Tuesday, April 30, 2013

Open sourced nodejs web apps - missing the best practices

While it has been obvious that people open source modules, in every single language, the idea that when you write a deployable web (or mobile or cli) app you should be
 - open sourcing it
 - link the app with the open source code of it
is much less discussed.

Here are a few examples
1 npmjs.org -> https://github.com/isaacs/npm-www
travis-ci.org -> https://github.com/travis-ci/travis-ci

3 liftie.info -> https://github.com/code42day/liftie

The practice is so uncommon that there aren't "best practice" guides for this, "this" being not the writing of the web app itself but the open-source process:


- What should I include in the public repo and what should I not include?
- Should I add an overly visible link from the deployed site to the code (fork me at github) or should I leave it for people to search and find the source.
...This is a very important point - equivalent to package your open source with the binary in the old GNU inspired days..
I often find a site that has a feature/functionality I want - but I want to make it a bit different. The site seems to be written by someone with open source ideology (e.g. 1,2,4 above). So how do I find the source?
I google "github <domain>" and if that doesn't work I typically give up.

Note that googling link:liftie.info finds no results even though the github repo is pointing to the site as its web url. Either google is increasingly screwing up its advanced options or github doesn't expose this well for search engines...
And I don't think that there is a "registry" for open source apps of sorts. You cannot find npmjs.org's code in npm (I am guessing that...haven't really looked)


Anyway but that is just one type of "best practices". What do you do about the data? For example in the modulecounts  site above the author has opted to put in the DB the regexpressions/urls that extract the counts from the registries... Thats a good part of the logic. Luckily he has checked in the db migration folders as well !!! which gives access to everything one would need. But there is more.
Lets say I want to take modulecounts and just write it in nodejs for the fun of it. Or even more I want to add some of the charts that Mikeal pointed out in his post, that show growth or proportion growth.. To do that I would need the actual historical data that the service has collected.
It would be nice to have that. Modulecounts again did the right thing and gives access to the csv in their  web site! But of course the app shouldn't/couldn't share private user data...

Another area of "best practices" is dependencies and testing 
It would be nice for the web app to have a test suite and travis-ci integration.
We would be able to create dependency graphs not just for modules but for actual apps!
It would give tremendous test coverage for all the module writers to confirm the validity of their changes . 

In general as I have said in an earlier post we need best practices that allow us to produce truly open apps. And we need people that are influencers to start following the practices and publish their apps as well (and not fear that by doing so they risk losing their userbase to someone else ) even if the apps are "for profit" apps.


Monday, April 29, 2013

More on nodejs dependencies and nodejs uniquenesses

continuing on on comments made here

http://www.futurealoof.com/posts/momentum.html
This article is the analysis of why nodejs is (and will be ) a more successful platform than its contemporaries (python ruby etc). 

...In the earlier days of node you could write anything. The advantage of nothing being compatible is that there is a much greater opportunity to attract people interested in writing virtually anything. That means a greater potential for early investment, which creates early momentum, which you can only lose over time so maximizing that early growth is the most important thing....


(my comment: one thing to note here is that Java had a similar potential early on. The virtual machine created a very isolated world where no existing (C/C++) lib could be brought in. However, that was seen then as a disadvantage and the  "parents" of that platform attempted to alleviate it by expanding a massive "standard" set of libraries that emulated the previous world and choked any potential for early on community investment.)


Other interesting article from this guy's blog:
If you are building an app or a web service or anything that is "deployed" then you should include node_modules in the repo but not binary targets 
If you are building a package/module (ie sth that is used by other packages/modules or apps ) then do not include the node_modules in the See for example 
deploys:
or packages


Bold statements


Reading npm's design philosophy , I found this statement to be rather bold and rather representative of the module mentality seen pervasive in the nodejs community:


- No lib folder : If you would put it in lib/, then it belongs in a separate module.

Here are a few other stmts as well



Design Philosophy

- No frameworks : Everything is done using small, simple, standalone modules that work with vanilla Node.js http servers.

...

Small Modules : No single JavaScript file should be more than about 200 lines.
...


Unceremonious MVC : No big MVC class heirarchy. Just have the route handler get some data, then hand it off to a template. Simpler is better.

Chaos vs Order (Law)

As I read the various denominations/alignments of dungeons and dragons I think that I am more of a "chaotic good" creature....

Saturday, April 27, 2013

Work notes - HS/GH evolving the flow

I am applying the moto "what other services/modules/libraries that are even remotely reusable/generic if they were to exist would make the job of implementing my project trivial"... I reached the following realization.
substack:
Which hypothetical reusable modules would make the task at hand trivial?

When you do that the first thing that happens is that you find other modules that are doing something similar to what you need but not exactly. So then you have the following options:
 1 Ignore the existing service and do something simpler yourself that does just what you need 
 2 Talk with the owner to see if the needed feature/expansion of functionality is sth that makes sense for that module. If yes:
    a ask the module owner if they would do it. (Even if the person is willing to do it, you are often being blocked by the missing functionality which means you probably need it asap which makes that option... rarely an option
    b fork the repo and try to do it yourself
 - If no
    c you may still fork the repo and create a variant of the module that provides that new functionality and publish it 

2c and 1 are similar. However, only 1a is truly leveraging others. I think it is very important to figure out how to better enable 1a (as opposed to just allow someone to outsource the todo list of their own repo).

So here is how we could do that.

The existing model of HS/GH  is as follows.
- You register one repo with HS/GH
- You can request for any of the issues in your own repo to be od sourced (by providing some additional info around the issue (budget, tat, primary skill, secondary skills) (you can provide these info either as back-matter yaml in the issue itself or directly in an external system. By doing so the following things happen
   - The issue owner is charged the amount
   - An od job post that links to the issue gets created based on the information above
   - A pool of candidates get automatically invited
   - Applicants that fail to meet requirements are auto-rejected
   - The first applicant that meets the requirements is auto-hired, and their gh username is linked to the job, and the job becomes filled
   - On pull request from the the linked user the system confirms that acceptance criteria are met. If not user is notified that the issue is not ready yet.
   - When the owner accepts the pull request payment is being made and job closes
   - Meanwhile a issue progress icon is maintained that can displayed in the issue's markdown both to help the issue owner as well as to attract more/future candidates.
   - If time passes past the tat, notification is given to issue owner to extent the deadline or the job gets cancelled and the money is returned to the issue owner.

The owner is freed from the hiring/paying process.
The owner still has to manage the person, answering questions, reviewing the pull request etc. 
He can avoid some of that by putting more time in the issue details. 
He can avoid some of that by following strong unit testing, coverage, lint enforced practices etc.
Still he has to put a non-insignificant amount of time, limiting essentially the extent to which a person can truly scale themselves.

To enable muti-level scaling we need to better faciliate the 1 case above.
So here is an idea of how to go about doing that:

HS/GH also supports the ability to "pledge" towards the implementation of issues/features on a repo that someone is not an owner of (like sourcebounty .com)

You can pledge an amount of $s towards the implementation of an issue. 
To figure out how much to pledge you really need to ask the repo owner - how big of a job it would be for you to do the job (assuming guidance by the owner - which in most cases they would be willing to provide). The amount of hours x rate is an indication of the pledge amount.
A simple way to think about that (similar to what we did above with the issue yaml back-matter) is to allow a pledge to be given in the comment of the issue as comment back-matter yaml. Essentially you link a particular comment on an issue on someone else repo with a pledge (amount+ TAT). That does the following:
 - checks if there is already an od job for this issue. 
 - If yes it augments the od job with the extra pledge/amount/tat.
 - if not creates the od job as private and invites the repo-owner as sole applicant.
 - the owner accepts the invite (no obligation) and subsequently can do 2 things
   - creates (one or more related issue and gets it done by someone else following the model above
     (note that he now has the money to do that)
   - does the job themselves and makes the money
     - closes the issue
     - on issue close the payment is being made
 - the pledge should have probably room to allow the repo owner to make some money themselves (even if they outsource the job) to increase the motivation and get the job done on time.

This means that module/repo-owner would make money by resolving issues. The more users a module has the more issues it would create. The more modules someone maintains the more issues.
The model allows a developer to make more and more money by developing the stuff that want to be writing.

Work notes - weekend planning


Next things in my quest for perfection for the small first project.
1. Still not satisfied about the man pages. mantastic didn't do a great job. Sections are not highlighted etc.
2. Cover requires a single file to run - most programs should be able to take a list of files. Should make a change. HS it?
3. Cover is not available as a library - make it a library. HS it?
4. Add unit tests for jshint and cover and include them in the test program. Figure out how to create a test that "does not decrease code coverage".
5. Still not satisfied with the Makefile. Should probably have build, cover data created as part of the build process and test depend on it. Make test should be smart and do everything by understanding file dependencies
6. Too much clutter at the top level. Some files should move down folders. maybe some folders should merge.
7. Issue HS jobs for the new brush types.
8. Change my github ssh  defaults so as when I push, I push as ogt (as opposed to tsatalos). Do that without messing amzn/heroku.

Friday, April 26, 2013

Browsing hacker news


https://github.com/f/omelette ->
The interesting thing here is the use of animation gif in the github read me….

http://blogging.alastair.is/how-i-served-100k-users-without-crashing-and-only-spent-0-32/
The interesting thing here is the realization that the gh-pages feature of github may not be worthwhile the effort (and the various annoyances) . An S3 wrapper to push your static site to S3 on commit may be a better option.

I just submitted my first hacker news comment.. https://news.ycombinator.com/item?id=5613652
and subscribed to http://hnnotify.com/ and imitated the animation gif on boxchareditor.

Happy.


Thursday, April 25, 2013

On continuous integration

Ideas:


reflects the status of the tests on last commit.

However the dependencies keep on changing (and as things go the dependencies will keep on increasing exponentially). Ideally a continuous integration system would look at the tree of dependencies (package.json) see which dependencies are fuzzy (this is the instructed approach ) and keep track for changes in those dependencies. Note that the change we are looking for there is version number changes in the published registry (npmjs).

If we see now the world after travis (or another travis-like service) implemented this feature, then as every component publishes a new revision that would trigger a re-evaluation of the tests of every (closure) dependent module/project that is linked with travis. (interestingly that would cause spiky usage.... on the other hand it may be less important to produce real time notifications to all the affected repo owners) A repo owner would the receive the notification that their repo failed passing as a result of  some change... in which case the have two options:
 - fix the problem
 - put a version restriction in their dependency file

The other interesting thing here is that ideally the person that wants to publish a new revision should be able to see the effect of their action before publishing. Ie for all dependent repos they should be able to run the tests - but having told travis to use their about to be published revision as if it were published.
The result should be then a list of all the repos that fail (and used to pass before).
The person could then do any of the following
 - Consider some of the failures as unintended effects/bugs of his rebision, esssentially views the vast # of repos as test suites for their library. In that case he proceeds to fix the bug
 - Consider some of the failures as an intended lack of backwards compatibility in which case the person can bot Submit issues to the affected repo owners that an upcoming release will cause their repos to fail. The bot could
  - just notify of the issue
  - suggest a pull request for changing the package.json
  - suggest a pull request that automatically fixes the problem if an automatic code update is feasible

and do all that ahead of the actual publishing of the new revision.
This would also give a user feedback to the repo owner how many of the users are willing to update their vs stick to the old release.

The world impact of all that is that code becomes aware of other code and bots are working to keep the overall system healthy... and more importantly a live deep dependency model becomes possible without forcing the freezing of dependent modules (which bring the problem of inconsistent modules being used by different libs and bugs not being fixed etc etc)

Tuesday, April 23, 2013

Work notes - getting coverage

Today's progress:
 - Successfully added code coverage reporting to boxchareditor (using node-cover)
 - Added tests to reach 100% line/branch coverage

Still todos:
 - Find way to use node coverage report as a job acceptance "test", ie if the code doesn't meet certain minimum coverage, it fails as if a test has failed.
 - Find a way to allow someone to test whether their code meets the basic acceptance criteria before the final pull request


Possible ideas about "acceptance/validation tests"

  + Is the github user the one that is allowed to submit the pull request?
     + Is the job still open, within deadline etc?
  + Is the code on a branch?
  + Can the code automatically merge?
      + Test against orginal fork point
      + Test again current head
  + Does the code passes all the unit test
  + Does the code meets the functional acceptance tests?
  + Does the code passes minimum code coverage in testing?
     + avg line,branch coverage, no particular file below certain #
  + Is the code "compliant" (follows stylistic requirements, conventions etc). (jshint config)
  + Are all the dependencies ok
     + dependencies up to date
     + no duplicate dependencies
     + no blacklisted dependencies
  + Does the code passes the browser portability requirement tests.

Monday, April 22, 2013

Gitbots

http://www.wired.com/wiredenterprise/2012/12/github-bots/



gitbots...
So you have a technique that makes lots of people code better (e.g. a better compression alg for your images). You create a bot that looks in github repos, find projects that have images, checks wether the new compression algorithm can make a difference , and if it can you automatically do a fork/recompress image/submit pull request back.

While the negatives are quite obvious the positives are more interesting.
Improving source code at scale is really interesting - and feasible because of open source collab platforms like github.

You can have a someone run a spell checker against doc/readme pages/ and when it find mistakes pass them through some crowdsourcing and then automatically fix everyones docs. You may find that people haven't done man pages out of their wiki - creating man pages and automatically add the man page install in the install process could be automated. People may not have hooked up a continuous integration system like travis that confirms on commit...even though they have the tests.. thats again automatable to get the travis-ci treatment.

If people are annoyed by the pull request noise.. you can have the bot submit an issue asking the repo owner if they are interested for the fix and only proceed if the issue doesn't close/gets a positive reply.

If people are annoyed by the issue noise from bots... they should have a bot that filters/screens issues based on user that the bot is associated with or any other rule they need.

Tuesday, April 16, 2013

Node.js and open source trends

I spent some time with a friend from work after a debate on which languages to allow and which languages to not allow in our production system. I failed to explain that the language per se is not the issue - it is the best practices and the community culture that is developed around the language that is of importance. Chosing java vs php vs python vs nodejs _is_ a big deal.

My primary argument there was trying to explain the reasons why nodejs is not "yet another fad" but it is changing the way open source development happens, and I argued that we cannot leverage it unless/until we follow an open source model for writing our code.
I tried to explain that open source model doesn't mean to make your code open, public, useful, get users and contributors. As the creators of browserling (github/substack (the 2nd most prolific npm contributor) and github/petersk) showed writing your app in "open source model" is about architecting your app by keep on asking the question "what possibly reusable pieces if I had, would make the writing of my app trivial") - which results in you pushing out a stream of dozens of tiny (open source) modules - whose probably expected public utilization is fairly small - but still allows you to better architect your software and enable collaborative distributed development.

As always the community brain listened and an article popped up in hacker news today with a much better framing of this discussion:
The Node.js Community is Quietly Changing the Face of Open Source (caines.ca).

python:  29,720 packages / 22 years = 1351 packages per year
ruby:      54,385 packages / 18 years =    3022 packages per year
node.js  26,966 packages / 4 years =   6742 packages per year

Its a worthwhile read.

...
Interestingly there is a guy that is even more prolific npm contributor than substack.... tjholowaychuk
He has an interesting post explaining what he is missing in client side js componentization

Sunday, April 14, 2013

Markdown as a platform

It seems that the comment about how github+markdown is creating a better platorm
(changes  => github hook => notify services => update status/dashboards etc=> status/dashboards is captured as a png, and png is embeded to the project's homepage )
is being realized by more people.

Here is a new example that shows not just the build status but actually where does this repo currently is tested for (javascript case)

For the record this is a fairly new development   (feature/product testling was launched in January)
another indication of the community brain.

Friday, April 12, 2013

Work notes - HS/GH progress

6-th straight success !! (6 hrs from post to pull request)!!
I am very very happy.

So here are the few data points.
1. boxchareditor has my complete todo list as issues https://github.com/ogt/boxchareditor/issues
2. I posted the very first issue  as an OD job - accidentally to the wrong team.. the OD interface is really  tricky sometimes particularly if there are many jobs/many teams.
    oD job : Add enhancement in open source javascript project
3. As you can see by now I have concluded to fully separating the task at hand from the job post
   Here is the template for the job post  https://gist.github.com/ogt/55b25e064f729cb5799d
4. I have started running a header and footer in the issue - the header captures the status of the issue (
    - Sourced @ oD for $40 - Waiting for developers
    - Sourced @ oD for $40 - Job in progress

    - Sourced @ oD for $40 - Job completed successfully
 In all the cases this links to the OD job. The footer is the "Yaml - end - matter" - something structured that can be automatically used by a bot to read and know what job to post
5. The job was not perfect - but this was due to a pre-existing bug in my own code that only manifested when I added a new brush. The contractor shield his code from the bug but didn't fix it.
6. I got a github comment against the issue from a 2nd developer saying that he had done the job but the job became unavailable!
7. github preview tool is invaluable - http://htmlpreview.github.io/?....  when you want to test a self a forked html-based github repo.

Other learnings:
- When you have a new repository - you will need to pump up the price a bit to attract developers. The idea is that the investment for a new to the repo person is quite bigger than a person that has already done tasks for the repo.
- When you are a new user - you will probably need to pump the price even more - you/yourself is an unknown quantity (that already is the case in OD)
- A well taken care job post, well formatted polished - (and for that matter a well polished issue) makes people a) take notice, b) want to work on it c) act carefully to make sure that what they do is/appears polished


Next steps -
1. fix the bug in my code
2. Expand the test todo - hard to accept pull requests without a test suite... and post it.

----a day later and a bit more sober after having worked on the bug.---
The bug was easy to fix easy to spot. I would have been happier if the developer had fixed or if I had found it and asked him to fix. Testing...
The developer didn't update any text in the readme etc. I think thats justified - in retrospect I should have done a better job mentally thinking the HS instructions.

Wednesday, April 10, 2013

Dealing with conflict


I was at a school event the other day, a very very long high school end of soccer season gathering (3hrs ) where coaches, graduating student/players etc were talking about their experiences. Anyway, living in a society that puts in a very high pedestal team sports and the importance of children participation..., I wasn't expecting to hear anything new. JUst the usual, about how people chracter, social skils, leaderships etc was improved (my personal view is that sports are useful, but expecting kids to invest 10hrs+ (my kids are putting closer to 20 hrs between , P.E., soccer, swimming, shuttling to the various events) has clearly a negative ROI.).

One coach started a list of the 8 benefits that kids get from this (high school soccer team partication in this case):

1. Deal with Authority  (I realized there that all the coaches/teachers in that room seemed more like seargants than normal teachers)
...
3. Dealing with Conflict:
 I Want the kids to learn to deal with conflict. There are good and bad ways to deal with conflict. Sometimes I create conflict for no particular reason, just for the effect. The other day a kid came 1 minute late. I harass him in front of everyone. "YOU ARE ONE MINUTE LATE. I asked everyone to be on time." Kids learn that "lying" isn't working. Kids learn that "its ok" to not agree. Kids learn to defend themselves. Kids learn how to not lose control. etc etc.
... (I actually don't recall the rest).


That stuck on me.
I realized that this is something that I don't know how to do. Actually I realized that most people from my country (propbably because they don't do sports in their youth) don't know how to do - while a higher percent of "americans" do. I talked about it with my cofounnder and we both agreed that it is a very useful and important skill to have and it is unfortunate that we don't have it and it improbable that we would be able to obtain it at our age..

But today I had a new realization. The issue is much deeper.
When my friend says "my biggest problem is that I don't know how to say no to people. http://realgl.blogspot.com/2013/02/phobia-of-offending-people.html"
its the same issue "he doesn't know how to deal with conflict"
When I say I am not good at negotiating its the same issue.
When I say to a CEO, you cannot do salary discussions with an engineer the same way that you would with a sales guy.., the sales guy will come to you, and you will often just negotiate him down. The engineer will not come to you until he would wait for you to suggest an increase - and he will tell you that this is not enough only when he has made already the decision to go someplace else... The same issue :the engineer stereotype doesn't know how to deal with conflict.
When people (used to say) sales guys get the pretty girls because they know how to deal with rejection  its the same issue.

When I look around in the company probably the most talented engineers in the company "don't deal well with conflict".
These people are often called passive/aggressive  - which converts a missing skill to a character/behavioral weakness.

A simplistic way to understand what goes on here is to realize that early "academic brain maturing" in kids often results in social isolation
  - you don't have common things to discuss with your classmates, your classmates don't like you
  - you find interest in book reading computer gaming etc... which replaces social advancement time in other kids
  - early academic brain maturing typically comes at the expense of lack "physical control brain maturing" => geeks aren't the best athletes => none of the "sport team" gains above

Following my recent change in attitude to accept the way I am (as opposed to try to improve/reprogram myself) I think I am ok not knowing how to deal with conflict.
I have the hope that an HS world leaves much less conflict than what you would get if you were to build a team of smart strangers with different optimization formulas and get them to create a company.

Tuesday, April 9, 2013

Architecting for HS

Looking at https://github.com/ogt/boxchareditor/issues it is interesting to see how the issues and the source code evolved to make the subsequent HS-ing of the todo list easier - both for the HS programmer as well as to minimize the final merge from me.

Parts of the code that could be extended, were given name (e.g. type), they were pushed out as a separate file (to minimize merge headaches. A normal refactoring of the code following DRY principles would have resulted in a possibly more compact code that attempts to find/understand the shared aspects of the logic between various fonts.  (thin thick type vs single double line).
Even the functionality itself was influenced - ( I was considering "switching on the fly from single to double to thick... as part of the drawing, I gave up after I broke them up independently) 

The interesting thing is that even though originally I thought that the variants(types) are very similar so there is a common underlying logic and just a table that maps fonts for each different type.... that ended up being an incorrect assumption.
Single-double line has a different set of "combination" characters. Many of them overlap - but not all.
This means that the code that handles everyone would need to have the union of all the combination chars, disproportionally raising the complexity of the algorithm and essentially forcing me to think of use cases that don't even exist in practice.
The approach of fully separating each type, allows them to diverge as needed, and while it involves some repetition it results in a smaller/easier to understand function for each type.
As I go through the todo list, I find often these "dimensions" that make very easy to create additional HS tasks if I have already described one. For example "porting" for sublime,eclipse, ACE etc. is another dimension similar to "type".

The other realization is that I was unable to HS the boxchareditor from scratch. I mean I could but I wouldn't get the architecture that would allow me to do the subsequent HS-ing.
In that sense the model we are following is a model whose ideal target (as HS client) is a very strong developer, (a developer with very strong architectural traits). You need to be such a developer to produce both the first version of the code and write the code in such a way that you can subsequently leverage a large number of contributors without spending too much time in education, documentation, merging  etc... 

So this HS is better targeting people that are strong developers that do have budget. That doesn't have a strong overlap with OD's clients or contractors. It might have more overlap with github's network.

On the positive side, creating a system that is targeting/attracting/gives more superpowers to top developers is bound to have good marketing characteristic - would not have to deal with the uphill marketing battle that OD had to face for most of its first years.

Monday, April 8, 2013

Fitbit

After the advice of a friend I went and got fitbit ones and a fitbit scale.
The obvious question is how I, the sworn against exercise person ended up buying health gadgets.
Before jumping to the obvious conclusion that I am just a hypocrite - my defense is that digitizing, recording, monitoring, capturing every aspect of my life, events, measurement is a something that I really believe in.  These devices do a bit more of that.

So far they worked ok. Problems, 
1. the fitbit one, does not sync with my HTC phone (I have to be carrying the little dongle in the laptop)
2. the fitbit scale doesn't sync with my wifi (I had to swicth one of my routers at a/b/g (doesn't like n) to make it work)
3. the fitbit one gets confused with my over-moving legs, it counted that I did 10 miles the first day I worn it - fix moved it from the pocket to the belt.

But asides of all that I am happy customer and so are the members of my family that got one as well.

Sunday, April 7, 2013

Freezing a deployable github repository

So here is my issue

This is about using github in a heroku style, and being able to keep versions of the repository as deployed sites.
So how to do that:

Lets assume that you have a repository e.g. https://github.com/ogt/boxchareditor that is "github deployable". Ie there is just one branch gh-pages - git push updates a live running site http://ogt.githb.io/boxchareditor in addition to updating the github repo.

So lets say that you want to keep a particular version as a referacable deployed url.

How do you do that:

> hub clone boxchareditor boxchareditor-1
> cd !$
> perl -p -i -e 's,ogt/boxchareditor,ogt/boxchareditor-1,g' * 
> git add .
> git commit -m 'changed links to repo to point to own repo'
> git remote -rm origin
> hub create -h http://ogt.github.io/boxchareditor-1
> git push origin gh-pages

I think I will make it a mini utility

> gitfreeze reponame freezedreponame



Saturday, April 6, 2013

Box char editor

Little utility to use as basis for some more HS experiments
  http://ogt.github.io/boxchareditor/
(it is obvious to me by know that the model of HS that I follow is for programmers.
It requires that you right a first version of what you want
It requires that the first version has an architecture that makes it easy for people to contribute, pull requests to not cause conflicts. This means that the basic file structure, modularization of your code has to be there - from you. This means that not only is it for programmers, but its actually primarily for strong programmers that can architect their code for change. Thats a rather different paradigm than the one that is made feasible by OD.

Anyway back to github.
Things I learned:

Creating a gh-pages branch and make it the default
Deleting your master branch

> hub clone repo
> cd !$
> git branch -D master
> git push origin :master
(assumes that you have already made another branch the default in the github -> settings->default branch place )

Adding a fork me image

Changing the home page/ description of the repository so as they both point to each other
  (the service points to its underlying code page, the code base points to the service)

This last bit seems important. In some sense, just like in old open source, the license would actually require that every binary distribution of the code would provide a reference to a place where someone can easily get the source code for the binary.

Similarly, in the "open startup" world, every web app/web service, should be pointing to a place where someone, can fork a repository which ideally can be autodeployed (assuming that you provide config vars/urls/credentials to any external services it may use/need).

boxchareditor satisfies that small requirement

Friday, April 5, 2013

Stopping coffee - continued

4 days have passed since the beginning of my cold turkey stop of coffee.
Yesterday, I was able to come home at 10:30pm driving the highway enjoying a unique first in many years experience: being sleepy and being still in control. I.e., I was able to stay awake by will.
That was an ability that I had practically lost in the past - sleepiness would come so hard that I would be unable to stop without resorting to extra-ordinary measures.
Then I went home and worked on my computer until 1-2am until I decided that I need a clearer mind to tackle a bug. An then I woke up by myself at 6:30 not feeling sleepy anymore.

Its awsome

Berkshire Hathaway

I was curious what are the companies held in the portfolio of the $250 dollars Berkshire Hathway...


Clicking the image above should provide a link to the flash from the cnbc BH portfolio tracker.

Anyway, it seems that BH represents the  "good, healthy Fortune 50 (or 500)  (I think that Buffer has declared that he stays out of tech/new/cool/(innovative?)/small? companies). In that sense the company exemplifies the successful big enterprise. In that sense its long term decline would provide the best metric for the trend that I am hoping to see, lots of small startups eating up big enterprises.
So the bet I would make is that the next 10 years will not be as bright as the prior 10 years for BH  .

Tuesday, April 2, 2013

Playing with Markdown and block characters


Using ├, ─, │, └ characters to describe the tree structure of a pip installable python module. It looks a bit better at http://stackoverflow.com/questions/8247605/configuring-so-that-pip-install-can-work-from-github

Here is how this post looks with GFM

foo 
├── foo
│   ├── __init__.py
│   └── bar.py
└── setup.py


And here how it would have looked with normal +, -, |

foo
+-- foo
|   +-- __init__.py
|   +-- bar.py
+---setup.py


I remember when I started programming, borland, pascal, dos. 1983 or so, the borland editor had a mode that allowed me, to use the arrows and "draw" any path I wanted using block characters.



Think F1 means single line block character mode, F2 means double line block character mode, and as soon as you enter the mode the editor would see the neighboring chars and would use the appropriate chartacter to make the whole thing look nice. The fonts for the single line were the 4 corners, 2 straits, 4 T and 1 cross. 11 all and all. + 11 for the double line, plus a higher number to deal with single-double line joints. The funny thing is that I remember more time playing with it than using it. It was very cool.
(Note to self - is there a sublime plugin that does sth similar? is there a font set wit similar characters? or the need for these chars disappeared with the influx CGA-> VGA and graphical (as opposed to text+block chars-based) windows...

wikipedia


DOS

In all MS-DOS code pages, box drawing characters are present, but their number is limited to 40 (for example in code page 437):
0123456789ABCDEF
B
C
D

Stopping coffee

I have been drinking coffee all my life - not real bitter coffee but greek frappe
My typical routine has been 1 morning frappee from home, 1 early afternoon frappe at work and I sip half a cup of a iced black coffee from the coffee shop in the evenning.

Anyway, yesterday I decided to stop cold turkey the injunction of caffeine into my system.
A friend has told me earlier that after he started drinking coffee he was unable to stay up without coffee. The feeling that I am left to be governed by my right brains whims and desires seems wrong to me.
And I always thought that my coffee use was rather re-creational - frappe with lots of milk and sugar doesn't taste like coffee - I am not addicted to coffee ...
Contrary to my expectations yesterday was a day where I had a constant headaches, I had a droopy had (felt like a chicken in greek terms).
Today I feel better :-).

I wonder how many days will need to pass until I will be able to stay late just from the pure control of my left brain.

Monday, April 1, 2013

Heroku's cost per dyno

I was always wondering ... how much does a dyno cost to heroku.
Heroku gives a free dyno per user (720 dyno hours per month) so that seems like a lot
especially given that the dynos behave like small EC2 instances - occassionally better occassionally worse. It seems to be costing the same as a reserved small EC2 instances... - but without actually reserving it for a year. Seems like a good deal right?

Lets assume that this was true, ie that heroku doesn't "auto-idle" your app.
My friend told me that Heroku uses lxc 
Searching Heroku+lxc at google shows very little and even the quora article that I found the most useful (which returned by google) has the lxc reference removed... I am thinking conspiracy theories here...

Anyway here is the information I found from the quora article:

Apparently heroku uses High Memory Extra large instances


High-Memory Extra Large Instance
17.1 GiB of memory
6.5 EC2 Compute Units (2 virtual cores with 3.25 EC2 Compute Units each)
420 GB of instance storage
64-bit platform
I/O Performance: Moderate
EBS-Optimized Available: No
API name: m2.xlarge



High-Memory Reserved Instances
Extra Large$272$0.169 per Hour$398$0.136 per Hour



and stuffs up to at least 60 dynos in each such machine.

like Heroku runs up to at least 60 dynos/workers per railgun instance, which appears to be an EC2 "High-Memory Extra Large Instance" with 17.1GB of RAM and two 2.67GHz CPU cores (see http://aspen-versions.heroku.com...)


Now, the link pointed above leads to a decommissioned app (more conspiracy theories..).
I wonder is he making up the 60 number?

Heroku states that each dyno gets 512MBs of mem.. (related info at heroku site + this article )but that would be 35 dynos per machine not 60...plus on top of that how do you get that cpu ? heroku promises much more than 0.1 EC2 compute unit (1 ec2 compute unit ~= a 1GHZ 2007 Opteron).
So it seems that the answer in all these is overbooking.
Heroku does the very convenient (and ok from my perspective ) thing of forcing people to write small apps that can be restarted and is much more efficient than an individual user at keeping a big number of apps to a single machine making sure all along to move apps around when their workload increases beyond what fits their machine... ie. I think they keep their promise of 512MB ram and 1 cpu)

Anyway, assuming that 60 is right, heroku's cost per dyno is  $0.169/hr x 24hrs x 30days = $121 / 60 dynos ~= $2/dyno every month. So they charge $45/month and theypay $2. The freebie dyno-month is a non negligible $2/month.. Of course auto-idling must be reducing that to a much smaller number.