Showing posts with label hack. Show all posts
Showing posts with label hack. Show all posts

Wednesday, August 08, 2012

Lytro Camera and Light Field Pictures (LFP)

Finally got my Lytro camera two month ago and have already filled up my Lytro photo library with more than one thousand pictures, which stores more than 20GB wroth of data on my hard driver. Of course I keep a backup on my Dropbox folder, which means another 20GB on my hard driver and my paid cloud storage service.

Light field cameras are new technologies, as well as light field pictures. Lytro, Inc. has developed a new file format, called LFP (which is short for Light Field Photography or Light Field Pictures), that is used for almost everything, let it be storing some (about 1GB) mixture of text and binary data about the camera, including the lens array calibration information and wifi MAC address, or storing the raw data and/or the processed data for a light field picture. Now, the best thing about the Lytro, Inc. is that, besides developing this new file format (which is simple enough to reverse-engineer quickly), they are keeping everything transparent, making it easy to understand the logic behind their software and be able to liberate our own data. More importantly, this method allows using common technologies to develop for the Lytro camera, the Lytro Desktop application, and the light field pictures.

Since Lytro released a Windows version of the Lytro Desktop application a couple of weeks ago, I was able to play with my photo library and LFP files. The result is two new pet projects.

Lytro Library Merger

This small Python application lets you merge any Lytro Desktop photo library to your main photo library. For example, if you have a photo library on a Mac OS X machine and have created another one on a Windows machine, now you can merge these two and get all your photos in one place.

More on Lytro Library Merger at http://behnam.github.com/lytro_library_merger/

python-lfp-reader

This is small Python library that comes with some very useful command-line scripts for working with LFP files. But the more interesting feature for some users can be lfp_picture_viewer which displays any processed LFP image and allows you to refocus the image; and it works (almost) any platform that supports Python, including Linux, Windows, and Mac OS X.

Download it at http://pypi.python.org/pypi/lfp-reader or if you prefer the command-line, try "easy_install lfp-reader".

More on http://behnam.github.com/python-lfp-reader/

Friday, September 19, 2008

Jalali GCal moved to Google Code

Finally I created a project for Jalali GCal in code.google.com. Here are the Installation Guide and the downloads list.

Thanks to Mehdi Ahmadizadeh, the new versions work fine with current Google Calendar UI. Also some ideas from Shayan have been implemented.

Here are latest features (for version 2.4):
  • The userscript is now available in two editions: English and Persian. Using Persian edition gives you Persian numbers and months' names;
  • The font of Persian texts in Persian version is bigger than the default texts;
  • The name of the Jalali month is shown in the first day of the month (in the table).
Hope you enjoy it. Feel free to report enhancement requests, bugs, and issues.

Thursday, September 21, 2006

Mozilla/Firefox Hacks for Power Users (Hack 200C+0002)

Here is some preferences I have set, and you may like to set them, if you are a power user, bidi user, or your locale is not en-US, but have to use this locale.

Newbie HOWTO: use "about:config" to set this key/values.

Power User:
  • layout.word_select.stop_at_punctuation
  • layout.word_select.eat_space_to_next_word
Set them to TRUE if you want Ctrl+Left/Right-Arrows stop at the start/end of alpha-numeric words (like what you get on Gtk+/Gnome). Default values make it to jump to the next/previous Space/Tab character! The second one also affects word boundary on selecting with mouse double-click.

  • browser.triple_click_selects_paragraph
(Mozilla >= 1.9, Firefox >= 3.0a1)
This option allows you to select whether triple click should select the whole paragraph, or just the line you are clicking. If it's FALSE, you can select the whole paragraph with quadruple-click (Wait, it doesn't work on Gtk+/Gnome, as Gtk+ doesn't support quadruple-click. If you like it, here are the Mozilla bug: #348751.)

  • network.http.max-persistent-connctions-per-proxy
  • network.http.max-persistent-connctions-per-server
If you use Tor, or any other proxy in your LAN, just set the first one to a big number (I use 50). Also I set the second one to 8, as Flickr and many other photo-sharing sites use just one domain for almost all images on the their pages, so I cannot get even two pages simultaneously. (maps.google.com is smart enough)

  • network.protocol-handler.external.ed2k
  • network.protocol-handler.app.ed2k
Here are how you can define a protocol and set the external application. In this example, I set ED2K protocol. Create the first key as Boolean, and set the value to TRUE. Then create the second key as String, and set the path to your ed2k link-handler ("/usr/bin/ed2k" for me) as its value. That's it.
Homework: Create a protocol-handler and write a script to handle Yahoo! Messenger links, and make GAIM do the requested action (add buddy, send message, etc). Of course you should mail them to me to get your point. :D)

  • mousewheel.horizscroll.*.action
Try possible values for this key (0..4 IIRC) to get more functions under your fingers (horizontal scroll of your professional mouse, or the touch-pad of your laptop).


Localization:
  • printer.printer_PostScript/*.print_paper_name
If you live in a country (or organization) which the default paper size is A4, not Letter, just set the value of this key to "A4".

  • browser.fixup.alternate.suffix
And if your want to set the default ".com" value to something else (i.e. ".co.uk" or ".ir"), just set it in this key.


Bi-Directional:
  • bidi.browser.ui
And this is the best part for Arabic, Iranian (Persian), and Israeli (Hebrew) users. Setting this key to TRUE will do some magic for you. You can switch the text direction and alignment of input fields with just one keystroke: Ctrk+Shift+X! Also you can switch the page direction from the View menu. Help yourself!

  • mousewheel.horizscroll.*.numlines
If you use Mozilla/Firefox in a right-to-left locale, just set the value of these keys to "1" instead of default "-1". Here are the Mozilla bug: #350594.


Ok, that's all. Let me know if you have problem with this hacks, or other L10n (localization), Bidi (bi-directional), or RTL (right-to-left) problems with Mozilla/Firefox.

Thursday, June 01, 2006

Flickr Hack 200C+0001: EasyDownloadr

Behdad and I prefer to have the "Original" size of a photo to view, or use (if it's under a CC lisence). So we wrote a Bookmarklet to make it easy to save the original size of an image on Flickr.

Here is the Flickr EasyDownloadr bookmarklet.

HOWTO: Right click on previous link. Bookmark it (preferably in Bookmarks Toolbar Folder and rename it if needed). Open the Flickr page of the image and use this bookmark to save the original size of the image.

UPDATE: And here are the Flickr EasyOpenr which just opens the original size.

Wednesday, May 31, 2006

Jalali Calendar for Google Calendar



A couple weeks ago, I wrote the Jalali GCal user script (a JavaScript that Firefox runs on the web page if you have GreaseMonkey extension installed) to add Jalali Calendar (A.K.A. Iranian Calendar) to Google Calendar application.

As you can see in the screenshot, it adds Jalali year, month, and month days beside the Gregorian ones. (which makes it really useful for me! ;) This version (v1.1) supports all views: Day, Week, Month, Next 4 Days, and Agenda!

To use it, you should install GreaseMonkey (for Firefox 1.5), then open Jalali GCal user script and install it. Now refresh Google Calendar page.

Of course it's under LGPL license. I hope you like it.

Update: Jalali GCal moved to Google Code

Thursday, November 10, 2005

Horizontal theme for Guifications



Here are my Horizontal theme for Gaim's Guifications plugin.

Download horizontal-1.0.tar.gz
Download horizontal-1.0.zip

Just sets "IM Message", "Invited", "Name Spoken", "Topic Changed" and "Warned" event, as they are the only feature that I use.


Ubuntu HOWTO:

$ sudo apt-get install gaim-guifications wget
$ mkdir -p ~/.gaim/guifications/themes/
$ wget http://zwnj.org/proj/guifications/horizontal-1.0.tar.gz -O - | tar -zx -C ~/.gaim/guifications/themes/