Cheraq.com

I innovate, then I am!

private-property

Monday, November 28, 2011
by Mohammad J.
0 comments

Common Javascript mistakes: Variable Scope

If you are a person that JavaScript(JS) is not your first programming language, and you have a background in C, C++, Java, C#, Python or other well structured programming languages, then you might caught off-guard with some JS concepts. We usually don’t like to start learning something from zero, so we usually try to guess how things work based on what we already learned in other programming languages. But some concepts in JS are totally different from other languages, and the one that recently I faced is: Variable Scope. Continue reading

europython-logo1

Saturday, October 8, 2011
by Mohammad J.
0 comments

Google Code Jam: 2011 Euro Python

In this Problem Solving session, we will have a look at Google Code Jam – Euro Python 2011 contest. Contest consists of four questions which are from easy to medium difficulty and contestants had more than 3 hours to solve the problems which is more than enough. Lets start solving problems rather than talking. Continue reading

Wednesday, September 7, 2011
by Mohammad J.
0 comments

LINQ and Inconsistency in pagination result

LINQ is one of the significant improvements of .Net and from the time it has been added till today I am always using it in all my projects (I forgot how I was using DB before!). But recently I have faced a weird issue. Did you ever faced an issue where you can see items have been stored properly in your database without any duplicates, but when you are using your grid view or listing feature to check pages, there are duplicates and missing items. If so, then don’t panic! You are not alone! Continue reading

Divide & Conquer - Image Credit: iStockPhoto

Friday, August 12, 2011
by Mohammad J.
0 comments

Divide and Conquer is the new black!

Divide and conquer is an algorithm design paradigm that solves problem by dividing it to smaller sub-problems and solving them either by dividing them to smaller ones, or by any other algorithms. This is a very old way of solving problems. However, recent technology advancements did not make it off-fashion. There are two well-known and powerful algorithms based on this methodology: Binary Search and Merge Sort. What we are going to do is, have a look at the main idea behind it, discuss about algorithms based on it, and see how we can use it in our daily projects. Continue reading

Algorithm-funny

Tuesday, July 5, 2011
by Mohammad J.
0 comments

Algorithms: What? Why? When? How?

In computer software, Algorithm is a very common term. Lots of people use this terms without even knowing the meaning or usage of them. Finding proper algorithm for a given problem could be challenging. Nowadays, hardware performance is improved a lot and this means we have faster CPUs and more memory to perform computations. This is a first article of Algorithms series, where we will discuss about algorithms and we will try to adapt the classic algorithms with our modern machines. Continue reading

Thursday, May 26, 2011
by Mohammad J.
0 comments

How to resolve URL to absolute path when you don’t have access to page object?

Using Virtual Path will make web applications more portable. If you don’t know what I mean by virtual path, it is simply URLs that start with “~/”. But resolving this URLs to absolute path something might be tricky. ASP.NET’s Page object provides a convenient function “ResolveUrl()” that does this for us, but what if we do not have access to this object?! For example Web Service or Generic Handlers do not provide this functionality. If you are wondering how to achieve this in such situations, then you are on right track. Continue reading

Thursday, May 26, 2011
by Mohammad J.
1 Comment

Extension Methods in .NET

Making codes more semantic will help to reduce the maintenance efforts. Dot Net provides a way to add new functionality to existing class without defining new class/type. For example, you want to add HtmlEncode to string class so you could use it like “str.HtmlEncode()” or you want to make converting string to int so easier by adding ToInt32 function to string class and be able to use it like “textbox1.Text.ToInt32()”. This is more convenient than using “Convert.ToInt32(textbox1.Text)”. Here you will learn how to do it. Continue reading