jeffcogswell 175 Light Poster Featured Poster

When I was studying computer programming in college many years ago, I didn't imagine that our work could impact lives, particularly in a negative way. We've heard reports (mostly true) of death, dying, and destruction as a result of software problems, such as the time a plane flew right into a mountain due to the users not being informed of changes to the software. (For more interesting tidbits, check out the check out this Software Horror Stories page .)

We can never predict what kind of bizarre things will happen as a result of software bugs, but today's news is certainly odd: This weekend daylight savings time ended in many parts of the world (but not in the US yet), and the Apple iPhone's alarm didn't handle it properly. When I travel, I almost always rely on my phone's alarm to get me up at the right time. But apparently a lot of people use their phones every day. And yesterday morning millions of Europeans didn't wake up at the right time thanks to the iPhone bug .

Prior to about--oh, I don't know--1970?, there was an easy answer: Just avoid software if your life depends on it. But that, of course, isn't possible today. Nearly everything we use today runs on software. Just in my house alone, I can think of many things that rely on software: The TV (and the gazillion things hooked up to it), the microwave oven, the regular oven, the …

jeffcogswell 175 Light Poster Featured Poster

reinders.png Here at DaniWeb, we've talked a lot about Intel Parallel Studio . I recently had the chance to sit down with Intel's James Reinders, and find out more about his take on Parallel Studio 2011 . Mr. Reinders (pronounced Rhine-ders) is a senior engineer at Intel and has been with the company since 1989. He's the "chief evangelist" for their Parallel Studio product, so as you can imagine, he had a lot to say about it. We had a great interview, and here's what came out of it.

DaniWeb (JC): You wrote an O'Reilly book. Tell me a little bit about what that is.

Reinders: It's a nutshell book. Its title is Intel Threading Building Blocks: Outfitting C++ for Multi-core Processor Parallelism. It came out about 3 and a half years ago at the same time that we open-sourced Threading Building Blocks. It's what we thought of as a complete set of what you need to add to C++ to do parallel programming effectively. We've got algorithms; we've got data structures because STL is not thread safe, which required fixes on data structures; we've got portable locks and atomic operations. And by "portable" I mean the language doesn't define how to do an atomic operation or lock, so you tend to use critical sections on Windows, and mutexes on Linux. Then the next thing you know you've got code that doesn't compile in both places unless you do #ifdef's all over. …

WASDted commented: nice interview Jeff!! +1
Intrade commented: Very good report on the Interview. Please keep these coming! +2
kvprajapati commented: Nice talk. +11
jeffcogswell 175 Light Poster Featured Poster

Hi!

I did some checking around for you, and I was told that they *are* developing various aspects of Parallel Studio for Linux. I think that will include Cilk+. I'm not sure the data we should see it, but I'm thinking it'll be early 2011.

Jeff

jeffcogswell 175 Light Poster Featured Poster

bjarne2.jpg Almost every programmer knows his name. He's a living legend in computers. His name is Bjarne Stroustrup, and he created the world's most popular programming language, C++. I had a chance to ask him a few questions. The first three of the questions I came up with, and the remainder I selected from the numerous questions suggested by DaniWeb community members. So sit back, and listen to the words of one of the greatest programming masters ever. (My questions are noted with "JC"; questions from the DaniWeb community are noted as "DW".)DANIWEB (JC): On your home page for your teaching, I see you're doing research in scalable parallel software. I know that parallel processing is now a reality for most desktops, with multi-core processors now common. I was wondering if you might tell us just a bit about that, such as what you're exploring right now in that field, and what exciting things are going on that might spark some interest in parallel programming with our readers?

STROUSTRUP: I work on several distinct approaches to dealing with concurrency: parallel computation in the context of traditional numerical/scientific applications, standardization of conventional threads-and-locks approaches to concurrency, and lock-free programming (primarily to support the implementations of higher-level approaches to concurrency). In fact, I have worked with concurrency on and off since my student days where I did my PhD on concurrency topics.

In the parallel programming areas my main contribution aims to support Lawrence Rauchwerger's STAPL library and …

jonsca commented: Excellent use of DW questions +5
Antenka commented: Well done! :) +2
jeffcogswell 175 Light Poster Featured Poster

product_suite_image1[1].jpg Since the release of the second edition of Parallel Studio this month, I've spent a good amount of time with it, trying out the new features.

First, what's Parallel Studio? It's an add-in for Microsoft Visual Studio that gives you a large set of features for writing parallel code that targets multiple processor cores. It includes a new C++ compiler that gets run instead of the built-in Visual C++ compiler, allowing you to take advantage of several new features. Parallel Studio integrates with all the recent versions of Visual Studio: 2005, 2008, and 2010.

Parallel Studio 2011, which is the second version, is a significant improvement over the first version. The new features are:Cilk Plus: New C++ keywords (called Cilk Plus) that simplify the writing of parallel, threaded code.

BPP: Parallel Studio includes an entire template library called Parallel Building Blocks (PBB). PBB is built on Threading Building Blocks 3.0, an open-source threading library that was also created by Intel, along with Array Building Blocks. This threading library includes several classes that are similar to the ones in the standard C++ library, with the difference being they are totally thread-safe and will, when possible, run simultaneously on multiple cores. This takes away a lot of the hard work of programming for multiple threads, and that's one of the primary goals of Intel Parallel Studio 2011.

Intel Parallel Advisor: This is all new for 2011. (The earlier version included a "Lite" version.) The idea …

ndeniche commented: Nice!! Will totally try it out!! +6
jeffcogswell 175 Light Poster Featured Poster

I'm still here at the Intel Developer Forum (IDF) 2010, and just had the chance to try out something cool. The Intel Atom processors are lightweight x86 processors for use in a whole range of small devices. And being x86-based, they can run modern desktop operating sytesms.

At the beginning of 2010, Intel released the n450 version of the Atom. And to help engineers and hobbyists get started, they've created a "development board" which is a small circuit board containing an Atom processor, 1G of SO-DIMM memory, and several ports including USB 2.0 ports, a video port, and two ethernet ports. Optionally, you can get the board inside a handy, durable plastic case.

What's the point of this? To experiment building your own Atom-based devices. Here at IDF, they had a hands-on lab where you get to play with it. When I think back to my college days in the late 1980s, I was originally going into computer hardware engineering, not programming. And we were working with all sorts of devices and chips and circuit boards. But to build our own computer-powered devices required huge amounts of work that probably included burning yourself with a soldering iron. Getting software onto the device was practically an afterthought (assuming you had any hair left on your head after building your device).

But now the line has blurred between hardware and software engineer. Much of the computer itself is already built for you and lives inside the Atom chip itself. So here in …

jeffcogswell 175 Light Poster Featured Poster

meego.jpg In the past, the wordembedded was limited to specialty devices that a lot of us used, but few programmers really cared about. Embedded devices meant things like the controllers on your microwave oven or the computer that ran your car's fuel injection system. There are certainly a lot of software engineers working in that realm, but for those of us who program for PCs, we had little interest in embedded technology.

But that is all changing thanks to the huge number of handheld devices that need programming. While most of us still won't be writing at the assembly-language level, opting instead for high level languages such as C++, Objective C, or C#, we will, nevertheless, likely be making the transition to embedded programming.

atom_cores.jpg That's why we need to know about Intel's Atom processor. The Atom processor is an x86-based processor (and now dual-core!), but it's used in small devices, whether it's a phone, a netbook, a slate computer, or even any number of other devices. (Here at Intel IDF they showed us a motorcycle with an on-board Atom processor that reports data back to the racing team.)

Or how about this application: In-vehicle Infotainment. (That's Intel's exact wording.) A company called HawTai is developing a car that comes standard with a computer that includes navigation, real-time weather, and entertainment, all powered by an Atom processor running the MeeGo operating system. (MeeGo is Linux-based.) And similarly, Delphi (the car parts company, not …

jeffcogswell 175 Light Poster Featured Poster

Parallel-Studio-2011.gif Today at Intel's IDF 2010 was the official launch of the 2011 version of Intel Parallel Studio. Parallel Studio is a set of tools that enhance Visual Studio to support full parallel programming.

This is more than just a simple plug-in for Visual Studio. It's an entire set of tools covering the entire development workflow. In terms of parallel development, these steps are design, build and debug, verify, and tune.

For designing, you have the Intel Parallel Advisor, which sismplifies the process of adding parallelism to your application. For the build and debug phase, you have the Parallel Composer. Together those two tools help you create software that runs in parallel. But what exactly do we mean by parallel? The individual cores of, for example, a quad-core processor are essentially separate processors all on a single chip. A well-designed program, then, can take advantage of these multiple cores. For instance, a computationally-intensive loop can run its separate iterations in separate cores simultaneously, completing the task in a shorter time. parallel2.jpg Of course, if you're doing computations in a loop, it's probably not just a simple matter of running the iterations concurrently in separate cores, as each iteration might rely on the results of earlier iterations. But that's not a problem with the help of tools shipping with the new 2011 version of Parallel Studio. There's an entire library available called the Parallel Building Blocks that makes such computations easy. Combine that with …

Ancient Dragon commented: Nice info :) +33
jeffcogswell 175 Light Poster Featured Poster

Intel-Atom_0.jpg I'm here at the Intel Developer Forum 2010 in San Francisco, and this has been a great opportunity for a programmer such as myself. While most programmers might think of Intel as a hardware manufacturer and look to other companies (such as Microsoft) for their development tools, in fact that couldn't be further from the truth. In addition to creating some amazing hardware technology, Intel has a huge set of tools for developing software that runs on the devices and computers powered by their technology.

One such such device that has a whole set of tools is the Atom processor. The Atom is a very low-power x86-based processor meant for handheld devices, netbooks, and anything else that needs the power of x86 but without the overhead of a full microprocessor. (For example, here at the conference one company is presenting a pretty cool digial music stand that contains a dual-core Atom processor. Yes, dual core. Sweet.)

While not new (the first Atom was introduced in 2008), Intel has several developer programs for the Atom that they're continuing to role out. I had the opportunity to attend a presentation by Intel's Bill Pearson where he gave an hour-long introduction to developing for the Atom.

The developer program includes a complete app store, where you can publish and sell your Atom-powered apps. But what's cool about this particular app program is that you can also create components that other programmers can use and make …

jeffcogswell 175 Light Poster Featured Poster

I'm here at the IDF 2010 conference in San Francisco, and during this morning's keynote session, I had to the opportunity to see some pretty cool technology. One of the things that they demonstrated was essentially the next generation of handheld game controllers. Think of the Wii remotes, but with more accuracy in 3 dimensions. Wii remotes use triangulation and technically only detect two dimensions (although clever programming in the Wii helps pick out a certain amount of a third dimension). But these devices they demonstrated had full three dimensional handling.

The new technology relies on the latest and greatest Intel technology, called Sandy Bridge. That might seem surprising since we're talking about game controllers, but that's precisely the point being made at this conference: The technologies are converging into single chips and platforms. The new Sandy Bridge generation of Intel technology covers multi-core technology, graphics, and floating point processing all on a single chip, making the chips usable in a wide range of applications, and removing the need for specialized chips. In the past we saw chips devoted to graphics, chips devoted to floating point operations (such as in digital signal processing designs), and so on. But now the individual chips can handle all of this. So Intel's idea is this: Why build specialized chips and platforms when the current processor can do it all for you? That leaves programmers able to build powerful applications and focus on the "what" rather than the "how". Need powerful image analysis …

jeffcogswell 175 Light Poster Featured Poster

I'm biased towards C++ All-in-One for Dummies.

Jeff Cogswell (Author, C++ All-in-One for Dummies. :-D)

jeffcogswell 175 Light Poster Featured Poster

mssdl.jpg In a blog posting August 26, Microsoft announced that it is revising the licensing terms of its Security Development Lifecycle, moving parts of it to a Creative Commons license.

Security Development Lifecycle is a methodology that Microsoft developed that incorporates best security practices at every level of the development lifecycle when security is important--such as in secure business environments or where personally identifiable information is vital.

The methodology includes a set of documentation explaining the process and how to follow it, as well as a set of software tools to help in the software development. But there's always been a catch: While Microsoft certainly wanted organizations to use this methodology, companies weren't allowed to create their own internal documentationbased on the methodology's documentation without express written consent from Microsoft (even if the documentation would be internal to the company).

That certainly seems a little silly; every large company creating software creates its own internal documentation, and such documentation often includes their own adaptation of a particular software development methodology. So if a company uses the Microsoft SDL, most likely they would produce their own documentation based on the existing SDL documentation. But up until now that was technically illegal.

Fortunately, Microsoft realized how absurd that was, and today announced that they have modified the license. While the tools are still proprietary, the documentation itself now has a Creative Commons license. The short story is now that companies that based their own internal processes on this …

jeffcogswell 175 Light Poster Featured Poster

Rapid Application Development has come a long way since the early days of Delphi and Visual Basic in the mid 1990s. I remember those days well, as I immersed myself in Pascal development with the original Delphi back in 1995 and even wrote a couple of books about it. Delphi was created by Borland, and then, after Borland changed its name twice (first to Inprise, then back to Borland), Delphi was later moved to a new company spun off by Borland in 2006 called CodeGear. CodeGear was then bought by Embarcadero Technologies in 2008. Today Delphi and its descendants are produced by Embarcadero.

The modern descendant of Delphi is called Rad Studio XE, which was just announced today. It will encompass most of the incarnations of Delphi, including Delphi itself for Pascal development, C++Builder for C++ development, Delphi Prism for developing .NET and Mono software, and RadPHP for PHP development.

Although the product won't be available until mid-September, Embarcadero has released the first of three "sneak preview" videos to show off some of the product's features.

Among the new features are version control (through Subversion), new debugging features, code editor enhancements, and, perhaps the most interesting, rapid development through RadPHP.

Based on the video, it appears the Subversion integration is pretty good. The demo machine had a copy of TortoiseSVN installed and all set up. Inside RAD Studio, the project tree included menu options for checking a project into SVN, checking out files, committing changes, and all that good stuff …

jeffcogswell 175 Light Poster Featured Poster

Yes! I agree with what you say. That was kind of my point when I said, "Now the best solution in this case is to fix the problem by making Beetle derived from Car just like the other two classes." Although I didn't mention interfaces, the point applies there too.

The main point here is to help people understand what exactly interfaces are before venturing into realms of COM interop, calling python .py files, and so on. I'm planning to write a second article later that takes the readers to the next step -- now that they understand the dynamic types, here's the ideal place to use them, calling python, etc.

Jeff

jeffcogswell 175 Light Poster Featured Poster

With the recent release of Visual Studio 2010, Microsoft has updated.NET and the C# language, both now at version 4. One of the new features of C# is the ability to handle dynamic types. But what exactly does that mean?

Essentially, if you're very careful, you can use C# in a manner similar to languages such as Python or even Smalltalk. Normally, without dynamic types, the compiler does all your type checking for you and won't compile the code if there are typing errors. For example, if you have something like this in your C# program:

Myobj.SomeFunction();

the C# compiler will make sure whatever class Myobj belongs to actually has a function called SomeFunction. If not, the compiler will issue a compiler error and refuse to build your program.

Normally compile-time type checking is a good thing, because it helps us programmers keep from writing sloppy code. But there are times when you might need to get around it.
Look closely at the following code. Notice the base class Car, and the three classes that follow it. Then notice the shop function, and how I use that function in Main.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace dynamictypes
{

    class Car{
        public virtual string tuneup() { return "fixed"; }
    }

    class Mustang : Car {
        public override string tuneup() { return "good to go"; }
    }

    class Pinto : Car
    {
        public override string tuneup() { return "yee haw"; }
    }

    class Beetle
    {
        public string tuneup() …
ddanbe commented: Keep up the good work! +7
jeffcogswell 175 Light Poster Featured Poster

Hi Sridhar, can you post your code so we can take a look at it?

In general, if you use the AJAX XMLHttpRequest object (or a library that encapsulates the AJAX functionality), you should be fine. The object should make the call and return the results in a function, instead of loading the page in the browser. If you post your code, I can take a look at it and give some tips.

Jeff

jeffcogswell 175 Light Poster Featured Poster

Do you mean global.asax? If so, you can do URL rewriting inside the Application_BeginRequest function. Look up on the Microsoft MSDN site the function Context.RewritePath.

jeffcogswell 175 Light Poster Featured Poster

I had this same situation, and if you're willing to use some JavaScript, you can write some AJAX code that will request a page. You could create a page with nothing on it, maybe call it ping.aspx. And then set a JavaScript timer to go off every couple minutes and request the page. You'll probably need to throw in a random number as a parameter such as ping.aspx?random=somenumber, where somenumber is a randomly-generated number, in case the page gets cached.