Top Desktop Softwares that I use, daily!

Categories: blog



These software that I list, have no SUPER special qualities about them. They just do their job quietly and doesn’t bother me with any configurations.

Colibri

Works absolutely fabulous, few friends and colleague that looked at it starts using it and never looked back. Its just super convenient to type in the stuffs that you need instead of searching through the Programs Menu Labyrinth. 

Metapad

A lightweight replacement for notepad.

Notepad++

Mainly for quick code editing, minimum syntax highlighting, lots of neat stuffs and still lightweight.

Pixie

It works, small and fast. I’m not too picky about the interface (there’s better interfaced color picker out there), I’ve been using it for years and I won’t switch just because its interface. Works fine as it is!

 

Thats about it. I exclude stuffs like Firefox and all its plugins, who knows why.

Laying off Developers

Categories: blog

There’s a reddit entry about a post on craigslist about developers
who were laid off
, their employer is kind enough to find them a job (my
first employer also offered to find me a job but I declined, I don’t
want to be in-debt with him). What caught my interest is the
description of the first developer. I don’t know whether this is authentic or just a stunt from a job agency.

Most of his work has been PHP and MySQL, though he has done a lot with
Perl. He is strongly drawn to big challenges and tough assignments, and
attacks them with tenacity. Don’t ask him to build you a 5 page
website. He’ll fall asleep. Hire him to build you a gigantic web application that supports tens of thousands of customers.

Yeah, sounds like me (I used to maintain a big e-HR application
using Perl) and have a couple of times fall asleep from doing
guidelines and filling up dummy data in the database. Sometimes I ward
off my sleepiness by reading interesting articles which results in work
delayed but then again, I was the only developer. So, not much stuffs
going around for me to talk to and about my new cool code snippets,
functions, libraries and shit.

"Hey look! I’ve managed to
automate this thing so that it can automatically generate it on the fly
when you request it, you can use it by …!" ,

"Is it ready yet?"

"No, but it can save us some… "

"Then get to it!" 

 ":("

Hopefully on my new job, there’ll be some enthusiastic developers, I know there is, I don’t know about the rest, but Ikhwan is one of them. Looking forward to work with him.

MySQL 4.0 fading away from CodeIgniter..

Categories: blog

It seems like sooner or later I’d have to move away from MySQL 4.0
(current hosting still using it). There will be some feature that will
be added in the future that requires the use of MySQL 4.1 or higher.
So it seems it won’t be long till I’ll have to move my ass off to
another hosting, or just set a co-location which will be costly. I’m
using MySQL 5 in my local environment.

Tracking Pizza Real-time! (Wish there was something like that here)

Categories: blog

I stumbled on a script that gets real-time data from Domino’s Pizza,
sadly the Domino’s in my country doesn’t implement the system yet. So,
there’s no hope of using it, for now. I wonder if other delivery
service will implement it. It’d better search and scour their websites
and leave no stone unturned.

Truncating Text and HTML

Categories: blog
code_montage.png

Of all the applications that I built, truncating text with HTML is crucial. The last thing I need is an entry that takes up half of the page and makes it looks absolutely ugly (I could put a read more on my posts but sometimes I just forget and my posts and not that long).

Here's a function that I use for truncating text with HTML (texts without HTML also works). If I remember correctly its a snippet from cakephp.

Update: Seems the Text Editor doesn't play nice. Here's the file.

 

PHP:
  1. function truncate($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) {
  2.     if ($considerHtml) {
  3.         // if the plain text is shorter than the maximum length, return the whole text
  4.         if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {
  5.             return $text;
  6.         }
  7.        
  8.         // splits all html-tags to scanable lines
  9.         preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);
  10.  
  11.         $total_length = strlen($ending);
  12.         $open_tags = array();
  13.         $truncate = '';
  14.        
  15.         foreach ($lines as $line_matchings) {
  16.             // if there is any html-tag in this line, handle it and add it (uncounted) to the output
  17.             if (!empty($line_matchings[1])) {
  18.                 // if it's an "empty element" with or without xhtml-conform closing slash (f.e. <br/>)
  19.                 if (preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) {
  20.                     // do nothing
  21.                 // if tag is a closing tag (f.e. </strong>)
  22.                 } else if (preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[1], $tag_matchings)) {
  23.                     // delete tag from $open_tags list
  24.                     $pos = array_search($tag_matchings[1], $open_tags);
  25.                     if ($pos !== false) {
  26.                         unset($open_tags[$pos]);
  27.                     }
  28.                 // if tag is an opening tag (f.e. <strong>)
  29.                 } else if (preg_match('/^<\s*([^\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {
  30.                     // add tag to the beginning of $open_tags list
  31.                     array_unshift($open_tags, strtolower($tag_matchings[1]));
  32.                 }
  33.                 // add html-tag to $truncate'd text
  34.                 $truncate .= $line_matchings[1];
  35.             }
  36.            
  37.             // calculate the length of the plain text part of the line; handle entities as one character
  38.             $content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));
  39.             if ($total_length+$content_length> $length) {
  40.                 // the number of characters which are left
  41.                 $left = $length - $total_length;
  42.                 $entities_length = 0;
  43.                 // search for html entities
  44.                 if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {
  45.                     // calculate the real length of all entities in the legal range
  46.                     foreach ($entities[0] as $entity) {
  47.                         if ($entity[1]+1-$entities_length <= $left) {
  48.                             $left--;
  49.                             $entities_length += strlen($entity[0]);
  50.                         } else {
  51.                             // no more characters left
  52.                             break;
  53.                         }
  54.                     }
  55.                 }
  56.                 $truncate .= substr($line_matchings[2], 0, $left+$entities_length);
  57.                 // maximum lenght is reached, so get off the loop
  58.                 break;
  59.             } else {
  60.                 $truncate .= $line_matchings[2];
  61.                 $total_length += $content_length;
  62.             }
  63.            
  64.             // if the maximum length is reached, get off the loop
  65.             if($total_length>= $length) {
  66.                 break;
  67.             }
  68.         }
  69.     } else {
  70.         if (strlen($text) <= $length) {
  71.             return $text;
  72.         } else {
  73.             $truncate = substr($text, 0, $length - strlen($ending));
  74.         }
  75.     }
  76.    
  77.     // if the words shouldn't be cut in the middle...
  78.     if (!$exact) {
  79.         // ...search the last occurance of a space...
  80.         $spacepos = strrpos($truncate, ' ');
  81.         if (isset($spacepos)) {
  82.             // ...and cut the text in this position
  83.             $truncate = substr($truncate, 0, $spacepos);
  84.         }
  85.     }
  86.    
  87.     // add the defined ending to the text
  88.     $truncate .= $ending;
  89.    
  90.     if($considerHtml) {
  91.         // close all unclosed html-tags
  92.         foreach ($open_tags as $tag) {
  93.             $truncate .= '</' . $tag . '>';
  94.         }
  95.     }
  96.    
  97.     return $truncate;
  98.    
  99. }

Trying to make things simpler

Categories: blog

I've created a simple application currently for my own use to put in contacts and stuffs. Mash-ups of applications that I think useful. I used a wufoo template for it and I'll adjust it bit by bit to make it more easy on the eyes.

Currently there's only:

  • Phone Book
  • Account No. 

 Features that will be included is download the data in a spreadsheet. And I'll put it for download later on when I get opinions from my friends.

A phone book? WTF? Yes, I need a phone book because my stupid cellphone is malfunctioning most of the time, usable but its getting on my nerve. The stupid joystick isn't doing what I'm directing it to do. IT SELECTS WHEN I PRESS TO GO UP, argh. It doesn't respond to directions and I have to press it almost 5-10 times for it to move. Damn it.

 Upcoming App is a deck vault. Save a deck, review and analyze  a deck against other decks by inputting the results of the match. Not much. I'll have to see what I come up later. Another interesting idea is to save prices and events. To see how much the price will rise during certain events and why. I don't see a benefit right now, but sure looks like fun in the long term (if I can somehow digest the data and make sense out of it).

I'm going to start work on 1st April at mediu.edu.my. I realize its April Fool's Day and I don't think and hope nobody do any stupid jokes to me on that day. Sometime things can get overboard and ended with someone lying on the ground with blood gushing from the mouth or nose. Don't cry wolf when there's none.

“Oi! Whats up? Lets go magic!”

Categories: magic

Tonight is another FNM @ Manawerx. I'm gonna tweak my deck a little bit, must include grimoire thief and a couple of other 1 CC (Casting Cost) drop. Just went to penny-arcade and today's strip is absolutely hilarious, its just what I've been going through. Every late evening around 7pm, my friend will call, "Jom, Magic!" and usually I'm asleep and I'm like "Uhhh, ye la ye la" but sometimes I just give valid reasons like too tired and busy with work and most often he will insist on me going. Most often I just went along.

Last Sunday (City Champs Trial IV at Summit, USJ) I lost badly against burn deck and weird G/U/W ramp deck which uses teferi's moat and sacred mesa + crovax. That deck is really good. Well played too. My score was like 2 wins and 4 losses. Both of the wins are against kithkin decks.

 

SEO validation service, SEO Bugs

Categories: Tips

Found something about SEO, something like the W3C Validation Service called SEObugs. Put in my website on the text field and search! Told me I was missing stuffs like the meta keyword and description. So.. I just put it in. 

A journey of a thousand miles begins with a single step.

Tested with the w3c validation service and it is still valid. yeay! (Sometimes the Xinha thing fuck things up, so ya never know!)

Curved image tabs

Categories: blog

curved_tab.jpg

Alright, whats wrong with the above tab? Looks nice doesn't it? Sure looks nice to me. But its too much work to be bothered with. The picture above was taken from Cyberjaya's website. I was involved in the project. It was a hard project, mostly because I'm unfamiliar with the framework used as the backbone for the website. Vanilla Forum.

curved_tab_outline.jpg

Ok you can see the lines dividing the tabs. There's actually 3 images for the divider between the buttons. Multiple conditions and javascript required to manipulate which lights up for which. You can look at the javascript that I wrote for it, not the most best code but it works. Hrmm, I can't quite explain it, you just have to try it to understand how bothersome it is, or maybe I just don't know the right and easy way. :\

All I can say right now is avoid curved image tabs! 

Available for hire!

Categories: blog

So what's interesting, nowadays? 

  • Nice article by Paul Graham, You Weren't Meant to Have a Boss.
  • Ignorance doesn't make a Programming Language Sucks. Heh, true that! Dont let anyone drag you into arguing about programming language; What? You like xyz language? ok sure, use that whatever makes you happy. Unless I'm the solution architect who decides which language to be used in a company, then thats a different story.
  • Masjid & Surau, is going to be resumed, hopefully it'll be up and running by the end of this month!
  • Google Interviewed but I didn't get the job as System Engineer (I have forgotten a lot of linux stuffs so lots of questions were answered wrong).
  • Some ASP projects, just CRUD modules.
  • Still losing in Friday Night Magic, I think I'm gonna drop the merfolk theme and use something practical instead. Still johnny (an R&D persona used by WotC) at heart, so I'll think of something.
  • Been playing DotA, heh, these players have no idea what "pro" means. They just throw it around as if they know and ignorance to them is bliss. Pro? Professional people doesn't bitch and leave game when they lose, or else we'd have a soccer match where when the team loses the player just decides to go off the field. No, they do not do that, they just keep on playing trying as hard as they can even though the score is high. /rant.
  • Quit my job, looking for other better jobs out there.

 

 That's about it, hopefully I'll get some stuffs done.

GimpStyle Theme design by Horacio Bella.