Questions

Where does Console.WriteLine go in ASP.NET?

In a J2EE application (like one running in WebSphere), when I use `System.out.println()`, my text goes to standard out, which is mapped to a file by the WebSphere admin console. In an ASP.NET applica...

14 Apr at 12:59

How to get first element in a list of tuples?

I have a list like below where the first element is the id and the other is a string: ``` [(1, u'abc'), (2, u'def')] ``` I want to create a list of ids only from this list of tuples as below: ``` ...

24 May at 09:31

'uint32_t' identifier not found error

I'm porting code from Linux C to Visual C++ for windows. Visual C++ doesn't know `#include <stdint.h>` so I commented it out. Later, I found a lot of those `'uint32_t': identifier not found` errors....

2 Aug at 20:15

Python datetime - setting fixed hour and minute after using strptime to get day,month,year

I've successfully converted something of `26 Sep 2012` format to `26-09-2012` using: ``` datetime.strptime(request.POST['sample_date'],'%d %b %Y') ``` However, I don't know how to set the hour and mi...

Get value of c# dynamic property via string

I'd like to access the value of a `dynamic` c# property with a string: `dynamic d = new { value1 = "some", value2 = "random", value3 = "value" };` How can I get the value of d.value2 ("random") if I...

8 Feb at 22:59

Get Base64 encode file-data from Input Form

I've got a basic HTML form from which I can grab a bit of information that I'm examining in Firebug. My only issues is that I'm trying to encode the file data before it's sent to the server where it'...

16 Feb at 18:33

What does npm install --legacy-peer-deps do exactly? When is it recommended / What's a potential use case?

Just ran into this error: ``` npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: nexttwin@0.1.0 npm ERR! Found: react@17.0.1 npm ERR! node_m...

Background images: how to fill whole div if image is small and vice versa

I have three problems: 1. When I tried to use a background image in a smaller size div, the div shows only part of image. How can I show the full or a specific part of image? 2. I have a smaller ima...

21 Mar at 05:19

Call Python function from JavaScript code

I'd like to call a Python function from JavaScript code, because there isn't an alternative in JavaScript for doing what I want. Is this possible? Could you adjust the below snippet to work? JavaScri...

Extract a substring according to a pattern

Suppose I have a list of string: ``` string = c("G1:E001", "G2:E002", "G3:E003") ``` Now I hope to get a vector of string that contains only the parts after the colon ":", i.e `substring = c(E001,E...

2 Apr at 09:29

How to solve "The directory is not empty" error when running rmdir command in a batch script?

I am making a batch script and part of the script is trying to remove a directory and all of its sub-directories. I am getting an intermittent error about a sub-directory not being empty. I read one a...

26 Sep at 00:54

Package php5 have no installation candidate (Ubuntu 16.04)

When i try to install php5 in Ubuntu 16.04 by using following code: ``` sudo apt-get install php5 php5-mcrypt ``` I get following error: ``` Reading package lists... Done Building dependency tree ...

12 Jul at 19:7

How to implement a Map with multiple keys?

I need a data structure which behaves like a Map, but uses multiple (differently-typed) keys to access its values. Something like: ``` MyMap<K1,K2,V> ... ``` With methods like: ``` getByKey1(...

11 Apr at 15:48

How to undo local changes to a specific file

I'm trying to undo local changes to a specific file. Nothing has been committed. When I want to revert all changes, I can perform `git revert --reset HEAD`. However, in this case, I don't want to rev...

23 May at 12:26

tsconfig.json: Build:No inputs were found in config file

I have an ASP.NET core project and I'm getting this error when I try to build it: ``` error TS18003: Build:No inputs were found in config file 'Z:/Projects/client/ZV/src/ZV/Scripts/tsconfig.json'. Sp...

Create an instance of a class from a string

Is there a way to create an instance of a class based on the fact I know the name of the class at runtime. Basically I would have the name of the class in a string.

11 Dec at 04:28

Subtract 1 day with PHP

I'm trying to take a date object that's coming out of my Drupal CMS, subtract one day and print out both dates. Here's what I have ``` $date_raw = $messagenode->field_message_date[0]['value']; prin...

4 Oct at 16:45

Get specific line from text file using just shell script

I am trying to get a specific line from a text file. So far, online I have only seen stuff like sed, (I can only use the sh -not bash or sed or anything like that). I need to do this only using a bas...

8 Sep at 08:37

upstream sent too big header while reading response header from upstream

I am getting these kind of errors: > 2014/05/24 11:49:06 [error] 8376#0: *54031 upstream sent too big header while reading response header from upstream, client: 107.21.193.210, server: aamjanata.com...

UIView with rounded corners and drop shadow?

I’ve been working on an application for a couple of years and received a simple design request: Round the corners on a UIView and add a drop shadow.To do as given below. I want a custom `UIView`... : ...

The given key was not present in the dictionary. Which key?

Is there a way to get the value of the given key in the following exception in C# in a way that affects all generic classes? I think this is a big miss in the exception description from Microsoft. ``...

13 Jan at 14:40

What's the difference between text/xml vs application/xml for webservice response

This is more of a general question about the difference between `text/xml` and `application/xml`. I am fairly new to writing webservices (REST - Jersey). I have been producing `application/xml` since ...

28 Jan at 19:40

Prevent form redirect OR refresh on submit?

I've searched through a bunch of pages, but can't find my problem, so I had to make a post. I have a form that has a submit button, and when submitted I want it to NOT refresh OR redirect. I just wan...

10 Mar at 07:53

Angular pass callback function to child component as @Input similar to AngularJS way

AngularJS has the & parameters where you could pass a callback to a directive (e.g [AngularJS way of callbacks](https://stackoverflow.com/questions/31440366/pass-callback-function-to-directive). Is it...

19 Jul at 10:31

Exception in thread "main" java.lang.UnsupportedClassVersionError: a (Unsupported major.minor version 51.0)

> [unsupported major .minor version 51.0](https://stackoverflow.com/questions/10382929/unsupported-major-minor-version-51-0) I installed JDK7, a simple hello word program gets compile but when...