Home

Zhenya Ciurana - Official Author Blog

Recent Entries

Journal Info

Ciurana, Eugene, headshot, photo, press kit
Name
Zhenya Ciurana
Website
Eugene Ciurana Official Author Site

View

Advertisement

Customize

November 24th, 2009

Hadoop mappers/reducers may be written in Java or in any language that supports streaming via stdin and stout. The streaming API is intended for users with very limited Java knowledge, according to the documentation. Java is considered the best choice for "heavy duty" jobs. Balancing the computational network's performance against the development speed could be a reason for using the streaming vs. the Java mappers/reducers. Last, some scripted languages may work as well or better than Java in specific problem domains.

Are there cases where a scripting language is more advisable than using Java for both speed of development and performance? How can you identify them?

This is an exercise based on a training course I underwent recently at Cloudera. Assume a data set with all of Shakespeare's works and the need to identify the line offset in which a given word appears in each of them. Each work appears in a separate file. Users have the option of implementing this in either Java or in their favourite scripting language. The input to the computational network is of the form:
hamlet@11141\tKING CLAUDIUS\tWe doubt it nothing: heartily farewell.

The mapper intermediate output should be:
KING\thamlet@11141
CLAUDIUS\thamlet@11141
We\thamlet@11141
doubt\thamlet@11141
it\thamlet@11141
nothing\thamlet@11141
heartily\thamlet@11141
farewell\thamlet@11141

The reducer would then take all those intermediate results and generate a list of each word's occurrence across all works:
doubt\thamlet@111141,romeoandjuliet@23445,henryv@426917

Since mapper and reducer operate on text, a scripting language optimized for text processing could be a good idea. The mapper and reducer were initially coded in awk. The mapper strips all control and punctuation characters, leaving only the words:
  #!/usr/bin/gawk -f
  # shakesmapper.awk - map all the words in Shakespeare's works.
  {
    for (n = 2;n <= NF;n++) {
      gsub("[,:;)(|!\\[\\]\\.\\?]|--","");
      if (length($n) > 0) printf("%s\t%s\n", $n, $1);
    }
  }

The reducer is also quite simple:
  #!/usr/bin/gawk -f
  # shakesreducer.awk - reduce the output from the mapper.
  { wordsList[$1] = ($1 in wordsList) ? sprintf("%s,%s", wordsList[$1], $2) : $2; }

  END {
    for (key in wordsList)
      printf("%s\t%s\n", key, wordsList[key]);
  }

awk's main advantage is conciseness over other scripting languages and Java. By comparison, the functionally equivalent mapper Python code included in the training materials is:
#!/usr/bin/python

import re
import sys

NONALPHA = re.compile("\W")

for input in sys.stdin.readlines():
	keyline = input.split("\t", 1)
	if (len(keyline) == 2):
		(key, line) = keyline
		for w in NONALPHA.split(line):
			if w:
				print w + "\t" + key

The Python code is much more verbose. The Java mapper is even more complex and requires knowledge and understanding of the Hadoop API plus a compilation cycle; the Java mapper and reducer are organized as:
public class LineIndexMapper extends MapReduceBase implements Mapper<LongWritable, Text, Text, Text> {
  public void map(LongWritable k, Text v, OutputCollector<Text, Text> o,
      Reporter r) throws IOException { /* implementation here */ }
  .
  .
}

and
public class LineIndexReducer extends MapReduceBase
    implements Reducer<Text, Text, Text, Text> {
  public void reduce(Text k, Iterator<Text> v,
      OutputCollector<Text, Text> o, Reporter r) throws IOException { /* implementation */ }
  .
  .
}

While the Java code isn't hard to figure out by a proficient Java coder, it may be a daunting exercise for a domain expert with little or no Java knowledge. Forcing a Java solution on the domain experts would require to either train them in Java, or add a Java coder to the team with the additional time invested in requirements gathering and coding. This may not be worth for applications where the mappers/reducers must change quickly.

Assuming the same inputs and infrastructure, are scripting languages a good choice? Performance tests for the awk, Python, and Java mappers/reducers were carried out against the same data set on the same Hadoop computational network with no other processes running alongside them. Java professionals predicted that Java code would outperform the scripted program by a significant margin. Here are the results (shorter times == better performance):




The Java code was simplified so that it didn't even attempt to remove punctuation from the data like the awk and Python versions. Java has a clear performance advantage over Python but the performance gain over awk for text processing is less than 5%. For a very large data set, is the 5% performance significant when compared against the time and cost of writing the code in Java vs. a scripting language? Is there a cost/time advantage in leveraging the domain experts' command of a domain-specific language, or is it easier to teach them a fast scripting language instead of Java?

Conclusions

  • For text inputs, the time of development will be faster in a text processing language like awk or Perl
  • Perform a quick performance analysis with a subset of the data to compare performance between languages; in this case, awk's performance is arguably in par with Java's for more complex operations with a much shorter development cycle
  • Some mathematical or binary data may benefit from calling code written in FORTRAN or Mathematica
  • For binary or XML inputs, Java offers a clear performance advantage over other languages at a cost of higher specialization required on the part of the implementer
Since separation of problem domain business logic from distributed execution is a main advantage of map/reduce networks, it may make sense to apply the languages that problem domain experts already mastered or can learn faster than Java to create almost-as-fast but quicker-to-code-and-test solutions.

November 22nd, 2009

Whale sashimiI received this note from a Sushi Eating HOWTO fan a few days ago:

Thank you for a wonderful guide to the world of sushi, the best guide I have ever read. Even after reading plenty of other sources about sushi I learned several new things. But I beg you, please, PLEASE do not encourage people -- ANY people -- to eat whale meat! There are thousands of other delicious experiences to be had while eating sushi without the need to include overfished, threatened, or endangered species on the list. Please remove the reference to whale meat from this sushi guide and your books, and do your part to DISCOURAGE people from this unnecessary, inhumane, and globally irresponsible practice.

I agree with her overall feeling that overfished species should be given a break from sushi bars. Maguro is high on the endangered species list and now I go out of my way to avoid it.

Minke whales (the ones I've been dining on) are not endangered based on the information I've gathered both in Norway and on the 'net since I received this message. As such, I have no problem suggesting that others try it. The meat is delicious in a gamey sort of way, very lean, and great served as either steaks or as sushi. According to the IWC and Wikipedia, Norway has been hunting fewer whales than its quota since 1994.

I admit to having eaten whale in Japan as well -- my hosts heard me mention it after I returned from a then recent trip to Norway and graciously surprised my friends and I. I was not able to turn it down in the context I was in (formal business dinner and well, I don't speak Japanese). I haven't sought to eat more whale in Japan since that experience, opting instead for regular sushi at the Tsukiji market. There are... plenty of fish in the ocean still.

The Sushi Eating HOWTO is about teaching people how to enjoy sushi. Just like it doesn't recommend any given sushiya (sushi restaurant), it doesn't promote or decry eating any sushi because that's ultimately a choice based on personal responsibility. The upcoming edition of the HOWTO will have a simple code indicating which fish may not be advisable due to overfishing and based on the information published by the Monterey Aquarium. Informed readers can make their own decisions.

The Sushi Eating HOWTO will neither encourage nor discourage whale consumption. It's up to each person to decide whether they want to eat it or not based on their own preferences and beliefs.

(California rolls still suck, though!)

Cheers!

October 11th, 2009

Paster for Vim 1.2 Released

Add to Memories Tell a Friend
Ciurana, Eugene, headshot, photo, press kit
Paster for Vim was released this morning. New in version 1.2:
  • If called from MacVim or gVIM, a paste operation will also open a browser on the page where the paste took place. See instructions below to set that up.
  • Minor bug fixes for users of pastey.
How to Enable the Browser
The browser support is controlled by the presence of the g:PASTER_BROWSER_COMMAND. It must be set to the appropriate command line for launching the browser. The paste will appear in the current browser if one is already open.  The .vimrc or .gvimrc files may have this definition as well. Here are some examples of common command lines for initialiation:

OS X
  • let g:PASTER_BROWSER_COMMAND='open -a Firefox'
  • let g:PASTER_BROWSER_COMMAND='open -a Safari'
Linux
  • let g:PASTER_BROWSER_COMMAND='firefox'
  • let g:PASTER_BROWSER_COMMAND='konqueror'

Windows
  • let g:PASTER_BROWSER_COMMAND='start /NORMAL firefox.exe'
  • let g:PASTER_BROWSER_COMMAND='start /NORMAL iexplore.exe'
Contact me via the paster.vim project page if you have any questions.

Cheers!

August 13th, 2009

IPREDator HOWTO

Add to Memories Tell a Friend
Ciurana, Eugene, headshot, photo, press kit
Greetings.

I occasionally have a need to surf the 'net anonymously for a variety of reasons.  IPREDator is a PPTP proxy that enables you to do just that.  IPREDator was brought to life by the same guys as The Pirate Bay in response to stupid/draconian/dangerous laws and regulations that invade privacy on the 'net.  This tutorial shows explains how to connect to IPREDator from your OS X system.
  1. Get an IPREDator account; the availability of such accounts was limited during the beta so keep trying
  2. Pay for the service using a major credit card; the cost is about €5 per month for unlimited traffic
  3. Open System Preferences / Network
  4. Create a new connection, interface type VPN
  5. Set the server address to vpn.ipredator.se - this name dynamically resolves to one in a bank of IPREDator servers in Sweden that will proxy all your connections securely
  6. Enter your account name (the same one from step 1)
  7. Set the encryption to 128 bits only
  8. Set your password in the authentication settings (same one from step 1)
  9. Click on Advanced... and tell your system to use all this VPN for all your connections
  10. Apply, close System Preferences
  11. Click on the VPN icon on the menu bar and Connect...

Done!

Ensure to execute step 9 or your connection won't be protected.  Very important!  Failing to do this means that your traffic is still wide open for anyone to see.



Cheers!


(Posted in Spanish because most victims of these attacks and infected folks are friends of mine in Mexico; copy of a message sent to them via email.  Cheers!  - E)

Hola.

 

Hace rato recibí un mensaje que pretendía ser de mi amigo Luis; él, o un amigo de él, fueron atacados por el sitio my-pictures-book DOT com. Este sitio cosecha credenciales para conectarse a MSN Messenger/Live Messenger pretendiendo que tiene fotos que mostrarles.

 

El ataque comienza cuando recibes un mensaje que parece proceder de alguien que conoces (see phishing-attack-1.png). Si haces click en el enlace, control pasará a my-pictures-book DOT com o un sitio similar (ve phishing-attack-3.png) donde te pedirán tus credenciales para MSN. El sitio atacante utiliza tus credenciales para conectarse a MSN pretendiendo ser tú y continuar atacando a otros sitios.
 

 
phishing-attack-1.png

phishing-attack-3.png

 

Ya que tus credenciales de MSN Messenger y de Hotmail son idénticas, esto quiere decir que el atacante también tiene acceso a esa cuenta de correo electrónico.

 

Si no has caído en esa trampa, por favor no sigas enlaces que lleguen al azar, sin previa conversación con la persona en MSN que supuestamente te los mandó.

 

Si caíste en esa trampa, por favor conéctate a Hotmail / Live y cambia tu password de inmediato. Esto prevenirá que otros caigan creyendo que tú les enviaste un mensaje.

 

En el futuro, considera utilizar Firefox o Safari como to navegador principal. Internet Explorer, como siempre, está mal diseñado y no ofrece protección contra este tipo de ataques (ve phishing-attack-2.png).

 

Por favor no envíen este mensaje en cadena. Esto se los mandé a ustedes directamente porque son mis allegados. Si desean advertir a sus amigos sobre esta información por favor utilicen este enlace en mi blog, y envíen eso, sin incluir mi dirección de correo electrónico.

 

Nos vemos!


May 26th, 2009

Sushi Eating HOWTO Updated

Add to Memories Tell a Friend
Ciurana, Eugene, headshot, photo, press kit
Greetings.

The Sushi Eating HOWTO was updated today.  The quarterly updates are too long, too complicated to handle, so in the future I'll try to make them at a faster pace.

Here is the list of changes for this HOWTO release:Enjoy the HOWTO, enjoy the sushi, and cheers!

May 24th, 2009

Norwegian Seafood Sandwich

Add to Memories Tell a Friend
Ciurana, Eugene, headshot, photo, press kit
A long time ago, in one of my favourite cities far, far away...

I first tried this sandwich at the food court at Oslo City, a super-cool shopping centre downtown.  I dissected the sandwich on-site to figure out the ingredients.

OKi, from the inside of the sandwich, on a crusty baguette, working your way outward:
  • Thin layer of mayonnaise
  • Tiny cocktail shrimp [also pretentiously known as "crevettes" (French word for... shrimp)]
  • A few crayfish
  • Some bits of Norwegian or Alaskan king crab
  • Sprinkle with lemon pepper and salt to taste
  • Thin tomato slices
  • Thin cucumber slices
  • Thin hard boiled egg slices
Additional notes:
  • It goes without saying:  shell all the crustaceans before you put them in the sandwich.  Someone made me something like this with whole shrimp.  Chitin is a great source of glucosamine for my finger joints after years of sparring and pounding the heavy bag but I prefer to not eat lots of it in my sandwiches.
  • If you can get your hands on it, use grapeseed Vegenaise.  If you must use mayonnaise, please don't screw this up using some cheap crap.  Use something made with decent oil and few chemicals.  If you need a degree to read the ingredients list, don't use that mayonnaise.
  • If you are in the Bay Area, use dungeness crab instead.
  • If you are anywhere in Europe, eat as many Norwegian king crabs as you can.  They are a variety of Alaskan crab introduced there by the Russians in the 1970s... in an ocean where they have no natural predators so they are royally screwing things up for Norwegian fishermen.  Feel free to kill as many of these little bastards as you can to help restore the ecological balance along the fjords, the Barents sea, and surrounding ocean.
Let me know how your sandwiches turn out... cheers!

May 20th, 2009

Virus attack from facebook

Add to Memories Tell a Friend
Ciurana, Eugene, headshot, photo, press kit
OKi, so I wonder now how many people will be bitten by this attack.

facebook TrojanI was switching applications on facebook from the Profile page to the SocialMe application. SocialMe (or one of the mini-profiles there) has been compromised with a virus / Trojan that pretends to be some Windows anti-virus scan to trick the user into inoculating the system with a fake remedy.

Devious, devious, devious.

Here is what happens:
  • The browser's client area switches to what appears to be a Windows Explorer / Virus Scan control panel
  • A fake scan "identifies" a number of Trojans and viruses
  • The scanner offers to repair the problem by downloading the attack code under false pretenses
  • Canceling the download will result in a dialog that won't let the browser quit
  • People who don't know any better are likely to eventually OK to get rid of the annoyance and compromise their own system
The most devious part of this attack is the attention to detail that the creators put. If this code ran on a Windows XP system, with a retarded copy of Internet Explorer, users might believe this is a legitimate repair.

REBOOT YOUR COMPUTER IF YOU ARE A WINDOWS USER AND RUN INTO THIS WINDOW (SEE THE IMAGE).  YOU WON'T BE INFECTED IF YOU DON'T INSTALL THE PROGRAM THAT YOU'RE URGED TO DOWNLOAD.  RUN A LEGITIMATE ANTI-VIRUS AFTER YOUR SYSTEM IS BACK ON-LINE.

Please warn your friends on facebook and who use Windows instead of something sensible like OS X or Linux about this problem. If you're technically inclined, you may analyze the code for the HTML/JavaScript attack, and fetch the install_2018-7.exe Trojan.

Remember: friends don't let friends use Internet Explorer. Get Firefox and Safari now!  Think of the children.

Cheers!

May 18th, 2009

I was reading the news earlier today when I ran into this description of Abrahamic religions.

Think of religion as you'd think of a movie.  The Torah is the first one, and the New Testament is the sequel.  Then the Qu'ran comes out and reconstructs the last one like it never happened.  There's still Jesus, but he's not the main character anymore, and the messiah hasn't shown up yet.

Jews like the first movie but ignored the sequels, like with the Matrix Trilogy.  Christians think you need to watch the first two, but the third movie doesn't count, like with The Godfather Trilogy.  Moslems think that the third one was the best, like with the Star Wars prequels.  Mormons like the second movie so much that they started writing fan fiction that doesn't fit with any of the series canon.


I can't find who the original author was -- please let me know in the comments for full credit.

Cheers!

March 28th, 2009

Howdy.

La Jefa's DesktopSomeone asked me recently how to set up a Linux computer for their grandma. I believe that giving your older folks a Linux or OS X computer is a much better way of helping them carry with their on-line life. My Mum used a Windows/Compaq system for about 7 months between her Linux and her OS X systems; that time was fraught with periodic maintenance visits from me (physical or remote) that validated this notion. I was always logging on remotely to "fix something".

I had my 73-year old Mum running on a Linux configuration until last year, then I switched her computer with a MacBook that I upgraded. Picking the distribution up wasn't as complicated as figuring out the best setup for her to do her email, word processing, web browsing, and chat. I went (at the time) with Fedora Core + KDE. These days I'd go with Ubuntu now that it's as close to rock solid as you can expect of an end-user distribution.

My Mum and I live in different countries, about 3,000 miles away from one another, so giving her good support was a top priority. To that end, every machine she's got since then has these characteristics (irrespective of the OS running in it):
  1. Laptop with an external monitor, a mouse, and a keyboard. Don't make mum or grandma squint or cramp their hands while typing, but let them be mobile if they want (my Mum spends about 40% of her time traveling).
  2. Install a simple-but-secure login. No automatic logins, please. Try to balance security with ease of use. A strongish password is good. A password + thumbprint reader + Captcha for logging in is bad.
  3. Install VNC Server and ensure that it auto starts with the computer EVERY time, in case you need to fix something that she's looking at while while either of you is 3,000 miles away.
  4. If you run a home server, install an SSH client that autostarts under a non-privileged account and calls your server (also non-privileged), opening a remote port so that you can log on to the machine. Ensure that you can log on to at least ports 22 and ports 59xx for SSH and VNC.
  5. You may get away with only a pinhole in the firewall if your grandma isn't traveling. I prefer the VPN back tunnel because I can fix an issue wherever the old lady happens to be, as long as she's got an Internet connection. It's also a good way to track a stolen machine if the thief is stupid enough to try to make it work without wiping out the OS.
  6. On the desktop... place big icons where she can see them, know what they are, and click/manipulate them without having to dick around with menus/docks/etc. Put the icons as far away as you can from the Trash icon, just in case.
  7. Ensure that the power button is set to shut the system down cleanly in case she forgets to shut it down. Fixing corrupted files remotely is a bitch.
  8. For an emergency, leave her a Knoppix disk or a USB drive with a big sign that says "Put this in the computer if it breaks and call me" that implements a subset of the previous steps.

My Mum's old configuration, in detail, was:

Fedora Core 2, KDE, Mozilla/Firefox, Kopete, OpenOffice.org, and a couple of desktop games like Minesweeper. Eventually I installed a media player too.

Her current configuration is:

OS X Leopard 10.5.4, Firefox 3, Adium X, Skype, Office:Mac, and a couple of Flash games in her bookmarks.
The system uses 802.11n to connect to her LAN (Netgear), which in turn connects to the Internet via dynamic IP addresses. The Netgear box provides firewalling, but the firewall is turned on on the laptop regardless because of her mobility.

I only have to play with her machine remotely once every six months, but having all these precautions in place is a huge boon, given the geographical separation.

Cheers,

pr3d4t0r

February 16th, 2009

I work on non-programming documents quite often. I also like sorting the directories under Documents in reverse chronological order, so that whatever I'm working on appears at the top of the listing, and so on. Continued file creation/deletion results in frequently accessed directories getting pushed down the list even though they are still "current".

I was using the UNIX touch tool to update the files/directories modification time to "now", so that they go back to the top of the list. Unfortunately this requires opening a console and doing something like:

cd ~/Documents ; ls -alrt ; touch publishing conferences novels

In English, that means go to the Documents directory, list its contents, identify the files or directories that you want at the top of the list, then touch them to the top. It's visually harder and it breaks my concentration when I'm not in vim / programming / scripting mode. So, I figured I'd write a visual touch utility:



The requirements are simple: it should provide the same features as UNIX touch, and it should be portable to as many systems as possible. A few hours and some programming later, I can offer jtouch to the world!

jtouch is a Java-based GUI tool that offers equivalent functionality to the UNIX touch command. Users can select files or directories and touch them to update their modification time. The tool was created purely for convenience so that users can update file/directory times without having to open a console to execute the command. jtouch runs in any GUI environment (Linux, Windows) where Java is available. It's packaged as a stand-alone Mac application as well -- click and go!

jtouch is released under the GPLv2.

Cheers!

February 4th, 2009

Howdy.

BookmarksBin screenshotThe source code for Developing with Google App Engine is available on-line! You can check out the table of contents and download the sources from my main web site, or you can now download it from the BookmarksBin application itself. This screenshot shows what the links to the book and to the source code look like.

A couple of people commented that the user interface for the BookmarksBin sample application for the book is rather plain. That was a design and execution decision.

Writing a book is like any other project: you need to plan, execute, and make compromises along the way. The purpose of the book isn't to show how to build every aspect of a web application to the reader. I was aiming at showing how to use all the Google App Engine features that I could in as concise and complete a manner as possible. The UI doesn't have rounded corners, or snazzy special effects because those are separate topics from App Engine. Instead, I focused on showing how to use the Django templates, and how to set static, dynamic, and client-side scripting files so that someone interested in making a richer UI has the tools (and develops the know-how) to implement it using App Engine features.

I'm now working on a new, expanded book about App Engine development that covers client-side integration and development in more detail, including a couple of sections on things like jQuery. Please let me know your suggestions about what kinds of client-side browser features you'd like to see covered in relation to App Engine application development.

Cheers!

January 25th, 2009

Ah... Developing with Google App Engine is out. You can get it at your nearest bookstore... and some folks already did. Thanks to John Howe for letting me know that (gasp!) the source code for the book wasn't available for download yet. We're rectifying that as we speak. For now, you may download the sources from my web site.

Thanks for your patience and stay tuned... the sources for all the code are coming soon to the Apress book page and to BookmarksBin.

Cheers!

January 16th, 2009

eWeek Subscription Renewals

Add to Memories Tell a Friend
Ciurana, Eugene, headshot, photo, press kit
Just a bit of Friday self-promotion: apparently eWeek is using my cover photo for the subscription renewal emails.



Blast from the past: here is the original article about open-source and LeapFrog, where we talked about what we were trying to accomplish back in mid 2007... and it's now a reality.

Renew your eWeek subscription now if you haven't had a chance yet! It's the best magazine for the IT professional (with kudos to Jason Brooks and Daryl Taft).

Cheers!

January 14th, 2009

So... it turns out that i have not-so-nasty but uncomfortable larynx infection.  It's nothing to write home about by itself.  Then I managed to tear the tissue around it last night...

Having a sore throat and going on a six-hour airplane ride isn't fun; it causes tension from trying to stop coughing and otherwise trying to minimize discomfort takes its toll.  I got home, had a couple of friends over to offer sympathy (and hot soup!), then dozed off while watching a movie.  Weird as I am, I sleep like a corpse:  on my back, with my hands crossed across my chest, straight as a board.

Sixty minutes after falling asleep your throat muscles relax.  Since the larynx, pharynx, epiglottis and other parts of the oral cavity are swollen because of the larynx infection and so on, relaxing all those tissues and sleeping on my back caused them to collapse, blocking my air passages at around 2100 last night.  This is called obstruction sleep apnea, for the medical geeks among us.  It's not fun waking up, hypoxic, and gasping for air.  The choking reflex forces your throat closed preventing anything from going down your throat -- and from letting air *in*.  So I had to force my throat open first, freaking my good neighbours out when I dashed off the sofa and knocked a couple of chairs down, and kept trying to push air out of my somewhat empty lungs.

Fun times, innit?

The whole thing lasted for about 45 seconds before I was breathing normally but was enough for me to make a significant tear in my oral cavity tissues.  So now I can barely talk, and when I do my voice is a couple of octaves lower than usual and coarse... maybe I'm possessed!  Anyway, a quick trip to St. Mary's Hospital, some antibiotics, hot soup, and remembering to sleep on my side or belly down for the next few days and all will be good.  Interesting side-effects from enthusiastic coughing (as in coughing and pushing air out with all your strength) to restore normal breathing.

Cheers!

January 5th, 2009

Take the voodoo out of designing and implementing Service-Oriented Architectures. How do you go about building systems that leverage SOA techniques? Basic, architectural, and complex patterns emerge as more institutions build and deploy mission-critical SOA systems. The SOA Patterns Refcardz (#38, DZone, 2009) is a handy reference based on real-life SOA implementations and enhanced with the knowledge shared by SOA and enterprise integration gurus like Thomas Erl, Jeff Genender, David Chapell, and Gregor Hohpe.
 
Different authors came up with different pattern languages for SOA and EIA system descriptions; many of them are distilled for this guide. The SOA Patterns Refcardz covers these topics:
  • About SOA Patterns
  • SOA Funcamentals
  • Pattern Language (adopted from Gregor's nomenclature)
  • Basic Service Patterns
  • Architectural Patterns
  • Compound Patterns
This handy reference card is available for download from DZone and it's sponsored by Software AG and its SOA governance and BPM groups.

December 18th, 2008

The other day I dropped my trusty Montblanc Noblesse Titanium. This skinny pen is a discontinued model from before the Noblesse series accepted piston adapters, so it only works with ink cartridges. The full cartridge I'd just popped into it came lose inside the case, unbeknownst to me until a few pages later when the nib stopped working. I opened the pen and realized what happened and, horror, the cartridge was stuck inside the pen, out of reach.

I tried shaking the cartridge lose, and to pop it out of there with a think pick without success. I then called the San Francisco Montblanc store and they indicated that retrieving the cartridge would cost $85 and a two-week turnaround. I switched pens to my stainless steel Meisterstück (built-in piston only) and noticed that I barely had ink for a day or two after filling it. So, I decided to go to Flax Art & Design, an awesome store here in San Francisco, to buy more ink.

Bjor is the lady in charge of the luxury writing instruments department at Flax. We spoke a bit about ink, inkwells, pens, and so on. She told me that Flax no longer carries Montblanc ink--yet another reason to head to the Montblanc store. I mentioned my problem with the cartridge to her and she came up with a great way to solve it:

Just get a 3" screw, gently put it in the pen's case through the cartridge's opening, turn it once or twice, and pull the cartridge lose.

She worked on it for the whole of 5 seconds, and the problem was solved!

We discussed other topics and I learned more tips and tricks about various fountain pens (and I've been writing with them exclusively for 20 years... yet she taught me a few quite interesting things!), met the store manager, and otherwise had a fabulous time. Moreover, that saved me a trip to the Montblanc store since I can just clean the Noblesse and use that for the next couple of weeks since I'll be on a trip. Cartridges are better than pistons when flying because they're less likely to leak.

So... I saved $85 (maybe over $100, since I'd have had to park downtown if I'd gone to the Montblanc store), learned new things, re-discovered how cool going to Flax is, and otherwise had a great time. Thanks Bjor! You rock. Thanks Flax -- I'll try to shop with you more often!

P.S. On a somewhat unrelated note: if you run into Santa Claus/Dyet Moroz, los Reyes Magos, the Christmas Spirits, or a rich aunt, let them know that I'd really, really, really, really appreciate getting a pen as a gift. Flax has this fabulous 18kt gold Montblanc Meisterstück that I just fell in love with. I've been a good kid all year, did my homework, and otherwise have a need for another nice pen, in case I get another ink cartridge malfunction. The pen at Flax needs a home where it'll be loved and coddled. Maybe I could adopt it?

Cheers!

December 12th, 2008

Facebook just released their fork of memcached. memcached was first created to support LiveJournal's explosive growth and is often used in writing scalable web sites. Although enterprise Java applications tend to favor technologies such as Terracotta and Oracle Coherence, memcached is available for them along with every major programming language in use today. The official memcached repository, Google App Engine's Memcache, and now the Facebook memcached fork are different flavors or forks of the same technology.

memcached is installed in as many servers as possible in a cluster. The servers are transparently available to the clients over a network connection. Clients are responsible for establishing the connection by either talking to the memcached servers directly, or by instantiating a language-specific client that allows the application to add, query, remove, and modify key/value pairs. Applications use these values by querying the cache or by adding or refreshing the values in the course of their lifetime. The overall goal consists of eliminating unnecessary access to databases or other constrained resources.

The memcached client usage pattern is something like:
Figure 7-1 -- Developing with the Google App Engine
# Google App Engine memcache example:
from google.appengine.api import memcache
.
.
datum = memcache.get(key)

if datum is None:
datum = dataRepository.runQueryBasedOn(key)
if datum is not None:
memcache.add(key, datum, DURATION)

return datum
.
.
The client application may fetch data in bulk by providing multiple keys, or may delete or even flush the cache. memcached's popularity arose from its balance of ease-of-use and robustness.

Facebook is arguably the largest memcached user now, given their growth in the last 18 months and their reliance on caching to optimize their user experience. They forked the code to meet their own unique performance requirements because the original implementation was somewhat lacking. The Facebook code offers these differences against the main memcached branch:
  • Thread-bound shared connection buffer pools for UDP and TCP sockets for more efficient memory utilization than the original, a-buffer-per-TCP-connection model.
  • Fetch operations use dedicated UDP sockets for transmitting replies to support application-level flow control and to reduce network traffic.
  • "Opportunistic" network I/O that combines interrupt- and polling-driven operations against the network interfaces to alleviate Linux kernel contention issues.
  • Reduced network lock contention through the use of batched dequeues for data transmission to reduce or eliminate network contention issues in 8-core (or higher) systems.
Most of these optimizations are specific to Linux kernels running on multi-core processors, as Paul Saab described in the memcached fork announcement.

Chapter 7: Memcache and Session Data of Developing with Google App Engine describes how to use an elegant Memcache client implementation: simple and powerful.

Cheers!

December 3rd, 2008

Greetings.

One of the very few things I liked about Facebook was its terse UI. I personally preferred MySpace's and Blog City's layouts and editing tools, since they allow a high degree of customization through CSS, but I could see the value in Facebook's white-n-blue motif. Not anymore.

Facebook began serving ads that are every bit as annoying, if not more so, than those found in other sites. I could handle them for about five minutes before I disabled them via Privoxy.

I don't surf the web directly from the computer I'm in. I prefer to keep prying eyes away from my browsing habits wherever I am, so I use an encrypted connection to one of my servers, then use Privoxy to both filter all the fugly ads, nasty JavaScript, or other annoyances, and to proxy all my connections. Privoxy manages lists of URI patterns for filtering content. So... if you are running it on your system (or server) and need the parameters for filtering the crap coming out of Facebook and it's partners, just follow these instructions:

1. Go to http://p.p -- the Privoxy configuration page.
2. Click on View & change current configuration
3. Edit /etc/privoxy/default.action (the path may vary in your system, but the file name is the same)
4. Go to the Action: +block
5. Add: profile.ak.facebook.com/object*
6. Add: *cubics.com

Done!

profile.ak.facebook.com/object* is where all the images on the right-hand bar come from. This may also disable annoying images from the stupid "apps" as well -- a bonus. Regular end-user photos come from a different path, so you will continue to see your friends' photos and other regular content.

*cubics.com are the servers delivering the Flash crap ads.

Cheers!

E

November 30th, 2008

Radioactive Salsa Recipe

Add to Memories Tell a Friend
Ciurana, Eugene, headshot, photo, press kit
Due to popular demand, here is the recipe for radioactive salsa.

4 ripe Habanero peppers
2 green Jalapeño peppers
4 ripe tomatoes
8 garlic cloves
1/8 cup of cilantro
1 tbsp of salt (adjust to your taste)

Wash everything.  Remove the stems from the tomatoes and peppers, if they are still attached.

Roast the tomatoes, peppers, and garlic on a hot griddle, no oil.  Keep turning all of them until they're brown on all sides.  Don't cover them either.  Just keep turning them.  If you have a BBQ, you could just roast these directly on the grill.

Drop all the ingredients in the blender.   Run it a couple of times until you liquify the tomatoes.  Keep blending until you have a salsa of smooth, not chunky, consistency.

Use this sauce to enhance other meals.  It's great with anything that you'd want to spice up.  Be careful with how much of this you put on it, though!

One of the best properties of Habaneros is that they won't upset your stomach in spite of how much of it you consume.

I labeled this "radioactive" because of its capsaicin content.  A very spicy Jalapeño pepper is rated at around 10,000 Scoville units.  That's the Jalapeño that you remember as being very spicy.  Now, a good Habanero will clock between 200,000 and 350,000 Scoville units.  That's between 20 and 35 times spicier than the spiciest Jalapeño that you ever tried.  And this sauce requires four of them.

The best part is that, regardless of how spicy this is, you can still taste the fruitiness of the Habanero and the distinct tomato, garlic, and cilantro flavours.  The spiciness will diminish over a few days in the refrigerator.

Buy the Habanero peppers at a Mexican grocery store.  Habaneros from Whole Foods, Safeway, etc. just don't have the same kick to them.

Note for those who asked for the recipe... here is where you can buy the Habaneros close to where you live:
  • Oregon:  Woodburn is the place to go.
  • Jacksonville, FL:  There are some Mexican stores south of the city; I don't recall the exact neighbourhood but find some Mexicans and ask them where el mercado is
  • San Francisco:  El Chico on 24th between Brannan and Potrero
  • Moscow:  Elisyevsky Magazin on Tverskaya -- get peppers that are as close to orange as possible; they're stocked in the back, next to the citrus and mangos and they'll be a bit expensive; you can buy the other ingredients at a regular gastronom.
Let me know what you think... I have some recipes that make good use of this sauce, like huevos rancheros.

Cheers!

Advertisement

Customize
Powered by LiveJournal.com