Get in on the Ground Floor!!!

Having been a software developer for a few years I have to say that my favorite job offers or postings are those that guarantee their idea is revolutionary and as a developer I would be crazy to not want to get in on the ground floor.

Now I am not going to say that all startups are bad because clearly our industry has proven this point wrong.

What I do want to explain is that as a developer I and am I sure many others get this pitch sometimes too often. So recently when I was approached by a previous coworker looking for a developer to work on their new idea I tried to take some time to share some advice before turning down their offer.

DISCLAIMER – I know this person and while I am certain that their idea probably has some merit to it lately my time is filled with the workings of my own ideas on top of my normal work schedule and of course the schedule of a parent with a child whose day almost never seems to end of after school activities.

First and foremost you need to understand the simple fact that developers are regularly pitched the line about the next greatest idea. Don’t be discouraged if we don’t share your enthusiasm. Rather change your approach, remember that you need to sell your idea to us just like you would a potential investor or future customer.

Back when I was in college I wanted to get this part-time sales job because the hours were perfect and the commission was awesome. I learned their product (even better than the manager who interviewed me), was dressed to impress for the interview and attempted to wow with my knowledge.

At the end of the interview the manager asked me one simple question. “What is the most important skill of a salesperson?”

Stumped at first, the answer seemed simple, they had to know the product.

Wrong!!! The most important skill to a salesperson is to become their clients friend so as to build a level of trust when completing the deal. The interviewing manager sat down with me and explained as best as could be done to an 18 year old who knew everything at the time.

So first things first try to become friends with the development community and do so in a manner that doesn’t paint you as that creepy uncle who buys pizza for everyone. Take some time and learn the things we like to do and take an interest in us as much as you want us to take in your idea.

The next piece of advice should be simple and hopefully already be something you are doing.

Network, network, network.

I had recommend to my friend that they should try some of the local entrepreneurial events happening in our area.

Startup Weekend – I attended/competed in one of these events a couple of years ago and let me say that it was a blast. There is an even mix of people who are developers, marketers, sales and everyone else you can think of starting a company with. What makes these events successful is that from the very beginning a team is built which shares in the idea that the company they are building is the next greatest thing.

! Million Cups (1MC) – So while I have not attended my own local meet-up the positive feedback I hear from the community is that this is a must for new entrepreneurs. It ties back to the original idea of networking.

Hackathons – Ok so I know that some of you are probably thinking this would be a great event to meet developers and pitch your idea. While I can’t speak for all developers at these events I can share with you my personal belief. I am at the event to hangout with people who love developing software as much as I do. An unwelcome approach at an event like this will automatically land you in that creepy uncle category I mentioned earlier.

Finally, if a developer is going to dedicate their free time towards your project then you should understand that they will expect to be an equal partner in the adventure. You may have come up with the idea but we were the ones who transformed your idea into a tangible thing.

Take these recommendations and use or pursue them however you choose. I am sure that along the way more will be learned but hopefully this will get you started. I normally sign-off by saying “Happy Coding” but instead let me say this…

Happy entrepreneuring and the best of luck in making your idea a revolutionary one.

A UITextView with borders

Ok I very rarely ever work with the UITextView (more like ever) and this will be a quick post to go over what I am sure is probably a simple and widely known fix for some developers.

So in my current project I have a need for the user to be able to enter multiple lines of text as a way of storing notes:

screen shot

The screen looks simple and as such I assumed it would be easily laid out in the storyboard editor. Maybe that was my first mistake? The following picture gives you an idea of what it looks like in the storyboard and, without some code quick additions, what it also will look when run:

iosstoryboard

Are you thinking the same thing I was?  Where is the border that intuitively tells the users they can click and enter some text on the screen?

I don’t know the reason behind this (maybe someone can explain it) but apparently the UITextView does not come with borders that you can control or define with the storyboard editor. There is also no way to enter Placeholder text but I will leave that as a subject for a future post.

For now lets cover the solution of getting a border to surround the text area.

Make sure that you first include the QuartzCore.framwork and then for your view add the following include statement:

#include <QuartzCore/QuartzCore.h>

Then in your views viewDidLoad method add the following lines of code (make sure that you change the name to match):

- (void)viewDidLoad
{
   [super viewDidLoad];
   // Do any additional setup after loading the view.

   [[self.textViewNotes layer] setBorderColor:[[UIColor lightGrayColor] CGColor]];
   [[self.textViewNotes layer] setBorderWidth:.4];
   [[self.textViewNotes layer] setCornerRadius:8.0f];    
}

Run it and there you go.

I am not going to go into details about what each line of code is doing because in this situation I believe the code is doing a fairly good job at documenting itself.

Where did I get the numbers from you ask?? I hate to say this but I applied no science in those numbers and it was just guess work and trying to find something that matched the UITextField already on the screen. I tried using the getters on my title field (it’s a UITextField) but that didn’t work. Probably a subject for another post at some other time.

For now enjoy and as always Happy Coding!!

tick, tock… Time waits for No One

Ok so what I am about to discuss might be old news for most but for me it’s new. After discovering this I have to admit that I am a bit disappointed in myself for not already knowing this.

When implementing asynchronous methods in Node I had always done the following:

function asynchProcessFunc = function(callback) {
    setTimeout(function(callback){
        // process the request now
        callback(returnData);
    }, 0);

    // return back 
};

It was recommended by someone that I change this out for the process.nextTick(cb) method. Being a firmware developer in previous lifetimes the pure mention of tick had me intrigued.

Was it actually processing CPU ticks?

Turns out the answer was No but still what I did find was something far better than a zero based timeout. I had always known that setTimeout(cb, timer) with a zero based timer was never going to be accurate but I had decided it was the best I could ever get.

To get an idea of a difference between the two I wrote the following to measure setTimeout:

setTimeout(function(){
    var startTime = process.hrtime();

    setTimeout(function() {
        var timeDiff = process.hrtime(startTime);
        console.log('setTimeout time diff - ', timeDiff[0]*1e9 + timeDiff[1], '(nanoSecs)');
    }, 0);
}, 1000);

I rounded the average rate to 1600000.

I then changed the program to use process.nextTick() like the following:

setTimeout(function(){
    var startTime = process.hrtime();

    process.nextTick(function() {
        var timeDiff = process.hrtime(startTime);
        console.log('nextTick time diff - ', timeDiff[0]*1e9 + timeDiff[1], '(nanoSecs)');
    });	
}, 1000);

I rounded the average rate to 400000, which gives me a difference of about 4x performance increase. Depending on your product this I am sure will change but even the improvement comes in at 2x that is still a major performance increase.

Happy coding everyone.