Wednesday, September 15, 2010

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>