Saturday, September 15, 2007

windows vista: access: local only

Ok, this is my first post of non programming issue but it still usefull for computers users.
Last week i got a new HP Laptop, with windows vista insite, it's cool looking, i was so happy with it untill i had the first problem, i couldn't surf the net.
well, i will not talk alot, because i guess some of you is reading here after a few days of searching.
well, what i had is like that:
i could connect to the network and see other computers but could not surf the net
that what you should do:
go to the network connection icon on the tray - > right click ->network and Sharing Center -> on the left press of the Manage network connection - > right click on the network that you want to log in to -> properties -> now you have some check boxes :
uncheck the Internet Protocol Version 6
stand on the Internet Protocol Version 4 and press properties :
check the Use the following IP Address :
and on the fields fill the following:
IP Address : [put an IP the is fine with your router]
Subnet mask : 255.255.255.0
Default gateway: the ip of your router

then check : use the following DNS server addresses
Prefered DNS server: the ip of your router.

press OK -> OK and restart your computer.

for me it worked..
thanks to the guys here: http://www.daniweb.com/forums/thread73818.html

Wednesday, July 04, 2007

sql query for getting your users email servers

this is a query that get you a list of the servers of the users emails that they registered with, for example if you have 100 people that has a hotmail account and 200 users with gmail you will get this table:
count server
-----------------
100 hotmail
200 gmail
...

here is the query:

select * from
(SELECT Count(users.UserID) AS Count, right(users.Useremail,len(users.Useremail)-instr(users.Useremail,'@')) as server
FROM users
where users.useremail <> ''
GROUP BY right(users.Useremail,len(users.Useremail)-instr(users.Useremail,'@')))
order by count

Monday, July 02, 2007

Selection.Find crash

you wrote an application that works with Word object?
the application crashes in the middle of the run, after the debug you find that it crashes on this line:
WordObj.Selection.Find

well, it's not your fault, it's a microsoft bug. now, how you resolve it??
it's a tricky way,
what you should do is late binding
u should dim your word object as an General object and create it manualy, not by "new word"
here is a usefull code:
...


Dim wrdDoc As Object ' setting the word object as a general object
Dim IsWordRunning As Boolean

IsWordRunning = ApplicationIsRunning("Word.Application")
If IsWordRunning = True Then ' do
Set wrdApp = GetObject(, "Word.Application")
Else
Set wrdApp = CreateObject("Word.Application")
End If
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Open(filename)


...


and here is the applicationisrunning function:

Function ApplicationIsRunning(ApplicationClassName As String) As Boolean
' returns True if the application is running
' example: If Not ApplicationIsRunning("Outlook.Application") Then Exit Sub
Dim AnyApp As Object
On Error Resume Next
Set AnyApp = GetObject(, ApplicationClassName)
ApplicationIsRunning = Not AnyApp Is Nothing
Set AnyApp = Nothing
On Error GoTo 0
End Function

Thursday, June 28, 2007

adding adsense to phpbb 3 forum

do you want to add adsense advertising to your forum.
i could add adsense to the top of my forum by adding the code in the overall_header.htm file, i added it at the end of the file.
the important thing is that when i added it to the file manulay and then uploaded the file it didn't work, i succeded only when i changed the file through the admin system.
same i did with the google analytics code, i added it to the same file, but after the header tag.
if someone could do that after the first post only please write it here.

Monday, June 25, 2007

Beta Version for arabic language Google Adsense

Lately the google adsense for content started to support arabic language websites, the www.arabsites.co.il website administrator said that his site is utf-8 incoded and two weeks ago he started to show ads in his site, more he said, the pay per click still low, it's about 1-2 centes per click, but i guess when the time pass, more advertisers will know about the service and they will pay beter for a click.
the first report was on the arabic seo forum www.seoarabia.com

Sunday, June 24, 2007

register a domain name - how to do it

if you want to build a website you need few thing for starting it successfully.
first, you should know if you site will be visited by a lot of visitors or few, that is a very important thing, because if you expect a high number of visitors, you should get a dedicated server , a standart hosting plan cant hold alot of traffic.
for good hosting plans i suggest to see what brinkster company offer, i work with them and i like it there.
they suggest you a free domain for each hosting plan, but i don't like that, i prefer to buy the domain name by my self, it's cheap (8.99$) and easy, i do that with godaddy, they have a great control panel that make it easy to manage my domains, and i have alot of them.
i already had on accident with a company that gave me a free domain, and after it expired the didn't renew that and i lost it with all my visitors. so watch out with that!
register a domain name:
so how to register a domain name? it's easy step but so important, i suggest you to register your domain in the main extensions like .com, .net , .info (it's cheap 1$ only) and .mobi (if you see that there is a use to your site with mobile)

how to choose your hosting plan
basicly you can choose a professional hosting plan, but if you think that a lot of users will be visiting you site you should change your choice, i got a basic host plan and i'm hosting many websites on it, i get 5000 visitors each day, i think it's the limit of this plan, so i think if you think you'll have more than this number of visitors daily, you should take a dedicated server.
if your websitet build with php/asp/.net/jsp
you should pay attention for that also, if you take a windows server so you should use asp/.net or you should check if the server support php, brinkster server support aslo php on their windows servers.


Thursday, May 03, 2007

Unrecognized attribute 'xmlns'.

this error actually means that the site is running old Framework version,
what you need to do is the following:
1.Open Internet Information Services and navigate to "Default Web Site" (or the site you're using as your default).
2.Right click the Site icon (the one with the globe).
3.Select the ASP.NET tab. You'll see a drop-down with the available versions (if you're getting the error, odds are, you'll see 1.1).
4.Select the proper build of ASP.NET 2.0 (or later, depends on the version you worked on in the developing stage).
5.Restart IIS.

Sunday, January 28, 2007

Change master web server in interdev Project

if you want to start using another web server for your asp projects which you created in interdev 6.0 then you need to change the master web that you set when you created the project.
to do that you should do those steps:
1. release your working copy:
right click on your project-> release working copy
2. on the upper toolbar (File Edit View...) choose Project -> Web Project -> Copy Web Application ... -> set the new server name and the directory you want to creat the project in, un check the Add to existing Web Project and the press OK.
3. now create a new project, in the 2nd stem, choose to use an existeing remote directory!

have a nice programming!

Tuesday, January 16, 2007

How to recognize google visit

do you want to know if this visit is a google visit??
here is a simple asp code to do that:
< % robot=request.ServerVariables("HTTP_USER_AGENT") if (Instr(robot,"Googlebot")<>0) then
...
end if
% >

and this is how to do it with php script

< ? define("SYSTEM_FROM_NAME","Your name"); define("SYSTEM_FROM_EMAIL","Your email"); //---this script will send email to webmaster when google visit your pages. if(isset($_SERVER['HTTP_USER_AGENT']) && eregi("googlebot",$_SERVER['HTTP_USER_AGENT'])) { if ($QUERY_STRING != "") { $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].'?'.$QUERY_STRING; } else { $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; } $today = date("F j, Y, g:i a"); $headers = "From: ".SYSTEM_FROM_NAME." <".SYSTEM_FROM_EMAIL.">";
$message="";
$message.="Googlebot is crawling your site:\n";
$message.="Page: $url\n";
$message.="Date: $today \n";
$message.="IP: ".$_SERVER['REMOTE_ADDR']." \n";
mail(SYSTEM_FROM_EMAIL, "googlebot crawle - $url", "$message",$headers);}
? >