knightroberny 發表在 痞客邦 留言(0) 人氣()
一、TableSorter 介紹
在所有 jQuery 表格排序外掛裡面,TableSorter 算是使用率最高的,並且擴充功能相當多(但不一定用獲得),因此本篇保舉這個工具。
1. 官網說明
https://mottie.github.io/tablesorter/docs/
下載檔案後找到這幾個檔案
knightroberny 發表在 痞客邦 留言(0) 人氣()
本文為大家講授的是PHP錯誤Notice : Use of undefined constant 的完美解決方式,這個php的非致命毛病提示在pph5.3以上的版本中呈現的頻率異常好,主要是因為php.ini中的毛病級別設置裝備擺設的問題,感愛好的同窗參考下.
本文為大家講解的是PHP毛病Notice : Use of undefined constant 的完善解決方法,這個php的非致命毛病提示在php5.3以上的版本中泛起的頻率十分好,首要是因為php.ini中的毛病級別設置裝備擺設的問題.
問題申明:會快速造成磁碟空間滿載,致使系統沒法正常利用.
- cat /var/log/httpd/error_log
knightroberny 發表在 痞客邦 留言(0) 人氣()
- Model summary (fused): 168 layers, 3011108 parameters, 0 gradients
- Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 45.58it/s]
- all 12 12 0 0 0 0
- Traceback (most recent call last):
- File "D:\yolo\testyolo.py", line 13, in <module>
- model.train(data="data.yaml",
- File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\model.py", line 334, in train
- self.trainer.train()
- File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\trainer.py", line 195, in train
- self._do_train(world_size)
- File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\trainer.py", line 418, in _do_train
- self.final_eval()
- File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\trainer.py", line 573, in final_eval
- self.metrics = self.validator(model=f)
- File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
- return func(*args, **kwargs)
- File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\validator.py", line 190, in __call__
- self.print_results()
- File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\models\yolo\detect\val.py", line 165, in print_results
- names=self.names.values(),
- AttributeError: 'str' object has no attribute 'values'
- Exception in thread Thread-12 (plot_images):
- Traceback (most recent call last):
- File "D:\ProgramData\Anaconda3\envs\python310\lib\threading.py", line 1009, in _bootstrap_inner
- self.run()
- File "D:\ProgramData\Anaconda3\envs\python310\lib\threading.py", line 946, in run
- self._target(*self._args, **self._kwargs)
- File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\utils\plotting.py", line 442, in plot_images
- c = names.get(c, c) if names else c
- AttributeError: 'str' object has no attribute 'get'
-
- Process finished with exit code 1
-
複製代碼
knightroberny 發表在 痞客邦 留言(0) 人氣()
資料庫常常是有看沒有懂
圖解秒懂SQL語言
knightroberny 發表在 痞客邦 留言(0) 人氣()
影片
TB6612FNG是東芝生產的馬達驅動與節制IC,內部包括兩組H橋式電路,可驅動和節制兩個小型直流馬達,或一個雙極性步進馬達。
knightroberny 發表在 痞客邦 留言(0) 人氣()
成績圖:
座標:
- [[ 16 290]
- [412 491]
- [740 626]
- [283 631]
- [146 651]
- [ 32 710]]
- 5.0
- image 1/1 D:\yolo\bus.jpg: 640x480 4 persons, 1 bus, 1 stop sign, 83.9ms
- Speed: 3.0ms preprocess, 83.9ms inference, 4.0ms postprocess per image at shape (1, 3, 640, 480)
- tensor([[ 22.3412, 228.0822, 802.0841, 754.3939]], device='cuda:0')
- 準確率 0.879738450050354
- x,y: [[412 491]]
- 0.0
- tensor([[ 47.5999, 398.8344, 244.2552, 903.1386]], device='cuda:0')
- 準確率 0.873720109462738
- x,y: [[146 651]]
- 0.0
- tensor([[670.3670, 376.9174, 810.0000, 875.0829]], device='cuda:0')
- 準確率 0.8693700432777405
- x,y: [[740 626]]
- 0.0
- tensor([[220.5713, 405.7240, 344.5589, 857.2506]], device='cuda:0')
- 準確率 0.819391667842865
- x,y: [[283 631]]
- 11.0
- tensor([[7.7698e-02, 2.5441e+02, 3.2119e+01, 3.2465e+02]], device='cuda:0')
- 準確率 0.44594067335128784
- x,y: [[ 16 290]]
- 0.0
- tensor([[3.2650e-02, 5.4988e+02, 6.4001e+01, 8.6930e+02]], device='cuda:0')
- 準確率 0.29976797103881836
- x,y: [[ 32 710]]
-
knightroberny 發表在 痞客邦 留言(0) 人氣()
ESP32 腳位34 毗鄰到可變電阻腳位 2
ESP32 腳位VIN 毗連到可變電阻腳位 1
ESP32 腳位GND 連接到可變電阻腳位 3
讀取數值為12 bits = 4096
0 - 4095
程式碼:
- const int potPin = 34;
- int val=0;
- void setup() {
- Serial.begin(115200); //連線速度
- delay(1000);
- }
-
- void loop() {
- // put your main code here, to run repeatedly:
- val = analogRead(potPin); //讀取電壓數值
- Serial.println(val); //印出電壓數值
- delay(500); //延遲0.5秒
- }
knightroberny 發表在 痞客邦 留言(0) 人氣()
申明:在Linux下把excel數據導入到mysql數據庫中,這其實是很搞笑的一個活動!幾近很少有法式員研究過這個問題吧?如斯變態的問題,估量我是第一個研究的!呵呵,完滿是自找苦吃~~,然則今天完了這項太有挑戰性的工作!
先清算一下思緒先,~~
首先:需要把文件上傳到服務器上
然後:讀取excel數據列顯示出來
然後:讓用戶選擇字段的對應關係
然後:提交數據,讀取字段的對應關係
最後:批量導入數據,刪除且則文件
一共是以上五步調!我們一步步闡明~~~
第一步:下載附件中的phpexcelparser4.rar ,這個文件是上傳excel盜服務器上並以web情勢展示出來的!這個一般沒有問題的!問題是法式的做法是把表存為且自表而沒有真正保留下來,所以起首要更改法式代碼為
-
- //uc轉換成html
- function uc2html($str) {
- $ret = '';
- for( $i=0; $i<strlen($str)/2; $i++ ) {
- $charcode = ord($str[$i*2])+256*ord($str[$i*2+1]);
- // $ret .= '&#'.$charcode;
- if($charcode<127)
- $ret .=chr($charcode);
- else
- $ret .= iconv("utf-8","utf-8",u2utf8($charcode));
- }
- return $ret;
- }
- //html轉成utf8
- function u2utf8($c) {
- $str="";
- if ($c < 0x80) {
- $str.=$c;
- } else if ($c < 0x800) {
- $str.=chr(0xC0 | $c>>6);
- $str.=chr(0x80 | $c & 0x3F);
- } else if ($c < 0x10000) {
- $str.=chr(0xE0 | $c>>12);
- $str.=chr(0x80 | $c>>6 & 0x3F);
- $str.=chr(0x80 | $c & 0x3F);
- } else if ($c < 0x200000) {
- $str.=chr(0xF0 | $c>>18);
- $str.=chr(0x80 | $c>>12 & 0x3F);
- $str.=chr(0x80 | $c>>6 & 0x3F);
- $str.=chr(0x80 | $c & 0x3F);
- }
- return $str;
- }
-
- if (trim($_POST["cmd"])=="upload")
- {
- $err_corr = "Unsupported format or file corrupted";
- $excel_file_size;
- $excel_file = $_FILES['excel_file'];
- $uploadservername=$UploadAbsPath."tmpexcel/".$_FILES['excel_file']['name'];
- echo($uploadservername);
- if (!is_writeable($UploadAbsPath."tmpexcel/"))
- {
- echo "目錄不成寫!"; exit;
- }
- else
- {
- echo "目次可寫!";
- }
- if (move_uploaded_file($_FILES['excel_file']['tmp_name'], $uploadservername))
- {
- echo("上傳成功");
- }
- else
- {
- echo("上傳失敗");
- }
- $excel_file=$uploadservername;
- //if( $excel_file )
- // $excel_file = $_FILES['excel_file']['tmp_name'];
-
-
- if( $excel_file == '' ) fatal("No file uploaded");
-
-
- $exc = new ExcelFileParser("debug.log", ABC_NO_LOG);//ABC_NO_LOG ABC_VAR_DUMP);
- //echo($excel_file."|");
-
- $style = $_POST['style'];
- if( $style == 'old' )
- {
- $fh = @fopen ($excel_file,'rb');
- if( !$fh ) fatal("No file uploaded");
- if( filesize($excel_file)==0 ) fatal("No file uploaded");
- $fc = fread( $fh, filesize($excel_file) );
- @fclose($fh);
- if( strlen($fc) < filesize($excel_file) )
- fatal("Cannot read file");
-
- $time_start = getmicrotime();
- $res = $exc->ParseFromString($fc);
- $time_end = getmicrotime();
- }
- elseif( $style == 'segment' )
- {
- $time_start = getmicrotime();
- $res = $exc->ParseFromFile($excel_file);
- $time_end = getmicrotime();
- }
-
-
- switch ($res) {
- case 0: break;
- case 1: fatal("Can't open file");
- case 2: fatal("File too small to be an Excel file");
- case 3: fatal("Error reading file header");
- case 4: fatal("Error reading file");
- case 5: fatal("This is not an Excel file or file stored in Excel < 5.0");
- case 6: fatal("File corrupted");
- case 7: fatal("No Excel data found in file");
- case 8: fatal("Unsupported file version");
-
-
- default:
- fatal("Unknown error");
- }
-
-
- /*
- print '<pre>';
- print_r( $exc );
- print '</pre>';
- exit;
- */
-
-
- show_time();
-
-
- echo <<<LEG
- <b>Legend:</b><br><br>
- <form name='doform' action='' method='post'>
- <input type='hidden' name='action' value='do'>
- <input type='hidden' name='excel_file' value=$excel_file>
- <input type='hidden' name='style' value=$style>
- <table border=1 cellspacing=0 cellpadding=0>
- <tr><td>Data type</td><td>Description</td></tr>
- <tr><td class=empty> </td><td class=index>An empty cell</td></tr>
- <tr><td class=dt_string>ABCabc</td><td class=index>String</td></tr>
- <tr><td class=dt_int>12345</td><td class=index>Integer</td></tr>
- <tr><td class=dt_float>123.45</td><td class=index>Float</td></tr>
- <tr><td class=dt_date>123.45</td><td class=index>Date</td></tr>
- <table>
- <br><br>
-
-
- LEG;
- /*
- print "<pre>";
- print_r ($exc->worksheet);
- print_r($exc->sst);
- print "</pre>";
- */
- for( $ws_num=0; $ws_num<count($exc->worksheet['name']); $ws_num++ )
- {
- print "<b>Worksheet: \"";
- if( $exc->worksheet['unicode'][$ws_num] ) {
- print uc2html($exc->worksheet['name'][$ws_num]);
- } else
- print $exc->worksheet['name'][$ws_num];
-
-
- print "\"</b>";
- $ws = $exc->worksheet['data'][$ws_num];
-
-
- if( is_array($ws) &&
- isset($ws['max_row']) && isset($ws['max_col']) ) {
- echo "\n<br><br><table border=1 cellspacing=0 cellpadding=2>\n";
-
-
- print "<tr><td> </td>\n";
- for( $j=0; $j<=$ws['max_col']; $j++ ) {
- print "<td class=index> ";
- if( $j>25 ) print chr((int)($j/26)+64);
- //這裡要顯示一個下拉列表來顯示數據
- //注意是輪回數據<br />
- echo("\n<select name='".$j."'>");
- echo("\n<option value='0'>不選擇</option>");
- echo("\n<option value='costomernum'>客戶編號</option>");
- echo("\n<option value='name'>客戶姓名</option>");
- echo("\n<option value='phone1'>電話1</option>");
- echo("\n<option value='phone2'>德律風2</option>");
- echo("\n<option value='address1'>地址1</option>");
- echo("\n<option value='address2'>地址2</option>");
- echo("\n<option value='company'>公司</option>");
- echo("\n<option value='levelc'>職稱</option>");
- echo("\n<option value='ps'>備註</option>");
-
- echo("</select>");
- print "</td>";
- }
-
-
- print "<tr><td> </td>\n";
- for( $j=0; $j<=$ws['max_col']; $j++ ) {
- print "<td class=index> ";
- if( $j>25 ) print chr((int)($j/26)+64);
- print chr(($j % 26) + 65)." 列名</td>";
- }
-
-
-
- //表頭輸出終了
- if ($ws['max_row']>9)
- {
- $shownum=9;
- }
- else
- {
- $shownum=$ws['max_row'];//只輸出前10條數據
- }
- for( $i=0; $i<=$shownum; $i++ ) {
- print "<tr><td class=index>".($i+1)."</td>\n";
- if(isset($ws['cell'][$i]) && is_array($ws['cell'][$i]) ) {
- for( $j=0; $j<=$ws['max_col']; $j++ ) {
-
-
- if( ( is_array($ws['cell'][$i]) ) &&
- ( isset($ws['cell'][$i][$j]) )
- ){
-
-
- // print cell data
- print "<td class=\"";
- $data = $ws['cell'][$i][$j];
-
-
- $font = $ws['cell'][$i][$j]['font'];
- $style = " style ='".ExcelFont::ExcelToCSS($exc->fonts[$font])."'";
-
-
- switch ($data['type']) {
- // string
- case 0:
- print "dt_string\"".$style.">";
- $ind = $data['data'];
- if( $exc->sst['unicode'][$ind] ) {
- $s = uc2html($exc->sst['data'][$ind]);
- } else
- $s = $exc->sst['data'][$ind];
- if( strlen(trim($s))==0 )
- print " ";
- else
- print $s;
- break;
- // integer number
- case 1:
- print "dt_int\"".$style."> ";
- print $data['data'];
- break;
- // float number
- case 2:
- print "dt_float\"".$style."> ";
- echo $data['data'];
- break;
- // date
- case 3:
- print "dt_date\"".$style."> ";
-
-
- $ret = $data[data];//str_replace ( " 00:00:00", "", gmdate("d-m-Y H:i:s",$exc->xls2tstamp($data[data])) );
- echo ( $ret );
- break;
- default:
- print "dt_unknown\"".$style."> ";
- break;
- }
- print "</td>\n";
- } else {
- print "<td class=empty> </td>\n";
- }
- }
- } else {
- // print an empty row
- for( $j=0; $j<=$ws['max_col']; $j++ )
- print "<td class=empty> </td>";
- print "\n";
- }
- print "</tr>\n";
- }
-
-
- echo "</table><br>\n";
- } else {
- // emtpty worksheet
- print "<b> - empty</b><br>\n";
- }
- print "<br>";
-
-
- }
- echo("<input type='submit' name='Submit' value='轉換' />");
- echo("</form>");
- /* print "Formats<br>";
- foreach($exc->format as $value) {
- printf("( %x )",array_search($value,$exc->format));
- print htmlentities($value,ENT_QUOTES);
- print "<br>";
- }
-
-
- print "XFs<br>";
- for( $i=0;$i<count($exc->xf['format']);$i++) {
- printf ("(%x)",$i);
- printf (" format (%x) font (%x)",$exc->xf['format'][$i],$exc->xf['font'][$i]);
-
-
- print "<br>";
- }
- */
- }
knightroberny 發表在 痞客邦 留言(0) 人氣()
knightroberny 發表在 痞客邦 留言(0) 人氣()