Posts

Showing posts from April, 2011

Go / Golang's RegExp / String Performance

Working with Go I've experienced some perceived slowness when  performing RegEx operations on strings. I've looked for benchmarks and  found  this one .   In some areas Go kann keep up with Java but when it comes to string operations ("regex-dna" benchmark), Go is even much slower than Ruby or Python. Is the status quo going to improve anytime soon? And why is Go so terribly slow when it comes to string/RegEx operations?   And here is the  explanation why... , and  this one, shows the explanation even graphically .

Perl / Python / Ruby / PHP RegEx implementation VS Go / Golang's implementation

Image
Introduction This is a tale of two approaches to regular expression matching. One of them is in widespread use in the standard interpreters for many languages, including Perl. The other is used only in a few places, notably most implementations of awk and grep. The two approaches have wildly different performance characteristics:     Time to match a?nan against an Let's use superscripts to denote string repetition, so that a?3a3 is shorthand for a?a?a?aaa. The two graphs plot the time required by each approach to match the regular expression a?nan against the string an. Notice that Perl requires over sixty seconds to match a 29-character string. The other approach, labeled Thompson NFA for reasons that will be explained later, requires twenty microseconds to match the string. That's not a typo. The Perl graph plots time in seconds, while the Thompson NFA graph plots time in microseconds: the Thompson NFA implementation is a million times faster than Perl when running

List all symbolic links in a Linux/Unix directory

ls -la | grep ^l

Access MySQL / Redis / MongoDB on Cloud Foundry via external client application

...isn't possible yet but he guys at CF are  working on a solution , so it might be possible to access the MySQL DB via Oracle's MySQLWorkbench soon.

Activity Monitor: Mac's "inactive" memory definition

Inactive memory This information in memory is not actively being used, but was recently used. For example, if you've been using Mail and then quit it, the RAM that Mail was using is marked as Inactive memory. This Inactive memory is available for use by another application, just like Free memory.  However, if you open Mail before its Inactive memory is used by a different application, Mail will open quicker because its Inactive memory is converted to Active memory, instead of loading Mail from the slower hard disk. -- Apple Support

Cloud Foundry Environment Variables — example output

Variable  names  and their possible  values : VMC_APP_HOST: 10.114.110.207 VMC_APP_NAME: env VMC_APP_INSTANCE: {"uris":["env.vcloudlabs.com"],"droplet_id":8781,"port":38723,"start":"Mon Mar 14 22:12:38 -0400 2011","instance_id":"761a23e1-533d-45f2-b22a-4524a9b0e861","resources_tracked":true,"version":"01bf98c5-906e-4af9-99db-5be3b48981b3","mem_quota":67108864,"instance_index":0,"secure_user":"b29-user-2","state":"STARTING","disk_quota":2147483648,"name":"env","state_timestamp":1300155158,"fds_quota":256,"dir":"/var/b29.local/apps/env-0-761a23e1-533d-45f2-b22a-4524a9b0e861","users":["person@example.com"]} SHELL: /bin/sh XDG_SESSION_COOKIE: 54734e3a0e719835e9b4985f4cd3c129-1300155163.225936-375864229 VMC_APP_PORT: 38723 VMC_

Get/clone/fetch/pull/mirror remote branch in Git

git checkout -b remote_branch _might_have_another_name_than_the_remote_branch_in_origin  origin/ remote_branch

GWT example using bean validation and RequestFactory instead of RPC

cd $GWT_HOME/samples/DynaTableRf ant devmode ...a kind of source code tutorial/template for using RequestFactory that supports JSR 303 bean validation.  

Remove Posterous badge/slider/panel/label from your blog

Just insert... #posterous_required_header { display: none; } ...between  <style>  and  </style>  of your theme.

Maven plugin w/ vmc functionality for Cloud Foundry

...is  coming soon .

Delete/Remove remote branch in Git

git push origin :branch_to_be_deleted

All the Git at your fingertips — auto-completion

...want  auto-completion  for  certain git commands ?   Put this into your  ~/.bash_profile   or  ~/.bashrc : _git() {     local cur prev opts     COMPREPLY=()     cur="${COMP_WORDS[COMP_CWORD]}"     prev="${COMP_WORDS[COMP_CWORD-1]}"     opts=" checkout commit branch push pull log reset status "     if [[ ${cur} == * ]] ; then         COMPREPLY=( $(compgen -W "${opts}"  ${cur}) )         return 0     fi } complete -F _git git