Questions

How to display a content in two-column layout in LaTeX?

I am writing an article in LaTeX and I would like to display some content in two column layout. In the left column a matrix and in the right column a list of items. I have tried with tabular environme...

23 Jun at 20:22

pytest cannot import module while python can

I am working on a package in Python. I use virtualenv. I set the path to the root of the module in a .pth path in my virtualenv, so that I can import modules of the package while developing the code a...

27 Feb at 12:13

What's the point of the X-Requested-With header?

JQuery and other frameworks add the following header: > X-Requested-With: XMLHttpRequest Why is this needed? Why would a server want to treat AJAX requests differently than normal requests? : I jus...

14 Jan at 20:8

List distinct values in a vector in R

How can I list the distinct values in a vector where the values are replicative? I mean, similarly to the following SQL statement: ``` SELECT DISTINCT product_code FROM data ```

21 Jan at 13:59

Understanding esModuleInterop in tsconfig file

I was checking out someone `.tsconfig` file and there I spotted `--esModuleInterop` This is his `.tsconfig` file ``` { "compilerOptions": { "moduleResolution": "node", "target": "es6", "...

23 Jan at 19:48

Append a tuple to a list - what's the difference between two ways?

I wrote my first "Hello World" 4 months ago. Since then, I have been following a Coursera Python course provided by Rice University. I recently worked on a mini-project involving tuples and lists. The...

16 Jul at 16:16

Maven project.build.directory

In Maven, what does the `project.build.directory` refer to? I am a bit confused, does it reference the source code directory or the target directory in the Maven project?

3 Feb at 09:13

What is Git fast-forwarding?

Is it OK to assume that fast-forward means all commits are replayed on the target branch and the `HEAD` is set to the last commit on that branch?

9 Nov at 21:7

Nginx: stat() failed (13: permission denied)

I am using the default config while adding the specific directory with nginx installed on my ubuntu 12.04 machine. ``` server { #listen 80; ## listen for ipv4; this line is default and imp...

27 Feb at 13:0

How to suppress Pandas Future warning ?

When I run the program, Pandas gives 'Future warning' like below every time. ``` D:\Python\lib\site-packages\pandas\core\frame.py:3581: FutureWarning: rename with inplace=True will return None from ...

Java: Unresolved compilation problem

What are the possible causes of a "java.lang.Error: Unresolved compilation problem"? Additional information: I have seen this after copying a set of updated JAR files from a build on top of the exi...

15 Jul at 11:18

How do I center a window on the screen in C# & WinForms?

I need a way to center the current window on the screen. So for example, if a user pushes a button, I want the window to center itself on the screen. I know you can use the startposition property, but...

11 Feb at 09:25

c++ array - expression must have a constant value

I get an error when I try to create an array from the variables I declared. ``` int row = 8; int col= 8; int [row][col]; ``` Why do I get this error: > expression must have a constant value.

31 May at 16:42

Python variables as keys to dict

Is there an easier way to do this in Python (2.7)?: Note: This isn't anything fancy, like putting all local variables into a dictionary. Just the ones I specify in a list. ``` apple = 1 banana = 'f' ...

30 Jun at 06:45

Cast received object to a List<object> or IEnumerable<object>

I'm trying to perform the following cast ``` private void MyMethod(object myObject) { if(myObject is IEnumerable) { List<object> collection = (List<object>)myObject; ...

10 Mar at 22:47

How to change a field name in JSON using Jackson

I'm using jackson to convert an object of mine to json. The object has 2 fields: ``` @Entity public class City { @id Long id; String name; public String getName() { return name; } publ...

Detect Route Change with react-router

I have to implement some business logic depending on browsing history. What I want to do is something like this: ``` reactRouter.onUrlChange(url => { this.history.push(url); }); ``` Is there an...

How often does python flush to a file?

1. How often does Python flush to a file? 2. How often does Python flush to stdout? I'm unsure about (1). As for (2), I believe Python flushes to stdout after every new line. But, if you overloa...

7 May at 06:42

jQuery change method on input type="file"

I'm trying to embrace jQuery 100% with it's simple and elegant API but I've run into an inconsistency between the API and straight-up HTML that I can't quite figure out. I have an AJAX file uploader ...

Cannot use Server.MapPath

What I must do to make `Server.MapPath` work? I have `using System.Web;` what else? When I type `Server` there is no quick result option (intelli-sense) for `Server`. Any help?

TypeError: tuple indices must be integers, not str

I am trying to pull data from a database and assign them to different lists. This specific error is giving me a lot of trouble "TypeError: tuple indices must be integers, not str" I tried converting ...

25 Apr at 04:42

Regex date format validation on Java

I'm just wondering if there is a way (maybe with regex) to validate that an input on a Java desktop app is exactly a string formatted as: "YYYY-MM-DD".

2 Aug at 12:1

Calculating a directory's size using Python?

Before I re-invent this particular wheel, has anybody got a nice routine for calculating the size of a directory using Python? It would be very nice if the routine would format the size nicely in Mb/G...

1 Feb at 00:51

php - How do I fix this illegal offset type error

I'm getting > illegal offset type error for every iteration of this code. Here's the code : ``` $s = array(); for($i = 0; $i < 20; $i++){ $source = $xml->entry[$i]->source; $s[$source] += ...

18 Dec at 19:44

When would you use the Builder Pattern?

What are some , of using the Builder Pattern? What does it buy you? Why not just use a Factory Pattern?

28 Sep at 16:50