<activty android:windowSoftInputMode="stateHidden">
</activity>
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 main | |
import ( | |
"fmt" | |
"math" | |
"strings" | |
) | |
const total_length int = 80 |
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
function [J, grad] = costFunctionReg(theta, X, y, lambda) | |
m = length(y); % number of training examples | |
h = sigmoid(X * theta); | |
J = mean(-y .* log(h) - (1 - y) .* log(1 - h)) ... | |
+ lambda / 2.0 / m * (sum(theta .^ 2) - theta(1) ^ 2); | |
grad = X' * (h - y) / m + lambda / m * theta; | |
grad(1) -= lambda / m * theta(1); |
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
# -*- coding: UTF-8 -*- | |
import logging | |
from nameko.constants import AMQP_URI_CONFIG_KEY | |
from nameko.standalone.rpc import ServiceRpcProxy | |
from tornado.options import parse_command_line | |
def main(): |
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
#import <UIKit/UIKit.h> | |
@interface RXWaveLoadingView : UIView | |
@property (nonatomic, assign) NSInteger numberOfWaves; | |
@property (nonatomic, assign) CGSize waveSize; | |
@property (nonatomic, assign) CGFloat waveSpacing; | |
@property (nonatomic, assign) CGFloat waveDuration; | |
@property (nonatomic, strong) UIColor *waveColor; |
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
- (void)viewWillAppear:(BOOL)animated { | |
[super viewWillAppear:animated]; | |
// Add observers for keyboard messages | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) | |
name:UIKeyboardWillShowNotification | |
object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillHide:) |
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
@implementation UIImage (ImageCrop) | |
+ (UIImage *)centerOvalCropImage:(UIImage *)image | |
{ | |
CGFloat width = image.size.width; | |
CGFloat height = image.size.height; | |
CGRect targetRect = CGRectMake(width / 4.0, height / 4.0, width / 2.0, height / 2.0); | |
UIGraphicsBeginImageContextWithOptions(CGSizeMake(width, height), NO, 0); | |
CGContextRef context = UIGraphicsGetCurrentContext(); |
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
@interface SomeClass | |
typedef void (^AnimationBlock)(BOOL); | |
@end | |
// animationBlocks, where store all animation blocks | |
NSMutableArray *animationBlocks = [NSMutableArray new]; | |
AnimationBlock (^getNextAnimation)() = ^{ | |
AnimationBlock block = animationBlocks.count ? [animationBlocks objectAtIndex:0] : Nil; | |
if (block) { | |
[animationBlocks removeObjectAtIndex:0]; |
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.ryannnnnnn.test_swipe_refresh_layout; | |
import android.app.Activity; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
public class MyActivity extends Activity implements SwipeRefreshLayout.OnRefreshListener { |
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
请比较select模型与WSAEventSelect模型两者之间的差异? | |
Deadline: Oct 27, 2014 |
NewerOlder