If you find this page, it’s because I have not yet deleted it…

I am in the process of moving all posts to my main blog and, once this is all copied and empty, will delete this sub-domain. The reason is, that

  1. I cannot be asked to have two separate blogs for me, and
  2. I set up an SSL certificate for my main blog, which enables me to encrypt all data via HTTPS

I hope you understand, especially as nothing will change for you :p

Posted in etc

When writing an application, one may want to make it interface with some web based backend. More specifically, I’ll show how simple it is to send HTTP requests using Swift to a PHP based website and obtain a reply.

The process is actually really simple:

  1. Generate a NSMutableURLRequest; mutable since you’ll have to set its properties later
  2. Set the request’s HTTPMethod; that will be POST or GET depending on how you interface with the backend
  3. Set the request’s HTTPBody; by creating a data String and converting it into an NSData object
  4. Pass the request to a NSURLSession; using the dataTaskWithRequest() function as it will call its completion handler when finished
  5. Define the content of the completion handler (if needed); to obtain the reply and check for errors

Done šŸ™‚

Continue reading

NumPy is a package that provides cool and simple functionality for n-dimensional array manipulation. I come from a MATLABĀ® background, so I wanted to try something easy, yet the results were not as I expected. It’s concerning simple vector multiplication, i.e. using the dot-product. Whereas in MATLABĀ® the that the two operands are used matters in what the result will be, NumPy seemed to be a bit picky when it came to it. Thanks to stackoverflow I finally understood my confusion and this short post may help someone equally stuck.

Continue reading

For our research on electricity networks work we utilise a BDS licensed power system simulator, a.k.a. OpenDSS (link). This simulation platform receives sequential instructions that first define the equipment properties (i.e. define line, load and transformer specifications), then assign the asset placement (i.e. define the netlist) and then simulates the whole thing. Up until now we only implemented two means of interacting with OpenDSS. One is to generate a big bunch of files that are collated in a common master.dss file. Doing this limits the spectrum of our research to OpenDSS’s inherent capabilities and would not be sufficient for dynamic time series analysis. The more flexible approach was to use MATLABĀ® which can interact with OpenDSS through a registered Component Object Model (COM) server. With all the functionality that MATLAB brings as well as the capabilities of OpenDSS this seemed like a perfect combination. But now we want to take it even further and implement computer science (CS) based solving mechanisms on real communications protocols, yet these may only be simulated in MATLABĀ®. So I decided to give Python a try as it seems to be able to interact with OpenDSS in a similar fashion, yet with all its packages makes CS life a hell of a lot easier. So let’s see how I got started with that.

Continue reading