This file contains 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
// | |
// ViewController.swift | |
// | |
import UIKit | |
class ViewController: UIViewController, UIActionSheetDelegate { | |
@IBAction func tapButton(sender : AnyObject) { | |
var sheet: UIActionSheet = UIActionSheet(); | |
let title: String = "Please choose a course"; |
This file contains 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
// | |
// Swift-KVO | |
// | |
// Created by Jim Correia on 6/5/14. | |
// Copyright (c) 2014-2015 Jim Correia. All rights reserved. | |
// | |
// Update: 6/17/2014 | |
// | |
// KVOContext has gone away; use the same idiom you'd use from Objective-C for the context | |
// |
This file contains 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
/* | |
iOS上传所需基本图片 | |
icon | |
● Icon.png – 57×57 iPhone应用图标 | |
● Icon@2x.png – 114×114 iPhone Retina显示屏应用图标 | |
● Icon-72.png – 72×72 iPad应用图标 |
This file contains 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
// An example viewDidLoad | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[self loadWebView]; | |
} | |
// The example loader | |
// | |
// Assumes you have an IBOutlet for the UIWebView defined: @property (strong, nonatomic) UIWebView *wv; |
This file contains 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
public class ContentPatternConverter implements Converter<String, ContentPattern> { | |
private PatternService patternService; | |
@Autowired | |
public ContentPatternConverter(PatternService patternService) { | |
this.patternService = patternService; | |
} | |
@Override |
This file contains 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.thurloat.foo; | |
import org.codehaus.jackson.annotate.JsonIgnore; | |
import org.codehaus.jackson.annotate.JsonProperty; | |
/** | |
* In order to write a composite data property (stats) out to JSON without reading | |
* it back in, you need to explicitly ignore the property, as well as the setter and | |
* then apply the @JsonProperty annotation to the getter. | |
**/ |
This file contains 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
class Beanutils{ | |
//merge two bean by discovering differences | |
private <M> void merge(M target, M destination) throws Exception { | |
BeanInfo beanInfo = Introspector.getBeanInfo(target.getClass()); | |
// Iterate over all the attributes | |
for (PropertyDescriptor descriptor : beanInfo.getPropertyDescriptors()) { | |
// Only copy writable attributes | |
if (descriptor.getWriteMethod() != null) { |
This file contains 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.pillartechnology.mail; | |
import java.util.Date; | |
public class Email { | |
private String domain; | |
private String user; | |
private String body; | |
private Date timestamp; |