<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Programming Life &#187; PHP</title>
	<atom:link href="http://blog.coding.ro/topics/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.coding.ro</link>
	<description>Coding Through Life</description>
	<lastBuildDate>Mon, 21 Sep 2009 20:54:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>OSX Leopard on Compaq Presario A900</title>
		<link>http://blog.coding.ro/2009/09/osx-leopard-on-compaq-presario-a900/</link>
		<comments>http://blog.coding.ro/2009/09/osx-leopard-on-compaq-presario-a900/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 20:46:47 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[A900]]></category>
		<category><![CDATA[Compaq]]></category>
		<category><![CDATA[GMA x3100]]></category>
		<category><![CDATA[hackintosh]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[OSx86]]></category>
		<category><![CDATA[Presario]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=91</guid>
		<description><![CDATA[After a long weekend of trials and errors I&#8217;ve finally managed to properly install Leopard 10.5.6 on my laptop. I have Leopard on my desktop along side windows 7 and is running fast, really fast. Although I knew  from the start that installing on my Presarion A944 it will not be as easy as on [...]]]></description>
			<content:encoded><![CDATA[<p>After a long weekend of trials and errors I&#8217;ve finally managed to properly install Leopard 10.5.6 on my laptop.</p>
<p>I have Leopard on my desktop along side windows 7 and is running fast, really fast. Although I knew  from the start that installing on my Presarion A944 it will not be as easy as on the desktop I just couldn&#8217;t help it.</p>
<p>First of all the prerequisites for this adventure :</p>
<ol>
<li>iPc Leopard DVD (search your favorite torrent site for it)</li>
<li>One piece Compaq Presario A900 laptop (get it from wherever you prefer). Mine is A944CA.</li>
<li>A complete list of hardware items that your Presario has. Here is my list:</li>
</ol>
<ul>
<li>Intel GMA X3100 videocard</li>
<li>Intel ICH8 chipset</li>
<li>Atheros wireless card</li>
<li>Realteck RTL8139/810x network card</li>
<li>Conexant Audio</li>
</ul>
<p>OK. Here we go:</p>
<ol>
<li>Insert the DVD in the tray and boot the computer. Hit F9 when the message appears in order to change the boot priority and select the DVD.</li>
<li>After selecting the language for the installation, in the next screen open the disk utility.<br />
- select the HDD you want to use and choose &#8220;partition&#8221;<br />
- partition the disk as you like but in &#8220;options&#8221; area choose GUID (here you loose all data on the selected HDD so please be careful what you want)<br />
- select one partition and format it as Mac Journaled<br />
- close the disk utility</li>
<li>Hit Continue until you have the &#8220;Customize&#8221; button available, then hit &#8220;Customize&#8221;<br />
- Drivers &gt;&gt; Video &gt;&gt; Intel &gt;&gt; GMA x3100<br />
- Drivers &gt;&gt; Chipset &gt;&gt; Intel ICHxx<br />
- Drivers &gt;&gt; Audio &gt;&gt; Others &gt;&gt; Conexant<br />
- Drivers &gt;&gt; Ethernet &gt;&gt; RTL8139 (something similar, I can&#8217;t remember exactly the string)<br />
- Drivers &gt;&gt; Wireless &gt;&gt; Atheros (for some reason wireless is not working&#8230; yet, but I&#8217;m a persistent son of a &#8230; so I&#8217;ll post updates on that)<br />
- from fixes I only chose Keyboard PS2 as it seems not to work without it (no keyboard attached message)<br />
- hit &#8220;Continue&#8221; and the installation should go perfectly fine for&#8230; 10 minutes tops.</li>
<li>This is really important.<br />
After the installation is finished, after restart press any key at OSX boot, enter -x at the prompt and hit the return key. This will boot Leopard in safe mode.<br />
After completing the installation with all the required data (user name, pass, etc&#8230;)  you will have to perform a special trick to get the Video working in normal mode (as opposed to working only in safe mode).<br />
Navigate to System &gt; Library &gt; Extensions and remove 2 kexts (actually move them somewhere to have a backup):<br />
- AppleIntelIntegratedFramebuffer.kext<br />
- AppleIntelGMAX3100.kext</li>
<li>Restart the Computer</li>
<li>Enjoy</li>
</ol>
<p>What is not working:</p>
<p>- Video does not have QE support (not yet as far as I know)<br />
- Wireless not working (although I have an 80% sure bet on the reason&#8230; will investigate)</p>
<p>Everything else works as expected and  I&#8217;m actually quite please with the performance.</p>
<p>As a warning for the hackintosh newcomers: If you&#8217;ve never done this kind of testing installation before, find someone who did to help you out because you may have different hardware setup than I do and that would change step 3 completely. It&#8217;s always better to have someone experienced around the first time (yeah, that works for computers too <img src='http://blog.coding.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p>For those of you that are really serious about the PC OSX business, <a href="http://www.osx86project.org/" target="_blank">http://www.osx86project.org/</a> is the place to find everything you need to know.</p>
<p>That being said, please don&#8217;t blame it on me is you lose your data or crush the computer.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/2009/09/osx-leopard-on-compaq-presario-a900/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lotto numbers PHP generator</title>
		<link>http://blog.coding.ro/2008/08/lotto-numbers-php-generator/</link>
		<comments>http://blog.coding.ro/2008/08/lotto-numbers-php-generator/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 07:58:32 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[6/49]]></category>
		<category><![CDATA[loto]]></category>
		<category><![CDATA[lotto]]></category>
		<category><![CDATA[number generator]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=17</guid>
		<description><![CDATA[A small search on Google showed me that most of the existent Lotto Number Generators are shareware, so I decided to write a tiny PHP script that does the basic job: ?View Code PHP1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 &#160; &#60;?php $generated = array&#40;&#41;; &#160; while [...]]]></description>
			<content:encoded><![CDATA[<p>A small search on Google showed me that most of the existent Lotto Number Generators are shareware, so I decided to write a tiny PHP script that does the basic job:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p17code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p172"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p17code2"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #000088;">$generated</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$generated</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$no</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mt_rand"><span style="color: #990000;">mt_rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">49</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/array_search"><span style="color: #990000;">array_search</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$no</span><span style="color: #339933;">,</span> <span style="color: #000088;">$generated</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
             <span style="color: #000088;">$generated</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$no</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">echo</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; : &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$generated</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/2008/08/lotto-numbers-php-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How can we import data in MySQL from CSV file</title>
		<link>http://blog.coding.ro/2008/04/how-can-we-import-data-in-mysql-from-csv-file/</link>
		<comments>http://blog.coding.ro/2008/04/how-can-we-import-data-in-mysql-from-csv-file/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 21:19:36 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CSV file]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[import data]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=13</guid>
		<description><![CDATA[Run this SQL script either from a mysql console or from your favorite scripting language (PHP, PERL&#8230;) LOAD DATA LOCAL INFILE &#8216;/path-to-file/dump_file.csv&#8217; INTO TABLE table_name FIELDS TERMINATED BY &#8216;,&#8217; LINES TERMINATED BY &#8216;\n&#8217; (Field_1, Filed_2, Field_3); I believe the syntax is more than clear so I won&#8217;t bother explaining too much.]]></description>
			<content:encoded><![CDATA[<p>Run this SQL script either from a mysql console or from your favorite scripting language (PHP, PERL&#8230;)</p>
<p>LOAD DATA LOCAL INFILE &#8216;/path-to-file/dump_file.csv&#8217;<br />
INTO TABLE table_name<br />
FIELDS TERMINATED BY &#8216;,&#8217;<br />
LINES TERMINATED BY &#8216;\n&#8217;<br />
(Field_1, Filed_2, Field_3);</p>
<p>I believe the syntax is more than clear so I won&#8217;t bother explaining too much.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/2008/04/how-can-we-import-data-in-mysql-from-csv-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How can we export MySQL data as CSV</title>
		<link>http://blog.coding.ro/2008/04/how-can-we-export-mysql-data-as-csv/</link>
		<comments>http://blog.coding.ro/2008/04/how-can-we-export-mysql-data-as-csv/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 21:12:23 +0000</pubDate>
		<dc:creator>sonix</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[MySQL dump]]></category>

		<guid isPermaLink="false">http://blog.coding.ro/?p=12</guid>
		<description><![CDATA[IN PHP: ?Download mysql2csv.txt1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 $table2dump = 'table_name'; $file_content = ''; &#160; $sql = &#34;SHOW COLUMNS FROM &#34; . $table2dump ; $res = mysql_query&#40;$sql&#41;; while &#40;$row = mysql_fetch_assoc&#40;$res&#41;&#41; &#123; $file_content .= $row&#91;'Field'&#93;.','; &#125; $file_content = substr&#40;$file_content, [...]]]></description>
			<content:encoded><![CDATA[<p>IN PHP:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.coding.ro/wp-content/plugins/wp-codebox/wp-codebox.php?p=12&amp;download=mysql2csv.txt">mysql2csv.txt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p124"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p12code4"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$table2dump</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'table_name'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$file_content</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SHOW COLUMNS FROM &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$table2dump</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_assoc"><span style="color: #990000;">mysql_fetch_assoc</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$file_content</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Field'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">','</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$file_content</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_content</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$table2dump</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_assoc"><span style="color: #990000;">mysql_fetch_assoc</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$file_content</span>  <span style="color: #339933;">.=</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: application/vnd.ms-excel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-disposition: csv; filename=&quot;</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;_&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$table2dump</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;.csv; size=&quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_content</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$file_content</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.coding.ro/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.coding.ro/2008/04/how-can-we-export-mysql-data-as-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
