Archive

Archive for January, 2010

Algorithm Analysis and Asymptotic Complexity / Big O Notation Is Important

January 21st, 2010

Algorithm Analysis (Asymptotic Complexity / Big O Notation) courses are the bane of computer science students everywhere. These courses were mandatory, dry, and lacked real world pragmatism for students who just wanted to get stuff done. Well, that’s what we told ourselves; that’s the theory we presented to our friends – we were convinced that framework vendors or the hoogie-boogie man would figure out the most efficient way to performance tune / compile our code. We looked to Sun, Microsoft, or IBM to figure out the details. In truth we were lazy-naive students and Algorithm Analysis was tougher than we’d like to admit – much harder than programming in 4th generation programming languages, more difficult than computer theory, or operating system theory.

As I brush up Algorithm Analysis I found these perspectives interesting:

to be a good programmer, you just program ever day for two years … to be a world-class programmer, you can program every day for ten years, or you can program every day for two years and take an algorithms class – Introduction – Analysis of Algorithms, Insertion Sort, Mergesort

Having a solid base of algorithmic knowledge and technique is one characteristic that separates the truly skilled programmers from the novices. With modern computing technology, you can accomplish some tasks without knowing much about algorithms, but with a good background in algorithms, you can do much, much more - Introduction to Algorithms, Second Edition

It’s unfortunate that our professors never mentioned that Algorithm Analysis would be an integral part of academic type interviews and a prerequisite for getting a job at Google, but then again who would have listened?

Author: Adam Kahtava Categories: Musings Tags:

Sending Email With Attachments In PowerShell

January 19th, 2010

Here's an example on how to send email with attachments via PowerShell:

POWERSHELL:
  1. # A Mailer script that makes use of System.Net to send email with attachments
  2. #
  3. # Sample usage:
  4. #  PS C:\> Send-Mail-With-Attachment 'email@domain.com' 'Hello world!' 'Filename.txt'
  5.  
  6. function global:Send-Mail-With-Attachment($to, $subject, $file){
  7.  
  8.   $filenameAndPath = (Resolve-Path .\$file).ToString()
  9.   $from = 'Automated Powershell Mailer'
  10.  
  11.   [void][Reflection.Assembly]::LoadWithPartialName('System.Net') | out-null
  12.  
  13.   $message = New-Object System.Net.Mail.MailMessage($from, $to, $subject, $subject)
  14.   $attachment = New-Object System.Net.Mail.Attachment($filenameAndPath, 'text/plain')
  15.   $message.Attachments.Add($attachment)
  16.  
  17.   $smtpClient = New-Object System.Net.Mail.SmtpClient
  18.   $smtpClient.host = 'mail.domain.com'
  19.   $smtpClient.Send($message)
  20. }

Contribute, view, or download the script here: Mailer.ps1

Author: Adam Kahtava Categories: .NET, PowerShell Tags:

Life’s Creative Circle: Creativity Isn’t About Art or Design

January 14th, 2010

The most popular conception of creativity is that it's something to do with the arts.

Nonsense. - Paul Arden, It's Not How Good You Are, It's How Good You Wan't To Be.

This year marks a new decade for me (I'm saying goodbye to the late 20's). According to Arden's Creative Circle this blog was written during my era of Maturity and for the next 10 years I'll be Hell Bent On Success. Thanks for putting up with my growing pains and griping.

Author: Adam Kahtava Categories: Creativity, Musings, Personal Tags: