Querying 20M-Record MongoDB Collection

Storify saves a lot of meta data about social elements: tweets, Facebook status updates, blog posts, news articles, etc. MongoDB is great for storing such unstructured data but last week I had to fix some inconsistency in 20-million-record Elements collection.

Storify saves a lot of meta data about social elements: tweets, Facebook status updates, blog posts, news articles, etc. MongoDB is great for storing such unstructured data but last week I had to fix some inconsistency in 20-million-record Elements collection.

The script was simple: find elements, see if there are no dependencies, delete orphan elements, neveretheless it was timing out or just becoming unresponsive. After a few hours of running different modifications I came up with the working solution.

Here are some of the suggestions when dealing with big collections on Node.js + MongoDB stack:

Befriend Shell

Interactive shell, or mongo, is a good place to start. To launch it, just type mongo in your terminal window:

$ mongo

Assuming you have correct paths set-up during your MongoDB installation, the command will start the shell and present angle brace.

>

Use JS files

To execute JavaScript file in a Mongo shell run:

$ mongo fix.js --shell

Queries look the same:

db.elements.find({...}).limit(10).forEach(printjson);

To output results use:

print();

or

printjson();

To connect to a database:

db = connect("<host>:<port>/<dbname>")

Break Down

Separate your query into a few scripts with smaller queries. You can output each script to a file (as JSON or CSV) and then look at the output and see if your script is doing what it is actually supposed to do.

To execute JavaScript file (fix.js) and output results into another file (fix.txt) instead of the screen, use:

$ mongo fix.js > fix.txt --shell

or

$ mongo --quiet fix.js > fix.txt --shell

Check count()

Simply run count() to see the number of elements in the collection:

 db.collection.count();

or a cursor:

 db.collection.find({…}).count();

Use limit()

You can apply limit() function to your cursor without modifying anything else in a script to test the output without spending too much time waiting for the whole result.

For example:

 db.find({…}).limit(10).forEach(function() {…});

or

 db.find({…}).limit(1).forEach(function() {…});

is better than using:

 db.findOne({…})

because findOne() returns single document while find() and limit() still returns a cursor.

Hit Index

hint() index will allow you to manually use particular index:

 db.elemetns.find({…}).hint({active:1, status:1, slug:1});

Make sure you have actual indexes with ensureIndex():

 db.collection.ensureIndex({…})

Narrow Down

Use additional criteria such as $ne, $where, $in, e.g.:

db.elements.find({ $and:[{type:'link'}
  ,{"source.href":{$exists:true}}
  ,{'date.created':{$gt: new Date("November 30 2012")}}
  ,{$where: function () {
    if (this.meta&&this.data&&this.data&&this.data.link) {
      return this.meta.title!=this.data.link.title;
    } else {
      return false;
    }}} 
  , {'date.created': {$lt: new Date("December 2 2012")}}]}).forEach(function(e, index, array){
    print(e._id.str);
    });

Call for Reviewers and a Free Copy of Rapid Prototyping with JS

Get a free copy of Rapid Prototyping with JS and provide us your competent feedback to help prepare for the new revision and publishing on Amazon.com. First 50 people to submit an application and qualify will receive a coupon for free download of Rapid Prototyping with JS.

Call for Reviewers and a Free Copy

Get a free copy of Rapid Prototyping with JS and provide us your competent feedback to help prepare for the new revision and publishing on Amazon.com. First 50 people to submit an application and qualify will receive a coupon for free download of Rapid Prototyping with JS.

  1. Fill a short form and wait for the coupon;
  2. Download the book for free on LeanPub;
  3. Send your feedback to (instructions will be provided later).

About Rapid Prototyping with JS

Rapid Prototyping with JS is a hands-on book which introduces you to rapid software prototyping using the latest cutting-edge web and mobile technologies including NodeJS, MongoDB, BackboneJS, Twitter Bootstrap, LESS, jQuery, Parse.com, Heroku and others.

50% Off During Holidays

By the way, you can get Rapid Prototyping with JS ebook in PDF, Kindle/Mobi, iPad/ePub formats and future updates for 50% off during holidays at https://leanpub.com/rapid-prototyping-with-js/.

My First Week At Storify

Last week I joined Storify — a destination for curated social media news. Storify helps you sort through the noise to find the voices online that matter.

Last week I joined Storify — a destination for curated social media news. Storify helps you sort through the noise to find the voices online that matter. To find more about Storify take a look at the guided tour.

Storify co-founder Burt and I met a couple months ago for the first time and I’m glad that we did. There were three main reasons for me to come on board: great team, awesome product and company vision, and cool tech stack that I’m passionate about: Node.js+Express+MongoDB.

Storify on Nodejs.org
Storify on Nodejs.org

The first week at Storify exceeded my expectations! So far there were: 4 team lunches, one birthday party, two (!) break-ins. In addition, I’ve worked on the front-page on my second day and had a chance to SSH to production servers.

A few word about the office, besides free snacks and espresso and being close to everything, there are two other startups, Buffer and HomeLight. The funny thing is that I’ve discovered and fallen in love with Buffer just a few weeks ago and now I’ve met with Leo and sit next to their brilliant team!

By the way, Storify is hiring bright minds: Operations Engineer and Front-End Engineer. If you want to do work on interesting things check out full job description.

Rapid Prototyping with JS is out!

Rapid Prototyping with JS is a hands-on book which introduces you to rapid software prototyping using the latest cutting-edge web and mobile technologies including NodeJS, MongoDB, BackboneJS, Twitter Bootstrap, LESS, jQuery, Parse.com, Heroku and others.

The Book is on LeanPub

Rapid Prototyping with JS is a hands-on book which introduces you to rapid software prototyping using the latest cutting-edge web and mobile technologies including NodeJS, MongoDB, BackboneJS, Twitter Bootstrap, LESS, jQuery, Parse.com, Heroku and others.

The book has 84 pages (in PDF format) or 13,616 words to be precise, step-by-step set-up, best practice advices, web development overview, 11 code examples (also available ready-to-go in GitHub repository azat-co/rpjs), flexible pricing ($9.99–19.99).

Order your copy of Rapid Prototyping with JS at LeanPub: leanpub.com/rapid-prototyping-with-js.

Rapid Prototyping with JS
Rapid Prototyping with JS: Learn how to build web and mobile apps using JavaScript and Node.js

LeanPub platform allows readers to receive infinite future updates (current version of the book is 0.3) and read the book in the most popular digital formats: PDF, ePub/iPad, MOBI/Kindle. The PDF version has footnote links which make it suitable for printing.

Download a free sample at samples.leanpub.com/rapid-prototyping-with-js-sample.pdf.

What Readers Say

Rapid Prototyping with JS is being successfully used at StartupMonthly as a training manual. Here are some of our trainees’ testimonials:

“Thanks a lot to all and special thanks to Azat and Yuri. I enjoyed it a lot and felt motivated to work hard to know these technologies.” — Shelly Arora

“Thanks for putting this workshop together this weekend… what we did with Bootstrap + Parse was really quick & awesome.” — Mariya Yao

“Thanks Yuri and all of you folks. It was a great session – very educative, and it certainly helped me brush up on my Javascript skills. Look forward to seeing/working with you in the future.” — Sam Sur

Who This Book is For

The book is designed for advanced-beginner and intermediate level web and mobile developers: somebody who has just started programming and somebody who is an expert in other languages like Ruby on Rails, PHP, and Java and wants to learn JavaScript and Node.js.

Rapid Prototyping with JS, as you can tell from the name, is about taking your idea to a functional prototype in the form of a web or a mobile application as fast as possible. This thinking adheres to the Lean Startup methodology. Therefore, this book would be more valuable to startup founders, but big companies’ employees might also find it useful, especially if they plan to add new skills to their resume.

Prerequisite

Mac OS X or UNIX/Linux systems are highly recommended for this book’s examples and for web development in general, although it’s still possible to hack your way on a Windows-based system.

Contents

Acknowledgment

Introduction

  1. Who This Book is For
  2. Prerequisite
  3. What to Expect
  4. Notation
  5. Web Basics: Hyper Text Markup Language, Cascading Style Sheets, JavaScript
  6. Agile Methodologies: Scrum, Test-Driven Development, Continuous Deployment, Paired Programming
  7. Node.js
  8. NoSQL and MongoDB
  9. Cloud Computing
  10. HTTP Requests and Responses
  11. RESTful API

Getting Started

  1. Development Folder
  2. Browsers
  3. IDEs and Text Editors
  4. Version Control Systems
  5. Local HTTP Servers
  6. Database: MongoDB
  7. Other Components: NodeJS, jQuery, LESS
  8. SSH Keys
  9. GitHub
  10. Windows Azure
  11. Heroku
  12. Cloud9

Building Front-End Application

  1. JSON
  2. AJAX
  3. Cross-Domain Calls
  4. jQuery
  5. Twitter Bootstrap
  6. LESS
  7. BackboneJS
  8. Example of using Twitter REST API and jQuery
  9. Parse.com
  10. Message Board with Parse.com
  11. Message Board with Parse.com: REST API and jQuery version
  12. Pushing to GitHub
  13. Deployment to Windows Azure
  14. Deployment to Heroku
  15. Message Board with Parse.com: JavaScript SDK and BackboneJS version
  16. Deploying Message Board to PaaS
  17. Enhancing Message Board
  18. Building Back-End Application

Building “Hello World” in NodeJS

  1. NodeJS Core Modules
  2. Node Package Manager
  3. Deploying “Hello World” to PaaS
  4. Deploying to Windows Azure
  5. Deploying to Heroku
  6. Message Board: Run-Time Memory version
  7. Test Case for Message Board
  8. MongoDB Shell
  9. MongoDB Native Driver
  10. MongoDB on Heroku: MongoHQ MongoHQ URL
  11. BSON
  12. Message Board: MongoDB version

Putting it All Together

  1. Different Domain Deployment
  2. Changing Endpoints
  3. Message Board Application
  4. Deployment
  5. Same Domain Deployment

Further Reading

About the Author

Order your copy of Rapid Prototyping with JS at LeanPub: leanpub.com/rapid-prototyping-with-js.

Markdown Goodness

I’ve been introduced to Markdown by my co-worker through GitHub and the need to document the services we’ve been working on at Gizmo. And soon I’ve become a huge fan of Markdown. Honestly, I don’t think I would have been so productive writing blog posts, training manual and Rapid Prototyping with JS book without the help of Markdown and my favorite Markdown apps which I’ll list later.

Markdown is a lightweight text formatting syntax which allows you to write in a plain text, read what you’ve written, and convert marked text cleanly, without any additional mess, into HTML. It is a very accessible and efficient way of writing books, blog posts, articles, technical documentation and pretty much everything which is meant to be on the Internet. Markdown is de-facto a standard in a tech community, since it’s perfect for inserting code blocks and links. Also Markdown is gaining popularity in book publishing, e.g., LeanPub is accepting books only in Markdown.

I’ve been introduced to Markdown by my co-worker through GitHub and the need to document the services we’ve been working on at Gizmo. And soon I’ve become a huge fan of Markdown. Honestly, I don’t think I would have been so productive writing blog posts, training manual and Rapid Prototyping with JS book without the help of Markdown and my favorite Markdown apps which I’ll list later.

Beautiful iA Write - my favorite Markdown app
Beautiful iA Write – my favorite Markdown app

Markdown is a lightweight text formatting syntax which allows you to write in a plain text, read what you’ve written, and convert marked text cleanly, without any additional mess, into HTML. It is a very accessible and efficient way of writing books, blog posts, articles, technical documentation and pretty much everything which is meant to be on the Internet. Markdown is de-facto a standard in a tech community, since it’s perfect for inserting code blocks and links. Also Markdown is gaining popularity in book publishing, e.g., LeanPub is accepting books only in Markdown.

Because Markdown doesn’t require typing too much extra code, like plain HTML, or using your touchpad/mouse, like Word, Pages, or Google Docs, Markdown is just a pure bliss. On the other hand if you’ve been dealing with plain HTML or WYSIWYG editors you know that it’s a matter of putting all those opening and closing angle brackets (<>) or cleaning up the extra mess. Really, who has time for that?

Markdown Sample
Markdown Sample

Here are the five most used styles, which according to 80/20 rule, aka Pareto Principle, will give you the most bang for you time:

  • Headers: use #,##, ###,…, e.g., # Markdown Post
  • Links: use: ([](), <>), e.g., [Cool blog](http://webapplog.com) will turn into Cool blog
  • Emphasis: for Bold use **bold** and Italic use *italic*;
  • Lists: just start with 1. item or * item and follow by space
  • Code: use var a=[]; or tabbed line before.

In case you have to dive deeper in to the markup, here is the original John Gruber’s Markdown: Syntax.

Note: there are many flavors of Markdown, such as GitHub or LeanPub, but those five styles should apply to all of them as they are considered to be the foundation.

And finally, here is my favorite Markdown tools which I can’t live without:

  • ByWord: apps which have nice UI/UX, tons of features, iCloud/Dropbox support, versions for: iPad/iPhone, and Mac OS X;
  • iA Writer: and similar to ByWord, although apps have less features which I guess was made on purpose to keep attention on the writing, versions for: iPhone/iPad, and Mac OS X;
  • Marked: preview app which supports multiple CSS files and many exporting functionalities, version for Max OS X;
  • Mou: free The missing Markdown editor for web developers which has live preview, version for Max OS X;
  • TextMate: plain code/text editor dubbed The Missing Editor for Mac OS X, version for Mac OS X.

And of course, you can use any text editor like Emacs, Vim, Sublime or Notepad for writing Markdown, — it’s just a text after all! Extra bonus: many websites and blogging platforms now support Markdown right off the bat, check with theirs FAQ/help.

Most Common Technical Questions for Early-Stage Startups

A lot of people like to pick my brain on technical things related to early stage startups, e.g., what framework to use, how long will it take to build an app or a website, should I hire or outsource. I decided to organize my answers to the most common technical questions in this post:

A lot of people like to pick my brain on technical things related to early stage startups, e.g., what framework to use, how long will it take to build an app or a website, should I hire or outsource. I decided to organize my answers to the most common technical questions in this post:

  • Don’t outsource your core product. Outsourcing to a digital agency is the best way to spend your money fast and usually fruitlessly.
  • Use frameworks, don’t write trivial things like URL parsers from scratch.
  • Use available solutions to your none-core components. Things like: CMS, blog, analytics, landing page, forum, version-control, bug-tracking/customer feedback, project management, etc.
  • Use PaaS or IaaS. Don’t use IaaS unless you really need to, for example when PaaS becomes cost prohibitive;
  • Make mobile your first initiative, if and when it makes sense for your business; don’t even build a website if mobile app is your bread and butter!
  • Code snippet: Learn Programming
    Code Snippet: Learn Programming
  • Use social connect APIs for smooth user on-boarding, most of your early adopter probably have at least Facebook or Twitter accounts; don’t make them type their emails and remember passwords.
  • Use the most appropriate programming language don’t rely on your geeky “guru” friend’s advice that programming language is a matter of personal preference, to go with PHP, or that Ruby on Rails and Node.js are just a fads.
  • Don’t over-rely on remote developers. It often leads to miscommunication; your teams will work longer, will have to spend more time and money; also, not everybody is disciplined well enough to work remotely without social interaction and direct supervision.
  • Don’t over-rely on part-time developers. It will take longer to execute, the code will be less efficient due to distractions and as a result harder to maintain and more expensive to run in the future.
  • Learn programming. Business co-founders without any programming knowledge will have a hard time understanding trade-off in features and available resources; expect longer sprint meetings and leap of trust between technical and business people.
  • Don’t have more that one language for your core-product on a prototype stage because code is not an asset, but a liability and maintaining fragmented codebase could lead to a disaster.
  • Start from scratch for your core-product or refactor your code often if you or your team are still learning a language or a framework; the longer you keep old spaghetti code the harder it will be to come back to fix it later.
  • Use Test-Driven Development and Pair-Programming.
  • Use peers and mentors help/feedback from fellow founders, programmer friends on meet-ups and at the office.
  • Involve developers in customer development process. Tech people just love to build things for the sake of building something complicated. It’s so hard to practice Lean Startup methodology, because you need a lot of self-discipline. And it’s just so tempting to go to your basement for 6 months, into your hacker/coding nirvana mode, instead of doing endless customer interview, landing pages, mock-ups, paper prototypes and face website! The problem is that you’ll usually end up with another useless app or website. I had similar a phat startup experience with what later became open-sourced project http://openList.co.

Best of the web goodies for agile web development, startups and Lean Startup startups:

If you like this post and want to lean more about building your web or mobile app using the latest tech and agile practices check out my new book on how to take your idea to a prototype with JavaScript, Node.js and MongoDB — Rapid Prototyping with JS.

LaunchRock vs KickoffLabs

KickoffLabs is a winner, in my humble opinion. I picked KickoffLabs for my Rapid Prototyping with JS book’s landing page because KickoffLabs offers more functionality than LaunchRock does. Although LaunchRock has better user interface interface and less clunky user experience.

UPDATE: KickoffLabs team kindly gave me one month worth of their service as a token of appreciation for spreading the word about them, I don’t think this in any way affected my review.

Tl;Dr

KickoffLabs is a winner, in my humble opinion. I picked KickoffLabs for my Rapid Prototyping with JS book’s landing page because KickoffLabs offers more functionality than LaunchRock does. Although LaunchRock has better user interface interface and less clunky user experience.

If you’re still bulging your own landing pages for whatever you’re launching, e.g., books, startups, apps, stop right now! Yes, I know, it’s not a big deal to throw together some PHP or Ruby on Rails, hook up email sign-up form and Google Analytics, and maybe even tinker with the design a little bit. Landing pages are all trivial but could be very time consuming especially if you’re a product perfectionist like I am. Lean Startup teaches us not to spend 10–40 hours putting together a landing page if there are solutions like LaunchRock, KickoffLabs and Unbounce!

LaunchRock

LaunchRock has seamless UI/UX
LaunchRock has seamless UI/UX

I’ve tried LaunchRock before they had a new design and multiple-site support, which is sadly unavailable for existing accounts, for CrowdSFX.

Pros:

  • easy step-by-step set-up and configuration;
  • user friendly design with live preview;
  • no hard selling.

Cons:

  • limited functionality and configuration;
  • no multiple-site supports for existing users.

KickoffLabs

KickoffLabs Dashboard is somewhat clunky
KickoffLabs Dashboard is somewhat clunky

Because I couldn’t set up new landing page with the existing account and I didn’t want to mess up with Google App setting up a separate email account for Rapid Prototyping with JS book website, I decided to try out KickoffLabs. I’ve heard about KickoffLabs from my designer friend, and she said that it had more features than LaunchRock, that’s even better I thought!

Setting up a landing page on KickoffLabs has started all right, but soon I realized that in order to get anything decent out of KickoffLabs service I needed to upgrade to a paid account. I went with the basic paid account which is $29/mo and got Google Analytics support, custom domain, no branding and something else. Google Analytics and custom domains are provided for free at LaunchRock, so it was sad to discover that I have to pay for those features at KickoffLabs.

Pros:

  • more features than LaunchRock;
  • easily customizable looks and feel;
  • free themes;
  • support multiple-sites.

Cons:

  • try to hard up-sell you on basic features like Google Analytics and custom domains (SRSLY?!);
  • some themes rely heavily on Twitter Bootstrap look and feel;
  • clunky user interface, easy to get lose in screens and menus.

In the end, I ended up using paid KickoffLabs account, for Rapid Prototyping with JS book with the unpaid old version of LaunchRock, for CrowdSFX project. Maybe I’ll try Unbounce next and write about it as well. No matter what service you choice to go with, just do NOT do your landing pages from scratch, or Gods of the Lean Startup movement will punish you! JK.

Follow up read on The Next Web — KickoffLabs beats LaunchRock out of the gate, throwing stones on the way.

PS: Scott Watermasysk, the founder of KickoffLabs, promised me a free month of service for this blog post. Let’s see if he keeps his promises :)

What We’ve Learned From Teaching the Trainings

A couple months ago, the team of StartupMonthly: Yuri Rabinovich and Vadim Slavin as instructors and facilitators, Micah McGraw as an assistant (thanks Micah!), and I as an instructor and author, ran another class of my Rapid Prototyping with JavaScript and NodeJS training.

From an idea to a prototype
Yuri Rabinovich – From an idea to a prototype

The training is a two and a quarter day intensive hands-on workshop designed for advanced beginner and intermediate programmers. The main goal is to take an idea to a functional prototype, known as Minimal Viable Product or just MVP in Lean Startup circles.

We cover agile software and business methodologies (Lean Startup), front-end development with modern tools (LESS, Parse.com, Git) and frameworks (BackboneJS, jQuery, Twitter Bootstrap), deployment to production with Platform as a Service (PaaS) solutions (Heroku, Windows Azure) and back-end development with highly efficient and scalable technologies (Node.js, MongoDB). You can find the detailed curriculum of Rapid Prototyping with JavaScript training: on WebAppLog blog, and on StartupMonthly website.

Rapid Prototyping with JavaScript training
Rapid Prototyping with JavaScript training

We’ve learned a great deal from our students. Here are some of the most important, in my opinion, things:

  • Trainees with different levels of programming skills have different interests and different questions. We had trainees who were asking questions about running NodeJS stack in production and on the other hand there were people who were struggling with basic examples, e.g., making AJAX JavaScript call.
  • We still stayed competitive as a business venture even after reducing the discounts by $100 to $200, e.g., classes at Marakana are 1.5–2x more expensive; therefore rising prices don’t often affect the sales.
  • Having more time to market and sell is more important than having a lower price per seat. We came to this conclusion when higher prices and two months marketing yielded better results than lower price and one month of marketing. The brand awareness of the training is still insignificant to account for it. We mostly used [StartupMonthly] network and social events, a couple hundreds of dollars on Facebook ads, posting on Hacker News, and emailing to JavaScript dev groups.
  • Full refund policy didn’t turn out to be a disaster; in fact, it might have helped us to sell out the tickets. There was only one student who requested the refund simply because he didn’t expect that the training would be so intense and not suited for total beginners in web development.
  • Setting up dev environment is not an issue with a good step-by-step manual. Thanks to the lessons we’ve learned from out previous training, more about it in this blog post — Pilot Rapid Prototyping with JavaScript and NodeJS Class, I had beefed-up the manual with more robust tutorials; and only 2 trainees showed up for our optional Friday night pre-course session to get help with setting up a development environment on their machines. This is a true Reverse teaching approach.
  • Examples usually are not interesting to some of the students. We had a more engaging class when the students worked on their own ideas rather than code examples from the manual. Because examples are boring, people copy/paste code instead of writing it. Which leads to…
  • Copy/paste students complete assignments faster, but some of them have no idea how basic stuff works :-( It came to no-surprise that those trainees experienced barrage of difficulties when they tried to work on their own ideas or to implement additional functionality on top of the examples provided in the manual.
  • Advanced students skipped the second day, on which we had fun with NodeJS and MongoDB. Bummer! They were only interested in front-end JavaScript prototyping to complement their Ruby on Rails or Java back-end skills, hence the demand for separate front-end training exists.
Rapid Prototyping with JavaScript training
Rapid Prototyping with JavaScript training

Recently, I had a conversations with a new technical education company, Catalyst, which takes people from zero to employment; something similar to Dev Bootcamp but for JavaScript, including technologies like jQuery, CoffeeScript, NodeJS, etc.
We concluded that with materials widely available in a form of books, screencasts, GitHub repositories, and other mediums, learning technical skills come down to motivation. And motivation comes mostly from self-identity. For example, if I self-identify myself as a developer (or engineer, programmer, hacker), I could stay up all night fixing bugs, hacking around an obscure platform limitation, or trying to meet a deadline; however, if I wear an entrepreneurial hat, I’m more inclined to look at the bigger picture and either to defer the issue or to delegate it to a more experienced person. Therefore, entrepreneurial types usually less motivated to solve pure technical problems.

In our next iteration of the Rapid Prototyping with JavaScript and NodeJS trainings we plan to change our approach from education to coaching by:

  • Extending the format from two days to three to four days;
  • Accepting only those teams of two to three people or one-man-band-type individuals who already have an idea;
  • Packaging training materials in a self-study kit starting with a Rapid Prototyping with JavaScript book.

Students will work on their ideas while tapping into mentorship and experience of industry leading practices in both technical and Lean Startup methodologies. Exact dates and location of the next trainings will be announced on StartupMonthly website and on my blog — WebAppLog.com.

What is Accelerator.IO?

It’s a new social network for entrepreneurs with productivity tools based on Lean Startup methodology. Accelerator.IO is a niche social network similar to dribbble, which is for designers, and Forrst, which is for developers. Main focus for us, team of Accelerator.IO, is to provide valuable tools and content for startupers, founders, hackers and hustlers by connecting them with mentors, investors and most importantly fellow entrepreneurs across the globe. It is important to state that Accelerator.IO is not a competitor to AngelList but rather a complimentary tool. In fact, we leverage AngelList API to gather entrepreneurial information about users such as company name and website URL. In a sense Accelerator.IO is a global online co-working space where smart and bright minds collaborate and learn from each others failures and successes.

Accelerator.IO
Accelerator.IO

The key features of Accelerator.IO:

  • curated access and content moderation to keep discussions interesting and engaging;
  • access to global network of like-minded people;
  • leveraging AngelList API for easier adoption;
  • reliance on the over 6,000 people network of StartupMonthly fund and startup accelerator, across Silicon Valley/San Francisco, Middle East and Europe;
  • productivity tools for entrepreneurs and startups founders based on Lean Startup methodology.

Right now Accelerator.IO is in beta testing. We accept early access sign ups and beta testers at http://signup.accelerator.io.

Last but not least, if you are looking for a side-project to pick-up a new skills in web and mobile development, or get a free access to startup social events and get exposure on web — Accelerator.IO is accepting volunteers: JavaScript developers, front-end or back-end (we’ll teach you Node.js if you’re only front-end dev right now).

Online Education Overview

Massive open online course or MOOC — is a type of online course aimed at large-scale participation and open access via the web. MOOCs are a recent development in the area of distance education, and a progression of the kind of open education ideals suggested by open educational resources.wiki

Up until recently, online courses were just poor imitations of traditional lectures captured on video camera. MOOCs emerged a few years ago with pioneers such as Coursera. They’ve become more and more popular as supplementary, continuing or even as a replacement for traditional education.

Online Education
Online Education

Free Online Courses

Here is a brief overview of free online courses:

  • Udacity: high quality free courses consisting of short videos with quizzes, homework, tests, engaging discussions among faculty and students, multiple levels of certification, job board featuring student profiles.
  • Coursera: same free high quality content as Udacity with broader selection of courses.
  • edX: similar concept as Coursera or Udacity; edX courses involve professors from MIT, Harvard and other top-tier universities.
  • Open Classroom: free online videos of Stanford University classes.
  • CodeAcademy: ability to learn JavaScript (other languages like Ruby on Rails are coming soon!) in your browser with automated tests.

Other Free Online Courses

These courses like Open Classroom are less comprehensive than MOOCs and usually lack discussion boards, tests and certification:

  • Academic Earth: free online classes and online learning tools from Ivy League universities, Massachusetts Institute of Technology, Stanford University, University of California at Berkeley and others.
  • Open.Michigan: hub for openly licensed educational content initiated by the University of Michigan.
  • webcast.berkeley: UC Berkeley’s central service for online video & audio for students and learners around the globe.
  • Open Yale Courses: free and open access to a selection of introductory courses taught by distinguished teachers and scholars at Yale University.
  • MIT OpenCourseWare: free publication of MIT course materials that reflect almost all the undergraduate and graduate subjects taught at MIT.

Paid Online Courses

These websites offer a wide variety of classes at relatively small cost:

  • Udemy: lots of discounts; courses on Lean Startup methodology.
  • Online Marketing Institute: all things related to online marketing; subscription-based.
  • Khan Academy: short videos primarily on high school subjects.
  • iTunes U: mostly videos and textbooks from top universities like Yale.
  • Lynda: paid business and software-oriented courses with homework, labs and tests.

Degree Programs and Education

For those who need a degree, the online education approach offers greater flexibility than a conventional one; various degrees can be earned part-time, at your own location and at a cheaper cost. Here are the most trusted (and in most cases accredited) options:

  • Kaplan University: more than 170 degrees and programs by an accredited institution.
  • DeVry University: online degree programs at the associate, bachelor’s, and master’s degree programs level.
  • Strayer: both online (called iCampus) and on-campus options with the same content and accreditation.
  • University of Phoenix: 20 years of experience in online education with accreditation in degree programs at the associate, bachelor’s, master’s and doctoral levels.

Screencasts

A screencast is a digital recording of computer screen output, also known as a video screen capture, often containing audio narration.wiki

Screencasts have become a very popular learning tool for programmers and IT professionals. Here are some top screencast websites for cutting-edge technologies such as Ruby on Rails, JavaScript and NodeJS:

Trends in Online Education

Here are some common hot trends which emerged in the past couple years in online education:

  • Reversed classroom concept (aka Flip teaching): instructors give the bulk of new materials as a homework for self-study and leave precious time with students for Q&A, tests, discussions.
  • Short videos: materials are easier to digest in short bursts, each usually followed by a quiz or summary.
  • Low-tech, conversational tutorial videos without the instructor as in Khan Academy video format.
  • Automation of tests: in-browser tests and even coding interpreters require less supervision from instructors.
  • Peers’ help on discussion forums: students help each other to clarify questions, give hints, find goofs and mistakes, and provide out-of-the-box answers to the problems; therefore, these discussions help to save faculty’s precious time.

Not always the old pro-verb “you’re getting what you pay for it” is right. In the past decade, the cost of conventional education has skyrocketed due to easily available student loans but efficiency stayed pretty much the same. The general trend is that education and online education especially is getting more efficient. MOOCs allow dozens of thousands of students to partake in a single course. Although, there are many regulated professions such as ones in medical or law fields where traditional degrees are a necessity, for the vast majority of IT jobs, portfolios and GitHub “resumes” have become more important than GPAs or names of prestigious colleges in the hiring process. It might be too early to say what impact these initiatives will have on hiring especially in big (conservative) corporations, but with high motivation and great materials most people can achieve amazing results in study without getting into debt.

In conclusion, my personal favorite MOOC website is Udacity. I even bought a T-shirt to support them. Would you pay thousands dollars for almost the same quality of materials? I wouldn’t but then I already have Master’s Degree from traditional university :-) So are MOOCs only for continued education? What do you think?

How to Decrease Chances of Success in a Startup

“Never make the same mistake twice.” – Gus Fring, Breaking Bad.

I’ve been in Silicon Valley a little bit over a year, but already have seen plenty of failed early stage startups. Therefore, I decided to organize my thoughts on observing key factors which might decrease chances of success in such. They are not deal-breakers. There are many examples of people succeeding against some of these rules, but in general it’s tougher and harder.

I never make the same mistake twice. I make it five or six times, just to be sure.
I never make the same mistake twice. I make it five or six times, just to be sure.

This list of red flags, or litmus tests, could be used by potential future employees, founders, or angel investors when weighing the pros and cons of a particular startup to join / invest in. So if you want to fail, here are some ways to do it.

  • Get a part-time founder or be a part-timer yourself. A startup is not a typical company. It’s a marathon (or series of sprints) but not a sprint. It’s important to maintain focus and not burn out.
  • Hire remote employees. For a majority of people working from home translates into no work at all not only due to lack of discipline but also because of distractions. Discrepancies in time zones, especially large discrepancies, slow things down, and miscommunications can lead to mistrust later.
  • Have too many business founders. Again, miscommunications between pure business people increase overhead and decrease runway time. In most cases there is no work for more than one pure business person in a team of less than 4–5 founders. Technical people can often perform a business task, but not vice versa.
  • Hire interns. Usually it’s a waste of time for founders unless there are some monotonous and time-consuming tasks. These tasks could be easily taught to interns and supervised later. But don’t delegate important tasks which are essential to your business.
  • Hire B- and C players. It’s the same thing as with part-timers, remote employees and interns. B- and C employees will drain resources (time, stipend money, salary and mental energy) to either learn basic stuff or by requiring constant supervision and micro-control. As a result, output has less in value than input. Beware, slackers bring down A players and inhibit idea-generating processes!
  • Have no domain expertise. Founders who have little or no domain expertise, and no desire to learn the industry or niche are not serious entrepreneurs. This should be self-explanatory. :-)
  • Work on the first idea which seems plausible. Intuition is a good thing only if and when propped up by good customer validation and market fit. Overly emotional attachment to an idea early in the game prevents looking at the data and pivoting when needed.
  • Validate ideas by your family, friends or unpaid customers. This point piggybacks on the previous one, and involves poor judgment and lack of action. There is nothing wrong with using your intuition initially, but there’s no excuse for lack of reality check.
  • Run a success theater. Spending lavishly on attending conferences, office space, chiefs, hacker house, cleaning, transportation, hotels while being far from profitable is border-line criminal due to the breach of founders’ fiduciary duties to the investors. In addition, it drains mental energy and distracts team and founders from more important things like growth, profitability and product development.
  • Date your co-founder. Dating might seem like a good idea when a couple is in harmony, but more often than not, all things that could go wrong in a startup do go wrong. This puts strains on personal relationships and adds drama (Bravo TV’s Start-Ups: Silicon Valley new TV show anyone?) because most humans are bad at keeping professional and personal boundaries.
  • Don’t work with your co-founders prior to starting a startup. Side projects, hackathons and just being pals in general (outside of work) could help greatly when/if bad times come during your venture together.

The average chances of failure in a startup are 90%. Founders should use any opportunity to improve the odds! Don’t make your work and life even harder, and look out for these early signs of trouble when dealing with startups.

Help to build new social network for entrepreneurs – Accelerator.IO

Accelerator.IO

Accelerator.IO
Accelerator.IO

We are building StartupMonthly internal system for community management with a potential to become new social network for entrepreneurs or Hacker News. With support of Steve Blank and Robert Scoble, we are incorporating StartupMonthly methodology for startup acceleration to improve productivity of startup ecosystems.

Join us as a Contributor

You will get exposure in the community and opportunity to work with StartupMonthly mentors, access to all the StartupMonthly events and all the cool technologies for rapid prototyping.

  • Frontend/Backend developers with BackboneJS, Node.JS and MongoDB skills.
  • Designer – Illustrator, Photoshop, CSS/HTML.

Please send your resume to info@startupmonthly.org, or Tweet to @azat_co or @byuric.

openList.co – Ad Classified Website Application

With openList.co you could have your own ad classified website set up in minutes. It comes with minimalistic Cragislist.org-like theme which provides unobstructive UI/UX.

Download

Quick Look

openList Home Page
openList Home Page
openList.co Category View
openList.co Category View

Features

  • Custom fields for ad categories like real estate, for sale etc.
  • Email verification and ad manager for deletion/editing
  • Ad flagging ie spam, like, violation, etc
  • Minimalistic design and use of templates ease customization
  • HTML filter, Captcha and WYSIWYG editor
  • clean URLs
  • photo upload
  • nested categories

Requirements

PHP5 or higher with GD support for Captcha, MySQL, access to .htaccess file.

Installation

  1. Download application as zip package or clone from GitHub repo (azat-co/openlist).

  2. Start your favorite local web server (e.g. MAMP) and MySQL database. Point localhost to your folder or change class/config.php file with a new host name, aka SITE_URL, more info below.

  3. Modify class/systemconsts.class.php file with your database parameters. By default they’re:

    const DB='test',
    HOST='localhost',
    DSN='mysql:dbname=test;host=localhost',
    USERNAME='root',
    PASSWORD='root';
    
  4. OPTIONAL: modify class/config.php file such parameters as language (English or Russian), numbers of ads/posts per page, number of days after which ad/post will expire, photo size limit, website URL, path to templates, etc.

  5. Run install.php by going to SITE_URL/install.php or localhost/install.php.

  6. View application at localhost or your custom host name (it will be pre-populated with data).

Customization

  • class/config.php – global constants.
  • class/systemconsts.class.php – database parameters.
  • install.php – initial data, e.g. cities, categories, custom fields, etc.
  • tpl/*.tpl.php – Savant3 templates (basically just PHP), aka “view” in MVC architecture.
  • class/model.class.php – “model” layer of MVC architecture, it uses PDO library.
  • class/service.class.php – business logic layer.
  • index.php and htaccess – “controller” layer of MVC architecture.

To change cities, categories and other data just modify SQL statements in install.php or edit your database with phpMyAdmin.

Libraries

Those dependencies are already included in the package/repository. You could use newer version at your own risk.

  • Slightly modified PHP template engine Savant3 – the backbone of application MVC architecture.
  • JavaScript and HTML WYSIWYG client-side editor TinyMCE for new rich text editor.
  • PHP HTML filter HTML Purifier for cleaning malicious user input.
  • PHP Captcha script Securimage

Deployment of Static Files to Heroku

If you use Ruby on Rails, Django or NodeJS frameworks on the same domains they have special folders, usually called static, public or assets. But what if you what deploy just “static” file which are usually not so static, by they way.

Heroku uses Cedar stack as an application creation tool and it doesn’t support flat-out deployment of static files such as HTML, CSS or JavaScript, unless they come with some server-side language, e.g, PHP, Ruby, Python. This might come in handy if you are using front-end applications build with jQuery or BackboneJS framework and services like Parse.com or Firebase.com or consume your own back-end deployed as a different application on different instance and/or domain.

There are multiple ways to trick Heroku and Cedar into thinking that your HTML, CSS and JavaScript files are PHP or Ruby on Rails, or any other legitimate Cedar stack, applications. Here is the simplest way is to create index.php file in your project folder, on the same level as your .git folder. You can do this in terminal with this command:

$ touch index.php

Then we turn off PHP with .htaccess directive. You can add line to .htaccess and create it with this terminal command:

$ echo 'php_flag engine off' > .htaccess

This two terminal command will create empty index.php file and .htaccess file which turns PHP off. This solution was discovered by Kenneth Reitz.

Another approach is less elegant but also involves PHP. Create file index.php on the same level as index.html in the project folder which you would like to publish/deploy to Heroku with the following content:

<?php echo file_get_contents('index.html'); ?>

Third way is to use Ruby and Ruby Bamboo stack. In this case, we would need the following structure:

 -project folder
    config.ru
   /public
      index.html
      /css
      app.js
      ...

The path in index.html to CSS and other assets should be relative. i.e. ‘css/style.css’. The config.ru file should contain the following code:

use Rack::Static, 
  :urls => ["/stylesheets", "/images"],
  :root => "public"

run lambda { |env|
  [
    200, 
    {
      'Content-Type'  => 'text/html', 
      'Cache-Control' => 'public, max-age=86400' 
    },
    File.open('public/index.html', File::RDONLY)
  ]
}

For more details, you could refer to official Bamboo Heroku documentation.

Last but not least, for Python and Django developers, you could add following to your urls.py:

urlpatterns += patterns(”, (r’^static/(?P.*)$’, ‘django.views.static.serve’, {‘document_root’: settings.STATIC_ROOT}),)

Or with this Procfile line:

web: python my_django_app/manage.py collectstatic --noinput; bin/gunicorn_django --workers=4 --bind=0.0.0.0:$PORT my_django_app/settings.py 

The full Django post is at Managing Django Static Files on Heroku.

If you use NodeJS, here is how to write your own server:

var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;

http.createServer(function(request, response) {

  var uri = url.parse(request.url).pathname
    , filename = path.join(process.cwd(), uri);

  path.exists(filename, function(exists) {
    if(!exists) {
      response.writeHead(404, {"Content-Type": "text/plain"});
      response.write("404 Not Found\n");
      response.end();
      return;
    }

    if (fs.statSync(filename).isDirectory()) filename += '/index.html';

    fs.readFile(filename, "binary", function(err, file) {
      if(err) {        
        response.writeHead(500, {"Content-Type": "text/plain"});
        response.write(err + "\n");
        response.end();
        return;
      }

      response.writeHead(200);
      response.write(file, "binary");
      response.end();
    });
  });
}).listen(parseInt(port, 10));

console.log("Static file server running at\n  => http://localhost:" + port + "/\nCTRL + C to shutdown");

Pilot Rapid Prototyping with JavaScript and NodeJS Class

Traditional Computer Science education sucks big time when it comes to modern agile technologies like Ruby on Rails, Django, NodeJS, and NoSQL databases. Last time I checked, the maximum that was offered were classes in Web Design I, Web Design II and Photoshop Basics. WTF?! Don’t get me wrong. I have Master’s degree in Information Systems Technology and value fundamentals, but I was never taught anything up-to-date. There was some ASP, some C++, some SQL, but most of my learning I had to do on my own. Sure there are tons information online and in books, but not everybody has time, dedication, focus and self-discipline to master a new technical skill this way. Reading a book or watching a screencast is just not enough. The best learning comes from 25% books, 25% peer-to-peer communication and discussion, 25% student-to-teacher relationship; the last 25% is the time and practice on your own.

I saw a huge need for effective technical trainings and decided to validate my idea. I already had plenty of teaching experience from college years, during which I wrote my first textbook, had it published on a curriculum for my classmates a year later, and from teaching yoga classes. I needed a pilot class, so I approached startup accelerator and fund, StartupMonthly, and offered to develop and teach the “Rapid Prototyping with JavaScript and NodeJS” training.

I chose JavaScript and NodeJS because students will be able to use the same language both for front-end and back-end development. Their brains don’t have to switch thus saving time and speeding the learning process. NodeJS is becoming more and more popular due to its real-time support and I’m very passionate about this technology. The training runs over a long weekend, starting on Friday night with an optional Q&A session on setting up your environment. Then, we have two full days on Saturday and Sunday, making the course 16 hours total. This way, people who have full time jobs don’t have to take time off to attend. The class is very hands-on and, as much as possible, inline with the principles of Flipped Teaching.

Rapid Prototyping with JavaScript and NodeJS - Day 1
Day 1

The goal was not to make a profit. So we priced the training very aggressively twice or thrice lower than the market price of our competitors in order to attract students. The results were amazing! The goal was to sell at least 10 seats and we had 15 people in our first class! Big thanks to Yuri Rabinovich, killer StartupMonthly team and its vast network of people interested in technology :)

Rapid Prototyping with JavaScript and NodeJS - Day 2
Day 2

Then the hard work began. In a true spirit of lean startup methodology (hey, this is what we teach, right?) the manual had only a bare minimum of information and was tailored towards intermediate web and JavaScript developers. The majority was doing well, but I couldn’t say that for everyone. This was a good feedback for me, and helped to improve the manual by including many simple steps and additional terminal commands for deployment and Git.

Optimize but not too over optimize
“Optimize, but not over optimize”

Overall, students were tired, but happy with the number of new technologies they’ve tried. It was sort of a Chinese Buffet of Programming. You don’t have to try everything, you only pick what you want and indulge in it :) Here is the list of topics to give you an idea:

  • Agile, Continuous Deployment, TDD, Pair Programming
  • Basic front-end technologies: JavaScript, HTML, CSS
  • NodeJS and its advantages. Event driven programming.
  • MongoDB and Document Store and Key-Value concepts.
  • JSON, structure and examples.
  • Could computing. Cloud platforms: Windows Azure, Heroku.
  • Structure of HTTP Request and Response: headers, body, methods
  • RESTful API, examples and advantages.
  • Overview of HTML: structure, tags and syntax. Inclusion of CSS, JavaScript files/tags.
  • jQuery: AJAX, cross-domain calls and JSONP
  • Twitter Bootstrap: grid layout, form components, icons
  • LESS: mixins, variables and compilation.
  • BackboneJS: structure, events, view, sub-views, models, collections and event listeners and event binding.
  • Parse.com: plain REST API calls with jQuery ajax function and JavaScript SDK with Backbone compatible library.
  • Generating of SSH keys, configuring Git, GitHub, Heroku and Windows Azure for deployment.
  • Installation and basic configuration of NodeJS and MongoDB in local environment.
  • Deployment of NodeJS and MongoDB and static/front-end applications to PaaS cloud services like Windows Azure and Heroku with Git.
  • Building sample applications with NodeJS, jQuery, BackboneJS, Twitter Bootstrap, MongoDB, Parse.com and other tools/technologies. Deploying it to cloud services.
  • Building your own idea/prototype and presenting it. Deploying it to cloud services.
  • Practicing Paired Programming and Test-Driven Development techniques.
Next Billion-Dollar Idea
Next Billion-Dollar Idea

By the end of the weekend, we had 3 teams with 2 to 3 people in each. The teams built or started to build applications using their own ideas. One of them was a remake of Reddit with better UX/UI and the other was a service for angry ex-girlfriends to post (mostly negative I suspect) feedbacks on their ex-boyfriends :)

Here are some testimonials from the students:

“Thanks Yuri and all of you folks. It was a great session – very educative, and it certainly helped me brush up on my Javascript skills. Look forward to seeing/working with you in the future” – Sam Sur.

“Thanks for putting this workshop together this weekend… what we did with Bootstrap + Parse was really quick & awesome” – Mariya Yao.

“Thanks a lot to all and special thanks to Azat and Yuri.
I enjoyed it a lot and felt motivated to work hard to know these technologies” – Shelly Arora.

Q&A Session
Q&A Session

Next weekend, August 10–12 2012, I’m teaching the second class of “Rapid Prototyping with JavaScript and NodeJS”. I’m exited to share my experience and passion with another 10–20 smart people and make a small dent in technical education!

“Advanced Prototyping with JavaScript and NodeJS” and “Mobile Prototyping with JavaScript” trainings are coming on the weekend of August 25–26 2012. We have other cities like Los Angeles and New York in a pipeline and, (knock on wood) the future for “Rapid Prototyping” series looks very promising .

Highlights from “Hackers & Painters” by Paul Graham

When I’m reading Kindle books I always highlight interesting sentences and paragraphs. I thought it would be good to have them in handy on a blog. The book “Hackers & Painters” is a collection of Paul Graham’s essays and a must-read for a developer aka hacker or non-technical startuper.

Hackers & Painters: Big Ideas from the Computer Age
Hackers & Painters: Big Ideas from the Computer Age by Paul Graham
  • Hacking and painting are the same. This came as a surprise to me. I always thought that developers and designers are the opposites side of one startup coin. PG even went to school to learn about painting which inspires me to improve my design skills.
  • “You need a good sense of design to judge a good design” — this is obvious, but good sense of design could be (and must be?) developed. While good design is subjective to peoples’ opinion, time can show the difference between good and bad design both in software and graphics.
  • “Big companies win by sucking less than other big companies.” In other words big companies try to minimize losses and risks by sticking to proven “good old” designs and products. As long as their competitors do the same, why bother? This is the main reason why startups could be more successful than big companies. Startup should do things differently, while big company can do what the other big companies are doing.
  • Don’t give away information. The good source to learn about technology other startups use is their job openings. “The more of an IT flavor the job description had, the less dangerous the company was.”
  • New design bring better ROI in new markets. Especially if the same people design and implement the product, e.g. Apple.
  • “Most hacker don’t learn to hack by taking college courses in programming.” My own experience and observation prove the same. I often explain this to non-technical people who is contemplating to enter a career of a software / web developer or a programmer. There is only so much you can learn in a college or a university. The ratio of time and money spent to the practical knowledge gained is so low that I usually try to talk them out of it. Seriously :)
  • Software specifications changes fast and far from perfect. This is an another advantage startups can use over big companies where feedback loop is longer and iteration cycles are longer too.
  • “In hacking. like painting, work comes in cycles.” This one is very true for me. I can hack literally for 24 hours (especially during hackathons) and then don’t do any coding for a few days. Just read or catch up on my emails. Maybe it’s because our brains are more efficient when they focus on one type of tasks — “plug in”.
  • Divide and conquer: each module or set of feature should have “an owner” who is responsible for making it shine. It communicates with other modules via interfaces.
  • Programs should be written for people to read, and only incidentally for machines to execute.
  • Practicing thinking differently big in life will make it easier to think differently on “small trips outside the box that people call innovative”.
  • “Argue with idiots, and you become an idiot.”
  • “Working to implement one idea gives you more ideas.” And the opposite is true by ditching the idea or delaying it other follow up ideas might never come or be delayed. “Get Shit Done” in other words. :)
  • There are only two sufficient things to know about business: build something useful and make more than you spend. I would also add that best business is when you solve other people’s problems.
  • “If starting a startup were easy, everyone would do it.”
  • Doing a normal job usually means that you effort is averaged by the rest of the employees performance. Same for working in small groups and / or startups: working with better performing people rises your average! A-type person in a company where majority is Bs and Cs will be in a worse situation. In small, 5–10 people groups, it’s easier to measure effectiveness of individual contributor.
  • Leverage is an impact you make and see in the end results. The best situation when you have both measurement and leverage.
  • “Big companies can develop technology. They just can’t do it quickly. Their size makes them slow and prevents them from rewarding employees for the extraordinary effort required.”
  • Chose the most difficult tasks, features, problems when making both strategical and tactical decisions — “run upstairs,” to get competitive advantage. “Start by picking a hard problem, and then at every decision point, take the harder choice.”
  • Selling later for more is easier than earlier for less. Big “companies doing acquisitions are not looking for bargains.”
  • The way to generate wealth is to please the customers by solving their problems. “Design your product to please the users.” And not to please VCs or potential acquirers.
  • “Brand is the residue left as the substantive differences between rich and poor evaporate.” One of the reasons is that it’s “inconvenient to do something expensive and custom”.
  • “Mistakes are natural. Instead of treating them as disasters, make them easy to acknowledge and easy to fix.” Everybody could fail. The characteristic of a strong person is raising up from the failures quickly and learning from them.
  • Silicon Valley today is fifteenth century Florence, Italy. The power of same-minded people is real, powerful and unique.
  • Cultivate and acquire domain expertise.
  • Programming languages are not created equal. It’s easier to understand this by comparing low-level language like Assembly to high-level languages like C++ or Java. But the same comparison becomes harder for high-level languages, for examples PHP vs Ruby on Rails. In same cases it boils down to personal preferences, and considering how conservative humans in general, even to religious-like points of views / “wars”: “the language I’m using is the best!” BTW, if you are still using PHP, please take a look, if you haven’t already, at this article PHP: a fractal of bad design and take a glance at actual PHP hammer with two claws. You can only see the difference after you are exposes to more powerful / better things. It’s called “blub paradox”.
  • “Object-oriented programming offers a sustainable way to write spaghetti code.” – http://www.codinghorror.com/blog/2007/03/your-code-oop-or-poo.html
  • Technical “book should be thin, well-written, and full of good examples”.
  • Be optimistic about solving the problem but skeptical about the quality of the solution at the moment.
  • Get the prototype in front of users ASAP!

Graham, Paul (2008–07–14). Hackers & Painters: Big Ideas from the Computer Age (Kindle Location 2021). OReilly Media – A. Kindle Edition.

I will puke if I hear array search interview question again

Array search, sorting and related interview questions are very boring, unreasonable and borderline irritating.

UPDATE: You can follow the discussion on Hacker News.

Figuratively of course but still, array search, sorting and related interview questions are very boring, unreasonable and borderline irritating. Last month I was looking what is out there on the job market. All this hype about shortage of developers got me interesting in exploring new opportunities. I enjoyed meeting new people and learning about technological stack and problems companies try to solve. There were about a dozen phone interviews and a half-dozen face-to-face meetings. Most of the companies are regularly featured on TechCrunch. They are your typical VC-backed, 100–300 people startups. They have tons of perks as bicycle storage, tennis tables, free drinks and lunches, nerf guns, casual approach, lots of beer — all these tricks to lure employees. :)

No puking please
No puking please

Now here is the bad part. It didn’t matter much what technology startups use or what level of seniority was required for the position I was interviewed for. No. 95% of the time there were variations of array search and sorting, finding min / max value in array combined with providing big O notation, complexity and efficiency of such algorithms and functions type of questions. Two times I was asked exactly the same question:

Write function find_matches(haystack, needle) which returns array of all the matched elements needle array in haystack array with duplicates considerations.

The best answer to this question involves the use of a hash in which keys are values of needle array elements. And values are counts of repetitions of needle array elements in haystack array. Second time I’ve heard it I was bored even more than my interviewer, the VP of that startup. :)

I understand that there is never enough time in a startup. I’ve been on the other side of an interview process a few months ago. But I never took a shortcut. Maybe arrays are the only thing those “brain-dead” people remember from C++ class they took 10 years ago to fulfill their Computer Science degree requirement. Yes, 10 years ago it did matter which function to use, because memory and CPU were expensive. Not anymore! When is the last time you had to write your own array sorting function or function that performs search in an array? There is always a function for that in a high-level languages like Ruby (index), JavaScript (indexOf) or Python (index). And if you did write your own that is probably because you couldn’t find it (learn how to Google) or you didn’t bother to find it. In both cases it’s usually a bad idea because build-in functions are very efficient and your / our code is usually not efficient. Why test and ask for something which you are not using in real development? Why not look at candidate’s GitHub repositories, live websites and apps? Why not solve real problems your startup has at the moment?

Another sad thing, which I gladly didn’t see that much (but there still were a few interviewers) in the Bay Area compared to the East Coast, is asking terms, function names, definitions, slang, etc. Expecting people to remember functions’ syntax is a sin in itself! All this leads to hiring people with good memory vs smart people. That’s especially wrong when all these information is only a Google search away. And being smart can’t be acquired or substituted with search engine results.

Dear interviewers, please be creative if your goal is to find creative, smart people! Also remember that code is not an asset. It’s a liability. The more you code the more you’ll have to maintain. :)

AngelHack Grand Finals Demo

FashionMetric team, which was selected as a wildcard for Grand Finals Demo of AngelHack arrived from Los Angeles couple days before the event. Before the event we had a little bit of a “startup drama” due to the fact that one of our developers has left the company the day before. But team pulled it together and even pitched to famous investor’s team via GoToMeeting.

Happy Anxious Minutes Before Talking to Investor
Happy Anxious Minutes Before Talking to Investor

AngelHack Grand Finals Demo is basically a “demo day” for hackathon teams. Teams are the winners of previous rounds from Boston, New York City, San Francisco and other cities. They were allowed to work on their ideas and even pivot and change teams during 2 weeks from the previous round. More that 30 teams from across the states flew to San Francisco to pitch to the group of investors and judges. And the rest of the world was able to watch the event live through UStrem. After the pitches and announcement of the winners there was a dinner with optional partying and socializing. Two winners took $25,000 each in seed investment.

AngelHack '12 Grand Finals Demo
AngelHack ’12 Grand Finals Demo

There were very interesting teams. For example Fly.io which enables users to manipulate their laptop / desktop just by the eyes’ movements. Some teams members were nervous and others weren’t prepared to answer tough questions asked by the judges (like we :) ).

Before going on stage
Before going on stage

Our team FashionMetric didn’t score any prizes but we got valuable feedback from Thomas Korte – founder of AngelPad incubator and other judges. Interesting enough that many attendees later said that Thomas was harsh and they don’t agree with his point of view but our team don’t think so :) I actually agree that one of our slides with 9% segment of men who buy online is somewhat misleading.

Special Award for ShareBrowse.com
Special Award for ShareBrowse.com

The winners were Appetas – restaurant menu enhancer and GiveGo – charity meets sport. And the Special Award went to the youngest hacker, 15-year-old founder of ShareBrowse.com – customer support without installation and hassle. On the next day we went to Googleplex in Mountain View.

Hackathon "Duck crossing"
Hackathon “Duck crossing”

Accidentally they were having Seafood festival which slowed down our guided tour before tech talks and lunch. Special thanks to Greg and his team for organizing AngelHack!

FashionMetric.com in Android Garden
FashionMetric.com in Android Garden

This website is not intended for use with JavaScript disabled

I’m working on materials for technical workshop. The topic is “Rapid Prototyping with JavaScript”. It is mostly about jQuery, Backbone, AJAX, RESTful APIs, NodeJS and MongoDB. So a lot of JavaScript on a client side and today I was asked a question by curious friend who saw my frequent updates about the event on Facebook:

“What about users who has JavaScript disabled?”

The questions made my smile and I intuitively answered:

“It’s 2012, right? The number of such users must be insignificant”.

And later I proved to be right — only 2% of Yahoo.com users have JavaScript disabled.

Another article shows why Yahoo.com data is a good source. It has almost all of the countries covered so we can get average numbers and numbers per each country.

But I wanted to analyze the change. Just about 5 years ago companies seriously considered not to innovate AJAX-y way so they can please non-JavaScript users. Now, I barely hear about such non-sense. Even the opposite is true – startups limit their environments to only WebKit browsers. What happened to that attitude? How did that happened? One theory is that Chrome and Firefox became more popular and an update to the newer and faster versions became just a click away or even automatic in most (default) cases. JavaScript de-facto became a web standard. Not using JS is a misfit.

I can’t imagine my life without Google Docs, GMail, Facebook chat and other wonderful things which are brought to us but small scripting language which started in 1995 at Netscape as a way to make text blink if not for the XMLHTTPRequest object. Brilliant minds even overcame cross-origin limitation with dynamically injecting script tags into to DOM. This technique is known as JSONP. But that is me — sort of advanced user.

Just a few days ago Adobe announced on 5th anniversary of iPhone release, which never supported Adobe Flash, that they will discontinue support of Flash plug-in in new Android 4.1, Jelly Bean. This event completes triumph of JavaScript as cross platform tool for web and mobile development.

For those unfortunate people (2% of Yahoo.com users) and search engine bots I must remember to put noscript into my HTML:

<noscript>
    This website is not intended for use with JavaScript disabled.
    Unless you are a googlebot, telnet or i486-PC user, please go get the latest version of Chrome.
</noscript>

One side note: mission critical applications without control over clients’ environment, corporate and government organizations which must try to server all users still have to take into account a lot of things which consumer facing and startup companies could get away with. Being section 508 complaint also falls into this category.

Super Simple Backbone Starter Kit / Boilerplate

During AngelHack, more details in my previous blog post, I struggled to find simple BackboneJS Boilerplate to start building our fashion prototype quickly.
If you are not familiar with BackboneJS it is a very powerful MVC framework for building thick client applications. It has fully RESTful API support via it’s model methods. So after half an hour of going through Backbone Boilerplate and other samples and tutorials I ended up using Sample App with Backbone.js and Twitter Bootstrap as a foundation.

So after this experience I decided to come up with my own super simple BackboneJS boilerplate or starter kit. It has bare minimum but all the necessary components:

To make it work just download zip or fork and clone it from GitHub.com: https://github.com/azat-co/super-simple-backbone-starter-kit. Then launch index.html in your favorite HTTP web server.

It’s a single-file application. Everything Backbone related is in app.js. Templates are in separate files and loaded via RequireJS, and Text plug-in for RequireJS.