Questions

Changing text of UIButton programmatically swift

Simple question here. I have a UIButton, currencySelector, and I want to programmatically change the text. Here's what I have: ``` currencySelector.text = "foobar" ``` Xcode gives me the error "Exp...

23 Mar at 15:34

Safe method to get value of nested dictionary

I have a nested dictionary. Is there only one way to get values out safely? ``` try: example_dict['key1']['key2'] except KeyError: pass ``` Or maybe python has a method like `get()` for nes...

4 Mar at 09:41

iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development

Apple's website claims that the resolution is 1080p: 1920 x 1080 However, the launch screen required by Xcode (8.0 GM launched today) is 2208 x 1242. Who's right? ![Xcode](https://i.stack.imgur.com...

"Could not run curl-config: [Errno 2] No such file or directory" when installing pycurl

I'm trying to install pycurl via: ``` sudo pip install pycurl ``` It downloaded fine, but when when it runs setup.py I get the following traceback: ``` Downloading/unpacking pycurl Running setup...

29 May at 16:15

How do I initialize a TypeScript Object with a JSON-Object?

I receive a JSON object from an AJAX call to a REST server. This object has property names that match my TypeScript class (this is a follow-on to [this question](https://stackoverflow.com/questions/22...

5 Dec at 15:50

How to fix org.hibernate.LazyInitializationException - could not initialize proxy - no Session

I get the following exception: ``` Exception in thread "main" org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.ini...

What is NODE_ENV and how to use it in Express?

This is my app that I'm currently running on production. ``` var app = express(); app.set('views',settings.c.WEB_PATH + '/public/templates'); app.set('view engine','ejs'); app.configure(function(){ ...

18 Nov at 17:44

Multiple actions were found that match the request in Web Api

I keep getting this error when I try to have 2 "Get" methods > Multiple actions were found that match the request: webapi I been looking around at the other similar questions about this on stack bu...

How to change the background color of a UIButton while it's highlighted?

At some point in my app I have a highlighted `UIButton` (for example when a user has his finger on the button) and I need to change the background color while the button is highlighted (so while the f...

10 Feb at 09:17

Commit history on remote repository

I am trying to access a branch's commit history on a remote repository. I had a look at [the doc](http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History) but could not find any substantial i...

5 Aug at 13:15

Export specific rows from a PostgreSQL table as INSERT SQL script

I have a database schema named: `nyummy` and a table named `cimory`: ``` create table nyummy.cimory ( id numeric(10,0) not null, name character varying(60) not null, city character varying(50) ...

When is the @JsonProperty property used and what is it used for?

This bean 'State' : ``` public class State { private boolean isSet; @JsonProperty("isSet") public boolean isSet() { return isSet; } @JsonProperty("isSet") public vo...

20 Sep at 15:1

How to remove item from list in C#?

I have a list stored in resultlist as follows: ``` var resultlist = results.ToList(); ``` It looks something like this: ``` ID FirstName LastName -- --------- -------- 1 Bill Smith 2 Joh...

9 Dec at 07:22

Why use 'virtual' for class properties in Entity Framework model definitions?

In the following blog: [http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx](http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-...

7 Jan at 11:31

How to show "if" condition on a sequence diagram?

I was wondering, how can one represent "`if`" statement on a sequence diagram? ``` if (somethingShouldBeDone) { // Do it } else { // Do something else } ``` Can it be represented at a...

13 Nov at 21:11

What does $(function() {} ); do?

Sometimes I make a function and call the function later. Example: ``` function example { alert('example'); } example(); // <-- Then call it later ``` Somehow, some functions cannot be called. I ha...

20 Mar at 19:49

How to use ScrollView in Android?

I have an XML layout file, but the text is more than fits into the screen size. What do I need to do in order to make a `ScrollView`? ``` <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:an...

16 Feb at 13:43

How to format strings in Java

Primitive question, but how do I format strings like this: > "Step {1} of {2}" by substituting variables using Java? In C# it's easy.

28 Aug at 17:31

How to flip background image using CSS?

How to flip any background image using CSS? Is it possible? currenty I'm using this arrow image in a `background-image` of `li` in css ![enter image description here](https://i.stack.imgur.com/ah0iN...

24 Apr at 06:33

How to get response status code from jQuery.ajax?

In the following code, all I am trying to do is to get the HTTP response code from a jQuery.ajax call. Then, if the code is 301 (Moved Permanently), display the 'Location' response header: ``` <?xml ...

17 Mar at 19:25

Difference between socket and websocket?

I'm building web app that needs to communicate with another application using socket connections. This is new territory for me, so want to be sure that [sockets](https://stackoverflow.com/questions/15...

23 Apr at 09:59

Django Admin - change header 'Django administration' text

How does one change the 'Django administration' text in the django admin header? It doesn't seem to be covered in the "Customizing the admin" documentation.

8 Feb at 21:10

How to use underscore.js as a template engine?

I'm trying to learn about new usages of javascript as a serverside language and as a functional language. Few days ago I heard about node.js and express framework. Then I saw about underscore.js as a ...

Can I set background image and opacity in the same property?

I can see in CSS references [how to set image transparency](http://www.w3schools.com/css/css_image_transparency.asp) and [how to set a background image](http://www.w3schools.com/css/css_background.asp...

3 Jan at 20:11

Count character occurrences in a string in C++

How can I count the number of `"_"` in a string like `"bla_bla_blabla_bla"`?

10 Jul at 11:42