Lets Talk

R.java missing issue after ADT Rev 22.x update

We do a lot of Android development in RPOGmaatic. After the recent ADT 22.x update, all hell broke loose :(

Suddenly all our projects couldn’t generate the R file. All sorts of mysterious issues!

Apparently there have been significant changes in the way ADT handles the build. In ADT now there is a new component in the Tools folder called “Android SDK Build-tools” that needs to be installed as well.

adt_build_tool

Now its also possible, the build tools is listed as installed, it will not work. To resolve this, first quit the Eclipse (if its already running), start the Android SDK manager. Then uninstall the Android SDK Build-tools and install again. Start Eclipse and clean build your project again. You should see the R files being generated back again :)

Even after that, you might find some more errors regarding resource files.

Go into Project=>properties => Java build path= > Order and Export. Please make sure all your jars are checked.

android_libs

 

I hope these will resolve your issues with updated ADT.

Let me know if you have any new issues.

 

Nasty Apache, Nasty Error Detected in the Parent Process

At <a href=”http://progmaatic.com” title=”PROGmaatic Developer Network”>PROGmaatic</a>, we have several servers for different purposes. In one of our server, often during midnight (thats GMT+6) the Apache stops. I thought, OK may be it was due to load or something. Since it was not our production server, I wasn’t that much concerned.

Last month I moved an application to that server to off-load some processes from our main server. Now I started noticing the Apache downtime (which I should have fixed before :( ). So finally today I started digging into the mighty Apache error log and found the something interesting:
<!–more–>
<code>
[Fri May 03 11:34:33 2013] [notice] caught SIGTERM, shutting down
[Fri May 03 11:35:35 2013] [notice] seg fault or similar nasty error detected in the parent process
</code>

After doing some Google search (No wonder here :D), I found that if <em>Apachectl graceful</em> is issued, this error occurs. So I know how to reproduce the error :)

So I issued this command in console and checked the error log. Same error. Nothing new! But after giving <em>Apachectl restart</em> I noticed a warning in error log.
<code>
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20090626+lfs/idn.so’ – /usr/lib/php5/20090626+lfs/idn.so: cannot open shared object file: No such file or directory in Unknown on line 0
</code>
Voila! It seems php5-idn is not available. So I issued <em>apt-get install php5-idn</em>. Btw php5-idn is required to show international characters in DNS

Now issuing <em>Apachectl graceful</em> stopped giving seg fault :)

PHP Bijoy to Unicode Converter

In our latest project at PROGmaatic, we needed a converter to convert lots of information written in Bangla. Unfortunately  everything was in Bijoy (SutonnyMJ) font. But our requirement was Unicode formatted data and language preference was PHP.

 

I thought, no big deal. There should have been lots of converters available, and most of them might be in PHP. After hours of searching (Yes I don’t like coding when I can find something free :D).

Well, I haven’t found a single script which would do what I needed. Two of the following did help me to understand how to develop the converter:

So finally I end up coding one myself. Fork it from my Github account.

In the coding process I have learnt two valuable lessons :)

1. javascript string method ‘substring‘ is not equivalent to PHP’s string function ‘substr‘ [I spent only 5 hours for this mistake!!!]

2. Nothing is better than step-by-step Debugging!

 

Future modifications:

1. Make mbstring independent. (I actually figured out the way, but right now I don’t need it since I have mbstring support :))

2. Make memory efficient.

 

Check the code and let me know if you find a better way, find a bug or need some modification. I will be happy to make the changes and give you the credit :)

 

How to add scheduled task to run php scripts in Windows

Few days ago, for one of our PHP / MySQL project, we were needed to run two php scripts at every minute. We usually develop/deploy our projects in LAMP environment, where we use crontab for our scheduled tasks. But our client have wanted us to run the system in Windows. So we have chosen  XAMPP. To run our two php scripts every 1 & 2 minute, we thought of developing a simple tool for windows which would run at background and execute those two php scripts. Fortunately we have found about schtasks, a native scheduler in Windows to run scheduled task smoothly in command prompt.

1 of 6
123456