Sample Filter
   11 tags on

4 answers

C++ function about usage of return

Hello i am totally new to c++ programming, I had a question when we use a int function why do we have to use return command like we can use cout << sum << endl; and call the function in ...

3 answers

Why does this string not change to uppercase?

So I have a file of amino acids that I am trying to read mdvfmkglskakegvvaaaektkqgvaeaagktkegvlyvgsktkegvvhgvatvaektk eqvtnvggavvtgvtavaqktvegagsiaaatgfvkkdqlgkneegapqegiledmpvdp dneayempseegyqdyepea ...

3 answers | 35 secs ago by varda1316 on Stack Overflow stackoverflow.com
1 answer

STL container for local heap allocator?

I'm writing a class (a Huffman encoder, if you're curious) that needs to contain a specialized binary tree for which an STL container wasn't directly appropriate. And it's no problem to define a ...

2 answers

C++ Boost ASIO simple periodic timer?

I want a very simple periodic timer to call my code every 50ms. I could make a thread that sleeps for 50ms all the time (but that's a pain)... I could start looking into Linux API's for making timers ...

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

How to speed up multiprocessing.Queue with NumPy arrays?

As the code example below illustrates, sending NumPy data via multiprocessing.Queue is about 12 times slower than just assigning values to a data segment of the same size (on Linux, at least): # ...

4 answers

Can a generic lambda have no arguments?

First of all, I know I could use templated class/functor, but that is not what I want. Here is the lambda: auto lambda = [] (auto var) { decltype(var) x; //do stuff with x but nothing with ...

4 answers | 2 mins ago by user2565020 on Stack Overflow stackoverflow.com
0 answers

Process is not terminated though its task is done in Python?

I wrote a custom process pool to just playing on python processes. Basic consept: Create tasks Assign a task to a process if the process task is done, 3.a remove the process from process list 3.b go ...

0 answers

<br> tag screwing up my data from scraping using beautiful soup and python

I am trying to get a detailed list of golf courses from the a given website. I created a scrapper tool to scrape the name and address of different golf courses in the US. My problem is that in the ...

0 answers

Linked List Retain Function Not Working

This was an old assignment on a data structure course. The objective is to complete the retain function which works like such: listy.retain(listx) and the result is to REMOVE elements in listy that ...

0 answers

I can't make changes to a Django queryset then run filters on changed data

I tried putting the queryset in a list but then the list object has no method exclude(). I need to find all the start_date's that are in the last month if they have and end_date that is after 12 then ...

2 answers

How does tail recursion really help over traditional recursion?

I was reading up about the difference between tail recursion and Traditional recursion and find it mentioned that "Tail Recursion however is a form of recursion that doesn’t use any stack space, and ...

0 answers

Link-time error LNK2001 & LNK1169 in VS 2013 while compiling the C++ program - B. Stroustrup's PPP using C++: Ch. 8 - Q1 Drill?

Possible duplicate: stroustrup ppp chapter 8 drill headers I'm learning C++ using PPP using C++ by B. Stroustrup, 1st edition. I am having trouble solving this question, Ch. 8 Drill, Q1 - ...

3 answers

Shapeless HList type checking

I am using Shapeless and have the following method to compute the difference between two HLists: def diff[H <: HList](lst1: H, lst2:H):List[String] = (lst1, lst2) match { case (HNil, HNil) ...

0 answers

Python open .spydata file to use data

I have a file with the extension spydata that is filled with Twitter data. I need to open and extract this data to use. For this I installed the Spyder environment since it's supposed to be able to ...

0 answers

Aligning words without delimiters?

I'm trying to align words with vim-tabular, but without delimiters between them, like commas or colons. For instance: int x = 1; float y = 2; char z = 3; What expression do I need to use to ...

1 answer

C++ (VC) Text output breaks lines with 0d 0d 0a instead of 0d 0a - how to fix?

EDIT: The solution to this problem was supplied by Ulrich Eckhardt in the comments below. Also: this problem had an entirely different cause and solution from the ones described in possible ...

3 answers

Same operations taking different time

I am in the process of optimizing my code for my n-body simulator, and when profiling my code, have seen this: These two lines, float diffX = (pNode->CenterOfMassx - pBody->posX); float ...

3 answers | 5 mins ago by Kieren Pearson on Stack Overflow stackoverflow.com
0 answers

igraph select function for generic attributes

I am learning igraph, by following this tutorial. Here is a syntax from the tutorial that I was not familiar before: # g is a Graph object # g.vs are vertices of g >>> ...

0 answers

Trying to install pygame for Python 2.7, getting “DLL load failed: The specified module could not be found.”

I'm running 32 bit Python 2.7 and installed the pygame-1.9.1.win32-py2.7 version of pygame. However, when I try to import pygame, I get the following error: ImportError ...

1 answer

Simple Sublime Text 3 python27 build system - add project folder to path

I am trying to set up a very simply python 2 build system in sublime text 3. The default build environment for python works, but I want to be able to import top level modules of the project by adding ...

0 answers

Log/track user actions in a python application

I'm trying to find a method for logging user actions in my python application (not keylogging a user's entire machine at all times) for analysis. The python application is installed on a local ...

0 answers

arm-none-eabi-g++ is trying to compile for desktop instead of arm

I have a makefile that calls arm-none-eabi-g++ to compile a bunch of files. If I give the files a .c extension, it works. If I change the extension to .cc, it looks like g++ is doing the compilation ...

0 answers

“pwd” giving path on windows machine when run through python subprocess

I wrote the following script called file_I_executed.py: def main(): loc = subprocess.popen("pwd") print loc Which gave output: C:\Python27\python.exe ...

0 answers

Eclipse gcc error

Hi Im new to coding and was trying to learn some C++ Im currently watching the Lynda Essential C/C++ coarse, and when setting up the gnu with Eclipse, I encounter this error: Building file: ...

2 answers

Selenium not working on Pycharm

I installed Selenium on my system using 'pip install selenium' and it works great on Mac Console. But when I tried using selenium in my project on Pycharm, I got an error that No module named Selenium ...

0 answers

Django: Fetching Twitter account details after successful Twitter login

I'm trying to work on an application where I'd allow users to login using their Twitter account credentials and fetch some data from their Twitter accounts, like the count of their Twitter followers, ...

0 answers

Pickle and exec in python

¡Hi everybody! What I have to do is this: import pickle exec "def f(): print 'Hi!'" code = pickle.dumps(f) print code As you can see, it works fine. But, in order to avoid defining global ...

2 answers

Getting “does not name a type error”, but I am naming a type

I'm sure I'm overlooking something basic here, but I can't figure it out. I have this bit of code: boost::asio::io_service smpp_io_service; tcp::endpoint ...

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

Sum all items in final row of dataframe

I have the following dataframe: BBG.XSWX.KABN.S BBG.XETR.TKA.S BBG.XSWX.CON.S BBG.XLON.ISAT.S date 20/02/2015 -0.004881 0.008011 0.007047 -0.000307 ...

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

Lost connection with scp

I have installed the Git version control in Windows 8.1y by using the ssh protocol, but when I set the repository into a server with the command: scp -r project.git user @ la_ip: \ destination folder ...

15 30 50 per page
1 2 3