A broad look into the mobile network future

When i went through my files i stumbled over a paper i made at my university and thought maybe someone could find interest in it.

The paper features a summary of the history of mobile networks and tries to make a forecast about which technologies are most likely to play a role in next generation mobile networks.

I am going to quote the abstract here:

The ubiquitous access to information through mobile networks
changed our lives. These mobile networks are in a
state of permanent evolution. In this paper we identify the
most probable drivers for future mobile networks. We provide
an overview over the most successful commercial mobile
networks and point out the technologies used in these mobile
networks that will most likely be reused in future networks.
We discuss the diculties and requirements for future mobile
networks that come with the deployment of billions of
autonomous Machine-to-Machine devices. While some solutions
have been proposed to deal with these Machine-to-
Machine requirements many problems remain unsolved.

Continue reading


@Asynchronous does not work from inside the same EJB

I recently needed to start a method asynchronously on the server start up.

I came up with this code (pseudocode):

@Singleton
@Startup
public StartupEJB {
   @PostConstruct
   private void postConstruct() {
      worker();
   }
 
   @Asynchronous
   public void worker() {
      // Do something heavy
   }
}

This approach failed, the worker() method was not executed asynchronously.

I then found out that the Application Server (in my case JBoss) calls the method directly when it is located inside the same EJB: source.

The solution was to use a seperate EJB that launched the worker Thread:

@Stateless
public class ExecutorBean {
 
   @Asynchronous
   public void execute(Runnable command) {
      command.run();
   }
}

and

@Singleton
@Startup
public StartupEJB {
   @EJB
   ExecutorBean executorBean;
 
   @PostConstruct
   private void postConstruct() {
      worker();
   }
 
   public void worker() {
      executorBean.execute(new Runnable() {
         @Override
         public void run() {
            // Do something heavy
         }        
      });      
   }
}

Beautiful CSS3 loading animation overlay with custom message

I recently stumbled over a beautiful loading animation that is completely done in CSS3 (link):

Loader Animation GIF

All i had to do was fixing a small bug (link), adding some JavaScript and adding an semi-transparent overlay, so all credits go to Hugo Giraudel.

I centered the loading animation div and added a field to display a text message.

To allow for easy display and hiding i cooked up some JavaScript that shows the overlay and puts the text message (or a default message) in the right place.

Demo:
link
Continue reading


Fetch all Languages of the World (ISO 639) as Java Array

Recently i needed a Java Array of all Languages, containing some unique id.

I found that ISO 639 is exactly what i needed. The list is offered by the Library of Congress in a CSV like Format (link).

So i parsed this data and thought that maybe someone can use this, either the Java Array or the Code as Example for parsing external data with JavaScript.

 Demo:

To fetch the list i used Ben Almans JSONP Proxy and Ben Nadels CSVToArray Function.
Continue reading


Remove certain item or clear whole OmniFaces cache

The Omnifaces o:cache Component is a useful Tool when trying to speed up you jsf powered website.

But in some situations you need to remove a certain item from the cache or you want to clear the whole cache, while there seems to be a way (Example 4) to remove single items by Key we couldn’t find a ‘official’ way to clear the whole cache.

 

Here is our Solution to the Problem:

public static boolean removeOmniCacheItem(String key) {    	
	Map<string , Object> applicationMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
 
	if (applicationMap.containsKey(DefaultCacheProvider.DEFAULT_CACHE_PARAM_NAME)) {
		synchronized (DefaultCacheProvider.class) {
			if (applicationMap.containsKey(DefaultCacheProvider.DEFAULT_CACHE_PARAM_NAME)) {
				((Cache)applicationMap.get(DefaultCacheProvider.DEFAULT_CACHE_PARAM_NAME)).remove(key);
				return true;
			}				
		}
	}
 
	return false;
}
 
public static boolean clearOmniCache() {    	
	Map</string><string , Object> applicationMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
 
	if (applicationMap.containsKey(DefaultCacheProvider.DEFAULT_CACHE_PARAM_NAME)) {
		synchronized (DefaultCacheProvider.class) {
			if (applicationMap.containsKey(DefaultCacheProvider.DEFAULT_CACHE_PARAM_NAME)) {
				applicationMap.remove(DefaultCacheProvider.DEFAULT_CACHE_PARAM_NAME);
				return true;
			}				
		}
	}
 
	return false;
}
</string>

Continue reading


Center Youtube

These days Youtube was revamped (at least the update arrived in germany too) and i was instantly annoyed by the left aligned design.

I wrote a super small greasemonkey script to fix it, and thought maybe somebody wants it too.

Have fun with it:

Link: The script on Userscripts.com

The Code:

// ==UserScript==
// @name       Center that damn youtube (for 1920x1080)
// @namespace  http://www.whitebyte.info/
// @version    0.1
// @description  centers youtube.com on screens with resolutin 1920x1080
// @match      *youtube.com*
// @copyright  2012+, You
// @require    http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==
 
jQuery('#page-container').css('margin', '0 0 0 300px');

Android Wifi Hotspot Manager Class

Android has the great option to let you Tether your connection via wifi, but as developer you got little to none control over this mechanism.

Therefore i wrote a class to correct this: WifiApManager.

With this class you can enable the check the current Status of the Hotspot, enable/disable it, get/set the current AP configuration and also get the list of currently connected clients.

 

I also made an example to demonstrate it’s capabilities:

Continue reading