Friday, September 17, 2010

using Regular Expressions in C# to find a phrase in a text and replace it with another

This is an example on how to find & replace a phrase in a string, the easy way in C# :

            
            using System.Text.RegularExpressions;
            ....
            if (Regex.IsMatch(content, searchText, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
            {
                display.Text += "Found match in " + filePath +" ***\n";
                content = Regex.Replace(content, searchText, replaceText);
            }

folderBrowserDialog, C#

Example on how to get a path to work on it later on from folderBrowserDialog in C#

          DialogResult result = folderBrowserDialog1.ShowDialog();
            if (result == DialogResult.OK)
            {
                thePath = folderBrowserDialog1.SelectedPath;
                pathLabel.Text = folderBrowserDialog1.SelectedPath;
            }

Find & Replace requested text in all files application

This small C#.Net application finds & replace the requested text with desired text in all files under one folder & sub-folders. This application was made according to needs of some changes at webpages at work.
The application is under development to be stable enough for release ...

Tuesday, September 14, 2010

HOWTO, uneditable text box in C#

If you want a uneditable text box, then ReadOnly properties on the text box should be set as True.

Wednesday, September 08, 2010

Different arrays in C#, Jagged vs. Multi dimensional

Jagged array :
bool[][] myBools = new bool[2][];


Multi dimentional array : 
double[,] myDoubles = new double[2, 2];


One of the differences between jagged arrays and a multi-dimension array is that a multi-dimension array will allocate memory for every element of each dimension, whereas a jagged array will only allocate memory for the size of each array in each dimension that you define. Most of the time, you'll be using multi-dimension arrays, if you need multiple dimensions, and will only use jagged arrays in very special circumstances when you are able to save significant memory by explicitly specifying the sizes of the arrays in each dimension.


Monday, July 19, 2010

Learn Python in 10 minutes !!! It is true :-)

Yes, it is true. I did teach me Python in 10 minutes. Although later I had to come back and search other pages for details but this page really gives you a quick kick-start. Enjoy :-)

http://www.korokithakis.net/tutorials/python

Tuesday, July 06, 2010

How to get Dell Photo 964 to work on Windows 7 64 bit

The R146813(click on the link to download)driver works on Windows 7 64 bit enterprise(Tested by me). Follow the following steps exactly, or it will not work. This is how I got the AIO 964 printer to work in Windows 7 from start to finish.

1. Open device manager and uninstall the printer making sure to tick the "Delete the driver software for the device" box.
2. Unplug the USB cord for the printer.
3. If you have previously tried installing the dell drivers using the setup.exe make sure to uninstall the printer drivers and supporting application. if not disregard this step.
4. Run the clean up patch (R166225.zip)
5. Reboot
6. Right click on the installer and go to the "Compatibility" tab. Check "Run this program in compatibility mode" and choose "Windows Vista" Finally check the "Run as Administrator" option. Click Apply and OK.

7. Install the R146813 drivers plugging in the printer when prompter by the installer.

Your 964 will be working on your Windows 7 64 bit :-)

Wednesday, June 23, 2010

posting from my android :-)

hehe it's cool to blog from HTC desire ...

Published with Blogger-droid v1.3.6

Sunday, June 13, 2010

Trash bin on Ubuntu Desktop

Run Terminal & write the following command to run the Configuration Editor :

  • $ sudo gconf-editor

Then go to apps/nautilus/desktop and select 'trash_icon_visible'.

Sunday, June 06, 2010

Take a snapshot of an area on your Desktop

This command ran in the terminal allows you to select an area on the desktop and have a snapshot of it ... very handy for making guides :-)

  • user@computer:~$ import test.png
After this you will have a file called test.png created on your desktop which contains a snapshot of selected area.

Chrome 5.0 ready for Linux

My tips about browsers for Linux, is Google Chrome. I love Firefox myself, but Chrome for Linux is perfect. While Firefox is pretty slow under Linux, Chrome is a fast reliable tools for your everyday surfing. This doesn't mean that you should throw away Firefox though, because Chrome still has its downsides. When it comes to running certificated Java applications on Internet banks still Chrome is not working properly :-(, but in everyother place, it works just perfect ...


Latest News : Chrome 5.0 is ready for Linux :
Source : About.com

The web browser Chrome, developed by Google, has finally been released as an official stable release for Linux. Google Chrome 5.0 for Linux is described by the developers as solid, high performance, and fully-featured.
Highlights of the latest version include HTML 5 functionality, such as geolocation programming interfaces, application caching, and drag-and-drop capability. Using Google accounts, you can now copy browser preferences to other machines, so you don't have to manually customize your Chrome browser on every computer you are using.

How is Chrome different from other browsers? The first item would be speed. Like the Google search engine, Chrome has been designed for speed. This shows for example in the start-up time, which is several times shorter than that of Firefox.

Another interesting feature is the "incognito" mode, which allows you to surf the Internet without the browser tracking where you are going or what you are doing. That is, it won't save your browsing history.

Chrome tries to integrate the Internet with your PC by making it easy to add short-cuts to web sites to your desktop. Not surprisingly, web search is tightly integrated as well, so that you can alternatively enter a URL or a search phrase in the address field on the "Omnibar".

However you are not limited to using Google as search engine. By typing another common search tool, such as Yahoo or Live Search in front of your search phrase you are engaging that web service instead.

Another one of Chrome's novel features is "tab isolation". This means, if the web page in one particular tab causes trouble or crashes, it does not affect the other tabs. Furthermore, you can monitor CPU and memory usage of each tab and kill it if its requirements get out of hand. You can access the Chrome task manager through the "page" menu to the right of the search/address field. From there you would go to Developer and select Task manager.

Changing your Desktop on your local linux computer to another directory


The default location of your Desktop folder is ~/Desktop. You might want to have it pointing to another location(online home directory forexample). Run the terminal and run the follwoing command :
gedit ~/.config/user-dirs.dirs
Find : XDG_DESKTOP_DIR. Change it to the right path that you like: 

XDG_DESKTOP_DIR="$HOME/Desktop" 
change it to :
XDG_DESKTOP_DIR="$HOME/Test/NewDesktop"


After changing it to the right address, again run the follwoing command in the terminal :
killall nautilus 
OR simply log off and log in again.

Change your desktop to your home directory

to change your simple default desktop to your homedir :
  1. open gconf-editor
  2. browse to /apps/nautilus/preferences entry in it
  3. set desktop_is_home_dir flag

Thursday, May 13, 2010

Virtual drive in Ubuntu

You do not need a virtual "drive". ISOs are supported directly by the Linux kernel itself. Google Search Result.

Monday, May 10, 2010

Create your own channel in IRC


You can easily become the operator of your own IRC channel. You can create your own channel by typing /join #channel-name where the channel name doesn't already exist on that network, as in:
/join funfunfun
When you create a channel, you are automatically made the operator of the channel. You can then invite friends across theInternet to join the channel, or wait and see if others join of their own accord.
When you create a channel, you should use the /topic command to specify a one sentence description of the channel's topic. This topic will be displayed to anybody executing a /list command, and may be your best chance to get people to investigate the channel.
/topic #quantum This channel is about einstein
If you need to sign off the channel, or wish to give up operator status, you can assign operator status to someone else with the/op command. You can make more than one person an operator if you want:
/op ivan
/op pierre
/op jane
The /mode command lets you designate a channel that you have created to be secret or private.
/mode #mychannel +s
/mode #mychannel +p
As an operator, you can kick people off.
/kick stupidperson
Source : http://www.livinginternet.com/r/ra_create.htm

Saturday, May 08, 2010

Black box vs. White box testing


Black box testing
  • takes an external perspective of the test object to derive test cases. These tests can be functional or non-functional, though usually functional. The test designer selects valid and invalid input and determines the correct output. There is no knowledge of the test object's internal structure.
White box testing
  • uses an internal perspective of the system to design test cases based on internal structure. It requires programming skills to identify all paths through the software. The tester chooses test case inputs to exercise paths through the code and determines the appropriate outputs. In electrical hardware testing, every node in a circuit may be probed and measured; an example is in-circuit testing (ICT).

Sunday, May 02, 2010

Getting your last session in Chrome

Under setting, choose "Options", then the "Basics" tab, and under "On startup:", you should see a choice "Restore the pages that were open last".