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
1.document.write(""); 输出语句 | |
2.JS中的注释为// | |
3.传统的HTML文档顺序是:document->html->(head,body) | |
4.一个浏览器窗口中的DOM顺序是:window->(navigator,screen,history,location,document) | |
5.得到表单中元素的名称和值:document.getElementById("表单中元素的ID号").name(或value) | |
6.一个小写转大写的JS: document.getElementById("output").value = document.getElementById("input").value.toUpperCase(); | |
7.JS中的值类型:String,Number,Boolean,Null,Object,Function | |
8.JS中的字符型转换成数值型:parseInt(),parseFloat() | |
9.JS中的数字转换成字符型:(""+变量) | |
10.JS中的取字符串长度是:(length) |
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
.gz | |
解压1:gunzip FileName.gz | |
解压2:gzip -d FileName.gz | |
压缩:gzip FileName | |
.tar.gz | |
解压:tar zxvf FileName.tar.gz | |
压缩:tar zcvf FileName.tar.gz DirName | |
--------------------------------------------- | |
.bz2 |
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
1.apt-get install php5-curl | |
2./etc/init.d/apache2 restart | |
3.curl.php: | |
<? | |
$ch = curl_init(); | |
$timeout = 5; | |
curl_setopt ($ch, CURLOPT_URL, 'http://www.baidu.com/'); | |
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/wordpress | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/> | |
Options Indexes FollowSymLinks MultiViews |
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
// | |
// UMeng.m | |
// Gallery | |
// | |
// Created by marshluca on 11-2-10. | |
// Copyright 2011 www.5yi.com. All rights reserved. | |
// | |
#import "UMeng.h" | |
#import "MBase.h" |
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
# Sample verbose configuration file for Unicorn (not Rack) | |
# | |
# This configuration file documents many features of Unicorn | |
# that may not be needed for some applications. See | |
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb | |
# for a much simpler configuration file. | |
# | |
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete | |
# documentation. |
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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Load" | |
style:UIBarButtonItemStyleDone | |
target:self | |
action:@selector(loadData)]; | |
NSMutableArray *_array = [[NSMutableArray alloc] initWithCapacity:10000]; | |
self.array = _array; |
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
select * from sqlite_master where type='index'; | |
drop index vegetables_name; | |
create index vegetables_name on vegetables(name); | |
insert into vegetables values ("luobo", "green", "nice luobo"); | |
create table vegetables (name char not null, color char not null default 'green', description char); |
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
#import <Foundation/Foundation.h> | |
#import "FMDatabase.h" | |
#import "FMDatabaseAdditions.h" | |
#define FMDBQuickCheck(SomeBool) { if (!(SomeBool)) { NSLog(@"Failure on line %d", __LINE__); return 123; } } | |
int main (int argc, const char * argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
// delete the old db. |
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
- (void)saveImageToAlbum | |
{ | |
UIImage *image = currentPage.imageView.image; | |
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); | |
} | |
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo | |
{ | |
if (error == nil) |