‘Technicalities’ Category Archives
Feb
Laptop vs. Desktop smackdown
by Mikael Lundin in Technicalities
Since the prices on RAM is all time low I seized the moment and doubled the amount in my developer machine from 4Gb to 8Gb. Let’s just say that 8Gb is the new 4Gb now.
Developing on a laptop or desktop?
I’m kind of biased about doing my development on a laptop or a desktop. I use a laptop at work and love the mobility of it, but feel very limited by the performance. My development desktop at home is heavy as hell, and not something you would move around, but it is the most stable computer I’ve ever owned.
The laptop
If we were to boil it down, what are the cons/pros for using a laptop in development.
| Pros | Cons |
|---|---|
| Mobility | Expensive performance |
| Built in UPS | Heat problems |
| Ergonomics, screen size | |
| No tinkering, hard to service | |
| Video and audio is crap |
When you sit in front of your computer for 8-10 hours straight you have to think about ergonomics. This usually means that external screen, keyboard and mouse are needed even though it’s all included in the laptop.
A laptop is much more use and throw away than desktop, because it is so hard to service. You won’t switch that CPU when it becomes too old and you won’t exchange motherboard for USB 3 support.
The Desktop
| Pros | Cons |
|---|---|
| Powerful hardware available | Stationary, you won’t move it around |
| Easier to cool down, not as noisy or warm | Takes up a lot of space |
| Cheaper in the long run, you switch components | |
| Customizable, you can add 2 hard drives if you want |
The largest pro here is that you can get much more raw power from your desktop and that can be upgraded as new components appear on the market. Waiting for compilation is never fun.
Summary
Would I rather work on a desktop or a laptop. Neither, both. I would love to have a solution where my workplace provided a desktop for development, and a laptop that is always synced with the desktop. When ever I needed to go out to a customer or into a meeting I could grab my laptop and know that it was up to date with my latest work. This could be done with dropbox or any similar solution.
This of course would make me a very expensive developer needing both 2 sets of hardware and 2 sets of licenses. But hey! employees salaries are expensive, not hardware.
Jan
Email is dead
by Mikael Lundin in Technicalities
As much as I would hope above statement to be true, E-mail technology is not as dead as I would hope it to be. Mark Zuckerberg hopes to replace SMTP with Facebook which is preposterous as such basic Internet functionality must be completely open and not owned by some company.
Why E-mail should die
I am not in any ways against the concept of messaging over the Internet. It is more of a technical issue with the technologies that today makes it possible.
Reliability
Today it is quite humorous to think back of the early days of Internet when a novice would send e-mail and then call to the recipient and ask if he’s got it yet. Sadly this is still happening all because e-mail is not reliable.
Sometimes an e-mail just disappears because the recipients’ mail server is offline. At other times the e-mail is marked as spam and filtered out. It happens that the recipient e-mail system (Hotmail) will place the e-mail in trash.
“Did you get my e-mail?
- No, let me check my trash bin”
Security
The fact that almost every e-mail on the Internet is still sent in plain text, is a major security issue. Anyone could read e-mails that pass through a server on the Internet. The problem is that PGP that was created to solve this issue, was that complex that nobody uses it, and it never came to support HTML e-mails.
“Please don’t send me passwords by e-mail.”
Another major security issue is that there’s no way to confirm that the e-mail I just got came from you. It could say Facebook in the header, but really come from a malicious hacker that wants to steal my passwords.
Signing e-mails could also be solved with PGP but again, this is too complex and does not support HTML e-mails.
We need an e-mail protocol that is secure by default. If every e-mail would have to be signed we would soon get rid of spam and you would never get an e-mail from your bank, telling you to send them your credentials.
Formatting
It is now 2011 and e-mail formatting still does not work appropriately. This is mostly Microsoft’s fault that decided some time ago that Outlook should render e-mails with Word and not Internet Explorer. The major cause was security issues with Internet Explorer that made it possible to execute code on the target computer.
I do find it ridiculous that you can’t attach images to your e-mail in a standardized way. You can’t make it look good in every e-mail reader without writing HTML 3.2 and ask the user to download images, and you can’t make javascript effects that company newsletters really could benefit from.
This is ridiculous. The web is moving forward at a tremendous pace but e-mail formatting works the same as it did 10 years ago. No surprise why the young and hip people flee this technology platform.
A call for arms
E-mail is a technology that should die, or evolve. We need a new version of e-mail that is easily extendable, secure by default and support any version of HTML. Otherwise I’m sure that we in the future will not use e-mail for sending e-mail, but only to authenticate our identity against other systems, like Facebook, a purpose it never was designed for.
Nov
Tips and trix composing HTML emails
by Mikael Lundin in Technicalities
So you need to create an HTML e-mail and you don’t want it to be caught in every spam filter of the web. You also would like if it looked almost the same in different readers. Here’s some stuff I’ve learned.
Reverse PTR Record
If you want people getting your e-mail you should really consider Reverse PTR Record. This is set up by your ISP and will confirm that e-mail that you send actually belongs to the domain it was originated from.
HTML 3.2
What happened in Outlook 2000 was that Microsoft decided to use Word for rendering HTML e-mails. No, I’m not kidding. This is still the case, and that’s why we have to write HTML 3.2 for our e-mails, with table layout and no styles. Don’t end your <BR> tags.
No background images
Background images is a big no-no in most HTML e-mail clients and that is why you should avoid them at any cost. Try to exchange any background images with an <IMG> tag and use background colors to make up for missing image elements.
Use plain text fallback
When sending HTML e-mails you should send both HTML part and plain text. This will make it easier to pass through spam filters and it will give primitive HTML clients some clue of what you’re selling.
Test test test
Some e-mail clients will center your table text by default. Some will not display that image. Others will make everything look like crap. You have to test with different e-mail readers and the cheapest way is to invest in a tool like http://litmus.com/
Sep
Backup plan for SQL Server Express
by Mikael Lundin in Technicalities
I’m using SQL Express for a lot of my projects. Both my private projects and when the customer does not see the need of investing in a SQL Server license.
Unfortunatly there are some missing features in Express, to make you want to buy that license. The backup scheduler is one of them. But don’t dispair, all the functionality for creating a backup is there. You just have to do it in another way.
Backup your database
First, open up the backup dialog in SQL Management studio express. Select to script the backup and save it as a file.
Now we edit this file so that it looks the way we want it. This is my backup script.
DECLARE @pathName NVARCHAR(512) SET @pathName = 'D:\Backups\CMS\backups\cmsDatabase-' + Convert(varchar(8), GETDATE(), 112) + '.bak' BACKUP DATABASE [cmsDatabase] TO DISK = @pathName WITH NOFORMAT, NOINIT, NAME = N'cmsDatabase-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO
Now, all we have to do is schedule this to run every week. Create a new powershell script in the same folder as your backup script. Mine is called job.ps1
sqlcmd -S KINO\SQLEXPRESS -U backupUser -P backupUserPassword -i schedule.sql
Where schedule.sql would be our previous backup script. I would also like to backup the whole website directory at the same time, so I add the following to my powershell script.
$date = Get-Date -format yyyyMMdd $env:Path += ";C:\Program Files\WinRAR\" rar.exe a cmsWebsite-$date.rar C:\inetpub\cmsWebsite
Open up Windows Scheduler and create a schedule where you run this script every monday 1 am.

That’s it! Works like a charm.
Jul
TogglChart – a Toggl charting solution
by Mikael Lundin in Programming, Technicalities
I’ve studied before how to connect to the Toggl API both here and here. Toggl is a tool for easily tracking time put in a project. This is necessary for billing customers, but also useful for tracking your own effort to a project.
I’ve written a command line tool that will extract data from Toggl API and create a chart that will show amount of hours spent per week. A chart can look like this.
All you need to do, is to call the executable with your API Token as required argument.
TogglChart.exe -apiToken=ec3223d0919b45ec2267826fc0954db0
There are some posibilities to customize the output. Here’s the full usage for this command line tool.
--apiToken=VALUE Your API token from Toggl. Easily find in "My
settings" https://www.toggl.com/user/edit
--imageWidth=VALUE Width of the result chart in pixels (image will
scale to fit width)
--imageHeight=VALUE Height of the result chart in pixels (image will
scale to fit height)
--imageTitle=VALUE The main title of the chart that will be shown
at the top.
--outputFile=VALUE Path and filename to the output file. Example:
toggle.jpg
--imageFormat=VALUE Filetype of the result image. Legal values are
jpg, png, bmp and gif
--weeks=VALUE Number of weeks backwards that tasks should be
fetched from Toggl.
--projectName=VALUE The name of the project in Toggl. This is useful
to specify when you have several different
projects that you register time on and only want
to create chart for one of them. If you don't
specify project name, chart will be created from
all projects combined.
--dynamic If you set this value to true, empty weeks at
beginning of the period will be removed.
--help, -h, -? Displays this message.
MsBuild Task
I’ve also included an MSBuild task. Instead of using the TogglChart.exe directly you can call the MSBuild task inside the TogglChart.dll.
<!-- TOGGLCHART --> <UsingTask TaskName="TogglChart.MsBuild.TogglChart" AssemblyFile="$(MSBuildProjectDirectory)\ExternalTools\TogglChart.dll" /> <Target Name="TogglChart"> <TogglChart ApiToken="ec3223d0919b45ec2259296fc0954db0" ImageWidth="320" ImageHeight="240" ImageTitle="Time spent on Hippo" OutputFile="$(ArtifactDirectory)\togglchart.jpg" ImageFormat="jpg" Weeks="10" ProjectName="Hippo" Dynamic="true" /> </Target>
Both TogglChart.exe and TogglChart.dll are stand-alone. You do not need the DLL for the EXE to run, nor the other way around.
Download
License: You are free to use and distribute this application.


