Skip to content

images Philosophy Path.Combine in .Net

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

1
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:

1
/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.

VN:F [1.9.17_1161]
Rating: 9.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: +2 (from 2 votes)

Popularity: 6% [?]

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.
untitled Static code analysis for C++
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

VN:F [1.9.17_1161]
Rating: 9.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Popularity: 5% [?]

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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);
        }
    }
}

2011 06 14 8 11 11 PM In your opinion, how many CLR object can be created in one second?

VN:F [1.9.17_1161]
Rating: 5.5/10 (2 votes cast)
VN:F [1.9.17_1161]
Rating: -1 (from 1 vote)

Popularity: 6% [?]

phpwCSiTPWindows 8 start menu 610x343 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.

 

1 Sinofsky shows off Windows 8 at D9

 

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.

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Popularity: 5% [?]

winphone logo 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.

VN:F [1.9.17_1161]
Rating: 8.0/10 (1 vote cast)
VN:F [1.9.17_1161]
Rating: +1 (from 1 vote)

Popularity: 4% [?]

Slider by webdesign