December 28, 2008Searching never seemed something really hard to do because SQL’s LIKE was there to aid the oppressed but… does LIKE the job right?
So we have data and when it gets bigger and bigger, we need to search through it. Let’s take some approaches to the Search function and find out the better way.
Read the full article
December 24, 2008Sometimes you’re working on your computer and things start to work strange. The softwares starts to crash without reason… uhoh… or my home or my temp/var folders are full.
To quickly have an overview of your directory sizes du helps wonderfully!
du is an utility binary that comes with (I think) most Linux distributions and some BSD that lists all directories’ and subdirectories’ “disk usage” (got it?). By default, du scans recursively until the last directory on tree.
The --max-depth attribute used with the -h (human-readable units) provides a good look at your disks’ size.
The following code scans only your first directories whithin your home directory:
Just change the --max-depth value to match your needs.
December 23, 2008This is silly though. I was starting to lose my head and shout at the code when I as running Doctrine’s YAML parser to generate my base models. I was getting a strange parse error that said something like “Unable to parse line 0 (b0VIM…” and so discovered that it was my VIM swapfiles first-liners!
The parser scanned my YAML directory and parsed all .yml files, including the VIM swaps.
So if you get this funny string don’t go crazy. Trash the swap!
As confirmed during the latest article about MVC, one of the greatests discussions around the subject is: Where’s the fat going?
The discussion goes between the two layers, Model and Controller, and has caused a lot of buzz since the MVC boom. So lets take a closer look…
Read the full article
December 21, 2008In my quest for the perfect code I’ve ran thru many tries since I’ve entered the OOP writing utility classes and even coded my own templating system with a simple wildcard replacing variable system but it lacked intowflow controlw structures.
Then I’ve had contact with Smarty and PEAR’s DataObject (PHP language) at a company I’ve worked last year when we used a (very primitive and simple) kind of MVC with DO as model layer, Smarty as view layer and only one huge (around 130 KSLOC) controller that we called “The Godfather” as a private joke. After all, besides DO’s memory meanace, (almost) everything worked as it should but only after I’ve worked with CakePHP’s (Ruby’s) MVC implemetation that I realised how everything should behave.
MVC stands for “Model View Controller” and it’s a multi-layered design pattern. It’s one of the most famous (uhhh the flashes!) and organized design patterns I’ve worked so far because you can split the codes from your database calls and templating system.
Read the full article
December 17, 2008We’ve all seen the most diverse kind of article of “Best web development ________”, “Applications to aid agile web development”… ahh that word “agile”…
The thing that worries me about all those buzz is that it’s all partial. I’m not crucifying people but its what to expect: If the writer is a Windows user, it’ll provide an article about Windows environment softwares and practices. (You can keep reading, this is not a Windows vs Linux post)
Read the full article
December 16, 2008This one was quite interesting. I’ve wrote my PHP function to capitalize the fileld at insert with ucwords() but I already had some on the base that I need to convert without re-importing them.
Read the full article
Every developer has it’s toolkit. When it comes to web development you have a browser as your frontend client and it’s good to have all your tools close by.
Tools saves time, aids debugging and doesn’t kills kittens. So, enjoy my list!
Read the full article
December 12, 2008For every *nix/BSD user, there was no life before SSH and even the crappy Windows plataform got a client (thank god).
But I’ve personally ran into many bad experiences that Google helped me solve.
So, here are my advices for logging into SSH to a linux machine:
- Change your Terminal Emulation to “linux”: Connection-> Data -> Terminal-Type String = linux
- Change your escape sequence to “Linux”: Terminal -> Keyboad -> “The Function Keys and Keypad” -> Linux
- Set the terminal to UTF-8: Window -> Translation -> “Character set translation on received data” -> UTF-8
That’s it, if someone has other tips envolving PuTTY SSH Client, please share at the comments!
December 3, 2008Ok, as wordpress gave my first post, I’ll write something.
Hello All!
This is it. My Blog (yay!). Ok, not that exciting.
Well, here at Heavyworks I’ll write about code, coding, software development, bit crafting and more code. Yeah, it’s basically about coding and all that coding has and represents (anyone understood what I’ve just wrote?).
I have already some code snippets and util functions that I’ll post here too so it maybe useful for someone.
Feel free to discuss, complain and contribute!
I’m still working on a nicer template (even not being a designer [thank god]) so keep on watching. I’m planning to release the new layout and start blogging this weekend!
Cheers!
Jan, the bitwelder!