I guess every developer was asked at some point about making a website for a friend only to be taken aback by the technological limitations of the hosting provider.

I am a professional Asp.Net developer (of course I am versed also in winforms and all the other areas of .Net programming, but web applications are my specialty) and I am accustomed to work in relation with databases. When someone wants a website that normally requires at least a few tables and there is no database engine available, what do you do? Over the years I used two techniques: use xml based storage and javascript storage. Of course they are limited but the whole point is that for small scale applications they are sufficient. Here are some examples:

  1. http://www.orionmodels.ro : this is a javascript storage based application. It comprises of classic HTML, asynchronous loading using XMLHttpRequest and a script containing object definition and object instances (the models are actually javascript objects that are instanciated and then processed in the various pages of the application)
  2. http://www.mcmserv.ro: this is an xml storage based application. It is written in ASP.Net 2.0 and all the objects are serialized in xml on the web server. Pretty nifty and also has an html editor which saves html in the actual xml serialization (unfortunately that is on the administration side which is not available to outside)

Overall I am pleased with the results but it’s a technical trick and not something I endorse. Buy the heck a subscription with a database, normally it’s just a few dollars more.

P.S. Don’t mind the website’s design, I am not a designer … only a developer.

Comments 2 Comments »

I am certain that many of you encountered a need for a code like this:

switch (controlVariable)
{
    case 1:
        int i = 10;
        Console.Out.WriteLine(i);
        break;
    case 2:
        int i = 20; // compiler error here
        Console.Out.WriteLine(i);
        break;
}

This is not possible because the whole switch acts as a “declaration space” and only one declaration of the “i” variable is allowed. In order to overcome this, one has somehow to trick the compiler into considering each case as having its own declaration space. How we make this? Use the brackets:

switch (controlVariable)
{
    case 1:
    {
        int i = 10;
        Console.Out.WriteLine(i);
        break;
    }
    case 2:
    {
        int i = 20;
        Console.Out.WriteLine(i);
        break;
    }
}

Comments No Comments »

Read about it on ScottGu’s blog

Comments No Comments »

The past two days I tried to make a file server out of an older pc I had lying around. It had an MSI KT6V-LSR with an Athlon processor on it. Toghether with one 400Gb and one 500Gb harddrive I thought I could crop a machine for storing files. My primary OS of choice was Windows 7. I had also an XP around but I consider it too outdated to use and the Vista would be too slughish on this old hardware.

The problem I encountered was that Win7 was not booting on this pc. This is because on the Win7, Microsoft changed the boot sector (don’t ask me why) and older systems do not recognize this as a valid bootable disk and the only message I was getting was a “cannot boot from cd code 5” error. After scouring the net I finally found a sollution which I want to post here.

1. Get a Windows Vista boot disk. It does not matter it’s from a “friend” or yours. You won’t actually intall Vista, just piggy-back on it’s boot capabilities.

2. Boot from the Vista disk.

3. After selecting the language select repair. Afterwards, depending on the state of your harddrive and other stuff you should be getting the choice of running a command prompt. Do it.

4. Change the disks such that your drive now contains the Windows7 disk.

5. In the command prompt navigate to the drive with the Windows7 disk, go to the sources directory and type setup.exe and press enter.

6. Now the Windows7 will start installing and everything will go on normally.

 

Happy installing!

Comments 2 Comments »

I was researching today how one connect to an Oracle database from .Net using Visual Studio 2008 and ODP.Net (Oracle Data Provider for .Net). What I initially tried and what I will talk about is to add a new datasource to a project. I will not go into specific programatic access but into configuration.

First thing you have to do is download ODP.Net from the link above and install it. In the installer two things have to be done. Select the type of install and pass the prerequisites. On the type of install I could not understand the choices mainly because the texts for the two available was 90% identical, but the ideea is that the first one is for instalation on a machine that does not have the oracle installed on it, while the second was for the machines with it.

The second part of the install is also nasty from a usability point of view. I am running Windows 7 RC1 and at this time the installer does not recognize it as a supported OS. Fair enough, but you have to guess that you need to tick the checkboxes of the failed prerequisites in order to be able to continue. Afterwards it was click and continue until, again you are dumbfounded at the end screen. It says everything is done and you have a close button and that asks if if you are sure you want to exit. Are you crazy ?! What else can be done on that screen!

So we now have ODP on our machine. Fire up Visual Studio and open your project and the “Add new data source” wizard. Select New connection and ODP and that should do it. NOPE! This is not an MS driver, you have to work to get things done. You have to go now to the directory where ODP was installed, in the Network\Admin subdirectory and copy from the sample subdirectory into its root the two files “tnsnames.ora” and “sqlnet.ora”. Then modify them according to your oracle configuration (you can find examples on the web).

After modifying the configuration files go to Visual Studio again but make sure (if you’re on Vista or Win7) to run it as administrator. In the add new connection when selecting the ODP.Net driver you are now presented also with an option for your particular connection specified in the tnsnames.ora. Another trick needed here is that when filling in the user name this is automatically transformed to uppercase. If you have a username in lowercase you need to go to advanced and change it to lowercase from there.

Done. Really … done. You have now a data source connection and can create your datasource from an Oracle database. What it’s left is to get your hands on a linq connector for Oracle … but you have to go to other parties like DevArt because Oracle can’t be bothered.

Cheers

Comments No Comments »

All of us heard of the upcoming ASP.Net 4.0 and Visual Studio 2010 due in Q4 2009 so I thought on listing the highlights on the ASP side. You can find the original whitepaper here.

  Read the rest of this entry »

Comments 1 Comment »

I just finished modding my computer with the goal of making it more silent. It all started with an Antec Sonata III 500 which was supposed to hold my new Core2Duo. I like this case. Sturdy build and quite heavy. It has springs for the harddrive mounts to dampen the shocks and sound, a good 500Watt source and gorgeos looks and also it is very easy to work with, especially with me poking my head inside it to check and modify stuff.

 At that time I stuck with the Intel stock cooler which of course proved too loud. From the perfomance it was ok. I am not an overclocker so it was enough for the job. Still I needed to change it because it was loud as hell. I chose A Scythe Ninja 2 which can normally be used also in a fanless mode but I did not risk and installed also the provided fan, which is a 120×120 – 800rpm one (very quiet also).

My shock was of course that my system was as loud as before so I turned my head to the cooler on the VGA. This was a Saphire 4850 with a Zalman cooler; Noisy as hell as I saw, and thus I had to go for yet another upgrade which turned to be an Arctic Accelero S1 Rev.2. Also this is designed as a fanless sollution but again I wanted to play safe and added the turbo module which consists of 2 low rev fans barely audible.

All in all the system is now quiet and yet powerfull to play anything I throw at it. I could not make it dead silent but its miles from where it started. Below are some pictures I took along the process.
Read the rest of this entry »

Comments No Comments »

It’s been again a long time since my last post.
Today I wanted to explore a little bit the realms of paralel processing. As I already stated in some previous posts, the current trend of going multicore is somewhat out of phase of the current programming techniques, meaning we have multicore but we rarely use it. Most applications available on the market are single core and some have just some modules optimized for multicore.
Suprisingly the most parallel applications nowadays are graphics processing. Latest generation GPU’s are actually multicore processors, but specialized for simple operations (thus very fast). For the general purpose software developer this processing powerhouse is out of reach due to the different programming model. What this means is that first of all there is a lack of higher level abstractions of the GPU and also there are limitations because of this specializations.
There are some API’s available from NVIDIA and AMD (read ATI) in the form of CUDA and STREAM, but for me, as a C# developer they are not attractive since they offer a C++ API.

Fortunately there is Microsoft Accelerator which you can get from here. This is a .Net abstraction over the GPU and allows for some basic computations to be forwarded to the GPU instead of the CPU. Naturally I wanted to explore a little bit and especially to do some tests. Below is my test example, some results and remarks.
Read the rest of this entry »

Comments 3 Comments »

Hi,

Some days ago I read an interesting article about SSD performance degradation on Anandtech, and I kinda felt that this was happening to me also. I don’t own an SSD yet but I encountered flash performance degradation on my 8Gb Flash Voyager stick. Now I won’t go into the details about why flash performance degradation because the article above is more explanatory than I could make it. Suffice to say that I wanted to see if I can bring my stick back to life.

What was wrong with my voyager is that in the last weeks the write performance was poor. Whereas normally I could write at around 9MB/sec now I could only do it only at around 2-3MB/sec. From the article I understood that this was because even if the OS was reporting enough free space on the drive, all the space was already holding data and in order to write over it the flash needed to get the invalid data, write it to cache, delete the old location and then overwrite it with the new data. If one could delete everything from the location, subsequent writes would be just writes with no additional steps to execute, thus faster write speeds. This meant that I would need to do a format of the stick. But before that I had to do some tests to see performance before and after.
Read the rest of this entry »

Comments No Comments »

Today I was looking on MSDN and came upon a blog entry of J.D. Meier about 8 new big trends. I must say that I agree and I want to share them also here:

  • Analytics is Hot.  “The 21st century is all about math: some of the most unique, innovative ideas are emerging with these types of analytic projects. This is where the next billion dollar industries are being born.”
  • Small is the new R&D.  “Today, the global R&D process has changed, and small is big. The global, infinite idea loop allows topic experts to share their latest research and insight with their global peers on a continuous basis. It’s a fundamental transformation in which most new scientific discoveries now percolate from the bottom up.”
  • Attitude and Amusement. “The fact is, you’ll need them. That’s why workforce engagement is the big issue — you’ll only be able to get the staff you need if you can keep them active, engaged, interested and amused. A entirely different workplace concept that is radical, yet necessary.”
  • Time Disappears.  “The major trend going forward is the collapse of time. There’s no time to plan anymore – there is just a need for action. While we still need budgets to manage and control, they’ll have to be constantly adjusted to deal with new realities. In this context, volatility is the new normal : the concept of risk management, for example, is transitioning quickly to one of risk containment.”
  • Resistance to Change Retires.  “The coming generation of senior management aggressively pursues and implements new ideas. While the first is reluctant to embrace new business models, the next steamrollers them. Expect velocity!
  • Careers End. “Your paycheck will come from: the global, itinerant, part-time, skills-for-hire economy.”
  • Knowledge & Skills Banks.  “The capital of the 21st century isn’t financial : it’s experiential knowledge that is extremely scarce and specialized.”
  • Interactivity Redefines.  “Every industry will soon be transformed by the forthcoming era of “pervasive connectivity.”  Essentially, every device and thing around us is about to become plugged in — leading us to an era of interactivity and connectivity that is mind-boggling in scope.”

Comments 1 Comment »