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 filterContentForSearchText(searchString: String, scope: String = "All") { | |
// Filter the array using the filter method | |
self.filteredLocationNames = self.locationNames.filter({( stateName: String) -> Bool in | |
let stringMatch = stateName.lowercaseString.rangeOfString(searchString.lowercaseString) | |
return stringMatch != nil | |
}) | |
} |
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 table = db["STOCKS_CORN_LOCATION"]; | |
// | |
// | |
// var query = "SELECT LOCATION, \"2011301_ON\", \"2011301_OFF\", \"2011301_TOTAL\" FROM STOCKS_CORN_LOCATION" | |
// let statement = db.prepare(query) | |
// while ((statement.next()) != nil){ | |
// let row = statement.row![0]! | |
// var dataFieldImport = DataFieldObject(fieldOne: statement.row![0]! as String, | |
// fieldTwo: statement.row![1]! as String, | |
// fieldThree: statement.row![2]! as String, |
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
extension String { | |
subscript (i: Int) -> Character { | |
return self[advance(self.startIndex, i)] | |
} | |
subscript (i: Int) -> String { | |
return String(self[i] as Character) | |
} |
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
USE [clo1] | |
GO | |
/****** Object: StoredProcedure [dbo].[spGet_CQT_WAS_AssetContribution] ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
/* ============================================= | |
-- Description: CQT_WAS_AssetContribution |
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
<script type="text/javascript"> | |
<!-- | |
if (screen.width <= 800) { | |
window.location = "http://m.domain.com"; | |
} | |
//--> | |
</script> |
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 checkWinCondition (column: Int, row: Int){ | |
let alert = UIAlertView() | |
alert.title = "Four In a Row! Game Over!" | |
alert.addButtonWithTitle("OK") | |
for row in 0..<gameBoard.rows { | |
for column in 0..<gameBoard.columns { | |
//horizontal | |
if(isLinearMatch(column: column, row: row, stepX: 1, stepY: 0)){ |
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
// | |
// JPUsersTableViewController.swift | |
// BaseballCardSocialNetwork | |
// | |
// Created by Eric Gu on 2/19/15. | |
// Copyright (c) 2015 Eric Gu. All rights reserved. | |
// | |
import UIKit |
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
override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!, object: PFObject!) -> JPUserTableViewCell! { | |
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as JPUserTableViewCell | |
cell.imageView.hidden = true | |
(cell.viewWithTag(1) as PFImageView).image = kProfileDefaultProfileImage | |
dispatch_async(dispatch_get_main_queue(),{ | |
//cell.textLabel?.text = object["username"] as? String | |
if let profileImageData = object["profileImage"] as? PFFile { | |
println(profileImageData) | |
cell.imageView.file = profileImageData |
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 pickedImage:UIImage = "SOME IMAGE" | |
let scaledImage = scaleImageWith(pickedImage) | |
let imageData = UIImagePNGRepresentation(scaledImage) | |
let imageFile:PFFile = PFFile(data: imageData) | |
PFUser.currentUser().setObject(imageFile, forKey: "imageFieldName") | |
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
USE [HRData] | |
GO | |
/****** Object: StoredProcedure [dbo].[usp_Calculate_PTOAccrual] Script Date: 02/27/2015 10:46:35 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
ALTER PROCEDURE [dbo].[usp_Calculate_PTOAccrual] ( | |
@UserID INT = NULL |