Blog Posts

Passing 2D arrays to Java from Python using javabridge

There are many libraries for calling java code from python and there are many articles that try to provide a preview on their syntax. I’ve worked with JPype and Javabridge which seems to be two of the more famous ones. While JPype is by far more use friendly that javabridge I have personally had problems with it when trying to add some jar files to the class path. Especially if the jar file is packaged by maven or the project’s structure

Continue Reading

PIP Install can’t find numpy header

So if you experienced this awkward situation that you are trying to install a python package that is dependent on numpy but you receive an error from clang complaining about not being to find numpy header files this might be your quick solution. This kind of problems happen far too often on Mac than you’d be comfortable with. I mean as a nerd I expect some challenge but common this kind is more a waste of time. Basically I was seeing this error while trying

Continue Reading

Java to Python? Learn to think differently about type checking!

The Problem So recently I posted the following blog post explaining my approach to determining of an value is instance of a custom class. I also posted a reddit question asking if my solution made sense and whether I was missing some cases. This had become a hard thing to do since it Python pretty much everything is an object and is an instance of a class. It was even harder in Python 3x. At least in Python 2.7 you could check type of

Continue Reading

Essential Reads for Any Python Programmer

These days I’ve seen people writing code in Python with many many different backgrounds. Python is a well known language with small footprint and it has a great community. All of which makes it a great language for beginners and also very easy to jump in to and start your project. But, also extremely easy to miss important knowledge about underlying structure and design pattern conventions. So I’ve started using Python for a couple of my bigger projects and especially my research now. One of these projects demands some

Continue Reading

Check in Python if a value is instance of a custom class

I’m working on a object based serializer/deserializer in python and as a result I need to know if a value is instance of class or not. First, I realized that in contrary to Java, there is really no clean way of determining if variable is holding an instance of a class or a primitive type For clarification: I know in java due to static typing it probably never happens to need to check this. But to a java programmer is intuitive to

Continue Reading

Importing packages with overlapping package hierarchies in Python

I started Python programming 4-5 years ago. However, I usually still use Java to write more complicated projects such as data processing platforms for many reasons. One reason is the that writing complicated projects where you have to separate one project into many related and dependent projects much easier. Lately, I started writing a Python stub for an RPC project that I’m working on that would enable me and possibly my team to write Machine Learning code in various languages and

Continue Reading

Feeling excited about django-affiliations

Well, a while ago I wrote an application for Django web framework application. Today I’m visiting the repository and I see it has been able to gain a lot of attention up to 64 downloads only in the last month and 5 just yesterday. Makes me excited to contribute more to the open source community. So open source community bring it on :D. here are the specs as of today:   Downloads (All Versions): 5 downloads in the last day 20

Continue Reading

Display Donors List For Charitable WordPress Plugin

Today, I decided to use this great donation WordPress plugin for our non-profit website (iraniansptgh.com). We are doing a fundraising to attend the Pittsburgh’s Bicentennial Anniversary Parade and since I’m maintaining the website I decided to quickly look into the existing WordPress plugins that I could find for donations and create a webpage for our fundraising.   I decided to finally use Charitable fundraising plugin, about which I have to say it is a GREAT plugin. Even the free version gives you tons of

Continue Reading

What my students wanted to know about me

  Well this may be a little late to post 😀 but at the first class I asked my students to fill a survey mainly asking about their expectations for a good TA. In the last question I said they can ask me any question that they want and it was an anonymous survey. Here I’m sharing them with you. Answers may/are a little different from what I gave in the class but I tried to be close.   How long have you been

Continue Reading

Introduction To Git With a Little Taste of HTML and CSS

I know there are many tutorials on Git out there and it may not seems a great use of time to write a new one. However, I’m writing this for my recitation hoping it would benefit everyone. Therefore, I will not spend too much time writing same things over and over. Instead I will link to other tutorials and pages.  Also I will include few tips to keep your code well organized and modular when your writing HTML, CSS and later one when

Continue Reading

Site Footer