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
jQuery.fn.center_v = function () { | |
this.css("position","absolute"); | |
this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px"); | |
return this; | |
} | |
jQuery.fn.center_h = function () { | |
this.css("position","absolute"); | |
this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px"); | |
return this; |
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
<?php | |
class FW_Tools_Component { | |
//成份列表 | |
//重複出現的東西,出現率會比較高。總長度建議不要超過255。 | |
static $elements = array( | |
'屍毒', | |
'御宅氣', | |
'高手高手高高手', | |
'雜魚', | |
'高頻雜訊', |
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
#encoding: UTF-8 | |
# Author: XiaochuanHuang | |
# Email : emohuang [at] gmail [dot] com | |
require 'open-uri' | |
require "net/http" | |
require "uri" | |
require 'hpricot' | |
class Db_Album |
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
<?php | |
public static function isAccess($access) { | |
Yii::import("srbac.components.Helper"); | |
$allows = Helper::findModule('srbac')->getAlwaysAllowed(); | |
if (in_array( strtolower($access) ,array_map('strtolower', $allows ) ) ) { | |
return true; | |
} | |
return user()->checkAccess($access,Yii::app()->getUser()->id); | |
//return user()->checkAccess($access,user()->id); |
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
// ==UserScript== | |
// @author iParanoid | |
// @name V2EX_User_Script | |
// @namespace https://zone-huangxc.rhcloud.com | |
// @description Position fixed the navigation , Scroll to top when double click navigation bar or Page Footer | |
// @include * | |
// @updateURL https://gist.github.com/paranoidxc/5065236/raw/10bc3ee7501b86f2e579657ef64348e642cc2a70/V2EX.user.js | |
// ==/UserScript== | |
function iparanoid_wrapper() { |
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 app = angular.module("app",[]); | |
app.config(function($logProvider){ | |
$logProvider.debugEnabled(false); | |
}); | |
app.run(function($rootScope,$log){ | |
$rootScope.$log = $log; | |
}); |
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
#encoding: UTF-8 | |
# Author: XiaochuanHuang | |
# Email : emohuang [at] gmail [dot] com | |
require 'open-uri' | |
require "net/http" | |
require "uri" | |
require 'hpricot' | |
class Db_Album |
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
# 2014 阅读列表 | |
### 技艺 | |
- ~~<del>软件开发者路线图﹕从学徒到高手</del>~~ EOF 03.12 | |
- ~~<del>结网</del>~~ EOF 03.24 | |
- ~~<del>C程序设计语言 (The C Programming Language)</del>~~ EOF 03.28 | |
- ~~<del>Node.js开发指南</del>~~ EOF 02.28 | |
- 算法: C 语言实现 1-4 部分 | |
- ~~ iOS Programming : The Big Nerd Ranch Guide (4th) ~~ EOF 07.01 | |
- ~~ 深入理解计算机系统 ~~ EOF 08.14 |
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
#define N 32 | |
#include <iostream> | |
//#include <stdio.h> | |
//using namespace std; | |
main() { | |
int i, j, a[N]; | |
for ( i = 2; i < N; i++ ) { | |
a[i] = 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
#include <stdlib.h> // malloc | |
#include <iostream> | |
main( int argc, char *argv[] ) { | |
long int i, j, N = atol(argv[1]); | |
int *a = malloc(N*sizeof(int)); | |
if ( a == NULL ) { | |
printf("Insufficient memory.\n"); | |
return 1; |
OlderNewer