| | Posted Jun 27, 2011 [category: Programming tag: Clojure] Leave-Comment View-Comments | |
A long time ago I set out to start a blog and at some point, thereafter, I decided that building a custom blogging platform was a better idea than choosing from one of the many off-the-shelf solutions. I'm not going to go into the many reasons why I made this decision, but I will say that one of the reasons was to learn a new programming language, which has led me to where I am today - knee deep writing code in Clojure and writing blog posts about a programming language I'm happy to have discovered.
| |
So Why Clojure?  Originally, I picked Clojure for its speed, access to Java libraries, effectiveness in parallel computing, concurrency management capabilities, functional language paradigm and powerful code generating code macro system. But as powerful and impressive as these features are, none of them are really the reasons why I am still using the language.
After several months of work, I have discovered what I like the most about Clojure is that it brings together the best of what many languages have to offer while not forcing it all upon me and, in doing so, has provided a good balance between power and flexibility. For example I have found that I can utilize pretty much any Java library, yet I don't have to spend much time interfacing with Java. I can implement code or features using functional abstractions, but I can also choose to incorporate object oriented abstractions. I can choose to declare data types in select cases where it might be needed or I can allow Clojure to choose for me, eliminating some boiler plate code that would otherwise be distracting. The list of examples showing both Clojure's power and flexibility can go on and on.
Ultimately, what's really important to me, is that much of the code complexity I normally associate with programming can still be abstracted away, even while having access to mega powerful features. This, in turn, has allowed me to spend more time focused on my business ideas and less time figuring out how to code them. With Clojure I accomplish more and have found a greater sense of happiness with the work I am doing.  Scope of Content  Clojure is a rich language, loaded with features. So much so, that one could literally find themselves writing a book, even when only intending to write a blog post! So while reading this guide, it's best not to expect coverage on many of the super cool features that Clojure has to offer as I've only been able to give consideration to what I believe is necessary for a beginner to get started. 
| |
 | | View Additional Content | |
| |
| | Posted Feb 19, 2011 [category: Finance tag: Stocks] Leave-Comment View-Comments | |
Year over year I have been doing fair job adding to my RRSP accounts and a fantastic job in neglecting my TFSA (Tax Free Savings Account). Fortunately I had a few stocks kicking around and by moving them into a TFSA I am able to prevent further taxation on any future gains. What a great idea, right?
Just not as simple as it sounds.
| |
Unfortunately, since these stocks were in the form US equities held at a US banking/trading company, I was required to cash them out[1], convert the proceeds into Canadian currency, route the proceeds over to my Canadian tax free savings account and then, afterward, re-purchase those same US securities.
Cashing out was, of course, the easiest part which was followed by a conversation with an E*trade rep whom explained that converting the funds to Canadian dollars would cost me (big time). Not only would I be required to pay the markets exchange rate, which was 0.9981 at the time, but they also wanted to take an additional 2.25% just to manage the exchange. Paying E*trade this much money did not sit well with me and so I decided to try my bank instead.
Now, having been with my local Canadian bank for a very long time I would have thought they could offer, even marginally, a better deal. Surprisingly, they were much worse. They wanted a whopping 2.98% on top of the market exchange rate and that was not going to happen!
A little later I did a Google search which returned a mention of CalForex. Thankfully I discovered a reasonable 0.064% handling fee[2]. Upon chatting with CalForex, I learned the process to make an exchange with them. They simply requested a client account be opened, then to provide a draft or money order to make the exchange. Easy, peasy (yeah right)!
Since the people at E*trade (wanting 2.25%) could not make a draft order to CalForex on my behalf, I ended up having to open a US bank account with my local Canadian bank (the people wanting 2.98%). In doing so, I was able to have the money wired over from E*trade and have my local bank make the draft order instead. All this followed by a short walk, check in hand, to the CalForex office where I made the exchange, then returned back to my local bank and deposited the Canadian funds into my Canadian account.
If any of this sounds like a lot of work for insignificant returns just take a look at the following grid having a few scenarios:    It's also worth mentioning that by having a US friendly Scotia iTrade account you can save even more money when re-purchasing the US securities. And if you're a long term investor, like myself, you can simply pay the $30 for the first quarter, make your purchases, then revert your account back to a standard account (to prevent having to pay $30 each quarter).  Note: This post represents my personal experiences and choices. I am not a financial adviser. I am not even in the finance field, so please do your own due diligence and make sure you're making the right choices for your situation. [1] Don't forget there will be a tax consequence on any capital gains if you choose to cash out.
[2] My CalForex rate (0.064%) was based on dealing with the corporate services office, not the retail outlet. The rate was also considered a preferred rate based on opening a "preferred client account", whatever that means.
[3] The CalForex rate may change with different amounts. In the table providing scenarios, I only used the rate based upon my personal amount, so you may want to check your own numbers (it will still be much better than the alternatives).
| |
| |
| | Posted Jan 30, 2011 [category: Programming tag: Arc] Leave-Comment | |
This last weekend I was hackin with the arc programming language and while I find the language really enjoyable, its sore spot is the lack of useful database interfaces. Needless to say, my tinkering evolved into writing a new interface and provides access from Arc to FleetDB. In this post I cover the features FleetDB brings to the table, what it brings to the Arc language and also an overview of using the client code.
| |
FleetDB
FleetDB is a No-SQL database solution that's schema free and optimized for agile development. It was written by Mark McGranaghan. If you would like to know more about FleetDB you can read about it here.
For now, here is a high level list of features that FleetDB offers:
- The data is all kept in memory allowing for really fast execution.
- It's schema free allowing for adhoc data structure changes and really easy dynamic upgrades.
- Operations use Clojure's STM transaction model for concurrent operations.
- Durability comes in the form of an append-only log file.
- Many programming language clients.
- Uses a JSON-based protocol.
 Arc  Arc is a dialect of Lisp written by Paul Graham and Robert Morris. It's a fairly new language having a very small, but friendly community. It's also a very easy language to learn and use, however it has very few libraries making it difficult to do many things (out-of-the-box). If you would like to learn more about Arc you can find the tutorial here or get involved at the community forum here.  Arc with FleetDB  Arc, currently, provides no concurrency transaction model for its data structures that would ensure the integrity of in-memory data. And while you do have the option to implement queuing mechanisms with code, I believe you'll find it's better to have a transaction layer to abstract that complexity away. For those of you that see the value in such a feature, know that FleetDB can bring that to the Arc programming language.
Another significant benefit that FleetDB can bring to Arc is the ability to cross-pollinate with other languages. FleetDB has client code already written for languages such as Ruby, Python, Clojure, Node.js, Perl and now Arc. They all share a common JSON protocol so if your data is stored in FleetDB, and you need to use a library for some feature that Arc does not support, you may be able to spin off that piece to another language like Ruby. All the while Arc still has the ability to relay information to and from these other languages through FleetDB.
Want to know more? Then see my walk-through of using FleetDB options via the Arc programming language. | |
| |
| | Posted Nov 04, 2010 [category: Hardware tag: iPad] Leave-Comment View-Comments | |
The other day I stopped in at BestBuy to shop for DVDs and, as always, I couldn't help but wander over to play with the iPad and drool. Funny thing is, after picking it up, I noticed the mail icon had a message received indicator...
| |
Well, curiosity got the best of me and I opened the mail app to discover some *wildly entertaining* email, that made the DVDs I had just picked up seem utterly boring (a message from some girl to some university employee - you can only imagine). So I clicked a button hoping to get out, which took to me to the inbox showing her complete history with titles such as 'Scotia Bank account statement'. By that time I had an audience, including the BestBuy crew, looking over my shoulder. Some, jokingly, suggested devious replies to threads within her inbox.
You'll be happy to know I did the right thing. I sent a brief email, from her own account, informing her that while logging into her web-mail she somehow saved her account data within the devices config settings - not just as a cookie where logging out would protect her. I also let her know that I deleted the setup to prevent any further onslaught.
Ah the new world we live in - something to drool over right?
| |
| |
|