tag:blogger.com,1999:blog-66990118667311765142024-03-12T22:16:32.932-07:00Top E CodersUnknownnoreply@blogger.comBlogger29125tag:blogger.com,1999:blog-6699011866731176514.post-10287849749115854812011-02-23T01:34:00.001-08:002021-05-23T00:04:26.633-07:00How to detect a bounce email1. make sure the email you send out have the header
"Return-Path: detect-bounce@example.com\r\n",
&
"Return-Receipt-To: bounce@example.com\r\n"
2. setup this detect-bounce mail account at your mail server
3. redirect the incoming mail from this email account to your php script (check your mail server doc on how do this)
4. your php script will then be able to process the incoming email in Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-27591585982752156272011-01-31T00:43:00.002-08:002021-05-23T00:05:06.396-07:00MySQL LIMIT OptimizationI have this scenario where MySQL LIMIT syntax is very slow for table having 30 million records.
Solution
Instead of using MySQL LIMIT you may use WHERE and BETWEEN which works pretty fast.
Here are sample queries generated by my script:
1st SELECT * FROM mytable ORDER BY id LIMIT 0, 10000
.
.
.
17th SELECT * FROM mytable ORDER BY id LIMIT 160000, 10000
Each queries (1st to 16th) took 3 Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-9752235612048671802011-01-27T17:31:00.002-08:002021-05-23T00:05:20.638-07:00Proper Indexing of Tables in MySQLIn general you should only add indexes to match the queries your application uses, any extra will waste resources. In an application with very small tables, indexes will not make much difference but as soon as your tables are larger than your buffer sizes the indexes will start to speed things up dramatically.
When to add an index?
1. You have done an EXPLAIN and no index was shown as Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-53289877535461336032011-01-23T17:09:00.001-08:002021-05-23T00:05:31.298-07:00Hudson Installation ProceduresOverview
Hudson is a Continuous Integration (CI) server which polls a version control repository and runs an automated build soon after a change is detected in the version control repository. Hudson organizes CI jobs into projects. Each project has its own build script and its build results are stored within Hudson's work area.
This page lists the steps necessary to configure and operate Hudson Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-68017837138071069532010-12-03T15:48:00.001-08:002021-05-23T00:05:38.585-07:00mod_pagespeedmod_pagespeed is an open-source Apache module that automatically optimizes web pages and resources on them. It does this by rewriting the resources using filters that implement web performance best practices. Webmasters and web developers can use mod_pagespeed to improve the performance of their web pages when serving content with the Apache HTTP Server.
mod_pagespeed includes several filter Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-5590888971118996012010-11-22T16:35:00.001-08:002021-05-23T00:05:46.732-07:00NetBeans IDE 7.0 Beta DownloadThe new Beta build of NetBeans IDE 7.0 introduces language support for JDK7, enhanced integration with the Oracle WebLogic server, support for Oracle Database, GlassFish 3.1, Maven 3, HTML5 editing, and more.
The NetBeans team is pleased to announce the availability of NetBeans IDE 7.0 Beta.
NetBeans IDE 7.0 Beta introduces language support for development to the Java SE 7 specification with Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-70977451534233413212010-11-18T19:09:00.001-08:002021-05-23T00:05:59.768-07:00Testing PlatformUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-54406338802252214772010-11-10T23:15:00.001-08:002021-05-23T00:07:02.581-07:00Site Performance EnhancementEnhance your site performance with these common practices derived from the web. See what are applicable to you and gain from the benefits.
Use mod_pagespeed
Use mod_expires
Use mod_deflate
Avoid .htaccess
PHP ob_gzhandler
Use CSS Sprites
Combine and Minify
Compress Components
Compress Images
Limit Cookies
Parallel Downloads
Use mod_pagespeed mod_pagespeed is an open-source Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-79123831315066582452010-11-10T18:12:00.001-08:002021-05-23T00:07:12.822-07:00Combine and Minify CSS and Javascript Files Using MinifyCombine, Minify, Cache CSS and Javascript Files
This tutorial will teach us how to combine and minify CSS and javascript files using [http://code.google.com/p/minify/ Minify] thus will help your site regain high performance result and pass the tests of Yahoo!'s YSLow, Google's Page Speed, or AOL's WebPagetest.
What is Minify?
Minify is a PHP5 app that helps you follow several of Yahoo!'s Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-10590685206948886832010-11-02T00:35:00.001-07:002021-05-23T00:07:20.669-07:00PHPUnit Bootstrap with PHP AutoloadI have a scenario wherein after upgrading PHPUnit 3.4.11 to version 3.5.3, an existing bootstrap file for phpunit suddenly encountered an error complaining about class was not found. It seems PHP __autoload is not working.
After few experiments, a solution came up as shown below.
This is the previous method of autoloading class.
if (!function_exists('__autoload')) {
function __autoload($Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-6699011866731176514.post-20233523410267873152010-10-25T22:09:00.002-07:002021-05-23T00:08:21.923-07:00CSV to Graph - Convert Siege Log into Bar GraphCSV to Graph - Convert Siege Log into bar Graph - a simple perl script that reads a csv file and converts it into bar graph.
#!/usr/bin/perl
use strict;
use Text::ParseWords;
use GD::Graph::bars;
use Data::Dumper;
#my $file = 'siege.csv';
my $file = $ARGV[0];
my ($output_file) = ($file =~ /(.*)\./);
my @data;
my @legends;
# parse csv
open(my $fh, '<', $file) or die "Can't read csv fileUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-6699011866731176514.post-28604790995608845472010-08-13T01:04:00.002-07:002021-05-23T00:07:45.869-07:00How to View the Remote Desktop of a Headless ServerThis is applicable to those people who do most of their works on CLI. But how about if a certain task requires that your server has a running X windows which is frequently not available on most linux-based servers? The answer is a virtual X server together with VNC.
We'll not tackle what is X server nor what is VNC, instead you may use the power of Google or just visit Wikipedia.
Requirements
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-2789375358173930302010-07-30T16:54:00.001-07:002021-05-23T00:07:52.249-07:00Writing Unit Tests - Front and Back end
PHPUnit Test Case
* Skeleton Test
* setUp() and tearDown()
* Incomplete or Skipped Tests
* Assertions
* Logging
* Bootstrap
* Configuration File
* Code Coverage Analysis
Selenium Test Case
* Selenium IDE
* Selenium RC
* Failure ScreenshotsUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-73234275719179046182010-06-05T16:10:00.001-07:002021-05-23T00:07:59.839-07:00Find Replace String with SedDealing with copying file and modify it's content replacing strings over and over again? Some of us uses the approach of editing files using vim then executes find and replace command.
Find and replace command on vim
:s/OLD_STRING/NEW_STRING/g
But if you are already aware of the content of the file that your going to copy and just want to simply replicate it with modified context, then you Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-20502730750660329942010-06-05T15:48:00.001-07:002021-05-23T00:08:09.787-07:00How to Install Huawei E220 on SliTazMy primary objective is to resurrect my old laptop (Toshiba 1065cds) using SliTaz, an open source free operating system, and have an internet connection using Sun Broadband post-paid plan.
Installing SliTaz is very easy, because it is very small, light and easy to use. But now the challenge begins, how will I able to make the modem work on my newly resurrected laptop? I've been looking over theUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-12060101429742182842010-06-05T15:39:00.001-07:002021-05-23T00:09:15.251-07:00Solution for Flash Cookie BugFlash cookie bug can be solved by creating `.htaccess` for `uploadify.php`. .htaccess removes any authentication of uploadify.php and prevents firefox from crashing.
First, create .htaccess file within the same folder with uploadify.php.
Here is my .htaccess
<Files "uploadify.php">
Satisfy Any
</Files>
And here is the script for my uploader:
<script type="text/javascript">Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-82006247375614416282010-06-02T00:14:00.002-07:002021-05-23T00:09:22.819-07:00Disable startx on UbuntuI was having an issue starting up my Ubuntu (installed on a VMware) on a command line instead of it's default Desktop. After some googling, I was able to solve my problem with these simple steps on how to disable startx.
First it is important you create a backup copy of your file.
$ cp /etc/X11/default-display-manager /etc/X11/default-display-manager.orig
Then replace it's content with false
$ Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-23190530750195515982010-05-28T00:15:00.001-07:002021-05-23T00:09:33.551-07:00Selenium Remote Control on LinuxThis a tutorial about front-end unit testing using Selenium Remote Control and Firefox on a headless Linux server.
Requirements
Selenium Remote Control
Firefox
Xvfb (X Windows Virtual Frame Buffer)
PHPUnit
Install Selenium
$ wget http://selenium.googlecode.com/files/selenium-remote-control-1.0.3.zip
$ unzip selenium-remote-control-1.0.3.zip -d /opt/selenium-remote-control-1.0.3
$ ln -s /opt/Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-69678137069800770692010-05-08T00:40:00.001-07:002021-05-23T00:09:43.345-07:00How to Configure phpUnderControlhttp://docs.google.com/present/view?id=dfc724c8_4cmdtpqhsConfiguring phpUnderControl
This an overview of configuring phpUnderControl. This includes adding projects using phpUnderControl's command line, enabling PHP Mess Detector, enabling Artifacts, and adding new tab on phpUnderControl's menu.
Install Cruisecontrol
Requirements:
- Java
- Ant (CC ships with its own copy of Ant)
Install Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-24791563026298648822010-05-08T00:23:00.002-07:002021-05-23T00:09:53.247-07:00CruiseControl Common Build ProcessCron automatically switches project's working directory into the latest tag or branch based on which of them has the latest revision number.
Project's SVN log were constantly checked by CruiseControl and once detected build process will start.
Pre-Build contains code tests and analysis that needs be executed before project deployment.
SVN Update will retrieve any files missed by the last time Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-50608233288375020702010-04-29T21:19:00.001-07:002021-05-23T00:10:00.820-07:00Remote Deployment with Ant and RsyncRemote Deployment with Ant and Rsync - this tutorial will teach us how to deploy projects on a remote server. This is very suitable especially for those who implements Continuous Integration where you will deploy projects upon every successful build or after passing all through unit tests, code analysis, and load testing.
Ant sample buildfile
Add this to your Ant's buidlfile (e.g. build.xml)
&Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6699011866731176514.post-36757068895094418112010-04-27T23:39:00.004-07:002021-05-23T00:10:18.499-07:00How to Install phpUnderControlSetting Up and Configuring phpUnderControl - this tutorial will teach us how to install phpUnderControl.
phpUnderControl is an addon application for the continuous integration tool CruiseControl, which integrates some of the best PHP development tools. This project aims to make your first steps with CruiseControl and PHP as easy as possible. Therefore phpUnderControl comes with a command line Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-38982220645130183542010-04-27T23:39:00.003-07:002021-05-23T00:10:10.847-07:00How to Install CruiseControlSetting Up and Configuring CruiseControl - learn how to install cruisecontrol.
This page is primarily focused on installing and configuring CruiseControl on Linux which includes
- Procedures on Running Your Very First CruiseControl Server
- Implementation of phpUnderControl
- Adding New Projects on CruiseControl
- Integration of Some of the Best PHP Development Tools.
Requirements
Some Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6699011866731176514.post-56894341552763557482010-04-23T01:32:00.001-07:002021-05-23T00:10:27.477-07:00How to Fetch YSlow Beacon Result and Save as HTMLHow to Fetch YSlow Beacon Result and Save as HTML
Introduction
YSlow analyzes web page performance by examining all the components on the page, including components dynamically created by using `JavaScript`. It measures the page's performance and offers suggestions for improvement. YSlow is integrated into the Firebug web development tool for Firefox.
On this tutorial, we will learn how to Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6699011866731176514.post-59699370588861135612010-04-23T01:20:00.001-07:002021-05-23T00:10:57.716-07:00Graphical Plot of Xdebug CachegrindGraphical Plot of Xdebug Cachegrind - Update for How to Create Graphical View of Xdebug's Cachegrind Output.
This a command line approach of profiling a single php script using Xdebug. Running Xdebug profiler from CLI is simply by executing your php script along with xdebug directives using `-d` option, this will then create a cachegrind file which we're going to convert into a visual plot usingUnknownnoreply@blogger.com0