Questions

How to get a ListBox ItemTemplate to stretch horizontally the full width of the ListBox?

I want to have the ListItems to extend with their orange background the full width of the Listbox. Currently they are only as wide as the FirstName + LastName. I've set every element I can to: Horiz...

8 May at 08:37

Best way to extract a subvector from a vector?

Suppose I have a `std::vector` (let's call it `myVec`) of size `N`. What's the simplest way to construct a new vector consisting of a copy of elements X through Y, where 0 <= X <= Y <= N-1? For exam...

10 May at 06:9

How can I toggle word wrap in Visual Studio?

Does Visual Studio .NET have a way to toggle word-wrap on and off? I am used to this feature in Eclipse which allows you to right click and toggle word wrap on and off so that when you have long line...

31 May at 03:9

How can I use inverse or negative wildcards when pattern matching in a unix/linux shell?

Say I want to copy the contents of a directory excluding files and folders whose names contain the word 'Music'. ``` cp [exclude-matches] *Music* /target_directory ``` What should go in place of [e...

19 Oct at 17:24

How to create number input field in Flutter?

I'm unable to find a way to create an input field in Flutter that would open up a numeric keyboard and should take numeric input only. Is this possible with Flutter material widgets? Some GitHub discu...

24 Sep at 08:26

How do I initialize Kotlin's MutableList to empty MutableList?

Seems so simple, but, how do I initialize Kotlin's `MutableList` to empty `MutableList`? I could hack it this way, but I'm sure there is something easier available: ``` var pusta: List<Kolory> = emp...

7 Mar at 08:7

Images can't contain alpha channels or transparencies

Apple has released new version of iTunes Connect & I got an error message when I tried to set Screenshots on itunes connect for my app. ``` "Images can't contain alpha channels or transparencies." ``...

6 Sep at 06:36

Synchronously waiting for an async operation, and why does Wait() freeze the program here

: I'm looking for an explanation, not just a solution. I already know the solution. Despite having spent several days studying MSDN articles about the Task-based Asynchronous Pattern (TAP), async and...

Convert one date format into another in PHP

Is there a simple way to convert one date format into another date format in PHP? I have this: ``` $old_date = date('y-m-d-h-i-s'); // works $middle = strtotime($old_date); /...

How to get the device's IMEI/ESN programmatically in android?

To identify each devices uniquely I would like to use the IMEI (or ESN number for CDMA devices). How to access this programmatically?

19 May at 06:21

How to set initial value and auto increment in MySQL?

How do I set the initial value for an "id" column in a MySQL table that start from 1001? I want to do an insert `"INSERT INTO users (name, email) VALUES ('{$name}', '{$email}')";` Without specifying...

30 Dec at 04:4

How can I suppress all output from a command using Bash?

I have a Bash script that runs a program with parameters. That program outputs some status (doing this, doing that...). There isn't any option for this program to be quiet. How can I prevent the scri...

21 Feb at 19:50

Determine device (iPhone, iPod Touch) with iOS

Is there a way to determine the device running an application. I want to distinguish between `iPhone` and `iPod Touch`, if possible.

4 Jan at 10:18

Hibernate: hbm2ddl.auto=update in production?

Is it okay to run Hibernate applications configured with `hbm2ddl.auto=update` to update the database schema in a production environment?

7 May at 17:42

Polymorphism vs Overriding vs Overloading

In terms of Java, when someone asks: > what is polymorphism? Would or be an acceptable answer? I think there is a bit more to it than that. I think is not the right answer for sure.

How to get UTF-8 working in Java webapps?

I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support `äöå` etc. for regular Finnish text and Cyrillic alphabets like `ЦжФ` for special cases. My setup is the f...

20 Mar at 20:32

How to get a file's Media Type (MIME type)?

How do you get a Media Type (MIME type) from a file using Java? So far I've tried JMimeMagic & Mime-Util. The first gave me memory exceptions, the second doesn't close its streams properly. How would...

4 Apr at 18:39

Context.startForegroundService() did not then call Service.startForeground()

I am using `Service` Class on the Android O OS. I plan to use the `Service` in the background. The [Android documentation](https://developer.android.com/guide/components/services#StartingAService)...

Powershell Invoke-WebRequest Fails with SSL/TLS Secure Channel

I'm trying to execute this powershell command `Invoke-WebRequest -Uri https://apod.nasa.gov/apod/` and I get this error. https requests appear to work ("[https://google.com](https://google.com)") ...

30 Nov at 04:51

Error: Node Sass does not yet support your current environment: Windows 64-bit with false

``` E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj>ionic serve -l (node:4772) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs...

30 Dec at 18:14

Ignore duplicates when producing map using streams

``` Map<String, String> phoneBook = people.stream() .collect(toMap(Person::getName, Person::getAddress)); ```...

12 May at 09:50

go get results in 'terminal prompts disabled' error for github private repo

I created the private repo examplesite/myprivaterepo using the Github UI from my browser. Then I went to my go directory (on the desktop) and cloned it: ``` $ cd $GOPATH $ go get github.com/examples...

7 Jan at 04:32

Using psql how do I list extensions installed in a database?

How do I list all extensions that are already installed in a database or schema from psql? See also - [Finding a list of available extensions that PostgreSQL ships with](https://dba.stackexchange.co...

400 BAD request HTTP error code meaning?

I have a JSON request which I'm posting to a HTTP URL. Should this be treated as `400` where `requestedResource` field exists but `"Roman"` is an invalid value for this field? ``` [{requestedResou...

How do I set the maximum line length in PyCharm?

I am using PyCharm on Windows and want to change the settings to limit the maximum line length to `79` characters, as opposed to the default limit of `120` characters. Where can I change the maximum ...

25 Sep at 13:56