|
|
|
|
|
|
Powered byD's Bloggie
| Weblog Main complete archive ... |
|
|
Shoutbox is opened ! - 1:12 pm
Site Issue , Site Updates , Web Hosting - DaRen
The shoutbox is in the navigation menu on your left hand side if you cant find it. I've always wanted to code a shoutbox and it's in my TO-DO list since I started my site long ago. But since it's not the most important thing, it's dragged until recently I begin to lay my hands on it.
The shoutbox is embeded inside a IFRAME...so...? SO I DIDN'T EXPECT ANOTHER BANNER WILL SHOW UP INSIDE THE IFRAME TOO !!! The banner there is making the shoutbox and me looking stupid...grrr...  whatever...anyway, like the commenting system, it's implemented with some simple abuse-protection. You can only post a new shout message 1 min after the previous shout of yours, double posting is not allowed too.
ps: design and layout are "stolen" from ShoutMix, however, all the codes are written by myself, so the copyright thing ? duh, you decide...
Which one ? HTML or XHTML ? - 1:48 am
(X)HTML , Browser , Computing , Internet , Site Issue , Standards - DaRen
Currently the site's content is HTML 4.01 Transitional compliance, it works fine until I realize doing a <link> thing inside the header breaks everything... one example is:
[ Hide ] <link rel="shortcut icon" type="image/vnd.microsoft.icon" href='/favicon.ico' />
It doesn't belongs to HTML 4.01...So, Im thinking of changing to XHTML, kinda headache though because I need to search and replace a lot of html tags like <br> to <br /> <input> to <input /> inside my templates...tons of them...omg...gayness...I should standardize my code in the beginning...
Reserved folder name in Win and Unix - 12:54 pm
Computing , Security , Weird Stuff - DaRen
Below is a list of reserved names that cannot be used for folder or file name, either in windows or unix-like file system:
CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.
For example, if you try to create a new folder named, "CON" (case-insensitive), windows will "undo" the renaming to the original one. So creating a new folder with the name "CON" just renames it to "New Folder". Try it yourself if you don't believe.
Explanation
This actually is a unix-like feature. DOS device drivers are accessible like normal files, i.e. the everything-is-a-file philosophy. CON is the equivalent of /dev/tty, NUL of /dev/null, COM# of /dev/ttyS#, LPT# of /dev/lp# and CLOCK$ corresponds to /dev/rtc (PRN is an alias to LPT1, AUX is COM1). Every character device can be opened this way, block devices (which are assumed to be FAT formatted...) are named A: to Z:, as you will know. Many pseudo character devices (drivers which had to be loaded as drivers but were no character devices, like EMM386, HIMEM.SYS, ..) had forbidden characters like '*' in their device names to be hidden from the user.
The only problem is: DOS 1, which introduced CON, NUL, PRN and AUX had no directories, i.e. no /dev/, so for compatibility with old DOS1-executables (which don't know that they live in a directory) the character devices have to exist in every directory. Don't know why this feature was not limited to FCB (CP/M like) file access, unix like file numbers were introduced together with directories in DOS 2
Trick
You can however rename/create folders with those reserved names by using the mkdir and ren command in DOS-prompt.
Last edited: Mon 2005-10-24 @ 16:35 , by DaRen 1 time(s)
CAPTCHA - 4:24 pm
Computing , Security , Site Issue , Standards - DaRen
This is what I'll implement it later to shoutbox/comment section. Shoutbox section should generate a smaller image to save space ? Haven't decide...let me think about it...
CAPTCHA ( Completely automated public turing test to tell computers and humans apart ), click here for more info.
xXx - The Next Level - 1:43 am
Movie - DaRen
I watched this movie on the DVD during the weekends, xXx - The Next Level (also known as State of the Union), sequel of the first xXx. The movie itself isn't that bad but also not really a "wow" to me. In fact, I prefer more about the "behind the scene" section, eg. how a particular scene, explosion, stunt is shot in the movie.
Personally, I love the scene where Stone Darius connects an aircraft carrier's catapult launch hook to an empty tank and make a direct hit on an incoming enemy tank which is chasing for him. That's so COOOOOL and crazy!! hehe...
A worth to watch film (if you're a fan of explosions here and there).
New episode of 'Kang Xi' - 1:25 am
Entertainment - DaRen
Just finish watching "Kang Xi Lai Le", the first new episode after little S took pregnancy leave one month ago. S.H.E is taking little S role as partner of Kang Yong. The programme will do a rotation by inviting other people to partner with Kang Yong until little S is back next year. Selina and Ella are pretty active and talkactive but Hebe is so quiet. I guess if this continues, then only S.E. is more than enough for the show since Hebe doesn't makes much difference for being in the show or not.
The name of 'Kang Xi Lai Le' is changed to 'Kang Yong Dang Jia' for the time being.
ps: I can't type in mandarin until I changed MySQL database's encoding to Unicode and get my template's charset set as Unicode. Check out here for more news.
Y2K bug ? What about Y2038 ? - 11:38 pm
Computing , Event , Security , Standards - DaRen
5 years ago, I witnessed the historical moment where time passed by, marking the start of a new millennium. There are a lot of news about the Y2K bug before that, about how it will causes impact to our every day life. But well thanks to those people who done the preparation, fixing and patching on the electronic devices that we rely on, I stepped into the year 2000 without having a single trouble, just that I need to remember not to write year 1999 instead of 2000 when filling up forms.
So, now what? I'm working on some sort of birthday reminder thing in PHP and I got frustrated when it comes to storing a person's birth date. First of all I don't like to use MySQL datetime date type, I prefer using unix epoch which can be easily generated using php time() and mktime(), saving me the steps to converting the format. However unix epoch is only valid from January 1 1970 00:00:00 GMT onwards, making those people who born before 1970 invalid. So I do some google-ing to find out why the developers of Unix or even PHP refuse to start unix epoch from, say, year 1600 ? (Windows Win32 FILETIME epoch is at January 1 1601 00:00:00 UTC, Im guessing windows is using unsigned 32-bit, because windows don't work with negative timestamps... lazy to do the calculations...) Before I got my answers, I dsicovered some interesting news.
After the Y2K problem, are you aware of the next coming bug similar to Y2K's one ?
The Y2038 problem
In computing, the year 2038 problem may cause some computer software to fail in or about the year 2038. The problem affects programs that use the POSIX time representation, which represents time as the number of seconds since January 1, 1970. This representation is standard in Unix-like operating systems and also affects software written for most other operating systems because of the broad deployment of C. On most 32-bit systems, the time_t data type used to store this second count is a signed 32-bit integer. The latest time that can be represented in this format, following the POSIX standard, is 03:14:08 UTC on January 19, 2038. Times beyond this moment will "wrap around" and be represented internally as a negative number, and cause programs to fail, since they will see these times not as being in 2038 but rather in 1970 or 1901, depending on the implementation. Erroneous calculations and decisions may therefore result.
Using a 64-bit architecture will solve this problem, delaying the date problem to about 300 billion years later. To be more precise, it will happen on Sunday, 4 December, year 292,277,026,596. After 292 billion years later, maybe a 128-bit will be used which hmm...really isn't our business anymore. Who cares what will happen after 292 billion years eh ? I don't even really care if my weblog will crash or not in year 2038... hehe... who cares anyway ?
source:
http://en.wikipedia.org/wiki/Unix_epoch
http://en.wikipedia.org/wiki/Year_2038_problem
Last edited: Sat 2005-12-17 @ 03:20 , by DaRen 3 time(s)
Found a bug ? Report to me ! - 7:14 pm
Bug , Site Issue - DaRen
If you spot any bugs, security exploit, warning/error messages or weird CSS rendering when visiting my site, please kindly report them to me. Please also specify the browser and version of the browser you're using. In other words, I would like to hear from you if your web browser is throwing you with errors (either Windows / Linux / Mac based).
You can leave me a message by posting a comment on this entry or contact me. Thanks
ps : not those bugs that crawl on your LCD screen or keyboard ... hehe ...
Weblog Archive - 7:17 pm
Site Issue , Site Updates - DaRen
My weblog archive is complete. User is able to browse blog entries by category, by year, by month, by day or by time. Some parts of the archive supports pagination and the rest are able to browse previous/next section according to post by post, day by day and month by month. Other sites updates include templates cosmetic update, cleaning dead codes and clean up the css file. Before that my css is a mess and a lot of them are redundant, it's so messy that it can makes your browser roar at you :p Besides that, I hope I fixed the IP grabbing problem woeisiong mentioned.
Last edited: Mon 2005-10-17 @ 19:01 , by DaRen 1 time(s)
PHP Passing by Reference - 3:07 pm
Bug , Coding , PHP - DaRen
PHP's function supports passing by reference. However, default values may ONLY be passed by reference starting from PHP >= 5. Default values in PHP functions are like:
[ Hide ] // function declaration with default value
function foo($bar = 'default value here'){ ... };
// function declaration with passing by reference
function foo(&$bar){ ... };
What pissed me off is that I'm using PHP 5 for my computer but the hosting server is using PHP4. I only realize that PHP 4 doesn't supports that after I uploaded all my files to the server. Example of default values passed by reference:
[ Hide ] // This won't work in PHP < 5
function foo(&$bar = 'default value here'){ ... };
Workaround :
Set allow_call_time_pass_reference to true in php.ini if you're using php >= 5 so that you won't get a bunch of warning messages filling your screen.
Trick to do default values passed by reference [ Hide ] <?
// function declaration
function foo($bar = 'default value here') { ... };
// function calling
foo(); // valid call
foo(&$var); // this, however is consider deprecated in PHP >= 5
?>
Base on the above code:
PHP < 5 complains:
Parse error: parse error, expecting ')' and later on by a fatal error and killing the script execution.
PHP >= 5 complains:
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer.
|
|
|
|
|