Skip to content

Posts by admin:

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

    May 21st, 2010

    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

    No Comments "

    Adding Transparent Modal View Programatically– iPhone

    May 18th, 2010

    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];
    }
    

    No Comments "

    Meetups around San Francisco and Random Observations from a Foreigner

    May 12th, 2010

    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.

    No Comments "

    Google Apps Mail Setup on eapps.com

    May 4th, 2010

    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!

    No Comments "

    Upgrading Grails, GWT, grails-gwt plugin and beyond

    April 12th, 2010

    @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.

    No Comments "

    GWT — Calling a Java Method from Handwritten JavaScript

    April 2nd, 2010

    For the remotespots project, we developed a notification panel which is very similiar to Stackoverflow notification bar. So, what this bar provides is the a HTML message and a close bottom at the right end.

    For the close button, instead of adding a hyperlink from the java code, this time we used JSNI which enables you to integrate JavaScript directly into your application.

    We have a class called GenericNotifcation in the package org.remote.dogan.client. When a noticition bar is needed,

    public static void showNotification(String message, int seconds)
    

    is called.To hide the bar the following method is called,

    public static void hideNotification()
    

    So, to make the JSNI close method call from js, we need to call the hideNotification java method from js.

    To do this, we add amethod to register hideNotification method a js method for the handwritten javascript

    public static native void exportStaticMethod() /*-{
    $wnd.closeNotification =
    	@org.remote.dogan.client.GenericNotifcation::hideNotification();
    }-*/;
    

    As a second step, we should call the method exportStaticMethod() to actually make the registration of the js method. We do this in showNotification method but for a generic case, onModuleLoad is good candidate.

    public static void showNotification(String message, int seconds)
    
    {
    GenericNotifcation.exportStaticMethod();
    ...
    }
    

    So as the last step, we add the js call in the html template like the following:
    <a title=”close this notification” onclick=’closeNotification()’ />x</a>

    For further information, the documentation for GWT JSNI is here.

    No Comments "

    Using GWT Listbox with Unicode

    March 31st, 2010

    In our new project remotespots.com, we use GWT for the front end. Since remotespots supports two languages (English & Turkish), with a listbox we enables users to select which language they are going to use.

    GWT’s Listbox is a combo box basically. GWT support HTML in most of its widgets, but this is not the case for ListBox. You can only add String instances to a listbox.

    This cause problems with characters which are non-english like ö ü ç

    In such a case, to overcome the problem, unicode representation should be used.

    ListBox lb = new ListBox();
    lb.addItem("English", "en");
    lb.addItem("T\u00FBrk\u00E7e", "tr");
    

    The full list of the unicode representations,  this link can be used. (http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/TURKISH.TXT)

    2 Comments "

    Using Twitter oauth on GAE/J

    January 26th, 2010

    Twitter supports oauth and there are many libraries for it, for  Java(twitter4J)(oauth-signpost),  most of the time you see examples of a desktop version, so it can take time to implement it on a web application (it did take time for my case).

    Step 1. Get a Twitter account and create a Twitter application from http://twitter.com/apps (don’t forget to check in browser and enter a  valid callback url.

    Step 2.  Download twitter4J add the library (in my case twitter4j-core-2.1.1-SNAPSHOT.jar) to project and update classpath

    Step 3. Create a web application (I assume you have the Google plugin for Eclipse )

    Step 4. Add the following servlets and update your web.xml. First servlet will handle login part. It will create a RequestToken which will create the magical aggrements between the consumer(your application) and provider(twitter). First servlet save the  token and secret token since we will need them later.

    String token = requestToken.getToken();
    String tokenSecret = requestToken.getTokenSecret();
    

    Step 5. You forget to update web.xml didn’t you, update the web.xml

    Step 6.  Enable session by adding

        <sessions-enabled>true</sessions-enabled>
    

    to appengine-web.xml.

    You can see my version from http://90.latest.denemekaya.appspot.com/login

    ps. don’t forget to set the callback in Twittter to the url of the servlet for callback.

    Links:

    • http://www.pakzilla.com/2009/10/03/tutorial-java-based-twitter-app-on-google-app-engine/
    • Explain the same procedure with Grails — http://blogs.bytecode.com.au/glen/2009/12/08/log-into-your-grails-app-using-your-twitter-credentials.html

    3 Comments "

    Smashing Magazine’den 10 Kullanilabilirlik Ipucu

    January 24th, 2010

    Smashing Magazine karsilastigim cok guzel bir yazinin, Turkce ozeti sayilabilecek bir post. Elbette cok cok kisaltilmis bir ozetidir. Yazinin orijinal hali burada.

    1. Form yaratirken iki kolonlu tasarim yerine, dikey tasarim kullanin, cunku kullanicilar formu yukaridan asagiya tarayarak doldururlar. Bir diger noktada form’daki aciklama yazilari koyu renk (bold) olmamali.

    2. Kullanicilar yuzlere odaklanir. Eger yuz bize degilde, ekranda baska bir yere bakiyorsa, yuzden sonra kullanicilarin bakacagi diger nokta, bakis dogrultusudur.

    3. Tasarimin kalitesi, guvenirliliginizi arttirir. Okurlar kitabin kapagindan kesinlikle etkilenirler, bu web icinde gecerli. Eger  tasarimdaki yerlesim, tutarlilik, tipografi, renk, still uyumluluk gosteriyorsa, bu ziaretciler uzerinde olumlu etki yapacaktir.

    4. Kullanicilar scroll kullanmazlar. Kullanicilarin %77 scroll arayuzunu kullanimiyor, bu yunden sayfanin yuklendiginde gorunen kismi cok onemli.

    5. Linkler icin gecerli renk MAVi.

    6.  Arama kutulari icin ideal genislik, 26 karakter.

    7. Beyaz alanlar algiyi arttirir.

    8. Sadece 5 kisiyle yapacaginiz kullanilabilirlik testi, sitenizdeki kullanilabilirlik sorunlarinin %85′ini cozecektir.

    9. Urunleriniz icin bilgi acisindan aciklayici sayfalar hazirlayin, sadece kisa bir sure bakacak olan ziyaretciler icin bile daha gecerlidir.

    10. Kulanicilarin cogu reklamlara (ya da reklama benzeyen ogelere) karsi kor gibidir.

    No Comments "

    Using Memcache with Google App Engine (GAE/J)

    January 18th, 2010

    A simple beginning — Fragman iPhone Application

    Memcache provides convenience to store a frequent query in memory, so that you don’t have to make the same execution over and over again. For the iPhone application I build (Fragman), I build a GAE/J backend for managing movie names, IMDB URLs, thumb images, video files, etc. It interacts with the Obj-c code via calls encoded in JSON.

    Since the categories are updated so frequently (new trailer, top 250 , soap opera trailers), every time the user starts the application from her iPhone, the corresponding categories Id(key) lists are  created which includes all the aspects mentioned above,

    what I see, after people start to use the application that, most of the time, the application got stuck with the time constraint of GAE and this causes inconvenience, so I decided to hold the category lists’s JSON in memory. Following is the code ,

    this is the servlet for creating the JSON which is called after say upcoming movie list is changed. This servlet updates the memcached list

            List keyList = new ArrayList();
    	static Cache cache;
    	static
    	{
    		try
    		{
    			CacheFactory cacheFactory =
    CacheManager.getInstance().getCacheFactory();
    			cache = cacheFactory.createCache(
    Collections.emptyMap());
    		}
    		catch (CacheException e)
    		{
    			// ...
    		}
    		//.....
                    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException, IOException
    	        {
                           //................
                           if(cache.containsKey(mode))
    		       {
    			     cache.remove(mode);
    		       }
    		       cache.put(mode, keyList);
    	        }
                    //........
              }

    And this is the servlet that fetch the Fragman beans from the datastore with the given keys (key list is got from the memecached list)

              keyList = (List)cache.get(mode);
    By doing this, I reduce the time that the servlet that creates the JSON takes.

    No Comments "