21 Nov 2013, 3:46pm
meteor:

leave a comment




  • Anzeige
  • Mongo fails when starting meteor

    If your are see­ing this one when start­ing meteor:
    Unexpected mongo exit code 100. Restarting.
    Can't start mongod
    MongoDB had an unspecified uncaught exception.

    Check if mon­goDB is run­ning already, oth­er­wise, if you can find a file called .meteor/local/db/mongod.lock means that mongo did not stop prop­erly last time. Just delet­ing this lock file should fix it. It’s a bit unfor­tu­nate that the error mes­sage doesn’t give any hint in this direction.

    7 Oct 2013, 10:07am
    javascript:

    1 comment




  • Anzeige
  • Callback Method for Twitter’s Typeahead

    When you start using Twitter’s typea­head, e.g. because you switched from Boot­strap 2.3 to 3.0, you will notice that it is NOT a sim­ple drop-in replace­ment for Bootstrap’s orig­i­nal typea­head!
    Before, you gen­er­ated the sug­ges­tions shown to the user by imple­ment­ing a call­back method while cre­at­ing the typea­head like this:

    $(field).typeahead({
      source: function(query, process) { 
        ... return a list of suggestions (see doc for details) 
      }
    });

    Since ver­sion 3, Boot­strap does not pro­vide its own typea­head any more, instead it is using Twitter’s own imple­men­ta­tion which seems to be a good choice at least on the long run. But it does not pro­vide any mean for defin­ing a call­back method to pro­vide the sug­ges­tions — no clue why.
    Instead you can pro­vide a pre­de­fined array locally, a pre­de­fined array that will be loaded on start-up, or a remote ser­vice defined by a URL.
    You will find sev­eral good exam­ples of why you need a call­back method sometimes.

    • You want/have to use a Javascript library to access the service.
    • There is no data­base for the sug­ges­tions, they a gen­er­ated on the fly, e.g.if you want to sug­gest sen­tence com­ple­tion while the user types.
    • You are using Meteor’s col­lec­tions hold­ing your sug­ges­tions, thus, there is no URL you could point to.

    But tak­ing a look into the inter­nals revealed fol­low­ing solu­tion: com­pletely by-pass the inter­nal sug­ges­tion aggre­ga­tion of Twitter’s typea­head by replac­ing the getSuggestions(query, callback) method of the first dataset, which we defined by local: [];.

    (t = $("field")).typeahead({ local: [] });
    t.data("ttView").datasets[0].getSuggestions = function(query, callback) {
      var suggestions = ... gather your suggestions here ...
      var data = [];
      for (suggestion in suggestions) { data.push(this._transformDatum(suggestion)); }
      callback(data)
    }

    (Trans­lated from Cof­fee­script on-the-fly — con­sider as a draft than an out-of-the-box solution.)

    Happy hack­ing. :)

    p.s. for Meteor users: The call­back breaks each time the tem­plate gets re-rendered — despite that you use the pack­age preserve-inputs or <#constant> due to a bug. Some­how, con­stant areas and that par­tic­u­lar pack­age do not get along with each other. Solu­tion: removed the pack­age and use con­stant areas around typea­head input fields works. This should be fixed as soon as the new tem­plate engine gets rolled out.

    15 Nov 2012, 5:37pm
    gwt:

    1 comment




  • Anzeige
  • GWTBridge Not Found in GWT2.5

    Just updated the GWT SDK and ended up with a bro­ken app:

    java.lang.NoClassDefFoundError: com/google/gwt/core/client/GWTBridge
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:169)
    	at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70)
    	at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:64)
    

    After some searching/experimenting and a cup of cof­fee it finally occurred to me: the pack­age name says client! So all the time I have been using a client-package class in my server-side code. Kinda sur­pris­ing that it did work nicely all the while.

    Solu­tion: replace all com.google.gwt.core.client.GWT with com.google.gwt.core.shared.GWT in shared and server-side code.

    20 Sep 2012, 1:32pm
    gwt java:

    13 comments




  • Anzeige
  • Using GWT’s DateTimeFormat in Server-Side Code

    I was work­ing on some util­ity class to for­mat dates. As the for­mat­ting is the same on server and client the same class should be used on both, server and client. Within the GWT frame­work there is the DateTimeFormat class which seems to be sup­posed to do exactly that.

    But despite being in the shared pack­age (com.google.gwt.i18n.shared.DateTimeFormat) using it in the server-side code causes

    java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable in client code!  It cannot be called, for example, from server code. If you are running a unit test, check that your test case extends GWTTestCase and that GWT.create() is not called from within an initializer or constructor.

    Hav­ing a look into the code of the DateTimeFormat class (which is part of the shared pack­age of the GWT frame­work, thus can be used on server and client) reveals there is an import of com.google.gwt.i18n.client.LocaleInfo. But this class is part of the client pack­age — thus, it can not be used in the server-side code. It’s unclear to me why this was done like that because it sim­ply can not work by definition…

    Going down a bit fur­ther in the code of the DateTimeFormat class shows that the client pack­age class LocaleInfo is used only once like this:

    private static DateTimeFormatInfo getDefaultDateTimeFormatInfo() {
      // MUSTFIX(jat): implement
      return LocaleInfo.getCurrentLocale().getDateTimeFormatInfo();
    }

    The line is marked as “MUSTFIX” but for some rea­son it has not been fixed yet.
    There is a way to fix this issue that worked for me:

    • Copy the con­tent of DateTimeFormat to a new file in your own code
    • Remove the import of LocaleInfo
    • Chang­ing the fol­low­ing method (start­ing in line 656) like this:
    private static DateTimeFormatInfo getDefaultDateTimeFormatInfo() {
      return new DefaultDateTimeFormatInfo();
    }
    • And use this newly cre­ated class from now on in all your code.

    The fix does not seem to cause any major harm, but as John A. Tam­plin (cf. his com­ment below) clearly pointed out, apply­ing this fix will ren­der all dates using the default locale instead of using the user’s locale. Thus, this fix should be con­sid­ered a hack rather than a patch — but it does the trick until the bug has been fixed officially.

    The hack can be applied quickly — or sim­ply down­load the fixed class here.

    p.s. Unfor­tu­nately, it is not pos­si­ble to just over­write the method in a derived class because it’s a sta­tic method and pri­vate any­way.
    p.p.s. As sug­gested in the com­ments, you might also ini­tial­ize the DateTimeFormat with a new DefaultDateTimeFormatInfo() as the sec­ond para­menter. (Please note that I did not ver­ify this sug­ges­tion) In gen­eral, both ways of fix­ing this issue will cause that the date and time to be for­mated using the default locale rather than the user’s cur­rent locale, unfortunately.

    24 Aug 2012, 12:26am
    php:

    leave a comment




  • Anzeige
  • Papercite Crashes WordPress

    Just updated Word­Press as well as all the plu­g­ins and sud­denly my résumé page is blank. And just in case some­one else expe­ri­ences a sim­i­lar issue, I took notes of all the steps to fix the issue below.

    Turn­ing off likely plu­g­ins revealed that papercite (a plu­gin used to ren­der pub­li­ca­tions in the BIB for­mat as HTML) was the reason.

    To under­stand­ing the prob­lem I turned on error mes­sages to actu­ally see what was going on by
    edit­ing index.php in wp-content/themes/ / and added fol­low­ing line to the begin­ning of the file:

    <?php ini_set('display_errors',1); error_reporting(E_ALL); ?>

    From that I could under­stand that papercite was unable to load a PEAR mod­ule due to the strong restric­tions that my web space provider had set up (which is also why I can not edit the php.ini file directly to turn on error messages).

    Solu­tion: Go to Set­tings -> papercite plu­gin and change the parser to OSBiB parser (which does not depend on PEAR), et voilà my résumé with pub­li­ca­tions is back! :)

    Finally, let’s remove the PHP line I added in the begin­ning from the index.php file.

    14 May 2012, 8:27pm
    linux recommendations:

    4 comments




  • Anzeige
  • Missing Digikam Themes w/t KDE

    Digikam is a great tool to man­age and work on pho­tos — my per­sonal favorite for some years already. But it’s made for KDE and uses a lot of KDE-related libs and stuff, there­fore, installing it in Gnome, Xfce, Lxde and the like will cost about 1gb because of the depene­den­cies.
    Nev­er­the­less, worth it. But it comes with a bright default skin ren­der­ing it com­pletely unus­able for work­ing seri­ously on light and color set­tings of photos.

    To add themes, you will have to install an extra pack­age (as decribed here) like this:
    sudo apt-get install kde-workspace-data
    Yes, this will add more data to your disk, but only 10mb this time. ;)

    Happy photo-tweaking!

    26 Apr 2012, 9:58am
    gwt java:

    leave a comment




  • Anzeige
  • Multiple Projects and GWT

    When work­ing on sev­eral large scale projects (in Eclipse), it’s con­ve­nient and of course more effi­cient to share and reuse code via com­mon libraries. While those are in an early stage they need to be changed a lot and there­fore it’s handy to link projects in instead of cre­at­ing new jars each time the library has been updated.
    Unfor­tu­nately, this stan­dard approach for Java devel­op­ment in Eclipse does not work that straight for­ward as with plain old Java projects, it requires three steps in total:

    1. Link the library project to all rel­e­vant projects (“Project Pref­er­ences” -> “Java Build Path” -> “Projects” -> “Add…”)
    2. Then, add the client-side code of the library (by adding it as a mod­ule.) There­fore, edit the gwt.xml of your appli­ca­tion and add for exam­ple <inherits name="net.svenbuschbeck.gwt.lib.SuperLib "/> where Super­Lib is the file name of the gwt.xml file in you library project and before that is the pack­age it lies in.
    3. Add the code to the project by link­ing a source folder. Unfor­tu­nately, this is required if you do not want to write an Ant script to com­pile your appli­ca­tion. (If you pre­fer Ant check this out) I don’t like the idea of using such a script because if you for­get to run it each time you make changes, you will end up in confusion—let’s go for the con­ve­nient, auto­matic way then.
      1. Add a folder to your appli­ca­tion project; open the “advanced” sec­tion in the folder cre­ation dia­log, select “Link to alter­nate loca­tion” and pick the source folder (usu­ally “src”) of your library project. (Hint: if you work within a team using a ver­sion­ing sys­tem, you can cre­ate a vari­able for that folder and use this instead. This way, each of your col­leagues can put the library project in a dif­fer­ent folder and accom­mo­date for that by adjust­ing the vari­able :) )
      2. Right click the folder, “Build Path” -> “Use as Source Folder”. Done.

    Sur­pris­ingly, the GWT plu­gin for Eclipse does not honor the project link­ing, thus all the ref­er­ences need to be made explicit or you will end up with lots of the fol­low­ing: ClassNotFoundException.

    31 Jan 2012, 10:53am
    gwt java javascript:

    leave a comment




  • Anzeige
  • An invalid or illegal string was specified” Exception in GWT

    While work­ing with can­vas (draw­ing stuff on it) in GWT, sud­denly and in a seem­ingly unpre­dictable man­ner I got fol­low­ing error mes­sage now and then from within the GWT frame­work code:

    com.google.gwt.core.client.JavaScriptException: (NS_ERROR_DOM_SYNTAX_ERR): An invalid or illegal string was specified;

    Again, GWT tricked me into think­ing I am writ­ing Java code and made me for­get about that it is going to be com­piled into Javascript. And because of the lat­ter, a divi­sion by zero does not throw an Devi­sion­ByZe­roEx­cep­tion, no, it returns NaN even for native data types (there is no dif­fer­en­ti­a­tion between dou­ble and Dou­ble in Javascript — there is only the object-version of dou­ble, which can be of value Double.NaN).

    But also GWT was not pre­pared to han­dle Double.NaN. When call­ing canvas.getContext().drawImage(image,x,y) and one of x and y or both were Double.NaN I got the error mes­sage shown above. If you got the same… you know what to do now: check all devi­sions in your code for poten­tial devi­sions by zero!!

    28 Feb 2011, 11:10pm
    gwt java:

    leave a comment




  • Anzeige
  • How to Execute Code When the GWT Application Is Going Down

    My goal was to store the UI state of my appli­ca­tion just before it gets ter­mi­nated to be able to restore it next time the way the user left it the other day.

    I tried to add an addAttachHandler to the RootPanel to get informed about the root panel get­ting detached from the DOM so that I can final­ize my appli­ca­tion. Sur­pris­ingly, that does not work in Chrome (tested Chrome and Fire­fox only).

    But besides that this sounds like a bug to me, I found the “proper” way of doing things before the appli­ca­tion ends:

    Window.addWindowClosingHandler(new Window.ClosingHandler() {
    	@Override public void onWindowClosing(ClosingEvent event) { ... } 
    });

    In the end, I think some­thing like Document.addUnloadHandler would be more sug­ges­tive… clos­ing the win­dow or reload­ing a page is both exit­ing the appli­ca­tion by unload­ing the DOM — not clos­ing the window.

    18 Feb 2011, 1:27pm
    gwt:

    1 comment




  • Anzeige
  • Disable an Anchor in GWT

    Unex­pect­edly, call­ing setEnabled(false) does not pre­vent a link/anchor from being clicked. That means, the click events still get trig­gered.
    The rea­son is more or less a bug in GWT as it updates the list of events that are going to be trig­gered only at the moment when it gets attached to the DOM (Btw, in GWT, this process is called to sink and to unsink events, where the for­mer enables a spe­cific event to be trig­gered and the lat­ter dis­ables it).
    I found a workaround by cre­at­ing my own Anchor class and forc­ing the under­ly­ing GWT Anchor to update the list of events to be sunk.

    ...
    import com.google.gwt.event.dom.client.ClickHandler;
    import com.google.gwt.user.client.Event;
    
    public class Anchor extends com.google.gwt.user.client.ui.Anchor {
    
    	@Override public void setEnabled(boolean enabled) {
    		super.setEnabled(enabled);
    		if (isAttached()) {
    			onDetach();
    			if (enabled) {
    				sinkEvents(Event.ONCLICK);
    			} else {
    				unsinkEvents(Event.ONCLICK);
    			}
    			onAttach();
    		}
    	}
    
    	@Override protected void onLoad() {
    		super.onLoad();
    		if (isEnabled()) {
    			sinkEvents(Event.ONCLICK);
    		} else {
    			unsinkEvents(Event.ONCLICK);
    		}
    	}
    }

    Note the onLoad method, it sets up the state when the wid­get gets attached to the DOM the first time. It is required because setEnabled() could have been called before the anchor got attached.

    If you encoun­tered the same issue, please vote for this bug report.

    14 Feb 2011, 9:48pm
    linux:

    leave a comment




  • Anzeige
  • Flickering Screen with ATI Radeon X1400 and Ubuntu

    EDIT: ATI Radeon X1400 seems to work fine again since Ubuntu 11.04.

    There is another fix to the “well known” issues with the ATI Radeon X1400 and Ubuntu 10.04 to 10.10 besides the one posted about one year ago (see here).
    The pre­vi­ous fix kept the graph­ics card work­ing nor­mally but harmed the over­all oper­at­ing system’s sta­bil­ity, so here is another fix based on dis­abling all 3D fea­tures of the device to get rid of the flick­er­ing screen.

    It’s up to you to choose what you are able to live with­out
    a) The desk­top set­tings panel and “Seg­men­ta­tion fault” errors now and then, or
    b) 3D accel­er­a­tion (does not harm video play­back or any other basic OS functionalities)

    For solu­tion a) see this.
    For b) cre­ate this file: /etc/modprobe.d/radeon-kms.conf — and add fol­low­ing content

    options radeon modeset=0

    Solu­tion found here (in German).

    14 Feb 2011, 9:26pm
    linux:

    leave a comment




  • Anzeige
  • Logitech Communicator STX Webcam vs. Ubuntu (64bit) & Skype 2.1

    There are many tuto­ri­als out there solv­ing the prob­lem by mak­ing Skype use Video for Linux ver­sion 1 dri­vers instead of ver­sion 2, as that par­tic­u­lar web­cam does not seem to get along with the newer ver­sion. It boils down to the fol­low­ing lines:

    Cre­ate a file in /usr/local/bin/skype and insert

    #!/bin/bash
    LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so /usr/bin/skype

    Finally, make it exe­cutable by sudo chmod a+x /usr/local/bin/skype
    Use this file to start Skype from now on. Done.

    But not for me. Skype refused to eat it: ERROR: ld.so: object '/usr/lib/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.
    Until I finally found this one here.

    Just to cut a long story short, here is why: all the other solu­tions work for 32bit Linux only — but hey, I do not have any of my old laptop’s poten­tial to be wasted — I am run­ning 64bit Ubuntu (tested with ver­sion 9.10 and 10.10 64bit). And with a minor tweak, the fix will work for you, too. :)

    Install the video4linux libraries:

     sudo apt-get install lib32v4l-0

    And change /usr/local/bin/skype to

    LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so /usr/bin/skype

    Its just about the “32” — and one good exam­ple more of why you should put mean­ing­ful error mes­sages in what­ever software!

    Thanks Eoin Mur­phy.

    7 Feb 2011, 2:58pm
    java:

    leave a comment




  • Anzeige
  • Java Cookies from the Future Past

    While work­ing with cook­ies in Java/GWT and thus—to set the expire date—with Date, I found a doubt­ful Java behavior.

    My goal was to set a cookie to expire in about one month from today like this:

    Date expires = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 30);
    Cookies.setCookie("myCookie", "myData", expires);

    And kept won­der­ing why the cookie never got stored.

    And finally cre­ated a sim­ple test case like this:

    Date today = new Date();
    Date tomorrow = new Date(today.getTime() + 1000 * 60 * 60 * 24);
    Date nextMonth = new Date(today.getTime() + 1000 * 60 * 60 * 24 * 30);

    And got fol­low­ing dates:

    today=Mon Feb 07 14:27:50 CET 2011
    tomorrow=Tue Feb 08 14:27:50 CET 2011
    nextMonth=Tue Jan 18 21:25:02 CET 2011

    Accord­ing to Java’s cal­cu­la­tion, the cookie was expired already before even being set.

    Took me a bit to under­stand why:
    1000 * 60 * 60 * 24 * 30 = 2,592,000,000 = 0x9A7EC800
    Thus, the first bit got set to one… a clas­si­cal over­flow caus­ing the inte­ger value to become neg­a­tive — just try:

    System.out.println(1000 * 60 * 60 * 24 * 30);

    It will print out -1702967296.

    Fix: Add a lit­tle L will solve the issue by forc­ing the com­piler to cal­cu­late using the scope of long:

    Date nextMonthLong = new Date(today.getTime() + 1000L * 60 * 60 * 24 * 30);

    I guess I will fall for that one again some­time as the error is not obvi­ous in my opin­ion — espe­cially because getTime() returns a long and still, the com­piler sticks with an int for the mul­ti­pli­ca­tion part.

    2 Feb 2011, 11:45pm
    gwt jobs:

    leave a comment




  • Anzeige
  • GWT Error Message “Asked for attribute parser of no type”

    Exam­ple:

    public boolean isCollapsed() {
    	return panel.isVisible();
    }
    
    public void setCollapsed() {
    	panel.setVisible(false);
    }

    Seen it? Despite the com­pli­cated and cryp­tic error mes­sage, the mis­take is rather sim­ple: the set­ter method is miss­ing a para­me­ter, i.e. “pub­lic void setCollapsed(boolean collapsed) {“.

    14 Dec 2010, 11:49am
    java:

    leave a comment




  • Anzeige
  • Casting collections in Java

    Assum­ing two classes A and B as

    class A {}
    class B extends A {}

    It is just log­i­cal that cast­ing B to A works fine:

    A anObjectOfClassA = new B();

    But when it comes to col­lec­tions of As and Bs, a strange phe­nom­e­non appears in Java:

    Collection<B> collectionOfBs = new LinkedList<B>();
    Collection<A> collectionOfAs = (Collection<A>)collectionOfBs; // this line does not compile!

    That is, though the col­lec­tion wrap­per (the java.util.Collection class) is the same and B extends A, cast­ing a col­lec­tion of objects of class B to a col­lec­tion of objects of class A throws an compile-time error.

    But it works using gener­ics (the whole class for the sake of com­plete­ness and reusability):

    import java.util.Collection;
    import java.util.LinkedList;
    
    public class CollectionCastingExample {
    
      class A {}
      class B extends A {}
    	
      Collection<B> collectionOfBs = new LinkedList<B>();
    //  Collection<A> collectionOfAs = (Collection<A>)collectionOfBs;
    	
      Collection<A> collectionOfAs = downCastCollection(collectionOfBs, A.class);
    	
      /**
       * Casts a collection of objects of class B where B extends A to a collection of objects of class A.
       * 
       * @param <T> Base class
       * @param collection Collection of objects of a class extending T 
       * @param aClass Representation of T
       * @return Collection of objects of T casted from given collection of objects of a class extending T.
       */
      @SuppressWarnings("unchecked")
      public static <T> Collection<T> downCastCollection(Collection<? extends T> collection,
          Class<T> aClass) {
        return (Collection<T>) collection;
      }
    }

    Despite the fact that a @SuppressWarnings("unchecked") is required, it avoids iter­at­ing over the whole col­lec­tion of Bs and cast­ing each of them from B to A plus adding them to a new col­lec­tion of As.

    17 Sep 2010, 3:49pm
    gwt java:

    leave a comment




  • Anzeige
  • Uploading File to Server: Access Denied

    Sim­ple task: upload a file to the server. Achieved so far: upload form works and the file gets trans­ferred to the server.
    But as soon as the file is writ­ten, I get one of that:
    “java.security.AccessControlException: access denied (java.io.FilePermission /some/folder/upload__71c20601_12b1b66bc39__7ffa_00000000.tmp write)“
    I am amazed how much search­ing is required to find some infor­ma­tion about how to mod­ify the file per­mis­sions for the local app engine! And in the end, it turns out that there is an issue with the GAE on Mac but with­out a way to con­fig­ure the local Jetty server to allow write access. :(
    As soon as I deploy the app to a Tom­cat on Linux, it works like a charm!

    16 Sep 2010, 6:02pm
    jobs projects:

    3 comments




  • Anzeige
  • GWT FileUpload: Adding Widgets to a FormPanel

    If you build your first GWT form, for exam­ple some­thing like that:

    <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
    <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <g:HTMLPanel>
    <g:FormPanel ui:field="form"> 
    <g:FileUpload ui:field="uploadField" name="file"/>
    <g:SubmitButton ui:field="submitButton">Upload</g:SubmitButton>
    </g:FormPanel>
    </g:HTMLPanel>
    </ui:UiBinder>

    And your con­sole keeps telling you dur­ing run­time some­thing like this: “java.lang.IllegalStateException: Sim­plePanel can only con­tain one child wid­get”. Instead of writ­ing a long page of expla­na­tions and com­plaints like I did before, it’s sim­ply like that:

    Just put all your wid­gets in a panel (like Hor­i­zon­tal­Panel) and add that panel to the Form­Panel.” (Jake − cf. com­ment below)

    Thanks Jake! :)

    9 Sep 2010, 4:48pm
    jobs projects:

    1 comment




  • Anzeige
  • GWT Does Not Load Module in Local AppEngine

    The issue arose after I renamed the mod­ule file (end­ing with .gwt.xml) to bet­ter rep­re­sent the mod­ule func­tion­al­ity. I also updated all rel­e­vant files in the project (search for files con­tain­ing the old name to find them) accordingly.

    Start­ing the appli­ca­tion after that mod­i­fi­ca­tions ended up in an error (“[ERROR] Unable to find ‘<old mod­ule name>.gwt.xml’ on your class­path; could be a typo, or maybe you for­got to include a class­path entry for source?”) as the AppEngine tried load­ing the mod­ule by its old name.

    Solu­tion: Delete the launch pro­file for the project (by choos­ing “Run As…” -> “Run Con­fig­u­ra­tions…” from the con­text menu).

    Obvi­ously the GWT does not check nor update the auto­mat­i­cally gen­er­ated launch pro­file thus you need to delete it to force the GWT to cre­ate a new pro­file from scratch tak­ing the project changes into account. You might also adjust the pro­file accord­ing to the changes made, but delet­ing it is the safe and easy way.

    25 Aug 2010, 10:41am
    jobs projects:

    leave a comment




  • Anzeige
  • First GWT Steps

    Just started to work with GWT – a pretty inter­est­ing approach for web devel­op­ment com­pared to PHP or JSF. The whole Appli­ca­tion engine is quite impres­sive espe­cially allow­ing you to quickly test your appli­ca­tions locally by sup­port­ing auto­matic hot deploy­ment after each code update.
    One thing that took me a while was one of that “[ERROR] Unable to find ‘[some-file].xml’ on your class­path; could be a typo, or maybe you for­got to include a class­path entry for source?” errors. If you are sure the file is in place, I real­ized restart­ing the App Engine or Eclipse mostly solves that problem.

    30 Apr 2010, 11:04pm
    linux:

    leave a comment




  • Anzeige
  • Flickering Screen After Upgrade to Kubuntu 10.04

    First of all, I was amazed how smoothly the upgrade went. (K)Ubuntu and I guess other dis­tri­b­u­tions as well have gone quite a far way to become plat­forms for every­body — with a lot of soft­ware but even more tools, helpers and auto­matic back­ground ser­vices — like the nice upgrade service.

    There was only one prob­lem I ran into and I want to share the solution.

    I am run­ning Kubuntu 10.04 (just upgraded today) on a Lenovo IBM ThinkPad R60 (Yes, one of those with both brands on them ;) ) with an ATI Radeon X1400 graph­ics device. But since upgraded, my dis­play started flick­er­ing — not per­ma­nently but unbearable.

    The solu­tion that worked for me (at least par­tially — see below — and this is of cause depend­ing on the graph­ics device type) was to install the pro­pri­etary ATI dri­vers. I know, it is not a good solu­tion, I do not like to use them nei­ther and if any­one out there is read­ing this with a bet­ter solu­tion in mind, let me know it!! :)
    Edit 2011-02-14: Added a new post with an addi­tional, alter­na­tive solu­tion here.

    So what you need to do is  to get your favorite pack­age man­age­ment tool (e.g. Synap­tic or KPack­ageKit) — just hit Alt+F2 and type “pack­age” and pick KPack­ageKit from the list (it will ask you for the super user pass­word). Then, search for “fglrx”. In KPack­ageKit, you will find a result titled “Video dri­ver for the ATI graph­ics accel­er­a­tor”, and some­thing below the title like “fglrx — 2:8.723.1-0ubuntu3” but the ver­sion num­ber should not mat­ter. Click the arrow to the right, hit “Apply” and after reboot­ing, every­thing should per­fectly with­out any configuration.

    Good luck. ;)

    Prob­lems noticed so far: The dri­ver causes “Seg­men­ta­tion Fault” error mes­sages, e.g. when try­ing to open up the dis­play set­tings. That’s ugly, I know. But you can read in sev­eral forum and blog posts, that the sup­port for the for­mer nicely work­ing dri­ver for the ATI X1400 has been dis­con­tin­ued since 10.04, hence, it’s just good luck that the fglrx works some­how — good to know *after* upgrad­ing, right. But still, the flick­er­ing was unbear­able for me, thus, I accept the issues for now. I will keep my eyes peeled hop­ing for a proper solu­tion in the future.

    18 Feb 2010, 7:10pm
    jobs projects:

    leave a comment




  • Anzeige
  • Getting Drupal’s Access Control Module to Work Properly

    After set­ting up some con­tent types — some pub­lic, some inter­nal. I installed the Access Con­trol mod­ule, set up inter­nal con­tent not to be vis­i­ble to anony­mous users — but with­out any effect.

    After some research, but with­out suc­cess, I real­ized the *Advanced* sec­tion at the bot­tom of the Access Con­trol tab for each con­tent type. And now the magic trick: Increase the weight and you are done. So I guess the build in access man­age­ment was fight­ing the Access Con­trol mod­ule, so it is up to you to make your favorite mod­ule stronger by giv­ing it more weight. — I doubt this is intu­itive. Addi­tion­ally, it is for sure dif­fi­cult to sim­ply find the tiny lit­tle select box down there in a sec­tion, which is by default folded.

    2 Feb 2010, 7:13pm
    jobs projects:

    leave a comment




  • Anzeige
  • How to Make Jquerymenu for Drupal Keep its State on Page Reload

    While set­ting up the web­site for my new project “Glo­cal” www.glocal-project.eu), I came across the prob­lem of find­ing a proper menu mod­ule. Some­thing easy to use, sta­ble and effi­cient in the same time for the com­plex intranet struc­ture (there­fore, sorry, but you will not be able to see my solu­tion there unless you are a project mem­ber). Some­thing with a high usabil­ity in the end. Active­menu is still quite buggy and DHTML Menue requires a dou­ble click to actu­ally open a page — unbear­able in a non-doulbe-click envi­ron­ment like the Inter­net — who is sup­posed to guess, that this menu requires a dou­ble click?? Leav­ing me with JQuery­menu.

    First impres­sion: per­fect! Open and close branches by click­ing (+) or (-) — view page by click­ing menu item label. Even the few styling issues could be fixed eas­ily by using CSS. But as soon, as some­one clicks a label, the menu col­lapses to its default sta­tus. It does not remem­ber its last sta­tus after load­ing a dif­fer­ent page with the same menu.

    Is this it? All mod­ule have crit­i­cal down­sides like this? I was quite dis­ap­pointed! :(

    But I taught JQuery­menu to remember!

    As it is quite some code, I will not post it here directly, but added it to the tracker page for this “fea­ture request” or you can down­load the two updated files (jquerymenu.js and jquerymenu.module) here and replace the once in your /sites/all/modules/jquerymenu folder.

    But please be care­ful, it should be con­sid­ered an alpha ver­sion, there are quite some weak­nesses (see tracker page). Any feed­back or sug­ges­tions are very wel­come!

    24 Jun 2009, 3:03pm
    jobs projects:

    4 comments




  • Anzeige
  • fixing flex VideoDisplay CuePointManager

    I was cre­at­ing a Flex appli­ca­tion to show slides and a pre­sen­ta­tion video of pre­vi­ously recorded pre­sen­ta­tions. Accord­ingly, each slide should appear at a cer­tain point of time in the video — calls for cue points!

    As all slides and there appear­ance are stored in a text file in my case, I started adding cue points with Action­Script. But as soon as the video can be con­trolled with a slider, allow­ing to shift for– and back­wards, the event han­dler “cue­Point” was not trig­gered any more. Thus, the slides where not changed cor­rectly as the user jumps ahead, as the cue points between the pre­vi­ous and the new posi­tion did not cause and cue point event.

    Finally I wrote AdvCue­Point­Man­ager, inher­it­ing from Cue­Point­Man­ager, but which can deal with jump­ing back– and forward.

    Copy it to “<your source folder>/net/svenbuschbeck/flex/video” and use it as follows:

    <mx:VideoDisplay cuePointManagerClass="net.svenbuschbeck.flex.video.AdvCuePointManager" />