Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

Daily Archives: 01/10/2009

ActivePerl


https://i1.wp.com/www.activestate.com/ui/img/as_logo_web.gifActivePerl is the industry-standard Perl distribution, available for Windows, Linux, Mac OS X, Solaris, AIX and HP-UX. Developers worldwide rely on ActivePerl’s completeness and ease-of-use, while corporate users protect their infrastructure and stay competitive with quality-assured ActivePerl Business Solutions.

  • PPM scans .packlist files newer than the corresponding PPM database for that install area.
  • On 32-bit Windows CPAN shell automatically downloads and installs the MinGW GCC compiler.
  • Modules shipped as part of core Perl now included in PPM database.
  • Bundled modules updated to latest version.
  • Security fixes.
Advertisements

Firebug – Web Development Evolved


https://i2.wp.com/getfirebug.com/header.png

Firebug integrates with Firefox to put a wealth of web development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
Firebug is always just a keystroke away, but it never gets in your way. You can open Firebug in a separate window, or as a bar at the bottom of your browser. Firebug also gives you fine-grained control over which websites you want to enable it for.
Firebug makes it simple to find HTML elements buried deep in the page. Once you’ve found what you’re looking for, Firebug gives you a wealth of information, and lets you edit the HTML live.
Firebug’s CSS tabs tell you everything you need to know about the styles in your web pages, and if you don’t like what it’s telling you, you can make changes and see them take effect instantly.

https://i0.wp.com/getfirebug.com/html1.gif

When your CSS boxes aren’t lining up correctly it can be difficult to understand why. Let Firebug be your eyes and it will measure and illustrate all the offsets, margins, borders, padding, and sizes for you.
Your pages are taking a long time to load, but why? Did you go crazy and write too much JavaScript? Did you forget to compress your images? Are your ad partner’s servers taking a siesta? Firebug breaks it all down for you file-by-file.
Firebug includes a powerful JavaScript debugger that lets you pause execution at any time and have look at the state of the world. If your code is a little sluggish, use the JavaScript profiler to measure performance and find bottlenecks fast.

ExtJS – Cross-Browser Rich Internet Application Framework


https://i1.wp.com/www.extjs.com/assets/images/extjs2.png

Ext JS is a cross-browser JavaScript library for building rich internet applications. It includes:

  • High performance, customizable UI widgets
  • Well designed and extensible Component model
  • An intuitive, easy to use API
  • Commercial and Open Source licenses available

Ext JS supports all major web browsers including:

  • Internet Explorer 6+
  • FireFox 1.5+ (PC, Mac)
  • Safari 3+
  • Opera 9+ (PC, Mac)

Page Auto Re-direct after few seconds


JS Code:

function redirect(){
window.location = "http://domain.com/your-redirect-page.html";
}
setTimeout("redirect()",10000);

WinMerge – Opensource merging tool for Windows


https://i2.wp.com/winmerge.org/engine/images/head.gifWinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.

WinMerge is an open source project, which means that the program is maintained and developed by volunteers.

https://i0.wp.com/winmerge.org/about/screenshots/screenshot_small.png

Creating a Log File in PHP


Here is the code that can save the system process to a .log file using php:

//Function: writeToLogFile($content,$flag) - To write every steps to the specified log file.
function writeToLogFile($content,$flag){
global $LOG_FILE;
$strRootPath = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$fp = fopen($strRootPath.$LOG_FILE,"a");
if ($flag)
$f_contents = date("Y-m-d H:i:s")."-".$content;
else
$f_contents = $content;
fwrite($fp,$f_contents."\r\n");
fclose($fp);
}

URL Validation


If you want to validate an URL in input fields, here is the JS code:

function isUrl(s) {
var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
return regexp.test(s);
}

How to parse a URL?


If you want to parse a URL, here is the JS code: (please write a comment if you take this code)

function parseURL(buffer) {
var result = { };
result.protocol = "";
result.user = "";
result.password = "";
result.host = "";
result.port = "";
result.path = "";
result.query = "";
var section = "PROTOCOL";
var start = 0;
var wasSlash = false;
while(start < buffer.length) {
if(section == "PROTOCOL") {
if(buffer.charAt(start) == ':') {
section = "AFTER_PROTOCOL";
start++;
} else if(buffer.charAt(start) == '/' && result.protocol.length() == 0) {
section = PATH;
} else {
result.protocol += buffer.charAt(start++);
}
} else if(section == "AFTER_PROTOCOL") {
if(buffer.charAt(start) == '/') {
if(!wasSlash) {
wasSlash = true;
} else {
wasSlash = false;
section = "USER";
}
start ++;
} else {
throw new ParseException("Protocol shell be separated with 2 slashes");
}
} else if(section == "USER") {
if(buffer.charAt(start) == '/') {
result.host = result.user;
result.user = "";
section = "PATH";
} else if(buffer.charAt(start) == '?') {
result.host = result.user;
result.user = "";
section = "QUERY";
start++;
} else if(buffer.charAt(start) == ':') {
section = "PASSWORD";
start++;
} else if(buffer.charAt(start) == '@') {
section = "HOST";
start++;
} else {
result.user += buffer.charAt(start++);
}
} else if(section == "PASSWORD") {
if(buffer.charAt(start) == '/') {
result.host = result.user;
result.port = result.password;
result.user = "";
result.password = "";
section = "PATH";
} else if(buffer.charAt(start) == '?') {
result.host = result.user;
result.port = result.password;
result.user = "";
result.password = "";
section = "QUERY";
start ++;
} else if(buffer.charAt(start) == '@') {
section = "HOST";
start++;
} else {
result.password += buffer.charAt(start++);
}
} else if(section == "HOST") {
if(buffer.charAt(start) == '/') {
section = "PATH";
} else if(buffer.charAt(start) == ':') {
section = "PORT";
start++;
} else if(buffer.charAt(start) == '?') {
section = "QUERY";
start++;
} else {
result.host += buffer.charAt(start++);
}
} else if(section == "PORT") {
if(buffer.charAt(start) = '/') {
section = "PATH";
} else if(buffer.charAt(start) == '?') {
section = "QUERY";
start++;
} else {
result.port += buffer.charAt(start++);
}
} else if(section == "PATH") {
if(buffer.charAt(start) == '?') {
section = "QUERY";
start ++;
} else {
result.path += buffer.charAt(start++);
}
} else if(section == "QUERY") {
result.query += buffer.charAt(start++);
}
}
if(section == "PROTOCOL") {
result.host = result.protocol;
result.protocol = "http";
} else if(section == "AFTER_PROTOCOL") {
throw new ParseException("Invalid url");
} else if(section == "USER") {
result.host = result.user;
result.user = "";
} else if(section == "PASSWORD") {
result.host = result.user;
result.port = result.password;
result.user = "";
result.password = "";
}
return result;
}

The Trac Ticket System


https://i0.wp.com/www.edgewall.org/gfx/trac_logo.pngThe Trac ticket database provides simple but effective tracking of issues and bugs within a project.

As the central project management element of Trac, tickets are used for project tasks, feature requests, bug reports and software support issues.

As with the TracWiki, this subsystem has been designed with the goal of making user contribution and participation as simple as possible. It should be as easy as possible to report bugs, ask questions and suggest improvements.

An issue is assigned to a person who must resolve it or reassign the ticket to someone else. All tickets can be edited, annotated, assigned, prioritized and discussed at any time.

Ma Amar Ma



Without saying she understands everything, she is in our happiness, sadness, she is the best and most truthful.
She helped in every petty thing like she taught us how to walk, she led us by her finger.
In cold she is like sunlight, in summer she is like rain. She is like dreams and she is ours when we are in trouble.
She kisses our forehead, even if she is far(not with us)..she is with us day and night(in our hearts)
Thats all about our mothers…
And thats all is the song about
http://www.youtube.com/v/yM7ajRUMs9c&hl=en&fs=1&color1=0x2b405b&color2=0x6b8ab6&border=1
In Bangla, as in many other languages, ‘Ma’ means Mother:
No one sings me to sleep anymore
No face around me resembles how I remember her
Her care and warmth are plain gone
The only way I can see her is when I close my eyes
Maa, oh my mother.Maa, oh my mother
There’s this illusion, and
When I see you through it,I forget all pain that surrounds me

How do I recover my Joomla admin password?


A. You cannot recover the existing password, but you can reset it to a new password. The passwords are stored using a one-way MD5 hash which prevents recovering the password.
But you can reset the password by editing the password field in the database.Set the password to a known value and then you may log-in using that new password.

The password is stored in the MySQL database jos_users table password field. (change this for your table prefix if different) Use a MySQL utility such as phpMyAdmin or MySQL Query Browser to edit this field. Open the table, find your admin username, and then select that row for editing. The password must be hashed, you cannot simply enter text into this field. Read more of this post

Cobian Backup


Cobian Backup is a multi-threaded program that can be used to schedule and backup your files and directories from their original location to other directories/drives in the same computer or other computer in your network. FTP backup is also supported in both directions (download and upload).

Cobian Backup exists in two different versions: application and service. The program uses very few resources and can be running on the background on your system, checking your backup schedule and executing your backups when necessary.

Cobian Backup is not an usual backup application: it only copies your files and folders in original or compressed mode to other destination, creating a security copy as a result. So Cobian Backup can be better described as a “Scheduler for security copies”. Cobian Backup supports several methods of compression and strong encryption.

SWFUpload – JavaScript/Flash library to Upload Multiple Files


https://i0.wp.com/www.swfupload.org/sites/swfupload.org/themes/joel_pittet/Alina/images/logo.gif

SWFUpload is a small JavaScript/Flash library to get the best of both worlds. It features the great upload capabilities of Flash and the accessibility and ease of HTML/CSS.

* Upload multiple files at once by ctrl/shift-selecting in dialog
* Javascript callbacks on all events
* Get file information before upload starts
* Style upload elements with XHTML and css
* Display information while files are uploading using HTML
* No page reloads necessary
* Works on all platforms/browsers that has Flash support.
* Degrades gracefully to normal HTML upload form if Flash or javascript is unavailable
* Control filesize before upload starts
* Only display chosen filetypes in dialog
* Queue uploads, remove/add files before starting upload

PHP – Undefined Index


This error appears because of your PHP error reporting settings. Usually, it appears when your variable is not properly set. There are two ways to handle this issue:

1. Check if $_POST[‘action’] is set before using it. For example:

if (!isset($_POST['action']))
{
//If not isset -> set with dumy value
$_POST['action'] = "undefine";
}

2. Suppress Notice warnings

Notice warnings could be suppressed by changing the error_reporting variable in your PHP.ini. error_reporting could be set to show all errors except those for notices and coding standards warnings: error_reporting = E_ALL & ~E_NOTICE

The same is accomplished by adding the following line in your php page:

 error_reporting (E_ALL ^ E_NOTICE);

suPHP


https://i1.wp.com/www.suphp.org/images/suphp_logo.png

suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter.

MySQL Indexing Sequence


The indexing should be the same sequence in the SQL used.

SELECT `image_no` AS count FROM `images` WHERE `section`='b_cars' AND `ad_no`='300483' ORDER BY `image_no` DESC LIMIT 1 KEY `section` (`section`,`ad_no`,`order_no`,`image_no`)

WHERE
ORDER BY/GROUP BY
SELECT

Freelance in Australia


The Freelance Factory allows Freelance Creative Talent to promote themselves and their services by offering a One Page Creative Profile Webpage in a categorised, industry-specific directory. It is completely FREE to register with the Freelance Factory, here you will be able to search other freelance profiles, search to team up, join the Factory Floor or simply have a look around. If you would like to advertise your expertise with a onepage profile page, display work samples and link to your website, a small fee applies. $22 per month or $232 per year.

https://i1.wp.com/www.freelancesuccess.com.au/images/artshub.png

A wonderful resource for all arts workers. Become a member and receive a number of benefits including a weekly Jobs e-bulletin. Membership costs $88 per year.

https://i0.wp.com/www.freelancesuccess.com.au/images/freelancer.com.png

Freelancer.com.au is a freelance jobs directory for Australians. It offers links to freelance & work at home job-boards, self-promotion tips, contract employment, lists of self-employment health/medical insurance for freelancers, and jobs for a wide range of freelance and home-based professionals. Read more of this post

Welcome to My Blog


Hello, and welcome to my blog! I’m not sure exactly what I’ll be writing about, but with the project I’ve been working on for the past 7 months recently announced, I felt compelled to finally start one. Of course, it has taken me almost a week to get my blog up and running – more on that in future blog entries…

I joined Macromedia around 9 months ago, and run the recently announced project code-named “Zorn” with Sho Kuwamoto. My prime motivation for joining Macromedia was that I saw incredible things being done in Flash that just blew me away, but every time I picked it up, my eyes would glaze over. Within this dichotomy I saw a tremendous opportunity to help make building these rich internet apps easier for people like me.

So Zorn is the new development tool that we’re building to make it easier to build apps that run on the Flash Platform. Zorn is built on Eclipse and I think will help make Flash more approachable for developers. I’ve got to say that as I typed that last sentence, I almost had to laugh. Developers, especially really good ones, are usually the type of people who don’t need things to be made more approachable – their whole reason for being is to figure out the hard stuff! Yet it’s amazing how many great developers I’ve met who can’t figure out how to do anything in Flash and just give up. The problem is that the Flash model, while very intuitive for animators and designers, is just completely foreign to experienced developers. Timelines? Movieclips? Layers with code? Huh? I’ll be talking more about how we will address these issues in the months ahead. Read more of this post

%d bloggers like this: