Friday, December 07, 2012

It's About Doing Something Good

It's not always about the fame and the fortune. Sometimes it's as simple as saving someone the headache of having to get a new ID card, passport or driver's permit.

I was saved from this torment twice and now I think it's time I return the favour to my countrymen.


Friday, November 30, 2012

Fixing a Problem

Problems. They're everywhere, especially in my country. They range from simple annoyances to huge socio-economic issues that will take a large amount of effort, money and divine intervention to cure.

As humongous or diminutive as problems might be I believe that the solutions to them come about by chipping away at the issue in a very incremental manner. It just takes time and a fair amount of consistency, but eventually the problem will dissolve.

But what about this case - what do you do in a case where the solution to the problem is so simple, yet the people for whom you are solving the problem are too paranoid and distrusting for them to even dip their toe in the solution unless they see someone else drinking the proverbial Kool-Aid first? What do you do then? What becomes of the problem? Can it still be classified as a problem since nobody seems to want it solved or everybody balks at the presented solution?

There is a culture in my country that says no solution (or product in a general sense of the word) is any good unless millions have been spent in creating it is presented with lavish press conferences and promotional campaigns. I honestly find this highly annoying and it shows where we are as a people in terms of our mental development.

I'm daring to change that culture and see if I can bring my country even one step closer to the 21st century. That's why I'm challenging myself to fix a problem that plagues everyone in my country, and i'm going to fix it with a budget of $20USD and I want to see how my countrymen react to it. It's going to be practical, free and simple to use. Let's see how it goes.






Thursday, August 23, 2012

jQuery QR Code Generator

So I came across a QR Code (2D Barcode) generator tonight that is written in pure JavaScript, relies on jQuery and makes 0 calls to any external API.

It's called jQuery QR Code and it's written by Jerome Etienne. Take a look at his GitHub project and tell me  what you think. This will definitely come in handy on my current project!

Saturday, March 03, 2012

Fixing Ubuntu Issues: No Wireless on Reboot

Continuing on with my series on solving problems I've encountered while using Ubuntu 11.10, I've found yet another solution to a problem that I heard a lot of people talking about. It's also a hot topic on the Ubuntu forums. I',m speaking, of course, about Ubuntu and wireless internet access.

In recent times it has not been uncommon for Ubuntu to not be able to connect to my wireless network on boot up, so I did some digging and found out that the problem was that the Automatic DHCP IPv4 settings were to blame. My solution: use manual IPv4 configuration. Here's how.

My internet set up is as follows :- My modem is connected to my wireless router which propagates the signal that my PC's USB wireless adapter receives. There's plenty of networking going on there, (something I am not the best at) but I do know that finding out the IP addresses of my various pieces of network hardware will be the key.

So on my Windows machine i ran ipconfig and found out those addresses:

192.168.1.1 - My modem's address
192.168.2.1 - My wireless router's address (Default gateway)
192.168.2.5 - Address of PC
255.255.255.0 - Subnet mask

I took those settings over to Ubuntu, opened the network manager by clicking the Wireless icon in the top task bar, selecting Edit connections... > Wireless > FBI_VAN_467 (My SSID) > Edit... > IPv4 Settings and entering the information as follows:


I chose a random non-conflicting IP address for my Ubuntu PC's address, used my wireless router's IP address for my default gateway and set my DNS server address to my modem's address.

After that it worked like a charm. I hope this helps!


Thursday, March 01, 2012

New Search Engine - DuckDuckGo

After reading this very interesting and informative article (http://dontbubble.us/) and hearing mentions of it in the tech-o-sphere, I was intrigued to look into this DuckDuckGo search engine to see what it was about.

Now, anybody who knows me knows that I'm a G-Man (Google Man) through and through, but honestly i've not been to happy about their recent skirmishes with the law when it comes to people's privacy and the extent to which they will go to get your personal information so that they can target ads to better suit you.

Truthfully I was never a fan of the idea that I was being herded and processed by a big company that was going to use my personal information, my likes, dislikes, hobbies - my personality - to make money, but I had to tolerate it because it was the companies behind some of the best internet services that I use were doing this.

Now there's a new duck in the search engine pond and this one is more morally secure and less thirsty for money and is doing... just fine! I'm talking of course, about DuckDuckGo.

Granted i've only been using it for a grand total of 6 hours, I was very impressed with the speed, the relevance of the search and the cleanliness of the design... I'm just not too fond of the name. It doesn't quite adhere to the web 2.0 naming convention of 2 syllables, real/unreal word but I guess it sort of works for them. DuckDuckGo doesn't really roll off the tongue like Google or Yahoo or Bing but the name contributes to the overall playful charm of the site and to be honest, I would be reluctant to use another Web 2.0 named search engine like Searchly or Fynd or something like that.

A Sample Search

I did a Google search for  Railscasts and compared the results to those I found on DuckDuckGo. I preferred Duck's search results. They pointed to some more relevant resources.

Google Search Results

Results from the Duck
I personally prefer Duck's results. As you can see I snatched up the Railscasts them for Vim :) What do you think?

Friday, February 24, 2012

Validating Virtual Attributes in Rails 3.1

When validating virtual attributes in Rails it's important to remember that they are just that - virtual attributes. I spent almost an hour last night trying to figure out why my validations were throwing an error when I called Object.valid? My class was structured similar to the following (forgive me, I am a Rails n00b):
Class User

attr_accessor :password

validates :password,
:presence => true,
:on => create

validates :password,
:length => { :minimum => 6 :maximum => 8 },
:if => :password?
.
.
.
end
When calling valid? on the User object I got a method undefined error for password?. I could't quite figure it out and I was wondering what I was doing wrong until eventually I tried appending the following to the bottom of the class definition:
.
.
.
def password?
 self.password.present?
end
.
.
.
An seemingly simple and obvious solution, I know, but this took me about an hour to figure out after Stack Overflow failed me for the first time.

I hope this helps save someone else the frustration I endured.

Thursday, February 23, 2012

Fixing Ubuntu Issues: Ugly Font Rendering in NetBeans

Recently i've had the displeasure of working in NetBeans on Ubuntu. The IDE is great but the font rendering is terrible. Here's my solution to this problem.

The first step is to uninstall Open JDK (if it is installed) and install Sun's JRE. Do that by selecting the following packages in the synaptic package manager:

  • sun-java6-bin
  • sun-java6-jdk
  • sun-java6-jre

Mark all installed instances of Open JDk for uninstallation if you have to, then click Apply.

Confirm your Java version by going to the console and entering

java -version
You should see
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)
Now that that's done, install Microsoft's Core Fonts. Do this by going to the Ubuntu Software Center and searching for 
ttf-mscorefonts
Install them, then open NetBeans, go to Tools > Options > Fonts and Colours and choose the Courier New font. I set mine to size 18 bold. Here is my result:


Before


After

Wednesday, February 22, 2012

Fixing Ubuntu Issues: Restart Wireless Without Reboot

Sometimes after resuming from sleep, you would find that your wireless connection no longer works. Up until now, my only solution to this was to reboot. I've found an alternative solution from user mariosx on http://ubuntuforums.org/archive/index.php/t-913407.html that involves simply restarting the wireless interface. To do so, enter the following in a terminal window


sudo ifconfig eth1 down
sudo ifconfig eth1 up

Where eth1 = your network interface. Could be wlan0 or something like that. I have not yet tried this out, but it's one of the more sane solutions i've come accross for this problem during my searches.

Fixing Ubuntu Issues: Flickering Pointer

Upon instlaling Ubuntu 11.10 some of may notice that the cursor constantly flickers and sometimes disappears randomly. To solve this do the following:

Note: xorg.conf is depreciated in Ubuntu 11+

Type the following in a new console window:

cd /usr/share/X11/xorg.conf.d

sudo touch 10-monitor.conf

sudo gedit 10-monitor.conf

Paste the following into the file, changing variables where indicated by the comments

Section "Monitor"
    Identifier    "Monitor0"
EndSection

Section "Device"
    Identifier    "Device0"
    Driver        "nvidia" #Choose the driver used for this monitor
EndSection

Section "Screen"
    Identifier    "Screen0"  #Collapse Monitor and Device section to Screen section
    Device        "Device0"
    Monitor       "Monitor0"
    DefaultDepth  24 #Choose the depth (16||24)
    SubSection "Display"
        Depth     24
        Modes     "1680x1050" #Choose the resolution
    EndSubSection
EndSection

Save the file.

Press CTRL + ALT + FI to enter terminal mode and type the following:

sudo stop lightdm

sudo start lightdm

Log in and notice that the cursor does not flicker any more. You may have to unplug your mouse and plug in back in to get the cursor to work. If you do not get back to the graphical mode after starting the display manager, press CTRL + ALT + F7

Reference: http://ubuntuforums.org/showthread.php?t=1730188