Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

Vesuvius vesuvius Count Orlock
  • VS2010 to use toolbars?

    Rico Mariani answered this question here.

    The ribbon was created to allow a user to have access to a lot of commands at any given moment. In Visual Studio the commands you use the most are F5 and the debugging options, so a ribbon is overkill and takes up too much space.

    You also don't edit your code like a word document, as int for example is already formatted, and /// gives you your XML comments all nicely formatted in green.

    I keep sounding like a broken record, but if you really want to know why the ribbon was procured, then watch The Story Of The Ribbon.

  • sftp client?

    http://filezilla-project.org/

  • Using Nested ICollections ​(ObjectData​Source) with a repeater?

    http://weblogs.asp.net/scottgu/archive/2006/01/07/434787.aspx

  • F# Discussion

    phreaks said:
    Pretty cool.

    How is the VS.Net integration?

    Is there intellisense and all the other goodies that would help compel ppl to switch from python, R, or Matlab?







    I reckon this will be fully integrated in VS 2010.

    Depending on how good the dynamic language runtime is, Visual Studio next version will certainly be very interesting. If you are missing any library in .NET, just call open System.Windows.Forms for example and you are good to go.

  • F# Discussion

    Ok, I've been looking at the September 2008 CTP and have had a look at the tutorial which I will post below.

    The first think that stuck me coming from a C type training is the use of the keyword let

    Pretty much everything is like using the keyword var in C#. Everything is about type inference. Everything is also immutable like a string in .NET, i.e. let x = 10 cannot be changed(unless you use the mutable keyword)

    I also like tuples, which we just do not have in .NET, you would have to write your own in C#. also looking at list again, none of this

     

    List<int> intList = new List<int>();

    You just go
     

    /// The empty list

    let listA = [ ]          

     

    /// A list with 3 integers

    let listB = [ 1; 2; 3 ] 



    What other interesting constructs can you make out, without writing any code?

    // F# Tutorial File

    //

    // This file contains sample code to guide you through the

    // primitives of the F# language. 

    //

    // For a larger collection of F# samples, see:

    //     http://go.microsoft.com/fwlink/?LinkID=124614

    //

    // Contents:

    //   - Simple computations

    //   - Functions on integers 

    //   - Tuples

    //   - Booleans

    //   - Strings

    //   - Lists

    //   - Arrays

    //   - More Collections

    //   - Functions

    //   - Types: unions

    //   - Types: records

    //   - Types: classes

    //   - Types: interfaces

    //   - Types: classes with interface implementations

    //   - Printing

     

    // Turn on the lightweight syntax

    #light

     

    // open some standard namespaces

    open System

     

    // Simple computations

    // ---------------------------------------------------------------

    // Here are some simple computations.  Note how code can be documented

    // with '///' comments.  Hover over any reference to a variable to

    // see its documentation.

     

    /// A very simple constant integer

    let int1 = 1

     

    /// A second very simple constant integer

    let int2 = 2

     

    /// Add two integers

    let int3 = int1 + int2

     

    // Functions on integers 

    // ---------------------------------------------------------------

     

    /// A function on integers

    let f x = 2*x*x - 5*x + 3

     

    /// The result of a simple computation

    let result = f (int3 + 4)

     

    /// Another function on integers

    let increment x = x + 1

     

    /// Compute the factorial of an integer

    let rec factorial n = if n=0 then 1 else n * factorial (n-1)

     

    /// Compute the highest-common-factor of two integers

    let rec hcf a b =                       // notice: 2 parameters separated by spaces

        if a=0 then b

        elif a<b then hcf a (b-a)           // notice: 2 arguments separated by spaces

        else hcf (a-b) b

        // note: function arguments are usually space separated

        // note: 'let rec' defines a recursive function

     

     

    // Tuples

    // ---------------------------------------------------------------

     

    // A simple tuple of integers

    let pointA = (1, 2, 3)

     

    // A simple tuple of an integer, a string and a double-precision floating point number

    let dataB = (1, "fred", 3.1415)

     

    /// A function that swaps the order of two values in a tuple

    let Swap (a, b) = (b, a)

     

    // Booleans

    // ---------------------------------------------------------------

     

    /// A simple boolean value

    let boolean1 = true

     

    /// A second simple boolean value

    let boolean2 = false

     

    /// Compute a new boolean using ands, ors, and nots

    let boolean3 = not boolean1 && (boolean2 || false)

     

    // Strings

    // ---------------------------------------------------------------

     

    /// A simple string

    let stringA  = "Hello"

     

    /// A second simple string

    let stringB  = "world"

     

    /// "Hello world" computed using string concatentation

    let stringC  = stringA + " " + stringB

     

    /// "Hello world" computed using a .NET library function

    let stringD = String.Join(" ",[| stringA; stringB |])

      // Try re-typing the above line to see intellisense in action

      // Note, ctrl-J on (partial) identifiers re-activates it

     

    // Functional Lists

    // ---------------------------------------------------------------

     

    /// The empty list

    let listA = [ ]          

     

    /// A list with 3 integers

    let listB = [ 1; 2; 3 ]    

     

    /// A list with 3 integers, note :: is the 'cons' operation

    let listC = 1 :: [2; 3]   

     

    /// Compute the sum of a list of integers using a recursive function

    let rec SumList xs =

        match xs with

        | []    -> 0

        | y::ys -> y + SumList ys

     

    /// Sum of a list

    let listD = SumList [1; 2; 3] 

     

    /// The list of integers between 1 and 10 inclusive

    let oneToTen = [1..10]

     

    /// The squares of the first 10 integers

    let squaresOfOneToTen = [ for x in 0..10 -> x*x ]

     

     

    // Mutable Arrays

    // ---------------------------------------------------------------

     

    /// Create an array

    let arr = Array.create 4 "hello"

    arr.[1] <- "world"

    arr.[3] <- "don"

     

    /// Compute the length of the array by using an instance method on the array object

    let arrLength = arr.Length       

     

    // Extract a sub-array using slicing notation

    let front = arr.[0..2]

     

     

    // More Collections

    // ---------------------------------------------------------------

     

    /// A dictionary with integer keys and string values

    let lookupTable = dict [ (1, "One"); (2, "Two") ]

     

    let oneString = lookupTable.[1]

     

    // For some other common data structures, see:

    //   System.Collections.Generic

    //   Microsoft.FSharp.Collections

    //   Microsoft.FSharp.Collections.Seq

    //   Microsoft.FSharp.Collections.Set

    //   Microsoft.FSharp.Collections.Map

     

    // Functions

    // ---------------------------------------------------------------

     

    /// A function that squares its input

    let Square x = x*x             

     

    // Map a function across a list of values

    let squares1 = List.map Square [1; 2; 3; 4]

    let squares2 = List.map (fun x -> x*x) [1; 2; 3; 4]

     

    // Pipelines

    let squares3 = [1; 2; 3; 4] |> List.map (fun x -> x*x)

    let SumOfSquaresUpTo n =

      [1..n]

      |> List.map Square

      |> List.sum

     

    // Types: unions

    // ---------------------------------------------------------------

     

    type Expr =

      | Num of int

      | Add of Expr * Expr

      | Mul of Expr * Expr

      | Var of string

     

    let rec Evaluate (env:Map<string,int>) exp =

        match exp with

        | Num n -> n

        | Add (x,y) -> Evaluate env x + Evaluate env y

        | Mul (x,y) -> Evaluate env x * Evaluate env y

        | Var id    -> env.[id]

     

    let envA = Map.of_list [ "a",1 ;

                             "b",2 ;

                             "c",3 ]

     

    let expT1 = Add(Var "a",Mul(Num 2,Var "b"))

    let resT1 = Evaluate envA expT1

     

     

    // Types: records

    // ---------------------------------------------------------------

     

    type Card = { Name  : string;

                  Phone : string;

                  Ok    : bool }

     

    let cardA = { Name = "Alf" ; Phone = "(206) 555-8257" ; Ok = false }

    let cardB = { cardA with Phone = "(206) 555-4112"; Ok = true }

    let ShowCard c =

      c.Name + " Phone: " + c.Phone + (if not c.Ok then " (unchecked)" else "")

     

     

    // Types: classes

    // ---------------------------------------------------------------

     

    /// A 2-dimensional vector

    type Vector2D(dx:float, dy:float) =

        // The pre-computed length of the vector

        let length = sqrt(dx*dx + dy*dy)

        /// The displacement along the X-axis

        member v.DX = dx

        /// The displacement along the Y-axis

        member v.DY = dy

        /// The length of the vector

        member v.Length = length

        // Re-scale the vector by a constant

        member v.Scale(k) = Vector2D(k*dx, k*dy)

     

     

    // Types: interfaces

    // ---------------------------------------------------------------

     

    type IPeekPoke =

        abstract Peek: unit -> int

        abstract Poke: int -> unit

     

     

    // Types: classes with interface implementations

    // ---------------------------------------------------------------

     

    /// A widget which counts the number of times it is poked

    type Widget(initialState:int) =

        /// The internal state of the Widget

        let mutable state = initialState

     

        // Implement the IPeekPoke interface

        interface IPeekPoke with

            member x.Poke(n) = state <- state + n

            member x.Peek() = state

     

        /// Has the Widget been poked?

        member x.HasBeenPoked = (state <> 0)

     

     

    let widget = Widget(12) :> IPeekPoke

     

    widget.Poke(4)

    let peekResult = widget.Peek()

     

     

    // Printing

    // ---------------------------------------------------------------

     

    // Print an integer

    printfn "peekResult = %d" peekResult

     

    // Print a result using %A for generic printing

    printfn "listC = %A" listC

  • Todd Bishop article on Channel 9

    No disrespect to the "gaffer" Jeff but Charles does a more than excellent job, and is one reason I keep returning.

    One minute it is SmallBasic, the next it is Citrix with John Sheehan, the minute after it's Ritzy and the women thing, then the genuflexions at JAOO, Betrand Meyer, Meijers etc.

    Channel 9 cannot be accused of being linear.

  • Ingredients to make the Windows 7 Taskbar an Epic Fail ?

    Sven Groot said:
    vesuvius said:
    *snip*
    APIs for this are already available, admittedly not managed but it's not as if you have to wait for MS to produce wrappers, you can do it yourself and as littleguru showed, some people are already working on it.
    This is a far better example, because it is through Microsoft and points to the VistaBridge but the project is actually Windows7.DesktopIntegration.

    My wish is for this to be completed soon, and a push be made for developers to adopt the libraries, because the more people that have applications that can show the taskbar in it's true light, then the less friction there will be.

    I also say this because most businesses are going to skip Vista, and the last thing an IT director wants, is to be told that in order for their proprietary software to run productively and efficiently on Windows 7 then they are going to have to perform modifications based on some open source project on codeplex.com or codeprject.com.

    My concern is strictly about the reduction in friction between migrating from XP/Vista to Windows 7.

  • Ingredients to make the Windows 7 Taskbar an Epic Fail ?

    Bas said:
    Why are they second class citizens? I can imagine that providing custom previews might not be possible yet, but in what other ways do your own applications (and firefox and such) behave differently in the new taskbar?
    I am talking about jump lists and the common file dialog.

     If you open up Word for instance, you have all your recent documents, and the option to open up a new document all automatically integrated. The same can be said for things like windows media player when you can play/pause a program straight from the task bar.

    Have a look at this


    At the moment you only get this level of feedback from Microsoft programs. I would like to include the same level of recent files or document in my applications.

    Try using Free Download manager for instance or Skype. You end up with the duplication in the notify area and taskbar that this is all new taskbar mumbo-jumbo is meant to remove, because these vendors have not got the API in order to change their applications. Apart from Microsoft applications, I am having to recreate the Vista/XP taskbar which defeats the whole objective.

    Microsoft are aware of this, hence this. My principal gripe is the fact that this has been added to VistaBridge which is two years too late already, and no-one seems to admit or care about that.

    Please don't let the taskbar go the same way.

  • Ingredients to make the Windows 7 Taskbar an Epic Fail ?

    The good folks at Microsoft have changed the way we navigate our applications in Seven, which was very good of them, and I can see why they have done so and applaud them so.

    The Task bar will be perceived to be problematical, until an API is released that allows native and managed developers to target the task bar API, and make their applications easier to use. At present, the only programs that work with the taskbar well are Microsoft ones (Word, Explorer etc.)

    All other programs like Firefox, Free Download Manager and even my own custom Windows Forms applications are really painful to use because they are in the Task bar, but are second class citizens as far as the taskbar is concerned.

    There is a Task bar API in development, but that has been assigned to be joined with the VistaBridge which was released two years too late, and progress in development in it, is like a dog with three legs.

    The mistake you [Microsoft] have made is in not making available a feature complete task bar API, that all appplication developers can start to use that is itself beta so as to mitigate any friction with the inevitable recalcitrance you will encounter by people inured to previous versions.

    You should know by now just how much most people dislike change, and the availability of this API would surely palliate those voiceferous about the change. The biggest problem Vista had was misconception, and I have worked with many users over the years and know that my visually impaired uncle for instance will not be able to use Seven. If you don't do something about this soon, you will be Mojaving the task bar in 2012.

    Just my 2 pence.

  • Moonlight 1.0

    stevo_ said:
    Personally I think for the effort put in.. its a waste of time.
    Would you care to elaborate as to why this is a wasted effort?