January 24, 2015 Book Reviews No comments
January 24, 2015 Book Reviews No comments
I started to buy equities thanks to the interview for the developer role I had in local financial startup. So in order to better understand their business I opened an account with a broker bank. (Btw, I even had gambling accounts when I worked for a betting company.) My current equities portfolio is up 7% since September 2014 when I started to invest into equities. Of course I’m in a good position since it is still bull market we are in. Nevertheless there is a lot of danger in this overheated environment and way too many pitfalls. So knowledge, discipline and patience are key.
As for the knowledge there are plenty of books written on investing. A lot of them are just mutually contradicting and more often than not useless. But there are books that were tested by time and deserve their mention in “best” lists. No wonder top of most of those lists is “The intelligent Investor”. I’m reading it at the moment and I can tell that it is by far the most far reaching book of all other ones I’ve read on investing. But to be honest, I’ve only read very few and I didn’t pay to much attention to selection of books, so I was reading some nonsense about doomsday and gold rush. Therefore I decided to come up with some good list for this year, since I anyway planned to read at least 13 books on investing.
I compiled this list in very simple way by searching the web for lists of recommended books and then selecting only those that appear most frequently in those lists. I scanned maybe 20 lists. The list below is like unsorted merge of other lists. I’m planning to have reviews for each of these books and then in the end of the year to have a list with overview and maybe my rating. So if I come up with rating list, it will also include other books I’ve already read on investing that didn’t make it into this list.
Some other books I consider to read or I might read instead of one or few above
If you are total beginner I think it is wise to start with smaller books like “The Little Book of Common Sense Investing” or “The Richest man in Babylon”.
I think it is very important to have the knowledge in a field you want to operate in, being it software development or investing or whatever. So good luck both to you and myself.
January 23, 2015 .NET, JavaScript 1 comment
In a project I’m working on we have plenty of shared logic that we want to execute both on client and server. We decided that we want it to be written in JavaScript. As our backend is .NET we used Jurassic library to compile JavaScript code on the server and then to execute it whenever we needed it. We used Jurassic library for quite some time and it worked fine. It is a bit slow on doing initial compile of all of our JS code, so our startup time lagged (+30 sec or so). Execution time also wished to be better. But recently we started to get crashes that seemed to be from the library itself, but it is a real pain to find out what was the problem since library doesn’t provide JS stack trace.
If everything goes smoothly all you need to do is to reference EdgeJs.dll through NuGet and execute your node script using Edge.Func. But life is not that easy.
I would recommend to create minimalistic project with basic things that are used in the project you are going to integrate Edge into. This will allow you to save time on testing how integration works. You can start with hello world available on Edge.js page. I’ve also created simple project with few things I wanted to test out, mainly loading of modules, passing-in and getting results.
Here below are three files from my sample project. It should be easy to follow the code plus there are some comments just below the code.
In Program.cs you can see how easy it is to invoke Edge and pass in a dynamic object. Getting result back is also super easy. If you are working with large objects you might want to convert the object to JSON and then pass it into your JavaScript. This is what we do using Newtonsoft.Json.
Edge.Func has to accept a function of a specific signature with a callback being called. Alternatively you can have a module that itself is a function and then load it. Exactly what I did with module edgeEntryPoint.js. To do something useful, I’m trying to dynamically find an object ‘className’ and call a function ‘functionName’ on it plus I send some other parameters. This is somewhat similar to what we want to achieve in our project.
calc2D.js is a module with logic that I’m trying to call. There is one interesting thing about it. It is the way how it exposes itself to the world. It checks if there is ‘window’ and assigns itself to it or otherwise assigns itself to ‘GLOBAL’ so this module with work fine both in browser and in Node.js.
It is very likely that you are signing your assemblies therefore you will get compile error telling you:
Assembly generation failed — Referenced assembly ‘Edge’ does not have a strong name.
Don’t panic. You can still sign Edge.dll. There are few ways of doing it. You can even rebuild Edge source code with your key.snk or what I find more easier is to disassemble, rebuild and sign from VS console using 2 commands:
ildasm /all /out=Edge.il Edge.dll
ilasm /dll /key=key.snk Edge.il
In case if you want to run same JavaScript both on client and on server you might run into issues of namespacing and global variables. Above I’ve already demonstrated how we exposed our own namespace by checking if ‘window’ is defined. If you are trying to load a lot of modules you might want to assign them to global variables before your callback function returns. For example:
moment = require(‘../../moment.js’);
If you still get error ‘window is not defined’ it could be that some internal logic is relying on global ‘window’ being defined somewhere. In order to fix it you can just have this kind of a hack in front of your entry function:
GLOBAL.window = GLOBAL;
There is already issue reported on this on GitHub edge#215, which I believe is similar to what we are experiencing (if not exactly same).
In our case we want to run JavaScript from .NET that runs in IIS. I created wrapper around Edge that keeps compiled function, and then Invoking is done whenever we need it. One interesting thing started to happen when I had web site pointing to bin folder. After rebuilding the app initialization would hang on Edge.Func. If I kill the w3wp.exe process and start the app from scratch all works just fine. Unfortunately I was not able to reproduce this with console application. I suspect that this has something to do with how IIS threads run and possibly locks files, but still if I locked node.dll, double_edge.js and edge.node files for console app it was not reproducible.
Issue was solved by ensuring that IIS is stopped before building the web project. This can be achieved by using commands ‘iisreset /stop’ and ‘iisreset /start’ in BeforeBuild and AfterBuild tags of your csproj file.
I don’t think that this is the best way to solve this or that running Edge.js in IIS is very reliable, so I spent a bit of time reading source code of Edge.js and debugging it. And to be honest I don’t quite understand all the things around invoking native code to make all this magic happen. Because of this I’m not 100% sure that entire solution with Edge.js will prove itself to be a decent one.
All in all Edge.js is a really great tool. Not so long ago things it does would be unbelievably difficult to achieve.
I hope this post is of some help to you.
January 14, 2015 YearPlanReport No comments
2014 didn’t turn to be forth life changing year in a row. I still have the same job and live in the same place. As I probably mentioned before, I’m working as subcontractor to International Atomic Energy Agency (UN associated organization). This year I’ve mostly done JavaScript and less of .NET. But I don’t mind. That is because JavaScript has its own beauty.
My daughter is now bit older and of course occupies a lot of my time. She needs more and more attention as she moves closer to being two years old. In her year and a half she already travelled more countries than her grandparents in their lives. 2014 was definitely a year of travel. We visited islands of Malta and Mallorca and I’m really glad that my daughter is fine with planes, because this means that we can have more distant trips in future. Of course we travelled by car all around Austria (Prague and other places in Chez Republic, Munich, Slovenia and Croatia, Poland, lots of Hungary, etc) and in Austria, mainly visiting public swimming pools, museums and having some outdoor activities.

It is fair to say that we tried to have each and every weekend somewhere outside. This of course had impact on what I could do to improve my professional skills outside of the work, which I didn’t do much except of reading few books.
There is one different thing that I started doing in 2014. I’m investing my money now. And not just bank deposits or mutual funds as I used to do, but the real thing – exploring equities and other instruments and buying then (for long). I’m planning to do more of this in 2015.
This is continuation of my year plan/report thread. I had similar plan for 2010, 2011, 2012, and for 2013. Completion of 2010 list was almost 100% successful, completion of 2011 list was less successful. 2012 list completion is somewhere in between. Both 2011 and 2012 greatly changed my life. Same was with the year 2013 and it was mostly successful. You can see above how my 2014 year went.
Last year I didn’t come up with new year’s resolution. Things didn’t go sideways because of that, but I had nothing to compare my achievements with. I think I will better have some simple list on what I’m planning and want to do.
It is a bit late, but I wish you all
April 8, 2014 EmberJS No comments
I had to implement copy functionality in our Ember application so it would allow to copy any section of data from parent source to target. In order for this to work deep copy of corresponding section has to be created and each id changed in it so that Ember handles it as another entity.
In Ember you can add Copyable mixin to your object and then implement method copy(). That’s fine, but what if you want to make it generic for anything? Other approach we all know is deep copy by serialization/deserialization.
If you are using Ember Data it is likely that you have your own serializer and adapter. So in order to implement deep copy you will need a bit of “magic”. Here it is:
copySection: function(source, target, sectionName){
var sourceSection = source.get(sectionName);
var copiedSection = sourceSection.serialize();
var type = source.constructor.metaForProperty(sectionName).type;
var serializer = this.store.serializerFor(type.typeKey);
// traverse your copiedSection and generate new ID for each child
var normalized = serializer.extractSingle(this.store, type, copiedSection, copiedSection.id, 'findById');
var deserialized = this.store.push(type, normalized);
target.set(sectionName, deserialized);
},
Hope it comes handy for someone.
April 7, 2014 HowTo, Opinion No comments
Usually when I have some adventures with backing-up and restoring I don’t write a blog post about that. But this time it was bit special. I unintentionally repartitioned external drive where I kept all of my system backups and large media files. This made me rethink my backup/restore strategy.
I will begin with the story of my adventures. Currently I’m running Windows 8.1. The other evening I decided I want to play old game from my school days. Since I couldn’t find it I decided to play newer version still relatively old – released in 2006. As usual with old games and current OSs it wouldn’t start. As it is normal for programmer I didn’t give up. First of all there was something with DirectX. It was complaining that I need newer version, which I of course had, but it was way too new for the game to understand. After fixing it game still wouldn’t start because of other problems. I have changed few files in system32. It still didn’t help. Then I decided on other approach – installing WinXP on virtual machine and run it there. I did it with VirtualBox and it didn’t work because of some other issues. Then I found Win7 virtual machine I used before for VMware, but that VM didn’t want to start.
At this point I decided to give up with that game. So to compensate I started looking for small game I played in university. Unfortunately the other game also didn’t want to start by freezing my PC. After reboot… ah… actually there was no reboot since my Windows made its mind not to boot any longer!
Now I had to restore. Thankfully my Dell laptop had recovery boot partition and I was able to quickly restore to previous point in time. Not sure why Windows didn’t boot if recovery wasn’t pain at all.
After that happened I decided that I need additional restoring power. So I ran program by Dell called “Backup and Recovery” to create yet another backup of the system. Program asked me for drive and I found one free on my external HDD where I keep system images. Unfortunately I didn’t pay attention to care about what that special backup might do. It created bootable partition and of course repartitioned entire drive. I pulled USB cable when I realized what it started to do!
I had to recover again, but now files on repartitioned drive. If you look online there are some good programs that allow you to restore your deleted files and even find lost partitions. One of such is EaseUS, but it costs money and I didn’t want to pay for one time. Thus I found one free called “Find And Mount” that allows to find lost partition and mount it as another drive so I can copy files over. That’s good but for some reason speed of recovery was only 512Kbit/s so you can imagine how much time it would take to recover 2TB of stuff. I proceeded with restoring only the most important stuff. Maybe in total restoring took like 30+ hours.
Bit more on this story. Since I needed to restore so much stuff I didn’t have space for it. My laptop is only 256Gb SSD and my wife’s laptop (formerly mine) also has only that much. But I had 512 HDD left aside. So I just bought HDD external drive case for some 13 EUR and thus got some additional space.
So that was end of story. Now I want to document what I do and want to start doing in addition to be on the safe side.
What’s are the top most important files not to lose? – These are photos and other things that are strongly personal. I’m pretty sure if you have some work projects they are already under source control or handled by other parties and responsible people. So work stuff is therefor less critical.
My idea is that your most important things should be just spread as much as possible. This is true for photos I have. They are just on every hard drive I ever had. At least 5 in Ukraine and 4 here in Austria. Older photos are also on multiple DVDs and CDs. Some photos are in Picasa – I’m still running old offer from Google 20Gb just for 4$ per year. All phone photos are automatically uploaded to OneDrive with 8Gb there. Also I used to have 100Gb on DropBox but then I found it too expensive so stopped keeping photos there.
All my personal projects and things I created on my own are treated almost the same as photos, only they are not so public, often encrypted.
So roughly backup strategy:
I started to think if I want to buy NAS and some more Cloud. For now will see if I can get myself into a trouble again and what it would cost if it happens.
On the image below Disk 0 is my laptop’s disk. Disk 1 is where I now have complete images of 2 laptops at home, complete copy of Disk 2 and also Media junk. Disk 2 is another drive with Windows installed, which will now be used regularly for backups and for “File History”.
Now some links and how-to info:
This was just a story to share with you but it emphasises one more time that backups are important.
P.S. I finally managed to play newer version of 2nd game :)
March 24, 2014 Conferences, Opinion No comments
What a silly title for the post. What if everyone wrote about what they are NOT doing?
Well, I write this blog post partially to convince myself that decision on not attending NDC2014 is right and partially to share my thoughts on such aspects of attending conferences as price and return of investment.
I always wanted to visit some big developer’s conference. One of the conferences that I definitely like is NDC (either in Oslo or London). I think it has best mix of technologies that match my interests and at the same time has big names in it.
I wanted to go there for 4 times. First time I just asked my company in Ukraine, but it would be too expensive for them and I don’t know if they ever sent people to such conferences. Second time I asked company here in Austria, but I was new employee to send me somewhere – I didn’t have a chance to prove that I worth it. Third time I just couldn’t do that because my daughter was about to be born. And this summer I’m not going to allow myself to attend it on my own.
Reason is simple – price. I’ve calculated that it would cost me around 2600 Euro (~3600$) to attend it. This includes tickets for the conference and flights, hotel, food and 3 working days. Organizers wouldn’t give me a discount.
Being self-employed makes you really consider such things as conferences from manager’s or company’s perspective. You start to think about return of investment and how to justify conference attendance. Real question is if money spent on conference will benefit you correspondingly.
NDC videos are available online shortly after conference. It is not a secret that what people get from conferences is not content of presentations but possibility to establish relations with gurus who are at the top in the industry. I heard this so many times. One of my old friends said that conference really starts when presentations are over and people get together at lunch or dinner or at party.
Taking this into account it is very hard for me to believe that I could establish good connections at any conference. I’m usually shy, especially when it comes to social events and new connections. I don’t think that I’m only one who has this problem. Probably most of developers to some extend have similar issues. I found some articles on how you can attend conferences as yourself. But point that I’m trying to make is that usually it is company that pays for their employees therefor developers are not that much concerned about the price and of course they are happy to attend. I would also be happy if someone paid for me. Some say that conferences are often just a reward for best developers for being loyal to their companies.
I concluded for myself that from learning perspective I would not gain much from this conference and from networking perspective it doesn’t worth so much money. Of course there is tiny chance that I’m overlooking some big opportunity.
I believe that if I spend just half of those money on small conferences and tools/learning I will get more in return.
This beginner’s guide to attending conferences is quite useful. I think I will use some of the provided hints when I’ll be attending smaller conferences.
One last thing, probably ultimate goal for any attendee of any conference is to grow to the level when you are invited as one of key speakers.
January 22, 2014 Agile, Opinion 3 comments
Here is how top of my working tasks list looked like in the end of a day:
![]()
I’ve got nice count of 10 commit items awaiting to be pushed to the server.
![]()
Have you noticed number 10? Why 10? And what should it mean?
10 a day is my limit at the moment!
What if something new pops up?
There is one special rule: You can always interrupt to add task to your list. Apparently when you work on task some items pop-up, if you address everything at that moment you won’t be able to complete your main pomodoro. Instead what you can always do is to switch screen type task and again switch to your work.
What if new big stuff comes up on your way?
How many personal pomodoros there should be?
How to stick to this technique?
January 2, 2014 EmberJS No comments
December 29, 2013 YearPlanReport 2 comments
Year 2013 became life changing for me again being the 3rd year in a row, when I say this.
At the beginning of the year I knew that we are waiting for the baby. I decided on changing my job and approximately at the same time when my daughter was born I changed my job. Now I work for UN associated organization and I started working on something interesting – an offline capable web application written with EmberJs.
My plan for the year 2013 was quite extensive and had 21 items. I’ve achieved more than half of that but still much wasn’t done. Interestingly things not done are mostly skills related, which should probably keep me alerted.
Now a bit on each item.
The best thing which could happen. My daughter was born on 10th of June. Here are few pictures.
Now she occupies tons of my time. But it is not an excuse it rather has to be reason to do more!
Travel a lot. We definitely travelled a lot year. Because now we have small baby at home we are somewhat limited in distances we could travel. Thus year was mostly Austria explorative. My wife writes a blog post for each of our trips to different attractions.
![]()
Buy a car. I bought Ford Focus Traveller with big boot. Now we need one. It is diesel car so driver experience is somewhat different, but on other hand car proves itself great for long trips. Also I already took car for 5 times to Ukraine this year.
Ski high in the Alps. Not that I skied much this year. But I have a picture that proves that I skied in Alps at hight altitudes. Taken in Obertauern.
![]()

Learn German for real A2. I think I’ve failed here. No real need in communication in German. But I’ve attended A2 course so maybe I’ve learned something. At least for sure there is improvement when comparing to 2012.
Improve English fluency by applying more synonymous and idioms. Maybe. Now I work at UN where I have to collaborate with different people from all over the world in English, including native speakers.
Perform well & keep being challenged at work. I’ve changed my work. Now I’m self-employed and work by contract for UN associated organization through the other company. I’m happy that I’m quite challenged now, mostly thanks to interesting project and Iraqian boss.
Contribute to open source. Fail. One gist doesn’t count.
Deliver many technical presentations. None delivered. Instead I performed quite few presentations to our users. I even had to wear suite.
Extend social network at work & outside. Mostly failure here. My exposure has changed now. I feel myself somewhat in very closed community of developers.
Write some web project. I do this now at work all days long.
Do programming in other languages than C#. Yes, now I mostly program in javascript.
Take part in one or few programming contests. Fail, except of some TC single round matches.
Visit one or few conferences. Fail.
Improve blog quality. Fail, since nothing has changed on this blog and post frequency is low.
Write at least 41 blog posts. Fail.
Increase community visibility. Fail.
Read as many books as I like. Well, this couldn’t have been a fail.
Consistently do exercises. Fail.
Reach 2013 reputation at stackoverflow. Fail.
Earn 2013 euro outside. Since now I’m self-employed and earn significantly much more than before. I would say that here I’ve oversucceeded here.
Generally it was very good year. I’m very happy because of my born daughter. She is great. Next year we will start learning programming and travel a lot together.
Unfortunately it is very likely that whatever I say is just like on the picture below:
Nevertheless, I wish you all
HAPPY NEW YEAR!
December 7, 2013 EmberJS, JavaScript, Web No comments
I would like to show you how Chosen can be quickly integrated into your EmberJs application together with Twitter Bootstrap.
If you just want a solution, here is my gist: https://gist.github.com/andriybuday/7849057
Otherwise read a short story with some comments and “excuses” from my side.
I’m currently working on web application. We use JavaScript MVC web framework called EmberJs. It is very cool framework, and I will write about it more in the future. Ember has small set of views and input-helpers. Just using them is not always enough to build solid and rich application. Fortunately there are tons of controls available online, and it is quite easy to write your own controls with Ember.
Most of online available controls/plugins are based on jQuery (no surprises, of course) and they use plain javascript objects. Ember wraps javascript objects into Ember.Object, so it allows for data binding, data tracking and other advanced features, but on other hand it makes impossible to use vast majority of web components right away. You need to adapt them in order to to use them with Ember.
Having component created with Ember would result in application-specific html-tag, that would use JavaScript logic defined by you. Something like: <my-own-html-tag… that does and shows what you want.
Chosen. One of the controls we wanted to use was Chosen. “Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly.” It allows you to have nice multi-selects that look like one below:
I’ve found a quick way to integrate chosen with Ember. As per me easiest way would be to utilize existing view called Ember.Select. You can embed it into your new component.
To be completely fair, my solution is not perfect, since I needed to hack html generated by Ember and manually handle selection/deselection of elements from the list, but solution below allowed me to achieve results fast without much code.
(Other option would be to avoid using Ember.Select and then play a lot with defining proper view for your component.)
If you are one of my constant readers, it might be bit surprising that I’m writing about web, and not even from .NET perspective. But believe me, you can expect more. I wanted to do more programming in other languages. This is why I struggled to try many programming languages. But thanks to some coincidences I currently code in javascript most of my time.