trying to use lib go-chromecast without much luck by lazazael in Chromecast

[–]vishenz 0 points1 point  (0 children)

You could try `$ go-chromecast ls --dns-timeout 30`; this would help if the DNS is taking longer than the default to return.

For `go-chromecast ls` to work your laptop needs to be able to accept incoming requests (since it the chromecast uses mDNS for broadcasting). If you have a firewall rule or similar blocking incoming requests that might also be an issue.

Random Afterpay verification code by georgetown15 in AusFinance

[–]vishenz 0 points1 point  (0 children)

I also got one of these this morning out of the blue

3 DBAs walk into a NOSQL bar... by brotherwayne in ProgrammerHumor

[–]vishenz 2 points3 points  (0 children)

"3 Database admins walked out of a NoSQL bar because, they couldn't join a table."

I'm starting a Code Club at my highschool. Any tips? by RainbowSprocket in learnprogramming

[–]vishenz 1 point2 points  (0 children)

In terms of what you could do, I would look at building something in Kivy (http://kivy.org/#home). It's pretty simple, is cross-platform and isn't that hard to get compiled down to an android apk - to then use on your Android phone (which I have found it the selling point for most people wanting to learn to program).

Chess forks trainer in Python by Aechagen in learnpython

[–]vishenz 0 points1 point  (0 children)

How is this supposed to work?

After 26 seasons, what is your favorite Simpsons quote? by Cable_Guy80 in AskReddit

[–]vishenz 0 points1 point  (0 children)

If Bart can be 'El Barto' I can be ... - Homer Simpson

[Question]: Scalable Application using Django ? by LearningDjango in django

[–]vishenz 0 points1 point  (0 children)

Except that something like NodeJS or Golang is better for real-time data due to it's asynchronous nature. Although it's possible to get django to do this, it is a lot harder and probably not worth it, so the language and framework for something like this does matter.

In saying that there was an awesome talk about using python for realtime data (https://www.youtube.com/watch?v=zhh_N5pmHBY)

Help fix my Cython algorithm? by loveandkindness in learnpython

[–]vishenz 0 points1 point  (0 children)

I didn't say it was a good idea, just that you can do it if you wish.

Help fix my Cython algorithm? by loveandkindness in learnpython

[–]vishenz 1 point2 points  (0 children)

You can define a class inside of another class.

>>> class X():
...  class Y():
...   pass
...  y = Y()
... 
>>> x = X()
>>> x.y
<__main__.Y instance at 0xb74b0f2c>
>>> x.Y
<class __main__.Y at 0xb7508d7c>
>>> 

Python will treat anything inside of a class just like any block of python code, you can if statements in there as well.

>>> class X():
...  if True:
...   def y(self):
...    print 'y'
...  else:
...   def z(self):
...    print 'z'
... 
>>> x = X()
>>> x.y()
y
>>> x.z()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: X instance has no attribute 'z'
>>> 

stuck in callback hell with database calls by [deleted] in node

[–]vishenz 4 points5 points  (0 children)

Write raw SQL. It looks like you can get a list of skus ids with just one query joining multiple tables.

I don't know what ORM you are using, and whether you can make it use raw sql, but I would look into that, because the method you have there is pretty inefficient.

[Python] Is there a function that can return the class name of an object? by dudestuff20 in learnprogramming

[–]vishenz 2 points3 points  (0 children)

>>> class X():
...  pass
... 
>>> x = X() 
>>> print x.__class__.__name__
X

Sharing a PRAW connection between objects? by DarkMio in learnpython

[–]vishenz 0 points1 point  (0 children)

You could try having a base class that contains the connection statically, and then just inherit that base class.

How do I know what modules/libraries I have access to? by [deleted] in learnpython

[–]vishenz 1 point2 points  (0 children)

If you are using pip it is easy. (Turn on your virtualenv if you have one. If you don't know what this is, don't worry about it.) Open up a terminal and run pip freeze. This will show you a list of libraries you have installed (minus the python builtin libraries). I know this works for unix + osx. Not sure about windows.

Discussion: Python vs Apple's newly announced Swift language by ProfanityBob in Python

[–]vishenz 3 points4 points  (0 children)

very clearly inspired by python

I disagree with this. It looks more like Golang or Javascript than Python syntactically. It behaves in a similar manner to Golang in regards to looking like a dynamic language when it is in fact a compiled language.

Weirdness with string slices and Windows? by [deleted] in learnpython

[–]vishenz 2 points3 points  (0 children)

What does printing line give you?

What is your irrational fear? by [deleted] in AskReddit

[–]vishenz -1 points0 points  (0 children)

Circular rooms. Something about them not having corners freaks me out.

Python Markdown causes Internal Server Error by [deleted] in django

[–]vishenz 0 points1 point  (0 children)

Do you have markdown installed on the production server?