Flux RSS des billets

DotMG's joblog

Work hard at whatever you do! (Ecc. 9. 10a)
Publié le 17 Jan 2013, 7:10 am dans android

I planned to make a review of this android smartphone named Tecno T3. Tecno are chinese phones made for Africans. This last sentence describes how is it, low cost, low specs. And when it comes with 13 months warranty, I can almost safely think it is not as bad quality as many chinese products are.

Tecno T3 could be a good device, it has everything, but, its bottleneck is its memory: 175MB which leaves a bare 30MB, even less, for apps to use. To make things worse, it comes with so many bloatwares that I don't need and that consume this precious resource. Unfortunately, these bloatwares are installed as system apps and can't be removed or disabled. Each time I restart my phone, I have to manually force close these apps.

From the day one I purchased it, I searched everywhere for a way to remove these apps like Facebook, Twitter, GO keyboard... But Tecno T3, released in July 2012, could not be rooted with standard rooting tools like SuperOneClick.

Finally, someone found the solution, it's an app called Poot, which then install Ministro II. It should be run and then it tries to root the phone. It doesn't always succeed, and at each failure, I had to reboot the phone and try again.
After one factory reset and about hundreds of reboots, I finally had my phone rooted. I then removed all the bloatwares and have installed only the apps I like. I even replaced the original launcher with a more lightweight and low memory footprint one, named Lightning launcher.

I said I planned to make a review of this smartphone, and the review I intended to make was rather negative, but once it is rooted, I changed my mind.

Publié le 21 Oct 2012, 1:04 pm dans iseries
When compiling a RPGIV program, I found a lot of errors, caused by one fact: RNF2120 on one file XXXX
fXXXXXXXX  if   e           k disk
When I check the file XXXXXXXX, it exists and in one of my library list. And it is not in QTEMP. So, why does the compiler issuing a RNF2120. After many tries and retries, I've issued a DSPFFD on the file to see if there was anything abnormal with the file creation. And Bingo! DSPFFD failed. It was because I created the file in SQLRPG PGM which was NOT compiled with COMMIT = *NONE, so the file exists but in a zombie state, waiting for a COMMIT or a ROLLBACK. So, I signed off, modified my SQLRPG program which creates the file by adding
recompiled and re-created the file and problem solved.
Publié le 9 Oct 2012, 2:40 am dans jQuery

I'm rather bad at jQuery. I had a philosophy of avoiding technologies and funny stuffs that could alter accessibility. No java applets, no flash, and very few javascript codes. But with jQuery, portability of javascript codes is getting better, and nowadays, few people have javascript disabled on desktop ... On a mobile device, it's another story.

So, it took me more than 30 minutes to find out how to retrieve the innerText of a clicked element inside a .click(). Sometimes, the problem with javascript debugging is that almost everything is an object, and when you alert($k); to see what it is, you'll only know that it's an object. My fault is that I didn't read the documentation enough to know how to access the clicked object.

$('.myquery a').click(eventObj) {
 var clicked_object = $(this);
Publié le 5 Oct 2012, 6:52 am dans iseries

We needed to cleanup the iSeries, by removing all the unnecessary files. It seems to be always a good game to go haunting for large files. For me, going the IFS way was a discovery. The simple command below did all the job.

qsh cmd('find / -size +200000 -ls >/home/bigfiles.txt;')

Those familiar with Linux recognize here the find command. A subtle difference is in the number +200000, for the find command on QShell, you multiply this number by 512 to get the number of maximum bytes. Here, I'm looking for files having a size bigger than 200.000 * 512 ~ about 100MB. And it lists every file on IFS that has a size bigger than 100MB, but also every member of any physical file having a size greater than 100MB.

This takes an eternity to complete. PGM-FIND eats up to 20% UC, most of the time about 7% and for my case, this was not a real issue.

Publié le 4 Oct 2012, 8:15 am dans apache, php

This is the second part of the story about this site in all plain html that needed some revamp. Yesterday, I talked about installing PunBB as a forum, and today, I'll talk about a quick templating.

I think the webmaster used tools like Dreamweaver to build the site. My friend asked me to move one image in the footer of the page. That image was inside a <table>, moving it for one page was not a PITA, but repeating the steps for all .html files would really suck. Other options would be to create a script to do this automatically, or restart from scratch with a templated system. Finally, I found a dirty quirk to do the job, and without changing any file present in the site. It's really simple, I redirect all URL in .html into a script mytemplate.php, passing the filename as a parameter, and do everything in mytemplate.php.

.htaccess to perform the redirection:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^([^/]*).html$ mytemplate.php?page=$1 [L]
RewriteRule ^/?$ mytemplate.php?page=index

Second step is to copy index.html into mytemplate.php. I stripped all content, leaving only what would be in a template, ie: <head>, header, footer and sidebar part of <body> tag. mytemplate.php is now my template for all .html file. What I removed was replaced with some simple PHP instructions which load the content of the page :

if (preg_match('![/\\:]!', $_GET['page'])) return;
$k = file_get_contents($_GET['page'].'.html');
$k = preg_replace('/^.*<!-- end of menu -->/sm', '', $k);
$k = preg_replace('!^\s*<!--start of footer -->.*$!sm', '', $k);
echo $k;
The first instruction is a security measure, just in case someone tries to exploit this template with URL like /mytemplate.php?page=/etc/passwd (although the 2nd line allows only .html file to be read). The second line loads the .html file. The 3rd and 4th lines strip headers and footers, because they are now provided by the template mytemplate.php. Looking for the pattern was the hardest thing to do, but if some of the html files missed these pattern, I could add them manually. And that's it. For any change I need to do, I have to play with mytemplate.php only. The other good surprise is that I can mask all the changes I've made just by disabling the rewriting in .htaccess.
Pages: 1 2 3 4 5