3/10/2012

Azimuthal Equidistant Projection and Program

I finally finished writing. I updated the page related to azimuthal equidistant projection and uploaded the program I made.


Here is the page on my website.
http://sites.google.com/site/somedayuniverse/contents/azimuthal-projection

3/01/2012

Network Programming with .Net

I tried to write a code working in the network. Windows API is necessary to build a system related to the network. But I did not want to use APIs. There was no practical reason. I just wanted not to be confused with them, and wanted to use mainly C++/CLI, which I was familiar with.

I found an interesting page related to this problem. (although it is mentioning C#.)

So what I had to do was to write my own code in C++/CLI. It was just to put proper notations. But I found this page was a kind of old documents because some functions were obsolete.

At last, I wrote a new C++/CLI version after reading the page.

===============================================
#include "stdafx.h"

using namespace System;
using namespace System::Net;

int main(array ^args)
{
String^ name = (args->Length < 1) ? Dns::GetHostName() : args[0];
try{
array^ addrs = Dns::GetHostEntry(name)->AddressList;
int i = 0;
while(i < addrs->Length){
Console::WriteLine("{0}/{1}",name,addrs[i]);
i++;
}
}catch(Exception^ e){
Console::WriteLine(e->Message);
}

Console::ReadLine(); //waiting for pushing Enter
return 0;
}
===============================================

It is just the beginning. I will start for higher levels.