Jourdein

I code, I experienced, I blog and I share my enthusiasm

I tried Git

Posted by Jourdein On February - 20 - 2010ADD COMMENTS

images-1.jpgCurrently, I hosted my repositories with XP-Dev that utilize Subversion as it’s source code management system (SCM). Hearing a lot of hypes about the Git, I did try setting up a git account at Project Locker.

images-3.jpgYep, it seems that Git is really is an advance SCM. It has a lot of features. What differentiate it from Subversion is it’s decentralize repository system. Rather than recreate the post, you can read it at Why you should switch form Subversion to Git.

images-2.jpgOn Mac, if you’re using git, there an open source Git UI called GitX. It trying to utilize the advance features in Git producing such an interface. You have a history graph which I’ve never seen in Subversion UI yet. After you commit, you can see which file and which line has been merges/changes rather than executing command diff.

When you first checkout, you are cloning form the main repository. Thus, when you are in offline mode, you can still commit or revert to previous revision. When you online, push it the server and it will merge with other repo.

Frankly, I would love to convert to Git but project-wise, Subversion can still do what Git can do since my project is not so big and with small team. Moreover, Git is complex because of features it has while in Subversion, I just need to commit or update and does not worry about commit, push and branch merging etc.

Software Is Hard

Posted by Jourdein On February - 16 - 2010ADD COMMENTS

Developing software is hard. Below is an article form August 19, 2007.

Software is hard

Really, developing software is hard. If you want all those nifty features, biasing to certain framework because it’s the best, feeding your preference for certain os and without final decision. Yes, if all of those are free then go for it. In reality, those are cost. What languages you gonna use and how many developers you have? What are their expertise?

Some need to be compromise in order to benefit others or to maintain balance.

Submitting app to App Store

Posted by Jourdein On February - 10 - 2010ADD COMMENTS

images.jpgReally… it was really a tricky tasks making sure that your app is codesign correctly and Apple website accepted your app. As I could remember, I repeat myself more than 7 times doing the same thing, making sure that I did the steps correctly or when changes require you to start from the beginning.

In a simple understanding flow of process, you need to:

1. Create a request for certificate
2. Install the certificate
3. Create App Id
4. Create Provisioning profile
5. Download Provisioning profile
6. Setting XCode to CodeSign using the certificate.
7. Get the binary file, zipped it and upload to Apple website.

So, your target is to get the binary file (.app). That .app file must be signed by XCode using certificate given by Apple. The signing process also requires that you have a valid provisioning profile which you get from Apple, generated from the certificate you’ve requested.

ForkLift 1.7 crashed on Snow Leopard

Posted by Jourdein On February - 3 - 2010ADD COMMENTS

forklift.pngI’ve install ForkLift 1.7 and suddenly, it crashed. Examining the report that is supposed to be sent to Apple, I found that, ForkLift is trying to access some of the files that aren’t there.

Googled and found that the files has been placed under a different folder in Snow Leopard. Logical thinking, the files are there but ForkLift doesn’t know where they are.

Found a fix that restore those file references by creating symlinks:

sudo ln -s /System/Library/Frameworks/AppleShareClientCore.framework /System/Library/Frameworks/AppleShareClient.framework
sudo ln -s /System/Library/Frameworks/AppleShareClientCore.framework/Versions/A/AppleShareClientCore /System/Library/Frameworks/AppleShareClientCore.framework/Versions/A/AppleShareClient
sudo ln -s /System/Library/Frameworks/QuickLook.framework /System/Library/PrivateFrameworks/QuickLookUI.framework
sudo ln -s /System/Library/Frameworks/QuickLook.framework/QuickLook /System/Library/Frameworks/QuickLook.framework/QuickLookUI
sudo ln -s /System/Library/Frameworks/QuickLook.framework/Versions/A/QuickLook /System/Library/Frameworks/QuickLook.framework/Versions/A/QuickLookUI

Run the above commands in terminal. If you have problem copying and pasting, download it here. Execute the file from terminal either by

$ ./fixsymlinks

or

$ source fixsymlinks

From whom did I get the solution… Zolntanb (thanks mate)

Google is phasing out Microsoft internet Explorer 6

Posted by Jourdein On February - 2 - 2010ADD COMMENTS

ie6trash.png Google will begin phasing out support for IE6 and other older browsers on Google Docs suite and Google Sites editor on March 1. I’ve received the notices since I’m an admin for Google Apps.

Seems that, somewhere in 2010, Google Apps will continue to support IE7 and above, Firefox 3.0 and above, Google Chrome and above and Safari 3.0 and above.

Since Google has forgotten IE6, it would also be natural for me to forget IE6. My life would be easier developing website without worrying how it will render on IE6 or IE5.

Google said that they want to harness latest improvements in web browser technology and it would be HTML5 and faster Javascript. Google has their experiment on this technology and it was mind blowing experiences. And mind you, IE is not welcome there. It mainly targeted for Chrome browser but Firefox and Safari can view correctly but not IE (I’ve read some comments there about this). Head to Chrome Experiments to see for yourself.

Updating a has_many relational model

Posted by Jourdein On February - 1 - 2010ADD COMMENTS
has many relationship solution.png

Last night, found a problem in codes during updating form for a has_many relationship model. Rather than updating the record, it created a new one.

The solution is in railscasts episode 75.

Consider contact that has_many contact_email addresses. Created

def contact_email_attributes=(contact_email_attributes)
  contact_email_attributes  do |attributes|
    contact_emails.build(attributes)
  end
end

Changed to this one:

def contact_email_attributes=(contact_email_attributes)
  contact_email_attributes.each  do |attributes|
    if attributes[:id].blank?
      contact_emails.build(attributes)
    else
      contact_email = contact_emails.detect { |e| e.id == attributes[:id].to_i }
      contact_email.attributes = attributes
    end
  end
end

that will updates contact_email if there’s :id attributes. Then, I need to add the :id inside the form as hidden_field_tag:

- @contact.contact_emails.each do |contact_email|
...
= hidden_field_tag "contact[contact_email_attributes][][id]", contact_email.id
...

And that’s all. It’s done.

In the form, you could do fields_for rather than using _tag methods. In fact, my original code was using that but after I tried everything and it ended up with the _tag methods, I was lazy to change it back. By the way, it works both ways…

Passenger, Rails and XAMPP on Mac

Posted by Jourdein On January - 30 - 2010ADD COMMENTS

I’ve successfully setup my Rails on Passenger. It was not a swift tasks as I was trying to setup it on ‘my’ XAMPP.

I had XAMPP all the way since I’ve started development on PHP. Don’t want to install different Apache server just to setup Passenger. Because of that, I took 1 full day of my life to finally have a functional Rails with Passenger on Apache in XAMPP.

(assuming you had Rails with Mongrel and XAMPP already)

  1. Install gem Passenger
  2. Download XAMPP dev (this is the key for success!)
  3. Run passenger install script
  4. Modify Apache .conf file

(you’re ready to go)

Add some miscellaneous (that’ll make your life easier)

  1. Download and install Passenger Preference Pane

1. Install gem Passenger

$ sudo gem install passenger

2. Download XAMPP Developer

XAMPP Developer package for Mac

3. Run passenger install script for Apache

$ sudo passenger-install-apache2-module

(No. 4 step is given at the end of module installation above)

Download & install Passenger Preference Pane here

Hosting server migrated

Posted by Jourdein On January - 12 - 2010ADD COMMENTS

legal-bytes.com was down and at the time of posting, it’s still down. I’ve just waiting for the domain changes to take effect.

I thought, it was the problem related to the server and that I just need wait until it is fixed. It was down for 3 days (approximately) that I took the liberty to send a support ticket to Exabytes‘ support engineer. Immediately (not hour or even half an hour), they replied with the explanation:

For your information, the server 210.48.145.6 already migrate to the new data center and we have update the IP to 110.4.45.29

legal-bytes.com didn’t use their DNS records but just pointing the A record to the shared IP address associated with our hosting package. For that matter, I think, the update of the IP didn’t automatically configured to the domain and thus need the domain administrator to change it manually.

I was very very happy with Exabytes for the services they’ve given. Recommended if you are finding one.

Updates
Did asked if the old DNS still applied and the answer is “not anymore”. It has changed to

Old

ns67.mschosting.com 210.48.145.7
ns68.mschosting.com 210.48.145.8

New

ns101.mschosting.com 110.4.45.4
ns102.mschosting.com 72.18.132.245

Learning Ruby on Rails for 2 weeks

Posted by Jourdein On January - 10 - 2010ADD COMMENTS

I’m really tired. It has been a hectic weekend for me. Code code and more code. Learn Rails in two weeks while developing application at the same time. Today, I think I’ll stop here. The system seems O.K. I would like to enjoy my weekend left.

Working after hours

Posted by Jourdein On December - 30 - 2009ADD COMMENTS

This in one the events that takes place in 2009 about giving power to MACC (Malaysia Anti-Corruption Commission) to detain suspect after office hours. I at first, without reading more, believes that the agency should be given this power to detain after office hours…because crimes happen also after office hours.

Today, I realized, I’m too shallow in knowledge. Found this comment in chedet blog. I took this one from many others as it simply summarized all the points.

By S..Tan on December 28, 2009 11:22 PM

………………CONSTITUTIONAL FREEDOM

The constitution entrusts the police force with security, law enforcement, power of detention. MACC does not exist when constitution written and is not envisaged to hold such powers.

The High Court judge is right, the constitution should not allow too many bodies power over civil liberties. Similarly the constitution does not grant prosecution powers to other bodies except Attorney General.

The judge is looking at civil liberty and freedom. Detention without trial or charge (24hrs interrogation) is violation of basic freedoms and should not be granted freely.

……………..ROLE OF MACC

MACC is a post crime investigation agency, not pre crime prevention body. With investigative not security or preventive powers (from its actions so far) there is no need to give this agency 24hrs detention authority without charge or trial.

Power of detention should be given to only security and safety agencies, not agencies investigating political parties, councilors purchase of stationery etc.

…………….CIVIL RIGHTS ABUSE

It will lead to civil rights abuse which such powers over civil liberties is prone. Already the police (one agency granted such powers) sometimes act out of control.

Since the crime already committed and no security risk involved why need 24hr powers? Anyway if MACC require such power they can refer police.

……………..REDUCING CRIME

Giving MACC 24 hrs detention powers will not reduce crime, as it only acts after the crime has taken place. But dissolving Umno is guaranteed to reduce crime by 900 cases (Tun’s quote on Umno corruption reports)

I do not need to summarize again. The above quote says it all.

Investigation can be done outside working hours but detention of suspect is done during office hours. Call police if requires detention after office hours.

About Me

Programmer as profession, photography and videography as passion. Likes cooking, watching Animes. Code in PHP, Objective-C, VB, C, C++, MySQL, SQLite. Using Photoshop CS3 and FinalCut Pro Express on 2GHz MacBook, 4GB RAM with hardisk capacity 160GB. Owned a jailbroken, activate and unlocked iPhone with 2.0 firmware.

Enter the video embed code here. Remember to change the size to 310 x 250 in the embed code.