Showing posts with label adobe air. Show all posts
Showing posts with label adobe air. Show all posts

Thursday, April 1, 2010

Flex Directory Compression

Here is an example for compression and decompression of files and directories using the DEFLATE compression algorithm. 

The structure I have created for the file structure in the compressed file is arbitrary.  for each file it describes the name and data witch is a byte array of the file content. Directories do not have a data attribute, but children that recursively describe files with in.  


Download the source code here

Download the example AIR application here

 
When running the example, drag and drop a file or directory into the upper box, this will catch the link and create a compressed version of the file in the application storage directory (i.e. /AppData/Roaming/Deflator/Local Store)

To extract the file back, click on the compressed file in the list and click the extract button. This will recreate the file or directory on your desktop.




Please note: that if the original file is still on the desktop when you extract, you will have an error. so if you deflated something from the desktop, make sure you rename it before you extract

Good luck.

Friday, March 5, 2010

Protect Your Passwords! A beta release

The past month I have spent time developing a little desktop application for safe guarding web account details. This application helps in maintaining a well organized database of secret account information and free text notes, in an ordered and easy to find manner.

What makes it so safe?

This application installs on your local desktop, so the information you type into it never leaves your computer. This application encrypts everything you put into it using a high, U.S. government approved standard called AES-128 (Advanced Encryption Standard). This application uses the password you provide as part of the encryption key ensuring no one else can breach the critical information you have, unless he has your password. It’s important to remember that nothing is 100% safe, but it helps not to be the easiest pray.

This beta release includes:
· An encrypted database, using AES-128
· Managing records for web accounts, mail accounts, software registration and general notes
· Managing categories for organizing the records (including custom categories)

The next release (not a beta) will include:
· File attachments (you will be able to drag in and out files and the system will encrypt/decrypt them accordingly)
· Backups (you would be able to have temporal backups and retrieve data in case the computer got corrupted, all backups are fully protected)
· Any cool feature I get from people using it (email me for special requests: giladmanor@yahoo.com)

Installing the Protect Your Passwords! application
The installation process is very simple; and it works for all major Operating systems (i.e. windows, Mac and Linux) just follow the instructions on the badge:

To intsall this application please follow these two steps
1. Install Adobe Air
2. Download and run Protect Your Password


Or download directly and run installation manually.

 After installing you will find the following icon on your desktop:
 
Double click it, to run the application. After consenting on the disclaimer, you will be asked to enter your master password in a screen shown in figure 1

1
Figure 1: Master Password Creation.

The master password is the one password you will need to remember from now on, and better not forget. The master password is used as the key for the encryption of the file containing all the vital data. This means that the encryption is unique to you. The master password registration screen requires you to enter a password of a certain minimum length. While typing your master password the password strength indicator will let you know who safe your password is.

Using the application
Once the master password is entered, the next time you open this application you will be asked to enter your master password in order to unlock the application, see figure 2.

2
Figure 2: the login screen

Failing to provide the correct password for over 4 times locks the application, as displayed in figure 3. The reason for this is to make life harder for hackers using automation software to try and guess your password.

3
Figure 3: a locked application, no further attempts are allowed until the application is restarted

Important note: If you forget your master password, there is no way to retrieve the data, not even me, since I will have to have the correct password to decrypt the database.

After logging in, the application dashboard is opened up, where you have shortcuts to all the important features of the application, as displayed in figure 4. 

4
Figure 4: the application dashboard

From the dashboard you can:
· Search for a protected record, the search is either by a search phrase or by category
· Create a new record
· Create your own categories, delete existing categories (deleting a category doesn’t delete the records that were related to it)
· Change your master password

Not yet in this version: the settings screen for advanced configuration

Searching for Records:
To find a record you are looking for, you may either click on the category it belongs to, or click the search records button. This will move you to the search screen displayed in figure 7.
The new record button will move you to the details screen for entering a new record, displayed in figure 6

The new category button will open up a popup for entering a label for a new category as shown in the following figure 5

5
Figure 5: creating a custom category

Removing an existing category envolves right clicking on the category you would like to remove and selecting “delete”.
Clicking the change master password button on the dashboard directs you to the master password screen as displayed in figure 1. Failing to complete this form will leave you with the previous password.
Creating a new record is done by the new record screen depicted in figure 6

6
Figure 6: creating a new record

The record form is structured from two input arias, once for standard details, as displayed in figure 6, and the other is for free text notes, which is accessible by clicking on the “Notes” bar in the bottom of the details screen.

Note that when entering a new account, the details form allows you to create a random password to use on the web account. Since you don’t have to remember the special password, it’s easier to have web accounts that are even more secure. Choose the length of password you would like to have and click on the “Generate” button to render a unique password.
For convenience, you can put the web address (URL) of the site for the web account. This is saved for later quick access but is not mandatory.
The tags have no significant use for now, but in later releases, I intend to have advanced searched and categorization according to these tags, so it might be useful to start tagging your information.
Exiting the application or this screen without clicking on the save button; will result in loss of the changes.

The search screen, as shown in figure 7 allows you to look for a particular record of information either by selecting a category, or by a search phase, or a combination of both.

7
Figure 7: the search screen

Once you found the record you were looking for, there are several functionality shortcuts you can access on the record display:
· Navigate to the web account site by clicking the label. This feature is available only if you entered a valid URL in the link filed on the details form, as shown in figure 6. If you left the field empty, then clicking on the label will open the record for editing
· Copy USER NAME to clipboard, this is available to you only if you put the user in the user field in the details form
· Copy PASSWORD to clipboard, this is available to you only if you put the user in the password field in the details form.
· The little x button is for deleting the record
· The little pencil button is for opening the record for editing

Clicking on any of the category icons on the side will automatically change the search result to include the selected category.
That’s it for now, please remember that I welcome any suggestion warmly, feel free to send your suggestions to my mail at: giladmanor@yahoo.com or by posting it as a response on this blog.

Friday, February 12, 2010

Flex AS3 Multi Treading Workaround

Its well known that the current versions of Flex (using either the flash or AIR players) do not provide support for multithreading. Everything you do is loaded on the same main thread that is running the GUI too.
This restriction means that if you have to do a dutiful task, the GUI actually stops responding to the user and  your app may even get the “Not Responding” label in the title bar while its off processing.
The way to bypass this issue is to follow two guidelines
  • Break down the big process in to smaller, manageable runs. this means that if you have a loop that each iteration is taxing, you would want to call that loop one iteration at a time.
  • Call the single iteration in a way that interlaces with the GUI refresh rate.
Here is a simple GUI component that you may place on your application, to invoke calls on some other process without hampering the responsiveness of the GUI.
The method you call by this component has to be in the nature of:
public function runFunction(data:Object):Boolean

Download zip file for AsyncThreadComponent

Usage:
Paste this on your app:
<view:AsyncThreadComponent id="asyncThread" />
When you want something to be invoked, create an object and pass the method:
asyncThread.exec(theObject.runFunction,theObject);

Independent on Sundays

Sunday, January 18, 2009

The white rabbit: bugs and suggestions

current version : beta 0.2 (download)

this is what i have so far in terms of open bugs and suggestions:

unresolved bugs:
  1. project and task tree collapses whenever changed
  2. session time counter display: when changing back from monthly to session, the clock keeps showing the monthly accumulation

suggestions:
  1. "coast plus" configuration for the reports; suggested by Roy Reshef. have a configuration for adding a fixed overhead on the hour report, that would express the standard extra expenses. this is useful for freelancers that need to overload extra coasts on the hourly report. this might be implemented as a conversion to monitory terms as well.
  2. add a scheduler for tasks; suggested by Tomer Ben Arie. embed a scheduler into the project and task tree, that would allow time planning for implementation
  3. go large in enterprise mode; suggested by Ori Manor. enable networking and task legation from one user to another.
  4. oops mechanism, for backtracking in case i forget to stop the clock.
  5. floating task; enable time measurement without first determining the ownership. this is a nice feature when you are presented with a problem that you cant decide where to frame it until well into the task.
  6. task list view; a simple list like view where the user may thrown in "todo" tasks, and categorize them later.

Saturday, January 17, 2009

Follow the white rabbit




A couple of months ago, two things happened; one was that I got a project for a report wizard to do in flex. The other was the need to report on the hours I spent on it.

Learning Flex was a very nice and exciting experience. The need for precise accounting of time spent on this project made me start a side task on my little white rabbit.

The white rabbit is a simple, stand-alone application that measures time spend on each task in a project. It’s not fully automated, and relays the user to start and stop the clock.

Nevertheless, it does help keep organized and it does generate a report.

Why is it called “The white rabbit”? Because of the character from Luis Carol’s Alice in wonderland, the white rabbit fellow that runs around complaining about time or the absence of it.

So here it is. A simple tool, very easy to use, fully persisted standalone application.

The application was written using the adobe flex3 builder, and the package is installable in all windows versions and Mac OS, as long as you have flash installed (get adobe air).

The application has three aspects to it:

· The task management tool, defines a tree of accounts, projects and tasks

· The activity measurement tool, double click a task, and it starts counting the time

· And the reporting tool, temporal reports in a PDF format, ready for submission


Projects and Task tree management:

I have assembled the task tree with three entities:

· An account: represents a customer. A billed entity that would be receiving the report.

· A project: an assignment with a particular scope, one may regard this is as a directory of tasks.

· A task: a single work particle. Could be regarded as anything actually.

The only restriction I’ve set into this task tree structure is that the root of any tree has to be an account.

Figure 1: the porjects management screen

































The items in the tree, regardless of their type all have the following properties:

· A title

· A description

· Status (open or closed)

· An hour estimation

· An hour restriction (fixed price tasks)

· A deadline

Note: No field is mandatory; it’s up to the user to define the data regarded as useful.

Changing a task status (open to close and vice versa) changes its availability in the activity measurement tool. However, after closing a branch, it is still possible to generate a report on it.

The data is persisted as long as the branch is not removed from the task tree.



Timer, the activity measurements

This part of the application has a very simple concept.

The same task tree is displayed but filtered to show only the open tasks. If an element is closed, all elements on the branch underneath it are restricted from this view even if some of them are still open. This is for providing a way to shut down an entire branch without tediously closing each element by itself.

Once the desired task is visible, double click to start timer.

Figure 2: the timer, double click an element on the tree, and the clock stats ticking



















While working on a task, the application will not allow shifting to another task until an explicit stop command is set on the open session.

This is done easily enough by clicking the big stop session button in the middle of the screen.

I have a distinct dislike to having too many windows open all at once on y desktop. I would like to continue the time measurement on a task without having the white rabbit application open. So it is, that the application will continue counting up the seconds and minutes even if you close the application window.

The only way to stop the time measurement session is by explicitly clicking on the stop session button.

At this case, I open up the white rabbit, and click the stop button, the moment the timer screen appears back.

A friend suggested an ‘oops’ scenario, when I might forget to close a session while I’m off for lunch or something like that. I liked that very much and probably add that for the next release.



Reporting

The reporting aspect is the same task tree GUI viewed in previous aspects. The tree includes accounts projects and tasks, and by double clicking one of them, a dialogue appears, for setting the reports parameters.

Figure 3: the report creator, generates a PDF file according to a given template


































In this dialogue, the user selects the following:

· A report template

· May edit the report title

· Define time scope of the report by start and end dates

· Set the time aggregation for the report (resolution per session, day, month or just the bottom line)

· Set the task aggregation (either an aggregation of all the branch under the selected element, or a detailed account of each task by itself)

Once these points are set, the save button triggered the report generator and a PDF document will appear on the desktop.

Figure 4: a PDF report. Nothing fancy yet.














Installation, configuration, bugs and suggestions


The beta version of the white rabbit available free, on this link

Before starting anything, make sure that the system has an installation of the adobe air player.

Download the package, and double click it to trigger the installation sequence.

This application should install without any problems on any windows desktop platform or Mac.

When the application opens up the first time, the screen you will fist see is of the task tree.

Ease your way into the settings tab to set your personal data that would be eventually embedded into the reports to generate by the system. There is no need to do these configurations to be able to start measuring time on tasks. The minimal settings required are a single account and a single task under that.

Please feel free to pour your heard and suggest anything that comes into mind. That goes without saying to any bug you find.

To send me bug information or suggestions, you might find it useful to pop open the bug sending screen. To do that, click open the help (the question mark at the top right of any screen) and there choose the “report a bug” link button.

Figure 5: reporting a bug



















It’s a resent addition, and not fancy at all, only one attachment can be handled at a time, and there is no indication that the attachment is there (yet).

I would never mind reading how wonderful the application is and how useful you find it.

Have a jolly one.