SIDEBAR
»
S
I
D
E
B
A
R
«
Which word stands for what?
Sep 13th, 2009 by Mojtaba

Year 2038 Bug, Y2K38
Sep 6th, 2009 by Mojtaba

You may know that the Unix timestamp was limited to the years 1970 to 2038. You may ask why you are limited to the years 1970 through 2038. Well, it’s because the original developers of Unix chose the start of the year 1970 as the base date that no programmer should need to go before! The Unix designers also decided that nobody would be using Unix after about 70 years or so, and therefore believed they could get away with storing the timestamp as a 32-bit value—which will run out on January 19, 2038! This will create what has come to be known as the

Y2K38 bug (much like the millennium bug, which was caused by storing years as two-digit values, and which also had to be fixed). We have to hope it will all be solved well before we get too close to that date.

http://en.wikipedia.org/wiki/Year_2038_problem

حالا ماه شدی…
Sep 2nd, 2009 by Mojtaba

خوب به نظرم دیگه درست شد فارسیش! (تیتر رو میگم!)

الان دیگه میشه هم فارسی نوشت هم انگلیش هم فینگلیش و … البته کلی زبونه دیگه! سعی می کنم فارسیش کم باشه کلا !

[singlepic id=4 w=320 h=240]

فارسي
Sep 1st, 2009 by Mojtaba

برام جالب بود ببینم وردپرس چه عکس‌العملی نسبت به نوشته فارسی (راست چین) نشون میده! فعلا که اصلا خوب نیست!

خوب بهتر شد  :-)  رفتم یه افزونه (Plugin) به اسم wp-rtl نصب کردم خیلی بهتر شد. فقط باید یه فکری به حال تیتر بالا کرد… اونم درست میشه!

اینم بگم من کلا بدم میاد از کلماتی مثل «افزونه» استفاده کنم! در ضمن هر جوری دوست دارم فارسی می نویسم دوست نداری نخون! قلت یا درثتش به خودم مربوته! 8-)

Collapsing rows in HTML table
Aug 30th, 2009 by Mojtaba

If you want to collapse some rows in you HTML table you can use the following script in your HTML document!


<script type="text/javascript">
var rowVisible = true;
function toggleDisplay(tbl) {
var tblRows = tbl.rows;
for (i = 0; i < tblRows.length; i++) {
if (tblRows[i].className != "odd") {
tblRows[i].style.display = (rowVisible) ? "none" : "";
}
}
rowVisible = !rowVisible;
}
</script>

and here is a button for activating script:

<input type="button" value="Hide Details" onclick="toggleDisplay(document.getElementById('TheTable'))" />

Now each time you press the button all odd rows will collapse . Note that you have to set your table id to “TheTable” & also set classes of odd rows to “odd”.

Here is an example:

Row1 Row 1
Row2 Row2
Row3 Row3
Speed up MySQL connection
Aug 28th, 2009 by Mojtaba

If you want to run a MySQL server on you local network, you can disable name resolve feature in order to get faster connection (Up to 10x faster). Remember that after disabling name resolve you have to enter your server IP address each time you want to use it.

Ok, follow me if you want faster connection:

  1. Open your MySQL config file. /etc/my.cnf
  2. Find [mysqld] and insert following string below it
    • skip-name-resolve

Here is an example
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
skip-name-resolve

Creating Table from MySql
Aug 19th, 2009 by Mojtaba

Here is a PHP code in order to view table in HTML format from MySql database, As one knows you have to place this code in php tag (<?php … ?>) in order to execute it.

print "<TABLE BORDER=0 CELLPADDING=2>\n";
$fields = mysql_list_fields("DATABASENAME", "YOURSQLTABLENAME");
$columns = mysql_num_fields($fields);
print "<TR>";
for ($x = 0; $x < $columns;$x++ ) {
print "<TH>" . mysql_field_name($fields,$x) . "</TH>\n";
}
print "</TR>\n";
$sql = "SELECT * from YOURSQLTABLENAME";
$result = mysql_query($sql);
while ($obj = mysql_fetch_object($result,MYSQL_ASSOC)) {
print "<TR>";
foreach($obj as $val) {
print "<TD>" . $val . "</TD>";
}
print "</TR>\n";
}
echo "</TABLE>\n";

Have fun
Aug 19th, 2009 by Mojtaba

[nggallery id=1]

Hello Google!
Aug 18th, 2009 by Mojtaba

Hello Google please find me :)

»  Substance:WordPress   »  Style:Ahren Ahimsa
© 2010 Mojtabacazi.com . All right reserved