Jalebi – Indian dessert

Hi,

A post after a very long time. This time with an Indian dessert!

Deepavali or Diwali, the festival of lights is the biggest festival in India. It is believed that good won evil on this day and people across the country celebrate it with fireworks and sweets. Festive mood starts to set in even a week prior to Diwali. I miss being in India to be a part of the festivities. The best I could do is to prepare some sweets and masticate the childhood memories of this colorful festival. Thus came the idea of making jaelabi – deep-fried flour batter shaped in whirls, and dunked in sugar+rosewater syrup.

Deep-fried sweets are rarity in my home.Especially Jaelabi – since my childhood I have thought this as the most difficult dessert to prepare at home and needs lot of expertise. But decided to prepare this to understand the complexity and to convince myself that  this is not hard to prepare . As I thought, it was not hard at all.

Alright! Recipe time. I followed http://showmethecurry.com/desserts/jalebi.html to T and it came out perfect.

Tips:

1. Have lots of work space to move around. I used all the 4 stove tops. Had the oil to fry in one. adjacent stove (turned off) had a plate covered with tissue, to remove excess oil from the fried jalebi. The stove behind had the sugar syrup . adjacent to it was a bowl to place the jalebi dunked in sugar syrup. Having things setup like this made it very fast and easy. Didn’t require another person to help me.

2. Please add cardamom as powder (as in the recipe) and not as seeds. I didn’t have the powder and was lazy to make it. Ended up adding the cardamom seeds as is and had quiet some cleanup if the batter was not coming through the ketchup bottle nozzle, because the seeds got struck.

3. You can add rosewater to the sugar syrup. That gives a distinct flavor and I absolutely love it. To the suggested amount of water add 2 tablespoons of rosewater while preparing the syrup.

4. You can substitute the orange color with others, but traditionally jalebis are orange to vermilion shade.

5. Rapid rise yeast is available in most groceries. Strangely, had tough time finding the ketchup bottles. Finally  found them both in Walmart.

6. Can be served warm, though I like it cold. If served warm, this can be served with vanilla ice cream.

This is how mine turned out. The quantity given in the link  made around 30 Jaelbis for me
image

C ya :*

Advertisements

Eclipse IDE and its idiosyncracy

Hi,

A quick post on Eclipse IDE’s log cat. While running an android code, its common for people to Log messages so that they can see them in the Log Cat. I started Eclipse in my machine and was running the code and was surprised to see the Log cat remained empty.

1. I went to the DDMS view and clicked on my device name shown in the list of devices and ran the app again, Still log cat was showing up empty.

2. Much annoyed, then realized that it got to do something with Eclipse’s behavior. I have two instances of Eclipse, one for my pet projects and another for my work. They point  to different workspaces. I was running the pet project instance of eclipse over the weekend and then started the other one at work today.

So the trick was to

– close all eclipse windows

– disconnect device (if connected)

– go to adb ‘s location in command prompt . It should be in sdk/platform-tools folder

– kill the adb server by the command adb kill-server 

– start the server again by the command adb start-server

– Now open eclipse and you can see log messages flooded in the log cat.

 

Happy android coding. See ya! :*

Android – setting size of grid view items according to screensize

While working in an android project, I came across a situation where the grid item’s size was differing with screensize.

This is my gridview

<GridView
android:id=”@+id/PhoneImageGrid”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
android:columnWidth=”90dp”
android:gravity=”center”
android:horizontalSpacing=”10dp”
android:numColumns=”auto_fit”
android:stretchMode=”columnWidth”
android:verticalSpacing=”10dp” />

 

Obvious because, in my gridview’s adapter, I had set the dimensions as 150 * 150 px.

 imageView.setLayoutParams(new GridView.LayoutParams(150,150)); //dimension in px

where imageView is my gridview.

This worked perfect for Samsung Galaxy S-II phone, but looked smaller in S-III

The trick here is to set the dimensions in dp in dimens.xml , so  the android system calculates the dimension according to screensize while displaying the grid item.

In values/dimens.xml , set the width and height

Eg: 

<dimen name=”width”>100dp</dimen>
<dimen name=”height”>100dp</dimen>

In the adapter’s get view, get the dimensions from Resources and set it as follows

imageView.setLayoutParams(new GridView.LayoutParams(
(int)mContext.getResources().getDimension(R.dimen.width),
(int)mContext.getResources().getDimension(R.dimen.height)));

Thats it. This works good across different phone sizes.

White Chocolate Mango Cheese Cake

Back to baking with a summer special – Mango!

Made this cheesecake for a potluck with coworkers and guess what?! turned out to be a huge hit in spite of few obvious mistakes.

 The recipe

Ingredients and quantity as in this link http://www.philadelphia.co.uk/Recipes/Philly-Mango-Cheesecake?r=29537

Mistakes I did

1. I baked it at 8 am, left it to cool and it went into refrigerator at 10 am for a 7:00 pm party. Cheesecakes taste better when they sit in refrigerator overnight. This way the crust is set well and the flavors bloom.

2. I didn’t set the crushed crackers perfectly packed before pouring the batter. Very important thing to remember while preparing  crust – if u r using graham crackers crushed mix, press them well in the baking sheet until set. I didn’t press them hard, so during the party, i could still see they weren’t settled perfectly well. See here how to set the crushed crackers . Simpler option is to buy a graham crust if you want the cake set fast.

3. bake the crust just until done. which is 8 mins. do this after u set the crushed crackers well as in the above link. i left it for 10 mins. though it didnt taste weird, i could see the crackers slightly burnt in the edges of the baking sheet

4. I used what i thought as ripe mangoes. They weren’t perfectly ripe and i ended up adding more sugar to reduce the sourness and it did work. People who tasted the cake didn’t find anything different, but I the baker, could feel slight sourness. You could use canned mangoes, though I haven’t tried it. Googling my way through it, I found its a safe bet.

Few tips:

melting white chocolate – If you have melted chocolate before, you know that the ground rule is to use a double-boiler. If you are new to this or u dont have a double-boiler do this. pour a cup of water to a vessel and bring it to boil. take a vessel that would fit into this vessel and add chocolate to it. Now keep the stove in medium-high flame and wait until the chocolate melts. This takes time because we are not heating the chocolate directly, but with the heat from the outer vessel. While waiting for this to be done, prepare the mango puree.

Mango puree – don’t add water while making the puree. We don’t want extra water while baking. If u think  its pulpy, then add few drops of water, just enough to puree it.

Swirling – Once the cheesecake batter is ready, pour it on top of the crust and pour the mango puree as drops. Now to create swirl patter use a butter knife and swirl the drops of puree in a zig-zag fashion like this one

Bake for 30-35 mins at 350F . For me, by 35 mins, the edges were set, but I thought major portion was slightly jiggly. I should have left it at that, because any way its gonna sit in the refrigerator and will set by then. Since i didn’t have a lot of time left for the party, I ended up baking it for 7 more minutes, thinking it will be set better. But the edges were a little burnt. As expected rest of the cake was baked perfectly. I still found it as an eyesore to have the edges slightly burnt and toasty 😦

So lesson again is to bake cheesecake to right amount of time and let it refrigerate overnight. If you over do baking , even for minutes, it turns out not so great!

Image

Gallery App in android

Hi,

Back after a long time! This time, I have an android app I created to share with you all.

What is it?

A gallery app in android

What are the features?

–  Creates a grid within the app

–  Where I can add images from camera or gallery and show thumbnails of the same in grid

–   Click open the thumbnail to show the image in fullsize

–   Delete the image and subsequently its thumbnail

–   Share the image to Facebook and other social media.

 

I was tired of searching for such an app online. because all of them either use SQlite DB or Content Providers. I tried both the approaches and they just didn’t fit the bill..

Here am consolidating the pros and cons of the approaches I tried and the one thats presented now.

My failed approaches

Storing images in a SQlite DB

Pros: Simple, fast adding and retrieval, easy on the VM’s budget. Writing the image as a byte array is much faster and easier to retrieve

Cons: Thumbnail image is decoded as byte array and shown as bitmap. This affects the clarity of the image very badly, when viewed full size.

Using Content Resolver to generate Thumbnails and show the fullsize image

Pros: There is no code from your side to generate thumbnails, Whenever a new image is added, query the Media Store to get the system generated thumbnail. Write the new image to a folder in sdcard, so full-size image looks perfect (as it is reading the original image from sdcard). Don’t forget to add user permissions in the manifest to mount/unmount media and to write to external storage(sdcard)

Cons:  Updating the media store is very slow. Again its a single line code to ask the media store to be rescanned to generate new thumbnail (for a newly added image) or to remove a thumbnail(in case of deleting the image from the grid). The lag is so obvious that you hardly like it.

 

My successful approach (Code in github. Link provided at the end of the post)

Generating Thumbnails on the fly. Here when a new image is chosen from gallery or by clicking a pic in the camera, the image is written to a folder in SD Card (again, don’t forget to include necessary permissions in the manifest. Refer AndroidManifest.xml in the code provided in github), and the thumbnail is created by generating a bitmap of the fullsized image. Setting the bitmapFactory options ‘s sample size high, saves you from out of memory errors.

 

Various screens from the app

app-snapshot

 

Download the entire app here :

 https://github.com/Orange1987/Android/tree/master/AndroidGalleryApp

C ya :*

Creating image hot spots in Android

A typical example is creating a map of a country and clicking on a state, brings us some info about the city. For beginners, each clickable part of the image is called hotspot

While this is very common and easy to do in HTML, its slightly different and interesting in Android.

A typical idea I came up with is, to create transparent image buttons and implant them in a relative layout, in positions corresponding to the part of the image you want to click.

But I came across this interesting solution, where some one has created a widget called image map,

All you need to pass is

1. The image for which u want to create hotspots Eg: A map whose different areas should be clickable

2. The polygon coordinates for the different areas that you want to make clickable. Ok, wonder how to get polygon coordinates for an area in the image?

–  I used Photoshop CS6. Place the polygon lasso tool on an area in the image and look at the Info Palette (Press F8 for this dialog to appear), Note the X,Y co-ordinates. Take 5  such (X,Y) sets until you complete the area. 5 is not mandatory, but usually is comprehensive!

Here is the link to the widget https://github.com/catchthecows/AndroidImageMap

C ya :*

PHP: Var_dump($variable) – The SAVIOUR!

If you are trying to display a variable’s value in PHP and it just wouldn’t show up, don’t fret! Chances are the variable’s value is null or empty string or can be any other reason. To research it, pass the variable info to var_dump() function and it displays on screen, information about the variable like its type and what it evaluated to

Eg: $value be the variable you are wanting to research, say because it is not displayed on screen when you echo $variable , do this

echo var_dump($variable)

C ya :*

__() in Symfony Framework for PHP

When you work in PHP Symfony, many are the chances to see a statement like this

<?php echo link_to(__(‘String title’), $internal_uri, array(‘target’ => ‘_blank’, ‘title’ => __(‘String title’)) );

Ok! lets not worry about $internal_uri here.

Leaving that out, take a closer look at the above statement. there is a link_to() function and its out put is echo’d . Other than that there is a weird __() thingy!

Does it look like a operator? NO! Its a function in symfony  that takes care of translation.

what does it translate?  The string you pass Eg: In the snippet, __() would look for translations of the string  ‘string title’

How? Refer to Using Dictionary files in http://symfony.com/legacy/doc/book/1_0/en/13-I18n-and-L10n

C ya :*