OK - have a home page on Google Sites:
Home page
Enjoy!
Ideas and thoughts about Microsoft Identity, C# development, cabbages and kings and random flotsam on the incoming tide
Friday, March 06, 2009
Misc : Top Google search result
Wednesday, February 25, 2009
Misc : Setting up and adding your gravatar
What is a gravatar? As per the site, "A gravatar, or globally recognized avatar, is quite simply an image that follows you from site to site appearing beside your name when you do things".
As per Wikipedia, "A Gravatar avatar can be up to 512 pixels wide, is always square and is displayed at 80 by 80 pixels by default. If the uploaded avatar is larger or smaller, the avatar is scaled appropriately".
I wanted to add one to Stack Overflow.
So I searched Google Images for a small image and saved it to my hard drive as a .jpg.
Then I used the ubiquitous Paint to open it. Under "Image / Attributes", it showed as:
Width = 60, Height = 40.
To keep it square, I needed to make the width 40. Simple maths shows that I needed it to be reduced by a third. So "Image / Stretch/Skew" and type 67 (i.e. 67 %) into the "Horizontal" box for "Stretch".
Another "Image / Attributes" showed it was pretty much as required. Save on the hard drive.
So logon to Gravatar. "My Account / Manage" Click "Add a new image". Browse to where the file was saved, select the file, crop as appropriate (I just dragged the box to fit the image), select the content type (hopefully it's "G"!) and you're done.
Now any site that uses gravatars will display your new image.
Enjoy!
As per Wikipedia, "A Gravatar avatar can be up to 512 pixels wide, is always square and is displayed at 80 by 80 pixels by default. If the uploaded avatar is larger or smaller, the avatar is scaled appropriately".
I wanted to add one to Stack Overflow.
So I searched Google Images for a small image and saved it to my hard drive as a .jpg.
Then I used the ubiquitous Paint to open it. Under "Image / Attributes", it showed as:
Width = 60, Height = 40.
To keep it square, I needed to make the width 40. Simple maths shows that I needed it to be reduced by a third. So "Image / Stretch/Skew" and type 67 (i.e. 67 %) into the "Horizontal" box for "Stretch".
Another "Image / Attributes" showed it was pretty much as required. Save on the hard drive.
So logon to Gravatar. "My Account / Manage" Click "Add a new image". Browse to where the file was saved, select the file, crop as appropriate (I just dragged the box to fit the image), select the content type (hopefully it's "G"!) and you're done.
Now any site that uses gravatars will display your new image.
Enjoy!
Monday, February 16, 2009
XP : DOS equivalent of Traceroute
I've used Traceroute often to trace the path between two hosts and highlight potential bottlenecks.
But it is not a Windows program. However, "PathPing" is a network utility in XP.
"It combines the functionality of Ping with that of Traceroute (in Windows: tracert), by providing details of the path between two hosts and Ping-like statistics for each node in the path based on samples taken over a time period".
Or (as above), use tracert.
Enjoy!
But it is not a Windows program. However, "PathPing" is a network utility in XP.
"It combines the functionality of Ping with that of Traceroute (in Windows: tracert), by providing details of the path between two hosts and Ping-like statistics for each node in the path based on samples taken over a time period".
C:\>pathping
Usage: pathping [-g host-list] [-h maximum_hops] [-i address] [-n]
[-p period] [-q num_queries] [-w timeout] [-P] [-R] [-T]
[-4] [-6] target_name
Options:
-g host-list Loose source route along host-list.
-h maximum_hops Maximum number of hops to search for target.
-i address Use the specified source address.
-n Do not resolve addresses to hostnames.
-p period Wait period milliseconds between pings.
-q num_queries Number of queries per hop.
-w timeout Wait timeout milliseconds for each reply.
-P Test for RSVP PATH connectivity.
-R Test if each hop is RSVP aware.
-T Test connectivity to each hop with Layer-2 priority tags.
-4 Force using IPv4.
-6 Force using IPv6.
Or (as above), use tracert.
C:\>tracert
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.
Enjoy!
Friday, January 30, 2009
C# : Removing non-ASCII characters
I was trying to filter some files and remove all the non-ASCII characters. Using Mr. Google lead me to this very helpful
post.
Essentially:
I didn't want control characters so my filter was \u0020-\u007F.
Enjoy!
post.
Essentially:
string s = "søme string";
s = Regex.Replace(s, @"[^\u0000-\u007F]", "");
I didn't want control characters so my filter was \u0020-\u007F.
Enjoy!
Thursday, December 04, 2008
Java : Axis2 client and Log4J
I was busy testing a client developed using the Eclipse plug-ins in the previous post.
This came up with the following error message.
log4j:WARN No appenders could be found for logger (org.apache.axis2.description.AxisService).
log4j:WARN Please initialize the log4j system properly.
To set this up inside an Eclipse project:
* Create a new folder in the project called e.g. "log4j".
* Add a file to that folder called log4j.properties which contains something like:
* In the project's "Run Dialog", click on the "Classpath" tab / "Advanced" / "Add folder" and then browse to the "log4j" folder previously created.
* That's it
Enjoy!
This came up with the following error message.
log4j:WARN No appenders could be found for logger (org.apache.axis2.description.AxisService).
log4j:WARN Please initialize the log4j system properly.
To set this up inside an Eclipse project:
* Create a new folder in the project called e.g. "log4j".
* Add a file to that folder called log4j.properties which contains something like:
# Set root category priority to INFO and set its only appender to A1
log4j.rootCategory=INFO, A1
# A1 is set to be a ConsoleAppender (writes to system console).
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
* In the project's "Run Dialog", click on the "Classpath" tab / "Advanced" / "Add folder" and then browse to the "log4j" folder previously created.
* That's it
Enjoy!
Java : Tomcat / Eclipse and Axis2
I needed to develop a Java web service that ran inside Tomcat and used Axis2 as the web server component.
I use Eclipse as my Java IDE and was looking around for plug-ins that would automate and simplify the whole process.
Came across this excellent tutorial - Developing Web Services Using Apache Axis2 Eclipse Plugins - Part 1
This uses two Eclipse plug-ins:
Apache Axis2 Service Archive Generator Wizard and
Apache Axis2 Code Generator Wizard
which generate the proxies and then wrap everything up for deployment to Tomcat.
I highly recommend working through the tutorial and then using that knowledge to develop and deploy your own.
Enjoy!
I use Eclipse as my Java IDE and was looking around for plug-ins that would automate and simplify the whole process.
Came across this excellent tutorial - Developing Web Services Using Apache Axis2 Eclipse Plugins - Part 1
This uses two Eclipse plug-ins:
Apache Axis2 Service Archive Generator Wizard and
Apache Axis2 Code Generator Wizard
which generate the proxies and then wrap everything up for deployment to Tomcat.
I highly recommend working through the tutorial and then using that knowledge to develop and deploy your own.
Enjoy!
Java : Finding jars and classes
I seem to spend half my life looking for jars and classes to solve the ubiquitous "Class not defined" problem.
Found this very useful resource which allows you to find which jar files contain the required class and then download them if needed.
Enjoy!
Found this very useful resource which allows you to find which jar files contain the required class and then download them if needed.
Enjoy!
Friday, November 28, 2008
Visual Studio: Intellisense XML files
I was playing with Rhino Mocks which comes with a .dll and a .xml file (for the Rhino Mocks Intellisense) but couldn't get the Intellisense to work.
You need to put the xml file in the same directory as the dll file and then restart VS.
Then all should be fine.
I did find bits and pieces that lacked Intellisense but I guess that that's a problem with the XML file?
Enjoy!
You need to put the xml file in the same directory as the dll file and then restart VS.
Then all should be fine.
I did find bits and pieces that lacked Intellisense but I guess that that's a problem with the XML file?
Enjoy!
Wednesday, November 19, 2008
LINQ : Simple LINQ to XML
It's really simple to construct XML documents with LINQ. This simple construct (inside LINQPad):
produces:
Enjoy!
XDocument simpleDoc =
new XDocument(
new XElement("TopLevel",
new XElement("SecondLevel",
  new XElement("a", "b",
new XAttribute("class", "level"))
)
)
);
simpleDoc.Dump();
produces:
<TopLevel>
<SecondLevel>
<a class="level">b</a>
</SecondLevel>
</TopLevel>
Enjoy!
Tuesday, November 18, 2008
LINQ : LINQPad with auto-completion / Intellisense
This is in beta as we speak.
If you can't wait, invoke as:
LINQPad -beta
Really unlocks the power of LINQ since you can now see what options are available.
Enjoy!
If you can't wait, invoke as:
LINQPad -beta
Really unlocks the power of LINQ since you can now see what options are available.
Enjoy!
LINQ : LINQ samples and ObjectDumper
There's a good selection of LINQ samples here. I ran up most of them in LINQPad.
However, some of these samples use a method called ObjectDumper (which does much the same job as object.Dump() in LINQPad).
The source for ObjectDumper can be found in this zip file. Save the files in an ObjectDumper directory somewhere and load them as a Project under Visual Studio. (Note that the sample is for VS 2008 but I had no problems doing this with VS 2005. Just remember to click on the .csproj to open the project and not the .sln!).
Then build the project which will create a .dll and add this .dll to the LINQPad "snippet" using "Advanced Properties" (F4)", then "Add" and then "Browse" to where you created the .dll.
Enjoy!
However, some of these samples use a method called ObjectDumper (which does much the same job as object.Dump() in LINQPad).
The source for ObjectDumper can be found in this zip file. Save the files in an ObjectDumper directory somewhere and load them as a Project under Visual Studio. (Note that the sample is for VS 2008 but I had no problems doing this with VS 2005. Just remember to click on the .csproj to open the project and not the .sln!).
Then build the project which will create a .dll and add this .dll to the LINQPad "snippet" using "Advanced Properties" (F4)", then "Add" and then "Browse" to where you created the .dll.
Enjoy!
Subscribe to:
Posts (Atom)

