Tales of a GeekTrotter Binary Logbook

4Jan/1320

Upgrade Arrows X LTE (F-05D) to Android 4.0

Back in November 2012, Docomo (finally...) upgraded its Docomo NEXT Serie to Android 4.

To upgrade, you can either follow the detailed version by Docomo (and many other Japanese websites...).
Full of colours, explanations and diagrams so a 2 years old child can do it:...
http://www.nttdocomo.co.jp/support/utilization/product_update/list/f05d/device.html
...and might waste hours

Or, simply download the two following files:
- ZIP: http://spf.fmworld.net/fujitsu/c/update/nttdocomo/f-05d/update1/top/download/ [from the Wifi connection of your F-05D phone OR your computer]
- APK: http://spf.fmworld.net/fujitsu/c/update/nttdocomo/f-05d/update1/sp/top/download/ [from the 3G connection of your F-05D phone]
In both cases, click the blue box to agree. (同意する)

Extract the ZIP in your INTERNAL SD card, NOT in external_sd.
So you should have a ".enc" file at the same level as "external_sd" (and not inside).
Install the APK on your phone, run it, choose the first option (internal memory) and wait, that's it.

Enjoy!

Filed under: IT 20 Comments
15May/121

Mobile Applications in HTML5/CSS3 with Sencha Touch

A few years ago, I was writing about building smartphone applications with Rhomobile Rhodes.

Since then, I also tried several frameworks, such as Appcelerator Titanium Mobile but was especially satisfied by a relatively recent one, using only web technologies: Sencha Touch 2.0.
My main concern about Titanium Mobile is that the generated application was not behaving the same on Android and iOS (and was not working on iOS).
After writing code and testing on Android, I was very frustrated that it didn't work out-of-the-box on iPhone.
I didn't really have time to investigate the problem, but it gave me a bad image of the product.
That's how I ended up trying Sencha Touch 2.

A quick summary of the strengths and weakness of Sencha Touch 2.

Strengths:

  • Rapid testing (inside the browser)
  • Good User Interface API
  • MVC Design Pattern
  • Provides a GUI for quick mockup (Sencha Architect)
  • Pure HTML5/CSS3

Weaknesses:

  • New, working fine on Mac (from what I heard/read), but unstable on Windows/Linux*
  • Is limited by the cross-domain security that prevents from fetching data from other domains that do not?explicitly?allow it if ran in the browser (not packaged as an application)
  • Needs to be integrated into another framework such as PhoneGap (Cordova) to be packaged as a real?application*
  • Tiny visual difference between the desktop browser rendering and the smartphone browser rendering (text is not coloured in one of the pages)

*The Sencha command-line is supposed to provide packaging, but doesn't work well on Linux so I had to integrate the app inside a PhoneGap project to deploy as a real?application.

It took me about 8 working hours (a geek weekend) to build a simple application from scratch.
For testing, I created a small application that allows you to add transactions to the easy online money management service Buxfer, which provides a JSON API (Sencha Touch 2 can easily handle data coming from JSON/JSONP objects).

The application is very basic: 3 tabs (Home, Add and Logout).
On the Home tab, I list the accounts and the last transactions.
On the Add tab I allow to add a transaction (an expense or an income).
And the Logout tab will log the user out.

The application works very well on the desktop browser, and it's really fast to test our program:

However, there are a few differences on the real?application on the smartphone:
- There are no colours on the accounts balance listing (should be green if positive, red if negative)
- It's hard to make the checkboxes on the Add tab activate (touch)

I recorded a video of the real?app running on my phone, not really good quality but gives an idea of the rendering:

As we can see, it's still very nice, and I'm sure the little problems will be fixed soon.

You can find the source code of that application on BitBucket: Buxfer Mobile

Next time, I'll try another promising mobile framework: jQuery Mobile.

Filed under: IT, Programming 1 Comment
13May/120

Some Parallel Computing (Multithreading) and Http Requests in C#

After programming in Python, Ruby, Java, C/C++ for a while, I decided to give a chance to C#.
For a fair comparison, I decided to write a small program that I have already written (or parts of it) in Java, C++ and Python.

The requirements of the program are the following:
- login to an external website I am not the owner through POST requests and store the session
- fetch several pages on that website (logged in, multithreaded)
- provide a login window, a window with a table (grid) to display the data fetched
- provide the possibility to open the webpage we have logged in, being logged in

Additionally, it would be great if we could have:
- easy packaging and distribution
- multi-platform (Win/Linux/Mac)
- rapid development

I tried Visual Studio 2010 C# edition and created a WPF Application.
Unfortunately, I found out afterwards that WPF is not supported by Mono, the free implementation of .NET for Linux/Mac.
So unfortunately, the "multi-plateform" point was not achieved.
However, all the other points have been reached, and in less than a day, from scratch, my first C# application was up and running:

What it does:
- Login to http://www.kingsofchaos.com (an old online MMORPG game not really popular anymore).
- Gives choice to scan a given number of battlefield pages from a given page.
- Show the results and allow to sort by columns.
- Open the stat page of a given player by double clicking on the row.

Download: KoC_Toolbox.zip

Let see in this post how we achieved that, and what are my first-thoughts about C# programming.

Usage of third-party tools that automate the game is forbidden by the Kings of Chaos rules.
Doing so can have your account banned so use at your own risk.
28Feb/120

Save your screenshots to a file in Python

Python allows you to quickly build useful applications.
Let say you're running the old Windows XP and need to take screenshots of your screen, directly saving the picture.
You might usually open Paint, paste, save (choosing the format you want to save as).
Well, fast enough, but could be improved isn't it?

The following piece of code grabs the image from the clipboard and directly prompts you where to save the file.
Depending on the filename you choose, it will automatically apply the correct compression (bmp/png/jpeg...) thanks to the Python Image Library (PIL).

In addition to the libraries bundled with Python you only need to install PIL, either from PIL or from PILLOW.

I personally chose pillow:

$ pypm install pillow
The following packages will be installed into "%APPDATA%\Python" (2.7):
 pillow-1.7.6
Hit: [pypm-free.activestate.com] pillow 1.7.6
Installing pillow-1.7.6
Fixing script %APPDATA%\Python\Scripts\pilconvert.py
Fixing script %APPDATA%\Python\Scripts\pildriver.py
Fixing script %APPDATA%\Python\Scripts\pilfile.py
Fixing script %APPDATA%\Python\Scripts\pilprint.py

You are now ready to run the script:

import os
from PIL import ImageGrab # from PIL or PILLOW
from Tkinter import Tk
from tkFileDialog import asksaveasfile
import tkMessageBox
import subprocess

if __name__=='__main__':
    
    # hide the Tk window
    root = Tk()
    root.withdraw()
    
    # grab the image from the clipboard
    myimage = ImageGrab.grabclipboard()
    
    # quit if it's not an image
    if myimage is None:
        msg = "The clipboard does not contain an image."
        tkMessageBox.showwarning("Error", msg)
        exit()
    
    # choose where to save the file
    fout = asksaveasfile(mode='w', defaultextension=".png")
    
    # quit if the user canceled saving the file
    if fout is None:
        exit()
    
    # finally, save the file (extension will dictate the compression)
    try:
        output = fout.name
        myimage.save(output)
    except Exception, e:
        msg = "Error: %s" % e
        tkMessageBox.showerror("Error", msg)
    else:
        filePath = os.path.abspath(output)
        #tkMessageBox.showinfo("Saved", filePath)
        subprocess.Popen(r'explorer /select,"'+filePath+'"')

To use it, simply hit the "Print Scrn" key and run the script.
Running the script is not that faster than starting Paint so you could create a shortcut to the desktop and create a Shortcut Key to the shortcut.

For example to set a shortcut to "Ctrl + Alt + P":

Now simply hit "Print Scrn", "Ctrl + Alt + P" and choose where to save the screenshot, that's it!

Filed under: IT, Programming No Comments
4Feb/120

Run Django from a VM and access it from the host

If you try to run Django development mode from a Virtual Machine and access the website from the host, you need to specify the global IP address in the "runserver" command.

For example if your VM IP address is 192.168.31.128 (in NAT mode):
IP_address_of_the_VM

You should run the server by calling (you can change the port):

python manage.py runserver 192.168.31.128:8000

Run_server_from_VM

Now you need to connect to the website specifying the IP address like that: http://192.168.31.128:8000.

Both from the VM:
Access_server_in_VM

And the Host:
Access_server_from_host

The server running on Linux is much faster than the one running on Windows :)
Filed under: IT, Linux, Programming No Comments
Page 1 sur 101234510Dernière page »