- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
<分区>
bak.sql的内容是:
1 -- MySQL dump 10.14 Distrib 5.5.60-MariaDB, for Linux (x86_64)
2 --
3 -- Host: localhost Database: suck_db
4 -- ------------------------------------------------------
5 -- Server version 5.5.60-MariaDB
6
7 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 /*!40101 SET NAMES utf8 */;
11 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 /*!40103 SET TIME_ZONE='+00:00' */;
13 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18 --
19 -- Current Database: `suck_db`
20 --
21
22 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `suck_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
23
24 USE `suck_db`;
25
26 --
27 -- Table structure for table `suck_t`
28 --
29
30 DROP TABLE IF EXISTS `suck_t`;
31 /*!40101 SET @saved_cs_client = @@character_set_client */;
32 /*!40101 SET character_set_client = utf8 */;
33 CREATE TABLE `suck_t` (
34 `id` int(10) NOT NULL AUTO_INCREMENT,
35 `name` varchar(30) NOT NULL DEFAULT '',
36 `age` tinyint(4) NOT NULL DEFAULT '0',
37 PRIMARY KEY (`id`)
38 ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;
39 /*!40101 SET character_set_client = @saved_cs_client */;
40
41 --
42 -- Dumping data for table `suck_t`
43 --
44
45 LOCK TABLES `suck_t` WRITE;
46 /*!40000 ALTER TABLE `suck_t` DISABLE KEYS */;
47 INSERT INTO `suck_t` VALUES (1,'tom1',11),(2,'tom2',11),(3,'tom3',11),(4,'tom4',11),(5,'tom5',11),(6,'tom5',11),(7,'tom5',11),(8,'tom5',11),(9,'tom5',11),(10,'tom5',11),(11,'tom5',11),(12,'tom5',11),(13,'tom5',11),(14,'tom5',11),(15,'tom5',11),(16,'tom5',11),(17,'tom5',11),(18,'tom5',11),(19,'tom5',11),(20,'tom5',11),(21,'tom5',11),(22,'tom5',11),(23,'tom5',11),(24,'tom5',11),(25,'tom5',11),(26,'tom5',11),(27,'tom5',11);
48 /*!40000 ALTER TABLE `suck_t` ENABLE KEYS */;
49 UNLOCK TABLES;
50 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
51
52 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
53 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
54 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
55 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
56 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
57 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
58 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
59
60 -- Dump completed on 2018-12-12 1:02:27
当我运行时
sed -e '/./{H;$!d;}' -e 'x;/CREATE TABLE `suck_t`/!d;q' bak.sql
输出是:
DROP TABLE IF EXISTS `suck_t`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `suck_t` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL DEFAULT '',
`age` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
此命令的目的是从 bak.sql
文件中提取创建表扇区。
我真的很困惑,它是如何工作的?
还有{H;$!d;}
,为什么要有大括号?带牙套和不带牙套有什么区别?
我的理解是,'/./{H;$!d;}' 执行后,模式空间包括 10 行空行和最后一行,保持空间包括所有非空行。即
模式空间是:
1
2
3
4
5
6
7
8
9
10
11 -- Dump completed on 2018-12-12 1:02:27
保留空间是:
1 -- MySQL dump 10.14 Distrib 5.5.60-MariaDB, for Linux (x86_64)
2 --
3 -- Host: localhost Database: suck_db
4 -- ------------------------------------------------------
5 -- Server version 5.5.60-MariaDB
6 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
7 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
8 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
9 /*!40101 SET NAMES utf8 */;
10 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
11 /*!40103 SET TIME_ZONE='+00:00' */;
12 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
13 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
14 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
15 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
16 --
17 -- Current Database: `suck_db`
18 --
19 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `suck_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
20 USE `suck_db`;
21 --
22 -- Table structure for table `suck_t`
23 --
24 DROP TABLE IF EXISTS `suck_t`;
25 /*!40101 SET @saved_cs_client = @@character_set_client */;
26 /*!40101 SET character_set_client = utf8 */;
27 CREATE TABLE `suck_t` (
28 `id` int(10) NOT NULL AUTO_INCREMENT,
29 `name` varchar(30) NOT NULL DEFAULT '',
30 `age` tinyint(4) NOT NULL DEFAULT '0',
31 PRIMARY KEY (`id`)
32 ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;
33 /*!40101 SET character_set_client = @saved_cs_client */;
34 --
35 -- Dumping data for table `suck_t`
36 --
37 LOCK TABLES `suck_t` WRITE;
38 /*!40000 ALTER TABLE `suck_t` DISABLE KEYS */;
39 INSERT INTO `suck_t` VALUES (1,'tom1',11),(2,'tom2',11),(3,'tom3',11),(4,'tom4',11),(5,'tom5',11),(6,'tom5',11),(7,'tom5',11),(8,'tom5',11),(9,'tom5',11),(10,'tom5',11),(11,'tom5',11),(12,'tom5',11),(13,'tom5',11),(14,'tom5',11),(15,'tom5',11),(16,'tom5',11),(17,'tom5',11),(18,'tom5',11),(19,'tom5',11),(20,'tom5',11),(21,'tom5',11),(22,'tom5',11),(23,'tom5',11),(24,'tom5',11),(25,'tom5',11),(26,'tom5',11),(27,'tom5',11);
40 /*!40000 ALTER TABLE `suck_t` ENABLE KEYS */;
41 UNLOCK TABLES;
42 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
43 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
44 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
45 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
46 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
47 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
48 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
49 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
50 -- Dump completed on 2018-12-12 1:02:27
'x'执行后,hold space和pattern space互换,所以pattern space包括所有非空行,hold space包括一堆空行和最后一行。
模式空间是:
1 -- MySQL dump 10.14 Distrib 5.5.60-MariaDB, for Linux (x86_64)
2 --
3 -- Host: localhost Database: suck_db
4 -- ------------------------------------------------------
5 -- Server version 5.5.60-MariaDB
6 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
7 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
8 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
9 /*!40101 SET NAMES utf8 */;
10 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
11 /*!40103 SET TIME_ZONE='+00:00' */;
12 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
13 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
14 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
15 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
16 --
17 -- Current Database: `suck_db`
18 --
19 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `suck_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
20 USE `suck_db`;
21 --
22 -- Table structure for table `suck_t`
23 --
24 DROP TABLE IF EXISTS `suck_t`;
25 /*!40101 SET @saved_cs_client = @@character_set_client */;
26 /*!40101 SET character_set_client = utf8 */;
27 CREATE TABLE `suck_t` (
28 `id` int(10) NOT NULL AUTO_INCREMENT,
29 `name` varchar(30) NOT NULL DEFAULT '',
30 `age` tinyint(4) NOT NULL DEFAULT '0',
31 PRIMARY KEY (`id`)
32 ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;
33 /*!40101 SET character_set_client = @saved_cs_client */;
34 --
35 -- Dumping data for table `suck_t`
36 --
37 LOCK TABLES `suck_t` WRITE;
38 /*!40000 ALTER TABLE `suck_t` DISABLE KEYS */;
39 INSERT INTO `suck_t` VALUES (1,'tom1',11),(2,'tom2',11),(3,'tom3',11),(4,'tom4',11),(5,'tom5',11),(6,'tom5',11),(7,'tom5',11),(8,'tom5',11),(9,'tom5',11),(10,'tom5',11),(11,'tom5',11),(12,'tom5',11),(13,'tom5',11),(14,'tom5',11),(15,'tom5',11),(16,'tom5',11),(17,'tom5',11),(18,'tom5',11),(19,'tom5',11),(20,'tom5',11),(21,'tom5',11),(22,'tom5',11),(23,'tom5',11),(24,'tom5',11),(25,'tom5',11),(26,'tom5',11),(27,'tom5',11);
40 /*!40000 ALTER TABLE `suck_t` ENABLE KEYS */;
41 UNLOCK TABLES;
42 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
43 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
44 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
45 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
46 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
47 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
48 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
49 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
50 -- Dump completed on 2018-12-12 1:02:27
保留空间是:
1
2
3
4
5
6
7
8
9
10
11 -- Dump completed on 2018-12-12 1:02:27
执行'/CREATE TABLE suck_t/!d'后,模式空间中除包含CREATE TABLE suck_t的行外的所有行都被删除。所以输出是:
27 CREATE TABLE `suck_t` (
我哪里错了?
例子一 function first(a, b) { return a + b; } function second() { return Math.floor(Math.sqrt(a
我想证明或证伪forall (P Q : Prop), (P -> Q) -> (Q -> P) -> P = Q.在柯克。这是我的方法。 Inductive True2 : Prop := | O
程序提取数字,我希望它继续循环,直到用户键入“Q”/“q”键。例如,当用户按下“O”键时,程序应打印他们输入的数字的个位数,对于用户输入的任何 3 位数字,依此类推。当我现在运行代码时,没有输出,但也
我收到以下代码的警告,我不明白为什么。 类似于这个问题:Unhandled rejection reasons (should be empty) 但是…… 我很确定我正在处理所有错误,那么为什么会出
我正在使用 Express 构建一个博客站点,并且是第一次使用 Q,我希望能够利用资深 Q 用户的知识。 我向我的数据库发出一个请求以加载帖子数据,另一个请求命中 Instagram API(除非它已
我刚刚找到有关 apache solr 的信息,并且在我成功安装了带有 Tomcat 的 apache Solr 之后。然后我开始使用 Apache Solr 进行搜索。 但我对 Apache Sol
我在 Stack Overflow post 上看到了下图 但是,我对“p OR q”、“p AND q”的结果感到困惑,其中“p”等于“false”,“q”等于“unknown”。 在图中,“p O
有人向我提出了这个问题。 n = 77 n = p*q p and q is a prime number 用蛮力找到p和q。 到目前为止我的代码: public class If { pub
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 4 年前。 Improve
我注意到如果 .then()回调由于任何错误(例如对 undefined variable 的操作)而失败,并且没有 .catch()相关联,该错误将被静默忽略。 这在开发过程中很不舒服。 例如,此代
以下示例打印“SAME”: if (q/\\a/ eq q/\a/) { print "SAME\n"; } else { print "DIFFERENT\n"; } 我理解这与 d
我画了 qq 图多元回归,得到了下面的图。谁能告诉我为什么红线下面有两个点?这些点对我的模型有影响吗? 我使用下面的代码来绘制图表。 from sklearn.linear_model import
我确定 int q[6][4] 中的 q 的类型为 (**q)[4],即, 指向大小为 4 的整数数组的指针。但是我的书(我发现它很可疑!!)说函数定义中的 int q[][4] 部分 void fo
我试图用 tatics [intros]、[apply]、[assumption]、[destruct]、[left]、[right]、[split] 来证明这个引理,但失败了。谁能教教我怎么证明?
使用 q.all 时,我的数组中的立即函数似乎没有执行。每个函数都应该创建一个已解决的 promise ,将其打印到控制台,然后返回它。我没有看到控制台输出,但 Q.all 似乎很满意,并用 2 个空
我想在 OpenAI 的 Bipedal Walker v2 中实现 Q 学习,但在寻找教程后,它们似乎总是有限环境,这使得 Q 矩阵和奖励矩阵易于初始化。 例如:http://mnemstudio.
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我正在创建一个基于 AngularJS、Breeze 和 RequireJS 的单页应用程序。在使用 requirejs 设置 AMD 以使用 Angular 和 Breeze 时,我遇到了 Bree
这个问题在这里已经有了答案: Difference between defer().promise and Promise (1 个回答) 关闭 6 年前。 在 Angular 中,以下代码片段似乎
我写了一个 tcp 服务器和一个 tcp 客户端,客户端只向服务器发送数据并打印它写入了多少字节,服务器只接受连接,然后我使用 netstat 显示套接字的 Recv-Q 和 Send-问,我发现 R
我是一名优秀的程序员,十分优秀!