06
May
2013
admin

Click Only Once with jQuery

Hope this will be useful for the jQuery lovers.  

Method 1:  
$("#click_me_once").one("click", function() {    
alert("This will be clicked only once.");  
});      

Tags: 
06
May
2013
admin

Difference Between Primary Key and Unique Key

 

Every SQL programmer is supposed to have a better knowledge of Primary and Unique key. As I have visited many places and observed this that it’s the basic question being asked. I have decided to share this for those who are fresh and preparing for some kind of interview.

Primary Key:

1. Primary key does not accept null values.
2. There is only one primary key in a table.
3. Clustered index is created in Primary key.
4. Primary key allows each row in a table to be uniquely identified and ensures that no duplicate rows exist.

Tags: 
10
Apr
2013
admin

PHP fsockopen error - permission denied (13)

This error is not file permissions, it means httpd has been denied permission to connect to that IP address and port.

The most common cause of this is SELinux configuration not permitting httpd to make network connections.

To resolve it, you need to change an SELinux boolean value (which will automatically persist across reboots). You may also want to restart httpd to reset the proxy worker, although this isn't strictly required.

 /usr/sbin/setsebool httpd_can_network_connect=1

Tags: 
08
Oct
2012
admin

Notice: A session had already been started - ignoring session_start()

 

This problem occurs when php.ini file has session.autostart turned on. You can fixed this following way:

02
Oct
2012
admin

Using grep to move files

Search using grep inside all the files of a directory for the pattern 'from-sip' (to move specific call folder).

Create the "from-sip" directoy and try following command in centos6:
 
mv $(grep -l 'from-sip' *) from-sip 
 
Try the grep command on its own to see what it will find. -l causes grep to list the matching file names.
Tags: 
24
Sep
2012
admin

Modifying PDF files with PHP using FPDF/FPDI Library

There are several libraries available in PHP for dealing with PDF files, none seem to have capabilities to modify the contents of an existing PDF file. The FPDF is an open-source library for PDF file generation in PHP. In their an extension of the library, named FPDI, this one was capable of ‘manipulating’ PDF files. It extracts the contents of each page in the file, uses it as a template, lets put texts/images/shapes on the template and then outputs the modified file.

09
Apr
2011
admin

Managing Cron Jobs with PHP

Background – An Overview of the Crontab

Let’s face it, having the ability to schedule tasks to run in the background is just great! From backing up an SQL database, fetching / sending emails to running clean up tasks, analyzing performance, or even grabbing RSS feeds, cron jobs are fantastic!

Although the syntax of scheduling a new job may seem daunting at first glance, it’s actually relatively simple to understand once you break it down. A cron job will always have five columns each of which represent a chronological ‘operator’ followed by the full path and command to execute:

  1. * * * * * home/path/to/command/the_command.sh  

Each of the chronological columns has a specific relevance to the schedule of the task. They are as follows:

  • Minutes represents the minutes of a given hour, 0-59 respectively.
  • Hours represents the hours of a given day, 0-23 respectively.
  • Days represents the days of a given month, 1-31 respectively.
  • Months represents the months of a given year, 1-12 respectively.
  • Day of the Week represents the day of the week, Sunday through Saturday, numerically, as 0-6 respectively.
  1. Minutes [0-59]  
  2. |   Hours [0-23]  
  3. |   |   Days [1-31]  
  4. |   |   |   Months [1-12]  
  5. |   |   |   |   Days of the Week [Numeric, 0-6]  
  6. |   |   |   |   |  
  7. *   *   *   *   * home/path/to/command/the_command.sh  

So, for example, if one wanted to schedule a task for 12am on the first day of every month it would look something like this:

  1. 0 0 1 * * home/path/to/command/the_command.sh  

If we wanted to schedule a task to run every Saturday at 8:30am we’d write it as follows:

  1. 30 8 * * 6 home/path/to/command/the_command.sh  
06
Apr
2011
admin

Windows SSH Secure Shell Initial Connection and Transferring Files

To use these instructions it is necessary to download and install SSH Secure Shell for Windows. If you haven't downloaded this application, do so now:

SSH Download
SSH Communications Window Client (Version 3.2.9, which includes support for pass-thru printing)

05
Apr
2011
admin

এপ্রিলের মিথ্যাচার

মিথ্যা একটি চারিত্রিক ব্যাধি। যার মধ্যে মনুষ্য রুচিবোধ কিংবা সুস্থ প্রকৃতি বিদ্যমান সে কোনক্রমেই এর প্রতি সমর্থন জ্ঞাপন করতে পারে না। আর না করাই হচ্ছে স্বাভাবিক মনুষ্য ধর্ম। সকল ধর্মেই এর প্রতি নিন্দা জ্ঞাপন করা হয়েছে।

‘পক্ষান্তরে সত্য পৃথিবীর স্থায়িত্বের একটি মূল ভিত্তি। প্রশংসাযোগ্য বস্তু, নবুওয়তের অংশ ও তাকওয়ার ফল। এ সত্য না থাকলে শরিয়তের বিধানসমূহ অকেজো হয়ে যেত।  মূলত মিথ্যা বলার দোষে দুষ্ট হওয়ার অর্থ হচ্ছে মানবতা থেকে বেরিয়ে যাওয়া। কারণ, কথা বলা মানুষের একটি বৈশিষ্ট্য আর কথা সত্য না হলে তার কোন অর্থই থাকে না।’ (মুহাম্মদ আল-খাদেমি: বারীকাতুন মাহমূদিয়া, ৩/১৮৩)

05
Apr
2011
admin

সদ্য ভূমিষ্ঠ সন্তানের ক্ষেত্রে করণীয়

সন্তান ভূমিষ্ঠ হওয়ার পর করণীয় :

১. সন্তান ভূমিষ্ঠ হলে আল্লাহর প্রসংশা করা, তার শুকরিয়া আদায় করা ও সন্তানের জন্য দোয়া করা। পবিত্র কুরআনে ইবরাহিম আলাইহিস সালাম সম্পর্কে এরশাদ হয়েছে, সন্তান ভূমিষ্ঠ হওয়ার পর তিনি বলেন, সকল প্রশংসা আল্লাহর, যিনি বৃদ্ধ বয়সে আমাকে ইসমাঈল ও ইসহাককে দান করেছেন। নিশ্চয় আমার রব দোআ শ্রবণকারী। হে আমার রব, আমাকে সালাত কায়েমকারী বানান এবং আমার বংশধরদের মধ্য থেকেও, হে আমাদের রব, আর আমার দোআ কবুল করুন। (সূরা ইবরাহিম : ৩৯-৪১)

03
Apr
2011
admin

PHP Class: Convert Plural to Singular or Vice Versa in English

List of Functions

Other than pluralize and singularize, this class has some more functions to convert text strings by certain standards. List below are all the functions this class has:

28
Mar
2011
admin

How to search text in files or folders in Command Line of Ubuntu

 

Applications -> Accessories -> Terminal

and write the following command:

grep -i -n -r ‘searchtext’ *

-i for ignore case sens, -n for line number and -r for recursive

where searchtext is the text you want to search in your files.

This will bring the results with the file names, containing all the files which has the text searchtext.

12
Mar
2010
admin

How do I fix “Setup did not find any hard disk drives installed in your computer” error during Win XP Pro install?

When I try to reinstall Windows XP in ASUS Z99Eseries, I got following message:
"Setup did not find any hard disk drives installed in your computer.

Make sure any hard disk dirves are powered on and properly connected to your computer, and that any disk-related hardware configuration is correct. This may involve running a manufacturer-supplied to diagnostic or setup program.

Setup cannot continue. To quit Setup, press F3."

So, I try to fix this more and more time. And finally fixed this following way:

08
Mar
2010
admin

বিবিসির দৃষ্টিতে পৃথিবীর সেরা ১০০ টি উপন্যাস

২০০৩ সালের এপ্রিল মাস থেকে সর্বকালের সেরা ১০০ টি উপন্যাস নির্বাচিত করার জন্য বিবিসি জরিপ শুরু করে। প্রায় সাড়ে সাত লাখ ভোট আসে সর্বকালের সেরা ১০০ টি উপন্যাস নির্বাচনের জন্য। নিচে এগুলোর নাম দেওয়া হলোঃ

03
Mar
2010
admin

Salah : The Benefit of the Worshipper's Standing Before His Lord

The Prayer is a sanctified and holy moment (mauqif) for the worshipper in the presence of his Lord and Deity in truth. He fulfils (by its performance) his covenants, obligations and statements of confession which are contained within and are required by the testimony that:"There is nothing which has the right to be worshipped except Allah and that Muhammed is His Messenger" and by whose attestation one becomes a muslim.

Pages

Subscribe to Welcome to my blog........... RSS