Reading Material: Recognizing Traffic Lights With Deep Learning

A pretty good Non-AI-Experience required article talking about how to train models to recognise traffic lights. It has a few link references that will be very helpful for my future AI training/projects, eg. image-net.org https://medium.freecodecamp.com/recognizing-traffic-lights-with-deep-learning-23dae23287cc#.k941su69v

Django Rest Framework QuerySet

I have just created this python library so that you can query the remote api just like the Django queryset. It is particularly usefully when used in Django ListView with pagination. https://github.com/variable/django-rest-framework-queryset 

Posting image to thumbor using requests package

Seems like there are not many code sample there, and the requests documentation was giving the wrong hint to use files={‘file’: open(‘image.jpg’)} which you will end up getting 415 response code. I think I will just share my working sample code here to save someone’s time import requests # local file with open(‘image.jpg’, ‘rb’) as… Read More »

Make sure you are closing the DB connections after accessing Django ORM in your threads

I was writing a service which import various feeds and then post to another RESTful API, simple enough as below: from django.db import connections class Receiver(PolymorphicModel): … class Database(Receiver): name = models.CharField(max_length=255) def get_data_source(self): return connections[name] Then the feed model: class Feed(models.Model): receiver = models.ForeignKey(‘Receiver’) def get_data_source(self): return self.receiver.get_real_instance().get_data_source() Then run this feed in trivial… Read More »

EJB stateful vs stateless

I have been studying Java EE and I posted a question on Stackoverflow to verify my understanding of “SessionBean”, here is the summary: Stateless bean in client: public void work(){ bean.work1(); // this uses instance 1 in App Server … bean.work2(); // this can be instance 2 in App Server }   Stateful bean in… Read More »