Archive

Posts Tagged ‘awesome’

My Hand and the Canon XSI

February 3rd, 2010

Array


I just took this picture with my new Canon XSI DSLR.  I really like it.  Even though I’m going to have to buy all new lenses, I think this picture, which was shot freehand with my left hand hanging in the air, makes it all worth it.

Geet asked me what inspired me to switch to Canon after my devotion to Nikon and coveting of his D90.  I was intrigued by the D90 and other Nikon offerings, but I preferred to stay in the $500 camera territory (D90 bodies start around $700 used).  True, I would not have had to buy new lenses, but my current lens situation isn’t really to die for (kit lens, 55-200mm VR lens, and 50mm 1.4 manual focus prime lens).  I’ve had the most fun with the prime lens, and I’ll probably spend some real money this time on a Canon version with auto-focus.

The real selling points for me for the Canon XSI over the Nikon D40x were the following:

  • Auto-exposure bracketing (for HDR mainly)
  • Shot Rate: 3.5 fps vs. the D40x 3fps.  Minor, but still better.
  • Image stabilization in the kit lens (a bit gimmicky since it’s a low focal length, but still nice)
  • Automatic Sensor cleaning (D40x doesn’t have it)
  • More stuff in the viewfinder, like ISO settings.
  • Better menu, more features to configure
  • Larger screen (I usually use the viewfinder though)
  • Live View (very minor advantage, see previous comment).  It will be nice when I’m taking a picture away from my face.
  • Weight with the kit lens seems lighter than the D40x (I could be imagining things)
  • Auto-focus metering is better, and the up-close performance is better
  • Low-light performance seems to be better at ISO 800, but there are so many factors here that it could just be settings away.

The cons exist though:

  • The D40x has configurable hardware buttons, which is cool.  I don’t see this on the Canon
  • None of my filters will fit the funky 58mm format!  I have quite a few :(
  • The SD card slot door isn’t spring loaded – the Nikon’s is.  Very very minor.
  • After taking a picture or a set of them, it shows on the screen, but you have to hit the play button to activate review mode before hitting a directional button.  On the Nikon, if you hit a directional button when a picture is showing, you’re magically in review mode.
  • The sound!  The squeaky nasty gear-driven shutter sound is rather awful, while the mechanical-sounding Nikon shutter sound is totally awesome.
  • The feel of the adjustment wheel is better on the Nikon.  It seems cheaper on the Canon.
  • Deleting pictures on the camera is more cumbersome.

Overall, I’m still happy.


Uncategorized , , , , ,

Extracting M2TS length from a BDMV directory in Linux

January 14th, 2010

I was having the hardest time getting various programs to echo the runtime of m2ts files in Linux, and it turns out someone wrote a parser for the files in the BDMV/PLAYLIST directory, which have all of this information.

  • Get bdtools. I got Version 1.4. You can find it here.
  • ./configure && make && sudo make install
  • Try running mpls_dump. I got this error when running:
    mpls_dump: error while loading shared libraries: libbd-1.0.so.1: cannot open shared object file:
    No such file or directory

  • To fix it, do this:
    echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf
    sudo ldconfig


Uncategorized , , , , , , , , ,

Calibre with the Nook on Ubuntu

January 1st, 2010

Calibre is about the best thing since sliced bread. It is able to convert basically any type of Ebook format into EPUB, which is what my Nook reads natively. It seamlessly syncs with the Nook as well, which is a huge plus, and all of this happens in Linux. I highly recommend this software. Just make sure not to queue up too many jobs, or it might DOS your computer for a bit. The PDF conversion is especially intensive. It makes quick work of short documents (hundreds of pages), but documents that are thousands of pages take much, much longer. The only capability I’m missing currently is conversion of DOC to EPUB, but I can use OpenOffice to convert a DOC to HTML, and then import that into Calibre and convert it, so that works.


Uncategorized , , , , , , ,

Fixing italics in Calibre EPUB output

December 31st, 2009

I converted an ebook from TXT to EPUB today using Calibre, and found that the italics (which in the TXT file are annotated /like this/) are not converted into the HTML equivalent.  I did the following to fix this:

  1. unzip ebook.epub -d tmpbook
  2. cd tmpbook
  3. perl -i.bak -pe 's/([\s-,.;\'?:]+)\/(.+?)\/([\s-,.;\'?:]+)/$1<i>$2<\/i>$3/sg;' *html
  4. That will create.bak files just in case anything went wrong.  To revert the changes, do this:
    for i in *.bak; do mv $i ${i%.bak}; done
  5. zip -r ebook.zip * && mv ebook.zip ebook.epub

Then, I found out Calibre works beautifully with the Nook, so I just popped it on there and it worked.

Uncategorized , , , , ,

Compiling ConvertLit on Ubuntu Linux 9.10

December 31st, 2009

So, ConvertLit seems to be a good solution for those looking to convert LIT ebooks into EPUB (well, into HTML, but then into EPUB…).  Unfortunately, the developers seem to be unable to properly make a good source tarball for version 1.8.  Here’s what I did:

  1. Download Version 1.8 source from here.
  2. unzip clit18src.zip -d convertlit
  3. sudo apt-get install libtommath-dev
  4. Download this to the convertlit directory.
  5. patch -p1 -i clit18.source.patch
  6. You should see the clit18/Makefile was patched
  7. cd lib && make && cd ../clit18 && make
  8. the clit binary should be available in the clit18 directory
  9. sudo cp clit18/clit /usr/local/bin/
  10. Use it!

Now I just have to figure out how to convert it to epub.

Uncategorized , , , , , , ,

Diving into OOC, a fun new programming language

November 12th, 2009

OOC is cool.  Yesterday I started writing some code in it after reading about it on the github blog.  Here is the first result:

I’m extremely happy with how well this performs.  Using the latest ooc Java compiler from the github trunk to handle the each() functions, this compiles down to a bunch of C code, and then is automagically compiled behind the scenes into an ELF Binary!  This is totally awesome, and I have to commend nddrylliog and the other contributors for their work on this awesome project.  Now I should use it for something useful :D

A quick note about getting it running on Ubuntu:


sudo apt-get install sun-java6-jdk
git clone git://github.com/nddrylliog/ooc.git
cd ooc
JAVA_HOME=/usr/lib/jvm/java-6-sun/ make

At least, that’s how I did it. Then I compile all my ooc with a Makefile like this:


INPUTS=$(wildcard *.ooc)
TARGETS=$(patsubst %.ooc, %, $(INPUTS))

all: $(TARGETS)

%: %.ooc
  java -jar ~/repos/ooc/bin/ooc.jar $@

That will compile all ooc files in the directory.

Uncategorized , , , , , ,

SMPlayer, Lirc, and IRExec on Ubuntu Karmic

November 7th, 2009

I used to use lirc with mplayer to allow my Packard Bell crappy remote to work awesomely, but I have since lost that configuration and switched to smplayer, since it’s awesome.  Today, I figured out how to control smplayer using similar means.

Read more…

Uncategorized , , , , , , ,

1,000,000th Fibonacci Number One-Liner in C

September 9th, 2009

This is possibly the best one-liner I’ve ever written:

gcc -x c -o /tmp/out - -lgmp <<< '#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <gmp.h>
void omg_i_love_leonardo_of_pisa(uint32_t num, mpz_t * result) { mpz_t retval, last, tmp; mpz_init(retval);
 mpz_init(last); mpz_init(tmp); uint32_t i = 1; if(num == 0) return; mpz_set_ui(retval, 1U);
mpz_set_ui(last, 0U); for(; i < num; i++) { mpz_set(tmp, retval); mpz_add(retval, retval, last);
mpz_set(last, tmp); } mpz_set(*result, retval); } int main() { uint32_t num; mpz_t fibo; mpz_init(fibo);
omg_i_love_leonardo_of_pisa(1000001, &fibo); mpz_out_str(stdout, 10, fibo); printf("\n"); return 1; }
' && time /tmp/out

It compiles a C program given from STDIN, puts it in /tmp/out, and runs it with time to find the time it takes to run. It generates the 1,000,000th Fibonacci number. Try it!

Uncategorized , , , , , , ,

Reading compressed files with postgres using named pipes

September 4th, 2009

Postgres has the same type of ability MySQL has to read in files, yet much nicer syntax. LOAD DATA INFILE from MySQL is just COPY in postgres. I decided to try having it read from a named pipe today, and it worked out nicely.
Read more…

Uncategorized , , , , ,

Using Vimpress

February 28th, 2009

I’m regaining some functionality I haven’t had for a long time today. Back in the old days, I used to use [Flog](http://www.ralree.com/2006/09/02/changing-up-the-flogging/”) to post to Typo, but that all went away with Mephisto (I couldn’t get XMLRPC to work properly). So, I’m trying [Vimpress](http://friggeri.net/blog/2007/07/13/vimpress). Hopefully, I won’t need to hack together Ultimate Tag Warrior into Wordpress 2.8 to get tagging from vim to work.

##Update
It looks like it’s working, as a matter of fact. I installed the [Markdown for Wordpress and bbpress](http://mitcho.com/code/) plugin, and immediately my post was fixed up with nice new syntax. Tags work without any additional plugins using Wordpress 2.8. Go Vimpress!

##Update 2
As you can probably see on the sidebar, I added a vimpress repository to GitHub, since it was lacking one before. You can now use vimpress simply by performing a git clone git://github.com/hank/vimpress.git .vim. I went ahead and patched it with the custom slug options mentioned in the main vimpress site’s comments. Both versions are available as [tags on GitHub](http://github.com/hank/vimpress/downloads).

##Update 3
I happened to get to wonder how secure XML-RPC was, so I did a nice little wireshark packet capture, and lo-and-behold, there was my password in plaintext HTTP. I was aghast – why couldn’t they do a little HTTP-Digest authentication or something at least? Anyway, after researching what people think of this, and finding only past vulnerabilities in Wordpress, not complaints that it’s just a **bad idea to use insecure XML-RPC for blog posting**, I tried putting an s in front of my HTTP. Guess what – ***It Worked!*** I have to give props to Python for having that all built in.

So now, thanks to Site5’s free-to-use server certificates, I can now use XML-RPC securely.

Uncategorized , , , , , , , ,