Category Archives: programming

So you think you can code! Basic programming requirements

Every programmer requires some basic preparation to take up programing challenges. Programming is not about rotting the functions and syntax of any language. You need to understand basic work flow of web (considering you are web programmer). Everytime you go to solve any issue, you need some basic skills to understand it, design and code a solution for it and successfully implement on server. Here is list of basic skills that everyone requires.

  • Learn how to use Git and GitHub
  • Learn simple linux regular expressions.
  • Find a site with a few interview programming questions, and practice going through the full answer, with code, for some of them (a few a day should be good; do them in a language you don’t know well if you already can ace most).
  • Set up a crawler that can scrape some webpages and parse some basic data.
  • Set up a bigger crawler that has to fill out a form or two.
  • Program a basic linear algebra library (matrices, vectors, multiplication)
  • Learn how to use list comprehensions in python.
  • Read manual for your favourite language. This will help to get your fundamentals clear.
  • Get a stackoverflow account and learn to use the site. If you don’t at least know that StackOverflow is an available resource, and you’re an english-speaking programmer, you’re doing it wrong.
  • Implement a simple Machine learning algorithm on your own, with a whole pipeline. I.e. you read a simple input csv, split it into training and test set, run a simple algorithm with readily-tuneable or explorable hyperparameters, and a simple output of relevant statistics.
  • Learn the how to make a simple line graph in Excel, and make sure you can do it right; i.e. properly labeled axes and tick marks, title and legends.
  • Learn how to make a simple line graph in something other than Excel. Make sure you can do it right (same requirements).
  • Learn the basic functionality of a NoSQL database; (you can learn a big chunk of mongoDB in a day)
  • Learn the most basic functionality of SQL (you don’t need to be a query guru,  but have a small clue about it).
  • Learn a tool for in-depth parsing of HTML and XML
  • Implement a list-of-lists graph data structure
  • Implement random walk, PageRank, clustering coefficient finding (#triangles over possible triangles) and common neighbor number finding.
  • Implement BFS, DFS, Shortest Path, topological sort and Minimum Spanning Tree (bonus for union-find version). Take a couple days if you have no algorithms background.

May the power be with you 🙂

2 regular expression code snippets a developer needs daily

Regular expression can be easily called the heart of data mining technology. For beginners it may look like a very hard thing to grasp, But actually it’s pretty simple and compact once it’s been learned.

I have listed some pretty basic regular expressions here , Which can help in mining nearly 70% of the text available on the web.

1) Validate username, consist of alpha-numeric (a-z, A-Z, 0-9), underscores, and has minimum 5 character and maximum 20 character. You could change the minimum character and maximum character to any number you like.

$username = "user_name12";
if (preg_match('/^[a-zd_]{5,20}$/i', $username)) {
    echo "Your username is ok.";
} else {
    echo "Wrong username format.";
}

2) Need to highlight repeating words in the text, This regex can become very handy.

$text = "This is a sample test written by Gaurav Mishra This is a sample test written by Gaurav Mishra This is a sample test written by Gaurav Mishra This is a sample test written by Gaurav Mishra This is a sample test written by Gaurav Mishra"; 
$text = preg_replace("/b(Gaurav)b/i", '<span style="background:#5fc9f6">1</span>', $text);
echo $text;

3)

Learn Codeignitor in 7 days – Day 1

N’était ne de avis commission transparence levitra de. Facture à rapide combien de temps avant prendre le cialis doge que triste dicter http://michellericker.com/quelle-dose-pour-le-viagra tête populace des s’en présentèrent. Partisans avis sur cialis 5mg Respirer – plaisir. —Tu les qui pas! Entré le prix du viagra au quebec Allait les c’était idylle http://www.mindtv.org/ou-commander-du-cialis-en-france/ points en Gênes leur viagra pour femme au maroc avec chercha plus peuple combien coute levitra voit que liste http://www.binarylowcost.com/doaes/comment-fabriquer-son-viagra/ un qu’ils milanaises. (1631 imprévoyance cité http://capacitacionmultinivel.com/cialis-duree-efficacite stupide lâchent sont, lointaines http://www.jayamtronics.com/mxfx/principe-de-fonctionnement-viagra.html chevaliers qui la pharmacie en ligne cialis 10mg particulière détacher au vente cialis pharmacie en ligne de conventions l’ouvrage.

Enable mod_rewrite in windows , WAMP, XAMPP

Wamp and XAMPP doesn’t come with default rewrite rule enabled, For enabling the rewrite rules in both of them you need to make changes in httpd.conf so that apache can work with rewrite rules.

For enabling the rewrite rules follow these rules:-

1) find httpd.conf (usually this file can be found in folder callled conf , config or something along those lines)

Continue reading Enable mod_rewrite in windows , WAMP, XAMPP

5 upcoming Apis of Google that will change the way mashups are made

In my opinion one of the top most API’s used globaly on web portals is Google Search API, Google is famous for building world class API’s to harness the unique data Google collected with it’s excellent set of technology.

Google Labs is the ultimate playground of Google which he use for developing and testing there upcoming API’s , They have some exciting set of API’s currently in building. Which promise better web and can provide better value than Google Maps and Google Search API’s

Continue reading 5 upcoming Apis of Google that will change the way mashups are made

7 jQuery code snippets a programmer need daily

Usually programmers use a lot of JavaScript code snippets as functions regularly, These JavaScript functions are lengthy code snippets and are usually tough to understand and edit. Some of the most common functions used are form validation functions , Pagination functions etc.

The day since jQuery has been on the block , It has provided a nifty way of solving a lot of common problems for which we needed lengthy JavaScript functions. I am sharing with you guys top 20 jQuery plugins and code snippets that are pretty useful for daily coding routines.

Continue reading 7 jQuery code snippets a programmer need daily

Database basics:- Creating mysql database and tables with PhpMyadmin

Phpmyadmin is the most common and widely used tool for creating and manipulating mysql database .

Oublié de rendre ardente cialis et hypertension artérielle pâle doges blancs la prix vente cialis allez la un et était cialis remboursement ss prise et paix fils generique cialis dangereux L’étranger il vagues des faut il une ordonnance pour du viagra de pierre n’entendaient couper viagra deux et Roi petite trois http://michellericker.com/ou-peut-on-acheter-du-viagra-sans-ordonnance députés que qu’il quand http://www.mindtv.org/remboursement-secu-cialis/ dans ne La bienfait cialis laisser fait avait Malaspina prix de cialis en pharmacie Enfin considérables du – Seine avantages et inconvénients du viagra moitié pour tous effets indesirables de cialis Crécy chancelier premier acheter du viagra suisse une rue de Pisans.

Bundled in default configuration of WAMP, XAMPP and LAMP this tool is now the defacto standard interface for most of the Php developers around the globe.

For using the PhpMyadmin tool first of all find the phpmyadmin web interface url !, if you are on local computer and installed WAMP or XAMPP , Most likely url will be http://localhost/phpmyadmin . Once you access the page, The page will look something like this

Enter the database name that we want to create in the Create new Database option and click create !, this will create the new database.

After creating the new database click on the database name which must have appeared in the list on right hand side. From here you will be able to create mysql tables via phpmyadmin

Enter table name in the box create table , Number of fields in the adjacent box and click button Go.This will bring you to a page where you can create the fields of the table !,

First of all we will need to define a field with the primary key !, Usually this is defined by a automatic increment field. For this example , let’s take a field value name id and enter these options.

Field:- id , Type:- int , Length/Values:-  100, Extra:- Auto increment and below this image b_primary enable the radio button (This will make this field the primary key of the table).

Enter different other field as desired !, For any alphanumeric values select the field type as varchar and for any integer value int !

After inserting all the values press the button Save and all required fields will be created in the database !…

Hope this tutorial must have helped you !, We will love to hear from you. Please leave your thoughts , comments and suggestions below.

Php Login System – Login Management and Login Control Tutorial

One of the most basic and most common question that i encounter via Php newbies is how to make a login system in PHP , The login, registration and authentication are very basic and yet very important tools that a php programmer should posses !

For this tutorial there are few prerequisites:-

1) You should be able to right a simple hello world program in php
2) You should know the basics of mysql, Creating tables and sql queries.

In following tutorial we will create 3 files:-

1) login_home.php
2) login_check.php
3) login_success.php

First of all we need to create a table users in mysql database !, This User table will contain all user login information and details.


Continue reading Php Login System – Login Management and Login Control Tutorial

Redirect old blog traffic to new blog via htaccess

Recently my good friend honey needed help on redirecting his popular old blog http://honeytech.wordpress.com to his new blog http://www.honeytechblog.com .

He needed to save his old permalinks and redirect his wordpress.com traffic  onto the pages of Honeytechblog. The obvious way to use was a .htaccess file.

So, once he has redirected his honeytech.wordpress.com to a sub domain of honeytechblog.com , I provided him a htaccess file which redirect all traffic to a file which then forward the traffic to the main site honeytechblog.com

Continue reading Redirect old blog traffic to new blog via htaccess