Questions

Using setDate in PreparedStatement

In order to make our code more standard, we were asked to change all the places where we hardcoded our SQL variables to prepared statements and bind the variables instead. I am however facing a proble...

Sort an array of objects in React and render them

I have an array of objects containing some information. I am not able to render them in the order I want and I need some help with that. I render them like this: ``` this.state.data.map( (i...

28 Feb at 08:24

OS X Framework Library not loaded: 'Image not found'

I am trying to create a basic OS X Framework, right now I just have a test framework created: `TestMacFramework.framework` and I'm trying to import it into a brand new OS X Application project. I hav...

3 Apr at 12:9

CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False

I'm using Django 1.6.5 with the setting: ``` DEBUG = True ``` When I change to `DEBUG = False` and run `manage.py runserver`, I get the following error: ``` CommandError: You must set settings.ALLOWE...

22 Dec at 03:4

Java verify void method calls n times with Mockito

I'm trying to verify that a (void) method is being called inside of a DAO - I'm using a commit point that sends a list of results up to that point, resets the list and continues. Say I have 4 things ...

DB2 Query to retrieve all table names for a given schema

I'm just looking for a simple query to select all the table names for a given schema. For example, our DB has over 100 tables and I need to find any table that contains the sub-string “CUR”. I can u...

26 Nov at 14:36

How to split a long array into smaller arrays, with JavaScript

I have an array of e-mails (it can be just 1 email, or 100 emails), and I need to send the array with an ajax request (that I know how to do), but I can only send an array that has 10 or less e-mails ...

25 Oct at 23:18

Use cell's color as condition in if statement (function)

I am trying to get a cell to perform a function based on the hilight color of a cell. Here is the function I currently have: ``` =IF(A6.Interior.ColorIndex=6,IF(ROUNDDOWN(IF(M6<3,0,IF(M6<5,1,IF(M6<1...

13 Sep at 19:20

What is the main purpose of setTag() getTag() methods of View?

What is the main purpose of such methods as `setTag()` and `getTag()` of `View` type objects? Am I right in thinking that I can associate any number of objects with a single View?

How to install an APK file on an Android phone?

I have a simple "Hello Android" application on my computer ([Eclipse](http://en.wikipedia.org/wiki/Eclipse_%28software%29) environment), and I have built an [APK](http://en.wikipedia.org/wiki/APK_%28f...

8 Jul at 19:38

Create SQLite Database and table

Within C# application code, I would like to create and then interact with one or more SQLite databases. How do I initialize a new SQLite database file and open it for reading and writing? Following ...

20 Jun at 19:51

Share data between AngularJS controllers

I'm trying to share data across controllers. Use-case is a multi-step form, data entered in one input is later used in multiple display locations outside the original controller. Code below and in [js...

28 Jan at 00:33

JQuery Bootstrap Multiselect plugin - Set a value as selected in the multiselect dropdown

I am having a multiselect dropdown using the Boostrap Multiselect plugin ([http://davidstutz.de/bootstrap-multiselect/](http://davidstutz.de/bootstrap-multiselect/)) as below ``` <select id="data" na...

Escape curly brace '{' in String.Format

How do I display a literal curly brace character when using the String.Format method? Example: ``` sb.AppendLine(String.Format("public {0} {1} { get; private set; }", prop.Type, prop.Name)); ``` ...

31 Oct at 11:21

How can I convert uppercase letters to lowercase in Notepad++

I use Notepad ++ for coding mostly. How can I convert capital letters to lowercase and vice versa?

30 Nov at 16:1

How to find the day, month and year with moment.js

`2014-07-28` How do I find the `month`, `year` and `day` with `moment.js` given the date format above? ``` var check = moment(n.entry.date_entered).format("YYYY/MM/DD"); var month = check.getUTCMon...

12 Oct at 09:1

Excel how to find values in 1 column exist in the range of values in another

I have two columns- column A which extends upto 11027(values) and column I which extends to 42000(values).Both the columns contains some code details. Something like this ``` A B q123 ...

PHP convert string to hex and hex to string

I got the problem when convert between this 2 type in PHP. This is the code I searched in google ``` function strToHex($string){ $hex=''; for ($i=0; $i < strlen($string); $i++){ $hex ...

29 Aug at 09:19

REST / SOAP endpoints for a WCF service

I have a WCF service and I want to expose it as both a RESTfull service and as a SOAP service. Anyone has done something like this before?

4 Jan at 02:28

Which selector do I need to select an option by its text?

I need to check if a `<select>` has an option whose text is equal to a specific value. For example, if there's an `<option value="123">abc</option>`, I would be looking for "abc". Is there a selecto...

8 Jul at 06:21

How to call a parent method from child class in javascript?

I've spent the last couple of hours trying to find a solution to my problem but it seems to be hopeless. Basically I need to know how to call a parent method from a child class. All the stuff that I'...

30 Jun at 08:27

Get the current date in java.sql.Date format

I need to add the current date into a prepared statement of a JDBC call. I need to add the date in a format like `yyyy/MM/dd`. I've try with ``` DateFormat dateFormat = new SimpleDateFormat("yyyy/MM...

15 Aug at 17:14

How to extract the decimal part from a floating point number in C?

How can we extract the decimal part of a floating point number and store the decimal part and the integer part into two separate integer variables?

12 Mar at 16:59

Spring Boot Rest Controller how to return different HTTP status codes?

I am using Spring Boot for a simple REST API and would like to return a correct HTTP statuscode if something fails. ``` @RequestMapping(value="/rawdata/", method = RequestMethod.PUT) @ResponseBody @R...

18 Jun at 18:29

How to display all methods of an object?

I want to know how to list all methods available for an object like for example: ``` alert(show_all_methods(Math)); ``` This should print: ``` abs, acos, asin, atan, atan2, ceil, cos, exp, floor,...

31 Aug at 07:26