Skip to main content

Posts

Just for fun!

It has been a while since I have written something about Javascript. You need to copy and paste this to your browser’s address bar to see how it works. javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("a"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top= (Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',50); void(0); Enjoy!

Performance of null checks in Java

Which one is faster? a == null or null == a ? This is the method of the former. public static boolean firstNullCheck(Object a) { if (a == null) { return true; } return false; } and the method of the latter. public static boolean secondNullCheck(Object a) { if (null == a) { return true; } return false; } Here’s the disassembly of the former. public static boolean firstNullCheck(java.lang.Object); Code: 0: aload_0 1: ifnonnull 6 4: iconst_1 5: ireturn 6: iconst_0 7: ireturn and the disassembly of the latter. public static boolean secondNullCheck(java.lang.Object); Code: 0: aconst_null 1: aload_0 2: if_acmpne 7 5: iconst_1 6: ireturn 7: iconst_0 8: ireturn The former saves you a bytecode. Anyone who can explain further since I am not sure whether if_acmpne is faster than ifnonnull ?

Google over SSL

If you do not want your search queries to be compromised, use Google SSL . However, there is one thing I discovered though, if you click on a cached link, it’s not encrypted, it goes back to HTTP from HTTPS making the protected search useless. Just be aware.

Importance of daily meetings

Why are daily meetings important? Yes I know what you are thinking, to check if the schedule is on target, to spot showstoppers, roadblocks and whatnots. But aside from those, there are things that make daily meetings rewarding. Let’s face it, some people (including me) find it hard oftentimes to achieve a certain level of focus at work especially when multitasking is inevitable. Meetings will remind us of our commitments infront of our peers. Since most of us will be ashamed of not making any progress, it will trigger ourselves to do something about it. In my opinion, having daily meetings typically before the shift starts will help a lot of peers suffering from bad habits - procrastination. It is one way of invigorating those who have not found their way out yet. “Keep each other in the zone, what are teammates for?”

Google Search Operators

There is great power here. I know most of you are not taking advantage of these operators. 1. + (plus) - this will yield search results ordered by the number of occurrences of the specified word 2. - (dash) - this will yield search results that do not contain the specified word 3. " " (double quotes) - this will yield search results containing the exact word specified 4. . (dot) - is a wildcard representing a single character 5. * (asterisk) - is a wildcard representing a single word 6. | - traditional OR operator 7. site: - search within a specified domain 8. intitle: - this will search for the 1st specified word in page titles and the 2nd specified word in the text 9. allintitle: - this will search for texts in page titles only 10. inurl: - this will search for URLs containing the specified word 11. allinurl: - this will search for texts in URLs only 12. filetype: - this will search for texts containing files of the specified extension and the specified word 1...

Gmail Search Operators

These operators will give you more precise search results. 1. from: - mails from the name of the sender 2. to: - mails sent/to be sent to to the recipient 3. subject: - search mails containing the specified words in the subject 4. OR - traditional OR operator 5. - (dash or hyphen) - exclude messages containing the specified words 6. label: - search messages by label 7. has:attachment - search mails with attachments 8. filename: - search mails by filename of the attachments 9. " " (double quotes) - traditional operator for filtering exact specified words 10. () - used for grouping search expressions 11. in:anywhere - search for mails anywhere in your account 12. in:inbox - search for mails in your inbox 13. in:trash - search for mails in your trash folder 14. in:spam - search for mails in your spam folder 15. is:starred - search for starred mails 16. is:unread - search for unread mails 17. is:read - search for read mails 18. cc: - search mails that were ca...