I am learning both PhoneGap and SignalR and figured out tonight how to enable both polling and message sending under PhoneGap, at least within the Windows Phone emulator. I have not tried on my Android phone yet. That will wait until I deploy the server hub.
Wednesday, September 19, 2012
Getting SignalR and PhoneGap Working Under Windows Phone Emulator
Sunday, September 16, 2012
The Fragile Managerfesto Patterns: Bad Boss Behaviors
This is a video in draft form of what I want to become a launching pad for demonstrating many "Bad Boss Behaviors" and the remedies for them that agile practices bring.
- Barge In Boss: Manager, unaware of what an employee is working on, interrupts him.
- Agile Remedy: Visible Workspace and Tools
- Belittler Boss: Denigrates the employee's desire to improve the customer experience
- Agile Remedy: clear values and an outward, customer focus
- Pinheaded Policy Pushing Boss: Imposes strict, top-down, and very draconian policy requirements on the employee.
- Agile Remedy: living standards and openness to modern and changing realities
- I'm Louder = More Power Boss: the boss, when his thinking is challenged, responds by speaking louder, emphasizing he has more power than the employee.
- Agile Remedy: a flatter structure, managers who are not bosses, but service-oriented leaders and hands-on
- Priorities Ping Pong Boss: this boss exercises his control by shifting employees from one priority project to another at will, often leaving a trail of unfinished work behind.
- Agile Remedy: singluar focus until completion on tasks and projects, not rapid reassignment based on a "fighting fires" approach.
- Everything's Easy and Instant Boss: this boss assures you that your new assignment is simple, will not take long, and must be done instantly, no matter what. These bosses continually assign a fixed, non-negotiable amount of work to someone and require that it be completed by a fixed, non-negotiable, and arbitrary deadline. In software development, this is a typical "waterfall" or "big bang all at once" approach.
We're going to record the results of what happens with an Everything's Easy and Instant Boss does push his a arbitrary deadline onto a much smaller scale: that of reading a couple of paragraphs. It's kind of an obvious failure case, isn't it? But, if a human being cannot predict with any accuracy how long a couple of paragraphs will take to read aloud, then why do they keep getting away with telling customers that a project can be "complete with high quality and correctness" by an arbitrary deadline?
Things that make you go Hmmmmmm.
Tuesday, August 28, 2012
More Thoughts on Compressed Schedules: 151 hours in 3 weeks; followed by 9 days off
When briefly discussing the topic of compressing multiple weeks worth of work into fewer weeks, followed by more lengthy time off with VersionOne CTO Ian Culling today, he asked me: "Have you read that book?"
Or, maybe you'd prefer to do two heavy days back-to-back and get them over with. Fine, go for it. Swap Tuesday and Wednesday. Maybe you have the flexibility, and desire, to do 4 hours on Sunday evening, or Saturday morning. Great, then chop off 4 from Mon or Tue, or turn them into simple 10 hour days. It's up to you and your employer.
As the "next step down", but perhaps more palatable all around, consider the 5 week schedule compressed into 4 weeks.
Here, we have 37.69 hours times 5 = 188.46 hours.
So, divided by 4 = 47.12 hours per week, or 9.42 hours a day.
9.42 hours a day? That's almost nothing, right? It's 9 hours, 25 minutes, and 12 seconds actually :)
Big deal. Work from 8 am to 6:15, with, a 40 minute lunch break. That still gives you about 4 to 5 hours after work, assuming you get home around 7 and want to go to bed at 11.
With this schedule, you end up with pretty much regular hours, regular evenings, and regular, full weekends. Want to leave early on Fridays? Have at it. Work 2 to 4 hours from home in the evening, and leave on Friday at 2:15.
Yet, again, most importantly, is that after working this schedule for four weeks, you've already worked the same number of hours you would have worked in 5 weeks had you worked 8 hours a day.
Because you did it this way, you should now take 9 straight days off for a mini vacation.
With 52 weeks in a year, the pattern is something like 40 working weeks, and 10 9-day mini vacations.
That's 200 days working, 90 days off. But, add 10 more days and 4 more weekend days:
210 / 94 + 61 more weekend days from the other weekends.
We end up with 210 working days and 155 days off. Not bad.
Will the company shut down if people are out a week after working 4 straight weeks? I doubt it. Rotate the schedule so that not everyone is out the same week. Or don't. Shut the whole thing down. Be creative. Go for it.
Maybe my math is off a bit, but you get the picture.
Perhaps there are other, even better options. Maybe 10 weeks on, 2 weeks off (16 days straight!) is the ticket? For example: if you worked the same schedule as above, 9.42 hours a day, you'd have to work 10 weeks in a row, but then could take two full weeks off + 6 weekend days. Since, there are 4 groups of 12 in 52 weeks, you could it 4 times a year!
It all boils down to the fact that there are multiple ways to work toward this goal of both satisfying your obligations to your career, and of carving out more continuous blocks of time off for rest and recreation.
Sunday, August 26, 2012
Learning CoffeeScript, F#, and Haskell (and brushing up on math)
I've started to get very interested in new programming languages, as a result of working with people at http://www.VersionOne.com. At V1, they use CoffeeScript for some of the UI features. While also brushing up on some of my math fundamentals, I started watching this old (but good) video series: http://www.learner.org/resources/series66.html?pop=yes&pid=189
- n!
- P(n, r)
- C(n, r)
- The "->" syntax just means that what follows will be the definition of a function.
- Whitespace is significant (get over it).
- The last statement in a function is the return value, though you can return values earlier by using the return statement.
- I made two versions of factorial, one with an embedded function defined within the first, and split one that uses a call to a separately defined function.
120362880012036288006011880300310
F# and Haskell:
I've been working with Joe Koberg at V1, and he's been exploring a lot of functional languages, which has sparked my interest. Here are my first attempts at writing the same functions in F# and in Haskell:
F#:
open System
let rec factorial (n : uint64) =
if n = 0UL then
1UL
else
n * factorial (n - 1UL)
let permutations totalNumberOfItems numberOfItemstoChoose =
let total = factorial totalNumberOfItems
let divisorBase = totalNumberOfItems - numberOfItemstoChoose
let divisorTotal = factorial divisorBase
total / divisorTotal
let combinations totalNumberOfItems numberOfItemsToChoose =
let total = factorial totalNumberOfItems
let divisorBase = totalNumberOfItems - numberOfItemsToChoose
let divisorSubTotal = factorial divisorBase
let divisorAdditionalToReduceBy = factorial numberOfItemsToChoose
let divisorTotal = (divisorSubTotal * divisorAdditionalToReduceBy)
let result = total / divisorTotal
result
printfn "%A" (factorial 5UL)
printfn "%A" (factorial 10UL)
printfn "%A" (permutations 5UL 3UL)
printfn "%A" (permutations 12UL 4UL)
printfn "%A" (combinations 15UL 5UL)
printfn "%A" (combinations 5UL 3UL)
Console.Read()
Haskell
-- n!
factorial number =
if number < 1 then
1
else
number * factorial (number - 1)
factorial2 0 = 1
factorial2 n = n * factorial (n - 1)
-- P(n, r)
permutations totalNumberOfItems itemsToChoose =
(factorial totalNumberOfItems) / (factorial (totalNumberOfItems - itemsToChoose) )
permutations2 n r =
fac_n / fac_n_minus_r
where
fac_n = factorial n
fac_n_minus_r = factorial (n - r)
-- C(n, r)
combinations totalNumberOfItems itemsToChoose =
(factorial totalNumberOfItems) / ((factorial (totalNumberOfItems - itemsToChoose) ) * (factorial itemsToChoose) )
combinations2 n r =
fac_n / ( fac_n_minus_r * fac_r )
where
fac_n = factorial n
fac_n_minus_r = factorial (n - r)
fac_r = factorial r
Now, in the Haskell version there are a couple of versions of each, but it's still less code than any of the others. What I love about this is the minimal number of parentheses, no curly braces, and the where clause that assigns "local definitions" for the permutations2 and combinations2 functions. I'll admit that until I read http://en.wikibooks.org/wiki/Haskell/Variables_and_functions, I was a bit miffed as to how to do this without defining a constant outside the function, which would have made no sense at all for reusability.
Thus, while I like all three of these languages so far, I'm most intrigued by the Haskell program and its economy of syntax.
Learn more about these two languages:
- http://www.tryfsharp.org/ (Features online execution env)
- http://en.wikibooks.org/wiki/F_Sharp_Programming
- http://tryhaskell.org/ (Features online execution env)
- http://learnyouahaskell.com/chapters
- http://en.wikibooks.org/wiki/Haskell
Thursday, August 23, 2012
Working 40 Hours in 3 Days? Possibilities for Making it Work
I've been thinking about different kinds of work schedules. I found this poll interesting:
http://boards.straightdope.com/sdmb/showthread.php?t=608388
Question: If you could choose your own work week hours
Responses:
5 hours, 42 minutes/day, 7 days a week | 0 | 0% | |
6 hours, 40 minutes/day, 6 days a week | 0 | 0% | |
8 hours/day, 5 consecutive days a week | 10 | 12.35% | |
8 hours/day, 5 non-consecutive days a week | 2 | 2.47% | |
10 hours/day, 4 consecutive days a week | 32 | 39.51% | |
10 hours/day, 4 non-consecutive days a week | 9 | 11.11% | |
13 hours, 20 minutes/day, 3 consecutive days a week | 13 | 16.05% | |
13 hours, 20 minutes/day, 3 non-consecutive days a week | 1 | 1.23% | |
20 hours/day, 2 consecutive days a week | 0 | 0% | |
20 hours/day, 2 non-consecutive days a week | 0 | 0% | |
40 consecutive hours a week | 0 | 0% | |
40 varyingly distributed hours (i.e. something else) | 11 | 13.58% | |
I'm retired | 3 | 3.70% |
So, is it really possible to do 3 straight days, 13.20 each, and then have 4 days off each week?
Of course, it is possible if you can swing it and really want to.
Some variations:
12:05 - 6:05 AM sleep
7:00 - 1:30 6.5 hours work
1:30 - 2:15 lunch
2:15 - 3:15 nap
3:15 - 6:45 3.5 hours work
6:45 - 8:45 dinner, socialize/family, exercise (whatever you want)
8:45 - 12:05 3 hours, 20 minutes work
Maybe you'd prefer to exercise from 2:15 to 3:15 instead of nap, and do an evening nap later before the last sprint, but whatever.
If you could get by on 6 hours nightly sleep PLUS the nap during the day or evening.
Or maybe you could try two 6:40 segments from 7 to 1:40 and 5:20 to midnight.
Alternative to three day: 3 big days, 1 tiny day
The more I think about it, the more I like the idea, in general, but 13:20 seems to push it a bit too far.
Think this is just a gimmick, that BestBuy is a fluke? Think again. How about these companies:Results-Only Work Environment goes beyond telework. It's a management strategy where employees are evaluated on performance, not presence. In a ROWE, people focus on results and only results – increasing the organization's performance while cultivating the right environment for people to manage all the demands in their lives...including work.