Jul 27 2008

Links for Sunday #3

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Jul 22 2008

10 portable apps for code geeks

Being code geeks we should learn to code and debug in any PC and of course any situation. Here are 10 portable applications that you can carry around on your pen drive.

  1. XAMPP : XAMPP is an integrated server package of Apache, mySQL, PHP and phpMyAdmin (the AMPP in XAMPP) that all run from a removable drive. Everything is pre-configured and ready to go just by unzipping or installing it.
  2. portDev-Cpp : This will allow you to program in C/C++ anywhere you want.
  3. PSPad : The universal freeware editor is for you if you need to: •work with plain text - the editor has a wealth of formatting functions, including a spell checker •create web pages - as web authoring editor, PSPad contains many unique tools to save your time •use a good IDE for your compiler - editor PSPad catch and parse compiler output, integrate external help files, compare versions, and much more…
  4. MDB2XML : This utility converts a MS Access database (MDB) to an XML document. Simple enter the name of the MDB file, give the name of the output file and press Convert. The total number of converted records is displayed in the results list control. MDB2XML makes is build using the classes CXmlDocument and CXmlElement which are explained in the Classes section of this website.
  5. Javadoc : Javadoc Creator is an easy to use utility to create Javadocs for your projects. It is the perfect shell for JDK’s “javadoc” utility. You’ll never need to memorize the command line parameters again! Apart from counting classes, packages and lines of code for statistical reasons, it creates useful batch files (*.bat) that launch JDK’s “javadoc” tool to create a Javadoc web-site.
  6. HFS File Server : HFS (HTTP File Server) is a great tool for sharing files. Once the server is up and running, the administrator simply adds files to be shared via drag and drop. Users wishing to download the shared files go to the specified IP address/domain where HFS is hosted via their favorite web browser. They will then be presented with a nice web page that lists all the available files that can be downloaded.
  7. Bean Maker : Bean Maker is an innovative and fully customizable source code generator, designed to help boost programmers’ productivity. It can generate any kind of files (*.java, *.xml, *.tld) using simple text templates enhanced with with special tags. Bean Maker works for any kind of computer language, although it was designed originally for Java and J2EE programmers. Whether you are looking for consistency across development teams, simplification of repetitive tasks or just error free code generation Bean Maker is the tool for you. Ease of use and innovative template-tags make this utility an essential tool for every developer.
  8. i.FTP Client : As the name suggests, this is a portable FTP client.
  9. DiffDaff : DiffDaff is a free utility that enables a direct comparison between two files, folders, or web sites and shows the differences line by line. The variations are classified as changes, deleted, non-existing, and identical content. The variations are also color marked. The DiffDaff tool enables parallel scrolling through the results, line numeration, and many other features that facilitate the work and simplify locating the differences.
  10. HexEditor : Ability to perform BIT Modification on a BYTE. HEX Searching, TEXT Searching, UNICODE TEXT Searching. Also Case Insensitive Searching for Standard TEXT and Unicode Text. Inserting, Overwriting, Pasting, Copying, etc… All Supported. Variable colored interface shows Brighter colors for higher valued data. Just mouse over any byte to show info about it.

Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Digg It!
    www.sajithmr.com

Jul 20 2008

Links for Sunday #2

Jul 17 2008

extract/get email address from string using vb.net

Here is a simple VB.Net code to extract email addresses from a string

Imports System.Text.RegularExpressions
 
Public Class Form1
 
    Private Sub btnExtract_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExtract.Click
 
        Dim textstring As Array
        Dim strEmail As String
        Dim strEmailChars As String
        Dim StrOutPut As String = ""
 
        strEmail = txtMailContent.Text
        StrOutPut = txtResult.Text
        strEmailChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_@."
        For cnt As Long = 0 To strEmail.Length - 1  'Loop throug each charecters in the content
 
            'Check whether the charecter is anything other than valid email charecters (Charecters in the strins "strEmailChars")
            If strEmailChars.Contains(strEmail(cnt)) = False Then
                strEmail = strEmail.Replace(strEmail(cnt), " ") 'Replace that String with space
            End If
        Next
 
        textstring = Split(strEmail) ' no delimeter means use space
 
        Dim emailpattern As String = "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
 
        Dim i As Integer
        Dim r As New Regex(emailpattern, RegexOptions.IgnoreCase + RegexOptions.Multiline)
 
        For i = 0 To textstring.GetLength(0) - 1
            Dim m As Match = r.Match(textstring(i))
 
            While m.Success
                If StrOutPut.Contains(m.ToString) = False Then
                    If StrOutPut.Length > 0 Then    'Put a comma before appending new email address if the
                        '                            taken email id is not the first one
                        StrOutPut = StrOutPut & ", "
                    End If
                    StrOutPut = StrOutPut & m.ToString()
                    lblCount.Text = lblCount.Text + 1
                End If
                m = m.NextMatch()
            End While
        Next i
        StrOutPut = StrOutPut.Remove(StrOutPut.LastIndexOf(",") + 1, 0)
 
        txtResult.Text = StrOutPut
 
        MsgBox("Completed")
 
    End Sub
 
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        lblCount.Text = 0
    End Sub
End Class

Now here is a detailed explanation.
Create a VB.Net 2005 application. Design a form with two text boxes (txtMailContent, txtResult), a label box (lblCount) and a button (btnExtract). Take the code window of the form and delete all the content and paste the above mentioned code.

Declare variables

Imports System.Text.RegularExpressions
‘Import name space for regular expressions.
Dim textstring As Array
Dim strEmail As String
Dim strEmailChars As String
Dim StrOutPut As String = ""

Assign string to extract to the variable strEmail and assign the current result to StrOutPut. This code will extract unique email address from the supplied string.

strEmail = txtMailContent.Text
StrOutPut = txtResult.Text

Assign legal characters to a string.

strEmailChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_@."

The below loop will replace all illegal characters with an “Space”

For cnt As Long = 0 To strEmail.Length - 1  'Loop throug each charecters in the content
 
'Check whether the charecter is anything other than valid email charecters
'(Charecters in the strins "strEmailChars")
If strEmailChars.Contains(strEmail(cnt)) = False Then
strEmail = strEmail.Replace(strEmail(cnt), " ") 'Replace that String with space
End If
Next

Split each word and store it in an array.

textstring = Split(strEmail) ' no delimeter means use space

The belowloop will extract each word in the array and check if that is a valid email. If that is a valid email then it will check whether its a duplicate. If not then it will add that email address to result. The label lblCount will display the total number of emails extracted.

Dim emailpattern As String = "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
Dim r As New Regex(emailpattern, RegexOptions.IgnoreCase + RegexOptions.Multiline)
For i = 0 To textstring.GetLength(0) - 1
Dim m As Match = r.Match(textstring(i))
 
While m.Success
If StrOutPut.Contains(m.ToString) = False Then
If StrOutPut.Length > 0 Then    'Put a comma before appending new email address if the
'                            taken email id is not the first one
StrOutPut = StrOutPut & ", "
End If
 
StrOutPut = StrOutPut & m.ToString()
lblCount.Text = lblCount.Text + 1
End If
m = m.NextMatch()
End While
Next i
StrOutPut = StrOutPut.Remove(StrOutPut.LastIndexOf(",") + 1, 0)
txtResult.Text = StrOutPut

Now Display the result in to the text box txtResult. :)

Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Digg It!
    www.sajithmr.com

Jul 14 2008

Text editors for code geeks

What is the fun in being a geek if what you do can be easily understood by others. As geeks we should always do things complicated :-)

Here are few free text editors which are good for writing codes.

  1. Intype : Intype is a really good lightweight text editor for Windows. The interface of Intype is just like the one for TextMate for OS X so it works really well and keeps things simple, easy and tidy. Intype has been around since its first alpha release back in January 2007 and is now on alpha version 3. Read more here.
  2. Notepad++ : Notepad++ is a very popular open source text editor for Windows that a lot of programmers use because of the functionality that it has. Notepad++ was first released in November 2003 and as of writing this article is at version 5.0. Read more
  3. ConTEXT : The languages that ConTEXT supports for syntax highlighting are C, C++, CSS, ConTEXT Highlighter, ConTEXT Language Files, Fortran, Foxpro, HTML, Inno Setup Script, Java, JavaScript, Object Pascal, Perl, PHP, Python, SQL, Tcl/Tk, Visual Basic, x86 Assembler and XML. If you don’t like the syntax highlighting that ConTEXT uses then you can always edit it under Options->Environment Options->Colors. You can also download more highlighters from their website. Read more

I am sure I have missed some good text editors. If you know anything else why dont you share with with other geeks?

Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Digg It!
    www.sajithmr.com

Jul 12 2008

6 html and javascript codes to crash IE6

My friend Jean at catswhocode wrote a post about 6 html and javascript codes that crash IE6. Check out the codes here. Let me search for my IE shortcut and tryout some of those codes.

Have some happy crashes!

Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Digg It!
    www.sajithmr.com

Jul 11 2008

curl - URL shortener sourcode

There is no need for an introduction about URL shorteners as everyone knows about it. TinyURL is one of the most popular url shorteners. If you think tinyUrl is the shortest one? you are wrong :-)

I wrote a simple URL shortener in PHP some time back and it can be accessed using the url http://curlit.in

If you are interested in knowing how it works you can download the code here.

Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Digg It!
    www.sajithmr.com

Jul 3 2008

A bit about me and this blog

Hello World

Welcome! I am Shoban. I am a 22 year old computer techie currently residing in Trivandrum, India. I work as as a software engineer for an MNC in Technopark. I also blog at www.crankup.net

So why codegeeks? In one of niftygeekspeak’s post she says

The definition of geek from Meriam-Webster’s Collegiate Dictionary, 11th edition.

Geek 1 : a carnival performer often billed as a wild man whose act usu. includes biting the head off a live chicken or snake

2 : a person often of an intellectual bent who is disliked

3 : an enthusiast or expert esp. in a technological field or activity

Okay. I don’t recall ever biting the head off of a live chicken.

Even I don’t recall ever biting the head of a live chicken or snake. But I remember spending hours in front the computer writing code. This blog is dedicated to all code geeks out there who, as you know, rule the world:-)

I will be back with my second post soon till then here are some of the sites where you can spend your time

Blogs and forums where you can find me.

  1. www.crankup.net
  2. www.mytechnopark.com
  3. www.indianitforum.com
  4. www.mobspice.com

Some of the sites which I found interesting.

  1. www.geeksaresexy.net
  2. www.howtogeek.com
  3. www.dailycupoftech.com
  4. www.sajithmr.com
  5. www.iamatechie.com
  6. www.codinghorror.com

Happy coding!!!

Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Digg It!
    www.sajithmr.com