Samstag, 2. Juni 2012

Impressions on Dagi P507 capacitive touchscreen stylus

Hello folks!

I recently ordered the Dagi P507 capacitive touchscreen stylus as a consequence of an article I read in the German computer magazine There it was presented as a very convincing product with a completely new concept, and since I own a tablet, I hoped to be able to use it for drawing.

A nice demo video, though rather a commercial, can be found on Youtube:


I bought the stylus at Brando's (<<LINK>>) for only 23 US$ including shipping fees and had to wait 50 days, although they estimated 20 days at most. Maybe the German customs didn't know whether to charge me additional taxes or not. But now I finally have it and I can share my experiences so far.

The stylus comes in a small paper box and with a plastic cap [B] (I don't know what it is used for as of now), a second metal spring [A] and several new tip stickers [C] included.
How the stylus was delivered (at least similar)


The spring can easily be overseen in my opinion, so be careful when throwing the packaging away.

<<My opinion>>:
The pen is a real enhancement in terms of precision on capacitive touchscreens. Even with the free version of AutoCAD's Sketchbook (express) you feel quickly like a "real artist" and at all places it saves you nerves by minimizing the number of misclicks.

The pen has a high build-quality and is as heavy as a full-metal pen. I didn't like the looseness of the cap when putting it on the backend of the pen when writing though. For me the length is still ok, but for others the pen might be too short.

I cannot say, whether or not and how often the tip stickers have to be changed, so far it doesn't seem necessary in any way.


The smoothness of the pen gliding over the screen depends. On my tablet it feels sometimes a bit scratchy, but probably because of the dirt it accumulates from time to time. On my sellphone, it feels very smooth. I think that by extending the spring a bit, you will even feel more like you write on paper because of the extended resistance - feeling just like pushing a pen into soft cardboard.

Of course there remains the problem with your hand heels. When writing a longer text or after some minutes of continuous drawing, you will feel the want to lay down your hand on the rest of the screen. I haven't met any good software trying to recognize and ignoring that so far, but I admit I haven't really looked for it. I don't even know whether this kind of filtering is technically possible or not, but I guess there exist only few non-paid solutions (on Android).

Dagi P507 in action


All in all, the pen is definitely worth its money and it is fun to use, but somehow it is not a perfect solution. Capacitive touchscreens are in fact not very precise, so everything will have to stay finger-friendly which minimizes the use of the stylus, and professionals who want real precision, pressure recognition etc. will buy other equipment. Remaining applications are taking notes on your tablet (but don't forget to keep your hand heels up), presenting on your mobile devices and maybe feel a bit nostalgic over the old PDAs.

I hope you got an impression on this product,
see you soon

suluke

Dienstag, 22. Mai 2012

Show a preview of your latest blogspot post on your external domain homepage

Hello readers!


During my internship I was given the task to find out on how to realize a small preview of the newest post from a blog here on blogspot. The problem was, that the previews should be integrated into a website owned by our client which was hosted by a different provider on a different domain, and that they should always keep up to date without any modifications. Additionally, my boss preferred to have the preview generated on client side, because it means less traffic and probably less trouble when integrating it into the rest of the framework-based project. In plain words, I was supposed to use Javascript.

So I searched the internet for multiple keyword combinations but did not find any solutions of someone who did that before. So I had to come up with a solution myself.

I believe there are three possible approaches for that:
The worst should be to go via the blog homepage, because then the desired information would either be mixed up with all sort of additional markup or completely hidden in other js-scripts.

The second approach is probably the most elegant one, but not completely simple to realize: If I tried to receive the data by pulling it from the blog's atom/rss feed I would have my information in a relatively good structure and Google would probably not set a limit to the number of accesses per day. Unfortunately though, plain javascript does not provide tools to parse the xml-alike feed output and I did not want to mess with an external library or parse the feed myself, which is probably still relatively easy with regular expression matches.

But I went the third way, which is probably the first one that came to your mind: Via the blogger api.
The api is currently under construction (heading for version 2) and the registration process takes some time to complete. You have to register/create a new api-Project on https://code.google.com/apis/console/ and apply for the permission to use the blogger api in it. The response e-mail took about twelve hours during the two times I tried it, which is the reason why I even think that there is only one Google employee who manually admits the usage of the api for your project.

Afterwards you simply do what the blogger-team wrote in their answer and you get access to the API-key, which is used by Google to keep track of your usage. I believe, the standard daily quota is about 1000 and I hope, it is counted by IPs and not by API-calls. Otherwise the permitted accesses would be exhausted quite rapidly.

Here is the code of my blogger.js file that generates the preview:
 /**  
  * Version: 2012/05/23 rev.1  
  *   
  * This script obtains information from the first post of a blogger-blog   
  * (in particular title + first image) and injects it into a specific  
  * place in the webpage.  
  *   
  * Currently, the information is written into an element (<div>) with the  
  * ID "blogger_output"  
  *   
  * To be able to style the information via css, the following classes are given to it:  
  * post title (p-tag): blogger_title  
  * post image (img-tag): blogger_image  
  */  
   
 function Blogger() {  
    Blogger.init();  
 }  
   
 Blogger.htmlOut = "blogger_output"; //The html-element, in which the blog-preview is to be written  
 Blogger.gAPI_URL = "https://www.googleapis.com/blogger/v2/blogs/"; //the blogger api base-url  
 Blogger.blogID = "9034413279324519603"; //The id of the blog whose latest post we want to generate a preview from  
 Blogger.apiKey = "AIzaSyCYuAlcd4NzcvTB2Igp7b2Tuuak_mLfcfk"; //The api-key to access the blogger-api  
   
 /**  
  * Writes a new line of (html-) text into the output element specified above  
  * @param text Some text to be written into the htmlOut element  
  */  
 Blogger.echo = function(text, writeInID) {  
    document.getElementById(writeInID).innerHTML += text;  
 };  
   
 /**  
  * Dynamically injects a script to the end of the body of the page  
  * @param jsname the url or name of the script to be injected  
  */  
 Blogger.injectScript = function (jsname) {  
    var scr = document.createElement('script');  
    scr.setAttribute('type','text/javascript');  
    scr.setAttribute('src',jsname);  
      
    var body = document.getElementsByTagName('body')[0];  
    body.appendChild(scr);  
 };  
   
 /**  
  * This is the callback method of the first blogger api call. Currently it does all  
  * the work (get title, image(s), preview text...), but at a later point we hope  
  * the blogger REST-api will support at least images as an additional resource type.   
  * In this case it is easy to add a second callback method correponding to the image[s]  
  * of the first post only.  
  * @param response The response of the google server after our api call  
  */  
 Blogger.handleBlog = function(response) {  
    //extract image url  
    var imgTag = response.items[0].content.match('(\\u003cimg.*?(/\\u003e))')[0];  
    var imgUrl = imgTag.match('http:.*?(?=\")');  
      
    //output  
    var aName = "blogger_link";  
    this.echo('<a id="' + aName + '" class="' + aName + '" href="' + response.items[0].url + '"></a>', this.htmlOut);  
    this.echo('<p class="blogger_title">' + response.items[0].title + '</p>', aName);  
      
    //Maybe a post has no image  
    //TODO: In this case, other information from the post could be shown  
    if(imgUrl != null) {  
       this.echo('<img class="blogger_image" alt="" src="' + imgUrl + '"/>', aName);  
    }  
    this.echo('</a>');  
 };  
   
 /**  
  * The first method of the script.  
  */  
 Blogger.init = function() {  
    //Inject script to obtain blog-data from google/blogger  
    var callback = 'Blogger.handleBlog';  
    var jsname = this.gAPI_URL + this.blogID + '/posts?callback=' + callback + '&key=' + this.apiKey;  
    this.injectScript(jsname);  
    return;  
 };  
   
   
 Blogger();  

Of course, you have to replace the values of the variablesapiKey and blogID with your personal data.

There are two techniques used here that may require explanation for beginners:
First, the data is received in JSON format via JSON with Padding (JSONP). You will easily find guides on this by using the internet.
And secondly there is the dynamic javascript injection in injectScript, which I borrowed from http://javascript.about.com/library/bladdjs.htm.

Additionally, there are a few things that I wanted to comment on here:
First thing is: please don't forget that I am an intern and this is actually my first try in anything javascript related. This is my first attempt of a pure js version.

You can also find a version of this script as a jquery-plugin under http://dl.dropbox.com/u/19826318/Blogger/bloggerJQP.js
In this case, only jquery has to be loaded, followed by the script call.

Secondly, you might have seen some passages in the code which refer to the current status of the blogger api. I really hope, there will be some improvement there as far as resource types are concerned. At least, the developer in charge has already received and approved a feature request upon this.

The code is well documented I hope, and there are classes/IDs given to the output later on which allow easy CSS-styling.

Used in a website, the html might look like the following:
1:  <html>  
2:   <head>  
3:    <title>JavaScript-Test</title>  
4:   </head>  
5:   <body>  
6:    <div id='blogger_output'><p>Neues aus meinem Blog:</p></div>  
7:    <script src="blogger.js" type="text/javascript"></script>  
8:   </body>  
9:  </html>  
...where the <div>-tag's id "blogger_output" is required for the script to be able to write the content into.

Result: 
Title and image of the post, all linking to the original post-url
Title and image of the post, all linking to the original post-url

I hope, this might be useful for some web-developer or intern out there. Please leave a comment if you liked it or if you have suggestions on how to improve this:)

See you soon,
suluke







Helpful links:
Getting started of the blogger JSON api 2.0
Code formatter for blogger

Dienstag, 8. Mai 2012

Why b43 driver does not load, even though brcmsmac is blacklisted

Hello world!
For some time now, I am trying to switch from my Microsoft Windows installation to a Linux one, Fedora 17beta to be precise. I am progressing very fast, but here and there it takes some time to get some things working for which you had a tool on Windows that doesn't exist on linux and which is too sophisticated for wine.


The hardest issue so far was the following:
In Windows 7HP it is fairly easy to turn your laptop's wireless card into a hotspot and thus sharing its ethernet connection with some other devices, in my case my smartphone and tablet. This is somehow important to me, because my room is simply too remote from our usual router, and my devices running android's apps have to be updated regularly. For the task of turning my notebook into a hotspot there exist several tools, simply go to www.alternativeto.net and pick the one you like best. I personally got along best with Virtual Router, since it is open source, free, and somehow light-weight. I can also recommend Virtual Wifi Router Version 2, it doesn't even require an installation, but somehow there are some graphical glitches.


Ok, let's get back to the original topic. Under Linux, those tools do NOT exist, there is only one software package that I could find that provides this feature, but of course not with a nice graphical UI. It is called "hostapd". For more advanced users it should be easy to get it running and there are a lot of guides covering how to get it to work with different dhcp servers etc.


BUT that is not the initial problem. Wireless in Linux is a world for itself, and especially the drivers and their features vary like animals in a zoo. Hostapd needs special drivers complying with the new mac80211 stack, which provides host-mode functionality. My notebook includes a broadcom card called BCM43225, and the only driver that promised to have this feature was b43, only working with my card since kernel 3.2.


So I initiated everything - I installed the firmwarecutter (b43-fwcutter), blacklisted the originally used driver brcmsmac and since it did not work from the beginning (of course) I even posted stupid questions into a forum. Finally I decided to compile my own kernel, completely stripped of brcmsmac, which I assumed to be interfering with b43. And then --- boom! I stumbled upon this option in the kernel configuration tool
Wireless LAN --> Broadcom43xx wireless support --> Hardware support that overlaps with the brcmsmac driver
Screenshot of xconfig












I hope you see, what the point is. It is possible to disable b43's support for all cards that can be used with brcmsmac, and the developers of Fedora promptly used this "feature". But why would you do that??? I mean, read <<<HERE>>> and you will get the impression that the kernel hackers themself are more convinced with their own work than with the new driver programmed by Broadcom. Is it really so complicated to filter drivers so that only one is used at a time for the same hardware that you have to hardcode limitations into overlapping drivers?


I spent hours on searching the web for someone maybe having the same problem. "Why does b43 not feel responsible for BCM43225", "why doesn't it load automatically?" etc. The answer is: The distributors (I'm sure Ubuntu does the same) couldn't imagine someone wanting to have more features in the driver. Ok, I might be a bit demanding - for a product that I use for free and that is so great. Dear Linux community, you are awesome. And I have to apologize if I sound  reproaching. In the end it is Broadcom's fault, since they didn't cooperate and still do not add all the features to their drivers. Please consider this article as constructive criticism.


I hope that if there is someone out there that wants to do something similar will find this post so that he doesn't have to waste so much time.


Yours sincerly,
suluke

Mittwoch, 25. April 2012

Rooting HTC Legend with Firmware 3.15, HBoot 1.001 and flashing CM9

Hello to the world out there,
today's post will be kind of obsolete from the beginning, but since I had so much trouble achieving what I wanted, I decided to share my experiences.

My sister has an HTC Legend, which is a beautiful phone in my opinion. And the fact that it survived her lifestyle for almost two years now with the only exception of one battery due to it having been dropped into water and a lost battery cover speaks clearly for it. Unfortunately though, the hardware is outdated from today's point of view.

When my sister asked me to help her installing a game called "temple run", whose installation failed on FroYo, I decided to help my sister getting even more out of the Legend, which means rooting and flashing a nice custom rom. As the title says, her stock rom didn't have the best prerequisites for rooting with
Firmware 3.15, Android 2.2 (FroYo)
HBoot 1.001, which cannot be s-offed, thus meaning that /system and /recovery will always be write-protected except from within recovery
and seemingly a branding from her provider, meaning that I had to have a goldcard inserted for everything

Ok, my major problem was downgrading to firmware 1.31, Android 2.1 (Eclair), I followed all the guides in >>here<<, which caused me to face the first Problem, namely that VISIONary wouldn't be successful, thus not resulting in a temp root. Another hard reset solved that, but any other tool doing the job (like super oneclick) should also do the job. The RUU failed several times with error 171 (waiting for bootloader too long) while the Legend was stuck at a black screen with some HTC update logo. The solution for that was finally to manually boot into bootloader (taking out battery and restarting with Power and Back button pressed simultaneously) and running the RUU again.

With the still not rooted Legend on firmware 1.31 I then tried to follow >>this<< guide from within my Win7-x64 installation, which also caused problems, so I had to switch to my Linux installation. By the way, I also tried it on WinXP in VirtualBox, but since VirtualBox did not not auto-reconnect the device after reboots, I didn't succeed here, too. VMWare does probably do this better.

I'm a little ashamed for having had the next problem, but maybe I am not the only one who simply couldn't imagine to use the trackball in the custom recovery popping up next after step1. Just so you know: it is being done this way and this will be the recovery from which you can install every custom rom in the future. The only disadvantage is that you always have to start it using a script on your PC, so a cable connection is required. But while researching the forums at XDA I think I saw that there are other ways to start recovery ("fake flash") and there are even CWM recoveries available for us with s-on devices. Additionally I can tell you, that I didn't have to switch the micro-SD to a non-goldcard one, maybe it is not mandatory and the guys from the guide just wanted to prevent that someone loses its "goldcardness" by writing the rootedupdate.zip on it. As far as I know, it has nothing to do with the necessity to have a goldcard inserted when flashing roms in the future. Once a device is branded, you will always need a goldcard to install another rom.

Well, after that all worked, I headed to the XDA-Developers and found this awesome new CM9-Rom for the HTC Legend: http://forum.xda-developers.com/showthread.php?t=1562595
As you can see in the video, it runs in a very acceptable speed, but I still did the following to improve the performance:
    [Settings-> System Performance]
    I set the maximum speed to 787MHz &the governor to "SmartAss2"
    I disabled tile rendering and enabled 16bit transparency
    [Settings-> Developer Settings]
    I activated "force 2D hardware acceleration"
    (I don't think they are exactly called and labeled like this, but you can hopefully figure out what I mean)
As a result I believe that even the fade-in animation of the app-drawer isn't laggy any more.

Of course, I also had to mess with the boot-loops after installing g-apps, but luckily the solution for that is already linked to in the OP of the rom [here].

So, in the end all this was actually "simple" if I had known everything I know now before. Next thing is maybe to figure out how to get the app working for my sister. This time installation doesn't fail from the beginning, but instead the app crashes right after opening it. Logcat showed me some exceptions that occur while  trying to load some mono library which cannot be found. So I'm afraid that it will probably be impossible for me to solve that:(

Good bye for now, you see I have things to be done
yours suluke


Donnerstag, 12. April 2012

Billiges Netzteil für Asus Transformer TF101

DISCLAIMER: Ich übernehme keine Haftung für etwaige Schäden an Geräten, die aufgrund dieses Erfahrungsberichts entstanden sind. Es handelt sich hierbei nur um die Schilderungen und Empfehlungen auf Basis meiner eigenen Erfahrungen.

Auf den XDA-Developers wurde schon lange festgestellt, dass sich der Transformer mit allen erdenklichen USB-Netzteilen laden lässt, die mindestens 11Volt, 1Ampere liefern (LINK).
Das ist in sofern von höherer Bedeutung, da das mitgelieferte USB-Netzteil bei vielen Leuten mehr oder wenig häufig aus zwei verschiedenen Gründen "zickt", also seinen Dienst nicht ordnungsgemäß verrichtet.

Der erste ist, dass der Aufstecker, der das universelle Netzteil mit unserer "national spezifischen" europäischen Steckdose verbindet, nicht richtig auf den Kontakten sitzt. Hier kann also schon leichtes zurechtbiegen helfen.

Als zweiter Grund kann der Defekt aber auch auf Überhitzung des Ladegeräts zurückzuführen sein. Das ist dann schon gravierender, aber auch hierfür gibt es einen Fix - eine Nacht in der Tiefkühltruhe hat mir zum Beispiel geholfen. (LINK)

Was ist aber, wenn das Netzteil wirklich mal hin ist? Man wird sehr unsicher, wenn man die Sache wie ich schon mal miterlebt hat. Jeder Ladevorgang über Nacht könnte der letzte sein, sagt einem das Gefühl. Der offizielle Ersatz kostet hierzulande ganze 40€. Viel zu viel, wenn man es nur zur Sicherheit dazu bestellen möchte. Einsenden des Netzteils ist für mich jedenfalls keine Option, zu lange müsste ich auf mein Tablet verzichten.

Also habe ich es mal mit dem Goobay Schaltnetzteil 1000mA bei Amazon probiert. Es bietet eine USB-Buchsen-Aufsatz inklusive, und siehe da, es funktioniert tatsächlich. Vielleicht kann man sagen, es verrichte seinen Dienst nicht unbedingt schnell (23% innerhallb von 40 Minuten, die 1500mA-Version könnte da helfen), aber immerhin. Zusätzlich verlängert es die Kabelreichweite enorm (siehe Fotos) und die Kosten belaufen sich derzeit auf nur etwa 7,30€, teilweise mit kostenlosem Versand. Alles was man dafür tun muss, ist den Regler am Netzteil auf 12V zu stellen.


Was aber auf jeden Fall noch zu beachten ist, ist dass man NIEMALS andere USB-Geräte anschließt, solange der Regler auf Werten über 5V steht. Die Stromversorgung in USB ist nur auf 5V spezifiziert und das erwarten die meisten Geräte dann auch, mit höheren Werten riskiert man einen Geräteschaden. Das originale Netzteil des Transformers bietet hier lediglich eine komfortable Erweiterung, denn es "fragt" die Geräte quasi, ob es sich um ein TF handelt, wonach es 12V ausspuckt, oder nicht, wodurch es auf 5V-Betrieb stellt. Das Goobay-Netzteil bietet diesen Komfort NICHT.

Ich hoffe, ich konnte eventuell einigen beim Sparen helfen oder ruhigere Nächte verschaffen.

Liebe Grüße, euer suluke

Mittwoch, 8. Februar 2012

Fibonacci in batch

Here a simple programm showing some of the power of batch, just so you get an impression why I think it is a good start to learn how to program:
Fibonacci.bat
1 :: This script prints out all Fibonacci-numbers up
2 :: to a position defined by the user
3 :: Version 1.0
4 :: Date: 2012/01/26
5 :: Author: Lukas Boehm
6 @echo off
7
8 :: Section that asks the user to enter a VALID
9 :: position in the fibonacci-sequence
10 setlocal
11 :input
12 set /p POS=Bitte geben Sie die gewuenschte Stelle in der Folge ein
13 set /a NUM=%POS% + 0
14 echo.
15 if %NUM% neq %POS% (
16 echo Fehler: keine gueltige Zahl!
17 goto input
18 )
19 endlocal & set POS=%POS%
20
21 :: Section that calculates and prints out
22 :: the fibonacci numbers
23 setlocal EnableDelayedExpansion
24 set LAST=0
25 set CURRENT=1
26
27 FOR /L %%N IN (1, 1, %POS%) DO (
28 set SWAP=!CURRENT!
29 set /A CURRENT +=!LAST!
30 echo !LAST!
31 set LAST=!SWAP!
32 )
33 endlocal
34
35 :EOF
36 PAUSE

Sonntag, 22. Januar 2012

Initial commit - the "succeed first - develop interest - learn on-the-fly"-approach


Hello there!
I am a self-taught programmer from Germany and really love programming. It gives me some feeling comparable to the one a gardener has when he has worked a lot on his plants and finally he can harvest the results of his work. The only difference is that I don't need to be on the field all day and everything happens much faster than waiting for plants to grow. Besides, the work rather challenges your brain than your muscles.

The benefit of the ability to code a bit are quite obvious, so I often feel the desire to share my skills and help others with them. But teaching programming on the fly is definitely not as easy as some might think. First of all, your apprentice must be willing to spend some time at least. Second, you will have to have a master plan on how you want to progress. I have made the experience that just because I started with learning java, this is not a good way to start with newbies who expect to be given a gentle introduction. Already setting up jdk with environment variables, and maybe eclipse and so on is far too much for the first day. And the first day is decisive for the first impression of the learner and whether he believes that he will be able to learn it or not. Therefore I believe a person who wants to become a part-time programmer has to start with the means that are already installed on his machine. But which means ARE installed on his machine?

Well, many pc-users out there are using M$ windoze. Unfortunately though, this os does not come along with any compilers or anything similar, so everytime I want to simply type in a "hello world" to deliver quick success to my prentice, the only possibility to do this is to use one of the two scripting interfaces windows features, namely batch and visual basic script (and maybe html, but I don't know whether this is a good idea to start with. I mean, maybe this will make our friend who wants to learn programming a bit confused since usually noobs cannot imagine that IE does something locally. In addition, ui/graphics programming is a far step further down the road. If you really want to program on hardware level, fency graphics will only prevent you from getting lower to the system. But I will keep this in mind for the next time)

Batch is fairly easy to get started with since there is so little to learn and everything seems to be kind of self-explanatory. But on the other hand batch is very limited. I would even say, it is very VERY limited. Already when you come to arithmetics, you will see that it is originally designed to perform some file system tasks, since you will need the switch "/a" in front of every mathematic assignment. And it is nothing that can be compared to any other modern programming language. You have no code blocks, no functions, no types, and you have GOTO. Except that, batch will serve perfectly well to introduce an absolute beginner to the main idea behind programming:
Tell the computer what you want within a limited set of commands and never expect him to do anything intelligent on his own.

To conclude, using batch has the advantages that it works out of the box and features almost everything you will want to do in the first coding lessons. That is hello world, importance of commenting and some simple calculation etc. without the trouble of compiling or installing interpreters.
Critics will say, that batch has nothing to do with programming (and I will agree with them) and will damage the style of the later programmer (and here I will disagree. In my opinion only the one who knows ugliness is able to become aestheticist ;-)

So far so good, that was my first blog post.
See you soon