Questions

How to make HTTP Post request with JSON body in Swift?

I'm trying to make an HTTP post request with a JSON body : How to be able to add an NSdictionnary to the HTTP request body. Here is my code, it doesn't seem to work properly. ``` var entry1 = Response...

2 Jun at 00:19

Prime number check acts strange

I have been trying to write a program that will take an imputed number, and check and see if it is a prime number. The code that I have made so far works perfectly if the number is in fact a prime nu...

20 Mar at 14:2

retrieve data from db and display it in table in php .. see this code whats wrong with it?

``` $db = mysql_connect("localhost", "root", ""); $er = mysql_select_db("ram"); $query = "insert into names values('$name','$add1','$add2','$mail')"; $result = mysql_query($query); print "<p> ...

7 Sep at 17:27

What is the OR operator in an IF statement

In C#, how do I specify OR: ``` if(this OR that) {do the other thing} ``` I couldn't find it in the help. My code is: ``` if (title == "User greeting" || "User name") {do stuff} ``` and my er...

2 Feb at 17:5

Best implementation for hashCode method for a collection

How do we decide on the best implementation of `hashCode()` method for a collection (assuming that equals method has been overridden correctly) ?

21 Sep at 20:25

Create text file and fill it using bash

I need to create a text file (unless it already exists) and write a new line to the file all using bash. I'm sure it's simple, but could anyone explain this to me?

29 Mar at 17:4

Table overflowing outside of div

I'm trying to stop a table that has width explicitly declared from overflowing outside of its parent `div`. I presume I can do this in some way using `max-width`, but I can't seem to get this working....

9 Jul at 19:17

Print debugging info from stored procedure in MySQL

Is there a way in MySQL to print debugging messages to stdout, temptable or logfile? Something like: - `print`- `DBMS_OUTPUT.PUT_LINE`

24 Dec at 04:41

How to get resources directory path programmatically

I have the following directory layout: > - - - - - - - Within a ServletContextListener class, I want to access the files under the SQL directory and list them. Basically my problem is with the pa...

16 Oct at 22:0

Asyncio.gather vs asyncio.wait

[asyncio.gather](https://docs.python.org/3/library/asyncio-task.html#asyncio.gather) and [asyncio.wait](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait) seem to have similar uses: I h...

Fetch API request timeout?

I have a `fetch-api` `POST` request: ``` fetch(url, { method: 'POST', body: formData, credentials: 'include' }) ``` I want to know what is the default timeout for this? and how can we set it to...

9 Jul at 11:39

How to implement a binary tree?

Which is the best data structure that can be used to implement a binary tree in Python?

How do I represent a time only value in .NET?

Is there a way one can represent a time only value in .NET without the date? For example, indicating the opening time of a shop? `TimeSpan` indicates a range, whereas I only want to store a time valu...

11 Dec at 23:59

multiple packages in context:component-scan, spring config

How can I add multiple packages in spring-servlet.xml file in `context:component-scan` element? I have tried ``` <context:component-scan base-package="z.y.z.service" base-package="x.y.z.controller" ...

14 Jun at 08:38

Where can I set path to make.exe on Windows?

When I try run `make` from cmd-console on Windows, it runs Turbo Delphi's `make.exe` but I need MSYS's `make.exe`. There is no mention about Turbo Delphi in `%path%` variable, maybe I can change it to...

17 Jun at 14:49

Failed to authenticate on SMTP server error using gmail

I'm trying to set up email for my first laravel project, and was thrilled that there's a laracast for it: [https://laracasts.com/lessons/mailers](https://laracasts.com/lessons/mailers) I've followed...

26 Nov at 13:9

Where does Anaconda Python install on Windows?

I installed Anaconda for Python 2.7 on my Windows machine and wanted to add the Anaconda interpreter to PyDev, but quick googling couldn't find the default place where Anaconda installed, and searchin...

25 Mar at 07:34

How to delete cookies on an ASP.NET website

In my website when the user clicks on the "Logout" button, the Logout.aspx page loads with code `Session.Clear()`. In ASP.NET/C#, does this clear all cookies? Or is there any other code that needs to...

Java Array, Finding Duplicates

I have an array, and am looking for duplicates. ``` duplicates = false; for(j = 0; j < zipcodeList.length; j++){ for(k = 0; k < zipcodeList.length; k++){ if (zipcodeList[k] == zipcodeList...

5 Dec at 03:19

Simple proof that GUID is not unique

I'd like to prove that a GUID is not unique in a simple test program. I expected the following code to run for hours, but it's not working. How can I make it work? ``` BigInteger begin = new BigInteg...

3 May at 05:49

How can I make a clickable link in an NSAttributedString?

It's trivial to make hyperlinks clickable in a `UITextView`. You just set the "detect links" checkbox on the view in IB, and it detects HTTP links and turns them into hyperlinks. However, that still...

How to use NSURLConnection to connect with SSL for an untrusted cert?

I have the following simple code to connect to a SSL webpage ``` NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:url]; [ NSURLConnection sendSynchronousRequest: urlRequest returni...

Is it possible to declare a public variable in vba and assign a default value?

I want to do this but it won't compile: ``` Public MyVariable as Integer = 123 ``` What's the best way of achieving this?

Fatal error: unexpectedly found nil while unwrapping an Optional values

I was using an `UICollectionView` in Swift but I get when I try to change the text of the cell's label. ``` func collectionView(collectionView: UICollectionView!, numberOfItemsInSection section: In...

23 Jan at 07:43

How to list all the files in android phone by using adb shell?

I just try to write a bash shell for my Android Phone. When I want list all the files in my Android Phone. I found that the Android shell terminal doesn't support `find` command. So I just want to kno...

18 Mar at 08:22