3 July 2011 0 Comments

WTF is this? Twahpic, a new way to model your tweets

  Ok, I don’t get it.  I tried it and I am not getting what this is.  Check it out and let me know: http://twahpic.msresearch.us/S4.aspx

3 June 2009 0 Comments

Tips till dig som kommer på Marknadsdagen och Partnerkväll på Hotellet imorgon

Det blir fullsatt på Microsoft kontoret i Akalla, lämna gärna bilen hemma, så väl eftermiddag som kväll. Det är trångt om p-plats såväl i Akalla såsom runt Stureplan så här i juni månad

1 June 2009 0 Comments

DLR を使った Excel プログラミング

Visual Studio 2010ベータ1のウォークスルーの中に Office プログラマビリティ があります。このウォークスルーの中で、1か所だけ 動的呼び出しになると記述されたところがあります。この個所を、このウォークスルーではNo PIA(埋め込みPIA)というシナリオを確認するために、最終的には、キャストします。なぜキャストするかといえば、埋め込みPIAでは必要な型情報のみを取り込むからだと説明されています。この内容は、さておきNo PIAにしないコードの抜粋を以下に引用します。 public class Account { public int ID { get; set; } public double Balance { get; set; } } using Excel = Microsoft.Office.Interop.Excel; class Program { static void Main(string[] args) { var checkAccounts = new List<Account> { new Account { ID = 345, Balance = 541.27 }, new Account { ID = 123, Balance = -127.44 } }; DisplayInExcel(checkAccounts, (account, cell) => { cell.Value2 = account.ID; cell.get_Offset(0, 1).Value2 = account.Balance; if (account.Balance < 0) { cell.Interior.Color = 255; cell.get_Offset(0, 1).Interior.Color = 255; } }); } public static void DisplayInExcel( IEnumerable<Account> accounts, Action<Account, Excel.Rage> DisplayFunc) { var xl = new Excel.Application(); xl.Workbooks.Add(); xl.Visible = true; xl.get_Range(“A1″).Value2 = “ID”; xl.get_Range(“B1″).Value2 = “Balance”; xl.get_Range(“A2″).Select(); foreach (var ac in accounts) { DisplayFunc(ac, xl.ActiveCell); xl.ActiveCell.get_Offset(1, 0).Select(); } xl.get_Range(“A1:B3″).Copy(); xl.Columns[1].AutoFit(); xl.Columns[2].AutoFit(); } } 「 xl.Columns[1].AutoFit(); 」が実行時に解決されて、AutoFitメソッドが呼ばれます。この実行時に解決するというのは、xl.Columns[1]が実行時にRangeオブジェクトを返すために、AutoFitメソッドを呼び出せるようになるという意味です。このウォークスルーでは埋め込みPIAを確認するためですが、最終的に「((Excel.Range) xl.Columns[1]).AutoFit();」とキャストを追加するようになります。  しかし、.NET Framework 4.0ベータ1には動的呼び出しをサポートするために DLRが含まれています。DLRを使うようにすることで、埋め込みPIAどころか、型情報自体を実行時に解決することができます。そのように改造した Programクラスを以下に示します。 //using Excel = Microsoft.Office.Interop.Excel; class Program { static void Main(string[] args) { var checkAccounts = new List<Account> { new Account { ID = 345, Balance = 541.27 }, new Account { ID = 123, Balance = -127.44 } }; DisplayInExcel(checkAccounts, (account, cell) => { cell.Value2 = account.ID; cell.Offset(0, 1).Value2 = account.Balance; if (account.Balance < 0) { cell.Interior.Color = 255; cell.Offset(0, 1).Interior.Color = 255; } }); } public static void DisplayInExcel( IEnumerable<Account> accounts, Action<Account, dynamic> DisplayFunc) { dynamic xl = GetComInstance(“Excel.Application”); xl.Workbooks.Add(); xl.Visible = true; xl.Range(“A1″).Value2 = “ID”; xl.Range(“B1″).Value2 = “Balance”; xl.Range(“A2″).Select(); foreach (var ac in accounts) { DisplayFunc(ac, xl.ActiveCell); xl.ActiveCell.Offset(1, 0).Select(); } xl.Range(“A1:B3″).Copy(); xl.Columns[1].AutoFit(); xl.Columns[2].AutoFit(); } // COMインスタンス作成用のヘルパーメソッド public static dynamic GetComInstance(string progID) { Type comType = Type.GetTypeFromProgID(progID); return System.Activator.CreateInstance(comType); } } プロジェクトからPIAアセンブリへの参照を削除して、ビルドすれば DLR を活用した動的呼び出しが完成します。C#では、PIAを使っている時にGet_RangeやGet_Offsetというメソッドだったことにも注意してください。VBと同じように「Get_」プレフィックスのつかないメソッドで呼び出せるようになります。これは、dynamicキーワードによってC# Binderが DLR のCOM呼び出し(VB6のレイトバインディングと同等)を呼び出すからです。 VB のウォークスルーのコードも、型名を Object に変更すれば、同じように動的呼び出しを実現することができます。VBの場合は、VBコンパイラがVB Binderである NewLateBindingクラス を利用するコードを出力することで実現しています。 PIAがあれば実行時の型変換の規則がありますので実行速度的には良いでしょうが、DLRを使った動的呼び出しも私には良さそうに思えます。皆さんは、どちらがお好きでしょうか?

29 May 2009 0 Comments

How to Programmatically Modify the IIS Virtual Directory

If you have more than a dozen web servers in a cluster with identical setting, and you need to update the virtual directory, it is much more convenient to write a simple program to update it.

29 May 2009 0 Comments

Lessons from the state police, like what to do when they pull you over

NPR’s Noah Adams rides along with the Idaho State Police and learns the answers to questions like what you should do when you are pulled over, and why the first thing the officer does is touch your car.

29 May 2009 0 Comments

The best feature of Windows 7

I know this isn’t specifically educational, but I just feel the need to share. Having been using Windows 7 for a few weeks, the one feature that just knocks my socks off (and seems so obvious in hindsight) is the way that I can easily split my screen to show two different programmes at the same time. Basically, you grab the title bar of the window – like this: And then move it over to the left hand or right hand side of the screen.

27 May 2009 0 Comments

立命館アジア太平洋大学訪問 Update

5/19に訪問した立命館アジア太平洋大学から、いくつか更新情報が届きましたのでお知らせします。 学校のホームページのニュースに取り上げていただきました。 「 ニュース:APUサークルAPU-CTがマイクロソフトセミナーを開催 」 5/19訪問時に収録したトークショーが公開されました。 「 Microsoft Seminar 2009 Talk Show 」 トークショーは、司会の方からスタッフの方まで、全て学生の方々が行っています。 ゲスト(私)のトークはともかく、司会やスタッフの方々の仕事振りは完璧でした。 MSP(Microsoft Student Partners) のYusuf君を始めとして、協力いただいた学生の皆さま、ありがとうございました。

21 May 2009 0 Comments

Visual Studio 2010 SDK Beta 1 Available!

It pays to be in early in the morning… sometimes you get to be the first to announce. :) The Visual Studio 2010 SDK Beta 1 is now available for download on MSDN Download Center.

21 May 2009 0 Comments

You can sort by most downloaded project – #034

Previously, I mentioned that you can sort by top rated release on CodePlex. But it is also interesting to know you can sort by most downloaded project in the past 7 days. We do past 7 days so that active projects are listed first

15 May 2009 0 Comments

Série Cenários Reais: Aproveitando a sua TI ao máximo

Pessoal, Estive trabalhando com o Fabio Hara em um projeto de criação de conteúdo (conjunto de vídeos para o MSDN e o TechNet) chamado Série Cenários Reais: Aproveitando a sua TI ao máximo . Esta série disponibiliza um conteúdo técnico sobre soluções da plataforma Microsoft , através de apresentações dinâmicas, usando uma metodologia de cenários para que você tenha uma visão completa da tecnologia. É um conteúdo cheio de informações técnicas para vencer os desafios da nova economia , colocando você em contato com as mais recentes soluções Microsoft e tendências.

5 May 2009 0 Comments

CRM Accelerator med ny funksjonalitet for arbeidsflyt

En ny akselerator er nå tilgjengelig på Codeplex: “ Microsoft Dynamics CRM Business Productivity Workflow Tools ” (velklingende navn, ikke sant?). Dette er rett og slett en serie med “custom workflow activities” som du kan velge fra når du setter opp arbeidsflyt

5 May 2009 0 Comments

Tool: Code Rush Xpress 9.1 Beta

59 Refactorings, 17 consume-first providers, and a  lot more! Marc Schweigert send us this link I don’t think he blogged about it. It is really cool (watch the video!) I think a lot of you will appreciate this tool