Blog ala Vidar

SQL, AppFrame and other cool technologies

Monthly Archives: October 2009

5 minutes interview #15 – Nils Arne Ramsvik

Nils Arne started a couple of months before me. The first thing I can remember was that he was working with a handheld computer for a customer. This was back when I thought that PHP and MySQL was the only way you could do anything. Of course, I was wrong. Nils Arne is from Etne (about 10 minutes from Ølen). He’s also the first AppFrame Certified Developer, including the Microsoft certifications! He’s also written several good blog posts. You can visit his blog here.

Do you remember your first day in Omega?
I remember I started part time alongside my studies in Stavanger and were given a bunch of AppFrame / PIMS manuals and an old laptop – so it was up to me to get myself a backup database and install PIMS to teach me what it was. There was no training, unlike now, and I learned probably the most when I came out to the customers after I started full time.

What have you been doing these years?
I have worked with a lot of customers like R&M, Baker, Sørco, Prosafe and IKM. I have been traveling a lot for Omega. Singapore, Germany, USA, and last but not least Egersund. The last year I have mainly worked on CMS-related (Completion Management System) things in Ølensvåg.

What’s your current position? Working on anything fun?
Now I am in Svein Tore’s CMS department. Here we have just released a new build where we are trying to focus on user-friendliness by for example implementing the three structures in the forms, so that users can more easily be able to navigate their way in PIMS.

Do you have any tips for those of us that still haven’t got to take all the certifications?
You need to read a lot for these exams. There have been many long days reading books before I took the exams. But it’s worth it, especially when one climb up on the salary ladder – which was my motivation. Now I have taken the certification that Omega covers, so now I’m just waiting for a new "carrot" from Omega before I start reading again.

Any hobbies? Except computer stuff, of course.
In the summer I am often out in my boat, but now that the autumn is here I’m in the mountains hunting  for grouse. Trying to get up to the mountains 3-4 times a week to see if there is anything I can shoot to fill up the freezer. It has been a lot of grouse in the beginning of the hunting season, but now it’s time for wood grouse. We rarely go for a walk without seeing / shooting for any 🙂 I’m not really into skiing, but I like after-skiing, so in the winter there’s after-skiing and recharging so that I’m ready for the first boat ride in the summer.

Advertisements

Select your web browser(s)

A while back Microsoft had to add a thing to IE so that users could choose their web browser after they installed windows (in EU). Now they’ve added this list, but Safari is the first in the list (because it’s alphabetic… Apple makes Safari). This makes the Mozilla guys angry. To cut to the chase: I’M SO TIRED OF THIS STUPID ARGUMENT! If you show this screen to any of my family members, they will choose Internet Explorer, because they haven’t heard of any of the other ones. Me, I will close this page and go to Google Chrome’s website to download MY preferred browser. So, I’ve got two messages.

First one goes to Microsoft: Get some balls and stop this stupidity! You’ve got more than enough money to run over the Mozilla-guys in court so your users don’t need ANOTHER click to start browsing.

Second one goes to Mozilla: STOP WHINING! This is NOT your operating system. If a user want to download your browser, he’ll go to your website and download it. You’re only making it harder for users like my mom to start surfing!

Podcasts for nerds

On my commute from and to Ølen I’ve got a lot of time to kill, so I’ve started listening to podcasts. By now I’m following 30 podcasts! Most of these are from NRK, so they’re in Norwegian, but I’m also listening to a couple of English podcasts. I hope some of these might be interesting for you, and maybe help you on your commute or when you’re working out! All of them are available in iTunes.

.NET Rocks!
Talk show for developers programming on the Microsoft .NET platform. Hosts: Carl Franklin and Richard Campbell.

Hanselminutes
Scott Hanselman (web developer at Microsoft) has a weekly where he discusses utilities, tools, ASP.NET and win forms stuff.

RunAs Radio
Talk show for IT Professionals working with Microsoft products. Discusses everything from Windows 7 to SQL Server. Hosts: Richard Campbell and Greg Hughes.

Security Now
Weekly talk show from TWiT.TV where the topic is security. Hosts: Steve Gibson (creator of the first anti-spyware application) and Leo Laporte.

This Week in Google
Another one of TWiT.TV’s productions. This is the show about Google and “the cloud” (read: other web-stuff). Hosts: Leo Laporte, Gina Trapani and Jeff Jarvis.

This Week in Tech
The first (I think) podcast from TWiT.TV. General tech-talk show where they talk about anything. Popular topics are Kindle (from Amazon), Google Wave and Snow Leopard. Hosts: Leo Laporte, Patrick Norton and John C. Dvorak.

Windows Weekly
Weekly talk show about Windows related stuff. Vista, Windows 7, Office, X-Box +++. Hosts: Leo Laporte and Paul Thurrott.

 

Here’s a quick list of recommended podcasts from NRK (in Norwegian!):
20 spørsmål
Hallo i Uken
Herreavdelingen (Yan Friis og Finn Bjelke)
Misjonen (på P4 med Atle Antonsen og Johan Golden)
Naturens Verden
Morgenkåseriet
P2 Akademiet
Sånn er Livet
Språkteigen
Verdt å Vite

Google Wave – Preview

Yesterday I got a Google Wave invite. I’ve played with it for a couple of hours to try to understand the concept. I’ve heard a lot of a podcast called TWIG (This Week In Google) where they’ve been talking about wave. They’ve said that you shouldn’t think of wave as a MSN or mail “killer”, and I tend to agree. Where I see the big potential is when you want to collaborate on a document or similar. In Omega we got TeamDocuments. This MIGHT be a TeamDoc killer, but I’m not convinced yet. You’ve probably already seen the video where they presented Google Wave for developers. I’ve tried out some of the functionality, but for now I think it’s way to slow. I’m using chrome version 4, but they still got some tuning to do in my opinion. Anyhow, let’s focus on the cool stuff! On the left side (see the screenshot) you’ve got Inbox etc and your contacts on the bottom. I know a couple of guys which has an account, so the first thing I tried was having a live conversation with one of them (Tormod Haugen). I found it very cool that you see what the other person is typing before he presses enter. This saves a lot of time, at least compared to MSN where you’re seeing the “….. is writing” for several minutes, and then the thing he/she were writing was “ok”. Pretty annoying.

In the picture you’ll see my search “with:public lang:no”. In wave you can share a wave with everyone, or with just the people you choose. Public of course means everyone, and guess what… “lang:no” means Norwegian 🙂 The wave I’ve clicked on is called “Calling out to all Norwegian wavers"!”, it was last updated 1:25 pm, and has one unread message (or Blip as it’s called) of 34. In this wave there’s a vote if Google Wave seems promising. I’ve voted “Maybe”. As every other good bug testers, I’m going to start reporting bugs from now. I’m a Microsoft fan-boy, but I’m also a Google fan-boy, so why not help them out the same way I’ve been helping Microsoft? By reporting LOTS of bugs 😛

Conclusion: Although this seems promising, there’s still a long way to go. I’ll keep testing it, checking out all the bots you can add and other stuff. Maybe I’ll even write a bot myself? 🙂

NB! I don’t have any invitations, sorry. If I get any, I already have a list of about 20 people who’s interested 😛

5 minutes interview #14 – Ronny Stange

You might have seen Ronny driving around in his wheelchair at Omega HQ. He’s one of the most silent guys I know, but he’s always in a good mood and likes to talk tech-stuff. A couple of years ago he started in the Technology department. It was back when we were located at "teknisk etat" in Ølen Centrum. After a little while we got him to join us out on the balcony for a little break in between code-sessions so we had the possibility of getting to know him and his staff.

Do you remember your first day in Omega?
I remember it very well. This was way before any training sessions had made its way in Omega, so things was fairly unorganized. I was basically told to install Visual Studio and read up on how to use the grid until Peter got back from vacation. I remember thinking that things was fairly chaotic, so good thing that we’ve started with training session for new employees. 🙂

What did you do before Omega?
Before Omega there was school. I took my bachelor degree at NITH Stavanger, and then I went on and took my masters at Brunel University.

You are the "go to guy" on AppFrame Web. Can you tell us a bit about web3?
The goal with web3 was to make it a lot simpler to use than the old web2 framework. Johnny even wanted it to be so simple that no JavaScript coding was needed. With that goal in mind we started creating the framework based on DevExpress’ web controls. However, we quickly found out that these web controls was not as solid as their win controls. Long story short, a brand new framework based on Telerik was released with build3. And in build4 we expanded that framework with the new client side framework that even impressed Vidar!

Except web-programming, do you have any hobbies?
Well I am a big music fan, metal is the preferred genre. So I like going to concerts when I’m able to. Other than that I am a big movie geek and I usually blow off about 80% of my salary on new DVDs.

Networking for dummies

Since I started in Omega I have got a couple of questions over and over again which clearly states that they’ve misunderstood networking. I’m not saying they’re stupid or anything… We all misunderstand some things… Here I will give a quick and superficial overview of terms and how they’re used.

IP – Internet Protocol (IPv4)
You have probably heard the term “IP address”. This is your address on the network. When you type www.vg.no in your browser, your computer asks your DNS server which IP this refers to. In this case it’s 195.88.55.16. This is VG’s (unique) internet address. If you do start –> run –> cmd –> ipconfig, you’ll see your IP address(es). If it starts with any of these, you’re on a private network (which cannot be connected to from the internet!)
10.*.*.*
127.*.*.* – Loopback (used internally on your computer)
172.16.*.* to 172.31.*.*
192.168.*.*
Btw, if you haven’t understood the joke before: “There’s no place like 127.0.0.1”. 127.0.0.1 is ALWAYS your computer.. I’ve only covered IPv4 (version 4) of this protocol. There’s a new version called IPv6 which is in use by default by Vista+ and 2008+.

TCP – Transmission Control Protocol
This is the most used protocol on the internet (combined with IP.. TCP/IP). With this you send packets on specific ports. For instance when you use your browser to go to http://www.omega.no you’re accessing TCP port 80 on a specific server in Omega. When you set up your web server you can set it to any port you’d like (between 0 and 65535), but then people have to add this port, for instance http://mywebsite.com:31337. Popular services running on TCP/IP: FTP (port 21), SMTP (25), HTTP (80), POP3 (110), IMAP4 (143), HTTPS (443)

UDP – User Datagram Protocol
The main difference between TCP and UDP is that UDP is used for streams. When connecting to a web site you need all packets to view the site. If you don’t have all packets, the html-code may be corrupt. TCP ensures that ALL packets get from sender to receiver, even if it has to send the same packet 1000 times. UDP on the other hand doesn’t care to check if the packet is received. It sends a stream of packets.. If you watch TV on the internet, and there’s suddenly a packet loss, the packet is invalid after 5 milliseconds anyways, so why send it? Popular services running UDP: IPTV, VoIP (Voice over IP).

ICMP – Internet Control Message Protocol
This protocol is used for ping, traceroute and other network specific things. Many think that if you don’t get a ping result from a server, it’s down. THIS IS BULLSHIT. A SQL Server needs to answer on (at least) TCP 1433. But, you can block ICMP calls to the server. This is actually pretty common, because ping can be used for DDoS (Distributed Denial of Service) attacks. So, if you’re outside the Omega network you cannot ping any of our servers. That doesn’t mean they’re down. Instead of doing this, you can telnet the server on a port you know is open.

HUB, SWITCH, ROUTER
Before, everyone was using hubs, but the big problem with hubs is that all signals are broadcasted to all devices connected to it. So, if I, JanCB and 8 others are on the same hub, and I’m sending a packet to JanCB, it will be sent to all 10 on the hub. This is where a switch is much better. In the beginning a switch was called a smart hub. Instead of sending the packet to all devices, it sends it to the actual receiver. And then we got routers. The difference between switches and routers are that a router has a table witch says where to send the data AND if it’s allowed. (Yes, I know there’s something called managed switch etc, but this blog post is a quick and dirty introduction to networking).

DHCP – Dynamic Host Configuration Protocol
This is a network application protocol that has a predefined configuration for all devices that connects to it, so that all devices gets an IP address, a gateway, DNS servers etc.

SMTP – Simple Mail Transfer Protocol
This protocol has been in use for more than 25 years (and is running on TCP port 25 ;)! As the name says, it’s a protocol for sending mails. The big problem with it is spammers. Since some of us (NOT ME!) click on links in spam, we’ll never get rid of this problem. But, to be sure spammers don’t use SMTPs there’s one solution: SMTP relaying. This means that you can set which IPs can send mail using this server. In Omega there are only a couple of servers that are allowed to use our SMTP server. This is not a problem since we’re using a web-mail system. All ISPs (Internet Service Provider) have their own SMTP server, so when you’re for example connected at home and want to send mail using outlook, use your ISPs SMTP server. We will NEVER open SMTP for IPs that is outside Omega, so please stop asking about this 🙂 Here’s a list of SMTPs you can use:

Telenor: smtp.online.no
Netcom: smtp.netcom.no
Bkk: smtp.bkkb.no
NextGenTel: smtp.nextgentel.no

By now I’m sure you’ve understood it’s (normally) just adding SMTP before your ISPs URL.

I will try to make JanCB write a couple of blog posts (since he’s the network alpha male in Omega) about the details of these topics. Please ask him on MSN, or mail him at jancb@omega.no if there are any topics you’d like to hear more about.

Incremental for each domain

I’m currently creating a new data model for a customer. They’ve got an Elements table with a field called “Num” (Number) which is supposed to be incremental for each domain. How to solve that? Well, you can create a UDF and set the default value of the No field to this UDF, but then you don’t support inserting more than one row. So, how did I solve it? There’s (at least) two ways. You either create an instead of trigger, or do as I did. Here’s an example:

CREATE TABLE MyElements (
	Domain NVARCHAR(128),
	Num INT,
	PrimKey UNIQUEIDENTIFIER
)
GO

ALTER TABLE MyElements
	ADD CONSTRAINT DF_MyElements_PrimKey
	DEFAULT (NEWSEQUENTIALID())
	FOR PrimKey
GO

ALTER TABLE MyElements
	ADD CONSTRAINT DF_MyElements_Num
	DEFAULT (RAND(CONVERT([INT], CONVERT([VARBINARY](36), NEWID(), 0), 0))*(100000))
	FOR Num
GO

CREATE TRIGGER MyElements_ITrig
ON MyElements
FOR INSERT
AS

WITH MyCTE AS
(
	SELECT
	  PrimKey, Num,
	  ROW_NUMBER() OVER(PARTITION BY Domain ORDER BY PrimKey) AS RowID
		FROM MyElements AS E
)

UPDATE E
	SET E.Num = C.RowID
	FROM MyElements AS E
	INNER JOIN Inserted AS I ON E.PrimKey = I.PrimKey
	INNER JOIN MyCTE AS C ON I.PrimKey = C.PrimKey AND C.Num  C.RowID

First we create a table. Notice that the PrimKey field has NEWSEQUENTIALID() as default, and that the Num field has a default value with some cool random functionality. Then we create the trigger where we have a CTE that creates a ROW_NUMBER partitioned by Domain, ordered by PrimKey. Then we do an update of our table. Try yourself!

INSERT INTO MyElements
  (Domain)
SELECT TOP 1000
  'Omega'
	FROM sys.syscomments

Microsoft Security Essentials

A couple of days ago Microsoft released MSE (Microsoft Security Essentials). This is a FREE anti virus and malware application. I have been using the beta version for several months now, and I’m very happy with it. It auto updates, scans your computer and checks everything you download from the internet without bugging you with “You need to update…”, “Your computer was just scanned for viruses” etc. It’s very light weight so it doesn’t steel your computers performance like F-Secure and other AVs.

I was curious about if this actually was as other AVs, so I found a couple of viruses and downloaded them. Surely, right after I was finished downloading them, MSE said that it had found viruses and that it was going to clean my computer. Two minutes later it said it had cleaned my computer. Awesome! So, what are you waiting for? Uninstall your slow AVs and install MSE. Remember that even though you’ve got AV, you still need to think logically when surfing!

5 minutes interview #13 – Werner Simonsen Waage

I first met Werner online, at IRC (Internet Relay Chat) about 10-12 years ago. After chatting for a couple of years, we had a mini data party. The only thing I remember from this is that we played Action Quake, him against 6-7 of us. He was only allowed to use knives, we used all available weapons. He won 9 of 10 rounds! After that we’ve always been connected either via IRC or MSN. About two years ago I started pushing Werner to start learn VB so I could recruit him for a position in Omega. June last year I recommended him for an open position in Trygve’s department. Now he sits right next to me 🙂 He’s just started a blog which will be available after his first post!

What were your first days in Omega like?
My first days were a bit long; I started with the AppFrame developer course the same week as I had my last exam. After the course was over I had to drive back to Stord where I was studying, and read up on what I had missed. So, I didn’t understand much about CR3, winforms or whatever, and I really didn’t think I was going to be employed.

What did you do before you started in Omega? Any cool computer projects?
Before I started in Omega I had to finish my teacher’s studies, I worked part time as a security guard and was just hanging around waiting for my life to begin. I have only had one project outside of Omega that is somewhat worth mentioning, an MMORPG (Massively Multiplayer Online Role-Playing Game) I did in PHP. Some day I might upgrade it 😉 You can visit the game here.

You are responsible for the Robotics Challenge. Could you tell us a bit about what this is?
When I was over at the Stavanger office for a day, I noticed that they had a much better non-work relationship than I’m used to. I pondered a bit on this, and after a while I thought maybe I could do something fun for the people in my department. Then I remembered that Olav had enthusiastically talked about some robotics when he was at school, and one leap of the mind to the next; the Lego robot.
I talked to the people in my department and they agreed to try this stuff out, and a few other departments joined also. There are a lot of intelligent people in our company with different hobbies and interests, I thought the robotics challenge would be a nice way for us to meet, do something that we are good at (coding) and talk together without any clients demanding our attention.

Do you have any hobbies?
In my spare time I’m trying to compensate for sitting on my ass all day by hiking, biking or jogging. I also like fishing. Some of my time I spend reading fantasy literature and playing computer games.