Useless post ever!
Thursday, November 27, 2008
Tuesday, October 21, 2008
Shrink your Firefox context menus with ffchrome
If you, like me, don’t like reading all the forty seven options of the firefox context menu just to find the “Save link As..” or “Save Image As…” options, here is the solution: ffchrome Firefox extension.
This extension allows you to customize the Context Menu elements, keeping the menu very tiny and clean.
by
Fábio Gomes
at
12:07 PM
0
Comments
Permalinks
Monday, October 20, 2008
xKill - My favorite Linux application of all times, now on Windows
Now I can, once more, use one of the most useful tools ever invented: xKill.
If you don’t know what it does, its purpose is very straightforward: It kills any application with just one mouse click.
You know when that buggy application which has a giant memory leak crashes, start eating up all you memory and by the time you try to open the task manager you computer is already dead? Well, this is over now.
With xKill you need just to hit Ctrl + Alt + Backspace and click on the bad application, it will die instantly.
You can download the windows version of xKill here. Have a nice hunting!
by
Fábio Gomes
at
8:51 PM
0
Comments
Permalinks
Tags: software, Tips, Tools, Windows Vista
Merging partitions on Windows Vista
Recently I began to run out of space on my Windows partition, mostly because when I installed Vista I thought that 30GB for the primary partition would be enough.
That proved to be a miscalculation, even disabling everything I could, like Hibernation and making Service Pack 1 permanent, I was still running out of space.
Luckily I found out that you can Merge partitions on Windows Vista, with no effort at all!
I had an old partition which I mostly used to test Linux distros, so I deleted that partition and merged up the free space with the primary partition, the problem was solved with a few clicks!
If you are running out of space, instead of reinstalling everything from scratch, you can backup a secondary partition, delete it, merge the free space with the Windows partition and live happily ever after.
by
Fábio Gomes
at
1:41 PM
0
Comments
Permalinks
Tags: software, Tips, Windows Vista
Thursday, October 02, 2008
Delphi 2009 Help, when F1 becomes useful again
Sad, my coffee breaks are gone, luckily my coworkers will work more peacefully now!
I just hit F1 on Delphi 2009 and when I was preparing to leave, take a coffee and tease my coworkers the help was already open, and most impressive, it was on the right topic!
As I said before, I believe documentation to be very important for any product, I’m very happy that CodeGear are caring more about it.
IMO, one thing that keep beginners away from Delphi is the learning curve, it is very hard to find information and code examples in the Delphi documentation, also it lacks step-by-step walkthroughs to solve common problems.
I really hope that CodeGear realize that and give it more attention.
But for now, I’m happy, at least with the speed. Oh, and so are my coworkers :)
by
Fábio Gomes
at
1:59 PM
0
Comments
Permalinks
Tags: delphi
Monday, September 01, 2008
Bad software design, MGS4 edition.
The reasons why this blog isn't getting updated in ages are 2, the first one is that the university is consuming a lot of my time and the second one is that I bought a PS3.
Take it easy, I'll not start blogging about games (yet again), I'll blog about my bad experiences with Metal Gear Online (MGO), and how Konami managed to piss off me and everyone I know who bought MGS4.
First of all, to be able to play it online I had to upgrade my Internet connection, not because it was too slow to play, or too laggy, but because I've spent a week leaving my PS3 on every night downloading updates. Just to wake up the next day and see that it didn't download anything because it stopped for some unknown error and the error message showed the error's Hexadecimal code, why the hell would I be interested in the Hexadecimal error code?
After managing to upgrade my Internet connection and download all the updates, the worst part began, Konami might not know, but there is something called PSN, which is the Playstation Network and every PS3 user has at least one account, but Konami didn't know this, so I had to create yet another account at Konami, called Konami ID.
But this wasn't enough, after creating my Konami ID, I had to create a Game ID, and there are some "simple" rules to create both Konami ID and Game ID:
- Your KONAMI ID must be 8-32 characters in length using lower case letters, numbers, hyphens (-), underscores (_), and periods (.).
- Please enter a combination of alphanumeric characters of 8-32 characters in length.
- Symbols cannot be used.Passwords are case-sensitive.
- Your KONAMI ID and password can not be made identical.
- Your GAME ID must be 8-32 characters in length using lower case letters, numbers, hyphens (-), underscores (_), and periods (.).
- Your GAME ID cannot be the same as your KONAMI ID.
- Please enter a GAME ID password 4-16 numbers in length.
- Your GAME ID password must comprise of a sequence of numbers between 0 to 9.Please do not include any alphabetical letters.
Here is the form if you don't believe me: https://id.konami.net/entry.do
Now, imagine yourself wanting to play badly and having to fill up this "little" form using a video game controller.
After one week trying to download the updates, when I was finally managing to get online with MGS4, my fingers were itching to play, and I had to read all these stupid rules and generate and take note of the passwords. Because it isn't enough for Konami to have 1 ID, you must have 2, and with different passwords! Oh, wait, 3 IDs, because I already have a PSN ID.
If you think that it ends here, another "particularity" of MGO, is that you can create just one character per account, if you, for instance, have a brother, you will need to buy another character slot.
This alone made me lost all the will to play MGO.
This is a very good example of bad software design, I just wanted to play, and as we all know, it is possible to use just the PSN to play online, I have all the data that every game might ever need filled up in my PSN account, email, address, birthday, etc. Why the hell do I need to duplicate everything on the Konami account?
Thanks Konami, for yet again giving me a bad game experience.
by
Fábio Gomes
at
2:30 PM
1 Comments
Permalinks
Friday, July 18, 2008
localhost redirecting to www.localhost.com
For some time now, each time I typed localhost on Firefox it tried to open www.localhost.com, but accessing 127.0.0.1 worked just fine.
I was lazy about fixing it, but today I got pissed off and decided to find out what the hell was happening.
After googling a little bit I found this forum post: http://www.wilderssecurity.com/archive/index.php/t-198020.html
It happens because of Firefox and Vista's IPv6 support. I'm not sure why it happens, but there are 3 easy solutions:
- Remove the IPv6 entry for localhost in the windows hosts file (explained bellow).
- Disable Firefox's IPv6 support.
- Disable Vista's IPv6 support.
As I don't use IPv6 at all, my choice, is the quickest and dirtiest one: remove the entry from the hosts file.
To do it, just do the following:
- Open notepad as Administrator and edit the file: C:\Windows\System32\drivers\etc\hosts
- Remove the line: ::1 localhost
- Save the file.
- Open up the command prompt as Administrator (hit the windows key, type cmd and then hit Ctrl + Shift + Enter)
- Execute the command: ipconfig /flushdns
- That's all folks :)
I don't know why Firefox tries to open www.localhost.com, but if you are asking yourself what is "::1 localhost", it is the IPv6 equivalent of 127.0.0.1, you can read more about it at the Localhost's entry at wikipedia.
by
Fábio Gomes
at
11:36 PM
8
Comments
Permalinks
Tags: Tips, Windows Vista
Tuesday, July 15, 2008
How not to offer jobs
Schedule a talk at an university which has a lot of potential employees and do the following:
- University students are called brats, just call them that without remorse.
- If you are employed, it's because there are too much demand for developers, not because you are good.
- The only future that awaits you is RSI.
- If you are 38, you only have 2 more [development] years, then you will be promoted to project manager, AKA elderly developer.
- You don't have to think about new technologies, because the real market is in Acre and they still use 66mhz computers, so go learn Clipper.
- It doesn't matter how skilled you are, software developers will never be rich.
That's exactly what a guy said to us in a speech, they were offering internships.
They just ended up in everyone's list of companies to never send a resume, nobody was left in the room by the time they showed their email addresses.
Although it is funny, the point here is that most company's just don't figure out what smart guys like Joel Spolsky have been saying for some time now.
This reminds me of this scene from the Pirates of silicon valley: Are you a virgin?
When this kind of executive tries to offer jobs for university students, they try to show the image of a successful business man with a nice car, a nice bank account and a big house. Even though we love money, a good salary, being rich and having a Ferrari, there is more in life then being a successful executive working in a successful company.
Think about how much time of your life you spend working, and think about your workplace and coworkers. Are you doing something that really makes a difference and solve real problems or you just do what you are told in order to get your paycheck by the end of the month?
IMHO the problem with software development today is that people are always thinking about profit and forget what a software is meant to do, which happens to be very simple, solve problems.
I wonder how long it will take to people stop thinking about how to make money fast with software and begin to search for unsolved problems. I'm sure that there are a lot of people out there with a lot of problems willing to pay you to solve then, am I wrong? Also, remember that solving problems isn't about creating them so you can solve, you must solve other people's real problems.
Something I always wonder about is: How would Google be if they thought about profiting instead of solving a [real] problem?
Then when I quit a job to earn less and work more, people call me crazy, am I?
by
Fábio Gomes
at
11:15 PM
1 Comments
Permalinks
Tags: Essays
Tuesday, June 10, 2008
define: programming
Programming is all about knowing when to boil the orange sponge donkey across the phillipines with an orangutang gorilla crossed with a ham sandwich to the fourth power of twelve across the nile with an awful headache from the previous night when all of alfred's naughty jalapeno peppers frog-marched the nordic elves across the loom-lined geronimo induced swamp donkey over and above the fortran fortified kilomanjaro fence past the meticulously crafted anti disgusting sponge cake scenario where all the hats doth quoteth the milk which is not unlike the super werewolf from the infinite realm of ninja-step. it's hard to define, really.
By some extremely creative (and high) anonymous guy who commented on Coding Horror.
by
Fábio Gomes
at
6:27 PM
0
Comments
Permalinks
Tags: Fun, programming
Monday, June 09, 2008
RTFM
I learned (the hard way), that is always better to read the documentation, help files, readme.txt or install.txt files before trying to do something using trial and error.
It is always quicker and more productive to take your time, read about what you want to, and then do it knowing exactly how.
You think that an easy task can be done without getting help from boring manuals, going straight to the point is so much funnier isn't it?
Believe me, you are losing so much good information doing it like this, and a lot of time too. When you make something work, how can you be sure that you did it using the right method? Isn't there an easier, faster and safer way?
Sadly most people are afraid of manuals and spend precious time using trial and error, without any clues about what they are doing. When programing this is called programming by coincidence.
I also used to program a lot by coincidence, who didn't? But after passing some hard times you realize that reading the documentation is always faster than trial and error.
So you become to add more value to products which has a good and complete documentation, it's very sad when you find some definitions like this in the documentation:
This is Ranged, a member of class TClientDataSet.
When you are working on a project, or in my case developing something which will be used for several projects, it is very important to document things, it will save you and your co-workers a lot of time in the future, I usually forget things which I did myself, how can will I remember about something someone else did if nobody documented it? Well, guess the only option is to program by coincidence.
by
Fábio Gomes
at
11:09 PM
0
Comments
Permalinks
Monday, May 26, 2008
Recursive component's enumerator in Delphi
I needed to loop through all the components in some forms, and when you have a frame inside a form, the default TComponent's enumerator doesn't return the components which are inside the frame.
After goggling a little bit I found this nice reference: Fun with enumerators, which helped me understand how Delphi enumerator's work (and how complicated they are), so I managed to write a class helper to loop recursively through components.
Below is the unit full source code:
unit RecursiveEnumerator;
interface
uses Classes,
Contnrs;
type
TRecursiveComponentsEnum = class
private
FComponents: TComponentList;
FIndex: Integer;
function GetCurrent: TComponent;
public
constructor Create(AContainer: TComponent);
destructor Destroy; override;
function MoveNext: Boolean;
property Current: TComponent read GetCurrent;
end;
IRecursiveEnumeratorFactory = interface
function GetEnumerator: TRecursiveComponentsEnum;
end;
TRecursiveEnumeratorFactory = class(TInterfacedObject, IRecursiveEnumeratorFactory)
private
FContainer: TComponent;
public
function GetEnumerator: TRecursiveComponentsEnum;
constructor Create(AContainer: TComponent);
end;
TRecursiveEnumeratorComponentHelper = class helper for TComponent
public
function GetRecursiveEnumerator: IRecursiveEnumeratorFactory;
end;
implementation
uses
SysUtils;
constructor TRecursiveComponentsEnum.Create(AContainer: TComponent);
procedure AddToList(AComponent: TComponent);
var
lComponent: TComponent;
begin
for lComponent in AComponent do
begin
if lComponent.ComponentCount > 0 then
AddToList(lComponent);
FComponents.Add(lComponent);
end;
end;
begin
FComponents := TComponentList.Create(False);
AddToList(AContainer);
FIndex := -1;
end;
destructor TRecursiveComponentsEnum.Destroy;
begin
FComponents.Free;
inherited;
end;
function TRecursiveComponentsEnum.GetCurrent: TComponent;
begin
Result := FComponents.Items[FIndex];
end;
function TRecursiveComponentsEnum.MoveNext: Boolean;
begin
Result := FIndex < FComponents.Count - 1;
if Result then
Inc(FIndex);
end;
function TRecursiveEnumeratorComponentHelper.GetRecursiveEnumerator: IRecursiveEnumeratorFactory;
begin
Result := TRecursiveEnumeratorFactory.Create(Self);
end;
constructor TRecursiveEnumeratorFactory.Create(AContainer: TComponent);
begin
FContainer := AContainer;
end;
function TRecursiveEnumeratorFactory.GetEnumerator: TRecursiveComponentsEnum;
begin
Result := TRecursiveComponentsEnum.Create(FContainer);
end;
end.
It is a class helper, to use it, just add the unit to the uses list and use it like this:
var
Component: TComponent;
begin
for Component in GetRecursiveEnumerator do
// do something with the component
end;
The magic here is that it doesn't loop trough the components "on the fly". When you call the GetRecursiveEnumerator a TRecursiveComponentsEnum instance is created, at this time, it loops recursively trough all the component's underlying components and fill a TComponentList (FComponents), then the GetCurrent method return's the components from this list, and it just works.
constructor TRecursiveComponentsEnum.Create(AContainer: TComponent);
procedure AddToList(AComponent: TComponent);
var
lComponent: TComponent;
begin
for lComponent in AComponent do
begin
if lComponent.ComponentCount > 0 then
AddToList(lComponent);
FComponents.Add(lComponent);
end;
end;
begin
FComponents := TComponentList.Create(False);
AddToList(AContainer);
FIndex := -1;
end;
Hope I'm not reinventing the wheel. If you know a better solution, please let me know.
by
Fábio Gomes
at
12:32 PM
2
Comments
Permalinks
Friday, May 09, 2008
Code is your least problem
Most developers think that in order to be a good developer, they need to know 10 different programming languages. I wish real life was that simple.
When you start working in real life software, problems in the source code are the easiest to solve, the real problems start to hunt you when you need to think about design, or in most cases, when you don't design in the first place.
Keeping it short, you can't please both Greeks and Trojans. If you try to do that, you can doom your project for that neat little feature you added just because someone asked and you found it cool.
I just finished reading The Mythical Man Month, it was written in the sixties, back then they didn't have these wonderful ultra high level languages as we do today, but still problems in the design phase were worst than coding problems, can you imagine what is worst than reading memory dumps produced by assembly code?
I confess that when I started programming, I wanted to write code, and still want, but I realized that rushing straight to the code writing will give you more headaches and make you lose a lot more time than if you take your time and carefully think about what problem you are trying to solve, but still I always rush into it.
Have you ever get in a discussion that lasted hours and hours and suddenly someone asks "what problem are we trying to solve again?", usually nobody can answer it.
Asking yourself what problems you are trying to solve is indeed one of the best ways to be sure that what you are trying to do is worth it, you need to solve problems, not write code, indeed for a developer it is very difficult to solve a problem without writing code, but that would be heaven, personally I find it more enjoyable to delete code, not write it.
If we wish to count lines of code, we should not regard them as lines produced but as lines spent. (Edsger Dijkstra)
Remember, your purpose is to solve people's problem, not write code, if you keep that in mind, you can produce real software which people would really use in real life, which would solve real problems.
Easier said than done, isn't it?
by
Fábio Gomes
at
11:02 PM
0
Comments
Permalinks
Sunday, May 04, 2008
How to add syntax highlight to Blogger
Adding syntax highlight to blogger is very simple, first of all you need to download SyntaxHighlighter.
Now extract the contents of the package and upload the Scripts and Styles folder to any host or website which can be linked from your blog.
To make it work, you will need to edit your blog's template and add the following code after the <!-- end outer-wrapper --> tag:
<link href='http://[YOUR HOST URL]/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script language='javascript' src='http://[YOUR HOST URL]/shCore.js'/>
<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>
Now you just need to add support for the languages you want, I could just say, just put this bunch of code on your blog's template and it will work, but most people don't post code in several languages, also it's very important to understand what the hell you are doing.
To add syntax highlight support for python, after the shCore.js line you added before, add this line:
<script language='javascript' src='http://[YOUR HOST URL]/shBrushPython.js'/>
If you browse the Scripts folder of the syntaxhighlighter package, you will notice several shBrush*.js files, like shBrushPhp.js, these files are the highlight rules for especific languages, to support other languages, just change the shBrushPython in the above code to your language's specific file and add it to your template.
Syntaxhighlighter supports pre and textarea tags, but it will not work automagically, you need to specify that a pre or textarea tag is code and which language the code is.
To add some python code to your blog use:
<pre name="code" class="python">
The list of supported languages and their aliases can be found at the syntaxhighlighter wiki
by
Fábio Gomes
at
11:42 AM
13
Comments
Permalinks
Wednesday, April 23, 2008
UsWare, the better way to make software. Better.
This week I decided to use the software I'm currently helping develop at my job to control my personal finances.
I used to control my finances on a spreadsheet and it was a real pain, I've never had a real estimate of anything, I just got very wrong assumptions.
This experience of using our own software was very constructive, in the first 5 minutes I thought: "how the hell can people use this?", But after a while I noticed that the software is very consistent and it does very well what it is supposed to do.
In 15 minutes I had about 15 ideas of improvements, some I tried to code right away, others, after some thinking proved not to be worth doing, and others gave ideas for future improvements.
Being a user of your own software just brings you benefits, you will know it better than anyone else and be user and developer at same time.
This quote fits perfectly for those developers that treats users as enemies:
"Know thy self, know thy enemy. A thousand battles, a thousand victories.” Sun Tzu
If you write software but don't use it, shame on you!
This post was inspired by: UsWare vs. ThemWare
by
Fábio Gomes
at
10:19 PM
1 Comments
Permalinks
Thursday, March 27, 2008
Delphi 2007 Cheat Sheet
This week I started reading the Marco Cantú's Delphi 2007 Handbook, and it inspired me to make this cheat sheet.
I learned several new Delphi 2007 shortcuts that helps a lot to improve productivity.
I made a compilation of the shortcuts which I think are essentials to every Delphi developer.
Download: Delphi 2007 Cheat Sheet.pdf
Just a few comments about some of the shortcuts:
Ctrl + /: This slash is the phisical slash key, it is located on the left side of the right shift key.
Ctrl + O, U: This shotcut inverts the case so CaSe becomes cAsE, you have to select the text, press Ctrl + O, release the Ctrl key and then press U
by
Fábio Gomes
at
7:38 PM
1 Comments
Permalinks
Tuesday, March 11, 2008
How to use TortoiseSVN to create a local Subversion repository
In my last post I explained how version control works, today I'll explain how to create your first local subversion repository using the tortoiseSVN subversion client.
There are several ways to have a Subversion repository, you can create an open source application and host in Google Project Hosting, you can sign up for a professional subversion hosting like wush.net, and you can keep it simple (stupid), and create your own local subversion repository.
A repository is basically the main subversion database where subversion tracks all modifications you do to any files added to it. So in order to use subversion you need a repositoy.
First of all you will need the TortoiseSVN client, just grab it and install.
After installing it, it will add some new options to you Windows Explorer context menu, so right click in any folder and you will see 2 options, SVN Checkout and a TortoiseSVN sub menu.
First of all, you will need to create a folder to be your repository, this folder will store a copy of your projects stored in the subversion repository and keep track of their modifications, so create a folder called MyRepository in any place you like.
After creating the folder, right click on it, go to the TortoiseSVN menu and click on Create Repository Here.
That's all you need to create a local repository.
No you will need some code to add to it, so create a folder or just create a folder called temp and a HelloWorld.txt, open the HelloWorld.txt file and type something on it.
Now, right click on the temp folder and on the TortoiseSVN menu, select import.
You will need to select where you repository is, to do so, click on the "..." button on the top right corner, and select the MyRepository folder.
Type Initial Import on the Import Message and click OK.
I'll explain what you just did, because it can be tricky to understand.
When you created your Repository, you just created an empty database, and the import you just did, added your project to that database, so now you can access your project using the database and send your changes to the database.
Create a new folder anywhere and call it MyWorkingCode, now, right click on this folder and select SVN Checkout, this window should pop up:
As you did in the import process, click on the top right button and select the MyRepository folder, don't change the checkout directory, now just click the OK and you will notice that Subversion starts adding your files to your MyWorkingCode folder.
Notice that now your MyWorkingCode folder has a green icon on it, it means that the source code in that folder wasn't modified and it is exactly how it was on the subversion repository when you checked it out.
Inside this folder you should find your HelloWorld.txt, change something in this file and save it, after saving you will notice that both the file and the folder containing it will have a red icon on them, that means that they were modified.
Now you have two options, send those modifications to the database, or revert the stated of the file back to the state it was when you checked it out, it is a very powerfull thing, because now you can just mess everything up and with just a click you have everything back to normal in seconds!
Try it out, delete the HelloWorld.txt file and after that right click on your MyWorkingCode folder and select Revert on the TortoiseSVN sub menu, click OK on the window that will pop up and feel the power, your file that was deleted was restored!
Now, Edit your HelloWorld.txt again and save it. After that, right click on you MyWorkingCode folder and select SVN Commit, you will notice that a Window will pop up and in the bottom panel, you will see your modified File, double click on it, you should see this window:
It shows the differences between your working file and the state the file was when you checked it out, just close this window and click on the OK button in the Commit window, it will send your modifications to the database and show the new revision number, this means that now you have 2 versions of this file on the repository, and you can get them at any time, just checking out the specific revision, and also you can revert the file to any past revision you like.
For now it's just it, I don't want to scare you as I was scared by the SVN Book, so I'll try to post a better explanation of commit and other subversion features in a near future, stay tunned.
by
Fábio Gomes
at
10:08 PM
11
Comments
Permalinks
Monday, March 10, 2008
How version control works
I can't believe how stupid I was for not using a version control software since I started programming, I was always lazy about reading about it, also the SVN Book scared me do death.
First of all you will need to understand what version control really means.
You can find a lot of information about version control, but sometimes they are too extensive or maybe too complicated for beginners, I don't know if when people write about it they want to scare the begginners so they can learn the hard way as I did, but anyway I'll try explain with my own words, how version control works.
Every developer who has written more than "hello world" applications have faced this kind of situation:
You have a software that says that 1 plus 1 is 2, and then you change some stuff and it start saying that 1 plus 1 is -1, well, you changed a lot of stuff and it was working yesterday, but today you can make it work anymore, and also you changed so many things that it is almost impossible to figure out what caused the problem, it would be nice to have something to say what was changed since yesterday so you can quickly get a clue about what went wrong and what modification added the bug.
Well, version control could do that for you...
Now another situation, what if you accidentally deleted a file by mistake? What are you going to do? Search for backups? What if your backup is one week old and you changed a lot of stuff since then, well I guess you will have to do everything again, good luck.
Even people who already use version control sometimes don't know about everything it can do and how it really works.
First of all you need to understand that version control just stores the differences of your files, it creates a database and after you add a file for the first time, from that point on, every time you modify it, it will store only the difference of the current file to the previous state, so you can get the original file any time you want, and also based on this, you can always keep track of every modification and restore a file to any state it once was.
Also, version control never removes anything, so even if you delete a file, you can always restore it from a previous point where it still existed.
Imagine a timeline, with version control you can just go back to a point in time when that file still existed and restore it, nice isn't it?
Most people start using version control after the first time they need to work with someone else in the same source code, because it's practically impossible to work in a team, modifying the same source code without version control.
Did you notice that I didn't talk about any advantages version control has when working in teams, well, Its because that is not the idea behind this post.
For some time now, I've been keeping a local subversion repository for all my personal application, even the useless ones, because every once in a while you need to do something in real life that you already did in some useless test application that you garbaged, if you have that piece of code in subversion, it's just a matter of minutes do find it, instead of losing some hours doing it again.
To learn how to create your own subversion repository, please read: How to use TortoiseSVN to create a local Subversion repository
by
Fábio Gomes
at
6:56 PM
2
Comments
Permalinks
Blogs and chitchat
This week I unsubscribed from several blogs I used to read because of the excessive chitchat.
I noticed that after becoming famous, a lot of blogs started posting useless and repetitive stuff just to keep the blog updated, and that resulted in poor content which doesn't add anything to my life, so I just kicked their asses and unsubscribed from the rss.
One of the reasons this blog kinda died, is because after deciding to just post here about something that can add something to the reader's life (which is not the case with this post), I just got out of ideas.
When I ask myself "will this add something to people's life?" the answer is no and as I'm too lazy to just post it anyway, I just forget about it.
But maybe, just maybe, I'm thinking the wrong way, maybe my ideas just don't add something to MY life, but it could be helpful to someone out there, and as now I just have a few things to read in my rss read, I think I can use some spare time to post some chitchat here too, who knows?
by
Fábio Gomes
at
6:44 PM
2
Comments
Permalinks
Tuesday, November 06, 2007
Yet Another Gaming Blog
After receiving some feedback about my posts about games in this blog, I decided to dedicate this blog just for technology and software development, as some readers don't like games and most of them doesn't have a Nintendo DS.
So I just moved all the posts related to games to this blog: Yet Another Gaming Blog.
But sadly, I'm not going to update it, because after thinking about it, I realised that there is too many game blogs and sites out there, and my opinion about it doesn't make any difference.
I think that someday this blog about development will be useful, at least for laughing about how I sucked (as I laugh when I read the first posts of this blog), so I will try to keep a post schedule of 1 post per year (just kidding).
I'm planning to continue my series of programming lessons from where it stopped and also I have some nice posts planned, because after getting some feedback from friends and readers, I think I found the path that this blog should follow.
So from now on, expect this blog to be a serious blogs with just useful and original posts, I'll stop with this stupidity about posting news that everybody already saw in 10 different sites on the internet.
After analysing the log about the readers of this blog, I realised how stupid I am from posting news on this blog, and how much I missed from not posting original contents here.
Even though I still suck at almost everything I do, there are people out there that still are clueless as I was sometime ago, and helping these people will be the main goal of this blog.
So, sign the RSS feed and have faith!
by
Fábio Gomes
at
1:38 AM
2
Comments
Permalinks
Thursday, November 01, 2007
How not to write code: The evils of duplication
I had to do some maintenance on some old php code and saw the following code:
Just by looking at it you can see 3 things:
1 - Everything is duplicated
2 - It was copied and pasted.
3 - The field names sux.
Well, guess what, I wrote that code. period.
But now when I look at it, it is disgusting. I'm violating the DRY (Don't repeat yourself) principle and also suffering from the evils of duplication, because I needed to add one field in that select, and if I didn't refactor I would have to add the field 3 times!
But as I'm sucking less now I took some minutes and refactored the code, here is what the code looks like after a quick and little refactoring:
Still not perfect, but way better.
by
Fábio Gomes
at
12:05 AM
1 Comments
Permalinks

