Custom Wrapper Class for Dictionary component – Flex

I was developing a Flex module earlier yesterday and somehow felt the need of an efficient data structure for look-up purpose. Array and ArrayCollection are just not good enough and the default implementation of Dictionary as part of Flex API is a no-brainer. So, I decided to create a wrapper functionality similar to the Dictionary Class available in languages such as C# and Java (HashTable). This version of Dictionary is actually a hybrid between a set (uniqueness) and dictionary (fast lookups) based on my requirements.

So far, I have implemented the following functionality >>

  • insertKey(key : Object, value : Object)
  • getSize()
  • removeKey(key : Object)
  • clear()
  • containsKey(key : Object)
  • containsValue(value : Object)
  • toString()
  • getKeys()
  • getValues()

Source code is available here >> MyDictionary.as MDIllegalObjectException.as

(Replace the “.as_.txt” extension to “.as” before using the file)

Feel free to modify the source code and if any bugs are found, please do comment back to the post as it will be helpful to others.

A sample demo testing the MyDictionary Class can be seen here >> Test3.mxml

(Replace the “.mxml_.txt” extension to “.mxml” before using the file)

0  

That’s how you kill three fish with one bird

Kingfisher grabs 3!

Kingfisher grabs 3!

I believe this particular bird is the Robinhood among all the other Kingfishers out there 🙂 Photograph is astonishing and and the way Kingfishers fly inches above the water is amazing as well.

2  

Email Dispatcher using C#

A few days back, I worked on an Email dispatcher command-line application which had capabilities of zipping up reports and emailing the reports to the clients at an astonishingly fast speed of hundreds of reports per min (assuming each report has 150,000 records with min of 6 columns).

Here, I am implementing a similar application but with a smaller + different set of requirement which are as follows:

1) Perform robust regular-expression based pattern matching & error reporting capability

2) Handle passwords efficiently from command-line (will improve the method later)

3) Use efficient Object-oriented Design & Modular code

4) Program is specific to Gmail (smtp address and port number). One can change this set of values to handle other major email providers.

Files>>

1) Program.cs

2) User.cs

3) Constants.cs

(Replace the “.cs_.txt” extension to “.cs” before using the file)

0  

QuickSort Algorithm in Java

Was plying over the fastest in-place non-stable sorting algorithm >> non-randomized version of QuickSort (Never mind the O^2 worst case! :)) )

I have attached a java implementation of the same algorithm alongside.

QuickSortAlgo.java

(Replace the “.java_.txt” extension to “.java” before using the file)

0  

What’s this Dooogy upto!!

Dog using laptop

Dog using laptop

What an impressive doggy! I was wondering whether it is trying to impersonate me during my lazy weekends! xD

And the surprising thing is that the fluffy friend is actually using the Laptop Mouse Pad and trying to run some application from the Start menu! 🙂

LIFE IS GOOD!

0