Posts

Showing posts from June, 2012

Async (non-blocking) programming with C++11

  Asynchronous  programming is a wonderfull thing is it not? However that only applies if it is used in a controlled manner. Given the advantages that it offers it can potentially be very easy to get into the swing of it all and make an entire application async and ending up in debugging hell in the event of unexpected application behaviour. So why am i talking about aync? ok so let me get one thing clear, when i say async i strictly mean non-blocking, because you can make an async call and have your program wait on the function to finish doing its task, however in that case  you are no longer doing what you set out to do.  Ok i guess  am just dragging this out, well i get the point , enough foreplay, now on to business! Since my research work is mostly all C++, i reached a stage in my research where i had to adopt an asynchronous (non-blocking) approach at solving one of my research problems. Which had me to go on the hunt for the best possible ...

Calling Java methods from C++

  In one of my projects, I had the need to call a Java function from a C++ class and somewhat surprisingly it was more complicated than I initially expected it to be. Arguably there are more resources on how to call C++ functions from a Java class then the other way around. Also one needs to ensure that the documentation refers to calling Java from C++ instead of C , as there differences in the function calls. Hence based on my experience here's the solution that I came up with. Requirements I wanted a Java class to perform a certain task and return an array of double  (primitive type). I would then invoke this Java method from my C++ class and use the values of that double array. A sample of my Java class public class Test{ public[] double array; public int size; public double[] getArray() { array = new double[]{1.2,3.2,1.2}; return array; } } Hurdles and initial mistakes Initially what I was trying was to...

ASP.NET MVC2 and IIS 7.5 deployment issue

After spending hours and pulling my hair out over the deployment error , i finally found a solution, but before i talk about the actual solution, i will provide some context to the underlying problem. I have recently developed an ASP.NET application using the MVC2 framework and when i tried to deploy the application on IIS i encountered a deployment error. The link between .NET framework (any version) and IIS This is the least visible problem of them all, because you are most likely to assume that this has already been taken care of. This is not an issue if IIS is installed before the .NET framework, however  if IIS is uninstalled or installed after the .NET framework has been installed than it does not automatically establish the link between the two . In case of the latter the issue can be resolved by manually establishing the link between IIS by the following steps start the command prompt and navigate to the directory where you have installed the ASP.NET framework e.g....