Monday, October 24, 2011

ADOdb and MSSQL: Differences from MySQL and my ADOdb impression

On our first project that I'm in that utilizes MSSQL, a database server made by Microsoft, I've chose to use ADOdb abstraction, to prevent possible incompatibility. However it wasn't that easy. I had problem connecting, problem with SQL and more.

What is PHP ADOdb?

ADOdb is an abstraction library. Abstraction aims to simplify coding by doing the procedure but hiding the code that does the procedure. It is not actually hidden though, you can always dig in to the code but that defeats the purpose of abstraction, which is, to require less thinking for the programmer.

It is also designed to have shortcuts on stuffs that are frequently done. Therefore it lessens the lines of codes and making it easier to read.

Unsolved Connection Problem To MSSQL

2 of us on our team had problem connecting using SQL clients like SQL Server 2005,Visual Studio and Navicat. It says Login failed for user <username>. My team mate though, using mac, can connect using Navicat using the same credentials. Then I theorize that there's something weird on windows (or vista[our office PCs uses vista]) that maybe preventing us to connect.

The PHP on our server can connect, and since it's not a requirement to browse the db on a desktop client, I shifted my effort on creating a simple querying script on the server, so we can use it on querying.

Differences of MSSQL and MySQL

It wasn't as smooth as I imagined it, since the role of abstraction layer is to prevent compatibility issues. Here are some of the issues I had running PHP ADOdb on MSSQL as compared on PHP ADOdb on MySQL
  • backticks ( ` ) - it was my habit to backtick tables and field names on mysql, I realized it is not supported on MSSQL and I later learned that it uses brackets instead ( [ ] )
  • LIMIT clause - this is not supported on MSSQL, you will have to use something like: SELECT TOP 10 * FROM tablename
  • Floats you see might not be what you see. I found out that even with SQL where clause " fieldName > 0 ", I see results returning fieldName which seems to be equal to 0.00 , I then tried ROUND(fieldName,2), a suggestion of my teammate and it worked. Our theory is, it might be containing values beyond the 2nd decimal digit.
  • SHA1 and MD5 - these encryption algorithms are not called like SHA1() and MD5() on MSSQL. They are called by a function named HashBytes,(eg. HashBytes("SHA1","123") ) which returns binary version, like if php sha1() is called with 2nd parameter as true. To convert to hex, you have to use a function named master.dbo.fn_varbintohexstr() , which converts it to 0x01234 hex version, which then leads you to SUBSTR() it so you can remove the "0x". Messy isn't it?
    • example: SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('SHA1', '123')), 3,512)
    • The big limit is 512 is a play safe solution for MD5(32 hex characters) and SHA1(40 hex characters)
  • Random order - there's no clear support on MSSQL on MySQL's ORDER RAND() ... you can use a unique id seeder which is newid() though. Pretty slow though.
  • SUBSTRING() -  the third parameter (length) is required. SUBSTR() alias is non existent. Second parameter when set to 0 does not return blank string does not return blank string.

ADOdb Functions I Like

I've used ADOdb before on my second job, what I liked about it is that it has functions like the following:
  • getRow($sql) which gets the first row of select as php array,
  • getOne($sql) which gets the first row's first column(first cell), (eg. for sum(), count()) (as string)
  • getAssoc($sql,...) which returns array(first column =>  second column) format which is very useful in a lot of instances specially when combined with smarty template's html_options
  • autoExecute($table,$data,$mode,$where,...) - which inserts or update table. Useful specially for my situation having MSSQL which I am unfamiliar with. However I was not able to use it on MSSQL since this current project was read-only on DB.


Things I wish ADOdb has

  • escape string - it has quote() function, but sometimes I want an escape function that will not quote my strings
  • one dimensional list array query - it has getAssoc(), but sometimes I want a numeric list of array which is messy to do with getAssoc(), take this sql for example:SELECT country_id FROM countries

    Although it can be  done by crappy way like array_values(), I still wish there is a built in function on it.
  • meta quote (quoting for fields or table)  - a way to quote the field name like `field_name`, probably useful for reserved names

Achieving The Real Abstraction

  • Field quoting - use a function. (eg. string(7) "`date`" db_quote_field('date') ) or a class method
  • LIMIT clause - omit it. Then use GetArray([$number_of_rows]) if needed a specific limit or GetRow()
  • SHA1 / MD5 - you may not be able to use the same variable approach here, since MSSQL and MySQL SHA1() and MD5 it has a parameter and differ in number of closing parenthesis. Because of this, you may use a PHP function or an SQL procedure. I suggest using a PHP function.
    • eg. string "SHA1('123')" db_proc('SHA1','123')
  • Random ordering, Substring and other functions - Concat, IfNull, length, random, substr page of phplens appears to have list of abstraction functions and properties.

Conclusion

Always remember to use a user with limited permission when using a new SQLanguage.  On this case I specifically requested for a read-only user.

Although I had a experience that is not so smooth on using MSSQL, I understand that I have to learn more and use it before I conclude (although sometimes I'm a Microsoft hater :)) ), so I can't say that MSSQL is bad. Yes every PHP Developer likes MySQL, but there are people that are comfortable with it you'll have to face that fact if you want to be a good developer.

Labels: , , , ,

Wednesday, October 19, 2011

New Position: Lead PHP Developer

June of this year I was employed on my second job(PHP Developer) that paid me 133% more than PHP Programmer). My former officemate on my first job, told me about a job opening with the same salary, I wasn't able to entertain this because my second job's website got hacked and all files got wiped, so I needed to help. And I don't think it's a good idea to leave a company after 1 month cause I think it'll look ugly on my resume.

The offer

3 months later I called them again and to my surprise they asked me to go to there office right away located in Ortigas, NCR, Philippines that night because they need it urgent. I had a test which is a bit hard( I was expecting tests would be easy) then next day I was offered the job as PHP Software Developer (although I would just call it PHP Developer), for 14% more more salary but with 37% less working hours but it is night shift.

I came back to there office on night shift, then discovered the one that I will replace, who needs to go away for personal reason, is the PHP Lead Developer of two other developers. Of course I didn't expected that I will be the next team leader cause I've just worked for 2 years(+1 year by my own) and I am new to the company. This guy explained to me the current project status and the background of the company we will work in. When I asked him if I will be the next lead developer, he  said he don't know.

The challenge: being unexpected leader

Some days later I formally started and the surprising part is that the CEO assigned the leader. Although in doubt, I just thought this is my chance to experience it. Considering I'm still a young developer(but not generally young though :P, at age 22, I know it's not gonna be easy to lead team mates who don't know you.

I had to adjust with the codes I inherit, which I call (sorry) bad code. I had learned how to aim for benefit of simplicity on my first job while my second job thought me on the benefit of complexity. I had my first job for 2 years, had them both simultaneously for 2 months and had my second job for 3 months. I learned a lot from my two previous jobs and it's time to apply the lessons from both.

Sinking in

All seems to be good, the catch is it takes 2 hours to go office. Including the time to prepare before and after office it takes away extra 6 hours of my daily life. I always say this same phrase "Tatanda ako ng maaga" (I'll get old early) :)). So I am preparing to rent-to-own a condo 15 minutes away from office. I just wish I can budget my money well cause it'll cost 65% of my current salary. XD

Labels: , ,

Tuesday, October 11, 2011

Realizing I'm Outdated. Love at 2nd "site" towards HTML5

I have been hearing about HTML5 for about a year now but I haven't paid too much attention cause coding with it means browser compatibility issues.

However, I came across a code on a form of mailchimp newsletter. I saw some attributes and attribute values that are new to my eyes. placeholder and required attributes, and the "email" input type.

At first I thought they are just used for the signup form's javascript, I assigned my teammate to make the jquery validate for it. but a minute later I was surprised by my browser pops me up a message saying one of the fields is required. Then I realized I was seeing placeholder texts on them while we don't add them yet.

I opened my test file and experimented with the third one, the "email" input[type] attribute which I replaced with 'text' cause the css was just targeting the classic "text" and "password" input[type] values. And to my surprise, this attribute shows a warning when the input does not contain a valid email address.

After this I googled about html5 and saw the reference  page on w3.org . I pasted it on document editor and it appears to be 1000 pages, I trimmed it abit and came out to be 700 pages. I will print it(cause I don't like reading alot on computer screens) perhaps 200 pages a time then read about it to add up on my web developing knowledge.

Labels: ,

Back And Blogging

Web Developing
It's been a while since I last posted a blog post here. It's because my free webhost cancelled my account for some ambiguous reason, that is, I broke one the terms of use. Which is weird cause only two website of mine was active that time, this site and my gaming guide website. Which I didn't edit for some months. It took me awhile to fix things cause I'm busy working as a PHP developer.

For the past 6 months I my workflow evolved more than it did for the past 2 years. I had a part time job on  a client based on europe which after 2 months hired me full time so I had to quit my first job which I had for 2 years. After 3 months of working I was hired by another local company. So in 4 months I had my salary increase by 2 and 2/3.

Religion
I thank the Lord for that cause 8 months ago I had been back and going to church again after a decade. And what's better, it's a christian church.

I can say that I'm converted now since I'm enjoying going to that church every week.

Financial Point of View

I've gone through a lot of other change such as my financial point of view. I've reading Robert Kiyosaki's book for awhile and it gives me alot of idea. Specially the part where he says that creating assets are better than buying them, like thinking of an idea that can give you money instead of buying a property that gives your money.

3 years ago this is the way I think. Create a good website that sustains itself. A website that visitors come on and those visits attracts more visit. After a year I realized it was almost impossible and started working as employee.

Now that I'm a highly paid employee I realized that that thinking 3 years ago was the right thinking. While preserving my job(s) I will think of website ideas that can be turned into assets.

At the same time I will save money for building business one at a time starting from small to large. And I'm also interested on studying stocks.

I plan to avail a condo 15 minutes away from office which I'll have to pay for 3 years, with no interest. And because it's just 3 years, it'll be 3x more expensive.


Education
I'm still an undergraduate of Technological University of the Philippines. Although I plan to study on a more sophisticated school as soon as I can support it, I plan to finish what's undone on my college. I will just have to process the papers on my Training(SIT) exemption (cause I've worked already) and I can graduate by march.

My financial plan though, states I can't quit being employe until I'm around 27 years old :P


Labels: , , , ,

Sunday, March 20, 2011

Transparent Under The Cursor: A Facebook Liked A Link Evil Trick

This is a blog post for people who experience to "liked a link" without knowing or really liking a link.

Yesternight(March 18) I saw my friend like a link, "Mind blowing Tsunami footage" or something like that. I clicked at the link and end up closing the tab cause it looks spammy.

This morning I saw on my wall that I "liked a link" which is that same page. So I investigated the trick that tricked me.

What's the trick?

In simple words, the like button is:
  1. Invisible
  2. Follows the mouse

Using this sneaky trick any click, anywhere, will click the like button. To make you click, they use traps to make you click somewhere. (Like the play button of an intriguing video)

How to prevent this?

If you notice the cursor is a pointer (pointing hand), or it is rapidly changing from arrow to pointing hand when you move the mouse, then it might be this facebook like a link trick. Of course this is impossible to be done unconsciously.

For myself, and as usual now shared the world, I made a new user script that would work on Firefox(w/ Greasemonkey addon) and google chrome.

Facebook Anti Like Trick

If I see new "liked a link" tricks and have enough time, I will add new functions to fight against newtricks. (updates are not automatic)

Here's a screenshot of the revealed like button under the cursor(photoshopped the cursor cause it is not included on my screenshot. Screenshot is intendedly grayscaled):

You may want to read about my facebook time limiter user script too:

Facebook Time Limiter

Technical Procedure I've Done

Warning: The following content are for developers only

(Not a nerd? Go To Top :) )

It was hard, it took me about 1 hour even with the help of firebug. I can't find the like button anywhere. I expected it to be invisible. But I expected it to be easily searchable using the html tab of firebug. But on the net tab of firebug, like.php of facebook is being loaded.

This website uses an iframe inside another iframe. (let's call them parent-iframe and child-iframe) . According to net tab of firefox, loading of like.php is right after the loading child-iframe. But when I inspect child-iframe using firebug, I can't find the like button.

I almost gave up. But I realized I can further narrow the search by directly going to the url of the "child-iframe".Then I realized the child-iframe contains the like button redirects to another page, making the like button unsearchable using firebug.

What it probably does is assuming the click was done. Leaving the user clueless. And think that the redirect was because of his click.

The facebook like button is inside a frame(iframe), browser prevents iframes to be edited/read/written by another domain, yes the contents of this frame are not accessible by other websites. but the frame itself is "stylable". But on this encounter, they styled a div wrapper instead of styling the iframe directly.

I also think there's also an invisible pay per click advertisement somewhere.

This makes me think of making a new script that detects transparent iframes. I did small edits on the user script and it turned into a transparent iframe detector.

I will run this script on my firefox for awhile, If I see at least one website abuse this, I will upload this user script immediately.

Website security application

This vulnerability is not applicable for facebook only. All websites could be subject by this trick. I may make a new post on general application of this trick to a typical website.

You may want to read about my facebook time limiter user script too:

Facebook Time Limiter

This post does not endorse anyone to use this trick to have tremendous likes on there site. Or earn more on google adsense. If you will do this trickery... I hate you :)) that's all hehe

Labels: , ,

Saturday, March 12, 2011

Facebook Time Limiter User Script

Facebook is addicting. And I know how to make browser user scripts. So I made this user script that will warn the user when he/she exceed the time specified per hour.

Actually it doesn't just warn the user. It stops the user from using it. It's hard to break the rule if you can't break the rule. But of course it's still up to the user if he will fool him/herself by disabling the user script when the time is up.

Facebook Time Limiter on userscripts.org

Custom Time Limit

to set the limit, paste and enter this format to browser address bar while on fb tab/window:

javascript:FTL_set_timelimit(limit(secs),session_interval(secs));void(0);

the limit sets the time per session_interval.

session_interval is the total time you want to moderate. If you want to moderate time per hour, it'll be 3600, if you want to moderate time per day, it'll be 86400

I'm still thinking of other good ways to make this more user friendly.

Example Time Limit Settings:

5 minutes per hour:

javascript:FTL_set_timelimit(300,3600);void(0);

10 minutes per hour:

javascript:FTL_set_timelimit(600,3600);void(0);

5 minutes per 30 minutes:

javascript:FTL_set_timelimit(300,1800);void(0);

1 hour a day:

javascript:FTL_set_timelimit(3600,86400);void(0);

Note: If you just can't get how to set the timelimit:

(this example uses 5 minutes per 30 minutes)

  1. Go to FB tab
  2. Press Alt + D
  3. Paste the javascript:FTL_set_timelimit(300,1800);void(0);
  4. Press enter
  5. Reload page if not reloading.

Do I use this?

Of course. I made this for me, but since I always share what I can share, I posted this on usercripts.org. I have 5 minutes per hour limit and it works good, I think it'll help me be more productive.

I still have to improve this when I have free time, updates would be posted on the facebook time limiter - userscript page

Labels: , , ,

Saturday, January 22, 2011

How To Permanently Protect USB Flash Drive From autorun.inf

Summary

Simply create a folder named autorun.inf on the root(topmost) of your USB flash drive.

Or you can download this autorun-protect.bat file and place it inside your usb, then run it

Note: adding files or folder inside this autorun.inf folder makes it more secure.


Note: in case you don't get the comics, they are just jokes

Story

After years(around 4 years I think) of using this method, it gained my trust and it really works. Without autorun.inf, viruses are basically immobile, unless you run them manually.

What are the disadvantages?

  • You can't edit and use autorun.inf functions like:
    • run an application when flash drive is inserted to pc
    • Custom icon of flash drive on my computer
  • When the usb flash drive is plugged in to a computer, the autoplay of windows will run, scanning each file to create a suggestion of what to do with the flash drive. If your flash drive or portable hard drive is too big, it will take long. So be quick and cancel it cause it doesn't really give nice suggestion anyway

How does it work?

Most viruses are created to treat autorun.inf as a file, not a folder.

If it tries to delete, it, it may use cmd del, which will delete the contents of the folder, NOT the folder.

After thinking it is deleted, the virus may try to overwrite it, which fails, because it is a folder, not a file, and file functions will fail. Overwriting it with a file will also fail if you try it manually. (note: on cmd, the correct command is rmdir and rd, not del) Much better, when the autorun.inf folder still has contents inside it, even rd and rmdir won't work.

Common Scenarios

When the autorun.inf folder becomes visible again, this means the usb got attacked.

To cure this:
  • right click on the autorun.inf folder
  • click on properties
  • See the type
  • If it's a folder, then the virus failed, but the *.exe can still be there so be warned
  • If it's an application, Delete it, cause it's actually autorun.inf.exe
    • The virus that attacked creates an *.exe application that pretends to be a folder. It hides your original folder and runs the virus when clicked, then open the folder, making you think that it's a real folder. You need to delete all folder-pretending application, then change all the hidden folders visibility using attrib on cmd(I may post another post about that)

---- WARNING! Non-Geeks please proceed to conclusion :). For techies go on reading ;) -----

The code

The code inside autorun-protect.bat is:

cd / attrib autorun.inf -R -H -S del autorun.inf mkdir autorun.inf attrib autorun.inf +R +H +S

cd / Go to the root directory of your flash drive

attrib autorun.inf -R -H -S remove the protection of the current autorun.inf file, which could be a virus

del autorun.inf Deletes the current autorun.inf, if it ask you if you want to delete autorun.inf/* that means you already have the folder, and you don't need to this anymore

mkdir autorun.inf Creates the folder named autorun.inf

attrib autorun.inf +R +H +S To create less distraction, hide this folder and make it a system file

Conclusion

That's all, as far as I my experience on it, I only got struck hard by a virus on a computer (already there before I plug my usb flash drive) that deletes all files(or deallocate my usb flash drive volume).

Using this method, you have lesser things to worry about. Plugging your USB won't infect your flash drive, however it can be attacked by the virus already inside that computer. Your flash drive can also be filled with virus files, but it won't autorun. You can plug on a virused computer and a non-virused computer without (almost)automatically spreading it.

Note: "replacing a file with folder" always work to get rid of applications that always go back. Such us windows genuine warning, viruses that reproduce itself like sowar in my post on How I fought sowar virus without antivirus.

Labels: ,

Tuesday, January 4, 2011

Wireless Keyboard And Mouse: Logitech MK250 Review

Logitech MK250 Wireless Mouse and keyboard
Pro's
  1. Unified usb reciever, 1 reciever for keyboard and mouse
  2. Access/Multimedia buttons
  3. Power saving (the box says 15 months battery life for keyboard, 5 months for mouse)
  4. Less batteries (1 AA battery for mouse, 2 AAA battery on the keyboard)
  5. Spill resistant (Anti liquid spills)
  6. 128 bit wireless encryption
  7. Warranty (3 years on the box, 3 months on the store)
  8. Stylish design
  9. Rubber stoppers on the bottom
  10. Low noise
  11. Big spacebar
  12. Plug and play.
Others(Non pro, non con):
  1. Middleweight keyboard
  2. A little bit heavy mouse
  3. Unique laser sensor placement(not on the center)
  4. Normal mouse (3 buttons one wheel)
Con's
  1. Unique placement of the home, end, insert, delete, page up and page down buttons
  2. no windows button on the right side
  3. to activate access keys, you need to hold the custom modifier FN button on the right side
  4. Rectangle enter button (not six sided reverse L shape)
  5. no right menu button on the right side
  6. Low class batteries included
  7. 3 Batteries = charger problems (where do you buy 3 battery slot charger?)
  8. No Caps lock light, Scroll lock light and num lock light!
  9. Price is around 1.5x (1,300 pesos)

Pro: Unified USB receiver

Small USB Receiver

One usb reciever for both the wireless keyboard and the wireless mouse, saving one usb slot specially when you're using a laptop or notebook.

This is also very light compared to usb flash disks. Something is making noise inside it when you shake it so I think it's shallow.

On the picture I compared the size vs a double A battery.

Con: Unique placement of the home, end, insert, delete, page up and page down buttons

Weird Home, End, Insert, Page up, Page down, Delete KeysThis is very annoying. When I edit my codes (programming) I (always) accidentally press page down. Then I'm lost. My normal reflexes press CTRL+z automatically but sometimes pressing that makes me more lost. Well maybe I'll just need to get used to it, but switching back to normal keyboard may give me a new problem. ~X(

Pro: Access/Multimedia buttons

These access buttons are activated by pressing the F1 to F12 buttons, while holding the blue custom FN button between the right ALT and CTRL button of the wireless keyboard.

This include(F1-F12 respectively):

  1. Stand by button
  2. Mute button
  3. Volume down button
  4. Volume up button
  5. Media Player Button (Windows Media Player, I don't know how to set this to other players such as vlc) (edit: would work when vlc is the current window)
  6. Pause/Play button (edit: would work when vlc is the current window)
  7. Previous song button (edit: would work when vlc is the current window)
  8. Next song button (edit: would work when vlc is the current window)
  9. Internet home button(opens a new window)
  10. Microsoft Outlook Mail button (Even though my default email program is thunderbird :(( )
  11. Search button (Highlight search box on browser, Opens file search on explorer or desktop)
  12. Calculator button (Opens the calculator[calc.exe])
  13. (FN+Print screen) right click(contextual) menu
  14. (FN+Pause break) scroll lock button

Con: to activate access keys, you need to hold the custom modifier FN button on the right side

Pro:Power saver

The box says 15 months battery life of the wireless keyboard, 5 months battery life of wireless mouse. That sounds exaggerated but we'll see if it's real.

The box says that it has automatic sleep, I'm seeing the mouse's laser light goes dim when not in use.

Of course that's all I can see cause I can't see through plastics and woods. We need superman for that. JK :))

As I was editing this draft, I have been using this for a week without replacing the battery.

And hey, this could be a good choice for environmentalists, as some wireless mouse eats battery of 2 AAA in less than a day

Con: Batteries included are not rechargeable - the included batteries are non rechargeable duracell batteries. bad for the environment. :|

Less Batteries

Unlike other wireless mice(<-- lol at that term) , which requires 2 AAA batteries, it's mouse requires only 1 double A battery. Weird enough, the mouse cover has slot for another AA battery. Although you cannot fit an AA battery there.

And unlike other wireless keyboards, which requires AA batteries, the keyboard requires only 2 AAA batteries.

Con: 3 Batteries = charger problems

where do you buy 3 battery slot charger? - well I realized after 1 week of use, it isn't a problem at all. Cause it takes ages to drain the batteries. I may have lost my 2-slot AA/AAA cdr-king charger once the batteries are drained.(I use cdr-king batteries, but they are not the reason of this long life)

Pros: Spill Resistant

Anti Spill Design Drains

One of the unique features or boasting of this wireless keyboard.

Probably most of us, including me, have experienced sharing our drinks with our keyboard, and most likely your keyboard didn't liked it and said goodbye to you forever :)).

But this wireless keyboard has 10 holes below it, to drain the water(see picture) however, I was not able to capture all 10 holes.

And it has this gutter design on the bottom to control the water.

I accidentally removed one of the keys and discovered it is mounted on a high socket, and it's hard to reattach it, so it maybe compactly fitted to the socket, to prevent water penetration.

I'm not an expert reviewer so I will never test to spill liquid that on purpose :)). And hey there's a footnote

Tested under limited conditions (maximum 60ml liquid spillage). Do not immerse in liquid
My favorite energy drink is 240ml(cobra energy drink) so I should still be cautious haha

Con: No Caps lock light, Scroll lock light and num lock light!

:O ... now you know how it saves battery. It actually took me 1 week to notice this. Haha, that's a proof of the genius idea. Those lights are almost useless ;)

128 bit AES wireless encryption

I just realized, wireless keyboards can be vulnerable to key-logging hacks, (If you're important enough, someone may make efforts to catch your signal and record all your keystrokes, possibly revealing your passwords). And this encryption could a good protection against it, I don't know how to test that thought

I have a theory that the bigger size of the unified usb receiver is because of this encryption feature.

Warranty

The box says 3 years warranty, but the store where I bought this says 3 months. That's weird, but at least it has warranty haha.

Other Pro's

  1. Stylish design - I dunno but I like the curved glossy edges of this keyboard. I also like the snapping sound when I fold the height adjuster
  2. Rubber stoppers on the bottom - keyboard won't slip on your table. It's hard to move it without lifting though hahaha :))
  3. Low noise - the box says this but comparing to other keyboards I used(cdr-king) it has just little less noise, but the cracking sound is not there, specially noticeable when I'm typing at night, when all other people in our house is already sleeping
  4. Big spacebar - the spacebar is almost as wide at an inch
  5. Plug and play - no softwares. Just plug the usb and turn on the keyboard and mouse (wait for seconds after plugging the unified USB receiver).

Other cons

  1. Rectangle enter button (not six sided reverse L shape) - After using it for 1 week I got used to it and now I don't accidentally hit the backslash(\) button above it. As I am typing this I hit enter button instead of the backslash button though. :\
  2. Price is around 1.5x (1,300 pesos) - see prices of competition below

Others(Non pro, non con):

  1. Middleweight keyboard - I got a funny experience on this. I lifted the keyboard one hand while gripping on the arrow keys, one of the keys detached. (It was hard to put it back again)
  2. A little bit heavy mouse - so little I didn't notice it now after 1 week use.
  3. Unique laser sensor placement(not on the center) it is placed on right side of the bottom of the mouse, without a reason I can think of. Maybe about biased on right handed or left handed people?
  4. Mouse's Laser Sensor is on the right side instead of the centerNormal mouse (3 buttons one wheel) - if you're looking for mouse with special buttons(mouse 3 , mouse 4 and mouse 5 or the browser back and foward button)

Competition

You might ask, what are the other choices to start with? I asked every keyboard selling shops on the tech section of the mall I went and here are the choices:

Note: This is based on the keyboards I saw, It does not represent all models nor a conclusion of there value!

  1. CDR king Keyboard and separate mouse - con: no cdr-king keyboards has unified usb receiver and the price is a bit higher if you combine the price of keyboards and mouse pro: smaller USB receivers (the prices vary but what I want is there flexible wireless keyboard which cost 880 pesos there's alot other variation so you better check there website if you're interested)
  2. Genius(brand) Mouse and Keyboard - con: I dunno if the big salesman(or bouncer) was wrong, but the unified receiver was wired big thing. And it doesn't have access/media buttons (price: ~ 900 pesos)
  3. Brandless(or I just can't read it) china keyboard and mouse - con: I bet it doesn't have warranty pro: price, it was only 700 pesos (wireless mouse and keyboard) and it has a very little usb reciever, if you plug it to the usb slot, it will only measure one cm. (Price ~ 700 pesos) I saw this on SM Southmall's Cyberzone on one of the stall on the middle of it's hallway
  4. A4tech Mouse and keyboard - I had a hard time choosing between this and Logitech's. Pro: Small, light, the mouse is cool, the unified usb receiver can be stored inside the mouse, which has cool look inside and out. And as I can remember it, it has access keys and the mouse has built in gesture(<-- first time I saw such) Con: no num pad. (Price: 1300 pesos)

Other stuffs

Logitech Mk250 keyboardThis is my first time to post a review for a product, I realized I should have done this before on other (cheap[I'm just a poor guy you know :P]) stuffs I bought. But this is a start :D.

The wireless mouse can be used almost on any surface, I sometimes use it on my lap, on my white wooden desk, on the colored bed sheet on the shiny mantle.

About the signal, the box says there will be no interference even on the busiest wireless workplaces, so I guess the usb receiver automatically detects which signal is from it's paired keyboard and mouse. However I can't test nor prove that.

About the 15 meter signal distance, I didn't tried it yet, cause I don't find any use of it. (aside from impressing a girl by playing a piano on your keyboard using the simplepiano software that is on the other room. Yeah that's how my weird imagination goes. :)) )

As a programmer, I always press *(asterisk) [shift-8] button, but I always accidentally press (, it might be my bad though, cause I always had problem pressing * button.

Sometimes I experience being on a textarea but I can't type, but I can move the cursor(using arrow buttons), but I guess it's one of my scripts or my browser that is messed up.

After a tiring day, sleeping directly after work or using the computer is tempting enough not to press the off button of the mouse, or I just forgot to do it. To preserve battery I should always remember that. But the keyboard and the mouse off buttons are on the bottom so that's really another reason to get lazy about it.

But theoretically(my theory ;)) keyboards only uses power when pressed, cause mouse always need the red laser light turned on so it's more important to turn off the mouse.

Mouse power lightThe mouse battery light between the mouse 1 and mouse 2 lights second after turning on, changing batteries (and after the sleep mode), to save battery, it will turn off after some seconds. Maybe it's there to show you if the battery is still good.

And having a turn off button on the keyboard and mouse gives a convenient way to prevent problems when my 1 year old nephew go wild and play with my keyboard (or just plug out the USB receiver quickly)

The turn off switch is has (painted?)colored base so you'll see red when off and green when on.

Conclusion

Overall I think I like the wireless keyboard and wireless mouse. Just can't forget the annoying position of home and end button that makes me press page down key every time I want to press end key. I'll still need to take a look on it's power consumption if it really last that long. And if it allows drinking ;)

Labels: ,

Thursday, December 30, 2010

Image Rotate Animation - Wowhead's Cataclysm's Maelstrom Animation

Element CSS transform rotation(-moz-transform:rotate() / -webkit-transform:rotate() / -o-tranform:rotate() ) is very unpopular cause it's not yet supported on all browser. (in a web developer language, not supported on all browsers means Not supported on IE:)) )

But just recently as World of warcraft's 3rd expansion, cataclysm, is released, wowhead, one of the most popular database website of wow attached a maelstrom animation on there header(It's something like a (very)huge catastrophic storm/whirlpool in the middle of the world of that game)

This is my non-jquery version of it (the code can be seen below)

This can be seen on all inner pages of this website like: http://www.wowhead.com/classes

Makes me think, there's alot of ways to play with it. Like Google Gravity does.

As I can imagine it, we can make solar system's rotation and revolution or an analog clock, analog tester, speedometer, pendulum and other things.

But of course, web developers should keep in mind that, like every other good things, Internet Explorer does not support this CSS property(ie. transform). And you cannot ignore that. But as for wowhead, it isn't necessary for that maelstrom thing to rotate, so that's some good way to implement it.

The Code

Note: wowhead's source code is minified so I didn't based it on there approach

http://albertdiones.co.cc/assets/js/wowhead-transform-rotation-animation.js

Labels: ,

Walang Jo Smart bro

This tuesday(December 28 2010)buong araw akong walang connection ang smart bro. Kaurat, kasi trabaho ko required ang internet. 2 months including this month di ko pa nababayaran. Pero di naman daw yun ang dahilan nung tumawag ako sa customer service. Papupuntahin daw nila yung mga technician(contractors) nila

Pero sandali lang pagkatapos kong tumawag, meron na akong internet, ewan ko kung baket. Nung dumating yung mga contractors nila kinabukasan, sabi ko ok na, padisco-disconnect lang minsan, pero sabi nila iche-check narin nila

Habang kung ano ano ang pini-ping nila sa cmd, at may IP address din silang brinobrowse, panget daw ang nasasagap kong signal, tira tira lang daw. Umakyat sila sa bubong namin then nagpi-ping sa cmd yung isa sa laptop ko.

Maya maya nagso-solitaire na yung nasa laptop ko, ok lang naman pero nung katagalan at sinabi niya saken na di na ako magkakainternet at kelangan kong magdagdag ng tubo(pipe) para tumaas ang antenna ko

Quoted = smart bro contractor
Not quoted = Me

"Sir wala na kayong connection"
Anong wala? di na ako magkakaroon?
"Opo sir kelangan po magdagdag ng tubo"
Di ba may bayad yun? magkano yun?
"papadaanin po sa office 700 yun"
"panget po yung signal nyo eh"
Di bale nang panget mapagtyatyagaan yun eh kesa wala
On my head:

"papadaanin po sa office 700 yun"
paiba iba ang presyo, WOW 1000 yan dati nung nagpakabit ako promo ba yan? at anong papadanin sa office, pag sa inyo iba na presyo? :))

At ng marinig ko yun parang sasabog ako, pumunta sila dito para lang sirain ang connection ko? To force me to buy there pipe? eh kung sila kaya pukpukin ko ng tubo o di kaya arnis cane? katabi lang ng laptop ko yung arnis haha. Lumabas na lang ako at said to myself to keep calm.

Nung umalis sila binalik ko yung antenna ko sa normal niyang angle. Then I tried to connect again. Tapos di na naayos. Tumawag uli ako sa customer service. Tapos kinuwento ko lahat maliban dun sa paglalaro ng solitaire sa pc ng customer nila, tutal di naman masasaktan ang processor ko sa solitaire eh haha, nakakaawa naman yung mga salesman ng tubo

Habang natawag ako nagkaroon uli ng connection, sabi ko sa smart bro CSR, kung pwede wag na lang papuntahin yung mga contractors, baka nga naman ulitin lang nila yung kalokohan nila.Habang tinatype ko to paputol putol parin ang internet

Hehe kung di sana ako nagkaroon ng connection ngayon balak ko eh paputol na lang yung connection ko then maghirap yang smart bro na yan sa pagsingil ng kulang kulang 2k na bill ko for last month and this month. Hahahaha.

Labels:

Saturday, December 25, 2010

RTL Character: Weird Discovery On HTML ISO Characters

I was looking for the html entity version of ► (obviously I found it already)

For those who doesn't know html entity, it is the equivalent code for a character, which is used for characters that are not on the keyboard or for preventing a character to be interpreted as html character such as the less than sign (<)

I used PHP for loop to find it, however, I discovered a weird behavior, I was confused because I saw the numbers are all rumbled.

The PHP Code was:

<?php for($x=1;$x<=10000;$x++) { echo "$x: &#$x; <br />"; } ?>

It is coded to show the number on the right side and the character corresponding(ascii or iso)

This discovery means that it adding &#8238; can actually mess up a website, and I think I should watch out for such vulnerability. Making it look gibberish and unreadable.

<div> This text will stay as left to right <div>Hi, I will put RTL character after <b>this</b><span>&#8238; it will become</span> <span>right to left</span> and unreadable/gibberish </div> </div>
This code results to:
This text will stay as left to right
Hi, I will put RTL character after this‮ it will become right to left and unreadable/gibberish

This affects all the child elements, and all sibling elements and ancestor elements as long as they are all contained in the same <div>, which gives another reason to use <div>

Security Solution

Use htmlspecialchars() or htmlentities() on user input data, when printing them on your html. You can also use div's but that's just not reliable.

You can also target this character via str_replace or preg_replace but who knows what other characters can mess up your website

Or you can just ignore it. After all it will appear rarely, affect your website temporarily and it will require real intension to destroy your website even temporarily. But one day you'll be forced to choose your defense against it

Labels: , ,

Friday, October 22, 2010

Randomness Problems

learned alot about php's randomness today. PHP on windows biased on a specific number on specific range. For example this afternoon between 1-47, 24 is favored. Tonight as I post this, it favors 21.

While around 5:00(I believe time has something to do with random number generation) of this afternoon Unix hates 30. It gives this number, no matter how many the choices are, 2/3 of the normal chance.

I generated random integer from 1 to 1000, 1 million times(not exaggerating here), the normal answer should be 10,000 (1M/1K) but 30 is getting just around 6,000 after alot of reset and retries

But tonight as I post this, no bias occurs. It could be that I've just encountered a rare occurrence of a random number generation bug.

What to use when you don't trust php's rand() commands? the mt_rand() function. My boss told me about it just now and I think I'll be using it from now cause it shows no bias when I tested it.

Also, shuffle shuffle() works better than array_rand() when dealing with picking a random item from an array. I used this and get only 0.04% error

Or you can use this function(haha)

I'm a big fan of destiny so it's ironic how I seek the the perfection of randomness XD

Labels:

Friday, September 17, 2010

php function to truncate string upto x characters

My sidebar now looks better now that I implement one of the codes I use on another project to truncate strings upto a certain chars, without cutting or truncating words

The Code

/**
* truncate_upto_chars
* @param string $string the string to truncate
* @param int $chars the number of characters, this will not "cut" words
* @param string $ellipsis the string to concatenate or put in the end of the string if truncated
* @see http://albertdiones.co.cc/blog/2010/09/php-function-to-truncate-string-upto-x.html
*/
function truncate_upto_chars($string,$chars,$ellipsis='…') {
  if (preg_match(sprintf('/^.{0,%u}(.*?\b|$)/',$chars),$string,$preg_matches)) {
    $str=$preg_matches[0];
    if (strlen($str)>=$chars)
      $str.=$ellipsis;
    return $str;
  }
  else
    ;#throw new Exception("failed to truncate $string");
}

I'm kinda amused to exceptions so I used them almost all the time. And I know not all are amused haha, that's why I commented it out

And I'm not really sure why I used sprintf there. You can edit it anyway if you like to use it. :)

Labels:

devcon accidentally disabled all my usb hubs

I wanted to create a batch program file that updates and "safely remove" my USB flash drive, I used this devcon.exe from microsoft. Unfortunately, I accidentally removed all the devices on my notebook.

Fix:

This was fixed just by going to device manager, uninstall all the usb host stuffs under universal serial bus controllers one by one then restart

After restarting they will automatically reinstall. And it fixed my problem. Just posting this to help other people if they would encounter same problem

The cause of the problem:

and by the way, the command I accidentally typed was:<-- (READ THIS WELL, DO NOT TEST IT OUT WITHOUT READING)

devcon remove status *

Obviously I was just trying to see the status when I accidentally( I don't know how I TYPED accidentally ) typed remove before status, causing devcon to try to remove device "status" which is invalid, but however removes * which means ALL

then boom, it became koko krunch. hahahaha

(If you find it weird that the fix comes before the cause, let's face it it's really annoying to read the whole post while all you care about is how to fix it :) hahaha :)

Labels:

Friday, September 3, 2010

Google Buckyball Logo - Another CSS Sprite Animation

I have found another CSS sprite animation on the web, the Google's buckyball logo for today, September 4, 2010.

Although it's a bit crappy cause makes my Firefox slow down, it gives me the idea that web developers really consider using this method to animate "images" although they are not just images.

This case is very complex that it makes me crazy thinking how they get the motivation on making around 50+ parts that moves around and making sure that the bond line (divs with background) and the bond point(img) would be perfectly bonded. However the browser would pay the performance price.

I have save a copy of it just in case you really want to see it in the future (since tomorrow it will be gone): View Google buckyball animation Although it's up to Google if they'll remove these files on there website.

Now I wonder, what's better? gif animation or canvass animation or flash animation or css sprite animation?

Note: I'm not really sure about the correct term for "css sprite animation"

Labels:

Saturday, August 7, 2010

Pointer Gesture - Firefox User Script

I just made a new user script for firefox's greasemonkey addon.

It's gesture user script cause I want a customizable gesture script.

I made this just for fun, next for my tablet (fun first cause I would have searched for gesture addons or wait till I got windows 7 installed. Actually what I'm really proud are my better debugging and MATH skills :)

Aside from those reason, I also like the fact that I can customize it to add all the features and other gestures that I want (Yeah I'm so selfish)

http://www.userscripts.org/scripts/show/83147

I'm still thinking of adding new gestures like refresh when drawing a circle, and a way to google search using selected text (unfortunately select then double click won't work smoothly so I need to find another way)

Current features:
  • 1. Mousedown then drag upward then mouseup to page down
    • 1.1 Mousedown, hold, then drag upward then mouseup to go to page's bottom
  • 2. Mousedown then drag downward then mouseup to page up
    • 2.1 Mousedown, hold, then drag downward then mouseup to go to page's top
  • 3. Mousedown then drag to the left then mouseup to go back(history)
  • 4. Mousedown then drag to the right then mouseup to go forward)history)
  • Drag links diagonally right-upward then mouseup to open them in new tab
  • 6. Drag links diagonally left-upward then mouseup to open them in current window
  • 7.Tabs opened using gesture # 5 can be closed by drawing a cross / then \

Labels:

Saturday, March 27, 2010

Travians' CSS Sprite Animation

I have came across a browser game website, http://travians.com/ . This website at first glance looks like a flash animated or GIF animated website as you hover your mouse on the characters and other things on the page, specially on the mouse on the sign post(the login form). When you hover on the mouse(not the one you're holding right now). It performs a tumbling(backtive), then goes back hanging on the signpost. On first glance I thought this is a GIF or flash, but when I inspected it it was actually a CSS sprite. http://travians.com/img/portal/interface/chars/mouse.png I wonder where I can use this technique.

Labels:

Monday, March 8, 2010

Blogger now deprecating FTP publishing

Source: http://blogger-ftp.blogspot.com/2010/01/deprecating-ftp.html

Blogger is deactivating FTP publishing starting on may 1, 2010. This is a very bad news for me because most of my blogs are published this way.

I use this publishing so that I can use the html blog files to create a dynamic php blog pages. Now I am forced to create a blogging backend or maybe just use Wordpress. This might be a good idea because Wordpress do something I can't figure out to index pages on google.

Labels:

Sunday, March 7, 2010

New Layout

I have added a new layout to this website. This new layout includes a dropdown menu on the header, jquery integration, border-radius. I am just basically applying what I learned on my work.

I also used the IE only css property, expression() which uses javascript in css layout. This seems to be a cool way to fix the % problem, the absolute-fixed problem, the auto margin problem and many problems that IE gives to web designers (well I consider myself more of a programmer).

I also used my own database program which I temporary call RSDB(Real Simple DataBase). I am still having trouble making the backend though :P.

Labels:

Saturday, November 14, 2009

Unforgettable Friday The 13th

November 13, 2009

Another day of chained bad luck. Imagine declaring a day a day full of bad luck just to realize there's more to come; In the SAME day. carrying a bike on your arm for 2KMs, pushing a tricycle for 10KMs.

Going to school, for my SIT (OJT) enrollment. As usual I go there the unusual way, biking. Passed the 5th kilometer, the jeepney in front of me stopped weirdly, my normal response is to overtake such vehicles. To my surprise, a pipe digging is across the road ahead, I stood on the pedal to see a non-edgy part of the digging. Too late for me tho, I am too fast and there's another car on my left(right is the jeepney) I just strengthen my arms to handle the bike after running over the digging. Boom, and I ran over it, and the feeling is as if I broke my bike's wheel. Tho it seems to be normal, I know for myself that it hit so hard.

8th kilometer(Coastal Mall, Parañaque) , which is halfway, I was on a running on a curve, I felt something on the wheels. The rear wheel is soft. I can still feel the pressure on the wheel so I continued, but after some seconds, the wheel was totally flat. I stopped riding it and started walking with it, at a gas station, I bought prepaid load and sent SMS to my father(because he's a cyclist too, and he got materials for fixing the wheel). As I leave the gas station I heard a weird sound on my bike as I was walking with it. I felt it was coming from the flat wheel, and I was afraid to make it worse, so I carried it on my right arm.

Carrying my bike on the right arm, I walked northwards(Macapagal Highway), Until I got to EDSA intersection. I am walking to save time while waiting for my father to come. My shoulder already hurt and I stopped in front of a school(Manila Doctors College). After some minutes my father came and fixed it after around 15 minutes. I biked my way to school.

3pm I was in school and all went right, except for an argument with a enrollment officer which got offended when I am reasoning out. I am not trying to fight tho, I think he misinterpreted me or he just don't like people who reason out.

Around 7 I planned to go home, and guess what, my bike's rear wheel is flat again. I sent SMS to my father about it and he said he's gonna bring the tricycle to carry it, instead of coming to fix it

After more than an hour the tricycle came, my mother was also in it, we loaded the bike and we rode, I was so sleepy at that moment. And guess what, the tricycle was also scre*ed. We aren't even passed the 1KM when it stopped. Although my father tried to fix it, it still got scre*ed before we can even go far, until the chain(connecting the engine to the wheel) was totally broken and hopeless

Only choice is, to push the da*n vehicle home, and we are 17 KMs from home, well, less than that because it ran around 250 KMs :P. I started pushing it, my mother also helping sometimes(I always tell her to sit), while my dad is driving. My sleepiness was already out of my mind and kept on pushing it. We were at mabini road, which is a route for jeepneys. Many people stare at me as I sweat allover specially on my face. I know I have just started so I almost ignored most of those curious(and some mean) people.

As we run slow towards, hotels and condos, were around us. And so as rich people, well dressed foreign looking girls. I sweat allover and my shirt was almost all wet and dirty. It was humiliating, but still, motivating. All these sacrifices I do, will be paid off by God someday, that this is just one of his test, all my dreams will come true and I will be rich and respected. And I will also be able to live luxurious and live on hotels and condos.

Feeling how I sweat, I know dehydration will be a problem, so when I saw a street vendor I bought some drinks. Mabini, Del Pilar, Harrison, EDSA, Baclaran, Quirino. Nothing really special went until we reached around 10 KMs except my right foot was sprained and I can't move it anymore. Luckily a motor parts store was still open(1 AM). And my father bought new chain, my big brother came with his motorcycle, while my father was trying to attached the new chain

After that we rode the tricycle and my brother was on our back, we are running slow, but the chains got loosed again and we stopped, as my brother suggested, we tied the tricycle to his motorcycle so it can pull it

All went well until we got home. I just felt well that no one was hurt, except my whole body and my purse :P. Da*n that was 10 Kilometers. And we got some good bonding moments too. We are mutual about our feeling most of the times and we are not vocal most of the times. Nice to see that we had helped each other as a family.

Although I think it was a better idea to have contacted my brother, so he would have pulled the tricycle home for that 10 KMs

Labels:

Tuesday, November 3, 2009

A (crazy) PHP AntiVirus

I often find myself unsatisfied of what my antivirus can detect, so I often wish I can tell my antivirus, hey! delete all files like this one, everything identical with this file should be deleted! delete them all.

But, I didn't found anything like that, and I am a PHP programmer, and I can't do anything? So one night I started to create a simple antivirus program using PHP. So I created it, but lol, what's the sense? I bet it can only be used on localhost, so I won't be able to share it.

It simply compare contents of files from the virus signatures folder, one by one, but of course, for efficiency, it also records the file sizes, making it possible to check for possible threats, without really opening the contents of the files that is currently on scan, that makes it more efficient

The next problem will be, how to make it run continously, overcoming the maximum execution time, which is, by default, is 60 seconds, and on free webhosts, 30 seconds. Well implementing it on another host will popup another problem that I will figure out later.

This maximum execution time problem is defeated by using ajax and jquery, by using the $().replace which creates a chain reaction of ajax. And by using a get parameter that tells where the scan stopped, that will be used as "bookmark", that will be used to indicate where the script should start scanning.

I actually slept accidentally, and in the morning, I have found out that the script actually still runs, and it really ran continously, which is nice, just like a real antivirus

The funny part is, my (real)antivirus deletes my php antivirus' quarantine, *lol* . But I got i fixed later on by making the file extension not to be scanned. I actually always changed the file extensions of my virus collection( I actually call them pokemons sometimes ) into ".dangerous" so that it would say under the file name "DANGEROUS FILE" *lol*. After this all went right.

But in the end, what's the use of this PHP antivirus anyway? I dunno, but I know I can use this to scan my files with new threats that my antivirus can't detect as threat. If you find it to be useful for yourself, hmm maybe leave a comment

Labels:

Fighting Sowar Virus

I have encountered this sowar.vbs, months ago in a computer cafe, but never really worried about it since I have this "agimat"(talisman) vs autorun viruses, which is a folder named "autorun.inf" on my flash disk. I will just delete the defenseless executables that require a compatible autorun configuration to be dangerous. I just always watch out for accidental double clicks on them.

But tonight I had to fight this virus, since it was brought to my computer by my uncle. And WTF, the effects of this virus was really bad. First of it sets my homepage (lol I don't have internet connection at home yet) to a porn site. What an ***. Well, the most remarkable thing about it is that it removes the folder option on the control panel. I didn't even knew that it was possible. Aside from these it also does the common virus actions like disabling showing hidden file, disabling showing system file(which I discovered to be also called as "Super Hidden Files"), hiding the file extension, disabling the task manager and disabling reg edit.

I disabled the "sowar" program on the start up on msconfig, but as I expected after restart, it reappeared. Apparently as long as this "wscript.exe" runs, it regenerates itself. So after the restart, I enabled my task manager using my taskmanager enabler, then quickly ended the proccess "wscript.exe" which I discovered to be the one running vbs scripts( so don't even think of deleting this innocent executable ). The real criminal is at "C:/WINDOWS/sowar.vbs", I changed the attributes, to make it visible, I did this using cmd "attrib C:/WINDOWS/sowar.vbs -R -H -S" after this I didn't deleted it, I renamed it, then created a new folder, that has the same name, "sowar.vbs". I ran cmd and changed the attributes, "attrib C:/WINDOWS/sowar.vbs" +R +H +S". After this, I restarted the computer, then saw that it still attempts to run sowar.vbs at startup, which of course fails. It is a folder now, not a vbs file, no matter what they try to return the startup directive on msconfig, it wouldn't succeed as long as it is a folder.

Now that the evil proccess is not around, time to clean up the mess it created. I am pretty sure that it will be a satisfying fix to fix the registry first. But how? My registry is disabled, and I dunno how to enable it using "reg add" on cmd(on bat files I prefer). I decided to carefully open the sowar vbs file with programmer's notepad, carefully, to prevent accidental running by double clicking. I discovered it was alil "encrypted" or something.

Special characters infest the file, but very obvious resemblance to registry addresses appear on some part, but they contain invalid special characters, on the bottom of the file, I have found a function declaration(must be a visual basic function declaration) which does multiple replacements. Little by little, I used the find and replace(ctrl + H) tool of the programmer's notepad, looking for obvious replacements. I was seeing an obvious progress and I almost decoded the registry edit's.



Here's an example:

HKEY_CUR�NT_USER\So‡w€e\Mi�o•‡\Intƒn…
where:

� = RE
‡ = ft
€ = ar
� = cr
• = so
ƒ = er
… = et

And it will be:
HKEY_CURRENT_USER\Software\Microsoft\Internet

After some time I have encoded all of the special characters, although I really don't understood "reg add" commands, I found the "cmd help" really useful("REG ADD /?"). I reversed engineered the directives of the virus and used them to create a .bat file that will fix them. I only don't understand the line with "NoDriveTypeAutoRun", but since it uses 128 (ff) *lol* I just set it to 0(Please comment if I did it wrong :P).

So if you got same situation, well that porn site isn't the right home page for you right? *lol* you can download this file: sowar-fix.bat or if you're a techie person, paste the following code on a .bat file.

Note: you have to make sure you have prevented "C:/WINDOWS/sowar.vbs" from running. Or else all the registry fixes will just be trashed

Note: you also have to remove the possibility that sowar will run on windows startup. If you didn't read the early part of this post, please do so, I used the "replace with a folder method" to stop the virus from "regenerating" itself.

Note: The folder option will reappear after restarting your computer, after the .bat fixing was done.

For Techies, here is the code of the bat file I made:

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /d "http://www.google.com/" /f REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Search Page" /d "http://www.google.com/" /f REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /d 1 /t REG_DWORD /f REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /d 0 /t REG_DWORD /f REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /d 1 /t REG_DWORD /f REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDriveTypeAutoRun /d 00 /t REG_DWORD /f REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoFolderOptions /d 0 /t REG_DWORD /f REG ADD "KEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableTaskMgr /d 0 /t REG_DWORD /f REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableRegistryTools /d 0 /t REG_DWORD /f cmd

Labels:

Saturday, October 3, 2009

Semi-Hold-up'ers

Tama, semi hold up'ers mga holdaper na hindi naman talaga holdapers. Eto ang istorya

Naglalaro ako sa isang cafe nang madaling araw, di ko akalain na delikado rin pala talaga ang cafes. Isang grupo ng mga frat or gangster ang pumasok sa cafe, naghahanap ng mapagtritripan. Nung una mga bading ang pinagtritripan nila, pero mamaya maya nadamay na ako. Tumayo sa harap ko yung topless na lalake at nagtanong saakin, tinanggal ko ang headset ko para marinig ko

Laking gulat ko ng marining ko ang tinatanong niya. "Trip mo ba ako". Agad akong na bad trip at sinuot uli ang headset. Halos handa na akong makipagrambolan dahil alam kong hindi ako titigilan ng lokong yun hanggang sa magpakababa ako. Na hindi ko gagawin sa pagkakaalam ko. Malaking problema ko yun, hindi ako madaling magbaba ng pride lalo na kung wala akong ginagawang masama.

Pinatigil siya ng isa sa mga kasama niya, na kaklase at malapit kong kaibigan nung high school. Grabe, bakit nila kinokonsente ang kalokohan ng kasama nila. Maya maya ay yung bading naman sa likod ang pinagtripan nya, at mukhang sinuntok niya pa. Halos gusto ko na ring magalit sa kawalang dahilan ng trip nila, pero kailangan kong pigilan ang sarili ko. Isang babae na nagrerent ang sinigawan ang topless na lalake. Binara siya ng mga kasama nito, pero siya mismo sinabing "wag yan babae yan eh". Aba gentleman parin ata ang loko. Bakit naman kasi pinababayaan ng mga bantay ng cafe ang mga nangyayari.

Kahit bading yung mga pinagtritripan nila, tao parin naman yun.Paulit ulit silang nagpabalikbalik sa cafe. Maya maya nakita ko nang hawak niya ang isang kutsilyo. Sa loob ng cafe at lantad na lantad. WTF. Bakit ba pinababayaan nila to. Maya maya nanghihingi na sila ng pera sa mga tao. Kuwento ng kuwento ang lalaking topless na lasing. Tungkol sa kalaban nilang frat na binugbug siya ng walang dahilan

Hiningian niya rin ako ng pera habang may hawak na kutsilyo(pero hindi nakatutok sa akin), sampung piso o limang piso daw, pero tumanggi ako, nagulat ako ng biglang iba na ang tono niya, parang biglang naging mahinahon. Umapir siya sakin at sinabing "Pasensiya na ha, pareho lang naman tayong mahirap eh". Pagkatapos nilang lumabas hindi na sila bumalik. Hindi ko siya binigyan kahit may pera ako, kasi pakiramdam ko pangiinom lang nila yun.

Yun nga, lahat talaga tayo tao parin. Talagang may dahilan ang lahat ng kabaluktutan. Kaya sila nakakagawa ng ganun ay dahil sa sama ng loob sa ibang tao, at sa iba pang problema. Marami talagang puwedeng tumulak sa tao para gumawa ng masama. Pero kahit kailan hindi maaring maging tama ang mali. Dapat laging matatag ang tao para manatiling gumagawa ng tama sa gitna ng lahat ng problemang nakababaliw

Labels: ,

Thursday, May 28, 2009

WoW300's Direct Traffic Inflation

It is weird but, My WoW Macro Website, WoW300 is receiving more direct traffic than I expect.For those who doesn't know, direct traffic is number of website visitors that directly typed the name of the website on there browsers.

Before, it was steady at below 20 visitors per day, I understand that this is just normal for a not-so-popular website. But these past weeks, I am receiving around 50 direct traffic per day, which really surprises me.

This could be a result of my more world of warcraft-like design especially on the icons of the spells, like the Polymorph Macros (I am talking about the sheep icon there). This kind of icons would have giving the visitors closer to the world of warcraft environment

If this continues, and add to the search engine traffic I expect as soon as I got most of the pages indexed by google(around 500 pages), I expect gradual inflation on the direct traffic and a big bang inflation on the organic traffic on every google indexation of pages(since I am noticing that google index many pages on each indexing)

Labels:

Friday, May 15, 2009

My First Salary

Today I just got my first salary on my whole life.It's a real good feeling to know that I am finally making money out of my own work. But of course I need not be selfish. I gave half of it to my dad and mom.

Although I planned somethings to buy for this time, I think I will just have to wait for my next payday. Because I know it is better idea to give some of it to my parents than to spend it all by myself. And I know one day I can give everything they need, when I become a great programmer

Labels:

Sunday, May 3, 2009

Expiration Day

Yesterday, my mom brought to home some grocery products. And they are all rejects. Either they are expired a day to week or there foil packs are punched. And it is assumed that we would consume it. Or at least our dogs will.

If it would sound weird to you, maybe you didn't felt poverty all your life. Actually our financial status isn't that bad, we can eat enough for a day. But it is enough only. Maybe this psychology is just for saving money as much we can. But it gives me a different meaning.

It just mean to me that I must strive for success and change our lives. That I need to be serious on the path that I am pursuing. I must make sure I will be a successful programmer. One day, I promise to myself, we will never think of eating this kind of foods again.

Labels:

Saturday, May 2, 2009

My First Week on work

I have started working this monday on a website technologies company. I dedicated my time for it and put aside my personal websites for awhile.

I am really amused with my new and very first job, since everything seems to be nice. I have a nice boss,a nice office and a good company. And most of all I like my position. I am hoping not to loose this job no matter what.

In my first week I have learned alot of new concepts of PHP programming and practical basics of Linux. I also learned about using FTP on browsers, but in Firefox I can't figure out how to upload files.

I am also enjoying the rules and convention that I have to follow, because it gives codes a uniform look. I hope all this good luck continues

Labels:

Wednesday, April 22, 2009

At last google indexed more of my pages

After about 2 weeks, from 21 pages from my website wow300.web44.net indexed by google now it is 47, but I still got more than 500 pages that waits to be indexed, and it seems it will take a long time for this to happen.

I still remember the times that I rejoice everytime that I see this website's search traffic jump from 30 to 60, then to 80 and before march it even peaked to 120 organic visitors per day

I am pretty confident that when this new site's page is indexed as many as the old one, this would get better search traffic than the previous one, but this takes too long

But anyway, that's how google goes.

Labels:

Thursday, April 16, 2009

Form Submission Objects Programs

I had an idea to make a object oriented program for html forms. I realized making a process for each of the submissions on my websites are inefficient, so I made this plan for OO Form objects

I will use this for uniformity and security. I think the __construct() and __toString() will become very handy this time.

I will start it out today and try it out in the future.

Labels:

Wednesday, April 15, 2009

My Website Membership program

I am developing a new program for my website, wow300.web44.net. It's a simple membership program.

I have been thinking it's a big help if users can help developing the website. And I may even make a self-sustaining website once the traffic inflates. I have made two object classes, a visitor class and a member class, the member class extends the first one.

It took me 2 and half hour, to make it work. Next I will be designing the GUI for the users. As of now, I think it's a real good and convenient program, I can import it to my other website in the future. I have used a pattern I read about, the singleton.

Anyway I have been practicing to have a cleaner codes in the sense that I am now putting spaces between equal signs, the function arguments and the parenthesis. But sometimes I am still doubting if I am doing a better habit or it's just a step back.

But I am sure that I am doing better on naming variables. From one letter variables, I am now using better names and as much as possible I am using English words with right spellings.

It's really hard to be a lone programmer, I hope someone would give me a distinct direction in the future. Maybe my boss in the future, or anyone with more experience.

Labels:

Sunday, April 12, 2009

Haha my inaccurate tongue

I just realized that I undersold myself last tuesday's job interview when the HR asked me how long I make page like what I showed her, I answered 2 days for 3hours/day which sums up to 6 hours

I think I was stupid to answer that that way. I meant I make that PHP program to make hundreds of pages (spells category on wow300). Haha she might have thought I was making a single page for two days =S my bad.

Anyway, I have just finished the program for the sitemap for the said page category and it now sums up to 162 pages. I am excited for all of this to be indexed by Google, I am sure that my former wow300.co.cc's Organic traffic will be doubled because of these new pages.

Labels:

Wednesday, April 8, 2009

Improving my designer skills

wow300.web44.net, my oldest website and once became a 200 visitor per day trafficked website, is a world of warcraft macro guide website. Although WoW servers are widely pirated, this game has a fairly high system requirement and it is a trend that players would take the best PC modification that they can.

By this trend, we can say that users who browse the net that is a WoW playeer is playing on an optimal PC with optimal connection, thus it is wise to focus on the attractiveness of the page than focusing on minimizing the page load, this theory is reflected on world of warcraft website, worldofwarcraft.com

But, what if they are browsing while they are playing? low Framerates on WoW is really annoying to players.Low framerates is often caused by excessive multi-tasking that there PC cannot handle. By this thought, would attractiveness really give them pleasure, or they would just be annoyed by there low framerate and long page load?

As of now I am able to redesign some of the parts of this website and I am also thinking if having the same look on all the pages is benificial to my website.

Maybe I should research more about the relation of these things with each other

Labels:

Tuesday, April 7, 2009

Finished the Per-Spell Pages of wow300

I have just finished one of my projects on wow300.web44.net, the categorization by spells. Where every spells, for example Heroic Strike , is contained on many macros on the website. When a user requests that spell page, the PHP will query the database for the macros that uses this spell.

In my opinion and experience, dividing your website in multiple pages, tackling atomic topics, will help so much in your SEO. So I am very excited to see my SE traffic as soon as Google Indexes all the pages. As of now I finished most of the spell extracting from my macro pages.

The fun part is that I added real icons from WoW to all these spells, which really makes my website look better. and more WoW'ish :P

I had a hard time making preg_match'es for extracting the spells. And the harder part is, these new spells will be recorded and I will still add details about it one by one. Now I have more than a hundred of spells. And the spell moderation and detail adding is almost done. So now I will just have to wait for new spells that needs details.

Labels:

Friday, April 3, 2009

Getting bored on google's slow indexing

I am still waiting for Google to index my moved website, wow300, from wow300.co.cc to wow300.web44.net, but for 2 weeks, there's no change, it's still 13 pages on the search engine

I am frustrated by the co.cc's change policy, because I will start from scratch to increase my SEO ranking on that website

But of course, it's too early to give up as of now I will get my website better and better and I will add more unique feature.

I am planning 3 new features of this website with the help of my new handmade file-based database

Labels:

Wednesday, April 1, 2009

A very nice day

I woke up this day and meet most of my bad luck and saw it as a very bad day. My first interview as a programmer is today, and I thought it would affect it, I rode my bike to the location with a bad mood.

But before I pass the first kilometer, I realized, I am not this kind of person, I am a very jolly person with superficial happiness. And by realizing that I smiled. And was driven by my optimism.

Upon going there, I asked instructions from many people, even tho I already used Google maps to locate the building. I think God rewarded my optimism because I met many helpful people on the road.

I came to the site near the building and realized, damn a bike won't fit good in this place, it's a highly commercialized place with payed parkings everywhere, I looked around about 3 times just to find a spot where I can lock my bike up. Then someone called me from the other side of the road.

They are two motorcycle owners and 2 street vendor, they said "Dito mo lagay mababait ang mga tao dito" (Put that here, people here are kind). They are in a empty guard house, and behind it was there motorcycles, behind these is a open sewer.They were nice to a stranger like me, one of them even offered to me to use lock it up on his wheels I found it really nice, kind people really still exists =).

I changed from my cycling jersey to a white t-shirt. It's nice that the guard house is blocking most of the public. Then I cleaned up my sweaty face and neck, and wore my long sleeve(it's the only thing formal I can wear >.<). I used the tinted window pane of the parked SUV on the side as a mirror, and realized, Not a single sign of being a cyclist =)

I came in to the building and logged in the logbook, I realized that this is a very serious application, in a very serious company. Am I prepared? I rode on the elevator and felt my elevator-sickness ahh damn I don't feel good at elevators XD. I saw the surveillance camera and just laugh at myself

The interview wasn't that stressful, but I have no idea if I was doing the right thing, I was just saying what I think. It wasn't the typical type of interview that you can see on online interview tips. But then again, at least I have been honest, but I did tried to emphasize some of the most complex parts of my works(my websites). The interview ended nicely, after the handshake, I just thought, damn what do I do next XD.

I am afraid there's many more people(maybe older, or an older-graduate!) that would fit much better in the job, but at least I had experience of looking for a job, and much more, I would love to have this job. In short, I am not just looking for a job just to have a job, but I am looking for a job that I will enjoy, after all programming is my happiness.

I used another road on my way home as another motorcycle rider on the parking lot suggested. They really insist for me to take this road named "C-5" instead of "EDSA" . So I tried it, I like challenges anyway. I followed his instructions and had fun on a road he told me to be "pababa" (downhill) and when I go down this road, my speed got crazy I think it was around 50 KPH, I was laughing while going down *lol*.

When I came to "C-5" I realized it was a weird road too many intersections and many uphills and downhills, ah my legs. I saw a landmark, a stiff upward cliff next to sidewalk with houses on the top, it looked like I am in a province. There is even a mini-waterfalls on the sidewalk. I even asked myself "Am I still in Manila?". And *lol* it rained, ahh I'm wet XD(since I am not the kind of person who stops and says 'oh no it rained I will wait for it to stop')

I bought some a burger as my self-reward =).I came home and even I am wet from the rain, something in me still doesn't call it a bad day, I love this feeling. I realized, a bad day is product of pessimism of our minds. Optimism makes every day a good day =D.

Labels:

Monday, March 30, 2009

My First Joomla Installation

Last night I decided to start learning about Joomla, since I am not in to CMSs that much(because I love hand-coding[actually I am hand coding this post on Blogger]), and for me blogs = wordpress and forums = PHPBB, I don't know where to use Joomla yet, so I made some personal use purpose for it

Joomla was thought to us on a seminar of a group of PHP "spreaders" named PHPUG Philippines. But I didn't used it until now.

I discovered that this CMS costs 2 seconds to download, it's unbelievable. But the catch is, it contains 3800+ files, making FTP upload real time-consuming. I uploaded it late at night 2 days ago, ended at about 2 am

And now I configured the installation and it's now ready for use, I wonder what's next to do, maybe I will start uploading some pictures from Google and see the workaround on Joomla and at the same time, giving myself some pleasure collecting images specially fanarts.

Labels:

Sunday, March 29, 2009

A Little Bit Different Me

As a part of my self-confidence campaign for myself, I decided to make some "personal diary" label of my blog. I believe it's kinda required for a web-publisher to have self-confidence, and I am always shy of making "personal-diary" posts on any websites. But now I will try to be very personal to practice my self-confidence.

Last night I slept at 3:00 am, (maybe we better call it "last day"). I was up all the way till 3 writing up my program plans on my notebook for 4 projects I am personally developing, one of these is my own database program.

I was doing this all day yesterday but I prefer doing it at night, where almost everybody is already sleeping. Our house isn't big to get me isolated from distractions and stress. The silence of the night keeps me focused, but I believe the human nature of sleeping at that time is a real disadvantage. Either I drink coffee or else I find myself on the wooden sofa sleeping over my notebook, crumpling some of the pages. Tonight I didn't had money to buy coffee. I forgot to ask dad before he slept, well I doubt he would give me, well I tried to ask, he got angry

I tried to think of alternate "stimulant". I remembered when I am sleepy at classes, I'll get my finger pinch my other palm. That night I got clothes peg and put pinched my ribs *ouch*. It's kinda funny but I considered it as a 'serious' way. at 3 my body gave up, but I set up the alarm of my cellphone at 6.

I woke up at 9, finding out that someone turned off the alarm, I didn't cared who, it was stupid to wake up at 6 sleeping at 3 anyway. I started up continuing writing my plans. I was about in the 24th page, when I stopped, I saw our dog, unleashed, then I go near her and saw her skin is damaged with small lesion that I doubt will heal normally. I decided to give her a bath, but I will do it with care, dogs are known water fearing...

I remember a TV demo on doing this so I followed it, not to directly pour water on her face and minimizing the sudden pouring of water. I enjoyed doing it, and I even made it right also on her puppy. It's my first time doing this so I really enjoyed it.

I continued my program-plan writing, alil bit more, I decided to drink some coffee. My mom heard it and started up talking something I hate.

It pains me when I hear from my mother that it's "abnormal" habit to stay up at night just for that. Even tho I understand that she isn't aware what I do, I still can't help but be angry when she talks like that. My family is the first reason why I changed like this, I want to do my very best to succeed in life. As long as we prostrate in poverty, I will never stop doing this.

Labels:

Wednesday, March 25, 2009

Standing up from co.cc change policy

Since about 1 month, I have been spending my time recovering my best trafficked website's status, wow300.co.cc, which got expired because of the co.cc change policy

wow300.co.cc is one of the domains that got expired because co.cc change the policy from free to free-for-one-year domains. Even tho $3.00 a year is a (very)small amount, I can't avail a credit card a this moment so my only choice is to retreat to my old domain, wow300.web44.net

Now I have just finished fixing the hierarchy of links, from /?category=item URL structure to /category/item and even /category/sub-category/item. I like the result of this optimization and I am hoping it would make a big impact on my SEO ranking.

Thanks to my own database program, this integration has been made easily

Now all I need to do is wait for Google to index my pages and I will takea look at the results

Labels: