Android create folders in Internal Memory

I used this to create folder/file in internal memory : File mydir = context.getDir(“mydir”, Context.MODE_PRIVATE); //Creating an internal dir; File fileWithinMyDir = new File(mydir, “myfile”); //Getting a file within the dir. FileOutputStream out = new FileOutputStream(fileWithinMyDir); //Use the stream as usual to write into the file.

What are the main performance differences between varchar and nvarchar SQL Server data types?

Disk space is not the issue… but memory and performance will be. Double the page reads, double index size, strange LIKE and = constant behaviour etc Do you need to store Chinese etc script? Yes or no… And from MS BOL “Storage and Performance Effects of Unicode” Edit: Recent SO question highlighting how bad nvarchar … Read more

What column type/length should I use for storing a Bcrypt hashed password in a Database?

The modular crypt format for bcrypt consists of $2$, $2a$ or $2y$ identifying the hashing algorithm and format a two digit value denoting the cost parameter, followed by $ a 53 characters long base-64-encoded value (they use the alphabet ., /, 0–9, A–Z, a–z that is different to the standard Base 64 Encoding alphabet) consisting … 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

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