Create your own basic In-Memory Cache

In one of my recent projects, there was a requirement to cache data for a stipulated period of time (say 3 minutes) in order to prevent frequent database look-ups. Obviously, improving the efficiency of the system was also another requirement. 😉

Via illustrations as shown below, I have made a basic flowchart about the different steps/events which might be encountered while developing a low-cost, inexpensive, custom, in-memory & timestamp-based cache mechanism. Various different Data structures can also be utilized as per the requirement.

The second conditional expression can be as follows:
if(((new Date()).time – timeStampObj[Identifier]) < 180001)    //ACTIONSCRIPT
……………… and so on

This is because
1) ‘time’ property of Date class returns back the current time in milliseconds (since 1st Jan, 1970)
2) timeStampObj Dictionary stores data as <Identifier, time in milliseconds>
3) Since the stipulated time-period is 3 min (180,000 milliseconds), it is logical to check “less than 180001” condition

In-memory Cache

In-memory Cache

0  

Think twice before cheating on that online test! ;)

Think twice before cheating on that online test

Think twice before cheating on that online test

This was really really interesting!

I have heard of a program called LockdownBrowser, which includes a monitoring tool capable of reporting all the other programs running on the computer or being utilized by the User simultaneously.

It isn’t just a web browser but a combination of programs and is similar to the “Warden” application used by World of Warcraft to make sure you aren’t tampering with memory to cheat the game. 😛

0  

Oh man, those were the days I miss most…

Quake 2

Quake 2


Quake series of games were simply amazing.
I miss this game (Quake 2) so much. The additional set of movement skills with hopping, conc jumping, rocket jumping, etc. adding a whole other layer to the game that kept me coming back. Before Quake, Doom and its clones ruled the FPS. But, it never truly felt 3D.

Quake came out and blew our minds. There were polygons! And monsters that weren’t sprites! Oh my!  Then, there was the multiplayer. It was more fun than Doom’s. Some servers had mods and CTF modes! It was team-based dynamics, in blazing polygons!. The next logical step was counter-strike, and now the plethora of shooters we have now.
Note that this is completely general, and probably not all that accurate, but there is a whole history of great games and culture that’s been built on.
Thanks to STEAM as I was able to purchase ALL the legendary games (Quake, Hexen, Doom) developed by ID software in one single package! :))
0  

Custom Wrapper Class for Dictionary component – Flex {UPDATED}

Added some new functionality and plugged possible bugs.

New functions incorporated:

  • function insertKeyValue(keyValueCombo:Object):void >>Argument passed in is used as both Key and Value
  • function insertArray(arr:Array):void >>Takes an Array object as argument and inserts each Array element in the MyDictionary Object
  • function clone():MyDictionary >>Performs a deep copy
  • function getValue(key : Object):Object >>Returns the corresponding value for the given key

Modified:

  • function getValues(asArray:Boolean=true):Object >>Can handle either Array or ArrayCollection argument depending on the boolean value passed
  • function getKeys(asArray:Boolean=true):Object >>Can handle either Array or ArrayCollection argument depending on the boolean value passed

Source File: 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.

0  

Error 1 error LNK1168: cannot open for writing

I was writing a simple C program to print “HelloWorld” while using the new improved Visual Studio 2010. Program compiled fine on the first run but I started to get a weird linking error (see title of post) on recompiling later on.

I singled out the problem to a service in Windows 7. Earlier in the week, I disabled a bunch of (unnecessary) Windows service processes to speed up my OS and happened to disable “Application Experience” service as well.

Enabling the service has solved the issue completely. The reason is because Application Experience service is used to process application compatibility cache requests for applications as they are launched.

18