Sample Filter
   11 tags on

0 answers

sbt (building Scalatra) immediately fails with <2GB of RAM

I set up a DigitalOcean "droplet"/server and provided it with 512mb of RAM. upon trying to run the ./sbt script I instantly get this failure: Using /root/.sbt/0.13.0 as sbt dir, -sbt-dir to ...

1 answer

Adding protorpc url variables

Is there a way to add a variable in the protorpc service path? Similar to webapp2 url templates.

0 answers

How to enable python repl autocomplete and still allow new line tabs

I currently have the following in ~/.pythonrc to enable auto completion in the python repl: # Autocompletion import rlcompleter, readline readline.parse_and_bind('tab:complete') However, when I tab …

1 answer

Django: Template Context Processor declare all functions in one tuple entry

Is there a way to declare all of your custom template context processor functions in one tuple entry? # Templates Related Settings TEMPLATE_CONTEXT_PROCESSORS = ( ...

1 answers | 1 min ago by user1757703 on Stack Overflow stackoverflow.com
5 answers

Change to sudo user within a python script

I have a problem. I am writing a piece of software, which is required to perform an operation which requires the user to be in sudo mode. running 'sudo python filename.py' isn't an option, which leads …

5 answers | 1 min ago by Lipwig on Stack Overflow stackoverflow.com
0 answers

When I use pygame.transform.rotate(), it moves my image so that, if used in succession, it will go off screen. Why?

So I loaded an image, then used rotate on it. However, when I ran the program, it just slid off screen. Why? import pygame, sys def rotate45(gameObject): newObject = ...

1 answer

c++ signal handler can wake a thread?

Since a C++ signal handler should only access volatile std::sig_atomic_t or std::atomic(since C++11), is it possible to have a thread sleeping and wake with it? std::atomic_bool exit_now(false); ...

3 answers

Sharing AWS Elastic Beanstalk configuration for git deployment to AWS

I have a project deployed to Amazon Elastic Beanstalk but I need to have other team members deploy as well. We are using AWS eb CLI, which is very handy. But, it adds all generated configuration ...

0 answers

How to do POST request with Newman?

I'm trying to do the equivalent of curl -XPOST http://example.com -d '{"query":{"term":{"user":"kimchy"}}}'. My code looks like the following // this uses dijon val query = json"""{ "query" : { …

0 answers

Understanding Template Partial Specialization

I am trying to understand the concept of partial specialization of templates. However I seem to be confusing it with template specialization. I am considering the following two examples template ...

0 answers

How implement a stream in c++/cxx language

Hi I'm looking for an example which implements a stream in c++/cxx, to be clear this is the reference of class ...

0 answers

“No-throw dereferencing” of std::unique_ptr

I write code in C++ which uses a std::unique_ptr u to handle a std::string resource, and I want to dereference u so that I can pass the std::string to a call of the std::string copy constructor: ...

1 answer

pylint does not work in emacs

I have emacs24 (installed by homebrew) and pylint (installed by pip) on my mac, and I have the following code (add-hook 'after-init-hook #'global-flycheck-mode) in my .emacs file. However there's …

1 answer

Index where condition is true. Efficiency and brevity

Say I have a dataframe: this_is_my_dataframe_with_a_long_name I would like to find the indices where a condition is True. For example, let's say that the condition is that column is equal to value. …

1 answers | 3 mins ago by user815423426 on Stack Overflow stackoverflow.com
0 answers

How to specify custom tool-tip descriptions for Python functions in IDLE

As soon as I type print( in IDLE 3.4.1, a tool-tip comes up: print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) Clearly this was custom-set in the definition of the print function, …

2 answers

How can I confirm an assumption of an automatically inferenced type at compile time? (i.e. static_assert style)

Occasionally, I'll assign the returned value of a function to a variable of auto type (e.g. auto returnValue = someFunction();), but still would like to clarify/enforce certain assumptions about the …

4 answers

How to perform list comprehension on the following two lists?

This question has probably been asked here before but me being new to python and lack of better keywords to search led me to ask the question. I have two lists: list1 = ['John', 'Don', 'Sam'] list2 …

0 answers

QT can't access members

My program starts perfectly and shows the QPlainTextEdit(console) widget that I create then when I call a method from that widget the program fails and exit main.cpp #include "cmdmw.h" #include ...

3 answers

Two versions of [] operator for rvalue and lvalue cases

I have implemented a collection of ints. I would like to have to versions of the [] operator: One that returns an int used when a rvalue is needed. For example, when user tries to read a given ...

2 answers

Autoformatting python code: dictionaries

I have a frankly demonic python source file, consisting of an endless list of unindented dictionaries. It's unreadable. I'd like to reformat the file to look like this: [ { 'foo' : …

2 answers | 10 mins ago by uʍop ǝpısdn on Stack Overflow stackoverflow.com
0 answers

Python HTTP POST to printer ulogin.cgi

This script is supposed to connect to a printer (protected by HTTP Auth) and scrape its XML/HTML for information: import requests printer_url = "http://*redacted*/wcd/ulogin.cgi" payload = ...

0 answers

Move Wakari Notebooks to another directory

I cannot find an option to move notebooks from the home directory do other directories in wakari. I have a bunch of notebook as mini-examples i created, and now i want to categorize them into ...

5 answers

template for “AnySTLContainer<int>” c++

I am looking for a way to provide a function that takes a templated (STL) container, but requires its elements to be of a certain type (e.g. int). These function calls should be VALID: ...

1 answer

2 classes, both have pointers. need them to either point to a type of themselves, or a type of the other

I am making linked list of sectors. A sector can either be of type directorySector or userSector. The first sector is always a directory sector, and the rest are not known until run time. How would I …

1 answer

It seems that it is not possible to do POST with body >10K with scala play ws framework

It seems that it is not possible to do POST with body >10K If I do: WS.url(url).post("content more than 10K") I've got clipped body. Exactly 10K. How can I avoid this limitation?

3 answers

Immediate detection of heap corruption errors on Windows. How?

I can't sleep! :) I have a reasonably large project on Windows and encountered some heap corruption issues. I have read all SO, including this nice topic: How to debug heap corruption errors?, ...

1 answer

How do I add a Scala variable's value to a jsValue in Play?

Let's say I have val numOpen = 5. Now I have a JsValue that has a key whose value needs to be the value of numOpen: var data1: JsValue = Json.parse(""" { "value": 64, // …

1 answers | 18 mins ago by L. Becker on Stack Overflow stackoverflow.com
5 answers

How does origin/HEAD get set?

I have a branch set up to track a ref in origin. git checkout <branchname> switches to that branch, and a git status will show me how far ahead or behind my branch is from origin, but I'm ...

5 answers | 19 mins ago by ecoffey on Stack Overflow stackoverflow.com
3 answers

Editing OpenCL in netbeans

I recently read a question on IDE's here on StackOverflow, having always been an emacs user I decided to try out one of these ide's, namely netbeans for editing C++. It was so nice that I got a little …

1 answer

Basemap clipped in East-West Direction (not wrapping)

I have a global 2.5-degree data field (144,72) plotted on a basemap. I thought everything was working until I noticed that the map was not continuous in the E-W direction. The image is posted at …

15 30 50 per page
1 2 3