Wednesday, December 15, 2010

Malaysia E-Hadith

Malaysia E-Hadith

Website nih bagus bagi yang tak ada buku hadith dan juga cool sebab boleh search. So boleh lah anda cari hadith-hadith tertentu yang dapat membantu

http://ii.islam.gov.my/hadith/hadith.asp

Mintak panjang umur dan murah rezeki?
http://ii.islam.gov.my/hadith/hadith1.asp?keyID=1264

Siapa orang yang betul-betul miskin?
http://ii.islam.gov.my/hadith/hadith1.asp?keyID=1667

Tuesday, December 14, 2010

FPDF - MutiCell - underline on each line

FPDF - MutiCell - underline on each line


Draw line under each line when new line is created when using FPDF. Or simply like picture below


Lazy to put picture


 


If you are using FPDF and want to make a line at the bottom of the text using Muticell, the parameter you send willl be like this


$pdf->MultiCell( 10, 100, "Hello World", 'B')


Where the 'B' represent line at bottom


 


But if you have a case like $pdf->MultiCell( 10, 100, "Hello \nWorld", 'B') //New line


or $pdf->MultiCell( 10, 100, "Hello World Hello World Hello World Hello World Hello World Hello World ", 'B') //Text too long auto new line


They will look like this


Lazy to put picture


 


And what you want is to look like this


Lazy to put picture


 


If you change the text into underline, it also does solve the purpose but it is not underline upon cell. It will be underline upon text


Lazy to put picture


 


So what left is only a tweak to the FPDF where I will tell you where to modify, which is in the function MultiCell(...) of course


First of all, I'm using FPDF version 1.53 (2004-12-31) where Olivier PLATHEY said "You may use and modify this software as you wish."


So this tweak is legal


Second, this code I write is free you may use and modify what I code as you wish. This is also 'AS IS', if anything happen dont blame me


If got bug, I dont care because with this code I already manage to get what I want


 


Lets start


 


Step 1


Go to the function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0)


 


Step 2


Inside there, you will see function Cell(...) is called 4 times and what you need to do is add additional code at the bottom of cell number 1 and 3


If I was correct


Cell no 1 is at line 755


Cell no 3 is at line 794


 


Step 3


Make the code to look like this. Make it like that at the 1st and 3rd cell



$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);

//Hassif. If you want the Multicell to have a bottom line at each text. use this
//Common border 'B' only bottom line at the end of text. Not at each line of text
if( strpos($border,'Z')){
$this->Line( $this->x, $this->y, $w+$this->x, $this->y);
}



 


Step 4


It done. So to use this feature you need to put $pdf->MultiCell( 10, 100, "Hello \nWorld", 'BZ') which is additional 'Z' character


 


Im kind of busy right now to explain further, so later...

Thursday, November 25, 2010

mysql find duplicate record

I take it from here. Put in my own blog cause I keep using them
http://www.petefreitag.com/item/169.cfm

SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )

SELECT email
FROM users
GROUP BY email
HAVING ( COUNT(email) = 1 )

31 May 2011
It turns out these code was pretty awesome when I want to make a dynamic drop down selection
I can make it display unique value and sorted by most use at the top

Thursday, November 4, 2010

Redhat I always use command

Last update, 25 April 2011
This is not only for Redhat, but for most of Linux machine (I think)

Source of this command is from here. I keep using them
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/s1-manipulate-current.html
http://redhat.activeventure.com/71/gettingstartedguide/s1-managing-working-with-files.html

This is a good reference for VI - Visual Editor (Command line interface for text editor)
http://www.cs.colostate.edu/helpdocs/vi.html

Check folder size
du -hs /path/to/directory


Check harddisk space
df


List all the content within the current folder (or path)
ls OR ls -all


Remove file
rm thefilename.txt


Move file
mv thefilename.txt /home/asipo/


Delete directory and all its content
rm -rf /home/asipo/backupdocuments


Zip a file or folder
zip -r iWantTheZipFileNameToBeLikeThisOkay.zip theActualFileName.txt


Unzip a file (not sure for folder)
unzip thefilename.zip


Change folder owner
chown -R asipo.asigroup '/var/www/smellynomore/app/tmp'


Change folder permission
chmod -R 777 '/var/www/smellynomore/app/tmp'


Copy all except one folder

shopt -s extglob
cp -r A/!(B) dest_dir


Execute bin file
chmod u+x qt-sdk-linux-x86-opensource-2010.05.1.bin
./qt-sdk-linux-x86-opensource-2010.05.1.bin

Connect to server and control it (Telnet / SHH I think)
ssh -p 22 asipi@langit.com.my

Monday, October 11, 2010

Detect keyboard button press

This javascript function is to detect KEYCODE of the keyboard you press.
Note that pressing 'P' will not return 'P' but they will send signal in integer called KEYCODE

This is engineering guys who did it, so we IT guys just follow. Dont questioned

To detect and return what is the KEYCODE for each button. Refer this link
http://help.dottoro.com/ljlkwans.php

Or I give you guys the code, ha

Javascript code
function callSearchPressEnter(event)
{
var keyCode = event.which;
if (keyCode == undefined)
{
keyCode = event.keyCode;
}
alert ("The Unicode key code is: " + keyCode);
}


For the HTML
bla bla bla onkeydown="callSearchPressEnter(event)"

Monday, October 4, 2010

Convert PDF into Excel or Words

I use Able2Extract Pro. Of course I download the Pirate one with the crack

Thursday, September 30, 2010

PHP ' become '

in PHP What happen when I output the string into text file is
The character ' become '

Copy this ' to create this '

' is a html character special code that represent ' symbol
Means it will display correctly as ' if you see it in web browser

Simply solving the problem by html_entity_decode( "'", ENT_QUOTES)

Note that html_entity_decode( "'") will not work
I found this solution in some page (didnt remember the site URL, sorry >.<)

So what is this html_entity_decode(...) function?
It is use to convert special html character into the normal character
Detail was in http://php.net/manual/en/function.html-entity-decode.php

The inverse of it was htmlentities(...)
Detail was in http://www.php.net/manual/en/function.htmlentities.php

Tuesday, September 28, 2010

Software Architecting Success Factors and Pitfalls

My boss give to my email so sharing it with myself

Software Architecting Success Factors and Pitfalls

The top critical success factors for the architecting effort that we have identified are:

The architecting effort must:

* address a strategic business objective of your key sponsor
* have a good lead architect with well-defined role and style
* have a lead architect and architecture team who are able to "sell" (lead); conversely, the organization must be willing to "buy into" (follow)
* contribute immediate value to developers (utilizers of the architecture)

The architecture is more likely to be successful if:

* there are architecture advocates at all levels of the organization
* architecture is woven into the culture
* there is customer involvement/pressure/demand

Critical Success Factors

* Interpersonal and team communication and ownership
* Leadership
* Vision
* Teamwork
* Availability of talent/resources
* Must have strong management sponsorship
* Market/business understanding
* Good match between technology and business strategy
* Customer focus
* Clear specifications including dependencies
* Simple architecture
* Deployed in phases/incrementally
* Architecture is understandable by all
* Solve at least the current problem
* Validation of requirements during each step of the process
* Project management

The architect must have the following skills:

* good domain knowledge
* good communicator/listener
* good persuader
* good project management skills

The architect must

* have a clear and compelling vision
* champion the cause
* provide constructive feedback

Pitfalls

* Poor leadership
* Thinking at too low a level
* Poor communication inside/outside the architecture team
* Not enough "selling"
* Lack of resources/talent
* Poorly designed roles and responsibilities
* Bad design/idea
* Lack of extensibility
* Doesn't solve the project team's problems
* Lack of control/authority
* Requirements unclear, not well-defined, not signed off, changing
* Architecture team loses touch with the product team's problems
* Product team believes "we can solve it better ourselves"
* Development management not penalized for "stalling"
* Politics

PHP display all error on server

If you do the programming in localhost (yours PC) the debugging might be easier
But when uploaded into the server, the error come out (even in localhost is okay)

So you need to debug at the server because only the server have the error. Mostly because of develop in Windows while server in Linux cause the error

So you need these code
Taken from http://www.wallpaperama.com/forums/how-to-display-php-errors-in-my-script-code-when-display-errors-is-disabled-t453.html

I write it here

ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);



I know these can be done in PHP cause I meet the code before, but until now still didnt find the 'easy copy paste' yet. So the tutorial really save my day

these code will display the error (Including Notice)
*Notice is not an error, program can still continue

Saturday, September 25, 2010

Antivirus software, comodo

Here Im going to give opinion about anti virus software
Im using comodo internet security (free)
From here http://www.comodo.com/

If you are using kaspersky (need to pay). Im going to say yes kepersky is better
I have try bitdefender before this, still kaspersky is the best

If you want to use free anti virus software which is comodo
I going to tell you comodo has several classification in security

1. Anti virus
2. Internet security
3. Smart Defence+

what is this 3 things?

Antivirus
Is detect and remove virus
Its detect the virus when you open a folder or while performing a scan
After detect they will remove it
Not good antivirus software will not be able to detect a virus
Personally these comodo dont have a good antivirus so I dont install it

Internet security
It is a whole large topic with a purpose protect from Internet harm such as Hack, Spam etc etc. There is alot of way these guys do to hack so does security do to prevent. I install these feature in comodo

Smart Defense +
This is a new term in computer security. The base idea was a spam and telling you that these program abc.exe is running. Do you want to proceed? then you may decide yes or no.
Comodo are good enough to tell you that the program is safe. But still is depend on the situation. For an example, I was installing some game and they telling me is it?. If you are not computer literate you may suspect the game is a virus but most of the case, you know that what you do so you know that that is a game Im about to install so that was not a virus.
Basically this is the most important feature I need in my computer and the main reason why Im using comodo

Friday, September 17, 2010

Zip file

I always forget bout this, so its for myself note
zip -r filename.zip files

Wednesday, September 15, 2010

Fedora Install LAMP

Lazy to write, so
http://techchorus.net/how-install-lamp

restart the LAMP
service mysqld start
service httpd start

How to install x-debug
http://paulslinuxbox.net/blog/linux/eclipse-php-and-xdebug

Install RMPFusion

Keywords
install RMPFusion
Fedora cant play mp3 file
Fedora packages: failed to install signature

What is RMPFusion

If you are new to Fedora. RMPFusion is a 3rd party software source list
Means all installer that is 'FREE' but 'NOT REALLY FREE' like flash player was listed here

Some EMO EMO
I create this tutorial because I cant play mp3 file because of failed to install the 3rd party software. The reason was not on the software source but on the signature key that not being teach during "how to install the 3rd party source list". Probably this is easy but IM USING WINDOWS!

Start the Tutorial
Go to http://rpmfusion.org/

1st step - Put RMPFusion in yor list
Download the .rpm file. These file is an installer to make RMPFusion as your 3rd party source list
Note you need to Install both Free and Non-Free

2nd step - Verify the Signature
Download the signature
Import the signature


This is the link where I learn how to install (import actually) the signature http://fedoraproject.org/wiki/Enabling_new_signing_key

To put it simply su -c 'rpm --import NAME_OF_THE_SIGNATURE_FILE'

In my PC it will be
cd Downloads
su
mypassword1234
ls
su -c 'rpm --import RPM-GPG-KEY-rpmfusion-free-fedora-13'
su -c 'rpm --import RPM-GPG-KEY-rpmfusion-nonfree-fedora-13'

Tuesday, August 31, 2010

FPDF °C become °C

Keyword
FPDF °C become °C
FPDF °C problem
FPDF symbol problem
FPDF degree celsius temperature problem

I having a bug when I create a file from FPDF the character when wrong.
The wrong is the symbol where °C become °C

I try to change the FPDF font into UTF-8 by embedding UTF-8 font into it but still problem (my database and html page display the °C correctly)

after several experimenting cause googling is failed (4 hours of stress)
the reaseon is because of my page encoding. FPDF write into the paper using 'ISO-8859-1' encoding.
Thus UTF-8 is °C and when it write it become ISO-8859-1 which is °C

So long for the chatting lets cut to the point

use utf8_decode("°C") will solve your problem. It will convert UTF-8 to ISO-8859-1

HOpe this help cause 'quick googling' disappoint me

Just for my own reference to converting string

Javascript change dropdown or select option value which is index

I google for "javascript change select value" and turn out not really help full
The keyword for select is more like dropdown
while the value is index
So it must be "javascriptchange dropdown index"

The purpsoe of this post is a javascript is to change the selection inside the dropdown into something you want.



Just like the dropdown above. The default value is seet to the first option which is "Hello"
When I click a certain script with value "World", the script will change the dropdown into to "World". This is what I want. Below is the code


function changeDropDown( dropdownidname, dropdownvalue)
{
var testingga = window.opener.document.EditView.elements[dropdownidname];
//In most case it will be document.getElementById(dropdownidname); I think

for (var i=0; i < testingga.length; i++)
{
if (testingga[i].value == dropdownvalue)
{
testingga[i].selected = true;
}
}
}

Tuesday, August 10, 2010

Web Graph

I surfing the net and come across with this http://www.rgraph.net
It provide you with a graph creation for website development. Pretty nice compared with JPGraph
Its a free for non business (only 1 time payment for business)

Friday, July 16, 2010

PHP Display array pre print_r into list button ul li

Related
Display array in list (collapsable)
Display array in print_r
Display array in ul li
Display array in pre

Usually in programming, when you debugging an array you will be using the pre and print_r
This is all right when the data is small. But if the array size is very large things will be hard which is happen to me lately.

So I create a function that display the array on the list. Plus this list is collapsible and it is a very simple code. Only 2 function needed

function thejavascriptrewrite()
{
echo "<script type='text/javascript'>";

echo "
function switchme( \$theId)
{
\$theElement = document.getElementById(\$theId);

if( \$theElement.style.display == 'none'){
\$theElement.style.display = '';
}
else{
\$theElement.style.display = 'none';
}

}
";

echo "</script>";
}

function arraytolist( $data, $iteration = 0, $fortheUL = null)
{
$idName = "someCounterId";

echo "<ul $fortheUL>";

foreach( $data as $key => $value)
{
if( !is_array($value)){
echo "<li>";
echo "[$key]=".$value;
echo "</li>";
}
else{

$iteration++;
$totalArray = count( $value);

echo "<li>"."<a onclick=\"switchme('$idName".$iteration."')\">$key ($totalArray)</a>";
$forNextUL = "id='$idName".$iteration."' style='display: none;'";
$iteration = arraytolist($value, $iteration, $forNextUL);
echo "</li>";
}
}

echo "</ul>";
return $iteration;
}

How to use?

paste this code

$data = array( 'abc', 'def', 'ghi');
thejavascriptrewrite();
arraytolist($data);

Tuesday, July 13, 2010

Jquery from Novice to Ninja

Sitepoint offer free Ebook "Jquery from Novice to Ninja" when Spain win the World Cup and I downloaded the Ebook (9MB) for free!

Saturday, July 3, 2010

HTML CSS Change Paragraph Spacing

I do some google to change my website design to change paragraph spacing and come across to this page. Its show the link that related to it

The site is http://answers.google.com/answers/threadview/id/783141.html

While the reference website is
  • http://lab.artlung.com/change-space-between-paragraphs/
  • http://www.w3schools.com/css/css_margin.asp
  • http://www.westciv.com/style_master/academy/css_tutorial/properties/margin.html

All the link given is suggesting you to using css margin.
As for me, by using this already enough
<p style="line-height: 200px;">Hello World</p>

Friday, June 11, 2010

Display and Disable Super hidden file

Yuu all know most of virus is hidden and the most typical way for them to infect you PC was through portable media like pen drive or portable harddisk.
I got alot of this case when I put my portable HDD to my friend. Luckyly I got antivirus to detect them but not to remove them.

The problem is the virus file is hidden and its not just typical hidden. Its a 'Super hidden file' where your 'Tool > Folder option > Show hidden file and folder' wont help at all.
So to encounter this you must use the command line aka cmd

So, type 'cmd' at run.

Navigate the 'cmd' into the portable media. In my case is typing 'I:' which direct me into I:\>



After that type 'dir /ah' and I see the virus! which is rfg.exe and his buddy autorun.inf.



The problem is I can see it in cmd but cant see in normal view.
So I disable their 'super hidden' using cmd by typing
'attrib -s -h -r rfg.exe' and 'attrib -s -h -r autorun.inf'

After typing these 2 things and It shows. So I delete them.

Just for friendly reminder. Never double click portable media. Right click and 'Explore' is the easy safest way.

Thats it, hope its usefull

*note
I just encounter another virus in my PenDrive but this method does not work
So this tutorial is not going to 100% solve your problem

Friday, June 4, 2010

Rounded border

After several research.
Here is the thing that is needed to create rounded rectangle.
This works on FF and GC. Not on IE and dont know on others

-moz-border-radius: 20px 20px 20px 20px; background: none repeat scroll 0 0 #D8DEEF;
border-bottom-left-radius: 20px 20px;
border-bottom-right-radius: 20px 20px;
border-top-left-radius: 20px 20px;
border-top-right-radius: 20px 20px;

Sunday, May 23, 2010

Playing with date

Since I easily forget about MySQL date function. I wrote this to myself.

I have a field name `created` with DATETIME format like 2010-05-24 11:24:05

Using the MySQL function
SELECT NOW() give you the latest time like 2010-05-24 11:24:05

SELECT CURDATE() give you the current date like 2010-05-24

So I available command is. Lets say the current time is 2010-05-24 11:24:05
SELECT YEAR( NOW()); will return 2010
SELECT MONTH( NOW()); will return 05
SELECT DAY( NOW()); will return 24
SELECT TIME( NOW()); will return 11:24:05
SELECT HOUR( NOW()); will return 11
SELECT MINUTE( NOW()); will return 24
SELECT SECOND( NOW()); will return 05

*Note
SELECT YEAR('2010-05-24 11:24:05'); will also return 2010


To select a record in the same month
SELECT * FROM table WHERE YEAR(`created`) = YEAR(CURDATE()) AND MONTH(`created`) = MONTH(CURDATE())

Another format is like this
SELECT name, created FROM customer
WHERE created BETWEEN '2010-01-04 00:00:00' AND '2010-01-06 00:00:00';

*Take note the field registerdate format is DATETIME()
*Take note that the date range in the between must be from low to high

These is a function to take the 'current amount from stock forecast'. Let say with these situation
15 March 2011, Gold price will be 2.0
20 March 2011, Gold price will be 2.1
30 March 2011, Gold price will be 2.2

Today is 25 March 2011. So the SQL will return "Gold price will be 2.1"
So these is the SQL
"SELECT `goldprice` FROM `vtiger_goldforecast` WHERE `datestart` <=CURDATE() ORDER BY `vtiger_goldforecast`.`datestart` DESC LIMIT 1";



Update 1.2 (25 Nov 2011) - Select a record within a date
Case: The table has start date and end date. You want to retrieve a record where today is still withing the start and end date

SELECT * FROM special eventWHERE NOW( ) BETWEEN startdate AND enddate


Thats for today, version 1.1
Going to update later

Saturday, May 22, 2010

Javascript get screen browser size resolution

You might find it everywhere but I just keep this link for my own reference.
Normally it would be like this
screen.height
screen.width

*There is a difference using screen with the link given

But this tutorial is more focus on Window size and scrolling
http://www.howtocreate.co.uk/tutorials/javascript/browserwindow

Creating a popup
http://www.blazonry.com/javascript/windows.php


As for concolusion. I create a popup handle


//Create a popup
function popup( link, senderId)
{
//Get the browser resolution
var width = getBrowserWidth();
var height = getBrowserHeight();

//alert( width + "=" + height + " - " + screen.width + "=" + screen.height);

//Reduce the screen by 20%
width = width * 0.8;
height = height * 0.8;

//Put the popup at the middle of the page
var left = (screen.width/2)-(width/2);
var top = (screen.height/2)-(height/2);

//alert(senderId);

popupWindow = window.open( link, "popupWindow", "width="+width+",height="+height+",top="+top+",left="+left+",scrollbars=yes,toolbar=no,location=no,menubar=no,resizable=no,directories=no");
popupWindow.focus();
}


//Change the innerHTML based on the given Id
function changeInnerHTML( elementName, theValue)
{
var theElement = window.opener.document.getElementById(elementName);
theElement.innerHTML = theValue;
}


//Change the value based on the given Id
function changeValue( elementName, theValue)
{
var theElement = window.opener.document.getElementById(elementName);
theElement.value = theValue;
}


//Get the browser width
function getBrowserWidth()
{
var myWidth = 0;

if( typeof( window.innerWidth ) == 'number' ) {
myWidth = window.innerWidth; //Non-IE
}
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
myWidth = document.documentElement.clientWidth; //IE 6+ in 'standards compliant mode'
}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
myWidth = document.body.clientWidth; //IE 4 compatible
}

return myWidth;
}


//Get the browser height
function getBrowserHeight()
{
var myHeight = 0;

if( typeof( window.innerWidth ) == 'number' ) {
myHeight = window.innerHeight; //Non-IE
}
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
myHeight = document.documentElement.clientHeight; //IE 6+ in 'standards compliant mode'
}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
myHeight = document.body.clientHeight; //IE 4 compatible
}

return myHeight;
}



Found out problem
1. Not really 'at center' if the browser zoom is not 100% (happen on FF as I found it out)

Want to use this code? its free and 'as is'

Tuesday, May 18, 2010

CakePHP iframe

I very new with iframe so i just job it down to myself

lets says I have a controller name customers, inside it has 3 function which is index, add and edit.

Inside the index.ctp, i put an iframe into it

like this
<a href="customers/edit/1" target="test">HREF</a>

<iframe name="test" width="500" height="200" frameborder="1" src="customers/add"></iframe>


Tho cool part is, it will load the customer/add into the iframe and when I click the hyper link, the customers/edit/1 will load

Saturday, May 15, 2010

Install and bypass window media player 11 validation

If you using a pirate Window XP and inside it is using Window media player 9, you might be want to upgrade it into window media player 11.

THe problem is during the installation the installer will detect your Windows is a pirate version.

To encounter this problem I simply found an easy solution at http://www.tech-recipes.com/rx/2577/wmp11_install_windows_media_player_11_without_activating_bypass_wga/

window media player is a better player from window because of its lightweight and nice interface. Playlist and music manager is also available.

Well, from the link given I simply give a short tutorial (repeating the same thing)

1. Download the window media player 11 at microsoft website (image below is the installer I downloaded)



2. Extract the installer wmp11-windowsxp-x86-enu.exe


3. After extract, It supposed to looks liek this


4. Run the wmfdist11.exe


5. Run the wmp11.exe


6. Restart you PC

6. And the WMP 11 is installed

Thats it

Thursday, May 13, 2010

CakePHP utf8 special character chinese character

i involve in some database with a chinese character.
It turns out my find('all') give me "????" for the chinese character

After some google, this is because database encoding. Its need to be utf-8
So this is the link thats help me http://nik.chankov.net/2007/10/01/cakephp-and-character-set-in-the-database/

Conclusion is, inside the database.php put the 'encoding'
class DATABASE_CONFIG {

var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'project_name',
'prefix' => '',
'encoding' => 'utf8'
);
}


What will happen actually is before any SQL query is executed.
It will execute this code first, I think.
"SET NAMES 'utf8'"


Just to remind something. If there is a case you table Collation/charset is not utf-8 means you will not be able to use Chinese character. So here is the tweak
ALTER TABLE 'tblcustomers' COLLATE utf8_general_ci;


And still, my website did not display the chinese character.
So I end it with
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf8"$gt;

and the problem is solve

Yeah!

PHP Error

Got this from Mark Baker at forums.devshed.com
where his signature says, which is use full if you don't have PHP debugging tool

error_reporting(E_ALL);
ini_set('display_errors', 1);

Wednesday, May 12, 2010

Store Password Manager

If there a case you have a many password to remember, the only solution is by storing it.

When talk about storing password in you PC, there always be a security issue.

in this case, I'm using KeePass as a Password manager

KeePass is free and highly encrypted password manager. More feature is describe in the website

You can get the link here http://keepass.info/index.html

Tuesday, May 11, 2010

MYSQL Export

I involve in some project where I need to do Export mysql table into .csv file

First of all, the table structure
CREATE TABLE IF NOT EXISTS `contacts` (
`id` int(20) unsigned NOT NULL auto_increment,
`name` varchar(200) NOT NULL,
`phonenumber` varchar(50) NOT NULL,
`group` varchar(50) NOT NULL,
`created` datetime default NULL,
`modified` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Contact detail' AUTO_INCREMENT=5 ;

INSERT INTO `contacts` (`id`, `name`, `phonenumber`, `group`, `created`, `modified`) VALUES
(1, 'Mr Number 1', '0126784669', 'Customer', '2010-05-12 09:50:57', '2010-05-12 09:50:57'),
(2, 'Mrs Testing', '0136785186', 'Customer', '2010-05-12 09:50:57', '2010-05-12 09:50:57'),
(3, 'Mr Bone', '0184531256', 'Staff', '2010-05-12 09:52:41', '2010-05-12 09:52:41'),
(4, 'Mr Gray', '0104578996', 'Staff', '2010-05-12 09:52:41', '2010-05-12 09:52:41');


Here is how to export the file into .csv
This code is in many blog and other tutorial
SELECT *
INTO OUTFILE "C:/Documents and Settings/asipo/My Documents/Downloads/contacts.csv"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM contacts
WHERE `group` = 'Customer';


But most of the website I found, does not show how to create a .csv file with a extra column header description into it.
So this is how I do it
SELECT 'Id', 'Name', 'Phone Number', 'Group', 'Created', 'Modified'
FROM `contacts` LIMIT 1
UNION
SELECT *
INTO OUTFILE "C:/Documents and Settings/asipo/My Documents/Downloads/contacts.csv"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ''
LINES TERMINATED BY '\n'
FROM `contacts`

As a result, you going to see somthing like this


Thats all

Wednesday, April 21, 2010

Software type list

I go into some website and its list down all its supported application.
here it is. Might be useful for me later if I want to do some project

Navigation
Fantastico Home
Control Panel Home

Blogs
b2evolution
Nucleus
WordPress

Classifieds
Noahs Classifieds

Content Management
Drupal
Geeklog
Joomla 1.5
Joomla
Mambo
PHP-Nuke
phpWCMS
phpWebSite
Siteframe
TYPO3
Xoops
Zikula

Customer Relationship
Crafty Syntax Live Help
Help Center Live
osTicket
PerlDesk
PHP Support Tickets
Support Logic Helpdesk
Support Services Manager

Discussion Boards
phpBB
SMF

E-Commerce
CubeCart
OS Commerce
Zen Cart

F.A.Q.
FAQMasterFlex

Hosting Billing
AccountLab Plus
phpCOIN

Image Galleries
4Images Gallery
Coppermine Photo Gallery
Gallery

Mailing Lists
PHPlist

Polls and Surveys
Advanced Poll
LimeSurvey
phpESP

Project Management
dotProject
PHProjekt

Site Builders
Soholaunch Pro Edition
Templates Express

Wiki
TikiWiki CMS/Groupware
PhpWiki

Other Scripts
Dew-NewPHPLinks
Moodle
Open-Realty
OpenX
PHPauction
phpFormGenerator
WebCalendar

Wednesday, April 7, 2010

Highlight table row when on mouse

What does this do?
Its highlight the table row when your cursor on the row
This is using CSS not using javascript.

Put this thing in your css
<style type="text/css">

.tablestes tr:hover { background-color: lime; }

.tablestes td:hover { background-color: red; }

</style>


And inside the html. name the table class into "tablestes"
<table class="tablestes">

<tr><td>Row 1</td></tr>

<tr><td>Row 2</td></tr>

<tr><td>Row 3</td></tr>

</table>

Sunday, April 4, 2010

About Me

Nothing much to talk about
This blog focused on something that I repeatedly used and want to remember it (got more draft than post)


Nickname: asipo
Location: malaysia
Email: keyboard4444 (@gmail.com) I seldom checking my email


If you are not a developer or programmer. This label might be useful, others will be just boring

Sunday, March 14, 2010

By pass FLV to MP3 Converter 1.5 Trial

This only apply for a software called FLV to MP3 Converter


See how to get and use it here http://asipi.blogspot.com/2010/03/flv-to-mp3-converter-15.html

Keyword:
FLV to MP3 Converter 1.5 Trial by pass register
Skip FLV to MP3 Converter register

I'm usually listen for Trance from youtube. Since I like some of them very much, I rip it!.
After rip the FLV file I will convert it into MP3 using FLV to MP3 Converter 1.5.

This all went smoothly until the Software ask me to register aka Pruchase.
Thus, in this tutorial. It will simply tell you how to by pass FLV to MP3 converter Trial

How did I rip from youtube?
http://asipi.blogspot.com/2008/11/steal-streaming-video.html

Back to the topic, after using it for 20 times (in my case). It will ask you to register






There is a way to skip it

Open registry editor and Ctrl+F (Find) for word "flv2mp3Count"

Or by manual
HKEY_CURRENT_USER > Software > Microsoft > MSUpdate

After the searching is complete it should be displaying flv2mp3Count Value Data 20 in Decimal

This means, the software is checking the number of times you convert a flv into mp3. It it is more than 20 it will ask you to register






After that, double click "flv2mp3Count"
then click the "Decimal" and change the Value Data into 0

Press OK and start the "flv2mp3.exe" again it should be running fine








Additional note to make it simple.

This is some build in code i make to automatically change the registry just by clicking it
Which is using "Registry Editor".
Its already build in most of Window XP I believe.






First of all, open a new notepad.
Copy this code using and paste it into notepad


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\MSUpdate]
"flv2mp3Count"=dword:00000000







And rename the notepad file extension name from .txt into .reg






After saving. Double click it at it should look like this



Thats all,
Hope its useful... guess not

FLV to MP3 Converter 1.5

Keyword:
FLV to MP3 Converter
Convert FLV into MP3
FLV to MP3

In this tutorial. I will simply tell you what software did I use to convert .FLV file into .MP3 and how did I use it

As you all known, .FLV file come when you rip a video clip from youtube.
Since I'm ripping a music, the video does not matter so this is the part where I need a converter, into .MP3 file of course

If you been wandering how did I rip the Video Clip from youtube, See here http://asipi.blogspot.com/2008/11/steal-streaming-video.html

After using it for 20 times, you need to purchase it. So this is how i skip it
http://asipi.blogspot.com/2010/03/by-pass-flv-to-mp3-converter-15-trial.html

So, the software that I use to convert from .FLV into .MP3 is called "FLV to MP3 Convert" version 1.5

Please note that there are many software that allow file converting. This is just one of them

You may download it from here http://www.smallvideosoft.com/
After download, install it





Run the application







Select the .FLV file you want to convert
(Hold crtl while clicking the file to select multiple file)





Start converting





See your result


Extra note
I also use some other FLV to MP3 Converter and realize that this FLV to MP3 produce a low quality .MP3 (64kbps, where 128kbps for typical .MP3 music)
Or its because of the the default setting since I'm using it.

Thats all,
Hope its useful... guess not

Saturday, February 13, 2010

Windows shortcut

Windows logo key
Display or hide the Start menu

Windows logo key+L
Lock the computer

Windows logo key+BREAK
Display the System Properties dialog box

Windows logo key+D
Show the desktop

Windows logo key+M
Minimize all windows

Windows logo key+SHIFT+M
Restore minimized windows

Windows logo key+E
Open My Computer

Windows logo key+F
Search for a file or folder

CTRL+Windows logo key+F
Search for computers

Windows logo key+F1
Display Windows Help

Windows logo key+R
Open the Run dialog box

Windows logo key+U
Open Utility Manager

Monday, February 8, 2010

Reduce Firefox memory usage

Keyword:
Optimize Firefox memory
Firefox memory usage too high

In this chapter
I will simply teach how to reduce your Firefox memory usage.
Usually my Firefox can reach from 100k-300k memory usage. But with this, about 60-90k

Case
Im using Firefox 3.6
Window XP Home Edition SP 3
This tutorial is actually come from aviransplace

The Setting
But here my settings. You can custom it as you want.
Refer to the aviransplace to know what is the value should be put
1. At the address bar, type "about:config" and press enter
2. browser.cache.disk.capacity = 4096
3. browser.cache.offline.capacity = 4096
4. browser.sessionhistory.max_total_viewers = 2


Note
When using Firebug for developing website. I realize that the more error Firebug detect, the higher my memory consumption (and it does not go down).
To view current memory chache usage type "about:cache?device=memory" at addressbar

Additional settings.
Take a note that Firefox plug-in also can affect you memory usage.
You can check it ad Tools > Add-ons
In my case I only leave
Firebug 1.5.0
Flashblock 1.5.11.2
LogMeIn 1.0.0.496

Once done. My 1 tab with google page consume me 70k memory usage

Another additional setting
In case you want a ad hock browsing. It is best for you to keep a FF with a safemode start.
Simply duplicate the Shortcut of the FF
At the new Icon Right click > Properties
And add new words "-safe-mode"
It become like this

"C:\Program Files\Mozilla Firefox\firefox.exe" -safe-mode

Guess what. Its 55k memory usage

Update on 19 July 2010
Now Im using Google Chrome (most of the time) because of FF will run 1 .exe file just for flash. I didnt remember the name but it was on the task manager. This result a very high CPU consumption in my PC. I heard it was because of latest FF and this is still on a testing phase.

Update on 22 April 20110
I think these method is already obsolete and cannot be use anymore

Wednesday, February 3, 2010

PHP trace error

Keyword
PHP trace error
PHP display error stack
PHP show error stack
PHP debug error
PHP show previous error

I believe many developer is well known of this, which is debugging your PHP code.

You might realize in WAMP (windows) the error display is at the current line.
Thus, if the error happen in a function tracking it down will be hard indeed since you dont know where the function is called.

To solve this problem, developer will use debugger tool.
In this case I will recommend Xdebug. http://xdebug.org/index.php

Here some screen shot on how the xdebug looks like


To install xdebug for window is pretty easy
1. Donwload the xdebug.dll file
2. Inside the php.ini, specifiy where you put the xdebug.dll file
3. Detail of the installation can be read at the xdebug documentation itself

good luck, kupo

Wednesday, January 20, 2010

phpmyadmin blank page too many table

If you were developer and just installed a WAMP in your machine.

There might be a problem where the phpmyadmin page goes blank after when you select the database.

And if you observe, this only happen when the number of table is too many.

Like this,


This problem is actually because of the setting in your php.ini config file

The setting title is called "Resource Limits". Search for this "Resource Limits" inside the php.ini and change to this.

You can set anything as long as its more than the default.
max_execution_time = 60
max_input_time = 60
memory_limit = 256M


After that, restart the WAMP and its solved.

This problem occured on WAMP5 Version 1.7.0

Notepad 2

Probably many ppl didnt know about "abit advance" version of notepad.
Its lightweight and almost similar to notepad.

Mostly, it is used by developer for quick editing.
As for me, i like it because its support syntax highlighting and show a line number

Here is where you can download it HERE

Some screen shot

Tuesday, January 12, 2010

Using FTP client

In this page, I will simply teach how to use FTP (File Transfer Protocol).
Its allow you to download and upload a file into another computer.

And of course, the permission to download or upload is determine by the another computer. Lets called it as server.

First of all, is the tool required to use this FTP.
In this case I will be showing using Mozilla Firefox 3.5.7 and Core FTP Lite.

Using Mozilla Firefox
Its simple, just type the ftp URL in the URL bar. Eg: ftp://abcxyz.com.my/
Please note that Mozilla Firefox is only a client. Thus, you can only download a file from it(not upload)








Using Core FTP Lite (free edition)
First of all, download the software first
http://www.coreftp.com/
http://download.cnet.com/Core-FTP-Lite/3000-2160_4-10256215.html



Once Install. Run the software and you may have something like this



Go to the Menu > File > Connect.
The ftp server is ftp://abcxyz.com.my/. Thus, inside the HOST/IP/URL is “abcxyz.com.my”.
The username and password is depends.
After all the setting, click “Connect” button.
To use the Core FTP is also easy. Just need to drag and drop for download or upload



Conclusion
This is a simple tutorial on how to use. There is also a lot of stuff that I didn't know. Google might help.

Please note that the exact FTP link is not.
See this website http://www.cs.tut.fi/~jkorpela/ftpurl.html to see the FTP real URL format.
Well, its like this ftp://user:password@host:port/path

Thursday, January 7, 2010

Flashblock

Flashlock is a Firefox add on that used to block all type of flash player.
Its let you to determine by your own to run the flash or not.

Benefit
Improve your internet speed since less data is loaded into your website page
Disable annoying advertisement

How do I get this?
Its in the Firefox add on website. Just search for "Flashblock"
Or simply click HERE
The installation should be easy for Firefox.

Here some example

Flashblock on FF Addon



Flashblock on the run

Friday, January 1, 2010

Disable yahoo messanger advertisement

Im using yahoo messenger 10. and this is how I disable their advertisement. AND ITS WORKING!

Please note that I have try many other way by googling such as editing the registry file and also downloading the tweak application.

And this method is available through many website either. So I just copy and paste the link HERE

Basically
At C:\Windows\system32\drivers\etc\hosts. Open the "hosts" with notepad.
And add "127.0.0.1 insider.msg.yahoo.com"

Please not that this method can also be use to disable a lot of thing. Once I saw they use it do disable the Adobe Professional pirate version from being black listed

Thats all,
Hope its useful... guess not