Skip to content

Commit

Permalink
勤奋是你生命的密码,能译出你一部壮丽的史诗。
Browse files Browse the repository at this point in the history
  • Loading branch information
AtlantisDe committed Jul 9, 2019
1 parent 5d4361d commit 44fb6c1
Show file tree
Hide file tree
Showing 65 changed files with 2,154 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Advanced Installer

- [Free Windows Installer - MSI Installer Tool](https://www.advancedinstaller.com/)
- [安装包制作工具 Advanced Installer v16.1 + v16.0 付费汉化版!心海首发!-心海e站](https://hrtsea.com/27808.html)
5 changes: 5 additions & 0 deletions Cloud/google/GoogleTranslateFreeApi/GoogleTranslateFreeApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GoogleTranslateFreeApi

## Github

- [Grizley56/GoogleTranslateFreeApi](https://github.com/Grizley56/GoogleTranslateFreeApi)
Empty file added Cloud/google/Gpay/Gpay.md
Empty file.
7 changes: 7 additions & 0 deletions Cloud/google/Translate/Translate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Translate

- [使用 google 语言 api 来实现整个网站的翻译 - 曾经沧海 云淡风轻 - 博客园](https://www.cnblogs.com/yifenghong/p/4522949.html)
- [谷歌大神 Jeff Dean:谷歌翻译 API 付费服务已获利 - 人工智能 - 电子发烧友网](http://www.elecfans.com/rengongzhineng/636406.html)
- [这是真的,Google 翻译的 API 真的关闭了-腾讯云资讯](https://cloud.tencent.com/info/aa73e69f1b1f8f14ccdd15f0e8666ef2.html)
- [快速入门:使用客户端库](https://cloud.google.com/translate/docs/quickstart-client-libraries)
- [GoogleCloudPlatform/dotnet-docs-samples](https://github.com/GoogleCloudPlatform/dotnet-docs-samples/blob/2ec373efac86f3e589ff98ac8abf5d28b29b1578/translate/api/QuickStart/Program.cs)
35 changes: 35 additions & 0 deletions Cloud/google/apis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# console.developers.google.com/apis

- [Getting Title at 53:25](https://console.developers.google.com/apis/dashboard?project=fluid-mote-240115&pli=1)

## GCP [Google Cloud Platform]

- [Google Cloud Platform Documentation Google Cloud](https://cloud.google.com/docs/)
- [Google Cloud Platform Billing Support - Google Cloud Platform Console Help](https://support.google.com/cloud/contact/cloud_platform_billing)

## Cloud Translation API

- [Google 中国开发者  |  Google Developers](https://developers.google.cn/china/)
- [技术资源汇总](https://chinagdg.org/resource-list/)

### Google.Cloud.Translation.V2

- [Cloud Translation API](https://console.developers.google.com/apis/library/translate.googleapis.com?filter=category:machine-learning&project=fluid-mote-240115&folder&organizationId)
- [Google.Cloud.Translation.V2 | Google.Cloud.Translation.V2](https://googleapis.github.io/google-cloud-dotnet/docs/Google.Cloud.Translation.V2/)
- [Google Cloud Client Libraries for .NET | Google Cloud APIs](https://googleapis.github.io/google-cloud-dotnet/docs/index.html)

## APIS

### Google APIs Explorer

- [Google APIs Explorer](https://developers.google.com/apis-explorer/#p/)
- [API Library](https://console.developers.google.com/apis/library?project=fluid-mote-240115&folder&organizationId)
- [Machine learning](https://console.developers.google.com/apis/library?filter=category:machine-learning&project=fluid-mote-240115&folder&organizationId)

### Pricing

- [Pricing Google Cloud](https://cloud.google.com/translate/pricing)

### Google Cloud Platform

- [GCP Support Services Support Google Cloud](https://cloud.google.com/support/)
5 changes: 5 additions & 0 deletions Cloud/google/developers/developers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# developers

- [Google Developers](https://developers.google.com/)
- [GCP(Google Cloud Platform)入门 - 六合小杆子 - 博客园](https://www.cnblogs.com/shengwang/p/10567446.html)
- [Gpay](https://pay.google.com/payments/home)
5 changes: 5 additions & 0 deletions Cloud/google/google-translate-api/google-translate-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# google-translate-api

## GitHub

- [matheuss/google-translate-api](https://github.com/matheuss/google-translate-api)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Microsoft SQL Server 2012 Express

- [Download Microsoft® SQL Server® 2012 Express from Official Microsoft Download Center](https://www.microsoft.com/en-us/download/details.aspx?id=29062)
3 changes: 3 additions & 0 deletions DB/PostgreSQL/PostgreSQL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PostgreSQL

- [问题来了,PostgreSQL 的好处都有啥?](https://www.sohu.com/a/237111633_671058)
13 changes: 13 additions & 0 deletions DB/SQLite/Insert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 写入

- [使用事务操作 SQLite 数据批量插入,提高数据批量写入速度,源码讲解 - 伍华聪 - 博客园](https://www.cnblogs.com/wuhuacong/p/3310008.html)
- [提升 SQLite 数据插入效率低、速度慢的方法 - fugaoting 的博客 - CSDN 博客](https://blog.csdn.net/fugaoting/article/details/88732027)
- [提升 SQLite 数据插入效率低、速度慢的方法 - majiakun1 的专栏 - CSDN 博客](https://blog.csdn.net/majiakun1/article/details/46607163)
- [c# 对sqlite基本操作,带批量插入(百万级秒插)-CSDN下载](https://download.csdn.net/download/mic_gary/10154869)

## 常遇到问题

### string or blob too big

- System.Data.SQLite.SQLiteException:“string or blob too big
- statement too long”
25 changes: 25 additions & 0 deletions DB/SQLite/Repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Repair

- SQLite 有一个很严重的缺点就是不提供 Repair 命令.
- 导致死亡提示 database disk image is malformed 它的产生有很多种可能,
- 比如,磁盘空间不足,还有就是写入数据过程中突然掉电等.官

- [SQLite 数据库错误:The database disk image is malformed 解决(修复)方法 - 林鹤霄 - ITeye 博客](https://linhexiao.iteye.com/blog/2342808)
- [使用 SQLite 的感想 - 猴健居士 - 博客园](https://www.cnblogs.com/HopeGi/archive/2013/05/28/3102922.html)
- [sqlite 错误 database disk image is malformed 可解决 - wolfking0608 的博客 - CSDN 博客](https://blog.csdn.net/wolfking0608/article/details/71076588)
- [讨论 SQLite 数据库损坏与修复 - 飞龙在天 - CSDN 博客](https://blog.csdn.net/dragonpeng2008/article/details/52094269)

## 大型文件修复

```txt
最后这个问题还是解决了,我的解决方法是:
下载SQLite Expert Professional,一定要Professional版(收费)的,Personal版(免费)的没有修复功能。
```

### sqlite3 下载

```txt
sqlite-tools-win32-x86-3280000.zip
(1.70 MiB) A bundle of command-line tools for managing SQLite database files, including the command-line shell program, the sqldiff.exe program, and the sqlite3_analyzer.exe program.
(sha1: 4063fe326243ab775a86c104fa77ac178f03976b)
```
9 changes: 9 additions & 0 deletions DB/SQLite/SQL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SQL

## SQL 语句

### 清理空闲页

```C#
VACUUM
```
35 changes: 35 additions & 0 deletions DB/SQLite/SQLite.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

- 本教程帮助您了解什么是 SQLite,它与 SQL 之间的不同,为什么需要它,以及它的应用程序数据库处理方式。
- SQLite 是一个软件库,实现了自给自足的、无服务器的、零配置的、事务性的 SQL 数据库引擎。SQLite 是一个增长最快的数据库引擎,这是在普及方面的增长,与它的尺寸大小无关。SQLite 源代码不受版权限制。
- [SQLite 的并发处理 - Ming Tong - CSDN 博客](https://blog.csdn.net/cuit/article/details/21975807)

```txt
总结
最后我们来总结一下
1.当有写操作时,其他读操作会被驳回
2.当有写操作时,其他写操作会被驳回
3.当开启事务时,在提交事务之前,其他写操作会被驳回
4.当开启事务时,在提交事务之前,其他事务请求会被驳回
5.当有读操作时,其他写操作会被驳回
6.读操作之间能够并发执行
```

```txt
使用SQLite经常会遇到并发处理,要处理好多线程或多进程之间的并发,就得搞清楚SQLite的机制,尤其是Sqlite的锁机制。
因为SQLite是文件数据库,所以它的锁也基本是和文件一致,也即:写独占,读共享。这意味是在读取数据库的时候,是可以多个线程共享的,而如果有增删改的操作,则会独占此文件,其他线程会进程都会被阻塞。
```

## Official

Expand All @@ -12,6 +31,22 @@
- [SQLite 简介 | 菜鸟教程](http://www.runoob.com/sqlite/sqlite-intro.html)
- [SQLite 性能 - 它不是内存数据库,不要对 IN-MEMORY 望文生意。 - bbqz007 - 博客园](https://www.cnblogs.com/bbqzsl/p/6066851.html)
- [C#操作 SQLite 数据库 - 阿凡卢 - 博客园](https://www.cnblogs.com/luxiaoxun/p/3784729.html)
- [[sqlite] db-journal 文件产生原因及说明 - Boffi - CSDN 博客](https://blog.csdn.net/mozart_cai/article/details/26815339)
- [SQLite 库级锁简介和“database is locked”异常的解决方法 - time 式的博客 - CSDN 博客](https://blog.csdn.net/WZh0316/article/details/81188451)

### 性能

- [sqlite3 数据库最大可以是多大?可以存放多少数据?读写性能怎么样? - DerekHan - 博客园](https://www.cnblogs.com/derekhan/p/10897421.html)

### 读写/锁

```text
SQLite 是一个软件库,实现了自给自足的、无服务器的、零配置的、事务性的 SQL 数据库引擎。SQLite允许多个进程/线程同时进行读操作,但在同一时刻只允许一个线程进行写操作。SQLite在进行写操作时,数据库文件会被锁定,此时任何其他的读/写操作都会被阻塞,如果阻塞超过5秒钟(默认是5秒,可通过重新编译SQLite进行修改),就会抛出描述为“database is locked”的异常。
出现上述现象的原因是SQLite只支持库级锁,不支持并发执行写操作,即使是不同的表,同一时刻也只能进行一个写操作。例如,事务T1在表A新插入一条数据,事务T2在表B中更新一条已存在的数据,这两个操作是不能同时进行的,只能顺序进行。
SQLite尽量延迟了申请X锁,直到数据块真正写盘时才申请X锁,再加上被阻塞的操作有等待时间,所以当SQLite作为客户端嵌入数据库被使用时时,一般情况下不会抛出“database is locked”的异常。但是,在高并发的环境下,还是很有可能抛出异常的。避免这种异常的最简单有效的方法,就是在进行写操作时实现互斥锁,并保证写操作按顺序执行。
```

## SQLite 与 SQLite 区别

Expand Down
181 changes: 181 additions & 0 deletions DB/SQLite/Thread.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# 线程读写

- [Sqlite3 多线程读写解决方案 - tajon1226 的专栏 - CSDN 博客](https://blog.csdn.net/tajon1226/article/details/54864322)
- [sqlite3 多线程和锁 ,优化插入速度及性能优化 - 熠熠闪光 - 博客园](https://www.cnblogs.com/huozhong/p/5973938.html)

## Sqlite3 多线程读写解决方案

```text
重要的事情说三遍!!!
如果你想在多线程环境下使用数据库,
那么你得确保所有的线程使用的都是同一个数据库连接。
如果你想在多线程环境下使用数据库,
那么你得确保所有的线程使用的都是同一个数据库连接。
如果你想在多线程环境下使用数据库,
那么你得确保所有的线程使用的都是同一个数据库连接。
```

## 多线程读写操作

```c#
//多线程写 一定要加锁
Thread Th3 = new Thread(delegate ()
{
Parallel.For(0, 1, new ParallelOptions() { MaxDegreeOfParallelism = 300 }, (i, loopState) =>
{
try
{
lock (lockObj)
{
using (var db = Aleseocore.Module.Aleseo.Database.Main.Base.GetInstance_demo_guid())
{
var demo_guiditem = new Aleseo.Database.Main.Entity.Models.demo_guiditem();
demo_guiditem.guid = i.ToString();
demo_guiditem.body = System.Guid.NewGuid().ToString("N");
var t2 = db.Insertable(demo_guiditem).ExecuteCommand();
}
}
}
catch (Exception)
{
Console.WriteLine("写入异常");
}

});

});
Th3.IsBackground = true;
Th3.Start();

//多线程读 无须加锁
Thread Th4 = new Thread(delegate ()
{
Parallel.For(0, 999999999, new ParallelOptions() { MaxDegreeOfParallelism = 300 }, (i, loopState) =>
{
try
{
using (var db = Aleseocore.Module.Aleseo.Database.Main.Base.GetInstance_demo_guid())
{
var urlitems = db.Queryable<Aleseo.Database.Main.Entity.Models.demo_guiditem>().OrderBy(it => SqlSugar.SqlFunc.GetRandom()).Take(50).ToList();
}
}
catch (Exception)
{
Console.WriteLine("读取异常");
}
lock (lockObj)
{
}
});

});
Th4.IsBackground = true;
Th4.Start();

```

## 批量写测试

```c#

//多线程写 一定要加锁
Thread Th3 = new Thread(delegate ()
{
//批量写入测试
List<Aleseo.Database.Main.Entity.Models.demo_guiditem> demo_Guiditems = new List<Aleseo.Database.Main.Entity.Models.demo_guiditem>();



Parallel.For(0, 0, new ParallelOptions() { MaxDegreeOfParallelism = 5000 }, (i, loopState) =>
{
try
{
lock (lockObj)
{
demo_Guiditems.Add(new Aleseo.Database.Main.Entity.Models.demo_guiditem() { guid = i.ToString(), body = File.ReadAllText(@"D:\wwwrootRes\AleseoTemp\Articles\c4150a1b8b8005af3ad0127adb125fae.txt", Encoding.UTF8) });
}

}
catch (Exception ex)
{
Console.WriteLine("写入异常," + ex.Message);
}

});

if (demo_Guiditems.Count==0)
{
return;
}

System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Reset();
stopwatch.Start();

using (var db = Aleseocore.Module.Aleseo.Database.Main.Base.GetInstance_demo_guid())
{

var t2 = db.Insertable(demo_Guiditems).ExecuteCommand();
}

stopwatch.Stop();
Console.WriteLine("成功导入{0}条数据 ,用时{1}秒。", demo_Guiditems.Count, stopwatch.Elapsed.TotalSeconds);

Console.WriteLine("执行完毕");



});
Th3.IsBackground = true;
Th3.Start();
```

## 事务多线程下错误示例

```c#
// 事务插入数据
if (demo_Guiditems.Count == 0) { return; }

System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Reset();
stopwatch.Start();

Thread Th_insert_1 = new Thread(delegate ()
{
using (var db = Aleseocore.Module.Aleseo.Database.Main.Base.GetInstance_demo_guid())
{
for (int i = 0; i < 2500; i++)
{
var item = demo_Guiditems[i];
db.Insertable<Aleseo.Database.Main.Entity.Models.demo_guiditem>(item).AddQueue();
}
var more = db.SaveQueuesAsync();
}

});
Th_insert_1.IsBackground = true;
Th_insert_1.Start();

Thread Th_insert_2 = new Thread(delegate ()
{

using (var db = Aleseocore.Module.Aleseo.Database.Main.Base.GetInstance_demo_guid())
{
for (int i = 2500 - 1; i < 5000; i++)
{
var item = demo_Guiditems[i];
db.Insertable<Aleseo.Database.Main.Entity.Models.demo_guiditem>(item).AddQueue();
}
var more = db.SaveQueuesAsync();
}

});
Th_insert_2.IsBackground = true;
Th_insert_2.Start();


```
10 changes: 10 additions & 0 deletions DB/Sql Server LocalDB/Sql Server LocalDB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Sql Server LocalDB

## Wiki

- [VS2015 自带的 LocalDB 数据库的用法 - Traveller_Lee - 博客园](https://www.cnblogs.com/Traveller-Lee/archive/2016/08/16/5776312.html)
- [如何安装 SQL LocalDB 数据库安装图文教程](https://baijiahao.baidu.com/s?id=1590447297764877317&wfr=spider&for=pc)
- [开发机用 LocalDB 代替 SQL Server-使用与连接字符串](http://www.cftea.com/m/c.asp?docID=7913)
- [SqlLocalDB 实用工具](https://docs.microsoft.com/zh-cn/previous-versions/sql/sql-server-2012/hh212961%28v%3Dsql.110%29)
- [使用 SqlLocalDB 命令行管理 LocalDB - 账号难注册 - 博客园](https://www.cnblogs.com/wallis0922/p/3702424.html)
- [SQL Server LocalDB本地文件数据库操作实践 - 纸上得来终觉浅,绝知此事要躬行 - CSDN博客](https://blog.csdn.net/boonya/article/details/80743084)
19 changes: 19 additions & 0 deletions DB/Sql Server LocalDB/SqlLocalDB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SqlLocalDB

## 操作命令

```C#
// 启动、停止LocalDB实例
SqlLocalDB start "MyLocalDB"
SqlLocalDB stop "MyLocalDB"
```

### 路径

- SqlLocalDB.exe
- %ProgramFiles%\Microsoft SQL Server\110\Tools\Binn

### CMD 命令行中运行 SqlLocalDB.exe

- Cd %ProgramFiles%\Microsoft SQL Server\110\Tools\Binn
- SqlLocalDB.exe /?
4 changes: 4 additions & 0 deletions DB/SqlBulkCopy/SqlBulkCopy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SqlBulkCopy

- [SqlBulkCopy 类](https://msdn.microsoft.com/zh-cn/library/ms294344)
- [SqlBulkCopy 批量写入 25 万条数据只需 3s - 汉城节度使 - 博客园](https://www.cnblogs.com/tuqun/p/3637691.html)
3 changes: 3 additions & 0 deletions Doc/Online/kancloud/kancloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 看云 kancloud

- [看云 | 专注文档在线创作、阅读、分享和托管](https://www.kancloud.cn/)
3 changes: 3 additions & 0 deletions Framework/.NET/Html Agility Pack/style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# style

- [Better way to add a style attribute to Html using HtmlAgilityPack](https://html-agility-pack.net/knowledge-base/12062495/better-way-to-add-a-style-attribute-to-html-using-htmlagilitypack)
Loading

0 comments on commit 44fb6c1

Please sign in to comment.