I think online RSS readers like Google Reader suck - I vastly prefer desktop ones. For many years, I used SharpReader. I liked it and it's free - what's to complain about?
But it's no longer maintained. The last update was "Changes in 0.9.7.0 - released August 2 2006" and there were more and more of my blogs that were just throwing feed errors that weren't actually errors.
So reluctantly, I look around for a new one. After a bit of research, I settled on FeedDemon. Took me a while to get used to its quirks but once I got over the initial learning curve, I'm quite happy with it.
And since I could export my subscriptions in opml and import them into FeedDemon, I didn't lose a single one.
Enjoy!
Ideas and thoughts about Microsoft Identity, C# development, cabbages and kings and random flotsam on the incoming tide
Friday, October 31, 2008
Tuesday, October 28, 2008
Excel : Putting the row number in the cell
Comparing two versions of a spreadsheet (old versus new), I wanted to have a column of the current row number on the old spreadsheet and the corresponding row number on the new one.
For the old spreadsheet, this would just be the row number e.g. column 3 has number 3.
An easy way to do this is to type two numbers in the first two rows (i.e. 1 and 2) and then highlight them as if to drag them which causes the little box to appear in the bottom right hand corner of the cell. Then drag the box down the rest of the column.
When you do this, Excel works out the relationship between the two numbers (i.e. row x = x; row x+1 = x+1) and then applies this to the rest of the column.
Done.
Enjoy!
For the old spreadsheet, this would just be the row number e.g. column 3 has number 3.
An easy way to do this is to type two numbers in the first two rows (i.e. 1 and 2) and then highlight them as if to drag them which causes the little box to appear in the bottom right hand corner of the cell. Then drag the box down the rest of the column.
When you do this, Excel works out the relationship between the two numbers (i.e. row x = x; row x+1 = x+1) and then applies this to the rest of the column.
Done.
Enjoy!
Excel : Viewing two windows side by side
I have two spreadsheets; one an earlier version and one that reflects the current state after many alterations and updates and I wanted to document all the changes.
So I tried to put them side by side so I could manually compare them row-by-row.
There are two buttons on the task bar (one for each window) but clicking them loads each spreadsheet in exactly the same window. They effectively overlay each other.
After doing some research, I found you need to click Window / Arrange / Vertical and hey presto it's done.
Enjoy!
So I tried to put them side by side so I could manually compare them row-by-row.
There are two buttons on the task bar (one for each window) but clicking them loads each spreadsheet in exactly the same window. They effectively overlay each other.
After doing some research, I found you need to click Window / Arrange / Vertical and hey presto it's done.
Enjoy!
Thursday, October 16, 2008
C# : T4 - the Text Template Transformation Toolkit
Been looking at code generation templates. Obviously CodeSmith is right up there but then I read an article by Scott Hanselman entitled "T4 (Text Template Transformation Toolkit) Code Generation - Best Kept Visual Studio Secret" which describes a Visual Studio add-in (I'm using VS 2005) which does pretty much the same thing.
There's a link in the article to another "How-To" by Oleg Sych entitled "
How to create a simple T4 template". You need to download DSL Tools and you may also want to install the T4 Editor by Clarius Consulting.
As an example, here's my template (Template.tt):
and here's the class (TestClass.tt) that uses it:
which results in this code:
Enjoy!
There's a link in the article to another "How-To" by Oleg Sych entitled "
How to create a simple T4 template". You need to download DSL Tools and you may also want to install the T4 Editor by Clarius Consulting.
As an example, here's my template (Template.tt):
<#@ template language="C#" #>
<#@ assembly name="System.dll" #>
//
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//
using System;
public class <#= this.ClassName #>
{
public static void HelloDude()
{
Console.WriteLine("Hello, Dude");
for (<#= this.Variable #> = <#= this.Start #>; <#= this.Variable #> < <#= this.End #>;
<#= this.Variable#>++)
{
}
}
}
<#+
string ClassName = "MyClass";
string Variable = "i";
string Start = "0";
string End = "10";
#>
and here's the class (TestClass.tt) that uses it:
<#
this.ClassName = "TestClass";
this.Variable = "i";
this.Start = "0";
this.End = "20";
#>
<#@ include file="Path to template\Template.tt" #>
which results in this code:
//
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//
using System;
public class TestClass
{
public static void HelloDude()
{
Console.WriteLine("Hello, Dude");
for (i = 0; i < 20;
i++)
{
}
}
}
Enjoy!
Friday, September 05, 2008
openSTA : Logging SOAP faults
The audit log contains the items you log. To log the fact that your web service returned a SOAP fault use something like:
Enjoy!
CHARACTER*65535 BODY_RESPONSE
INTEGER FNIDOFFSET
...
LOAD RESPONSE_INFO BODY ON 1 INTO BODY_RESPONSE
SET FNIDOFFSET = ~LOCATE('SOAP:Fault', BODY_RESPONSE), CASE_BLIND
IF (FNIDOFFSET >= 0) THEN
LOG "SOAP:Fault error detected"
ENDIF
Enjoy!
Excel: "Pass" / "Fail" in a column and "Fail" in red
There is a pivot table spreadsheet on the openSTA site which allows you to work with timers. I wanted to compare that with a required result and then place "Pass" or "Fail" in the column depending on the result and then have "Fail" in red to highlight it.
You could of course use VBA but that requires a bit of programming skill.
The fist part is easy - just use the formula:
=IF(H1>K1,"Fail","Pass")
where H1 is the openSTA timer result and K1 is the required result.
The second part is done via selecting the "Pass" / "Fail" column and then right-click / Format / Conditional Formatting.
The condition is "Cell value is equal to "Fail"", then click on the "Format" button and select the red colour.
Enjoy!
You could of course use VBA but that requires a bit of programming skill.
The fist part is easy - just use the formula:
=IF(H1>K1,"Fail","Pass")
where H1 is the openSTA timer result and K1 is the required result.
The second part is done via selecting the "Pass" / "Fail" column and then right-click / Format / Conditional Formatting.
The condition is "Cell value is equal to "Fail"", then click on the "Format" button and select the red colour.
Enjoy!
openSTA : Creating random variables
I've been involved with openSTA testing lately and will blog on some things I learned.
One thing I needed to do was to run some tests on a web service that creates files. Each file had to be a different name.
and then in the web service, set the title to:
'Doc name '+ C_FC + C_TIMEVAL + '.doc
Enjoy!
One thing I needed to do was to run some tests on a web service that creates files. Each file had to be a different name.
INTEGER FILECOUNT, SCRIPT
INTEGER TIMEVAL
CHARACTER*10 C_FC
CHARACTER*10 C_TIMEVAL
...
ACQUIRE TEST-WIDE MUTEX "FC"
SET FILECOUNT = FILECOUNT + 1
CONVERT FILECOUNT TO C_FC
RELEASE TEST-WIDE MUTEX "FC"
ACQUIRE TEST-WIDE MUTEX "DocID"
LOAD TIME into TIMEVAL
!Ensure that the time provides 7 digits
SET TIMEVAL = TIMEVAL + 1000000
CONVERT TIMEVAL TO C_TIMEVAL
RELEASE TEST-WIDE MUTEX "DocID"
and then in the web service, set the title to:
'Doc name '+ C_FC + C_TIMEVAL + '.doc
Enjoy!
Wednesday, August 20, 2008
openSTA : Test hangs
Found an annoying problem with the Test box. When I changed a parameter, the whole application just froze - no error messages, nothing.
I eventually figured out that this was because the test file was R/O! Removing that attribute fixed the problem.
Enjoy!
I eventually figured out that this was because the test file was R/O! Removing that attribute fixed the problem.
Enjoy!
Monday, July 28, 2008
C# : Reading a binary file
I needed to read a file into a buffer for subsequent encoding.
Made the mistake of usuing TextReader which of course has issues becaise the EOF could be anywhere for a bionary file. Also you don't know how big the file is and you don't want to use Peek and read one character at a time.
Came up with the following:
Enjoy!
Made the mistake of usuing TextReader which of course has issues becaise the EOF could be anywhere for a bionary file. Also you don't know how big the file is and you don't want to use Peek and read one character at a time.
Came up with the following:
...
try
{
// Note: This is a binary file so can't use EOF
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
byte[] bArray = new byte[br.BaseStream.Length];
bArray = br.ReadBytes(Convert.ToInt32(br.BaseStream.Length));
return bArray;
}
catch (Exception ex)
{
...
}
Enjoy!
Misc : Error 0X80070052 on USB Flash Drives
I came across this at the weekend.
Trying to copy some files from a DVD to a flash drive and kept getting this error.
Tried everything - reformatted etc. but no joy.
So Mr. Google to the rescue.
One link suggested that the problem was that there is a limit to the number of files you can copy to the root directory of a USB drive.
Sounded suspect but made a folder under root and then copied the files to the folder.
Suddenly everything worked!
Amazing!
Enjoy!
Trying to copy some files from a DVD to a flash drive and kept getting this error.
Tried everything - reformatted etc. but no joy.
So Mr. Google to the rescue.
One link suggested that the problem was that there is a limit to the number of files you can copy to the root directory of a USB drive.
Sounded suspect but made a folder under root and then copied the files to the folder.
Suddenly everything worked!
Amazing!
Enjoy!
Monday, July 07, 2008
Eclipse : Compiling JVM 1.4 with Eclipse Europa
Eclipse Europa won't work with anything less than JVM 1.5.
But what happens if your client needs a Java 1.4 program? Do you have to download an earlier version of Eclipse?
Actually - no!
You can compile 1.4 programs inside the Europa 1.5 workspace.
Under "Windows - Preferences - Java - Installed JREs", you need to add the path to the 1.4 JVM.
Right click on the 1.4 project.
Under "Properties - Java Build Path - Libraries", ensure that the JRE System Library points to the 1.4 version.
Under "Properties - Java Compiler", click "Enable project specific settings". Set "Compiler compliance level" to 1.4.
That's it.
Enjoy!
But what happens if your client needs a Java 1.4 program? Do you have to download an earlier version of Eclipse?
Actually - no!
You can compile 1.4 programs inside the Europa 1.5 workspace.
Under "Windows - Preferences - Java - Installed JREs", you need to add the path to the 1.4 JVM.
Right click on the 1.4 project.
Under "Properties - Java Build Path - Libraries", ensure that the JRE System Library points to the 1.4 version.
Under "Properties - Java Compiler", click "Enable project specific settings". Set "Compiler compliance level" to 1.4.
That's it.
Enjoy!
Thursday, June 26, 2008
Java : Implementing the C# foreach
This is a common construct:
It's messy and in C# you can easily do this far more elegantly with the "foreach" command.
How do you do this in Java?
Use something like e.g. for Reflection fields:
Enjoy!
for (int i = 0; i < "object".length; i++)
{
}
It's messy and in C# you can easily do this far more elegantly with the "foreach" command.
How do you do this in Java?
Use something like e.g. for Reflection fields:
import java.lang.reflect.Field;
Field[] fields = "object".getClass().getDeclaredFields();
for (Field field : fields)
{
...
field[i].getName();
...
}
Enjoy!
Subscribe to:
Posts (Atom)