tag:blogger.com,1999:blog-27867008621915367902024-03-05T16:19:56.200+02:00Life, Technology and EverythingJust my understanding of the essence of thingsYoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.comBlogger73125tag:blogger.com,1999:blog-2786700862191536790.post-80483716271456792182015-04-20T16:00:00.004+03:002016-11-04T08:33:14.251+02:00Alan Kay, TDD and FPOne of my favorite Alan Kay quotes is "A change in perspective is worth 80 IQ points".<br />
<div>
Regardless if he ever measured it or not, he did capture an important aspect of complicated problem solving - problems have many axis. Each perspective by itself only explores part of a problem's axis, and any additional perspective explores more axis, en-route towards a comprehensive solution.</div>
<div>
This is where the power of TDD (test driven development) and FP (functional programming) comes from.</div>
<div>
<br /></div>
<div>
When you do TDD, you explore axis which do not directly target the question of "how do I solve the problem", but rather the question "How to detect a wrong solution". By following these axis, alongside with exploring using the regular problem solving mechanisms (as we try to change perspective, not just use one different perspective), the chances of reaching a more comprehensive solution are increased. The side-effect of this approach is having the tests later on to allow ongoing verification of the consistent behaviour of the software.</div>
<div>
<br /></div>
<div>
When you do FP, you explore axis which do target the question of "how do I solve the problem", but via different axis, as the industry standard is doing it the OO way. This means different model of the problem, different abstractions, different computation mechanisms. Again, by exploring additional routes to solve the problem (this time they target the question directly), you increase your chances of finding a comprehensive solution to the problem. The side-effect of using this approach is a larger set of simply solvable problems, as there are problems that are entry-level on the FP axis, while being advanced when projected onto the OO axis (and one of the benefits of simple solutions is that they are very easy to test).</div>
<div>
<br /></div>
<div>
In the same way that novelists are not in the business of books writing, but rather in the business of story telling deployed via books, software engineers are not in the business of writing software, but rather in the business of problem solving deployed via software . This is why using the extra perspective(s) is so important.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-15958095957028875502012-09-08T21:54:00.000+03:002019-06-28T23:51:40.143+03:00The axis of a software personThere are several axis for the skill that a software person should (must) have<br />
<div>
<ol>
<li>Software engineering skills - these are the skills that allow a software person to transform a description of a system to a system and a project that can be controlled and maintained. These skills are:</li>
<ul>
<li>Distilling requirements from the needs of the client. This is a phase where a semantic description of a system is reduced to a syntactic description. Engineers need syntax, as it is possible to build tools that understand and analyze syntactic description of a system.</li>
<li>Designing the system - both low and high level design</li>
<li>Understanding regulations related to software (e.g., privacy constraints or accessibility rules)</li>
<li>Knowledge of development processes - agile or not agile, TDD or testing at the end of each development phase</li>
</ul>
<li>Software coding skills - these are the skills that allow developers to take a description of a system and develop something that executes on a computer, these skills are:</li>
<ul>
<li>Programming language(s) - The vehicle that translates neural signals in the developer's brain to operations on the CPU. It is crucial to know at least one, but it is rarely enough. The fact that it is possible to use a certain language to code doesn't mean that it is the right language to choose, Turing completeness is not everything. Be versatile, know static and dynamic language, declarative and imperative, functional and OO ...</li>
<li>Development tools - understand what your IDE can give you. Know all the features of your debugger, also all of its blind-spots (concurrency...)</li>
<li>Development ecosystem - know the libraries, toolkits, and basically everything that is already done, correct and useful</li>
<li>Problems avoiding - understand code smells. In my first course on software development the lecturer said "code that is written twice is written once too many" - follow this rule, learn to love refactoring and strive for code reusability</li>
</ul>
<li>Expertise in a technical domain - knowledge beyond coding. It can be machine learning or information retrieval, usability or DB design, security or concurrent programming. A software person must be knowledgeable in a technical domain, this what separates software person from a code monkey</li>
<li>Understanding of a client's domain - this can be anything - from spacecraft aeronautics to medical devices, it is crucial to understand the client's domain in order to be able to provide a product that solves the client's problem. This knowledge is utilized throughout all the software construction life-cycle. From properly understanding the client's requirement, through giving proper names to variables all the way to building a system that is exactly what the client needs. </li>
</ol>
<div>
Only by having a proper combination of skills along these axis, a software person is able to solve the tough problems that the client is facing and provide a solution that works the way that the client needs (and not just the technical problems that the client doesn't really cares about).</div>
</div>
Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-71577621559205278802012-08-25T19:13:00.000+03:002012-08-25T19:13:24.210+03:00What's next for SamsungThe court decided that Samsung had infringed several of Apple's patents, mostly design / user interface / user interaction related ones.<br />
<br />
That's good, because shameless copying without acknowledging should be discouraged.<br />
<br />
So what's Samsung to do next? as I see it, they can choose one of two paths:<br />
<br />
1) The easy way - make the users pay for the infringement by keep on using these patents, raise the devices' price and just give that money to Apple as royalties. As a consequence, there would not be a need to innovate as basically, the problem (how to do good design / user interface / user interaction) is solved, just more expensive to the users.<br />
<br />
2) The hard way - make themselves temporary pay for the infringement by investing in innovation. Create better, innovative, brilliant designs / user interfaces and user interaction schemes. Ones that are both better than Apple's and are patentable. This means investment in research, ideation and development, without any promise of success, but with a promise that in case of success, they'll be bigger than Apple (and that's a lot).<br />
<br />
Which path will they choose ?Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-70600675577367230602012-05-31T23:14:00.000+03:002016-10-13T13:32:26.854+03:00Big data 2.0One of the hottest fields in the software industry today is big data. It seems that everywhere you go you hear about it.<br />
<br />
In the past, what constrained big data from being a reality was low capacity storage (or the price of storing large quantities of data), once this obstacle was removed, and Moore's law kept on ticking, extremely powerful machines were at reach for everyone, and hardware was no longer an issue.<br />
<br />
Once hardware stopped being the bottleneck, it was time for software to stop acting as such. This was addressed by designing and implementing better and stronger analysis algorithms (think of the fields of machine learning and data mining) as well as finding and inventing new visualization mechanisms. These solutions are aiming at taking data and extracting information out of it, either by analytically detecting a signal in the data or by rendering the data in ways that it is easy for the mind to grasp and perform its own analysis.<br />
<br />
The problem with these solutions is that they are at best when there is a definite answer to a well defined question. Still, more than often, that answer is relatively flat and abstracts out the complexity of both the answer and the question.<br />
<br />
There is a need to find a new mechanism, something that would tell the story of the solution, that would deliver the idea that captures the complexity of the question and the complexity of the answer. This is not something that is found in nowadays computer science - it is not a combination of CS and math (to yield better algorithms) or CS and cognitive psychology / neuroscience (the forebearers of the information visualization and HCI fields).<br />
<br />
My guess is that it would be a new field, some sort of an hybrid of CS and philosophy. I specifically think that philosophy is the field from which answers would come since one of the key aspects of philosophy is the ability to tell an idea, a real idea, not just a story (this is the focus of literature) or express a feeling.<br />
<br />
When this field is established - it would be big data 2.0Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-36883250500562152852012-04-21T17:39:00.000+03:002012-04-21T17:39:09.019+03:00Trying out TwitterI'm trying out twitter - look me up at <a href="http://twitter.com/yoavrubin">http://twitter.com/yoavrubin</a>Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-4093242220459162532012-03-19T00:03:00.000+02:002012-03-19T00:03:33.859+02:00The most courageous code comment ever<div class="separator" style="clear: both; text-align: left;">This screen capture (taken from <a href="http://code.google.com/p/virtualagc/source/browse/trunk/Luminary099/LUNAR_LANDING_GUIDANCE_EQUATIONS.s?r=258#175">here</a>), is part of the code that put Apollo 11 and 12 on the moon. More specifically, it is part of the landing guidance code, so these lines were responsible for the 'put' in the phrase 'put a man on the moon'. I will never write such a mission critical code, I don't know of anyone who will. </div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">Still, look at the comments in lines 179 and 180... someone really hoped for it to work...</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCmY5PJT_sHqinMEY0OfvH5c7xl9rXanyoPS9QKUYNvezrY0tH2jPj0__H74muk91cvlUgI7-mWPeDIsxPIwSeXZpAIYhQWr9ooLYFH4BwmpslYdJ1QQeY4-sq5FifBUUXn1_AE2anUXGI/s1600/Capture.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="111" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCmY5PJT_sHqinMEY0OfvH5c7xl9rXanyoPS9QKUYNvezrY0tH2jPj0__H74muk91cvlUgI7-mWPeDIsxPIwSeXZpAIYhQWr9ooLYFH4BwmpslYdJ1QQeY4-sq5FifBUUXn1_AE2anUXGI/s400/Capture.PNG" width="404" /></a></div>Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com2tag:blogger.com,1999:blog-2786700862191536790.post-53476507158219147132012-02-21T11:20:00.000+02:002012-02-21T11:20:55.023+02:00At the end of the rainbowTook this picture a few days ago, I guess that someone found a few leprechaun gold pots on his porch.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7kc63XckfzfwZa5-Ifl3cR_gcO9Ond8FWgiVC3QVv51wGHPjen3Ay5Bz2dqmSHVoxw3QWPobW_oo3UgJPi2qbF-7AF2EwXm8UgAgBoWsZ6f4SjHB5B2tk6_f4SlvrC-mEy2y9PooM0qtS/s1600/photo+4.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7kc63XckfzfwZa5-Ifl3cR_gcO9Ond8FWgiVC3QVv51wGHPjen3Ay5Bz2dqmSHVoxw3QWPobW_oo3UgJPi2qbF-7AF2EwXm8UgAgBoWsZ6f4SjHB5B2tk6_f4SlvrC-mEy2y9PooM0qtS/s400/photo+4.JPG" width="400" /></a></div>Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-39498412705902475432012-02-07T12:24:00.000+02:002012-02-07T12:24:42.379+02:00My book is now publishedThe book, called "Looking inside a Neural Network", is based on my thesis. It is now published and available, see it here: <a href="http://www.amazon.com/Looking-Inside-Neural-Network-Microscopy/dp/3847378686/">http://www.amazon.com/Looking-Inside-Neural-Network-Microscopy/dp/3847378686/</a>Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-88317792925375828432011-09-13T00:19:00.000+03:002011-09-13T00:19:00.291+03:00The Joy of Clojure - a short book reviewI'm currently reading the book "<a href="http://joyofclojure.com/">The Joy of Clojure</a>". This is a rare kind of book - the kind you don't want to end. It explains Clojure - but not in a "do this to get that" kind of a way, which is the way most technical books are. It does it differently, by almost telling a story that reveals Clojure layer after layer. It does so while keeping the Clojure motto of "no unneeded overhead" - exactly what's needed, no more no less.<br />
<br />
Still, if it was just for that, I wouldn't rush to write this short review - there's something else in the way that this book is written, its style is some sort of a combination between an Arthur Conan Doyle novel in the way that it glues you to the page, and a late night show monologue that provides you fun every 30 seconds.<br />
<br />
A must read for every software developer - regardless if you ever plan to write a single line of Clojure code, it would just make you think clearer about code in general and specifically about your code.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com1tag:blogger.com,1999:blog-2786700862191536790.post-39288333584495840652011-09-03T14:01:00.000+03:002011-09-03T14:01:49.864+03:00A function, JavaScript engine and the single var pattern to declare variables walk into a pub<a href="http://addyosmani.com/blog/">Addy Osmani </a>had published a very nice <a href="http://addyosmani.com/blog/lessons-from-a-javascript-code-review/">post </a>that summarizes various problems found when doing JavaScript code review. Most of the points there worth paying attention to. However, there is one point there that he got completely wrong. When he discussed the problem of variables declared all over the place within a function scope, he suggested to use the "single var pattern to declare variables", basically write the variables declarations like this:<br />
<br />
<span class="Apple-style-span" style="color: blue;">var </span>someData = "testing",<br />
otherData = "data1",<br />
moreData = "data2";<br />
<br />
This kind of coding will get you into trouble. Try to find the difference between the code above and the code below:<br />
<br />
<br />
<span class="Apple-style-span" style="color: blue;">var </span>someData = "testing"<br />
otherData = "data1",<br />
moreData = "data2";<br />
<div><br />
</div><div>Found?</div><div><br />
</div><div>let's add to the first snippet the scope of each variable:</div><div><br />
</div><div><span class="Apple-style-span" style="color: blue;">var </span>someData = "testing", <span class="Apple-style-span" style="color: #38761d;">// local within the function</span><br />
otherData = "data1", <span class="Apple-style-span" style="color: #38761d;">// local within the function</span><br />
moreData = "data2"; <span class="Apple-style-span" style="color: #38761d;">// local within the function</span></div><div><br />
</div><div>Now let's do the same for the second snippet:</div><div><br />
</div><div><span class="Apple-style-span" style="color: blue;">var </span>someData = "testing"<span class="Apple-style-span" style="color: #38761d;"> // local within the function</span><br />
otherData = "data1",<span class="Apple-style-span" style="color: #38761d;"> // global</span><br />
moreData = "data2"; <span class="Apple-style-span" style="color: #38761d;">// global</span><br />
<br />
Big difference, but why?.<br />
<br />
Answer: Take a look at the "testing" string. In the first snippet it is followed by a comma, whereas it is not there in the second snippet. That's all, one comma.<br />
<br />
Both snippets are valid JavaScript code, it just happens that even though JavaScript has a C like syntax, it does not require to have a semi-colon at the end of each line, the JavaScript engine will add it if missing.<br />
<br />
So the second snippet is actually:<br />
<br />
<br />
<span class="Apple-style-span" style="color: blue;">var </span>someData = "testing"; <span class="Apple-style-span" style="color: #38761d;">// local within the function</span><br />
otherData = "data1",<span class="Apple-style-span" style="color: #38761d;"> // global</span><br />
moreData = "data2"; <span class="Apple-style-span" style="color: #38761d;">// global</span><br />
<br />
(note the semi-colon after the "testing").<br />
<br />
One more thing to know about JavaScript: when declaring a variable inside a function without the var keyword, it is defined as a global variable.<br />
<br />
Now go and find that little comma somewhere in your code, at 1:00 am , a few hours before delivery.<br />
<br />
I prefer the simpler approach to define variables, and do the following:<br />
<br />
<br />
<span class="Apple-style-span" style="color: blue;">var </span>someData = "testing"; <span class="Apple-style-span" style="color: #38761d;">// local within the function</span><br />
<span class="Apple-style-span" style="color: blue;">var </span>otherData = "data1"; <span class="Apple-style-span" style="color: #38761d;">// local within the function</span><br />
<span class="Apple-style-span" style="color: blue;">var </span>moreData = "data2"; <span class="Apple-style-span" style="color: #38761d;">// local within the function</span><br />
<br />
You can say that it is less elegant, but it is much less error prone, much more descriptive of what you want, can save hours of looking for a comma and simply put, it is just a simpler code. Just remember that beauty is in the eyes of the beholder, and to me, in code, simplicity is beauty .<br />
<br />
</div>Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-24193763043489995452011-08-18T12:54:00.000+03:002011-08-18T12:54:38.602+03:00What's next in the mobile arenaApple has complete control both on the software and the hardware of their mobile devices. Moreover, they have a huge client base (all the iPXXXX people)<br />
Google now also has complete control both on the software and the hardware of their mobile device (assuming that the deal with Motorola Mobility is approved). Moreover, they have a huge client base (all the android people)<br />
<br />
RIM has complete control both on the software and the hardware of their devices, but nobody buys their products and they are loosing their share in the mobile market.<br />
<br />
Microsoft controls its software and wants to increase their share in this market.<br />
<br />
When will Microsoft buy RIM?<br />
<br />
Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-17728069257930119922011-08-13T21:59:00.002+03:002011-08-15T18:55:25.619+03:00The effects of the software patents warThere's a software patents war raging. It is fought between all the players, big and small: Google, Apple, Microsoft, Oracle and IBM are just a few names in the list of the war participants.<br />
<br />
It is all over the news now, <a href="http://www.networkworld.com/news/2011/072911-google-ibm-patent.html">Google buys more then a 1000 patents from IBM</a> and <a href="http://blogs.siliconvalley.com/gmsv/2011/07/quoted-google-counsel-on-software-patent-war.html">fails to buy 6000 other patents</a>, of Nortel. These 6000 patents were bought by Apple, Microsoft and Ericsson. The undertaker of silicon valley<a href="http://www.pehub.com/115158/silicon-valley%E2%80%99s-undertaker-%E2%80%98we%E2%80%99re-anticipating-a-major-fallout%E2%80%99/"> claims that nowadays, what's left of a company that is closing down is the IP</a> (whereas during the 2000 bubble bust servers were what a dying company could sell).<br />
<br />
This leads me to ask about the effect of this war on the recruitment process. I guess that companies in the high-tec industry will start looking for people who know to develop software (transform innovation into code) as well as know how to develop IP (transform innovation into patents).<br />
Would an ad for a software developer include not only the set of technologies / domains that a possible candidate should know, but also how many patents are on the candidate's belt?<br />
<br />
<b>Update</b><br />
The patents war is now going to the next level - <a href="http://googleblog.blogspot.com/2011/08/supercharging-android-google-to-acquire.html">Google bought Motorola Mobility</a> and its portfolio of about 17,000 patents. Now Google has a patent arsenal which can be used to really fight the rest of the big players.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-74358048571188463832011-07-27T14:51:00.000+03:002011-07-27T14:51:08.218+03:00Programming and softwaringProgramming is creating functional components from code atoms (such as a programming language keywords or library calls). It is structuring a code molecule with defined input and output.<br />
<br />
Softwaring is the composition of code units (atoms and molecules), functional components and other software to create an entity that has code organs (such as UI or communication layer), processes and life cycle.<br />
<br />
Programming is chemistry.<br />
<br />
Softwaring is biology.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-47107397006091214352011-06-28T23:18:00.001+03:002011-06-29T07:32:48.309+03:00A different, simpler, approach to visually design business processesAbout a year ago, I co-authored a paper called "What You See And Do Is What You Get: A Human-Centric Design Approach to Human-Centric process". It was accepted and presented at the BPD workshop (BPD here stands for "Business Process Design") which was part of the BPM conference (BPM here stands for "Business Process Management").<br />
<br />
The paper describes a new way to design processes. The key idea there was to reuse the WYSIWYG ("what you see is what you get") design approach (which is used usually for user interface design) in process design, where static page design is not sufficient, but there's also a need to design the dynamic nature of the process.<br />
<br />
I just noticed that the proceedings are now published, so it is possible to read the paper <a href="http://books.google.com/books?id=TXa8-hxKFOQC&pg=PA49#v=onepage&q&f=false">here</a>.<br />
Section 2 there describes in more details the WYS<b>AD</b>IWYG approach.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-83595475499958615132011-06-26T19:47:00.001+03:002011-06-26T19:48:40.752+03:00Comparing programming languages to boatsSee <a href="http://compsci.ca/blog/if-a-programming-language-was-a-boat/" target="_blank">here</a>, a nice comparison of programming languages to types of boats. Very funny, some of it even makes sense (even though I'd say that Java is the Titanic rather then a cargo ship...)<br />
<div><br />
</div><div><div><br />
</div><div><br />
<div><br />
</div><div><br />
</div></div></div>Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-48664620401804873862011-06-13T15:24:00.000+03:002011-06-13T15:24:11.003+03:00Brain-mapping the Dallas MavericksDallas Mavericks just won the NBA title. Watching them was a true enjoyment due to the diversity of the playing styles that this team showed.<br />
When combining together all these playing styles it is easy to see the resemblance of this team to another remarkable machine - the brain. Here is a short list of the key players and their role / playing style as if they are regions in the brain:<br />
<br />
Jason Kidd - Prefrontal Cortex: This region is responsible for planning and decision making (amongst other things). This is the type of basketball that Jason Kidd is playing - very smart and focused on taking the right decisions while planning two moves in advance.<br />
<br />
Dirk Nowitzki - Cerebellum. This region is responsible for repetitive motorical tasks, such as climbing stairs all the way to doing calligraphy. Dirk Nowitzki's game is all about doing several things over and over again, regardless of their complexity - jump backward on one leg, re-balance in mid-air and then throw the ball accurately to the hoop. from the outside it seems complicated, it is if you stop and think about every step. It isn't if done automatically.<br />
<br />
Jason Terry - Amygdala. This region's key functionality is handling the limbic system, i.e. emotions. Jason Terry's game is all about emotions - if he feels that he needs to shot, he'll shoot, no fear, no stress, it can be a win or loose shot, if he feels it, he'll do it.<br />
<br />
Jose Barea - Brainstem - This region is responsible for the basic bodily functions - breathing, temperature control, etc. Jose Barea's game is just as primal as this region- no, thinking, just doing - you are faced with a higher, stronger defender (or two), run into them and throw the ball.<br />
<br />
Sean Marion - thalamus - This region is the communication relay system, just in the middle of so many processes. Sean Marion's game is similar, he is everywhere, does not start anything, may end plays and glues numerous processes together.<br />
<br />
Tyson Chandler - Astrocytes - this is the "skeleton" of the brain - it give structure and holds everything in place. Does not do any calculation, but everything would collapse without it.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-4640104565139118982011-06-08T11:58:00.000+03:002011-06-08T11:58:26.623+03:00Alan Kay's view on type systemsIn <a href="http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en">here </a>there's a very interesting correspondence with <a href="http://en.wikipedia.org/wiki/Alan_Kay">Alan Kay</a> about <a href="http://en.wikipedia.org/wiki/Object-oriented_programming">OOP </a>and his definition of it. Amongst other things, he wrote a short sentence that describes his view in the ongoing debate of static vs. dynamic typing.<br />
<br />
Here's the exact quote:<br />
<br />
"I'm not against types, but I don't know of any type systems that aren't a complete pain, so I still like dynamic typing"<br />
<br />
I couldn't agree more. I don't recall even once that static typing actually helped me in designing software, I can recall numerous times that it just stood in the way, without anything to gain other then detecting errors in compile time, but only the kind of errors that any developer (junior or experienced) must be able to detect easily.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-18718137527564085492011-05-23T23:02:00.000+03:002015-10-09T23:19:04.383+03:00Did Don Giovanni want to be a lumberjack?Just noticed it. Monty Python's Lumberjack song is really similar to Là ci darem la mano from Mozart's Don Giovanni.<br />
<br />
take a look:<br />
Here's the lumberjack song:<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="257" src="http://www.youtube.com/embed/mL7n5mEmXJo" width="400"></iframe><br />
<br />
<br />
And here's Pavarotti doing Là ci darem la mano<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="330" src="http://www.youtube.com/embed/P627lL09hwg" width="400"></iframe>Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-6926497724685088532011-05-20T20:51:00.002+03:002014-12-07T13:52:20.071+02:00Darwinian evolution of programming languagesIn evolutionary biology, when the environment changes, the flora and fauna changes, this is done by adapting to the change and fitting the specie to the new constraints and new opportunities. This is the essence of <a href="http://en.wikipedia.org/wiki/Charles_Darwin">Darwin's </a><a href="http://www.literature.org/authors/darwin-charles/the-origin-of-species/">The Origin of Species</a> - the survival of the fittest.<br />
<br />
Same thing happened in programming languages.<br />
<br />
During the early days, computation power and memory were scarce and expensive, thus programming languages in use were as close to the machine as possible, to exploit everything from these resources - think of LISP's car and cdr, which are based on specific registers...<br />
<br />
After some time, memory was still expensive, but computation power become more available, therefore a new specie evolved - a language that allows to describe the computations done in a more "human" way (i.e., imperative), but still close monitoring of the memory is available. Think of C.<br />
<br />
Computation power kept growing, and new programming paradigm evolved - OO, but still, memory is costly, and there was C++.<br />
<br />
During the 90's memory became cheap, tight monitoring of it became unnecessary and more could be done with it. The stage was ready for the next languages to rule the Earth, and the era of virtual machines started - most notably Java and its JVM, but around that time also Python, Ruby and others appeared.<br />
<br />
Computation power kept becoming more available, as well as memory. But times have changed. Multi-core processors are here, and are here to stay. More power now means more processors, not a stronger, single processor. New languages are now coming out of the primal ocean and taking their first breaths of fresh air (or doing parallel computations). These languages are the functional languages. They were around before, but just like the dolphins that returned to the ocean with enhanced brains and lungs to rule that habitat, It is now their turn to gain dominance.<br />
It is not clear who will win this new race. Some of these languages have the advantage of being able to interact and co-exist with already running software and libraries - such as Clojure with the JVM, or F# with .Net.<br />
<br />
Days will tell who will inherit the planet - exciting times ahead.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-70308513549862240692011-05-13T23:30:00.001+03:002011-05-13T23:31:25.487+03:00ClojureI've started to write code in <a href="http://clojure.org/">Clojure</a>, which is a LISP dialect created for the JVM.<br />
<br />
This means that the code has the aesthetics that can only be achieved when doing functional programming, while maintaining the ability to fully interact with existing Java based libraries and code.<br />
<br />
More then that, Clojure comes along with a modern (almost futuristic) approach to concurrency, way different then the one Java has.<br />
<br />
This is extremely important for a programming language, let me explain why.<br />
<br />
A good way to think of concurrency (and especially data concurrency ) in programming is to think about it as a mine field, where the locations in which the threads are interleaving and handling the same data are mines. Your code is the field.<br />
<br />
Java's approach is "I'll give you the ability to place mines and I'll also give you these small cocktail umbrellas to mark where the mines are". You just have to hope that you placed these little cute umbrellas in the right places and covered with them all the ways to access the mines. This is tough to do right in small scale software (where there are very few developers). Practically impossible to do right in large scale software (where there are too many developers).<br />
<br />
Clojure's approach is different. It says "put as many mines as you want, I'll cover it with so much concrete, that it doesn't matter how many users are travelling in the field". The concrete itself is composed of immutable data, actors/agents model and software transaction memory.<br />
<br />
(BTW, JavaScript approach can be summed up as "there shell be no mines")<br />
<br />
I will not start to explain why concurrency is important, if you don't know, then probably you didn't read all the way up to here...<br />
<br />
This is a delightful language to use (higher order function is by far the most beautiful idea in programming). It is powerful, efficient with a "no fluff just stuff" attitude with a potential to take your code to places that OO just can't go.<br />
<br />
I guess that this is the reason why one of the first books written about Clojure is called "<a href="http://joyofclojure.com/">The Joy of Clojure</a>", not sure that there are such titles about C or Java (a book with a similar title about C++ is probably aimed at the masochist community).<br />
<br />
Try it, you will not regret and will not look back.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-78520591472589413002011-04-26T12:42:00.000+03:002011-04-26T12:42:47.176+03:00Stepback and CrossoverCrossover is a basketball maneuver that when done properly, allows the attacker to move pass the defender, but at risk that if the attacker wants to take a shot, the defender may be still close enough to block it. If the attacker needs to take a shot, there's another manouver, called stepback, in which the attacker (very very) quickly gets close to the defender and then steps back.<br />
<br />
<br />
See here how Kemba Walker does a crossover followed by a stepback with a Baryshnikovian perfection.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="255" src="http://www.youtube.com/embed/yyF6amZw82M" title="YouTube video player" width="400"></iframe>Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-89278176421697771522011-04-17T10:20:00.002+03:002015-10-05T22:32:09.471+03:00Research, Engineering and NoveltyIt is possible to distill the research process into these steps:<br />
<br />
<ul>
<li>Immerse yourself in a domain</li>
<li>Grok it till you can spot holes in it</li>
<li>Find an idea that covers one of these holes </li>
<li>Show the novelty of that idea by the fact that it fills a hole or covers some aspect of the domain that wasn't covered before.</li>
<li>Prove the idea either formally using theorems and lemmas or present data that supports the it with some level of certainty</li>
</ul>
If you need to build a system to prove the idea, it is a disposable, one shot system, that solves the given problem and its set of users is the researcher / research team.<br />
<br />
The grand finale of the research process is when it is dumped out as a research paper that is accepted to a journal or presented in a conference.<br />
<br />
Engineering is somewhat different.<br />
<br />
The engineering process is initiated when there's a need to solve a problem - which is done by constructing and materializing a solution (which does not have to be a novel one).<br />
This usually involves a development process. The solution's novelty can be further protected as a patent.<br />
<br />
In this process, a bulletproof and robust solution is the holy grail.<br />
A successful system is one that:<br />
<ul>
<li>Solves the given problem</li>
<li>Provides maximal output with minimal resources </li>
<li>Can be used by many users (not just by the solution/system developers) </li>
</ul>
The grand finale of an engineering process is a satisfied user (this can be someone crossing a bridge, a pilot flying an aircraft or a gamer playing in a virtual world).<br />
<br />
I was, am and will be involved in both of these processes, so all I can say is that the understanding in which process you are is far more important then the kind of process you participate in.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-60864832355610027842011-03-10T07:25:00.001+02:002012-10-09T05:18:21.313+02:00Beautiful codeI am currently reading the book <a href="http://www.amazon.com/gp/product/B0026OR2NG/">Beautiful Code</a>, which got me thinking "what is the most beautiful code I've ever written". The answer came up really quickly.<br />
As part of my dissertation I developed an image analysis and statistical data mining and analysis software. In this software, one of the functions was responsible to detect correlation of events between two vectors, where each vector holds the times in which a neuron fired an action potential. This kind of computation is called <a href="http://en.wikipedia.org/wiki/Cross-correlation">cross correlation</a> but with the constraint that the correlation is bounded by biological time frame (usually less then 100 ms).<br />
<br />
The initial implementation looked as follows, where 'sVec' and 'tVec' are the vectors, and 'before' and 'after' define the biological time frame.<br />
<br />
<br />
function crossCol = calcCrossCorrelation(sVec, tVec, before, after)<br />
numOfSourceMaximas = numel(sVec);<br />
numOfTargetMaximas = numel(tVec);<br />
crossCol = zeros(before+after+1, 1);<br />
for i=1:numOfSourceMaximas<br />
sourceSpikeLocation = sVec(i);<br />
for j=1:numOfTargetMaximas<br />
targetSpikeLocation = tVec(j);<br />
delta = targetSpikeLocation - sourceSpikeLocation;<br />
if(delta< -before)<br />
continue;<br />
end<br />
if(delta > after)<br />
continue;<br />
end<br />
crossCol(abs(-before - delta )+1) =<br />
crossCol(abs(-before - delta )+1) +1;<br />
end<br />
end<br />
<br />
This code basically runs on every combination of any event in the vectors and checks whether the combination occurred within the given time frame. It ran slow, really slow. To analyze data from one imaging session and to complete all the checks of all the cross correlations of all the cells I needed a few days, so I sat down to optimize this code, the final result looked like this:<br />
<br />
function crossCol = calcCrossCorrelation(sVec, tVec, before, after)<br />
<br />
distMat = bsxfun(@minus,tVec',sVec);<br />
filteredDist= distMat ((distMat >= -before) & (distMat <= after));<br />
crossCol = histc(filteredDist, (-before:after));<br />
<div>
<br /></div>
<div>
Thee lines of code.</div>
<div>
<br /></div>
<div>
The first line creates a distance matrix between the two vectors (using Matlab's utility bsxfun, which is very efficient). </div>
<div>
The second line is filtering out this matrix into a vector that holds all the cells whose value was within the biological time frame.</div>
<div>
The third line bins all these values to a set of bins for all the values in the biological time frame (the set of values is defined by the 'before' and 'after' parameters and the sampling rate which affects which values would exist in this range).</div>
<div>
<br /></div>
<div>
This change made the same analysis run in a matter of about 30 seconds, as well as being beautiful code on its own.<br />
<br />
The updated code results from a change in the problem solving approach - thinking of the problem in terms of matrices and what can be done with vectors/matrices and arrays instead of thinking about each event on its own. This thinking paradigm is very powerful, especially when using the right tools (in here - Matlab).</div>
Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0tag:blogger.com,1999:blog-2786700862191536790.post-12647831581684145802011-02-27T15:20:00.000+02:002011-02-27T15:20:33.591+02:00Equality, transitivity and JavaScriptOne of the simplest ways to explain transitivity is using the equality operation, by saying that if A equals B and B equals C then A equals C. This is commonsense stuff, how can it be different.<br />
<br />
Well, it can.<br />
<br />
In JavaScript, the '==' (double equal) does type coercion, and therefore ends up in non-common-sense situation where equality in not transitive. See in the following example where A equals B, B equals C, but still, A does NOT equals C :<br />
<br />
'0' == 0 <span class="Apple-style-span" style="color: #38761d;">// true - the string 0 (zero) equals the number 0</span><br />
0 == '' <span class="Apple-style-span" style="color: #38761d;">// true - the number zero equals empty string</span><br />
'0' == '' <span class="Apple-style-span" style="color: #38761d;">// false - the string 0 (zero) does not equal empty string</span><br />
<span class="Apple-style-span" style="color: #38761d;"><br />
</span><br />
seems that common sense is over appreciated...Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com1tag:blogger.com,1999:blog-2786700862191536790.post-40177906393316442232011-02-23T09:13:00.000+02:002011-02-23T09:13:28.809+02:00Cause and effectGot my self and iPad. Seems that now I need to go through a wide-smilectomy procedure.Yoav Rubinhttp://www.blogger.com/profile/02020814739195147149noreply@blogger.com0