<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5209901364844687221</id><updated>2024-09-02T07:02:29.167+03:00</updated><category term="Java"/><category term="HR"/><category term="hiring"/><category term="programming"/><category term="linux"/><category term="interviews"/><category term="management"/><category term="passwords"/><category term="security"/><category term="sysadmin"/><category term="system administration"/><category term="exception"/><category term="interview questions"/><category term="OO"/><category term="Taleb"/><category term="admin"/><category term="agile"/><category term="authentication"/><category term="automation"/><category term="black swan"/><category term="bosses"/><category term="bug"/><category term="bug fixing"/><category term="bug testing"/><category term="bugs"/><category term="catch"/><category term="code optimization"/><category term="code review"/><category term="date formate"/><category term="daylight savings"/><category term="debugging"/><category term="design"/><category term="df"/><category term="eclipse"/><category term="elevator pitch"/><category term="errors"/><category term="estimation"/><category term="exception handling"/><category term="extreme programming"/><category term="freenx"/><category term="funding"/><category term="gigantt"/><category term="gnu screen"/><category term="hardware"/><category term="hpc"/><category term="ipsec"/><category term="jvisualvm"/><category term="jvm"/><category term="kernel 3.0"/><category term="linus thorvalds"/><category term="log4j"/><category term="logs"/><category term="monitor"/><category term="no disk space"/><category term="nomachine"/><category term="nullpointer"/><category term="out of storage"/><category term="pair programming"/><category term="pitching"/><category term="plannin"/><category term="presentations"/><category term="probability"/><category term="profiler"/><category term="project management"/><category term="raid"/><category term="scripts"/><category term="shortcuts"/><category term="shutdown hook"/><category term="skills"/><category term="startups"/><category term="sudo"/><category term="sudoers"/><category term="terminate"/><category term="timezones"/><category term="try"/><category term="try and catch"/><category term="ubuntu"/><category term="unity"/><category term="unity2d"/><category term="visudo"/><category term="vpn"/><category term="webmin"/><title type='text'>CTOIsrael</title><subtitle type='html'>Experiences and Lessons learned from my position as CTO in a small tech company in Israel.  Follow me on twitter @ctoisrael.  Comment if you want help with something that I have written about.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-7540340864999322992</id><published>2012-02-05T12:26:00.000+02:00</published><updated>2012-02-05T12:26:09.679+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gigantt"/><category scheme="http://www.blogger.com/atom/ns#" term="hiring"/><category scheme="http://www.blogger.com/atom/ns#" term="HR"/><category scheme="http://www.blogger.com/atom/ns#" term="interviews"/><category scheme="http://www.blogger.com/atom/ns#" term="plannin"/><category scheme="http://www.blogger.com/atom/ns#" term="skills"/><title type='text'>As if I haven&#39;t written enough about HR</title><content type='html'>Readers of this blog will know I have a huge axe to grind about bad HR, particularly here in Israel (&lt;a href=&quot;http://ctoisrael.blogspot.com/2011/06/programming-tests-is-there-shortcut.html&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://ctoisrael.blogspot.com/2011/06/more-on-hiring-or-how-to-avoid-moron.html&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://ctoisrael.blogspot.com/2011/05/hiring-right.html&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://ctoisrael.blogspot.com/2012/01/interview-questions-some-ideas-and-why.html&quot;&gt;here&lt;/a&gt;). Bad interviews, bad interview questions, not bothering to filter candidates properly. &amp;nbsp;As my company grows and I start to look for new people, I strive to find better techiques for interviewing and hiring, that I have mentioned as potential solutions in my earlier posts, to getting that perfect match. &amp;nbsp;I have just found &lt;a href=&quot;http://skillsapp.com/&quot;&gt;Skills&lt;/a&gt;, a company that may go a long way to ensuring that the right CVs land on my desk. &amp;nbsp;I look forward to using them the next time I am hiring.&lt;br /&gt;
&lt;br /&gt;
I got to them from browsing the jobs on another site that I am excited about &lt;a href=&quot;http://www.gigantt.com/&quot;&gt;Gigantt&lt;/a&gt;. &amp;nbsp;Not that I am looking for a job, when I seen new companies I always like to look at what kind of people they are hiring. &amp;nbsp;It gives me a wider view of what they do and how they go about doing it. &amp;nbsp;Gigantt looks like an interesting and very userfriendly project planning tool and maybe just what I need right now. &amp;nbsp;Waiting to hear when I can start beta testing.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/7540340864999322992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2012/02/as-if-i-havent-written-enough-about-hr.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/7540340864999322992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/7540340864999322992'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2012/02/as-if-i-havent-written-enough-about-hr.html' title='As if I haven&#39;t written enough about HR'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-8762504539883552361</id><published>2012-01-16T19:24:00.002+02:00</published><updated>2012-01-18T17:44:19.136+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="freenx"/><category scheme="http://www.blogger.com/atom/ns#" term="hardware"/><category scheme="http://www.blogger.com/atom/ns#" term="hpc"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="nomachine"/><category scheme="http://www.blogger.com/atom/ns#" term="raid"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="unity"/><category scheme="http://www.blogger.com/atom/ns#" term="unity2d"/><category scheme="http://www.blogger.com/atom/ns#" term="webmin"/><title type='text'>My new super duper server</title><content type='html'>For the hardware geeks among you lets start with the specs.&lt;br /&gt;
Dell R810 platform&lt;br /&gt;
4x Intel Xeon E7-8837 2.67GHz 8 core processor&lt;br /&gt;
128GB RAM&lt;br /&gt;
6x300GB 10k RPM SAS drives (RAID5 using 1 as a hot spare)&lt;br /&gt;
&lt;br /&gt;
This server is for running simulations. &amp;nbsp;It is not serving up webpages, or in fact for any sort of internet application. &amp;nbsp;I needed plenty of parallel power and this is what would fit the budget and requirements best.&lt;br /&gt;
&lt;br /&gt;
So what did I do with it?&lt;br /&gt;
&lt;br /&gt;
Before I start, one of the reasons I am writing this blog is to get input. &amp;nbsp;If while reading this you see something that looks wrong, or a mistake, or that there is a better way to do it then feel free to drop me a line. &amp;nbsp;Let me know where I have gone wrong, and feel free to suggest improvements.&lt;br /&gt;
&lt;br /&gt;
This beast chews a large amount of electricity and makes a lot of noise. &amp;nbsp;It also pumps out a huge amount of heat. &amp;nbsp;My office is small so we elected to host it at a server farm near by and let them worry about all that. &amp;nbsp;When it arrive I went down there and installed it. &amp;nbsp;Spending a day in a server room is not fun if you don&#39;t have warm enough clothes, I can also recommend some fingerless gloves.&lt;br /&gt;
&lt;br /&gt;
Annoyingly when I started to install the OS I noticed something wrong with the Harddrive space. &amp;nbsp;I stopped the install and rebooted in the RAID management system. &amp;nbsp;Someone hadn&#39;t seen my note about having one hot spare. &amp;nbsp;I had to rebuild the RAID which took a while because the initialization took forever. &amp;nbsp;Having sorted that little problem out I proceeded to install Ubuntu Server 11.10.&lt;br /&gt;
&lt;br /&gt;
The simulation program that I have created is a written in Java and has a GUI front end for configuring the specifics of each individual simulation. &amp;nbsp;That meant some sort of graphical window manager. &amp;nbsp;I installed unity-2d ( I am pretty sure that this was a mistake). &amp;nbsp;Once installed I added GNU Screen, the Oracle version of Java, Eclipse, Firefox, Webmin and FreeNX.&lt;br /&gt;
&lt;br /&gt;
Reasons for my decisions:&lt;br /&gt;
&lt;br /&gt;
Ubuntu&lt;br /&gt;
I am most familiar with this distribution, I use it at home and for other systems at work. &amp;nbsp;I feel comfortable with it and under the time constraints felt I needed to chose something that required no time for me to learn. &amp;nbsp;Debian could have worked too as they are pretty similar and both use apt. &amp;nbsp;Given that they are similar I reasoned that there would be no difference either way, so I stuck to Debian. &amp;nbsp;My Other reasonable option was CentOS. &amp;nbsp;Not being familiar with that or with yum, I decided that I did not want to spend the whole day looking up how to install and operating system that I had never used before. &amp;nbsp;What I should have done was done some test installations on VMWare instances on my old server. &lt;br /&gt;
&lt;br /&gt;
Java&lt;br /&gt;
The simulations are optimization and testing of a live/ real time system that runs elsewhere, ie not on this particular server. &amp;nbsp;The simulations are far more computer intensive that the live system. &amp;nbsp;The original system that I created depended on a Java API. &amp;nbsp;There were no other options at the time. &amp;nbsp;As a result the software that I have written has remained in Java. &amp;nbsp;As time has gone on we have moved away from the original API and now we primarily use QuickFIX/J. &amp;nbsp;Another Java API. &amp;nbsp;QuickFIX has other APIs but considering how far I had come with the software already written in Java it seemed like it would take too much effort on my part to rework everything into another language like C++. &amp;nbsp;I picked the Oracle JRE &amp;nbsp;as I have had some trouble in the past with the ICEDTEA version.&lt;br /&gt;
&lt;br /&gt;
Unity-2d&lt;br /&gt;
Unity itself is a controversial window manager, Ubuntu created it as an alternative to Gnome3. &amp;nbsp;As a change from Gnome2 the previous default window manager its pretty drastic, and there are many people left feeling that the choices that they used to have with Linux are disappearing in a world of constrained window managers. &amp;nbsp;To be honest I do not agree, Ubuntu is aimed at the entire desktop market, their goal is to create an easy to use Linux desktop (or laptop) that you don&#39;t have to be a Linux guru to understand. &amp;nbsp;There are options if you want them chose something else. &amp;nbsp;I digress, I chose Unity-2d as there is only a standard graphics card in the server and I really don&#39;t need the full version. &amp;nbsp;I believe this was a mistake. &amp;nbsp;I should have opted for something even more lightweight and simple. &amp;nbsp;I am not sure whether this will cause me any problems but I could certainly have used something else. &amp;nbsp;I did however have to chose something. &amp;nbsp;As I said the application that I will be using is controlled by a GUI written in Java, I therefore must have X and a window manager. &lt;br /&gt;
My major annoyance with unity is that when I have many windows open I just want a regular taskbar. &amp;nbsp;The unity panel is annoying and can really slow me down. &amp;nbsp;Simple solution to this was using &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1865276&quot;&gt;gnome-panel&lt;/a&gt;. &amp;nbsp;I now have a taskbar at the bottom which makes life much easier switching between running applications. There was another options&lt;a href=&quot;http://www.liberiangeek.net/2011/10/add-taskbar-in-ubuntu-11-0411-10-with-panel-tint2/&quot;&gt; tint2&lt;/a&gt; but I prefered the more simple UI of gnome-panel.&lt;br /&gt;
For those of you wanting to know more about configuring unity in general have a look &lt;a href=&quot;http://askubuntu.com/questions/29553/how-can-i-configure-unity&quot;&gt;here&lt;/a&gt;. &amp;nbsp;And more on using unity&#39;s features &lt;a href=&quot;http://askubuntu.com/questions/28086/what-are-unitys-keyboard-and-mouse-shortcuts&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
Everything is working fine now as far as the window manager is concerned. &amp;nbsp;I still have my doubts though, it is possible that unity is slowing things down a little. &amp;nbsp;Possibly there is no escape while I need a GUI I must use something and this might be just as good or bad as any.&lt;br /&gt;
&lt;br /&gt;
Eclipse&lt;br /&gt;
I use &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;eclipse &lt;/a&gt;for my Java coding, so it is useful to have it available should I need to do something directly on the server. &amp;nbsp;I don&#39;t envisage needing it very often at all but better to have it available just incase.&lt;br /&gt;
&lt;br /&gt;
Webmin&lt;br /&gt;
I love &lt;a href=&quot;http://webmin.com/&quot;&gt;Webmin&lt;/a&gt;, it makes many sysadmin tasks very easy. &amp;nbsp;Additionally I have made it available over the internet so that I can view it from my office. &amp;nbsp;I especially like if for configuring the firewall. &amp;nbsp;Iptables can be a bit fiddly and Webmin makes life much easier.&lt;br /&gt;
&lt;br /&gt;
FreeNX
&lt;br /&gt;
I am using my FreeNX a free port of&amp;nbsp;&lt;a href=&quot;http://www.nomachine.com/&quot;&gt;NoMachine&lt;/a&gt;&amp;nbsp;NX server&amp;nbsp;for my remote desktop session. &amp;nbsp;The advantage of this compared to exporting the display is that it is easy to keep the current session alive, like most remote desktop software. &amp;nbsp;I have had trouble using VNC on Linux in the past and I had heard about FreeNX before. &amp;nbsp;Having searched around the internet I found that this was recommended. &amp;nbsp;An additional bonus is that it opens a separate session to that which is viewable directly on the server. &amp;nbsp;Instructions for Ubuntu installation can be found &lt;a href=&quot;https://help.ubuntu.com/community/FreeNX&quot;&gt;here&lt;/a&gt;. &amp;nbsp;I have not been able to set it up avaiable over the web on a browser but there are instructions &lt;a href=&quot;http://www.nomachine.com/documents/plugin/install.html&quot;&gt;here&lt;/a&gt;. &amp;nbsp;So far so good, configuration was easy and the NoMachine NX client for windows connects, disconnects and reconnects to existing sessions with no problems. &amp;nbsp;The interface is nice and fast over my Internet connection and so far I am happy with the results. &amp;nbsp;I can use my software in a nice full screen GUI over the Internet as if I was sat in front of the server myself.&lt;br /&gt;
&lt;br /&gt;
Thats my setup. &amp;nbsp;I will follow this post up with any gripes and problems that I have with my system as I begin to put it through its paces. &amp;nbsp;Let me know if you have any questions about what I did what I installed and if you have problems with any of these bits of software let me know, maybe I can help.&lt;br /&gt;
&lt;blockquote style=&quot;background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;&quot; type=&quot;cite&quot;&gt;
&lt;div&gt;
&lt;div dir=&quot;RTL&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/8762504539883552361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2012/01/my-new-super-duper-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/8762504539883552361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/8762504539883552361'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2012/01/my-new-super-duper-server.html' title='My new super duper server'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-158521480293261666</id><published>2012-01-04T11:00:00.000+02:00</published><updated>2012-01-04T11:00:03.639+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="black swan"/><category scheme="http://www.blogger.com/atom/ns#" term="bug testing"/><category scheme="http://www.blogger.com/atom/ns#" term="estimation"/><category scheme="http://www.blogger.com/atom/ns#" term="hiring"/><category scheme="http://www.blogger.com/atom/ns#" term="HR"/><category scheme="http://www.blogger.com/atom/ns#" term="interview questions"/><category scheme="http://www.blogger.com/atom/ns#" term="interviews"/><category scheme="http://www.blogger.com/atom/ns#" term="probability"/><category scheme="http://www.blogger.com/atom/ns#" term="Taleb"/><title type='text'>Interview questions - some ideas and why they are helpful</title><content type='html'>I have been away on vacation and I got some time to read, so I dug in to &lt;a href=&quot;http://www.amazon.com/Black-Swan-Improbable-Robustness-Fragility/dp/081297381X&quot;&gt;Black Swan&lt;/a&gt; by Nassim&amp;nbsp;Nicholas&amp;nbsp;Taleb. &amp;nbsp;He is an excellent and thought provoking writer. &amp;nbsp;I am reading this book extra slowly as I like to stop after every page or so and think about what he has written.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In the book he poses some interesting questions and I think some of them may be interesting to use as interview questions. &amp;nbsp;So that I don&#39;t leave you in suspense I will put the questions here and allow you to think about them while I give an further introduction to what I want to achieve, which is not necessarily the point that Taleb was making.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A) If you had no restrictions on folding a piece of paper and could physically fold it 50 times. &amp;nbsp;How tall approximately would the folded paper be?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
B) Given the number sequence 2,4,6. &amp;nbsp;Find the rule that determines the sequence. &amp;nbsp;You give three three number sequences that I will answer yes or no to if then conform to the rule of the sequence.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
C) If I flipped a fair coin 100 times and it came up with 99 heads, what is the probability that the next flip will be tails?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I have talked before about stupid interviews that waste my time as well as the time of the employees of the company that has been interviewing me. &amp;nbsp;I should note that I have been asked interesting questions and puzzles in some interviews and one or two silly ones too. &amp;nbsp;The one that springs to mind here is when I got asked if I could have any superpower what would it be. &amp;nbsp;If you are an interviewer asking that question be damn sure you have a good interpretation of the responses to this question. &amp;nbsp;Some people, even geeks, are just not in to comics and superheroes. &amp;nbsp;My answer to that question was that it is very hard to give an answer that couldn&#39;t be sinister. &amp;nbsp;Flying is probably pretty harmless, but mind reading/ control, invisibility, super strength are all things that could be used for bad just as easily as for good. &amp;nbsp;I didn&#39;t think it was a good question, but I tried to answer it as best as I answer good questions, by showing that it was flawed. &amp;nbsp;I then asked the interviewer the same question. &amp;nbsp;He gave me an unsatisfactory answer. &amp;nbsp;I should have asked him how he interpreted my answer, I don&#39;t think it made any difference to the result of the interview. &amp;nbsp;I will concede here that if the future employer is a huge comic book fan as are the team that the position is for, then it may be a useful tool for assessing how good a fit it will be for the future employee.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Additionally mathematical and logic puzzles may not give the best metrics for good employees when used incorrectly. &amp;nbsp;Know what you want to get out of the answers, it is not good enough to find a question on the internet and ask it hoping to determine that the answer will give and indication of whether the potential employee is capable of thinking outside the box or has above average logical reasoning skills.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Looking at the questions in a little more detail:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A) Firstly the answer I don&#39;t want to hear is that a piece of paper no matter what the size cannot be folded more than 7 times (This is the current accepted number for a regular piece of paper, though apparently a girl managed &lt;a href=&quot;http://answers.yahoo.com/question/index?qid=20060712141230AA9qtni&quot;&gt;12 times&lt;/a&gt; and came up with and equation to prove it). &amp;nbsp;I am not testing knowledge, and no one likes a smart ass. &amp;nbsp;Additionally I asked the question stating there were no physical restrictions. &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I want to see the reasoning and thought process. &amp;nbsp;First state your assumptions. &amp;nbsp;A piece of regular printer paper is clearly not 1cm thick. &amp;nbsp;I would accept the candidate making the assumption 1mm, though that is a factor of 10 out. &amp;nbsp;It is much closer to 0.1mm, however I am not testing knowledge here just reasoning. &amp;nbsp;Lets assume it is 1mm we can always divide by 10 to get the real answer later. &amp;nbsp;It should be fairly clear that the answer is 50^2 * thickness. &amp;nbsp;I do not expect the exact answer here. &amp;nbsp;But I would like an order of scale. &amp;nbsp;I have a short cut. &amp;nbsp;10^2 is 1024. &amp;nbsp;So for every ten folds the height of the paper goes up by a factor of 1000, this means that the answer is 10^15 times the thickness. If the thickness is 1mm then the length is approximately 1,000,000,000 km. The real answer given the actual thickness is 100,000,000km, about two thirds the way from hear to the sun. &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I have a confession, I am horrible at mental arithmetic. &amp;nbsp;I could train myself to be better at it, but I guess I just got lazy. &amp;nbsp;If I need to add something up accurately I usually have a computer, calculator or even a pen and paper handy. &amp;nbsp;What I am good at is estimating. &amp;nbsp;This is phenomenally powerful. &amp;nbsp;The ability to this well and accurately enough can be more useful than just plugging the numbers into a calculator. &amp;nbsp;If I look at some calculation and estimate the answer first, it is easy to see errors if I make a mistake when plugging the actual numbers into a computation device. &amp;nbsp;I attribute this lesson to Mr Roger Hand my A-level physics teacher, thank you so much for this it has been an invaluable tool throughout my life. &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I like to know the scale of big numbers. &amp;nbsp;It puts things in perspective, it is not the most important thing here but you can expand on the estimation aspect by equating a large number with something that it represents. &amp;nbsp;100 million km really doesn&#39;t mean that much to me. &amp;nbsp;The distance to the moon is 400 thousand km, so it is considerably more than that and as I said two thirds the distance to the sun. &amp;nbsp;If someone said its about the distance to the sun, then that would be satisfactory. &amp;nbsp;It&#39;s about the right order of magnitude.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Enough about estimation. &amp;nbsp;The other skill this highlights is knowledge and understanding of powers of two. &amp;nbsp;I honestly wouldn&#39;t care if the candidate had to write down the powers of two, as long as they stopped at 10. It should be obvious at that point how to short cut to the answer from there.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I will highlight why these two things are necessary for a candidate that I would employ. &amp;nbsp;We deal with large numbers. &amp;nbsp;Millions and tens of millions of dollars. &amp;nbsp;We multiply that by fractions of pennies. &amp;nbsp;If we are producing results that are factors of 10 out is should be obvious from an estimate done before that calculation. &amp;nbsp;This is pretty critical as we are talking about real money transactions and position management. &amp;nbsp;The powers of two should be second nature to any Computer Science graduate. &amp;nbsp;We recently had to send out messages to a system in byte codes. &amp;nbsp;I spent far too much of my time explaining the binary, decimal and Hex representations of these strings to my employee. &amp;nbsp;It was immensely frustrating for both of us, but we got through it. &amp;nbsp;In a world of high level languages, it is too easy to forget the roots of computing lies in bits and bytes.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
B) What three sequences did you think of? &amp;nbsp;1,3,5; 8,10,12; 20,22,24. &amp;nbsp;The answers would be yes, yes and yes. &amp;nbsp;Your conclusion would be increments of 2. &amp;nbsp;You would be wrong. &amp;nbsp;That answer is clearly a possibility but not what I was looking for. &amp;nbsp;You may argue that it fits your sequences. &amp;nbsp;Of course so does the correct answer. &amp;nbsp;You may get defensive, and say how was I supposed to determine that. &amp;nbsp;To which I would answer that you must try to find a sequence that doesn&#39;t fit. &amp;nbsp;Using the following 3 sequences: 1,3,5; 5,10,15; 6,5,3, would result in yes, yes and no. &amp;nbsp;1,3,5 confirms your initial assumption that the number increment by 2. &amp;nbsp;5,12,15 disproves that the increments must be 2 and that they must be regular. Finally 6,5,3 shows that the sequence cannot be descending. &amp;nbsp;The answer is that the sequence must be ascending, and that is all. &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It can only be shown by finding counter examples as well as examples. &amp;nbsp;If you just go about proving yourself right with each suggestion you will get locked in a corner. &amp;nbsp;A candidate able to simply solve this should be good a bug testing. &amp;nbsp;A successful bug test is one that fails, any other bug test does not show evidence of a bug. &amp;nbsp;This must not be confused with show evidence of no bugs. &amp;nbsp;A semantic difference for sure, but a very important one.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
C) &amp;nbsp;This takes me back to school. &amp;nbsp;The concept of a fair coin and a fair die. &amp;nbsp;That means that it is not unfairly weighted, there is no bias. &amp;nbsp;It should conform to probability. &amp;nbsp;Of course if the question was I flipped a fair coin 5 times and it was heads. &amp;nbsp;The probability of a tail would reasonably still be 50%. &amp;nbsp;I would not expect anything else. &amp;nbsp;However as the numbers grow the statistics should tend towards conforming to the true probabilities. &amp;nbsp;I would reasonably expect around 60/40 one way or another for 100 tosses and maybe 55/45 for 1000 flips. &amp;nbsp;To have 99 out of 99 flips come up the same, you would be a little foolish to assume that I was telling the truth about it being a fair coin. &amp;nbsp;So OK, its a trick question of sorts, but it is more of a real world problem. &amp;nbsp;I have been told something, but I have evidence to prove otherwise, now I must draw a reasonable conclusion. &amp;nbsp;I am not trying to trick you, I am trying to get you to solve a problem of two conflicting bits of information. &amp;nbsp;I want to here that it should be 50/50 if its a fair coin, but it doesn&#39;t seem to be a fair coin. &amp;nbsp;Equally I do not want to hear that it&#39;s clearly going to be a 100th head. &amp;nbsp;You would have ignored my statement that its a fair coin, and assumed that just because something has happened one way 99 times in a row then it is going to be the same on the 100th time.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Here we see that that real world problems do not always fit into classroom style examples. &amp;nbsp;The world fits the normal distribution less than we think it does. &amp;nbsp;It also gives an example of how probability and statistics fit together. &amp;nbsp;A reasonable candidate should understand and show this in their discussion of the question.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I hope this has given and potential interviewers some ideas on what to ask and how to understand the answers they get. &amp;nbsp;Please comment and let me know what you think about this, and if you have any other suggestions.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/158521480293261666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2012/01/interview-questions-some-ideas-and-why.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/158521480293261666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/158521480293261666'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2012/01/interview-questions-some-ideas-and-why.html' title='Interview questions - some ideas and why they are helpful'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-4202348144529252554</id><published>2011-08-10T10:58:00.000+03:00</published><updated>2011-08-10T10:58:10.336+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="passwords"/><category scheme="http://www.blogger.com/atom/ns#" term="security"/><category scheme="http://www.blogger.com/atom/ns#" term="sysadmin"/><category scheme="http://www.blogger.com/atom/ns#" term="system administration"/><title type='text'>More on Passwords</title><content type='html'>Following my last rant about &lt;a href=&quot;http://ctoisrael.blogspot.com/2011/07/passwords-and-security.html&quot;&gt;passwords&lt;/a&gt;. &amp;nbsp;Today&#39;s &lt;a href=&quot;http://xkcd.com/936/&quot;&gt;XKCD&lt;/a&gt;&amp;nbsp;is right on the money. &amp;nbsp;However it requires sysadmins to change their silly requirements about having between 6 and 8 letters, with one capitalization and one numeral. &amp;nbsp;It is clear that the longer a password is the harder it is to guess by a computer. &amp;nbsp;However if you pick words from around your office (like they do in the movies) you could be susceptible to a really good human guess.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/4202348144529252554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/08/more-on-passwords.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/4202348144529252554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/4202348144529252554'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/08/more-on-passwords.html' title='More on Passwords'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-62588182355011635</id><published>2011-07-19T17:00:00.002+03:00</published><updated>2011-07-19T18:21:41.332+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="agile"/><category scheme="http://www.blogger.com/atom/ns#" term="code review"/><category scheme="http://www.blogger.com/atom/ns#" term="extreme programming"/><category scheme="http://www.blogger.com/atom/ns#" term="pair programming"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Advantages of pair programming and or good code review</title><content type='html'>I had a little problem with some code that went live an through a NullPointerException, causing various problems in the production system. &amp;nbsp;It was far from a disaster but not great that such a thing should happen. &amp;nbsp;Additionally The error was hard to track down to its source. &amp;nbsp;When I did track it down I found the problem described in this &lt;a href=&quot;http://ctoisrael.blogspot.com/2011/07/excpetions-if-you-havent-caught-on-then.html&quot;&gt;post&lt;/a&gt;. &amp;nbsp;As soon as I saw it I knew that was contributing not only to the issue but causing additional problems. &lt;br /&gt;
&lt;br /&gt;
The key here was that in testing which I reviewed with the author of this code everything was OK. &amp;nbsp;I would like to have unit tests for everything testing every possible issue. &amp;nbsp;But we don&#39;t. &amp;nbsp;Its not always practical, its not always easy to know the issues ahead of time. &amp;nbsp;We should, I should insist on it. &amp;nbsp;Would projects that are running late run later, most definitely. &amp;nbsp;Would we have less problems once they went live, almost certainly. &amp;nbsp;I just don&#39;t have the man power right now to get everything done, and remember I am not the boss. &amp;nbsp;My superiors are all non technical. &amp;nbsp;They want things done yesterday. They don&#39;t understand why it isn&#39;t ready just that it isn&#39;t. &amp;nbsp;As long as I can rule out critical bugs it works in my favour to get things rolled out and running, and solve the minor issues as the come up. &amp;nbsp;Its inefficient and its bad practice. &amp;nbsp;Solution, if you are in the same position as me then get a bigger budget and hire and extra programmer or two.&lt;br /&gt;
&lt;br /&gt;
With or without the extra man power there are two possible methods that can be used to avoid at least some of the issues that come up when going live with new code. &amp;nbsp;&lt;a href=&quot;http://www.extremeprogramming.org/rules/pair.html&quot;&gt;Pair programming&lt;/a&gt; and code review. &amp;nbsp;At my previous place of employment we used both to ensure as few mistakes as possible. &amp;nbsp;Pair programming is an interesting method, because it requires one computer and two people. &amp;nbsp;One is in the driving seat and the other sits next to them and contributes. &amp;nbsp;Anyone familiar with &lt;a href=&quot;http://en.wikipedia.org/wiki/Agile_software_development&quot;&gt;Agile &lt;/a&gt;or &lt;a href=&quot;http://www.extremeprogramming.org/&quot;&gt;Extreme Programming&lt;/a&gt;&amp;nbsp;will be familiar with pair programming. &amp;nbsp;When it works its great. &amp;nbsp;The time lost by having to programmers work on one piece of code is gained back by having higher quality of code, that is easier to maintain, and with less bugs. &amp;nbsp;Even things like the write / compile / test cycle is improved by having less syntax errors (due to them being spotted by the one not doing the driving). &amp;nbsp;Ideas are generated and turned over faster. &amp;nbsp;When it comes to maintenance or fixing the bugs that do get through having two people that worked on the code originally can be very helpful. &amp;nbsp;If one is off on vacation or sick, or worse has left the company, the other is likely to be around. &amp;nbsp;This extra ownership of the code is so helpful in these situations.&lt;br /&gt;
&lt;br /&gt;
An old colleague of mine envisioned people rotating the pairs reasonably frequently, lets say one person worked with one pair in the morning and another in the afternoon. &amp;nbsp;The more people you have the more possible pairs. &amp;nbsp;This could mean even more that two people have some ownership of the code. &amp;nbsp;Switching pairs around will give people the opportunity to take a break from each other, which is often needed in some cases, and to find really constructive and destructive pairings, to be either encouraged or discourage in the future. &amp;nbsp;An additional benefit of pair programming is the lack of other distractions, you cannot be sitting in front of some code when working with someone and then suddenly check your facebook/gmail/twitter. &amp;nbsp;You will certainly need more breaks, but you wont spend real coding time wasting it on the internet.&lt;br /&gt;
&lt;br /&gt;
Where it breaks down is when you do not have many people it can still be done but without the variance of a large group. &amp;nbsp;The number of possible pairings is n(n-1)/2 (triangular numbers), so in smaller groups this is limited. &amp;nbsp;Additionally not all possible pairs work. &amp;nbsp;I was often paired with weaker coders which meant I was doing most of the thinking. &amp;nbsp;It was also frustrating for me not driving because the driver was working so slowly. &amp;nbsp;In some projects I was working with one other programmer and we would spend some time working on the same code and other time working separately. &amp;nbsp;The other coder would frequently get stuck and ask to do some work in a pair. &amp;nbsp;This was code for either me working and explaining what I was doing to his code as I went along, or sitting behind him growing ever more frustrated as I told him what to do. &amp;nbsp;That was a particularly nightmare case. &amp;nbsp;Other pairs that I worked with were great. &amp;nbsp;We thought alike, solved problems quickly together and saved time exactly in the ways mentioned above. &lt;br /&gt;
&lt;br /&gt;
Code review is a lot more annoying but is a great final barrier before moving to production. &amp;nbsp;I would often work with another coder on some code, then later go to someone more senior than me to be my pair for the installation. &amp;nbsp;This meant that I had to explain all changes to the senior person, who would look over the code for any glaring errors, and understand the changes that I had made. &amp;nbsp;Installation was made safer by having someone look over my shoulder making sure that I didn&#39;t do something stupid in production. &amp;nbsp;The reason its annoying to do is again because it means taking the time of someone senior to go over something you know well again. &amp;nbsp;If you want to get something in to production quickly it can be really annoying having someone asking you to justify every line of code. &amp;nbsp;However in the long run this is the safest way to do things.&lt;br /&gt;
&lt;br /&gt;
If you haven&#39;t tried pair programming, try it, even for a couple of hours a day.&lt;br /&gt;
Happy coding.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/62588182355011635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/advantages-of-pair-programming-and-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/62588182355011635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/62588182355011635'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/advantages-of-pair-programming-and-or.html' title='Advantages of pair programming and or good code review'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-353330275508591232</id><published>2011-07-18T10:54:00.002+03:00</published><updated>2011-07-18T16:08:29.777+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="passwords"/><category scheme="http://www.blogger.com/atom/ns#" term="security"/><category scheme="http://www.blogger.com/atom/ns#" term="sysadmin"/><category scheme="http://www.blogger.com/atom/ns#" term="system administration"/><title type='text'>Passwords and Security (cont)</title><content type='html'>And just like that here we have it&lt;br /&gt;
https://browserid.org/&lt;br /&gt;
an attempt by Mozilla at unifying your login. &amp;nbsp;This is exactly whats needed. &amp;nbsp;One login for all sites, cue Lord of the Rings reference.&lt;br /&gt;
There are many sites like banking sites that may not work with this straight away, especially as my bank likes me to change my password every 2 minutes. see previous &lt;a href=&quot;http://ctoisrael.blogspot.com/2011/07/passwords-and-security.html&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;
But with initiatives like this I can see things moving in the right direction.&lt;br /&gt;
Google goes a long way towards this, once you are signed in to Gmail you are signed in to all Google products. However that is limiting in that you may want to use something other than Google on the web.&lt;br /&gt;
&lt;br /&gt;
Safe surfing...</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/353330275508591232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/passwords-and-security-cont.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/353330275508591232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/353330275508591232'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/passwords-and-security-cont.html' title='Passwords and Security (cont)'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-7685198794284604809</id><published>2011-07-09T13:27:00.000+03:00</published><updated>2011-07-09T13:27:30.125+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="passwords"/><category scheme="http://www.blogger.com/atom/ns#" term="security"/><category scheme="http://www.blogger.com/atom/ns#" term="sysadmin"/><category scheme="http://www.blogger.com/atom/ns#" term="system administration"/><title type='text'>Passwords and Security</title><content type='html'>I have too many passwords, way too many. Its dangerous I am signed up to many websites, often using my email as a username. I am careful though not to use my the same password for my email as I do for the websites where my username is my emails address.&amp;nbsp;http://bit.ly/rqYTu0 XKCD sums this up quite nicely. &amp;nbsp;I am a big fan of using google account /facebook /twitter logins for other sites. &amp;nbsp;This makes perfect sense to me. &amp;nbsp;I only need one strong password for my gmail account and google with authorize my login to other sites. I really hope many sites pick this up, the internet will become a much safer place, though could force some people to get accounts with services they do not want. The other day I almost signed up to facebook as it was the only way to log in to a site. &amp;nbsp;I didn&#39;t in the end so I never got to use that site, but doubt many people will be in this situation.&lt;br /&gt;
&lt;br /&gt;
This was not the main purpose of this rant. &amp;nbsp;There are some sites, mainly banking, and also at a previous company where you have to change your passwords every 3 months. &amp;nbsp;I just think this is totally excessive. &amp;nbsp;No one takes security seriously at this point. &amp;nbsp;Every time I have to change my password one of two things happen. &amp;nbsp;I forget my password and I get locked out or I have to write it down on paper and leave it next to my computer. &amp;nbsp;Additionally in order to try to remember it I have to pick something easy to remember. &amp;nbsp;I am not the only one that does this. &amp;nbsp;That being the case the very process used to create more security is actually creating less security. &amp;nbsp;So Sysadmins I beg you, stop this there are better ways to increase security. &amp;nbsp;Insist on very secure passwords that never change or use something like and &lt;a href=&quot;http://www.rsa.com/node.aspx?id=1156&quot;&gt;RSA secureID&lt;/a&gt; key. &amp;nbsp;I admit that they are not always practical measures but at the same time they are better than this pseudo secure method of changing passwords every 3 months.&lt;br /&gt;
&lt;br /&gt;
/rantover</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/7685198794284604809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/passwords-and-security.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/7685198794284604809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/7685198794284604809'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/passwords-and-security.html' title='Passwords and Security'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-7186123161031155034</id><published>2011-07-08T16:39:00.000+03:00</published><updated>2011-07-08T16:39:21.928+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code optimization"/><category scheme="http://www.blogger.com/atom/ns#" term="debugging"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="jvisualvm"/><category scheme="http://www.blogger.com/atom/ns#" term="jvm"/><category scheme="http://www.blogger.com/atom/ns#" term="monitor"/><category scheme="http://www.blogger.com/atom/ns#" term="profiler"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>JVisualVM - Java&#39;s hidden monitor and profiling tool</title><content type='html'>There are a few different ways of profiling your Java application. &amp;nbsp;One is using the -prof switch when calling running a Java app. &amp;nbsp;This will output a profile file when the app is terminated. &amp;nbsp;Another is a third party app like &lt;a href=&quot;http://www.yourkit.com/&quot;&gt;Yourkit&lt;/a&gt;. &amp;nbsp;Yourkit is great, but you have to add a something to the commandline and after 30 days full free trial is its super expensive.&lt;br /&gt;
&lt;br /&gt;
Finally in recent editions of the JDK there is jvisualvm.exe. &amp;nbsp;Make sure you have the JDK and not just the JRE. &amp;nbsp;locate the install directory and find the bin directory. &amp;nbsp;There you should find the executable. &amp;nbsp;Once you open it up you can go to tools and add some additional plugins. &amp;nbsp;On the left hand side you will see the available JVMs that are connected. &amp;nbsp;The good thing about this profiler/monitor is that you don&#39;t need to add anything to the commandline like you do with Yourkit. &amp;nbsp;In your kit you have to add something to connect to that yourkit agent. &amp;nbsp;Here it just connects and you can see all the JVMs running. &amp;nbsp;Each instance of Java should run in a new JVM so you can run and view many different programs at once. &amp;nbsp;It gives you a basic view of the memory and processor usage along details about calls to GC and the number of threads and classes being used. &amp;nbsp;Additionally you can run a profiler to which will sample the application and give details of either cpu or memory usage. &amp;nbsp;This is extremely useful in finding memory leaks or in my case optimizing your code. &amp;nbsp;I do a large amount of number crunching which tends to use a lot of memory and cpu, using jvisualvm I have reduced the amount of memory used and made the whole process more efficient. &amp;nbsp;There are other features that let you view information about classes.&lt;br /&gt;
&lt;br /&gt;
I came across and a problem when running jvisualvm the other day. &amp;nbsp;The executable ran and but it did not detect my running application. I ran an old version of my application and found that it was detected. &amp;nbsp;In the end I have discovered that for some strange reason the java executable has to be running with code located on the same drive. &amp;nbsp;Its very strange but seems to be the only solution I am aware of. &amp;nbsp;If anyone else has seen this problem let me know, especially if you solved it in another way. &amp;nbsp;As usual drop me line if you have questions that I haven&#39;t answered in this post.&lt;br /&gt;
Happy optimizing.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/7186123161031155034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/jvisualvm-javas-hidden-monitor-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/7186123161031155034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/7186123161031155034'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/jvisualvm-javas-hidden-monitor-and.html' title='JVisualVM - Java&#39;s hidden monitor and profiling tool'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-3776545221947248530</id><published>2011-07-06T02:54:00.000+03:00</published><updated>2011-07-06T02:54:45.239+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exception"/><category scheme="http://www.blogger.com/atom/ns#" term="exception handling"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="try and catch"/><title type='text'>Excpetions - if you haven&#39;t caught on then you should try to</title><content type='html'>I am sure this has been said before but I came across an error that occurred yesterday. &amp;nbsp;I was told the code was working. &amp;nbsp;For the most part I could see that in the staging environment it was working just fine. &amp;nbsp;Sunday comes around. &amp;nbsp;My install day. &amp;nbsp;I check the staging environment. &amp;nbsp;I find that there is a null pointer exception. &amp;nbsp;The code crashed at a strange point. &amp;nbsp;With some deduction I realize where the error is coming from. &amp;nbsp;A method was called on an object that was clearly null, hence causing the exception. &amp;nbsp;The object that caused the exception was instantiated on the line before. &amp;nbsp;So no doubt there. &amp;nbsp;I the method called on the line before returns the object in question so I look at the method, which happened to be in a different class. &amp;nbsp;I see:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public SomeObject badMethod(InputObject obj){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; try {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;code some of which that could cause an exception..&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; including declaration of SomeObject&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and return of the instantiated object&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; catch (Exception e) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return null;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Two big problems with this, possibly three. &amp;nbsp;The minor of all of these is that so much code is in the try block. &amp;nbsp;I am not sure if this is wrong, but at the same time it doesn&#39;t look right mainly from a maintenance point of view. &amp;nbsp;I had to delete the try and catch lines to find out which line of code require the exception handling, thanks to Eclipse that bit was simple. &lt;br /&gt;
&lt;br /&gt;
I found out that the exception was actually a ParseException.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;TIP #1:&lt;/b&gt; When using try catch blocks to catch exceptions, catch the specific exception. &amp;nbsp;Always be more explicit when you can. &amp;nbsp;Code is more understandable and you have the specific exception object available to you in the catch block.&lt;br /&gt;
&lt;br /&gt;
The really big problem was how this was handled. &amp;nbsp;Theoretically I have no problem with returning null from a method. &amp;nbsp;However if you use a method that could return null that value must be handled. &amp;nbsp;Sometimes it is better if the method throws an exception instead. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;TIP #2:&lt;/b&gt; If the method could return null you must test for it. &amp;nbsp;Otherwise you will end up with a nasty NullPointerException&lt;br /&gt;
&lt;br /&gt;
In my case I ended up with an unhandled NullPointerException instead of a ParseException. &amp;nbsp;I had no further information about this as well. &amp;nbsp;This brings me to another point, at the very least you want to have the line&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;e.printStackTrace();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
in the catch block. &amp;nbsp;At least then you can track the exception properly. &amp;nbsp;Better still use a logger, and add a little message of your own perhaps with some variable values printed so that you have an idea of what went wrong in your log or on your console. With most loggers you can add the the exception itself as an argument and the logger will handle outputting the relevant information from it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;TIP #3: &lt;/b&gt;Use a logger to print a sensible message from the catch block.&lt;br /&gt;
&lt;br /&gt;
In this example the there was no real exception handling in the code. &amp;nbsp;The catch block just returns a null which is not handled in the calling code. &amp;nbsp;My solution in this case was to add a sensible logging line and throw the exception again. &amp;nbsp;This way the exception is passed up the stack. &amp;nbsp;The key here is that it forces the calling method to handle this exception. &amp;nbsp;In this case that works, I needed an extra try catch block, but the error will be handled better. &amp;nbsp;Now the parse exception will be passed up through the calling stack and the method will now handle this error correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;TIP #4:&lt;/b&gt; Handle the exception, its not enough just to print the stack trace or log the error.&lt;br /&gt;
&lt;br /&gt;
Conclusion:&lt;br /&gt;
The tips I have presented here are very important when dealing with exceptions in Java. &amp;nbsp;It is too easy, especially in Eclipse which does so much for you, to leave the printStackTrace() in there and not do anything else. &amp;nbsp;But they must be handled. &amp;nbsp;Learn to use them problem and exceptions will be your friend. &amp;nbsp;Errors will be handled correctly and the code will run more smoothly and hopefully be a little more readable.&lt;br /&gt;
&lt;br /&gt;
Happy coding.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/3776545221947248530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/excpetions-if-you-havent-caught-on-then.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/3776545221947248530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/3776545221947248530'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/07/excpetions-if-you-havent-caught-on-then.html' title='Excpetions - if you haven&#39;t caught on then you should try to'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-2998222184090678735</id><published>2011-06-30T07:54:00.000+03:00</published><updated>2011-06-30T07:54:26.137+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="df"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="no disk space"/><category scheme="http://www.blogger.com/atom/ns#" term="out of storage"/><title type='text'>Problem with reporting of disk space</title><content type='html'>I ran out of room on a drive. &amp;nbsp;It was reporting that there was 0 space left on the drive. &amp;nbsp;I delete some files and then after running df -h it was still reporting 0 space left on drive. &amp;nbsp;I found this&lt;br /&gt;
&lt;a href=&quot;http://serverfault.com/questions/158524/disk-space-not-freed-on-ext3-raid1-after-deleting&quot;&gt;http://serverfault.com/questions/158524/disk-space-not-freed-on-ext3-raid1-after-deleting&lt;/a&gt;&lt;br /&gt;
which explains quite nicely the problem.&lt;br /&gt;
&lt;br /&gt;
In short the solution was to type&lt;br /&gt;
&lt;br /&gt;
sudo tune2fs -m 0 /dev/&amp;lt;partitionname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and all was solved.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/2998222184090678735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/problem-with-reporting-of-disk-space.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/2998222184090678735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/2998222184090678735'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/problem-with-reporting-of-disk-space.html' title='Problem with reporting of disk space'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-641960989473524820</id><published>2011-06-26T10:55:00.001+03:00</published><updated>2011-06-26T16:21:48.900+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="elevator pitch"/><category scheme="http://www.blogger.com/atom/ns#" term="funding"/><category scheme="http://www.blogger.com/atom/ns#" term="pitching"/><category scheme="http://www.blogger.com/atom/ns#" term="presentations"/><category scheme="http://www.blogger.com/atom/ns#" term="startups"/><title type='text'>Start up pitches</title><content type='html'>http://mashable.com/2011/06/24/startup-pitch-presentation/&lt;br /&gt;
&lt;br /&gt;
Whether you are just getting started or about to raise capital this is a really good breakdown of what to present to investors. &amp;nbsp;It is good to be thinking about this from the beginning. &amp;nbsp;As you develop you company and get ready to present it might change, but by the time you are presenting have it down pat. &amp;nbsp;And don&#39;t forget to have an elevator pitch too. &amp;nbsp;Sometimes you might only get 30 seconds with someone, and you better have a good answer for the inevitable &quot;and what do you do?&quot; question. &amp;nbsp;Get it right and make it count.&lt;br /&gt;
&lt;br /&gt;
happy pitching</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/641960989473524820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/start-up-pitches.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/641960989473524820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/641960989473524820'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/start-up-pitches.html' title='Start up pitches'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-5446115287665304084</id><published>2011-06-22T10:59:00.002+03:00</published><updated>2011-06-22T11:07:43.181+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="admin"/><category scheme="http://www.blogger.com/atom/ns#" term="authentication"/><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="ipsec"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="scripts"/><category scheme="http://www.blogger.com/atom/ns#" term="sudo"/><category scheme="http://www.blogger.com/atom/ns#" term="sudoers"/><category scheme="http://www.blogger.com/atom/ns#" term="visudo"/><category scheme="http://www.blogger.com/atom/ns#" term="vpn"/><title type='text'>Automating password authenticated commands</title><content type='html'>On my linux server I have an&lt;a href=&quot;http://bit.ly/iI4338&quot;&gt; IPSEC VPN&lt;/a&gt; set up to an external connection. &amp;nbsp;This was a stipulation from the counterparty to allow us to send secure data, from a verified user. &amp;nbsp;I set that up before I started this blog, so at some point I will do a retrospective blog on that. &amp;nbsp;For now I want to talk about something a little more general, I am just framing the problem.&lt;br /&gt;
&lt;br /&gt;
I have a &lt;a href=&quot;http://bit.ly/iIk7tE&quot;&gt;FIX &lt;/a&gt;connection running over this VPN, using the &lt;a href=&quot;http://bit.ly/jE6Xsd&quot;&gt;QuickFix/J&lt;/a&gt; API. &amp;nbsp;For some reason that I cannot quite figure out I lose the session and it will not automatically reconnect. &amp;nbsp;This is usually solved be resetting the VPN. I wrote a short script to take down and bring back up the connection, called restartVPN:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#! /bin/bash&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;sudo ipsec auto --verbose --down Test&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;sudo ipsec auto --verbose --up Test&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This works fine. &amp;nbsp;As you can see I use sudo to give me admin rights to do this. &amp;nbsp;This is fine for a manual operation. &amp;nbsp;However I have had this problem occur and not been notified quickly enough to do this manually without any consequences therefore I wish to detect when my session has been down for too long and automatically reset it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This should be no problem I make a call from my code that is watching the session status to the bash script above and hey presto. &amp;nbsp;However this will not work, sudo requires password authentication for non root users be default. &amp;nbsp;A call from another system will get stuck waiting for the password and as its supposed to automated there isn&#39;t much I can do about that. &amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;WARNING: Messing around with the sudoers file is dangerous and should be done very carefully and allowing only the least possible permissions to make your scripts run automatically.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The solution is allowing sudo to run ipsec without requiring a password to get the admin rights. &amp;nbsp;Once done ipsec must still be run with sudo, so there is a small layer of security but the password layer is gone, so if you do type sudo ipsec make sure you know what you are doing.&lt;/div&gt;&lt;div&gt;Before you do this it is worth checking out the sudo and visudo man pages.&lt;/div&gt;&lt;div&gt;Bear in mind that my user is called ctoisrael and the command I am running is ipsec. &amp;nbsp;You will need to replace this with your own specifics.&lt;/div&gt;&lt;div&gt;First run visudo to edit the visudo file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;~/sudo visudo&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
It will open in your default editor. &amp;nbsp;Make sure you are familiar with editing in which ever you have chosen.&lt;br /&gt;
add a line like this at the bottom:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ctoisrael&amp;nbsp;ALL = NOPASSWD: /usr/sbin/ipsec&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
the first ALL means for all servers, in this case it doesn&#39;t matter because I am only setting this on this server and not copying it to other servers. &amp;nbsp;If I wanted to be specific ie that it can only be done on one server I would replace this first ALL with the name of the server. &amp;nbsp;The rest should be self explanatory. &amp;nbsp;I have specified that no password is needed when running the ipsec command, but only for this user.&lt;br /&gt;
Save the file. &amp;nbsp;It will be default save sudoers.tmp. &amp;nbsp;The visudo program will check to make sure it can be saved at the real sudoers file and then save it.&lt;br /&gt;
&lt;br /&gt;
Now when I run restartVPN it does not prompt me for the password which means it can be run from a script that will automatically reset my VPN when it goes down.&lt;br /&gt;
&lt;br /&gt;
I found a pretty good guide to setting up IPSEC VPNs if you are interested, &lt;a href=&quot;http://bit.ly/kxjjTj&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Feel free to write something in the comments if you have any questions about this or anything else I blog about, happy to help.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/5446115287665304084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/automating-password-authenticated.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/5446115287665304084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/5446115287665304084'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/automating-password-authenticated.html' title='Automating password authenticated commands'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-6656216645518638449</id><published>2011-06-14T22:49:00.001+03:00</published><updated>2011-06-14T22:50:34.352+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bug fixing"/><category scheme="http://www.blogger.com/atom/ns#" term="bugs"/><category scheme="http://www.blogger.com/atom/ns#" term="catch"/><category scheme="http://www.blogger.com/atom/ns#" term="errors"/><category scheme="http://www.blogger.com/atom/ns#" term="exception"/><category scheme="http://www.blogger.com/atom/ns#" term="gnu screen"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="log4j"/><category scheme="http://www.blogger.com/atom/ns#" term="logs"/><category scheme="http://www.blogger.com/atom/ns#" term="nullpointer"/><category scheme="http://www.blogger.com/atom/ns#" term="try"/><title type='text'>Fixing errors you cannot see and how I tried {to} catch (them){}</title><content type='html'>For those of you following my twitter @ctoisrael then you will know I was bug fixing today. &amp;nbsp;My system had a bug, the bug produced a tremendous amount of output. &amp;nbsp;I can only presume that what ever went wrong produced some sort of uncaught exception. &amp;nbsp;Uncaught exceptions are not written to the log, this is not usually a huge problem. &amp;nbsp;I run my system using multiple &quot;windows&quot; on a &lt;a href=&quot;http://www.gnu.org/software/screen/&quot;&gt;gnu screen&lt;/a&gt;. &amp;nbsp;If you use the linux commandline a lot, particularly remotely, this is one of the most useful tool there are out there. &amp;nbsp;I will save screen for another post. I actually have it set to scrollback a large amount of lines, but today even 10000 lines was too much. &amp;nbsp;There was just too much output. &amp;nbsp;Anything output by System.out or System.err was gone for good. &amp;nbsp;The log was not revealing. &amp;nbsp;I could see that there must have been an error from a malformed log line. &amp;nbsp;It didn&#39;t look right but I couldn&#39;t tell where it came from.&lt;br /&gt;
&lt;br /&gt;
Some of the most critical errors in Java are NullPointerExceptions. &amp;nbsp;They are not caught by default, and the IDEs obviously do not enforce you to surround code with try and catch blocks. &amp;nbsp;So I am guessing that somewhere outside of my scrollback was a NullPointer or ConcurrentModification exception that was not caught and though did not crash the whole system, resulted in some malformed data that produced a glitch that got me in to a big mess, but thankfully not a costly one. &amp;nbsp;The symptoms were resolved and no long term damage done. &amp;nbsp;I am still not further on with the root issue.&lt;br /&gt;
&lt;br /&gt;
I cannot find the root issue it is impossible, I checked the code where it could have happened but I cannot see anything wrong. &amp;nbsp;I have been through the log, I can see the result but still not the cause. &amp;nbsp;The next time this happened I must be prepared. &amp;nbsp;In order to do this I have to catch all possible exceptions. &amp;nbsp;This it turns out is not as easy as you might think. &amp;nbsp;Ideally I need to catch all exceptions, handle them if necessary and write them to the log.&lt;br /&gt;
&lt;br /&gt;
I have looked in to this in the past. &amp;nbsp;I have found two suggested solutions:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Surround everything with try/catch blocks, catching Exception, so that all unhandled &amp;nbsp;/ uncaught exceptions will caught, and then handled.&lt;/li&gt;
&lt;li&gt;Create a Class that implements &lt;a href=&quot;http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.UncaughtExceptionHandler.html&quot;&gt;Thread.UncaughtExceptionHandler&lt;/a&gt;&amp;nbsp;and add it to the Thread&lt;/li&gt;
&lt;/ol&gt;The try catch method is a simple solution but a flexible one. &amp;nbsp;One must remember that every thread needs to have a try catch block around it. &amp;nbsp;My suggestion would be to put it in the run method.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public void run(){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;all code to run the thread&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; } catch (Exception e){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;handle exception&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can be a huge pain to implement if your existing code has made different threads. &amp;nbsp;Additionally I find that too many try catch blocks can look ugly and longer than it should be. &amp;nbsp;The one advantage of this is that it allows the coder to have control over each potential exception in every place that it could occur. &amp;nbsp;Clever use or more specific exceptions that can go uncaught can allow handling in different ways.&lt;br /&gt;
&lt;br /&gt;
Despite this the second method is far better. &amp;nbsp;I created an abstract class:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public abstract class Log4JUncaughtExceptionHandler implements&amp;nbsp;&lt;a href=&quot;http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.UncaughtExceptionHandler.html&quot;&gt;Thread.UncaughtExceptionHandler&lt;/a&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; private static Logger log = Logger.getLogger(&quot;log&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
because it is abstract and subclass must implement the method uncaughtException(Thread t, Exception ex);&lt;br /&gt;
I created a subclass:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public class Log4JCatchAllExceptions extends Log4JUncaughtExceptionHandler{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; @Override&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; public class uncaughtException(Thread t, Exception ex){&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; log.error(t.getName(),ex);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;I used them as follows. &amp;nbsp;In any class with a main method I use the class to catch all exceptions with the line&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Thread.setDefaultUncaughtExceptionHandler(new Log4JCatchAllExceptions())&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;This only needs to go in once for the entire program. &amp;nbsp;All uncaught exceptions will be caught and handled by the Log4JCatchAllExceptions class. &amp;nbsp;Its pretty neat, no need to add lots of try catch blocks to the code and has pretty much the same effect. &amp;nbsp;What you don&#39;t have is the possibility to handle exceptions differently in different cases. &amp;nbsp;The reason is because it has been added as a static property of the Thread class, hence every new thread will have this property. &amp;nbsp;This can be overridden in the thread instances by using:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Thread t = new Thread();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;t.setUncaughtExcpetionHandler(new Log4JUncaughtExceptionHandler(){&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; @Override&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; public class uncaughtException(Thread t, Exception ex){&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; log.error(t.getName(),ex);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;t.start();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;This will set the handler of the specific thread to the anonymous class that is declared here. &amp;nbsp;So any time that there needs to be a specific handling of and error it can be done like this. &amp;nbsp;Here I have just printed a log in the same way that I did with the default class. &amp;nbsp;But in my real code I restart threads so that if they die thanks to a null pointer exception then they will respawn, reducing the effects of the error while recording it at the same time.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;And don&#39;t forget that there are times where going back to regular try catch blocks will fill in any holes that are not handled by these two classes.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/6656216645518638449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/fixing-errors-you-cannot-see-and-how-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/6656216645518638449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/6656216645518638449'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/fixing-errors-you-cannot-see-and-how-i.html' title='Fixing errors you cannot see and how I tried {to} catch (them){}'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-6978335258305576922</id><published>2011-06-11T12:58:00.000+03:00</published><updated>2011-06-11T12:58:04.665+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hiring"/><category scheme="http://www.blogger.com/atom/ns#" term="HR"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="shortcuts"/><title type='text'>Programming tests: is there a shortcut</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;For those of you not following my tweets, I tweeted the other day about&amp;nbsp;&lt;a href=&quot;http://www.codeeval.com/&quot;&gt;http://www.codeeval.com/&lt;/a&gt;. &amp;nbsp;This is a great service that basically allows you to create job applications online (no big deal) with the bar to sending it in as passing the programming problem that it presents (very big deal). &amp;nbsp;This could be a big help in theory. &amp;nbsp;You can see how organised they are about coding, for a good enough problem it will show their problem solving skills and their thought processes.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;I have a problem with this though, there seems to be no way to block the applicant looking the answers up. &amp;nbsp;There are timed problems, but copy paste is pretty quick once you have found the algorithm on the web. &amp;nbsp;In addition it has &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;a&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;plagiarism detector so you can see if candidates are sharing their answers. &amp;nbsp;This could actually be used by submitting answers that you find on the web. &amp;nbsp;Once a candidate uses the same answers from searching the web the plagiarism detector will flag them. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;Considering all of this I would still want to do a reasonable live test as well. &amp;nbsp;My main reason being efficiency of programmers is quite important to me. &amp;nbsp;I cannot stand sitting with someone who is repetitively doing the same slow process over and over again. &amp;nbsp;I saw recently a description of programmers as being &quot;Inherently lazy with just the right amount of motivation.&quot; &amp;nbsp;This description presents us with someone that is too lazy to keep doing something that takes 2 minutes over and over again, but will be motivated to spend an hour finding or writing a solution that will make this process automatic. &amp;nbsp;I love this, its true about me, and about many other coders. &amp;nbsp;I remember hearing a quote by &lt;a href=&quot;http://en.wikipedia.org/wiki/Richard_Stallman&quot;&gt;Richard Stallman&lt;/a&gt;, Founder of the &lt;a href=&quot;http://www.gnu.org/&quot;&gt;GNU project&lt;/a&gt;, &amp;nbsp;who said that he would have never got it done if he wasn&#39;t lazy. &amp;nbsp;I cannot find any reference for that right now so don&#39;t take me at my word. &amp;nbsp;But I am pretty sure that I read it in &lt;a href=&quot;http://www.amazon.co.uk/Rebel-Code-Linux-Source-Revolution/dp/0738206709/ref=sr_1_1?ie=UTF8&amp;amp;qid=1307785051&amp;amp;sr=8-1&quot;&gt;Rebel Code&lt;/a&gt;. &amp;nbsp;I digress...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;I want to see not just efficient solutions to problems but efficient working method to get there. &amp;nbsp;There is nothing more painful than watching someone click on the file menu and select copy and paste, even using right click in an editor, everyone should know ctrl^c ctrl^v. &amp;nbsp;Thats ok, I doubt you would come across many programmers that don&#39;t, but there are more examples of things that people can do to work quicker. &amp;nbsp;Selecting, single words and lines are very easy to select by double or triple clickling, no need to be exact about highlighting all the letters. &amp;nbsp;The less a mouse is used the better. &amp;nbsp;Users of VI and EMACS will be proficient at this and will probably be mouse free in other environments too. &amp;nbsp;Additionally X windows users will know that if you highlight something it is copied to the clipboard and can be pasted using a single middle click. &amp;nbsp;Saving too, most of the time its just ctrl^s but not doing it will mean you get prompted to save a few seconds are required of a mouse click, these things do add up. &amp;nbsp;It sounds like I am talking about some pretty irrelevant or small things but trust me when you watch some one who doesn&#39;t use these things its slow. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;I am not the best at these things, but I definitely notice when they are not being done. &amp;nbsp;When I spent more time in EMACS and VI I taped a list of common commands on the wall behind my monitor. &amp;nbsp;The more I used them the less I had to refer to the list and the faster I got at using these wonderful tools. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;One weird thing that I have is about searching through code. &amp;nbsp;I get it if you don&#39;t know the code, but there are many shortcuts especially in the IDEs to make it quicker. &amp;nbsp;I much prefer ctrl^j to ctrl^f in Eclipse, but what I prefer the most is being familiar enough with the code to know where to go. &amp;nbsp;Don&#39;t search just go straight there. &amp;nbsp;Someone who can type quick enough and knows the shortcuts to search should be able to beat me in a large file. &amp;nbsp;However its the familiarity with the code that I am looking for. &amp;nbsp;If you are my programmer and you don&#39;t know the code well enough how can you solve bugs or make feature changes. &amp;nbsp;I am not talking here about new code, I am talking about code the programmer has written themselves. &amp;nbsp;Searching is fine, I would never say to someone that they cannot do it, but I want to see some indication that the code they have spent &amp;nbsp;a few weeks writing is somehow bouncing around their heads.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/6978335258305576922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/programming-tests-is-there-shortcut.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/6978335258305576922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/6978335258305576922'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/programming-tests-is-there-shortcut.html' title='Programming tests: is there a shortcut'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-4611415562415813709</id><published>2011-06-08T23:10:00.000+03:00</published><updated>2011-06-08T23:10:43.980+03:00</updated><title type='text'>I love whiteboards</title><content type='html'>... but not as much as these guys.&amp;nbsp;http://bit.ly/jAxznB&lt;br /&gt;
&lt;br /&gt;
I love this idea, I think its great. &amp;nbsp;I have had whiteboards from my undergraduate degree and my post grad. &amp;nbsp;My supervisor meetings revolved around us working through ideas on the white board together. &amp;nbsp;If it was important and I didn&#39;t have time to write it down I would bring my camera and take a picture of it to refer to later. &lt;br /&gt;
&lt;br /&gt;
I cannot recommend them enough. &amp;nbsp;I have one white board in my office, its full there is almost no space left for temporary things. &amp;nbsp;I got it when I was lost in my notepads; ideas, todo lists, diagrams, passwords and notes. &amp;nbsp;Things were getting difficult to keep track off. &amp;nbsp;Now I have my whiteboard, it has not just everything I need to do, but everything that needs done. &amp;nbsp;My task, my staff&#39;s tasks, even my boss&#39;s tasks. &amp;nbsp;Its colour coded too, to indicate priority, that way I can add things to lists without worrying about the other. &amp;nbsp;Larger tasks are broken down in separate sections in to a group of smaller tasks. &amp;nbsp;Where possible time estimates are written next to tasks to give an idea of the scale of what needs to be done.&lt;br /&gt;
&lt;br /&gt;
This is great when things get done they are erased, when things do not get done they stay, much better than being lost in the depths of early pages of a notepad. &amp;nbsp;My notepads are for doodles and daily tasks, or notes from the evening to remind me to do something the following day. &amp;nbsp;Once the page is turned in the notepad I need not worry about the previous pages, all the important stuff is on the whiteboard. &lt;br /&gt;
&lt;br /&gt;
Its great for planning and working in a team. &amp;nbsp;Particularly if anybody can easily see who is assigned what. &amp;nbsp;My bosses know that I have plenty to do and can see by the turn over of tasks that I am at least getting something accomplished every day. &lt;br /&gt;
&lt;br /&gt;
The problem I have is that I only have one right now. &amp;nbsp;Its almost full of tasks and plans for future projects. &amp;nbsp;There is little room for diagrams, pseudo code and doodles. &amp;nbsp;I find that I spend some time every day explaining something to someone, this is best done with a space on the whiteboard and a dry marker in hand.&lt;br /&gt;
&lt;br /&gt;
I must add a task to the whiteboard:&lt;br /&gt;
Get more whiteboards &amp;nbsp; CTO 2hours</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/4611415562415813709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/i-love-whiteboards.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/4611415562415813709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/4611415562415813709'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/i-love-whiteboards.html' title='I love whiteboards'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-2412508314659069780</id><published>2011-06-06T01:00:00.000+03:00</published><updated>2012-02-05T12:00:27.870+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hiring"/><category scheme="http://www.blogger.com/atom/ns#" term="HR"/><category scheme="http://www.blogger.com/atom/ns#" term="management"/><title type='text'>More on Hiring: or how to avoid moron hiring</title><content type='html'>I have written about hiring before and I felt there was more I could say about it. &amp;nbsp;I do not have a huge amount of experience of searching for jobs elsewhere but here in Israel I feel the whole process is lacking. &amp;nbsp;I am originally from the UK and though I spent most of my time since high school studying at university I did apply for some jobs. &amp;nbsp;One experience jumps to mind. &amp;nbsp;I had a phone interview with a big consulting firm. &amp;nbsp;At the time I was not so confident with my programming ability. &amp;nbsp;I was young and naive and I guess what ever I said came off as, &quot;I don&#39;t like programming, I don&#39;t want to do it.&quot; &amp;nbsp;I was told later by HR from this company that I did not progress because I said that I did not like programming. &amp;nbsp;(things have changed considerably for me). &amp;nbsp;There was no attitude of &#39;lets interview him some more and see how it goes.&#39; &amp;nbsp;Later interviews, here in Israel, with other big companies have resulted in my not progressing for good reason, failing to pass whatever puzzles, tests and problems that were set out for me (Google, Bloomberg, and Brevin Howard), and being offered a job by Intel because I did pass these tests. &amp;nbsp;These are big companies, with HR that has been developed over many years. &amp;nbsp;They are efficient and are able to take on the best candidates.&lt;br /&gt;
&lt;br /&gt;
So why here do we have this attitude of wasting interviewers&#39; and candidates&#39; time by interviewing them when they are inappropriate. &amp;nbsp;Additionally at my previous company, for all the positives that they gained from taking a chance and hiring me, there were many people who were hired who were let go in 3 months or less because they were just unsuitable for the job. &amp;nbsp;The turn over of employees in my time there was ridiculous. &amp;nbsp;I suggested that they paid more to new candidates in order to attract better people, they didn&#39;t believe me and stated that there just isn&#39;t anyone out there. &amp;nbsp;This I find hard to believe.&lt;br /&gt;
&lt;br /&gt;
Testing is the way forward. &amp;nbsp;As I stated in my last post on this topic it should be not just one question but a number designed to demonstrate many different abilities and not to prejudice a decision by the candidate failing at one thing. &amp;nbsp;There are certain things that I want to know from a candidate that I should implement for the next interview process. &amp;nbsp;I work with linux and the commandline a lot. &amp;nbsp;I use &lt;a href=&quot;http://www.cygwin.com/&quot;&gt;Cygwin&lt;/a&gt; on my windows machines to interface with my linux boxes and more importantly to gain the power of bash to manipulate files in windows. &amp;nbsp;Where am I going with this. &amp;nbsp;If a candidate claims knowledge of linux I have an easy question to test something basic. &amp;nbsp;Given the directory C:\src\ (or whatever) find all the java files in that directory and its sub directories that have classes that implement a certain interface. &amp;nbsp;Lets say the action listener interface. &amp;nbsp;I could even sit them at my keyboard and get them to do it. &amp;nbsp;If the candidate has no understanding of linux this would be impossible. &amp;nbsp;If they do but are unfamiliar with the syntax of grep or find for example I would be happy for them to spend 5 mins reading the man pages. &amp;nbsp;I would expect an answer like:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;grep -Ri ActionListener * | grep -v svn | grep implements&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;I would expect to see them remove the svn directories from the result and refine the use of ActionListener to only when it is implemented in the class and not used as an anonymous class.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;a href=&quot;http://www.starling-software.com/employment/programmer-competency-matrix.html&quot;&gt;This &lt;/a&gt;is an ideal list of things a candidate should know. &amp;nbsp;Its use is explained in a link near the bottom. &amp;nbsp;A good score would certainly make a an ideal sounding candidate. &amp;nbsp;But these things especially the in depth knowledge of computer science things like sorting and search algorithms do not always translate well into the best employees. Discussed in a further &lt;a href=&quot;http://devinterviews.pen.io/&quot;&gt;article &lt;/a&gt;about the hiring process, it seems different approaches can be taken and are valid.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Another thing that I would like to see is their participation in something like StackOverflow, Experts exchange or some other forum of this type. &amp;nbsp;Alternatively involvement in an open source project. &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Regular expressions are such a useful tool. &amp;nbsp;Everyone should know about them and how to use them. &amp;nbsp;Again its easy to set up a simple test to discover the number of words of a certain type in a give text file. &amp;nbsp;I am reminded of this wonderful &lt;a href=&quot;http://xkcd.com/208/&quot;&gt;xkcd &lt;/a&gt;cartoon.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Finally &lt;a href=&quot;http://programmingmatters.com/the-top-10-attributes-of-a-great-programmer/&quot;&gt;here &lt;/a&gt;is another article on some positive traits to look out for in a new candidate.&lt;br /&gt;
&lt;br /&gt;
Happy hiring!</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/2412508314659069780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/more-on-hiring-or-how-to-avoid-moron.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/2412508314659069780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/2412508314659069780'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/more-on-hiring-or-how-to-avoid-moron.html' title='More on Hiring: or how to avoid moron hiring'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-8672836982727749446</id><published>2011-06-01T14:55:00.000+03:00</published><updated>2011-06-01T14:55:09.749+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="kernel 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="linus thorvalds"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>Congratulations Linus - 20 years of a job well done</title><content type='html'>Linux kernel 3.0 &lt;a href=&quot;http://www.phoronix.com/scan.php?page=news_item&amp;amp;px=OTUwMg&quot;&gt;released&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Very amusing comments from him too.&lt;br /&gt;
&lt;br /&gt;
Keep up the good work.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/8672836982727749446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/congratulations-linus-20-years-of-job.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/8672836982727749446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/8672836982727749446'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/congratulations-linus-20-years-of-job.html' title='Congratulations Linus - 20 years of a job well done'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-5105143610916667212</id><published>2011-06-01T13:46:00.001+03:00</published><updated>2011-06-01T13:47:22.966+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bug"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="shutdown hook"/><category scheme="http://www.blogger.com/atom/ns#" term="terminate"/><title type='text'>Shutdown Hooks Eclipsed by terminate button</title><content type='html'>&lt;div&gt;We are creating a new module for our system to receive data from another source.  Everytime we terminate the test application in Eclipse it causes and unexpected termination at the suppliers end.  I get notified and they assume something is wrong.  Solution add a Shutdown hook to end the connection gracefully.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Nothing is ever that easy.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href=&quot;http://abtj.blogspot.com/2009/08/shutdown-hook-and-eclipse.html?spref=bl&quot;&gt;Something About J: Shutdown Hook and Eclipse&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;turns out that a known bug in Eclipse is that clicking on the red terminate button does not kill anything nicely.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;No solutions only workarounds:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;1. Run in a console.  A bit annoying when working in dev, you need to constantly stop and start the app and it can slow you down a bit.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;2. Relatively safe &lt;a href=&quot;http://blog.arc90.com/2008/04/18/patrick-avis-java-tips-2-graceful-jvm-shutdown-in-eclipse/&quot;&gt;workaround &lt;/a&gt;if you are using threads.   It works well but you have to remember to use it and not click the red button! &lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Thanks to both for providing the most concise and useful explanations and suggestion.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/5105143610916667212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/shutdown-hooks-eclipsed-by-terminate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/5105143610916667212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/5105143610916667212'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/06/shutdown-hooks-eclipsed-by-terminate.html' title='Shutdown Hooks Eclipsed by terminate button'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-7964097508174279065</id><published>2011-05-31T11:52:00.000+03:00</published><updated>2011-05-31T11:52:59.211+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="date formate"/><category scheme="http://www.blogger.com/atom/ns#" term="daylight savings"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="timezones"/><title type='text'>Java TimeZones (Daylight savings time not included)</title><content type='html'>Quick background. &amp;nbsp;We receive data with different timestamps. &amp;nbsp;The easiest way to work with the data is to use &lt;a href=&quot;http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html&quot;&gt;SimpleDateF&lt;span id=&quot;goog_1985860437&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1985860438&quot;&gt;&lt;/span&gt;ormat &lt;/a&gt;and work with &lt;a href=&quot;http://download.oracle.com/javase/1.4.2/docs/api/java/util/Date.html&quot;&gt;Date&lt;/a&gt;. &amp;nbsp;Date holds a reference to the date as number of milliseconds since the &lt;a href=&quot;http://en.wikipedia.org/wiki/Unix_epoch&quot;&gt;Epoch (Jan 1 1970)&lt;/a&gt;. &lt;br /&gt;
For some reason our suppliers give us formated dates form different timezones. &amp;nbsp;No problem we just set the dateformatter to use a different timezone when parsing the date string. &amp;nbsp;The API &lt;a href=&quot;http://download.oracle.com/javase/1.4.2/docs/api/java/util/TimeZone.html&quot;&gt;doc&lt;/a&gt; states that it &quot;also figures out daylight savings&quot;. However it does not state that you must use the long code (&quot;Europe/London&quot;) for the timezone and not the 3 letter code (&quot;GMT&quot;). &lt;a href=&quot;http://bytes.com/topic/java/answers/15954-alphabetic-java-time-zones-continent-ocean-city-format&quot;&gt;&amp;nbsp;List of short codes&lt;/a&gt;. Now we are using the long code we are getting the correct dates with daylight savings taken account of.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/7964097508174279065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/05/java-timezones-daylight-savings-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/7964097508174279065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/7964097508174279065'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/05/java-timezones-daylight-savings-time.html' title='Java TimeZones (Daylight savings time not included)'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-8467708270206661217</id><published>2011-05-30T12:12:00.002+03:00</published><updated>2011-06-01T15:02:56.200+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bosses"/><category scheme="http://www.blogger.com/atom/ns#" term="management"/><category scheme="http://www.blogger.com/atom/ns#" term="project management"/><title type='text'>Even I have a boss</title><content type='html'>I am a bridge between two worlds. I manage the technology of the company. Everything that is not financial or administrative I am responsible for. &amp;nbsp;However when it comes down to it I have to do what I am told. &amp;nbsp;The good news, it just has to get done. &amp;nbsp;The bad news, they don&#39;t understand what needs to happen to get it done, and usually they think that it is always easy and could be done in a matter of minutes.  In practice what this means is that some times as a programmer you can do something simple that the non techie people think is amazing and should have been time consuming. Other times the opposite is true.&lt;br /&gt;
&lt;br /&gt;
Either way I&#39;m screwed, if I do something quickly that they think should take a long time, it raises their expectations for the next time. &amp;nbsp;If I have something that the bosses think should be straight forward, then they simply do not understand why it is that its taking so long.&lt;br /&gt;
&lt;br /&gt;
This gets in the way of my work, I have to either spend time explaining the reasons why things take time or not get them done properly. &amp;nbsp;In the past when I have been required to get out a new product or even a big feature I work hard on it to make sure its done and out there working, even if its missing a few things. &amp;nbsp;Then I let smaller tasks take longer as I use the time to add in all the features left out of the bigger project. &amp;nbsp;In the end most things get done, other things fall by the way side, usually by that time they don&#39;t matter anyway.&lt;br /&gt;
&lt;br /&gt;
My bosses aren&#39;t bad bosses, in fact quite the opposite. &amp;nbsp;They just don&#39;t always get it. &amp;nbsp;Looking back on things I wish I had time to build the infrastructure we work on before going live. &amp;nbsp;I have built it as needed and gone live as quickly as possible. &amp;nbsp;Over time new versions and bug fixes have resulted in better software. &amp;nbsp;I am left wondering whether this has worked out better than creating a whole system over a long period, testing, retesting, and then going live. &amp;nbsp;Would it have just taken me longer to make the same mistakes. &lt;br /&gt;
&lt;br /&gt;
As my staff grows and the codebase gets larger, I can implement better development standards. &amp;nbsp;Better testing, better design, better implementation. &amp;nbsp;I have more man hours available to me through my team, I can get things done faster and better at the same time. &amp;nbsp;That means I will spend less time coding and doing other techie things and more time managing the staff and being a bridge from the bosses to the techies. &amp;nbsp;I am their protector. &amp;nbsp;I know how long it will take, I have been there, when the programmers say its going to take 2 weeks, I know it will take 4. But I know that I will put the right pressure on to get it done, and my bosses will be kept at bay knowing that I am competently managing the project. &amp;nbsp;They will bug me, I will be the one disturbed leaving my staff to get on with it without the added pressure. &amp;nbsp;Hopefully resulting in better products at the end.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/8467708270206661217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/05/even-i-have-boss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/8467708270206661217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/8467708270206661217'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/05/even-i-have-boss.html' title='Even I have a boss'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-3782485162964523710</id><published>2011-05-25T11:58:00.003+03:00</published><updated>2011-06-01T18:15:20.606+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hiring"/><category scheme="http://www.blogger.com/atom/ns#" term="HR"/><category scheme="http://www.blogger.com/atom/ns#" term="interview questions"/><category scheme="http://www.blogger.com/atom/ns#" term="interviews"/><category scheme="http://www.blogger.com/atom/ns#" term="management"/><title type='text'>Hiring right</title><content type='html'>I saw this the other day:&lt;br /&gt;
&lt;a href=&quot;http://www.inc.com/ss/7-unconventional-ways-hire-best-tech-talent#0&quot;&gt;http://www.inc.com/ss/7-unconventional-ways-hire-best-tech-talent#0&lt;/a&gt;&lt;br /&gt;
While I like the idea, it was truly impractical for my needs. &amp;nbsp;Having said that I do feel that I could have been more thorough in my interviewing process.&lt;br /&gt;
&lt;br /&gt;
Lets start at the beginning. &amp;nbsp;Over the past few years I have been to a few interviews. &amp;nbsp;I have had some tough questions. &amp;nbsp;I have done OK in some and not so great in others. &amp;nbsp;Three companies, two of which I&amp;nbsp;have had multiple interviews, where I have basically been told at the end of it, &quot;we like you but you don&#39;t have any experience in Java (or what ever it was at the time that I didn&#39;t know)&quot;. &lt;br /&gt;
&lt;br /&gt;
I have to say this is particular annoying and a huge waste of both my and their time. &amp;nbsp;If they were looking for a Java programmer why were they interviewing me. &amp;nbsp;I didn&#39;t have it on my CV. &amp;nbsp;Ok I have a few interesting things on my CV but at the time Java wasn&#39;t one of them. &amp;nbsp;I said during the interview that I didn&#39;t know Java right now but I could learn. &amp;nbsp;In fairness most people when they are looking for a Java programmer they are looking for someone with 3 to 5 years experience that can hit the ground running. &amp;nbsp;But again they shouldn&#39;t have looked at me. &amp;nbsp;So the conversation continues. &amp;nbsp;&quot;Really you can just pick it up, huh. &amp;nbsp;What evidence can you present us with that would convince me?&quot; &amp;nbsp;Well for my current (at the time) job I learnt Perl Javascript and SQL and became proficient enough at them to run my own two man projects within a month. &quot;Oh thats interesting, what about a real language?&quot; &amp;nbsp;Harsh! Though again I get it, no proof that I have an understanding of OOD, but having said that I believe it is possible to learn the basics in a week reading on the internet. &amp;nbsp;The fact that this guy was so conceited that he thought learning Java was harder than the 3 languages I had to get to grips with prior to this, was a little narrow minded. &amp;nbsp;Aside from reading about Perl in the week running up to the start of that job everything &amp;nbsp;else was done offline. &amp;nbsp;We were on a closed system with no internet in the office. &amp;nbsp;That meant man pages (perldoc to be specific). &amp;nbsp;Javascript and SQL had to be learned from reading pre existing code and talking to others in my office. &amp;nbsp;All done with Emacs, no fancy IDE like Eclipse which does so much for you. &amp;nbsp;So a little context helps when responding to answers. &lt;br /&gt;
&lt;br /&gt;
So I finally landed a job, this job, I didn&#39;t know Java but I had a month to read about it before I started. &amp;nbsp;I played around a little and the rest I learned as I went along. &amp;nbsp;Its been two years. &amp;nbsp;And you know what, I rate myself pretty highly. &amp;nbsp;How do I know this. &amp;nbsp;I hired someone. &amp;nbsp;Someone I expected to blow me out the water in terms of coding. &amp;nbsp;You know what, she has 9 years of coding experience, c, c++ and Java. &amp;nbsp;As I understand it 3 years of each. &amp;nbsp;She doesn&#39;t know much about Threads or Swing or Sockets. &amp;nbsp;She is proficient at what she does know. &amp;nbsp;But somehow after all her time doing this, I still have a greater breadth of knowledge. &lt;br /&gt;
&lt;br /&gt;
(Additionally I was on track for becoming Rookie of the Year in Java on&lt;a href=&quot;http://www.experts-exchange.com/&quot;&gt; Experts Exchange&lt;/a&gt;&amp;nbsp;but my responsibilities took up too much of my time to actually continue doing all this work for free. &amp;nbsp;I will post more about EE and Stackoverflow later.)&lt;br /&gt;
&lt;br /&gt;
I am the CTO, I need to know everything (not saying that I do, just that I should have a wide range of skills and knowledge). &amp;nbsp;I am confident that my employee will be fine, it will start off slow and she will improve, but there is a lesson. &amp;nbsp;Assuming that someone who has the experience you think is necessary is not necessarily the best indicator of whether they will do well in your company. &amp;nbsp;I believe that had these companies taken a chance on me then they would have been pleasantly surprised by what I could have achieved. &amp;nbsp;They weren&#39;t willing to take that chance, and why should they they have I am sure they could have found plenty of other coders out there.&lt;br /&gt;
&lt;br /&gt;
This is the lesson of hiring, you never know what you are going to get. &amp;nbsp;You want some one great, with experience, broad knowledge, in depth understanding and the ability to pick up things they don&#39;t already know. &amp;nbsp;You try to test for this. &amp;nbsp;But its still hard to know for sure.&lt;br /&gt;
&lt;br /&gt;
Lets step back again, I have had some interviews where I have been asked to solve some problems, or give examples of code. &amp;nbsp;Generally these have gone badly for me. &amp;nbsp;Personally this is where I crack. &amp;nbsp;Its not the pressure I just don&#39;t think well like this. &amp;nbsp;And worst of all I don&#39;t end up thinking quickly, which is the worst part, as they not only want to see the correct solution but they want it done quickly. &amp;nbsp;So I decided that I would not ask these types of questions, firstly I don&#39;t know how to interpret the results, and secondly if they know how to do this already then it doesn&#39;t show me where they are lacking, and if they don&#39;t know how to do it then it doesn&#39;t show me other areas where they are positive.&lt;br /&gt;
&lt;br /&gt;
Back to my recent hire. &amp;nbsp;I have spent too long going over basic Hex and Binary. &amp;nbsp;This stuff should be second nature to a true CS grad, granted many coders might not be CS grads, but I have a CS grad and I wanted one specifically. &amp;nbsp;The reason: because they should be able to solve problems like this. &amp;nbsp;I am beginning to see the logic in some of these harder interviews and the fact that (big headedly) I may have &quot;slipped through the net&quot;, anyone that answers the type of problems I was getting from Google, Bloomberg and Brevin Howard deserves to be there or at least get another interview. &amp;nbsp;It shows a basic level of knowledge/understanding/problemsolving skills. &lt;br /&gt;
&lt;br /&gt;
So for the next interview I will ask the following:&lt;br /&gt;
given the a byte array which has the following bits:&lt;br /&gt;
sfff ffnn nnnn nnnn nnnn nnnn nnnn nnnn&lt;br /&gt;
show me how to extract the one bit sign s, the 5bit denomenator reference f, and the 26 bit numerator n.&lt;br /&gt;
the answer would be pseudo code that shows a bit mask for n&lt;br /&gt;
a shift and a bit mask for f&lt;br /&gt;
and a shift for s.&lt;br /&gt;
&lt;br /&gt;
In fairness to my employee she did solve the big problem that we were having that the byte array we were receiving looked different from the one we were trying to send. &amp;nbsp;The problem was that we were receiving the byte fields as little endian but reading them as big endian.&lt;br /&gt;
&lt;br /&gt;
So now one gets in the door with out understanding these concepts. &amp;nbsp;I am going to keep track of these problems for the future. &amp;nbsp;If any more crop up I will be noting them here and using them for interviewing. &amp;nbsp;I propose a system by which any one incorrect answer will not be the end of the world. &amp;nbsp;A scoring system will be used to decide if the candidate has a satisfactorily broad knowledge and with good problem solving skills.&lt;br /&gt;
&lt;br /&gt;
More on this as time goes on.</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/3782485162964523710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/05/hiring-right.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/3782485162964523710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/3782485162964523710'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/05/hiring-right.html' title='Hiring right'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5209901364844687221.post-5896072166373592101</id><published>2011-04-13T12:27:00.002+03:00</published><updated>2011-05-31T13:19:53.592+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="OO"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>The benefits of getting things right in OO</title><content type='html'>For anyone experienced in writing good OO code, the design is critical. &amp;nbsp;Planning ahead is essential in creating reusable objects. &amp;nbsp;I have been working on some old code that I wrote when I first started my current job and at the same time was very new to Java. &amp;nbsp;Its horrible. &amp;nbsp;Everything thrown in together. &amp;nbsp;Control, view and models all in one class; kludges, hacks and workarounds thrown in instead of proper refactoring. &amp;nbsp;Right now I am adding a new feature to the system. &amp;nbsp;I had two choices glue another piece of code to the mess or refactor the whole code base while adding in this change. &amp;nbsp;The result an extended project but more maintainable code, better code generally. Additionally many things that I am aware could be added or an issue have been taken care of, so that they should be easier to deal with later.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;So why was it such a mess in the first place?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There are many reasons, but it comes down to perceived amount of time to finish a task. &amp;nbsp;If I think I can get something done with a little hack or a quick kludge then thats the way its going to get done. &amp;nbsp;I know its wrong and I know in the future it might cost me but my environment can sometimes dictate that it must be done now. &amp;nbsp;I am the CTO, I am the bridge to the technical staff. My position is to get the technology working based on the requirements of my non technical bosses. &amp;nbsp;The situation where my bosses think something simple in their heads should be easy and quick to implement happens time and time again&lt;br /&gt;
&lt;br /&gt;
The non technical management want working systems or products. &amp;nbsp;My products are two separate systems. &amp;nbsp;One system is an offline system. &amp;nbsp;They run it, it does something, and produces a result. &amp;nbsp;The other is a live realtime system that runs 24/5 communicating with the outside world. That is what they want to see, it is my job to make sure they are produced, working and reliable. &amp;nbsp;Occasionally they request changes or we have routine upgrades. &amp;nbsp;This is where things get complicated. &amp;nbsp;They want it done. &amp;nbsp;They want it done soon. &amp;nbsp;They have no understanding of unit testing, refactoring and documentation. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What is the solution?&lt;/b&gt;&lt;br /&gt;
Get it done. &amp;nbsp;Many could argue getting it done means unit tests and refactoring as you go. &amp;nbsp;They would say that doing testing and keep code maintained is actually efficient in the short run as well. &amp;nbsp;This maybe the case but some times I am just too short sighted to see it like that. &amp;nbsp;I am under pressure, I have to get it done, why would I write some more code that isnt really &quot;relevant&quot; right now.&lt;br /&gt;
&lt;br /&gt;
I am in a good position right now. &amp;nbsp;I have two working systems and though there is pressure to get this new feature into production I have more time, and I am able to fend off my bosses so long enough to refactor a large chunk of my system.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Conclusion&lt;/b&gt;. &amp;nbsp;My code looks a lot nicer. &amp;nbsp;I have implemented the MVC pattern nicely, well considerably better than before. &amp;nbsp;I have reusable objects that have meant creating the two different view layers considerably easier. &amp;nbsp;Small changes to the model in the future will require only making changes in one and not two spots. &amp;nbsp;Its obvious now, but I am glad to see how much I have learned since I started.&lt;br /&gt;
So I got it done and now I have got it right. &amp;nbsp;It would have been nice to get it right first time, but they next project will benefit from what I have learned. &amp;nbsp;I will not necessarily get it right but it wont be as wrong as the code that I have just rewritten was.&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;Edit: This post was written concerning refactoring the offline system. &amp;nbsp;A change was made to the live system recently that used the refactoring of the offline system. &amp;nbsp;The change was smooth and easy because it simply reused previously tested and working components from the offline system. go me!&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://ctoisrael.blogspot.com/feeds/5896072166373592101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ctoisrael.blogspot.com/2011/04/benefits-of-getting-things-right-in-oo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/5896072166373592101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5209901364844687221/posts/default/5896072166373592101'/><link rel='alternate' type='text/html' href='http://ctoisrael.blogspot.com/2011/04/benefits-of-getting-things-right-in-oo.html' title='The benefits of getting things right in OO'/><author><name>Rob Woolfson</name><uri>http://www.blogger.com/profile/08062513384974880757</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>