Sunday, January 08, 2012
Goal Summary 2011
Spend time with my daughter – I’ve spent a lot of time with my daughter. PASSED
Be flexible – Hard to measure, my wife (the project leader) has given me a lot of crap for setting a goal that’s not measurable. With two kids, both me and my wife working full time and me doing sports at a pretty high level, I have no other choice but do be flexible . So I’ll mark this one down as PASSED.
Lose weight – this was perhaps the most important and most challenging goal for me on a personal level and I’m extremely happy to say I PASSED! Almost 12 kg (~26.5 lbs) in less of a year. The spike you see in the beginning of October is SharePoint conference in sunny California, lots of beer and food .
Clean up on the attic – this one I have FAILED miserably.
Learn Ruby – I’ve been hacking along on my ruby on rails site. Like the language a lot. I’m not all the way there yet but I see myself on track and gonna give myself a PASSED.
Git – not a pro yet but getting better at it. PASSED.
Windows Phone 7 App – MS Billing stole my money when the registration process on the developer site crashed (two times!) and that made me pissed off and lose interest in the whole thing. Need to carry on this goal to 2012. FAILED.
SharePoint Certification – Had to devote my time to look for a new job so FAILED this one.
National team in underwater rugby – Made it! Played my first (and probably last) world championship. We missed the final and ended up in third place, but other than that it was an awesome experience. PASSED.
Read up on running my own business – did read quite a lot but decided not to go for it now due to other circumstances. PASSED.
Cleanout Binders – Scanned seven binders in total, so I’m going to set give myself PASSED on this one to. Went through six binders and throwed away a lot of old crap and scanned the rest.
So the overall a pretty good year I think.
Summary
Six out of nine isn't half bad. Now I need to draw up some goals for 2012!
posted @ Sunday, January 08, 2012 12:07 PM | Feedback (0)
Saturday, September 10, 2011
Nailing those pomodors – harder than expected
Been working for 2 weeks now after my parental leave and it has not been pleasant to a variety of reasons. If we exclude factors out of my direct control and focus on what I actyllay do (or should) control. The pomodoro technique was a real struggle. I’m all behind the theory, I was pshyced and motivated. But I just could not get those 25 minutes to work for me. There where a lot of interruptions, both externa and internal. So what do you do in this day and age when you got a problem? You tweet about it! So I did. @emilcardell gave me a tip working for him: do 20 pomodoros with a 10 min “break” between each.
I gave it a try, thinking “big difference between 20 and 25 minutes”… But man, that made the difference for me! I managed too keep most of the 20 min pomodoros intact. Not that I didn’t have interruptions but they where mostly manageable.
20 min on and 10 off, holy cow that’s ineffective you say. 3 weeks ago I would have agreed with you but today I don’t. The focus of the pomodoro makes (at least) me more effective than otherwise so over the course of a day I really think it’s a win for me.
Still aiming for the 25-5 rhythm. But as they say “baby steps”.
posted @ Saturday, September 10, 2011 1:06 AM | Feedback (0)
Thursday, August 11, 2011
World Championship in Underwater Rugby
This is not a tech post at all. It’s just me plugging the World Championship in underwater rugby coming up next week. Why am I pimping it? Because I’m playing in the Swedish National Team!
So this here comes somewhat of a link dump. The tournament starts august 15th 2011 in Helsinki, Finland. I‘ll try to do twitter updates if I can find some free wi-fi (I won't ruin myself with data roaming fees) at twitter.com/nippe.
Check out the Swedish team: iof3.idrottonline.se/SvenskaSportdykarforbundet/UV-rugby/Arkiv/Landslag/Herrlandslaget/2011VMbilder/
Good introduction to underwater rugby video: vimeo.com/26539245
The championship's official site: www.uwr-finland2011.fi/
Twitter hash-tag: #uwrwc11
Live Streaming of the games: live.cmas.org
Game schedule and results page: www.uwr-finland2011.fi/game-schedule-results/
posted @ Thursday, August 11, 2011 11:22 PM | Feedback (0)
Sunday, July 17, 2011
Yearly Goals - Half Time
I’ve stopped with the monthly updates due to some non-encouraging feedback. However, half-time is big so here’s the half-time update.
Spend time with daughter – on track, not much to say.
Loose Weight – Also on track. I’ve been down at 90 kg and now I’m leveling out at 91-92 kg which seems to be a good weight for me. I can run without my knees hurting.
I’ve been eating using Glycemic Index, which has worked remarkably well. Two downsides: My stomach crashed after a while so I can’t eat strict GI now and it’s damn expensive.
Clean up attic – way behind. It’s such a mess I don’t even know where to start…
Learn Ruby – Coming along nicely. In hindsight I should have concentrated more on Ruby and less on Rails when starting, but I’m getting there. I’m working on a new Rails-site for my underwater rugby team as a learning project (https://github.com/nippe/Pdk-Team-Site).
Git – I feel pretty confortable using git. I still get myself in jams every now and then, but I see that as a part of the learning process. So I feel done with this as a goal and the plan is just to keep using it.
Windows Phone 7 App – Haven’t gotten around to this. Try to register for a developer subscription but Microsoft billing stiffed me for 300 kr (~ $50) without me getting a subscription.
SharePoint Cert – Started studying a little, then summer came…
National Team in Underwater Rugby – I MADE IT! Playing in the world championships in Helsinki august 15th to 20th.
Reading up on starting my own business – this stagnated due to other factors at home, but I’m still playing around with the idea.
Clean out binders – half way there scanned in 4 out of 8.
Summary
So, to summarize. I’m pretty much on track. A few thins lag behind. I hope I’ll be able to do a push after the summer when I start working again.
posted @ Sunday, July 17, 2011 2:17 PM | Feedback (0)
Thursday, June 02, 2011
Notifications to iPhone/iPad Using Prowl and Prowlin in .NET
This post is a little coding for fun exercise showing one way to send push notifications to your iPhone/iPad from .NET. It’s also a shameless plug for the open source .Net library I written for this, called Prowlin (https://github.com/nippe/Prowlin) in conjunction with Prowl on the iPhone.
So, to demo this in a simple and efficient way I’m going to write a simple URL monitor that tries to get an url and if the response code is something else than 200 it sends a notification to the iPhone/iPad. I’m going to write it as a simple console application. If one would like to run it as a service TopShelj (https://github.com/Topshelf/Topshelf) helps with that or a simple scheduled task might suffice.
Scene set, lets get started. The app is simple (can be improved immensely).
First, get the latest Prowlin binary from https://github.com/nippe/Prowlin/downloads or get the source from https://github.com/nippe/Prowlin and compile yourself.
Create a console application project and add a reference to Prowlin and System.Net. And off you go:
1: using System;
2: using System.Net;
3:
4: namespace Prowlin.UrlMonitor
5: {
6: internal class Program
7: {
8: private static void Main(string[] args) {
9: if (args.Length <= 0) {
10: Console.WriteLine("Enter URL as parameter");
11: return;
12: }
13: string urlToTest = args[0];
14: var request = WebRequest.Create(urlToTest) as HttpWebRequest;
15: WebResponse response = default(WebResponse);
16:
17: try {
18: response = request.GetResponse();
19: }
20: catch (WebException webException) {
21: string message = string.Empty;
22:
23: switch (webException.Status) {
24: case WebExceptionStatus.Timeout:
25: message = "Request timed out";
26: break;
27: case WebExceptionStatus.ProtocolError:
28: var httpWebResponse = webException.Response as HttpWebResponse;
29: message = httpWebResponse.StatusCode + " " + httpWebResponse.StatusDescription;
30: break;
31: default:
32: message = "Other problem";
33: break;
34: }
35:
36: SendProwlNotification(message, urlToTest);
37: }
38: }
39:
40: private static void SendProwlNotification(string message, string url) {
41: var notification = new Notification
42: {
43: Application = "URL Monitor",
44: Description = message,
45: Event = url + " not available",
46: Priority = NotificationPriority.High,
47: Url = url
48: };
49: notification.AddApiKey("589a2d241e6ea26a11c994af835012eb3230f39f");
50:
51: var prowlClient = new ProwlClient();
52: prowlClient.SendNotification(notification);
53: }
54: }
55: }
The program takes one parameter in, an URL. I don’t check if it actually is an URL in this sample.
The body of the program (the main function) does the try-to-get-url logic and if that call (line 18 above) fail the catch block calls SendProwlNotification on line 36. The SendProwlNotification is very straight forward or at least I hope so.
Instantiate a notification object, set properties and add one or more API Keys (used by Prowl so that notifications end up on the right phone).
New up a ProwlClient and call SendNotification with the created notification. And voila!
I’ll try to get the package up on NuGet within the coming weeks.
posted @ Thursday, June 02, 2011 11:01 PM | Feedback (0)
Monday, April 04, 2011
Goals follow-up 3 of 12
Time for the third follow up on how this years goals are going. Damn time moves fast.
Spend time with my daughter – going along nicely. Due to some sickness I’ve almost spent to much time with her .
Loose weight – Going good except around the 14th I was alone with the kids for a week and the 3 ½ yrs old became sick so no sleeping for dad. You can see the weight curve going up during that week. No sleep –> low blood sugar –> unstoppable candy cravings .
So far this year has been going pretty good:
Clean up the attic – Status Q .
Learn Ruby – Coming along, though slowly. But I started on my little hobby project: a site for my team with some attendance rsvp’s, a wall to post on and stuff. Will put it up on github as soon as it’s something that works.
I’ve gotten a little de-railed (pun intended ) by starting reading the RSpec Book, which is an awsome read but doesn’t really get me closer to creating a site for the team. But a really good dive in to BDD, Cucumber and such.
Git – Going good, now going through Rob Conery’s awsome git series on tekpub.
Windows Phone 7 App – All I’ve done is to locate a series of web casts on channel9 that I will use as staring point.
SharePoint Certification – Haven’t started yet…
Read up on running my own business – not done much more this month.
Clean out binders – Progress! Two more binders are now in PDF format! So 4 out of 8 done.
posted @ Monday, April 04, 2011 12:54 PM | Feedback (3)
Friday, March 11, 2011
Registering JavaScript's in your SharePoint/ASP.NET Project
Before going on parental leave I was involved in a fairly large SharePoint project with a distributed team. A question that arose for us was how we should handle script registrations in the solution. With many developers going at it we felt we where in risk of redundant registrations or a registration left out because of miscommunication or faulty assumptions within the team.
Even though we did this in SharePoint I see no reason why it shouldn’t work in a ASP.NET scenario.
Problem statement
How does any given webpart or user control know and ensure that the script it needs is registered on the page.
One possible solution
The solutions is of course many, this is the one I proposed as a solution.
First step is to have a central “repository” of script keys.
public class Keys { public class jQuery { public static string Version_1_4_4_min = "jquery-1.4.4.min.js"; public static string Easing_Version_1_3 = "jquery.easing.1.3.js"; public static string BxSlider_min = "jquery.bxSlider.min.js"; public static string UI_min = "jquery-ui.min.js"; public static string Corner = "jquery.corner.js"; } } public class Paths { public class jQuery { public static string Version_1_4_4_min = "/_layouts/BrandX/js/jquery-1.4.4.min.js"; public static string Easing_Version_1_3 = "/_layouts/BrandX/js/jquery.easing.1.3.js"; public static string BxSlider_min = "/_layouts/BrandX/js/jquery.bxSlider.min.js"; public static string UI_min = "/_layouts/BrandX/js/jquery-ui.min.js"; public static string Corner = "/_layouts/BrandX/JS/jquery.corner.js"; } }
Then some sort of centralized registration logic/service.
public class ClientScriptService { private static string _scriptTagTemplate = "<script type=\"text/javascript\" src="/img/spacer.gif"> ; public static void EnsureClientScript(Page page, string scriptKey, string scriptPath, Type callerType) { ClientScriptManager scriptManager = page.ClientScript; if (scriptManager.IsClientScriptBlockRegistered(scriptKey) == false) { scriptManager.RegisterClientScriptBlock(callerType, scriptKey, string.Format(_scriptTagTemplate, scriptPath)); } } }