MongoDB操作简记
一、数据库操作
1.显示当前选择的数据库
[root@weekend05 ~]# mongod --dbpath /data/db/
[root@weekend05 ~]# mongo
MongoDB shell version: 3.2.6
connecting to: test
。。。。
> db
test
2.创建或切换数据库MyDB
> use MyDB
switched to db MyDB
> db
MyDB
3.查看所有数据库
> show dbs
local 0.000GB
4.向MyDB插入一个文件
5.查看所有数据库
> db.movie.insert({"name":"tutorials yiibai"})
WriteResult({ "nInserted" : 1 })
> show dbs
MyDB 0.000GB
local 0.000GB
6.删除数据库MyDB
> db.dropDatabase()
{ "dropped" : "MyDB", "ok" : 1 }
二、集合操作
1.显式和隐式创建集合movie
显示创建
> db.createCollection("movie")
{ "ok" : 1 }
隐式创建
> db.movie.insert({"name":"tutorials yiibai"})
WriteResult({ "nInserted" : 1 })
2.查询所有集合
> show collections
movie
> db.getCollectionNames();
[ "movie" ]
3.查看集合总数据量
> db.movie.count();
1
4.查看movie集合所在数据库
> db.movie.getDB();
MyDB
5.查看当前集合movie状态
db.movie.stats();
{
"ns" : "MyDB.movie",
"count" : 1,
"size" : 49,
"avgObjSize" : 49,
"storageSize" : 16384,
"capped" : false,
"wiredTiger" : {
"metadata" : {
"formatVersion" : 1
},
"creationString" : "allocation_size=4KB,app_metadata=(formatVersion=1),block_allocation=best,block_compressor=snappy,cache_resident=0,checksum=on,colgroups=,collator=,columns=,dictionary=0,encryption=(keyid=,name=),exclusive=0,extractor=,format=btree,huffman_key=,huffman_value=,immutable=0,internal_item_max=0,internal_key_max=0,internal_key_truncate=,internal_page_max=4KB,key_format=q,key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=64MB,log=(enabled=),lsm=(auto_throttle=,bloom=,bloom_bit_count=16,bloom_config=,bloom_hash_count=8,bloom_oldest=0,chunk_count_limit=0,chunk_max=5GB,chunk_size=10MB,merge_max=15,merge_min=0),memory_page_max=10m,os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0,prefix_compression_min=4,source=,split_deepen_min_child=0,split_deepen_per_child=0,split_pct=90,type=file,value_format=u",
"type" : "file",
"uri" : "statistics:table:collection-2-2834400305576058642",
"LSM" : {
"bloom filter false positives" : 0,
"bloom filter hits" : 0,
"bloom filter misses" : 0,
"bloom filter pages evicted from cache" : 0,
"bloom filter pages read into cache" : 0,
"bloom filters in the LSM tree" : 0,
"chunks in the LSM tree" : 0,
"highest merge generation in the LSM tree" : 0,
"queries that could have benefited from a Bloom filter that did not exist" : 0,
"sleep for LSM checkpoint throttle" : 0,
"sleep for LSM merge throttle" : 0,
"total size of bloom filters" : 0
},
"block-manager" : {
"allocations requiring file extension" : 3,
"blocks allocated" : 3,
"blocks freed" : 0,
"checkpoint size" : 8192,
"file allocation unit size" : 4096,
"file bytes available for reuse" : 0,
"file magic number" : 120897,
"file major version number" : 1,
"file size in bytes" : 16384,
"minor version number" : 0
},
"btree" : {
"btree checkpoint generation" : 7,
"column-store fixed-size leaf pages" : 0,
"column-store internal pages" : 0,
"column-store variable-size RLE encoded values" : 0,
"column-store variable-size deleted values" : 0,
"column-store variable-size leaf pages" : 0,
"fixed-record size" : 0,
"maximum internal page key size" : 368,
"maximum internal page size" : 4096,
"maximum leaf page key size" : 2867,
"maximum leaf page size" : 32768,
"maximum leaf page value size" : 67108864,
"maximum tree depth" : 3,
"number of key/value pairs" : 0,
"overflow pages" : 0,
"pages rewritten by compaction" : 0,
"row-store internal pages" : 0,
"row-store leaf pages" : 0
},
"cache" : {
"bytes read into cache" : 0,
"bytes written from cache" : 143,
"checkpoint blocked page eviction" : 0,
"data source pages selected for eviction unable to be evicted" : 0,
"hazard pointer blocked page eviction" : 0,
"in-memory page passed criteria to be split" : 0,
"in-memory page splits" : 0,
"internal pages evicted" : 0,
"internal pages split during eviction" : 0,
"leaf pages split during eviction" : 0,
"modified pages evicted" : 0,
"overflow pages read into cache" : 0,
"overflow values cached in memory" : 0,
"page split during eviction deepened the tree" : 0,
"page written requiring lookaside records" : 0,
"pages read into cache" : 0,
"pages read into cache requiring lookaside entries" : 0,
"pages written from cache" : 2,
"pages written requiring in-memory restoration" : 0,
"unmodified pages evicted" : 0
},
"compression" : {
"compressed pages read" : 0,
"compressed pages written" : 0,
"page written failed to compress" : 0,
"page written was too small to compress" : 2,
"raw compression call failed, additional data available" : 0,
"raw compression call failed, no additional data available" : 0,
"raw compression call succeeded" : 0
},
"cursor" : {
"bulk-loaded cursor-insert calls" : 0,
"create calls" : 1,
"cursor-insert key and value bytes inserted" : 50,
"cursor-remove key bytes removed" : 0,
"cursor-update value bytes updated" : 0,
"insert calls" : 1,
"next calls" : 0,
"prev calls" : 1,
"remove calls" : 0,
"reset calls" : 2,
"restarted searches" : 0,
"search calls" : 0,
"search near calls" : 0,
"truncate calls" : 0,
"update calls" : 0
},
"reconciliation" : {
"dictionary matches" : 0,
"fast-path pages deleted" : 0,
"internal page key bytes discarded using suffix compression" : 0,
"internal page multi-block writes" : 0,
"internal-page overflow keys" : 0,
"leaf page key bytes discarded using prefix compression" : 0,
"leaf page multi-block writes" : 0,
"leaf-page overflow keys" : 0,
"maximum blocks required for a page" : 0,
"overflow values written" : 0,
"page checksum matches" : 0,
"page reconciliation calls" : 2,
"page reconciliation calls for eviction" : 0,
"pages deleted" : 0
},
"session" : {
"object compaction" : 0,
"open cursor count" : 1
},
"transaction" : {
"update conflicts" : 0
}
},
"nindexes" : 1,
"totalIndexSize" : 16384,
"indexSizes" : {
"_id_" : 16384
},
"ok" : 1
}
>
6.集合movie重命名
> db.movie.renameCollection("movies");
{ "ok" : 1 }
7.集合movie复制
> db.movies.copyTo("movie")
WARNING: db.eval is deprecated
1
8.删除集合movie
> db.movies.drop();
true
9.查看集合movie帮助
> db.movie.help();
DBCollection help
db.movie.find().help() - show DBCursor help
。。。下面内容太多省略
三、文档操作
1.插入操作
a.单个插入
> db.movie.insert({"name":"HuanLeSong","Times":10000})
WriteResult({ "nInserted" : 1 })
> db.movie.insert({"name":"SanJie","Times":20000})
WriteResult({ "nInserted" : 1 })
> db.movie.insert({"name":"SanJie","Address":"China"})
WriteResult({ "nInserted" : 1 })
> db.movie.find()
{ "_id" : ObjectId("5752948a6655ed3d2695cc1d"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("575295dd6655ed3d2695cc1e"), "name" : "HuanLeSong", "Times" : 10000 }
{ "_id" : ObjectId("575295ee6655ed3d2695cc1f"), "name" : "SanJie", "Times" : 20000 }
{ "_id" : ObjectId("575296006655ed3d2695cc20"), "name" : "SanJie", "Address" : "China" }
创建文档变量,对象
> movieVar1 = {"name":"HuanLeSong","Times":10000};
{ "name" : "HuanLeSong", "Times" : 10000 }
> movieVar2 = {"name":"SanJie","Times":20000};
{ "name" : "SanJie", "Times" : 20000 }
> movieVar3 = {"name":"SanJie","Address":"China"};
{ "name" : "SanJie", "Address" : "China" }
> db.movie.insert(movieVar1)
WriteResult({ "nInserted" : 1 })
> db.movie.insert(movieVar2)
WriteResult({ "nInserted" : 1 })
> db.movie.insert(movieVar3)
WriteResult({ "nInserted" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e52d8cfe9d7161059ed50"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e550dcfe9d7161059ed51"), "name" : "HuanLeSong", "Times" : 10000 }
{ "_id" : ObjectId("574e5517cfe9d7161059ed52"), "name" : "SanJie", "Times" : 20000 }
{ "_id" : ObjectId("574e551acfe9d7161059ed53"), "name" : "SanJie", "Address" : "China" }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed54"), "name" : "HuanLeSong", "Times" : 10000 }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed55"), "name" : "SanJie", "Times" : 20000 }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed56"), "name" : "SanJie", "Address" : "China" }
> db.movie.insert({"_id":08001,"name":"zhangsan"})
WriteResult({ "nInserted" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e52d8cfe9d7161059ed50"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e550dcfe9d7161059ed51"), "name" : "HuanLeSong", "Times" : 10000 }
{ "_id" : ObjectId("574e5517cfe9d7161059ed52"), "name" : "SanJie", "Times" : 20000 }
{ "_id" : ObjectId("574e551acfe9d7161059ed53"), "name" : "SanJie", "Address" : "China" }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed54"), "name" : "HuanLeSong", "Times" : 10000 }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed55"), "name" : "SanJie", "Times" : 20000 }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed56"), "name" : "SanJie", "Address" : "China" }
{ "_id" : 8001, "name" : "zhangsan" }db.movie.insert({"_id":08001,"name":"lisi"})
db.movie.save({"_id":08001,"name":"lisi"})
db.movie.find()
> db.movie.insert({"_id":08001,"name":"lisi"})
WriteResult({
"nInserted" : 0,
"writeError" : {
"code" : 11000,
"errmsg" : "E11000 duplicate key error collection: mydb.movie index: _id_ dup key: { : 8001.0 }"
}
})
> db.movie.save({"_id":08001,"name":"lisi"})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e52d8cfe9d7161059ed50"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e550dcfe9d7161059ed51"), "name" : "HuanLeSong", "Times" : 10000 }
{ "_id" : ObjectId("574e5517cfe9d7161059ed52"), "name" : "SanJie", "Times" : 20000 }
{ "_id" : ObjectId("574e551acfe9d7161059ed53"), "name" : "SanJie", "Address" : "China" }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed54"), "name" : "HuanLeSong", "Times" : 10000 }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed55"), "name" : "SanJie", "Times" : 20000 }
{ "_id" : ObjectId("574e55a0cfe9d7161059ed56"), "name" : "SanJie", "Address" : "China" }
{ "_id" : 8001, "name" : "lisi" }
>
综上结果可知:
Insert和Save的区别是:如果插入的集合的“_id”值,在集合中已经存在,用Insert执行插入操作回报异常,已经存在"_id"的键。用Save如果系统中没有相同的"_id"就执行插入操作,有的话就执行覆盖掉原来的值。相当于修改操作。
b.批量插入
采用数组的方式 []
> db.movie.insert([{username:'aaa',password:'bbb',tel:'123123123'},{username:'bbb',password:'ccc',tel:'123123234'}]);
BulkWriteResult({
"writeErrors" : [ ],
"writeConcernErrors" : [ ],
"nInserted" : 2,
"nUpserted" : 0,
"nMatched" : 0,
"nModified" : 0,
"nRemoved" : 0,
"upserted" : [ ]
})
> db.movie.find()
{ "_id" : ObjectId("5752948a6655ed3d2695cc1d"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("575295dd6655ed3d2695cc1e"), "name" : "HuanLeSong", "Times" : 10000 }
{ "_id" : ObjectId("575295ee6655ed3d2695cc1f"), "name" : "SanJie", "Times" : 20000 }
{ "_id" : ObjectId("575296006655ed3d2695cc20"), "name" : "SanJie", "Address" : "China" }
{ "_id" : ObjectId("575296c26655ed3d2695cc21"), "username" : "aaa", "password" : "bbb", "tel" : "123123123" }
{ "_id" : ObjectId("575296c26655ed3d2695cc22"), "username" : "bbb", "password" : "ccc", "tel" : "123123234" }
2.删除操作
1)按条件删除
> db.movie.remove({"name":"HuanLeSong"})
WriteResult({ "nRemoved" : 2 })
2)删除所有
> db.movie.remove({})
WriteResult({ "nRemoved" : 8 })
> db.movie.find()
> show collections
Movie
由上述结果得出remove({})和drop()的区别:
remove({}):删除所有文档,但不会删除集合本身,原索引也会保留
drop():删除整个集合,包括索引,然后重新创建集合和建立索引
3.修改操作
文档存入数据库后,就可以用update方法来修改它,update有两个参数一个是查询文档,找出需要更新的文档。一个是修改文档,描述对找到的文档做哪些修改
更新操作是原子的,若是两个更新同时发生,先到达服务器的先执行。
a.替换更新update
> db.movie.update({username:"bbb"},{password:"abc"});
WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
b.修改器更新
I.$set修改器
$set用来指定一个键的值,如果这个键不存在,就创建它。并且,只修改第一个
> db.movie.update({username:"aaa"},{$set:{password:"*****"}});
WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
II.$unset修改器
$unset来删除一个键
> db.movie.update({username:"aaa"},{$unset:{tel:1}});
WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
III.$inc修改器
$inc用来增加已有的键值,或者在键值不存在时创建。
> db.movie.update({username:"aaa"},{$inc:{age:2}}); --键值age不存在,创建age并赋值2
WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
IV.upsert
当update的第三个参数设置为true的时候,为upsert模式
upsert是一个特殊的更新。当没有文档符合更新条件,就会以这个条件创建新的文档。
> db.movie.update({username:'aaa'},{$inc:{age:2}});--当没有文档符合更新条件,就会以这个条件创建新的文档
WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
> db.movie.update({username:'aaa'},{$set:{abc:123}},true)
WriteResult({
"nMatched" : 0,
"nUpserted" : 1,
"nModified" : 0,
"_id" : ObjectId("574e5a67c7c9984dce48a02a")
})
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 123 }
> db.movie.update({username:'aaa'},{$set:{abc:234}},true) --当文档符合更新条件,就会更新文档
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234 }
V.数组修改器
数组修改器只能用于数组。[]
$push会像已有的数组末尾假如一个元素
$pop会从头部删除一个元素
> db.movie.update({username:'aaa'},{$push:{arr:1}});
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 1 ] }
> db.movie.update({username:'aaa'},{$push:{arr:2}});
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 1, 2 ] }
> db.movie.update({username:'aaa'},{$push:{arr:5}});
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 1, 2, 5 ] }
> db.movie.update({username:'aaa'},{$push:{arr:3}});
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 1, 2, 5, 3 ] }
> db.movie.update({username:'aaa'},{$pop:{arr:1}});
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 1, 2, 5 ] }
> db.movie.update({username:'aaa'},{$pop:{arr:-1}});
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 2, 5 ] }
VI.数组的定位修改器
若是数组中多个值,我们只想修改其中的部分值,有两种方法操作数组中的值:通过位置和定位操作符($)
数组下标是从0开始
db.movie.update({username:'aaa'},{$set:{'arr.2':10}});
db.movie.find()
> db.movie.update({username:'aaa'},{$set:{'arr.2':10}});
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 2, 5, 10 ] }
> db.movie.update({'arr.2':10},{$set:{'arr.$':100}});
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 2, 5, 100 ] }
VII.多文档修改
第四个参数设置为true
> db.movie.insert([{username:'aaa',password:'bbb',tel:'123123123'},{username:'bbb',password:'ccc',tel:'123123234'}]);
BulkWriteResult({
"writeErrors" : [ ],
"writeConcernErrors" : [ ],
"nInserted" : 2,
"nUpserted" : 0,
"nMatched" : 0,
"nModified" : 0,
"nRemoved" : 0,
"upserted" : [ ]
})
>
> db.movie.update({username:"aaa"},{$set:{password:"******"}},false,true);
WriteResult({ "nMatched" : 2, "nUpserted" : 0, "nModified" : 2 })
> db.movie.find()
{ "_id" : ObjectId("574e58aecfe9d7161059ed59"), "name" : "tutorials yiibai" }
{ "_id" : ObjectId("574e5a67c7c9984dce48a02a"), "username" : "aaa", "abc" : 234, "arr" : [ 2, 5, 100 ], "password" : "******" }
{ "_id" : ObjectId("574e73d1cfe9d7161059ed5a"), "username" : "aaa", "password" : "******", "tel" : "123123123" }
{ "_id" : ObjectId("574e73d1cfe9d7161059ed5b"), "username" : "bbb", "password" : "ccc", "tel" : "123123234" }
MongoDB操作简记的更多相关文章
- 基础拾遗-----mongoDB操作
基础拾遗 基础拾遗------特性详解 基础拾遗------webservice详解 基础拾遗------redis详解 基础拾遗------反射详解 基础拾遗------委托详解 基础拾遗----- ...
- mongodb操作文件
mongodb操作文件,主要是通过GridFS类.存储文件主要存放在fs中,其中的fs是数据库默认的.并且GridFS是直接与数据库打交道,与collection集合无关. ============= ...
- MongoDB操作
创建.删除数据库 格式 use DATABASE_NAME 如果不存在,则创建,否则直接切换到该数据库 显示当前所在的数据库 db 显示所有数据库 show dbs 删除数据库 db.dropData ...
- PHP mongoDB 操作
<?php /** * PHP操作MongoDB学习笔记 */ //************************* //** 连接MongoDB数据库 **// //************ ...
- mongodb操作之使用javaScript实现多表关联查询
一.数据控制 mongodb操作数据量控制,千万控制好,不要因为操作的数据量过多而导致失败. 演示一下发生此类错误的错误提示:
- SpringMVC连接MongoDB操作数据库
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Soft ...
- mongoDB操作详细
简介 它和我们使用的关系型数据库最大的区别就是约束性,可以说文件型数据库几乎不存在约束性,理论上没有主外键约束,没有存储的数据类型约束等等 关系型数据库中有一个 "表" 的概念,有 ...
- 02:MongoDB操作
1.1 MongoDB 增加 1.插入数据 1. 插入文档: insert 如果插入数据的时候,collection还不存在,自动创建集合 2. insertOne: 插入一条数据 3. insert ...
- mongodb初始化并使用node.js实现mongodb操作封装
mongodb的下载只要在https://www.mongodb.com/网站就能够下载 下载后安装只用一直点next就可以,注意最好使用默认路径安装到C盘,然后在任意位置建立一个文件夹用于储存你的数 ...
随机推荐
- 五分钟搭建 Flash 视频直播站
想在家里对全世界直播网络视频节目吗?如今视频网站是多如牛毛,但能让你玩直播的估计没几个吧?看完这篇教程就能帮你实现网络主持人的梦想.不花钱,不懂编程,不用写代码也行哦~ 首先是最低机器要求:Windo ...
- 项目实战之玩转div+css制作自己定义形状
项目需求 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/diss ...
- Arch Linux 下Android 源代码的下载以及编译
之前把公司的开发环境由Ubuntu Kylin 换成了Arch Linux.而Arch 下由于种种问题公司的代码一直编只是去.搞定了之后也一直忘了写下来,希望能给相同在Arch 下做Android 开 ...
- 漫谈Deep PCA与PCANet
又到了无聊的写博客的时间了,因为电脑在跑程序.眼下无事可做.我认为把昨天我看的一些论文方面的知识拿出来和大家分享一下. 美其名曰我是在研究"深度学习".只是因为本人是穷屌丝一个,买 ...
- cocos2dx笔记1:概述
1.核心的类和功能 CCDirector gameLoop,实现场景绘制.多个场景之间切换控制.控制游戏的停止,暂停,等生命周期. CCScene 场景类,每一个场景能够理解为一个游戏镜头.状态 CC ...
- wpa_supplicant - 强有力的终端 wifi 配置工具【转】
本文转载自:http://rickgray.me/2015/08/03/useful-command-tool-for-wifi-connection.html 最近网购了一套Raspberry-Pi ...
- POJ3468 A Simple Problem with Integers —— 线段树 区间修改
题目链接:https://vjudge.net/problem/POJ-3468 You have N integers, A1, A2, ... , AN. You need to deal wit ...
- YTU 2572: 猜灯谜
2572: 猜灯谜 时间限制: 1 Sec 内存限制: 128 MB 提交: 154 解决: 91 题目描述 A 村的元宵节灯会上有一迷题: 请猜谜 * 请猜谜 = 请边赏灯边猜 小明想,一定是每 ...
- [转]python的find()方法
描述 Python find() 方法检测字符串中是否包含子字符串 str ,如果指定 beg(开始) 和 end(结束) 范围,则检查是否包含在指定范围内,如果包含子字符串返回开始的索引值,否则返回 ...
- word-break word-wrap
work-break:break-all CJK超出的部分自动换行 word-wrap:break-word CJK如果有分隔符,当前分隔符之后与下一个分隔符之间的内容不能在这一行全部显示的话,在当前 ...