Skip to main content

Posts

Free Links Checker Tool

Whatever you are developing I'll recommend to run this tool agains your site. It's free, fast and doing exactly what I expected from tool that should look for broken links. The description of the tool is saying " Xenu's Link Sleuth (TM) checks Web sites for broken links."

Credit Card Validation in JavaScript

Using simple algorithm the credit card number can be validated. Each credit card type has his own rules for numbers to start from and for lengh of the number. IssuerIdentifier Card Number Length Diner's Club/Carte Blanche 300xxx-305xxx,36xxxx, 38xxxx 14 American Express 34xxxx, 37xxxx 15 VISA 4xxxxx 13, 16 MasterCard 51xxxx-55xxxx 16 Discover 6011xx 16 Following article explains in details what means digits in credit card numbers. More full example with source code can be found here .

Manage Custom Fields in the Database

There a lot of debates about how to store custom fields in database. Here is some interesting links that help me to get decision (in my case is EVA solution :-)) Storing Custom Fields in the Database (see also comments) - http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/ Thread from forum - http://osdir.com/ml/bug-tracking.bugzilla.devel/2005-01/msg00191.html Guide to the EAV (FAD) - http://weblogs.sqlteam.com/davidm/articles/12117.aspx http://en.wikipedia.org/wiki/Entity-Attribute-Value_model The circumstances where you would need to go beyond standard row-modeling to EAV are listed below: The data types of individual attributes varies (as seen with clinical findings). The categories of data are numerous, growing or fluctuating, but the number of instances (records/rows) within each category is very small. Here, with conventional modeling, the database’s Entity-Relationship Diagram might have...

Asynchronous pages in C# - When to Use It?

When do we need asynchronous page in ASP.net. Suppose you have a website with two web pages. One is your home page which display's a greeting, and the second page displays a large dataset from a database. You have 25 threads in your thread pool. 25 people simultaneously are accessing the database query page, and one additional person comes onto the site to see the home page which has static content on it. http://davidjberman.com/blogs/csharp/archive/2007/08/13/how-to-create-asynchronous-asp-net-pages-using-c.aspx

How to Send Many Parameters to the Thread

There are some ways to send number of parameters to the new created thread. 1. Creating a new instance of a class, and using that instance to store the information 2. Using ThreadPool to send parameters 3. Calling a delegate asynchronously More detailed information can be found at: http://www.yoda.arachsys.com/csharp/threadstart.html

Reverse Linked List Function - Interview Question

Here is code that should reverse Linked list: Linked list class: class Node { int ID; string name; Node next; } First option (recursive function): Node Reverse(Node root) { PutOnTop(root, root.Next) } Node PutOnTop(Node newRoot, Node current) { Node next = current.Next; current.Next = newRoot; if(next.Next!=null) PutOnTop(current,next); } Second option (without using recursive function): Node Reverse(Node root) { Node current = root.next; Node prev = root; while(current!=null) { Node next = current.Next; current.Next = prev; prev = current; current = next; } }