Send/Receive message To/From two running application

There are different ways to share information between 2 processes. First at all you have to think if both processes are going to be always in the same machine or not when your application scales up. Different Machines Use TCP/UDP socket connection (Can be the quickest solution) Use MSMQ Use WebServices, WCF or Restful Web … Read more

Avoid Overflow when Calculating π by Evaluating a Series Using 16-bit Arithmetic?

Take a look at related QA: Baking-Pi Challenge – Understanding & Improving Its using Wiki: Bailey–Borwein–Plouffe_formula which is more suited for integer arithmetics. The real challenge however would be: How do I convert a very long binary number to decimal?. As you probably want to print the number in dec base … Also if you … Read more

Parse html using C

You want to use HTML tidy to do this. The Lib curl page has some source code to get you going. Documents traversing the dom tree. You don’t need an xml parser. Doesn’t fail on badly formated html. http://curl.haxx.se/libcurl/c/htmltidy.html

Call C# dll from Delphi

You may have more luck skipping the COM part by using my project template for unmanaged exports class MyDllClass { [DllExport] static int MyDllMethod(int i) { MessageBox.Show(“The number is ” + i.ToString()); return i + 2; } } In Delphi, you’d import it like so: function MyDllMethod(i : Integer) : Integer; stdcall; extern ‘YourAssembly.dll’; I … Read more

Getting system Timezones in different languages

Changing the CurrentCulture doesn’t work as the information comes from the registry (XP) or from the Multilingual User Interface (MUI) DLL (Vista, Windows 7). On Vista or Windows 7, you may install other languages and change the display language (Region and Language -> Keyboards and languages -> Display language). A reboot is required. This, and … Read more

How to tell if a type is an instance of a specific template class?

Here’s an option: #include <iostream> #include <type_traits> #include <string> template <class, template <class> class> struct is_instance : public std::false_type {}; template <class T, template <class> class U> struct is_instance<U<T>, U> : public std::true_type {}; template <class> class Second {}; int main() { using A = Second<int>; using B = Second<std::string>; using C = float; std::cout … Read more