Philosophy Path.Combine in .Net

Generally most of the codes of the following methods to create a path to use:

string path = somePath + "\\" + filename;

But if the program is run under Mono on Linux problem on the Linux route because this time there are as follows:

/somepath/filename

 

 

It is therefore recommended for paths in your program, Path.Combine method in the System.IO namespace to use.Because this method of preparation of the final values ​​Path.VolumeSeparatorChar Path.DirectorySeperatorChar and uses. The values ​​in Windows (\) and Linux (/) varies automatically at runtime by the framework will be used by management.
The other advantage of using Path.Combine, the input is valid, this means that if the unauthorized use of characters, an exception will be issued.
Just add another one might not be bad and it is Environment.NewLine philosophy. The usual practice is that a new row with \n at the end of a string, but this is not always true and in different platforms. Windows Environment.NewLine equal \r \n and Unix-based systems in equal \n will be. Therefore it is better instead of the \n use of Environment.NewLine for the construction of new lines.

Static code analysis for C++

Static analysis of C/C++ code. Checks for: memory leaks, mismatching allocation-deallocation, buffer overrun, and many more. The goal is 0% false positives. See the wiki for more information.
The two versions command line and GUI versions are offered with the UI it uses QT.
22 had a bug in the Linux kernel discovered and resolved by the program and
also in many other open source programs have been used.

cppcheck-1.48-x…msi

In your opinion, how many CLR object can be created in one second?

The following console application and two copies conventional parallel processing version of a simple test for this measure provides:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;

namespace ObjectInitSpeedTest
{
    class Program
    {
        static void Main()
        {
            normalSpeedTest();
            parallelSpeedTest();
            Console.Title = "CLR Speed test";
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("http://www.ehsanenaloo.com");
            Console.WriteLine("Press any key ...");
            Console.ReadKey();
        }

        private static void parallelSpeedTest()
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("ParallelSpeedTest");

            long totalObjectsCreated = 0;
            long totalElapsedTime = 0;

            var tasks = new List<Task>();
            var processorCount = Environment.ProcessorCount;

            Console.WriteLine("Running on {0} cores", processorCount);

            for (var t = 0; t < processorCount; t++)
            {
                tasks.Add(Task.Factory.StartNew(
                () =>
                {
                    const int reps = 1000000000;
                    var sp = Stopwatch.StartNew();
                    for (var j = 0; j < reps; ++j)
                    {
                        new object();
                    }
                    sp.Stop();

                    Interlocked.Add(ref totalObjectsCreated, reps);
                    Interlocked.Add(ref totalElapsedTime, sp.ElapsedMilliseconds);
                }
                ));
            }

            Task.WaitAll(tasks.ToArray());

            Console.WriteLine("Created {0:N} objects in 1 sec\n", (totalObjectsCreated / (totalElapsedTime / processorCount)) * 1000);
        }

        private static void normalSpeedTest()
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("NormalSpeedTest");

            const int reps = 1000000000;
            var sp = Stopwatch.StartNew();
            sp.Start();
            for (var j = 0; j < reps; ++j)
            {
                new object();
            }
            sp.Stop();

            Console.WriteLine("Created {0:N} objects in 1 sec\n", (reps / sp.ElapsedMilliseconds) * 1000);
        }
    }
}

Sinofsky shows off Windows 8 at D9

Microsoft gave an early demonstration of the new look and capability of the next generation of Windows today at the D9 conference.

President of Windows Steven Sinofsky also gave an early preview even before he took the stage in Rancho Palos Verdes, Calif., to his conference hosts at the All Things D blog. For now it’s called Windows 8, but Sinofsky says that’s just a code name.

“We tried with Windows 8 to re-imagine how you work with a PC,” Sinofsky said on stage during an interview with D9 host Walt Mossberg.

The first noticeable change is the start menu (pictured above), which has been drastically altered to look a lot more likeWindows Phone 7. As for other changes, the system requirements for Windows 8 won’t be more than what’s required for a PC to run Windows 7. It will run on Intel, AMD processors, and ARM chips, something we learned earlier this year. The development platform is based on HTML5 and JavaScript. Any applications created for a touch (tablet) interface can also work with a mouse and keyboard. There’s also an option for a split virtual keyboard for typing on a tablet.

He says it will work on laptops, desktops, and tablets, and that everything that worked with Windows 7 will work with the next-generation OS as well. When using existing desktop applications, the interface goes to a very Windows 7-like desktop.

 

 

To log in to Windows 8 requires just a swipe up from the bottom of the screen. Applications will be launched from a series of tiles. Included in the the start-up menu tiles is a direct link to a Microsoft Store, which suggests Microsoft will have its own version of an online application store, similar to the Mac App Store.

While Internet Explorer 10 has been redesigned to take advantage of a touch interface for tablets using Windows 8, the Office suite of productivity applications did not get any makeover for the occasion.

As for when it will arrive, Sinofsky told the audience that refreshing Windows “every two or three years is good,” but that it would not be ready this fall. That would place its launch sometime next year.

Microsoft making it easier to port iPhone apps to Windows Phone

One of Microsoft’s problems in attracting people to write Windows Phone 7 applications is that the user base is much smaller than those of the iPhone or Android, so app developers tend to focus on those platforms. Now, Microsoft is tryin

g to make it easier for people to take the apps they’ve developed for the iPhone and make them work on Windows Phone.

With the iPhone/iOS to Windows Phone 7 API (application programming interface) mapping tool, released on Friday, developers have a new online resource for doing this conversion.

Essentially, the API mapping tool works like a foreign-language dictionary, said Jean-Christophe Cimetiere, Microsoft senior technical evangelist for interoperability. Developers can go through the code of their iPhone app and find the equivalent API calls for a Windows Phone 7 app.

“For this first round we focused on identifying the one-to-one mapping when it exists,” Cimetiere wrote in a blog post. “In the following versions we’ll expand the scope and anytime the concepts are similar enough, we’ll do our best to provide the appropriate guidance.

“Of course, this is a work in progress, coverage will expand and more iOS APIs will be mapped soon.”

More information on the tool is available on the Windows Phone Developer Blog.

Check security while using jQuery Ajax

I understand where Web services used by the script actually calls the current site and not by an external program?

Here we can help the source of ASP.NET MVC was: (+). IsAjaxRequest same method in both ASP.NET Webforms can be used:

public static bool IsAjaxRequest(this HttpRequestBase request)
{
if (request == null)
{
throw new ArgumentNullException("request");
}
return (request["X-Requested-With"] == "XMLHttpRequest") ||
((request.Headers != null) &amp;&amp; (request.Headers["X-Requested-With"] == "XMLHttpRequest"));
}

IsAjaxRequest result should be the beginning of all requests received. Of course, had to be careful that this study can be easily bypassed (because headers have been based), but still is better than no surveillance.

The State of Windows 8

Only Microsoft knows how the next version of its Windows operating system will look and what it will be called, but big changes could be ahead for the OS that observers refer to as “Windows 8.”
At this year’s Consumer Electronics Show in Las Vegas, Microsoft announced that Windows 8 will support system-on-a-chip architectures using ARM processors. Unlike the x86 architecture that today’s Windows laptops and desktops work with, ARM-based chips tend to run such low-power devices as tablets and smartphones.
In his CES keynote speech, Microsoft CEO Steve Ball­mer said, “This announcement is really all about enabling a new class of hardware, and new silicon partners for Windows, to bring the widest possible range of form factors to the market.”
In other words, Windows won’t be just for laptops and desktops anymore.
Actual Facts
Microsoft’s ARM announcement represents the firm’s only officially released factual detail about Windows 8. Consistent with it, the company named Nvidia, Qualcomm, and Texas Instruments as silicon partners, so Windows devices built upon their three low-power platforms are likely.
At an architectural summit in London last year, Microsoft en­­couraged the idea of virtualizing Windows more heavily, possibly storing apps, data, Windows settings, and parts of the OS itself in the cloud.
Rumors
No rumor about Windows 8 is more precise than a series of leaked slides that supposedly provide a blueprint for Microsoft’s next OS. The slides alone don’t indicate final features of Windows 8, but they do show where Microsoft is headed, especially since other reports have corroborated them.
One slide, for example, talks about an OS that follows users wherever they go; instead of being tethered to hardware, users may roam between desktops, laptops, and tablets in whatever way is most convenient.
Another slide speaks of a reset button that preserves apps and settings while wiping out viruses and other hindrances. Some industry watchers suggest that storing apps and data in the cloud could make this feature possible.
As for Microsoft’s goal of “instant on” computing, blogger Manan Kakkar spotted a Microsoft patent for using a hypervisor-another virtualization method-to split the operating system into a general-purpose OS and a number of appliancelike applications, such as for TVs and tablets. Those uses, Kakkar says, could switch on instantly even if the core OS took 30 seconds to start up.
How will Microsoft achieve these lightweight versions of its operating system? A ru­­mor circulated by Paul Thurrott posits that Windows 8 will introduce a tile-based interface called “Mosh” to serve as an alternative UI for tablets and other low-power touchscreen devices.
We’ve also heard rumblings about a new application de­­velopment framework code-named “Jupiter,” whose goal is to help developers create dynamic, visually appealing, and immersive applications for a forthcoming Windows app store. It may also be an attempt by Microsoft to enable developers to create apps that work on both traditional x86-based CPUs and ARM-based processors without extensive recompiling and reprogramming.
Speculation
If you doubt whether Windows 8 will be a profoundly different operating system from its predecessors, consider this breathless bit of hype that briefly appeared on a Microsoft developer’s blog in 2009:
“The minimum that folks can take for granted is that the next version will be something completely different from what folks usually expect of Windows…The themes that have been floated truly reflect what people have been looking [for] for years and it will change the way people think about PCs and the way they use them. It is the future of PCs.”
Microsoft quickly removed the blog, as if to erase the evidence. So is the company really trying to shake things up with Windows 8?
The Big Picture
Microsoft clearly wants to create an operating system that scales between devices. ARM support provides the foundation, and cloud services could be a major building block. The challenge for Microsoft will be to leave the core Windows experience and legacy compatibility intact while also pursuing its lofty ambitions.
A final rumor: Reportedly, Microsoft is targeting a 2012 release for Windows 8. Think the company can get everything figured out by then?

The State of Windows 8Beneath a thin surface layer of established fact about Microsoft’s next OS lies a deep pool of rumor and speculation. We plunge in to test the water.By Jared Newman, PCWorld    Jan 25, 2011 5:00 am
Only Microsoft knows how the next version of its Windows operating system will look and what it will be called, but big changes could be ahead for the OS that observers refer to as “Windows 8.”
At this year’s Consumer Electronics Show in Las Vegas, Microsoft announced that Windows 8 will support system-on-a-chip architectures using ARM processors. Unlike the x86 architecture that today’s Windows laptops and desktops work with, ARM-based chips tend to run such low-power devices as tablets and smartphones.
In his CES keynote speech, Microsoft CEO Steve Ball­mer said, “This announcement is really all about enabling a new class of hardware, and new silicon partners for Windows, to bring the widest possible range of form factors to the market.”
In other words, Windows won’t be just for laptops and desktops anymore.
Actual FactsMicrosoft’s ARM announcement represents the firm’s only officially released factual detail about Windows 8. Consistent with it, the company named Nvidia, Qualcomm, and Texas Instruments as silicon partners, so Windows devices built upon their three low-power platforms are likely.
At an architectural summit in London last year, Microsoft en­­couraged the idea of virtualizing Windows more heavily, possibly storing apps, data, Windows settings, and parts of the OS itself in the cloud.
RumorsNo rumor about Windows 8 is more precise than a series of leaked slides that supposedly provide a blueprint for Microsoft’s next OS. The slides alone don’t indicate final features of Windows 8, but they do show where Microsoft is headed, especially since other reports have corroborated them.
One slide, for example, talks about an OS that follows users wherever they go; instead of being tethered to hardware, users may roam between desktops, laptops, and tablets in whatever way is most convenient.
Another slide speaks of a reset button that preserves apps and settings while wiping out viruses and other hindrances. Some industry watchers suggest that storing apps and data in the cloud could make this feature possible.
As for Microsoft’s goal of “instant on” computing, blogger Manan Kakkar spotted a Microsoft patent for using a hypervisor-another virtualization method-to split the operating system into a general-purpose OS and a number of appliancelike applications, such as for TVs and tablets. Those uses, Kakkar says, could switch on instantly even if the core OS took 30 seconds to start up.
How will Microsoft achieve these lightweight versions of its operating system? A ru­­mor circulated by Paul Thurrott posits that Windows 8 will introduce a tile-based interface called “Mosh” to serve as an alternative UI for tablets and other low-power touchscreen devices.
We’ve also heard rumblings about a new application de­­velopment framework code-named “Jupiter,” whose goal is to help developers create dynamic, visually appealing, and immersive applications for a forthcoming Windows app store. It may also be an attempt by Microsoft to enable developers to create apps that work on both traditional x86-based CPUs and ARM-based processors without extensive recompiling and reprogramming.
SpeculationIf you doubt whether Windows 8 will be a profoundly different operating system from its predecessors, consider this breathless bit of hype that briefly appeared on a Microsoft developer’s blog in 2009:
“The minimum that folks can take for granted is that the next version will be something completely different from what folks usually expect of Windows…The themes that have been floated truly reflect what people have been looking [for] for years and it will change the way people think about PCs and the way they use them. It is the future of PCs.”
Microsoft quickly removed the blog, as if to erase the evidence. So is the company really trying to shake things up with Windows 8?
The Big PictureMicrosoft clearly wants to create an operating system that scales between devices. ARM support provides the foundation, and cloud services could be a major building block. The challenge for Microsoft will be to leave the core Windows experience and legacy compatibility intact while also pursuing its lofty ambitions.
A final rumor: Reportedly, Microsoft is targeting a 2012 release for Windows 8. Think the company can get everything figured out by then?

Source : www.pcworld.com

Intel finds Sandy Bridge chipset design flaw, shipments stopped and recalls beginning

A problem requiring a “silicon fix” is bad news in the chipset business, and sadly that’s what Intel is announcing. Its new Intel 6 Series chipset, Cougar Point, has been found to have a flaw, something to do with the SATA controller. Intel is indicating that the ports can “degrade over time,” leading to poor i/o performance down the road. All shipments have been stopped and a fix has been implemented for new deliveries, but it sounds like recalls will be starting soon for those with this ticking time bomb silicon within. It isn’t a critical problem right now, though, so if you own a Sandy Bridge Core i5 or Core i7 system keep computing with confidence while looking for a recall notice, but it is bad news for Intel’s bottom line: the company is advising a $300 million hit to revenue.

Family Processor Number Code Name
Intel® Core™ i7 Mobile Processor i7-2655LE Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2610UE Sandy Bridge
Intel® Core™ i5 Mobile Processor i5-2540M Sandy Bridge
Intel® Core™ i5 Mobile Processor i5-2520M Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2620M Sandy Bridge
Intel® Core™ i3 Desktop Processor i3-2100 Sandy Bridge
Intel® Core™ i3 Desktop Processor i3-2100T Sandy Bridge
Intel® Core™ i3 Desktop Processor i3-2120 Sandy Bridge
Intel® Core™ i5 Desktop Processor i5-2390T Sandy Bridge
Intel® Core™ i5 Mobile Processor i5-2510E Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2629M Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2649M Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2657M Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2617M Sandy Bridge
Intel® Core™ i5 Mobile Processor i5-2537M Sandy Bridge
Intel® Core™ i5 Mobile Processor i5-2515E Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2720QM Sandy Bridge
Intel® Core™ i5 Desktop Processor i5-2300 Sandy Bridge
Intel® Core™ i5 Desktop Processor i5-2400 Sandy Bridge
Intel® Core™ i5 Desktop Processor i5-2400S Sandy Bridge
Intel® Core™ i5 Desktop Processor i5-2500 Sandy Bridge
Intel® Core™ i5 Desktop Processor i5-2500K Sandy Bridge
Intel® Core™ i5 Desktop Processor i5-2500S Sandy Bridge
Intel® Core™ i5 Desktop Processor i5-2500T Sandy Bridge
Intel® Core™ i7 Desktop Processor i7-2600 Sandy Bridge
Intel® Core™ i7 Desktop Processor i7-2600K Sandy Bridge
Intel® Core™ i7 Desktop Processor i7-2600S Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2630QM Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2820QM Sandy Bridge
Intel® Core™ i7 Mobile Processor Extreme Edition i7-2920XM Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2635QM Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2710QE Sandy Bridge
Intel® Core™ i7 Mobile Processor i7-2715QE Sandy Bridge
Intel® Core™ i3 Mobile Processor i3-2310E Sandy Bridge

Source: engadget

IIS Express Windows Authentication

option-1: edit My Documents\IISExpress\config\applicationhost.config file and enable windowsAuthentication

option-2: Unlock windowsAuthentication section in My Documents\IISExpress\config\applicationhost.config and add following in web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
    <security>
      <authentication>
        <windowsAuthentication enabled="true" />
      </authentication>
    </security>
    </system.webServer>
</configuration>

Using IIS Express 7.5 in VS.NET

A Visual Studio 2010 Service Pack (which at the time of writing this beta version of its proposed), a new option to right click menu on project name in the name of VS.NET Use IIS Express, has added up could be easily This new option can be used (or in other words is integrated with IIS Express and requires no special regulation).
In other states (and copies, and that there will be no integration) can be acted as follows:
First method:
Following command on the command line Enter:
“C:\Program Files\IIS Express\iisexpress.exe” /path:D:\Projects\Test\MySiteTest\ /port:4986 /clr:v4.0

The case for providing accessible web server path mentioned site on port 4986(http://localhost:4986/) based on NET 4 will be established (for example for three and a half NET v3.5 Enter amount .)
Second method:
which in fact provide the first method behind the scenes it is temporary.
A) The first path My Documents \ IISExpress \ config file referred applicationhost.config open. Then tie the findings related to the site (about 153 rows) and select delete serverAutoStart:
<site name="WebSite1" id="1">
              <application path="/">
                  <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
              </application>
              <bindings>
                  <binding protocol="http" bindingInformation=":8080:localhost" />
              </bindings>
</site>

B) setting the desired site to manually add the file. For example:

<site name="WebSite2" id="2">
              <application path="/" applicationPool="Clr4IntegratedAppPool">
                  <virtualDirectory path="/" physicalPath="D:\Projects\Test\MySiteTest\" />
              </application>
              <bindings>
                  <binding protocol="http" bindingInformation=":Test:localhost" />
              </bindings>
</site>

Slider by webdesign