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 me.madeye; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import org.apache.http.HttpHost; | |
import android.content.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
// ... | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
Log.i(TAG, "-- onCreateView(...) --"); | |
mRootView = (View) inflater.inflate(R.layout.fragment_login, container, false); | |
return mRootView; | |
} | |
// 当FragmentActivity动态切换Fragment的时候,上面代码片段中的container设置为null或者其后的参数设置为false, | |
// 否则会报出异常: |
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
sudo chmod 777 / | |
sudo chmod 777 -R / | |
Linux下以上命令的危害性,试过的人都会觉得可怕,有些人遇到这种情况,第一反应是没救了,其实,你要愿意花功夫去折腾,还是有办法滴! | |
下面理了下怎么折腾: | |
道具: | |
A、B两台电脑,假设都装着Ubuntu 12.04版本的系统,都能ssh、root(平时装Linux的时候这两个最好都弄好了,以备不时之需)。 | |
情景: | |
现假设「A」是那台悲剧的执行过「sudo chmod 777 /」的电脑,什么效果,就不说了,反正不是什么好事,如果好奇,一试便知! |
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
/* | |
* Copyright 2011 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using System.Net; | |
namespace XcDownLoadFile | |
{ | |
public class DownLoadFile |
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
var ffi = require('ffi'), | |
ref = require('ref'), | |
Struct = require('ref-struct'), | |
Library = require('./Library'), | |
Type = ref.Type, | |
NULL = ref.NULL, | |
isNull = ref.isNull; | |
var groups = ['libs', 'types', 'structs', 'callbacks', 'enums']; |
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
var application_root = __dirname, | |
express = require("express"), | |
path = require("path"), | |
mongoose = require('mongoose'); | |
var app = express.createServer(); | |
// database | |
mongoose.connect('mongodb://localhost/ecomm_database'); |
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) viewDidLoad { | |
//... | |
comments.text = @"Comments"; | |
comments.textColor = [UIColor lightGrayColor]; | |
isEmpty = YES; | |
//... | |
} | |
- (BOOL)textViewShouldBeginEditing:(UITextView*)textView { | |
if (isEmpty) { |
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
/*global $*/ | |
(function () { | |
'use strict'; | |
var $html = $('#html'), | |
$convert = $('#convert'), | |
$jade = $('#jade'); | |
function normalizeLineBreaks(str) { | |
return str.replace(/(\r\n|\n|\r)/gm, '\n'); |
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 UITextField (HideKeyBoard) | |
-(void)hideKeyBoard:(UIView *)view; | |
@end |
OlderNewer