There's been a few times now that I've wanted to use Python to analyze content within the IBM Rational DOORS database. So I started searching. To my excitement I found this article but after trying to view the examples and finding out they're dead links it was back to square one.
After reading the DOORS Api Manual I was able to finally figure things out. Before we continue, you'll need the following batchserver.dxl file saved on your local machine:
Here's the basic overview of how to connect to DOORS using Python:
Startup DOORS using the batch mode and run the script above:
Create a Socket Connection to the batch server and send a dxl command:
It's actually pretty simple from there. You can pass in custom DXL scripts via the python socket connection. If you want to pass data back from the DXL socket server to Python, you'll need to use the return_ command in the DXL. Here's an example:
OpenCV and ffmpeg are great tools especially if you're wanting to do any type of image/video analysis or manipulation. But installing these tools isn't exactly the easiest thing to do either. I went through the pain and here's what I discovered.
Since opening most video files require a codec in OpenCV installing ffmpeg was the first thing that I did.
Run the Executable which will in turn extract the executable
Create a folder in C:\ called opencv
Copy the contents of the extracted files into opencv
Edit your PATH environment variable. This will be dependent on the version you want installed (i.e. 32 or 64 bit) and also the version of visual studio you have installed (express editions are fine).
After installing both OpenCV and ffmpeg you'll need to restart your computer to add the paths to the system path.
Installing OpenCV Python
Installing the binding for OpenCV in python simply requires copying over cv2.pyd from opencv/build/python/2.7/<OS Version> in to the site-packages folder. Note: that currently OpenCV is ONLY supported on Python 2.7.
OpenCV also requires that numpy be installed as well. matplolib is also recommended to be installed.
To test it out open a python console and enter the following:
I've been contracted to create a simple application for a local school, that basically takes all of their social media feeds, and puts them in one central place (i.e. Twitter, facebook, youtube, etc,.). They wanted me to develop for all three major platforms (Android, iOS, and Windows Phone 8). I was planning on developing for each platform individually, even though I knew that the basic business logic behind all three were going to be pretty much the same. So I thought that I'd ask over at Stack Overflow if there was any way to keep the business logic between all three platforms:
This led me to the tool Xamarin. Apparently it allows you to develop Android, and iOS apps using C# libraries. Since Windows Phone 8 already uses C# this sounds like a win-win situation... til I saw the price $299 per platform for the "indie" which means you have to use their IDE, or $999 again per platform to use their add in for Visual Studio. I've decided to give it a shot, and since I'm still a student I was able to secure an Academic License (which thankfully includes the Visual Studio add-ins) that was a bit cheaper. (Thanks guys. Honestly.)
So here's the basic idea of what Xamarin is and does:
Shared backend business logic, custom UI generation
Each platform is unique in its development. There are things that are very unique to iOS that aren't found on Android, and vice versa. However, the backend logic or how the data is stored, retrieved, and manipulated can be the same all around. This graphic gives a good overview of what Xamarin achieves to accomplish seemless cross platform development:
Installation was simple, until it came time to connect Xamarin to Visual Studio. As of right now, Xamarin doesn't support Visual Studio 2013 preview (understandable). After installing VS 2012 Ultimate, the Xamarin installer detected that the extensions needed to be installed. I tried, and tried, and tried, and tried, to no avail. Finally, I completely uninstalled Xamarin, and VS 2013 preview and then reinstalled Xamarin. Everthing worked fine from there.
If you're going to develop for iOS be warned, you still need a Mac running machine. You can still supposedly run the app from the Windows environment but, this appears to be done via connecting remotely to Xcode on the Mac. This also measn that you'll need to Xamarin on the Mac as well.
To summarize, if you're looking to develop mobile apps utilizing a single tool, Xamarin is your only option so far. But keep in mind there's a lot of upfront cost and setup time to get the ball rolling. Here's a quick summary of the steps that I've taken to get this all up and running:
Installed Visual Studio 2012 Ultimate
Installed Windows Phone 8 SDK
Installed Xamarin using the Universal installer on Windows Machine
While installing on Windows, I also installed on the Mac
Visual Studio is my favorite IDE by far, and when I heard that Python Tools for Visual Studio (PTVS) upgraded to v2.0 beta I was excited to test out the new features. However, I just started using Anaconda as my main Python distro which leads to problems with PTVS detecting any environments created using Anaconda.
Note that I'm not talking about virtualenvs, but rather Aanaconda's environments
I was able to get a Python 3.3 environment installed and running on Visual Studio, and here's what I did.
Installing a new Python Environment using Anaconda
To install a new env for Python, open up a command prompt and run the following:
You can change py3k to whatever you want to name the environment. The Python=3.3 specifies the version of python to install. Anaconda will take care of everything for you as far as downloading and installing packages.
Setting up PTVS for the new Anaconda Environment
PTVS will automatically pick up the root Anaconda environment, but any new ones created need to be specifically referenced. You can do this manually within Visual Studio:
And then give it a new name. I simply named it Python 3.3. Assuming you installed Anaconda in the default path and name the environ, use the following for the Path and Windows Path:
Select the appropriate architechture and Language Version for your environment. Finally, you'll need to create a new Environment Variable for this installation. I simply used ANAPYTHONPATH. Whatever var you use, be sure to set the value of it to the following:
That's it! You should have full access to your new Anaconda Environment.
Welcome to the KronoSKoderS blog! I'll be sharing my random musings with the projects that I plan on working on. Right now I'm only working on a couple, but hope to start up a few more. Here's a quick list of the things that I'm working on:
Metro-SE: A Winows 8 and Windows Phone 8 interface to the Stack Exchange sites
Alerts-SE: A notification systems for the Stack Exchange sites
Well this post doens't contain a whole lot, but just wanted to get started on things. Hopefully I'll be able to add a few more things later as I go along.