Archive for the 'Software' Category

Silvertlight Spelling Error

Yes, you read that right. After the Visual Studio 2008 SP1 upgrade, here’s what my Help|About dialog looks like:

Spelling error in the VS 2008 SP1 Help|About dialog

Spelling error in the VS 2008 SP1 Help|About dialog

Look in the “Product Details” section at the bottom.

How To Back Up A MySQL Database From a Command Prompt

I just upgraded my WordPress installation to 2.6.3 and have some tips for you future Googlers.

To back up your database from the command prompt, type:

mysqldump –user=username –password=password databasename > filename

Example:

mysqldump –user=foo –password=123456 foodb > foodb.bak

How To Get The Current User in MySQL

To determine who you are currently logged in as in a MySQL command prompt, type the following:

mysql> select user()

or

mysql> select current_user()

How To Get The Current Database Name In MySQL

I just upgraded my WordPress installation to 2.6.3 and have a few tips to blog about for all of you Google searchers.

To find the current database in a MySQL prompt, type the following:

mysql> select database();

New F# Book By Chris Smith Coming Out in 2009

Chris Smith, a Microsoft SDET on the F# team, has a new book coming out next year called “Learning F#”.  I can’t wait to see it – there are only a handful of F# books at all right now, and we welcome a new addition.

If you’re into F#, you should add Chris’ RSS feed to your reader.  He has some great posts.

SICP Exercises in F#, Exercise 1.4

> let a_plus_abs_b a b =
 let add a b = a + b
 let sub a b = a - b
 if b > 0 then
  add a b
 else
  sub a b;;

val a_plus_abs_b : int -> int -> int

> a_plus_abs_b 1 -4;;
val it : int = 5

SICP Exercises in F#, Exercise 1.3

> let proc3 a b c =
 let sqr x = x * x
 let sum_of_squares m n = sqr m + sqr n
 let biggest m n = if m > n then m else n
 let smallest m n = if m > n then n else m
 sum_of_squares (biggest a b) (biggest (smallest a b) c);;

val proc3 : int -> int -> int -> int

> proc3 2 3 4;;
val it : int = 25

SICP Exercises in F#, Exercises 1.1

> 10;;
val it : int = 10
> 5 + 3 + 4;;
val it : int = 12
> 9 - 1;;
val it : int = 8
> 6 / 2;;
val it : int = 3
> (2 * 4) + (4 - 6);;
val it : int = 6
> let a = 3;;

val a : int

> let b = a + 1;;

val b : int

> b;;
val it : int = 4
> a + b + (a * b);;
val it : int = 19
> (a = b);;
val it : bool = false
> if (b > a) && (b  if (a = 4) then 6
elif (b = 4) then (6 + 7 + a)
else 25;;
val it : int = 16
> 2 + (if b > a then b else a);;
val it : int = 6
> if (a > b) then a
elif (a  (if (a > b) then a
elif (a < b) then b
else -1) * (a + 1);;
val it : int = 16

SICP Exercises in F#, Section 1.1.6

NOTE: No exercises necessary for section 1.1.5

> let abs = function
 | n when n > 0 -> n
 | n when n  -n
 | _ -> 0;;


val abs : int -> int

> let abs x = 
 match x with
 | _ when x  -x
 | _ -> x;;

val abs : int -> int

> abs -12;;
val it : int = 12
> abs 12;;
val it : int = 12
> abs 0;;
val it : int = 0
> let abs x =
 if (x  int

> let r1 x = 
 (x > 5) && (x  bool

> r1 5;;
val it : bool = false
> r1 6;;
val it : bool = true

SICP Exercises in F#, Section 1.1.4

> let square x = x * x;;

val square : int -> int

> square 21;;
val it : int = 441
> square (2 + 5);;
val it : int = 49
> square (square 3);;
val it : int = 81
> let sum_of_squares x y = (square x) + (square y);;

val sum_of_squares : int -> int -> int

> sum_of_squares 3 4;;
val it : int = 25
> let f a = sum_of_squares (a + 1) (a * 2);;

val f : int -> int

> f 5;;
val it : int = 136

TwitterCounter for @anthonyrstevens
Add to Technorati Favorites

RSS Feed

View Anthony Stevens's profile on LinkedIn