This is a mirror of official site: http://jasper-net.blogspot.com/

Five tips for choosing the right Linux distribution

| Tuesday, January 11, 2011
I have, on a number of occasions, stressed to new Linux users how crucial the right distribution is. Choosing the distribution that suits your needs is the single most important key to success when attempting to migrate from another operating system. But how do you know which one to choose out of the hundreds of variations? Believe it or not, there are some key questions to ask yourself when making this decision. It has been my goal for more than a decade to help prospective Linux users make the plunge with ease and success. Let’s see if I can do the same for you with these five tips.

1: Decide what you need Linux to do

This is essential to your initial success. There are Linux distributions geared for specific needs. Do you need Linux to act as a server OS? A desktop OS? A router? A firewall? Once you have answered the question of what you need Linux to do, you’re more than halfway home. But if you don’t ask this question, you might very well install a distribution (such as CentOS) geared for a server environment and wonder why it makes a lousy desktop environment. Choosing the Ubuntu Desktop distribution and using it as a server will find you in the same state — constantly frustrated.

2: Choose between stable and cutting edge

This should be a black-and-white area and all new users should pay close attention to it. New-to-Linux users who choose a distribution like Fedora will be frustrated. No matter how polished and stable Fedora might seem, it is geared toward the bleeding edge. Fedora is used as a test bed distribution for its bigger brother Red Hat Enterprise Linux, so it’s constantly updating to the latest releases. This leads to users having to fix problems. Even out of the box, you might find Fedora broken in one respect or another.

3: Consider your desktop preferences

Although this issue is about to be tipped on its head (when distributions start migrating to GNOME 3 or Unity), it is still a big factor in the success of a new Linux user.

Read more: TechRepublic

Posted via email from .NET Info

Allowing Access to HttpContext in WCF REST Services

|
If you’re building WCF REST Services you may find that WCF’s OperationContext, which provides some amount of access to Http headers on inbound and outbound messages, is pretty limited in that it doesn’t provide access to everything and sometimes in a not so convenient manner. For example accessing query string parameters explicitly is pretty painful:

[OperationContract]
[WebGet]
public string HelloWorld()
{
   var properties = OperationContext.Current.IncomingMessageProperties;
   var property = properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
   string queryString = property.QueryString;
   var name = StringUtils.GetUrlEncodedKey(queryString,"Name");

   return "Hello World " + name;
}
And that doesn’t account for the logic in GetUrlEncodedKey to retrieve the querystring value.

It’s a heck of a lot easier to just do this:

[OperationContract]
[WebGet]
public string HelloWorld()
{
   var name = HttpContext.Current.Request.QueryString["Name"] ?? string.Empty;
   return "Hello World " + name;      
}

Ok, so if you follow the REST guidelines for WCF REST you shouldn’t have to rely on reading query string parameters manually but instead rely on routing logic, but you know what: WCF REST is a PITA anyway and anything to make things a little easier is welcome.

Read more: Rick Strahl's blog

Posted via email from .NET Info

VB Core – New compilation mode in Visual Studio 2010 SP1

|
While most servicing releases do not include new functionality, Visual Studio 2010 SP1 introduced an important new compiler feature that enables Visual Basic to target new platforms that were not previously supported.   This was mentioned in some of the initial SP1 blog posts such as Jasonz blog.  

This is a strategic investment by Microsoft in the future of VB.  This provides VB with an increased agility in the future for new platforms to support Visual Basic.  

This blog provides more information about the feature; let me know if you have more questions.

WHAT IT IS?

The new command line option /vbruntime* (with an asterisk) will embed a reduced version of the Visual Basic runtime into the compiled assembly and therefore eliminate the dependency on the VB Runtime assembly since this assembly does not ship on all .Net platforms such as Windows Phone 7 and XNA.
The feature can be used from the VBC command line compiler or by adding an entry <VBRuntime>Embed</VBRuntime> into the .vbproj file.
In general, its intended use is only for specific project templates that target platforms that don’t ship with a VB runtime.


WHEN SHOULD I USE IT?

The simple answer to this is you should never need to use this directly.   The feature has been implemented to allow Microsoft Partner teams to create Visual Basic project templates for platforms that previously didn’t support VB. When such VB project templates eventually become available, you as a VB developer will be able to do File>New Project for the new project types, and /vbruntime* will be used under-the-hood.

Read more: The Visual Basic Team

Posted via email from .NET Info

How to Create .Net DataGridView Image Buttons

|
As you may have guessed by now, here at Switch On The Code, we are very big advocates of the .Net framework and all it has to offer. Sometimes however, things can be a little bit on the tricky side. Recently I ran into a tricky solution when I was trying to get image buttons in a DataGridView control, and in this tutorial I will go over the solution I came up with, which may just give you the edge the next time you need a fancy DataGridView.

DataGridViews do offer a few different column types, including fairly simple ways to brew up your own custom column types. However, none of the default column types offer a truly good solution for clickable images. What we want here is an image that does something when we click it. Sure we can have a button with an image in it if we use a Button Column, but that is not really what I am looking for. This is where the tricky solution comes in.

For a moment, we have to step back and consider all the options a DataGridView offers, especially the events that can be captured by it. One of these events happens to be CellClick, which is the key to our solution. Using this event we can capture which row and column is clicked, and therefore we can determine if one of our image cells is being clicked. Even better, we can even tell which actual cell was clicked. Using this information we can have image cells that act like buttons, and the best part is that it is not that complicated to get working.

So the first part is pretty strait forward, we need a DataGridView with some image columns. It doesn't matter what images you use, or how you set up your columns, but you just have to keep track of the column names. Once you have your DataGridView all set up, we need to give it a couple test rows to work with, which we will do during initialization:

public Form1()
{
 InitializeComponent();
 dataGridView1.Rows.Add(5);
}

Read more: Switch-on-code

Posted via email from .NET Info

More Big News: .NET Reflector 7 Beta, Integrating Jason Haley's PowerCommands Add-in is Now Available

|
I'm very pleased to announce the release of .NET Reflector 7 Beta. As ever, you can get it from

http://reflector.red-gate.com/Download.aspx

I've been holding off for a week or so because I wanted to be able to announce the great news that we've acquired the excellent PowerCommands add-in from Jason Haley, and have integrated it directly into .NET Reflector. The amount of time Jason's invested in PowerCommands really shows, because it provides an extremely powerful set of extensions to the core Reflector functionality. To illustrate, here's a summary of the complete feature list which Jason provided us:

Assembly browser treeview

  • Import/export assembly lists
  • Sort assembly list alphanumerically
  • Find what other assemblies reference an assembly
  • Open assemblies embedded as resources
  • Open items with an external application, e.g.,
  • Open code with Notepad
  • Open modules with ildasm
  • Open zip files
  • Run executable assemblies
  • Copy assembly path to clipboard
  • Open containing folder
  • Create desktop shortcut to item using code:// URL
  • Open Visual Studio 2005/2008/2010 command prompt in containing folder
  • Create assembly binding redirect XML for .config file
  • Collapse all nodes in the assembly browser tree
  • Toggle assembly browser on/off
Decompilation
  • View enumerations and calculate bit flags for those marked with the [Flags] attribute
  • Copy decompiled code as HTML, RTF or plain text
  • Email decompiled member code
Resources
  • Export embedded resources (.resources files) as .resx files
  • Open resources with Paint

Read more: Simple-talk

Posted via email from .NET Info

Google URL Shortener gets an API

|
When we launched Google’s URL shortener externally back in September, there was no accompanying API to allow people to integrate goo.gl into their applications and web pages. However, we said that we were working on one, and today we're happy to announce that we’ve launched the goo.gl API in Google Code Labs. The documentation can be found on the Google Code site, with example code in the Getting Started section.

With this API, developers are able to programmatically access all of the fast, sleek goo.gl goodness that we currently provide via the web interface. You can shorten and expand URLs using the API, as well as fetch your history and analytics. You could use these features for a wide variety of applications, enabling behaviors ranging from auto-shortening within Twitter or Google Buzz clients to running regular jobs that monitor your usage statistics and traffic patterns. You can check out the Google APIs console to get started.

Read more: Google Blog

Posted via email from .NET Info

Invisible IP Addresses

|
I stumbled across something interesting the other day. I was working on a webserver which was configured to listen to traffic on a specific IP address defined within the Apache configuration. Oddly, this IP address did not show up in ifconfig, but the box WAS serving traffic for it. Even an ifconfig -a failed to show the IP. My only theory was that since the interface was brought down AFTER Apache started listening to that IP, it was somehow still wedged up.

So I confirmed the network init scripts, and rebooted the box. After the reboot, the device once again began listening to this "unconfigured" IP. As it turns out, this was due to how the interface was being configured.

/sbin/ip addr add 10.1.8.2/8 dev eth0:1

# ping 10.1.8.2 -c 1
PING 10.1.8.2 (10.1.8.2) 56(84) bytes of data.
64 bytes from 10.1.8.2: icmp_req=1 ttl=64 time=0.036 ms

--- 10.1.8.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.036/0.036/0.036/0.000 ms

# ifconfig eth0:1
eth0:1 Link encap:Ethernet HWaddr 00:25:64:c2:2f:6d
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:21 Memory:febe0000-fec00000

Read more: ##SECURITY (FREENODE) OFFICIAL BLOG

Posted via email from .NET Info

Logging Errors with ELMAH

| Monday, January 10, 2011
ELMAH (Error Logging Modules and Handlers) is a pluggable component that you can use to log errors without modifying the application code. The main advantage of ELMAH is it's pluggable feature. You can easily integrate the ELMAH component in your developed application. It's an open source project and you can customize the code according to your needs. I am not going to show you how to customize the component; instead configuration of this component with your ASP.Net application and how you can store the error messages in SQL Server. You can also store the error information in Oracle, Access or XML. There are several options available in their website.

First task is to download the ELMAH project from following link

http://code.google.com/p/elmah/

Once download is complete, create one website and add the elmah.dll reference from bin folder under the downloaded folder. All versions dll are available starting from .Net fx 1.1 to .Net fx 3.5.

1.gif

Next, make the appropriate ELMAH entries in Web.config. In ConfigSections, add the following:

<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/>
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/>
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
</sectionGroup>

Read more:  C# Corner

Posted via email from .NET Info

IIS7 re-installation failed due to HTTP service disabled

|
Symptom

Customer complained that he tried to re-install IIS7 as he found WWW service couldn't be started. However, the installation always failed and was reported "fatal error during installation".

Based on our experience, we uninstalled WAS (Windows Process Activation Service) first, and then tried to install IIS7 again. Unfortunately, we still got the same result.  IIS7 installation log looked like below:

[12/24/2010 12:04:34] [ ***** IIS 7.0 Component Based Setup ***** ]

[12/24/2010 12:04:34] "C:\Windows\System32\inetsrv\iissetup.exe" /install CoreWebEngine

[12/24/2010 12:04:34] Install of component CoreWebEngine succeeded!

[12/24/2010 12:04:34] Success!

[12/24/2010 12:04:34] [ End of IIS 7.0 Component Based Setup ]

[12/24/2010 12:04:34] [ ***** IIS 7.0 Component Based Setup ***** ]

[12/24/2010 12:04:34] "C:\Windows\System32\inetsrv\iissetup.exe" /install W3SVC

[12/24/2010 12:04:34] < !!FAIL!! > SERVICE_CONTROLLER::StartNamedService W3SVC result=0x8007042c

[12/24/2010 12:04:34] < !!FAIL!! > Install of component W3SVC result=0x8007042c

[12/24/2010 12:04:34] < !!FAIL!! > COMPONENT::ExecuteCommand result=0x8007042c

[12/24/2010 12:04:34] [ End of IIS 7.0 Component Based Setup ]

Read more: AsiaTech: Learning by Practice

Posted via email from .NET Info

Python paradox

|
In a recent talk I said something that upset a lot of people: that you could get smarter programmers to work on a Python project than you could to work on a Java project.

I didn't mean by this that Java programmers are dumb. I meant that Python programmers are smart. It's a lot of work to learn a new programming language. And people don't learn Python because it will get them a job; they learn it because they genuinely like to program and aren't satisfied with the languages they already know.

Which makes them exactly the kind of programmers companies should want to hire. Hence what, for lack of a better name, I'll call the Python paradox: if a company chooses to write its software in a comparatively esoteric language, they'll be able to hire better programmers, because they'll attract only those who cared enough to learn it. And for programmers the paradox is even more pronounced: the language to learn, if you want to get a good job, is a language that people don't learn merely to get a job.

Only a few companies have been smart enough to realize this so far. But there is a kind of selection going on here too: they're exactly the companies programmers would most like to work for. Google, for example. When they advertise Java programming jobs, they also want Python experience.

Read more: Python paradox

Posted via email from .NET Info

Open Team Server (OTS)

|
Our dVP Uwe Sander is currently working on Open Team Server (OTS), a .NET project (C#) which aims to provide an open source system for managing the whole lifecycle of a software project.

OTS is basically a source control system, but despite its name, it has nothing in common with the Team Foundation Server from Microsoft. Before checking it out you should note that the project is in a very early stage, it's not production ready and has no documentation except the command line help but it is basically working if you want to try it out.

Source code is here (no binaries yet):

http://sourceforge.net/projects/openteamserver/develop

Read more: Developer Community

Posted via email from .NET Info

Why we got 404 when accessing WCF domain services deployed in IIS6

|
Symptom:

Customer deployed a Silverlight + ASP.Net Project in IIS6 of Windows Server 2003, and the application logic was encapsulated in domain services. In order to verify if the domain service was working or not, he typed an URL like blow:

http://serverName/ClientBin/<Namespace>-<Class_Name>.svc

We followed the steps of this article: http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx. However, the issue still can't be fixed.

We got a workaround by creating an explicit svc file as below blog mentioned:
http://betaforums.silverlight.net/forums/p/180992/414301.aspx

But the question is:

Why it doesn't work if there is no explicit svc file for this scenario?

Root Cause:


After troubleshooting, we found that the 404 status code was caused that the option  "Verify that file exists" of .svc extension mapping of customer's web server was checked.

Under this situation, it will try to check if the file really exists in the physical disk when a request which extension is .svc was received on the web server. But actually, when we access the WCF RIA service through the URL like that: http://webserver/clientbin/<namespace>-<class_name>.svc, the file   doesn't really exist in the disk, unless we create it manually, that's why we got 404 status code which indicates "FILE NOT FOUND" information.

Solution:

Uncheck "Verify that file exists" for the .svc extension mapping

Read more:  AsiaTech: Learning by Practice

Posted via email from .NET Info

How to overcome the CLR fusion limitation

|
There are cases where you would be interested to load an assembly from a different directory then the root dir of your .net application. When you’ll try to do so you will face with the limitation of the fusion process (assembly loading process) – this limitation limits you to load assemblies from underneath the root dir of your application in order to guard your app from dll hell.

In order to overcome this limitation you can use the old plain Unix trick… create a symbolic link to the file… there is a small utility called mklink which lets you create symbolic link to a directory or a file.The process of making it work is to put the assembly in directory of your choice and then create the symlink at the place where the assembly is being expected to be.Its possible later on to replace the symlink with other symlink thus redirect the app to a different assembly without changing the app itself.

If you are interested in redirecting a bunch of assemblies it is also possible to declare a probing directory via the app.config file and create a symbolic link of this directory thus redirecting all the probing calls to a different directory outside of the root path of the app.

Read more: Ohad's Blog

Posted via email from .NET Info

Scientists Find Tears Are the Anti-Viagra

|
The male test subjects didn't know what they were smelling, they were just given little vials of clear liquid and told to sniff. But when those vials contained a woman's tears (collected while she watched a sad movie), the men rated pictures of women's faces as less sexually attractive, and their saliva contained less testosterone. Is this proof that humans make and respond to pheromones? The researcher behind the study doesn't use that controversial word, but he says his findings do prove that tears contain meaningful chemical messages.

Read more: Slashdot

Posted via email from .NET Info

iPhone app development with Linux

|
My employer, Chariot Solutions, held an in-house, week-long iPhone development course, taught by the folks at Big Nerd Ranch.

The course was great, we all learned a lot, and several of our folks are working on some apps, including one that they announced recently at JBoss World.

80% or more of our consultants have MacBook Pros, however, I opted for a Dell with Ubuntu when I joined Chariot about a year and a half ago.
I borrowed a MacBook for the course (thanks, Ken!), but have been feeling a bit left out since then, as the official Apple development tools (XCode and Interface Builder) only run on OS X.

I had previously whined about the fact that the official toolchain uses GCC under the covers, and that therefore, someone who knows GCC well (as in not me) ought to be able to get something working on Linux. Since then, I’ve seen a few pages on the web with instructions for getting arm-apple-darwin9-gcc working on Linux, but none seemed to have complete instructions on how to get the development environment working.

Well, yesterday, I decided to look harder, and found a site that explains setup of an iPhone development environment on Linux in detail.

Read more: Mobile DevZone

Posted via email from .NET Info

Second Congo War

|
    The Second Congo War, also known as Africa's World War and the Great War of Africa, began in August 1998 in the Democratic Republic of the Congo (formerly called Zaire), and officially ended in July 2003 when the Transitional Government of the Democratic Republic of the Congo took power (though hostilities continue to this day).

    The largest war in modern African history, it directly involved eight African nations, as well as about 25 armed groups. By 2008 the war and its aftermath had killed 5.4 million people, mostly from disease and starvation, making the Second Congo War the deadliest conflict worldwide since World War II. Millions more were displaced from their homes or sought asylum in neighboring countries.

    Despite a formal end to the war in July 2003 and an agreement by the former belligerents to create a government of national unity, 1,000 people died daily in 2004 from easily preventable cases of malnutrition and disease. The war and the conflicts afterwards are, among other things, driven by the trade of conflict minerals.

Read more: Wikipedia

Posted via email from .NET Info

40+ hours of free SQL Server 2008 Microsoft Certified Master (MCM) training videos from SQLskills and Microsoft

|
SQLskills.com has teamed up with Microsoft to provide 40 hours of online training geared towards the SQL Server 2008 MCM certification.

These videos are designed to give you an overview of the breadth of subject knowledge required, plus some indication of the depth to which you should know it. The four weeks of intensive training that SQLskills.com provides has a little overlap with the content in the videos, but most material in the class is not available anywhere online.

This page gives links to all the videos, grouped together to match our training classes.

Make sure to also check out the MCM Pre-Reading List that accompanies the videos!

Read more: Greg's Cool [Insert Clever Name] of the Day
Read more: SQLskills Free Online MCM Training

Posted via email from .NET Info

MonoDroid beta now open for all

|
After a closed testing program with the early Beta, Mono for Android or MonoDroid can now be test driven by anyone who cares to sign up.
It brings the full Mono VM to the Android so that you can develop applications using C#. In addition the Dalvik APIs have been bound to C# so that you can make use of many of the builtin facilities of the Android OS. The OpenTK library has also been ported so that you can share the same OpenGL code across Windows, Linux and iPhone.

Read more: I Programmer

Posted via email from .NET Info

Free (Reg-ware) SQL Server Perfmon Counters Poster. Counters + Descriptions + “values you want to see” = Happy DBA

|
image%5B11%5D.png?imgmax=800

When it comes to performance monitoring, few tools offer as much reliability and universal access as Perfmon — and that alone makes it worth learning. Its counter thresholds give you a clear picture, so you can diagnose the root-cause of your SQL Server issues right away. And now you can do it all even faster with this unique reference.

This poster — produced by our world-class SQL Server experts at Quest — provides valuable tips and tricks to remember when using Perfmon. It will help you quickly build a hypothesis and uncover the slowest components on your servers.

…”

What I really like about this poster is how not only are the counters listed, with description, but what the normally acceptable values of those counters should be. Given that there’s 1.9 gazillion perform counters, knowing the “good ones” and their values is a step toward SQL Server guru’ism.

Read more: Greg's Cool [Insert Clever Name] of the Day

Posted via email from .NET Info

ASP.NET MVC 3 Tutorials Index

|
My ASP.NET MVC 2 Tutorials Index is one of my most popular blog posts of 2010, so I thought I would make an ASP.NET MVC 3 Tutorials Index to make it easy to find ASP.NET MVC 3 tutorials on my website. I will be adding new tutorials over time so you can come back often to find fresh material. Most recent tutorials are at the top of the list.

ASP.NET MVC 3 Tutorials

  • JsonValueProviderFactory in ASP.NET MVC 3 - In ASP.NET MVC 3 there is now a built-in JsonValueProviderFactory that is used by modelbinders to obtain values provided by JSON requests.
  • ASP.NET MVC 3 Remote Validation Tutorial - ASP.NET MVC 3 comes with a new RemoteAttribute that you can decorate on model properties for calling server-side methods during client-side validation. In this sample you can mimic twitter-like registration functionality to let users know they chose a username that is already taken by another user.
  • CompareAttribute in ASP.NET MVC 3 - Compare Properties During Validation - ASP.NET MVC 3 has a new CompareAttribute that allows you to compare properties during validation. Good for situations like when you need to verify the password entered by a user equals confirm password during registration.

Read more: David Hayden

Posted via email from .NET Info

השימוש ב-Extended Properties

|
לאובייקטים שונים ב-SQL Server ניתן להוסיף ערכים והסברים באמצעות Extended Properties.

דרך הממשק הגרפי של ה-SSMS - קליק ימני על האובייקט ו-Properties,

בחלון שנפתח בוחרים ב- Extended Properties,

וניתן להוסיף שורות באופן חופשי הכוללות Name (סעיף) ו-Value (תיאור, ערך).

מידע שניתן להוסיף- מקור הנתונים האובייקט, תיאור כללי שלו, שם האפיון במערכת וכו'.

רצוי כמובן שה-Name יהיה סטנדרטי כדי שיהיה ניתן לתחקר את ה-Extended Properties בקלות: בדוגמה הזו הכותרת של תיאור הטבלה הוא MS_Description, ורצוי שזו תהיה הכותרת בכל תיאורי האובייקטים כדי שניתן יהיה לשלוף אותם בקלות מטבלאות המערכת.

ניתן להוסיף Extended Properties בעזרת קוד, למשל- נתונה טבלת dbo.Employees ובה עמודת Gender (מין, מגדר..) ואנחנו מעוניינים להוסיף תיאור לטבלה ותיאור לעמודה:

Exec sp_addextendedproperty 'Description','Actual employees', 'User', 'dbo', 'Table', 'Employees';

Exec sp_addextendedproperty 'Description','0=woman, 1=man, Null=unknown', 'User', 'dbo', 'Table', 'Employees', 'Column','Gender';
Go
שליפת ה-Extended Properties מתבצעת כך:

Select Object_Name(major_id) Tbl,
      Col_Name(major_id,minor_id) Col,
      *
From   sys.extended_properties
Where  Object_Name(major_id)='Employees';
Go

Read more: גרי רשף

Posted via email from .NET Info

Autotune.NET

|
Intro

We’ve all cringed as a hopelessly out of tune contestant appears on the latest episode of “American Idol.” Occasionally, there’s a contestant who manages to be pitch perfect all the way through—right until they flub the final note. And in the cutthroat world of televised auditions, sing one slightly flat note and you’re out.

So what takes care of a bad-pitch day? Autotune—an effect that corrects the pitch of your voice so you’ll never again sing out of tune. And now, with the power of modern microprocessors, autotune is possible in real-time, allowing singers to benefit from its almost magical powers during live concerts.

The company most famous for its autotune effect is Antares. Antares Auto-Tune currently retails for $249, and a stripped down version is available for $100. In addition to simply improving the pitch of a dodgy singer, autotune can be used to create unique robotic sounding vocal effects, a technique massively popular in recent years thanks to its use by artists such as T-Pain and the group behind the “Auto-Tune the News” YouTube videos. In 1998, when the effect was first used on Cher’s “Believe” single, the producer used such extreme settings that instead of subtly adjusting the pitch, autotune “snapped” instantaneously to the nearest “correct” note.

Read more: Coding4Fun

Posted via email from .NET Info

The remote name could not be resolved

|
גישה לשרת מרוחק דרך Proxy מקוד.
באחד המקרים ניסיתי לייבא תוכן xml משרת מרוחק ובמחשב הפיתוח הכול עבד בצורה חלקה, לעומת זאת בשרת קבלנו הודעת שגיאה The remote name could not be resolved.
אחד מבוגרי יהלו"מ של סלע מני מרסיאנו גילה שבשרת כל התקשורת עוברת דרך proxy, ולכן הוא כתב את הקוד הבא:

string returnValue;

HttpWebRequest wrequest = (HttpWebRequest)WebRequest.Create("url");
string sHttpProxyUrl = "proxy address";
wrequest.Proxy = new WebProxy(sHttpProxyUrl);
wrequest.Timeout = 500000;

using (WebResponse wresponse = wrequest.GetResponse())
{
   Stream wstream = wresponse.GetResponseStream();
   StreamReader streamReader = new StreamReader(wstream, Encoding.UTF8);
   returnValue = streamReader.ReadToEnd();
}

Read more: שלמה גולדברג (הרב דוטנט)

Posted via email from .NET Info

The Inheritance Problem

|
Inheritance and function overloading don't play well together in C#. See if you can figure out the reasons that this puzzle doesn't work as you might expect.

Background

Object Oriented programming is wonderful and one of its most wonderful attributes is the ability to create new classes that inherit all of the methods and properties of existing classes.
Today there may be some worries about using inheritance and even a move towards claiming that it isn't a particularly safe construct but many programmers do make use of it within their projects because it is better than Copy and Paste inheritance that you often see in use when the Interface approach is used.
So leaving asside questions of the advisability of using inheritance let's see how this particular puzzle came about.
C# takes a very standard approach to objects. You can create a base class:

class Base
{
public void MyMethod(int i)
{
 MessageBox.Show("Base method Int");
}
}

create a derived class:

Class Derived : Base
{    
}

and even if the Derived class is empty it still has all of the properties and methods of the base class. So you can call MyMethod using an object of the Derived class:

Derived MyObject = new Derived();
MyObject.MyMethod(1);

Another useful feature of C#, although it isn't an object oriented one is function overloading - which always sounds as if it is a sort of cruely to functions. It isn't because it is incredibly useful.
Functions are not simply defined by their name i.e. MyMethod but the types of their parameters or signature. That is MyMethod is MyMethod(int). What this means is that you can define lots of methods with same name as long as their parameter lists i.e. signatures are different. Notice that the return type plays no role in the signature.
If you make a call to an overloaded function then the function definition with the most specific match to the call signature is the one that is actually used. For example, if we change the defintion of the Base class to:

class Base
{
public void MyMethod(int i)
{
 MessageBox.Show("Base method Int");
}
public void MyMethod(object i)
{
 MessageBox.Show("Base Method Object");
}
}

And make a the call

Derived MyObject = new Derived();
MyObject.MyMethod(1);

Read more: I Programmer

Posted via email from .NET Info

Неприятный баг в NHibernate 3.0: приведение типов

|
При переводе проекта на версию NHibernate 3.0 столкнулся с неприятным багом: если использовать значение типа int в методе SetParameter (установка именованого параметра запроса) для выборки по полю типа byte получим исключение: Specified cast is not valid. В версии 2.0 такой проблемы не было.

Дело в том, что в методе Set класса ByteType (используется именно он, т.к. Хибернейт умный и узнает тип поля из маппинга) след. строчка:

((IDataParameter) cmd.Parameters[index]).Value = (byte)value;

В прочих классах Int16Type и тд такого нету – используется прямое присваивание параметра типа object, он конвертится уже дальше в BCL, более корректными методами.

Для себя эту неоднозначность исправил, засабмитил баг в трекер.

Read more: .NET разработка от devlanfear

Posted via email from .NET Info

Ускоритель для IE или GenericHandler.ashx своми руками

|
На моем сайте есть лента анекдотов (на главной странице), так вот, чтобы добавить на ленту новую запись надо зайти на сайт, нажать кнопку, которая откроет форму добавления, запонить поля, выбрать параметры и нажать кнопку "добавить". Это долго и не всегда хочется тратить на это время. Хочу чтобы было просто: нашел что-то интересное и смешное на каком-нибудь сайте, выделил, нажал на ускоритель и всё уже на сайте. Итак...

Для начала потребуется создать обработчик запросов (я выбрал название LentaIE.ashx), который будет получать данные от ускорителя. А потом создать специальный xml-файл, который должен соответствовать спецификации. Описание спецификации достаточно подробно описано MSDN, поэтому я не буду этого делать, а просто приведу готовый код:

<?xml version="1.0" encoding="UTF-8"?>
<os:openServiceDescription
   xmlns:os="http://www.microsoft.com/schemas/openservicedescription/1.0">
   <os:homepageUrl>http://www.calabonga.com</os:homepageUrl>
   <os:display>
       <os:name>Поделиться анекдотом</os:name>
       <os:icon>http://www.calabonga.com/images/musorka.ico</os:icon>
       <os:description>Мусорка - рассказать разместить свой анекдот</os:description>
   </os:display>
   <os:activity category="Share">
       <os:activityAction context="selection">
           <os:execute action="http://www.calabonga.com/h/LentaIE.ashx?content={selection}" method="post">
               <os:parameter name="content" value="{selection}" type="text" />
           </os:execute>
       </os:activityAction>
   </os:activity>
</os:openServiceDescription> 


Теперь что касается обработчика (.ashx). Создадим новый при помощи шаблона Visual Studio. Вновь созданный файл имеет следующий вид:

   public class LentaIE : IHttpHandler
   {
       public void ProcessRequest(HttpContext context)
       {

       }

       public bool IsReusable
       {
           get
           {
               return false;
           }
       }
   }

А теперь давайте напичкаем этот класс полезностями. Во-первых, создадим поле которое будет экземпляром класса унаследованного от DataContext (LINQ to SQL).

Read more: Мусорка - найди лучшее!

Posted via email from .NET Info

Extended WPF Toolkit–Release 1.3.0

|
A new version of the Extended WPF Toolkit has just released.  In this release there are three new controls and updates have been to two existing controls.  Lets take a look at what’s inside this newest release.

Updated Controls

The ColorPicker
The RichTextBoxFormatBar
The DateTimeUpDown

Read more: <ELEGANTC*DE>

Posted via email from .NET Info

WPF Quiz #1 – Resources

|
Having the following WPF code snippets:

<Application x:Class="Quiz1.App"
   xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <Application.Resources>
       <SolidColorBrush x:Key="BackgroundBrush" Color="Red" />
   </Application.Resources>
</Application>


public partial class App : Application
{
   private readonly Window _mainWindow = new MainWindow();

   protected override void OnStartup(StartupEventArgs e)
   {
       _mainWindow.Show();
       base.OnStartup(e);
   }
}


<Window x:Class="Quiz1.MainWindow"
   xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       Title="MainWindow" Height="350" Width="525">
   <Grid Background="{StaticResource BackgroundBrush}" />    
</Window>


public partial class MainWindow : Window
{
   public MainWindow()
   {
       InitializeComponent();
   }
}

Which one of the following statements is true?

a. Running the application, the grid background will be rendered Red.
b. Running the application, the grid background won't be rendered.
c. Running the application, an exception will be thrown.
d. The grid background won't be rendered at design time.

Read more: Essential WPF and Young Brothers

Posted via email from .NET Info

VMWare and Hyper-V

|
For a client engagement, I was provided VMWare images.  I don’t have VMWare, but have a server running Windows Server 2008 R2 with Hyper-V.  So I needed a conversion from the VMWare image to a Hyper-V image.

As is often the case, I figured I must not be the first person to want to do this, so there’s probably info on the web about it.   Back when I worked as a dev on Office, we had a strategy of being a universal receiver – no matter what format you had, you could open it in Office.  This was in the days when WordPerfect 4.1 and Lotus were the market leaders, so it makes sense to make it super easy for people to move from what they have to your format.  I figured the same must be true for Hyper-V, the kind of underdog in the VM space.

Sure enough, I found a good blog post from John Robbins describing how he did this.  John is doing a more complex migration than I need –he’s moving his whole environment, including an Active Directory domain controller from VMWare to Hyper-V.  I just have a couple of virtual disk images I need to be able to run under Hyper-V.  But John’s post links to just what I needed - a tool which does a sector-by-sector conversion from the VMWare .VMDK format for virtual hard disks to Hyper-V’s VHD format.

But that gives me a virtual hard drive with the image – it doesn’t give me a virtual machine.  Here are the steps to convert that from the VMWare virtual machine information provided:

  1. Download the VMDK to VHD Converter from VMToolkit.
  2. Use it to convert the VMWare VMDK (virtual disk image) to a Hyper-V VDK (virtual disk image).  This creates a new file that is a sector-by-sector copy of the original virtual hard disk.
  3. Start Hyper-V Manager and click on your server name in the tree control on the left.
  4. Click New / Virtual Machine… and name it and configure memory/networking.
  5. When you get to step 4 (Connect Virtual Hard Disk), click the second option “Use an existing virtual hard disk” and point it at the VHD you created from the VMDK.

Read more: Mike Kelly's Blog

Posted via email from .NET Info

SQL SERVER – master Database Log File Grew Too Big

|
Couple of the days ago, I received following email and I find this email very interesting and I feel like sharing with all of you.

Note: Please read the whole email before providing your suggestions.

“Hi Pinal,

If you can share these details on your blog, it will help many.

We understand the value of the master database and we take its regular back up (everyday midnight). Yesterday we noticed that our master database log file has grown very large. This is very first time that we have encountered such an issue. The master database is in simple recovery mode; so we assumed that it will never grow big; however, we now have a big log file.

We ran the following command

USE [master]
GO
DBCC SHRINKFILE (N'mastlog' , 0, TRUNCATEONLY)
GO

We know this command will break the chains of LSN but as per our understanding; it should not matter as we are in simple recovery model.

Read more: Journey to SQL Authority with Pinal Dave

Posted via email from .NET Info

Loading COM components in your Web Service

|
I ran into an issue the other day where my Silverlight Mobile App was calling my web service that was trying to load a COM component. Ran fine when debugging locally under Cassini. However, once deployed to IIS, loading the COM component failed with the following error:

"Retrieving the COM class factory for component with CLSID {D6567EF8-0A6C-48E7-9288-A2463123C2F3} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0×80070005 (E_ACCESSDENIED))."  

The solution was to update my component using in Component Service adding permissions to IIS_USERS for my component.

Exact steps:

1. Start Menu->Run dcomcnfg.
2. Expand Component Services->Computers->My Computer –> DCOM Config.
3. Right-click on your component in the tree view, select properties and click on the Security Tab.
4. Under Launch and Activation Permissions, click the Edit button.
5. Click Advanced button, click Find Now Button.

Read more: Everything Silverlight

Posted via email from .NET Info

Monads in C# – 1. Introduction

|
Here’s the complete series:
1. Introduction.
2. What’s the point?

I’ve foolishly volunteered to give a talk at DDD9 on the 29th January: ‘Monads! What are they, and why should I care?’:

“Or: How to bend Linq syntax to your will.

These days, monads are the "celebrities of programming language theory". But they also inspire fear in the hearts of lowly imperative programmers like myself. However they are a very useful and powerful abstraction and they pop up everywhere. C#'s Linq syntax is Monadic, for example. Having an understanding of Monads will give you the conceptual tools to greatly simplify many programming challenges, from dealing with nulls and managing state, to asynchronous programming and parsing. This talk will be mostly C#, but I will also be introducing a little F# and even some Haskell.”

Why foolish? Well, firstly, because I’ve only recently come to a limited understanding of what Monads are myself, and I’m fully aware that I’ve got a great deal more to learn. There’s a very good chance that I might not understand some important points, or that I’m just wrong about some things. Secondly, because it’s taken me several books, a gazillion blog posts and articles and upwards of a year to get to my limited understanding. To expect to transfer this to someone else’s brain in an hour’s presentation is completely unrealistic.

Read more: CODE RANT, Monads in C#–2. What’s the point?

Posted via email from .NET Info

MSDN Magazine: January 2011 Issue

|
The January 2011 edition of MSDN Magazone is available on-line, featuring articles exploring Windows Workflow, Dynamic Data, cloud project templates, MEF use in Silverlight to support MVVM, Unity Interceptors, XNA, and much more.

Read more: MSDN

Posted via email from .NET Info

AMD Puts Out Radeon HD 6000 Open-Source Driver

| Sunday, January 9, 2011
AMD has just released their open-source driver for the Radeon HD 6000 series graphics cards (sans the Cayman GPUs) with KMS, 2D, and 3D acceleration.

Read more: Slashdot

Posted via email from .NET Info

Twileshare – File-Sharing On Twitter The Way It Ought To Be

|
We’ve become used to the idea of sharing photos on Twitter (from Twitpic to Instagr.am), video (YouTube to Qik) and audio (Cinch to Soundcloud). But have we done much file-sharing via Twitter? Not to date.

There’s Tweetshare, Filesocial and Tweetcube but they are not something you will see in the average user’s stream – or at least not mine, and I follow nearly 4,000 accounts.

Twileshare is still in beta and launched just before Christmas but already it’s seen a lot of viral traffic from what I can see. There are now 24,000 mentions of it on Google.

Read more: TechCrunch

Posted via email from .NET Info

How to Setup Software RAID for a Simple File Server on Ubuntu

|
Do you need a file server on the cheap that is easy to setup, “rock solid” reliable with Email Alerting? will show you how to use Ubuntu, software RAID and SaMBa to accomplish just that.

Overview
Despite the recent buzz to move everything to the “all mighty”cloud,  sometimes you may not want your information in someone else’s server or it just maybe unfeasible to download the volumes of data that you require from the internet every time (for example image deployment). So before you clear out a place in your budget for a storage solution, consider a configuration that is licensing free with Linux.

With that said, going cheap/free does not mean “throwing caution to the wind”, and to that end, we will note points to be aware of, configurations that should be set in place in addition to using software RAID, to achieve the maximum price to reliability ratio.

About software RAID
As the name implies, this is a RAID (Redundant Array of Inexpensive Disks) setup that is done completely in software instead of using a dedicated hardware card. The main advantage of such a thing is cost, as this dedicated card is an added premium to the base configuration of the system. The main disadvantages are basically performance and some reliability as such a card usually comes with it’s own RAM+CPU to perform the calculations required for the redundancy math, data caching for increased performance, and the optional backup battery that keeps unwritten operations in the cache until power has been restored in case of a power out.

Read more: How-to-geek

Posted via email from .NET Info

Android Passes iPhone In US Market Share

|
   61.5 million people in the US owned smartphones during the three months ending in November 2010, up 10 percent from the preceding three-month period. For the first time, more Americans are using phones running Google's Android operating system than Apple's iPhone, but RIM's BlackBerry is still in first place, according to comScore. RIM fell from 37.6 percent to 33.5 percent market share of smartphones, Google captured second place among smartphone platforms by moving from 19.6 percent to 26.0 percent of US smartphone subscribers, and Apple slipped to third despite its growth from 24.2 percent to 25.0 percent of the market. Microsoft, in fourth place, fell into single digits from 10.8 percent to 9.0 percent while Palm was still last and further slipped from 4.6 percent to 3.9 percent.

Read more: Slashdot

Posted via email from .NET Info

Eavesdropping on GSM Calls

|
It's easy and cheap:
Speaking at the Chaos Computer Club (CCC) Congress in Berlin on Tuesday, a pair of researchers demonstrated a start-to-finish means of eavesdropping on encrypted GSM cellphone calls and text messages, using only four sub-$15 telephones as network "sniffers," a laptop computer, and a variety of open source software.
The encryption is lousy:
Several of the individual pieces of this GSM hack have been displayed before. The ability to decrypt GSM's 64-bit A5/1 encryption was demonstrated last year at this same event, for instance. However, network operators then responded that the difficulty of finding a specific phone, and of picking the correct encrypted radio signal out of the air, made the theoretical decryption danger minimal at best.
But:
As part of this background communication, GSM networks send out strings of identifying information, as well as essentially empty "Are you there?" messages. Empty space in these messages is filled with buffer bytes. Although a new GSM standard was put in place several years ago to turn these buffers into random bytes, they in fact remain largely identical today, under a much older standard.
This allows the researchers to predict with a high degree of probability the plain-text content of these encrypted system messages. This, combined with a two-terabyte table of precomputed encryption keys (a so-called rainbow table), allows a cracking program to discover the secret key to the session's encryption in about 20 seconds.

Read more: Bruce Schneier

Posted via email from .NET Info

Webfarm and IIS configuration tips/tricks

|
I was recently talking with some good friends about tips for performance and what an IIS Administrator could do on the server side.  I also see this question from time to time in the forums @ http://forums.iis.net.    Of course, you should test individual settings in a controlled environment while performing load testing before just implementing on your production farm.

  • IIS Compression enabled (both static and dynamic if possible, set it to 9)  If you are running IIS 6, check this article out by Scott Forsyth.
  • Run FRT for long running pages (Failed Request Tracing)
  • Sql Connection pooling in code
  • Look at load testing using visual studio load testing tools
  • Log parser  finding long running pages.  Here is a couple examples
  • Look at CPU, Memory and disk counters.  Make sure the server has enough resources.
  • Same machineKey account across all same nodes
  • Localize content vs. using UNC based content on a single server (My UNC tag with great posts)

  • Read more: Steve Schofield Weblog

    Posted via email from .NET Info

    Ассемблер для Windows используя Visual Studio

    |
    Многие из нас изучали ассемблер в университете, но почти всегда это ограничивалось простыми алгоритмами под DOS. При разработке программ для Windows может возникнуть необходимость написать часть кода на ассемблер, в этой статье я хочу рассказать вам, как использовать ассемблер в ваших программах под Visual Studio 2005.

    25.png

    Read more: habrahabr.ru

    Posted via email from .NET Info

    Mono at CES: More Games

    |
    During today's Nvidia press conference at CES, a the Monodroid-powered DeltaEngine was shown running the SoulCraft Tech Demo:

    1101060740uenTiTh1.png

    Read more: http://tirania.org

    Posted via email from .NET Info

    ACE

    |
        The ADAPTIVE Communication Environment (ACE) is a freely available, open-source object-oriented (OO) framework that implements many core patterns for concurrent communication software. ACE provides a rich set of reusable C++ wrapper facades and framework components that perform common communication software tasks across a range of OS platforms. The communication software tasks provided by ACE include event demultiplexing and event handler dispatching, signal handling, service initialization, interprocess communication, shared memory management, message routing, dynamic (re)configuration of distributed services, concurrent execution and synchronization.
    ACE is targeted for developers of high-performance and real-time communication services and applications. It simplifies the development of OO network applications and services that utilize interprocess communication, event demultiplexing, explicit dynamic linking, and concurrency. In addition, ACE automates system configuration and reconfiguration by dynamically linking services into applications at run-time and executing these services in one or more processes or threads.

    ACE continues to improve and its future is bright. ACE is supported commercially by multiple companies using an open-source business model. In addition, many members of the ACE development team are currently working on building The ACE ORB (TAO).

    Benefits of Using ACE?

    Some of the many benefits of using ACE include:

    • Increased portability -- ACE components make it easy to write concurrent networked applications on one OS platform and quickly port them to many other OS platforms. Moreover, because ACE is open source, free software, you never have to worry about getting locked into a particular operating system platform or compiler configuration.
    • Increased software quality -- ACE components are designed using many key patterns that increase key qualities, such as flexibility, extensibility, reusability, and modularity, of communication software.
    • Increased efficiency and predictability -- ACE is carefully designed to support a wide range of application quality of service (QoS) requirements, including low latency for delay-sensitive applications, high performance for bandwidth-intensive applications, and predictability for real-time applications.
    • Easier transition to standard higher-level middleware -- ACE provides the reusable components and patterns used in The ACE ORB (TAO), which is an open-source standard-compliant implementation of CORBA that's optimized for high-performance and real-time systems. Thus, ACE and TAO are designed to work well together in order to provide comprehensive middleware solutions.

    Read more: ACE

    Posted via email from .NET Info

    Debugging Assembly loading

    |
    Does a referenced assembly get loaded if no types in the assembly are “not used”?

    The term used is is very subjective. For a developer it would mean that you probably never created an instance or called a method on it. But this does not cover the whole story. You can instead consider what are the reasons for an assembly load occurring. Suzanne’s blog on Assembly loading Failures would give you a good understanding of failures if that is what you are interested in. This post focuses on how to identify what exactly is causing an assembly to load.

    We in the WCF team are very cautious on introducing assembly dependencies and how how our code paths can cause assembly loads since this impacts the reference set of your process. Images that get loaded during a WCF call can become the cause of slow start up since every assembly is a potential disk look up and larger the number the higher the impact to startup.  As a guidance for quick app startup is that you can eliminate a lot of the unnecessary assemblies from being loaded to speed up application startup if you refactor types properly.

    Read more: Sajay.com

    Posted via email from .NET Info

    ASP.NET Error Handling: Creating an extension method to send error email

    |
    Error handling in asp.net required to handle any kind of error occurred. We all are using that in one or another scenario. But some errors are there which will occur in some specific scenario in production environment.In this case we can’t show our programming errors to the End user. So we are going to put a error page over there or whatever best suited as per our requirement. But as a programmer we should know that error so we can track the scenario and we can solve that error or can handle error. In this kind of situation an Error Email comes handy. Whenever any occurs in system it will going to send error in our email.

    Here I am going to write a extension method which will send errors in email. From asp.net 3.5 or higher version of .NET framework  its provides a unique way to extend your classes. Here you can fine more information about extension method. So lets create extension method via implementing a static class like following. I am going to use same code for sending email via my Gmail account from here. Following is code for that.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Net.Mail;

    namespace Experiement
    {
       public static class MyExtension
       {
           public static void SendErrorEmail(this Exception ex)
           {
               MailMessage mailMessage = new MailMessage(new MailAddress("from@gmail.com")
                                          , new MailAddress("to@gmail.com"));
               mailMessage.Subject = "Exception Occured in your site";
               mailMessage.IsBodyHtml = true;

               System.Text.StringBuilder errorMessage = new System.Text.StringBuilder();

               errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}","Exception",ex.Message));
               errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}", "Stack Trace", ex.StackTrace));

               if (ex.InnerException != null)
               {
                   errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}", " Inner Exception", ex.InnerException.Message));
                   errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}", "Inner Stack Trace", ex.InnerException.StackTrace));
               }

               mailMessage.Body = errorMessage.ToString();

               System.Net.NetworkCredential networkCredentials = new
               System.Net.NetworkCredential("youraccount@gmail.com", "password");
               
               SmtpClient smtpClient = new SmtpClient();
               smtpClient.EnableSsl = true;
               smtpClient.UseDefaultCredentials = false;
               smtpClient.Credentials = networkCredentials;
               smtpClient.Host = "smtp.gmail.com";

    Read more: Beyond Relational

    Posted via email from .NET Info

    Use WinDbg and SOS.DLL with multiple CLR instances SxS in the same process

    |
    If you debugging a managed app that has more than one CLR instances loaded in the same process (typically V2/V1.1 + V4 at the time of writing), you’ll probably run into a problem that SOS commands doesn’t quite work in this case. More specifically, if you do a .loadby sos clr, all SOS commands work just fine. But if you unload the SOS (by .unload command) and then load the SOS for V2 by using .loadby sos mscorwks, you’ll find out that SOS commands in V2 doesn’t really work. For example, !dumpmt will tell you that a valid MethodTable is invalid, !do will tell you a valid object is invalid, etc.

    The trick is that you need to have WinDbg load the right version of Mscordacwks.dll. SOS needs this DLL to read data structures out-of-proc from the debuggee, and just like SOS.dll, this DLL is tightly coupled with CLR and needs to exactly match the CLR that you want to debug. The right command to load up the mscordacwks.dll is as follows:

    .cordll –ve –I <address_of_CLR_DLL> -l

    For example, say you want to load SOS for V2 mscorwks.dll, you need to follow these steps:

    1. .unload (This unloads all the extensions, or you can use .unload <SOS path name>. I found using .unload much easier)

    2. .loadby sos mscorwks (This loads up SOS)

    3. .cordll –u (This unloads the current mscordacwks loaded by WinDbg)

    4. lmvm mscorwks (Find out the address of mscorwks)

    5. .cordll –ve –I <address_of_mscorwks_DLL> -l

    Then you can go ahead and use V2 SOS commands.

    Read more: YI ZHANG'S MSDN BLOG

    Posted via email from .NET Info

    25 Fresh Examples of Beautiful UI Elements

    |
    UI elements – user interface elements – are a really important part of the design process. They are what we can call the face of interaction between your site and its users. Everything need to be well designed, positioned and planned. Drop downs, menus, search boxes, forms…all these elements need to be clear, easy to see and use and also beautiful, everything to get the viewers attention and get the results we want. Here we will list 25 websites that know how to give their users a nice experience with beautiful UI elements.

    Read more: CodrPC

    Posted via email from .NET Info

    10 Reasons Why Cloud is Changing IT

    |
    As we continue to see a rapid migration of infrastructure and services to the cloud, we list the top 10 reasons why cloud is changing the consumer and business landscape

    Read more: MICROSOFT GULF COMMUNITY BLOG

    Posted via email from .NET Info

    .NET Framework 4 Client Profile: The Devil Itself!

    |
    I am convinced that Microsoft’s decision to set the build profile of projects created with the Console Application template to “.NET 4 Client Profile” is a work of the devil itself! Why you might ask? Because it is set to this profile by default and because it will cause projects that should rightfully compile to fail, without an adequate explanation of why!

    Read more: Rantdriven.com

    Posted via email from .NET Info

    Prevent your Silverlight XAP file from caching in your browser

    |
    If you work with Silverlight daily then you have run into this problem. Your XAP file has been cached in your browser and you have to empty your browser cache to resolve it. This is highly irritating and there has to be a better way...

    Read more: Michael Crump

    Posted via email from .NET Info

    Using Templify and NuGet to automate and share Visual Studio Solution creation

    |
    In this blog post, I will cover two interesting tools that, when combined, can bring great value and speed at the beginning of any new software project that has to meet standards that are to be re-used for every project. The tools? Templify and NuGet.

    You know the drill. Starting off with a new project usually consists of boring, repetitive tasks, often enforced by (good!) practices defined by the company you work for (or by yourself for that company). To give you an example of a project I’ve recently done:

    Create a new ASP.NET MVC application in Visual Studio
    Add 2 new projects: <project>.ViewModels and <project>.Controllers
    Do some juggling by moving classes into the right project and setting up the correct references between these projects
    Maybe you are planning to use jQuery UI?

    Add the required JavaScript and CSS files to the project.
    Oh right and what was that class you needed to work with MEF inside ASP.NET MVC? Let’s add that one as well:

    Add the class for that
    Add a reference to System.ComponentModel.Composition to the project
    Admit it: these tasks are boring, time consuming and boring. Oh and time consuming. And boring. What if there were tools to automate a lot of this? And when I say a lot, I mean a LOT! Meet Templify and NuGet

    Read more: Tools for the lazy: Templify and NuGet

    Posted via email from .NET Info

    manage youtube using c# and youtube api 1.6

    |
    Introduction

    This is my first article. So please guide me to correct my mistakes.

    This code shows how to access youtube from desktop. Here you can perform same actions that can be done in youtube. Here I used YouTube API 1.6. Please download the same version. In latest version you will get some error when running the code.

    Using the Code

    This is a client application which intearct youtube using Youtube API 1.6 .Net client library. In this article I will explain about authentication, video feeds, displaying feeds and pagination.

    Basic Requirements

    .NET 2.0 runtime

    Youtube API 1.6 sdk

    Developer key (you can get it from here http://code.google.com/apis/youtube/dashboard/)

    Video player to play the video. You can use windows media player or flash player. Here i used shockwave player to play the video.

    After downloading and installing the Youtube SDK, Go to Installed location and you will find the DLLs that you need to get started in the distribution's Redist sub directory. Then open your IDE and add reference to the DLLs (I.e Google.Gdata.Client.dll, Google.Gdata.Extensions.dll, Google.Gdata.Youtube.dll)

    Read more: Codeproject

    Posted via email from .NET Info

    Mono 2.8.2 Released: Important Security Fix

    |
    We have just released Mono 2.8.2, it contains an important security fix for users of ASP.NET.

    We strongly advise every Mono 2.8.xx user to upgrade to Mono 2.8.2 if they host web applications with it. In addition, it also contains various updated to the Parallel Frameworks.

    Read more: Mono

    Posted via email from .NET Info

    Hunting for Bugs, but Found a Worm

    |
    Hi All, my name is Ron Riddle and I’m an Escalation Engineer on the core Windows team.  I worked an issue recently wherein a svchost.exe was crashing due to heap corruption; so, after enabling Page Heap and breaking out the services as needed, I received a user-mode dump that would show me the culprit.  I was expecting to find a legitimate bug either in our code or a third-party module; but, much to my surprise, I found that malware had caused a buffer overrun and the subsequent crash.  With that, I would like to share the simple approach I took in identifying the malware within the dump file.

    1. I start by dumping out the offending call stack.  Notice that the debugger wasn’t able to map the code addresses to a loaded or unloaded module.
    0:003> kbn
    # ChildEBP RetAddr  Args to Child            
    WARNING: Frame IP not in any known module. Following frames may be wrong.
    00 02bcfdcc 7c81a35f 02b7ae40 7c81a3ab 00000004 0x2b685b0
    01 02bcfde4 02b68bfe 02b7ae40 00000000 77e424ee ntdll!LdrpCallInitRoutine+0x21
    02 02bcfde8 02b7ae40 00000000 77e424ee 02b7ae10 0x2b68bfe
    03 02bcfdec 00000000 77e424ee 02b7ae10 00000000 0x2b7ae40

    2. Next, I try to learn more about the mystery address, such as what larger allocation it was a part of.
    0:003> !address 0x2b685b0
    Usage:                  <unclassified>
    Allocation Base:        02b60000
    Base Address:           02b61000
    End Address:            02b81000
    Region Size:            00020000
    Type:                   00020000    MEM_PRIVATE
    State:                  00001000    MEM_COMMIT
    Protect:                00000040    PAGE_EXECUTE_READWRITE

    3. By now, I am suspicious of a rogue module, so I proceed in searching the aforementioned address range for a DOS Signature(i.e. 0x5A4D or “MZ”) that I know any Portable Executable file must contain.  I start with the Base Address from the above output and use the Region Size to specify my range.
    0:003> s -a 02b61000 l20000/4 "MZ"
    02b615d8  4d 5a 90 00 03 00 00 00-04 00 00 00 ff ff 00 00  MZ..............
    02b61bd0  4d 5a 75 f4 5f 83 c4 08-c2 04 00 55 8d 44 24 0c  MZu._......U.D$.
    02b67cd0  4d 5a 0f 85 69 01 00 00-8b 4d 7c 8b 46 3c 81 c1  MZ..i....M|.F<..
    02b681bf  4d 5a 74 07 33 c0 e9 c9-01 00 00 8b 45 0c 56 8b  MZt.3.......E.V.

    4. Now that I have some hits, I’ll start with the first one and verify whether it’s a valid module.  Bingo!
    0:003> !dh -a 02b615d8

    File Type: DLL
    FILE HEADER VALUES
        14C machine (i386)
          5 number of sections
    37304740 time date stamp Wed May 05 08:27:28 1999

          0 file pointer to symbol table
          0 number of symbols
         E0 size of optional header
       2102 characteristics
               Executable
               32 bit word machine
               DLL

    OPTIONAL HEADER VALUES
        10B magic #
       7.00 linker version


    Read more: Ntdebugging Blog

    Posted via email from .NET Info

    Windows Phone 7 Design Guidelines – Cheat Sheet

    |
    One of the tasks I am trying to accomplish as I write the documentation to accompany the FuelTracker project, is to incorporate the design guidelines and certification requirements where they are pertinent. As a side effect of this effort, I’ve generated this little “cheat sheet” of various design hints and app requirements gleaned from these documents. Most of these hints pertain to issues we ran into when implementing Fuel Tracker so it assumes some basic familiarity with Silverlight controls and other features that are covered in detail in the design guidelines. I expect to be adding to this list, but  I am posting what I have so far, as I think it has some value.

    Navigation, frames and pages

    • Mockup the pages and navigational map of your application and walk through them several times before coding. This will minimize or eliminate the need to add pages or change the map later, when it will be much harder.
    • Make sure to consider the back button and user interactions with the application bar when creating your navigation map.

    Application Bar
    • Use the application bar button for common application tasks.
    • You are limited to four application bar buttons.
    • Place less frequently performed actions in the application bar menu.
    • If the action is difficult to clearly convey with an icon, place it in the application bar menu instead of as a button.
    • You are limited to five application bar menu items to prevent scrolling.
    • Standard application bar icons are installed as part of the Windows Phone Developer tools. Find them at C:\Program Files\Microsoft SDKs\Windows Phone\v7.0\Icons
    • Custom application bar icons should be 48 x 48 pixels and use a white foreground on a transparent background. You do not need the circle in the icon, as this is drawn by the application bar.

    Back button

    Read more: Silverlight SDK

    Posted via email from .NET Info

    What physical computer am I on?

    |
    Once you start to get more and more virtual machines, and more and more Hyper-V servers, in your environment it can get quite hard to keep track of where a specific virtual machine is actually running.
    System Center Virtual Machine Manager can help you out here – but what if you are not sitting at the  System Center Virtual Machine Manager Console?  What if you have used Remote Desktop to connect to the virtual machine?  What do you do then?
    A long, long time ago – I posted information on how to figure out the host operating system from inside a virtual machine using a VBScript on Virtual PC and Virtual Server.  And this script also works on Hyper-V!
    But no one uses VBScript anymore! Right?  So how do we do this in PowerShell?
    The answer is with a one-liner of course! (or actually – three one liners).

    To get the name of the physical computer that you are running on, open a PowerShell inside the virtual machine and type in:
    (Get-ItemProperty –path “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).PhysicalHostName

    You can also get the fully qualified name of the physical computer by running:
    (Get-ItemProperty –path “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).PhysicalHostNameFullyQualified

    Read more: Virtual PC Guy's Blog

    Posted via email from .NET Info

    From C/C++ to C#, libjpeg/libtiff’s journey from the unmanaged to managed world (Think “Porting code Tips and Tricks”)

    |
    This article describes a useful technics for transforming old-style C/C++ code to fully managed C# code. These methods were used for porting classic libjpeg and libtiff libraries to .NET Framework

    Table of contents

    Introduction
    1. Prerequisites
    2. Transfer process
    2.1 Removing the unnecessary code
    2.2 Preprocessor and conditional compilation.
    2.3 switch and goto operators
    2.4 Time to gather stones
    2.5 Preprocessor again and multiple inheritance
    2.6 typedef operator
    2.7. Pointer arithmetic
    2.8 Function pointers
    2.9 Isolation of the "problem code"
    2.10 Changing compiler
    2.11 Making it all work
    Introduction

    In this article I shall describe one of the methods that can be used to transform C/C++ code into C# code with the least amount of effort. The principles laid out in this article are also suitable for other pairs of languages, though. I want to warn you straight-off that this method is not applicable to porting of any GUI-related code.

    What is this useful for? For example, I have used this method to port libtiff, the well-known TIFF library, to C# (and libjpeg too). This allowed me to reuse work of many people contributed to libtiff along with the .NET Framework Class Library in my program. Code examples in my article are taken mainly from libtiff / libjpeg libraries.

    Read more: Adapting old code to new realities

    Posted via email from .NET Info

    Multi-language audio with IIS Smooth Streaming: An example from Radiovaticana Live Streaming

    |
    One of many useful features that comes with IIS Media Services 4.0 and Smooth Streaming is the ability to stream live and on-demand content with multiple language audio tracks that are selectable by the viewer.  An example of this capability is the recent schedule of events that Vatican Radio (http://www.radiovaticana.org/) delivered  during the last month. Vatican Radio delivered several events, such as Christmas night liturgical celebrations presided over by the Holy Father, World Day of Peace on January 1st, Jannuary 9 at 09.30 CET we have another event with the Pope,  and other events with multiple audio tracks (Natural Audio, Italian, English, French, German, Spanish, Portuguese and Arabic) was delivered during the last month. The player used for these events was based on the Silverlight Media Framework (SMF) and provides the viewer with the ability to select which audio track to listen to.

    The first publishing point on the IIS MS origin server provided a client manifest (.ismc file) of all the available tracks and the actual content to Silverlight media players. The second origin server publishing point had the Apple Devices Adaptive Streaming feature selected.  This enabled the origin server to do on-the-fly trans-muxing (repackaging from one file format to another) from the fragmented MP4 streams used by the Smooth Streaming format to the Apple HTTP Live Adaptive Streaming (HLS) format compatible with iPhone and iPad. It also created and published an HLS-compatible client manifest (.m3u8 file).  An HTTP CDN (content delivery network) pulled the content from the origin publishing points and distributed it to viewers on their Silverlight or iPhone/iPad clients.

    The Silverlight client player, based on SMF, read all tracks published in the manifest and transparently adapted the video quality as needed, based on the bandwidth available and video rendering capabilities of each client.  The player also offered the possibility to the viewer to choose the audio track.

    Read more: Giuseppe Guerrasio

    Posted via email from .NET Info

    Certificate management for developers

    |
    There’s no doubt that certificate management, when you haven’t futzed with it for some time, is a fun time…
    Raffaele Rialdi has the start of what looks like a promising tool to help manage the process of managing and deploying certificates for services (WCF) and a bunch of other tasks

    Read more: Raffaele Rialdi

    Posted via email from .NET Info

    Customizing Silverlight ChildWindow Style using Blend

    |
    Do you work with Child Window in Silverlight and want to customize the look & feel to match with your application UI? Then this post will help you to understand the process. I am going to discuss with you the customization steps in detail, so that, next time when you want to modify your Child Window UI, you will find it very useful.

    In this article, I will guide you through the steps of customization with the help of a sample application. We will need Microsoft Expression Blend for the full customization. Read the complete article to learn about it.


    Setting up the Basic Project

    Open your Expression Blend and create a new "Silverlight Application" project by specifying proper name, location and target version. Click "OK" and the IDE will create the Silverlight project for you.

    image%5B36%5D.png?imgmax=800

    Read more: Kunal's Blog

    Posted via email from .NET Info

    PostgreSQL performance considerations

    |
    There are a number of variables that allow a DBA to tune a PostgreSQL database server for specific loads, disk types and hardware. These are fondly called the GUCS (Global Unified Configuration Settings) and you can take a look via the pg_settings view. There are also a few of things that you can do in your application to get the most out of Postgres:

    Know the postgres index types
    By default CREATE INDEX will create B-tree indexes which will serve well for most cases where we use equality, inequality and range operators. However there are cases where you can build different indexing strategies with GiST (Generalized Search Tree) indexes. For example, Postgres ships with built in GiST operator classes for geometric operators — for dealing with the geometric types like point, box, polygon, circle, and others. There are more interesting GiST index examples in the contrib packages for things like textual search, tree structures, and more.

    Read more: GIANT ROBOTS

    Posted via email from .NET Info

    The Visual C++ Weekly Vol. 1 Issue 2 (Jan 8, 2011) Is Out

    |
    C++ MVP Kenny Kerr starts a new series on modern Windows development with C++0x. Intel features a highly parallel optimized crowd simulation technique. Get All-In-One: a code sample library for Microsoft development technologies. C++ MVP Kate Gregory shares a “lost+found” ISO technical report on C++ performance. And much, much more in the current issue of The Visual C++ Weekly.

    Read more: The Visual C++ Weekly Vol. 1 Issue 2

    Posted via email from .NET Info