Tag Archives: C#

Parsing XML in C#: A Quick Working Sample

Just started to work on hacking the Web application of vCAC and REST APIs in C#. As expected, the XML processing is an indispensable part for that purpose. I have worked on C# on and off in the past, but never as consistently as on Java. To get myself familiar with the related C# APIs for parsing, I coded the following sample code.

13c669a197a751bb8dc2d601243a7f97002

Posted in Software Development | Also tagged , | 16 Responses

Encrypt and Decrypt Password in C#?

I just spent a little time playing with C# on password encryption. Here is a sample code I wrote to get myself familiar with related APIs. Overall it’s pretty straight forward – it first encrypts a clear text to an encrypted Base64 encoded string, then reverses it.

Posted in Software Development | Also tagged , | 2 Responses

Why So Many Programming Languages?

While checking out the search engine terms to my blog, I found an interesting one there: “why so many programming languages?” A great question indeed. If you take a look at the Wikipedia page on programming languages, you will be surprised by the number of programming languages today. To give you a hint, the languages are categorized into different sections by their first letters. When I browsed the page, I found most of them were new to me and will definitely remain so in the future. :-)

Posted in Software Development | Also tagged , , | Leave a comment

Hub Programming Language: Does It Matter To You?

There are many programming languages today, sometimes too many to choose from for a new project. The good thing is that there aren’t many main stream programming languages, so picking one is not a daunting task. And almost all main stream languages can achieve similar things, meaning any one of them will work. So in the end it’s really a matter of team preference and sometimes company policy.

Posted in Software Development | Also tagged , , | 1 Response

How Many Programming Languages Are Enough?

During last 60 some years after computer was invented, there have been hundreds, if not thousands, programming languages. If we include domain specific language (DSLs), which accorinding to Martin Fowler may include regular expression, spreadsheet, etc, the number can be even bigger, not to mention more programming languages continue to emerge.

This would be a big burden if we have to learn all of them. Luckily, we don’t have to. In fact, most of us just need to learn several most popular ones. Even better, these popular languages may look very similar in syntax. As a result,

Posted in Software Development | Also tagged , | 2 Responses

Tech Talk: Accessing the Vsphere API from C/C++

This talk is by Steven Wong who is an architect working at EMC on various backup and virtualization projects. If you are using C or C++ with gSOAP to manage vSphere, this talk is for you.

Check it out below:

Posted in News & Events, vSphere API | Also tagged , , | Leave a comment

Squares Aren’t Rectangles? A Common Misunderstanding of Object Oriented Design From MSDN Magazine

While reading the recent Dec 2010 issue of MSDN magazine, I found an article (Multiparadigmatic .Net, Part 4: Object Orientation) with misunderstandings on object oriented design. I was surprised that the author reached conclusions like, “squares aren’t rectangles,” and “no happy ending here.” The conclusions are based on misunderstandings of object oriented design.

Let me show you what the root problem is and how to get a happy ending. After reading this, you won’t be bothered by “squares aren’t rectangles.”

What’s the problem?

As most people already know, inheritance or generalization (I prefer the latter) is an important feature of OOD. Using it effectively can lead to a good object model and concise codebase. In an inheritance relationship, a subtype must maintain “IS-A” relationship with its super type, for example, a Student type IS-A Person. I think most people are just fine with this.

Posted in Software Development | Also tagged , , , , | 3 Responses

Facebook HipHop Compiler for PHP: What Is It For You?

I attended a great seminar at Stanford by Haiping Zhao on the open source compiler which converts PHP code to C++ yesterday. Haiping is the tech lead for the open source HipHop project at Facebook.

As many have known, Facebook is a PHP shop with all the front end dynamic pages written in PHP. The upside of using PHP is that it’s very easy to read, write and debug, plus platform independent. The downside is that it’s really slow, probably one of the slowest scripting languages.

Why PHP is slow?

Haiping summarized three reasons, which he thinks are common contributors for slowness of scripting languages in general:

  1. Byte-code interpreter.
  2. Dynamic symbol lookups, including functions, variables, constants, class methods, properties, etc.
  3. Weakly typing. The zval has to evaluate the data type of any variable before any operation. Plus, the PHP array is too generic because it can represent any collection. 

Why Should Facebook Care?

When Haiping joined Facebook, new servers cannot catch up the new users. The server farms became so big that any percentage saving could save the company millions of dollars. Like all the big web companies, Facebook does not disclose the number of servers they have. The size of the datacenter is guarded as a secret. One of the professors did an estimate in his questions anyway: 15,000 to 30,000 servers.

Posted in Software Development | Also tagged , , | 2 Responses

Top 20 Most Popular Programming Languages

If you are a software engineer, you might have known Tiobe popularity index of programming languages. The index is updated on monthly basis. The following table shows the top 20 most popular languages this month.

The index caught many people’s attention this month because C regained its No.1 position. Java, used to be No. 1 for years, dropped to No. 2. Although percentage wise Java is still very close to C, the declining of Java popularity can be eye-catching.

Posted in Software Development | Also tagged , | 3 Responses

Why does C# Web Service code look weird?

Today I read a posting at VMware community forum about the weird code required by C# Web Service. If the following line is missing, then the vSphere API call to get properties doesn’t work:

VimApi.VimService.PropertySpec.allSpecified = True 

But the problem is that there isn’t any property defined as allSpecified in the object PropertySpec according to vSphere API Reference.

So, where does the allSpecified come from? and why is it needed?

Posted in Software Development, vSphere API | Also tagged , | Leave a comment
  • NEED HELP?


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.