Posts

Showing posts with the label Culture

The bizarreness of coding questions–it is time to cut the garbage?

Image
There have been a trend in the industry to evolve to pro-forma interviews running off stock questions that are actually rote based and often irrelevant to the position.    For an example that may make sense to you: Asking for any job that require writing emails , the following questions dealing with literacy: What is a Oxford Comma? What is a split infinitive and give me an example of a valid exception to the rule. What is the difference between obtuse and abstruse? What is the collective noun for a group of crows? (murder); quail? (covey); magpies? (tidings), etc If someone fails these questions, people could assert they are low literacy, and thus not qualified. In reality a person that aces these questions may write incomprehensible emails, while someone that funks these questions may write elegant clear emails.   In terms of coding questions, for a C# position you may get asked about single linked lists and how to do an AddBefore or other...

Expanding your language patterns: R

R (“GNU S”) is  a sweet language and environment for statistical computing and graphics. R is similar to the award-winning S system, which was developed at Bell Laboratories by John Chambers et al. It is also very similar to my first taught language APL/360 except it does not require special characters.   You can install it from http://www.r-project.org/ , there is a Windows version which comes with it’s own UI.   As simple example.  You want to calculate   1/1 +1/2+ …. 1/1000.  A verbose solution may be:   > a1 <- 1:1000 > sum(1/a1) [1] 7.485471   A one-liner (which APL is infamous for) would be: > sum(1/1:1000) [1] 7.485471   You can also do some really interesting stuff, like finding the sum of all the square roots from –1 to -45   >  a1 <- -1:-45 > a2 <- a1+ 0i > sum(sqrt(a2)) [1] 0+204.3985i   Yes, complex number support is native! ...

Tech Qu: Create a class and then a 2nd class that both overrides and overload.

A trivial item – but a few folks may get confused with the double “over”.     Code Snippet class MyBase   {      private string cr = "Open Source" ;           public virtual string Copyright()     {        return cr;     }        }    class MyOver : MyBase   {      private string lt = string .Empty;      //overload      public MyOver( string licensedTo)     {       lt = licensedTo;     }      public override string Copyright()     {        return "Company Conf " +lt;     }      // Overload      public string Copyright( string userName)     {        return Copyright()+ " " +userName;     }   }

Tech Qu: Implement a Stack as a Linked List

This is very much a low value question in the C# world because both exists in out standard library. An implementation is shown below. Additional items like Top, IsEmpty are easy adds. Code Snippet public class MyStack <T> : LinkedList <T>   {      public void Push(T item)     {        this .AddFirst(item);     }      public T Pop()     {       T result = this .First();        this .RemoveFirst();        return result;     }      public T Peek()     {        return this .First();     }   } Test Cases Code Snippet var test = new MyStack < int >();     test.Push(1);     test.Push(2);      Console .WriteLine(test.Peek());      Console .WriteLine(test.Pop());      Console .WriteLine(test.Pop()); With the console showing 2,2,1 as expected.

Tech Qu: Weighted picks from a list.

Image
Write a function that given a list of items and weights return a random item in the list taking the weights into account. The solution really depends if this is a one shot or a repeated call implementation. Code Snippet static Random rnd = new Random ();      public static int WeightedPick( int [] data)     {        var total = 0;        foreach ( var datum in data)       {         total += datum;       }        var pick = rnd.Next(total);        var accu = 0;        for ( var i = 0; i < data.Length; i++)       {         accu += data[i];          if (accu >= pick)         {          //DEBUG: Console.WriteLine(string.Format("rnd:{0}  item:{1}",pick,i));            return i;         }       }        return data.Length;     }   The code actually had a bug on the first cut. If the rnd is in the function, values will repeat because multiple calls may happen in the same RANDOM interval for the seed. The solution w...

Tech Qu: Maximum sub sequence which has equal number of 1s and 0s.

Image
You are given an array ' containing 0s and 1s. Find the maximum sub sequence which has equal number of 1s and 0s.   The solution is straight forward (using a long  so testing would be easy). We determine the maximum possible length and use this to shorten the loops. Code Snippet public static int Subsequence( long rawdata)     {        var data = new BitArray (System. BitConverter .GetBytes(rawdata));        if (data.Length < 2)          return data.Length;        var zCount = 0;        var oneCount = 0;        var sb = new StringBuilder ();        foreach ( bool datum in data)       {          if (datum)         {           oneCount++;           sb.Append( "1" );         }          else         {           zCount++;           sb.Append( "0" );         }       }        var endSearch =2 * Math .Min(oneCount, zCount);        var maxlength = 0;        var index = 0;        for ( int i = 0; i ...

Tech Qu: Find all palindromes in a string

Image
Wikipedia: A palindrome is a word, phrase, number or other sequence of units that can be read the same way in either direction (the adjustment of punctuation and spaces between words is generally permitted).   First, we need to define the minimum length to qualify as a palindrome. We’ll call this minLength . First filter non-letters and convert everything to upper case. Create an array of characters. Walk all possible strings of sufficient length and determine it they are matches. We avoid using string function to obtain good performance and small memory size. No recursions or functions calls   Function public static int Palindromes( string a, int minLength) {    int result = 0;    var letters = a.ToUpper().ToCharArray();    // remove spaces etc, leave only A-Z    var filtered = new StringBuilder ();    foreach ( var t in letters)   {      if (t >= 'A' && t <= 'Z' )     {       f...

Tech Qu: Data structure to store and add arbitrarily large number

Data structure to store and add arbitrarily large number Hi folks, I decided to play around with some of the silliness known as technical questions. At one time obtaining a University Degree was sufficient proof – until grade standards started diving to 20,000 leagues under the sea. In general, there are many right answers.   a) Design a data structure to store an arbitrarily large number b) How will you use it to store two such number and add them. c) Write down the class (code) for the data structure   We assume integers and not negative.   If it is arbitrary real then use: Code Snippet struct ArbitraryReal  {     public Stack < byte > LeftOf;     public Stack < byte > RightOf;     public bool Sign;  } This is an all in one function that could be decomposed.. Take the string, break into characters, then convert to integer. Conversion was done with an old fashion ...

How a technical conference should be / representing data

This last week I attended “Information Making Sense of the Deluge” hosted by The Economist (on my own dime and time). http://ideas.economist.com/event/information Available on line at http://fora.tv/conference/ideas_economy_information   First , this was the best conference that I have attended in at least 20 years… They had a strict “No Death by PowerPoint” policy. Less than 300 participants and 60 speakers. Talks and panel discussions were typically just 10 – 20 minutes each. A massive number of awesome speakers. Since we often present data, I should point folks to the works of Edward Tufte a Yale Emeritus Professor who is renowned for his data visualization and information design (see http://www.edwardtufte.com/tufte/ -- he is giving one-day courses in Seattle on the 20 th and 21 st of June). He has written publications on some of the problems with PowerPoints. These URLs will show some of his data visualizations: Bing Images Goog...

Contracting: End of Gig–some suggestions…

Often gigs are done on purchase orders. This means that you have lead time to prepare for alternatives if a renewal does not happen. I have had a few gigs where two weeks notice was required if the client decides to terminate early. Of course, the unexpected does happen, I recall one gig where I suddenly found that I could no longer sign in via-email or VPN into the client; I assumed it was a password issue – turned out that my contract was terminated abruptly (I had refused to work on December 25th for the new boss , and he terminated as a result – I was working for someone else in the same firm 6 weeks later…) It took almost a week before I got the official word through the agency that I was working through…   My usual practice is to always assume that the gig will not renew. This means that 4-6 weeks before the end of gig, I start putting out feelers. I will often drop resumes off to interesting adverts, looking for two types of gigs: Straight Contract Contract-To-...

Advice to new (and some seasoned) consultants

Image
At the start of this year, an old colleague that I have worked with in 4 different companies, decided to try consulting instead of being an employee. I gave him some advice of things that I try to do during my consulting career (and  as an employee). Here is a short list: Weekly Report If the boss prefers a weekly face to face, it is likely also a good thing to send a weekly report. For my current gig, I became slack because my key output was documents for review that always included the boss in the distribution list.  The key aspect is to enable the boss to be able to explain what you are doing (justifying your salary to his superiors) by just going to his mailbox.  Bosses that do not micro-management, often are not concern about week-to-week activities; they are concern about appearing to know what is happening. Make it easy for the boss! Weekly Report Structure My usual pattern is simple: Declare what you did in the last week Declare what you intende...

Types of Developers and IMHO what they are worth….

Last Friday I had a long discussion on different type of developers and their relevant value for an ongoing company. I am not talking about a startup-pancake (typically venture capital based whose model is to sell or flip into an IPO – then walking away with the money).   Support/Maintenance Developer This is a developer that is completely happy doing high quality fixes, dotting I’s and crossing T’s. It is typically a destination career – one that is grossly underpaid for their value.  In terms of construction industry, he is someone that comes in an fixes leaky roofs and windows, change furnace filters and all of the way up to doing minor additions. If you are familiar with Holmes on Homes , we talking of Mikes, and not the type that he ends up undoing and redoing.  A good one will often spend their entire career at one company, well appreciated (but likely underpaid!).   Release Developer This is where most developers ends at being.  Typically the...

IT Hiring: Time to reread Huxley’s Brave New World?

Actually for many managers today, read it for the first time. (It’s on line here )   “It's an absurdity. An Alpha-decanted, Alpha-conditioned man would go mad if he had to do Epsilon Semi-Moron work–go mad, or start smashing things up. Alphas can be completely socialized–but only on condition that you make them do Alpha work. Only an Epsilon can be expected to make Epsilon sacrifices, for the good reason that for him they aren't sacrifices; they're the line of least resistance. His conditioning has laid down rails along which he's got to run. He can't help himself; he's foredoomed.” For the illiterate, Alpha’s are the  smartest ones. The Harvard Business Review just made a video available called “ Hiring: Finding People Who Fit ” which echo similar thoughts.   Recently I have been mentoring several younger folks, and for some, I see the definite attitude that “ All people should be made in my image ”. No ability (or even consideration) of walking i...

Client Web Sites, Licensing and breach of contract

Yesterday I spent a hour and a half with a local developer who develops websites for local firms. He called because of my earlier posts on copyright issues. After getting a night to sleep on it, I suddenly said “dung, it’s a legal mine field today”. I will scenario two cases: A site using some form of open license software (i.e. JQUERY etc) A site using some 3rd party component that the developer is licensed for (for example, FLASH, TELERIK etc) “Our contract says that the customer owns the code” Without a lot of clean legal qualification of what the exactly means – you are in breach of contract with both of the above scenarios! The customer would need to sign the dozen of pages of legalesse required to qualify this. Why???? If you are giving them ownership of the code and using JQUERY, then you are saying that they own JQUERY and can legally sue anyone else that uses the JQUERY. If you exclude 3rd party components but supply code that sets or alter properties ...

Litigation: People in LLC Houses…

Lately I have been attempting to assist two former business partners in resolving a dispute. The problem arose because one of them resigned in writing from a LLC leaving the LLC completely in the hands of the other. There can be many reasons for someone doing so: The LLC is getting into murky legal waters and the person wishes to wash their hands of it to avoid being tainted with potential future problems; The LLC is financially underwater (which I believe is correct in this case) and the person decides that future efforts of getting it viable is not worthwhile the effort Typically, the person bailing out will form a new LLC and may pursue a similar business model. The dispute is an interesting one because it is akin to an employee quitting a company and then turning around and demanding severance, their chair, their PC and all of the software on it that was purchased by the corporation. It appears to be a combination of a sense of over-entitlement and not under...

Entrepreneurs Coffee: Personal Kanban and Lean Startup Methodology

Image
I attended Entrepreneurs Coffee this morning, see a lot of familiar faces and a few new ones. The speaker was Jim Benson, the author of the newly released book " Personal Kanban " as one of the founders of the Seattle's Lean Coffee. A few interesting notes that I took are: Jim and his partner(in DC) or clients will by on Skype 100% of the working day, not having a conversation – rather just hearing each other clicking away. When an issue arose, there is no need to make a telephone call or start a Skype conversation… he just speaks up !  Elegant approach. Sharing a virtual skype cubicle. Economy of scale does not work for Knowledge Workers – the more of them that you get involved, the lower the return per employee. I have seen this often and have been known to say “Don’t give me two developers to help me meet the deadline unless you really want to miss the deadline!”. Solo-coding (for me) often results in the highest output. Passing information and making sur...

Copyright, Open Source, Clean Rooms and Ignorance of the Law

Recently I was reminded (by being an observer to some drama) of the legal constraints that developers should know but frequently do not know – especially the new self-taught developers. I suspect that even some Computer Science graduates are ignorant here. Monkey See, Monkey Do –Lawyers Knock! Jack develops websites and a customer points him to a website that he wants emulated. Jack goes to the site and copy portions of the code from the site. Often the code is nothing more than a JavaScript function or a chunk of CSS. He uses these code fragments exactly as written (no renaming variables, changing line orders etc). He brings in a graphic designer that does a brilliant original design.   The site is ready, the customer is happy, Jack drops a check in his pocket.   Two months later, the customer phones Jack – he has just received a letter from a lawyer to take down the web site because it contains copyrighted material. Jack talks the customer into leaving it up. ...

EIKO–Experience In Koran Out…

I originally consider EIGO, Experience In Gospel Out, but felt that EIKO sound better.   On one of the Linked-In groups there was a lengthy discussion on architecture stack to use. What became very apparent was the trend to advocate a particular architecture primarily on the fact that you have experience with it. Opinions follow the same type of brand loyalty that you see with cars (Toyota, VW, Ford), computers (Linux, Mac, PC) and event TVs (Sony, VIZIO, Panasonic).   If MD followed the same brand loyalty –they would likely be deemed to be unprofessional and perhaps facing malpractices. One of the keys of being a responsible architect is to be profession which means become familiar with the different brands and to make rational decisions based on solid criteria. This means not slipping into plagiarizing marketing literature (which by definition, is not objective or rational), or opinions on the groups you frequent (most groups are inclined to a biased, self-affirming ...

Hot technology makes Intellectual Property easy to acquire hot goods…

Last Friday I attend a talk by Mark Anderson ,  Futurist and analyst with a 93+% success records for forecasts over the last decade (you can hear him on the BBC on Jan4,2011 ). The key item is that nation’s wealth comes from intellectual property, the knowledge (to produce goods) that other nations do not have. His concern is that the US is loosing it’s IP to other nations, China specifically – who does not protect foreign IP very much. When Boeing has to share it’s technology to get sales – it leads to a rather large hole in the foot.   A few years ago I was attending a security conference at the National Institute of Standards and Technology and heard that it was normal for most military firms to apply crazy glue to USB and firewire slots on every PC (forget about DVD or C D Burners). When I was teaching at NSB Bangor, one could not (legally) take a phone with a camera onto the base. With today’s technology, the amount of disabling is even more: No USB or Firewire t...

Startups: The Intellectual Properties dimension

This is a continuation of my startup series consisting of the prior posts of: Startups and Sql Server Databases Who should be in a startup team? So you want to do a startup – the “F” projects So you want to do a Startup – the “E” projects Startups: The napkin business plan Startup: Garage or Angel Funded or Solo So you want to do a Startup – the “A” projects So you want to do a Startup – the “D” Projects So you want to do a startup – the “C” projects So you want to do a startup–the “B” projects So you’re a developer and want to do a start-up … Some observations on Startups / Angels Funded Comp... If you want to do a startup there are three things to consider for Intellectual Property: Patents Trademarks Servicemarks NOTE THE FOLLOWING IS NOT LEGAL ADVISE – ALWAYS CONSULT AN ATTORNEY Patent means that some is new (novel) in how you are doing things. This may be something that seems minor like “One-Click” (Amazon). You can apply for patent on almost anything, and the track record for th...