Skip to content

Instantly share code, notes, and snippets.

View mitulmanish's full-sized avatar
🍏
🛩🇪🇪

mitul_manish mitulmanish

🍏
🛩🇪🇪
View GitHub Profile
let params = ["date": "range",
"date_from": "2016-08-12",
"date_to": "2016-08-12",
"category_id":["5","15","38"],
"zone_id":["16","18","22"]
]
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
HTTP Status Codes
1×× Informational
100 Continue
101 Switching Protocols
102 Processing
2×× Success
200 OK
201 Created
202 Accepted
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
}
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
}
}
@mitulmanish
mitulmanish / Main.java
Created July 13, 2016 08:04
Bubble Sort
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;
}
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++) {
@mitulmanish
mitulmanish / PatternMatching.java
Created July 13, 2016 03:23
Character pattern matching Algorithm
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'};
UITextFieldDelegate Methods
Editing lifecycle methods:
textFieldShouldBeginEditing(_:)
textFieldDidBeginEditing(_:)
textFieldShouldEndEditing(_:)
textFieldDidEndEditing(_:)
@mitulmanish
mitulmanish / iteration.swift
Created July 6, 2016 07:11
Two Dimensional array iteration in Swift 3 (Java Style)
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])" )
}
}