Friday, December 11, 2009

I'm a Code Manager

Product Manager, Project Manager, HR - i.e. People Manager, Technical Account Manager, Development Manager, Build Manager....and developers. Some develop and the rest manage stuff.

WRONG!

You know what? I want to be called by my new title: Code Manager. Everyone manages something and I manage code.

THERE!

I guess I missed the many architects, we can call them Code Benders - hey, I actually like that!

Happy coding!

P.S. I think I left out the Resource Manager - as in some companies, people are known as "resources". So in a project, the Project Mananger can choose 3 resources: a cofee machine, a printer and a developer. WRONG. I'm a Code Manager, not a resource, so please...

Thursday, September 24, 2009

My Nokia 770

I love my Nokia 770 and it's much more useful than the iPod - I must say...Since I was bashing all device manufacturers other than Apple, I must exclude Nokia from the list...

Having the courage to come up with a Linux-based Internet tablet, when they did, puts them squarely in front of Apple...

The thing is that I use them both (iPod Touch and the 770) as remotes to control movie playing at home and the Nokia is better equiped to be the remote. It is a little bulkier and sluggish to reconnect the WiFi, but the web browsing experience is much better, for the simple pages my application requires (larger screen helps, but the ergonomics of full-page and persistent zoom are what make it the better one).

Fully customisable home screen and a host of applications out-of-the-box actually make it the winner...just to think that I've had it for a few years now and it cost half what the iPod did...why is this new iPod touch so backwards? Target market? Well, I guess simplicity does have its benefits...it is a portable music player first of all!

Monday, September 21, 2009

iPods suck nicely

Just gave in and got the new iPod Touch (32G) this weekend. Let's see...

Couldn't even take it out of the box - I was afraid to break it - I went back and asked a "Mac Helper" for help and he explained how to take it out - apparently Apple just won the abnormal packaging contest!

Walked again out of the store only to come back: when turned on, the thing only displays an image suggesting plugging its USB into iTunes. I had to go back and explained that I just paid 400$ for a toy that doesn't work...they finally convinced me to just refrain from returning it and wait until I got home to plug it in and see what's what.

Well - finally got home and started playing with it. It does grow on you and you start to wonder how come every OTHER device manufacturer out there seems to be sooo stupid. They do deserve the market share they're left with!

But then you start to notice the noticeables:
- the only dark screen is the home screen...most others are the same stupid black on white as your microsoft outlook...and there's no obvious way to change the "skin".
- the browser, while smart, is also stupid. I.e. the "zoom", while nicely done with the pinching manouver, is not remembered when you click on the next page
- the home screen doesn't go wide when you turn the thing...non-sensical since when you can go back and forth between "wide" apps, you pass through the home screen and have to turn the thing again...

Overall, they can get away with all these, just because the thing is so nice in many other ways...but it goes to prove the limits of every day life - nobody's perfect.

Wednesday, September 16, 2009

converting Java collections to scala collections

This took me many hours to figure out. I didn't find a word about it in the (quite a bit of) stuff I read, including the "Programming in Scala" book, blogs, posts etc.

How to best convert java collections into scala collections and back. This is crucial, as lots of would-be scalaistas would still carry around some kind of Java library, be it JNDI or JTA or some in-house non-rewritables!

As of scala 2.7, scala.collection.jcl.Convertions is your friend. As of scala 2.8, scala.collection.JavaConversions is your best friend. Enough said.

Interestingly, I use List pretty much everywhere in my code. However, as you'll see, since List is the only one that doesn't freely convert from one to the other, it follows that you should use Seq[A] in all your scala code...hmmmm

[later edit] Also, your arguably best friend in scala is the scala.collections.mutable.ListBuffer - check it out, it's all you thought List would be! Although, after a while, you will find yourself relying on mutable collections less and less...

To get the full power of the implicit java to scala conversions, make sure you import the contents of the class, note the underscore below:
import scala.collection.JavaConversions._
[Later edit] I removed my examples here as being too clumsy :) use the import above instead.

Tuesday, August 11, 2009

Increase battery capacity to 123% :)


Just got this "warning" from my own laptop...no comments!

Friday, June 05, 2009

Process Explorer - me likee

Installed this Process Explorer a while back and it replaces the windows classic Task management stuff which is hopeless!

I love it. The best features are:


  1. it shows a lot of information about what's running

  2. you can search for a process just by typing the name

  3. when you say "kill" it actually kills them asap rather than think and wait and ask for confirmation about 10 times...

Whoa! Goodie! Me likee.


Thursday, May 14, 2009

Your own newspaper

Here's the culmination of the freedom from the mainstream: you can create your own newspaper, from the feeds you want: http://feedjournal.com/index.html

Not only are we using feed readers, we can now print our own newspapers - that's so cool...interestingly enough, this is just another of the Sovereign Individual predictions...

And...to complete the picture, for the retarded sites that don't support content feeds, here's a free service that does it: ChangeDetection. It is simple to use and no catches that I could find...

If you're looking, there's actually more of these page2rss services, including http://page2rss.com - really simple! The http://www.watchthatpage.com/ seems more complicated, while http://www.followthatpage.com/ can do only email...


Happy newsprinting!

Tuesday, April 21, 2009

Optional arguments in Scala

I couldn't find much on the web with this search and it took me maybe 15 min to figure it out, so here's the low down on using optional arguments in Scala. There's a description in section 8.8 in the Programming in Scala book - they call them "repeated parameters".

Using this notation you can overload Java methods with optional parms as well as pass them over to a "super." method (which was what I needed to do):


def takesOptionalArgs (x:String*) = {
println ("Scala println: ", x.mkString(" "))
java.lang.System.out.printf ("Java printf: %s %s %s", x:_*)
}


This special syntax instructs the compiler to pass the x array elements individually, not as an array!

Cheers.

[later edit] P.S. Note that there's an outstanding defect for overloading java vararg methods - it currently doesn't work: https://lampsvn.epfl.ch/trac/scala/ticket/1459

Tuesday, April 14, 2009

Agile Architecture talk from Coplien

For a nice glimpse at the future of programming as it evolves, I strongly recommend this talk from my favorite architecture guy: Coplien. Prerequisites: get a beer, slippers and a robe, the conclusion is not light reading!


http://blog.jaoo.dk/2009/03/04/handling-architecture-in-the-agile-world/


Some of the things that deserve emphasis:



  • The need that the application’s own model matches the model the users have in their head, i.e. the “view of the world” is obvious, but, unfortunately, it is not obvious to many…

  • Architecture is the essence of structure (the form), not the structure itself.

A good agile/lean architecture:



  • supports change

  • Supports user interaction

  • Lowers discovery costs, rework

Other memorables:



  • Habitable code – code where the designer could choose to live. Do you like your code? Would you live with it?

  • Refactoring is bad! We want to avoid re-work…you need a system view, not code–as-you-think!

  • The long forgotten purpose of OO is to capture the model from the user’s mind, not create toys for developers!

  • (Razie says hmm): Do object diagrams instead of class diagrams – users think in terms of instances, not abstract classes.

  • The GUI is not something between the GUI and the model, is a tool allowing the user to mess with the model! Kent Beck said “you can’t hide a bad architecture behind a good GUI”.

  • (Razie says hmm): Requirements are the LAST thing you look at when doing architecture!

  • Need architecture upfront, code just-in-time!

  • Java is a TOY language.

  • Scala’s got traits, baby!

This is the brief follow up: http://blog.jaoo.dk/2008/12/20/jaoo-video-2008-james-o-coplien/



  • Peter Coad’s now a pilot, but his role-based color modeling should’ve taken off!

Thursday, March 12, 2009

Components vs Frameworks

ABSTRACT: One of Razie's infamous uber-principles: I see frameworks as being the opposite of components. When architecting parts of a system, use this to decide on one or the other - this point of view could enrich the designer's arsenal of decision principles.
TAGS: architecture, design, principle

When you're talking about "writing code", the best option is generally reusing an existing piece of code and customizing it. Reusable pieces of code are normally in the category of either components or frameworks.

Components are more or less black boxes with well defined inputs/outputs and customization settings.

Frameworks, while they may also have defined inputs/outputs, they generally cannot be used as is. You write "plugins" (i.e. proxies or strategies) that customize a piece of the puzzle and then combine them to achieve the functionality the framework is intended for.

I see frameworks as being the opposite of components, given how they're used: while components are pre-determined pieces of functionality, which you combine to achieve a flexible structure, frameworks define first an immutable structure and then allow you to customize some aspects of it.

Patterns fall sqarely in the framework category, since they prescribe a structure with roles to fill out.

In terms of initialization and configuration, components get everything up-front, while frameworks usually will use a callback to retrieve configuration, when needed. At least it's easier to always follow this pattern: use of factories indicates frameworks, for instance.

Depending on the level you're at and your point of view, it is relative whether a given library falls in either category. For instance, a component could take a "strategy" as an input.

When you look at a system, you will see components made of frameworks, made of components, made of frameworks etc. A system is made of sub-systems, which can only be of either kind :) since they're the two opposite forms of sub-system architecture.

CONCLUSION

Making the distinction and decision between component vs. framework, when designing, is important, since the denomination of "component" carries lots of semantics: independence, self-sufficiency, black-box, upfront initialization etc.

Frameworks allow flexibility in the detail but are inflexible structure-wise. A framework that is too flexible is called a mess.

A framework with all variabilities fixed is a component.

Keep thinking and have fun, eh? I certainly am!

Tuesday, February 10, 2009

Stupid feedburner

Sorry folks, after many troubles and wasted time trying to get my feedburner feed to work, AFTER migration to google, I am giving up on using feedburner. It's the worse cloud ever and the worse migration of anything, ever!

This will be my feed. Yahoo pipes rock!

xxx url

Cheers!

[later edit] ... came to my senses...they still suck, but you should use this feed instead: http://feeds.razie.com/Razvan