السبت، 26 يونيو 2010
iPad: scrolling to the top
If you tap the status bar in, for example, Mail and Safari, the currently displayed information scrolls back to the top.
الخميس، 24 يونيو 2010
True roaming
Daring Fireball has a nice post on what Apple’s iPhone 4 video chat application “FaceTime” means long-term: That we get more alternatives to cellphone networks. With FaceTime, you currently need a cellphone connection to get started, but afterwards, all communication continues on the internet, via a WiFi connection. This is especially appealing in apartments such as mine where cellphone reception is bad. We are thus slowly progressing towards true network roaming. Another piece of the puzzle is the universal inbox (which integrates cellphone voice box, SMS, fax, and email).
الثلاثاء، 22 يونيو 2010
Simple cooking: chunky scrambled eggs
If you want something simple to cook, you can try this way of preparing scrambled eggs:
- Per person, use 2-4 eggs
- Put all the egg content in a bowl, use a fork to rupture the yolks. Don’t do much more. Not mixing the yolk and the egg white prior to moving the eggs into the pan gives the final result its chunky consistency and makes sure that you don’t destroy the protein.
- Heat the pan at medium heat.
- Melt butter in the pan (you can also use oil or margarine). The butter is for both limiting how much the egg sticks to the pan and for adding flavor, so you can adjust the amount according to your taste.
- Put the eggs into the pan. Stir by constantly removing the more solid bottom layer to make way for the softer top layer. Don’t let the eggs become too hard, you want a softer consistency than sunny-side up. Feel free to experiment with any hardness between soft-boiled and sunny-side up.
- Only salt afterward, to preserve the eggs.
السبت، 19 يونيو 2010
How to display CVS log messages chronologically
Yes, I sometimes still use CVS. And I just found out that it is incapable of displaying the logged commit messages in chronological order. It can only show them for each file, with the resulting duplicates and all-around chaos if you do this for every file in a module. Thankfully, there is a way around this. A tool called cvs2cl.pl converts the cvs log output into something readable.
الجمعة، 18 يونيو 2010
Fan-financed TV series
The idea is brilliant: Find enough people willing to pay for your TV series pilot, distribute it via BitTorrent and hope that that will get more people to pay for a complete season. Considering to what lengths fans go to prevent TV networks from canceling “their” show, this seems like a viable option. In fact, VODO has already been able to create the pilot episode of “Pioneer One” this way.
Servlet sessions and automatic login: standard Java EE might not be enough for you
Java servlet session management works well for basic requirements, but has limits when it comes to advanced features:
- There is no standard global view of all the sessions, since HttpSession.getSessionContext() has been deprecated. If you want access to all sessions, you have to set up your own registry.
- You have relatively little control of when the session expires. For example, there is no standardized way of accessing the session cookie and extending its lifespan beyond browser restarts.
- Any kind of server access keeps the session alive: Long-pull is still a common technique for sending events from the server to the client and prevents a session from being inactive.
- Store user name and password in a cookie: This is inherently unsafe and should never be done.
- Let the browser remember user name and password: Firefox does this, but only for forms the exist at page load time. It is thus very complicated to get to work for Ajax dialogs.
- Keep the session around longer: One needs to control session timeout (after a given period of inactivity) and possibly cookie expiration (the session ID is normally removed once one quits the browser).
- During login, ask for the period of time one should stay logged in (if there is no activity).
- On the server, use HttpSession.setMaxInactiveInterval(). Beware: Some servlet containers seem to create a new session when this method is invoked.
- Problems: (1) Long-polling is registered as usage. (2) You cannot extend session lifespan beyond the next browser termination (because the cookie with the session ID will be removed).
- Manage your sessions yourself. The client initially receives a session ID from the server and then sends it with each request to the server. The login security FAQ [1] has more details.
- It would be interesting to integrate this kind of session management with Google Guice which currently supports servlet sessions via a dedicated scope.
- [1] Google has a nice login security FAQ.
- [2] HttpSessionListener allows you to get notified of session creation and destruction.
- [3] HttpSessionBindingListener can get you notified when a session expires (and is simpler than HttpSessionListener).
- [4] “Google goodness: using GWT with Guice” (mentions session management with Guice).
الخميس، 17 يونيو 2010
Cooking thermometers
Following an idea of my brother’s, I’ve used a cooking thermometer today for the first time and it’s great. This is how it works: If you have a big chunk of meat to cook (in the oven, in a pressure cooker, etc.), it is usually difficult to guess when the meat is really done. With a cooking thermometer it is easy: Stick it into the hot meat, measure the temperature at the core and look up in a table how hot the core is when the meat is finished. Digital cooking thermometers can be used for multiple purposes: To measure the temperature of liquids, meat, etc. In contrast to digital thermometers, analog thermometers are left with the meat while it is being heated (useful, because you don’t have to open the container around the meat—if it is transparent). But they cannot measure much else, because it takes them time to pick up the temperature and they are not very sensitive.
الثلاثاء، 8 يونيو 2010
Google wants us to print to the cloud
This is an interesting announcement. In Google’s vision of the future, a printer can make itself available to the cloud and then be used from any internet-connected device. This includes cell phones, but also web applications. While I like the idea, I wonder if people will be willing to take the security risks. Discovering printing services in a LAN (via zero-configuration service discovery, as implemented by Apple’s Bonjour and Microsoft’s Universal Plug and Play) might be more palatable.
Update 2010-01-26: Google brings Cloud Print service to mobile Google Docs, Gmail
Update 2010-01-26: Google brings Cloud Print service to mobile Google Docs, Gmail
الاشتراك في:
الرسائل (Atom)