Sample Filter
   11 tags on

0 answers

Zodiac return function for Python program

Write a function zodiac ( x) that will return the name of the zodiac sign for that date. Use the functions dayYear() and zodiac() to write a main program that will let you test any given date. How ...

1 answer

How can I select and add the values in the columns of an array?

How can I select and add the values in the columns of an array? I have a 1992 by 784 array and I need to take columns from the array and add the values together. My goal is to add the column values ...

1 answers | 1 min ago by nabu on Stack Overflow
0 answers

Python zipfile slow to extract/decompress

I'm using Python to extract zip files I create on another machine. Sometimes the following code works fine, but then it takes 5-10 minutes to extract 30MB of data. This normally takes a few seconds. ...

3 answers

Python: function menu not working

I am having trouble with a menu that allows the user to choose which function to call. Part of the problem is that when I run the program it starts from the beginning (instead of calling the menu ...

3 answers | 1 min ago by shomz on Stack Overflow
1 answer

Is this a Pythonic way of doing Django Models

I am doing the fat models approach, so I have transformed my into a package thus: +--polls/ | +--models/ | | | ...

1 answer

Numpy: How to access elements beside elements satisfying condition

First off let me apologize for any formatting issues, I am writing this on a phone. If I had an numpy array 'a' I could easily find all values of 'a' satisfying elem > 2 via: a = ...

1 answers | 4 mins ago by Graham Reid on Stack Overflow
0 answers

Creating an online compiler for python with Node.JS

I am trying to create a compiler for Python based on web where user can upload their code and download the output. THe Application will be based on Node.JS and it will be hosted on AWS with help of ...

0 answers

Serialize to object using scala mongo driver?

I'm new to the scala mongo driver and am trying to understand how to map a class from a Document? None of the documentation seems to show how this is done. In the .net driver, its as easy as passing ...

1 answer

Why std::ios_base::sync_with_stdio isn't implemented in libc++ (clang)?

Let's look on this code example: #include <iostream> int main() { std::ios_base::sync_with_stdio(false); int n; std::cin >> n; for (int i = 0; i < n; ++i) { ...

1 answer

Finding index of element in array

I have an array teams[size]. Team* relatedTeam I know that the relatedTeam above is member of a teams. So, this is pointer. How can i find its index from this information? I am in transition from ...

1 answers | 6 mins ago by cihangir ND on Stack Overflow
1 answer

If statement inside parenthesis changes the value in a vector

I have a following problem. I have two vectors correct_data_labels.label and data_labels.label , label is the vector<int > whereas data_labels and correct_data_labels are the instance of my ...

1 answers | 8 mins ago by TMNT on Stack Overflow
0 answers

C++: Cloning and overloading with multiple inheritance

This is a follow-up to this question. Someone asked about a minimal example, but I found it impossible to condense it all into something working. I still have issues, so I hope that by giving a bit ...

0 answers

Find path of .sqlite file in Qt Creator

Okay so I'm relatively new to Qt but I have just finished my first program for a project. I have a .sqlite file that I open by doing this: db = QSqlDatabase::addDatabase("QSQLITE"); ...

1 answer

Scala application compiles error in IDEA due to the connection refuse

I'm trying to compile the scala application under IDEA, the scala compile server seems work well, but I got the following error every time I ran the scala application (script runs well). ...

2 answers

How to set image to the button using Win32APi c++?

I need to set image to the button. The main idea is to make image clickable, and when click on it some event happens. case WM_CREATE: HANDLE hBmp = (HBITMAP)LoadImage(GetModuleHandle(NULL), ...

2 answers

sorl thumbnails not loading images

I am having trouble getting thumbnails working with sorl.thumbnails. I am getting no errors. What I have done: INSTALLED_APPS = { ... 'sorl.thumbnail', } THUMBNAIL_DEBUG = True ...

1 answer

Python HTML to Text File UnicodeDecodeError?

So I am writing a program to read a webpage using urllib, then using "html2text", write the basic text to a file. However, the raw contents given from has various characters, so it would ...

0 answers

template function typecasted to BinaryFunc

BinaryFunc is defined in core.hpp as typedef void (*BinaryFunc)(const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t ...

1 answer

Python SQLite3 - Loop to Populate First Column

With Python3 I am trying to read in a text file and populate the first column of an SQLite3 table. The for-loop and execute combination is providing errors and I don't quite know what's going wrong. ...

1 answer

Python: “No virtualenv active”

I installed PyCharm 2.7 under Windows 8.1. It works fine, but every time I run a program, I get the following warning: WARNING:root:No virtualenv active Why does it happen and how can I fix it?

1 answers | 17 mins ago by user2738748 on Stack Overflow
0 answers

Defining Dictionary for weighted graph

Hey I am Very new to Python and I want to create a dictionary from Graph tables. I have three lists from graph tables edge = G.edges() weight = G.weights() node = G.nodes() Now I want a dictionary ...

2 answers

How to log a Python crash?

I am running a python code in a raspberry Pi. The code is supposed to last forever. However, after a few hours it crashes. Since it is running on a remote machine, I cannot see the message it gives ...

2 answers | 19 mins ago by alandalusi on Stack Overflow
1 answer

Error when trying to reuse Windows Notification class in Python

I am trying to use the pywin32 module to create a somewhat more interactive experience when playing my game, but I have encountered some issues. I wish to use the class WindowsBalloonTip more than ...

1 answers | 21 mins ago by ItsAzul_ on Stack Overflow
1 answer

How to get travis to fail if tests do not have enough coverage for python

I it possible to have travis fail if my test don't have enough coverage, say < 90% for example. Normally I run my tests with the following travis config entry. script: - coverage run ...

1 answers | 25 mins ago by fabe on Stack Overflow
1 answer

C++ Allegro stoping the sample

I want to stop my sample at certain point , but it sends me some weird error. This is my code: ALLEGRO_SAMPLE_ID id; ALLEGRO_SAMPLE* spl = al_load_sample("sound.ogg"); al_play_sample(spl, 1.0, 0, ...

1 answers | 26 mins ago by Kebapmanager on Stack Overflow
3 answers

Adding a value to a list of lists

I want to add a value to a list of lists. For input of [[1,2],[2,3]] I want output of [[2,3],[3,4]] I can do it with loops: list_of_lists = [[1,2],[2,3]] output = [] for list in list_of_lists: ...

0 answers

How to install shapely (python package)

The instructions for Windows ask to download the installer from The link for my version displays as "Shapely‑1.5.13‑cp27‑none‑win_amd64.whl". However it is ...

10 answers

In C++, should I bother to cache variables, or let the compiler do the optimization?

Consider the following code (p is of type unsigned char* and bitmap->width is of some integer type, exactly which is unknown and depends on which version of some external library we're using): for ...

1 answer

polyfit for 2d polynomial in python

z= a0 + a1*x + a2*y + a3*x**2 + a4*x**2*y + a5*x**2*y**2 + a6*y**2 + a7*x*y**2 + a8*x*y given arrays z, x, and y of length 20. I'd like to fit coefficients that minimize error. Basically i'm looking ...

5 answers

Purpose of new keyword in creating array in Java

I want to know why an array created in Java static even when we use the new keyword to define it. From what I've read, the new keyword allocates a memory space in the heap whenever it is encountered ...

5 answers | 32 mins ago by Harsh Gupta on Stack Overflow
15 30 50 per page
1 2 3