Saturday, September 10, 2011

The Code Hosting Site Holy War (I didn't know about)

Apparently there's been a mighty battle going on between code hosting sites on the Internetz and now from the clouds of dust a mighty and worthy victor has emerged wielding a sword and proclaiming victory ... Or it least this is the new meme I've observed. News to me. So now I need to understand what this holy war is even about ...


(Let me first say that I'm pretty much a git/github fanboy at this point. (Although git can be damn stink to learn.) But I don't buy into this notion that github is supreme and all other sites are crap ... or more importantly that development communities should be monolithic in what they use to revision teh codez.)


Oh I do want to know what mysterious code hosting war has just been fought and apparently concluded with a victor ...

Who was even on the battlefield fighting for their dominance of the Internetz--I'm guessing mostly github, launchpad and bitbucket. So.... Github Wins what? If we mean popularity contest, I agree. If by supreme awesomeness and superiority in implementation, I'm undecided right now.  Github is very nice and generally I advocate it because it is the most popular (out of similar sites) no doubt, so it's a good way to attract developers, and I'm much more keen on git's branching model (vs. hg and bzr). In general, though, I'm a polyglot when it comes to revisioning tools and use bzr, hg, git and svn through the week depending on what project I'm hacking on.  I like being able to use and learn concepts behind all of git, hg, and bzr, but I'm not so much a fan of legacy options like svn which just make experimentation with code and preserving (and possibly merging) revision history from those experiments a complete pain in the ass ... sorry Subversion stalwarts, you're advocating a "misguided rewrite of CVS" to paraphrase.


Concerning the code hosting sites, let me say some ill words about them all. Because they each have a few grams of suck in them and even to some extent deserve the sophomoric insults and rewordings like shithub, shitbucket or launchcrap. So let me unload some hate towards each in fairness.


Github (aka Shithub)


I think GitHub needs some improvements towards receiving the Awesome Supremacy award from the Drew Smathers Buckshot Society of Fringe Opinions on Software Awesomeness:



     
  1. Urls like http://foo/theuser/theproject are an insult to what open source means. Be project-centric like Launchpad: "theuser" doesn't belong in the url. (The ship has already sailed ... alas)
     
  2. Work on git core to integrate easily with github itself (again: where's my "git clone github:someproject" a la "bzr branch lp:someproject" - again being "project-centric" makes this easier)
     
  3. Build tools more auxiliary tasks integrated with the main UI (again like launchpad does) to attract contribution from non-developers: translations, project roadmaps, etc. (Right now all the CTAs are basically: "code, code, code, code, more code"). Some people on the internet think this is all a code hosting site should be. Others extoll the benefits of a rock solid issue tracker which is a useful technology that really stems beyond just software development.



Bitbucket (aka Shitbucket)


Bitbucket too needs a little slap around before getting a Supreme Awesomeness award:



     
  1. Your ticket tracker is total dirt. Launchpad open sourced their's so maybe there's some low-hanging fruit to integrate and reskin.
     
  2. Just keep copying github like you did from the start: bitbucket pages, edit commits and contribute in. the. brower., something like gist.github, also. Don't worry, you and Github are both run by a bunch of hipsters, so a patent war is impossible ... right?  (I'm watching you hipsters, keep it classy) 
     
  3. Ditto on Github critique (1) - your urls should have been project-centric.

Launchpad (aka Launchcrap)


The most common complaint against launchpad has perhaps been against its somewhat confusing UI.



     
  1. UX, UX, UX, UX. Seriously. I've got this dude who can make a big a big ass button that says CODE and people will know that's how to get to the codez. On the cheap too.  For a little extra he can reskin loggerhead to make it look like the same site ... and maybe even pull it inline that with the core navigation.
     
  2. Also, just copy a lot of what github does except the obviously inferior parts (ticket tracker, etc.). So some good things to emulate: "launchpad pages", comments on commits, etc.  Canonical is part enlightened capitalist, part hipster, so again I think we can dodge any patent bullets.

After the war ...


Alas, finally, if there really was a war going on, I'm hoping for some lingering skirmishes that will ensure one thing: If there is an end-all, let it be to code hosting sites and not revisioning tools. My DVCS Polyglot Party is amassing weapons and fortifying our bunkers on the fringe of this vast battlefield to fight towards this end. Let there be a <any old dvcs>.com to succeed github.com where people will share code, hack on code, merge code using any reasonable tool they prefer (darcs, bzr, hg, git, ...) all seamlessly, and with not a thought needed as to what's happening behind the scenes on this RCS-agnostic server. Such a sucessor would indeed be a far worthier victor in this war.

Thursday, February 17, 2011

Python List Comprehensions are not For-loops

I've too frequently seen Python code that looks like this:

[ dosomething(v) for v in items ]

Normally one would write a plain old for-loop:

for v in items:
dosomething(v)

You should always use the latter - not a list comprehension. Why?
  1. A simple for-loop is easier to read
  2. The for-loop does not need to allocate memory for a list that's not even used
The second point is the most important. To repeat the title of this post: A list comprehension is not a for-loop. In worser cases, items may be tied to a database cursor, for example, and could return an arbitrary number of items, so we could potentially allocate excess memory for a very large result set - and all to support a less readable idiom for looping over the result set.

So, don't be tempted by the dark side and confuse list comprehensions with for-loops and your code will be awesome.

Friday, July 23, 2010

Monday, June 21, 2010

IPython and libreadline Don't Work On Mac OSX ... Unless

This annoyed for quite some time: a default installation of IPython (even sometimes with python libreadline bindings installed) doesn't work to smoothly: IPython apparently loads libedit (the BSD variant) which garbles your text when you type past so many characters and doesn't support contextual history completion, etc. I was able to solve this problem with the following:

$ sudo pip uninstall readline ipython
$ sudo easy_install readline ipython

Note that the second step should be "easy_install" - not "pip".

Tuesday, February 2, 2010

Ding Dong, The (IE6) Witch is (almost) dead

I felt my office vibrating this morning but I soon realized it must be reverberations of the collective sigh of web developers all across the globe following Google's announcement of dropping support for IE6.  Apparently the French and German governments are "[advising] citizens to switch to a different browser until the IE6 issue had been resolved" according to at least one source.  I find that quite absurd considering the implication that someone might install a different browser and then switch back to "good old" IE6 ;)

It's depressing to note that IE6 still comprises about 9% of the browser market; so a web developer still has to fret over writing workarounds to account for about 1 out of 10 of their users.  Out of all the theories I've heard over why people still use this browser (dating back to 2001), the legacy corporate Intranet one is the most convincing.  I always new in my heart of hearts that ActiveX for the most part was a bad idea.  

Related articles by Zemanta

Posted via email from Quaternion's Mind Dump

Monday, January 18, 2010

The Cell

Comparison of sizes of lengths with order of m...

Image via Wikipedia

4215 Fre 41 (Memoirs and Reflections | by Aubsoluone Jikro 89th)

A sister.  The cold flesh. Birthed and on the table glowing in an effusive, self-contained bulbous cobweb of light, pulsating white, then blue, white, then blue ...

    This is the first memory of life.  The decanter spilling her across the table, she breathes and tries to understand life, immediately she is a cold wet slimy puppet; in days a beautiful baby; in months a crawling sentient being; and in years a fellow worker in the hull, a friend.
    She grows and learns to know and understand like I the laws of our very finite world: the size of only 10,500 cabinets interconnected like tunnels or stitched together with walls beat open to form small quarters - sleeping rooms, mess rooms, equipment access closets ...
    We are here floating to our lineage's death.  Marooned in a seemingly infinite vacuum of space.

2945 Jyr 33 (Recollections of the meteor field incident | Eschenon Rik 1st)

My age is 23 years and 17 months, I believe.  There should be others here to talk with and help with my duties in the hull, but I am alone.  I am literate but could not gauge the degree of my intellectual achievements good or bad having no living, non-artificial intellectual peer to compare myself to.  I can read at a rate of 3,000 words a minute and can record approximately 1,000 words every five minutes, or 200 words a minute on average.  None of the literature I've read in the library affirms my reading and writing capabilities as either success or failure in an intellectual endeavor.
    I only have one endeavor in life.  To activate the embryo cells and begin decanting members of my genetic family and race and preserve what little I remember of the spoken language and culture from my brief three years of contact with living members of my genetic family and race.

    The ship was traveling through what I now believe to be a meteor field.  Comm system was the first to be disabled by impact and if there were any transmissions they were not recorded in the library.  I have already consumed the entirety of the library.  I have memorized nearly on quarter of it as well.  There are no traces of any trasmission.
    (The written literature in the library's hull was of one differing from my family's spoken tongue.  The remaining two drones on board were programmed to speak my native tongue, so I spoke that bastardized perhaps with the vocabulary I absorbed most through reading rather than dim, shallow interactive with the emotionless, persona-less machines.)
    It was one of 10,000 cells, each the size of 1/40 of our home planet's moon, in network of self-sustained micro-orbitals.  10,000 feet from my head, is the curved wall of the main reactor, a the concetric hollow of a large sphere dumping oxygen and nitrogen through the system, its center, our  spinning hull, with it tunnels and rooms wrapped around the inside of the ring to produce gravity.
    Based on the number of years that have passed, I can only assume that our cell was not only damaged but detached from the main ship and launched off into open space.  I am at least tens of light years away from any solar system that would have any planets, and those planets would not be life-sustaining from my projections.  The cell is traveling close to 60,000 kilometers per hour through natural momentum.  Based on the design requirements of the cell, I believe that it may last from 500 to a maximum of 2,000 years.  Of course that could be made drastically short by collision with a dense cloud of space dust or a meteor collision.
    
    They say there is a time of trauma in everyone's life.  Trauma always produces potent memories, and a young age can provide a level of persistent lucidity in recollection otherwise impossible in such a young age.  For me that age was 3, and 1 month, I believe.  I was considered slower than the others, my genetic siblings, sister and brothers and had not yet been trained in writing or reading.  I was expected to be a laborer on the hull.  The methren (our genetic aunts) followed us toddlers, three aged three there were.  (We talked in a soft, rolling tongue in Illenish, a language that have developed in 2367 - a strangely accented derivative of Chinese with vocabulary heavily borrowed from Icelandic.  The language developed over the years after China's RMT corporation bought and inhabited the island nation.  Or so the articles from history I have access to so document.  There is not a tremendous body of literature devoted to this cultural subject.)
    I remember the methren Lucinia who adopted me spiritually.  I remember her name from my deep love for her and my memories of watching her die.  The walls of the escape vestibule crushing her body and eyes showing an expression of horror as the life was squeezed out of here.  There was a millisecond expression of her mind shouting "I love you" before the frozen pupils evoked only the hollowed sign of death.  And then she was entirely consumed, crushed and hidden behind folding metal walls.
    The others had been hurled out of the damaged escape vestibule, thrown violently into the thick nitrogen gases of the reactor and splattered against the opposing wall, the kernel of the micro-orbital.
    Everyone had died.  I was the last human survivor on cell AF1416.

    Were it not for AD4, I would have died there; drowning any logic or clear reasoning in tears and screaming fits as I stared out a small intact polymer window peering out into the reactor.  I only remember clouds of blood and imagined my sisters and brothers alive in the spinning mist of dark red blood.  I was deluded in my horror by hallucinations of other methren nearby holding my fragile body there in the bubble formed in the collapse.
    I didn't realize a small crawl space with light trickling in immediately behind me until I heard a nursery song and a voice effecting a methren whose name I have forgotten:
    "Rik, rik, trick a trick"  It sang in a soft voice perfectly emulating the methren.  I lay there and fell asleep for what seemed like a long time - for how long I cannot be sure.  I cannot remember the dream exactly but I know I had vivid and fantastic dreams trying to comfort my traumatized mind.  I do remember waking with the false illusion that I was crawling up a bunker ladder, a feat I had never really managed but tried and failed many times.
    AD4 was singing again.  Some nursery song about climbing and falling.  "Be brave and climb."  And then I crawled toward what I though was a methren singing to me; my eyes were still swollen from crying.  The last memory I have was after coming into the full light of hallway into which I had been summoned; the horrific moment of realizing it was AD4 emulating the methren.  I had convinced myself, wrongly, that the drone was going to kill me and throw me into the reactor with the rest; or at least crush me somehow.  I erupted into fitful sobbing again and stared back at the faceless drone which floated back from me playing a soft nursery song to calm my troubled self.

    From there I have no recollections until the age of 3 years and 10 months, I think, when AD4  had taught me basic writing, the alphabet, the concept of colors.  It spoke in its affected robotic voice after failing to convince me of its humanness.  I often wonder if I spoke to an outsider, they would confuse me for an android?  There is no way of telling.
    I am the third generation of the cell, we were commissioned as miners to be used in later parts of the main ship's voyage.  Now I am only racing time to make others to live in the little amount of time left.  0 generations? 1 generation? 2 generations? 100 generations? 1,000 generations?
 

Posted via email from Quaternion's Mind Dump

Friday, January 15, 2010

Competitor Research in Global Markets

quantcast-baidu

Image by mastaschmue via Flickr

Competitive website analysis can be tricky for global markets.  Take the stats for Baidu.com, the leading search engine in China, from Quantcast which is logically not representative of global traffic (including China) to the site; only an estimated 848K per month (compare that to US Google traffic of 146M).  Of course those are hits mostly Chinese expatriots and non-resident visitors.

The magic of quantcast.comcompete.com estimates [1] is simply getting scrubbed datasets from some ISPs.  Therefore they can be drastically inaccurate due to natural anomalies such as a large majority of traffic falling outside of available data samples.

Quantcast only provides statistics for US markets; I wish I had a market research consultant sitting next to me now to suggest similar competitor research tools.

There are a host of these sites (basically great marketing planning software with many features free from the bat) which are incredibly great for domestic companies researching other sites with a strong presence in the US markets.

I don't see many with sites which offer estimation of non-US markets.  I'll try completing a survey for my own purposes to hone in on options for researching some Asian, European and South American regions.  Anybody know of other companies such as Quantcast offering statistics on non-US traffic?

[1] Quantcast and other similar companies do provide direct measurement to webmasters via javascript tracking codes.

Related articles

Posted via email from Quaternion's Mind Dump