Questions

IIS Express Windows Authentication

I'm trying to use IIS Express with VS2010 to host a silverlight application. I modified my applicationhost.config file to allow for modification of the proper configuration settings. I have the foll...

get path for my .exe

how can I get my .exe path because if I copy my .exe I can get my new path ?

25 May at 08:46

Download file of any type in Asp.Net MVC using FileResult?

I've had it suggested to me that I should use FileResult to allow users to download files from my Asp.Net MVC application. But the only examples of this I can find always has to do with image files (s...

23 May at 11:47

How to elegantly check if a number is within a range?

How can I do this elegantly with C#? For example, a number can be between 1 and 100. I know a simple `if (x >= 1 && x <= 100)` would suffice; but with a lot of syntax sugar and new features constantly...

29 Sep at 19:51

redirect COPY of stdout to log file from within bash script itself

I know how to to a file: ``` exec > foo.log echo test ``` this will put the 'test' into the foo.log file. Now I want to i.e. it can be done trivially from outside the script: ``` script | tee ...

9 Aug at 23:56

Read values into a shell variable from a pipe

I am trying to get bash to process data from stdin that gets piped into, but no luck. What I mean is none of the following work: ``` echo "hello world" | test=($(< /dev/stdin)); echo test=$test test=...

25 Aug at 04:12

How do I edit the Visual Studio templates for new C# class/interface?

I find myself removing the following import statements in nearly every C# file I create in Visual Studio: ``` using System.Collections.Generic; using System.Linq; using System.Text; ``` Of course i...

9 Jun at 22:19

What is the best way to test for an empty string with jquery-out-of-the-box?

What is the best way to test for an empty string with jquery-out-of-the-box, i.e. without plugins? I tried [this](http://zipalong.com/blog/?p=287). But it did't work at least out-of-the-box. It woul...

14 Jun at 13:31

What is the best IDE to develop Android apps in?

I am about to start developing an android app and need to get an IDE. Eclipse and the android eclipse plugin appears to be the natural choice. However I am familiar with intelliJ and re-sharper so I w...

10 Sep at 14:31

How to make a smooth image rotation in Android?

I'm using a `RotateAnimation` to rotate an image that I'm using as a custom cyclical spinner in Android. Here's my `rotate_indefinitely.xml` file, which I placed in `res/anim/`: ``` <?xml version="1...

27 Oct at 23:52

Find an item in a list by LINQ

Here I have a simple example to find an item in a list of strings. Normally I use a `for` loop or anonymous delegate to do it like this: ``` int GetItemIndex(string search) { int found = -1; if ...

11 Jun at 20:11

How can I ensure that a division of integers is always rounded up?

I want to ensure that a division of integers is always rounded up if necessary. Is there a better way than this? There is a lot of casting going on. :-) ``` (int)Math.Ceiling((double)myInt1 / myInt2)...

23 Jun at 15:55

html select option separator

How do you make a separator in a select tag? ``` New Window New Tab ----------- Save Page ------------ Exit ```

16 Dec at 17:3

How to pipe list of files returned by find command to cat to view all the files

I am doing a [find](https://www.man7.org/linux/man-pages/man1/find.1.html) to get a list of files. How do I pipe it to another utility like [cat](https://www.man7.org/linux/man-pages/man1/cat.1.html) ...

7 Nov at 12:30

Centering a div block without the width

I have a problem when I try to center the div block "products" because I don't know in advance the div width. Anybody have a solution? Update: The problem I have is I don't know how many products I'...

8 Dec at 02:15

Invalid postback or callback argument. Event validation is enabled using '<pages enableEventValidation="true"/>'

I am getting the following error when I post back a page from the client-side. I have JavaScript code that modifies an asp:ListBox on the client side. How do we fix this? Error details below: ``` S...

How can I determine installed SQL Server instances and their versions?

I'm trying to determine what instances of sql server/sql express I have installed (either manually or programmatically) but all of the examples are telling me to run a SQL query to determine this whic...

8 Oct at 15:42

Vue Js - Loop via v-for X times (in a range)

How can I repeat a loop via `v-for` X (e.g. 10) times? ``` <!-- want to repeat this (e.g.) 10 times --> <ul> <li v-for="item in shoppingItems"> {{ item.name }} - {{ item.price }} </li> </ul> ...

24 Oct at 10:1

How to escape curly-brackets in f-strings?

I have a string in which I would like curly-brackets, but also take advantage of the f-strings feature. Is there some syntax that works for this? Here are two ways it does not work. I would like to in...

How to parse JSON string in Typescript

Is there a way to parse strings as JSON in TypeScript? For example in JavaScript, we can use [JSON.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)...

20 Feb at 21:1

How can I mimic the bottom sheet from the Maps app?

Can anyone tell me how I can mimic the bottom sheet in the new Apple Maps app in iOS 10? In Android, you can use a `BottomSheet` which mimics this behaviour, but I could not find anything like that fo...

7 Jun at 20:29

@HostBinding and @HostListener: what do they do and what are they for?

In my meanderings around the world wide interweb, and now especially the [angular.io style docs](https://angular.io/guide/styleguide), I find many references to `@HostBinding` and `@HostListener`. It ...

13 Dec at 23:26

SQLAlchemy: engine, connection and session difference

I use SQLAlchemy and there are at least three entities: `engine`, `session` and `connection`, which have `execute` method, so if I e.g. want to select all records from `table` I can do this ``` engin...

toBe(true) vs toBeTruthy() vs toBeTrue()

What is the difference between `expect(something).toBe(true)`, `expect(something).toBeTruthy()` and `expect(something).toBeTrue()`? Note that `toBeTrue()` is a introduced in [jasmine-matchers](https...

sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype('float64')

I am using sklearn and having a problem with the affinity propagation. I have built an input matrix and I keep getting the following error. ``` ValueError: Input contains NaN, infinity or a value to...