In software development, Subversion (SVN) is use to maintain current and historical versions of files such as source code, web pages, and documentation. Let say you need to work on a project that requires you to download the source code from the subversion. Here how it done...
Lost in the internet cloud? This blog is Azo's version of bread crumb trail, to help him recalls everything back so that he won't lost. And now this blog is a Swiss Army Knife of internet technology.
Showing posts with label how to. Show all posts
Showing posts with label how to. Show all posts
Wednesday, January 20, 2010
Thursday, May 21, 2009
How to restore Windows Vista Sidebar
Recently I created a gadget for Windows Vista Sidebar. It works as it suppose to but yesterday the sidebar refuse to start during start up or directly execute the application. Luckily this not the first encounter, apparently it's becoming popular issue among other unlucky Vista's user. I wonder if the problem will be passed on to Windows 7, 8, 9, 10...or forever. Some people wouldn't care if it works or not, I know because I would. but the thing is, I need to show the gadget it to my client. Anyway here is the solution...
Looking at the solution from Microsoft (KB963010), it is easy enough to solve this. They even provide the fix tool. But if you want to fix it manually, pop up the command prompt and run each of this command:
Regsvr32 atl.dll
Regsvr32 "%ProgramFiles%\Windows Sidebar\sbdrop.dll
Regsvr32 "%ProgramFiles%\Windows Sidebar\wlsrvc.dll
exit
It should fix the issue in no time.
Looking at the solution from Microsoft (KB963010), it is easy enough to solve this. They even provide the fix tool. But if you want to fix it manually, pop up the command prompt and run each of this command:
Regsvr32 atl.dll
Regsvr32 "%ProgramFiles%\Windows Sidebar\sbdrop.dll
Regsvr32 "%ProgramFiles%\Windows Sidebar\wlsrvc.dll
exit
It should fix the issue in no time.
Friday, February 20, 2009
Connecting Ubuntu 8.10 with Atheros Wireless Driver
This setting was a major nuisance to me. I search all over the net for a working solutions. From Madwifi to Ndiswrapper but still, nothing works on my Presario C700 unit. I even fully updated Intrepid release. Thanks for that, the system hit by kernel panic and I need to reinstall the whole OS again. But the working solution is just under my nose. Read on...
Well, not really my nose, it's documented in the Ubuntu help page, under the WifiDocsDriverAtheros topic.
My unit preference is Compaq Presario C700 with Atheros AR242x chip and Ubuntu 8.10 (fresh install). I connect to internet through ethernet cable (wireless is disable duh). If you have similar setup and I assume you know how to set your repository, this might work. This is how I done it:
Well, not really my nose, it's documented in the Ubuntu help page, under the WifiDocsDriverAtheros topic.
My unit preference is Compaq Presario C700 with Atheros AR242x chip and Ubuntu 8.10 (fresh install). I connect to internet through ethernet cable (wireless is disable duh). If you have similar setup and I assume you know how to set your repository, this might work. This is how I done it:
- Update only the essential part. Open the terminal and run this command.
sudo apt-get install build-essential - Deactivate the installed Atheros Driver. Since we're going to get the new one, disable the default driver which is auto-install during installation.
System > Administration > Hardware Drivers and click the "deactivate" button. - Run this command
sudo reboot - You now need to get the backport module. After the reboot, run this command
sudo apt-get install linux-backports-modules-intrepid-generic - Run this command
sudo reboot - For some other unit the wireless might be working now. But mine is not working yet. This may be the result of a conflict with either ath_hal or ath_pci, or ath5k might be blaclisted somewhere. So let isolate the ath_hal & ath_pci first. Run this command on the terminal:
sudo gedit /etc/modprobe.d/blacklist
and add the following lines to the bottom of the file:
blacklist ath_hal
blacklist ath_pci
save the blacklist file - Run this command
sudo reboot - By now my unit is able to detect wireless connection and manage to connect using WPA2 Personal pass key. But if your unit still doesn't, the last possible cause is the ath5k being blacklist somewhere, posibbly in modprobe.d. So run this command in terminal:
grep -r "ath5k" /etc/modprobe.d/
You just need to comment lines that have "blacklist ath5k" and then run this command:
sudo reboot
Labels:
AR242x,
Atheros,
how to,
Intrepid ibex,
Presario C700,
Ubuntu
Friday, February 06, 2009
Linux System Admin Tips

I'm not an avid Linux user but there is no harm learning some of tricks that only the experienced Linux admin would know. Check out this tips from Mike Chirico. It has 200 over of Linux tips and tricks. From setting and keeping the correct time on your computer, permanently deleting documents with shred, making files "immutable" so that root cannot change or delete, setting up more than one IP address on a single NIC, monitering users and processes, setting log rotate to monthly with 12 months of backups in compressed format, creating passwords for Apache using the htpasswd command, common Perl commands, using cfengine, adding users to groups, finding out which commands are aliased, query program text segment size and data segment size, trusted X11 forwarding, getting information on the hard drive including the current temperature, using Gnuplot, POVRAY and making animated GIFs, monitoring selective traffic with tcpdump and netstat, multiple examples using the find command, getting the most from Bash, plus a lot more.
Another article that I manage to digest from the same author is "Breaking Firewalls with OpenSSH and PuTTY". A very interesting reading material. The article shows you how remote Linux and Windows users can gain access to firewalled samba, mail, and http servers without monkeying the firewall. However the author said that those steps only applicable if you have a valid account on all targeted servers. In other words, to get a valid account is another art of hacking.
Monday, August 25, 2008
How to scan text directly into Microsoft Word using OCR
One day my boss asked me to get a soft copy of an annual report. He gave a 400 pages report book and he want it done by the end of the day. Luckily he just needed some portion of it but still the amount were a lot and can't possibly done in one afternoon. So I'm thought that it would be better if I can scan the text report directly using a scanner and grab the text and past it into a Microsoft Word document. And that was exactly what I did.
I'll show you how I done it. This method require a copy of Microsoft Office 2007 or later. What you need to do is to install the Microsoft Office Document Scanning tool. It is shipped with Microsoft Office as an optional tool However the tool is not install during the Microsoft Office normal installation.
Step 1: Go to Control Panel > Add or Remove Programs. Search for Microsoft Office 2007. Click change button. Choose add or remove feature on the next screen. Next you will get this pop-up

Step 2: Scroll down to the 'Office Tools' and expand it. Expand the 'Microsoft Office Document Imaging'. You will get the following options feature.
Select 'Run on your Computer'. That's it, you are done.
I'll show you how I done it. This method require a copy of Microsoft Office 2007 or later. What you need to do is to install the Microsoft Office Document Scanning tool. It is shipped with Microsoft Office as an optional tool However the tool is not install during the Microsoft Office normal installation.
Step 1: Go to Control Panel > Add or Remove Programs. Search for Microsoft Office 2007. Click change button. Choose add or remove feature on the next screen. Next you will get this pop-up

Step 2: Scroll down to the 'Office Tools' and expand it. Expand the 'Microsoft Office Document Imaging'. You will get the following options feature.
Select 'Run on your Computer'. That's it, you are done.
How To Change Blogger Favicon
What is Favicon?
Favicon (abbreviation of "favorites icon" and also known as a page icon), is an icon associated with a particular website or webpage that is displayed in the browser address bar next to a site's URL.
By default, Blogger inserted their own favicon. Do you know that you customize and install your very own favicon? Here's how...
Before we start, you will need an icon image with .ico extension. If you don't have any, there several tools that you can use to create one. But if you're totally clueless, you can create it using an online tool. Once generated, save it on your desktop and follow this step:
Step 1: You need to host the icon image somewhere by uploading the icon to your favorite image hosting. You can try Oogle Toogle or imageshack if you want. Copy the published url as your reference.
Step 2: Go to your Blogger Dashboard > Layout > Edit HTML.
There find the title tag which looks like this:-
<title><data:blog.pagetitle/></title>
and add the following code:
Change the URL-of-your-icon-file to your actual icon URL that you get from step 1.
Step 3: Save the template, refresh your blog and you are done.
Favicon (abbreviation of "favorites icon" and also known as a page icon), is an icon associated with a particular website or webpage that is displayed in the browser address bar next to a site's URL.
Before we start, you will need an icon image with .ico extension. If you don't have any, there several tools that you can use to create one. But if you're totally clueless, you can create it using an online tool. Once generated, save it on your desktop and follow this step:
Step 1: You need to host the icon image somewhere by uploading the icon to your favorite image hosting. You can try Oogle Toogle or imageshack if you want. Copy the published url as your reference.
Step 2: Go to your Blogger Dashboard > Layout > Edit HTML.
There find the title tag which looks like this:-
<title><data:blog.pagetitle/></title>
and add the following code:
Change the URL-of-your-icon-file to your actual icon URL that you get from step 1.
Step 3: Save the template, refresh your blog and you are done.
Labels:
favicon. blogger,
how to
Thursday, August 21, 2008
How To Post Code Snippets in Blogger Post
This issue haunting me for almost 2 years now (yup that long). I never properly research how it can be done before, not until last night. I have to enable this feature due to several factors where I need to post any sample snippet code directly to the blog post. However you need some tag into HMTL special character first.
As you notice (check for the blogger template tag), I start posting Blogger template for Blogger user. I did it because I want to channel out my art inspiration that clogging my mind. Anyway I thought maybe I could post the whole template (XML file) in the respective post. Later on I found that, Blogger just won't let you post some specific tag like <html> or <head> or <title> no matter what. So what is the point if it doesn't solve the issues? Read on...
Most people would say that using the <pre> would solve it. But I found a much better way to present your snippet code in your blog post. It is called SyntaxHighlighter. It quite easy to set up if you have your own domain as it requires some include files like css and javascript for coding syntax brushes where you can get it from the same website. No worries I'll show you how to deal with this. Read the step bellow:
1) Upload the SyntaxHighlighter files to your server.
2) Include the SyntaxHighlighter.css file at the top of your page, inside the head tag.
3) At the bottom of the page, just before the end body tag, include the brushes and other js files you will need, as well as the function call to stylize the <pre> tags:
4) Now you can start using it by placing your snippet code in between these two <pre> tags that the javascript will stylize
As you can see above, the result is much better.
Note:
You might find extra <br> tag in the posted code. This is due to the Blogger setting. By the dafault Blogger will automatically add <br> tag for each new line. There are to ways to fix this issue:
As you notice (check for the blogger template tag), I start posting Blogger template for Blogger user. I did it because I want to channel out my art inspiration that clogging my mind. Anyway I thought maybe I could post the whole template (XML file) in the respective post. Later on I found that, Blogger just won't let you post some specific tag like <html> or <head> or <title> no matter what. So what is the point if it doesn't solve the issues? Read on...
Most people would say that using the <pre> would solve it. But I found a much better way to present your snippet code in your blog post. It is called SyntaxHighlighter. It quite easy to set up if you have your own domain as it requires some include files like css and javascript for coding syntax brushes where you can get it from the same website. No worries I'll show you how to deal with this. Read the step bellow:
1) Upload the SyntaxHighlighter files to your server.
2) Include the SyntaxHighlighter.css file at the top of your page, inside the head tag.
<link type="text/css" rel="stylesheet" href="SyntaxHighlighter.css">
3) At the bottom of the page, just before the end body tag, include the brushes and other js files you will need, as well as the function call to stylize the <pre> tags:
<script language="javascript" src="shCore.js"></script>
<script language="javascript" src="shBrushCSharp.js"></script>
<script language="javascript" src="shBrushXml.js"></script>
<script language="javascript" src="shBrushPython.js"></script>
<script language="javascript">
dp.SyntaxHighlighter.ClipboardSwf = 'clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script>
4) Now you can start using it by placing your snippet code in between these two <pre> tags that the javascript will stylize
<pre name="code" class="html"> <!-- code here --> </pre> <pre name="code" class="python"> # code here </pre>
As you can see above, the result is much better.
Note:
You might find extra <br> tag in the posted code. This is due to the Blogger setting. By the dafault Blogger will automatically add <br> tag for each new line. There are to ways to fix this issue:
- You can disable this Blogger feature at Settings > Formatting > and set the Convert line breaks to 'No'. However from here onward, each of your blog posting will be one liner. Yup, no matter how many new line you made, your blog entry output will be in one line.
- Another method is to fix the SyntaxHighlighter by adding this specific script. Go to this line (at the step 3 above)
<script language="javascript"> dp.SyntaxHighlighter.ClipboardSwf = 'clipboard.swf'; dp.SyntaxHighlighter.HighlightAll('code'); </script>
Well ditch that that part and add this one.
Thanks to Hongjun for that fix.
Labels:
how to,
SyntaxHighlighter
Wednesday, November 07, 2007
How to Recover Your Deleted Files
Have you ever face this kind of situation? You have deleted a few files to free up some space in your hard disk, empty the recycle bin but suddenly you realized that you accidentally deleted a wrong file. Now how do you get it back? Don't panic, clear up your mind and start looking for options.
There are many data recovery software out there, how do you know which one is the best. Well, if you don't try it all you wouldn't know. And each software has different features to apply on different kind of situations. Anyway, I have found a good freeware solution for recovering deleted files:
http://officerecovery.com/freeundelete/
I always look for a free stuff first before looking for the commercial or pro software. Freeundelete does the job pretty well. You can choose which drive you want to scan. It will show you a list of all deleted file on that particular drive. Select any file from the list and choose where you want to save the recovered file. It will advice you to save it on different drive to avoid further damage on the data. That's it.
Free software always has limited functionality. If you want to perform harder task such as recovering data after hard drive has being formatted, you might need software such as EasyRecovery Pro which will cost you about $500 (price depend on several variants). It is a good practice to download a trial version before deciding to buy any software tagged with that price.
Despite all this, there is no guarantee that you will get back all your data intact. Based on my experience, the success rate of data recovery depends how severe the damage done on your hard disk. So, best of luck.
There are many data recovery software out there, how do you know which one is the best. Well, if you don't try it all you wouldn't know. And each software has different features to apply on different kind of situations. Anyway, I have found a good freeware solution for recovering deleted files:
http://officerecovery.com/freeundelete/
I always look for a free stuff first before looking for the commercial or pro software. Freeundelete does the job pretty well. You can choose which drive you want to scan. It will show you a list of all deleted file on that particular drive. Select any file from the list and choose where you want to save the recovered file. It will advice you to save it on different drive to avoid further damage on the data. That's it.
Free software always has limited functionality. If you want to perform harder task such as recovering data after hard drive has being formatted, you might need software such as EasyRecovery Pro which will cost you about $500 (price depend on several variants). It is a good practice to download a trial version before deciding to buy any software tagged with that price.
Despite all this, there is no guarantee that you will get back all your data intact. Based on my experience, the success rate of data recovery depends how severe the damage done on your hard disk. So, best of luck.
Labels:
data recovery,
how to
Saturday, November 03, 2007
Configuring D-Link 3G Mobile Wireless Routers
The startup configuration is properly documented in CD and the user manual. You can change the administrator password or the user name, monitor the status and much more. The only problem that I encountered is the information for my Celcom 3G broadband ISP setting. Without this information, I can't get into the internet. So here is the solution:
Before I start, D-Link 3G router has specific ISP card driver option to choose from:
Go to manual internet connection options and click "Manual Configure". You will see the following form.
At first I thought I just need to select my 3G ISP name (Celcom). So I tried both UMTS - Celcom - Option GT 3G Quad and HSDPA - Celcom - Huawei E600 / E620 but no connection detected. So I look back at the box and I noticed that the actual name is Novotell Wireless Merlin U530. So I choose UMTS - Taiwan Mobile - Novatel Mireless Merlin U530 on ISP - Card option. You can leave the rest of the form blank except:
- Dial Number : *99***1#
- APN : internet
- Keep-alive Interval : (your choice mine is 60 seconds)
Save the configuration and click to Status menu. You will find that your WAN is now connected. The internet is now ready, try it.
Before I start, D-Link 3G router has specific ISP card driver option to choose from:
- UMTS - Far Eastern Telecom - Option GT 3G Quad
- UMTS - O2 - Option GT 3G Quad
- UMTS - Vibo Telecom - ZTE MF320
- UMTS - Orangenet - Option Wireless GT Quad
- UMTS - Vodafone - Option Wireless GT Quad
- UMTS - Taiwan Mobile - Novatel Mireless (Wireless) Merlin U530
- UMTS - Chunghwa Telecom - Huawei E612
- UMTS - Telkomsel - Option GT 3G Quad
- UMTS - Exelcom - Option GT 3G Quad
- UMTS - Celcom - Option GT 3G Quad
- UMTS - Maxis - Option GT 3G
- HSDPA - Cingular - Sierra Wireless AirCard 860
- HSDPA - Cingular - Novatel Wireless Merlin U730
- HSDPA - Cingular - Sierra Wireless AirCard 875
- HSDPA - Italy - Sierra Wireless AirCard 865
- HSDPA - Optimus - Novatel Wireless Merlin U740
- HSDPA - T-Mobile - Option GT 3G+ / Fusion+
- HSDPA - Exelcom - Huawei E600 / E620
- HSDPA - Exelcom - Huawei E220 (USB)
- HSDPA - Exelcom - Option GT Max
- HSDPA - Maxis - Huawei E620
- HSDPA - Maxis - Motorola Phone RAZRV3xx (USB)
- HSDPA - Singtel - Huawei E620
- HSDPA - Singtel - Sierra Wireless AirCard 850
- HSDPA - Singtel - Option GT Fusion+ EMEA
- HSDPA - M1 - Vodafone GT MAX GX0201
- HSDPA - M1 - Vodafone Huawei E620
- HSDPA - M1 - Vodafone Huawei E220 (USB)
- HSDPA - Celcom - Huawei E600 / E620
- HSDPA - Celcom - Huawei E220 (USB)
- HSDPA - Globe - Vodafone Huawei E620
- HSDPA - Globe - Vodafone Huawei E220 (USB)
- HSDPA - PowerGrid - Huawei E620
- HSDPA - Vodacom - Huawei E220
- HSDPA - Vodacom - Huawei E620
- HSDPA - MTN - Huawei E220
- HSDPA - MTN - Huawei E620
- HSDPA - Taiwan - Option GT 7.2 Ready
- HSDPA - Taiwan - BandLuxe C100
- HSDPA - Hong Kong - Novatel Wireless Merlin XU870
- HSDPA - Hong Kong - Huawei E220(USB)
- HSDPA - Hong Kong - Option GT 3G+
- HSDPA - Hong Kong - Option GT MAX
- HSDPA - Egypt - E220 etisalat USB
Go to manual internet connection options and click "Manual Configure". You will see the following form.
At first I thought I just need to select my 3G ISP name (Celcom). So I tried both UMTS - Celcom - Option GT 3G Quad and HSDPA - Celcom - Huawei E600 / E620 but no connection detected. So I look back at the box and I noticed that the actual name is Novotell Wireless Merlin U530. So I choose UMTS - Taiwan Mobile - Novatel Mireless Merlin U530 on ISP - Card option. You can leave the rest of the form blank except:- Dial Number : *99***1#
- APN : internet
- Keep-alive Interval : (your choice mine is 60 seconds)
Save the configuration and click to Status menu. You will find that your WAN is now connected. The internet is now ready, try it.
Tuesday, October 16, 2007
Seting Up a Virtual Private Network (VPN) with Windows
I always wanted to try this out but always forgot. OK, here's the catch, imagine you're out from your office and suddenly forgot to get a file from your PC. You can either get your ass back to the office or you can try the VPN connection. Here is how:
You must:
Set up one computer to share files (server).
Set up another computer to access them (client).
Begin by setting up the server:
Now proceed to connect the client:
You must:
Set up one computer to share files (server).
Set up another computer to access them (client).
Begin by setting up the server:
- Open Internet Explorer and go to www.whatismyip.com. Write down the IP address. You will need it to configure the client.
- Click the Start button and click Run. Type control and hit Enter. Or you can open the Control Panel from Windows Start button
- Click Network and Internet Connections.
- Click Network Connections.
- Click Create a New Connection, which is the first option on the left toolbar.
- The New Connection Wizard will open. Click Next.
- Choose Set up an advanced connection, the last element on the list. Click Next.
- Choose Accept incoming connections. Click Next.
- You will see the Devices for Incoming Connections screen. Do not select anything on this screen. Click Next.
- Select Allow virtual private connections. Click Next.
- Select to whom you want to give access. Click Next. If a user is not listed, you will have to add an account.
- Do not change anything on the Networking Software screen. Click Next.
- That’s it! Your computer is now set up to allow for VPNs. Click Finish to complete the wizard.
Now proceed to connect the client:
- Click the Start button and click Run. Type control and hit Enter. Or you can open the Control Panel from Windows Start button
- Click Network and Internet Connections.
- Click Network Connections.
- Click Create a New Connection, which is the first option on the left toolbar.
- The New Connection Wizard will open. Click Next.
- Select Connect to the network at my workplace and click Next.
- Select Virtual Private Network connection and click Next.
- Type the name of your network in the blank box. Click Next.
- Enter the IP address you wrote down earlier and click Next.
- Select Add a shortcut to this connection to my desktop and click Finish.
- If the VPN doesn’t work, turn off your firewall.
- And don't give access to the “guest” account. It does not require a password, allowing anyone to access the VPN.
Labels:
how to,
How-to,
VPN,
Windows XP
Monday, September 17, 2007
Configuring PHP 5.2.3 To Work With MySQL 5.0 in IIS 5/6 Environment
By assuming the installation for PHP 5.2.3 and MySQL 5.0 were complete (normal/default installation), the following are the necessary steps to make the PHP and MySQL talk to eah other.
Step 1: In the C:\PHP folder copy the file "libmysql.dll" to your C:\WINDOWS\SYSTEM32 folder. Make sure you don't overwrite any existing file in this folder. If file exists, first rename it so you can go back.
Step 2: In the C:\PHP folder copy the file "php.ini-recommended" to your C:\WINDOWS folder. Rename this file to "php.ini"
Step 3: Edit this file "php.ini" using a text editor like notepad. Find the line where it says "extension_dir = *something*". Uncomment this line by removing the preceding semi-colon. and set it to say: extension_dir="c:\php\ext". But you need to comment the line where it says doc_root. Otherwise an error that says "No input file specified" will appear if you test any php script. (Php only interprets phpfiles that are located in or below the doc_root directory)
Step 4: In the same file "php.ini" also un-comment out 2 other lines by removing semi-colon. Find the lines where it says: extension=php_mysql.dll and extension=php_mysqli.dll and uncomment both lines by removing the semi-colon.
Step 5: Reboot the computer
And you are done.
Step 1: In the C:\PHP folder copy the file "libmysql.dll" to your C:\WINDOWS\SYSTEM32 folder. Make sure you don't overwrite any existing file in this folder. If file exists, first rename it so you can go back.
Step 2: In the C:\PHP folder copy the file "php.ini-recommended" to your C:\WINDOWS folder. Rename this file to "php.ini"
Step 3: Edit this file "php.ini" using a text editor like notepad. Find the line where it says "extension_dir = *something*". Uncomment this line by removing the preceding semi-colon. and set it to say: extension_dir="c:\php\ext". But you need to comment the line where it says doc_root. Otherwise an error that says "No input file specified" will appear if you test any php script. (Php only interprets phpfiles that are located in or below the doc_root directory)
Step 4: In the same file "php.ini" also un-comment out 2 other lines by removing semi-colon. Find the lines where it says: extension=php_mysql.dll and extension=php_mysqli.dll and uncomment both lines by removing the semi-colon.
Step 5: Reboot the computer
And you are done.
Friday, July 20, 2007
How to set a global variable in ASP .NET
If you are new to ASP .NET like myself and you need to carry a variable from one page to another, you have a few options. The method best suited for you depends on the way the data will be used.
The first option is to use session variables. Session variables allow you to keep the information hidden from the user by storing the data in server memory or in an SQL Database (see web.config).
To store the value type:
This variable will be available to you as long as a user’s session exists. When their session expires, asp.net will release the data from memory.
You can also accomplish the same task by carrying the value in the URL. This is generally not recommended for user information as it can be seen by the user and easily hacked. However it is recommended in cases where you want a user to be able to link to a specific instance of your asp.net page (i.e. having an articleID on a generic page to display articles).
The first option is to use session variables. Session variables allow you to keep the information hidden from the user by storing the data in server memory or in an SQL Database (see web.config).
To store the value type:
Session("FirstName") = "Azo"And to retrieve the value, type:
Dim firstname As String = CStr(Session("firstName"))
This variable will be available to you as long as a user’s session exists. When their session expires, asp.net will release the data from memory.
You can also accomplish the same task by carrying the value in the URL. This is generally not recommended for user information as it can be seen by the user and easily hacked. However it is recommended in cases where you want a user to be able to link to a specific instance of your asp.net page (i.e. having an articleID on a generic page to display articles).
Dim articleid As Integer = CInt(Request.QueryString("articleid"))If you only need to retain a variable when posting a page back to itself, you should use the viewstate. It works similarly to a hidden input field in html by placing the value in html code that is not displayed. However, items in the viewstate are encoded so that they cannot be easily deciphered by users. Syntax is similar to sessions, to place in viewstate:
viewstate("FirstName") = "Azo"To get from viewstate:
Dim fname As String = CStr(viewstate("FirstName"))If you would like to have a global variable that is static, for example, an sql connection string, I recommend creating a class, and creating the value as a public property of that class. This way you can return your values as a specific data type to enforce better programming.
Public Class GlobalsIf you need a dynamic variable that spans across individual user sessions (ie keeping a count of active users on your site), you must store the variable in the application object.
Public ReadOnly Property connstring() As String
Get
Return "server=WebSqlServer; database=Authors; uid=sa; pwd=abcdefg;"
End Get
End Property
End Class
Application("usercount") = CInt(Application("usercount")) + 1
Monday, May 21, 2007
Restoring MS SQL Database From .mdf File
Imagine this scenario, you are planning to reformat your SQL server which has 50 databases and all data and log files stored in SAN system. What is the faster way to restore all the databases once you had finish installed the OS and SQL server? I used to backup one by one using the backup and restore database tool. But recently I found a faster way which could save lot of time.
The method is simple enough that I feel stupid not to know this. All you have to do is attach the .mdf file to the SQL Server. How? Open the SQL Server Enterprise Manager, open the tree (Console Root > Microsoft SQL Servers > SQL Server Group > (Your SQL Server) > Database) right-click on the database and select All Tasks > Attach Database. And then, just select the .mdf file, click OK and you are done. The process is almost instantaneous. So for 50 databases you could finish it less than 2 minutes.

If you're not sure what I'm talking about, you could always start with the default database ship with SQL Server. Right cilck on the Northwind database and select All Task > Detach Database
. After that follow the step above.
Good luck.
The method is simple enough that I feel stupid not to know this. All you have to do is attach the .mdf file to the SQL Server. How? Open the SQL Server Enterprise Manager, open the tree (Console Root > Microsoft SQL Servers > SQL Server Group > (Your SQL Server) > Database) right-click on the database and select All Tasks > Attach Database. And then, just select the .mdf file, click OK and you are done. The process is almost instantaneous. So for 50 databases you could finish it less than 2 minutes.

If you're not sure what I'm talking about, you could always start with the default database ship with SQL Server. Right cilck on the Northwind database and select All Task > Detach Database
. After that follow the step above.
Good luck.
Labels:
how to,
MDF,
MSSQL 2000,
MSSQL 2005,
restore
Thursday, May 03, 2007
Establish Database Connection with Perl
It's been a while since I use Perl to connect to a database and my memory about it has faded long ago. But now since I'm no longer purely involve in web development so I thought this method could be useful. Let see how it goes.
To cut the chase, here is the sample code
DBI is Perl's DataBase Interface. There are many different databases: Oracle, mSQL, MySQL, Ingres... even files containing data separated by columns could be considered databases. DBI works with practically all of them. DBI requires a database driver module to talk to the database. The driver module handles all of the details about connecting to and communicating with the database. DBI sits on top of the driver; its job is to make reading from (and writing to) all databases as similar as possible. That way, if your project grows from something that could be handled with mSQL to something needing Oracle, you can make that change without altering the code very much.
Database driver modules are Perl modules like any other, and often they contain documentation. They are all inside the root package DBD. So, to get information on an Oracle driver you've installed, you can type:
Other than installing the module, and possibly reading the documentation, you rarely need to deal directly with the database driver module. DBI handles all of that.
To cut the chase, here is the sample code
use strict;
use DBI;
# Connect to the database
# See footnote 1
my $dbh = DBI->connect('DBI:mysql:my_database', 'my_username', 'my_password')
or die "Couldn't open database: $DBI::errstr; stopped";
# Prepare the SQL query for execution
my $sth = $dbh->prepare(<execute() or die "Couldn't execute statement: $DBI::errstr; stopped";
# Fetch each row and print it
while ( my ($field1, $field2, $field3) = $sth->fetchrow_array() ) {
print STDOUT "Field 1: $field1 Field 2: $field2 Field 3: $field3\n";
}
# Disconnect from the database
$dbh->disconnect();
DBI is Perl's DataBase Interface. There are many different databases: Oracle, mSQL, MySQL, Ingres... even files containing data separated by columns could be considered databases. DBI works with practically all of them. DBI requires a database driver module to talk to the database. The driver module handles all of the details about connecting to and communicating with the database. DBI sits on top of the driver; its job is to make reading from (and writing to) all databases as similar as possible. That way, if your project grows from something that could be handled with mSQL to something needing Oracle, you can make that change without altering the code very much.
Database driver modules are Perl modules like any other, and often they contain documentation. They are all inside the root package DBD. So, to get information on an Oracle driver you've installed, you can type:
perldoc DBD::Oracle
Other than installing the module, and possibly reading the documentation, you rarely need to deal directly with the database driver module. DBI handles all of that.
Saturday, February 10, 2007
How To Save YouTube Video

YouTube.com is great place to share your video online. However if you want to safe any video into your PC, YouTube don't have a direct access for this purpose. At least not for now. But there is always solution for every single problem and saving YouTube videos is not a problem anymore. Of course we need helps from others and that is why YouTubeX.com comes into the picture.
Now what you have to do:
- Browse for the videos at YouTube.com
- Copy and Paste the URL of the YouTube video into the form above.
- Click "DOWNLOAD" to save the YouTube file to your PC.
- Rename the YouTube file with a .flv extension if necessary
To playback the .FLV video, you'll need a FLV Player. You can get a FREE one here. Done.
You can now play the YouTube videos as many time you want without the need to connect to your ISP.
Update: The you TubeX.com is dead. I will show you a new way of saving the YouTube video.
Labels:
FLV Player,
how to,
YouTube
Subscribe to:
Posts (Atom)
