 I finally got Live Mesh working on my Mac, my phone, and my fileserver. I'm waiting on a new laptop for work, so I haven't installed there yet. I have to say this is very cool. At the very basic, it does file sync. This is what most users will see at first. I've used several different sync applications, and within a couple of days, I've been quite satisfied with this solution. One thing to note is that the Windows Mobile client actually does scheduled sync with your Live Mesh desktop in the cloud! The Windows Mobile and Mac client sync with the cloud. The Windows client has the ability to sync with the cloud, and to sync peer to peer with other Windows clients. The interesting thing is that you can sync with other people's Mesh objects, if they invite you. I can see this replacing Groove and FolderShare when it is release (it's a Technology Preview right now.) More to come as I play with it. BTW, there's a SDK as well.
I recently discovered that I was occasionally missing emails from correspondents. Reviewing the emails, it is obvious how they could be construed as SPAM (one sentence with a URL) however these are from regular correspondents, who are unlikely to be spoofed in a from address, so I searched out a way to whitelist them in IMF. Unfortunately, Microsoft has decided that spoofing is too easy, and the only means of whitelisting is by IP address. This doesn't really solve my problem, so I started looking in to other solutions. There seem to be a couple of options often mentioned, IMFcompanion and IMF Tune. IMF Companion is freeware, however it hasn't been developed since January 2007. Several reports in online forums says that it doesn't whitelist as well as it should. IMF Tune is a commercial application which realistically isn't that expensive, but is expensive enough that I could get Hosted Exchange accounts for less money. Vaguely frustrated by the experience, I decided I would have to write something. I had heard of SMTP event sinks, and started doing some reading. Most of the articles are of the "add a disclaimer" type, and nothing led me to believe that I could force IMF to bypass a message check based on a set of criteria. Quite a while ago, I had read about the FileSystemWatcher class in .NET. I researched it when reading about FolderShare. The way I have IMF configured, SPMA messages are archived, and can be delivered by plopping them in the pickup directory of the SMTP queue. I thought that a Windows service which watches for new messages, compares the From: line with a whitelist, and moves them from the UCEArchive directory to the pickup directory if they aren't SPAM should work fairly well. I hope to have something written soon, and will potentially release the source here. Thanks for C# Corner for their article on Creating Windows Services and Code Project for their hints on debugging a service. This kind of thing has been difficult on the MacBook. I really should create a Visual Studio VM, but for now I'm coding on my work laptop and via remote desktop to my XP desktop at home. It works ok, but isn't brilliant.
I'm in the middle of a porting/refactoring excersise of some old VB6 code to C# 2.0. In the VB code there are "types" and I had no idea of what the equivalent would be in C#. For example: Private Type foo Name As String
Value As Variant Used As Boolean
End Type
I searched and searched, and couldn't find it anywhere. Several different VB to C# comparison articles, a similar book, and nothing. I really didn't want to write a class for this simple data structure, so I started flipping through my C# book, and came on structs. How silly of me, this is exactly what I needed. struct foo
{
public string name;
public string value;
public bool used;
}
The really cool thing about structs is that you can have a function inside of a struct (but the struct is still a value referenced object.) struct propertyEntry
{
public string name;
public string value;
public bool used;
public string nameValue()
{
return name + value;
}
}
Cool stuff.
Cool. Dale Lane has posted a Pocket IE extension that allows you to add the current page you are viewing as a new bookmark in del.icio.us. He also posted the source.
I was just attempting to use sn.exe to create a strong name key pair, and ran into the error Access is Denied. D:\Documents\Work\Code>sn.exe -k foo.snk
Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved.
Failed to generate a strong name key pair -- Access is denied.
A bit of googling turned up a number of articles that point out that C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys isn't writable by Administrators, and it needs to be in order to use sn.exe to generate a keypair.
D:\Documents\Work\FML\Code\FML Addins 3>sn.exe -k FML.snk D:\Documents\Work\Code>sn.exe -k foo.snk
Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved.
Key pair written to foo.snk
Works now.
I got the SourceGear t-shirt I requested. It looks great. A couple of pics (yes, he's much cuter than me, even when trying to look like the Evil Mastermind.)
Check out this Jackson Fish Market post, which leads to Paul Senzee's account of Red 5 Studio's attempt to recruit him to be one of their new game developers. Now game development is a tough market, and having the best may mean the difference between black and really red (no pun intended), so I can understand why Red5 would go to this kind of effort to recruit talent. Its innovative and interesting. And can you imagine working for the company that came up with this? Working in the oil/technology industry has its own set of challenges when it comes to recruiting. We're not leading edge like Google. We're not flashy like a game company. And we don't make $10B a quarter like Exxon. Maybe I need to develop some interesting recruiting flair like this to find some really unique individuals. 8-) BTW, I want to work for a company who is named after a Star Wars persona.
SourceGear has released a free download of their new DiffMerge product. I downloaded and installed it yesterday, and I have to say its pretty nice, especially for the price. It will be interesting to see how it compares to Beyond Compare (which I thought was way more expensive than $30.) BTW, Eric, I feel for you man. My black lab Shiner is twelve years old, and I'm dreading the day he leaves us.
We (unfortunately) use SourceSafe as our revision control system in my group. I also use it on my laptop for personal revision control while I'm traveling (it beats keeping zip files of backed up code around.) Earlier this year we had a massive SS database crash, where I lost about a month of work. (Part of that was my fault, I wasn't doing any other backups, and I'd been bad about checking in...) Ever since then, I've been thinking about what we should do. Vault sounds really nice, but at $300 a pop, I'm not sure I can convince my management that its better than SS. Our development center in Calgary uses OmniWorks, which is a highly customized version of MKS Source Integrity. I've seen the VS plugin that it has, no thanks. And from what I've heard, getting anything done that isn't a code check-in/check-out (merging, branching, etc.) takes the blessing of some Unix gurus with long white beards, wearing flowing robes. Enter SVN. I've been reading quite a bit about this beast called Subversion. Cross platform. Secured remote access (SSH or SSL). A nifty Explorer extension. However, I really like the visual studio integration of Source Safe. For the kind of work we do, it works really well. So, great news, there's a Visual Studio provider for SVN called AnkhSVN. I just installed it and TortiseSVN on my machine. Unfortunately, AnkhSVN didn't seem to want to get along with SS. I fired up VS.NET. Opened the project of the thing I've been working on(still under SS revision control), and poof, VS.NET crashes. Considering I'm in the middle of a huge project, and my machine is due for a rebuild anyway, I'm going to hold off on any more experimenting.
After a year and a half writing C#, I'm back in VB6 making some major changes to a project. VB (and especially the IDE) is driving me nuts. Why the hell does it insist on popping up a message box when it finds a syntax error? Don't they know that I'm copying and pasting lines of code, and intend to go back and fix them later. I also keep forgetting my arrays are now 1 indexed. I'm really getting frustrated.
Mostly just a reminder for myself
MSDN link
FormsAuthentication
.HashPasswordForStoringInConfigFile
Method
Given a password and a string identifying the hash type, this routine
produces a hash password suitable for storing in a configuration file. [Visual Basic] Public Shared Function HashPasswordForStoringInConfigFile( ByVal password As String,
ByVal passwordFormat As String
) As String
[C#] public static string HashPasswordForStoringInConfigFile(
string password,
string passwordFormat
);
[C++] public: static String* HashPasswordForStoringInConfigFile(
String* password,
String* passwordFormat
);
[JScript] public static function HashPasswordForStoringInConfigFile( password : String,
passwordFormat : String
) : String;
Parameters
- password
- The password to hash.
- passwordFormat
- The hash algorithm to use. Choices are "sha1" or "md5".
Return Value
Returns a String containing a hashed password.
Remarks
Password algorithms supported are SHA1 and MD5.
Example[Visual Basic] <%@ Page Language="VB" autoeventwireup="true" %> <html> <head> <script runat="server"> Sub Cancel Click(sender as Object, e as EventArgs ) userName.Text = "" password.Text = "" repeatPassword.Text = "" result.Text = "" End Sub Sub HashPassword Click(sender as Object, e as EventArgs) If Page.IsValid Then Dim hashMethod As String If sha1.Checked Then hashMethod = "SHA1" Else hashMethod = "MD5" End If Dim hashedPassword As String hashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, hashMethod) result.Text = "<credentials passwordFormat='" + hashMethod + "'><br>" + " <user name='" + userName.Text + "' password='" + hashedPassword + "'><br>" + "</credentials>" Else result.Text = "There was an error on the page." End If End Sub </script> </head>
<body> <form runat="server"> <p>This form displays the results of the FormsAuthentication.HashPasswordForStoringInConfigFile method.<br>The user name and hashed password can be stored in a <credentials> node in the Web.config file.</p> <table> <tbody> <tr> <td>New User Name:</td> <td><asp:TextBox id="userName" runat="server"></asp:TextBox></td> <td><asp:RequiredFieldValidator id="userNameRequiredValidator" runat="server" ErrorMessage="User name required" ControlToValidate="userName"></asp:RequiredFieldValidator></td> </tr> <tr> <td>Password: </td> <td><asp:TextBox id="password" runat="server" TextMode="Password"></asp:TextBox></td> <td><asp:RequiredFieldValidator id="passwordRequiredValidator" runat="server" ErrorMessage="Password required" ControlToValidate="password"></asp:RequiredFieldValidator></td> </tr> <tr> <td>Repeat Password: </td> <td><asp:TextBox id="repeatPassword" runat="server" TextMode="Password"></asp:TextBox></td> <td><asp:CompareValidator id="passwordCompareValidator" runat="server" ErrorMessage="Password does not match" ControlToValidate="repeatPassword" ControlToCompare="password"></asp:CompareValidator></td> </tr> <tr> <td>Hash function: </td> <td align="middle"><asp:RadioButton id="sha1" runat="server" GroupName="HashType" Text="SHA1"></asp:RadioButton> <asp:RadioButton id="md5" runat="server" GroupName="HashType" Text="MD5"></asp:RadioButton></td> </tr> <tr> <td align="middle" colspan="2"> <asp:Button id="hashPassword" onclick="HashPassword Click" runat="server" Text="Hash Password"> </asp:Button> <asp:Button id="cancel" onclick="Cancel Click" runat="server" Text="Cancel" CausesValidation="false"> </asp:Button></td> </tr> </tbody> </table> <p><asp:Label id="result" runat="server"></asp:Label></p> </form> </body> </html>
[C#] <%@ Page Language="C#" autoeventwireup="true" %> <html> <head> <script runat="server"> void Cancel Click(object sender, EventArgs e) { userName.Text = ""; password.Text = ""; repeatPassword.Text = ""; result.Text = ""; } void HashPassword Click(object sender, EventArgs e) { if (Page.IsValid) { string hashMethod = ""; if (sha1.Checked) { hashMethod = "SHA1"; } else { hashMethod = "MD5"; } string hashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, hashMethod); result.Text="<credentials passwordFormat=\"" + hashMethod +"\"><br>" + " <user name=\"" + userName.Text + "\" password=\"" + hashedPassword + "\"><br>" + "</credentials>"; } else { result.Text = "There was an error on the page."; } } </script> </head>
<body> <form runat="server"> <p>This form displays the results of the FormsAuthentication.HashPasswordForStoringInConfigFile method.<br>The user name and hashed password can be stored in a <credentials> node in the Web.config file.</p> <table> <tbody> <tr> <td>New User Name:</td> <td><asp:TextBox id="userName" runat="server"></asp:TextBox></td> <td><asp:RequiredFieldValidator id="userNameRequiredValidator" runat="server" ErrorMessage="User name required" ControlToValidate="userName"></asp:RequiredFieldValidator></td> </tr> <tr> <td>Password: </td> <td><asp:TextBox id="password" runat="server" TextMode="Password"></asp:TextBox></td> <td><asp:RequiredFieldValidator id="passwordRequiredValidator" runat="server" ErrorMessage="Password required" ControlToValidate="password"></asp:RequiredFieldValidator></td> </tr> <tr> <td>Repeat Password: </td> <td><asp:TextBox id="repeatPassword" runat="server" TextMode="Password"></asp:TextBox></td> <td><asp:CompareValidator id="passwordCompareValidator" runat="server" ErrorMessage="Password does not match" ControlToValidate="repeatPassword" ControlToCompare="password"></asp:CompareValidator></td> </tr> <tr> <td>Hash function: </td> <td align="middle"><asp:RadioButton id="sha1" runat="server" GroupName="HashType" Text="SHA1"></asp:RadioButton> <asp:RadioButton id="md5" runat="server" GroupName="HashType" Text="MD5"></asp:RadioButton></td> </tr> <tr> <td align="middle" colspan="2"> <asp:Button id="hashPassword" onclick="HashPassword Click" runat="server" Text="Hash Password"> </asp:Button> <asp:Button id="cancel" onclick="Cancel Click" runat="server" Text="Cancel" CausesValidation="false"> </asp:Button></td> </tr> </tbody> </table> <p><asp:Label id="result" runat="server"></asp:Label></p> </form> </body> </html>
--
Did this work ok?
Too bad w.bloggar doesn't support uploading images via anything besides FTP.
Those two wireless USB security devices that I ordered, still haven't arrived. They show the item as backordered.
|
Copyright © 2009 Rick Lobrecht. All rights reserved.
|
|
|
Powered by newtelligence dasBlog 1.9.7174.0 |
|