Categories

SmartDos - Adobe Air based DOS Console

I was trying my hands on the new NativeProcess API in Adobe Air 2 SDK. This API allows communication with system processes using the standard IO. I tried an example with a small java application that reads and write data to the console and it looked pretty promising. I realized, the best application that’s readily available in Windows for testing the STDIN and STDOUT is the good old DOS and this is how I started putting together this prototype in place that allows you to use all the dos commands like you would in a DOS Console and also have the features to format it, color/highlight it, save the console contents as a text file and add shortcuts other command/batch files.
This is particularly useful if you want to send a copy of the console to some one for debugging, highlighting specific areas.
This application also has the feature to add shortcuts to other DOS/batch files. So, you don’t have to clutter your desktop with shortcuts to different servers. You can create a shortcut to say a Tomcat server, OC4j etc right in the application and launch them.

Adobe Air based Dos console

This certainly is a quick prototype of the NativeProcess API but looks like has got scope for improvement and real use.

Download SmartDos

Current version: 0.1

* Air based Dos application

Current version: 0.2

* Bug fixes

* Auto update for the executable

innerHTML issue in IE

There are number of articles on internet that talk about the fix for the innerHTML issues in IE. some are

http://support.microsoft.com/kb/276228

http://domscripting.com/blog/display/99

None of these work when you try to insert javascript into the <script> tags. Thats because all these solutions talk about using a wrapper <div> for the content and it won’t work if you are trying to insert or modifiy the javascript inside the <script> tags.

The solution is instead of using ‘innerHTML’, use ‘text’ property.

var script = document.createElement('script');
script.type = 'text/javascript';
// IE doesn't support innerHTML, fails, and uses .text instead
try {
script.innerHTML = code;
} catch(e){
script.text = code;
}
document.getElementsByTagName('head')[0].appendChild(script);

Unclosed <P> before <form> breaks form submit in IE when using jQuery

If you are facing issues with form submits using jQuery in IE because of unclosed <P> tags.

Try this:

var form = $(document).find(“form”);

var frm = form.parent().html();

if(frm.toLowerCase().indexOf(‘form’) > -1 && frm.toLowerCase().indexOf(‘/form’) == -1) {
var frmTag = frm.substring(frm.toLowerCase().indexOf(‘<form’), frm.toLowerCase().indexOf(‘>’)+1);
var rest = frm.substring(frm.toLowerCase().indexOf(‘>’)+1);
form.parent().remove();
form.before(frmTag);
form.prepend(rest);
}

jQuery.append() Behaviour

jQuery.append() behaves a differently in different situations. It sometimes moves the contents from the DOM to the new location where it is appended and sometimes it clones it (keeping a copy of the dom element in its original location). I stumbled upon this when trying to fix an issue with <form> submit. The content I was appending had a form embedded and the append() method in this case was creating two copies of the <form> node (since, it decided to go with cloning and not moving). So, how does the append() method decide what to use. I found an interesting article here:

http://welcome.totheinter.net/2009/03/19/the-undocumented-life-of-jquerys-append/

However in my case, It was a bit different. Although, I was using a single node to append to, the append() method wasn’t moving the elements. I figured out that its not only depends on whether you are appending the elements to single node or multiple nodes, but also on how you are fetching the contents to be appended. I was using .html() to fetch all the content from the DOM and then using append to insert it elsewhere. This in all cases would create a clone and not move the content. Instead, use children() to fetch all contents and bingo!!! jQuery.append() moves all content from the source to the destination.

Time Tracking System (updated)

Filling up the timesheet never interested me and the thought of remembering what I did through out the day and putting time against each one of them was a pain. I always wished if there is an easier way to do it or in a way automate this redundant task. There are many tools available to track time but for some reason I always found them a bit complicated and time consuming.

So, I decided to develop an application to keep track of my time. Time Tracking System is a step towards that. This application can be your personal time tracker. Any task can be tracked by simply selecting it from the task list.

The application is developed using Adobe Air 2 Beta and uses SQLite database for storing timesheet information locally. This is a very early version and I am continuing to work on it. The UI also looks basic and I have done the best I can within the available time. Thanks to Praveen for helping me with some of the UI and usability stuff.

The current version has the following features:

  1. Create tasks.
  2. Create projects.
  3. Daily and weekly timesheet in a read-only mode.
  4. Minimize application to task bar.
  5. Detect idle/away time
  6. Auto-updates

Plans so far…

  1. Search functionality for task and projects.
  2. Allow exporting of timesheet information to excel format.
  3. Export data into an user defined format. This could facilitate importing of data into other systems.

and more…

But, it all depends on user feedback. so feel free to use it and post your comments.

Download Time Tracking System

Requirements: Adobe Air 2 Beta 1

(doesn’t work with Adobe Air 2 Beta 2 runtime as NativeProcess support seems to have broken in this update. I am trying to get a response from the Adobe team on this but I might have to wait for the next patch/beta release to fix this. The discussion thread is here: http://forums.adobe.com/thread/575431?tstart=0
update: A bug has been created in this respect: http://bugs.adobe.com/jira/browse/FB-25990)

Current version: 0.2.28

* Added auto update feature.

Current version: 0.2.35

* Bug fixes.

Current version: 0.2.48

* Added support for Automatic window tracking

* TTS is now in EXE format

* Requires Adobe Air 2 Beta 1