How does jQuery .data() work?

Have a look at the source for it. From a quick glimpse, it looks like it’s storing the data in that cache variable that is created on line 2. Edit: Here’s a quick demo that finds the data in the cache: http://jsfiddle.net/CnET9/ You can also dump $.cache to your console and explore it manually.

Scalable Image Storage

We have been using CouchDB for that, saving images as an “Attachment”. But after a year the multi-dozen GB CouchDB Database files turned out to be a headache. For example CouchDB replication still has issues if you use it with very large document sizes. So we just rewrote our software to use CouchDB for image … Read more

Expiration of sessionStorage

It lives and dies with your browser session and is not shared between tabs. It doesn’t expire automatically. So if you never close your browser it never expires. So when the tab/window is closed the data is lost. Each sessionstorage area is allowed 5MB of storage (in some browsers 10MB). Whereas cookies only allow 4kb … Read more

How can I easily add storage to a VirtualBox machine with XP installed?

I found this nugget at the link following. It worked perfect for me and only took 5 seconds. As of VirtualBox 4 they added support for expansion. VBoxManage modifyhd filename.vdi –resize 46080 That will resize a virtual disk image to 45GB. https://superuser.com/questions/172651/increasing-disk-space-on-virtualbox

What are MySQL database engines? [closed]

mysql> SHOW ENGINES; +————+———+—————————————————————-+————–+——+————+ | Engine | Support | Comment | Transactions | XA | Savepoints | +————+———+—————————————————————-+————–+——+————+ | InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | … Read more

Calculating usage of localStorage space

You may be able to get an approximate idea by using the JSON methods to turn the whole localStorage object to a JSON string: JSON.stringify(localStorage).length I don’t know how byte-accurate it would be, especially with the few bytes of added markup if you’re using additional objects – but I figure it’s better than thinking you’re … Read more

Calculating and saving space in PostgreSQL

“Column Tetris” Actually, you can do something, but this needs deeper understanding. The keyword is alignment padding. Every data type has specific alignment requirements. You can minimize space lost to padding between columns by ordering them favorably. The following (extreme) example would waste a lot of physical disk space: CREATE TABLE t ( e int2 … Read more

Android saving file to external storage

Use this function to save your bitmap in SD card private void SaveImage(Bitmap finalBitmap) { String root = Environment.getExternalStorageDirectory().toString(); File myDir = new File(root + “/saved_images”); if (!myDir.exists()) { myDir.mkdirs(); } Random generator = new Random(); int n = 10000; n = generator.nextInt(n); String fname = “Image-“+ n +”.jpg”; File file = new File (myDir, … Read more