Saturday, December 22, 2007

Opening Up a Sony Cybershot DSC-L1

I purchased this little guy three years ago, but the lens cover stopped working, displaying the message "ERROR: TURN THE POWER OFF AND ON AGAIN" on the LCD. After searching the web, I only found useless manuals for sale or just basic consumer reviews. Since my fiancee and I already have two other Sony's, I figured I'd open up this one just as a saturday-afternoon adventure. Last time I opened up a consumer electronics device (other than a computer) I was probably 6. It was my first vinyl player whose plate suddenly stopped spinning. As usual, we took it to the nearest electronics repair shop, and they said they'd have to order this new motor, and that it'd cost a lot (sounds familiar?). So I got pissed and I just opened it up on my own at home, and starting touching random electronic components while the thing was still plugged to the wall. Finally, I touched something and the record player started spinning. It was a ridiculous potentiometer (a mere variable resistor)! Couldn't be easier and cheaper to fix, my dad just spent a few cents and I could hear my music again. Although I could have electrocuted myself that day, my mom still prides herself of her son's feat, more so than anything else I ever consciously did. Anyways, I figured I don't need to be an expert to be able to fix today's electronics. They have become more complicated but I am not 6 anymore, and sony electronics engineers haven't become all that much smarter, believe me, you'll see how cheap the shutter cover is. So lets start the step-by-step quest to open the Cybershot DSC-L1. (Do it at your own risk!)

First of all, go to radio shack and get yourself a set of precision screwdrivers. Get good ones since you need good grip here, as the screws will be really tight. Remove the battery from the camera. Now lets unscrew it, literally. There are 4 pairs of screws in total - 2 pairs on the bottom, 2 pairs on each side. The side screws become visible once you open the compartments for the batteries and the compartment for the DC power.

Ok, now that you removed the 8 screws, snap-out the plastic cover on the side where the DC input is. Then try to pull apart the two halves of the camera, the front cover from the back cover. One of the corners is kinda tricky, but just force it a little and it will snap open. Be careful but firm. Now you have the camera opened-up, it should look like this: You can now hook the camera to the outlet as the figure shows. Turn on the camera, and it should work as before. In my case, the shutter cover is stuck, so the lenses don't open or extend. Now notice that there are two switches that sense whether the shutter cover has retracted or not: In the case of my camera, I can fool it to extend the lenses by pressing the top left switch with a screwdriver:
Now unplug the power chord. The next step is to remove the plastic connectors from the front of the camera, so we can detach the two halves of the camera. First remove the two screws that hold the strap, one in the middle, the other near the motor. Do this by carefully using a precision screwdriver to help take the strap from under the plastic holders along its track. After some careful but trivial process, you obtain: Good. Now lets take care of that front cover. If so far it felt like you're performing a careful brain surgery, the next step will be more of an orthopedic surgery, except that you probably don't need a hammer. The problem is that the freakin' asses at sony actually glued the mechanics of the lens cover onto the front steel case. I thought I was doomed at this point, that the only way would be to order another front case, if sony still manufactures them, which I doubt. I got pissed and went for a high-risk brutal operation: to forcibly detach the black part from the steel case. Yes, it feels grotesque but it is the only way. Use a precision screwdriver to help you detach the two parts by "carving" into the glue. Sounds laughable, and looks even more laughable: Notice all the glue? Yeah, now you realize how the lens cover mechanics is by far the crappiest part of this camera. I don't know why sony tried to save money by doing such a shitty job at this, given that it is nothing compared to the cost of the software, signal processing and lens optics. Anyways, this is why probably every owner of the DSC-L1 will have problems with the lens cover at some point. Ok, back to business. Notice that there is a rod with a spring. Be careful with that little spring, it'll easily fall or jump all over the place. Anyways, the problem with my camera was that this rod wasn't perfectly in place, it seems, and that the gears weren't able to grasp the shutter cover. Now try to put that rod in place. First take the lens cover off and slide it all the way to the right of the rod. Carefully place the lens cover back in the track on the black plastic base by first fitting the bottom of it, then the top-right part of the rod, then, by squeezing the spring, fit the left part of the rod into the plastic case. You should feel it snap, and you need to put some pressure to get it to fit. After some patience with the damn spring, it is now time to reconnect the orange strap back into the black plastic support. Start by fitting and screwing the motor tight and move your way to the end of the strap. Plug the camera on the wall. You should end up with this: Now there is a subtle trick to it. The switch in the middle has to be pressed-in. Use a screw driver to press the switch and your finger to snap it in, then screw the middle switch: Ok, now you can turn your camera on to test the shutter cover. It should work! If not, post a comment and I'll try to help. If it worked, now you have to stick the black plastic component back into the metal cover. Do this by positioning it carefully then pressing firmly so that the glue sticks to the metal again (argh this horrendously cheap). Make sure the little transparent LED plastic on top of the shutter cover is in place. Now put the two halves of the camera back together, and screw the outer 8 screws back in. Snap the side plastic cover and you should have your >$100 value reward (>$250 back in the days):

Sunday, December 09, 2007

high quality eps in pdf

From http://electron.mit.edu/~gsteele/pdf/

One of the problems with pdf conversion is that most pdf converters
("distillers") are configured by default to always use lossy (DCT
Encoding) for color and grayscale images. For a scientific paper, this
produces very poor results. In order to get high quality figures in
the converted PDF, you can either tell the PDF distiller to use
FlateEncode or to use DCTEncode with a high quality factor. Here are
the postscript snippets that allow you to do this:

* Use DCTEncode with a high quality factor: this involves setting
a parameter called "/Qfactor" to a small number. The /Qfactor
parameter actually refers to "Quantization factor". Setting this to
0.15 uses the same settings as "Maximum Quality" mode for Acrobat
distiller.

systemdict /setdistillerparams known {
<< /ColorACSImageDict << /QFactor 0.15 /Blend 1 /ColorTransform
1 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >>
>> setdistillerparams
} if

* Use FlateEncode: this way, the images that you see in the
converted pdf file will be exactly identical to the EPS images you
submit.

systemdict /setdistillerparams known {
<< /AutoFilterColorImages false /ColorImageFilter /FlateEncode
>> setdistillerparams
} if

To use these, simply open up your .eps file in a text editor such as
emacs and insert the text after the end of the "%" commented area at
the beginning of the file. This should automatically work with dvipdfm
conversion as well as the pdf conversion software used on the arXiv
server.

Thursday, December 06, 2007

Sources of Inspiration

Two major sources of inspiration have dominated my years at Brown: philosophical/religious essays and biographies.

I am not Jewish nor radically religious, but since it's Hanukkah, I'll mention a collection of practical essays rooted in Jewish wisdom: www.aish.com/spirituality/48ways

Again, I am not blindly religious, but here is my own piece of wisdom - nothing is totally black and white, so be humble to listen, filtering what you like and questioning what you don't like in a constructive way. In fact the above essays are very rational in many ways, although at times they might be slightly simplistic - which is unavoidable even in less religious texts.

The essays are quite effective in inciting energy and vitality. My favorite ones:

It is interesting how Catholicism, although rooted in Judaism, has forgotten a little about a more proactive attitude towards achieving things in practice. Being meek and humble can be a very important concept, but that doesn't mean you should act foolish or abstain yourself from achieving. This is a recurring confusion among Catholics and paints a wrong image of Catholicism in the mind of non-Catholics. Anyways, human affairs are complicated, again, nothing is black-and-white.

I finish this part of this post with a quotation from one of the essays that is particularly well suited to my research

"You couldn't buy an eye for a million dollars. Yet God gave you -- for free -- a pair of eyes that work more accurately, quickly and efficiently than the most sophisticated digital vision devices."

Basically the Rabbi is challenging us researchers in the field : he wrote an essay that is supposed to offer timeless wisdom - and he certainly thinks machine vision doesn't work as good as human vision, and probably never will !!!!

***

The second part of this post is about these fantastic biographies of mathematicians and scientists we are used to hear about. I have just read a particularly amazing one, from Grassman. The man was never recognized as a major mathematician at his time, mostly taught at high schools, and yet had discovered a stupendous amount of concepts which, 100 years later, are now the basic "look and feel" of math.

After struggling all his life to get his ideas accepted, obtaining little visibility, and being criticized by major mathematicians for his abstract presentation, he finalizes his years by insisting on publishing yet another edition of his work, with a magnificent foreword:

==The following is an extract from the Foreword of Die Ausdehnungslehre: Vollständig und in strenger Form bearbeitet published by Grassmann in 1862:==

"I remain completely confident that the labour I have expended on the science presented here and which has demanded a significant part of my life as well as the most strenuous application of my powers, will not be lost. It is true that I am aware that the form which I have given the science is imperfect and must be imperfect. But I know and feel obliged to state (though I run the risk of seeming arrogant) that even if this work should again remain unused for another seventeen years or even longer, without entering into the actual development of science, still that time will come when it will be brought forth from the dust of oblivion and when ideas now dormant will bring forth fruit. I know that if I also fail to gather around me (as I have until now desired in vain) a circle of scholars, whom I could fructify with these ideas, and whom I could stimulate to develop and enrich them further, yet there will come a time when these ideas, perhaps in a new form, will arise anew and will enter into a living communication with contemporary developments. For truth is eternal and divine and no phase of it ... can pass without a trace; it remains in existence even if the cloth in which weak mortals dress it disintegrates into dust."

And ditto - his truth remains and there's nothing you can do about it. This is a sublime example of unshakable belief in ones purest thoughts, and this brings us back to one of the wisdom articles above - Use Your Inner Guide.

The full biography can be found at: www-history.mcs.st-andrews.ac.uk/Biographies/Grassmann.html

Friday, October 12, 2007

SO many Smart People are not Wise

Smart: adj. showing mental alertness and calculation and resourcefulness

Wise: adj. having or prompted by wisdom or discernment; marked by the exercise of good judgment or common sense

Who is intelligent, the wise or the smart??

Intelligent: adj. having the capacity for thought and reason especially to a high degree; 2: possessing sound knowledge; 3: exercising or showing good judgment; 4: endowed with the capacity to reason

Wisdom is certainly more connected to intelligence than the pure mental quickness characterizing smart people. There is a vast amount of smart people - a vastness that is increasingly alarming - that are foolish, ignorant, and ignoble. We lack people with slow, careful but creative mindset. A lot of smart people oversimplify and are extremely anxious. Imagine if they could use their powerful brains in a disciplined, calm, and lucid way?

Check out this funny link http://www.slowleadership.org/2006/10/hamburger-management-revealed.html

It is intriguing how much we need this in all areas, in computer science in specific. Instead of devising clever, smart hacks - still so popular nowadays - we really need to think deep and do everything very carefully. This is because we have so many people with simplistic thinking out there, which can only scratch the surfaces of problems. If you really want to succeed in life in the long run, it is better to be very wise and a little smart, than very smart and a little wise. There is no such thing as too much wisdom in this era where everyone has access to information that is already far beyond the level of clever and careless tricks.

A practical advice: study the relevant background in whatever your endeavor carefully. In the world of computers there is a saying that can be generalized: RTFM "read the fucking manual" ; follow the good tutorials on the net. Dont fool around with poor tricks trying to learn or do something that has already been clearly and neatly described. Spare some time to learning new things, RTFM and focus your smart ass where it is really needed.

Monday, July 23, 2007

[Linux] Bug in EPS export

When I try to export an OpenOffice.org drawing to EPS, the right and bottom parts of the drawing
are not shown, even though the bounding box seems right.
This bug started to occur when I upgraded to 2.2.1, although earlier versions
worked fine for me (I would guess the upgrade was from 2.2.0, but I am not
sure). Something definitely changed in recent versions regarding to EPS export
that caused things to stop working.

WORKAROUND 1) Select the whole drawing, then export. For some reason
it works like this.

WORKAROUND 2) Increase the margins by dragging
the margins to be far from the object. This screws-up the bounding box, but at
least the whole object is drawn. I then edit the eps file using a text
editor (vim),
and adjust the bounding box values according to the values I determine by
inspecting the drawing in ghostview ('gv'). The cursor in 'gv' shows the
bounding box value.

http://qa.openoffice.org/issues/show_bug.cgi?id=76048

Keywords: cut-off, draw, impress, latex, bounding box, margins, eps, postscript

[Linux] Printing with CUPS

I was trying to use the KDE control pannel to add printers to my
system, but I would get:
"unable to create temporary printer"

I also had a perfectly working printer, which suddenly became "not
ready" from the acrobat printing menu. When I opened the KDE printing
control panel, and tried "start printer", I got
client-error-not-found

The solution was to add the printer through the CUPS web interface,
which is actually very good. The way to do it is to open the following
link in your browser (konqueror/firefox):

http://localhost:631/

And add the printer from there. The process was straightforward for my
Lexmark Optra T612.
For the record, my CUPS version is 1.2.10. Maybe I updated CUPS and
the KDE print manager got lost? Go figure.. at least I will only use
the CUPS web interface from now on.

Tuesday, July 17, 2007

Birthday photos / Fotos do aniversario!

Check out my Birthday photos are at:
Vejam as Fotos do meu aniversario em:

http://cortex.lems.brown.edu/~rfabbri/gallery

Sunday, July 08, 2007

[Linux] Text encoding

I recently had a problem with special Portuguese characters and latex.
The problem is that the input must be in latin1 encoding, and I was
using utf-8 to edit an input file. It took me quite a while to figure
out why latex would not compile my recently edited file, but would
nicely compile my old files written in Portuguese. The error I was
getting was:

"Command \textcent unavailable in encoding T1"

Your command was ignored.

whenever a special symbol was found (for instance, the letter 'a'
circumflex). After studying encodings, unicode, ascii, latin1, and
also searching for similar errors, I found that Latex does not fully
support UTF-8 (as of this date), and that the input should be encoded
in latin1. The way to check the encoding of a file in VIM is to open
the file and type:

:set fileencoding

if it is utf-8 or anything other than 'latin1', you will get error
messages. So it really turned out that some recently edited files of
mine were in utf-8. My solution was then to type

:set fileencoding=latin1

inside GVIM, and save file, re-run latex and .... done.

PS: my latex preamble has the following:

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[portuges]{babel}

I am using tetex-3.0_p1-r3

Sunday, June 10, 2007

[Linux] Inkscape vector drawing program

I recently found this vector drawing program for Linux as a lightweight and libre alternative to Illustrator: http://www.inkscape.org

It looks very promising and it renders graphics and fonts very well with very nice effects (if properly installed). It can even render Latex math formulas using Effects->Render->Latex formula. And the nice thing is -- it converts the formulas to vectors, so no bitmaps are used, giving an amazing quality improvement to text in the drawings.

I am using Gentoo and I had to enable the plotutils use flag and re-emerge pstoedit in order for Latex rendering to work in Inkscape. The next thing I'd like to get working would be to have some easy way of specifying a Latex preamble so I could use my macros and commands when typing the formulas. A larger space for typing the formulas would also be part of my wish list.

Before Inkscape, I have been using OpenOffice.org draw, which is quite decent and has a good EPS export, although its rendering capabilities are far from Inkscape's, and it doesn't support reading SVG as of this time. OpenOffice.org can render Latex formulas if you use OOoLatex http://ooolatex.sourceforge.net - and it even supports a user-defined preamble. However, the formulas are in bitmap format only.

The main reason for my attempt to switch to Inkscape is that the effects (such as many options for stylized strokes) and rendering are way better than Open office draw. However, OOoLatex still is superior in certain features, for instance you can edit the formula and correct mistakes, something impossible with inkscape 0.45.1

Monday, June 04, 2007

New Photos

There are some new photos from last weekend:
http://cortex.lems.brown.edu/~rfabbri/gallery/
I went to Long Island with a Brazilian friend of mine.

Thursday, May 24, 2007

Accepted paper

I just got a final notice of acceptance of my manuscript at ACM
Computing Surveys:

R. Fabbri, O. M. Bruno, J. C. Torelli, L. da F. Costa "2D Euclidean
Distance Transform Algorithms: A Comparative Survey", ACM Computing
Surveys, 2007 (Accepted)

Supplementary material will soon be available at:
http://distance.sf.net

I'd like to thank all my family, friends, and my current and previous
advisors for their enthusiastic support. I hope this research will
prove useful for the community.

Monday, May 07, 2007

Spring

More of my spring photos here

Friday, April 27, 2007

Angela's website

This is my girlfriend's website
www.guzdesign.com

Her name is Angela Guzman and she is a Graphic designer and Industrial designer. She crafted that
website Guz Design a long time ago but still looks cool. She will supposedly
update it soon with lots of interesting stuff she's been doing at her
master's program at Rhode Island School of Design. Angela loves making patterns, playing with typography, and combining 3D and 2D approaches to design.

photos!

I have been posting more photos at my album:

http://cortex.lems.brown.edu/~rfabbri/gallery

I will leave them public for a while, but after that you'll have to
ask me for password.
You also need a password in order to access my complete photo collection which includes a lot of older stuff.

Sunday, February 04, 2007

Key Lime Pie

This is a nice & simple dessert from the Florida Keys.

6 egg yolks 1 can of condensed milk. (No evaporated milk!) 4oz of Key lime juice (maybe lemon or lime juice will work too)

Blend eggs and condensed milk, pour juice slowly while blending, then beat like a cake. The longer you beat, the puffier it gets.

Oven temperature at 325F, 15min. Let it cool, then freeze.

Monday, January 01, 2007

Shell World Florida Keys


Shell World Florida Keys
Originally uploaded by rfabbri.
This is a huge suvenir, home decor, and sea-shell store owned by my girlfriend's parents, take a look. They also have a website
www.shellworldflkeys.com