Thursday, December 8, 2011

Reloading or refreshing a web page really fast; a "third refresh method"

Perhaps some or even most of you out there know this, but there seems to be at least three ways of reloading or refreshing a page in Chrome / Chromium -- and in Firefox too as far as I can tell. The two commonly known ones are (I'm using Linux here; Windows and Mac might have different key bindings):

  • Ctrl-r, which does a normal reload; polling the servers for updates (with help from If-Modified-Since or etags or similar) for each external resource, and loads from local browser cache on HTTP 304 Not Modified type responses. 
  • Ctrl-Shift-r, which does what's commonly known as a hard refresh; fully reloading all content and external resources, completely ignoring the browser cache.
But there's another way of refreshing a page that's even faster than Ctrl-r :
  • Press Alt-d then press Enter -- or press Ctrl-l then press Enter.
This sort of does what Ctrl-r does, except it doesn't check ("poll") whether the servers has any updates with regards to external resources. It'll do a normal request for the resource directly referred to in the address bar of course -- which means most dynamic data will be fetched anew, but external resources are to a much larger extent fetched from local cache.

JavaScript
This refresh type can be done via JavaScript also. Instead of doing  window.location.reload();  do  window.location.href = window.location.href;

Wednesday, December 7, 2011

PostgreSQL: ALTER TABLE ==> "cannot be cast"

Altering a column type in PostgreSQL involves some cast trickery. As a note to myself and perhaps others Googling around for solutions, here goes:
ALTER TABLE "my_table" ALTER COLUMN "product_price" TYPE bigint USING 0::bigint;

Friday, August 26, 2011

My preferred software stack

I get questions about my preferred software stack from time to time, so here it is -- and for further reference:

I do know and use other technologies, but I prefer to interop with them or use them only when strictly needed, e.g. C for some embedded platforms -- as opposed to doing my main development in or with them.  

Also see this post for a more user centric angle of this as opposed to the more developer centric one accounted for in this text.

All this is probably not that interesting -- and what follows is lesser still, but anyway, here's some more:
  • Emacs for all editing etc., with Slime as a Clojure front-end.
  • GCC for C, with GDB, KdbgDDD and Valgrind for debugging.
  • Git: distributed (source code) revision control system.
  • rsync, and the front-end Grsync. I use these for both backup purposes and for keeping my desktop and laptop in sync.

Tuesday, July 26, 2011

Others (Twitter!) moving to the JVM also

It seems I'm not alone having struggled with issues related to Garbage Collection. Others, even Twitter, are also moving to the JVM: http://www.youtube.com/watch?v=ohHdZXnsNi8&feature=player_detailpage#t=219s

Also see https://dev.twitter.com/blog/twitter-open-source-and-jvm

Also check out the other OSCON 2011 videos rolling in right now:
   http://www.youtube.com/user/OreillyMedia#g/c/93FC98105B19725C

Update: In particular loving the Steve Yegge talk.

Tuesday, July 19, 2011

..and so it begins; SymbolicWeb has started its migration to Clojure

This'll just be a quick announcement since the state of this thing doesn't warrant anything else at the moment, but I've begun the transition of SymbolicWeb to Clojure. The Git repository can be found here: https://github.com/lnostdal/SymbolicWeb

For some background on why I'm doing this, see the previous posts here and here.

Even though this thing is very incomplete, any comments or e-mails regarding the code even at this point would be most welcome.

...the following is probably more or less a set of notes to self:

  • I'm not happy with how some of things are "bootstrapped". The FIND-OR-CREATE-APPLICATION-INSTANCE and similar stuff seems off.
  • The HTTP request and response need to be decoupled. This'll lead to way better design and performance. A look at HANDLE-COMET-REQUEST should reveal the reason for this.
  • I'm not sure how to go about the above yet. I'm thinking I should in the process probably switch to a better back-end right away; something like Netty, but then again Real Life issues are pressing on so maybe later.
  • Obviously I need some sort of URL-based routing so the same JVM instance can host multiple applications.
  • The low-level stuff for dealing nicely with HTML and CSS doesn't exist yet.
  • There are no widgets here at all.
  • No MVC system or anything exists yet.

..that's it for now; good night!