Swift Date Formatting

Swift Date Formatting

Ok. This one has me perplexed. I'm trying to pull a date string from a button and format is as a date to be store in CoreData. Here is my code:let dateStr = setDateBTN.titleLabel?.textlet dateFormatter = NSDateFormatter()dateFormatter.dateF

Checking if a variable is an integer in javascript

Checking if a variable is an integer in javascript

I made a form where the user inputs values for width and height that they want for the pop up window to be. I am using window.open for that. So I think I need to check if the values for width and height are integer. I have a function that

Draw Gaussian curve in Java

Draw Gaussian curve in Java

I'm coding an interactive applet with Piccolo and I need to include a Gaussian curve (aka Normal distribution chart) inside it.I imagine any kind of Java implementation would be enough, but I can't find any. Ideally, I'd like to pass a set

ROC curve for a binary classifier in MATLAB

ROC curve for a binary classifier in MATLAB

I have a binary classifier, which classifies an input X as class zero if its predicted value is below some threshold (say T), and one otherwise.I have all predicted and actual values for every input. So I can have both predicted class and a

Is it possible to hide or manipulate the jqGrid “sort” icons?

Is it possible to hide or manipulate the jqGrid “sort” icons?

I have a custom, multi-column sort attached to my jqGrid instance by means of the onSortCol event:onSortCol: function(index, iCol, sortorder) { //Manipulate the sort order via custom code, and store it in postData. return 'stop';}The

PhoneGap, PhoneGap Build and iOS - Mac needed?

PhoneGap, PhoneGap Build and iOS - Mac needed?

firstly I have reviewed previous similar questions, but there were either old and or contradictory in their answers, so I’m asking what is the current (May ’14) requirements to build/test/deploy iPhone/iPad apps?Longer version – I’ve been a

What is - function Empty() - in javascript ? [duplicate]

What is - function Empty() - in javascript ? [duplicate]

This question already has an answer here: Correct prototype chain for Function 4 answers I have this function : function fff(){}Which is a function whi

Get the (t-1) data within groups

Get the (t-1) data within groups

Apologies if this has been asked before, but I couldn't find any question which answers this exactly. I have a data like this:Project Date price A 30/3/2013 2082 B 19/3/2013 1567 B 22/2/2013 1642

Relative Layout get Width/Height return 0

Relative Layout get Width/Height return 0

I need to get width and height of Relative layout, however I do not know when the Relative Layout is ready to provide me these two attributes. My activity has several tabs and I call the getWidth() and getHeight() in onCreateView() after in

.load() kills character encoding

.load() kills character encoding

I'm using the following code to load in content:However the content is loaded in without the special characters that I want in UTF-8.It was mentioned somewhere to put this at the top of my code:$html = header('Content-Type: text/html; chars

Facebox adding commas to input

Facebox adding commas to input

I'm using a facebox to display a form inside a lightbox, nothing too exciting (just a couple of datepickers, some textboxes and a checkbox).However, I'm having issues with the postbacks, whenever I post back from the facebox it adds a ',' t

Google script to copy and rename a sheet and name is based on a cell reference

Google script to copy and rename a sheet and name is based on a cell reference

I'm new to google scripts and I need to copy the current active sheet to a new sheet and then rename this sheet based on a cell value. My issue is the cell value is a date and the below code works but instead on renaming the sheet 30-May-20

Angularjs How uri components are encoded

Angularjs How uri components are encoded

I was expecting AngularJS to encode query string parameters using the standard javascript function encodeURIComponent. According to the following test it is not the case:describe('$http', function () { it('encodes uri components correctly',

Access private members of jQuery plugin

Access private members of jQuery plugin

jQuery plugins use a pattern like this to hide private functions of a plugin:(function ($) { var a_private_function = function (opts) { opts.onStart(); } $.fn.name_of_plugin = function (options) { a_private_function(o

Why are inserts slow in the 2.6 MongoDB shell compared to previous versions?

Why are inserts slow in the 2.6 MongoDB shell compared to previous versions?

When inserting test data into MongoDB, I usually just use a for loop to do a large number of single inserts. With 2.4 and below, this is pretty fast (~2 seconds), for example:> db.timecheck.drop();true> start = new Date(); for(var i = 0; i

Is there a SWT debugger/spy?

Is there a SWT debugger/spy?

I'm trying to debug my SWT dialog (in an Eclipse plugin.) I'd like to find out why the layout is the way it is, and where the borders are between the controls. I've seen the SWT Spy plugin (http://www.eclipse.org/swt/tools.php), but I'd li

How do I insert a special character such as ' into MySQL?

How do I insert a special character such as ' into MySQL?

I am executing the insert query from a shell script which reads data from multiple files. Some of the data to be inserted contains ' in the text and MySQL keeps giving errorsERROR 1064 (42000) at line 1: You have an error in your SQL syntax

Java - Iterating over every two elements in a list

Java - Iterating over every two elements in a list

What's the best way to iterate over a list while processing 2 elements at the same time?Example:List strings = Arrays.asList("item 1", "item 2", "item 3", "item 4");for(int i = 0; i i + 1){ second = strings.get(i + 1); } Syste

Determining Django Model Instance Types after a Query on a Base-class

Determining Django Model Instance Types after a Query on a Base-class

Is there a way to determine what the 'real' class of a Django database object is, after it has been returned from a query for on a base class?For instance, if I have these models...class Animal(models.Model): name= models.CharField(max_l

JS .checked vs jquery attr('checked'), what is the difference?

JS .checked vs jquery attr('checked'), what is the difference?

I can't figure this one out. According to W3 Schools, the checked property sets or returns the checked state of a checkbox.So why does $('input').checked ? $('div').slideDown() : $('div').slideUp(); not work?Using prop however, does work.$

Spring Boot JSR303 message code in annotation getting ignored

Spring Boot JSR303 message code in annotation getting ignored

In my Spring Boot app I have a backing bean where I am using JSR303 validation. In the annotation, I have specified the message code:@NotBlank(message = "{firstname.isnull}")private String firstname;Then in my message.properties I have spe

Can you and how do you embed images in an email when using the Gmail API?

Can you and how do you embed images in an email when using the Gmail API?

When creating a message and using it to create a draft or email using the Gmail API, can you have an image embedded in the body? I'm looking to have the image data actually embedded similar to how copying and pasting an image (the actual da

Load Picturebox Image From Memory?

Load Picturebox Image From Memory?

I can't seem to figure out how to load a pictureBox image from a bitmap in memory. Is it possible or do I have to create temp file for the bitmap? 1:What format is the image in memory?If you have an actual Bitmap object, just assign it

Applying “page-break-before” to a table row (tr)

Applying “page-break-before” to a table row (tr)

According to W3.org, the style page-break-after applies to block level elements (http://www.w3.org/TR/2004/CR-CSS21-20040225/page.html#page-break-props) is a block level element (according to this: http://www.htmlhelp.com/reference/html40/b

Monitoring own memory usage by Java application

Monitoring own memory usage by Java application

I want to run several REST web applications inside one Java process to save memory and scale easily with help of Akka. I would like to estimate how much memory each request handler consume and detect these dangerous for the entire system.Is