-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrss2.xml
654 lines (420 loc) · 474 KB
/
rss2.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>GanAHE的小创元世纪</title>
<link>https://www.ganahe.top/</link>
<atom:link href="/rss2.xml" rel="self" type="application/rss+xml"/>
<description>万水千山,得幸相遇~</description>
<pubDate>Thu, 06 Aug 2020 13:17:07 GMT</pubDate>
<generator>http://hexo.io/</generator>
<item>
<title>【python与高等数学专题 二】使用Python的sympy库求解N阶导函数及对应点的导数值</title>
<link>https://www.ganahe.top/archives/976c4b7f.html</link>
<guid>https://www.ganahe.top/archives/976c4b7f.html</guid>
<pubDate>Thu, 06 Aug 2020 13:10:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="如何用Python对一个函数求导?"><a href="#如何用Python对一个函数求导?" class="headerlink" title="如何用Python对一个函数求导?"></a>如何用Python对一个函数求导?</h1><h1 id="(1)背景与介绍"><a href="#(1)背景与介绍" class="headerlink" title="(1)背景与介绍"></a>(1)背景与介绍</h1><p>如何证明自己解算出来的函数导数是正确的?<br>仅靠手工计算你无法确定导数的答案是否正确,不过我们可以用Python编写数学库来验证它。</p><h1 id="(2)导数基本概念框架思维导图"><a href="#(2)导数基本概念框架思维导图" class="headerlink" title="(2)导数基本概念框架思维导图"></a>(2)导数基本概念框架思维导图</h1><p>导数的基本概念如下图:<br><img data-src="https://img-blog.csdnimg.cn/20200806171746639.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="如何用Python对一个函数求导?"><a href="#如何用Python对一个函数求导?" class="headerlink" title="如何用Python对一个函数求导?"></a>如何用Python对一个函数求导?</h1><h1 id="(1)背景与介绍"><a href="#(1)背景与介绍" class="headerlink" title="(1)背景与介绍"></a>(1)背景与介绍</h1><p>如何证明自己解算出来的函数导数是正确的?<br>仅靠手工计算你无法确定导数的答案是否正确,不过我们可以用Python编写数学库来验证它。</p><h1 id="(2)导数基本概念框架思维导图"><a href="#(2)导数基本概念框架思维导图" class="headerlink" title="(2)导数基本概念框架思维导图"></a>(2)导数基本概念框架思维导图</h1><p>导数的基本概念如下图:<br><img data-src="https://img-blog.csdnimg.cn/20200806171746639.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><a id="more"></a><p><img data-src="https://img-blog.csdnimg.cn/20200806171756942.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><p><img data-src="https://img-blog.csdnimg.cn/20200806171819812.png#pic_cneter" alt></p><h1 id="(3)实例"><a href="#(3)实例" class="headerlink" title="(3)实例"></a>(3)实例</h1><h2 id="(3-1)Ex-1"><a href="#(3-1)Ex-1" class="headerlink" title="(3.1)Ex. 1"></a>(3.1)Ex. 1</h2><p>让我们对这个函数求导,并计算当xo = 1时的导数值。<br><img data-src="https://img-blog.csdnimg.cn/20200806173127105.png" alt></p><p>让我们来画一下函数图(如果不知道如何绘制函数图,请参照<a href="https://www.ganahe.top/archives/38ad5794.html"><strong>文章</strong></a>):<br><img data-src="https://img-blog.csdnimg.cn/2020080617502414.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><p>通过推算,我们知道这个函数的微分解算如下:<br><img data-src="https://img-blog.csdnimg.cn/20200806173246923.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt><br>利用Smypy去解算,代码如下:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!usr/bin/env python</span></span><br><span class="line"><span class="comment"># -*- conding:utf-8 -*-</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># import the Lib</span></span><br><span class="line"><span class="keyword">from</span> sympy <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"></span><br><span class="line"><span class="comment"># define a function to caculate</span></span><br><span class="line"><span class="comment"># we can use the function to derivative the </span></span><br><span class="line"><span class="comment"># function what you want to solve</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">derivative</span><span class="params">(draw = False)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> derivate</span></span><br><span class="line"><span class="string"> @para draw: Bool,plot function or not</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"> x,f = symbols(<span class="string">"x,f"</span>)</span><br><span class="line"> dx = <span class="number">1</span></span><br><span class="line"> <span class="comment"># define a function which will be derivatived</span></span><br><span class="line"> f = log(<span class="number">1</span>+exp(x**<span class="number">2</span>))</span><br><span class="line"> print(<span class="string">"the derivative of function :"</span>,diff(f,x))</span><br><span class="line"> <span class="keyword">if</span> dx != <span class="literal">None</span>:</span><br><span class="line"> print(<span class="string">"the value of derivative in xo (xo = {}):{}"</span>.format(dx,f.evalf(subs ={<span class="string">'x'</span>:dx})))</span><br><span class="line"> <span class="keyword">if</span> draw:</span><br><span class="line"> ezplot = <span class="keyword">lambda</span> expr:plot_implicit(sympify(expr))</span><br><span class="line"> ezplot(f)</span><br></pre></td></tr></table></figure><p>调用求导函数 : <code>derivative(False)</code> 得到如下结果:<br><img data-src="https://img-blog.csdnimg.cn/20200806174405220.png" alt><br>将原函数与导函数一起绘制出来如下图所示:</p><p><img data-src="https://img-blog.csdnimg.cn/20200806203249500.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><h2 id="(3-2)Ex-2"><a href="#(3-2)Ex-2" class="headerlink" title="(3.2)Ex. 2"></a>(3.2)Ex. 2</h2><p>在默认解中我们可以得到一阶导数。当我们需要求高阶导数时,可以通过下面的代码获得更高阶次的导数:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!usr/bin/env python</span></span><br><span class="line"><span class="comment"># -*- conding:utf-8 -*-</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># import the Lib</span></span><br><span class="line"><span class="keyword">from</span> sympy <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"></span><br><span class="line"><span class="comment"># define a function to caculate</span></span><br><span class="line"><span class="comment"># we can use the function to derivative the </span></span><br><span class="line"><span class="comment"># function what you want to solve</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">derivative</span><span class="params">(draw = False)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> derivate</span></span><br><span class="line"><span class="string"> @para draw: Bool,plot function or not</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"> x,f = symbols(<span class="string">"x,f"</span>)</span><br><span class="line"> dx = <span class="number">1</span></span><br><span class="line"> <span class="comment"># define a function which will be derivatived</span></span><br><span class="line"> n = <span class="number">2</span></span><br><span class="line"> f = x**<span class="number">3</span></span><br><span class="line"> print(<span class="string">"the derivative ({}) of function :{}"</span>.format(n,diff(f,x,n)))</span><br><span class="line"> <span class="keyword">if</span> dx != <span class="literal">None</span>:</span><br><span class="line"> print(<span class="string">"the value of derivative in xo (xo = {}):{}"</span>.format(dx,f.evalf(subs ={<span class="string">'x'</span>:dx})))</span><br><span class="line"> <span class="keyword">if</span> draw:</span><br><span class="line"> ezplot = <span class="keyword">lambda</span> expr:plot_implicit(sympify(expr))</span><br><span class="line"> ezplot(f)</span><br></pre></td></tr></table></figure><p>for example, We will take the second derivative of function: <code>y = x^3</code> :<br><img data-src="https://img-blog.csdnimg.cn/20200806204401162.png" alt><br><img data-src="https://img-blog.csdnimg.cn/20200806204602220.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><h1 id="(4)Confusing-Things"><a href="#(4)Confusing-Things" class="headerlink" title="(4)Confusing Things"></a>(4)Confusing Things</h1><p>我试图在 Sympy 代码中显示求导后的函数图,但失败了。</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> draw:</span><br><span class="line"> ezplot = <span class="keyword">lambda</span> expr:plot_implicit(sympify(expr))</span><br><span class="line"> ezplot(f)</span><br></pre></td></tr></table></figure><p>你会发现画布上什么都没有。显然,我的代码有很多问题,所以如果大佬有其他正确的写法,可以在评论中提交你正确的代码。</p><p><img data-src="https://img-blog.csdnimg.cn/20200806204449944.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/976c4b7f.html#disqus_thread</comments>
</item>
<item>
<title>[Python&Advances Mathematics Project # 2] How to take the derivative of a function by Python</title>
<link>https://www.ganahe.top/archives/2ad96df3.html</link>
<guid>https://www.ganahe.top/archives/2ad96df3.html</guid>
<pubDate>Thu, 06 Aug 2020 13:00:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="how-can-we-take-the-derivative-of-a-function-by-Python"><a href="#how-can-we-take-the-derivative-of-a-function-by-Python" class="headerlink" title="how can we take the derivative of a function by Python?"></a>how can we take the derivative of a function by Python?</h1><h1 id="(1)Background-And-Introduction"><a href="#(1)Background-And-Introduction" class="headerlink" title="(1)Background And Introduction"></a>(1)Background And Introduction</h1><p>How do you prove that the derivative of your function is correct?</p><p>You can’t know for sure if the derivative is correct by hand, but we can write a math library in Python to verify it</p><h1 id="(2)Derivative"><a href="#(2)Derivative" class="headerlink" title="(2)Derivative"></a>(2)Derivative</h1><p>This is some mindmaps about how to derivative the function (by the way,the language of these images is Chinese):</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="how-can-we-take-the-derivative-of-a-function-by-Python"><a href="#how-can-we-take-the-derivative-of-a-function-by-Python" class="headerlink" title="how can we take the derivative of a function by Python?"></a>how can we take the derivative of a function by Python?</h1><h1 id="(1)Background-And-Introduction"><a href="#(1)Background-And-Introduction" class="headerlink" title="(1)Background And Introduction"></a>(1)Background And Introduction</h1><p>How do you prove that the derivative of your function is correct?</p><p>You can’t know for sure if the derivative is correct by hand, but we can write a math library in Python to verify it</p><h1 id="(2)Derivative"><a href="#(2)Derivative" class="headerlink" title="(2)Derivative"></a>(2)Derivative</h1><p>This is some mindmaps about how to derivative the function (by the way,the language of these images is Chinese):</p><a id="more"></a><p><img data-src="https://img-blog.csdnimg.cn/20200806171746639.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><p><img data-src="https://img-blog.csdnimg.cn/20200806171756942.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt><br><img data-src="https://img-blog.csdnimg.cn/20200806171819812.png#pic_cneter" alt></p><h1 id="(3)Ex"><a href="#(3)Ex" class="headerlink" title="(3)Ex."></a>(3)Ex.</h1><h2 id="(3-1)Ex-1"><a href="#(3-1)Ex-1" class="headerlink" title="(3.1)Ex. 1"></a>(3.1)Ex. 1</h2><p>Let’s derivative this function and caculate the value of derivative while the xo equals to one.<br><img data-src="https://img-blog.csdnimg.cn/20200806173127105.png" alt></p><p>What does this function look like?</p><p>Let’s draw it( You can learn how to plot a function by <a href="https://www.ganahe.top/archives/16eaace6.html"><strong>this passage</strong></a> which I writen if you don’t how to plot a function in Python):</p><p><img data-src="https://img-blog.csdnimg.cn/2020080617502414.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><p>We can caculate it to the result like this:<br><img data-src="https://img-blog.csdnimg.cn/20200806173246923.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt><br>Ok, now we will use the Lib which named Sympy of Mathematics in Python,, to solve it:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!usr/bin/env python</span></span><br><span class="line"><span class="comment"># -*- conding:utf-8 -*-</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># import the Lib</span></span><br><span class="line"><span class="keyword">from</span> sympy <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"></span><br><span class="line"><span class="comment"># define a function to caculate</span></span><br><span class="line"><span class="comment"># we can use the function to derivative the </span></span><br><span class="line"><span class="comment"># function what you want to solve</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">derivative</span><span class="params">(draw = False)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> derivate</span></span><br><span class="line"><span class="string"> @para draw: Bool,plot function or not</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"> x,f = symbols(<span class="string">"x,f"</span>)</span><br><span class="line"> dx = <span class="number">1</span></span><br><span class="line"> <span class="comment"># define a function which will be derivatived</span></span><br><span class="line"> f = log(<span class="number">1</span>+exp(x**<span class="number">2</span>))</span><br><span class="line"> print(<span class="string">"the derivative of function :"</span>,diff(f,x))</span><br><span class="line"> <span class="keyword">if</span> dx != <span class="literal">None</span>:</span><br><span class="line"> print(<span class="string">"the value of derivative in xo (xo = {}):{}"</span>.format(dx,f.evalf(subs ={<span class="string">'x'</span>:dx})))</span><br><span class="line"> <span class="keyword">if</span> draw:</span><br><span class="line"> ezplot = <span class="keyword">lambda</span> expr:plot_implicit(sympify(expr))</span><br><span class="line"> ezplot(f)</span><br></pre></td></tr></table></figure><p>Calling <em>derivative</em> function: <code>derivative(False)</code> and we will take the derivative of it. Now we got the result:<br><img data-src="https://img-blog.csdnimg.cn/20200806174405220.png" alt><br>the function of derivative like this:<br><img data-src="https://img-blog.csdnimg.cn/20200806203249500.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><h2 id="(3-2)Ex-2"><a href="#(3-2)Ex-2" class="headerlink" title="(3.2)Ex. 2"></a>(3.2)Ex. 2</h2><p>We can get first derivative in default solution.</p><p>When we need to find the higher derivative, we can get the higher derivative through the following code:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!usr/bin/env python</span></span><br><span class="line"><span class="comment"># -*- conding:utf-8 -*-</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># import the Lib</span></span><br><span class="line"><span class="keyword">from</span> sympy <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"></span><br><span class="line"><span class="comment"># define a function to caculate</span></span><br><span class="line"><span class="comment"># we can use the function to derivative the </span></span><br><span class="line"><span class="comment"># function what you want to solve</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">derivative</span><span class="params">(draw = False)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> derivate</span></span><br><span class="line"><span class="string"> @para draw: Bool,plot function or not</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"> x,f = symbols(<span class="string">"x,f"</span>)</span><br><span class="line"> dx = <span class="number">1</span></span><br><span class="line"> <span class="comment"># define a function which will be derivatived</span></span><br><span class="line"> n = <span class="number">2</span></span><br><span class="line"> f = x**<span class="number">3</span></span><br><span class="line"> print(<span class="string">"the derivative ({}) of function :{}"</span>.format(n,diff(f,x,n)))</span><br><span class="line"> <span class="keyword">if</span> dx != <span class="literal">None</span>:</span><br><span class="line"> print(<span class="string">"the value of derivative in xo (xo = {}):{}"</span>.format(dx,f.evalf(subs ={<span class="string">'x'</span>:dx})))</span><br><span class="line"> <span class="keyword">if</span> draw:</span><br><span class="line"> ezplot = <span class="keyword">lambda</span> expr:plot_implicit(sympify(expr))</span><br><span class="line"> ezplot(f)</span><br></pre></td></tr></table></figure><p>for example, We will take the second derivative of function: <code>y = x^3</code> :<br><img data-src="https://img-blog.csdnimg.cn/20200806204401162.png" alt><br><img data-src="https://img-blog.csdnimg.cn/20200806204602220.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><h1 id="(4)Confusing-Things"><a href="#(4)Confusing-Things" class="headerlink" title="(4)Confusing Things"></a>(4)Confusing Things</h1><p>I try to show the function figure in <em>Sympy</em> code but failed.</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> draw:</span><br><span class="line"> ezplot = <span class="keyword">lambda</span> expr:plot_implicit(sympify(expr))</span><br><span class="line"> ezplot(f)</span><br></pre></td></tr></table></figure><p>You can find that the canvas have nothing on it.</p><p>Obviously, there are many problems with my code, so you can commit your correct code to me in comments if you are willing to help me and other learners!<br><img data-src="https://img-blog.csdnimg.cn/20200806204449944.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_cneter" alt></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/2ad96df3.html#disqus_thread</comments>
</item>
<item>
<title>[python&Advances mathematics Project # 1] draw multiple function images on a canvas</title>
<link>https://www.ganahe.top/archives/16eaace6.html</link>
<guid>https://www.ganahe.top/archives/16eaace6.html</guid>
<pubDate>Tue, 04 Aug 2020 09:00:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="(1)Background-and-Application"><a href="#(1)Background-and-Application" class="headerlink" title="(1)Background and Application"></a>(1)Background and Application</h1><p>We often need to draw a function image for our analysis in the learning and application of advanced mathematics, mathematical analysis and visualization and other scenarios. This can be easily achieved through Python3, which is much more portable and easy to use than MATLAB.</p><h1 id="(2)lib"><a href="#(2)lib" class="headerlink" title="(2)lib"></a>(2)lib</h1><ul><li>matplotlib</li><li>numpy</li></ul><h1 id="(3)General-code"><a href="#(3)General-code" class="headerlink" title="(3)General code"></a>(3)General code</h1><blockquote><p>Demand analysis</p></blockquote><p>We need a can in the function of the multiple function image is drawn with a picture at the same time, in order to show at the same time, contrast and analysis of law, so we first create the canvas, then according to the plot function is adopted to improve the rendering, according to the number of functions to achieve multiple functions at the same time drawing on the canvas, with design code is as follows:</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="(1)Background-and-Application"><a href="#(1)Background-and-Application" class="headerlink" title="(1)Background and Application"></a>(1)Background and Application</h1><p>We often need to draw a function image for our analysis in the learning and application of advanced mathematics, mathematical analysis and visualization and other scenarios. This can be easily achieved through Python3, which is much more portable and easy to use than MATLAB.</p><h1 id="(2)lib"><a href="#(2)lib" class="headerlink" title="(2)lib"></a>(2)lib</h1><ul><li>matplotlib</li><li>numpy</li></ul><h1 id="(3)General-code"><a href="#(3)General-code" class="headerlink" title="(3)General code"></a>(3)General code</h1><blockquote><p>Demand analysis</p></blockquote><p>We need a can in the function of the multiple function image is drawn with a picture at the same time, in order to show at the same time, contrast and analysis of law, so we first create the canvas, then according to the plot function is adopted to improve the rendering, according to the number of functions to achieve multiple functions at the same time drawing on the canvas, with design code is as follows:</p><a id="more"></a><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!usr/bin/env python</span></span><br><span class="line"><span class="comment"># -*- conding:utf-8 -*-</span></span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">from</span> numpy <span class="keyword">import</span> linspace,sqrt,sin,cos,tan,arctan,pi,exp</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">plotFunction</span><span class="params">(x,y,x2 = None,y2 = None,x3=None,y3 = None)</span>:</span></span><br><span class="line"> fig = plt.figure(num = <span class="number">1</span>,dpi = <span class="number">120</span>)</span><br><span class="line"> ax = plt.subplot(<span class="number">111</span>)</span><br><span class="line"> </span><br><span class="line"> <span class="comment"># coordinate axes</span></span><br><span class="line"> ax = plt.gca() <span class="comment"># get current axis</span></span><br><span class="line"> ax.spines[<span class="string">'right'</span>].set_color(<span class="string">'none'</span>) </span><br><span class="line"> ax.spines[<span class="string">'top'</span>].set_color(<span class="string">'none'</span>)</span><br><span class="line"> ax.xaxis.set_ticks_position(<span class="string">'bottom'</span>)</span><br><span class="line"> ax.yaxis.set_ticks_position(<span class="string">'left'</span>)</span><br><span class="line"> <span class="comment"># Set the coordinate axis of (0,0) at the center</span></span><br><span class="line"> ax.spines[<span class="string">'bottom'</span>].set_position((<span class="string">'data'</span>, <span class="number">0</span>)) <span class="comment"># Specifies that the bottom(that is, the X-axis specified) of the data setting is bound to the point 0 on the Y-axis</span></span><br><span class="line"> ax.spines[<span class="string">'left'</span>].set_position((<span class="string">'data'</span>, <span class="number">0</span>))</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"> ax.plot(x,y,label = <span class="string">"first Fig"</span>,color =<span class="string">"blueviolet"</span>)</span><br><span class="line"> <span class="keyword">if</span> x2 <span class="keyword">is</span> <span class="keyword">not</span> <span class="literal">None</span> <span class="keyword">and</span> y2 <span class="keyword">is</span> <span class="keyword">not</span> <span class="literal">None</span>:</span><br><span class="line"> ax.plot(x2,y2,label = <span class="string">"Second Fig"</span>,color =<span class="string">"red"</span>)</span><br><span class="line"> <span class="comment">#ax.set_xlim(0,2)</span></span><br><span class="line"> ax.set_xlabel(<span class="string">"line"</span>,color=<span class="string">'cyan'</span>)</span><br><span class="line"> <span class="comment">#plt.draw()</span></span><br><span class="line"> plt.legend()</span><br><span class="line"> plt.show()</span><br></pre></td></tr></table></figure><p>Relevant parameters and image adjustment can be referred to the Matplotlib manual. This paper aims to provide a method and idea.</p><h1 id="(4)Advanced-Mathematical-Function-Test"><a href="#(4)Advanced-Mathematical-Function-Test" class="headerlink" title="(4)Advanced Mathematical Function Test"></a>(4)Advanced Mathematical Function Test</h1><p>Take the function f (x)= sine (1/x) as an example, first define a function and the scope of its definition:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">x = linspace(<span class="number">-2</span>*pi,<span class="number">2</span>*pi,<span class="number">1000</span>)</span><br><span class="line">y = sin(<span class="number">1</span>/x)</span><br><span class="line"></span><br><span class="line">plotFunction(x,y)</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200804163016885.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>For complex trigonometric functions, see the figure below:<br><img data-src="https://img-blog.csdnimg.cn/2020080416351374.png" alt><br>If we want to know the graph of this function and how it differs from the sine of 1/x above, we just need to define it as follows:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">x = linspace(<span class="number">-2</span>*pi,<span class="number">2</span>*pi,<span class="number">1000</span>)</span><br><span class="line">y = sin(<span class="number">1</span>/x)</span><br><span class="line">y2 = sqrt(x)*(x**<span class="number">3</span><span class="number">-4</span>*cos(x)-sin(<span class="number">1</span>))</span><br><span class="line"></span><br><span class="line">plotFunction(x,y,x,y2)</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200804163420777.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>This function can also be further extended, can be used to achieve the original function of the drawing, the drawing of the first derivative function and other functions.<br><img data-src="https://img-blog.csdnimg.cn/20200804164905673.png" alt></p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">x = linspace(-pi/<span class="number">2</span>,pi/<span class="number">2</span>,<span class="number">1000</span>)</span><br><span class="line">y = arcsin(x)</span><br><span class="line">y2 = <span class="number">1</span>/sqrt(<span class="number">1</span>-x*x)</span><br><span class="line"></span><br><span class="line">plotFunction(x,y,x,y2)</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200804164826996.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>Other functions can be explored/improved on their own.</p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/16eaace6.html#disqus_thread</comments>
</item>
<item>
<title>【python与高等数学专题 一】Python3在一幅图绘制多个函数图像</title>
<link>https://www.ganahe.top/archives/38ad5794.html</link>
<guid>https://www.ganahe.top/archives/38ad5794.html</guid>
<pubDate>Tue, 04 Aug 2020 09:00:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="(一)背景与应用"><a href="#(一)背景与应用" class="headerlink" title="(一)背景与应用"></a>(一)背景与应用</h1><p>在高等数学等学科的学习与应用、数学分析与可视化等场景,我们时常会需要去将一个函数图像绘制出来以便于我们进行分析,通过Python3可以很方便地实现这一点,比起MATLAB等,其轻便、容易上手。</p><h1 id="(二)用到的库"><a href="#(二)用到的库" class="headerlink" title="(二)用到的库"></a>(二)用到的库</h1><ul><li>matplotlib</li><li>numpy</li></ul><h1 id="(三)通用代码"><a href="#(三)通用代码" class="headerlink" title="(三)通用代码"></a>(三)通用代码</h1><blockquote><p>需求分析</p></blockquote><p>我们需要一个能够在同一张图同时绘制多个函数图像的功能,以便于同时显示、对比和分析规律,因此我们先创建画布,随后根据采用plot函数进行绘制,根据函数的个数来实现多个函数的同时绘制在同一张画布上,设计的代码如下:</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="(一)背景与应用"><a href="#(一)背景与应用" class="headerlink" title="(一)背景与应用"></a>(一)背景与应用</h1><p>在高等数学等学科的学习与应用、数学分析与可视化等场景,我们时常会需要去将一个函数图像绘制出来以便于我们进行分析,通过Python3可以很方便地实现这一点,比起MATLAB等,其轻便、容易上手。</p><h1 id="(二)用到的库"><a href="#(二)用到的库" class="headerlink" title="(二)用到的库"></a>(二)用到的库</h1><ul><li>matplotlib</li><li>numpy</li></ul><h1 id="(三)通用代码"><a href="#(三)通用代码" class="headerlink" title="(三)通用代码"></a>(三)通用代码</h1><blockquote><p>需求分析</p></blockquote><p>我们需要一个能够在同一张图同时绘制多个函数图像的功能,以便于同时显示、对比和分析规律,因此我们先创建画布,随后根据采用plot函数进行绘制,根据函数的个数来实现多个函数的同时绘制在同一张画布上,设计的代码如下:</p><a id="more"></a><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!usr/bin/env python</span></span><br><span class="line"><span class="comment"># -*- conding:utf-8 -*-</span></span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">from</span> numpy <span class="keyword">import</span> linspace,sqrt,sin,cos,tan,arctan,pi,exp</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">plotFunction</span><span class="params">(x,y,x2 = None,y2 = None,x3=None,y3 = None)</span>:</span></span><br><span class="line"> fig = plt.figure(num = <span class="number">1</span>,dpi = <span class="number">120</span>)</span><br><span class="line"> ax = plt.subplot(<span class="number">111</span>)</span><br><span class="line"> </span><br><span class="line"> <span class="comment"># 坐标轴</span></span><br><span class="line"> ax = plt.gca() <span class="comment"># get current axis 获得坐标轴对象</span></span><br><span class="line"> ax.spines[<span class="string">'right'</span>].set_color(<span class="string">'none'</span>) <span class="comment"># 将右边 边沿线颜色设置为空 其实就相当于抹掉这条边</span></span><br><span class="line"> ax.spines[<span class="string">'top'</span>].set_color(<span class="string">'none'</span>)</span><br><span class="line"> ax.xaxis.set_ticks_position(<span class="string">'bottom'</span>)</span><br><span class="line"> ax.yaxis.set_ticks_position(<span class="string">'left'</span>)</span><br><span class="line"> <span class="comment"># 设置中心的为(0,0)的坐标轴</span></span><br><span class="line"> ax.spines[<span class="string">'bottom'</span>].set_position((<span class="string">'data'</span>, <span class="number">0</span>)) <span class="comment"># 指定 data 设置的bottom(也就是指定的x轴)绑定到y轴的0这个点上</span></span><br><span class="line"> ax.spines[<span class="string">'left'</span>].set_position((<span class="string">'data'</span>, <span class="number">0</span>))</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"> ax.plot(x,y,label = <span class="string">"first Fig"</span>,color =<span class="string">"blueviolet"</span>)</span><br><span class="line"> <span class="keyword">if</span> x2 <span class="keyword">is</span> <span class="keyword">not</span> <span class="literal">None</span> <span class="keyword">and</span> y2 <span class="keyword">is</span> <span class="keyword">not</span> <span class="literal">None</span>:</span><br><span class="line"> ax.plot(x2,y2,label = <span class="string">"Second Fig"</span>,color =<span class="string">"red"</span>)</span><br><span class="line"> <span class="comment">#ax.set_xlim(0,2)</span></span><br><span class="line"> ax.set_xlabel(<span class="string">"line"</span>,color=<span class="string">'cyan'</span>)</span><br><span class="line"> <span class="comment">#plt.draw()</span></span><br><span class="line"> plt.legend()</span><br><span class="line"> plt.show()</span><br></pre></td></tr></table></figure><p>相关的参数、图像的调整可以参考Matplotlib手册,本文旨在于提供一个方法、思想。</p><h1 id="(四)高等数学函数测试"><a href="#(四)高等数学函数测试" class="headerlink" title="(四)高等数学函数测试"></a>(四)高等数学函数测试</h1><p>以函数f(x)=sin(1/x)为例,首先定义一个函数以及函数定义域范围:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">x = linspace(<span class="number">-2</span>*pi,<span class="number">2</span>*pi,<span class="number">1000</span>)</span><br><span class="line">y = sin(<span class="number">1</span>/x)</span><br><span class="line"></span><br><span class="line">plotFunction(x,y)</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200804163016885.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>对于复杂的三角函数,如下图所示:<br><img data-src="https://img-blog.csdnimg.cn/2020080416351374.png" alt><br>如果我们想知道这个函数的图像以及与上面的sin(1/x)的差异,我们只需要定义如下:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">x = linspace(<span class="number">-2</span>*pi,<span class="number">2</span>*pi,<span class="number">1000</span>)</span><br><span class="line">y = sin(<span class="number">1</span>/x)</span><br><span class="line">y2 = sqrt(x)*(x**<span class="number">3</span><span class="number">-4</span>*cos(x)-sin(<span class="number">1</span>))</span><br><span class="line"></span><br><span class="line">plotFunction(x,y,x,y2)</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200804163420777.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>此函数还可以进行进一步的扩展,可以通过两个函数绘图实现原函数的绘制、一阶导函数等的绘制等功能。<br><img data-src="https://img-blog.csdnimg.cn/20200804164905673.png" alt></p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">x = linspace(-pi/<span class="number">2</span>,pi/<span class="number">2</span>,<span class="number">1000</span>)</span><br><span class="line">y = arcsin(x)</span><br><span class="line">y2 = <span class="number">1</span>/sqrt(<span class="number">1</span>-x*x)</span><br><span class="line"></span><br><span class="line">plotFunction(x,y,x,y2)</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200804164826996.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>其他功能可自行探索/改进。</p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/38ad5794.html#disqus_thread</comments>
</item>
<item>
<title>GNSS导航定位与测量综合系统(GNSSAMS Official 1.1.0)使用说明书</title>
<link>https://www.ganahe.top/archives/measureSoftwareHelp.html</link>
<guid>https://www.ganahe.top/archives/measureSoftwareHelp.html</guid>
<pubDate>Mon, 03 Aug 2020 13:10:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="GNSS导航定位与测量综合系统"><a href="#GNSS导航定位与测量综合系统" class="headerlink" title="GNSS导航定位与测量综合系统"></a>GNSS导航定位与测量综合系统</h1><h2 id="操-作-说-明-书"><a href="#操-作-说-明-书" class="headerlink" title="操 作 说 明 书"></a>操 作 说 明 书</h2><blockquote><h3 id="Copyright-by-GanAHE-DGZC"><a href="#Copyright-by-GanAHE-DGZC" class="headerlink" title="@Copyright by GanAHE,DGZC"></a>@Copyright by GanAHE,DGZC</h3></blockquote><h1 id="一、软件安装"><a href="#一、软件安装" class="headerlink" title="一、软件安装"></a>一、软件安装</h1><p>以Official version1.0版本为例,打开下载的安装包,双击选择安装,弹出如下协议界面,本软件遵循GPL v3 协议,不得将软件用于违法犯罪、商业获利等用途,否则将承担法律责任。<br>点击同意协议<code>I accept the agreement</code>:<br><img data-src="https://img-blog.csdnimg.cn/20200731132105702.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="GNSS导航定位与测量综合系统"><a href="#GNSS导航定位与测量综合系统" class="headerlink" title="GNSS导航定位与测量综合系统"></a>GNSS导航定位与测量综合系统</h1><h2 id="操-作-说-明-书"><a href="#操-作-说-明-书" class="headerlink" title="操 作 说 明 书"></a>操 作 说 明 书</h2><blockquote><h3 id="Copyright-by-GanAHE-DGZC"><a href="#Copyright-by-GanAHE-DGZC" class="headerlink" title="@Copyright by GanAHE,DGZC"></a>@Copyright by GanAHE,DGZC</h3></blockquote><h1 id="一、软件安装"><a href="#一、软件安装" class="headerlink" title="一、软件安装"></a>一、软件安装</h1><p>以Official version1.0版本为例,打开下载的安装包,双击选择安装,弹出如下协议界面,本软件遵循GPL v3 协议,不得将软件用于违法犯罪、商业获利等用途,否则将承担法律责任。<br>点击同意协议<code>I accept the agreement</code>:<br><img data-src="https://img-blog.csdnimg.cn/20200731132105702.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><a id="more"></a><p>同意协议后,自定义安装路径:<br><img data-src="https://img-blog.csdnimg.cn/2020073113211720.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>选择是否创建桌面快捷方式:<br><img data-src="https://img-blog.csdnimg.cn/20200731132127765.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>解压安装包,等待安装:</p><p>安装完成,点击桌面或是菜单栏的GNSSAMS Official 1.0,打开软件,进入欢迎界面:</p><h1 id="二、标准单点定位"><a href="#二、标准单点定位" class="headerlink" title="二、标准单点定位"></a>二、标准单点定位</h1><p><img data-src="https://img-blog.csdnimg.cn/20200731141619803.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><p><img data-src="https://img-blog.csdnimg.cn/20200731114557820.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731114721175.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731120131727.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><p><img data-src="https://img-blog.csdnimg.cn/20200731120402516.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731120508622.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731120659407.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731120924474.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731121057708.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><p><img data-src="https://img-blog.csdnimg.cn/20200731121217801.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731121755631.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731122019134.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731122154149.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/2020073112241110.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731122529579.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731122734911.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/2020073112281462.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731122956986.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731123138902.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731123302518.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731123448303.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731124115498.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731124256510.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731124357595.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731124549853.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731124638294.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731124659281.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731125044913.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731125209594.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731130310419.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731130510212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731130609397.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731130707841.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731130833621.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731130930747.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731131029386.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200731131241141.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/measureSoftwareHelp.html#disqus_thread</comments>
</item>
<item>
<title>百度网盘链接有效性批量检测软件 2.0.0 版本重要说明</title>
<link>https://www.ganahe.top/archives/bb80836e.html</link>
<guid>https://www.ganahe.top/archives/bb80836e.html</guid>
<pubDate>Mon, 03 Aug 2020 10:10:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="(一)错误信息与测试反馈"><a href="#(一)错误信息与测试反馈" class="headerlink" title="(一)错误信息与测试反馈"></a>(一)错误信息与测试反馈</h2><p>最近收到个别用户反馈,软件安装后无法使用,报错如下:<br><img data-src="https://img-blog.csdnimg.cn/20200803175730185.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p><img data-src="https://img-blog.csdnimg.cn/20200803174158253.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="报错"><br>经过开发者及时的多次测试、多方法测试、多环境测试,发现并无问题,可以正常运行,故应该是用户系统环境的相关配置可能导致了错误,缺少文件等。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="(一)错误信息与测试反馈"><a href="#(一)错误信息与测试反馈" class="headerlink" title="(一)错误信息与测试反馈"></a>(一)错误信息与测试反馈</h2><p>最近收到个别用户反馈,软件安装后无法使用,报错如下:<br><img data-src="https://img-blog.csdnimg.cn/20200803175730185.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p><img data-src="https://img-blog.csdnimg.cn/20200803174158253.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="报错"><br>经过开发者及时的多次测试、多方法测试、多环境测试,发现并无问题,可以正常运行,故应该是用户系统环境的相关配置可能导致了错误,缺少文件等。</p><a id="more"></a><p><img data-src="https://img-blog.csdnimg.cn/2020080317443627.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="软件"><br><img data-src="https://img-blog.csdnimg.cn/2020080317453459.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="启动页面"></p><p><img data-src="https://img-blog.csdnimg.cn/20200803174505219.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="开启正常"></p><h2 id="(二)解决措施"><a href="#(二)解决措施" class="headerlink" title="(二)解决措施"></a>(二)解决措施</h2><p>由于我们无法直接获取用户的系统环境,故我们上传了最新的内测版本,上传后的链接资源如下:</p><p><img data-src="https://img-blog.csdnimg.cn/20200803174040593.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>内测版本的软件将会在后台显示一个控制台用来监控软件的运行信息:<br><img data-src="https://img-blog.csdnimg.cn/20200803174912348.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="内测版情况"><br>如果正式版无法在个人电脑运行,请下载内测版本,运行后如果出现问题,请将控制台内的信息截图发送到如下渠道:</p><ol><li>微信公众号后台:星辰换日</li><li><a href="https://www.ganahe.top/archives/39e93322.html">网站在线说明评论区</a><br>我们会及时处理并给予回馈。</li></ol><h2 id="(三)附加说明"><a href="#(三)附加说明" class="headerlink" title="(三)附加说明"></a>(三)附加说明</h2><blockquote><p>百度网盘链接批量检测软件</p></blockquote><blockquote><h3 id="1-声明"><a href="#1-声明" class="headerlink" title="1.声明"></a>1.声明</h3></blockquote><ol><li>本软件遵循GPL v3协议,开源免费,任何未经本人许可的商业收费行为都属于侵权违法行为!用户可以通过下方联系方式予以告知。</li><li>不可将本软件应用于违法犯罪活动,否则自行承担法律责任。</li></ol><blockquote><h3 id="2-开发者:GanAHE"><a href="#2-开发者:GanAHE" class="headerlink" title="2.开发者:GanAHE"></a>2.开发者:GanAHE</h3><p>通过如下链接获取联系与最新更新:<br>(1)网站:<a href="https://www.ganahe.top">https://www.ganahe.top</a><br>(2)微信公众号合作平台:星辰换日</p></blockquote><blockquote><h3 id="3-本软件包含三个版本:"><a href="#3-本软件包含三个版本:" class="headerlink" title="3.本软件包含三个版本:"></a>3.本软件包含三个版本:</h3><p>(1)PC正式版 Official : 正式发布版本。<br>(2)PC测试版 Beta : 最新开发版本,可以体验最新的版本同时能看到软件<br>运行的相关信息,可通过这些信息反馈于上述的联系方式或是在此下方<br>评论:<a href="https://www.ganahe.top/archives/39e93322.html">https://www.ganahe.top/archives/39e93322.html</a>,我们将<br>根据反馈的信息去改善/更新软件功能,希望大家一起来构建一个完整的<br>百度网盘链接批量检测软件工具软件。<br>(3)命令行正式版 :无界面,轻量化,通过命令行执行。</p></blockquote><blockquote><h3 id="感谢各位的支持与反馈,让我们一起把软件做好,方便生活!"><a href="#感谢各位的支持与反馈,让我们一起把软件做好,方便生活!" class="headerlink" title="感谢各位的支持与反馈,让我们一起把软件做好,方便生活!"></a>感谢各位的支持与反馈,让我们一起把软件做好,方便生活!</h3></blockquote><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/bb80836e.html#disqus_thread</comments>
</item>
<item>
<title>ITSMS Official 交通场景智能监控综合系统GUI设计与使用说明书</title>
<link>https://www.ganahe.top/archives/ITSMSHelp.html</link>
<guid>https://www.ganahe.top/archives/ITSMSHelp.html</guid>
<pubDate>Fri, 17 Jul 2020 02:06:12 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><p># ITSMS Official 交通场景智能监控综合系统GUI设计与使用说明书</p><blockquote><p>Intelligent Traffic Scene Monitoring System</p><p>@Copyright by: JoeyforJoy,WHU222huan,GanAHE</p><p>You can find more information and software update by visiting<br><a href="http://www.ganahe.top">www.ganahe.top</a></p></blockquote><h1 id="一、-程序前端技术设计原理"><a href="#一、-程序前端技术设计原理" class="headerlink" title="一、 程序前端技术设计原理"></a>一、 程序前端技术设计原理</h1><h2 id="(一)-设计模型"><a href="#(一)-设计模型" class="headerlink" title="(一) 设计模型"></a>(一) 设计模型</h2><p>前端采用的框架为PyQt5,遵循GPL v3开源协议。<br>前端主要是对后端技术的封装与逻辑调用,采用MVC的设计模式,将数据与界面分离,整体设计结构如下:<br><img data-src="https://img-blog.csdnimg.cn/20200619170644769.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="图1-1 MVC模型"><br>视图为软件界面,通过界面操作发送动作指令,控制器接收后按条件执行相应的动作。在执行动作有需要数据的支持时,通过发送请求到model,实现数据的请求获取或存储。Model的数据来自于控制器传入的数据以及持久化存储的config.json文件,可以实现对数据的临时与长久存储、数据中转等操作。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><p># ITSMS Official 交通场景智能监控综合系统GUI设计与使用说明书</p><blockquote><p>Intelligent Traffic Scene Monitoring System</p><p>@Copyright by: JoeyforJoy,WHU222huan,GanAHE</p><p>You can find more information and software update by visiting<br><a href="http://www.ganahe.top">www.ganahe.top</a></p></blockquote><h1 id="一、-程序前端技术设计原理"><a href="#一、-程序前端技术设计原理" class="headerlink" title="一、 程序前端技术设计原理"></a>一、 程序前端技术设计原理</h1><h2 id="(一)-设计模型"><a href="#(一)-设计模型" class="headerlink" title="(一) 设计模型"></a>(一) 设计模型</h2><p>前端采用的框架为PyQt5,遵循GPL v3开源协议。<br>前端主要是对后端技术的封装与逻辑调用,采用MVC的设计模式,将数据与界面分离,整体设计结构如下:<br><img data-src="https://img-blog.csdnimg.cn/20200619170644769.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="图1-1 MVC模型"><br>视图为软件界面,通过界面操作发送动作指令,控制器接收后按条件执行相应的动作。在执行动作有需要数据的支持时,通过发送请求到model,实现数据的请求获取或存储。Model的数据来自于控制器传入的数据以及持久化存储的config.json文件,可以实现对数据的临时与长久存储、数据中转等操作。</p><a id="more"></a><p>对于视图,根据功能的划分设计如下:<br><img data-src="https://img-blog.csdnimg.cn/20200619170739838.png#pic_center" alt="图1-2 界面视图框架"></p><p>界面的显示包括目标检测、模型训练、信息监控、多文档界面、弹窗提示、文件筛选器等,用到的组件为Qwindow、QWight、QDialog。子窗体与主窗体、其他窗体等的信息数据传递依赖于PyQt5强大的信号/信号槽机制。某一个动作(事件)需要传递数据时,先将数据存储到datebase中转区域,随后发送指定信号,与该信号绑定的槽函数将对中转区域的数据进行相应的处理,由此完成了窗体之前的数据传递与交互。</p><h2 id="(二)-多线程与信息反馈机制设计"><a href="#(二)-多线程与信息反馈机制设计" class="headerlink" title="(二) 多线程与信息反馈机制设计"></a>(二) 多线程与信息反馈机制设计</h2><p><img data-src="https://img-blog.csdnimg.cn/20200619170812416.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="图1-3 多线程与信号反馈机制"></p><blockquote><p>表1 不同类型目标检测的代码</p></blockquote><table><thead><tr><th><strong>Code</strong></th><th><strong>链接目标</strong></th><th><strong>功能</strong></th></tr></thead><tbody><tr><td>201</td><td>子线程1-目标检测</td><td>视频检测</td></tr><tr><td>202</td><td>子线程1-目标检测</td><td>单张图像检测</td></tr><tr><td>203</td><td>子线程1-目标检测</td><td>批量图像检测</td></tr><tr><td>由于模型识别、训练等的处理所需耗时较长,在等待过程中由于拥塞极易导致软件出现假死现象,为提高软件的健壮性与适用性,在广泛添加异常捕捉机制之外,还采用了多线程的设计架构,以应对复杂的多任务与高占用处理需求。</td><td></td><td></td></tr><tr><td>对于软件的事件处理逻辑,正常情况下,目标检测、模型训练等功能在遇到需要进行如启动线程等的信息反馈时,通过图3的标注紫线启动信息传递中间信息到指定线程以激活对应的子线程,进而实现脱离窗体主线程完成高占用工作。</td><td></td><td></td></tr><tr><td>当出现重要信息展示、错误信息提示和操作错误警告时,将由QDialog发送信息,按照严重程度进行不同级别的反馈。</td><td></td><td></td></tr></tbody></table><blockquote><p>表2 不同信号代码对应的层级</p></blockquote><table><thead><tr><th><strong>Code</strong></th><th><strong>响应组件</strong></th><th><strong>级别</strong></th><th><strong>反馈目标层</strong></th><th><strong>作用</strong></th></tr></thead><tbody><tr><td>E</td><td>QDialog</td><td>一级</td><td>QWindow</td><td>弹窗信息,分别对应:Error、Warn、Tip以及Reply</td></tr><tr><td>W</td><td>QDialog</td><td>一级</td><td>QWindow</td><td></td></tr><tr><td>T</td><td>QDialog</td><td>一级</td><td>QWindow</td><td></td></tr><tr><td>R</td><td>QDialog</td><td>一级</td><td>QWindow</td><td></td></tr><tr><td>F</td><td>QTextEdit</td><td>一级</td><td>QWindow</td><td>传替文件路径设置文件列表树</td></tr><tr><td>I</td><td>QTextEdit</td><td>一级</td><td>QWindow</td><td>主窗体状态栏信息传替</td></tr><tr><td>F<a href="#_ftn1">[1]</a></td><td>lcdNumber</td><td>二级</td><td>QWight</td><td>设定视频检测时的FPS</td></tr><tr><td>file</td><td>QtCore.pyqtSignal</td><td>二级</td><td>QWight</td><td>链接一级F,转送文件路径</td></tr><tr><td>train</td><td>QTextEdit</td><td>二级</td><td>QWight</td><td>显示模型训练重要信息</td></tr><tr><td>M</td><td>Qlabel</td><td>二级</td><td>QWight</td><td>显示视频每一帧识别结果</td></tr><tr><td>A</td><td>QLabel</td><td>二级</td><td>QWight</td><td>显示图像识别后的结果</td></tr><tr><td>V</td><td>Win32com</td><td>二级</td><td>QThread</td><td>将信号、信息传替子线程播送</td></tr></tbody></table><hr><p><a href="#_ftnref1">[1]</a> 层级不同信号代码可以相同</p><h1 id="二、操作说明"><a href="#二、操作说明" class="headerlink" title="二、操作说明"></a>二、操作说明</h1><h2 id="(一)-软件整体结构与功能说明"><a href="#(一)-软件整体结构与功能说明" class="headerlink" title="(一) 软件整体结构与功能说明"></a>(一) 软件整体结构与功能说明</h2><h3 id="1-1-界面说明"><a href="#1-1-界面说明" class="headerlink" title="1.1 界面说明"></a>1.1 界面说明</h3><p><img data-src="https://img-blog.csdnimg.cn/20200619174231650.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="图2-1 欢迎页面"></p><blockquote><p>图2-1 欢迎页面</p></blockquote><h1 id="二、-需求规格"><a href="#二、-需求规格" class="headerlink" title="二、 需求规格"></a>二、 需求规格</h1><h2 id="一-概述"><a href="#一-概述" class="headerlink" title="(一) 概述"></a>(一) 概述</h2><p>交通场景智能监控综合系统软件(以下简称为本软件)使用Python语言编写,在Windows操作系统下运行。为了进行神经网络的训练与测试需要安装tensorflow库;为了在神经网络训练与测试过程中使用GPU加速,需要配置NVIDIA公司推出的适用于NVIDIA显卡的并行计算框架CUDA,同时安装深度神经网络的加速库cuDNN;针对图像与视频处理需要安装OpenCV库;针对数学运算需要安装Numpy库。</p><h2 id="二-环境"><a href="#二-环境" class="headerlink" title="(二) 环境"></a>(二) 环境</h2><p>操作系统环境:Windows 10(向下兼容)</p><p>程序语言:Python 3.X</p><p>软件包管理系统和环境管理系统:Conda</p><p>GPU并行计算框架:CUDA</p><h2 id="三-库"><a href="#三-库" class="headerlink" title="(三) 库"></a>(三) 库</h2><p>程序运行所需的库保存在requirement.txt文件中,包含以下内容:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">scipy==<span class="number">1.4</span><span class="number">.1</span></span><br><span class="line"></span><br><span class="line">opencv_python==<span class="number">3.4</span><span class="number">.5</span><span class="number">.20</span></span><br><span class="line"></span><br><span class="line">Keras==<span class="number">2.1</span><span class="number">.5</span></span><br><span class="line"></span><br><span class="line">numpy==<span class="number">1.17</span><span class="number">.4</span></span><br><span class="line"></span><br><span class="line">tensorflow==<span class="number">1.14</span><span class="number">.0</span></span><br><span class="line"></span><br><span class="line">matplotlib==<span class="number">3.0</span><span class="number">.3</span></span><br><span class="line"></span><br><span class="line">Pillow==<span class="number">7.1</span><span class="number">.2</span></span><br><span class="line"></span><br><span class="line">PyQt5==<span class="number">5.14</span><span class="number">.2</span></span><br><span class="line"></span><br><span class="line">scikit_learn==<span class="number">0.23</span><span class="number">.1</span></span><br><span class="line"></span><br><span class="line">scikit_image==<span class="number">0.17</span><span class="number">.2</span></span><br><span class="line"></span><br><span class="line">hyperlpr==<span class="number">0.0</span><span class="number">.2</span></span><br></pre></td></tr></table></figure><h2 id="四-环境与库配置方法"><a href="#四-环境与库配置方法" class="headerlink" title="(四) 环境与库配置方法"></a>(四) 环境与库配置方法</h2><p>Python、Conda与CUDA等环境的安装配置请自行查阅有关教程,在此不再赘述。</p><p>大多数库可在终端通过pip install或conda install指令安装。</p><h2 id="五-测试机硬件参数"><a href="#五-测试机硬件参数" class="headerlink" title="(五) 测试机硬件参数"></a>(五) 测试机硬件参数</h2><p>Ø <strong>测试机1</strong></p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">型号:LENOVO Y7000P</span><br><span class="line"></span><br><span class="line">CPU:Intel(R) Core(TM) i5<span class="number">-8300</span>U CPU @<span class="number">2.30</span>GHz <span class="number">2.30</span> GHz,<span class="number">8</span>G内存</span><br><span class="line"></span><br><span class="line">GPU:NVIDIA GeForce GTX <span class="number">1060</span></span><br><span class="line"></span><br><span class="line">操作系统:Windows <span class="number">10</span></span><br></pre></td></tr></table></figure><p>Ø <strong>测试机2</strong></p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">型号:HP Pavilion Gaming Laptop <span class="number">15</span>-dk0xxx</span><br><span class="line"></span><br><span class="line">CPU:Intel(R) Core(TM) i5<span class="number">-9300</span>U CPU @<span class="number">2.40</span>GHz <span class="number">2.40</span> GHz,<span class="number">8</span>G内存</span><br><span class="line"></span><br><span class="line">GPU:NVIDIA GeForce GTX <span class="number">1660</span>Ti</span><br><span class="line"></span><br><span class="line">操作系统:Windows <span class="number">10</span></span><br></pre></td></tr></table></figure><p>Ø <strong>测试机3</strong></p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">型号:acer Laptop</span><br><span class="line"></span><br><span class="line">CPU: Intel(R) Core(TM) i5<span class="number">-7300</span>HQ CPU @ <span class="number">2.50</span>GHz,<span class="number">8</span>G内存</span><br><span class="line"></span><br><span class="line">GPU:NVIDIA GeForce GTX <span class="number">1050</span></span><br><span class="line"></span><br><span class="line">操作系统:Windows <span class="number">10</span></span><br></pre></td></tr></table></figure><h1 id="三、-软件安装"><a href="#三、-软件安装" class="headerlink" title="三、 软件安装"></a>三、 软件安装</h1><h2 id="一-安装包解压到安装路径"><a href="#一-安装包解压到安装路径" class="headerlink" title="(一) 安装包解压到安装路径"></a>(一) 安装包解压到安装路径</h2><p>双击ITSMS Official2.2.0 setup.exe进行软件安装:<br><img data-src="https://img-blog.csdnimg.cn/20200723162136735.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图1 安装界面:协议接受</p></blockquote><p>选择“I accept the agreement”后点击“Next”进入下一步。</p><p><img data-src="https://img-blog.csdnimg.cn/20200723162253287.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图2 选择安装路径</p></blockquote><p>选择软件安装路径之后,点击“Next”进行安装。</p><p><img data-src="https://img-blog.csdnimg.cn/20200723162357261.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图3 等待文件解压安装</p></blockquote><p>创建桌面快捷方式,并等待大约一分钟即可安装完成,之后可以使用软件对交通场景进行智能监控。</p><h2 id="二-安装完成"><a href="#二-安装完成" class="headerlink" title="(二) 安装完成"></a>(二) 安装完成</h2><p>安装完成后,点击ITSMS Official 2.2.0,初次打开会比较慢,请稍微等待片刻,随后即可进入如下软件欢迎界面:</p><p><img data-src="https://img-blog.csdnimg.cn/20200723153017513.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图4 欢迎界面</p></blockquote><h1 id="四、-软件操作手册"><a href="#四、-软件操作手册" class="headerlink" title="四、 软件操作手册"></a>四、 软件操作手册</h1><h2 id="一-软件操作基本内容说明"><a href="#一-软件操作基本内容说明" class="headerlink" title="(一) 软件操作基本内容说明"></a>(一) 软件操作基本内容说明</h2><h3 id="1-界面构成"><a href="#1-界面构成" class="headerlink" title="(1) 界面构成"></a>(1) 界面构成</h3><p>界面结构组成主要为操作与显示区、信息监控区、操作菜单栏、弹出式提示/操作窗口组成。</p><p>操作与显示区域为各类功能的操作面板与结果等信息呈现的区域,是整个软件的交互最为核心的组成部分;</p><p>信息监控区是软件所有运行状态的监控区域,有助于用户和开发者等掌握软件整体情况与进程;</p><p>操作菜单栏是在操作与显示区域操作面板上的进一步提升,用来实现软件整体的交互操作;</p><p>弹出式提示/操作窗口有“关于”、“设置”等窗体,用来装载软件的相关信息、进行设置操作以及异常错误等信息弹窗提醒。</p><p><img data-src="https://img-blog.csdnimg.cn/20200723153310291.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图5 结构三大组成结构</p></blockquote><p><img data-src="https://img-blog.csdnimg.cn/20200723153454758.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图6 弹出式提示/操作窗口示例:设置界面</p></blockquote><h3 id="2-信息监测"><a href="#2-信息监测" class="headerlink" title="(2) 信息监测"></a>(2) 信息监测</h3><p>信息监测由文件列表栏与状态信息栏构成。文件列表栏主要用于呈现打开文件后文件目录信息(尤其是工作空间),状态信息栏是软件必不可少的一部分,其实现了软件的所有内部运行信息监控,有助于用户了解当前软件的进程,同时方便开发者进行调试,并对重要信息进行呈现。</p><p>文件列表栏与状态信息栏可以调节大小和位置,可以调节为浮动。在需要呈现更多信息时也可以隐藏。</p><p><img data-src="https://img-blog.csdnimg.cn/20200717171609815.png#pic_center" alt></p><blockquote><p>图7 信息检测栏组成与信息监控展示</p></blockquote><p><img data-src="https://img-blog.csdnimg.cn/20200717171629200.png#pic_center" alt><br> <img data-src="https://img-blog.csdnimg.cn/20200717171634595.png#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/20200717171641178.png#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/20200717171649864.png#pic_center" alt></p><blockquote><p>(组)图8 监控信息栏不同设置与展现的演示:状态信息栏为例</p></blockquote><p>隐藏后如果需要显示,需要点击菜单栏的开关按钮实现重新开启,下图中1控制状态信息栏的开启与隐藏,2控制文件列表栏的隐藏与启用。<br><img data-src="https://img-blog.csdnimg.cn/20200723153659739.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt></p><p><img data-src="https://img-blog.csdnimg.cn/20200717171656623.png#pic_center" alt></p><blockquote><p>图9 文件列表与状态信息栏开关</p></blockquote><h3 id="3-菜单栏"><a href="#3-菜单栏" class="headerlink" title="(3) 菜单栏"></a>(3) 菜单栏</h3><p>菜单栏是所有软件整体功能的操作区域,控制着软件全局操作逻辑,具体的菜单栏内容将在后文结合实际功能进行说明。</p><h3 id="4-软件设置功能"><a href="#4-软件设置功能" class="headerlink" title="(4) 软件设置功能"></a>(4) 软件设置功能</h3><p>软件设置功能是整个软件的设置部分,包括工作路径、运行环境、语音提示等的设置。按照下图操作即可打开设置面板:</p><p><img data-src="https://img-blog.csdnimg.cn/20200723153744958.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图10 打开设置面板</p></blockquote><p><strong>工作路径设置</strong></p><p>该功能为软件的重要设置部分,在进行图像检测、监控视频检测、模型训练时都需要用到该功能。</p><p>其中工作路径是图像、监控视频等检测结果与报告的输出路径,运行软件后的输出结果可在该功能进行修改;</p><p>模型文件默认,如有新的模型可以更改,否则该项一般不需要去设置;</p><p>道路相机参数极为重要,每一个不同道路监控摄像头的相机参数与其相应的视频一一对应,即每次对不同监控相机摄像的视频都需要更改为这个摄像机的相机参数,这样才能保证速度检测、车牌识别等功能是正常的。</p><p>文件路径的第一个按钮(带三个点)为自定义更改的路径按钮,点击后可以自行设置自己需要的路径,“默认”按钮则会恢复当前操作的默认路径。</p><p>最下排的按钮分别用来恢复所有路径默认值、保存修改、退出设置界面等。注意:每次修改后,如果不保存,则当前软件是已经生效了的,当在关闭软件后所有设置项都将在下一次打开时恢复默认设置;如果选择保存,则后续无论什么时候打开软件,所有设置的内容都将保存为修改后的结果。</p><p><img data-src="https://img-blog.csdnimg.cn/20200717171731233.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_1,color_FFFFFF,t_1#pic_center" alt></p><blockquote><p>图11 工作路径设置</p></blockquote><p><strong>运行环境设置</strong></p><p>运行环境主要是CPU与GPU的区别,由于时间有限,GPU加速功能暂不支持。<br><img data-src="https://img-blog.csdnimg.cn/20200717171750856.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_11,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图12 运行环境设置</p></blockquote><p><strong>其他设置</strong></p><p>该功能是为辅助软件操作准备的一个自动语音朗读提示功能,在进行关键操作或是发生错误时,如果开启该功能就可以进行语音提示。<br><img data-src="https://img-blog.csdnimg.cn/20200717171758464.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图13 其他设置:系统提示语音</p></blockquote><h2 id="二-图像检测与流量统计"><a href="#二-图像检测与流量统计" class="headerlink" title="(二) 图像检测与流量统计"></a>(二) 图像检测与流量统计</h2><p>点击菜单栏:功能-图像检测与流量统计进入该功能。<br><img data-src="https://img-blog.csdnimg.cn/20200723153930271.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图14 打开步骤演示</p></blockquote><h3 id="1-参数设置"><a href="#1-参数设置" class="headerlink" title="(1) 参数设置"></a>(1) 参数设置</h3><p>表1 图像检测参数对照表</p><table><thead><tr><th>参数</th><th>对应功能与作用</th></tr></thead><tbody><tr><td>识别检测目标</td><td>默认情况下是全选状态,可以通过勾选自定义检测目标</td></tr><tr><td>自动保存结果到工作空间</td><td>为在检测后将检测标记好的影像自动存储到工作空间中,该功能能够保存与原图相同或近似的分辨率</td></tr><tr><td>识别模式</td><td>提供了“目标检测与数量统计”、“目标检测与车牌识别”两个功能</td></tr><tr><td>多张影像弹出或是逐张显示</td><td>此参数是在进行批量识别情况下的设置,默认为逐张显示,此时检测后的图像将显示在界面内,如果选择弹出窗显示,则会一张一张弹出显示,此情况下可以在弹出窗内对图像进行额外的操作,如放大查看、另存到指定目录等</td></tr></tbody></table><p><img data-src="https://img-blog.csdnimg.cn/20200717171830980.png#pic_center" alt></p><blockquote><p>图15 图像检测参数操作面板</p></blockquote><h3 id="2-图像检测与流量统计"><a href="#2-图像检测与流量统计" class="headerlink" title="(2) 图像检测与流量统计"></a>(2) 图像检测与流量统计</h3><p>提供了单张图像检测、多张图像批量检测的功能。以单张影像检测的操作为例,点击对应的按钮弹出文件选择框:</p><p><img data-src="https://img-blog.csdnimg.cn/20200723154449656.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图16 导入图像进行检测演示</p></blockquote><p>如果有提示“检测到当前为初次使用……”则请稍等片刻,此时会预加载模型,为后续提供高速的检测功能。</p><p><img data-src="https://img-blog.csdnimg.cn/20200723154711682.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图17 首次使用弹窗说明</p></blockquote><p>检测完成,得到如下结果:</p><p><img data-src="https://img-blog.csdnimg.cn/20200723154848466.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图18 图像检测结果信息呈现区域</p></blockquote><p>其中中间部分是检测并标注后的图像,右侧对应检测信息,左侧图表为流量统计结果。</p><h3 id="3-保存检测结果"><a href="#3-保存检测结果" class="headerlink" title="(3) 保存检测结果"></a>(3) 保存检测结果</h3><p><strong>1》 自动保存到工作空间</strong></p><p>上文已说明,选择后即可实现保存到工作空间,输出文件路径为/workspace/Image_Result/,文件名为:RESULT_[当前检测图像图像名].png,此时也可以从文件列表栏看到文件的变动。</p><p><strong>2》 检测后的界面图像右键另存</strong></p><p>在检测后的界面上显示的图像点击右键,弹出选择对话框实现图像另存,该方法可以实现自定义的路径输出与命名,但分辨率相对于自动保存的结果会减低。<br><img data-src="https://img-blog.csdnimg.cn/20200723155627632.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图19 图像检测结果自动保存/右键自定义保存演示</p></blockquote><p><strong>3》多张图像批量检测弹出窗另存</strong></p><p>在弹出的窗体选择图像另存,效果与右键保存的效果一致。</p><p><img data-src="https://img-blog.csdnimg.cn/20200717171958208.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图20 批量图像检测弹出窗显示效果及自定义保存</p></blockquote><h2 id="三-监控视频超速车辆检测"><a href="#三-监控视频超速车辆检测" class="headerlink" title="(三) 监控视频超速车辆检测"></a>(三) 监控视频超速车辆检测</h2><p>在菜单栏上,选择:功能-监控视频超速视频检测。<br><img data-src="https://img-blog.csdnimg.cn/20200723160018367.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt></p><h3 id="1-导入待检测视频文件"><a href="#1-导入待检测视频文件" class="headerlink" title="(1) 导入待检测视频文件"></a>(1) 导入待检测视频文件</h3><p><img data-src="https://img-blog.csdnimg.cn/20200717172006703.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图21 导入检测视频</p></blockquote><p>按照图示标示一步步进行操作即可,导入相机参数操作亦同。</p><h3 id="2-导入待检测视频对应的相机参数文件"><a href="#2-导入待检测视频对应的相机参数文件" class="headerlink" title="(2) 导入待检测视频对应的相机参数文件"></a>(2) 导入待检测视频对应的相机参数文件</h3><p><img data-src="https://img-blog.csdnimg.cn/20200717172018289.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图22 导入相机参数</p></blockquote><h3 id="3-参数设置"><a href="#3-参数设置" class="headerlink" title="(3) 参数设置"></a>(3) 参数设置</h3><p>表2 视频识别参数对照表</p><table><thead><tr><th>参数</th><th>对应功能与作用</th></tr></thead><tbody><tr><td>识别目标</td><td>与上文图像检测目标设定相同</td></tr><tr><td>保存视频识别帧功能</td><td>自动将视频识别并标注后的每一帧保存到工作空间,路径为/workspace/ [当前检测的视频名称] FRAME_RESULT/,命名为1……n.jpg;</td></tr><tr><td>保存识别后视频</td><td>自动将标注后每一帧合成一个视频,保存在workspace中,命名为[当前检测的视频名称]_Detection.avi</td></tr><tr><td>仅检测不跟踪模式</td><td>是视频检测的一个方法,一般不需要设置</td></tr><tr><td>限速与检测距离</td><td>当前路段的限速情况,用来判别和界定车辆是否超速违章。相应的值可以上下调节,当需要跨度较大的调节方式时,可以鼠标点击轮盘摁住旋转,可以快速调整限速阈值,范围为0-150km/h。</td></tr></tbody></table><p><img data-src="https://img-blog.csdnimg.cn/20200717172027963.png#pic_center" alt></p><blockquote><p>图23 视频检测面板</p></blockquote><h3 id="4-开始检测"><a href="#4-开始检测" class="headerlink" title="(4) 开始检测"></a>(4) 开始检测</h3><p>点击开始检测,即可。</p><p>注意,视频检测中,还提供了一个图像识别的功能,该功能主要是为了在当前视频进程不结束的情况下,可以进行图像检测等来实现对比等功能。</p><p><img data-src="https://img-blog.csdnimg.cn/20200717172036579.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图24 视频检测操作步骤</p></blockquote><p><img data-src="https://img-blog.csdnimg.cn/20200717172042318.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图25 视频检测车辆超速违章信息</p></blockquote><p><img data-src="https://img-blog.csdnimg.cn/20200717172047695.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图26 视频检测结束总统计</p></blockquote><h3 id="5-强制终止检测进程"><a href="#5-强制终止检测进程" class="headerlink" title="(5) 强制终止检测进程"></a>(5) 强制终止检测进程</h3><p>当视频过长或是无需完成检测视频时,可以执行强制终止操作。值得说明的是,强制终止进程后,此前进行检测的违章报告、自动保存帧(选择情况下)、自动保存视频(选择情况下)都会保存相应的文件。</p><h3 id="6-查看导出信息"><a href="#6-查看导出信息" class="headerlink" title="(6) 查看导出信息"></a>(6) 查看导出信息</h3><p>以video-02.mp4这一段视频为例,只检测视频前几秒内的画面,导出后的文件情况如下,视频检测参数选择全部导出时的导出项如图27:</p><p><img data-src="https://img-blog.csdnimg.cn/20200717172056875.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图27导出项展示</p></blockquote><p><img data-src="https://img-blog.csdnimg.cn/20200717172102824.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图28 保存视频检测帧功能的结果展示</p></blockquote><p><img data-src="https://img-blog.csdnimg.cn/20200717172109305.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>图29 自动导出的违章检测报告</p></blockquote><p>由于监控视频角度不好、相机参数不够准确、视频分辨率不高等因素,会导致车牌识别的效果较差。</p><h2 id="四-自定义训练检测模型"><a href="#四-自定义训练检测模型" class="headerlink" title="(四) 自定义训练检测模型"></a>(四) 自定义训练检测模型</h2><p>模型训练功能是为专业人员增设的一个功能,在当前模型不能满足识别目标的情况下,可以通过待检测目标相近的数据集进行训练,以获得对特殊情况下的识别与检测需求。</p><h3 id="1-训练界面说明"><a href="#1-训练界面说明" class="headerlink" title="(1) 训练界面说明"></a>(1) 训练界面说明</h3><p>点击菜单栏:“功能-模型检测”可进入训练界面,界面如下:<br><img data-src="https://img-blog.csdnimg.cn/20200723160317121.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt></p><blockquote><p>图30 模型训练界面组成</p></blockquote><p>在“参数设置区”中,可设置模型训练时的必要参数,其具体含义将在下一节中介绍。</p><p>在“训练控制区”中,可控制训练的进行。设置完训练参数后,点击“训练模型”按钮,即可开始模型的训练;点击“强制终止”按钮,则中断模型的训练;点击“测试模型”,会出现以下提示:</p><p><img data-src="https://img-blog.csdnimg.cn/20200717172128461.png#pic_center" alt></p><blockquote><p>图31 训练结束后的测试提示</p></blockquote><p>点击“Yes”,便会自动跳转到“监控视频超速车辆检测”界面,进行测试。在测试之前,需要在系统设置中修改需要测试的模型的权重文件。</p><p>在“信息输出区”中,会实时输出训练过程中产生的信息。</p><h3 id="2-训练输入参数"><a href="#2-训练输入参数" class="headerlink" title="(2) 训练输入参数"></a>(2) 训练输入参数</h3><p>表3 模型训练参数</p><table><thead><tr><th>参数</th><th>对应功能与说明</th></tr></thead><tbody><tr><td>标注文件路径</td><td>标注文件的路径,标注文件的格式如下: 每一行的格式为: , 其中 的格式为: (无空格)</td></tr><tr><td>标注文件配套类名文件路径</td><td>类名文件定义了网络层输出层目标类别的具体含义,每一行都是一个类名,每一行的序号就是对应类型的</td></tr><tr><td>anchors文件路径</td><td>anchors文件记录了使用的anchor box的尺寸。其格式如下: …… 其中 分别表示第 个anchor box的宽和高</td></tr><tr><td>batch size</td><td>batch size,指每一次训练时输入的图像数,受CPU或GPU的容量限制</td></tr><tr><td>number of epoches</td><td>指训练集的遍历次数</td></tr><tr><td>加载预训练模型</td><td>是否要加载预训练模型。如果是,则需在”权重文件路径”中指定预训练模型的权重路径</td></tr><tr><td>权重文件路径</td><td>预训练模型的权重路径,加载预训练模型时设置</td></tr><tr><td>冻结darnet主体</td><td>如果冻结,则训练模型时只改变输出层的权重值</td></tr><tr><td>训练模型保存路径</td><td>指模型训练完毕后,权重文件的保存路径</td></tr></tbody></table><h1 id="五、下载软件(暂未开放下载通道,请关注原文消息)"><a href="#五、下载软件(暂未开放下载通道,请关注原文消息)" class="headerlink" title="五、下载软件(暂未开放下载通道,请关注原文消息)"></a>五、下载软件(暂未开放下载通道,请关注原文消息)</h1><p>请到原文获取下载地址与源代码。</p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/ITSMSHelp.html#disqus_thread</comments>
</item>
<item>
<title>Python3+PyQt5实现批量实现百度网盘链接有效性检测</title>
<link>https://www.ganahe.top/archives/39e93322.html</link>
<guid>https://www.ganahe.top/archives/39e93322.html</guid>
<pubDate>Thu, 16 Jul 2020 10:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="(一)背景"><a href="#(一)背景" class="headerlink" title="(一)背景"></a>(一)背景</h2><p>在之前的一期文章中,写了关于如何采用Python实现大量百度网盘链接有效性检测的问题,原文链接如下:<a href="https://www.ganahe.top/archives/d5641092.html">python批量实现百度网盘链接有效性检测传送门</a><br>然后有用户发现在输入时会退出,猜测可能是由于用户系统、文件路径未采用标准输入等导致识别错误,为了解决该问题,特定花了零碎30分钟+3小时开发了GUI界面,同时也感谢该用户的反馈和支持。<br>以下为问题详情,为保护个人隐私,部分内容将打码。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="(一)背景"><a href="#(一)背景" class="headerlink" title="(一)背景"></a>(一)背景</h2><p>在之前的一期文章中,写了关于如何采用Python实现大量百度网盘链接有效性检测的问题,原文链接如下:<a href="https://www.ganahe.top/archives/d5641092.html">python批量实现百度网盘链接有效性检测传送门</a><br>然后有用户发现在输入时会退出,猜测可能是由于用户系统、文件路径未采用标准输入等导致识别错误,为了解决该问题,特定花了零碎30分钟+3小时开发了GUI界面,同时也感谢该用户的反馈和支持。<br>以下为问题详情,为保护个人隐私,部分内容将打码。</p><a id="more"></a><p><img data-src="https://img-blog.csdnimg.cn/20200716165608432.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/20200716165539704.png#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/20200716165723210.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/20200716165754685.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/20200716165900882.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(二)基本原理"><a href="#(二)基本原理" class="headerlink" title="(二)基本原理"></a>(二)基本原理</h2><p>将之前实现的逻辑与PyQt5界面结合起来实现可视化交互。<br>由于检测时如果数量较多,故采用多线程的设计机制,保证了软件的稳定性与检测效率。</p><h2 id="(三)设计结果"><a href="#(三)设计结果" class="headerlink" title="(三)设计结果"></a>(三)设计结果</h2><p><img data-src="https://img-blog.csdnimg.cn/20200716170408271.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(四)运行说明教程与测试结果"><a href="#(四)运行说明教程与测试结果" class="headerlink" title="(四)运行说明教程与测试结果"></a>(四)运行说明教程与测试结果</h2><h3 id="1-导入或编辑待检测数据"><a href="#1-导入或编辑待检测数据" class="headerlink" title="1 导入或编辑待检测数据"></a>1 导入或编辑待检测数据</h3><p>打开软件,点击文件夹图标或是打开:文件-导入文件,将待检测的csv文件导入到软件中。</p><blockquote><p>注意:如果不知道待检测文件格式,请参考之前的文章!文件格式为csv,内容样式与下图相同。<br>随后就可以进行检测。<br><img data-src="https://img-blog.csdnimg.cn/20200716170452605.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>其他功能:由于我们可能需要修改或增删一些链接,故可以在表格区域右键进行数据处理,也可以直接修改表格内的数据:<br><img data-src="https://img-blog.csdnimg.cn/20200716171027509.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p></blockquote><h3 id="2-开始检测"><a href="#2-开始检测" class="headerlink" title="2 开始检测"></a>2 开始检测</h3><p>点击一键检测,此时将开启线程,逐条进行检测,相关信息在右侧的状态信息栏中查阅。<br><img data-src="https://img-blog.csdnimg.cn/20200716170546198.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h3 id="3-检测完成"><a href="#3-检测完成" class="headerlink" title="3 检测完成"></a>3 检测完成</h3><p>给出检测数据报告,同时自动将有效链接呈现到当前页面:<br><img data-src="https://img-blog.csdnimg.cn/20200716170625708.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>同时,如果需要保存有效数据,可以点击下图红色标定的图标,可以导出检测有效的链接到csv文件,至此,完成检测全部流程。<br><img data-src="https://img-blog.csdnimg.cn/20200716170713688.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(五)版本特性与后续开发"><a href="#(五)版本特性与后续开发" class="headerlink" title="(五)版本特性与后续开发"></a>(五)版本特性与后续开发</h2><h3 id="1-当前版本特性"><a href="#1-当前版本特性" class="headerlink" title="1 当前版本特性"></a>1 当前版本特性</h3><ul><li><input checked disabled type="checkbox"> 多线程设计;</li><li><input checked disabled type="checkbox"> 界面开发;</li><li><input checked disabled type="checkbox"> 表格信息呈现;</li><li><input checked disabled type="checkbox"> 可导出结果数据;</li><li><input checked disabled type="checkbox"> 自由添加修改表格内待检测数据;</li><li><input checked disabled type="checkbox"> 检测信息呈现清晰;</li><li><input checked disabled type="checkbox"> 开源免费。<h3 id="2-后续开发说明"><a href="#2-后续开发说明" class="headerlink" title="2 后续开发说明"></a>2 后续开发说明</h3></li><li><input disabled type="checkbox"> 其他网盘或是资料链接有效性检测;</li><li><input disabled type="checkbox"> 自动化爬取网络上的资源链接提供下载平台;</li><li><input disabled type="checkbox"> 添加检测后的右键自动提取文件功能;</li><li><input disabled type="checkbox"> 电影,课件,文档,软件等等资源获取与下载;</li><li><input disabled type="checkbox"> 在线资源软件内查看,减少调转与资源消耗;</li><li><input disabled type="checkbox"> 其他功能(用户反馈多的考虑开发/想到好的点子开发/有时间开发)</li></ul><h2 id="(六)开发说明与版权信息"><a href="#(六)开发说明与版权信息" class="headerlink" title="(六)开发说明与版权信息"></a>(六)开发说明与版权信息</h2><p><img data-src="https://img-blog.csdnimg.cn/2020071617153231.png#pic_center" alt><br>可通过在线帮助功能访问主页:<br><img data-src="https://img-blog.csdnimg.cn/20200716171612417.png#pic_center" alt></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/39e93322.html#disqus_thread</comments>
</item>
<item>
<title>主站迁移通知</title>
<link>https://www.ganahe.top/archives/4b347d7f.html</link>
<guid>https://www.ganahe.top/archives/4b347d7f.html</guid>
<pubDate>Fri, 26 Jun 2020 10:06:12 GMT</pubDate>
<description>
<!-- build time:Tue Nov 03 2020 23:11:30 GMT+0800 (GMT+08:00) --><h1 id="主站迁移通知"><a href="#主站迁移通知" class="headerlink" title="主站迁移通知"></a>主站迁
</description>
<content:encoded><![CDATA[<!-- build time:Tue Nov 03 2020 23:11:30 GMT+0800 (GMT+08:00) --><h1 id="主站迁移通知"><a href="#主站迁移通知" class="headerlink" title="主站迁移通知"></a>主站迁移通知</h1><h3 id="本站最新内容将在网站-DGZC的小创元世纪,链接:https-dgzc-ganahe-top"><a href="#本站最新内容将在网站-DGZC的小创元世纪,链接:https-dgzc-ganahe-top" class="headerlink" title="本站最新内容将在网站:DGZC的小创元世纪,链接:https://dgzc.ganahe.top/"></a>本站最新内容将在网站:<a href="https://dgzc.ganahe.top/" target="_blank" rel="noopener">DGZC的小创元世纪</a>,链接:<a href="https://dgzc.ganahe.top/" target="_blank" rel="noopener">https://dgzc.ganahe.top/</a></h3><p>提供更为全面的:资源分享及内容下载服务</p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/4b347d7f.html#disqus_thread</comments>
</item>
<item>
<title>【趣翻译 第一期】 1 - 茶与性教育:喝茶与性教育</title>
<link>https://www.ganahe.top/archives/a64d5b68.html</link>
<guid>https://www.ganahe.top/archives/a64d5b68.html</guid>
<pubDate>Fri, 26 Jun 2020 10:06:12 GMT</pubDate>
<description>
<!-- build time:Tue Nov 03 2020 23:11:15 GMT+0800 (GMT+08:00) --><hr><h1 id="喝茶哲学与“啪啪啪”"><a href="#喝茶哲学与“啪啪啪”" class="headerlink" title="喝茶哲学与“啪啪啪”"></a>喝茶哲学与“啪啪啪”</h1><blockquote><h2 id="声明:"><a href="#声明:" class="headerlink" title="声明:"></a>声明:</h2><ul><li><input checked disabled type="checkbox"> 1.来源:bilibili Up主:塔纳瓦隆灵魂大厅 的转载</li><li><input checked disabled type="checkbox"> 2.原标题:英国性教育科教短片:喝茶和啪啪啪 - Tea and Consent - Tee and Sex,视频链接在文章末尾。</li><li><input checked disabled type="checkbox"> 3.抄录与解读。</li><li><input checked disabled type="checkbox"> Script: rockstar dinosaur pirale princess;</li><li><input checked disabled type="checkbox"> Video: buleseatstudios.com;</li><li><input checked disabled type="checkbox"> Narrator: graham wheeler;</li><li><input checked disabled type="checkbox"> Animation: rachel brian</li></ul></blockquote><h2 id="(一)英文版"><a href="#(一)英文版" class="headerlink" title="(一)英文版"></a>(一)英文版</h2><h3 id="CONSENT:It’s-simple-as-tea"><a href="#CONSENT:It’s-simple-as-tea" class="headerlink" title="CONSENT:It’s simple as tea"></a>CONSENT:It’s simple as tea</h3><p>if you’re still struggling with consent, just imaging instead of initiating sex.</p><p>You’re making them a cup of tea, you say:” Hey, would you like a cup of tea?” and they go:” Oh my god, I would love a cup of tea, thank you!” then you know they want a cup of tea.</p>
</description>
<content:encoded><![CDATA[<!-- build time:Tue Nov 03 2020 23:11:15 GMT+0800 (GMT+08:00) --><hr><h1 id="喝茶哲学与“啪啪啪”"><a href="#喝茶哲学与“啪啪啪”" class="headerlink" title="喝茶哲学与“啪啪啪”"></a>喝茶哲学与“啪啪啪”</h1><blockquote><h2 id="声明:"><a href="#声明:" class="headerlink" title="声明:"></a>声明:</h2><ul><li><input checked disabled type="checkbox"> 1.来源:bilibili Up主:塔纳瓦隆灵魂大厅 的转载</li><li><input checked disabled type="checkbox"> 2.原标题:英国性教育科教短片:喝茶和啪啪啪 - Tea and Consent - Tee and Sex,视频链接在文章末尾。</li><li><input checked disabled type="checkbox"> 3.抄录与解读。</li><li><input checked disabled type="checkbox"> Script: rockstar dinosaur pirale princess;</li><li><input checked disabled type="checkbox"> Video: buleseatstudios.com;</li><li><input checked disabled type="checkbox"> Narrator: graham wheeler;</li><li><input checked disabled type="checkbox"> Animation: rachel brian</li></ul></blockquote><h2 id="(一)英文版"><a href="#(一)英文版" class="headerlink" title="(一)英文版"></a>(一)英文版</h2><h3 id="CONSENT:It’s-simple-as-tea"><a href="#CONSENT:It’s-simple-as-tea" class="headerlink" title="CONSENT:It’s simple as tea"></a>CONSENT:It’s simple as tea</h3><p>if you’re still struggling with consent, just imaging instead of initiating sex.</p><p>You’re making them a cup of tea, you say:” Hey, would you like a cup of tea?” and they go:” Oh my god, I would love a cup of tea, thank you!” then you know they want a cup of tea.</p><a id="more"></a><p>If you say:” Hey, would you like a cup of tea?” and they’re like:” uh, you know, I’m not really sure…” then you can make them a cup of tea or not.</p><p>But be aware that they might not drink it. And if they don’t drink it then … and this is the importtant bit. Don’t make them drink it just because you made it doesn’t mean you’re entitled to watch them drink it.</p><p>And if they say:” No, thank you” then don’t make them tea at all. Just don’t make them tea, don’t make them drink tea, don’t get annoyed at them for not wanting tea, they just don’t want tea, okey?</p><p>They might say:” Yes, please, that’s kind of you!” and then the tea arrives, they actually don’t want the tea at all. Sure, that’s kind of annoying as you’re gone to all the effort of making the tea. But they remain under no obligation to drink the tea.</p><p>They did want tea, now they don’t. Some people change their mind in the time it takes to boil that kettle, brew the tea and add the milk. And it’s okey for people to change their mind and you are still not entitled to watch them drink it.</p><p>If they are unconscious, don’t make them tea. Unconscious people don’t want tea and they can’t answer the question “do you want tea?” because they’re unconscious. Okey, maybe they were conscious when you asked them if them wanted tea, and they said yes. But in the time it took you to boil that kettle, brew the tea and add the milk. They are now unconscious. You should just put the tea down, make sure the unconscious persion is safe. And this is the important part again… don’t make them drink the tea. They said yes then,sure. But unconscious people don’t want tea.</p><p>If someone said yes to tea, started drinking it, and then passed out before they’d finished in, don’t keep on pouring it down their throat, take the tea away and make sure they are safe because unconscious people don’t want tea. Trust me on this.</p><p>If someone siad “yes” to tea around your house last Saturday that doesn’t mean they want you to make them tea all the time. They don’t want you to come around to their place unexpectedly and make them tea anf force them to drink it going:” but you wanted tea last week!” or to wake up to find you are pouring tea down their throat going:” but you wanted tea last night!”</p><p>If you can understand how completely ludicrous it is to force people to have tea when they don’t want tea, and you are able to understand when people don’t want tea then how hard is it to understand it when it comes to sex?</p><p>Whether it’s tea or sex, consent is everything. And in that note, I’m going to make myself a cup of tea.</p><iframe src="//player.bilibili.com/player.html?aid=925281283&bvid=BV1DT4y1G7ES&cid=180239857&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/a64d5b68.html#disqus_thread</comments>
</item>
<item>
<title>PyQt5打包后运行出现 ImportError: unable to find Qt5Core.dll on PATH 两套解决方案</title>
<link>https://www.ganahe.top/archives/387f01e.html</link>
<guid>https://www.ganahe.top/archives/387f01e.html</guid>
<pubDate>Sat, 20 Jun 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="一、背景"><a href="#一、背景" class="headerlink" title="一、背景"></a>一、背景</h1><p>最近一个项目采用PyQt5 5.13.0 进行开发,经过打包成exe可以执行。<br>环境:Windows 10 + python 3.7 + PyQt5 5.13.0 + tensorflow 1.14.0等。但是在此之前运行时会有这么一个错误:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ImportError: unable to find Qt5Core.dll on PATH</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200620221658817.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>5.12.3 以及5.13.0好像都存在该问题:<br><img data-src="https://img-blog.csdnimg.cn/20200620221556875.png#pic_center" alt="问题"></p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="一、背景"><a href="#一、背景" class="headerlink" title="一、背景"></a>一、背景</h1><p>最近一个项目采用PyQt5 5.13.0 进行开发,经过打包成exe可以执行。<br>环境:Windows 10 + python 3.7 + PyQt5 5.13.0 + tensorflow 1.14.0等。但是在此之前运行时会有这么一个错误:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ImportError: unable to find Qt5Core.dll on PATH</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200620221658817.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>5.12.3 以及5.13.0好像都存在该问题:<br><img data-src="https://img-blog.csdnimg.cn/20200620221556875.png#pic_center" alt="问题"></p><a id="more"></a><p>统一错误模板:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">λ XXXXXX.exe</span><br><span class="line">Traceback (most recent call last):</span><br><span class="line"> File <span class="string">"xxxxxx\ui.py"</span>, line 4, <span class="keyword">in</span> <module></span><br><span class="line"> File <span class="string">"c:\users\remib\.virtualenvs\xxxxxxx-w7udp1ct\lib\site-packages\PyInstaller\loader\pyimod03_importers.py"</span>, line 627, <span class="keyword">in</span> exec_module</span><br><span class="line"> <span class="built_in">exec</span>(bytecode, module.__dict__)</span><br><span class="line"> File <span class="string">"site-packages\PyQt5\__init__.py"</span>, line 41, <span class="keyword">in</span> <module></span><br><span class="line"> File <span class="string">"site-packages\PyQt5\__init__.py"</span>, line 33, <span class="keyword">in</span> find_qt</span><br><span class="line">ImportError: unable to find Qt5Core.dll on PATH</span><br><span class="line">[12876] Failed to execute script ui</span><br></pre></td></tr></table></figure><blockquote><p>注意:有时候运行失败是闪退的,如需要查看错误信息,可以先打包成在控制台运行,然后通过cmd、power shell等执行.exe文件</p></blockquote><h1 id="二、本机运行报错及解决办法"><a href="#二、本机运行报错及解决办法" class="headerlink" title="二、本机运行报错及解决办法"></a>二、本机运行报错及解决办法</h1><p>在PyQt创建初始化前加入如下代码:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> hasattr(sys, <span class="string">'frozen'</span>):</span><br><span class="line"> os.environ[<span class="string">'PATH'</span>] = sys._MEIPASS + <span class="string">";"</span> + os.environ[<span class="string">'PATH'</span>]</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/2020062022283797.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="示例"></p><h1 id="三、在其他电脑上报错及解决办法"><a href="#三、在其他电脑上报错及解决办法" class="headerlink" title="三、在其他电脑上报错及解决办法"></a>三、在其他电脑上报错及解决办法</h1><p><img data-src="https://img-blog.csdnimg.cn/20200620223808967.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>由于本人在此之前就用过PyQt5创建应用并解决了以上问题,但是最近的这个项目打包好发布后在相同运行环境下的机子又报错了,检查打包后项目的安装目录,发现文件是存在的:<br><img data-src="https://img-blog.csdnimg.cn/20200620223121123.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>经过一番测试与查找,发现打包后的PyQt5文件夹下,<code>PyQt5/Qt/bin</code>没有该文件。在Pyinstaller的GitHub项目下,issue有这么一项:</p><p><img data-src="https://img-blog.csdnimg.cn/20200621084924821.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>即需要手动将缺少的文件复制到打包后的<code>PyQt5/Qt/bin</code>目录下。查看该目录,在打包时手动加入缺少的文件:</p><blockquote><p>缺少文件情况</p></blockquote><p><img data-src="https://img-blog.csdnimg.cn/20200620223522669.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><blockquote><p>添加文件(可只添加缺少的文件,为防止其他PyQt的库又找不到,可以都复制进去(库文件来源于打包后的目录。)</p></blockquote><p><img data-src="https://img-blog.csdnimg.cn/20200620223556167.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p><img data-src="https://img-blog.csdnimg.cn/20200620224229194.png#pic_center" alt></p><p>最后成功!</p><h1 id="四、运行成功"><a href="#四、运行成功" class="headerlink" title="四、运行成功"></a>四、运行成功</h1><p><img data-src="https://img-blog.csdnimg.cn/20200620224031759.gif#pic_center" alt></p><h1 id="五、项目其他文章链接"><a href="#五、项目其他文章链接" class="headerlink" title="五、项目其他文章链接"></a>五、<a href="https://www.ganahe.top/archives/387f01e.html">项目其他文章链接</a></h1><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/387f01e.html#disqus_thread</comments>
</item>
<item>
<title>【英语搞笑配音】 (二)给Chloe送电脑的熊🐻</title>
<link>https://www.ganahe.top/archives/8747b423.html</link>
<guid>https://www.ganahe.top/archives/8747b423.html</guid>
<pubDate>Sat, 23 May 2020 02:49:36 GMT</pubDate>
<description>
<!-- build time:Tue Nov 03 2020 23:11:15 GMT+0800 (GMT+08:00) --><p><video src="https://cdn.llscdn.com/dubbing/20200523/Zjk4MWQwMDAwNTBjZGJl
</description>
<content:encoded><![CDATA[<!-- build time:Tue Nov 03 2020 23:11:15 GMT+0800 (GMT+08:00) --><p><video src="https://cdn.llscdn.com/dubbing/20200523/Zjk4MWQwMDAwNTBjZGJlNg==_5eb60c5af2cc5f000ac7f3f5_1590200712725.mp4" controls width="700" height="400">您的浏览器不支持播放该视频!</video></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/8747b423.html#disqus_thread</comments>
</item>
<item>
<title>【英语搞笑配音 第一期】 憨憨熊的维权之路(4集全)</title>
<link>https://www.ganahe.top/archives/276db9f1.html</link>
<guid>https://www.ganahe.top/archives/276db9f1.html</guid>
<pubDate>Sat, 23 May 2020 02:43:20 GMT</pubDate>
<description>
<!-- build time:Tue Nov 03 2020 23:11:15 GMT+0800 (GMT+08:00) --><h1 id="第一集-竹笋坏了"><a href="#第一集-竹笋坏了" class="headerlink" title="第一集 竹笋坏了"></a>第一集 竹笋坏了</h1><iframe src="//player.bilibili.com/player.html?aid=243361241&bvid=BV1Bv411z7XS&cid=194295099&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe>
</description>
<content:encoded><![CDATA[<!-- build time:Tue Nov 03 2020 23:11:15 GMT+0800 (GMT+08:00) --><h1 id="第一集-竹笋坏了"><a href="#第一集-竹笋坏了" class="headerlink" title="第一集 竹笋坏了"></a>第一集 竹笋坏了</h1><iframe src="//player.bilibili.com/player.html?aid=243361241&bvid=BV1Bv411z7XS&cid=194295099&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe><a id="more"></a><h1 id="第二集-第一位受害者出现"><a href="#第二集-第一位受害者出现" class="headerlink" title="第二集 第一位受害者出现"></a>第二集 第一位受害者出现</h1><iframe src="//player.bilibili.com/player.html?aid=243361241&bvid=BV1Bv411z7XS&cid=194295691&page=2" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe># 第三集 第二位受害者<iframe src="//player.bilibili.com/player.html?aid=243361241&bvid=BV1Bv411z7XS&cid=194295889&page=3" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe># 第四集 鸡兄找真凶<iframe src="//player.bilibili.com/player.html?aid=243361241&bvid=BV1Bv411z7XS&cid=194296109&page=4" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe># 幕后花絮(燃...)<iframe src="//player.bilibili.com/player.html?aid=243361241&bvid=BV1Bv411z7XS&cid=194324444&page=6" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/276db9f1.html#disqus_thread</comments>
</item>
<item>
<title>python批量实现百度网盘链接有效性检测</title>
<link>https://www.ganahe.top/archives/d5641092.html</link>
<guid>https://www.ganahe.top/archives/d5641092.html</guid>
<pubDate>Tue, 12 May 2020 10:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="(一)初始数据样式"><a href="#(一)初始数据样式" class="headerlink" title="(一)初始数据样式"></a>(一)初始数据样式</h2><p>将百度网盘连接存放到 采用逗号间隔的UTF-8类型csv 文件中,数据存放格式为<code>资源名 | 链接 | 密码</code>,如下图所示:<br><img data-src="https://img-blog.csdnimg.cn/20200512173820664.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="待检测数据(部分)"></p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="(一)初始数据样式"><a href="#(一)初始数据样式" class="headerlink" title="(一)初始数据样式"></a>(一)初始数据样式</h2><p>将百度网盘连接存放到 采用逗号间隔的UTF-8类型csv 文件中,数据存放格式为<code>资源名 | 链接 | 密码</code>,如下图所示:<br><img data-src="https://img-blog.csdnimg.cn/20200512173820664.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="待检测数据(部分)"></p><a id="more"></a><p>逗号间隔的UTF-8类型csv 文件可以采用Excel转换而得,选择另存为操作即可:<img data-src="https://img-blog.csdnimg.cn/20200512174130497.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(二)检测"><a href="#(二)检测" class="headerlink" title="(二)检测"></a>(二)检测</h2><h3 id="2-1-原理与思路"><a href="#2-1-原理与思路" class="headerlink" title="2.1 原理与思路"></a>2.1 原理与思路</h3><p>如链接失效,会出现如下界面:<br><img data-src="https://img-blog.csdnimg.cn/20200512174527698.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>通过控制台查看返回的代码:</p><p><img data-src="https://img-blog.csdnimg.cn/20200512174708140.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>如果链接无效会有标签 <code>class = share-error-left , div_id = share_nofound_des</code>。故可以通过 urllib 库和 bs4.BeautifulSoup 请求并解析HTML,从而判断该标签是否存在。</p><h3 id="2-2-设计"><a href="#2-2-设计" class="headerlink" title="2.2 设计"></a>2.2 设计</h3><p>通过读取 csv 文件,依次将资源链接传入处理函数,依次判断并保存到新的 <code>resultLink.csv</code>中,作为输出结果。</p><h3 id="2-3-代码-Demo"><a href="#2-3-代码-Demo" class="headerlink" title="2.3 代码 Demo"></a>2.3 代码 Demo</h3><h4 id="2-3-1-判断与解析代码"><a href="#2-3-1-判断与解析代码" class="headerlink" title="2.3.1 判断与解析代码"></a>2.3.1 判断与解析代码</h4><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="string">"""</span></span><br><span class="line"><span class="string">comment: 百度网盘爬虫分析</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">@author: GanAH 2020/5/12.</span></span><br><span class="line"><span class="string">@version 1.0.</span></span><br><span class="line"><span class="string">@contact: https://www.ganahe.top/</span></span><br><span class="line"><span class="string">"""</span></span><br><span class="line"><span class="keyword">import</span> csv</span><br><span class="line"><span class="keyword">import</span> os</span><br><span class="line"><span class="keyword">import</span> urllib.request</span><br><span class="line"><span class="keyword">import</span> time</span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> bs4 <span class="keyword">import</span> BeautifulSoup</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">BaiduNetdisk</span><span class="params">(object)</span>:</span></span><br><span class="line"></span><br><span class="line"> <span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self)</span>:</span></span><br><span class="line"> <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"> <span class="function"><span class="keyword">def</span> <span class="title">disabledLink</span><span class="params">(self, link)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> 链接有效性判断</span></span><br><span class="line"><span class="string"> :param link: baiduNetdisk download Link</span></span><br><span class="line"><span class="string"> :return: 0-False / html-True</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"> <span class="keyword">try</span>:</span><br><span class="line"> print(<span class="string">"url"</span>, link)</span><br><span class="line"></span><br><span class="line"> headers = {</span><br><span class="line"> <span class="string">'User-Agent'</span>: <span class="string">'Mozilla/4.0(compatible;MSIE 5.5;Windows NT)'</span></span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> req = urllib.request.Request(url=link, headers=headers, method=<span class="string">'POST'</span>)</span><br><span class="line"> response = urllib.request.urlopen(req, <span class="literal">None</span>, <span class="number">8</span>) <span class="comment"># 在这里应该加入代理</span></span><br><span class="line"> html = response.read()</span><br><span class="line"> <span class="keyword">return</span> {<span class="string">"code"</span>: <span class="number">1</span>, <span class="string">"status"</span>: html}</span><br><span class="line"> <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line"> <span class="keyword">return</span> {<span class="string">"code"</span>: <span class="number">0</span>, <span class="string">"status"</span>: e.__str__()}</span><br><span class="line"></span><br><span class="line"> <span class="function"><span class="keyword">def</span> <span class="title">anylies</span><span class="params">(self, link)</span>:</span></span><br><span class="line"> resultDict = self.disabledLink(link)</span><br><span class="line"> <span class="keyword">if</span> resultDict[<span class="string">"code"</span>] == <span class="number">0</span>:</span><br><span class="line"> print(<span class="string">"异常错误!"</span>)</span><br><span class="line"> print(resultDict.get(<span class="string">"status"</span>))</span><br><span class="line"> <span class="keyword">else</span>:</span><br><span class="line"> <span class="keyword">try</span>:</span><br><span class="line"> <span class="comment"># print(resultDict.get("status").decode('utf-8'))</span></span><br><span class="line"> <span class="comment"># ak = str(resultDict.get("status"),encoding = "utf8")</span></span><br><span class="line"> <span class="comment"># print(type(resultDict.get("status")))</span></span><br><span class="line"> <span class="comment"># for i in range(len(ak)):</span></span><br><span class="line"> <span class="comment"># print(ak[i])</span></span><br><span class="line"> soup = BeautifulSoup(resultDict.get(<span class="string">"status"</span>), <span class="string">'html.parser'</span>) <span class="comment"># 文档对象</span></span><br><span class="line"></span><br><span class="line"> <span class="comment"># 类名为xxx而且文本内容为hahaha的div</span></span><br><span class="line"> count = <span class="number">0</span></span><br><span class="line"> <span class="comment"># 查找是否有share-error标签,有则无效</span></span><br><span class="line"> print(<span class="string">"查找是否有share-error标签,有则无效"</span>)</span><br><span class="line"> <span class="keyword">for</span> k <span class="keyword">in</span> soup.find_all(<span class="string">'div'</span>, class_=<span class="string">'share-error-left'</span>): <span class="comment"># ,string='更多'</span></span><br><span class="line"> print(k)</span><br><span class="line"> count += <span class="number">1</span></span><br><span class="line"> <span class="keyword">if</span> count == <span class="number">0</span>:</span><br><span class="line"> print(<span class="string">"链接有效"</span>)</span><br><span class="line"> <span class="keyword">return</span> <span class="literal">True</span></span><br><span class="line"> <span class="keyword">else</span>:</span><br><span class="line"> print(<span class="string">"链接无效"</span>)</span><br><span class="line"> <span class="keyword">return</span> <span class="literal">False</span></span><br><span class="line"></span><br><span class="line"> <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line"> print(<span class="string">"异常错误-302:"</span>, e.__str__())</span><br></pre></td></tr></table></figure><h4 id="2-3-2-逻辑处理代码"><a href="#2-3-2-逻辑处理代码" class="headerlink" title="2.3.2 逻辑处理代码"></a>2.3.2 逻辑处理代码</h4><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> __name__ == <span class="string">"__main__"</span>:</span><br><span class="line"></span><br><span class="line"> <span class="keyword">try</span>:</span><br><span class="line"> print(<span class="string">"【===百度网盘链接有效性自动判别程序===】\n"</span>)</span><br><span class="line"> print(<span class="string">" * 联系方式\n 1.https://www.ganahe.top/ \n 2.合作微信公众号:星辰换日\n"</span>)</span><br><span class="line"> <span class="comment"># 读取CSV文档</span></span><br><span class="line"> filePath = input(<span class="string">" 请输入文件路径(示例:E:\\百度\\Link.csv):"</span>)</span><br><span class="line"> sourceList = []</span><br><span class="line"> <span class="keyword">with</span> open(filePath, <span class="string">"r"</span>, encoding=<span class="string">"utf8"</span>) <span class="keyword">as</span> F:</span><br><span class="line"> <span class="keyword">for</span> line <span class="keyword">in</span> F:</span><br><span class="line"> <span class="comment"># print(line)</span></span><br><span class="line"> sourceList.append(line.split(<span class="string">","</span>))</span><br><span class="line"></span><br><span class="line"> <span class="keyword">with</span> open(os.path.dirname(filePath) + <span class="string">"resultLink.csv"</span>, <span class="string">"w"</span>,newline= <span class="string">""</span>, encoding=<span class="string">"utf8"</span>) <span class="keyword">as</span> S:</span><br><span class="line"> writer = csv.writer(S)</span><br><span class="line"> head = sourceList[<span class="number">0</span>]</span><br><span class="line"> head.append(<span class="string">"有效性"</span>)</span><br><span class="line"> print(head)</span><br><span class="line"> writer.writerow(head)</span><br><span class="line"> <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">1</span>, len(sourceList)):</span><br><span class="line"> line = sourceList[i]</span><br><span class="line"> link = line[<span class="number">1</span>]</span><br><span class="line"> print(<span class="string">"\n ------- 第"</span>+str(i)+<span class="string">"个链接情况:"</span>,sourceList[i])</span><br><span class="line"> just = BaiduNetdisk().anylies(link)</span><br><span class="line"> <span class="keyword">if</span> just <span class="keyword">is</span> <span class="literal">True</span>:</span><br><span class="line"> line.append(<span class="string">"有效"</span>)</span><br><span class="line"> <span class="keyword">else</span>:</span><br><span class="line"> line.append(<span class="string">"链接无效"</span>)</span><br><span class="line"> writer.writerow(line)</span><br><span class="line"> </span><br><span class="line"> print(<span class="string">"\n-- 结束,所有链接均已分析完成,请打开resultLink.csv查看"</span>)</span><br><span class="line"> time.sleep(<span class="number">600</span>)</span><br><span class="line"></span><br><span class="line"> <span class="keyword">except</span> Exception <span class="keyword">as</span> e:</span><br><span class="line"> print(<span class="string">"异常错误-301:"</span>, e.__str__())</span><br></pre></td></tr></table></figure><h2 id="三-测试结果"><a href="#三-测试结果" class="headerlink" title="(三) 测试结果"></a>(三) 测试结果</h2><h3 id="3-1-使用方式"><a href="#3-1-使用方式" class="headerlink" title="3.1 使用方式"></a>3.1 使用方式</h3><p>如果 csv 文件与<strong>检测代码文件</strong>(baiduNetdisk.py,需要python编译环境)或<strong>程序</strong>(baiduNetdisk.exe,可以在window平台直接执行)<strong>在同一文件夹目录下</strong>:<br><img data-src="https://img-blog.csdnimg.cn/20200512175520288.png#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/2020051217564120.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>可以直接输入文件名[.后缀文件类型]即可。</p><p>GIF 展示如下:<br><img data-src="https://img-blog.csdnimg.cn/20200512180004686.gif" alt><br>如果不在同一文件夹目录下需要输入绝对路径:<br><img data-src="https://img-blog.csdnimg.cn/2020051218040043.gif" alt></p><h3 id="3-2-输出结果"><a href="#3-2-输出结果" class="headerlink" title="3.2 输出结果"></a>3.2 输出结果</h3><p><img data-src="https://img-blog.csdnimg.cn/20200512180433947.png#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/20200512181828407.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>由于大多链接已失效,为了验证是否可以检测出有效链接,特定在末尾加上有效的链接进行测试:<br><img data-src="https://img-blog.csdnimg.cn/20200512182105883.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt><br>可以发现,有效性得到检验。</p><h2 id="(四)获取程序或源代码方式"><a href="#(四)获取程序或源代码方式" class="headerlink" title="(四)获取程序或源代码方式"></a>(四)获取程序或源代码方式</h2><h3 id="4-1-Github"><a href="#4-1-Github" class="headerlink" title="4.1 Github"></a>4.1 <a href="https://github.com/GanAH/baiduNetdisk" target="_blank" rel="noopener">Github</a></h3><h3 id="4-2-网盘"><a href="#4-2-网盘" class="headerlink" title="4.2 网盘"></a>4.2 <a href="https://pan.baidu.com/s/1CXHlUtWmOH2LXxgYi-Q_CA" target="_blank" rel="noopener">网盘</a></h3><p>点击标题进入下载页面,下载密码的获取方式如下:<a href="https://mp.weixin.qq.com/s?__biz=MzUxNDkyMTQ1Nw==&mid=2247484598&idx=1&sn=42a3ce5d49979ecafefee7af427c0b24&chksm=f9bfc228cec84b3e01e812451b79325270b50d9010742e34664d7de33cdb7de4fc7a7c6fc614&token=5754633&lang=zh_CN#rd" target="_blank" rel="noopener">点击</a></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/d5641092.html#disqus_thread</comments>
</item>
<item>
<title>python代码编写小技巧————代码批量缩进</title>
<link>https://www.ganahe.top/archives/da7f3974.html</link>
<guid>https://www.ganahe.top/archives/da7f3974.html</guid>
<pubDate>Thu, 23 Apr 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="python代码编写小技巧————代码批量缩进"><a href="#python代码编写小技巧————代码批量缩进" class="headerlink" title="python代码编写小技巧————代码批量缩进"></a>python代码编写小技巧————代码批量缩进</h1><h2 id="在python语言中,初学者最难以忍受的莫过于难以捉摸的代码缩进量及对齐问题,不同的代码缩进量代码代表着python代码所属的代码块(范围),需要批量处理的时候,该怎么操作呢?"><a href="#在python语言中,初学者最难以忍受的莫过于难以捉摸的代码缩进量及对齐问题,不同的代码缩进量代码代表着python代码所属的代码块(范围),需要批量处理的时候,该怎么操作呢?" class="headerlink" title="在python语言中,初学者最难以忍受的莫过于难以捉摸的代码缩进量及对齐问题,不同的代码缩进量代码代表着python代码所属的代码块(范围),需要批量处理的时候,该怎么操作呢?"></a>在python语言中,初学者最难以忍受的莫过于难以捉摸的代码缩进量及对齐问题,不同的代码缩进量代码代表着python代码所属的代码块(范围),需要批量处理的时候,该怎么操作呢?</h2><p>本次主要针对已编辑好了的代码,在其中插入新的代码块,对剩余代码进行批量缩进以及注释操作。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="python代码编写小技巧————代码批量缩进"><a href="#python代码编写小技巧————代码批量缩进" class="headerlink" title="python代码编写小技巧————代码批量缩进"></a>python代码编写小技巧————代码批量缩进</h1><h2 id="在python语言中,初学者最难以忍受的莫过于难以捉摸的代码缩进量及对齐问题,不同的代码缩进量代码代表着python代码所属的代码块(范围),需要批量处理的时候,该怎么操作呢?"><a href="#在python语言中,初学者最难以忍受的莫过于难以捉摸的代码缩进量及对齐问题,不同的代码缩进量代码代表着python代码所属的代码块(范围),需要批量处理的时候,该怎么操作呢?" class="headerlink" title="在python语言中,初学者最难以忍受的莫过于难以捉摸的代码缩进量及对齐问题,不同的代码缩进量代码代表着python代码所属的代码块(范围),需要批量处理的时候,该怎么操作呢?"></a>在python语言中,初学者最难以忍受的莫过于难以捉摸的代码缩进量及对齐问题,不同的代码缩进量代码代表着python代码所属的代码块(范围),需要批量处理的时候,该怎么操作呢?</h2><p>本次主要针对已编辑好了的代码,在其中插入新的代码块,对剩余代码进行批量缩进以及注释操作。</p><a id="more"></a><h3 id="(一)示例代码片段"><a href="#(一)示例代码片段" class="headerlink" title="(一)示例代码片段"></a>(一)示例代码片段</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">staLocation</span><span class="params">(sourceArrayStrCoor)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> :param sourceArrayStrCoor: 传入的未处理原始字符数据</span></span><br><span class="line"><span class="string"> :return: para:已处理的结果数据</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"></span><br><span class="line"> print(sourceArrayStrCoor[<span class="number">3</span>])</span><br><span class="line"> print(<span class="string">"分隔测试"</span>)</span><br><span class="line"> <span class="comment">#过滤字符串左右的所有空格</span></span><br><span class="line"> print(re.split(<span class="string">'[\s]'</span>, sourceArrayStrCoor[<span class="number">3</span>].strip()))</span><br><span class="line"> <span class="comment">#处理非空格(负号)连接问题</span></span><br><span class="line"> rth = re.split(<span class="string">'[\s]'</span>, sourceArrayStrCoor[<span class="number">3</span>].strip())</span><br><span class="line"> <span class="comment"># 遍历结果,根据连接处为“-”来判断</span></span><br><span class="line"> <span class="keyword">for</span> i <span class="keyword">in</span> range(len(rth)):</span><br><span class="line"> <span class="comment"># 出现单负号连接情况,负号都是从第二个开始</span></span><br><span class="line"> <span class="keyword">if</span> <span class="number">19</span> < len(rth[i]) < <span class="number">58</span>:</span><br><span class="line"> <span class="keyword">pass</span></span><br></pre></td></tr></table></figure><p>主函数调用输出:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"> 0.792000000000E+05 0.391155481338E-07 0.306778842479E+01-0.856816768646E-07</span><br><span class="line"> </span><br><span class="line">分隔测试</span><br><span class="line">[<span class="string">'0.792000000000E+05'</span>, <span class="string">'0.391155481338E-07'</span>, <span class="string">'0.306778842479E+01-0.856816768646E-07'</span>]</span><br></pre></td></tr></table></figure><h3 id="(二)目标:在最开始加入循环for语句,实现多条数据处理"><a href="#(二)目标:在最开始加入循环for语句,实现多条数据处理" class="headerlink" title="(二)目标:在最开始加入循环for语句,实现多条数据处理"></a>(二)目标:在最开始加入循环for语句,实现多条数据处理</h3><p><img data-src="https://img-blog.csdnimg.cn/20190927201424874.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>==问题==:<strong>此时我们发现,加入后的代码块归属已经发生了改变,for之后的代码都归属于for循环,应该统一缩进字符。<br>但是代码过多我们要一个个去调整对齐吗?</strong></p><h3 id="(三)解决方案:批量缩进"><a href="#(三)解决方案:批量缩进" class="headerlink" title="(三)解决方案:批量缩进"></a>(三)解决方案:批量缩进</h3><h5 id="快捷键-:Tab-缩进,Shift-Tab-反向缩进"><a href="#快捷键-:Tab-缩进,Shift-Tab-反向缩进" class="headerlink" title="==快捷键==:Tab 缩进,Shift Tab 反向缩进"></a>==快捷键==:Tab 缩进,Shift Tab 反向缩进</h5><h4 id="3-1-选中需要缩进的代码区域,点击-Tab-即可;"><a href="#3-1-选中需要缩进的代码区域,点击-Tab-即可;" class="headerlink" title="3.1 选中需要缩进的代码区域,点击 Tab 即可;"></a>3.1 选中需要缩进的代码区域,点击 Tab 即可;</h4><p><img data-src="https://img-blog.csdnimg.cn/20190927201749581.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="3-2-效果"><a href="#3-2-效果" class="headerlink" title="3.2 效果"></a>3.2 效果</h4><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">5</span>):</span><br><span class="line"> print(sourceArrayStrCoor[<span class="number">3</span>])</span><br><span class="line"> print(<span class="string">"分隔测试"</span>)</span><br><span class="line"> <span class="comment">#过滤字符串左右的所有空格</span></span><br><span class="line"> print(re.split(<span class="string">'[\s]'</span>, sourceArrayStrCoor[<span class="number">3</span>].strip()))</span><br><span class="line"> <span class="comment">#处理非空格(负号)连接问题</span></span><br><span class="line"> rth = re.split(<span class="string">'[\s]'</span>, sourceArrayStrCoor[<span class="number">3</span>].strip())</span><br><span class="line"> <span class="comment"># 遍历结果,根据连接处为“-”来判断</span></span><br><span class="line"> <span class="keyword">for</span> i <span class="keyword">in</span> range(len(rth)):</span><br><span class="line"> <span class="comment"># 出现单负号连接情况,负号都是从第二个开始</span></span><br><span class="line"> <span class="keyword">if</span> <span class="number">19</span> < len(rth[i]) < <span class="number">58</span>:</span><br><span class="line"> <span class="keyword">pass</span></span><br></pre></td></tr></table></figure><h4 id="3-3-主函数调用结果"><a href="#3-3-主函数调用结果" class="headerlink" title="3.3 主函数调用结果"></a>3.3 主函数调用结果</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">12 10 6 20 22 0 0.0-0.101987272501E-03 0.409272615798E-11 0.000000000000E+00</span><br><span class="line"></span><br><span class="line">分隔测试</span><br><span class="line">['12', '10', '', '6', '20', '22', '', '0', '', '0.0-0.101987272501E-03', '0.409272615798E-11', '0.000000000000E+00']</span><br><span class="line"></span><br><span class="line"> 0.380000000000E+02-0.481250000000E+01 0.461804950315E-08-0.139801880836E+01</span><br><span class="line"></span><br><span class="line">分隔测试</span><br><span class="line">['0.380000000000E+02-0.481250000000E+01', '0.461804950315E-08-0.139801880836E+01']</span><br><span class="line"></span><br><span class="line"> -0.188127160072E-06 0.349152914714E-02 0.719912350178E-05 0.515366796684E+04</span><br><span class="line"></span><br><span class="line">分隔测试</span><br><span class="line">['-0.188127160072E-06', '0.349152914714E-02', '0.719912350178E-05', '0.515366796684E+04']</span><br><span class="line"></span><br><span class="line"> 0.792000000000E+05 0.391155481338E-07 0.306778842479E+01-0.856816768646E-07</span><br><span class="line"></span><br><span class="line">分隔测试</span><br><span class="line">['0.792000000000E+05', '0.391155481338E-07', '0.306778842479E+01-0.856816768646E-07']</span><br><span class="line"></span><br><span class="line"> 0.971417938748E+00 0.245656250000E+03-0.405309810049E+00-0.809212278368E-08</span><br><span class="line"></span><br><span class="line">分隔测试</span><br><span class="line">['0.971417938748E+00', '0.245656250000E+03-0.405309810049E+00-0.809212278368E-08']</span><br></pre></td></tr></table></figure><h4 id="3-4-反向缩进测试-选中需要缩进的区域,按住-Shift-Tab"><a href="#3-4-反向缩进测试-选中需要缩进的区域,按住-Shift-Tab" class="headerlink" title="3.4 反向缩进测试:选中需要缩进的区域,按住 Shift + Tab"></a>3.4 反向缩进测试:选中需要缩进的区域,按住 Shift + Tab</h4><p><img data-src="https://img-blog.csdnimg.cn/20190927202219322.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="假如需要注释掉大量代码段(不删除),该怎么操作呢?"><a href="#假如需要注释掉大量代码段(不删除),该怎么操作呢?" class="headerlink" title="==假如需要注释掉大量代码段(不删除),该怎么操作呢?=="></a>==假如需要注释掉大量代码段(不删除),该怎么操作呢?==</h4><h3 id="(四)快捷键-Ctrl"><a href="#(四)快捷键-Ctrl" class="headerlink" title="(四)快捷键 Ctrl + /"></a>(四)快捷键 Ctrl + /</h3><p>选中并按以上组合快捷键即可。</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">for i in range(5):</span><br><span class="line"> # print(sourceArrayStrCoor[i])</span><br><span class="line"> # print("分隔测试")</span><br><span class="line"> # #过滤字符串左右的所有空格</span><br><span class="line"> # print(re.split('[\s]', sourceArrayStrCoor[i].strip()))</span><br><span class="line"> # #处理非空格(负号)连接问题</span><br><span class="line"> # rth = re.split('[\s]', sourceArrayStrCoor[i].strip())</span><br><span class="line"> # # 遍历结果,根据连接处为“-”来判断</span><br><span class="line"> # for i in range(len(rth)):</span><br><span class="line"> # # 出现单负号连接情况,负号都是从第二个开始</span><br><span class="line"> # if 19 < len(rth[i]) < 58:</span><br><span class="line"> pass</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20190927203327986.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="五-更多内容"><a href="#五-更多内容" class="headerlink" title="(五) 更多内容"></a>(五) 更多内容</h3><p><img data-src="https://img-blog.csdnimg.cn/20190927203442574.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/da7f3974.html#disqus_thread</comments>
</item>
<item>
<title>在 Windows 10实现类似 Linux 在指定的当前文件目录下进入命令终端(DOS,window power shell)</title>
<link>https://www.ganahe.top/archives/836e08d9.html</link>
<guid>https://www.ganahe.top/archives/836e08d9.html</guid>
<pubDate>Thu, 23 Apr 2020 03:44:42 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="在-Windows-10实现类似-Linux-在指定的当前文件目录下进入命令终端(DOS,window-power-shell)"><a href="#在-Windows-10实现类似-Linux-在指定的当前文件目录下进入命令终端(DOS,window-power-shell)" class="headerlink" title="在 Windows 10实现类似 Linux 在指定的当前文件目录下进入命令终端(DOS,window power shell)"></a>在 Windows 10实现类似 Linux 在指定的当前文件目录下进入命令终端(DOS,window power shell)</h1><h5 id="在Linux中需要用到终端时,对于初学者而言找到目录右键进入-terminal-简直不要太方便,而在-Windows-10-就比较麻烦,必须要从家目录出发用-cd-命令进入,那有什么比较快捷的方式呢?"><a href="#在Linux中需要用到终端时,对于初学者而言找到目录右键进入-terminal-简直不要太方便,而在-Windows-10-就比较麻烦,必须要从家目录出发用-cd-命令进入,那有什么比较快捷的方式呢?" class="headerlink" title="在Linux中需要用到终端时,对于初学者而言找到目录右键进入 terminal 简直不要太方便,而在 Windows 10 就比较麻烦,必须要从家目录出发用 cd 命令进入,那有什么比较快捷的方式呢?"></a>在Linux中需要用到终端时,对于初学者而言找到目录右键进入 terminal 简直不要太方便,而在 Windows 10 就比较麻烦,必须要从家目录出发用 cd 命令进入,那有什么比较快捷的方式呢?</h5><h3 id="最为简单的方法:快捷键-Shift-右键"><a href="#最为简单的方法:快捷键-Shift-右键" class="headerlink" title="最为简单的方法:快捷键 Shift + 右键"></a>最为简单的方法:快捷键 Shift + 右键</h3>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="在-Windows-10实现类似-Linux-在指定的当前文件目录下进入命令终端(DOS,window-power-shell)"><a href="#在-Windows-10实现类似-Linux-在指定的当前文件目录下进入命令终端(DOS,window-power-shell)" class="headerlink" title="在 Windows 10实现类似 Linux 在指定的当前文件目录下进入命令终端(DOS,window power shell)"></a>在 Windows 10实现类似 Linux 在指定的当前文件目录下进入命令终端(DOS,window power shell)</h1><h5 id="在Linux中需要用到终端时,对于初学者而言找到目录右键进入-terminal-简直不要太方便,而在-Windows-10-就比较麻烦,必须要从家目录出发用-cd-命令进入,那有什么比较快捷的方式呢?"><a href="#在Linux中需要用到终端时,对于初学者而言找到目录右键进入-terminal-简直不要太方便,而在-Windows-10-就比较麻烦,必须要从家目录出发用-cd-命令进入,那有什么比较快捷的方式呢?" class="headerlink" title="在Linux中需要用到终端时,对于初学者而言找到目录右键进入 terminal 简直不要太方便,而在 Windows 10 就比较麻烦,必须要从家目录出发用 cd 命令进入,那有什么比较快捷的方式呢?"></a>在Linux中需要用到终端时,对于初学者而言找到目录右键进入 terminal 简直不要太方便,而在 Windows 10 就比较麻烦,必须要从家目录出发用 cd 命令进入,那有什么比较快捷的方式呢?</h5><h3 id="最为简单的方法:快捷键-Shift-右键"><a href="#最为简单的方法:快捷键-Shift-右键" class="headerlink" title="最为简单的方法:快捷键 Shift + 右键"></a>最为简单的方法:快捷键 Shift + 右键</h3><a id="more"></a><h3 id="演示:"><a href="#演示:" class="headerlink" title="==演示:=="></a>==演示:==</h3><h4 id="(一)常规不带快捷键:直接在目录下右键"><a href="#(一)常规不带快捷键:直接在目录下右键" class="headerlink" title="(一)常规不带快捷键:直接在目录下右键"></a>(一)常规不带快捷键:直接在目录下右键</h4><p>没有直接进入的选项:<img data-src="https://img-blog.csdnimg.cn/20191005145652438.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="(二)带快捷键再右键(快捷键-Shift-右键)"><a href="#(二)带快捷键再右键(快捷键-Shift-右键)" class="headerlink" title="(二)带快捷键再右键(快捷键 Shift + 右键)"></a>(二)带快捷键再右键(快捷键 Shift + 右键)</h4><p><img data-src="https://img-blog.csdnimg.cn/20191005145912345.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="2-1-打开效果"><a href="#2-1-打开效果" class="headerlink" title="2.1 打开效果"></a>2.1 打开效果</h4><p><img data-src="https://img-blog.csdnimg.cn/2019100515001111.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="2-2-python命令测试:正常"><a href="#2-2-python命令测试:正常" class="headerlink" title="2.2 python命令测试:正常"></a>2.2 python命令测试:正常</h4><p><img data-src="https://img-blog.csdnimg.cn/20191005150033458.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="2-3-运行脚本测试:正常"><a href="#2-3-运行脚本测试:正常" class="headerlink" title="2.3 运行脚本测试:正常"></a>2.3 运行脚本测试:正常</h4><h5 id="2-3-1-脚本源代码"><a href="#2-3-1-脚本源代码" class="headerlink" title="2.3.1 脚本源代码"></a>2.3.1 脚本源代码</h5><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"></span><br><span class="line">x=np.linspace(<span class="number">-5</span>,<span class="number">5</span>,<span class="number">1000</span>) <span class="comment">#这个表示在-5到5之间生成1000个x值</span></span><br><span class="line"></span><br><span class="line">y=[<span class="number">1</span>/(<span class="number">1</span>+np.exp(-i)) <span class="keyword">for</span> i <span class="keyword">in</span> x] <span class="comment">#对上述生成的1000个数循环用sigmoid公式求对应的y</span></span><br><span class="line"></span><br><span class="line">plt.plot(x,y) <span class="comment">#用上述生成的1000个xy值对生成1000个点</span></span><br><span class="line"></span><br><span class="line">plt.show() <span class="comment">#绘制图像</span></span><br></pre></td></tr></table></figure><h5 id="2-3-1-结果"><a href="#2-3-1-结果" class="headerlink" title="2.3.1 结果"></a>2.3.1 结果</h5><p><img data-src="https://img-blog.csdnimg.cn/20191005150243142.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="更多资讯与资源(教程,软件等)请关注:"><a href="#更多资讯与资源(教程,软件等)请关注:" class="headerlink" title="更多资讯与资源(教程,软件等)请关注:"></a>更多资讯与资源(教程,软件等)请关注:</h2><p><img data-src="https://img-blog.csdnimg.cn/20191005150349451.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/836e08d9.html#disqus_thread</comments>
</item>
<item>
<title>在Pychram中配置PyUIC5时文件路径说明与设置</title>
<link>https://www.ganahe.top/archives/da8afc03.html</link>
<guid>https://www.ganahe.top/archives/da8afc03.html</guid>
<pubDate>Thu, 23 Apr 2020 03:10:42 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h3 id="近期需要使用PyQT5开发GUI界面,用到了QtDesigner生成-ui文件,但是在配置PyUIC时遇到了问题,找了十几个教程都没有说清楚,以下自身经历,写下总结。"><a href="#近期需要使用PyQT5开发GUI界面,用到了QtDesigner生成-ui文件,但是在配置PyUIC时遇到了问题,找了十几个教程都没有说清楚,以下自身经历,写下总结。" class="headerlink" title="近期需要使用PyQT5开发GUI界面,用到了QtDesigner生成.ui文件,但是在配置PyUIC时遇到了问题,找了十几个教程都没有说清楚,以下自身经历,写下总结。"></a>近期需要使用PyQT5开发GUI界面,用到了QtDesigner生成.ui文件,但是在配置PyUIC时遇到了问题,找了十几个教程都没有说清楚,以下自身经历,写下总结。</h3><h4 id="基本配置说明"><a href="#基本配置说明" class="headerlink" title="基本配置说明"></a>基本配置说明</h4><p>Program的设置是python目录下的Script下的pyuic5.exe<br>参数设定为:$FileName$ -o $FileNameWithoutExtension$.py</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h3 id="近期需要使用PyQT5开发GUI界面,用到了QtDesigner生成-ui文件,但是在配置PyUIC时遇到了问题,找了十几个教程都没有说清楚,以下自身经历,写下总结。"><a href="#近期需要使用PyQT5开发GUI界面,用到了QtDesigner生成-ui文件,但是在配置PyUIC时遇到了问题,找了十几个教程都没有说清楚,以下自身经历,写下总结。" class="headerlink" title="近期需要使用PyQT5开发GUI界面,用到了QtDesigner生成.ui文件,但是在配置PyUIC时遇到了问题,找了十几个教程都没有说清楚,以下自身经历,写下总结。"></a>近期需要使用PyQT5开发GUI界面,用到了QtDesigner生成.ui文件,但是在配置PyUIC时遇到了问题,找了十几个教程都没有说清楚,以下自身经历,写下总结。</h3><h4 id="基本配置说明"><a href="#基本配置说明" class="headerlink" title="基本配置说明"></a>基本配置说明</h4><p>Program的设置是python目录下的Script下的pyuic5.exe<br>参数设定为:$FileName$ -o $FileNameWithoutExtension$.py</p><a id="more"></a><h4 id="文件路径设定"><a href="#文件路径设定" class="headerlink" title="文件路径设定"></a>文件路径设定</h4><h5 id="将当前-ui文件生成-py到当前目录"><a href="#将当前-ui文件生成-py到当前目录" class="headerlink" title="将当前.ui文件生成.py到当前目录"></a>将当前.ui文件生成.py到当前目录</h5><p>设定:$ $FileDir$ $<br><img data-src="https://img-blog.csdnimg.cn/20190917104850501.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>效果如下:<br><img data-src="https://img-blog.csdnimg.cn/20190917105310660.png" alt="在这里插入图片描述"><br>生成的代码如下:</p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Form implementation generated from reading ui file 'window.ui'</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># Created by: PyQt5 UI code generator 5.13.0</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># WARNING! All changes made in this file will be lost!</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">from</span> PyQt5 <span class="keyword">import</span> QtCore, QtGui, QtWidgets</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Ui_MainWindow</span><span class="params">(object)</span>:</span></span><br><span class="line"> <span class="function"><span class="keyword">def</span> <span class="title">setupUi</span><span class="params">(self, MainWindow)</span>:</span></span><br><span class="line"> MainWindow.setObjectName(<span class="string">"MainWindow"</span>)</span><br><span class="line"> MainWindow.resize(<span class="number">917</span>, <span class="number">546</span>)</span><br><span class="line"> self.centralwidget = QtWidgets.QWidget(MainWindow)</span><br><span class="line"> self.centralwidget.setObjectName(<span class="string">"centralwidget"</span>)</span><br><span class="line"> self.pushButton = QtWidgets.QPushButton(self.centralwidget)</span><br><span class="line"> self.pushButton.setGeometry(QtCore.QRect(<span class="number">100</span>, <span class="number">60</span>, <span class="number">93</span>, <span class="number">28</span>))</span><br><span class="line"> self.pushButton.setObjectName(<span class="string">"pushButton"</span>)</span><br><span class="line"> MainWindow.setCentralWidget(self.centralwidget)</span><br><span class="line"> self.menubar = QtWidgets.QMenuBar(MainWindow)</span><br><span class="line"> self.menubar.setGeometry(QtCore.QRect(<span class="number">0</span>, <span class="number">0</span>, <span class="number">917</span>, <span class="number">26</span>))</span><br><span class="line"> self.menubar.setObjectName(<span class="string">"menubar"</span>)</span><br><span class="line"> MainWindow.setMenuBar(self.menubar)</span><br><span class="line"> self.statusbar = QtWidgets.QStatusBar(MainWindow)</span><br><span class="line"> self.statusbar.setObjectName(<span class="string">"statusbar"</span>)</span><br><span class="line"> MainWindow.setStatusBar(self.statusbar)</span><br><span class="line"></span><br><span class="line"> self.retranslateUi(MainWindow)</span><br><span class="line"> QtCore.QMetaObject.connectSlotsByName(MainWindow)</span><br><span class="line"></span><br><span class="line"> <span class="function"><span class="keyword">def</span> <span class="title">retranslateUi</span><span class="params">(self, MainWindow)</span>:</span></span><br><span class="line"> _translate = QtCore.QCoreApplication.translate</span><br><span class="line"> MainWindow.setWindowTitle(_translate(<span class="string">"MainWindow"</span>, <span class="string">"MainWindow"</span>))</span><br><span class="line"> self.pushButton.setText(_translate(<span class="string">"MainWindow"</span>, <span class="string">"阿牛点击它"</span>))</span><br></pre></td></tr></table></figure><h5 id="将当前-ui文件生成-py到项目主目录"><a href="#将当前-ui文件生成-py到项目主目录" class="headerlink" title="将当前.ui文件生成.py到项目主目录"></a>将当前.ui文件生成.py到项目主目录</h5><p>路径: $$ProjectFileDir$ $</p><p><img data-src="https://img-blog.csdnimg.cn/20190917110156647.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><p>这时你会发现生成的文件跑到了项目主目录下:<br><img data-src="https://img-blog.csdnimg.cn/20190917105950116.png" alt="在这里插入图片描述"><br>同时警告:<br><img data-src="https://img-blog.csdnimg.cn/20190917110039741.png" alt="在这里插入图片描述"><br>同时文件错误,没有py代码:<br><img data-src="https://img-blog.csdnimg.cn/20190917110110397.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h3 id="更多资讯,关注:"><a href="#更多资讯,关注:" class="headerlink" title="更多资讯,关注:"></a>更多资讯,关注:</h3><p><img data-src="https://img-blog.csdnimg.cn/20190926105753707.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/da8afc03.html#disqus_thread</comments>
</item>
<item>
<title>python从bytes转到str转码输出问题</title>
<link>https://www.ganahe.top/archives/ba256ea6.html</link>
<guid>https://www.ganahe.top/archives/ba256ea6.html</guid>
<pubDate>Thu, 23 Apr 2020 02:55:42 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="python从bytes转到str转码输出问题"><a href="#python从bytes转到str转码输出问题" class="headerlink" title="python从bytes转到str转码输出问题"></a>python从bytes转到str转码输出问题</h1><h3 id="python从bytes转到str"><a href="#python从bytes转到str" class="headerlink" title="python从bytes转到str"></a>python从bytes转到str</h3><p>使用以下代码测试urllib库的urlopen()方法时,发现输出的为bytes类型:</p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> urllib.request</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">"__main__"</span>:</span><br><span class="line"> data = bytes(urllib.parse.urlencode(&#123;<span class="string">'word'</span>: <span class="string">'hello GanAH'</span>&#125;), encoding=<span class="string">'UTF-8'</span>)</span><br><span class="line"> respose2 = urllib.request.urlopen(<span class="string">"http://httpbin.org/post"</span>, data=data)</span><br><span class="line"></span><br><span class="line"> print((respose2.read()))</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/2019091919194786.png" alt></p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="python从bytes转到str转码输出问题"><a href="#python从bytes转到str转码输出问题" class="headerlink" title="python从bytes转到str转码输出问题"></a>python从bytes转到str转码输出问题</h1><h3 id="python从bytes转到str"><a href="#python从bytes转到str" class="headerlink" title="python从bytes转到str"></a>python从bytes转到str</h3><p>使用以下代码测试urllib库的urlopen()方法时,发现输出的为bytes类型:</p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> urllib.request</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">"__main__"</span>:</span><br><span class="line"> data = bytes(urllib.parse.urlencode({<span class="string">'word'</span>: <span class="string">'hello GanAH'</span>}), encoding=<span class="string">'UTF-8'</span>)</span><br><span class="line"> respose2 = urllib.request.urlopen(<span class="string">"http://httpbin.org/post"</span>, data=data)</span><br><span class="line"></span><br><span class="line"> print((respose2.read()))</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/2019091919194786.png" alt></p><a id="more"></a><p>比较长,影响阅读分析</p><h3 id="对结果转码输出:-decode-‘utf-8’"><a href="#对结果转码输出:-decode-‘utf-8’" class="headerlink" title="对结果转码输出:.decode(‘utf-8’)"></a>对结果转码输出:.decode(‘utf-8’)</h3><p>源代码中更改如下:</p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">print((respose2.read()).decode(<span class="string">'utf-8'</span>))</span><br></pre></td></tr></table></figure><h5 id="更改后的输出结果:"><a href="#更改后的输出结果:" class="headerlink" title="更改后的输出结果:"></a>更改后的输出结果:</h5><p><img data-src="https://img-blog.csdnimg.cn/20190919192141345.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt></p><h5 id="如需要回转则decode改成encode即可。"><a href="#如需要回转则decode改成encode即可。" class="headerlink" title="如需要回转则decode改成encode即可。"></a>如需要回转则decode改成encode即可。</h5><p>更多内容请关注:<br><img data-src="https://img-blog.csdnimg.cn/20190919192230504.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/ba256ea6.html#disqus_thread</comments>
</item>
<item>
<title>PyQt5打包成exe文件,运行弹窗出现 failed to execute script main使用--hidden-import=queue解决后仍失败的新方法</title>
<link>https://www.ganahe.top/archives/bb821c79.html</link>
<guid>https://www.ganahe.top/archives/bb821c79.html</guid>
<pubDate>Thu, 23 Apr 2020 02:51:42 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="PyQt5打包成exe文件,运行弹窗出现-failed-to-execute-script-main使用–hidden-import-queue解决后仍失败的新方法"><a href="#PyQt5打包成exe文件,运行弹窗出现-failed-to-execute-script-main使用–hidden-import-queue解决后仍失败的新方法" class="headerlink" title="PyQt5打包成exe文件,运行弹窗出现 failed to execute script main使用–hidden-import=queue解决后仍失败的新方法"></a>PyQt5打包成exe文件,运行弹窗出现 failed to execute script main使用–hidden-import=queue解决后仍失败的新方法</h1><p>在打包pyqt5写的GUI界面程序时一直失败(经过pyinstaller打包成单个文件),有以下错误提示:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"> WARNING: was placed previously at</span><br><span class="line">14831 WARNING: (&#39;PyQt5\\Qt\\bin\\libGLESv2.dll&#39;,</span><br><span class="line"> &#39;D:\\program &#39;</span><br><span class="line"> &#39;files\\python37\\lib\\site-packages\\PyQt5\\Qt\\bin\\libGLESv2.dll&#39;,</span><br><span class="line"> &#39;BINARY&#39;)</span><br></pre></td></tr></table></figure><p>同时运行exe文件时,弹出错误提示框:failed to execute script main<br><img data-src="https://img-blog.csdnimg.cn/20191003103940319.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="PyQt5打包成exe文件,运行弹窗出现-failed-to-execute-script-main使用–hidden-import-queue解决后仍失败的新方法"><a href="#PyQt5打包成exe文件,运行弹窗出现-failed-to-execute-script-main使用–hidden-import-queue解决后仍失败的新方法" class="headerlink" title="PyQt5打包成exe文件,运行弹窗出现 failed to execute script main使用–hidden-import=queue解决后仍失败的新方法"></a>PyQt5打包成exe文件,运行弹窗出现 failed to execute script main使用–hidden-import=queue解决后仍失败的新方法</h1><p>在打包pyqt5写的GUI界面程序时一直失败(经过pyinstaller打包成单个文件),有以下错误提示:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"> WARNING: was placed previously at</span><br><span class="line">14831 WARNING: ('PyQt5\\Qt\\bin\\libGLESv2.dll',</span><br><span class="line"> 'D:\\program '</span><br><span class="line"> 'files\\python37\\lib\\site-packages\\PyQt5\\Qt\\bin\\libGLESv2.dll',</span><br><span class="line"> 'BINARY')</span><br></pre></td></tr></table></figure><p>同时运行exe文件时,弹出错误提示框:failed to execute script main<br><img data-src="https://img-blog.csdnimg.cn/20191003103940319.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><a id="more"></a><h2 id="(一)解决办法一:打包命令附带–hidden-import-queue"><a href="#(一)解决办法一:打包命令附带–hidden-import-queue" class="headerlink" title="(一)解决办法一:打包命令附带–hidden-import=queue"></a>(一)解决办法一:打包命令附带–hidden-import=queue</h2><p>打包时加上 –hidden-import=queue<br>即Parameters配置修改为:<br>Parameters:–hidden-import=queue -w -F $FileName$</p><p>命令行打包示例:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">pyinstaller --hidden-import=queue -w -F main.py</span><br><span class="line"></span><br><span class="line">或 </span><br><span class="line"></span><br><span class="line">pyinstaller.exe -w -F --hidden-import=queue main.py</span><br></pre></td></tr></table></figure><p>打包结果生成:<br><img data-src="https://img-blog.csdnimg.cn/20191003104815205.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>==注意:== <strong>打包生成的exe文件是在dist文件夹下,由于项目中有文件目录用到项目的相对路径,同时为了演示,以上图片中dist外面的.exe文件为本人拷贝出来的。</strong></p><p>此时一般就可以打包完成了。</p><p><img data-src="https://img-blog.csdnimg.cn/20191003105426593.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="(二)仍然弹窗-failed-to-execute-script-main?(亲身经历,不堪回首…-)"><a href="#(二)仍然弹窗-failed-to-execute-script-main?(亲身经历,不堪回首…-)" class="headerlink" title="(二)仍然弹窗 failed to execute script main?(亲身经历,不堪回首….)"></a>(二)仍然弹窗 failed to execute script main?(亲身经历,不堪回首….)</h2><p>在main.py文件中,构建显示窗体GUI界面时,加入如下代码:</p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> sys,os</span><br><span class="line"><span class="comment">#注意就是下面的 if 语句</span></span><br><span class="line"><span class="keyword">if</span> hasattr(sys, <span class="string">'frozen'</span>):</span><br><span class="line"> os.environ[<span class="string">'PATH'</span>] = sys._MEIPASS + <span class="string">";"</span> + os.environ[<span class="string">'PATH'</span>]</span><br><span class="line"></span><br><span class="line"><span class="comment"># import others</span></span><br></pre></td></tr></table></figure><p>再次重复第一次步骤打包即可。</p><p>最后效果:<br><img data-src="https://img-blog.csdnimg.cn/20190930213527372.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="(三-使用Pychram一键快捷打包-exe文件"><a href="#(三-使用Pychram一键快捷打包-exe文件" class="headerlink" title="(三) 使用Pychram一键快捷打包.exe文件"></a>(三) 使用Pychram一键快捷打包.exe文件</h2><p>Pychram是重量级的python编辑器,可以配置相应的变量等实现在编辑器中写完代码即可打包,无需外部再cd定位文件再 pyinstaller命令打包。</p><p>相应步骤如下:</p><h3 id="3-1-打开:文件-设置"><a href="#3-1-打开:文件-设置" class="headerlink" title="3.1 打开:文件-设置"></a>3.1 打开:文件-设置</h3><p><img data-src="https://img-blog.csdnimg.cn/2019100311004071.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="3-2-定位到-工具-外部工具"><a href="#3-2-定位到-工具-外部工具" class="headerlink" title="3.2 定位到: 工具-外部工具"></a>3.2 定位到: 工具-外部工具</h3><p><img data-src="https://img-blog.csdnimg.cn/2019100311012815.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>注:此处出现的外部工具Pyinstaller即为本人已经做好的结果。</p><h3 id="3-3-左侧小绿加号添加操作"><a href="#3-3-左侧小绿加号添加操作" class="headerlink" title="3.3 左侧小绿加号添加操作"></a>3.3 左侧小绿加号添加操作</h3><p><img data-src="https://img-blog.csdnimg.cn/20191003110209817.png#pic_center" alt="在这里插入图片描述"></p><h3 id="3-4-给操作命名并进行相应的配置"><a href="#3-4-给操作命名并进行相应的配置" class="headerlink" title="3.4 给操作命名并进行相应的配置"></a>3.4 给操作命名并进行相应的配置</h3><p><img data-src="https://img-blog.csdnimg.cn/20191003110424529.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><strong>==参数说明:==</strong></p><ol><li>==<strong>程序:</strong>== 即下载的pyinstaller包内的pyinstaller.exe文件路径,一般使用pip命令下载位于python的安装目录下的Scripts文件夹下。</li><li>参数:在第一步骤说到的加入参数即这里可以自动配置:</li></ol><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-F -w --hidden-import=queue $FileNameWithoutExtension$.py</span><br></pre></td></tr></table></figure><ol start="3"><li>工作目录:推荐设定为</li></ol><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$FileDir$</span><br></pre></td></tr></table></figure><p>也可以设定为:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ProjectFileDir$</span><br></pre></td></tr></table></figure><p><strong>两者区别以及作用可参考该文章:</strong> <a href="https://blog.csdn.net/weixin_42646103/article/details/100919081" target="_blank" rel="noopener">在Pychram中配置PyUIC5时文件路径说明与设置</a></p><h3 id="3-5-保存-应用"><a href="#3-5-保存-应用" class="headerlink" title="3.5 保存-应用"></a>3.5 保存-应用</h3><p><img data-src="https://img-blog.csdnimg.cn/20191003111425950.png#pic_center" alt="在这里插入图片描述"><br>此时界面出现:<br><img data-src="https://img-blog.csdnimg.cn/20191003111442976.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20191003111503733.png#pic_center" alt="在这里插入图片描述"></p><h3 id="3-6-在项目中,点击需要打包的-py文件,右键找到刚刚命名的外部工具操作点击即可:"><a href="#3-6-在项目中,点击需要打包的-py文件,右键找到刚刚命名的外部工具操作点击即可:" class="headerlink" title="3.6 在项目中,点击需要打包的.py文件,右键找到刚刚命名的外部工具操作点击即可:"></a>3.6 在项目中,点击需要打包的.py文件,右键找到刚刚命名的外部工具操作点击即可:</h3><p><img data-src="https://img-blog.csdnimg.cn/20191003111531461.png#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/2019100311155251.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="(四)各类资源分享及交流"><a href="#(四)各类资源分享及交流" class="headerlink" title="(四)各类资源分享及交流"></a>(四)各类资源分享及交流</h2><p><img data-src="https://img-blog.csdnimg.cn/20191003111749429.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/bb821c79.html#disqus_thread</comments>
</item>
<item>
<title>Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序</title>
<link>https://www.ganahe.top/archives/3fb3689c.html</link>
<guid>https://www.ganahe.top/archives/3fb3689c.html</guid>
<pubDate>Thu, 23 Apr 2020 02:46:42 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序。"><a href="#Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序。" class="headerlink" title="Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序。"></a>Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序。</h2><dl><dt>Authors</dt><dd>GanAH</dd></dl><h4 id="近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:"><a href="#近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:" class="headerlink" title="近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:"></a>近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:</h4><ol><li><p>do 以及do while循环的使用与区别;</p></li><li><p>recursive递归函数的调用与结束条件;</p></li><li><p>字符串的连接等;</p></li><li><p>函数子程序与子例子程序的调用;</p></li><li><p>排序与统计。</p></li></ol>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序。"><a href="#Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序。" class="headerlink" title="Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序。"></a>Fortran计算小题目第二期:格式打印输出,函数子程序与子例子程序配合计算,字符串连接以及排序。</h2><dl><dt>Authors</dt><dd>GanAH</dd></dl><h4 id="近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:"><a href="#近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:" class="headerlink" title="近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:"></a>近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:</h4><ol><li><p>do 以及do while循环的使用与区别;</p></li><li><p>recursive递归函数的调用与结束条件;</p></li><li><p>字符串的连接等;</p></li><li><p>函数子程序与子例子程序的调用;</p></li><li><p>排序与统计。</p><a id="more"></a><h3 id="本次编程作业采用的编辑器为Visual-Studio-2015,编译环境为Intel-R-Visual-Fortran。"><a href="#本次编程作业采用的编辑器为Visual-Studio-2015,编译环境为Intel-R-Visual-Fortran。" class="headerlink" title="本次编程作业采用的编辑器为Visual Studio 2015,编译环境为Intel(R) Visual Fortran。"></a>本次编程作业采用的编辑器为Visual Studio 2015,编译环境为Intel(R) Visual Fortran。</h3><p>由于有多个题目要求,故将不同的题目内容分别作为函数定义在独立的文件中,使用项目主函数进行调用。</p><h3 id="第一题-非内置函数求sinx"><a href="#第一题-非内置函数求sinx" class="headerlink" title="第一题 非内置函数求sinx"></a>第一题 非内置函数求sinx</h3><h4 id="一-题目要求"><a href="#一-题目要求" class="headerlink" title="(一) 题目要求"></a>(一) 题目要求</h4><p><img data-src="https://img-blog.csdnimg.cn/20190921213506915.png#pic_center" alt="在这里插入图片描述"></p><h4 id="二-源代码"><a href="#二-源代码" class="headerlink" title="(二) 源代码"></a>(二) 源代码</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">!n代表计算长度</span><br><span class="line">!传入的x为radian</span><br><span class="line">!resultSinx为返回的数据</span><br><span class="line"><span class="function">FUNCTION <span class="title">loopSin</span><span class="params">(x,n)</span> <span class="title">RESULT</span><span class="params">(resultSinx)</span></span></span><br><span class="line"><span class="function">IMPLICIT NONE</span></span><br><span class="line"><span class="function">real resultSinx,x,fac_n</span></span><br><span class="line"><span class="function">integer n,i,lk</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">resultSinx </span>= <span class="number">0.0</span></span><br><span class="line"><span class="keyword">do</span> i = <span class="number">1</span>,n</span><br><span class="line"> <span class="function">call <span class="title">factorial</span><span class="params">(<span class="number">2</span>*i<span class="number">-1</span>,fac_n)</span></span></span><br><span class="line"><span class="function"> resultSinx </span>= resultSinx*<span class="number">1.0</span> + (((-<span class="number">1</span>)**(i-<span class="number">1</span>)) * (x**(<span class="number">2</span>*i - <span class="number">1</span>))/fac_n)*<span class="number">1.0</span> </span><br><span class="line"> </span><br><span class="line"> print <span class="number">11</span>,<span class="string">"第"</span>,i,<span class="string">"迭代值:"</span>,resultSinx</span><br><span class="line"> <span class="number">11</span> format(a4,i2,a8,f7<span class="number">.5</span>)</span><br><span class="line">end <span class="keyword">do</span></span><br><span class="line"></span><br><span class="line">END </span><br><span class="line">!计算阶乘子程序</span><br><span class="line"><span class="function">subroutine <span class="title">factorial</span><span class="params">(n,fac)</span></span></span><br><span class="line"><span class="function">real fac</span></span><br><span class="line"><span class="function">integer n,j,i</span></span><br><span class="line"><span class="function">j </span>= <span class="number">1</span></span><br><span class="line">fac = <span class="number">1.0</span></span><br><span class="line"><span class="function"><span class="keyword">do</span> <span class="title">while</span><span class="params">(j < n)</span></span></span><br><span class="line"><span class="function"> fac </span>= fac *(j+<span class="number">1</span>)</span><br><span class="line"> j = j + <span class="number">1</span> </span><br><span class="line"> end <span class="keyword">do</span></span><br><span class="line">end subroutine factorial</span><br></pre></td></tr></table></figure><h4 id="三-主函数调用及结果"><a href="#三-主函数调用及结果" class="headerlink" title="(三) 主函数调用及结果"></a>(三) 主函数调用及结果</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">real loopSin,j</span><br><span class="line"></span><br><span class="line">real a </span><br><span class="line">a = loopSin(<span class="number">30</span>*<span class="number">3.1415926</span>/<span class="number">180</span>,<span class="number">12</span>)</span><br><span class="line">print *,<span class="string">"sinx计算结果:"</span></span><br><span class="line">print *,a</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">print *,<span class="string">"二.阶乘计算测试,测试数据:3,6"</span></span><br><span class="line"><span class="function">call <span class="title">factorial</span><span class="params">(<span class="number">3</span>,j)</span></span></span><br><span class="line"><span class="function">print 11,"3的阶乘为:",j</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">call <span class="title">factorial</span><span class="params">(<span class="number">6</span>,j)</span></span></span><br><span class="line"><span class="function">print 11,"6的阶乘为:",j</span></span><br><span class="line"><span class="function">11 <span class="title">format</span><span class="params">(a14,f5<span class="number">.1</span>)</span></span></span><br><span class="line"><span class="function">pause 1</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function"> END PROGRAM Main</span></span><br></pre></td></tr></table></figure></li></ol><pre><code>图四 计算结果</code></pre><p><img data-src="https://img-blog.csdnimg.cn/20190921213849877.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="第二题-递归计算勒让德级数"><a href="#第二题-递归计算勒让德级数" class="headerlink" title="第二题 递归计算勒让德级数"></a>第二题 递归计算勒让德级数</h4><h4 id="一-题目要求-1"><a href="#一-题目要求-1" class="headerlink" title="(一) 题目要求"></a>(一) 题目要求</h4><p><img data-src="https://img-blog.csdnimg.cn/20190921214501858.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h5 id="二-源代码-1"><a href="#二-源代码-1" class="headerlink" title="(二) 源代码"></a>(二) 源代码</h5><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">!N为递归次数,整型</span><br><span class="line">!X为计算值,RESULT_le为递归计算结果,均为实型</span><br><span class="line"> <span class="function">recursive FUNCTION <span class="title">LEGENDRE_N</span><span class="params">(X,N)</span> <span class="title">RESULT</span><span class="params">(RESULT_le)</span></span></span><br><span class="line"><span class="function"> IMPLICIT NONE</span></span><br><span class="line"><span class="function"> real RESULT_le,X</span></span><br><span class="line"><span class="function"> integer N</span></span><br><span class="line"><span class="function"> select <span class="title">case</span><span class="params">(N)</span></span></span><br><span class="line"><span class="function"> <span class="title">case</span><span class="params">(<span class="number">0</span>)</span></span></span><br><span class="line"><span class="function"> RESULT_le </span>= <span class="number">0</span></span><br><span class="line"> <span class="keyword">case</span>(<span class="number">1</span>)</span><br><span class="line"> RESULT_le = X</span><br><span class="line"> <span class="keyword">case</span>(:-<span class="number">1</span>)</span><br><span class="line"> print *,<span class="string">"递归参数错误,负值!"</span></span><br><span class="line"> <span class="keyword">case</span> <span class="keyword">default</span></span><br><span class="line"> RESULT_le = ((<span class="number">2.0</span>*N-<span class="number">1</span>)*X*LEGENDRE_N(X,N-<span class="number">1</span>)-(N-<span class="number">1</span>)*LEGENDRE_N(X,N-<span class="number">1</span>))/N</span><br><span class="line"> </span><br><span class="line"> end select</span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"> END FUNCTION LEGENDRE_N</span><br></pre></td></tr></table></figure><h4 id="(三)-主函数调用及结果"><a href="#(三)-主函数调用及结果" class="headerlink" title="(三) 主函数调用及结果"></a>(三) 主函数调用及结果</h4><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">real LEGENDRE_N</span><br><span class="line"></span><br><span class="line">real a ,X</span><br><span class="line">integer::N</span><br><span class="line">integer i</span><br><span class="line"></span><br><span class="line">do i = <span class="number">0</span>,<span class="number">3</span></span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"输入X值:"</span></span><br><span class="line"> read *,X</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"输入级数N(整数):"</span></span><br><span class="line"> read *,N</span><br><span class="line"> a = LEGENDRE_N(X*<span class="number">1.0</span>,N)</span><br><span class="line"> <span class="keyword">print</span> <span class="number">10</span>,N,<span class="string">"级勒让德级数为:"</span>,a</span><br><span class="line"><span class="number">10</span> format(i2,a16,f) </span><br><span class="line"> </span><br><span class="line">end do</span><br><span class="line"></span><br><span class="line">pause <span class="number">1</span></span><br><span class="line"></span><br><span class="line"> END PROGRAM Main</span><br></pre></td></tr></table></figure><p>通过主函数调用时循环赋值并计算,采用三组数据进行测试,结果如下:<br><img data-src="https://img-blog.csdnimg.cn/20190921223807926.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h3 id="第三题-排序数据并统计"><a href="#第三题-排序数据并统计" class="headerlink" title="第三题 排序数据并统计"></a>第三题 排序数据并统计</h3><h4 id="(一)题目要求"><a href="#(一)题目要求" class="headerlink" title="(一)题目要求"></a>(一)题目要求</h4><p><img data-src="https://img-blog.csdnimg.cn/20190921220945996.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h4 id="(二)源代码"><a href="#(二)源代码" class="headerlink" title="(二)源代码"></a>(二)源代码</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">FUNCTION <span class="title">DATASTATIS</span><span class="params">()</span> <span class="title">RESULT</span><span class="params">(RE)</span></span></span><br><span class="line"><span class="function"> IMPLICIT NONE</span></span><br><span class="line"><span class="function"> real RE</span></span><br><span class="line"><span class="function"> integer,allocatable::<span class="title">Datas</span><span class="params">(:)</span></span></span><br><span class="line"><span class="function"> integer arrayLen,i,j,sum,temp</span></span><br><span class="line"><span class="function"> print *,"请输入数组的长度:"</span></span><br><span class="line"><span class="function"> read *,arrayLen</span></span><br><span class="line"><span class="function"> <span class="title">allocate</span><span class="params">(Datas(arrayLen)</span>)</span></span><br><span class="line"><span class="function"> </span></span><br><span class="line"><span class="function"> print *,"请输入需要处理的整数,回车隔开:"</span></span><br><span class="line"><span class="function"> sum </span>= <span class="number">0</span></span><br><span class="line"> <span class="keyword">do</span> i = <span class="number">1</span>,arrayLen</span><br><span class="line"> read *,Datas(i)</span><br><span class="line"> sum = sum + Datas(i)</span><br><span class="line"> end <span class="keyword">do</span></span><br><span class="line"> </span><br><span class="line"> !计算均值</span><br><span class="line"> print <span class="number">10</span>,<span class="string">"数值总和:"</span>,sum,<span class="string">" ,均值为:"</span>,<span class="number">1.0</span>*sum/arrayLen</span><br><span class="line"> <span class="number">10</span> format(a9,i3,a12,f5<span class="number">.2</span>) </span><br><span class="line"> !排序</span><br><span class="line"> <span class="keyword">do</span> i = <span class="number">1</span>,arrayLen-<span class="number">1</span></span><br><span class="line"> <span class="keyword">do</span> j = i,arrayLen</span><br><span class="line"> <span class="keyword">if</span>(Datas(i)>Datas(j)) then</span><br><span class="line"> temp = Datas(i)</span><br><span class="line"> Datas(i) = Datas(j)</span><br><span class="line"> Datas(j) = temp</span><br><span class="line"> end <span class="keyword">if</span></span><br><span class="line"> end <span class="keyword">do</span></span><br><span class="line"> end <span class="keyword">do</span></span><br><span class="line"> </span><br><span class="line"> print *,<span class="string">"从小到大重排序如下:"</span></span><br><span class="line"> print <span class="number">19</span>,Datas</span><br><span class="line"> <span class="number">19</span> format(<span class="number">10</span>i3) </span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"> </span><br><span class="line"> END FUNCTION DATASTATIS</span><br></pre></td></tr></table></figure><h4 id="(三)主函数调用及结果"><a href="#(三)主函数调用及结果" class="headerlink" title="(三)主函数调用及结果"></a>(三)主函数调用及结果</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">real DATASTATIS</span><br><span class="line"></span><br><span class="line">real a</span><br><span class="line">a = DATASTATIS()</span><br><span class="line"></span><br><span class="line">pause <span class="number">1</span></span><br><span class="line"></span><br><span class="line"> END PROGRAM Main</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20190922205704954.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190922205724598.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="第四题-在指定字符串的位置插入新的字符串"><a href="#第四题-在指定字符串的位置插入新的字符串" class="headerlink" title="第四题 在指定字符串的位置插入新的字符串"></a>第四题 在指定字符串的位置插入新的字符串</h3><h4 id="(一-题目要求"><a href="#(一-题目要求" class="headerlink" title="(一) 题目要求"></a>(一) 题目要求</h4><p><img data-src="https://img-blog.csdnimg.cn/20190921221416317.png" alt="在这里插入图片描述"></p><h4 id="(二)源代码-1"><a href="#(二)源代码-1" class="headerlink" title="(二)源代码"></a>(二)源代码</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line"><span class="function">FUNCTION <span class="title">STRINSERINDEX</span><span class="params">(STR1,STR2,index)</span> <span class="title">RESULT</span><span class="params">(STR)</span></span></span><br><span class="line"><span class="function"> IMPLICIT NONE</span></span><br><span class="line"><span class="function"> <span class="title">CHARACTER</span><span class="params">(<span class="number">5</span>)</span> STR1,STR2</span></span><br><span class="line"><span class="function"> <span class="title">CHARACTER</span><span class="params">(<span class="number">10</span>)</span> STR</span></span><br><span class="line"><span class="function"> INTEGER index</span></span><br><span class="line"><span class="function"> </span></span><br><span class="line"><span class="function"> STR </span>= STR1(<span class="number">1</span>:index)<span class="comment">//(STR2//STR1(index+1:))</span></span><br><span class="line"> </span><br><span class="line"> END FUNCTION STRINSERINDEX</span><br></pre></td></tr></table></figure><h4 id="(三)主函数调用及结果-1"><a href="#(三)主函数调用及结果-1" class="headerlink" title="(三)主函数调用及结果"></a>(三)主函数调用及结果</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">CHARACTER(<span class="number">5</span>) STR1,STR2</span><br><span class="line">CHARACTER(<span class="number">10</span>)STRINSERINDEX</span><br><span class="line">integer index</span><br><span class="line"></span><br><span class="line">PRINT *,<span class="string">"输入第一个待插入字符串:"</span></span><br><span class="line">read *,STR1</span><br><span class="line">PRINT *,<span class="string">"输入第二个需插入字符串:"</span></span><br><span class="line">read *,STR2</span><br><span class="line">PRINT *,<span class="string">"输入位置index:"</span></span><br><span class="line">read *,index</span><br><span class="line"></span><br><span class="line">print <span class="number">10</span>,<span class="string">"拼接结果:"</span>,STRINSERINDEX(STR1,STR2,index)</span><br><span class="line"><span class="number">10</span> format(a10,a10)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">pause <span class="number">1</span></span><br><span class="line"></span><br><span class="line"> END PROGRAM Main</span><br></pre></td></tr></table></figure><p>==该字符串连接为固定的长度连接,需要动态字符串连接可更改字符串的固定定义方式。==<br><img data-src="https://img-blog.csdnimg.cn/20190922215602742.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h4 id="(四)编码遇到的异常"><a href="#(四)编码遇到的异常" class="headerlink" title="(四)编码遇到的异常"></a>(四)编码遇到的异常</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line"></span><br><span class="line">CHARACTER(<span class="number">100</span>) STRINSERINDEX,STR1,STR2</span><br><span class="line">integer index</span><br><span class="line"></span><br><span class="line">PRINT *,<span class="string">"输入第一个待插入字符串:"</span></span><br><span class="line">read *,STR1</span><br><span class="line">print *,Str1(<span class="number">1</span>:<span class="number">2</span>)</span><br><span class="line">PRINT *,<span class="string">"输入第二个需插入字符串:"</span></span><br><span class="line">read *,STR2</span><br><span class="line">PRINT *,<span class="string">"输入位置index:"</span></span><br><span class="line">read *,index</span><br><span class="line"></span><br><span class="line">print *,STRINSERINDEX(STR1,STR2,index)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">pause <span class="number">1</span></span><br><span class="line"></span><br><span class="line"> END PROGRAM Main</span><br><span class="line">!字符串连接</span><br><span class="line"><span class="function">FUNCTION <span class="title">STRINSERINDEX</span><span class="params">(STR1,STR2,index)</span> <span class="title">RESULT</span><span class="params">(STR)</span></span></span><br><span class="line"><span class="function"> IMPLICIT NONE</span></span><br><span class="line"><span class="function"> <span class="title">CHARACTER</span><span class="params">(<span class="number">100</span>)</span> STR1,STR2,STR</span></span><br><span class="line"><span class="function"> INTEGER index</span></span><br><span class="line"><span class="function"> </span></span><br><span class="line"><span class="function"> STR </span>= STR1(<span class="number">1</span>:index)<span class="comment">//STR2//STR1(index:)</span></span><br><span class="line"> </span><br><span class="line"> END FUNCTION STRINSERINDEX</span><br></pre></td></tr></table></figure><h3 id="烫烫烫!"><a href="#烫烫烫!" class="headerlink" title="烫烫烫!"></a>烫烫烫!</h3><p><img data-src="https://img-blog.csdnimg.cn/20190922212653712.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/2019092221271064.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="五、-总结"><a href="#五、-总结" class="headerlink" title="五、 总结"></a>五、 总结</h3><p>本次内容能够通过动手编程去帮助我们熟悉、掌握并灵活应用新学的编程语言,包含了数据的键盘输入与屏幕输出、算法构建与计算等。从语法到编程习惯,都是促使我们去更深入地学习、掌握这一门编程语言。<br><br>更多精彩内容请扫描下方二维码,还有更多资源分享哟~<br><img data-src="https://img-blog.csdnimg.cn/20190921214252169.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/3fb3689c.html#disqus_thread</comments>
</item>
<item>
<title>Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用</title>
<link>https://www.ganahe.top/archives/5bb29ea0.html</link>
<guid>https://www.ganahe.top/archives/5bb29ea0.html</guid>
<pubDate>Thu, 23 Apr 2020 02:44:42 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用"><a href="#Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用" class="headerlink" title="Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用"></a>Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用</h2><h4 id="近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:"><a href="#近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:" class="headerlink" title="近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:"></a>近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:</h4><ol><li>Fortran的默认变量声明取消;</li><li>常量Parameter的类型声明与常量的应用;</li><li>自由格式与固定格式的区别;</li><li>函数子程序的定义与声明;</li><li>do循环;</li><li>if与Select case语句;</li><li>函数子程序的调用。</li></ol>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用"><a href="#Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用" class="headerlink" title="Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用"></a>Fortran计算小题目:包含函数子程序定义,Parameter常量类型的定义等知识的运用</h2><h4 id="近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:"><a href="#近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:" class="headerlink" title="近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:"></a>近期开始学习Fortran语言与程序设计,小有心得,特此分享。本次包含的内容有:</h4><ol><li>Fortran的默认变量声明取消;</li><li>常量Parameter的类型声明与常量的应用;</li><li>自由格式与固定格式的区别;</li><li>函数子程序的定义与声明;</li><li>do循环;</li><li>if与Select case语句;</li><li>函数子程序的调用。</li></ol><a id="more"></a><h3 id="本次编程作业采用的编辑器为Visual-Studio-2015,编译环境为Intel-R-Visual-Fortran。"><a href="#本次编程作业采用的编辑器为Visual-Studio-2015,编译环境为Intel-R-Visual-Fortran。" class="headerlink" title="本次编程作业采用的编辑器为Visual Studio 2015,编译环境为Intel(R) Visual Fortran。"></a>本次编程作业采用的编辑器为Visual Studio 2015,编译环境为Intel(R) Visual Fortran。</h3><p>由于有多个题目要求,故将不同的题目内容分别作为函数定义在独立的文件中,使用项目主函数进行调用。</p><h3 id="二、-第一题-圆柱体计算"><a href="#二、-第一题-圆柱体计算" class="headerlink" title="二、 第一题 圆柱体计算"></a>二、 第一题 圆柱体计算</h3><h4 id="一-题目要求"><a href="#一-题目要求" class="headerlink" title="(一) 题目要求"></a>(一) 题目要求</h4><p><img data-src="https://img-blog.csdnimg.cn/20190916194755715.png" alt="题目一"></p><h4 id="二-自由格式:函数子程序SV-f90"><a href="#二-自由格式:函数子程序SV-f90" class="headerlink" title="(二) 自由格式:函数子程序SV.f90"></a>(二) 自由格式:函数子程序SV.f90</h4><h5 id="1-源代码"><a href="#1-源代码" class="headerlink" title="(1) 源代码"></a>(1) 源代码</h5><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">function SV(b) result(a)</span><br><span class="line">implicit none</span><br><span class="line">real , PARAMETER::PI = <span class="number">3.1415927</span> </span><br><span class="line">real H,R,S,V</span><br><span class="line">real a,b</span><br><span class="line">H = <span class="number">0</span></span><br><span class="line">R = <span class="number">0</span></span><br><span class="line"><span class="keyword">print</span> *,<span class="string">"请输入圆柱体的高 H/m:"</span></span><br><span class="line">read *,H</span><br><span class="line"><span class="keyword">print</span> *,<span class="string">"请输入圆柱体的底面半径 R/m:"</span></span><br><span class="line">read *,R</span><br><span class="line"><span class="keyword">if</span>(H==<span class="number">0</span>)then</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"H数据未输入!"</span></span><br><span class="line"><span class="keyword">else</span> <span class="keyword">if</span>(R==<span class="number">0</span>)then </span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"R数据未输入!"</span></span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"> S = <span class="number">2.0</span>*PI*(R**<span class="number">2.0</span>)+<span class="number">2.0</span>*PI*R*H</span><br><span class="line"> V = PI*R*R*H</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"圆柱体表面积为 S="</span>,S,<span class="string">"平方米"</span></span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"圆柱体的体积为 V="</span>,V,<span class="string">"立方米"</span></span><br><span class="line">endif</span><br><span class="line"> a = <span class="number">1</span></span><br><span class="line">!暂停</span><br><span class="line">pause</span><br><span class="line">END function SV</span><br></pre></td></tr></table></figure><h5 id="2-主函数调用及运行结果"><a href="#2-主函数调用及运行结果" class="headerlink" title="(2) 主函数调用及运行结果"></a>(2) 主函数调用及运行结果</h5><p>!定义主函数</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">real SV,a</span><br><span class="line">real:: b = <span class="number">10.0</span></span><br><span class="line">a=SV(b)</span><br><span class="line">pause</span><br><span class="line"></span><br><span class="line"> END PROGRAM Main</span><br></pre></td></tr></table></figure><pre><code>图一 自由格式下的运行结果</code></pre><p><img data-src="https://img-blog.csdnimg.cn/20190916194724847.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>图二 IF语句判断输入的数据合理性<br><img data-src="https://img-blog.csdnimg.cn/20190916194913622.png" alt="在这里插入图片描述"></p><h4 id="三-固定格式:函数子程序SV-for"><a href="#三-固定格式:函数子程序SV-for" class="headerlink" title="(三) 固定格式:函数子程序SV.for"></a>(三) 固定格式:函数子程序SV.for</h4><h5 id="1-源代码-1"><a href="#1-源代码-1" class="headerlink" title="(1) 源代码"></a>(1) 源代码</h5><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">function <span class="title">SVou</span><span class="params">()</span> <span class="title">result</span><span class="params">(a)</span></span></span><br><span class="line"><span class="function"> IMPLICIT NONE</span></span><br><span class="line"><span class="function"> real a</span></span><br><span class="line"><span class="function"> real,PARAMETER::PIa </span>= <span class="number">3.1415927</span></span><br><span class="line"> real Ha,Ra,Sa,Va</span><br><span class="line"> Ha = <span class="number">0</span></span><br><span class="line"> Ra = <span class="number">0</span></span><br><span class="line"> print *,<span class="string">"请输入圆柱体的高 H/m:"</span></span><br><span class="line"> read *,Ha</span><br><span class="line"> print *,<span class="string">"请输入圆柱体的底面半径 R/m:"</span></span><br><span class="line"> read *,Ra</span><br><span class="line"> <span class="keyword">if</span>(Ha==<span class="number">0</span>)then</span><br><span class="line"> print *,<span class="string">"H数据错误!"</span></span><br><span class="line"> <span class="keyword">else</span> <span class="keyword">if</span>(Ra==<span class="number">0</span>)then </span><br><span class="line"> print *,<span class="string">"R数据错误!"</span></span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> Sa = <span class="number">2.0</span>*PIa*(Ra**<span class="number">2.0</span>)+<span class="number">2.0</span>*PIa*Ra*Ha</span><br><span class="line"> Va = PIa*Ra*Ra*Ha</span><br><span class="line"> print *,<span class="string">"圆柱体表面积为 S="</span>,Sa,<span class="string">"平方米"</span></span><br><span class="line"> print *,<span class="string">"圆柱体的体积为 V="</span>,Va,<span class="string">"立方米"</span></span><br><span class="line"> endif</span><br><span class="line"> </span><br><span class="line"> a = <span class="number">1</span></span><br><span class="line"> </span><br><span class="line">!暂停</span><br><span class="line"> pause</span><br><span class="line"> </span><br><span class="line"> END</span><br></pre></td></tr></table></figure><h5 id="2-主函数调用及运行结果-1"><a href="#2-主函数调用及运行结果-1" class="headerlink" title="(2) 主函数调用及运行结果"></a>(2) 主函数调用及运行结果</h5><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">!第一题</span><br><span class="line">real SV,a</span><br><span class="line">real:: b = <span class="number">10.0</span></span><br><span class="line">!第一题</span><br><span class="line">real SVou</span><br><span class="line">a = SVou()</span><br><span class="line">pause</span><br><span class="line"> END PROGRAM Main</span><br></pre></td></tr></table></figure><pre><code>图三 固定格式调用结果</code></pre><p><img data-src="https://img-blog.csdnimg.cn/20190916195250140.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h4 id="三、-第二题-求几何图形参数"><a href="#三、-第二题-求几何图形参数" class="headerlink" title="三、 第二题 求几何图形参数"></a>三、 第二题 求几何图形参数</h4><h5 id="一-题目要求-1"><a href="#一-题目要求-1" class="headerlink" title="(一) 题目要求"></a>(一) 题目要求</h5><p><img data-src="https://img-blog.csdnimg.cn/20190916195456343.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h5 id="二-源代码"><a href="#二-源代码" class="headerlink" title="(二) 源代码"></a>(二) 源代码</h5><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">!第二题内容</span><br><span class="line"> FUNCTION sector(r,sita) RESULT(k)</span><br><span class="line"> REAL,PARAMETER:: PI = <span class="number">3.1415927</span> </span><br><span class="line"> real h,s,a,b</span><br><span class="line"> real k</span><br><span class="line"> a = <span class="number">2</span>*PI*sita/<span class="number">360</span></span><br><span class="line"> sita = sita*PI/<span class="number">180</span></span><br><span class="line"> h = <span class="number">2</span>*r*(sin(sita/<span class="number">4</span>)**<span class="number">2</span>)</span><br><span class="line"> b = <span class="number">2</span>*r*sin(sita/<span class="number">2</span>)</span><br><span class="line"> s = a*r*r</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"拱高为 h ="</span>,h</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"弦长为 b ="</span>,b</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"面积为 s ="</span>,s</span><br><span class="line"> </span><br><span class="line"> k = <span class="number">1</span></span><br><span class="line"> END</span><br></pre></td></tr></table></figure><h5 id="三-主函数调用及结果"><a href="#三-主函数调用及结果" class="headerlink" title="(三) 主函数调用及结果"></a>(三) 主函数调用及结果</h5><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">real a</span><br><span class="line">!第二题</span><br><span class="line">real sector</span><br><span class="line">real r,sita</span><br><span class="line"></span><br><span class="line"><span class="keyword">print</span> *,<span class="string">"请输入半径r:"</span></span><br><span class="line">read *,r</span><br><span class="line"><span class="keyword">print</span> *,<span class="string">"请输入夹角角sita(°):"</span></span><br><span class="line">read *,sita</span><br><span class="line"></span><br><span class="line">a = sector(r,sita)</span><br><span class="line">pause</span><br><span class="line"></span><br><span class="line"> END PROGRAM Main</span><br></pre></td></tr></table></figure><pre><code>图四 计算结果</code></pre><p><img data-src="https://img-blog.csdnimg.cn/20190916195506869.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h4 id="四、-第三题-求解税率"><a href="#四、-第三题-求解税率" class="headerlink" title="四、 第三题 求解税率"></a>四、 第三题 求解税率</h4><h4 id="一-题目要求-2"><a href="#一-题目要求-2" class="headerlink" title="(一) 题目要求"></a>(一) 题目要求</h4><p><img data-src="https://img-blog.csdnimg.cn/20190916210549893.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190916210603268.png" alt="在这里插入图片描述"></p><h5 id="二-IF选择结构"><a href="#二-IF选择结构" class="headerlink" title="(二) IF选择结构"></a>(二) IF选择结构</h5><h5 id="1-源代码-2"><a href="#1-源代码-2" class="headerlink" title="(1) 源代码"></a>(1) 源代码</h5><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">FUNCTION Tax_IF(name,age,aunualIncome) RESULT(tax)</span><br><span class="line"> REAL tax</span><br><span class="line"> INTEGER age,aunualIncome</span><br><span class="line"> CHARACTER*<span class="number">7</span> name </span><br><span class="line"> <span class="keyword">if</span>(age<<span class="number">50</span>)then!年龄分段,小于<span class="number">50</span></span><br><span class="line"> </span><br><span class="line"> <span class="keyword">if</span>(aunualIncome<<span class="number">3000</span>)then !归算收入对应税</span><br><span class="line"> tax = aunualIncome*<span class="number">0.05</span></span><br><span class="line"> <span class="keyword">else</span> <span class="keyword">if</span>(<span class="number">3000</span><=aunualIncome<=<span class="number">8000</span>)then</span><br><span class="line"> tax = aunualIncome*<span class="number">0.09</span></span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> tax = aunualIncome*<span class="number">0.12</span></span><br><span class="line"> endif</span><br><span class="line"> </span><br><span class="line"> <span class="keyword">else</span>!年龄大于等于<span class="number">50</span></span><br><span class="line"> </span><br><span class="line"> <span class="keyword">if</span>(aunualIncome<<span class="number">3000</span>)then !归算收入对应税</span><br><span class="line"> tax = aunualIncome*<span class="number">0.03</span></span><br><span class="line"> <span class="keyword">else</span> <span class="keyword">if</span>(<span class="number">3000</span><=aunualIncome<=<span class="number">8000</span>)then</span><br><span class="line"> tax = aunualIncome*<span class="number">0.07</span></span><br><span class="line"> <span class="keyword">else</span></span><br><span class="line"> tax = aunualIncome*<span class="number">0.10</span></span><br><span class="line"> endif</span><br><span class="line"> endif</span><br><span class="line"></span><br><span class="line"> <span class="keyword">print</span> *,name,<span class="string">","</span>,age,<span class="string">"岁,其税为:"</span>,tax,<span class="string">"元"</span></span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">" 税后收入为:"</span>,(aunualIncome*<span class="number">1.0</span>-tax)</span><br><span class="line"></span><br><span class="line"> END</span><br></pre></td></tr></table></figure><h5 id="2-主函数调用及结果"><a href="#2-主函数调用及结果" class="headerlink" title="(2) 主函数调用及结果"></a>(2) 主函数调用及结果</h5><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">REAL TAX_IF</span><br><span class="line">REAL Tax_Case</span><br><span class="line">real tax1,tax2</span><br><span class="line">CHARACTER*<span class="number">7</span>::name = <span class="string">"我是谁?"</span></span><br><span class="line">INTEGER:: age,money,n</span><br><span class="line"></span><br><span class="line">do n=<span class="number">1</span>,<span class="number">3</span></span><br><span class="line"> write(*,*)<span class="string">"第"</span>,n,<span class="string">"组测试数据:"</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">print</span> *,<span class="string">"请输入年龄 age = :"</span></span><br><span class="line">read *,age</span><br><span class="line"><span class="keyword">print</span> *,<span class="string">"请输入年收入 moneyAlltheYears(元) = :"</span></span><br><span class="line">read *,money</span><br><span class="line">tax1 = TAX_IF(name,age,money)</span><br><span class="line">!tax2 = Tax_Case(name,age,money)</span><br><span class="line"><span class="keyword">print</span> *,<span class="string">"-----------"</span></span><br><span class="line">end do</span><br><span class="line"></span><br><span class="line">pause</span><br><span class="line"></span><br><span class="line"> END PROGRAM Main</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20190916210444519.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h4 id="三-Select-case选择结构"><a href="#三-Select-case选择结构" class="headerlink" title="(三) Select case选择结构"></a>(三) Select case选择结构</h4><h5 id="1-源代码-3"><a href="#1-源代码-3" class="headerlink" title="(1) 源代码"></a>(1) 源代码</h5><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line">FUNCTION Tax_Case(name,age,aunualIncome) RESULT(resultq)</span><br><span class="line"> real resultq</span><br><span class="line"> CHARACTER*<span class="number">7</span> name</span><br><span class="line"> INTEGER age,aunualIncome</span><br><span class="line"> select case(age)</span><br><span class="line"> case(:<span class="number">50</span>)</span><br><span class="line"> select case(aunualIncome)</span><br><span class="line"> case(:<span class="number">2999</span>)</span><br><span class="line"> resultq = aunualIncome*<span class="number">0.05</span></span><br><span class="line"> case(<span class="number">3000</span>:<span class="number">8000</span>)</span><br><span class="line"> resultq = aunualIncome*<span class="number">0.09</span></span><br><span class="line"> case(<span class="number">8001</span>:)</span><br><span class="line"> resultq = aunualIncome*<span class="number">0.12</span></span><br><span class="line"> case default</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"错误!"</span></span><br><span class="line"> end select</span><br><span class="line"></span><br><span class="line"> </span><br><span class="line"> case default</span><br><span class="line"> select case(aunualIncome)</span><br><span class="line"> case(:<span class="number">2999</span>)</span><br><span class="line"> resultq = aunualIncome*<span class="number">0.03</span></span><br><span class="line"> case(<span class="number">3000</span>:<span class="number">8000</span>)</span><br><span class="line"> resultq = aunualIncome*<span class="number">0.07</span></span><br><span class="line"> case(<span class="number">8001</span>:)</span><br><span class="line"> resultq = aunualIncome*<span class="number">0.10</span></span><br><span class="line"> case default</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">"错误!"</span></span><br><span class="line"> end select</span><br><span class="line"> end select</span><br><span class="line"> <span class="keyword">print</span> *,name,<span class="string">","</span>,age,<span class="string">"岁,其税为:"</span>,resultq</span><br><span class="line"> <span class="keyword">print</span> *,<span class="string">" 税后收入为:"</span>,(aunualIncome*<span class="number">1.0</span>-resultq)</span><br><span class="line"> </span><br><span class="line"> END</span><br></pre></td></tr></table></figure><h5 id="2-主函数调用与结果"><a href="#2-主函数调用与结果" class="headerlink" title="(2) 主函数调用与结果"></a>(2) 主函数调用与结果</h5><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">!定义主函数</span><br><span class="line">PROGRAM Main</span><br><span class="line">IMPLICIT NONE</span><br><span class="line">REAL TAX_IF</span><br><span class="line">REAL Tax_Case</span><br><span class="line">real tax1,tax2</span><br><span class="line">CHARACTER*<span class="number">7</span>::name = <span class="string">"我是谁?"</span></span><br><span class="line">INTEGER:: age,money,n</span><br><span class="line"></span><br><span class="line"><span class="keyword">do</span> n=<span class="number">1</span>,<span class="number">3</span></span><br><span class="line"> write(*,*)<span class="string">"第"</span>,n,<span class="string">"组测试数据:"</span></span><br><span class="line"> </span><br><span class="line">print *,<span class="string">"请输入年龄 age = :"</span></span><br><span class="line">read *,age</span><br><span class="line">print *,<span class="string">"请输入年收入 moneyAlltheYears(元) = :"</span></span><br><span class="line">read *,money</span><br><span class="line">!tax1 = TAX_IF(name,age,money)</span><br><span class="line">tax2 = Tax_Case(name,age,money)</span><br><span class="line">print *,<span class="string">"-----------"</span></span><br><span class="line">end <span class="keyword">do</span></span><br><span class="line"></span><br><span class="line">pause</span><br><span class="line"></span><br><span class="line"> END PROGRAM Main</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20190916210534452.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h3 id="五、-总结"><a href="#五、-总结" class="headerlink" title="五、 总结"></a>五、 总结</h3><p>本次内容能够通过动手编程去帮助我们熟悉、掌握并灵活应用新学的编程语言,包含了数据的键盘输入与屏幕输出、算法构建与计算等。从语法到编程习惯,都是促使我们去更深入地学习、掌握这一门编程语言。</p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/5bb29ea0.html#disqus_thread</comments>
</item>
<item>
<title>Word2016更改不同的级别标题序号:如2.2 ,2.2.1类标题序号</title>
<link>https://www.ganahe.top/archives/efccf9f7.html</link>
<guid>https://www.ganahe.top/archives/efccf9f7.html</guid>
<pubDate>Thu, 23 Apr 2020 02:44:42 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="Word2016更改不同的级别标题序号:如2-2-,2-2-1类标题序号"><a href="#Word2016更改不同的级别标题序号:如2-2-,2-2-1类标题序号" class="headerlink" title="Word2016更改不同的级别标题序号:如2.2 ,2.2.1类标题序号"></a>Word2016更改不同的级别标题序号:如2.2 ,2.2.1类标题序号</h1><h2 id="一-目标-效果"><a href="#一-目标-效果" class="headerlink" title="一. 目标==效果=="></a>一. 目标==效果==</h2><p><img data-src="https://img-blog.csdnimg.cn/20191102163522824.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="Word2016更改不同的级别标题序号:如2-2-,2-2-1类标题序号"><a href="#Word2016更改不同的级别标题序号:如2-2-,2-2-1类标题序号" class="headerlink" title="Word2016更改不同的级别标题序号:如2.2 ,2.2.1类标题序号"></a>Word2016更改不同的级别标题序号:如2.2 ,2.2.1类标题序号</h1><h2 id="一-目标-效果"><a href="#一-目标-效果" class="headerlink" title="一. 目标==效果=="></a>一. 目标==效果==</h2><p><img data-src="https://img-blog.csdnimg.cn/20191102163522824.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><a id="more"></a><h2 id="二-需要处理的-原始情况"><a href="#二-需要处理的-原始情况" class="headerlink" title="二. 需要处理的==原始情况=="></a>二. 需要处理的==原始情况==</h2><p><img data-src="https://img-blog.csdnimg.cn/2019110216371256.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="三-处理流程"><a href="#三-处理流程" class="headerlink" title="三. 处理流程"></a>三. 处理流程</h2><h4 id="选中需要更改的标题级别,点击上方多级列表,选择“定义新的多级列表”"><a href="#选中需要更改的标题级别,点击上方多级列表,选择“定义新的多级列表”" class="headerlink" title="选中需要更改的标题级别,点击上方多级列表,选择“定义新的多级列表”"></a>选中需要更改的标题级别,点击上方多级列表,选择“定义新的多级列表”</h4><p><img data-src="https://img-blog.csdnimg.cn/20191102163811182.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="选定需要改变的级别,更改起始的序号"><a href="#选定需要改变的级别,更改起始的序号" class="headerlink" title="选定需要改变的级别,更改起始的序号"></a>选定需要改变的级别,更改起始的序号</h4><p><img data-src="https://img-blog.csdnimg.cn/20191102165208736.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20191102164013517.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20191102165226650.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="最终结果,其他可根据此教程自行完成"><a href="#最终结果,其他可根据此教程自行完成" class="headerlink" title="最终结果,其他可根据此教程自行完成"></a>最终结果,其他可根据此教程自行完成</h4><p><img data-src="https://img-blog.csdnimg.cn/20191102164035655.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>更多资源分享及交流,软件分享等,请关注:<br><img data-src="https://img-blog.csdnimg.cn/20191102165726223.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/efccf9f7.html#disqus_thread</comments>
</item>
<item>
<title>基于Hexo博客框架添加自定义开发的HTML开源地图页面</title>
<link>https://www.ganahe.top/archives/53e3dc56.html</link>
<guid>https://www.ganahe.top/archives/53e3dc56.html</guid>
<pubDate>Tue, 21 Apr 2020 02:41:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="一-原因及目标"><a href="#一-原因及目标" class="headerlink" title="一. 原因及目标"></a>一. 原因及目标</h1><p>在 hexo 中,如果需要自建博文,则在站点打开 bash ,执行 <code>hexo new &lt;模板&gt; &quot;title&quot;</code> 即可,其中模板有 post 即为文章,drafts 为草稿。<br>而新建菜单栏,则执行<code>hexo new page &quot;菜单名&quot;</code> 即可。<br>新建文章或是菜单后我们会发现,在博客 source 文件夹下,对应的文件都是 .md 文件,在部署时,执行 <code>hexo clean &amp;&amp; hexo g -d</code>会对 .md 文件进行渲染以生成 html 格式文件。<br>那当我们有已经设计好的 HTML 文件想要加入到博客中,显然不可能直接把 HTML 放在 _post 文件夹下或是菜单对应的文件夹下,不然 HTML 文件会被再渲染,内容会丢失(为什么会这么说呢?实测……)。<br>下面提供一个通过菜单栏访问该 HTML 文件的办法。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="一-原因及目标"><a href="#一-原因及目标" class="headerlink" title="一. 原因及目标"></a>一. 原因及目标</h1><p>在 hexo 中,如果需要自建博文,则在站点打开 bash ,执行 <code>hexo new <模板> "title"</code> 即可,其中模板有 post 即为文章,drafts 为草稿。<br>而新建菜单栏,则执行<code>hexo new page "菜单名"</code> 即可。<br>新建文章或是菜单后我们会发现,在博客 source 文件夹下,对应的文件都是 .md 文件,在部署时,执行 <code>hexo clean && hexo g -d</code>会对 .md 文件进行渲染以生成 html 格式文件。<br>那当我们有已经设计好的 HTML 文件想要加入到博客中,显然不可能直接把 HTML 放在 _post 文件夹下或是菜单对应的文件夹下,不然 HTML 文件会被再渲染,内容会丢失(为什么会这么说呢?实测……)。<br>下面提供一个通过菜单栏访问该 HTML 文件的办法。</p><a id="more"></a><p>目标 HTML 文件为已经设计好的,基于 Web GIS 和开源地图 OpenStreetMap(OSM) 开发的地图。<br>采用 C# 进行开发,效果有:<br><img data-src="https://img-blog.csdnimg.cn/20200421094837819.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="开发文件"><br><img data-src="https://img-blog.csdnimg.cn/20200421095119742.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="已开发的web地图效果"><br>现在进行下一步操作。<br>注意,本人环境为 Windows 10 , Hexo 4.0,NexT 7.8.0。</p><h1 id="二-建立自定义文件"><a href="#二-建立自定义文件" class="headerlink" title="二. 建立自定义文件"></a>二. 建立自定义文件</h1><p>在站点 source 文件夹下,建立用于保存(索引)的文件夹,本人自定义为 DIYWeb,在该文件再建立其他的文件夹,对应的文件夹功能加入 HTML 文件,并命名为 index.html。<br><img data-src="https://img-blog.csdnimg.cn/20200421095926945.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="DIYWeb文件"><br><img data-src="https://img-blog.csdnimg.cn/20200421095956219.png#pic_center" alt="DIYWeb文件下目录"><br>这里我自定义了 404 / map 两个页面,map 即为本文需要的示例地图文件。下辖的文件如下:<br><img data-src="https://img-blog.csdnimg.cn/20200421100128609.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="HTML 文件"><br>此处,只需要有 HTML 文件即可,其他文件为本人设计的地图依赖文件。</p><h1 id="三-跳过渲染"><a href="#三-跳过渲染" class="headerlink" title="三. 跳过渲染"></a>三. 跳过渲染</h1><h2 id="(一)配置"><a href="#(一)配置" class="headerlink" title="(一)配置"></a>(一)配置</h2><p>HTML 文件我们已经做出来,就不再需要 hexo 框架进行再一次渲染了。</p><p>Hexo 提供了跳过渲染的方法:<br>在博客根目录的配置文件_config.yml文件里,进行如下配置:</p><figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 跳过渲染</span></span><br><span class="line">skip_render:</span><br><span class="line"> - <span class="string">"DIYWeb/map/*"</span> <span class="comment"># t添加的地方</span></span><br><span class="line"> - <span class="string">"DIYWeb/404/*"</span></span><br></pre></td></tr></table></figure><h2 id="(二)说明"><a href="#(二)说明" class="headerlink" title="(二)说明"></a>(二)说明</h2><p>如果你只是在 source 建立一个文件夹的话,比如 直接在 DIYWeb 文件夹放入 HTML 文件,则修改路径为 <code>"DIYWeb/*"</code>即可。</p><p>当然,如果你建立的模式跟我的一样,但是 类似 404、map 子文件夹特别多,则不可能一个个都添加,此时可设定为:<code>"DIYWeb/**"</code>。</p><h1 id="二-next主题菜单栏设计"><a href="#二-next主题菜单栏设计" class="headerlink" title="二. next主题菜单栏设计"></a>二. next主题菜单栏设计</h1><p>next主题是Hexo博客框架的一个广泛使用的主题,其菜单栏视图如下:<br><img data-src="https://img-blog.csdnimg.cn/20200421091619411.png#pic_center" alt="Hexo菜单栏"><br>由于不需要 .md 文件去渲染,那我们 dock 可不必去使用 <code>hexo new</code> 命令去建立文章或是菜单栏及其菜单栏文件。</p><p>菜单栏的添加,直接在 next 主题配置文件 _config.yml直接添加字段即可。</p><h2 id="(一)添加菜单"><a href="#(一)添加菜单" class="headerlink" title="(一)添加菜单"></a>(一)添加菜单</h2><p>打开 next 主题配置文件 _config.yml,<br>路径一般为站点目录下,themes\next_config.yml。<br>在 menu 菜单设定添加 map 菜单字段及图标<br><code>map: /DIYWeb/map/ || fa fa-sitemap</code>:<br><img data-src="https://img-blog.csdnimg.cn/20200421101104859.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="添加菜单及图标"><br>注意,这步骤很重要,该步骤设定菜单及图标外,还设定了菜单链接的 html 文件,<code>/DIYWeb/map/</code> 改成自己设定的文件目录。</p><h2 id="(二)对应语言文件配置"><a href="#(二)对应语言文件配置" class="headerlink" title="(二)对应语言文件配置"></a>(二)对应语言文件配置</h2><p>在 themes\next\languages\zh-CN.yml 添加 map 字段的文本:<br><img data-src="https://img-blog.csdnimg.cn/20200421101455399.png#pic_center" alt="map"></p><h2 id="三)菜单效果"><a href="#三)菜单效果" class="headerlink" title="(三)菜单效果"></a>(三)菜单效果</h2><p><img data-src="https://img-blog.csdnimg.cn/2020042110194047.png#pic_center" alt="菜单栏"></p><h1 id="三-效果"><a href="#三-效果" class="headerlink" title="三. 效果"></a>三. 效果</h1><p><img data-src="https://img-blog.csdnimg.cn/2020042110203723.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="加载的地图文件"><br>GIF动态效果:<br><img data-src="https://img-blog.csdnimg.cn/20200421103459299.gif#pic_center" alt="GIF"></p><h1 id="四-查看实例"><a href="#四-查看实例" class="headerlink" title="四. 查看实例"></a>四. 查看实例</h1><ol><li><a href="https://www.ganahe.top/DIYWeb/map/">配置部署后的在线地图</a></li><li><a href="https://www.ganahe.top/">本人 Hexo 博客</a></li></ol><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/53e3dc56.html#disqus_thread</comments>
</item>
<item>
<title>12306 Tickets version1.0 使用指南</title>
<link>https://www.ganahe.top/archives/38231.html</link>
<guid>https://www.ganahe.top/archives/38231.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><table><thead><tr><th align="center">序号</th><th align="center">特别说明</th></tr></thead><tbody><tr><td align="center">1</td><td align="center"><strong>本软件不具备抢票功能!!!</strong></td></tr><tr><td align="center">2</td><td align="center">本软件只作为自动化工具,减少手动操作的繁琐!!</td></tr><tr><td align="center">3</td><td align="center">部分功能还需要完善,但由于当前事情较忙,<br>更新版本会相对较慢,开发队伍:@一直憨憨一直爽!<br>@哈哈哈哈哈 @kgiu @GanAH @嗷呜不是喵呜!【都什么鬼昵称….】</td></tr><tr><td align="center">4</td><td align="center">核心代码参照GitHub大神的代码,经过简单修改,<br>加上GUI界面而得,参考代码地址:本项目开源地址:–&gt;</td></tr><tr><td align="center">5</td><td align="center">注意:当前仅支持Chrome浏览器,且仅支持chrome.78 及以上版本,若没有请在获取时选择相应的打包版本(chrome文件夹下)或是自行下载安装。</td></tr></tbody></table><h1 id="一-功能说明"><a href="#一-功能说明" class="headerlink" title="一. 功能说明"></a>一. 功能说明</h1><ol><li>实现12306自动化订票任务;</li><li>可进行多人订票任务;</li><li>采用Chrome浏览器插件执行,非脚本直接爬取进行post提交,相对安全;</li><li>所有数据均不会保存,亦不会上传到云端,运行如有防火墙警告,为正常现象,确认使用即可,不会危害电脑安全,也不会窃取个人信息,可参见源代码。</li></ol>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><table><thead><tr><th align="center">序号</th><th align="center">特别说明</th></tr></thead><tbody><tr><td align="center">1</td><td align="center"><strong>本软件不具备抢票功能!!!</strong></td></tr><tr><td align="center">2</td><td align="center">本软件只作为自动化工具,减少手动操作的繁琐!!</td></tr><tr><td align="center">3</td><td align="center">部分功能还需要完善,但由于当前事情较忙,<br>更新版本会相对较慢,开发队伍:@一直憨憨一直爽!<br>@哈哈哈哈哈 @kgiu @GanAH @嗷呜不是喵呜!【都什么鬼昵称….】</td></tr><tr><td align="center">4</td><td align="center">核心代码参照GitHub大神的代码,经过简单修改,<br>加上GUI界面而得,参考代码地址:本项目开源地址:–></td></tr><tr><td align="center">5</td><td align="center">注意:当前仅支持Chrome浏览器,且仅支持chrome.78 及以上版本,若没有请在获取时选择相应的打包版本(chrome文件夹下)或是自行下载安装。</td></tr></tbody></table><h1 id="一-功能说明"><a href="#一-功能说明" class="headerlink" title="一. 功能说明"></a>一. 功能说明</h1><ol><li>实现12306自动化订票任务;</li><li>可进行多人订票任务;</li><li>采用Chrome浏览器插件执行,非脚本直接爬取进行post提交,相对安全;</li><li>所有数据均不会保存,亦不会上传到云端,运行如有防火墙警告,为正常现象,确认使用即可,不会危害电脑安全,也不会窃取个人信息,可参见源代码。</li></ol><a id="more"></a><p><strong>视频效果展示:</strong></p><iframe src="//player.bilibili.com/player.html?aid=81578045&bvid=BV1WJ411b7rg&cid=139591153&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe><blockquote><p>这是发布在bilibili视频平台上的原创视频</p></blockquote><h1 id="二-界面展示,安装说明及基本操作"><a href="#二-界面展示,安装说明及基本操作" class="headerlink" title="二. 界面展示,安装说明及基本操作"></a>二. 界面展示,安装说明及基本操作</h1><p>操作界面如下:<br><img data-src="https://img-blog.csdnimg.cn/20191228104504573.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><p>信息填写区域如下图,cookies的填写请往下查看:<br><img data-src="https://img-blog.csdnimg.cn/20191228104532549.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><p>对于乘员信息,查看12306官网,如下图,比如:王大法,如果为学生,填写格式为王大法(学生),注意为英文的括号:</p><p><img data-src="https://img-blog.csdnimg.cn/20191228104557157.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><p>==实际测试效果视频==</p><p>[video(video-I8WVAizY-1577849679491)(type-bilibili)(url-<a href="https://player.bilibili.com/player.html?aid=81578045)(image-https://ss.csdn.net/p?http://i2.hdslb.com/bfs/archive/65e149bf02f3b55dd0f616cd013cb5ef1f066019.jpg)(title-12306Tickets软件测试自动订火车票【非抢票】)]" target="_blank" rel="noopener">https://player.bilibili.com/player.html?aid=81578045)(image-https://ss.csdn.net/p?http://i2.hdslb.com/bfs/archive/65e149bf02f3b55dd0f616cd013cb5ef1f066019.jpg)(title-12306Tickets软件测试自动订火车票【非抢票】)]</a><br>==注:由于测试时段为当天的23:00以后,12306不允许订票,故无订票信息。==<br>为了查看效果,可前往哔哩哔哩观看高清测试视频:<a href="https://www.bilibili.com/video/av81578045" target="_blank" rel="noopener">传送门</a></p><h1 id="三-特别操作及说明"><a href="#三-特别操作及说明" class="headerlink" title="三. 特别操作及说明"></a>三. 特别操作及说明</h1><h2 id="(一)-关于cookies值的获取方式:"><a href="#(一)-关于cookies值的获取方式:" class="headerlink" title="(一). 关于cookies值的获取方式:"></a>(一). 关于cookies值的获取方式:</h2><p>方法一(推荐) 复制如下代码:</p><p><img data-src="https://img-blog.csdnimg.cn/2019122810465060.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="literal">None</span></span><br></pre></td></tr></table></figure><p>方法二 (需要熟悉HTML的格式及网站源代码)Chrome</p><ol><li>定位到订票界面:</li></ol><p><img data-src="https://img-blog.csdnimg.cn/20191228104710741.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><ol start="2"><li>点击F12,弹出如下窗口:</li></ol><p><img data-src="https://img-blog.csdnimg.cn/20191228104712965.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><ol start="3"><li>接下来的操作步骤如下图中标识:</li></ol><p><img data-src="https://img-blog.csdnimg.cn/20191228104826373.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><ol start="4"><li>jc_save_fromstation的Value填入始发站cookies,jc_save_tostation填入终点站cookies,此时可以顺便计下需要指定列车对应的从上到下的序号,或是不指定由软件自动选择。</li></ol><h2 id="(二)-关于邮件通知系统的登录授权码获取"><a href="#(二)-关于邮件通知系统的登录授权码获取" class="headerlink" title="(二). 关于邮件通知系统的登录授权码获取"></a><strong>(二). 关于邮件通知系统的登录授权码获取</strong></h2><p>目前仅支持QQ邮箱系统,后续将会添加网易163系统。</p><blockquote><p>特别说明:添加邮箱不需要邮箱的账户密码,只需授权码即可,保护邮箱安全!</p></blockquote><p>具体获取授权码方法:</p><p>登录网页版QQ邮箱,找到:设置-账户-POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务,生成授权码,填入即可。</p><p><img data-src="https://img-blog.csdnimg.cn/20191228104857721.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="(三)-关于Chrome版本信息查看问题"><a href="#(三)-关于Chrome版本信息查看问题" class="headerlink" title="(三). 关于Chrome版本信息查看问题"></a>(三). 关于Chrome版本信息查看问题</h2><ol><li><p>打开chrome,找到右上角并执行图示操作:</p><p><img data-src="https://img-blog.csdnimg.cn/20191228105007267.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p></li><li><p>打开即可看到当前的Chrome版本信息,软件当前支持78.0以上版本。</p></li></ol><p><img data-src="https://img-blog.csdnimg.cn/20191228104937808.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h1 id="四-新版本更新及发布获取渠道"><a href="#四-新版本更新及发布获取渠道" class="headerlink" title="四. 新版本更新及发布获取渠道"></a>四. 新版本更新及发布获取渠道</h1><table><thead><tr><th>渠道一</th><th>微信公众号:<a href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzUxNDkyMTQ1Nw==&scene=126&bizpsid=1558318813#wechat_redirect" target="_blank" rel="noopener">点击</a></th></tr></thead><tbody><tr><td>渠道二</td><td>GitHub仓库:<a href="https://github.com/GanAH/12306Tickets" target="_blank" rel="noopener"><strong>点击</strong></a></td></tr></tbody></table><p>微信公众号后台回复:Ticket即可,此时会返回几个下载链接,自行选择便好。</p><h1 id="五-当前版本特性"><a href="#五-当前版本特性" class="headerlink" title="五. 当前版本特性"></a>五. 当前版本特性</h1><ol><li>可订票时间限制到2月29日;</li><li>采用浏览器插件实现模拟操作;</li><li>可进行邮箱通知;</li><li>座位选择;</li><li>多人同时选座(12306账户下需要有该乘员的信息)。</li></ol><h1 id="六-预期新版本特性(不定时更新,大概)"><a href="#六-预期新版本特性(不定时更新,大概)" class="headerlink" title="六. 预期新版本特性(不定时更新,大概)"></a>六. 预期新版本特性(不定时更新,大概)</h1><ol><li>耗时监测,完善监测信息,定位错误源,确保软件稳定性;</li><li>定时订票(自动识别验证码,当前未完成,需手动点击),邮件通知;</li><li>界面美化(任务逻辑完成后);</li><li>防反爬;</li><li>多线程监测与订票;</li><li>PC端迁移到移动端,实现云端挂载订票(可能);<br>件稳定性;</li><li>定时订票(自动识别验证码,当前未完成,需手动点击),邮件通知;</li><li>界面美化(任务逻辑完成后);</li><li>防反爬;</li><li>多线程监测与订票;</li><li>PC端迁移到移动端,实现云端挂载订票(可能);</li><li>…….(肯定还有,但没想好——)</li></ol><p>七. 微信公众号【合作】<br><img data-src="https://img-blog.csdnimg.cn/20191228105128547.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/38231.html#disqus_thread</comments>
</item>
<item>
<title>Swing在界面的JPanel面板中中添加图片</title>
<link>https://www.ganahe.top/archives/2551.html</link>
<guid>https://www.ganahe.top/archives/2551.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><p><img data-src="Java%E7%9A%84Swing%E5%9C%A8%E7%95%8C%E9%9D%A2%E7%9A%84JPanel%E9%9D%A2%E6%9D%BF%E4%B8%AD%E4%B8%AD%E6%B7%BB%E5%8A%A0%E5%9B%BE%E7%89%87%20/Gmxu90.jpg" alt></p><h4 id="需求分析"><a href="#需求分析" class="headerlink" title="需求分析"></a>需求分析</h4><ul><li>在JPanel中添加图片;</li><li>将绘有图片的JPanel组件添加到JFrame界面中,实现切割组件放置效果。</li></ul>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><p><img data-src="Java%E7%9A%84Swing%E5%9C%A8%E7%95%8C%E9%9D%A2%E7%9A%84JPanel%E9%9D%A2%E6%9D%BF%E4%B8%AD%E4%B8%AD%E6%B7%BB%E5%8A%A0%E5%9B%BE%E7%89%87%20/Gmxu90.jpg" alt></p><h4 id="需求分析"><a href="#需求分析" class="headerlink" title="需求分析"></a>需求分析</h4><ul><li>在JPanel中添加图片;</li><li>将绘有图片的JPanel组件添加到JFrame界面中,实现切割组件放置效果。</li></ul><a id="more"></a><h3 id="方法一:使用Toolkit-getDefaultToolkit-getImage-“图片路径”-获取可编辑的图片"><a href="#方法一:使用Toolkit-getDefaultToolkit-getImage-“图片路径”-获取可编辑的图片" class="headerlink" title="方法一:使用Toolkit.getDefaultToolkit().getImage(“图片路径”);获取可编辑的图片"></a>方法一:使用Toolkit.getDefaultToolkit().getImage(“图片路径”);获取可编辑的图片</h3><p>代码示例如下:</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">Image image = Toolkit.getDefaultToolkit().getImage(<span class="string">"图片路径"</span>);</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">ImagePanel</span> <span class="keyword">extends</span> <span class="title">JPanel</span> </span>{</span><br><span class="line"> <span class="keyword">private</span> Image image = <span class="keyword">null</span>;</span><br><span class="line"></span><br><span class="line"> <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">paintImage</span><span class="params">(Image image)</span> </span>{</span><br><span class="line"> <span class="keyword">this</span>.image = image;</span><br><span class="line"> <span class="keyword">this</span>.repaint();</span><br><span class="line"> }</span><br><span class="line"> <span class="meta">@Override</span></span><br><span class="line"> <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">paintComponent</span><span class="params">(Graphics g)</span> </span>{</span><br><span class="line"> <span class="keyword">super</span>.paintComponent(g);</span><br><span class="line"> g.drawImage(image, <span class="number">0</span>, <span class="number">0</span>, <span class="keyword">this</span>.getWidth(), <span class="keyword">this</span>.getHeight(), <span class="keyword">null</span>);</span><br><span class="line"> }</span><br><span class="line"> }</span><br></pre></td></tr></table></figure><p>即就是继承JComponent类重写paint方法,自己绘制图片(实际使用中比较麻烦,如仅仅是显示图片而不做操作,不推荐使用该方式)。</p><h3 id="方法二-:直接在JLabel中加入图片,再将JLabel加入JPanel中-推荐"><a href="#方法二-:直接在JLabel中加入图片,再将JLabel加入JPanel中-推荐" class="headerlink" title="方法二 :直接在JLabel中加入图片,再将JLabel加入JPanel中(推荐)"></a>方法二 :直接在JLabel中加入图片,再将JLabel加入JPanel中(推荐)</h3><p>Demo:</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Demo</span></span>{</span><br><span class="line"> <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">setAdjustmentWindow</span><span class="params">(JPanel panel, JFrame frame)</span></span></span><br><span class="line"><span class="function"> </span>{</span><br><span class="line"> JLabel label = <span class="keyword">new</span> JLabel();</span><br><span class="line"> label.setIcon(<span class="keyword">new</span> ImageIcon(<span class="string">"soure/res/leftup.png"</span>));<span class="comment">//文件路径</span></span><br><span class="line"> adjustmentWindow.add(label);</span><br><span class="line"> }</span><br><span class="line"> }</span><br></pre></td></tr></table></figure><p>使用该方法时,将JFrame组件及已定义并设定好在JFrame上的JPanel组件传入:</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">xxx</span></span>{</span><br><span class="line">....(省略)</span><br><span class="line">JFrame frame = <span class="keyword">new</span> JFrame(<span class="string">"Demo"</span>);</span><br><span class="line">JPanel Panel = <span class="keyword">new</span> JPanel();</span><br><span class="line"><span class="comment">//调用方法设置</span></span><br><span class="line"><span class="keyword">new</span> Demo().setGeodeticIssueWindow(Panel,frame);</span><br><span class="line">frame.add(Panel);</span><br><span class="line">frame.pack();</span><br><span class="line">frame.setVisible(<span class="keyword">true</span>);</span><br><span class="line">fFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); </span><br><span class="line">}</span><br></pre></td></tr></table></figure><h3 id="效果"><a href="#效果" class="headerlink" title="效果"></a>效果</h3><p><img data-src="https://img-blog.csdnimg.cn/20190828145453906.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_80" alt="在这里插入图片描述"></p><h2 id="更多内容及免费资源,请关注:"><a href="#更多内容及免费资源,请关注:" class="headerlink" title="更多内容及免费资源,请关注:"></a>更多内容及免费资源,请关注:</h2><p><img data-src="https://img-blog.csdnimg.cn/2019082814564184.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_80" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/2551.html#disqus_thread</comments>
</item>
<item>
<title>Python简单几行代码实现黑客电影镜头屏幕画面</title>
<link>https://www.ganahe.top/archives/23547.html</link>
<guid>https://www.ganahe.top/archives/23547.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><blockquote><p>通过几行简单的Python代码实现炫酷的数据流动效果</p></blockquote><h3 id="一-Python版本:Python3"><a href="#一-Python版本:Python3" class="headerlink" title="一.Python版本:Python3"></a>一.Python版本:Python3</h3><h3 id="二-操作示范"><a href="#二-操作示范" class="headerlink" title="二.操作示范"></a>二.操作示范</h3><p>为了显得更加<del>牛逼</del> 逼真,通常不会直接运行源代码文本,一种操作如下:</p><ol><li>在文本编辑器中写好源代码,将文本命名保存在某个硬盘位置中,此处假设命名为try.py,文件路径为E:Test\go\try.py;</li><li>在桌面新建一个文本文件,在文件里编辑如下内容:</li></ol><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">E:</span></span><br><span class="line"><span class="function"><span class="title">cd</span> <span class="title">Test</span>\<span class="title">go</span></span></span><br><span class="line"><span class="function"><span class="title">python</span> <span class="title">try.py</span></span></span><br></pre></td></tr></table></figure><iframe src="//player.bilibili.com/player.html?aid=68824248&bvid=BV1QJ411M7fc&cid=119277367&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe><blockquote><p>声明:视频为发布于bilibili视频平台的原创视频</p></blockquote>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><blockquote><p>通过几行简单的Python代码实现炫酷的数据流动效果</p></blockquote><h3 id="一-Python版本:Python3"><a href="#一-Python版本:Python3" class="headerlink" title="一.Python版本:Python3"></a>一.Python版本:Python3</h3><h3 id="二-操作示范"><a href="#二-操作示范" class="headerlink" title="二.操作示范"></a>二.操作示范</h3><p>为了显得更加<del>牛逼</del> 逼真,通常不会直接运行源代码文本,一种操作如下:</p><ol><li>在文本编辑器中写好源代码,将文本命名保存在某个硬盘位置中,此处假设命名为try.py,文件路径为E:Test\go\try.py;</li><li>在桌面新建一个文本文件,在文件里编辑如下内容:</li></ol><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">E:</span></span><br><span class="line"><span class="function"><span class="title">cd</span> <span class="title">Test</span>\<span class="title">go</span></span></span><br><span class="line"><span class="function"><span class="title">python</span> <span class="title">try.py</span></span></span><br></pre></td></tr></table></figure><iframe src="//player.bilibili.com/player.html?aid=68824248&bvid=BV1QJ411M7fc&cid=119277367&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen></iframe><blockquote><p>声明:视频为发布于bilibili视频平台的原创视频</p></blockquote><a id="more"></a><p>cd 后面所接的为源代码try.py文件所在文件目录路径。</p><ol start="3"><li><p>完成以上操作后,保存该文件为go.bat;</p></li><li><p>双击该文件,完成。</p></li><li><p>注意,此方法一定要先配置python的系统环境变量设置,一般安装python后都会进行此操作,如未配置环境变量,可按照如下设置:<br>简要方法:在环境变量中添加Python目录</p><pre><code>(1) 安装好Python后,右键点击"计算机",然后点击"属性";(2) 然后点击"高级系统设置";(3) 选择"系统变量"窗口下面的"Path",双击打开或点击右侧添加选项;(4) 然后在"Path"行,添加python安装路径;(5) 更详细教程请自行搜索。</code></pre><h3 id="三-python文件源代码"><a href="#三-python文件源代码" class="headerlink" title="三.python文件源代码"></a>三.python文件源代码</h3></li></ol><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> fractions <span class="keyword">import</span> Fraction</span><br><span class="line"><span class="keyword">import</span> time</span><br><span class="line"></span><br><span class="line">x = Fraction(<span class="number">3</span>, <span class="number">5</span>)</span><br><span class="line">y = Fraction(<span class="number">1</span>, <span class="number">5</span>)</span><br><span class="line">count = <span class="number">0</span></span><br><span class="line">time.sleep(<span class="number">10</span>)</span><br><span class="line"><span class="keyword">while</span> x < <span class="number">10</span>:</span><br><span class="line"> print(x)</span><br><span class="line"> time.sleep(<span class="number">0.05</span>)</span><br><span class="line"> x = x * y - <span class="number">1</span></span><br><span class="line"> count = count + <span class="number">1</span></span><br><span class="line"> <span class="keyword">if</span> count == <span class="number">100000</span>:</span><br><span class="line"> <span class="keyword">break</span></span><br><span class="line">time.sleep(<span class="number">10</span>)</span><br></pre></td></tr></table></figure><h3 id="四-效果欣赏(自行界面配置,会有不同的视觉效果)"><a href="#四-效果欣赏(自行界面配置,会有不同的视觉效果)" class="headerlink" title="四.效果欣赏(自行界面配置,会有不同的视觉效果)"></a>四.效果欣赏(自行界面配置,会有不同的视觉效果)</h3><p><img data-src="https://img-blog.csdnimg.cn/20190829152327922.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190829152413576.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190829152506207.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190829152601603.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>实时视频录制效果链接查看:<br>1.微信:<a href="https://mp.weixin.qq.com/s/mFF2NG5xxULFBl0RO8wFiA" target="_blank" rel="noopener">https://mp.weixin.qq.com/s/mFF2NG5xxULFBl0RO8wFiA</a><br>2.bilibili:<a href="https://www.bilibili.com/video/av68824248" target="_blank" rel="noopener">https://www.bilibili.com/video/av68824248</a></p><p>[video(video-z6Jyv6ME-1574862952808)(type-bilibili)(url-<a href="https://player.bilibili.com/player.html?aid=68824248)(image-https://ss.csdn.net/p?http://i0.hdslb.com/bfs/archive/4115cca6ea7a345d1720b793d63c096bbfd892f4.jpg)(title-黑客视觉–Python简单几行代码实现黑客电影特效镜头屏幕画面)]" target="_blank" rel="noopener">https://player.bilibili.com/player.html?aid=68824248)(image-https://ss.csdn.net/p?http://i0.hdslb.com/bfs/archive/4115cca6ea7a345d1720b793d63c096bbfd892f4.jpg)(title-黑客视觉–Python简单几行代码实现黑客电影特效镜头屏幕画面)]</a></p><h3 id="五-更多资源分享及精彩内容,请关注:"><a href="#五-更多资源分享及精彩内容,请关注:" class="headerlink" title="五.更多资源分享及精彩内容,请关注:"></a>五.更多资源分享及精彩内容,请关注:</h3><p><img data-src="https://img-blog.csdnimg.cn/20190924122039189.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述">ilibli</p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/23547.html#disqus_thread</comments>
</item>
<item>
<title>TortoiseGit推送代码到阿里云git托管或gitlab仓库报错error:failed to push some refs to '[email protected]_XXX.git'</title>
<link>https://www.ganahe.top/archives/3823128.html</link>
<guid>https://www.ganahe.top/archives/3823128.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>最近在做项目时,提交代码出现了很多问题,其中有很多细节需要注意。<br>其中有个问题也算是比较常见,但是容易忽略(项目管理员出来挨打)。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>最近在做项目时,提交代码出现了很多问题,其中有很多细节需要注意。<br>其中有个问题也算是比较常见,但是容易忽略(项目管理员出来挨打)。</p><a id="more"></a><h2 id="报错界面"><a href="#报错界面" class="headerlink" title="报错界面"></a>报错界面</h2><p><img data-src="https://img-blog.csdnimg.cn/20190411101738854.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="报错情况"></p><h2 id="查看设置"><a href="#查看设置" class="headerlink" title="查看设置"></a>查看设置</h2><p><img data-src="https://img-blog.csdnimg.cn/20190411101930664.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><h2 id="commit到本地库并pull"><a href="#commit到本地库并pull" class="headerlink" title="commit到本地库并pull"></a>commit到本地库并pull</h2><p><img data-src="https://img-blog.csdnimg.cn/20190411102235546.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="commit">)<img data-src="https://img-blog.csdnimg.cn/20190411102343834.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="pull"></p><h3 id="这样是没有任何问题的,设置无误,提交并pull也没有问题,但是push到远端代码仓时却报错了,找了很多方法都没有解决。"><a href="#这样是没有任何问题的,设置无误,提交并pull也没有问题,但是push到远端代码仓时却报错了,找了很多方法都没有解决。" class="headerlink" title="这样是没有任何问题的,设置无误,提交并pull也没有问题,但是push到远端代码仓时却报错了,找了很多方法都没有解决。"></a>这样是没有任何问题的,设置无误,提交并pull也没有问题,但是push到远端代码仓时却报错了,找了很多方法都没有解决。</h3><h2 id="原因?"><a href="#原因?" class="headerlink" title="原因?"></a>原因?</h2><h3 id="You-are-not-allowed-to-push-code-to-protected-branches-on-this-project-To-code-aliyun-com-XXX-server-git"><a href="#You-are-not-allowed-to-push-code-to-protected-branches-on-this-project-To-code-aliyun-com-XXX-server-git" class="headerlink" title="You are not allowed to push code to protected branches on this project. To code.aliyun.com:XXX_server.git"></a>You are not allowed to push code to protected branches on this project. To code.aliyun.com:XXX_server.git</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">You are not allowed to push code to protected branches on this project. To code.aliyun.com:XXX_server.git</span><br></pre></td></tr></table></figure><h2 id="联系项目管理员发现是我的分支被保护了,需要管理员授权开启即可。"><a href="#联系项目管理员发现是我的分支被保护了,需要管理员授权开启即可。" class="headerlink" title="- 联系项目管理员发现是我的分支被保护了,需要管理员授权开启即可。"></a>- 联系项目管理员发现是我的分支被保护了,需要管理员授权开启即可。</h2><h2 id="接触限制后,设置一项(图二-)不需要ppk文件,直接推送即可。"><a href="#接触限制后,设置一项(图二-)不需要ppk文件,直接推送即可。" class="headerlink" title="接触限制后,设置一项(图二*)不需要ppk文件,直接推送即可。"></a><em>接触限制后,设置一项(</em>图二*)不需要ppk文件,直接推送即可。</h2><h2 id="联系交流"><a href="#联系交流" class="headerlink" title="联系交流"></a>联系交流</h2><p>微信公众号,更多成长分享<br><img data-src="https://img-blog.csdnimg.cn/20190405205224346.jpg" alt="不定期分享资源"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/3823128.html#disqus_thread</comments>
</item>
<item>
<title>基于ArcGIS的新冠病毒分析与数据可视化</title>
<link>https://www.ganahe.top/archives/38231123.html</link>
<guid>https://www.ganahe.top/archives/38231123.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="一、-前言"><a href="#一、-前言" class="headerlink" title="一、 前言"></a>一、 前言</h2><h3 id="一-背景与意义"><a href="#一-背景与意义" class="headerlink" title="(一) 背景与意义"></a>(一) 背景与意义</h3><p>2019新型冠状病毒(2019-nCoV),于2019年武汉病毒性肺炎病例而被发现,是以前从未在人体中发现的冠状病毒新毒株,给我们国家带来了巨大的伤痛,困扰了每一个家庭,给原本该喜气洋洋的春节蒙上了一层阴影。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="一、-前言"><a href="#一、-前言" class="headerlink" title="一、 前言"></a>一、 前言</h2><h3 id="一-背景与意义"><a href="#一-背景与意义" class="headerlink" title="(一) 背景与意义"></a>(一) 背景与意义</h3><p>2019新型冠状病毒(2019-nCoV),于2019年武汉病毒性肺炎病例而被发现,是以前从未在人体中发现的冠状病毒新毒株,给我们国家带来了巨大的伤痛,困扰了每一个家庭,给原本该喜气洋洋的春节蒙上了一层阴影。</p><a id="more"></a><h3 id="二-前期数据收集"><a href="#二-前期数据收集" class="headerlink" title="(二) 前期数据收集"></a>(二) 前期数据收集</h3><p>基于ArcGIS等,我们可以分析不同时期病毒的感染情况,并针对一段时间进行数据可视化,以便于横向对比,便于专业人员直观地获取信息并分析。<br>收集数据的途径如下:<br>(1) 矢量图:省级行政区.shp、省会城市.shp 、武汉市区划、县道等shp矢量文件;<br>(2) 武汉社区风险度.xlsx ; (3) 百度实时疫情大数据; (4) 武汉市矢量地图(shp) ;(5) <a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank" rel="noopener">百度地图坐标拾取</a>。</p><h2 id="二、-基于ArcGIS的新冠病毒分级统计图分析"><a href="#二、-基于ArcGIS的新冠病毒分级统计图分析" class="headerlink" title="二、 基于ArcGIS的新冠病毒分级统计图分析"></a>二、 基于ArcGIS的新冠病毒分级统计图分析</h2><h3 id="(一)ArcGIS的操作简要流程"><a href="#(一)ArcGIS的操作简要流程" class="headerlink" title="(一)ArcGIS的操作简要流程"></a>(一)ArcGIS的操作简要流程</h3><ol><li>在ArcGIS建立新的地图模板;</li><li>导入省级行政区.shp、省会城市.shp;<br><img data-src="https://img-blog.csdnimg.cn/20200221182530666.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></li><li>根据省级行政区矢量图属性表找到省字段,对应的字段名为NAME,故收集好不同省的确诊人数、治愈人数以及死亡人数,将省对应的列头改为NAME,其余可不改,保存为以逗号隔开的csv文件;<br><img data-src="https://img-blog.csdnimg.cn/20200221182440656.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></li><li>导入csv文件,并链接到省级行政区,待字段匹配后即可进行后续操作;<br><img data-src="https://img-blog.csdnimg.cn/20200221182616778.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200221182626177.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></li><li>右键在“符号系统-分级色彩”设定不同的级别与对应的颜色,制作分级统计图。<br><img data-src="https://img-blog.csdnimg.cn/20200221182645656.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><h3 id="(二)最终效果"><a href="#(二)最终效果" class="headerlink" title="(二)最终效果"></a>(二)最终效果</h3>加上图例等,最终结果如下:<br><img data-src="https://img-blog.csdnimg.cn/20200221182210861.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200221182238725.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200221182249972.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>==图1 全国新型冠状病毒肺炎情况(2-19-组图)==</li></ol><h2 id="三、-基于ArcGIS的武汉社区风险度图"><a href="#三、-基于ArcGIS的武汉社区风险度图" class="headerlink" title="三、 基于ArcGIS的武汉社区风险度图"></a>三、 基于ArcGIS的武汉社区风险度图</h2><h3 id="(一)获取坐标"><a href="#(一)获取坐标" class="headerlink" title="(一)获取坐标"></a>(一)获取坐标</h3><p>从百度地图拾取出以下街道办事处的坐标(推荐:python读取字段自动执行):<br>在这里插入图片描述<br><img data-src="https://img-blog.csdnimg.cn/20200221182836552.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>==表1 武汉部分社区感染风险度与坐标(XY-BL)==</p><h3 id="(二)ArcGIS简要操作步骤"><a href="#(二)ArcGIS简要操作步骤" class="headerlink" title="(二)ArcGIS简要操作步骤"></a>(二)ArcGIS简要操作步骤</h3><p>在ArcGIS中,此步与第一部分全国疫情图操作类似,但不需要将矢量文件与.csv文件链接;<br>直接选中.csv文件显示XY坐标,并对属性进行标注,设定颜色级别等操作。<br><img data-src="https://img-blog.csdnimg.cn/20200221184127368.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="(三)成果"><a href="#(三)成果" class="headerlink" title="(三)成果"></a>(三)成果</h3><p><img data-src="https://img-blog.csdnimg.cn/20200221184026957.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>==图2 武汉市社区感染风险度(部分)==<br>从风险度分析来看,越接近武汉市中心,对应的图块面积越大,表示感染风险度越高。</p><h2 id="四、-新冠病毒时间序列图"><a href="#四、-新冠病毒时间序列图" class="headerlink" title="四、 新冠病毒时间序列图"></a>四、 新冠病毒时间序列图</h2><p>对腾讯实时疫情大数据进行爬取(采用Python爬虫),得到从1月14日至2月19日的数据。<br>代码如下(代码参照:<a href="https://blog.csdn.net/qq_41906429/article/details/104109765,略作小改):" target="_blank" rel="noopener">https://blog.csdn.net/qq_41906429/article/details/104109765,略作小改):</a></p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> requests,re</span><br><span class="line"><span class="keyword">import</span> json</span><br><span class="line"><span class="keyword">import</span> csv</span><br><span class="line"></span><br><span class="line">url = <span class="string">'https://view.inews.qq.com/g2/getOnsInfo?name=wuwei_ww_cn_day_counts'</span></span><br><span class="line">html = requests.get(url).text</span><br><span class="line">unicodestr=json.loads(html) <span class="comment">#将string转化为dict</span></span><br><span class="line">new_list = unicodestr.get(<span class="string">"data"</span>) <span class="comment">#获取data中的内容,取出的内容为str</span></span><br><span class="line"></span><br><span class="line">a = json.loads(new_list) <span class="comment">#对new_list再次进行load,使其变为dict才可使用</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">header = [<span class="string">'日期'</span>, <span class="string">'全国确诊人数'</span>, <span class="string">'全国疑似病例'</span>, <span class="string">'全国死亡人数'</span>, <span class="string">'全国治愈人数'</span>]</span><br><span class="line"><span class="keyword">with</span> open(<span class="string">'./爬取结果.csv'</span>, encoding=<span class="string">'utf-8-sig'</span>, mode=<span class="string">'w'</span>) <span class="keyword">as</span> f: </span><br><span class="line"><span class="comment">#编码utf-8后加-sig可解决csv中文写入乱码问题</span></span><br><span class="line"> f_csv = csv.writer(f)</span><br><span class="line"> f_csv.writerow(header)</span><br><span class="line">f.close()</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">save_data</span><span class="params">(data)</span>:</span></span><br><span class="line"> <span class="keyword">with</span> open(<span class="string">'./爬取结果.csv'</span>, encoding=<span class="string">'UTF-8'</span>, mode=<span class="string">'a+'</span>,newline=<span class="string">""</span>) <span class="keyword">as</span> f: <span class="comment"># 防止自动换行</span></span><br><span class="line"> f_csv = csv.writer(f)</span><br><span class="line"> print(data)</span><br><span class="line"> f_csv.writerow(data)</span><br><span class="line"> f.close()</span><br><span class="line"></span><br><span class="line">b = len(a)</span><br><span class="line">i = <span class="number">0</span></span><br><span class="line"><span class="keyword">while</span> i<b:</span><br><span class="line"> data = (<span class="string">"\t"</span>+a[i][<span class="string">'date'</span>]) <span class="comment">#\t解决写入csv小数(日期)自动省略前后的0问题</span></span><br><span class="line"> confirm = (a[i][<span class="string">'confirm'</span>])</span><br><span class="line"> suspect = (a[i][<span class="string">'suspect'</span>])</span><br><span class="line"> dead = (a[i][<span class="string">'dead'</span>])</span><br><span class="line"> heal = (a[i][<span class="string">'heal'</span>])</span><br><span class="line"> i+=<span class="number">1</span></span><br><span class="line"> tap = (data, confirm, suspect, dead, heal)</span><br><span class="line"> save_data(tap)</span><br><span class="line">print(<span class="string">"完成爬取----"</span>)</span><br></pre></td></tr></table></figure><p>在这里插入图片描述<br><img data-src="https://img-blog.csdnimg.cn/20200221183910208.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>对应的数据进行可视化得到变化趋势图如下:</p><p><img data-src="https://img-blog.csdnimg.cn/20200221183932877.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20200221183946801.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>==图3 NCP变化趋势图==<br>从时间纵向分析,1月26日至2月17日疫情未有缓势,在2月12日突然增长。从中不难看出,在1月23日左右,由于春运所具有人员高流动性的特点,导致了之后病毒的快速传播。好消息是全国累积治愈人数呈现指数增长,疫情传播速度趋于稳定,死亡人数相对累积速度较为平缓。这不是一个冷冰冰的数字,每一个都代表一个生命,而这些离不开一线医务工作者的努力与付出,期待春天的到来,中国依旧春暖花开!</p><h2 id="四-更多资源"><a href="#四-更多资源" class="headerlink" title="四.更多资源"></a>四.更多资源</h2><p>关注:</p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/38231123.html#disqus_thread</comments>
</item>
<item>
<title>使用阿里云短信服务API实现短信验证码以及短信服务通知</title>
<link>https://www.ganahe.top/archives/3823158.html</link>
<guid>https://www.ganahe.top/archives/3823158.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>初学者刚刚接触API的使用会遇到很多坑,自己就是如此,近期参与一个项目开发,负责的其中一项即为短信服务接口,在其中也碰到了许多问题,于是想就想写这篇文章一共分享所得。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>初学者刚刚接触API的使用会遇到很多坑,自己就是如此,近期参与一个项目开发,负责的其中一项即为短信服务接口,在其中也碰到了许多问题,于是想就想写这篇文章一共分享所得。</p><a id="more"></a><p>新手上路,错误与不足之处,还望大家海涵。</p><h2 id="一-短信调用简要说明"><a href="#一-短信调用简要说明" class="headerlink" title="一 .短信调用简要说明"></a>一 .短信调用简要说明</h2><p>短信服务(Short Message Service)是阿里云为用户提供的一种通信服务的能力。</p><p>支持向国内和国际快速发送验证码、短信通知和推广短信,服务范围覆盖全球200多个国家和地区。国内短信支持三网合一专属通道,与工信部携号转网平台实时互联。电信级运维保障,实时监控自动切换,到达率高达99%。完美支撑双11期间20亿短信发送,6亿用户触达。</p><p>使用其短信服务要先申请<strong>access key</strong>,<strong>短信签名</strong>和<strong>短信模板</strong>,审核时间一般一到两个工作日就可以了。</p><p>然后<strong>确保账户有余额</strong>,一条通知短信0.0045元。</p><p>随后就可以调用API接口了,代码<strong>demo</strong>很容易理解,<strong>导入依赖或是下载对应编程语言的短信open-api-SDK</strong>到本地导入就完成准备工作。</p><p><img data-src="https://img-blog.csdnimg.cn/20190405202832938.png" alt="阿里云需要申请规范"><br>然后就是测试了,导入以上的签名模板等进入demo代码就可以了。</p><h2 id="二-官方不带签名原生态测试demo"><a href="#二-官方不带签名原生态测试demo" class="headerlink" title="二 .官方不带签名原生态测试demo"></a>二 .官方不带签名原生态测试demo</h2><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//阿里云SMS短信服务demo</span></span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.CommonRequest;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.CommonResponse;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.DefaultAcsClient;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.IAcsClient;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.exceptions.ClientException;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.exceptions.ServerException;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.http.MethodType;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.profile.DefaultProfile;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">pom.xml</span></span><br><span class="line"><span class="comment"><dependency></span></span><br><span class="line"><span class="comment"> <groupId>com.aliyun</groupId></span></span><br><span class="line"><span class="comment"> <artifactId>aliyun-java-sdk-core</artifactId></span></span><br><span class="line"><span class="comment"> <version>4.0.3</version></span></span><br><span class="line"><span class="comment"></dependency></span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line">public <span class="class"><span class="keyword">class</span> <span class="title">CommonRpc</span> </span>{</span><br><span class="line"> public <span class="keyword">static</span> <span class="keyword">void</span> main(<span class="built_in">String</span>[] args) {</span><br><span class="line"> DefaultProfile profile = DefaultProfile.getProfile(<span class="string">"cn-hangzhou"</span>, <span class="string">"<accessKeyId>"</span>, <span class="string">"<accessSecret>"</span>);</span><br><span class="line"> IAcsClient client = <span class="keyword">new</span> DefaultAcsClient(profile);</span><br><span class="line"></span><br><span class="line"> CommonRequest request = <span class="keyword">new</span> CommonRequest();</span><br><span class="line"> <span class="comment">//request.setProtocol(ProtocolType.HTTPS);</span></span><br><span class="line"> request.setMethod(MethodType.POST);</span><br><span class="line"> request.setDomain(<span class="string">"dysmsapi.aliyuncs.com"</span>);</span><br><span class="line"> request.setVersion(<span class="string">"2017-05-25"</span>);</span><br><span class="line"> request.setAction(<span class="string">"SendSms"</span>);</span><br><span class="line"> request.putQueryParameter(<span class="string">"RegionId"</span>, <span class="string">"cn-hangzhou"</span>);</span><br><span class="line"> request.putQueryParameter(<span class="string">"PhoneNumbers"</span>, <span class="string">"13027145080"</span>);</span><br><span class="line"> <span class="keyword">try</span> {</span><br><span class="line"> CommonResponse response = client.getCommonResponse(request);</span><br><span class="line"> System.out.println(response.getData());</span><br><span class="line"> } <span class="keyword">catch</span> (ServerException e) {</span><br><span class="line"> e.printStackTrace();</span><br><span class="line"> } <span class="keyword">catch</span> (ClientException e) {</span><br><span class="line"> e.printStackTrace();</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h2 id="调用结果如下"><a href="#调用结果如下" class="headerlink" title="调用结果如下"></a>调用结果如下</h2><p><img data-src="https://img-blog.csdnimg.cn/20190405201243552.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><hr><h2 id="三-以上为不带模板和签名的API调用结果-下面加入签名和模板"><a href="#三-以上为不带模板和签名的API调用结果-下面加入签名和模板" class="headerlink" title="三 .以上为不带模板和签名的API调用结果 下面加入签名和模板"></a>三 .以上为不带模板和签名的API调用结果 下面加入签名和模板</h2><hr><h2 id="带有签名和模板的demo"><a href="#带有签名和模板的demo" class="headerlink" title="带有签名和模板的demo"></a>带有签名和模板的demo</h2><p><strong>相应区块已进行注释说明,只需要替换签名,模板,以及变量的参数值就可以使用了。变量类型需要自己在申请时自定义,以下展示为个人模板,具体情况请参照模板解决</strong></p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br></pre></td><td class="code"><pre><span class="line">package com.whuseat.notify_server.south.mess_service;</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.CommonRequest;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.CommonResponse;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.DefaultAcsClient;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.IAcsClient;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.exceptions.ClientException;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.exceptions.ServerException;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.http.MethodType;</span><br><span class="line"><span class="keyword">import</span> com.aliyuncs.profile.DefaultProfile;</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 阿里云短信API调用类</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@author </span>GanAH on 2019/3/30.</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@version </span>1.0</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line">public <span class="class"><span class="keyword">class</span> <span class="title">HttpSendSms</span></span></span><br><span class="line"><span class="class"> </span>{</span><br><span class="line"> public <span class="keyword">void</span> StartSendSms()</span><br><span class="line"> {</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 调用短信API请求</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * access key</span></span><br><span class="line"><span class="comment"> * regionId:短信服务区域.</span></span><br><span class="line"><span class="comment"> * accessKeyId:阿里云短信服务access keyId.</span></span><br><span class="line"><span class="comment"> * secret:access key密钥.</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> DefaultProfile profile = DefaultProfile.getProfile(<span class="string">"cn-hangzhou"</span>,</span><br><span class="line"> <span class="string">"LTAIAbjCxxxxxxW"</span>, <span class="string">"B4pWsaQfjzvVxxxxxxxxOF9"</span>);</span><br><span class="line"> IAcsClient client = <span class="keyword">new</span> DefaultAcsClient(profile);</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 传入参数,调用SDK</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> CommonRequest request = <span class="keyword">new</span> CommonRequest();</span><br><span class="line"> <span class="comment">//request.setProtocol(ProtocolType.HTTPS);</span></span><br><span class="line"> request.setMethod(MethodType.POST);</span><br><span class="line"> request.setDomain(<span class="string">"dysmsapi.aliyuncs.com"</span>);</span><br><span class="line"> request.setVersion(<span class="string">"2019-03-30"</span>);</span><br><span class="line"> request.setAction(<span class="string">"SendSms"</span>);</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 短信通知用户</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> request.putQueryParameter(<span class="string">"PhoneNumbers"</span>, <span class="string">"130xxxxx"</span>);</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 短信签名</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> request.putQueryParameter(<span class="string">"SignName"</span>, <span class="string">"XXXX"</span>);</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 短信通知模板</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> request.putQueryParameter(<span class="string">"TemplateCode"</span>, <span class="string">"SMS_16xxxxx"</span>);</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 模板变量名</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * 用户姓名name,时段time,数值code</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> request.putQueryParameter(<span class="string">"TemplateParam"</span>, <span class="string">"{\"name\":\"GanAH\",\"time\":\"2019\",\"code\":\"20\"}"</span>);</span><br><span class="line"> <span class="keyword">try</span></span><br><span class="line"> {</span><br><span class="line"> CommonResponse response = client.getCommonResponse(request);</span><br><span class="line"> System.out.println(response.getData());</span><br><span class="line"> }</span><br><span class="line"> <span class="keyword">catch</span> (ServerException e)</span><br><span class="line"> {</span><br><span class="line"> e.printStackTrace();</span><br><span class="line"> }</span><br><span class="line"> <span class="keyword">catch</span> (ClientException e)</span><br><span class="line"> {</span><br><span class="line"> e.printStackTrace();</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> public <span class="keyword">static</span> <span class="keyword">void</span> main(<span class="built_in">String</span>[] args)</span><br><span class="line"> {</span><br><span class="line"> <span class="keyword">try</span></span><br><span class="line"> {</span><br><span class="line"></span><br><span class="line"> HttpSendSms Test1 = <span class="keyword">new</span> HttpSendSms();</span><br><span class="line"> Test1.StartSendSms();</span><br><span class="line"> QuerySendDetails Test2 = <span class="keyword">new</span> QuerySendDetails();</span><br><span class="line"> SendBatchSms Test3 = <span class="keyword">new</span> SendBatchSms();</span><br><span class="line"> Test2.ShowQuerySendDetails();</span><br><span class="line"> Test3.StartSendBatchSms();</span><br><span class="line"></span><br><span class="line"> }<span class="keyword">catch</span> (Exception e)</span><br><span class="line"> {</span><br><span class="line"> e.printStackTrace();</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> }</span><br><span class="line"> }</span><br></pre></td></tr></table></figure><h2 id="调用结果及说明"><a href="#调用结果及说明" class="headerlink" title="调用结果及说明"></a>调用结果及说明</h2><p><img data-src="https://img-blog.csdnimg.cn/20190405204323516.png" alt="在这里插入图片描述"></p><ul><li>以上为我加入签名和模板,调整好变量后的调用结果,其中的短信:”签名场景非法”是由于我所用的示例短信签名和示例短信通知模板不对应所致,demo本身无问题。</li><li>使用不匹配的示例是为了说明下面的问题:<br>Code一栏为错误返回值,其说明了你的API调用错误类型,具体修改方法官方有指导,为了方便我已列出如下面所示。</li><li><strong>特别说明</strong>:加入测试的变量编辑方式如下图(最后一栏):<br><img data-src="https://img-blog.csdnimg.cn/20190405210318294.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><h2 id="四-常见的调试结果错误返回值"><a href="#四-常见的调试结果错误返回值" class="headerlink" title="四 .常见的调试结果错误返回值"></a>四 .常见的调试结果错误返回值</h2>调用API接口会产生接口调用错误码,常见接口调用错误码显示及修改建议如下。<br>错误码Code —— 错误提示Message —— 原因及建议处理方式<br>(一) isp.RAM_PERMISSION_DENY RAM权限DENY 当提示RAM权限不足时,就需要给当前使用的AK对应子账号进行授权:AliyunDysmsFullAccess(权限名称)。具体权限授权详见:<a href="https://help.aliyun.com/document_detail/55764.html?spm=5176.product44282.6.548.bKZJL2" target="_blank" rel="noopener">https://help.aliyun.com/document_detail/55764.html?spm=5176.product44282.6.548.bKZJL2</a><br>(二) isv.OUT_OF_SERVICE 业务停机 请先查看账户余额,若余额大于零,则请通过创建工单联系工程师处理<br>(三) isv.PRODUCT_UN_SUBSCRIPT 未开通云通信产品的阿里云客户 未开通云通信产品的阿里云客户(该AK所属的账号尚未开通云通信的服务,包括短信、语音、流量等服务)注:阿里云短信服务包含:1、消息服务 2、云通信短信服务 3、云市场短信接口,账号和短信接口不可混用。当出现此类提示报错需要检查当前AK是否已经开通阿里云云通信短信服务,如已开通消息服务,则参照消息服务文档调用接口。<br>(四) isv.PRODUCT_UNSUBSCRIBE 产品未开通 产品未订购(该AK所属的账号尚未开通当前接口的产品,如仅开通了短信服务的用户调用语音接口。),检查AK对应账号是否已开通调用接口对应的服务。短信服务开通链接:<a href="https://www.aliyun.com/product/sms" target="_blank" rel="noopener">https://www.aliyun.com/product/sms</a><br>(五) isv.ACCOUNT_NOT_EXISTS 账户不存在 请确认使用的账号是否与申请的账号一致<br>(六) isv.ACCOUNT_ABNORMAL 账户异常 请确认使用的账号是否与申请的账号一致<br>(七) isv.SMS_TEMPLATE_ILLEGAL 短信模版不合法 TemplateCode参数请传入审核通过的模版ID,模版见:见:<a href="https://dysms.console.aliyun.com/dysms.htm#/template" target="_blank" rel="noopener">https://dysms.console.aliyun.com/dysms.htm#/template</a><br>(八) isv.SMS_SIGNATURE_ILLEGAL 短信签名不合法 SignName请传入审核通过的签名内容,签名见:<a href="https://dysms.console.aliyun.com/dysms.htm#/sign" target="_blank" rel="noopener">https://dysms.console.aliyun.com/dysms.htm#/sign</a><br>(九) isv.INVALID_PARAMETERS 参数异常 对照文档,检查参数格式。例:短信查询接口SendDate日期格式yyyyMMdd,错误:2017-01-01正确:20170101<br>(十) isp.SYSTEM_ERROR isp.SYSTEM_ERROR 请重试接口调用,如仍存在此情况请创建工单反馈工程师查看<br>(十一) isv.MOBILE_NUMBER_ILLEGAL 非法手机号 PhoneNumbers参数请传入11位国内号段的手机号码<br>(十二) isv.MOBILE_COUNT_OVER_LIMIT 手机号码数量超过限制 短信接收号码,支持以英文逗号分隔的形式进行批量调用,批量上限为1000个手机号码,PhoneNumbers参数单次调用不传入过多接收号码<br>(十三) isv.TEMPLATE_MISSING_PARAMETERS 模版缺少变量 TemplateParam中需要以json格式字符串给使用的模版中出现的所有变量进行赋值。例:模版为:您好${name},验证码${code} TemplateParam={“name”:”Tom”,”code”:”123”}<br>(十四) isv.BUSINESS_LIMIT_CONTROL 业务限流 将短信发送频率限制在正常的业务流控范围内,默认流控:短信验证码 :使用同一个签名,对同一个手机号码发送短信验证码,支持1条/分钟,5条/小时 ,累计10条/天。<br>(十五) isv.INVALID_JSON_PARAM JSON参数不合法,只接受字符串值 TemplateParam入参以Json格式字符串形式传入。例:正确{“code”:”123”}<br>(十六) isv.BLACK_KEY_CONTROL_LIMIT 黑名单管控 黑名单管控是指变量内容含有限制发送的内容,变量不支持透传url,同时检查通过变量是否透传了一些敏感信息触发关键字<br>(十七) isv.PARAM_LENGTH_LIMIT 参数超出长度限制 单个变量长度限制在20字符内。<br>(十八) isv.PARAM_NOT_SUPPORT_URL 不支持URL 变量不支持透传url,同时检查通过变量是否透传了一些敏感信息触发关键字<br>(十九) isv.AMOUNT_NOT_ENOUGH 账户余额不足 转入金额不足以发送当前信息,确保余额足够发送当前短信<br>(二十) isv.TEMPLATE_PARAMS_ILLEGAL 模版变量里包含非法关键字 变量不支持透传url,同时检查通过变量是否透传了一些敏感信息触发关键字<br>(二十一) SignatureDoesNotMatch Specified signature is not matched with our calculation. Signature加密错误,如为SDK调用,则需要注意accessKeyId和accessKeySecret字符串赋值正确无误;如自行加密的Signature,则需要检查加密逻辑,对照文档:<a href="https://help.aliyun.com/document_detail/56189.html" target="_blank" rel="noopener">https://help.aliyun.com/document_detail/56189.html</a><br>(二十二) InvalidTimeStamp.Expired Specified time stamp or date value is expired. 时间戳错误,发出请求的时间和服务器接收到请求的时间不在15分钟内。经常出现该错误的原因是时区原因造成的,目前网关使用的时间是GMT时间<br>(二十三) SignatureNonceUsed Specified signature nonce was used already. 唯一随机数重复,SignatureNonce为唯一随机数,用于防止网络重放攻击。不同请求间要使用不同的随机数值。<br>(二十四) InvalidVersion Specified parameter Version is not valid. 版本号错误,需要确认接口的版本号,如云通信短信、语音、流量服务的Version=2017-05-25<br>(二十五) InvalidAction.NotFound Specified api is not found, please check your url and method 接口名错误,需要确认接口地址和接口名,如云通信短信服务短信发送:dysmsapi.aliyuncs.com,接口名Action=SendSms<h2 id="联系方式"><a href="#联系方式" class="headerlink" title="联系方式"></a>联系方式</h2><h3 id="微信公众号,更多成长分享"><a href="#微信公众号,更多成长分享" class="headerlink" title="微信公众号,更多成长分享"></a>微信公众号,更多成长分享</h3><img data-src="https://img-blog.csdnimg.cn/20190405205224346.jpg" alt="在这里插入图片描述"></li></ul><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/3823158.html#disqus_thread</comments>
</item>
<item>
<title>【python】基于openCV,PIL的深色多背景复杂验证码图像转灰度二值化,并去噪降噪处理分析</title>
<link>https://www.ganahe.top/archives/38231785.html</link>
<guid>https://www.ganahe.top/archives/38231785.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="一-前言与说明"><a href="#一-前言与说明" class="headerlink" title="一. 前言与说明"></a>一. 前言与说明</h2><p>参与一个比赛需要对项目中的验证码进行降噪处理,以便后续的工作。</p><p>但是该图像集(5000张)构成十分复杂,有部分图像背景色与字符颜色极为相近甚至达到人眼难以辨别的程度。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="一-前言与说明"><a href="#一-前言与说明" class="headerlink" title="一. 前言与说明"></a>一. 前言与说明</h2><p>参与一个比赛需要对项目中的验证码进行降噪处理,以便后续的工作。</p><p>但是该图像集(5000张)构成十分复杂,有部分图像背景色与字符颜色极为相近甚至达到人眼难以辨别的程度。</p><a id="more"></a><p>例如下图的528.jpg。<br><img data-src="https://img-blog.csdnimg.cn/20191126110351122.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="二-初步思路及效果"><a href="#二-初步思路及效果" class="headerlink" title="二. 初步思路及效果"></a>二. 初步思路及效果</h2><p>采用PIL的方法对原始图像读取并处理像素。</p><p>转为灰度图像,随后二值化并进行降噪处理。</p><p>转换并二值化的算法代码如下:</p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">two_value</span><span class="params">(imagePath, listhourd)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> 图像二值化</span></span><br><span class="line"><span class="string"> :param imagePath:原始未处理图像文件路径</span></span><br><span class="line"><span class="string"> :param listhourd: 二值化阈值,0-255</span></span><br><span class="line"><span class="string"> :return: 返回Image文件类型</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"> <span class="comment"># 图像二值化</span></span><br><span class="line"> image = Image.open(imagePath)</span><br><span class="line"> <span class="comment"># 灰度图</span></span><br><span class="line"> im = image.convert(<span class="string">'L'</span>)</span><br><span class="line"> threshold = listhourd</span><br><span class="line"> table = []</span><br><span class="line"> <span class="keyword">for</span> j <span class="keyword">in</span> range(<span class="number">256</span>):</span><br><span class="line"> <span class="keyword">if</span> j < threshold:</span><br><span class="line"> table.append(<span class="number">0</span>)</span><br><span class="line"> <span class="keyword">else</span>:</span><br><span class="line"> table.append(<span class="number">1</span>)</span><br><span class="line"> im = im.point(table, <span class="string">'L'</span>)</span><br><span class="line"> <span class="keyword">return</span> im</span><br></pre></td></tr></table></figure><p>此时效果对于大部分图像尚可。</p><p>但同时也发现有部分黑图,以及噪点极多的图像,且大多数图像的噪点仍然比较多,不是很干净。<br><img data-src="https://img-blog.csdnimg.cn/20191126111851950.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="三-成图检验分析"><a href="#三-成图检验分析" class="headerlink" title="三. 成图检验分析"></a>三. 成图检验分析</h2><h3 id="一-思路"><a href="#一-思路" class="headerlink" title="(一). 思路"></a>(一). 思路</h3><ol><li>将处理后的图像集进行遍历,筛选出质量较差的图像,并按照序号所引进行处理;</li><li>将影像像素值统计;</li><li>可视化分析找出差异特征并处理图像;</li><li>成果导出。</li></ol><h3 id="二-筛选数据导出"><a href="#二-筛选数据导出" class="headerlink" title="(二). 筛选数据导出"></a>(二). 筛选数据导出</h3><p>将筛选的图像特征数据导出到 csv 文件中。</p><p>代码如下:</p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># In[011]:</span></span><br><span class="line"><span class="keyword">from</span> PIL <span class="keyword">import</span> Image</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> csv</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">fitler_two_value_black</span><span class="params">(image, filterValue)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> 筛选二值化后的差图</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"> im = image</span><br><span class="line"> data = im.getdata()</span><br><span class="line"> w, h = im.size</span><br><span class="line"> black_point = <span class="number">0</span></span><br><span class="line"></span><br><span class="line"> <span class="comment"># 省去外轮廓,减少非去除噪点干扰</span></span><br><span class="line"> <span class="keyword">for</span> x <span class="keyword">in</span> range(<span class="number">10</span>, w - <span class="number">1</span>):</span><br><span class="line"> <span class="keyword">for</span> y <span class="keyword">in</span> range(<span class="number">15</span>, h - <span class="number">1</span>):</span><br><span class="line"> pixelData = im.getpixel((x, y))</span><br><span class="line"> <span class="keyword">if</span> (pixelData < filterValue):</span><br><span class="line"> black_point += <span class="number">1</span></span><br><span class="line"> <span class="comment"># im.show()</span></span><br><span class="line"> <span class="comment">#print("像素占比:", black_point * 100 / (w * h), "%")</span></span><br><span class="line"> <span class="keyword">return</span> black_point * <span class="number">100</span> / (w * h)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">anlyze</span><span class="params">()</span>:</span></span><br><span class="line"> print(<span class="string">"start to write "</span>)</span><br><span class="line"> header = [<span class="string">"captcha"</span>,<span class="string">"label"</span>,<span class="string">"black_point_count"</span>]</span><br><span class="line"> <span class="keyword">with</span> open(<span class="string">"./去噪后验证码像素比例分析.csv"</span>,<span class="string">"w"</span>,newline=<span class="string">""</span>) <span class="keyword">as</span> csvFile:</span><br><span class="line"> csvWriter = csv.writer(csvFile)</span><br><span class="line"> csvWriter.writerow(header)</span><br><span class="line"> <span class="keyword">for</span> i <span class="keyword">in</span> range(<span class="number">1</span>, <span class="number">5001</span>):</span><br><span class="line"> imagePath = <span class="string">"./testCompResult/"</span> + str(i) + <span class="string">".jpg"</span></span><br><span class="line"> im = Image.open(imagePath)</span><br><span class="line"> point = fitler_two_value_black(im, <span class="number">1</span>)</span><br><span class="line"> listg = [str(i) + <span class="string">".jpg"</span>, <span class="string">"label_None"</span>, str(point)]</span><br><span class="line"> csvWriter.writerow(listg)</span><br><span class="line"></span><br><span class="line"> csvFile.close()</span><br><span class="line"> print(<span class="string">"finish!"</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">anlyze()</span><br></pre></td></tr></table></figure><h3 id="三-数据可视化分析"><a href="#三-数据可视化分析" class="headerlink" title="(三). 数据可视化分析"></a>(三). 数据可视化分析</h3><p><img data-src="https://img-blog.csdnimg.cn/20191126112638997.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20191126112655431.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20191126112707367.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>离散分布图中,明显可见检测的黑色点所占百分比有部分图像的 point 值超过了平均值7.6,此即为黑图,小于 5 的为残缺较为严重的图像。</p><h2 id="四-新处理思想探索与效果(较为显著)"><a href="#四-新处理思想探索与效果(较为显著)" class="headerlink" title="四. 新处理思想探索与效果(较为显著)"></a>四. 新处理思想探索与效果(较为显著)</h2><h3 id="一-使用-OpenCV-灰度灰度图再进行二值化降噪"><a href="#一-使用-OpenCV-灰度灰度图再进行二值化降噪" class="headerlink" title="(一). 使用 OpenCV 灰度灰度图再进行二值化降噪"></a>(一). 使用 OpenCV 灰度灰度图再进行二值化降噪</h3><p>此步有利于避免前一步的黑图。</p><p>但也引入了新的问题,就是对灰度图的二值化引入了很多噪点:</p><p><img data-src="https://img-blog.csdnimg.cn/20191126115848771.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>单张图像放大展示:<br><img data-src="https://img-blog.csdnimg.cn/2019112616371365.jpg#pic_center" alt="opencv的降噪算法"></p><p>对该图再去噪又会破坏文字的完整性,且效果比较差,减小阈值又会造成所需特征缺失,如下图:</p><p><img data-src="https://img-blog.csdnimg.cn/20191126110924221.png#pic_center" alt="在这里插入图片描述"></p><h3 id="二-基于-openCV-加入高斯滤波"><a href="#二-基于-openCV-加入高斯滤波" class="headerlink" title="(二). 基于 openCV 加入高斯滤波"></a>(二). 基于 openCV 加入高斯滤波</h3><p><img data-src="https://img-blog.csdnimg.cn/20191127185703867.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="三-对加入滤波后的图像再次进行二值化并去噪"><a href="#三-对加入滤波后的图像再次进行二值化并去噪" class="headerlink" title="(三). 对加入滤波后的图像再次进行二值化并去噪"></a>(三). 对加入滤波后的图像再次进行二值化并去噪</h3><p><img data-src="https://img-blog.csdnimg.cn/20191126114811449.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>至此,降噪基本达到效果,背景噪点数量极少,字符显示极为清晰透亮,白白净净。</p><h2 id="五-残缺图的产生与验证增强"><a href="#五-残缺图的产生与验证增强" class="headerlink" title="五. 残缺图的产生与验证增强"></a>五. 残缺图的产生与验证增强</h2><p>经过前一步的处理后,虽说去噪效果极好,但我们发现部分图像的字符有所残缺。</p><p>经过多次认证测试,摸索出的新办法思想如下:<br><img data-src="https://img-blog.csdnimg.cn/2019112719015322.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>以上流程部分内容代表去噪算法。</p><p><img data-src="https://img-blog.csdnimg.cn/20191127190503256.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20191127204912315.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>以上为图像增强测试主要过程及效果,下面对图像集进行批量处理 :</p><p><img data-src="https://img-blog.csdnimg.cn/20191127190444224.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><p>其中测试用到的增强对比度的算法为伽马算法:</p><figure class="highlight py"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># In[011]:</span></span><br><span class="line"><span class="keyword">from</span> PIL <span class="keyword">import</span> Image</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> cv2</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">gammaChange</span><span class="params">(imagePath, gamma_value)</span>:</span></span><br><span class="line"> <span class="string">"""</span></span><br><span class="line"><span class="string"> 基于opencv的伽马变换,对图像对比度处理,但是保存后的图像貌似不太对劲,处理黑图</span></span><br><span class="line"><span class="string"> :param imagePath:原始文件路径</span></span><br><span class="line"><span class="string"> :return:numpy类型的 opencv 封装类型,需要使用cv2.imshow(),imwrite()操作</span></span><br><span class="line"><span class="string"> """</span></span><br><span class="line"> img = cv2.imread(imagePath, cv2.IMREAD_GRAYSCALE)</span><br><span class="line"> <span class="comment"># 图像归一化</span></span><br><span class="line"> fi = img / <span class="number">1</span></span><br><span class="line"> <span class="comment"># 伽马变换</span></span><br><span class="line"> out = np.power(fi, gamma_value)</span><br><span class="line"> <span class="keyword">return</span> out</span><br></pre></td></tr></table></figure><h2 id="六-降除效果可视化"><a href="#六-降除效果可视化" class="headerlink" title="六. 降除效果可视化"></a>六. 降除效果可视化</h2><p><img data-src="https://img-blog.csdnimg.cn/20191126112750722.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20191126112758984.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20191126112812931.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>point 无明显偏移情况。</p><p><img data-src="https://img-blog.csdnimg.cn/20191126165106837.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>对比图像,去噪效果较为明显,原残缺图像得到增强。</p><h2 id="七-最终效果"><a href="#七-最终效果" class="headerlink" title="七. 最终效果"></a>七. 最终效果</h2><p><img data-src="https://img-blog.csdnimg.cn/20191126112453275.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="八-不足之处"><a href="#八-不足之处" class="headerlink" title="八. 不足之处"></a>八. 不足之处</h2><p>部分字符颜色与背景色极为接近的图像,在经过处理后,在字符区域会</p><p>造成团簇状黑斑,或是字符消失,解决这一问题,需要用到基于</p><p>TensorFlow 等框架的深度学习去完成了。</p><p><img data-src="https://img-blog.csdnimg.cn/20191127190724129.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>但根据下图的去噪效果分析可见,该类残缺图所占比重较少,具体占比需要依据个人的数据训练集的质量而定:</p><p><img data-src="https://img-blog.csdnimg.cn/20191126165106837.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="九-交流与源代码获取"><a href="#九-交流与源代码获取" class="headerlink" title="九. 交流与源代码获取"></a>九. 交流与源代码获取</h2><p>源代码目前仍在完善中,尚未同步到 GitHub 仓库,有学习需要的伙伴或是想要了解更多内容,请到本人WX</p><p>公众号查找往期文章,需要代码可后台回复或是文章内直接获取:</p><p><img data-src="https://img-blog.csdnimg.cn/20191127191138215.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/38231785.html#disqus_thread</comments>
</item>
<item>
<title>安装MySQL启动时出现“net start mysql MySQL 服务正在启动 . MySQL 服务无法启动。 服务没有报告任何错误”的解决办法</title>
<link>https://www.ganahe.top/archives/3823178.html</link>
<guid>https://www.ganahe.top/archives/3823178.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="很多时候我们都会遇到需要数据库的操作,但是由于不太熟悉,很容易出现很多问题,本文为最基础的启动是所遇到问题的指导。"><a href="#很多时候我们都会遇到需要数据库的操作,但是由于不太熟悉,很容易出现很多问题,本文为最基础的启动是所遇到问题的指导。" class="headerlink" title="很多时候我们都会遇到需要数据库的操作,但是由于不太熟悉,很容易出现很多问题,本文为最基础的启动是所遇到问题的指导。"></a>很多时候我们都会遇到需要数据库的操作,但是由于不太熟悉,很容易出现很多问题,本文为最基础的启动是所遇到问题的指导。</h2>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="很多时候我们都会遇到需要数据库的操作,但是由于不太熟悉,很容易出现很多问题,本文为最基础的启动是所遇到问题的指导。"><a href="#很多时候我们都会遇到需要数据库的操作,但是由于不太熟悉,很容易出现很多问题,本文为最基础的启动是所遇到问题的指导。" class="headerlink" title="很多时候我们都会遇到需要数据库的操作,但是由于不太熟悉,很容易出现很多问题,本文为最基础的启动是所遇到问题的指导。"></a>很多时候我们都会遇到需要数据库的操作,但是由于不太熟悉,很容易出现很多问题,本文为最基础的启动是所遇到问题的指导。</h2><a id="more"></a><p>更多详细错误解析,请观摩大佬文章。</p><h2 id="一-错误类型"><a href="#一-错误类型" class="headerlink" title="一 错误类型"></a>一 错误类型</h2><h4 id="下载安装"><a href="#下载安装" class="headerlink" title="下载安装"></a>下载安装</h4><p><img data-src="https://img-blog.csdnimg.cn/20190502164750996.png" alt="在这里插入图片描述"></p><h4 id="启动错误"><a href="#启动错误" class="headerlink" title="启动错误"></a>启动错误</h4><p><img data-src="https://img-blog.csdnimg.cn/20190502164712507.png" alt="在这里插入图片描述"></p><h2 id="二-解决办法"><a href="#二-解决办法" class="headerlink" title="二 解决办法"></a>二 解决办法</h2><p>1.进入mysql的bin目录;<br><img data-src="https://img-blog.csdnimg.cn/20190502165037613.png" alt="在这里插入图片描述"><br>2. 执行mysqld –initialize-insecure ,第一次执行的话,时间会久一些,执行结束后没有输出信息,查看bin的同级目录下会多出一个data文件夹,里面一堆文件。<br><img data-src="https://img-blog.csdnimg.cn/20190502165057393.png" alt="在这里插入图片描述"><br>3. 再次启动,成功。<br><img data-src="https://img-blog.csdnimg.cn/2019050216511224.png" alt="在这里插入图片描述"></p><h2 id="注意事项"><a href="#注意事项" class="headerlink" title="注意事项"></a>注意事项</h2><p>初次解压安装包时,MySQL 5.7 以上版本默认没有data属性文件,不要手动创建。<br><img data-src="https://img-blog.csdnimg.cn/20190502165125712.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/3823178.html#disqus_thread</comments>
</item>
<item>
<title>将hexo个人博客部署到个人云服务器--最详细踩坑教程</title>
<link>https://www.ganahe.top/archives/4bf91e10.html</link>
<guid>https://www.ganahe.top/archives/4bf91e10.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="一-背景"><a href="#一-背景" class="headerlink" title="一. 背景"></a>一. 背景</h1><p>通过 Hexo 4.0 及 nexT 7.0 + 搭建个人博客后,当然不能就此停步,需要学习的东西还浩如烟海,本文将探索Hexo个人博客部署到个人服务器的过程。</p><p>本文章部署到个人云服务器的前提:</p><ul><li>有一台服务器(硬件准备);</li><li>hexo 博客已经做好搭建工作,可以部署到 GitHub Pages 或 Coding 等(技术准备);</li></ul>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h1 id="一-背景"><a href="#一-背景" class="headerlink" title="一. 背景"></a>一. 背景</h1><p>通过 Hexo 4.0 及 nexT 7.0 + 搭建个人博客后,当然不能就此停步,需要学习的东西还浩如烟海,本文将探索Hexo个人博客部署到个人服务器的过程。</p><p>本文章部署到个人云服务器的前提:</p><ul><li>有一台服务器(硬件准备);</li><li>hexo 博客已经做好搭建工作,可以部署到 GitHub Pages 或 Coding 等(技术准备);</li></ul><a id="more"></a><p>本文不会详细介绍 hexo 的搭建和 npm 、hexo g 等命令的使用,如有需要请参照网络资源教程或等待本博客更新查找。</p><h1 id="二-获取体验产品–服务器(选读节)"><a href="#二-获取体验产品–服务器(选读节)" class="headerlink" title="*二. 获取体验产品–服务器(选读节)"></a>*二. 获取体验产品–服务器(选读节)</h1><h2 id="(一)说明"><a href="#(一)说明" class="headerlink" title="(一)说明"></a>(一)说明</h2><p>如果你是学生党或是想要尝尝鲜学习新东西而已,可以使用体验产品来折腾。</p><p>一来免费,二来体验时长也足够学习到该内容的知识点了。</p><p>华为给新用户提供了免费体验的专区,大家可以进行体验。如果自己已经有服务器的可以跳过该环节或是参见该内容区域(二)末尾有服务器优惠购买的活动,优惠力度还比较大,但有时间限制。</p><h2 id="(二)购买体验产品"><a href="#(二)购买体验产品" class="headerlink" title="(二)购买体验产品"></a>(二)购买体验产品</h2><p><img data-src="https://img-blog.csdnimg.cn/2020032916551245.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>华为开发者免费体验专区:<a href="https://activity.huaweicloud.com/free_test/index.html" target="_blank" rel="noopener">https://activity.huaweicloud.com/free_test/index.html</a></p><p>符合免费体验的条件:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329165545992.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>个人选择购买该产品:<br><img data-src="https://img-blog.csdnimg.cn/20200329165555161.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>选择后进入支付界面,此时会有提示你:<u><strong>是否创建密码</strong></u> or <u><strong>开机后再创建</strong></u>。个人<u>建议直接设定密码</u>,因为开机再创建会额外进行不必要的操作,直接创建直接方便,登录的用户名为 root ,点击支付,提示购买成功:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329165652497.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>启动服务器并登录:<br><img data-src="https://img-blog.csdnimg.cn/20200329165738157.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p><img data-src="https://img-blog.csdnimg.cn/20200329165802847.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>登录成功:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329165828784.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(三)食髓知味再来一杯–持续支持与后续保障-–-2020年3月3日截止,没了"><a href="#(三)食髓知味再来一杯–持续支持与后续保障-–-2020年3月3日截止,没了" class="headerlink" title="(三)食髓知味再来一杯–持续支持与后续保障 –==2020年3月3日截止,没了=="></a><del>(三)食髓知味再来一杯–持续支持与后续保障</del> –==2020年3月3日截止,没了==</h2><p><del>体验产品过期后还想使用服务器怎么办?可以选择自购服务器。华为最近有开年采购季的活动,最基础的云服务器打0.6折,最高可以购买3年–>236.65 / (12*3) = 6.574 ¥每月!!这价格不香吗。</del></p><p><img data-src="https://img-blog.csdnimg.cn/20200329165855406.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p><del>况且还可以通过个人邀请链接得到优惠券,不过活动日期不久了,如果需要还得赶紧上车。<u>如果有需要可以点击我的个人推荐链接,你我都可以获得优惠券(新用户),当然你也可以推荐你的给别人也能获得新的优惠券,可以用来购买部分服务器或是直接续费。</u></del></p><p><img data-src="https://img-blog.csdnimg.cn/20200329165913376.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>【2核4G云服务器低至331元/年,限时抢购】华为云开年回馈用户,产品低至1折,您的专属链接:<a href="https://activity.huaweicloud.com/2020feb_promotion/invite.html?fromuser=080e2ff9d78026c30fb1c0026ef09de0&fromacct=d5de3644-9fc9-4193-a434-8726140022f3&needGalaxy=true" target="_blank" rel="noopener">https://activity.huaweicloud.com/2020feb_promotion/invite.html?fromuser=080e2ff9d78026c30fb1c0026ef09de0&fromacct=d5de3644-9fc9-4193-a434-8726140022f3&needGalaxy=true</a></p><p>续费:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329165924356.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br><img data-src="https://img-blog.csdnimg.cn/20200329170042718.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h1 id="三-开始配置"><a href="#三-开始配置" class="headerlink" title="三. 开始配置"></a>三. 开始配置</h1><h2 id="(一)云服务器登录连接方式"><a href="#(一)云服务器登录连接方式" class="headerlink" title="(一)云服务器登录连接方式"></a>(一)云服务器登录连接方式</h2><p>前提与说明:</p><ul><li>SSH方式登录要求该弹性云服务器已绑定弹性公网IP;</li><li>ssh连接正常;</li><li>~/.ssh 目录下公钥加入。</li></ul><p>开机后才能进行登录。</p><p>如果你的服务器为 Windows 操作系统,一般用户名为 administer ;如果为 Linux 操作系统,则为 root。</p><p>可登录服务器的方式有如下:</p><table><thead><tr><th>是否绑定EIP</th><th>本地操作系统</th><th align="center">连接方法</th></tr></thead><tbody><tr><td>是</td><td>Windows</td><td align="center">使用 PuTTY、Xshell 等远程登录工具</td></tr><tr><td>是</td><td>Linux</td><td align="center">terminal直接使用命令连接</td></tr><tr><td>是/否</td><td>Windows或者Linux</td><td align="center">使用管理控制台远程登录方式</td></tr></tbody></table><h2 id="(二)采用-XShell远程登录"><a href="#(二)采用-XShell远程登录" class="headerlink" title="(二)采用 XShell远程登录"></a>(二)采用 XShell远程登录</h2><p>XSHELL 是一款界面较好、功能也相对强大的远程登录管理工具,使用非常广泛,在业界比较受欢迎、也比较流行,支持多窗口切换以及常见shh ,Telnet,SFTP等协议。</p><p>本文将采用 XShell 进行说明与演示,其他软件操作方法可自行使用。XShell下载地址:<a href="https://www.netsarang.com/zh/xshell/,非商业使用可以获得免费许可证。" target="_blank" rel="noopener">https://www.netsarang.com/zh/xshell/,非商业使用可以获得免费许可证。</a></p><p><img data-src="https://img-blog.csdnimg.cn/20200329170120127.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>在确保云服务器已经开机的情况下,新建连接:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170131636.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p><img data-src="https://img-blog.csdnimg.cn/20200329170146476.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(三)在服务器建立-Git-仓库"><a href="#(三)在服务器建立-Git-仓库" class="headerlink" title="(三)在服务器建立 Git 仓库"></a>(三)在服务器建立 Git 仓库</h2><p>以下操作建立在 root 权限之下,如权限不足请申请 root 权限或采用 <code>sudo</code> 关键字。</p><p>==下文用到的 <code>ganahBlog.git</code> 为我自己的仓库名,可自行设定换成你喜欢的文字; root 为我的远端主机用户名,在后续需要用得到,如果不为 root ,在进行到文章相应位置自行修改。==</p><p>首先安装 Git 和 Nginx 服务,如有请跳过:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">apt-<span class="keyword">get</span> update</span><br><span class="line">apt-<span class="keyword">get</span> install git nginx -y</span><br></pre></td></tr></table></figure><p>建立文件路径:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mkdir /<span class="keyword">var</span>/repo/</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200329170348870.png#pic_center" alt></p><p>修改权限:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">chown -R $USER:$USER /<span class="keyword">var</span>/repo/</span><br><span class="line">chmod -R <span class="number">755</span> /<span class="keyword">var</span>/repo/</span><br></pre></td></tr></table></figure><p>创建远程 Git 仓库:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd /<span class="keyword">var</span>/repo</span><br><span class="line">git init --bare {自定义仓库名name}.git</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200329170402613.png#pic_center" alt></p><h2 id="(四)配置-Nginx-托管文件目录"><a href="#(四)配置-Nginx-托管文件目录" class="headerlink" title="(四)配置 Nginx 托管文件目录"></a>(四)配置 Nginx 托管文件目录</h2><p>创建目录并修改目录所有权和权限:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">mkdir -p /<span class="keyword">var</span>/www/hexo</span><br><span class="line"></span><br><span class="line">chown -R $USER:$USER /<span class="keyword">var</span>/www/hexo</span><br><span class="line">chmod -R <span class="number">755</span> /<span class="keyword">var</span>/www/hexo</span><br></pre></td></tr></table></figure><p>修改 Nginx 的 <code>default</code> 文件使得 root 指向刚刚创建的 <code>/var/www/hexo</code>目录:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim /etc/nginx/sites-available/<span class="keyword">default</span></span><br></pre></td></tr></table></figure><p>注意 vim 编辑方式:按照以上命令进入后为普通模式,具体介绍可以去找网上的内容,此处只说明如何进行下来的操作:</p><p>执行命令后编辑方式如下(下文有类似操作不再提及):</p><ul><li>点击 i 进入编辑模式;</li><li>使用键盘上下键查到下图的 <code>server</code> 字段 中的 <code>root</code>;</li><li>修改 <code>root</code> 的指向;</li><li>按住 <code>Esc</code>退出编辑模式;</li><li>输入 <code>:wq</code> 保存并退出 vim 编辑器;</li><li>如果有域名可以将server_name 字段后写入自己的域名。</li></ul><p><img data-src="https://img-blog.csdnimg.cn/2020032917041927.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><ul><li>最后重启 nginx 服务:</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">service nginx restart</span><br></pre></td></tr></table></figure><p>此时已经搭建好自己的nginx服务器,输入自己的服务器公网IP地址即可访问如下界面:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170441903.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>由于服务器暂未搭建任何东西,故访问出现403 ForBidden,如果没有成功则会出现 404 Not Found 或是加载失败等提示。</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170451245.png#pic_center" alt></p><p>当然,为了确认是否真的真的搭建成功,也可以在/var/www/hexo 目录下建立index.html 文件:</p><p>执行命令: vim index.html;</p><p>写入如下代码:</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">html</span>></span></span><br><span class="line"></span><br><span class="line"><span class="tag"><<span class="name">body</span>></span></span><br><span class="line"><span class="tag"><<span class="name">p</span>></span>This is my Blog.<span class="tag"></<span class="name">p</span>></span></span><br><span class="line"><span class="tag"></<span class="name">body</span>></span></span><br><span class="line"></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure><p>最后输入公网IP发现不再是 403 ForBidden,而是访问了 index.html :</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170503197.png#pic_center" alt></p><h2 id="五-Git-钩子(hooks"><a href="#五-Git-钩子(hooks" class="headerlink" title="(五) Git 钩子(hooks)"></a>(五) Git 钩子(hooks)</h2><p>执行下面的命令,在自动生成的<code>ganahBlog.git/hooks</code> 目录下创建一个新的钩子文件:</p><figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim /<span class="keyword">var</span>/repo/ganahBlog.git/hooks/post-receive</span><br></pre></td></tr></table></figure><p>打开文件后,加入下面的代码:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"></span><br><span class="line">git --work-tree=/var/www/hexo --git-dir=/var/repo/ganahBlog.git checkout -f</span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/2020032917054888.png#pic_center" alt></p><p>将文件保存(方法参加上文)后,赋予该文件可执行权限:</p><figure class="highlight csharp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">chmod +x /<span class="keyword">var</span>/repo/ganahBlog.git/hooks/post-receive</span><br></pre></td></tr></table></figure><h1 id="四-使用-Git-部署本地-Hexo-到远端服务器"><a href="#四-使用-Git-部署本地-Hexo-到远端服务器" class="headerlink" title="四. 使用 Git 部署本地 Hexo 到远端服务器"></a>四. 使用 Git 部署本地 Hexo 到远端服务器</h1><p>将服务器地址添加到受信任的站点,在本地任意目录从服务器上把<code>hexo_static</code>仓库克隆下来:</p><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone root@{云服务器IP}<span class="symbol">:/var/repo/ganahBlog</span>.git</span><br></pre></td></tr></table></figure><ul><li>注意:如果你在远端服务器创建了 Git 用户并设定为拥有者,请将 root 改成 git (git用户)。</li></ul><p>编辑<strong>站点</strong>配置文件<code>_config.yml</code> , 将 url 改成<code>https://{云服务器IP}/</code></p><p><img data-src="https://img-blog.csdnimg.cn/20200329170559721.png#pic_center" alt></p><p>将 deploy 目标改为 <code>{服务器用户名}@{服务IP}:/var/repo/ganahBlog.git</code>:</p><p><img data-src="https://img-blog.csdnimg.cn/2020032917061583.png#pic_center" alt></p><p>在个人博客站点目录下,打开 Git bash ,使用 <code>hexo clean && hexo g -d</code> 部署:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170651131.png#pic_center" alt></p><p>使用IP访问:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170715691.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>使用自己的域名访问:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170752760.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>效果参考本人个人博客地址:</p><p><a href="https://www.ganahe.top">https://www.ganahe.top</a></p><h1 id="五-错误集锦与解决措施参考"><a href="#五-错误集锦与解决措施参考" class="headerlink" title="五. 错误集锦与解决措施参考"></a>五. 错误集锦与解决措施参考</h1><h2 id="(一)部署后访问无效"><a href="#(一)部署后访问无效" class="headerlink" title="(一)部署后访问无效"></a>(一)部署后访问无效</h2><p>使用 <code>https://{服务器IP}:80</code> 来访问自己刚刚部署的服务器站点,没有出现博客:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170815326.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><ul><li><p>请检查以上操作是否有误或命令部分写错。</p></li><li><p>查看服务器的错误日志文件:/var/log/nginx/error.log</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170829977.png#pic_center" alt></p><p>此时可以发现是 /var/www/hexo 没有 index.html 文件,该文件存放在本地博客站点 public文件夹下</p></li><li><p>发现错误信息(不同的情况错误可能不同,本文仅代表个人遇到的情况,具体情况请具体分析,可以留言,或许我可以帮得上忙,或是自行搜索相关的文章。</p></li><li></li></ul><h2 id="(二)部署到远端服务器被拒绝"><a href="#(二)部署到远端服务器被拒绝" class="headerlink" title="(二)部署到远端服务器被拒绝"></a>(二)部署到远端服务器被拒绝</h2><p><img data-src="https://img-blog.csdnimg.cn/20200329170856252.png#pic_center" alt></p><p>刚配置好的 git 仓库服务器,首次提交的时候会报上图的错误,git 默认拒绝了 push 操作,需要进行设置。</p><ol><li><p>检查远端主机的 ~/.ssh 下文件的文件,公钥是否正确配置;</p></li><li><p>定位到仓库 ganahBlog.git 下,在 config 文件添加如下代码(可以使用:vim /var/repo/ganahBlog.git/config 进入文件):</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[receive]</span><br><span class="line">denyCurrentBranch = ignore</span><br></pre></td></tr></table></figure></li></ol><p><img data-src="https://img-blog.csdnimg.cn/20200329170907268.png#pic_center" alt></p><p>最后在该路径下执行如下代码:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git config receive.denyCurrentBranch ignore</span><br></pre></td></tr></table></figure><p>成功提交:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329170917222.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(三)拉取失败处理办法"><a href="#(三)拉取失败处理办法" class="headerlink" title="(三)拉取失败处理办法"></a>(三)拉取失败处理办法</h2><p><img data-src="https://img-blog.csdnimg.cn/20200329170947335.png#pic_center" alt></p><p>缺少公钥,定位到服务器的 ~/.ssh/下,将自己的公钥粘贴到authorized_keys上去,如果没有公钥,自行查找 Git 公钥生成办法,本文不针对该内容;文件不存在则新建即可:</p><p><img data-src="https://img-blog.csdnimg.cn/2020032917103347.png#pic_center" alt></p><p>加入方法与上面编辑 default 文件一样,XShell提供了外部粘贴的办法:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329171048444.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>也可以使用下面的指令实现:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh [远程主机用户名]@[远程主机IP] <span class="string">'mkdir -p .ssh && cat >>.ssh/authorized_keys'</span> < ~<span class="regexp">/.ssh/</span>authorized_keys.pub</span><br></pre></td></tr></table></figure><p>结果测试:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329171555926.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt><br>云仓库结构:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329171119696.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(四)无法查看-push-后的-git-中文件的原因与解决方法"><a href="#(四)无法查看-push-后的-git-中文件的原因与解决方法" class="headerlink" title="(四)无法查看 push 后的 git 中文件的原因与解决方法"></a>(四)无法查看 push 后的 git 中文件的原因与解决方法</h2><p>在初始化远程仓库时使用 git –bare init 而不要使用:git init (不建议);</p><p>可以使用命令 git reset –hard 看到 push 后的内容。</p><p>两个初始化命令是有区别的,在此不做赘述。</p><h2 id="(五)更新远端公钥后连接不上出现下面的问题"><a href="#(五)更新远端公钥后连接不上出现下面的问题" class="headerlink" title="(五)更新远端公钥后连接不上出现下面的问题"></a>(五)更新远端公钥后连接不上出现下面的问题</h2><p><img data-src="https://img-blog.csdnimg.cn/20200329171208385.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ECDSA host key <span class="keyword">for</span> <span class="number">125.36</span><span class="number">.25</span><span class="number">.875</span> has changed and you have requested strict checking.</span><br><span class="line">Host key verification failed.</span><br></pre></td></tr></table></figure><p>错误信息说明远端主机公钥信息已修改,需要更新:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -R <span class="string">"远程服务器ip"</span></span><br></pre></td></tr></table></figure><p><img data-src="https://img-blog.csdnimg.cn/20200329171224513.png#pic_center" alt></p><p>此时测试连接远端主机成功:</p><p><img data-src="https://img-blog.csdnimg.cn/20200329171233660.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><h2 id="(六)建立-git-用户"><a href="#(六)建立-git-用户" class="headerlink" title="(六)建立 git 用户"></a>(六)建立 git 用户</h2><p>以上第五条参考即在 git 用户下进行登录验证等操作。</p><p>为了安全,可以通过 git 用户管理仓库,而不是 root。</p><figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">adduser git # 按照指引输入密码等</span><br><span class="line"></span><br><span class="line">su git # 切换到git用户 git用户家目录 /home</span><br></pre></td></tr></table></figure><p>将密钥添加到 git 用户下:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">mkdir /home/git/.ssh</span><br><span class="line">vim /home/git/.ssh/authorized_keys</span><br></pre></td></tr></table></figure><p>写入公钥即可。</p><p>记得更新(第四条),测试连接:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh -v git@{服务器IP}</span><br></pre></td></tr></table></figure><h1 id="六-TIP"><a href="#六-TIP" class="headerlink" title="六. TIP"></a>六. TIP</h1><p>想要域名访问服务器的网站,请记得要备案,不然……</p><p><img data-src="https://img-blog.csdnimg.cn/20200329171246656.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><p>我 …..</p><h1 id="七-外链"><a href="#七-外链" class="headerlink" title="七. 外链"></a>七. 外链</h1><h2 id="一-个人博客传送门"><a href="#一-个人博客传送门" class="headerlink" title="(一) 个人博客传送门"></a>(一) <a href="https://www.ganahe.top">个人博客传送门</a></h2><h2 id="二-合作共建平台"><a href="#二-合作共建平台" class="headerlink" title="(二) 合作共建平台"></a>(二) 合作共建平台</h2><p><img data-src="https://img-blog.csdnimg.cn/20200329171258294.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/4bf91e10.html#disqus_thread</comments>
</item>
<item>
<title>图片公式转换Mathpix snipping Tool及快速编辑神器AxMath插件操作使用的几种用法(最详细精致)</title>
<link>https://www.ganahe.top/archives/38231796.html</link>
<guid>https://www.ganahe.top/archives/38231796.html</guid>
<pubDate>Sun, 15 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="一、Mathpix-snipping-Tool"><a href="#一、Mathpix-snipping-Tool" class="headerlink" title="一、Mathpix snipping Tool"></a>一、Mathpix snipping Tool</h2><h3 id="(一)介绍"><a href="#(一)介绍" class="headerlink" title="(一)介绍"></a>(一)介绍</h3><p><strong>Mathpix snipping Tool</strong> 本质上为 OCR(<em>Optical Character Recognition</em>,光学字符识别)软件,将截取的图片转化成LaTeX的代码,通过特定的文本编辑器即可将代码还原成高清的矢量图片格式公式或是适应当前编辑器的公式格式。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h2 id="一、Mathpix-snipping-Tool"><a href="#一、Mathpix-snipping-Tool" class="headerlink" title="一、Mathpix snipping Tool"></a>一、Mathpix snipping Tool</h2><h3 id="(一)介绍"><a href="#(一)介绍" class="headerlink" title="(一)介绍"></a>(一)介绍</h3><p><strong>Mathpix snipping Tool</strong> 本质上为 OCR(<em>Optical Character Recognition</em>,光学字符识别)软件,将截取的图片转化成LaTeX的代码,通过特定的文本编辑器即可将代码还原成高清的矢量图片格式公式或是适应当前编辑器的公式格式。</p><a id="more"></a><p>如在Markdown编辑器下的LaTeX的格式要求如下:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923184722808.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923192105821.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="(二)获取-Mathpix-snipping-Tool"><a href="#(二)获取-Mathpix-snipping-Tool" class="headerlink" title="(二)获取 Mathpix snipping Tool"></a>(二)获取 Mathpix snipping Tool</h3><p>从官网上下载特定的版本或是从以下网盘链接获取资源:<br>| 官网 | <a href="https://mathpix.com/" target="_blank" rel="noopener">https://mathpix.com/</a>|<br>|–|–|<br>|百度网盘 | 链接:<a href="https://pan.baidu.com/s/1do4hwXrj40JrxJZuqbuCWQ" target="_blank" rel="noopener">https://pan.baidu.com/s/1do4hwXrj40JrxJZuqbuCWQ</a><br>提取码 |hxea</p><p><strong>Mathpix snipping Tool</strong> 有着不同的版本,相应的版本信息如下:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923185515156.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>可以发现其有免费版本与付费版本的差别。<br>其中,免费版本每个月截图转换上限为50片,每个月正常使用基本够;付费版本每月4.99$$,略贵,但是截图转换次数无限。<br>购买界面:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923190419519.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="(三)功能说明"><a href="#(三)功能说明" class="headerlink" title="(三)功能说明"></a>(三)功能说明</h3><p><strong>Mathpix snipping Tool</strong> 支持的种类有 <strong>基本数学物理公式、矩阵、纸上的手写公式、化学方程式的转换提取以及图片类文档文字</strong> 的提取等。</p><p><img data-src="https://img-blog.csdnimg.cn/20190923190032419.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h3 id="(四)使用方法"><a href="#(四)使用方法" class="headerlink" title="(四)使用方法"></a>(四)使用方法</h3><h4 id="4-1-下载安装好-Mathpix-snipping-Tool-后,打开软件,双击下面的图标:"><a href="#4-1-下载安装好-Mathpix-snipping-Tool-后,打开软件,双击下面的图标:" class="headerlink" title="4.1 下载安装好 Mathpix snipping Tool 后,打开软件,双击下面的图标:"></a>4.1 下载安装好 <strong>Mathpix snipping Tool</strong> 后,打开软件,双击下面的图标:</h4><p><img data-src="https://img-blog.csdnimg.cn/20190923190535421.png#pic_center" alt="在这里插入图片描述"></p><h4 id="4-2-随后注册(或登录已注册账号)即可开始正常使用,此时软件不会弹出,其会固化在托盘上。"><a href="#4-2-随后注册(或登录已注册账号)即可开始正常使用,此时软件不会弹出,其会固化在托盘上。" class="headerlink" title="4.2 随后注册(或登录已注册账号)即可开始正常使用,此时软件不会弹出,其会固化在托盘上。"></a>4.2 随后注册(或登录已注册账号)即可开始正常使用,此时软件不会弹出,其会固化在托盘上。</h4><p>相关的软件设定可在托盘的图标上右键展开,此处不再详细说明。<br><img data-src="https://img-blog.csdnimg.cn/20190923221953356.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="4-3-选取图片公式并截取"><a href="#4-3-选取图片公式并截取" class="headerlink" title="4.3 选取图片公式并截取"></a>4.3 选取图片公式并截取</h4><p>点击快捷键:<strong>Ctrl + Alt + M</strong>,此时电脑所有界面固定,屏幕只显示灰度的静态图:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923191405791.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="4-4-移动光标,点击左键不放(出现红色线框)并拖动鼠标将所需的公式圈住,随后再释放-下图来自官网展示-:"><a href="#4-4-移动光标,点击左键不放(出现红色线框)并拖动鼠标将所需的公式圈住,随后再释放-下图来自官网展示-:" class="headerlink" title="4.4 移动光标,点击左键不放(出现红色线框)并拖动鼠标将所需的公式圈住,随后再释放 (下图来自官网展示) :"></a>4.4 移动光标,点击左键不放(出现红色线框)并拖动鼠标将所需的公式圈住,随后再释放 (下图来自官网展示) :</h4><p><img data-src="https://img-blog.csdnimg.cn/20190923191643496.gif#pic_center" alt="在这里插入图片描述"></p><h4 id="4-5-此时软件自动识别照片内容,并将对应的公式等转换出来。"><a href="#4-5-此时软件自动识别照片内容,并将对应的公式等转换出来。" class="headerlink" title="4.5 此时软件自动识别照片内容,并将对应的公式等转换出来。"></a>4.5 此时软件自动识别照片内容,并将对应的公式等转换出来。</h4><p><img data-src="https://img-blog.csdnimg.cn/20190923191029703.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>此时我们注意到上方有两处公式,第一个即为截取的图片内容,第二个即为文字公式,下面一堆类似乱码的文字即为转换的LaTeX公式格式文本,仔细观察还可以发现有URLs格式,此格式一般用于HTML的公式编写等,此处不展开说明。<br>至于下面为何有多条公式代码,那是不同的识别条件与精度等识别出不同的效果,软件默认将最好的识别情况按权重配比排序。</p><p>此时我们只需要复制下方的LaTeX即可(一般软件识别后已经自动复制到剪贴板上),到此,该软件已经完成它的使命。<br><img data-src="https://img-blog.csdnimg.cn/20190923193025824.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>鼠标移动到代码附近,即可出现 <strong>“copy”</strong> 以及 <strong>“edit”</strong> 按钮,点击 <strong>“copy”</strong> 进行复制,<strong>“edit”</strong> 为编辑代码。</p><h3 id="(五)历史记录"><a href="#(五)历史记录" class="headerlink" title="(五)历史记录"></a>(五)历史记录</h3><p>该软件自动保存近期的截图公式转换记录:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923192806553.gif#pic_center" alt="在这里插入图片描述"></p><h2 id="二、LaTeX公式代码转换为公式"><a href="#二、LaTeX公式代码转换为公式" class="headerlink" title="二、LaTeX公式代码转换为公式"></a>二、LaTeX公式代码转换为公式</h2><h3 id="(一)苦逼的公式编辑"><a href="#(一)苦逼的公式编辑" class="headerlink" title="(一)苦逼的公式编辑"></a>(一)苦逼的公式编辑</h3><p>我们编辑论文报告等,一般都会选择office套件的Word。<br>每当需要用到公式时,我们的习惯性操作为:<br><img data-src="https://img-blog.csdnimg.cn/2019092319363131.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/2019092320074345.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>或是通过插入对象:<br><img data-src="https://img-blog.csdnimg.cn/20190923193949880.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/2019092319391170.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923194515876.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>随后再手动苦逼编辑…….</p><p>也许你会问:<strong>我干嘛要一个个手打调整公式,截图拍照粘贴图片美滋滋~</strong></p><p><strong>那:</strong></p><p>导师不允许怎么办?</p><p>教案规则要求不许怎么办?</p><p>图片不清晰,转为固定的PDF等文件后模糊,文档内容极受影响怎么办?</p><p>论文发表机构不接受怎么办?</p><p>………</p><h3 id="(二)LaTeX公式转换插件来帮忙,妈妈再也不用担心我的搬砖只是搬砖啦!"><a href="#(二)LaTeX公式转换插件来帮忙,妈妈再也不用担心我的搬砖只是搬砖啦!" class="headerlink" title="(二)LaTeX公式转换插件来帮忙,妈妈再也不用担心我的搬砖只是搬砖啦!"></a>(二)LaTeX公式转换插件来帮忙,妈妈再也不用担心我的搬砖只是搬砖啦!</h3><p>思路:将第一步生成的公式代码转换为对应编辑器的公式格式。<br>方法:很多。<br>一是采用外部的内置有 LaTeX 代码转换的编辑器转换好后,再转移到 Word ;另一个是采用能够嵌入 Word 的、可以转换公式代码的插件。</p><h4 id="2-1-采用-MarkDown-编辑公式"><a href="#2-1-采用-MarkDown-编辑公式" class="headerlink" title="2.1 采用 MarkDown 编辑公式"></a>2.1 采用 MarkDown 编辑公式</h4><p>首先采用复制 <strong>Mathpix snipping Tool</strong> 转换后的代码,粘贴到MarkDown上:</p><p>一<br><img data-src="https://img-blog.csdnimg.cn/2019092319500040.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>二</p><p><img data-src="https://img-blog.csdnimg.cn/20190923195207991.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>注意看上图,==左侧为MarkDown编辑器的编辑区域,右侧为效果区==,然后我们发现<strong>代码没有转换???</strong><br>WTF?</p><p><img data-src="https://img-blog.csdnimg.cn/20190923195342713.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>不慌,来了来了,注意看好,在MarkDown上下文打出一组美刀符号:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923195523796.png#pic_center" alt="在这里插入图片描述"><br><strong>随后将之前的公式代码放进上下行间,看仔细咯别眨眼:</strong><br>一<br><img data-src="https://img-blog.csdnimg.cn/20190923195808512.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>二</p><p><img data-src="https://img-blog.csdnimg.cn/20190923195754334.png#pic_center" alt="在这里插入图片描述"><br>三</p><p><img data-src="https://img-blog.csdnimg.cn/20190923195718722.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>实际转换效果展示:<br>$$<br>T_{j, i}^{(t)} :=\mathrm{P}\left(Z_{i}=j | X_{i}=\mathbf{x}<em>{i} ; \theta^{(t)}\right)=\frac{\tau</em>{j}^{(t)} f\left(\mathbf{x}<em>{i} ; \boldsymbol{\mu}</em>{j}^{(t)}, \Sigma_{j}^{(t)}\right)}{\tau_{1}^{(t)} f\left(\mathbf{x}<em>{i} ; \boldsymbol{\mu}</em>{1}^{(t)}, \Sigma_{1}^{(t)}\right)+\tau_{2}^{(t)} f\left(\mathbf{x}<em>{i} ; \boldsymbol{\mu}</em>{2}^{(t)}, \Sigma_{2}^{(t)}\right)}<br>$$</p><h4 id="2-1-1-从MarkDown到Word"><a href="#2-1-1-从MarkDown到Word" class="headerlink" title="2.1.1 从MarkDown到Word"></a>2.1.1 从MarkDown到Word</h4><p>首先设置Word粘贴的格式,插入–公式–工具 ,选择右下角箭头弹出以下窗口,按照步骤设置即可:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923201919630.png#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923201738658.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><p><img data-src="https://img-blog.csdnimg.cn/20190923201805609.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>右键点击右侧公式,选择Show Math As,MathML Code</p><p><img data-src="https://img-blog.csdnimg.cn/20190923200930289.png#pic_center" alt="在这里插入图片描述"><br>全选复制呈现出的MathML:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923201014753.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>将其粘贴到word中,右键选择粘贴,选项选择 “只保留文本”即可完成:</p><p><img data-src="https://img-blog.csdnimg.cn/2019092320123316.png#pic_center" alt="在这里插入图片描述"></p><h4 id="2-2-在-Microsoft-Office-中-选择嵌入式-Word-插件编辑公式(强推!!)"><a href="#2-2-在-Microsoft-Office-中-选择嵌入式-Word-插件编辑公式(强推!!)" class="headerlink" title="2.2 在 Microsoft Office 中 选择嵌入式 Word 插件编辑公式(强推!!)"></a>2.2 在 Microsoft Office 中 选择嵌入式 Word 插件编辑公式(强推!!)</h4><h4 id="2-2-1-插件选择、说明与获取"><a href="#2-2-1-插件选择、说明与获取" class="headerlink" title="2.2.1 插件选择、说明与获取"></a>2.2.1 插件选择、说明与获取</h4><p>该类嵌入式转换插件很多,其中有国外的 <strong>MathType</strong> 是比较好用的,但是由于费用问题,故选择使用国内的一款软件 <strong>AxMath</strong> ,下载链接请扫描二维码获取下载链接(破解),或是自行到官方获取亦可。</p><p>当然也可以选择其他插件,主要看个人习惯。</p><p>下列内容将围绕 <strong>AxMath</strong> 展开。</p><h4 id="2-2-2-安装-AxMath"><a href="#2-2-2-安装-AxMath" class="headerlink" title="2.2.2 安装 AxMath"></a>2.2.2 安装 <strong>AxMath</strong></h4><p>将下载的压缩包解压:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923202748985.png#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923202819839.png#pic_center" alt="在这里插入图片描述"></p><p>点击 <strong>AxMath 2.5</strong> 进行安装(安装路径自定义),完成后退出程序,然后将Crack文件夹里的AxMath.exe复制到软件安装目录下即可完成破解。</p><p><strong>==注意:安装前一定要关闭所有word或是WPS的进程,具体:关闭程序,下方工具栏空白处右键打开任务管理器查看是否有后台程序在运行==</strong><br><img data-src="https://img-blog.csdnimg.cn/20190923202948239.png#pic_center" alt="在这里插入图片描述"></p><h4 id="2-2-3-检验"><a href="#2-2-3-检验" class="headerlink" title="2.2.3 检验"></a>2.2.3 检验</h4><p>此时打开Word 或是 WPS:<br><img data-src="https://img-blog.csdnimg.cn/20190923203126429.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923203137656.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923203235897.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923203246925.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>查看有如上图所示即可安装成功,接下来进行操作后续操作,<strong>后续将采用 Word 进行演示</strong>。</p><h4 id="2-2-4-将复制的LaTeX直接插入Word的行内公式"><a href="#2-2-4-将复制的LaTeX直接插入Word的行内公式" class="headerlink" title="2.2.4 将复制的LaTeX直接插入Word的行内公式"></a>2.2.4 将复制的LaTeX直接插入Word的行内公式</h4><p>示例公式:<br><img data-src="https://img-blog.csdnimg.cn/201909232043594.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><p>复制转换后的 <strong>Mathpix snipping Tool</strong> 公式代码,打开Word:<br><img data-src="https://img-blog.csdnimg.cn/20190923204137920.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>点击插件 <strong>AxMath</strong> ,将光标点中需要插入的位置,然后选择插入 <strong>行内公式</strong> :</p><p><img data-src="https://img-blog.csdnimg.cn/20190923204436109.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>弹出窗口:<br><img data-src="https://img-blog.csdnimg.cn/20190923204506484.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>采用快捷键:<strong>Ctrl + V</strong> 粘贴公式到空白处,查看公式有无错误,有即在当前窗口修改:</p><p><img data-src="https://img-blog.csdnimg.cn/20190923204700154.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><p>修改好后直接关闭窗口即可,查看公式效果如下:<br><img data-src="https://img-blog.csdnimg.cn/20190923204734478.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="效果图"></p><h4 id="2-2-4-将复制的LaTeX插入Word为行间公式"><a href="#2-2-4-将复制的LaTeX插入Word为行间公式" class="headerlink" title="2.2.4 将复制的LaTeX插入Word为行间公式"></a>2.2.4 将复制的LaTeX插入Word为行间公式</h4><p>示例公式:<br><img data-src="https://img-blog.csdnimg.cn/20190923204934422.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>光标定位并打开插件功能区域,选择 <strong>行间公式</strong>:<br><img data-src="https://img-blog.csdnimg.cn/20190923205149643.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923205328517.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="2-2-5-给添加的公式进行标号"><a href="#2-2-5-给添加的公式进行标号" class="headerlink" title="2.2.5 给添加的公式进行标号"></a>2.2.5 给添加的公式进行标号</h4><p>在论文期刊或是教材书籍中,我们均发现对其进行了标号,这是一项最基本的要求,那么该怎么完成呢?</p><p>测试:<br><img data-src="https://img-blog.csdnimg.cn/20190923205703958.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>点击选择需要标记的公式:<br><img data-src="https://img-blog.csdnimg.cn/20190923205808796.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>点击上方 <strong>AxMath</strong> 公式插件功能区,选择插入编号,其效果如图所示:<br><img data-src="https://img-blog.csdnimg.cn/20190923205924547.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>选中编号拖动到该公式后侧:<br><img data-src="https://img-blog.csdnimg.cn/20190923210044712.png#pic_center" alt="在这里插入图片描述"><br>选择公式及编号,设定为右对齐方式,随后在公式和编号之间键入Tab或是空格键调整公式的排版:<br><img data-src="https://img-blog.csdnimg.cn/20190923210233512.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/2019092321025443.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>完成编号输入。</p><h4 id="2-2-6-自动添加公式编号"><a href="#2-2-6-自动添加公式编号" class="headerlink" title="2.2.6 自动添加公式编号"></a>2.2.6 自动添加公式编号</h4><p>手动输入比较麻烦,那么能不能自动键入呢?答案是可以的,在插入公式时,选择插入编号公式即可(编号在左在右就不需要说明了,按照自己的要求来):</p><p><img data-src="https://img-blog.csdnimg.cn/20190923210726596.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923210853932.png#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/2019092321092872.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h4 id="2-2-7-更改公式编号级别"><a href="#2-2-7-更改公式编号级别" class="headerlink" title="2.2.7 更改公式编号级别"></a>2.2.7 更改公式编号级别</h4><p>我们可能会需要在不同的章节、不同级别的标题下使用相应级别的公式编号,如第一章公式 <strong>(1-1 ..)</strong> ;第二章公式 <strong>(2-1 …)</strong> ,那么怎么实现呢?<br><img data-src="https://img-blog.csdnimg.cn/20190923211138806.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>公式插入好后,在二级章节(级别)第一个公式上点击选中公式的编号,然后点击上面插件的功能区选项:<br><img data-src="https://img-blog.csdnimg.cn/20190923211512979.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923211531236.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>哎?这时候发现没反应:<br><img data-src="https://img-blog.csdnimg.cn/20190923211602196.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>选中刚刚更改的编号,然后点击更新试试:<br><img data-src="https://img-blog.csdnimg.cn/20190923211626820.png#pic_center" alt="在这里插入图片描述"><br><img data-src="https://img-blog.csdnimg.cn/20190923211659471.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>这时发现编号已更新!</p><h4 id="2-2-8-更改公式编号的样式"><a href="#2-2-8-更改公式编号的样式" class="headerlink" title="2.2.8 更改公式编号的样式"></a>2.2.8 更改公式编号的样式</h4><p>刚刚的编号不好看?</p><p>编号格式不符合要求,改?</p><p>咋整?<br><img data-src="https://img-blog.csdnimg.cn/20190923211944799.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>这么整:<br><img data-src="https://img-blog.csdnimg.cn/20190923212006519.png#pic_center" alt="在这里插入图片描述"><br>小白萌新操作:<br><img data-src="https://img-blog.csdnimg.cn/20190923212031495.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>大神操作:<br><img data-src="https://img-blog.csdnimg.cn/20190923212048761.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br>两种方法都可以,自己选。</p><h4 id="2-2-9-其他功能"><a href="#2-2-9-其他功能" class="headerlink" title="2.2.9 其他功能"></a>2.2.9 其他功能</h4><p><img data-src="https://img-blog.csdnimg.cn/20190923214040296.png#pic_center" alt="在这里插入图片描述"><br><strong>==下载好了自己不会摸索啊?!哈哈哈哈 [手动狗头]==</strong></p><h3 id="啊,几个小时过去了,我就写了这么个东西,用上了自己截图编写的测试文档等等琐碎的东西,太难了,欢迎转发交流使用,原创不易,偷窃可耻,希望有转载需要的还请联系并标注来源,谢谢。"><a href="#啊,几个小时过去了,我就写了这么个东西,用上了自己截图编写的测试文档等等琐碎的东西,太难了,欢迎转发交流使用,原创不易,偷窃可耻,希望有转载需要的还请联系并标注来源,谢谢。" class="headerlink" title="啊,几个小时过去了,我就写了这么个东西,用上了自己截图编写的测试文档等等琐碎的东西,太难了,欢迎转发交流使用,原创不易,偷窃可耻,希望有转载需要的还请联系并标注来源,谢谢。"></a>啊,几个小时过去了,我就写了这么个东西,用上了自己截图编写的测试文档等等琐碎的东西,太难了,欢迎转发交流使用,原创不易,偷窃可耻,希望有转载需要的还请联系并标注来源,谢谢。</h3><p><img data-src="https://img-blog.csdnimg.cn/20190923214014881.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><h2 id="三、AxMath下载链接与获取方式"><a href="#三、AxMath下载链接与获取方式" class="headerlink" title="三、AxMath下载链接与获取方式"></a>三、AxMath下载链接与获取方式</h2><h3 id="一)下载链接"><a href="#一)下载链接" class="headerlink" title="(一)下载链接"></a>(一)下载链接</h3><table><thead><tr><th>说明</th><th>链接</th></tr></thead><tbody><tr><td>AxMath1</td><td><a href="https://pan.baidu.com/s/1ej8clyZkLM2YYUO8hb9TRA" target="_blank" rel="noopener">https://pan.baidu.com/s/1ej8clyZkLM2YYUO8hb9TRA</a></td></tr><tr><td>AxMath2</td><td><a href="https://pan.baidu.com/s/1uA4mJp8xkJId0ZL_YH51aw" target="_blank" rel="noopener">https://pan.baidu.com/s/1uA4mJp8xkJId0ZL_YH51aw</a></td></tr><tr><td>Mathpix snipping Tool</td><td><a href="https://pan.baidu.com/s/1n3EUuuUB_OZkmSPSYwvXeg" target="_blank" rel="noopener">https://pan.baidu.com/s/1n3EUuuUB_OZkmSPSYwvXeg</a></td></tr><tr><td>### (二)说明</td><td></td></tr><tr><td><strong>以上链接中,Mathpix snipping Tool可到官网下载,AxMath 有两个,选择其一即可,需要提取码才能下载,请扫描下方二维码获取提取码。</strong></td><td></td></tr><tr><td>## 四、下载提取码二维码链接(weixin)</td><td></td></tr><tr><td>复制以下文字并后台回复即可获取提取码 :</td><td></td></tr><tr><td>1.<strong>AxMath</strong></td><td></td></tr></tbody></table><p>2.<strong>Mathpix snipping Tool</strong></p><p><img data-src="https://img-blog.csdnimg.cn/20190923214230511.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/38231796.html#disqus_thread</comments>
</item>
<item>
<title>Hexo 部署到Coding & Github Pages 服务器</title>
<link>https://www.ganahe.top/archives/3af46901.html</link>
<guid>https://www.ganahe.top/archives/3af46901.html</guid>
<pubDate>Sat, 14 Mar 2020 20:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><!-- rebuild by neat -->
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/3af46901.html#disqus_thread</comments>
</item>
<item>
<title>图床插入Typora的方式</title>
<link>https://www.ganahe.top/archives/c72adf2d.html</link>
<guid>https://www.ganahe.top/archives/c72adf2d.html</guid>
<pubDate>Sat, 14 Mar 2020 20:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><p>图床来也。</p><p>Typora插入外链图像方式:</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">![Picture Description](图床URL)</span><br></pre></td></tr></table></figure><p><img data-src="https://img.rawpixel.com/s3fs-private/rawpixel_images/website_content/pf-14-lukestackpoole9-drone-shot-in-californian-redwoods.jpg?auto=format&bg=transparent&con=3&cs=srgb&dpr=1&fm=jpg&ixlib=php-3.1.0&mark=rawpixel-watermark.png&markalpha=90&markpad=13&markscale=10&markx=25&q=75&usm=15&vib=3&w=1200&s=da66f43586540d586c60a926ea82dd27" alt></p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><p>图床来也。</p><p>Typora插入外链图像方式:</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">![Picture Description](图床URL)</span><br></pre></td></tr></table></figure><p><img data-src="https://img.rawpixel.com/s3fs-private/rawpixel_images/website_content/pf-14-lukestackpoole9-drone-shot-in-californian-redwoods.jpg?auto=format&bg=transparent&con=3&cs=srgb&dpr=1&fm=jpg&ixlib=php-3.1.0&mark=rawpixel-watermark.png&markalpha=90&markpad=13&markscale=10&markx=25&q=75&usm=15&vib=3&w=1200&s=da66f43586540d586c60a926ea82dd27" alt></p><a id="more"></a><p>示例:Rawpixel图床</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">![](https:<span class="comment">//img.rawpixel.com/s3fs-private/rawpixel_images/website_content/pf-14-lukestackpoole9-drone-shot-in-californian-redwoods.jpg?auto=format&bg=transparent&con=3&cs=srgb&dpr=1&fm=jpg&ixlib=php-3.1.0&mark=rawpixel-watermark.png&markalpha=90&markpad=13&markscale=10&markx=25&q=75&usm=15&vib=3&w=1200&s=da66f43586540d586c60a926ea82dd27)</span></span><br></pre></td></tr></table></figure><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/c72adf2d.html#disqus_thread</comments>
</item>
<item>
<title>VMwave完全删除一个虚拟机释放本地空间</title>
<link>https://www.ganahe.top/archives/3456489.html</link>
<guid>https://www.ganahe.top/archives/3456489.html</guid>
<pubDate>Sat, 14 Mar 2020 16:00:00 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h3 id="说明"><a href="#说明" class="headerlink" title="说明"></a>说明</h3><p>使用VMwave的人都知道删除虚拟机时,有时候并不会释放本地的磁盘空间,参照网上的很多办法(亲测)还是有残余,而且大部分方法是需要找到虚拟机的目录并针对特定文件或文件夹删除的。</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><h3 id="说明"><a href="#说明" class="headerlink" title="说明"></a>说明</h3><p>使用VMwave的人都知道删除虚拟机时,有时候并不会释放本地的磁盘空间,参照网上的很多办法(亲测)还是有残余,而且大部分方法是需要找到虚拟机的目录并针对特定文件或文件夹删除的。</p><a id="more"></a><h2 id="但这种方式不保险还麻烦"><a href="#但这种方式不保险还麻烦" class="headerlink" title="但这种方式不保险还麻烦"></a>但这种方式不保险还麻烦</h2><p>那么,该怎么办?</p><p>1.打开Vmware的管理界面;<br>2.选择需要删除的虚拟机;<br>3.右键,在弹出的对话框中选择如下图选项:<br><img data-src="https://img-blog.csdnimg.cn/20190620170251457.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>4.完成。</p><h3 id="更多资讯请点击:星辰幻日"><a href="#更多资讯请点击:星辰幻日" class="headerlink" title="更多资讯请点击:星辰幻日"></a>更多资讯请点击:<a href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzUxNDkyMTQ1Nw==&scene=126&bizpsid=1558318813#wechat_redirect" target="_blank" rel="noopener">星辰幻日</a></h3><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/3456489.html#disqus_thread</comments>
</item>
<item>
<title>Python中a , b = b , a + b与a = b , b = a + b 的区别(超详细解答)</title>
<link>https://www.ganahe.top/archives/101025.html</link>
<guid>https://www.ganahe.top/archives/101025.html</guid>
<pubDate>Sat, 14 Mar 2020 12:18:49 GMT</pubDate>
<description>
<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><p>在最近学的Python斐波那契数列(Fibonacci sequence)中遇到了这么一个奇怪的赋值计算方式,a , b =b ,a + b:</p>
</description>
<content:encoded><![CDATA[<!-- build time:Wed Aug 12 2020 17:09:57 GMT+0800 (GMT+08:00) --><p>在最近学的Python斐波那契数列(Fibonacci sequence)中遇到了这么一个奇怪的赋值计算方式,a , b =b ,a + b:</p><a id="more"></a><h4 id="源代码如下:"><a href="#源代码如下:" class="headerlink" title="源代码如下:"></a>源代码如下:</h4><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> sys</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">Fibonacci</span><span class="params">(k)</span>:</span></span><br><span class="line"> a = <span class="number">0</span></span><br><span class="line"> b = <span class="number">1</span></span><br><span class="line"> count = <span class="number">0</span></span><br><span class="line"> <span class="keyword">while</span> <span class="literal">True</span>:</span><br><span class="line"> <span class="keyword">if</span>(count > k):</span><br><span class="line"> <span class="keyword">return</span></span><br><span class="line"> <span class="keyword">yield</span> a</span><br><span class="line"> a,b=b,a+b</span><br><span class="line"> count+=<span class="number">1</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">testPrint</span><span class="params">(data)</span>:</span></span><br><span class="line"></span><br><span class="line"> Fou = Fibonacci(data) <span class="comment">#注:F为yield生成器返回生成的迭代器,相当于iter()</span></span><br><span class="line"> <span class="keyword">while</span> <span class="literal">True</span>:</span><br><span class="line"> <span class="keyword">try</span>:</span><br><span class="line"> print(next(Fou), end = <span class="string">" "</span>)</span><br><span class="line"> <span class="keyword">except</span> StopIteration:</span><br><span class="line"> sys.exit()</span><br><span class="line"></span><br><span class="line">testPrint(<span class="number">10</span>)</span><br></pre></td></tr></table></figure><h4 id="输出结果如是:"><a href="#输出结果如是:" class="headerlink" title="输出结果如是:"></a>输出结果如是:</h4><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">D:\Program Files\Python37\python.exe<span class="string">" E:/python/LearnProject/FileOpration.py</span></span><br><span class="line"><span class="string">0 1 1 2 3 5 8 13 21 34 55 </span></span><br><span class="line"><span class="string">进程已结束,退出代码0</span></span><br></pre></td></tr></table></figure><h2 id="将以上源代码中a-b-b-a-b-换成-a-b-b-a-b后,效果如下:"><a href="#将以上源代码中a-b-b-a-b-换成-a-b-b-a-b后,效果如下:" class="headerlink" title="将以上源代码中a , b = b ,a + b 换成 a = b , b = a + b后,效果如下:"></a>将以上源代码中a , b = b ,a + b 换成 a = b , b = a + b后,效果如下:</h2><p>部分切换后的源代码:<br><img data-src="https://img-blog.csdnimg.cn/20190820140834321.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>结果如下:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"D:\Program Files\Python37\python.exe"</span> E:/python/LearnProject/FileOpration.py</span><br><span class="line"><span class="number">0</span> <span class="number">1</span> <span class="number">2</span> <span class="number">4</span> <span class="number">8</span> <span class="number">16</span> <span class="number">32</span> <span class="number">64</span> <span class="number">128</span> <span class="number">256</span> <span class="number">512</span> </span><br><span class="line">进程已结束,退出代码<span class="number">0</span></span><br></pre></td></tr></table></figure><h2 id="分析"><a href="#分析" class="headerlink" title="分析"></a>分析</h2><p>a = 0<br>b = 1<br>count = 0<br>初始赋值如上所示,count记录循环次数。<br>进入循环:</p><h4 id="对于a-b-b-a-b-:"><a href="#对于a-b-b-a-b-:" class="headerlink" title="对于a , b = b ,a + b :"></a>对于a , b = b ,a + b :</h4><ol><li>计算过程:首先计算b = b ,a + b,即 b = b = 1, a +b = 0 + 1 = 1 ;</li><li>接下来赋值: a = b = 1;</li><li>继续循环重复以上步骤,请拿出笔自行演算或参见以上输出结果。<h4 id="对于a-b-b-a-b-:-1"><a href="#对于a-b-b-a-b-:-1" class="headerlink" title="对于a = b , b = a + b :"></a>对于a = b , b = a + b :</h4></li><li>这是最为常见的赋值计算式,计算过程:首先赋值 a = b = 1;</li><li>接下来计算: b = a + b = 1 + 1 = 2;</li><li>注意到这里两个式子结果已经不同,导致了以上第二次输出情况。</li><li>继续循环重复以上步骤,请拿出笔自行演算或参见以上输出结果。</li></ol><h3 id="更多资讯及资源分享,请扫描下方二维码交流:"><a href="#更多资讯及资源分享,请扫描下方二维码交流:" class="headerlink" title="更多资讯及资源分享,请扫描下方二维码交流:"></a>更多资讯及资源分享,请扫描下方二维码交流:</h3><p><img data-src="https://img-blog.csdnimg.cn/20190820141834229.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjY0NjEwMw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p><!-- rebuild by neat -->]]></content:encoded>
<comments>https://www.ganahe.top/archives/101025.html#disqus_thread</comments>
</item>
</channel>
</rss>