Read more: How Secure Is My Password?
How Secure Is My Password?
Trendistic
This way, it shows how the frequency of one, two, three and four-word phrases fluctuate over time. The result is a visualization of what is popular and what is not among Twitter users, and how certain events are reflected or even predicted by the microblogosphere.
You can enter a phrase (topic) in the Trendistic search box to see how its frequency varies over time, or several different topics separated by commas to see how they relate (each topic will show in the chart with a specific color): try comparing 'dinner' and 'breakfast' or 'morning' and 'night' for instance, to see how powerful it can be.
Read more: Trendistic.com
Valve Releases Updated Alien Swarm For Free With Code Base

baronvoncarson tips news that today Valve released an updated version of Alien Swarm, a popular Unreal Tournament 2004 total conversion mod. The creators of the mod were hired by Valve, and they've helped turn it into a stand-alone game running on the Source engine. Valve is also releasing the code base for Alien Swarm and an SDK. The game is available for free on Steam
Is Open Source SNORT Dead?
Read more: Slashdot
Cache On Delivery — Memcached Opens an Accidental Security Hole
"If you already know what memcached is, skim to slide #17. The jaw-drop will happen around slide #33. Turns out many websites expose their totally-non-protected memcached interface to the Internet, including gowalla, bit.ly, and PBS."
Read more: Slashdot
Flash / Frash Ported to iPhone 4 !! [Video]
Read more: Redmond Pie
Rubik's Cube Now Solvable in 20 Moves
Read more: Slashdot
Extreme Memory Oversubscription For VMs
Read more: Slashdot
Debugging WCF Clients and Services
In the past, I have debugged services by firing up the client application and manually attaching to the WCF Service Host – which in this case is the ASP.NET worker process. This process is quite cumbersome.
Visual Studio has feature that supports attaching to multiple projects when starting up.
In this example, I have a WCF service hosted in IIS which lives in the Wcf.Demo.IisServiceHost project. I also have a Wcf.Demo.TestHarness project which calls the service. I want to be able to attach the debugger to both the client and service by simply pressing F5.
Steps
1. Right click on the solution and select “Set StartUp Projects…“.
2. In the StartUp tab, select “Multiple startup projects” and select the projects you want to start up.

3. On the Action of the selected projects, select “Start” to start with the debugger attached.
If you now run (F5) the application, it will fire up both the Test Harness and a Internet browser to the service virtual directory. You can disable this.
4. Go to the Web project properties for the WCF web project and select “Don’t open a page“.
Now when you hit F5, the test harness will launch and the debugger will be attached to both processes.
Read more: Dave Jansen’s Blog
Silverlight Tutorilals
Please don't forget to provide your comments or suggestions.
In this chapter of the tutorial, you will learn about the very basic information on Silverlight i.e. what is Silverlight, what is the System Requirements for installing Silverlight and the pre-requisite to create a Silverlight application. After reading this chapter you will come to know about XAML, XAP file, Application XAML and how to host a Silverlight application.
Read more: Kunal's Blog
TSQL Challenge 36 - Create a graph/Chart with TSQL
Seq Data
----------- -----------
1 2
2 3
3 4
4 4
5 5
6 4
7 3
8 4
9 4
10 4
11 3
12 2
13 2
14 3
15 3
16 4
17 4
18 5
Here is how your graph should look like.
5|
4| _/\ __ _/
3| / \/ \ _/
2|/ \_/
1|
0|
Getting the Silverlight Toolkit Controls to work on WP7
However if you simply take the binaries from the source on codeplex and try to use them with say the expander control you are going to get runtime errors. The errors revolve around the GlobalCalendar, but they are very easy to fix (assuming you do not need the global calendar control).
What I did was open up the Silverlight.Controls.Toolkit.sln file (I happened to upgrade my sln to VS2010 but that is not needed) and do the following
Exclude the GlobalCalendar folder from Controls.Toolkilt
Open up the Themes/generic.xml file and comment out the various GlobalCalendar items (items under toolkit:GlobalCalendar) such as
<Style TargetType="toolkit:GlobalCalendar">
<Style TargetType="toolkitPrimitives:GlobalCalendarButton">
<Style TargetType="toolkitPrimitives:GlobalCalendarDayButton">
<Style TargetType="toolkitPrimitives:GlobalCalendarItem">
One you have these items removed simply recompile the source and use the new binaries which are generated.
Now of course this is the easy way out I could have spent the time needed to actually resolve the root cause, but I did not need the GlobalCalendar control at this point so I ‘hit the easy button’. I am sure that someone else out there can resolve this w/out the need to remove items.
Read more: devlicio.us
When does an object become available for garbage collection?
class SomeClass {
...
string SomeMethod(string s, bool reformulate)
{
OtherClass o = new OtherClass(s);
string result = Frob(o);
if (reformulate) Reformulate();
return result;
}
}
For the purpose of this discussion, assume that the Frob method does not retain a reference to the object o passed as a parameter. When does the OtherClass object o become eligible for collection? A naïve answer would be that it becomes eligible for collection at the closing-brace of the SomeMethod method, since that's when the last reference (in the variable o) goes out of scope.
A less naïve answer would be that it become eligible for collection after the return value from Frob is stored to the local variable result, because that's the last line of code which uses the variable o.
Read more: The old new thing
Everybody thinks about CLR objects the wrong way (well not everybody)
"Any local variable that is IDisposable should dispose itself when it goes out of scope."
"You should be able to attach an attribute to a class that says the destructor should be called immediately after leaving scope."
"It should have promised to call finalizers on scope exit."
What these people fail to recognize is that they are dealing with object references, not objects. (I'm restricting the discussion to reference types, naturally.) In C++, you can put an object in a local variable. In the CLR, you can only put an object reference in a local variable.
For those who think in terms of C++, imagine if it were impossible to declare instances of C++ classes as local variables on the stack. Instead, you had to declare a local variable that was a pointer to your C++ class, and put the object in the pointer.
C# | C++ |
---|---|
void Function(OtherClass o) { // No longer possible to declare objects // with automatic storage duration Color c(0,0,0); Brush b(c); o.SetBackground(b); } | |
void Function(OtherClass o) { Color c = new Color(0,0,0); Brush b = new Brush(c); o.SetBackground(b); } | void Function(OtherClass* o) { Color* c = new Color(0,0,0); Brush* b = new Brush(c); o->SetBackground(b); } |
This world where you can only use pointers to refer to objects is the world of the CLR.
Read more: The old new thing
NET Debugging and C++ Debugging Resources
[Shameless plug: If you haven’t taken these courses yet, I strongly suggest that you check them out. Between the two of them they have more than 20 hands-on debugging exercises which basically guarantee that you’re going to come out a WinDbg expert and be able to analyze dumps, solve problems in production, pinpoint memory leaks, and so on.]
First of all, the tools you are going to need. This is also a list of what I ask system administrators to install when giving these courses in a disconnected environment:
- Windows XP SP2 or later + symbols
- Visual Studio 2008 or Visual Studio 2010
- Visual C++ 2010 Redistributable (x86) + symbols
- .NET Framework 3.5 SP1 + symbols
- .NET Framework 4.0 + symbols
- Debugging Tools for Windows 32-bit
- Windows Support Tools
- Windows Resource Kit Tools
- Sysinternals Suite
- CLR Profiler 2.0
- Application Compatibility Toolkit 5.6
- Application Verifier 32-bit
- .NET Reflector
- SOSEX Debugging Extension
Now the resources you might find handy. I organized these by exercise, so that for each exercise there is at least one reference you might find useful:
- Setting up symbols
- Configuring symbols in a connected environment (KB)
- Obtaining Windows symbol packages
- How to verify symbols with symchk
Are Private Members Inherited?
public class Person
{
private string message;
public override string ToString()
{
return message;
}
public static Person CreateEmployee()
{
return new Employee();
}
class Employee : Person
{
public Employee()
{
this.message = "I inherit private members!";
}
}
}
Run this within a Console application, and it will print the message on the screen: “I inherit private members!”
class Program
{
static void Main()
{
Console.WriteLine(Person.CreateEmployee());
}
}
Proof positive that private members are actually inherited. Remember, modifiers such as public, protected, private, and internal are all accessibility modifiers. These modifiers affect encapsulation rather than inheritance.
Read more: KodefuGuru
August 2010 Security Release ISO Image
Read more: MS Download
Building your First End to End StreamInsight Application (Going Deep on Adapters)

Input adapters. Input adapters provide the interface for collecting data from a variety of sources (web services, databases, data feeds, sensors). A StreamInsight input adapter is a set of .NET classes implementing a set of interfaces.
They can be typed or untyped. Typed adapters have a fixed (or known at compile time) input data type, whereas untyped adapters infer their type at runtime based on configuration information. For example, a SQL Server input adapter would infer a data type based on a SELECT statement, stored procedure, etc, given to it at runtime.
Queries. Standing queries define the questions being asked of the data streaming through. Queries can be chained together, with a complete end to end query consisting of a set of input adapters, series of queries, and a set of output adapters.
Queries are defined in StreamInsight’s flavour of LINQ (lots more later).
Output adapters. Output adapters provide the interface for delivering query results to external systems and applications. Output adapters are the mirror image of input adapters (i.e. can be typed or untyped, etc).
Host. StreamInsight supports a variety of deployment models to best suit the needs of your application or deployment. The API (i.e. all of the StreamInsight code) can target an in-process “embedded” StreamInsight server, or a remote server (typically hosted in a Windows Service, such as the StreamInsightHost.exe that ships with StreamInsight).
Read more: StreamInsight Factotum
Understanding Commands: Arguments and Switches
Menu: View -> Other Windows -> Command Window
Command: View.CommandWindow
Versions: 2008,2010
Published: 8/10//2010
Code: vstipTool0069
Folks I want to get your input on the possible title for the new book. Give me your comments at http://blogs.msdn.com/b/zainnab/archive/2010/08/09/proposed-book-title.aspx
Some commands take arguments and switches so you can quickly execute them without having to deal with UI elements. You can get a list of commands that take arguments by going to the MSDN Documentation article entitled "Visual Studio Commands with Arguments" (http://msdn.microsoft.com/en-us/library/c338aexd.aspx). The best way to learn is by doing a sample so let's use the Edit.Find command. If you want to know more about what Find can do then check out vstipFind0007.
Basic Use
First, open up the Command window (CTRL + ALT + A) and run the command without any arguments:
Debugging a Bugcheck 0x109
In 64-bit versions of the Windows kernel PatchGuard is present. If any driver or application attempts to modify the kernel the PatchGuard will generate the bugcheck (CRITICAL_STRUCTURE_CORRUPTION) mentioned below. PatchGuard protects the kernel from modification by malicious or badly written drivers or software.
To further investigate this bugcheck you need to compare the impacted kernel function with a known reliable one. For instance, if the machine encountering this was running Windows Server 2008 service pack 2 with a post SP2 hotfix kernel you need to compare the impacted kernel function with that of service pack 2 kernel function. Usually you do not need to download and extract the post SP2 hotfix, because the vast majority of the kernel code has not been modified since the service pack.
If you already have service pack 2 for Windows Server 2008 handy, expand the package using instructions included in KB928636:
Windows6.0-KB948465-X64.exe /x
expand.exe -f:* C:\WS08\SP2\windows6.0-kb948465-X64.cab C:\WS08\SP2\Expanded
Locate the kernel binary from the expanded binaries and then open it up with your debugger just like you open a crash memory dump.
windbg -z C:\WS08\SP2\Expanded\amd64_microsoft-windows-os-kernel_31bf3856ad364e35_6.0.6002.18005_none_ca3a763069a24eea\ntoskrnl.exe
This is the bugcheck data from the dump:
CRITICAL_STRUCTURE_CORRUPTION (109)
This bugcheck is generated when the kernel detects that critical kernel code or
data have been corrupted. There are generally three causes for a corruption:
1) A driver has inadvertently or deliberately modified critical kernel code
or data. See http://www.microsoft.com/whdc/driver/kernel/64bitPatching.mspx
2) A developer attempted to set a normal kernel breakpoint using a kernel
debugger that was not attached when the system was booted. Normal breakpoints,
"bp", can only be set if the debugger is attached at boot time. Hardware
breakpoints, "ba", can be set at any time.
3) A hardware corruption occurred, e.g. failing RAM holding kernel code or data.
Arguments:
Arg1: a3a039d89b456543, Reserved
Arg2: b3b7465eedc23277, Reserved
Arg3: fffff80001778470, Failure type dependent information
Arg4: 0000000000000001, Type of corrupted region, can be
0 : A generic data region
1 : Modification of a function or .pdata
2 : A processor IDT
3 : A processor GDT
4 : Type 1 process list corruption
5 : Type 2 process list corruption
6 : Debug routine modification
7 : Critical MSR modification
Next, check the address at Arg3. This will give you the function that was modified, but not the offset of the modified instruction.
Read more: NTDebugging
The Anatomy of a WPF Application
There a lot of advanced articles on WPF and their desktop applications reflect a lot of experience. But sometimes the learning curve can be steep, as may be a large gap between those at the advanced level and those at the beginning level. This article is an attempt to step through the building process. In any form of programming, the best way to learn how to program is to read well-written programs. This paper will dive into a seemingly complicated WPF application. The XAML code will appear long-winded and the code-behind relatively simple. So we'll start by using either Expression Blend or visual Studio 2008 (or 2010) to make and develop this application. Once we are finished, we will examine how it works, and more importantly, why it works. So we begin by starting a new C# WPF application, and call it the default, WPFApp4. We then modify the code in MainWindow.xaml:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="WpfApp4.MainWindow"
Title="Color Spinner" Height="370" Width="270"><Window.Resources>
<Storyboard x:Key="Spin">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="ellipse1"
Storyboard.TargetProperty= "(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"
RepeatBehavior="Forever">
<SplineDoubleKeyFrame KeyTime="00:00:10" Value="360"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="ellipse2"Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"RepeatBehavior="Forever">
<SplineDoubleKeyFrame KeyTime="00:00:10" Value="-360"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="ellipse3"Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"RepeatBehavior="Forever">
<SplineDoubleKeyFrame KeyTime="00:00:05" Value="360"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="ellipse4"Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"RepeatBehavior="Forever">
<SplineDoubleKeyFrame KeyTime="00:00:05" Value="-360"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
....<Storyboard x:Key="ellipse1"/>
The <Window> element is used, unsurprisingly, to define a window. An application might consist of several windows, each of which would be contained in a separate XAML file. This isn’t to say that a XAML file always defines a window, though; XAML files can contain user controls, brushes and other resources, Web pages, and more. There is even a XAML file in the WpfApp4 project that defines the application itself — App.xaml. .Back to MainWindow.xaml, notice that the <Window> element contains some fairly self-explanatory attributes. There are two namespace declarations, one for the global namespace to be used for the XML and one for the x namespace. Both of these are essential for WPF functionality and define the vocabulary for the XAML syntax. Next is a Class attribute, taken from the x namespace. This attribute links the XAML<Window> element to a partial class definition in the code behind, in this case WpfApp4.Window.
Read more: Codeproject
log4net tutorial pt 1: getting started
This post is the first in a series aimed at making you comfortable and confident in using log4net as an application logging layer in your .NET applications. Seriously, it'll make your life a lot easier.
About log4net
My logging layer of choice for .NET is log4net from the Apache Software Foundation. It's open source, well-documented, extensible, and comes ripe with features right off the vine. There are alternative logging platforms available if open source isn't an option for you, such as the Microsoft Logging Application Block or, if you're willing to fork out some cash, LucidLog.Net; I can't comment on them directly as I have no experience with either - I've heard good things, but I've also heard that log4net is more feature-rich that both of these.
Note: This series of posts references log4net version 1.2.10.
Getting log4net
log4net is available here as a zip archive.
The archive contains a ton of stuff; for posterity, here are some hilites of what you'll find in there:
\bin houses the log4net binaries. The distribution contains versions of log4net built for specific platforms of .NET, including Microsoft .NET, Mono, Rotor, and the Compact Framework.
\doc contains the log4net documentation. Open index.html to start your perusing.
\examples contains several small, digestible sample logging applications in various languages and platforms.
Read more: beefycode.com
Creating a Silverlight Application that uses navigation framework and Viewbox control
The objective of this article is to present the Viewbox control. I have also explained here the navigation framework of Silverlight 3.
Viewbox Control:
This control is a content decorator.
It can resize its content based on its own size.
It takes one child element.
The most important property of Viewbox control is the Stretch property. It can take four values:
Fill: When the Stretch property of the Viewbox control is set to Fill, the content of the Viewbox takes up the entire height & width of the Viewbox.
Uniform: When the Stretch property of the Viewbox control is set to Uniform, the Viewbox scales up/down or moves left/right its content without distorting them or changing their height/width ratio.
UniformToFill: When the Stretch property of the Viewbox control is set to UniformToFill, the content of the Viewbox fills the entire Viewbox, but at the same time the height/width ratio of the content remains same.
None: When the Stretch property of the Viewbox control is set to None, it just clips to the original content without resizing it.
Another important property of the Viewbox is StretchDirection. It can take three values.
UpOnly: When the StretchDirection property of the viewbox is set to UpOnly, the viewbox can only enlarge its content.
DownOnly: When the StretchDirection property of the viewbox is set to DownOnly, the viewbox can only shrink its content.
Both: When the StretchDirection property of the viewbox is set to Both, the viewbox can both enlarge and shrink its content.
Navigation Framework:
Using navigation framework, we can navigate between different xaml pages by clicking even the browser's Back & Forward button, if there is browser history associated with that.
Now I am creating a sample to explain the above mentioned points.
Step 1:
Create a new Silverlight application.
Read more: C# Corner
Case Study - How Last.fm Uses HornetQ for Their Streaming Infrastructure
What Is Last.fm?
Last.fm is an online music service that tracks the music people listen to and generates recommendations and custom online radio stations based on this information. It allows user to track the song they listen to (by scrobbling the song) from Internet radio station, music player or portable devices. The scrobbles are transferred to Last.fm and displayed on the user’s profile page. Every track that is scrobbled by user plays will tell Last.fm something about what he or she likes. It can connect the user to other people who like the same song, artist, genre, etc. and recommend other songs from their music collections.
More than 40 million of unique users visit Last.fm each month and view 500 million pages.
Since the launch of the service, there has been more than 40 billion of scrobbles. Nowadays, there is 40 million of scrobbles a day (up to 800 per second at peak).
Last.fm infrastructure is using JMS, the Java standard for message service, to control its streaming service.
Last.fm recently migrated to HornetQ to improve its messaging service and ensure that it meets the quality of service expected by their users.
What Is HornetQ?
HornetQ is a community project from JBoss, the middleware division of Red Hat. HornetQ is the default messaging service for JBoss Application Server 6 and it can also be used as a standalone JMS server or embedded in any Java application. HornetQ is an Open Source (Apache-licensed) project to build a multi-protocol, embeddable, clustered messaging system with very high performance and availability.
Having some issues with their current messaging server, Last.fm was interested to integrate HornetQ in their infrastructure to improve performance and availability while keeping hardware resources under control.
Last.fm Infrastructure
Last.fm backends are written in both C++ and Java, the latter being used for its streaming infrastructure. The Java streaming backends are composed of a web application deployed on Tomcat (the streamer manager) and standalone Java applications (the streamers).
The streamers are designed to be simple with as few dependencies as possible, requiring no containers at all. Architecturally, they are independent of the rest of Last.fm infrastructure. They use JMS to communicate within themselves and with the other parts of the infrastructure in a loosely-coupled fashion.
For its streaming infrastructure, Last.fm uses JMS in three different use cases.
Streamer Control
streamer control messages are used when the streamers are upgraded. The streamers send control messages on the /queue/ControlQueueJMS queue when they are started up or shut down. The streamer manager will consume these messages and starts or stops sending traffic to the streamers accordingly.
This generates a low volume of messages (few messages a month).
Read more: Javalobby
Everybody thinks about garbage collection the wrong way
When you ask somebody what garbage collection is, the answer you get is probably going to be something along the lines of "Garbage collection is when the operating environment automatically reclaims memory that is no longer being used by the program. It does this by tracing memory starting from roots to identify which objects are accessible."
This description confuses the mechanism with the goal. It's like saying the job of a firefighter is "driving a red truck and spraying water." That's a description of what a firefighter does, but it misses the point of the job (namely, putting out fires and, more generally, fire safety).
Garbage collection is simulating a computer with an infinite amount of memory. The rest is mechanism. And naturally, the mechanism is "reclaiming memory that the program wouldn't notice went missing." It's one giant application of the as-if rule.¹
Now, with this view of the true definition of garbage collection, one result immediately follows:
If the amount of RAM available to the runtime is greater than the amount of memory required by a program, then a memory manager which employs the null garbage collector (which never collects anything) is a valid memory manager.
This is true because the memory manager can just allocate more RAM whenever the program needs it, and by assumption, this allocation will always succeed. A computer with more RAM than the memory requirements of a program has effectively infinite RAM, and therefore no simulation is needed.
Sure, the statement may be obvious, but it's also useful, because the null garbage collector is both very easy to analyze yet very different from garbage collectors you're more accustomed to seeing. You can therefore use it to produce results like this:
A correctly-written program cannot assume that finalizers will ever run at any point prior to program termination.
Read more: The old new thing
Browsing Android 2.2 (Froyo) Source code in Eclipse
Android is huge in scale becoming automatically poor in documentation. It’s getting better and better everyday but so far I’ve needed to pop the hood for a more thorough look every now and then.
You could always browse the source tree online but it isn’t just as effective and me being the possessive freak I am couldn’t let it go. So here is what I did to be able to browse from eclipse, you don’t have to go through with all of this a link to the resultant jar file is at the end of the post:
- Went to http://android.git.kernel.org/
- Followed the instructions to install git and repo
- Started with the base package (Framework classes) – added more as I went along but I only started with the base.git and you’ll probably only need this.
- Zipped the sources (only the java files) !!
Read more: Big Blue Brains
Using relative addresses for services in Silverlight applications
There are some interesting ideas to overcome this problem. Tim Heuer posted about an approach with "production" versus "staging" endpoints in config at http://timheuer.com/blog/archive/2010/04/05/managing-service-references-in-silverlight-applications-for-different-environments.aspx. This is great, but I was looking for something simpler, where one wouldn't need to change the generated config file. On Silverlight 4, there's a new feature where you can have a relative address on the client address in config (http://blogs.msdn.com/b/silverlightws/archive/2010/04/05/dynamically-updating-proxy-address-for-staging-production.aspx), but again, that involved changing the generated config file.
What I had been using (since Silverlight 2) has worked just fine for me, so I decided to post the solution here. The idea is that, in code, one helper function would take the actual page address (which, for the scenarios where you ASR to a service in the web project, is in the same domain where the .svc file will be), and based on that it will update the address of the client endpoint. The code is shown below (and a full project can be found here.
Read more: Carlos' blog
Securing MySQL in 10 minutes
Listen Only Where You Want to Hear
Just like memcache, the default mysql install is listening patiently on all your server's ethernet devices for someone to connect. So, just like memcache, we need to tell mysql to only listen on the ethernet device we care about. For your average single-server web host, you only need to listen to your local host.
Find your my.conf file. On servers I manage, this is either at
/etc/my.conf
or
/etc/mysql/my.conf
This configuration file will contain all kinds of goodies about performance tuning your mysql server, connection details for your mysql client, etc. you want to find the section with the heading
[mysqld]
and add this line:
bind-address = 127.0.0.1
If you are in some kind of multi-machine environment, you'll want to set that to whatever your private IP address is - under no circumstances should this be an ip address the general public can reach.
Secure Your Root Password
When you first start mysql on a new install, it prints out a message that says something like "Don't forget to set a root password!", and gives you a couple of command-line examples. But guess what? A lot of people never get around to setting these (and I have been as guilty of that as anyone).
Read more: CodeSherpas
Programmatically Invoke the C# Compiler
Let’s imagine we used an Xslt transformation to generate some code:
XslCompiledTransform transform = new XslCompiledTransform();
transform.Load("Program.xslt");
transform.Transform("Program.xml", "Program.cs");
Using the CSharpCodeProvider class we can now programmatically call the C# compiler to generate the executable assembly. We’ll begin by advising the compiler of some options we’d like it to use when compiling our code using the CompilerParameters class.
CompilerParameters parameters = new CompilerParameters();
We’ll specify that the assembly to be created should be an executable and we’ll also specify such things as whether debug information should be included, the warning level, whether warnings should be treated as errors etc.
parameters.GenerateExecutable = true;
parameters.IncludeDebugInformation = true;
parameters.GenerateInMemory = false;
parameters.TreatWarningsAsErrors = true;
parameters.WarningLevel = 3;
parameters.CompilerOptions = "/optimize";
parameters.OutputAssembly = "Program.exe";
Read more: Doug Holland - An Architects Perspective
Google and Yahoo Add to Calendar Html Helpers for Asp.net MVC
If you want to play around with these parameters I recommend using google’s tools to create a button for google calendar and following the guide on this site for yahoo.
I’ve gone ahead and wrapped them up into some Html helpers for Asp.Net MVC. I didn’t go overboard with the options here so if you will probably want to tweak the code a bit.
Read more: lukencode
Garbage Collection Algorithm with the use of WeakReference
Garbage Collection Algorithm
In .NET, every object is allocated using Managed Heap. We call it managed as every object that is allocated within the .NET environment is in explicit observation of GC. When we start an application, it creates its own address space where the memory used by the application would be stored. The runtime maintains a pointer which points to the base object of the heap. Now as the objects are created, the runtime first checks whether the object can be created within the reserved space, if it can it creates the object and returns the pointer to the location, so that the application can maintain a Strong Reference to the object. I have specifically used the term Strong Reference for the object which is reachable from the application. Eventually the pointer shifts to the next base address space.
Read more: DOT NET TRICKS
VirtualBox 3.2 Update
3.2.8 allows users to attach a single disk to several VMs without needing any additional tools and features. There are also shared folder improvements for Solaris guests. The Solaris Installer also now supports remote installations.
The stability fixes in VirtualBox 3.2.8 are plentiful. In today's release, a VM will properly terminate when PAE mode has been disabled and the guest tries to switch to that mode. Several GUI and 3D support fixes are included. The ZENworks PXE boot regression has also been fixed.
Read more: Javalobby
Windows Identity Foundation (WIF) By Example Part I – How To Get Started.
This post quickly goes through preparing the development environment for using Windows Identity Foundation (WIF) and it walks through creating basic simple Claims-Aware web site.
Summary of steps:
Step 1 – Prepare Development Environment
Step 2 – Configure IIS7 to use SSL
Step 3 – Create Claims-Enabled Web Site
Step 4 - Add local STS (Security Token Service)
Step 5 – Configure IIS to load User Profile
Step 6 – Test Your Work
Rest of the post is detailed explanation for each step followed by the resources in the end.
Step 1 – Prepare Development Environment
Have VS2010 installed.
Use Web Platform Installer available here to configure your dev machine. Tick all options on for Web Server and for Frameworks and Runtimes unless it completely sounds off like CGI.
Read more: Alik Levin's
Silverlight Exception: SaveFileDialog Dialogs must user-initiated
private SaveFileDialog dialog = new SaveFileDialog();
private string StringData = "";
try
{
dialog.DefaultExt = ".txt";
dialog.Filter = "Text Files|*.txt|All Files|*.*";
dialog.FilterIndex = 1;
}
catch (Exception ex)
{
tblError.Text = "Error SaveFileDialog: " + ex.Message;
}
void MOSS_WS_GetDataCompleted(object sender,
WebServiceReference.GetDataCompletedEventArgs e)
{
string data = StringData;
if (this.dialog.ShowDialog() == true)
{
using (System.IO.Stream stream = dialog.OpenFile())
{
using (System.IO.StreamWriter writer =
new System.IO.StreamWriter(stream))
{
writer.Write(data);
writer.Close();
}
stream.Close();
}
}
}
Read more: Dudi Nissan's Blog
winAUTOPWN – Windows Autohacking Tool
Also not forgetting that winAUTOPWN unlike other frameworks maintains the original exploit writer’s source code intact just as it was and uses it. This way the exploit writer’s credit and originality is maintained. The source is modified only when required to enable a missing feature or to remove hard-coded limitations. Under these circumstances also, the exploit writers credits remain intact.
Newer exploit modules are added as and when they release and older ones are also being daily added.
Binaries of perl, php, python and cygwin DLLs (included) are required to exist either in a common folder or should be properly installed with their paths registered for those exploits which are cannot be compiled into a PE-exe.
Features :
Contains already custom-compiled executables of famous and effective exploits alongwith a few original modified exploits.
No need to debug, script or compile the source codes.
Scans all ports 1 – 65535 after taking the IP address and tries all possible exploits according to the list of discovered open ports (OpenPorts.TXT)
PortScan is multi-threaded.
Read more: Darknet.org.uk
Resource Files and ASP.NET MVC Projects
Resx Files In App_GlobalResources
Using resource files in App_GlobalResources from your controller code will break your unit tests.
When you drop a .resx file in the special App_GlobalResources folder, the IDE uses the GlobalResourceProxyGenerator to generate a strongly typed internal class to wrap the resources inside. The internal class gives any code in the MVC project access to the resources:
var greeting = Resources.Strings.Greeting;
You can also use the resources from a view:
<%= Html.Encode(Resources.Strings.Greeting) %>
The problem is that global resources are not actually embedded into the project’s .dll. Instead it is the ASP.NET runtime that creates an App_GlobalResources assembly with the resources inside. This assembly is referenced by all the view assemblies ASP.NET creates, and is explicitly loaded by the strongly typed wrapper generated by the GlobalResourceProxyGenerator. Since the App_GlobalResources assembly doesn’t exist without an ASP.NET compilation phase, it’s not available when unit tests are running. Controller code under test that tries to access the resources will bomb with an exception.
Note that you’ll also have some Intellisense problems when using the view syntax shown above. I'm guessing this is because the IDE is confused by seeing the resource wrapper in two places (the project assembly, and a wrapper also goes into the App_GlobalResource created by ASP.NET in the Temporary ASP.NET Files folder. ).
There is a way to make resx files in App_GlobalResources work, but the folder isn’t truly necessary in an MVC project (or a web application project, for that matter). I think it’s just as easy to add resx files in a different location, even a separate class library, to avoid any confusion on how App_GlobalResources will behave.
In short: avoid App_GlobalResources and App_LocalResources (which has its own set of problems) in MVC.
Resx Files Outside Of Special Resource Directories
If you add a resx file to any other folder in an MVC project or class library, the resx is automatically set to be embedded into the project’s output assembly - this is good. The IDE also assigns the resx a custom tool of ResxCodeFileGenerator to generate a strongly typed wrapper - this is good. The generated class is internal by default – this is bad. The assembly created for a view (by ASP.NET) won’t be able to use the internal class because it is in a different assembly – the project assembly compiled in Visual Studio.
Solution
The easy fix is to make sure the custom tool is set to PublicResXFileCodeGenerator instead of ResXCodeFileGenerator. You can do this in the property window for the file, or in the resource editor that gives you a drop down for “Access Modifer” (the options are Internal, Public, and No Code Generation – choose Public).
Read more: Ode to code
Silverlight Navigation Part 2
This episode is jam packed with a ton of great navigation strategies and tips that you won't want to miss.
Read more: JohnPapa.net
Different culture settings between IIS and ASP.NET’s Development Server
This was a few years ago, and took some time to solve, and I though I had the unfortunate luck of being the owner of a weird installation of Windows 2003 server, but in the last 24 hours I’ve encountered three different computers that had a similar problem, where some of them decided that IIS should run on an English culture (en-US) and some on a French culture (fr-CH).
First of all, the reason IIS runs on a different culture than the ASP.NET’s development server is that the ASP.NET’s development server runs under the account of the user that is currently logged in, while IIS’s application pools runs under a different account:
For Windows XP with IIS 5.1, the user is ASPNET (a local account created by the .NET Framework)
For Windows 2003 and on (Vista, 7, 2008 server) with IIS 6 or 7.X, the user is Network Service (unless specified otherwise in the application pool configuration).
The reason why the Network Service account uses a different culture can usually be traced back to the installation of the operating system. The culture of newly created accounts is decided according to the regional settings of the default user, and the Network Service account is set when the operating system is installed. So if you install your windows with the English - United States settings which is usually the default culture, the account will use the en-US culture. In my case, someone probably missed the Hebrew option and selected Greek by mistake.
To fix this problem, you’ll need to change the regional settings of these special accounts (network service, local service, aspnet etc…). Fixing this depends on your operating system:
For Windows Vista and on (7, 2008 server) this is quite easy, just follow the steps specified in the following link.
For Windows 2003 and XP, you’ll need to edit the registry manually:
Open the registry, and export the “CURRENT_USER\Control Panel\International” branch. This branch contains the regional settings of the current user.
Under the HKEY_USERS hive, for each SID (security identifier) and for the .DEFAULT user perform the following steps:
Edit the exported registry file and set the path of the two sections to the account you want to fix. For example, to fix the network service account, change the “HKEY_CURRENT_USER\Control Panel\International” branch to “HKEY_USERS\S-1-5-20\Control Panel\International”.
Double-click the reg file to import it to the registry.
Return to the registry editor and check that the International branch was updated successfully for the account.
If you want to see which SID belongs to which builtin account, you can look at the following list.
Read more: Ido Flatow
Model-View-ViewModel (MVVM) Explained
The purpose of this post is to provide an introduction to the Model-View-ViewModel (MVVM) pattern. While I've participated in lots of discussions online about MVVM, it occurred to me that beginners who are learning the pattern have very little to go on and a lot of conflicting resources to wade through in order to try to implement it in their own code. I am not trying to introduce dogma but wanted to pull together key concepts in a single post to make it easy and straightforward to understand the value of the pattern and how it can be implemented. MVVM is really far simpler than people make it out to be.
Background
Why should you, as a developer, even care about the Model-View-ViewModel pattern? There are a number of benefits this pattern brings to both WPF and Silverlight development. Before you go on, ask yourself:
Do you need to share a project with a designer, and have the flexibility for design work and development work to happen near-simultaneously?
Do you require thorough unit testing for your solutions?
Is it important for you to have reusable components, both within and across projects in your organization?
Would you like more flexibility to change your user interface without having to refactor other logic in the code base?
If you answered "yes" to any of these questions, these are just a few of the benefits that using the MVVM model can bring for your project.
I've been amazed at some conversations I've read online. Things like, "MVVM only makes sense for extremely complex UI" or "MVVM always adds a lot of overhead and is too much for smaller applications." The real kicker was, "MVVM doesn't scale." In my opinion, statements like this speak to knowledge and implementation of MVVM, not MVVM itself. In other words, if you think it takes hours to wire up MVVM, you're not doing it right. If your application isn't scaling, don't blame MVVM, blame how you are using MVVM. Binding 100,000 items to a list box can be just silly regardless of what pattern you are following.
So the quick disclaimer: this is MVVM as I know it, not MVVM as a universal truth. I encourage you to share your thoughts, experiences, feedback, and opinions using the comments. If you feel something is incorrect, let me know and I'll do my best to keep this post updated and current.
The Model
The model is what I like to refer to as the domain object. The model represents the actual data and/or information we are dealing with. An example of a model might be a contact (containing name, phone number, address, etc) or the characteristics of a live streaming publishing point.
The key to remember with the model is that it holds the information, but not behaviors or services that manipulate the information. It is not responsible for formatting text to look pretty on the screen, or fetching a list of items from a remote server (in fact, in that list, each item would most likely be a model of its own). Business logic is typically kept separate from the model, and encapsulated in other classes that act on the model. This is not always true: for example, some models may contain validation.
It is often a challenge to keep a model completely "clean." By this I mean a true representation of "the real world." For example, a contact record may contain a last modified date and the identity of the modifying user (auditing information), and a unique identifier (database or persistence information). The modified date has no real meaning for a contact in the real world but is a function of how the model is used, tracked, and persisted in the system.
Read more: Codeproject
How To Change Visual Studio Default Editor
There are two ways to do it:
The Ugly Way – Registry
Under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0 find the “Default Editors” key (create if doesn't exists). Create another Key with the name of the File extension (Example :cs) you want to allocate to a custom editor, inside that key create:
String Key called “Custom” with the name of the Custom Editor (You can choose..)
DWORD called “Type” with value of 2 (Default)
Read more: Shai Raiten
NHibernate Tooling Review: LLBLGen Pro 3.0

This is part of what looks to be long series of posts about tooling relating to NHibernate.
In this case, I want to talk about LLBLGen Pro.
LLBLGen Pro 3.0 is an OR/M tool that also comes with an NHibernate option. Because it is the GUI tool to manage NHibernate mapping that I am testing, I am going to show a lot of screenshots. Also, please note that I am using this without any foreknowledge, reading the docs, or anything. I am also not going to do an in depth discussion, just use it to see how those things are working.
Read more: Ayende @ Rahien
WCF Service @ High Speed
Client side Service Caching
Dynamic binding of Service
Object caching
Service instance management
Easy mapping Business objects in XML
There is nothing new in this article other than I a using c# list objects to cache services and objects from service. This includes an XML file which I believe easy to map objects and its types to create Objects at run time using factory pattern.
The UML high level design picture shows well about all explained in this article. I am sure we can do some more optimization in this project, but for time being i just want to present few areas where we can improve performance of Service Communication.
What is the main time consuming process in WCF Service call?
One of the main time consuming process in any service call or any call to the outside application boundary is initiating and opening the connection across the channel, that is what we say connection pooling. In WCF service call we can easily achieve with caching service channels at client side. This article gives you with channel caching and object caching to improve speed.
Read more: Codeproject
IIS7 error 400.17, or 400.3
After installing new machine (Windows server 2008 32 bit), VS 2008, BizTalk 2009, etc', we tried to run some WCF service (which works on other machine), and got this very error: 400.17.
First time I saw this error a year+ ago, and forgot about it. Now, scratching my head, started googling, and (at least I do admit) forgot how to solve the error.
But! When started reproduce all installation actions of a new machine for our team-work, I asked:
-Did you run some magic code?
- What code?
- Yeah, the one with reg-something, don't actually remember but it's with regmodel? ServiceReg?
-Well, no, we didn't.
-So let's run it! (words for googling "install wcf IIS7")
Start-Run-CMD, cd "C:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Communication Foundation", there run ServiceModelReg -i
After this action, you should see in your command line - running some output about installing wcf thingies, and your service should start running.
Read more: Yonathan Masovich
netAudio
netAudio also provides tag editing functionality via tagLib.
This project was developed for use in in_lay along with other media-related technologies. For netAudio source and a look at the other media technologies, see in_lay.
For tag-editing functionality tagLib is used.
Read more: Codeplex
Creating Action Filters in ASP.NET MVC Applications
ASP.NET MVC Applications contains the action methods in the controllers. These actions are mapped through the routing when a user makes a browser request. In order to execute your logic before a action method is called or after an action method runs. ASP.NET MVC support this requirement through a concept called ActionFilters.
ActionFilter Uses
Authentication and Authorization can be implemented using action filters.
User actions can be logged.
For setting up the Localization feature in the application.
For Changing the Application behavior based on browser user agent.
Creating an ActionFilter in ASP.NET MVC Application
You can write a ActionFilter class by inherting from ActionFileAttribute class. You can override the method OnActionExecuting and write the logic that executes before Action Method.
To Add a ActionFilter to the ASP.NET MVC Application right click the Controllers folder in the project and select the add new item option and add the class template write the following code.
Read more: TECHBUBBLES
WPF Step by Step: Getting Started with WPF and Expression Blend

The Windows Presentation Foundation provides a fantastic way to develop your applications. However, getting started with WPF can be daunting. Data binding, MVVM, XAML, Pixel Shaders, Control Templates, Styles, Resources and Triggers are all terms that may well be unfamiliar.
This article will help you get started with WPF. We'll create a simple application, going over points of interest blow by blow. By the end of the article you will be comfortable with some of the core concepts of WPF development and you'll be well on the way to being able to harness the power of WPF to create stunning applications.
One of the great things about WPF is that it encourages you to use a sensible pattern for writing software - separating content from design, keeping the business logic away from the UI. You will write code that is well organised, easily testable and maintainable.
Background
The code in this article is C#. Visual Basic code will be very similar. If there is enough interest I will update it with VB code. I am using the latest platforms and technologies - Expression Blend 4, Visual Studio 2010 and the .NET Framework 4.0.
Creating a New Project
Enough preamble. Let's dive in and get started. We'll start simple and build a skeleton application, then we can take our basic application and refine it. Rather than being bombarded with technical details and abstracts, we're going for a very hands on approach.
First of all, open Expression Blend 4 and choose 'New Project'. I'm calling this one WpfStepByStep1 - any name will do!
Read more: Codeproject
Cosmos - C# Open Source Managed Operating System - MS5

Develop your own operating system using C# (or VB.Net, etc) and Visual Studio!
This is an update to an earlier article which discussed an older version of Cosmos. This article is specific to the Milestone 5 released in August 2010.
Introducing Cosmos
Cosmos (C# Open Source Managed Operating System) is an operating system development kit which uses Visual Studio as its development environment. Despite C# in the name any .NET based language can be used including VB.NET, Fortran, Delphi Prism, IronPython, F# and more. Cosmos itself and the kernel routines are primarily written in C#, and thus the Cosmos name. Besides that, NOSMOS (.NET Open Source Managed Operating System) sounds stupid.
Cosmos is not an operating system in the traditional sense, but instead it is an "Operating System Kit", or as I like to say "Operating System Legos". Cosmos lets you create operating systems just as Visual Studio and C# normally let you create applications. Most users can write and boot their own operating system in just a few minutes, all using Visual Studio. Milestone 5 includes new features such as an integrated project type in Visual Studio, and an integrated debugger. You can debug your operating system directly from Visual Studio using breakpoints.
Cosmos is available in two distributions, the developer kit (dev kit), and the user kit. The dev kit is designed for users who want to work on Cosmos itself. The user kit is designed for those who are interested in building their own operating system and doing some Cosmos work. The dev kit might be thought of as the Cosmos SDK. Most users should start off with the user kit as it is not so overwhelming like the dev kit. This article focuses on the user kit.
Writing your first Operating System
Create a new project as you would any C# project. Select Cosmos as the project type.
Read more: Codeproject