Questions

Why can I change a constant object in javascript

I know that ES6 is not standardized yet, but a [lot of browsers currently support](http://kangax.github.io/es5-compat-table/es6/) `const` keyword in JS. In spec, it is written that: > The value of a c...

12 Aug at 12:16

Suppressing "warning CS4014: Because this call is not awaited, execution of the current method continues..."

This is not a duplicate of ["How to safely call an async method in C# without await"](https://stackoverflow.com/questions/15522900/how-to-safely-call-an-async-method-in-c-sharp-without-await). > wa...

7 Dec at 00:23

Make var_dump look pretty

I have a simple `$_GET[]` query var set for showing testing data when pulling down queries from the DB. ``` <?php if($_GET['test']): ?> <div id="test" style="padding: 24px; background: #fff; text-a...

9 Nov at 21:58

How to make Twitter bootstrap modal full screen

``` <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-body"> <%= image_tag "Background.jpg" %> </div> <...

12 Sep at 23:57

How to translate between Windows and IANA time zones?

As described in [the timezone tag wiki](https://stackoverflow.com/tags/timezone/info), there are two different styles of time zones. - Those provided by Microsoft for use with Windows and the .Net `T...

3 Nov at 19:7

How do you create nested dict in Python?

I have 2 CSV files: 'Data' and 'Mapping': - `Device_Name``GDN``Device_Type``Device_OS`- `Device_Name`- `Device_Name``GDN``Device_Type``Device_OS` I know how to use dict when only 2 columns are prese...

Is there a ceiling equivalent of // operator in Python?

I found out about the `//` operator in Python which in Python 3 does division with floor. Is there an operator which divides with ceil instead? (I know about the `/` operator which in Python 3 does f...

2 Jul at 12:59

Center Oversized Image in Div

I have been trying to sort out how to center an oversized image within a div using css only. We are using a fluid layout, so the width of the image containers varies as the page width does (height of...

14 Feb at 09:56

REST API Login Pattern

I am creating a REST api, closely following apigee suggestions, using nouns not verbs, api version baked into the url, two api paths per collection, GET POST PUT DELETE usage, etc. I am working on th...

24 Mar at 04:48

Is HttpClient safe to use concurrently?

In all the examples I can find of usages of `HttpClient`, it is used for one off calls. But what if I have a persistent client situation, where several requests can be made concurrently? Basically, is...

Can the C# interactive window interact with my code?

In Visual Studio 2015 or later, I can open the 'C# interactive window', and run code: ``` > 5 + 3 8 ``` That's cute. Now how can I interact —my classes? Assume I have a project open. ``` > new Cog...

26 Feb at 09:0

Python code to remove HTML tags from a string

I have a text like this: ``` text = """<div> <h1>Title</h1> <p>A long text........ </p> <a href=""> a link </a> </div>""" ``` using pure Python, with no external module I want to have this: ``` >>...

6 Jun at 14:38

Find() vs. Where().FirstOrDefault()

I often see people using `Where.FirstOrDefault()` to do a search and grab the first element. Why not just use `Find()`? Is there an advantage to the other? I couldn't tell a difference. ``` namespace...

15 Dec at 09:15

Configuring Log4j Loggers Programmatically

I am trying to use SLF4J (with `log4j` binding) for the first time. I would like to configure 3 different named Loggers that can be returned by a LoggerFactory which will log different levels and pus...

22 Oct at 10:29

How do I get a list of connected sockets/clients with Socket.IO?

I'm trying to get a list of all the sockets/clients that are currently connected. `io.sockets` does not return an array, unfortunately. I know I could keep my own list using an array, but I don't thin...

30 Aug at 10:41

Is there a way to only install the mysql client (Linux)?

Are there are any Linux mysql command line tools that don't require the entire mysql db installation package to be installed? What I'm trying to do is from server #1 (app server), execute mysql com...

13 Mar at 03:32

Changing every value in a hash in Ruby

I want to change every value in a hash so as to add '%' before and after the value so ``` { :a=>'a' , :b=>'b' } ``` must be changed to ``` { :a=>'%a%' , :b=>'%b%' } ``` What's the best way to do...

4 Mar at 03:7

How can I default a parameter to Guid.Empty in C#?

I wish to say: ``` public void Problem(Guid optional = Guid.Empty) { } ``` But the compiler complains that Guid.Empty is not a compile time constant. As I don’t wish to change the API I can’t use:...

5 Jun at 07:34

When should I create a destructor?

For example: ``` public class Person { public Person() { } ~Person() { } } ``` When should I manually create a destructor? When have you needed to create a destructor?

4 Feb at 13:59

How can I add to a List's first position?

I just have a `List<T>` and I would like to add an item to this list but at the first position. `MyList.add()` adds the item as the last. How can I add it as the first?. Thanks for help!

4 Jan at 18:34

jQuery access input hidden value

How can I access `<input type="hidden">` tag's `value` attribute using jQuery?

27 Nov at 11:12

How to create a simple map using JavaScript/JQuery

How can you create the JavaScript/JQuery equivalent of this Java code: ``` Map map = new HashMap(); //Doesn't not have to be a hash map, any key/value map is fine map.put(myKey1, myObj1); map.put(myK...

22 Nov at 15:28

Get properties and values from unknown object

From the world of PHP I have decided to give C# a go. I've had a search but can't seem to find the answer of how to do the equivalent to this. ``` $object = new Object(); $vars = get_class_vars(get_...

10 Nov at 13:11

Create an array or List of all dates between two dates

I am generating multi-series graphs with the date along the X-Axis. The problem is that not all of the series in the graph have the same dates in the date range. Meaning that if I choose 1 Feb thr...

31 Dec at 16:43

What is the difference between Linq to XML Descendants and Elements

I have came across both these keywords in the VS IntelliSense. I tried to googling the difference between them and did not get a clear answer. Which one of these have the best performance with small t...

7 Oct at 12:20