Monday, June 1, 2009

Type Latex documents and get Live Preview (almost) on your Mac


We like typing our documents (scientific or not) in Latex because it is clean and powerful. But sometimes, it is cumbersome because to preview the result, you first have to typeset (sort of compiling) and view the document in a document viewer, whether DVI or PDF. This is much more difficult and time consuming than when a regular word processor such as Word is used. Of course, I don't mention the use of Latex GUIs such as Scientific Workplace (on Windows) because it is even more cumbersome and document created in this environment are very difficult to share with non SW users.

After some time on Mac, I have found the ideal setup (for me) and a great workflow. It is easy to install, to use and you almost get "Live Preview". What I mean by Live Preview is that you can type in your text editor latex code and get almost an instantaneous preview of the final document in PDF.

The trick involves a few softwares:
Mactex is the easiest way I know to install a Tex package on a Mac. Textmate is a great text editor. One thing is that it is not free :-( but you won't regret paying for it (A trial version is availabe). It can replace the simple editor bundled with OS X, and it makes things really easy. Skim is the fastest PDF viewer I know of for Mac. So download MacTex and install it, this should be fairly easy. Install Textmate and finally install Skim.

Now let's try creating a Latex document. Open Textmate and create a new document if necessary, and look at the bottom bar. You should see the type of the document and by default it is "Plain text". Click on that area and in the list menu choose "Latex" (alternatively you can try File Menu-->New from template-->Latex-->Article). Now you've told Textmate that you'll be typing a Latex document. You can try writing any Latex code you want. Let's remain simple and type this:

\documentclass{article}
\begin{document}
Hello there !
\end{document}


Now before previewing our document, let's make sure Textmate is properly configured for Latex. Go in the Bundles menu and do: Bundle Menu-->Latex-->Preferences. In the Latex Preferences dialog, make sure the Default engine is "pdflatex" (that's my advice). Then in dropdown menu View in choose "Skim", check "Show pdf automatically". You're done so click "Done".
Now you can preview your final document as a PDF in Skim. The shortcut to do that is "Command+r" . Try that and you should see the "Typeset and view" console that report the typesetting process and show errors and warnings. Skim should open automatically, steal focus and show you your newly created PDF. Great !

Now for the "Live Preview" (almost) workflow part. Here's what I like to do. I trim the Textmate window so that it occupies half the horizontal space on my screen. The other half is for Skim. This is already a neat setup: you type in Textmate, you press "Command+r" and you see the result in Skim very fast. But you can do better. First go in the Textmate preferences: Textmate Menu-->Preferences. Go to the "Advanced" tab and in the "Saving" sub tab. Now you have to check two option:
  • First check "Perform atomic saves". Atomic saves mean that (Textmate definition) instead of overwriting the file, TextMate saves to a new file and once this succeeds, overwrites the old file. This has the advantage that if your machine should crash while saving a file, you do not run the risk of losing the contents of both the old (last-saved) and new files
  • Second check "Save files when focus is lost": this is an interesting option. It means that each time you click anywhere outside the Textmate application, Textmate's focus is lost and your current work in Textmate is automatically saved !
OK! We're almost done. One last thing to do is to tell Textmate to monitor file saving and update final preview. To do that do: Bundles Menu-->Latex-->Watch document (alternatively use the shortcut Control+Command+w). Now a new PDF of your work will be created but this one is special (you can close the old one). The Watch document option does something pretty neat: it will automatically preview your document in Skim each time you save it. But as we've told Textmate to save automatically each time focus is lost, to have an almost "Live Preview" all you need to do is type, and then click on Skim (by clicking Skim or elsewhere outside of Textmate, Textmate loses focus, autosaves, and the Watch document option creates a new preview). Pretty good !

If this is not enough, we can go one step further however this step can be as much useful as a pain in the a$$. This is a trick I pulled directly from Textmate Howto Wiki. The idea now is to use something to autosave the Latex document for you every specified time. That thing is called EverSave ! This free little app save your work in almost any app for you. Download and install it. Once you're done go inside EverSave's preferences and do the following:
  • In the General tab, make sure "Listed applications" is the option under Save Applications and "Frontmost only" under Save Documents. Under When should EverSave save check only "Timer-controlled". Uncheck everything else inside this tab.
  • Go to the Applications tab and under Automatically save these applications click "+" and browse to your application folder to add Textmate. Automatically add applications options should be unchecked.
  • Go to the Timer tab. You have to choose a Save delay. EverSave will use this to save the document in Textmate every said time. I suggest putting something like 10 seconds or less. Then under Please choose a save method you absolutely need to choose "Save by simulating save shortcut", the other option is useless with Textmate as a save dialog will prompt each time.
You're done ! You can test the system. By the way EverSave installs a Mac bar icon that you can use to Enable or Disable autosave. This is wonderful if you type corrrect Latex code very fast. However this can be a pain in the a$$ because when you are in the middle of let's say typing an equation, EverSave will save, Watch document will see that the document was saved and try to update preview. If your Latex expression was wrong or incomplete, you will get an error. I've warned you !

That's it ! Let me know if you find this useful in your comments.

Tuesday, March 10, 2009

Data compression in Mac OS X: how to compress in RAR without WinRar...

Well something I miss a lot from my Windows days is an easy and efficient way to compress my data. Back on Windows, I was a heavy user of Rar compression and a big fan of WinRar. On Mac OS X, the most easy way to compress data is to use the built-in zip feature. That's fairly easy: in the Finder just right click on any folder(s) or file(s) and you should have the option to compress and create an archive in the contextual right click menu. That's pretty useful but you compress in the zip format and this is not the best way to save to compress in terms of space and you can not configure anything. So what I want is an easy way to compress in the Rar format because I came to like the compression rate and the power of this file format. But it appears that Rar is not a popular format on the Mac side and also right clicking something to archive is not very popular either (in fact if you ever had a mighy mouse, or have a Macbook, you know that right clicking anything is not Apple's thing).

First let's talk about decompressing rar files. You can not do this out of the box on Mac OS X if I remember correctly. You have to use a third party software such as The Unarchiver or UnRarX. But my favorite option to decompress rar archives is MacPar. True, decompressing rar files is not the primary goal of MacPar but it does it smoothly. And for the same price (free...) you can create parity sets or verify data integrity. MacPar also integrate with Split & Concat.

Now back to the main question: how to create Rar archive ? If you like to put your hands in OS X's Terminal, there is a straightforward way: use the command line rar executable available at Rarsoft, the makers of WinRar. This is just like what we did on MS-DOS with PKZIP, ARJ and RAR long ago... But yeah... Who wants to go back there ? If you don't, this gets a little bit crappy. After searching a bit, I found a software called RarMe. This is some sort of a graphical interface to the command line rar executable above. Although this does the job, I was not really satisfied with this soft because it was slow, and you have to specify everything each time in the interface window... super heavy stuff. It appears that the makers of RarMe are trying to make something better... so maybe something to follow. Also there was the Tiger only SimplyRar that looked good but I don't have Tiger anymore and their web site is down, also something called Rarify that works but no right click action here !

OK finally, I settled to a custom made solution with freely available software and the help of some nice guys on some forums I was reading. The final result is quite neat: you want to compress a file or folder to a Rar archive ? You just right click and choose "Add to Rar Archive" in the right click contextual menu, just as you do for zipping in the Finder. To do this, you will use an Automator workflow with an applescript to tell the command line Rar executable above what to do ! Sounds very complicated, but actually VERY easy. So here we go:
  1. Download the command line Rar for Mac OS X from Rarsoft here (more specific scripts can be found below). This is shareware so don't forget to buy it if you like it. I have not been nagged by this utility so far. What you will download is a compressed file. When you decompress it, you will get a folder named "Rar" with some files inside.
  2. Take the whole "Rar" folder from step (1) and drop it in your Applications folder. Now in your Applications folder, you should have a folder called "Rar" and inside a file also called "rar" and some other files such as "unrar"...
  3. Next go to your Home folder (this is the folder with a little house and your name on it most of the time). Inside there is a bunch of folders and one called "Library". Inside the "Library" folder, check if you have a folder called "Workflows". If not create it. Inside, the "Workflows" folder, create another folder called "Applications" and finally inside this newly created "Applications" folder, create another folder called "Finder". This is the place where you need to put the Automator workflow file later on in order for the Rar option to appear in your right click contextual menu.
  4. Download, the Automator workflow here. Once you unzip this file you will have a workflow file called "Add to Rar Archive.workflow". You need to put this file in the last folder you created in step (3). Once you did this, if you click on the workflow file and press "CMD+i", the path to the file should be "Users/yourname/Library/Workflows/Applications/Finder. Optionally, you can open this workflow file with Automator, check the AppleScript and change anything you like.
  5. YOU ARE DONE ! Now you can right click any folder, file or bunch of folders/files and in the contextual menu go to "Plus-->Automator-->Add to Rar Archive". And in a matter of seconds (actually it depends on the size of what you want to compress) you will have a Rar Archive.
OK that's it... Neat ! By the way, you can have as many workflows as you want in this manner as long as you give each workflow a different name. I just did the step by step guide and created the downloadable workflow file but I used the help available here and the AppleScript was written originally by some guy named "pardon" and you can find his original message and script here. Thanks a lot. Also, my version of the script uses these options of the command line rar executable: solid archiving, maximum compression, recurse subdirectories, assume yes on all queries and disable all messages. You can change these in the script.

Other scripts that might come in handy:
  • Add to Rar with timestamp script: this script always gives a timestamp as the name of the rar archive. WTF ? Well if you always archive the same set of files (for backup/logging purposes for instance), it's handy to have the date+time as archive name instead of anything else. This workflow creates a rar archive and gives it a timestamp in this format "20090410@032404.rar" meaning "YearMonthDay@HourMinuteSecond". With this your archives are nicely ordered. Check it out.

Tell me if the above download link is broken and ask/comment if you have any trouble.

Sunday, February 8, 2009

Converting a color PDF to a black and white (grayscale or monochrome) PDF

Here's my problem. I have a PDF document that is mainly text and also some graphics. The graphics are color graphics. However, I want a PDF where everything, including the graphics, is black and white (grayscale). Sometimes this is required. What would you do ? At first I thought that this would be really easy. In fact, I think it is if you have a lot of money. An Adobe blog poster describes a procedure here. But the trick is you need Adobe Acrobat Professional and... well no way I pay for that ! ( By the way if you had, Acrobat Pro, I think that a better way of doing things than to convert to Tiff would be to File-->Save As, choose save as Postscript, go in the Setting and set the Color option to Composite Gray. This will save your pdf to a black and white postscript (ps) file. Then using Acrobat Distiller, you can convert your ps file back to a Black and White PDF... voilà! I checked all that at the office after doing what comes next at home.)
Now I need to do that without the expensive Adobe Acrobat Professional. It turned out that with the software I had installed on my computer, I could not do that task. I tried saving to a PDF and looked for an option to save as Black and White document... but I did not find this (I tried with Skim on Mac and Foxit Reader and Abobe Reader 9 on Windows). Then I tried printing to PDF (with the built-in option on Mac and DoPDF on Windows) but there was nothing to set things to B&W. It turns out that on a Mac, you might get lucky sometimes. You can open your PDF with the default PDF viewer built into OS X. Then File-->Save As and there you have an option "Quartz Filter" and a dropdown menu where you can choose "Black and White" then save. This almost did the trick but for some reason, some graphics were really badly converted and some lines and curves had dissappeared !! Scary.
Here my solution with free software. Download and install GhostScript. Then Download and install GSview. Latex users probably already installed those. Finally you need a good free PDF writer. I like DoPDF. Open your PDF with GSview, and then choose File-->Print. In the print dialogue, choose DoPDF (or your own preferred pdf writer) as the printer. Then on the same windows bottom left you should have a "Print method" area where "Windows GDI Printer" is selected. If not select it and click Settings. In the "Colours" area select "Black and White". OK everything, and print your pdf after giving it a name. And voila! Black and White PDF from color conversion. Easy and free.
Maybe there is a way simpler way... let me know in the comments.

Wednesday, January 7, 2009

Viamichelin GPS Brick or block. How to survive and solve the issue?

Looks like I am an expert at bricking things. After my cell phone I bricked my Viamichelin GPS Navigation System. Mine is a X-970T New Edition (but my remarks below should apply to many models). OK let's say it straight, I think that the people who designed those things gave little thought to user experience.
If you have a functional Viamichelin GPS unit you have to do right now something most people do not do. Go install the DVD they gave you with the unit, follow on screen instruction and get your GPS and PC Viamichelin software in sync. Why ? Because if you do not perform those steps BEFORE anything crappy happens to your GPS or your GPS SD card... you're screwed !! These steps will create a restore point for your SD card.
Of course I did not do that and I think that most people do not because they do not give in depth reading to the user manual, because this is so cumbersome and because you never think of doing that when your unit is functional. And there is another problem with this procedure. What happens if you do install your DVD and then have a problem with your PC ? Well you're screwed again ! And finally, those products are discontinued so getting customer support is very difficult. So there must be a workaround.
First here's what happened to me. My GPS was fully functional and one day I followed a step by step guide on a corporate motel web page to install new POI (point of interest), such as those hotels, on my GPS. Wrong ! Never do that. To install POIs, you have to use the software Viamichelin gave you with DVD. Because I copied one file to my GPS SD card, it got bricked !! There are other silly way to brick your GPS. For instance, if you try to make a backup of your SD card yourself, you have to be very careful. On a Mac for instance, spotlight will try to write on the SD card and you might get a bricked GPS again.
So now the GPS unit is bricked, meaning it turns on, but is not functional. I received messages such as "mapsonic.exe failed..." or infinite loops between screens. But each time it failed to reach the main menu. I only found two solutions to my problem:
  • If you are lucky, this might work: you have to hard reset your GPS unit to factory settings. To do that: (1) Plug the AC adapter to your unit, (2) Remove SD card from unit, (3) Use something pointy such as a pin to press the reset button. Most of the time the reset button is located on the back of the device, inside a small hole, (4) Just after pressing Reset button release it and quickly press and keep holding the Power button (5) Keep holding as you will see a countdown and things like that (6) In the end factory settings will be reloaded, the GPS will restart and you will get a message to put your SD Card back. (7) After choosing your preferred settings... you GPS unit might be again fully functional... Mine did not :-(
  • Second solution is more a difficult one to achieve. The simplest way to do this is to get your unit to a Viamichelin repair point... but that might prove difficult to do. So you have to enter not so legal territory. Here's the deal. When you install your GPS unit with a SD card for the first time, a digital signature is written to the SD so that it can not be used on other units. So the main point here is to find a SD card or the content of a SD card that has not been digitally signed. How ? Well you can try ebay for a new SD card. You can also try to find the content of the SD card on the net (Google, Torrents are your friends). I give this last suggestion only as a piece of information as I think that doing this is not legal. You have to read Viamichelin disclaimer to find if you have the right to possess a digital copy of a legally purchased SD card, I have no clue. You can also find somebody who just bought a GPS unit but not yet installed the SD card. Borrow the SD, write protect the SD using the physical lock, make a copy and get the content to another SD card. Anyway once you have new SD. You can perform the hard reset step explained in solution one and use your new SD. If you only manage to get the content of an original SD, you will have to format a spare SD card to FAT, copy the files from original SD to the root of your SD and then perform the hard reset step of solution one with this SD. And that's it.
I hope this work for you !

Let me know if this helps in your comments.

Thursday, October 16, 2008

Journal of a Switcher: browsing the net

Your best buddy has been nagging you for years and there it is... you finally decided to give this mac thingy a try. Believe me with time you will come to love your Mac. But at first it can be VERY difficult because most of us have been Microsoft Windows formatted for so long. Anyway one of the things I found most annoying was to build from scratch a new software library. Let me try to help you with what I found out there. This is a "to be continued" Journal of a Switcher:
  • Browser: all you'll ever need is Firefox for mac or the built-in Safari. Google Chrome is not yet available for mac. Opera and others can be great alternatives just like under Windows. I'll use the space here to tell you about my Firefox experience. To be honest, I was a bit disappointed by Firefox 2.0 (don't worry this is nothing compared to my Internet Explorer 6 experience). I found it to crash often and more seriously to be a huge memory monger. Since I have Firefox 3.0 I am totally satisfied. I don't see anything really useful about the big talks nowadays about javascript speed. What I do see is the user friendliness of Firefox 3.0, most specially through all the plugins available out there. Here are the plugins I cant' live without:
  1. Firegestures: How did we do before ? I can't remember. I use mouse based navigation all the time. But most people I see using Firefox don't even know what it is.
  2. Adblock Plus: it's not when you install it that you see a real difference but when you remove it. You get so used to browse the net without annoying ads that you really believe internet is really like that... until you remove Adblock and rediscover how bad it has become.
  3. Tabmixplus: another thing I don't see people use often in Firefox is it's tab feature. Even though tabs are built into Firefox. I've seen a lot of people open as many Firefox windows as they need just as they use to do in the old Internet Explorer days. For those of you who didn't know (after all if everybody just assume that everybody knows... we're going nowhere) if you middle click on a web link while browsing on Firefox, it will open in a tab inside the same Firefox window and you can move between tabs easily. That said, eventhough the built-in tab feature is great, I always use Tabmixplus as a replacement for it's many time saving cool options. Check it out.
  4. Downthemall!: another fine Firefox extension. Downthemall! is a download manager. With it you can fast download as it can split a large file into smaller pieces and download them concurrently, you can also stop and resume downloads, mass download selected files on a page etc. Great tool.
  5. Foxmarks: If you have more than one computer and care about having the same browsing experience, this is for you. Foxmarks can syncronize your bookmarks across as many Firefox and as many computers as you have. Even works cross platform between a Mac and a Pc. And you can also access you bookmarks at any time if you're not on your computer.
Of course, there are so many extensions (check here) out there that you can spend days testing them. Find the right ones for you.

Wednesday, October 15, 2008

Prevent spammers from picking your email address from your webpage

Spams are the plague of the internet. But sometimes we provide the stick that beats us. How many of us have a webpage with our email address left there in plain sight of spam crawlers ? There are several ways to avoid robots and such from getting our email addresses. The obvious is to never share it publicly. You can also misspell your address a little and leave a message: johndoe_gmail.com (Replace the "_" with "@"). Here's a neat trick: put your email address in an image file. That's easy to do and quite efficient as robots can not crawl it and your human readers still get the info in a neat way. Open any image application, such as Microsoft Paint, Photoshop, Gimp or whatever you have around. Create a new file of the size you want it and paint the background transparent. You can also paint it in the same color as your webpage's background but painting it transparent is sure fire whatever the background color. Use the text tool in your image app to type your email address and save as an image file such as jpeg or gif. Next in your webpage, remove the written email and replace with the image. If you use a web publishing application such as Frontpage or Dreamweaver, it's quite easy to do. If you type your html yourself, just use the usual <img> tag.

Sunday, October 12, 2008

Tip for the short-sighted

If you're short-sighted like me, you carry around your glasses or lenses. Sometime you don't have those around and you need to see something out of your sight range. Use this tip to boost your sight a little: take your index finger and roll it around so as to leave a small hole in the middle (see picture below) . Now look through the little hole in your rolled finger. You should see things better. This is because of an optical property. If you're short-sighted, the outside image is not formed at the correct place in your retina (sort of). Looking through your rolled finger can help with that by changing the place where the image gets concentrated (kind of).



Friday, October 10, 2008

Using Gmail Quick Links

Quick links in Gmail (Google's online mail application) can be a great way to save time. For instance, spammers tend to send you crap with messy time stamps. When that happens you will see that you have unread spam but you might need to go through your whole spam folder to find those messy spams. With quick links you can improve such tasks (and others). Let's try a workaround for the problem above: in Gmail's search box type "in:Spam is:unread". These are instructions in Gmail's search language. Understand "look in the spam folder for all the emails that are unread". Click "Search mail" and all your unread spams will appear. Now the thing is to do something to avoid typing this in the search box each time you need it. So immediately after the search is complete, go to the Quick Links areas (generally on the bottom left of your Gmail window). Click "Add Quick Link" you will have a new dialog box where you need to give a name for the Quick Link you just created. Type a name and a new Quick Link by that name will appear in the Quick Links area. Each time you click the link, your unread spam will appear... nice!! You can do that with anything you search: "in:All is:starred from:dann has:attachment after:2008/09/01", this will search all your starred emails for an email from dann with an attachement received after septembre 9th 2009. You can Quick Link this.

Wednesday, October 8, 2008

Journal of a Switcher: what about file explorers ?

Your best buddy has been nagging you for years and there it is... you finally decided to give this mac thingy a try. Believe me with time you will come to love your Mac. But at first it can be VERY difficult because most of us have been Microsoft Windows formatted for so long. Anyway one of the things I found most annoying was to build from scratch a new software library. Let me try to help you with what I found out there. This is a "to be continued" Journal of a Switcher:
  • File explorer: you can use the built-in Finder. It's simple but can be sometimes annoying. Specially when you are used to Windows file explorer and the way it orders files and folders. If you get really annoyed, give PathFinder a try. You can customize it to get very Windows explorer like with the mac look plus tons of extra features. Sadly it's not free.

Tuesday, October 7, 2008

Failed Sony Ericsson firmware update: tips for updating and recovering from errors

As a foreword and if you did not update your Sony Ericsson handheld (mobile phone) yet: be warned, things can go VERY wrong. I'd advise against updating unless you know what you are doing and you feel your phone really needs this firmware update. Below is my experience with my handheld, a Sony Ericsson K850. To update your phone, you'll need a piece of sofware called Sony Ericsson Update Service (SEUS). This app is available from Sony Ericsson web page. This app needs Adobe Flash to work so make sure the latest version of Adobe Flash Player for Internet Explorer is installed on your computer before doing anything. Also, this app is Windows only.

Mac users with a Sony Ericsson handheld be very careful. It is very tempting to run Windows inside your virtualization software such as Parallels, VMWare Fusion and consorts and then try install SEUS there to update your phone. I'll totally advise AGAINST that. My personal experience from doing that says: lots of trouble you don't want !! Instead Mac users, use Bootcamp to run Windows natively with internet access.

Ok first things first: before doing anything download this pdf file from Sony Ericsson called Update Service Application Guide (Getting Started). Read that guide carefully. General tips that are good to know:
  • save all your data, specially data written on the phone memory
  • make ABSOLUTELY sure that your phone battery is charged at 100%
  • before updating remove SIM card and memory card
  • make sure there is enough place on the phone's internal memory, if not absolutely make some space
  • make sure computer is connected at all time of the update process to internet and that no firewall is blocking the SEUS app
  • you should not use you charger cable AND the data cable at the same time during update: you should rely only on your 100% charged battery
  • make sure your USB port is fully functional
  • make sure your data cable is fully functional and that no dirt is preventing good connection

OK, if you are ready to start, let's go:
  • Start Windows, Mac users start windows natively using Bootcamp or use a friend's PC
  • Install SEUS (make sure Adobe Flash is installed before and that the computer can access the net)
  • Start the SEUS application
  • Connect the data cable to the USB port of the computer but NOT YET to your phone. Make sure that the data cable is connected directly to a built-in USB port (meaning don't use an USB hub port)
  • Follow on screen instructions in the SEUS application: mainly choosing a language and your phone model.
  • Once SEUS has downloaded the latest firmware update from the net, continue following on screen instructions
  • At some time you will be on a screen asking you to connect your phone to the data cable. This has to be done in a special way: first turn your phone off, then remove your battery for a few seconds, reinsert your battery, locate the "C" (or cancel) key on your phone's keyboard and keep it pressed, connect the data cable to the phone (it should be already connected to the computer at the other end) and keep pressing the "C" button until a message on the computer screen tells you to release.
  • OK now SEUS should have detected and identified your phone, follow instructions and the firmware update will begin. Be patient, this can take a while.
  • Once the update is complete, you will get a message on the computer. Disconnect the cable from the phone when asked.
  • Remove the battery, wait a few seconds and reinsert. Now you can start your phone.
  • The phone should start. Don't worry if your phone looks like a Windows 95 screen for some time. It should ask you to wait. It is important that you WAIT (it can be stuck a long time on a message like "Please wait...") until the phone is ready.
  • Afterwards, the phone should return to normal use mode. You might need to configure some settings but all in all you're back to normal use: GREAT !!
OK people who were successful in updating does not need to read what's written below. As a matter of fact, I did not succeed my update at the first, second, or even 10th time. Because accurate information on how to do this the right way was scarce, I was forced to go with the hard way through trials and tribulations (what I totally not recommend). If you did start the update and at some time you had an update error asking you to redo the whole process, you might not be totally screwed yet. Most of the time, the phone might not restart even when the data cable is disconnected (sometime, the phone might begin the starting process, vibrate, light up, blink... but then nothing happens). That's really scary and all but there is hope:
  • You need to be absolutely sure that your battery is fully charged. If your phone does not start, it is difficult to know that. I am not really sure if your phone is recharging when you connect the charger cable while the phone is in this "bricked" non-responsive state (anybody know about that ?). My advice would be to borrow a fully charged compatible battery from a friend, or buy a new cheap one from a cheap store online.
  • Mac users, use a PC and if not possible run Windows in native mode through Bootcamp (do not use virtualization software to do firmware updates).
  • If the update failed once (or more) already, retry but use another USB port this time. Remember use a built-in USB port and NOT a USB hub port.
  • Check that no firewall is preventing SEUS from working normally
  • Uninstall and clean install SEUS if necessary
  • Did you remove SIM card and memory card before starting the update ?
  • Are you sure that the internal memory (this is different from the SIM memory or the memory card memory) had enough space ?
  • Did you remove the battery, wait some time, reinsert battery, before starting the process ? The process won't work if you did not, specially if the update already failed once.
  • Are you positive your computer was connected to internet during the whole process ?
If everything fails, I guess you need to consult with your phone dealer or Sony Ericsson. In my personal experience, I repetitively failed the update process (supposedly because of virtualization and battery issues) and my phone would not start (except for some vibration from time to time). I did manage to recover with another battery and without virtualization ( I am using a Mac). Good luck ;-).

Let me know if this helps in your comments.