Sunday, September 30, 2012

sous vide ala ghetto

I have been cooking ala sous vide for the last few days, using my ghetto setup.
 breakfast, eggs on toast. eggs sous vide at 63degC for 45min. cooked in a batch and then kept in freezer.

Lunch is too expensive, It will cost at a minimum about GBP10.... so I am skipping it. Just to give a matter of perspective, 300g of pork chop is GBP1.79

Dinner. Usually I would Sous vide the meat and later chill it in the fridge. After I am back from school, i would pop some into hot water bath . Once it is properly warmed to the desired temperature, in it goes to the hot skillet for the malliard reaction. 

Sous vide chicken thigh at 71degC for 2 Hr

sous vide pork chop at 57degC for 2Hr

Tefal frying pan is awesome!~

Watch out this space for sous vide beef rump (GBP1.99) and also bacon joint (GBP2.39)! 

Parsing or Word-Rip Alice-in-Wonderland, A programming methodology

Data need to be parsed very often into a form that is understandable by a software. Data parsing is most familiar with the computer science students, usually, data need to change form among different system. The sample operation below describes the methodology of word ripping the famed novel, Alice in Wonder land to 1. count the number of words and 2. determine word frequency 3. sort the word frequency.

Critical Analyzing the sample problem, and possibly break down this word rip operation into several sub steps. This is the most classic divide an conquer approach. First would be to determine the weapon of choice from the arsenal. Be it C++, C#, Java, Python, Haskell and etc. In this example where there is no preference for the language needed, hence the tie breaker would be the familiarity with the API. Using API definitely reduce the time to market (TTM), then custom writing another whole new library. In my example, Java is preferred.

Next, the "coding" part. Never-Ever-Jump-Straight-In! Give some thought on the process of word rip. Data need to be acquired, data need to be parsed, data need to be stored (in memory , data need to be manipulated and lastly data need to be output to a file physically. AH.... all look so familiar isn't it! At this point of time, locate the possible use of the API and make a mental (or physically writing it down) note about it. This is also the time where UML case and also class diagram can be drawn.

 Assuming the novel could be put into the same directory of the *.class file, this would same some time in programming, i.e, no need to import* and thus skipping the myriad of networking related troubleshooting for the code to access to the Internet. Reading in the data file, this should be familiar. With the class. The logical next step will be thinking on how to count the number of words (without the punctuation marks), what variables need to be declared and what type of control structure need to be used? Hint* while loop till the end of file, increase the counter for each word found. Compile and Print out. Troubleshoot as necessary.

Congratulations for coming this far. It means that you have completed the first iteration of counting words using next() [which ignoring punctuation marks]. Now, come the interesting bit. How to 1. remove the punctuation mars, the words 3.count the frequency of the words. Few assumptions need to be made. i.e Word and w0rd; text-ing and texting is 2 unique an etc. item 1 can be dealt separately first, but the choice made for 2. will directly impact the way the code written for 3.

REGEX and greedy comparison. I am assuming you guys are familiar with Java String class API and the replaceAll() method call. Since the need is to rip out the words (alphabets and numbers), minus the punctuation marks. I started with the most classic one replaceAll("[^A-Za-z]", "");  on close examining of the processed outputs, there are a few missed bits and blobs of punctuation mark remained. From the output, it will be naked to the untrained eye (on what need to be spotted). Do look out for patterns, such as repeating type of punctuation marks, syntax (format) of the words that fall in-between the data parser and then back to the programming<-run->debug cycle. Eventually, there might be a conclusion. Different train of thoughts will definitely leads to a different code. Some might be tempted to bail out; Some might look for other possible API to use, and etc. </-run->

Choice of 2. will impact 3. For an example, if array was used, and since array can only store 1 item in each allocated memory block. Logically it would lead to several outcome, such as OOP style i.e creating a class with 2 variables. creating 2 arrays, one for storing words and one for storing frequency. using more advanced data structures. The algorithm is pretty much straight forward. check whether is the first occurance. if not, increase the word-count, else insert the word and with word-count =1.

The efficiency of the code will be hampered by the type of data structure chosen. For an example, let say one array is used to store words, the code need to loop through the array to find a similar word. That is O(n) and the worst case scenario will be looping through the entire array. Since the words come in a random, and the array content not sorted, just to make the matter worst. Let say there is a match for the same word, the count need to be increased. Then it will be another loop through the word-count array, that is another O(n). Most likely this piece of code is implemented in an O(n^2) fashion. Is there a better way that can achieve O(1)?? [don't peek at my code yet, research about data structures, particularly the map]. Why I know to use a HMAP, it boils down to 2 things. I read about it, and I used it before. The worst thing you guys might be facing is "Ï heard it before (from some random conversation)", then it will be just another round of wild goose chase.

As for the sorting by frequency of words, again the choice of data structure made earlier affects the options available later. Hint* use Java.Collections

The first 3 SP students that respond with your OWN thoughts that were translated into code shall get a post card signed by me and snail mail from London, UK. POC + FCFS only.

code, enjoy!
just incase the embed fail...

Monday, September 24, 2012

Ghetto Sous Vide Salmon on the tap, and reflecting on my poor wallet

It has been some time since I last updated. Finally I have landed in the UK. All looked distant and yet I felt I have been here before. The deja-vu was through one of my good habits: reading. I read from The GB Encyclopedia since young; Wikipedia when I grew older, and  living in THE moment for now. All felt so surreal to be close to what I have read, but yet, the reality of lacking $$$ comes cold and hard. Everything comes with a price.

Cooked food, rental, transport and coffee are really expensive here. But thank goodness raw material is dirt cheap (in a way, compare relatively to what I used to pay). FYI: 1 trip to uni via the tube cost me GBP4, which is SGD8. In retrospect every month I only top-up EZlink (equivalent to Oyster pay per go) 45SGD round trip between SP and bukit batok. You do the maths. 1 serving of yucky "chinese" fried rice with chicken from a stall cost GBP5, compared relatively to a serving of chicken rice that goes for only SGD2.8 from a regular stall in SG. Proper sit down lunch would cost around GBP25, excluding the tips or gratitude fee. Fast food joint such as KFC, almost the same price for a standard 2 piece meal: GBP3.99 vs SGD7.40 (SP is SGD6.40)

It has been hard on the wallet, surviving without monthly pay nor maintenance fee....I never bother to look at the price tag of the items I am buying prior to this. Nowadays, I would mentally sum up my purchases before committing. Stay hungry, stay foolish. Quoted ad verbtim SteveJ. Cold food is the cheapest. After eating cold healthy food (cereals, bread, oats) for the last few days and living like a HOBO, the lack of FIRE and malliard reacted protein have cost me my health dearly. the FORCE is weak in this one.

It is FIGHT or FLIGHT; yet still need to keep the pounds and penny within sensible range.

Here comes my GBP3 salmon dinner ala Ghetto Sous Vide on the tap!
I came across a tap that is spewing really hot water and this strucked me. I quickly whipped out my LM35 and arduino setup and presto! It registers 60+- deg C.

Brine the salmon in a 10% salt solution (salt courtesy of KFC) for 45min. Look for some sandwich bags (which is ziplock bag) to put the salmon and seasoning. I have used thyme (courtesy of a garden i passed by) and pepper (courtesy of BK) to season. Use water displacement technique to vacuum seal the salmon in a pouch. Due to the limit of 23KG luggage, i did not get to bring my vacuum setup :(

set up water bath for 55degC (by mixing hot and cold water), turn on the hot tap and let the hot water trickle into the cooking vessel (thermodynamics: loss heat must be replaced). Earthen ware is recommended for heat retention. Sous vide the salmon 55degC for 15-20min

close up of the cooking from a tap....

must resist the temptation.... the process is not completed yet.

un-bag the salmon and pat dry. heat up the skillet and ready for crispy-ing the salmon skin.

Since the budget for dinner is only GBP3, I used up for salmon. Hence, no greens, starch nor soup.


The salmon flesh practically just melted in my mouth. The crispy skin gave me a recollection of what proper hot food supposed to be. I felt HUMAN again, despite the lack in a standard British grub that made up of a meat and 2 vegetables.

BTW, i am available for HIRE. According to labour laws, I can only work for 20hours (officially). If you need a butler, cook, body guard, computer/IT technician, plumber, EE engineer, toilet cleaner, room cleaner, ping me.