This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let params = ["date": "range", | |
"date_from": "2016-08-12", | |
"date_to": "2016-08-12", | |
"category_id":["5","15","38"], | |
"zone_id":["16","18","22"] | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// Wondering why we only use https connections? | |
// It's because of a new iOS feature called App Transport Security. | |
// From now on, Apps can only access resources through a secure | |
// connection, using https. You can easily change this default | |
// behavior. Check this article to find out how: | |
// http://www.neglectedpotential.com/2015/06/working-with-apples-application-transport-security/ | |
// OTOH, if you have no idea what the difference between an http and | |
// https connection is, fear not! Everything will be explained in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP Status Codes | |
1×× Informational | |
100 Continue | |
101 Switching Protocols | |
102 Processing | |
2×× Success | |
200 OK | |
201 Created | |
202 Accepted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func bubbleSort(inout set: [Int]) -> [Int] { | |
for i in 0..<set.count { | |
var swapAvailable = false | |
for j in 0..<set.count-i-1 { | |
if set[j+1] < set[j] { | |
let smallest = set[j+1] | |
set[j+1] = set[j] | |
set[j] = smallest | |
swapAvailable = true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func selectionSort(inout set: [Int]) -> [Int] { | |
for i in 0..<set.count - 1 { | |
var smallest = set[i] | |
var currentSmallestIndex = -1 | |
for j in (i+1)..<set.count { | |
if set[j] < smallest { | |
smallest = set[j] | |
currentSmallestIndex = j | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static int [] bubbleSort(int [] numberSet) { | |
for (int i = 0; i < numberSet.length -1; i++) { | |
for (int j = i + 1; j < numberSet.length; j++) { | |
int localVar = i; | |
if (numberSet[localVar] > numberSet[j]) { | |
int temp = numberSet[i]; | |
numberSet[i] = numberSet[j]; | |
numberSet[j] = temp; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static int [] selectionSort(int [] numbers) { | |
for(int i = 0; i < numbers.length - 1; i++) { | |
int currentSmallest = numbers[i]; | |
boolean smallestFound = false; | |
int smallestCurrentIndex = i; | |
for (int j = i + 1; j < numbers.length; j++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company; | |
public class Main { | |
public static void main(String[] args) { | |
// write your code here | |
char [] charSet = new char[] {'g', 'a', 't', 't', 'a', 'c', 'a', 'g', 'g', 'a', | |
't', 'a', 't', 'a', 'c','t','m', 'o', 'k', 't', 'a', 'c', 'h','t', 'g', | |
'k', 't', 'a', 'c', 'm', 'i', 't', 'u', 'l'}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UITextFieldDelegate Methods | |
Editing lifecycle methods: | |
textFieldShouldBeginEditing(_:) | |
textFieldDidBeginEditing(_:) | |
textFieldShouldEndEditing(_:) | |
textFieldDidEndEditing(_:) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var twoDimArray: [[Int]] = [ [1, 11], [2, 22] ] | |
for x in 0 ..< twoDimArray.count { | |
for y in 0 ..< twoDimArray[x].count { | |
print("vector[\(x), \(y)] = \(twoDimArray[x][y])" ) | |
} | |
} |