Sample Filter
   11 tags on

1 answer

Assign columns' value from other columns in Pandas dataframe

How do i assign columns in my dataframe to be equal to another column if/where condition is met? Update The problem I need to assign many columns values (and sometimes a value from another column in ...

1 answers | 51 secs ago by Chet Meinzer on Stack Overflow stackoverflow.com
0 answers

RFID Arduino to Raspberry Pi serial read python action running twice

I have the below script to read a serial port from an Arduino on a Raspberry Pi. The intent is to have the Pi monitor the Arduino rfid output and when a particular card number is identified, to ...

2 answers

How to serialize a python dict to text, in a human-readable way?

I have an python dict whose keys and values are strings, integers and other dicts and tuples (json does not support those). I want to save it to a text file and then read it from the file. Basically, ...

1 answer

C++ Instantiate subclass from multiple choices

I'm using a library that implements different types of network protocols like in the following simplified example that hopefully illustrates the problem I have. NOTE: This is all pseudo code just to ...

1 answers | 1 min ago by user1227445 on Stack Overflow stackoverflow.com
1 answer

Vim-airline close buffer/quit vim

With vim and vim-airline, I've got a situation where I want to be able to close a buffer if it exist, and if not close vim. So I've first remmapped :x to ;x for speed reasons. nnoremap : ; Then I ...

1 answers | 2 mins ago by mhartington on Stack Overflow stackoverflow.com
2 answers

Python class namespacing

I am relatively new to python and i am using python 2.7.x I have a question regarding name-spacing in python class Team(): x = 2 def p(self): print x a = Team() a.p() It says ...

2 answers | 3 mins ago by aceminer on Stack Overflow stackoverflow.com
1 answer

Building a project with mixed Scala and Java source files using Ant - illegal cyclic reference error

I have an existing Java project with Ant build that I am trying to set up to build with mixed source (Java and Scala). I hava a Java interface defined as - public interface One<T extends Two<? ...

1 answer

Django OAuth2 provider and resources on different servers?

I'm looking to set up Django to use OAuth2 to authenticate users for a service that I'm running, but I'm having a bit of difficulty understanding how the tokens are passed around. I've been working ...

1 answers | 5 mins ago by Joel B on Stack Overflow stackoverflow.com
2 answers

NamedPipe interprocess between c++ and Java application

I need start a named pipe server from c++ side and get a java application to read from the pipe. For the C++ side which creates the pipe, I followed the example from MSDN: ...

2 answers | 5 mins ago by rzhomx on Stack Overflow stackoverflow.com
3 answers

Convert rounded decimal to (approximate) radical value?

I've made a lot of random math programs to help me with my homework (synthetic division being the most fun) and now I'm wanting to reverse a radical expression. For instance, in my handy TI ...

2 answers

Distance between variables in memory

I wonder how C++ is handling variables so that the distance between the two addresses in memory of integer variables declared and initialized one after another is 3537492 - 3537480 = 12 ( I'm assuming ...

0 answers

GAE: Object change notification issues with dispatch file and modules

I have a fairly complex application running in Google App Engine, with multiple modules using the webapp2 framework. Previously, I had configured a Cloud Storage bucket to send object change ...

0 answers

Python 3.4 GUI single executable

Today I've started learning python. I only ever used PHP for various things and never had to bother with building exe files. Using some internet Python programming tutorials and a little of my own ...

1 answer

How to inspect a numpy/pandas object, i.e. str() in R

When I use R, I can use str() to inspect objects, which are a list of things most of the times. I recently switch to Python for statistics and don't know how inspect the objects I encounter. For ...

1 answers | 8 mins ago by Heisenberg on Stack Overflow stackoverflow.com
2 answers

Is there a Vimscript equivalent to Ruby's `any?'

I'd like to refactor this condition in my vimrc: if &term =~ "xterm" || &term =~ "screen" || &term =~ "builtin_gui" " do some stuff... endif In Ruby I'd probably do something like: ...

2 answers | 8 mins ago by ivan on Stack Overflow stackoverflow.com
2 answers

Numpy: Column dependent slicing

I could not find any question concerning what I want to do so I am asking now. Basically, I want slicing in matrices where the row index depends on the column index. For example: >>> import ...

2 answers | 10 mins ago by exception1 on Stack Overflow stackoverflow.com
0 answers

Layered rendering of a shadow cubemap

I'm trying to render a shadow cubemap in one pass, using layered rendering. I've tried to be as thorough as possible : I have bound a cubemap both depth attachment (GL_DEPTH_ATTACHMENT_32F) and ...

1 answer

Google App Engine/Webapp2 redirect for HTTP HEAD requests

I am using Google App Engine and webapp2's RedirectRoute method to handle the urls like this: app = webapp2.WSGIApplication([ RedirectRoute('/notes/', handler=notes, strict_slash=True, ...

0 answers

Trying to get emails from the past 3 days from outlook, it almost works, but it's skipping emails, any idea why? [code inside]

So here's the code ... import win32com.client, datetime from datetime import timedelta def checkTime(): date_filter_unformated = datetime.date.today() - timedelta(days=3) date_filter = ...

1 answer

Where can i find the printed information generated in the cpp files of NS2 library in which I added some cout() functions to print some information?

I'm using ns2 in linux to do some network experiments. I added some print lines in some of the cpp files of the ns library(through the function cout()). But when I execute the TCL scripts, I can't ...

1 answers | 20 mins ago by Ryan on Stack Overflow stackoverflow.com
0 answers

export neo4j database to graphml using python

I am trying to export Neo4j graph database to GraphML using python. I have already many articles on this site as well as other where you can do the same using Gremlin or such tools. I cam across ...

0 answers

GitPython - clone_from not working

I am facing an issue while cloning a git repo. I am using function clone_from from GitPython library from git import Repo Repo.clone_from("git://github.com/facebook/buck.git", "D:\sample") ...

0 answers

Set default text to database field

I want to set a default text to the database field when the path to the image is empty. class Company(db.Model): ... logo = db.Column(db.String(150)) def __init__(self, logo=None): ...

2 answers

Seperating application logic and view in Qt Widgets

I was wondering: what is the 'official' coding style when programming a Qt Widgets application. I'm specifically referring to keeping logic and view code separate. The default Qt Designer way makes ...

2 answers | 24 mins ago by Halfgaar on Stack Overflow stackoverflow.com
11 answers

Are there any provable real-world languages? (scala?)

I was taught about formal systems at university, but I was disappointed how they didn't seem to be used in the real word. I like the idea of being able to know that some code (object, function, ...

1 answer

Tweepy capping at 3182 tweets from a user

I have written a script to get all tweets from a given user and save them to a CSV. However I am noticing that I can only get 3182 tweets from any user supplied to the script. Is there some limit put ...

1 answers | 28 mins ago by thaweatherman on Stack Overflow stackoverflow.com
2 answers

Why I am not able to fit a sigmoid function to this data using scipy.optimize.curve_fit?

With the code below I am not able to fit a sigmoid function to my dataset. However, if I add an offset t = x + 50 -x0 in code below, it fits nicely. Shouldn't x0 take care of the fitting? import ...

2 answers | 29 mins ago by vivekbecks on Stack Overflow stackoverflow.com
1 answer

Python 3: Unbuffered vs Buffered Streams

I have been using the following snippet to silence (redirect output from) C code called in my Python script: from ctypes import CDLL, c_void_p import os import sys # Code class silence(object): ...

1 answer

Is there a way to know if a particular git commit to a branch is in another branch as well?

Is there a way to know if the code change for a particular commit on a branch is in another branch as well (whether it be via git cherry-pick or merge) I have two branches of code and occasionally ...

1 answers | 32 mins ago by Boon on Stack Overflow stackoverflow.com
3 answers

what is the difference between a[0] and &a[0] in string

string a = "asdf"; cout<<&a[0]; cout<<a[0]; Why are these two outputs different? Why is &a[0] not the address but the whole string?

3 answers | 32 mins ago by Kingsley Wang on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3