HoHalla

Shakeel Shrestha

Shakeel Shrestha's Blog (42)

Google Wave

New Communication and Collaboration System.

Continue

Added by Shakeel Shrestha on October 9, 2009 at 10:53am — 1 Comment

Autoloading Class in PHP

In PHP, if we need to use the functions of class file, to load the class file, we usually use include/include_once or require/require_once functions. But the easier way is to use the inbuild function __autoload(). For demonstration define the class files as needed. Example is given below. class MyClass1{ function myfunction(){ echo "Function inside MyClass1"; } } Save the file as MyClass.php class MyClass2{ function mynextfunction(){ echo "Function inside MyClass2"; } } Save the file as… Continue

Added by Shakeel Shrestha on January 31, 2009 at 6:49pm — No Comments

Url Rewriting

Some url rewriting that I have used. First uncomment the line below in apache>conf>httpd.conf file and restart the apache server. LoadModule rewrite_module modules/mod_rewrite.so Now add these lines in .htaccess file #initialize mod rewrite Options +FollowSymlinks RewriteEngine on #this line will disable direct file viewing within any folder Options -Indexes #this configuration will disable the access of .htaccess file <Files .htaccess>
order allow,deny
Continue

Added by Shakeel Shrestha on January 7, 2009 at 1:47pm — No Comments

Some Information about database indexes

Guidelines to create indexes The characteristics of data and the usage of the data in the environment in which it is defined ascertains the columns to build the index. The usefulness of the index is directly related to the percentage of rows returned from a query. Low percentage or high selectivity are more efficient. Creating indexes on the frequently searched column is more useful and efficient. Indexes can be best created on the following columns. • Primary Keys • Foreign Keys or col… Continue

Added by Shakeel Shrestha on January 1, 2009 at 11:30am — No Comments

Limitations of MySQL

Limitations of MySQL

General limitations of MySQL

32-bit binaries cannot addess more than 4 GB of memory. This is not a MySQL limitation, this is a technical limitation.

Limits of MySQL 4.1

Limits of Joins

In MySQL 4.1, the maximum number of tables that can be referenced in a single join is 61. This also applies to the number of tables that can be referenced in the definition of a view.

Limits of the MyISAM storage engine

There is a

Continue

Added by Shakeel Shrestha on December 18, 2008 at 4:53pm — No Comments

Some Reality

Whenever you find the key to success, someone changes the lock. _____ To Err is human, but to forgive is not a COMPANY policy. _____ The road to success??.. Is always under construction. _____ Alcohol doesn't solve any problems, but if you think again, neither does Milk. _____ In order to get a Loan, you first need to prove that you have ability to repay back. _____ All the desirable things in life are either illegal, expensive or fattening. _____ Since Light travels faster than Sound, peo… Continue

Added by Shakeel Shrestha on December 11, 2008 at 11:22am — No Comments

Academics invent a mathematical equation for why people procrastinate

The equation is U=EV/ID The 'U' stands for utility, or the desire to complete a given task. It is equal to the product of E, the expectation of success, and V the value of completion, divided by the product of I, the immediacy of the task, and D, the personal sensitivity to delay. Continue

Added by Shakeel Shrestha on December 8, 2008 at 3:59pm — No Comments

Currency Conversion With foxrate.org's XML-RPC API

Foxrate.org provides XML-RPC API to convert the currency from one to another. I needed it for a project to convert from Euro to Pound and vice-versa. I had once read about such a work in roshanbh.com.np so I finally thought to follow the same API. After searching for some days, I came up with some code but had some problem for which I couldn't get any help. At last our senior friend from college, Sanjeev, added last two lines of code to make it run. Thanks Sanjeev.

<?php

require_o

Continue

Added by Shakeel Shrestha on December 3, 2008 at 4:58pm — 1 Comment

Extracting Information Using XPath

You want to make sophisticated queries of your XML data without parsing the document node by node.

Solution: Use XPath

XPath is available in SimpleXML

<?php
$s=simple_load_file('address-book.xml');
$emails=$s->xpath('/address-book/person/email');

foreach($emails as $email){
//do something with $email
}
?>

And in DOM

<?php
$dom=new DOMDocument;
$dom->load('address-book.xml');
$xpath=new DOMXPath($d

Continue

Added by Shakeel Shrestha on November 24, 2008 at 8:24pm — No Comments

Multiple Worksheets, Borders, and Images

Few months back I was searching for the php code that creates excel file, which has got the content in multiple worksheet. I couldn't get any help from the net. Today just going through the PEAR Modules, I came across this script. This script generates excel file with multiple worksheets. <?php
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer("example4.xls");
$worksheet =& $workbook->addWorksheet();

$worksheet->writeNote(1, 0,

Continue

Added by Shakeel Shrestha on November 23, 2008 at 9:08pm — No Comments

Facebook is hit by a fast moving Social Engineering Attack

November 2008 is going to be a bad month for Facebook as a rapid moving chunk of malware is working through the social community, and sending an email with a link that sends a person to a compromised site, with the extra side bonus of malware. This though seems more like a social engineering style attack rather than a true worm/virus although it has components of each as part of its makeup. Essentially the user still has to do something, so it is not wholly automated. The way this works though… Continue

Added by Shakeel Shrestha on November 14, 2008 at 8:54am — No Comments

Escrow

What is Escrow? Escrow, or to place in escrow, is a legal arrangement wherein an asset such as money, property, a deed, or a bond is put into the custody or held in trust by a third party for delivery to a grantee only after the fulfillment of the conditions specified. While this is the traditional definition, an escrow transaction now also includes technology assets such as software and intellectual property. Escrow agreements are widely used in dealings in sectors like Real Estate, Au… Continue

Added by Shakeel Shrestha on November 9, 2008 at 6:08pm — No Comments

Some Birthday Wishes

Another Year I’m wishing you another year Of laughter, joy and fun, Surprises, love and happiness, And when your birthday’s done, I hope you feel deep in your heart, As your birthdays come and go, How very much you mean to me, More than you can know. By Joanna Fuchs Perfect Birthday On your birthday I wish you much pleasure and joy; I hope all of your wishes come true. May each hour and minute be filled with delight, And your birthday be perfect for you! By Joanna Fuchs BContinue

Added by Shakeel Shrestha on November 7, 2008 at 2:45pm — No Comments

Principles behind the Agile Manifesto

We follow these principles:

Our highest priority is to satisfy the customer through early and continuous delivery of valuable software. Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage. Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale. Business people and developers must work together daily througho
Continue

Added by Shakeel Shrestha on November 3, 2008 at 6:36pm — No Comments

Free Webhosting

For a student http://www.000webhost.com is a good place for testing your php based web projects. It is free and gives space of 1.5 GB. You can use ftp client softwares to upload the files at once. Beside this, it has its own cpanel with many features. Get other details logging into the site. Continue

Added by Shakeel Shrestha on October 24, 2008 at 1:09pm — No Comments

CELEBRATING GOOD FRIDAY IN OFFICE :: THE MAGIC ABOUT MOMOMAGIC

Aja kaha jane ko khaja ko lagi? Rajeev said. Malai ta chowmein khana man lageko cha, I said. You mean you wanted to go to Dragon, he said. But is too congested he added. Lets go to MomoMagic, down to Harihar Bhawan. Since no one had ever been there before, we all agreed to go there. We reached MomoMagic in few minutes, no other customers were there. Menu was in the table under. But I saw the beverage menu first before the main menu. Royal Stag....I said looking at the menu. Then everybody got in… Continue

Added by Shakeel Shrestha on September 28, 2008 at 11:20am — 3 Comments

10 things you (probably) didn't know about PHP

# Use ip2long() and long2ip() to store IP addresses as integers instead of strings in a database. This will reduce the storage space by almost a factor of four (15 bytes for char(15) vs. 4 bytes for the integer), make it easier to calculate whether a certain address falls within a range, and speed-up searches and sorts (sometimes by quite a bit). # Partially validate email addresses by checking that the domain name exists with checkdnsrr(). This built-in function checks to ensure that a specifi… Continue

Added by Shakeel Shrestha on September 14, 2008 at 8:42pm — No Comments

10 things every php developer should learn from Ruby on Rails

# Convention over configuration # Organize your files according to the MVC pattern # Adopt the DRY (Don't repeat yourself) philosophy # Use PHP5's object oriented capabilities # PHP can be cool like Ruby # Make use of Martin Fowler's Active Record pattern to map classes to database tables # Use PHP5's __autoload function so you don't need any require oder include # Use a template engine like Smarty or write your own # Adopt coding conventions like the PEAR coding standards # Use a rails… Continue

Added by Shakeel Shrestha on September 14, 2008 at 4:58pm — No Comments

Active record pattern

In computer science, the active record pattern is a design pattern frequently found in software that stores its data in relational databases. It was named by Martin Fowler in his book Patterns of Enterprise Application Architecture. Active record is an approach to accessing data in a database. A database table or view is wrapped into a class, thus an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded ge… Continue

Added by Shakeel Shrestha on September 12, 2008 at 10:13pm — No Comments

Don't repeat yourself

Don't Repeat Yourself (DRY, also known as Single Point of Truth) is a process philosophy aimed at reducing duplication, particularly in computing. The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency. DRY is a core principle of Andy Hunt and Dave Thomas's book The Pragmatic Programmer. They apply it quite broadly to include "database schemas, test plans, the… Continue

Added by Shakeel Shrestha on September 12, 2008 at 10:11pm — No Comments

About

Translate This Network

CNN Tech

Loading feed

Smashing Magazine

Loading feed

Events

Music

Loading…

© 2009   Created by Shakeel Shrestha on Ning.   Create a Ning Network!

Badges  |  Report an Issue  |  Privacy  |  Terms of Service

Sign in to chat!