Questions

Appending to list in Python dictionary

Is there a more elegant way to write this code? What I am doing: I have keys and dates. There can be a number of dates assigned to a key and so I am creating a dictionary of lists of dates to repres...

5 Jun at 08:56

How to assign an exec result to a sql variable?

How do you assign the result of an exec call to a variable in SQL? I have a stored proc called `up_GetBusinessDay`, which returns a single date. Can you do something like this: ``` exec @Previous...

Which passwordchar shows a black dot (•) in a winforms textbox?

Short question here: In , how do I use the `PasswordChar` property of a `Textbox` to show a common as a ? Is there perhaps some font I can use that has this as a character? If I use '`UseSystemPass...

11 Jul at 12:22

How to get current working directory in Java?

Let's say I have my main class in `C:\Users\Justian\Documents\`. How can I get my program to show that it's in `C:\Users\Justian\Documents`? Hard-Coding is not an option- it needs to be adaptable if ...

18 Dec at 18:57

How to display svg icons(.svg files) in UI using React Component?

I have seen a lot of libraries for svg on react but none gave me how to import an svg file in the react component. I have seen code which talk about bring the svg code into react rather than using the...

23 Aug at 07:10

How to get the request parameters in Symfony 2?

I am very new to symfony. In other languages like java and others I can use `request.getParameter('parmeter name')` to get the value. Is there anything similar that we can do with symfony2. I have se...

18 Aug at 17:19

CSS hide scroll bar if not needed

I am trying to figure out how I can hide the `overflow-y:scroll;` if not needed. What I mean is that I am building a website and I have a main area which posts will be displayed and I want to hide the...

29 Sep at 11:23

React native text going off my screen, refusing to wrap. What to do?

The following code can be found in [this live example](https://rnplay.org/apps/dN8pPA) I've got the following react native element: ``` 'use strict'; var React = require('react-native'); var { Ap...

30 Mar at 12:49

Align <div> elements side by side

I know this is a rather simple question, but I can't figure it out for the life of me. I have two links which I've applied a background image to. Here's what it currently looks like (apologies for ...

25 Mar at 16:40

What does the question mark and the colon (?: ternary operator) mean in objective-c?

What does this line of code mean? ``` label.frame = (inPseudoEditMode) ? kLabelIndentedRect : kLabelRect; ``` The `?` and `:` confuse me.

JSON.stringify output to div in pretty print way

I `JSON.stringify` a json object by ``` result = JSON.stringify(message, my_json, 2) ``` The `2` in the argument above is supposed to pretty print the result. It does this if I do something like `al...

How do you put an image file in a json object?

I am making a database for video games, each containing elements like name, genre, and and image of the game. Is it possible to put images into a json object for the db? If not is there a way around ...

27 Dec at 22:17

How to get the IP address of the server on which my C# application is running on?

I am running a server, and I want to display my own IP address. What is the syntax for getting the computer's own (if possible, external) IP address? Someone wrote the following code. ``` IPHostEnt...

28 Jul at 21:22

How to get element by innerText

How to get tag in html page, if I know what text tag contains. E.g.: ``` <a ...>SearchingText</a> ```

28 Jun at 14:27

What exactly is nullptr?

We now have C++11 with many new features. An interesting and confusing one (at least for me) is the new `nullptr`. Well, no need anymore for the nasty macro `NULL`. ``` int* x = nullptr; myclass* ob...

9 Oct at 12:36

What's the difference between window.location= and window.location.replace()?

Is there a difference between these two lines? ``` var url = "http://www.google.com/"; window.location = url; window.location.replace(url); ```

26 Sep at 19:46

When do items in HTML5 local storage expire?

For how long is data stored in `localStorage` (as part of DOM Storage in HTML5) available? Can I set an expiration time for the data which I put into local storage?

1 Jul at 15:41

Saving an Object (Data persistence)

I've created an object like this: ``` company1.name = 'banana' company1.value = 40 ``` I would like to save this object. How can I do that?

How do you increase the max number of concurrent connections in Apache?

What httpd conf settings do I need to change to increase the max number of concurrent connections for Apache? NOTE: I turned off KeepAlive since this is mainly an API server. ``` # # KeepAlive: Wheth...

2 Aug at 16:2

Getting a list of values from a list of dicts

I have a list of dicts like this: ``` [{'value': 'apple', 'blah': 2}, {'value': 'banana', 'blah': 3} , {'value': 'cars', 'blah': 4}] ``` I want `['apple', 'banana', 'cars']` Whats the best way...

5 Apr at 08:4

How can I convert JSON to a HashMap using Gson?

I'm requesting data from a server which returns data in the JSON format. Casting a HashMap into JSON when making the request wasn't hard at all but the other way seems to be a little tricky. The JSON ...

10 May at 16:37

Find PHP version on windows command line

I just tried to know version of my PHP from windows command typing, `C:\> php -v` But it is not working. It says `php is not recognized as internal or external command`.

18 Apr at 02:59

Split string in Lua?

I need to do a simple split of a string, but there doesn't seem to be a function for this, and the manual way I tested didn't seem to work. How would I do it?

22 Mar at 17:3

What is the string concatenation operator in Oracle?

What is the string concatenation operator in Oracle SQL? Are there any "interesting" features I should be careful of? (This seems obvious, but I couldn't find a previous question asking it).

29 Jun at 21:28

Simple pagination in javascript

I am trying to make pagination for my site. ([http://anuntorhei.md](http://anuntorhei.md)) : ``` var someVar = 50; function someStupidFunction() { if (objJson.length > 50) { ...

21 Aug at 20:11