JUN
2011
17
0 Comments
601 Hits
Getting First and Last Date of Months Using C#
Posted under: Tutorial

C# has a DateTime structure to hold date and time value in a single variable. The following script will gives you first and last date of given months in two lines of C# code. Assuming that the first and last dates we're looking for is for current month (now), the code would be like this:

DateTime FirstDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
DateTime LastDate = FirstDate.AddMonths(1).AddDays(-1);
Read More
MAY
2011
25
0 Comments
745 Hits
Adobe Reader 9.x axAcroPDFLib at closing problem C#
Posted under: Tutorial

If you code an C# .NET application using axAcroPDFLib to generate a PDF document, shows it to the user, and found error message on your application at application closing like this (instruction and memory address may vary):

The instruction at "0x0700609c" referenced memory at "0x00000014". The memory could not be read

It was caused by Adobe Reader 9.x axAcroPDFLib bug. The axAcroPDF control doesn't disposed properly during form closing event.

Read More
APR
2011
23
1 Comment
824 Hits
Google Weather API
Posted under: PHP

Google has a weather API which is very fast. It is able to show weather forecast of current condition and the following three days on many cities over the world. It is also able to show weather forecast based on longitude and latitude coordinate parameters. The returned forecast is in XML format. The API itself is undocumented by Google and may changed without notice. From many sources on the web, here's the URL of the Google weather API:

http://www.google.com/ig/api?weather=[cityname]
Read More
JUN
2010
15
0 Comments
483 Hits
Tutorial: MySQL Multiple Update Using Single SQL Query
Posted under: Tutorial
Tags: MySQL

Ever wanted to do some update on multiple rows with different value or on different condition in a single SQL query? Usually, this can be done by executing some queries in a row as needed. But with MySQL we can do it in a single SQL query. How come?

Read More
APR
2010
14
0 Comments
354 Hits
Easy "Spoiler" Show/Hide Element Using JavaScript
Posted under: Tutorial
Tags: Scripting

Sometimes we want to hide some content at first page load to reduce bandwidth transferred to the user. Usually when we just want to show the thumbnails of the image and then the original (big) sized image hidden next to it.

Read More
OCT
2009
29
1 Comment
401 Hits
Solving DownThemAll File Access Error on Windows 7
Posted under: Tutorial

Mozilla FirefoxIf you are using Mozilla Firefox browser on the latest of Microsoft Windows OS, Windows 7, you may encounter File Access Error while downloading files using DownThemAll plugin. I am using Mozilla Firefox v3.5.4 with DownThemAll v1.1.7.

Read More
JUN
2009
29
0 Comments
165 Hits
Greedy and Non-Greedy Matching using Perl Regular Expression
Posted under: Tutorial
Tags: Scripting

In this article I will show the difference between the default greedy (.+ and .*) and non-greedy matching using Perl-compatible regular expression.

For example, I have a string in a single line:

$line= "Seq[03] Command : CREATE("A") Seq[04] Command : CREATE("B") Seq[04] error: 5006 Seq[03] error: 5006 Seq[05] Command : DELETE("A") Seq[05] error: 5006 ";

I could capture all the Command without the error code using the following regular expression:

m/Seq\[[0-9]{2}\].+Command.+\(.+\)/gi
Read More
APR
2009
30
0 Comments
377 Hits
Binary String Conversion to Decimal and Hex Using C#
Posted under: Tutorial

microsoftnet-logoIf you need to convert Binary String to Decimal (Integer) and Hexadecimal, .NET Framework has conversion methods in Convert class to make numeric conversion easier. This class is located in Microsoft.VisualBasic library.

Read More
Next
Prev