Updated to live writer 14 which is part new live update pack.
Notable changes
1) Preview
2) Segeo font
[The views expressed on this website/blog are mine alone and do not necessarily reflect the views of my employer.]
Updated to live writer 14 which is part new live update pack.
Notable changes
1) Preview
2) Segeo font
Click once deployment requires CLR to be present on target machine to verify manifest. Following snippets help in detecting the same.
Snippets work with IE5+ and Firefox 3+ only. They fail with Chrome.
Server Side:
protected void Page_Load(object sender, EventArgs e)
{
bool clrOK = Request.Browser.ClrVersion > new Version(3, 0);
if (clrOK)
Response.Write("CLR Version : " + Request.Browser.ClrVersion);
else
Response.Write("This machine does not have Microsoft .NET Framework version 3.5 SP1. Install and try again.");
}
Client Side:
<script type="text/javascript">
function DetectCLR(targetVersion) {
//Gets CLR version on IE5+ and Firefox 3+
var uagent = navigator.userAgent;
//Form regular expression
var clrRegExp = new RegExp(".NET CLR \\d.\\d.\\d{5}", "g");
//Get Matches
var clrversions = uagent.match(clrRegExp);
//Is CLR present
if (clrversions == null)
document.write("Please install Microsoft .Net Framework 3.5 SP1 and try again");
//Possible .NET CLR versions for v2 and above
//.NET CLR 2.0.50727
//.NET CLR 3.0.04506
//.NET CLR 3.5.21022
//.NET CLR 3.5.30729
var arraylength = clrversions.length;
var clrversiondetected;
for (var i = 0; i < arraylength; i++) {
//document.write(clrversions[i] + "</br>");
clrversiondetected = (clrversions[i] == targetVersion);
}
if (!clrversiondetected)
document.write("Please install Microsoft .Net Framework 3.5 SP1 and try again");
else
document.write("CLR Version : <b>" + targetVersion + "</b>");
return clrversiondetected;
}
</script>
I just came across BOSS.
BOSS (Bharat Operating System Solutions) GNU/Linux distribution developed by C-DAC (Centre for Development of Advanced Computing) derived from Debian for enhancing the use of Free/ Open Source Software throughout India. BOSSGNU/Linux - a key deliverable of NRCFOSS has crossed another milestone by releasing version 3.0. BOSS GNU/Linux Version 3.0 is coupled with GNOME and KDE Desktop Environment with wide Indian language support & packages, relevant for use in the Government domain. Currently BOSS GNU/Linux Desktop is available in almost all the Indian Languages such as Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Oriya, Punjabi, Sanskrit, Tamil, Telugu, Bodo, Urdu, Kashmiri, Maithili, Konkani, Manipuri , which will enable the mainly non-English literate users in the country to be exposed to ICT and to use the computer more effectively.
Explicit interface methods are prefered to instance members for following reasons
a) They are accessible only through interface
b) They support multiple levels of inheritance chain
Some insight. Take this example.
a) Take simple console application
b) Add an interface
c) Implement interface
d) Create Object of the class and try to access interface method
e) Cast it with interface and access
f) Call another explicit method method
g) Call another explicit methos by casting this object with interface
using System;
using System.Collections.Generic;
using System.Text;
namespace ClassMonitorLibrary
{
public class Program
{
//Entry point
public static void Main(String [] args)
{
#region Not accessible directly
//Object is accessible
//IFile im = (IFile)(new InterfaceMethods());
#endregion
InterfaceMethods im = new InterfaceMethods();
im.GetFile("Data.txt", 10);
}
}
//Simple interface
interface IFile
{
bool GetFile(string fileName, int length);
bool IsFileExists(string fileName);
}
//Interface implementation
class InterfaceMethods : IFile
{
bool IFile.GetFile(string fileName, int length)
{
#region how to access method
//if (((IFile)this).IsFileExists(fileName))
#endregion
if (IsFileExists(fileName))
Console.WriteLine("FileExists");
return true;
}
bool IFile.IsFileExists(string fileName)
{
return true;
}
}
}
Register quickly as limited seats available for focused event on Software + Services.
Back up and swap files that vim creates are sometimes frustrating; that too when you are working on source tree in version controlled directory.
Setting them off is desirable for such environments. Today I updated my Vim profile to do this and also found consolas font more appealing font for Vim editing on windows. Just thought of sharing profile file if anyone else interested in it.
C:\Program Files\Vim\_Vimrc file
set nobackup "Set off backup files"
set noswapfile "Set off swap files"
"Fonts"
set guifont=Consolas:h12:cANSI
"Tabs"
set stal=2
"GUI Options"
set guioptions-=T "No Toolbar"
set guioptions-=r "No right scroll "
set guioptions-=m "No menu "
"Color scheme"
colorscheme wombat "tried zellner, now wombat suits me best"
AutomationFederation.org is conducting and online survey on Issues in the Manufacturing Environment.
Survey results will be published in Microsoft's forum.
During April 2-4, 2008, Microsoft will be hosting a forum specifically addressing issues in the Manufacturing environment. The Microsoft Manufacturers User's Group (MsMUG) has been working side-by-side with Microsoft in preparation for this event.
Do you use Visual studio's Task List? Atleast I was't using it so far and I regret for not knowing this earlier.
It works like this, you might want to do something at code at later point in time, just add a comment in this syntax
//TODO: Add exception handling here
or you are doing code review and felt a message should have been logged here just add a comment like this
//LOG: recursive function, log depth of stack
or you might have felt a method has grown too big, it must be refactored, just add a comment where ever you felt like
//REFACTOR: break this part as a function
And visual studio has a window to search for all these comments and present them in a list.
To show task list select from View -> Task List
By default it shows user task, select for comments from combobox.
You can set more tokens from Tools -> Options Check in image here. TODO, HACK, UNDONE and UnresolvedMergeConflict are default tokens in visual studio. I added LOG and REFACTOR.
Check how a
TODO: Clean up and Log Something in code is shown with. And it is a clickable target
Also you can sort all log messages or TODO's to attend once.
Also you can define user defined tasks too.
For that select User tasks option in Task List and add your taks.
I felt the option very handy and felt like sharing it.
As I am spending most of time in CLR sandbox these days, I couldn't realise that NUnit can't work for native code. But that is a bit disappointing, having spent those many years developing C++ code, I couldn't accept flag go down. YES there is a Unit testing framework available for native C++ too. It is called WinUnit and MSDN Febraury 2008 article Simplified Unit Testing for Native C++ Applications describes the details.
Salient features are
a) Its built as a regular C++ dll
b) You can run it from Command Line by passing dll name as argument to WinUnit.exe
c) You can integrate with Visual Studio Build process, so whenever you build the project Unit Tests are performed
Compared to NUnit:
a) It lacks UI
b) Lacks report generation features
Today I got my beta account for xcerion. First impression is "it is awsome", but doesn't work in firefox.
It works only with IE 6 or 7 on windows. Its an xml based web operating system. Applications are developed using Model View Controller framework.
Though it is not from big giants like Microsoft and Google, it paved a way towards it. It may not be adapted in low bandwidth environments, though there is an offline feature.
MotoDev Studio is a new IDE platform to develop J2ME applications for Motorola phones.
I just did a basic test using this.
Prerequiresites:
Build Steps:
package MyPackage;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloWorld extends MIDlet
{
private Form mainScreen;private Display myDisplay;
public HelloWorld()
{
myDisplay = Display.getDisplay(this);mainScreen = new Form("Hello World");
StringItem strItem = new StringItem("Hello","This is a J2ME MIDlet.");
mainScreen.append(strItem);
}
/**
* Start the MIDlet
*/
public void startApp() throws MIDletStateChangeException
{
myDisplay.setCurrent(mainScreen);
}/**
* Pause the MIDlet
*/
public void pauseApp()
{}
/**
* Called by the framework before the application is unloaded
*/
public void destroyApp(boolean unconditional)
{}
}
Note: This is without signing
GET /stock HTTP/1.1
Host: www.kbcafe.com
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
xmlns:m="http://www.kbcafe.com/stock">
<soap:Header>
<m:DeveloperKey>1234</t>
</soap:Header>
<soap:Body>
<m:GetStockPrice>
<m:StockName>HUMC</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
The SOAP request tends to be overly verbose, but generally (not always) easy to understand. The SOAP envelope wraps an optional Header and the Body. The Body contains the actual XML request object. The Header contains information not required to service the request, but that help in some other way. A common use of the SOAP Header is the attachment of user credentials to the request. The beauty of SOAP is that it's not bound to the HTTP transport, although HTTP is by far the most commonly used transport for SOAP messages.
SOAP Response
HTTP/1.1 200 OK
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
xmlns:m="http://www.kbcafe.com/stock">
<soap:Body>
<m:GetStockPriceResponse>
<m:Price>27.66</m:Price>
</m:GetStockPriceResponse>
</soap:Body>
</soap:Envelope>
The SOAP response, also slightly overly verbose, but easy to understand. Now, imagine getting this response and you want the m:Price element text. How would you formulate the XPath to acquire this bit of information? Very simple ("//m:Price/text()").
REST Request
GET /stock?StockName=HUMC HTTP/1.1
Host: www.kbcafe.com
The beauty of REST is that GET requests do not require a request package. In this case, the parameter data is simply passed as an HTTP request parameter. Of course, this simplicity comes with a price. You are now bound to the HTTP protocol. Although the argument has been made that the principles of REST are not bound to HTTP, nobody has ever documented that approach.
It's important I explain here that REST is primarily used to service GET requests. By GET, I mean REST requests using the HTTP GET verb. REST uses three other HTTP verbs POST, PUT and DELETE. GET is used to retrieve data, POST to create, PUT to edit and DELETE to ... umh... delete. The HTTP verb is another element that binds the REST protocol to HTTP.
REST Response
HTTP/1.1 200 OK
<?xml version="1.0"?>
<m:Price xmlns:m="http://www.kbcafe.com/stock">27.66</m:Price>
The REST response is often very similar to the contents of the SOAP request body. And it's very easy to express an XPath and retrieve the data ("//m:Price/text()"). Note the REST response is actually simpler than the SOAP Body. This is by convention. SOAP transactions typically contain an element named with the method name and the strings Request and Response appended. This is actually unnecessary, but does have one advantage. REST request typically embed the method name within the request URL, which again binds the protocol to HTTP, whereas embedding the method name within the package allows SOAP to exist over any protocol.
XML-RPC Request
POST /stock HTTP/1.1
Host: www.kbcafe.com
<?xml version="1.0"?>
<methodCall>
<methodName>stock.GetStockPrice</methodName>
<params>
<param>
<value><string>HUMC</string></value>
</param>
</params>
</methodCall>
The XML-RPC request is the most verbose of all the protocols. This verbosity is what makes XML-RPC both difficult to use and lacking in inter-op. For example, the <string> element is optional, so the <value> element could have been expressed as <value>HUMC</value>. Several MetaWeblogAPI (the most common implementation of XML-RPC) providers assume the <string> element is present, while others assume it's not present. Whichever way you code it, at least one MetaWeblogAPI provider will fail. This leads to a lot of frustration for developers trying to write XML-RPC applications. You often have to code the request differently to compensate for different server implementations.
XML-RPC Response
HTTP/1.1 200 OK
<?xml version="1.0"?>
<methodCall>
<methodName>stock.GetStockPrice</methodName>
<params>
<param>
<value><double>27.66</double></value>
</param>
</params>
</methodCall>
Again, the XML-RPC response is the most verbose and again it contains a gross limitation. What's the XPath for retrieving the data? If you said ("//double/text()"), then we might have a problem down the road. Imagine the provider augments his response with new elements that includes the stocks 365-day high and 365-day low. The XPath would fail. Neither SOAP or REST have this problem, because the elements are named semantically.
Today is 9th birthday for Google.
WISH YOU MANY MANY HAPPY RETURNS OF THE DAY GOOGLE.