Skip to content
Jul 13 10

Hello RoR

by dkberktas

Ruby on Rails (RoR) is the new framework I have been playing with and so far I should say it is really amazing. It has all these intuitive approaches that you find out by just guessing. I can only compare it with a couple of other technologies like RIFE (ogrence.net) and Grails (remotespots.com). RIFE has some neat features (template mechanism, web continuations, asynchronous mail queue, persistence layer, etc) but since the lead developer Geert Bevin stop actively developing it, it takes its place in the graveyard of dead tech. Then I try something different, Grails, which is a Groovy version of RoR. It is really good especially after Java Enterprise, convention over configuration is an excellent approach! But it is kind of very young, also Grails has this really fast development cycles, in a couple of month, I had to update my applications two times in which I spend hours to overcome plug-in dependencies, deployment issues, etc. ( one more thing, I can not find any other cool projects that uses Grails, even at SF Bay Groovy and Grails Meetup Group , actually I was the only one who is currently using Grails :-)  )

Since finding a good starter document is a very important decision, I took my time to select my first RoR source. I went over the following books and decided to use the latter one:

Although it is called as a tutorial, when you get the pdf dump, the 12 chapter tutorial is approximately 500 pages, which is literally a book.

The language of the book is very clean and most of the time funny. You can easily develop the code when you are reading it.  You can also follow a test driven approach if you want, but you don’t have (I didn’t).

I finished the book in 7 days with a daily 4 hours concentrated reading/coding sessions and with lots of Starbucks Misto (thanks Starbucks Besevler crew!).

The final code is at Github, and live demo site at Heroku.

As a pointer for the further steps, the tutorial suggest some pointers but I prefer to go on with my path, which requires ImageMagick and Paperclip, so next post will be about these two.

See you next time!

ps. I really like Heroku. Grails has something similar but to be honest, it is not that magical (as in iPad).

Jul 7 10

Yet Another Hacker News iPad Reader

by dkberktas

A couple of weeks ago, I wanted to read Hackernews with my iPad [although some HackerNews readers see iPad’s Safari good enough for the task (which requires opening new tabs for comments,  lots of copy & pasting URLs to share and  etc)], I searched for an application. Eventually, I found two, which are both paid applications. Since this applications is in my seven nights category (which is something I can code in seven consequent nights without disrupting my day work), I decided to code it myself.

After 3 nights the application was ready for the submission. It got rejected since I didn’t read the iPad User guidelines carefully (actually I just skimmed it in 5 minutes). The rejection reason is “You can’t show more than one popover at the same time”. I fixed the problem, and it is available in the app store (App Store link)

Yet Another Hackernews reader

I will probably change the default RSS feed of Hackernews which only show top 30 posts. Probably something on GAE, and maybe a simple my favorites kind of thing.

Jun 29 10

Grails 1.2.2 and Using ImageTools Plugin with a Slight Modification

by dkberktas

The Grails command create-controller and create-domain-class creates the files directly under the grails-app/domain and grails-app/controller, but the version(1.2.) I am using now has a different behaviour. Instead of grails-app/domain it creates grails-app/domain/{my-app-name}/ and grails-app/controller/{my-app-name}/

So I changed all the groovy file locations into a new folder(package) with my application name ( by the way all these are about my latest online usability testing tool Remotespots.com project). But something weird is happened with the ImageTools plugin. Since I move the controller files, ImageTool class is no longer visible to the controller that uses imagetool. Also, there is no way to import ImageTool since it is in default package, to solve this, go to .grails folder in your home folder and locate your projects folder and change the package of ImageTool.groovy as the following screenshot shows.

further information link

Jun 26 10

iPhone Ad Hoc Distribution Caveats and Useful Links

by dkberktas

One of the things I learn after developing a couple of iPhone (and iPad) applications is that sometimes it can take more  time to make it to app store or installing the app to the clients device than actually developing the applications.

Ad hoc distribution is one the things I really don’t like at all.

These are the caveats  :

-Download the distribution provisioning profile again from the Provisioning Portal, and remove the old one (from the organizer) before installing the new one

-Don’t forget to add the Entitlements.plist file with the key get-task-allow and the value false. (also add it tho the target build settings as Code Signing Entitlements key )

- If the client uses Windows make sure use .ipa file for sending the .app

- It is not iTunesArtwork.png but only iTunesArtwork

The links that explain the process:

  • http://johnehartzog.com/2009/04/iphone-app-ad-hoc-gotchas/
  • http://www.innerfence.com/howto/install-iphone-application-ad-hoc-distribution
  • http://www.iphonedevsdk.com/forum/iphone-sdk-development/3156-problem-iphone-ad-hoc-distribution.html
Jun 22 10

Java Dergisi

by dkberktas

Java Dergisinin ilk sayisini bir [KurumsalJava] grubundan duydum. Oldukca guzel bir girisim. — ozellikle, diger bilgisayar dergilerinin genellikle ayni icerigi tasimasi ve dergi olarak tuketilecek bir icerik sunmamasida dusunursek, bu dergi yazilim agirlikli olmasi ile beni oldukca heyecanlandird– Burda aklimdaki bir soruyuda hemen eklemem gerekiyor, basili dergiler daha ne kadar devam edecek cok merak ediyorum?

Java Dergisi dagitim olarak cok iyi bir is basarmis, neredeyse her yerde gormek mumkun. Derginin fiyati biraz yuksek(9.90) ozellikle Java ile ilgilenmesi olasi ogrenciler icin fiyat biraz hedef kitleyi dusurebilir. Derginin basim kalitesini dusurerek, dergi fiyatinda biraz oynama yapilabilir diye tahmin ediyorum, cunku kullanilan kagit cok cok sacma bir bicimde kaliteli. Guzel ornekler icin, bkn Matematik Dunyasi, Wired, NTV Bilim.

Yazilar korktugum gibi giris seviyesi tutoriallardan olusmuyor, gerci burada bir denge yakalamak cok zor, onlarca dali olan java dunyasinin hangi alanina girseniz bir uzmanlik alani cikiyor. Ornegin Java ME ve Androiddin arka arkaya yazilar ile islenmesi cok hostu. Biri gitmek uzere olan, biri yerlesmeye baslamis siki teknoloji.

Teknik yazilarin disinda, birazda genel havayi soluyan yazilarin eklenmesi derginin okuma keyfini arttirabilir, ornegin bu sayida James Gosling’in SUN’dan ayrilmasi ya da Oracle’in SUN’i satin almasi satir aralarinda gecistirilmis.

Son olarak, derginin Java dergisi olmasi illaki Java programlamasi ile ilgili olmasini gerektirmez. JVM ustunde calisan diger dillerden de bahsedilmesi (jruby, jython, scala, groovy) ve bunlari kullanan frameworklerin tanitilmasi da bence onemli bir katki olur.

Umarim dergi yeterli satis rakamlarini saglar ve surekliligi saglayabilir.

May 21 10

Google I/O 2010 — Notes & Stuff — A Geek Thing

by dkberktas

I am one of the lucky developers (one of the 5000) that can attend Google I/O 2010. I watched many videos from youtube, so I was very prepared for the sessions, but the overall experience was something well beyond my expectations. Below you can find the things I wrote during the three day marathon. Most of the items the things I will check out until the next Google I/O.

And finally, my resolution for the next year is to have a couple of Android apps on the market (maybe a game who knows).

Keywords — that I took note during the sessions

  • Google Web Elements — http://www.google.com/webelements/
  • Google Code Playgorund — http://code.google.com/apis/ajax/playground/#hello,_earth
  • Data Liberation Front — http://www.dataliberation.org/
  • Google Ajax APIs — http://code.google.com/apis/ajax/
  • KML Tutorial — http://code.google.com/apis/kml/documentation/kml_tut.html
  • Google Maps js API V3 — http://code.google.com/apis/maps/documentation/javascript/
  • Spring Roo –  Framework from VMWare that can easily be integrated with a GWT frontend — http://www.springsource.org/roo
  • Google Chrome Web App Store — http://blog.chromium.org/2010/05/chrome-web-store.html
  • WebM is an open media file format designed for the web.  — http://www.webmproject.org/about/
  • http://www.openclipart.org
  • Lots of things start or finish with enterprise enterprise enterprise (boooring…..)
  • Draconian Future (from Keynote Day 2 — referring Apple and Steve Jobs I guess :) — http://en.wikipedia.org/wiki/Draconian
  • Go ANDROID — Froyo 2.2 — 18 months — 180.000 developers — 50.000 applications on Market
  • V8 Javascript Engine — http://code.google.com/p/v8/
  • Sunspider javascript benchmark — http://www2.webkit.org/perf/sunspider-0.9/sunspider.html
  • qik — video sharing site — well, I have heard qik before, but when you use it, with live streaming and instant sharing stuff, it really is amazing
  • Dalvik VM — http://en.wikipedia.org/wiki/Dalvik_%28software%29
  • VP8 — video codec — http://en.wikipedia.org/wiki/VP8
  • What is Android? — http://developer.android.com/guide/basics/what-is-android.html
  • What is OpenGL ES ? — http://www.khronos.org/opengles/


Sessions I attend

The following three are from the Bootcamp which is one day before the io. I was fast enough to register for the event, that I can enter. This was like a warm up for the actual thing.(Bootcamp Schedule — https://sites.google.com/site/iobootcamp/schedule)

  • Introduction to Google App Engine
  • Mapping in 3D: Tips and tricks for Google Earth API and KML
  • The Big Picture and How to Get Started

And these are from the session in io:

  • Ignite Google I/O (http://code.google.com/events/io/2010/sessions/ignite-google-io.html) — the ones I like the most are,
  • Casting a wide net: how to target all Android devices (http://code.google.com/events/io/2010/sessions/casting-wide-net-android-devices.html) — way to technical for me, I am not an Android developer (yet). Also next room, there was another session of Paul Graham, it was full :( next time pg
  • Architecting GWT applications for production at Google (http://code.google.com/events/io/2010/sessions/architecting-production-gwt.html) — Presentation smells like enterprise which I am far from interested. Also, I am not sure about all these code generation stuff for DTOs (Spring Roo), also Vmware&spring is not my favorite source of inspiration (although I play with Grails lately)
  • HTML5 status update (http://code.google.com/events/io/2010/sessions/html5-status-chrome.html) — Last session of the i/o 2010. Two product managers of Chrome made a good summary of HTML 5 features and their perspective on the spec.

Keynotes that I can not attend since I was sleeping at that time :)

  • Day 1 — http://www.youtube.com/watch?v=a46hJYtsP-8&feature=player_embedded#!
  • Day 2 — they haven’t put a full version yet…

Day One After Party
This was a real nerdvana. a 8 leg giant spider that you can literally drive, pac man, food (like a lot), beer (free as in a lot free), huge screens with geeky videos, a toy like thing that you can control it with your mind and try to fly a ball by focusing sth sexy!, robots that play football, Tesla (sexy electric car), beer, remote control robot that try to demolish balloon with its tail, red wine…

Toys, Food, Drinks, T-shirts

Nexus One, HTC EVO, t-shirts, lots of Pepsi, Starbucks Coffee

May 18 10

Adding Transparent Modal View Programatically– iPhone

by dkberktas

Assuming you have a long process  taken so long that you want to show a transparent view, you can do it very easily by just adding the following method to your .m file and you will get the following transparent loading view


-(void)showLoadingView
{
	CGRect transparentViewFrame = CGRectMake(0.0, 0.0,320.0,480.0);
	transparentView = [[UIView alloc] initWithFrame:transparentViewFrame];
	transparentView.backgroundColor = [UIColor lightGrayColor];
	transparentView.alpha = 0.9;

	UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
	spinner.center = transparentView.center;
	[spinner startAnimating];

	UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 280, 320, 30)];
	messageLabel.textAlignment = UITextAlignmentCenter;
	messageLabel.text = @"please wait...";

	[transparentView addSubview:spinner];
	[transparentView addSubview:messageLabel];

	[self.view addSubview:transparentView];

	[messageLabel release];
	[spinner release];
	[transparentView release];
}

Now, you should call this function whenever needed. Let’s say you have a background process that will run while the transparent loading view is shown, below is the code to handle this situation:

-(void)myAction:(id)sender
{
	[self showLoadingView];

	[self performSelectorInBackground:@selector(myActionBackground:) withObject:sender];
}

-(void)myActionBackground:(id)sender
{
        NSAutoreleasePool *apool = [[NSAutoreleasePool alloc] init];
	//your code
        [apool release];
}
May 12 10

Meetups around San Francisco and Random Observations from a Foreigner

by dkberktas

For the last two months, I am visiting San Francisco, as I would say if I see you during a meet-up lately. I arrived San Francisco on 1st of March, and since then I have attended many meet-ups mostly the ones I found from meetup.com which is by the way a wonderful site (and also plancast), and also met with some very interesting characters.

Before mentioning the meetups and the people (SF Bay Groovy and Grails Meetup Group, SF New Tech, SFDUG – San Francisco Drupal Users group, The San Francisco Java User Group, WebMapSocial Silicon Valley Meetup Group, Web 2.0 Expo, Google I/O, and some other), I briefly want to talk about my thought on the community around bay area (actually mostly around San Francisco (sf)).

There are many (many) things (meet-ups, breakfasts, book clubs, expos, ignites…) that can consume all your time easily.  I wonder how people focus on anything around here. (The best way can be disconnect from internet so that you don’t see invitation emails that rain all day.)

the people. They are very very welcoming, and really interested in your story if you can explain it in 15-20 seconds. Really, if it exceeds this threshold, they start to think something else (probably because they are bored) in their mind, and try not to show it to you. But you can see it on their face :)

Another thing is you can instantly tell whether the person in front of you is a technical guy or a marketing guy, or a guy with money and time (these are the categories I come up  so far). Tech guys mostly either very geeky and friendly (like the one in TBBT) or very tense like the ones mentioned in Rework in the chapter about burn outs. Marketing guys seems to be really talkative even if you stop listening them, they keep talking. The guys w/ money seems to be very relaxed and cool (this is the nice way of saying high ego).

For the time being, this post will be a prologue.

At the end of May, I will turn back to Turkey, and hopefully I will have more time to write about my observations.

If you are reading this far, let me advertise my latest project to you.  An usability testing tool which creates click analysis tests; REMOTESPOTS. See the 4 minutes video to see what it is about.

May 4 10

Google Apps Mail Setup on eapps.com

by dkberktas

For our last project Remotespots (which is an online click analysis tool), we chose eApps as the virtual hosting solution which is so far very good indeed.  For mail server, since we trust the big brother Google, we use Google apps. Following is the simple steps for setting up the Google Apps Mail on eApps. (by the way, this is the case if you let eApps machine as your DNS server.)

A simple process as it should be but still worth documenting,

  • Scroll down to All My Domains and select it
  • Here you will see the domains that you added, select the one that you want to add mail functionality.

  • Delete the existing MX records
  • Add the ones Google Apps ask as the following (leave the first field empty!)

And of course give some time for the propagation of the new MX records to all caches on planet earth!

Apr 12 10

Upgrading Grails, GWT, grails-gwt plugin and beyond

by dkberktas

@Remotespots project was started a couple of months ago and and after some time all the technologies were updated to their current versions (Grails 1.2.2, GWT 2.0 which is a huge change from 1.7, and finally grails-gwt 0.5). Since we were busy w/ the features we ignored the upgrade but time has come to sent Remotespots to the wild, and we want it to be ready to its limits. Below you can find the steps and obstacles we encountered during the upgrade process. (I switched to Ubuntu from Windows XP, my headphones are still not working but at least I can open Eclipse under 60 seconds! so the things below is tested on Ubuntu 9.04)

  • Download and change GRAILS_HOME to new grails version (1.2.2)
  • Run grails upgrade
  • Run install-plugin gwt (so that it installs 0.5)
  • First obstacle
  • Error executing script CompileGwtModules: No such  property: usingGoogleGin  for class: _Events
    gant.TargetMissingPropertyException: No such property: usingGoogleGin for class: _Events
            at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:329)
            at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
            at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
            at gant.Gant.withBuildListeners(Gant.groovy:344)
            at gant.Gant.this$2$withBuildListeners(Gant.groovy)
            at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
            at gant.Gant.dispatch(Gant.groovy:334)
            at gant.Gant.this$2$dispatch(Gant.groovy)
            at gant.Gant.invokeMethod(Gant.groovy)
            at gant.Gant.processTargets(Gant.groovy:495)
            at gant.Gant.processTargets(Gant.groovy:480)

    To solve it, run grails clean command and empty ~\.grails\1.2.2\scriptCache folder. I found this solution from this link.

  • Another problem you are likely to see is
    grails  GWT module ... may need to be (re)compiled

    To solve it, run grails compile-gwt-modules command and refresh firefox w/ ctrl+f5 OR alt+shift+r

  • Last thing to be careful is, after started the gwt client with the command grails run-gwt-client, since GWT 2.0 get rid of hosted mode (finally), to see the changes on your code w/out restarting the server, add the suffix to the url ?gwt.codesvr=127.0.0.1:9997, from this link, you can find the solutions to the problems people have w/ the grails-gwt plugin.