Just sharing some of my inconsequential lunch conversations with you... RSS  

Monday, January 11, 2010

Strongly typed rules!

I admit, I’m an old fashioned curly brackets kind of developer with a crush for early binding and strongly typed models!

Here’s a cool post from Scott Guthrie about my kind of views:

<%= Html.TextBoxFor(model => model.Name) %>



Don’t you just love it when everything breaks apart on compile time? :)

Sunday, January 10, 2010

Bases

Why are so many ancient systems based 12? Because it is easy to do math with 12. According to Wikipedia:

12 is a highly composite number, the smallest number with four non-trivial factors (2, 3, 4, 6), and the smallest to include as factors all four numbers (1 to 4) within the subitizing range. As a result of this increased factorability of the radix and its divisibility by a wide range of the most elemental numbers (whereas ten has only two non-trivial factors: 2 and 5, with neither 3 nor 4), duodecimal representations fit more easily than decimal ones into many common patterns, as evidenced by the higher regularity observable in the duodecimal multiplication table. Of its factors, 2 and 3 are prime, which means the reciprocals of all 3-smooth numbers (such as 2, 3, 4, 6, 8, 9...) have a terminating representation in duodecimal. In particular, the five most elementary fractions (12, 13, 23, 14 and 34), all have a short terminating representation in duodecimal (0.6, 0.4, 0.8, 0.3 and 0.9, respectively), and twelve is the smallest radix with this feature (since it is the least common multiple of 3 and 4). This all makes it a more convenient number system for computing fractions than most other number systems in common use, such as the decimal, vigesimal, binary, octaland hexadecimal systems, although the sexagesimal system (where the reciprocals of all 5-smooth numbers terminate) does better in this respect (but at the cost of an unwieldily large multiplication table).

Here’s why so many ancient system are based 12 – they are simpler to compute. And this is why we still have 12 hours cycles. And this is probably why the non-scientific community took longer to give base 12 away – it is still a trading unit in use nowadays. At least in Portugal eggs come in half a dozen packages.

12 also have another cool property: dividing days in year by days in lunar cycle we get: 365,25 / 28: around 13. 12 is the nearest lower pair number to bridge the sun and lunar cycles. Probably irrelevant…

Ok, this guys gave some thought before choosing their base. But there are other cool number to simplify math. Take the babylonian numerals, based 60. More divisors, cool! And here’s why we 60 seconds in a minute, and 60 minutes in an hour and 360 degrees in a circle.

Finally we use base 10. What to do when we need to multiply by 13 or 14? It seems that we chose it simply because we are lazy and prefer counting fingers… :S

And then we have computers, but we all know that, right?

 

<update>

Here’s a divisor’s list (if I had to quickly bet on successful bases, I’d bet on the bold ones):

1 ( 1)  1
2 ( 2)  1 2
3 ( 2)  1 3
4 ( 3)  1 2 4
5 ( 2)  1 5
6 ( 4)  1 2 3 6
7 ( 2)  1 7
8 ( 4)  1 2 4 8
9 ( 3)  1 3 9
10 ( 4)  1 2 5 10
11 ( 2)  1 11
12 ( 6)  1 2 3 4 6 12
13 ( 2)  1 13
14 ( 4)  1 2 7 14
15 ( 4)  1 3 5 15
16 ( 5)  1 2 4 8 16
17 ( 2)  1 17
18 ( 6)  1 2 3 6 9 18
19 ( 2)  1 19
20 ( 6)  1 2 4 5 10 20
21 ( 4)  1 3 7 21
22 ( 4)  1 2 11 22
23 ( 2)  1 23
24 ( 8)  1 2 3 4 6 8 12 24
25 ( 3)  1 5 25
26 ( 4)  1 2 13 26
27 ( 4)  1 3 9 27
28 ( 6)  1 2 4 7 14 28
29 ( 2)  1 29
30 ( 8)  1 2 3 5 6 10 15 30
31 ( 2)  1 31
32 ( 6)  1 2 4 8 16 32
33 ( 4)  1 3 11 33
34 ( 4)  1 2 17 34
35 ( 4)  1 5 7 35
36 ( 9)  1 2 3 4 6 9 12 18 36
37 ( 2)  1 37
38 ( 4)  1 2 19 38
39 ( 4)  1 3 13 39
40 ( 8)  1 2 4 5 8 10 20 40
41 ( 2)  1 41
42 ( 8)  1 2 3 6 7 14 21 42
43 ( 2)  1 43
44 ( 6)  1 2 4 11 22 44
45 ( 6)  1 3 5 9 15 45
46 ( 4)  1 2 23 46
47 ( 2)  1 47
48 (10)  1 2 3 4 6 8 12 16 24 48
49 ( 3)  1 7 49
50 ( 6)  1 2 5 10 25 50
51 ( 4)  1 3 17 51
52 ( 6)  1 2 4 13 26 52
53 ( 2)  1 53
54 ( 8)  1 2 3 6 9 18 27 54
55 ( 4)  1 5 11 55
56 ( 8)  1 2 4 7 8 14 28 56
57 ( 4)  1 3 19 57
58 ( 4)  1 2 29 58
59 ( 2)  1 59
60 (12)  1 2 3 4 5 6 10 12 15 20 30 60

</update>

HTC Hero boot time sucks!

I’ve been trying out an HTC Hero. It’s a fair equipment with some cool functionalities, but there’s one little detail that doesn’t seem aligned with Google’s objectives: it takes ages to boot!

Here’s my experience:

Boot to desktop 1:34
desktop loading time 1:03
total 2:37

My Windows 7 boots considerably faster!

Please note that desktop loading time doesn’t allow me to use the mobile, so I have a 2:37 total boot time.

Probably some of this time is spent on the Android agenda widget.

Still a cool mobile.

Tuesday, January 05, 2010

Windows Azure MSDN benefits

It seems like there are some free benefits for MSDN Subscribers:

 

image

 

Heard about it here.

Installing HTC Hero on Windows 7

The proposed workaround stopped working. Why? I had a newer driver. Strange…

It seems like a newer driver update is available at WindowsUpdate :S Arghh!… I had to:

  • uninstall the driver – something like HTC Dream, if I remember correctly
  • disconnect the network
  • connect the phone
  • install driver locally according to the proposed workaround

Let me say my first experience with HTC Hero is a mixed one:

  • excelent: market!!!
  • good: cool hardware and display; cool desktop
  • --- : not so intuitive as expected… the menu and cancel buttons…
  • bad: no out of the box sync over USB; no network support over USB

Still a great mobile!

 

<update>

Cool things:

  • Icons look beautiful – they learned the lesson with Apple
  • Very well built
  • The gadgets makes the difference: accelerometer, compass, multi-touch
  • Google apps integration – incredible with gmail
  • Syncing with my carkit headset – didn’t ask for those dreadful ‘1111’, ‘1234’, … ‘9999’ low security stupid keys, just hacked them!
  • Getting a bunch of apps from Market; apps like Layar

Not so cool:

  • As a phone, it could be better:
    • Slow and cumbersome access to my 2K contact list, some bugs. Probably HTC software’s fault
    • Easy to miss receiving calls, and to miss we are making a call :S
    • Low cell signal
    • Not the greatest of phoning sound quality
  • Button position could be better. Back button is just hard to reach for right handed people
  • Slow access to my Exchange mail
  • Why do I have an alarm icon on the top of the phone?!?!
  • Ok, I know I’m not the typical phone user, but my after a bunch of installations my Hero is not as responsive as it used to…
  • Battery life could be better, could hardly make it through the day. But then again it is as appealing that I' could have overused it…
  • Couldn’t get the SDK up and running. Ok, probably my fault, I’ve downloaded Eclipse and SDK and tried to install it with no internet access. Well it seems that Google demands internet access on install. Go figure…

The verdict: I’ll probably wait for a faster CPU with a wider screen. And a cheaper one. Could Nexus On be the one?

</update>

 

<update II>

I’ve been using an average of nearly 20MB/day of 3G traffic. Oops, I’ve just wasted my monthly limit in less than a week. Be it because Android pushmail is too demanding on traffic or just because Android is a new gadget I’ve been exploring, one thing is for sure: I have to return this baby soon or upgrade my traffic account…

</update II>

Short MVC history lesson

Here’s a cool brief history of an old concept: http://kasparov.skife.org/blog/src/java/mvc.html

Monday, January 04, 2010

Bing vs google: oops

Ok, nowadays I can use either bing or google and hardly find any great difference. But sometime I still get some glitches in the matrix:

image

Sunday, January 03, 2010

TMN SilverBelt: take 2

After only a week of usage I’ve returned my SilverBelt and asked for a new unit. The only serious problem I had with it was the battery – it didn’t last for a day with the exact same usage as my old HTC 3300.

The new unit had the same problem, so I had to cut some waste. I started by opting out 3G over GSM. It saved me a bit, but not enough to get me through the day.

The workaround to get me through the day was quite drastic: I had to disable push mail, and opt for a 1h pooling. But now I can get through the day.

So my verdict is:

  • Cool display size – though a little “deaf”;
  • Windows Mobile 6.5 is heading in the right direction (and way), but it is still a no go; ZTE/TMN “shell “ is poor, to say the least;
  • Quite acceptable value for your money – ok, doesn’t support MultiTouch, accelerometer and digital compass, but we can’t really ask that for this price, can we? Ok, Pulse doesn’t support digital compass…
  • Unusable for a communicating kind of guy

So I’m again on ebay looking for a bargain on a:

  • iPhone 3GS
  • HTC Hero
  • T-Mobile Pulse

Until them, SilverBelt will do just fine.

PS: ok, some of these units don’t support PushMail, so this option is not entirely rational, is it? Who cares, its a gadget, if chosen without the heart will defy its purpose :)

Tuesday, December 22, 2009

Free book of the day: Essentials of Metaheuristics

Here’s a cool free book for those like me that love messing in the metaheuristics world.

Sunday, December 13, 2009

.NET OpenID

Here’s a cool library: DotNetOpenAuth:

This C# library adds OpenID 2.0 Provider and Relying Party, OAuth Consumer and Service Provider, and InfoCard Selectorsupport to your web site both programmatically and through convenient drop-in ASP.NET controls. Use as much or little of the functionality as you want.

Download it now

Download the latest version

or Get the latest source

All downloads include both the library, samples, and tools to help you get started.

We use GIT for source control, click here to find out more

Features

  • Compiled library that adds support for your site visitors to login with their OpenIDs by just dropping an ASP.NET control onto your page. It's that easy. An AJAX-style login control is also included for a slick, streamlined user experience.
  • Give your site members their own OpenIDs with the provider support included in this library.
  • Sample relying party and provider web sites show you just how to do it.
  • Easy access to all the functionality so you can customize how OpenID will operate on your site, whether you use ASP.NET or not.
  • Classic ASP support
  • Full support for custom extensions. Plus built-in support for Simple Registration, Attribute Exchange and PAPE.
  • Works in partial trusted shared hosting environments.
  • Support for web farms where state persistence, front-facing web servers and ASP.NET may not be standard or even available.
  • OpenID 2.0 and 1.x
  • OAuth 1.0 and 1.0a
  • Superior support for multi-byte Unicode identifiers.
  • Lots of security features
  • 490+ unit tests to verify correctness.
  • Library behind the OSIS OpenID interop testing
  • About 1500 downloads per month. See who's using DotNetOpenAuth

Wednesday, December 09, 2009

Google Chrome just got fatter

Yeap, Google Chrome now has extensions! We can say bye bye to the minimalist approach, but hello to many goodies.

Here are some of the most popular extensions – yes, there’s a basic ad blocker:

Google Mail Checker

(698)

-  115,343 users

Displays the number of unread messages in your Google Mail inbox. You can also click the button to...

AdThwart

(327)

-  70,693 users

Blocks ads on websites. Includes the EasyList ad filter list as of 9 Dec 2009.

Google Translate

(180)

-  69,760 users

This extension translates entire webpages into a language of your choice with one click. By the...

RSS Subscription Extension

(227)

-  49,322 users

Adds one-click subscription to your toolbar

Google Wave Notifier

(123)

-  37,235 users

Displays number of unread Waves.

Xmarks for Chrome Beta

(211)

-  35,478 users

Xmarks for Chrome Beta is a beta preview of Xmarks for Chrome

 

Please note: you’ll have to install version 4 beta.

Thursday, December 03, 2009

Windows 7 Sensor and Location Platform Overview

Uau, I want to play with this!

The Windows Sensor and Location platform, new for Windows 7, enables your computer and applications to adapt to their current environment. With location sensors -- including GPS devices, WWAN radios, and even triangulation technology -- your applications and gadgets can know exactly where they are, enabling them to provide more locally relevant content and functionality. Join Dan Polivy, Gavin Gear, product team PMs, and Yochay Kiriaty, Technical Evangelist, as they explain what the Windows 7 Sensor and Location platform is, what underlying architecture supports its functionality, and how developers can take advantage of this new and exciting platform.

  Get Microsoft Silverlight

Development Catharsis :: Copyright 2006 Mário Romano