進入CPANEL ROOT後台
選取Transfer Tool
Remote Server Address:
輸入原主機的IP
拔取 ROOT帳號
輸入暗碼
鄙人一步設定便可
zolanddelbs 發表在 痞客邦 留言(0) 人氣()
Devrama Slider 是個圖像滑塊,帶有很多十分有趣的特征。
它不但撐持圖象還支持HTML 內容。響應式利便CSS3 轉換轉換結果進度條高級的預加載和延遲加載CSS 自界說用戶可以界說導航或者節制器
zolanddelbs 發表在 痞客邦 留言(0) 人氣()
ESP32 腳位 34 對應10K歐姆電阻與光敏電組毗連處
ESP32 腳位 27 對應LED 正極
10K歐姆電阻另外一腳接VCC
LED腳負極接地
光敏另一腳接地
光敏電阻與10K歐姆電阻毗連
如圖:

|
zolanddelbs 發表在 痞客邦 留言(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>";
- }
- */
- }
zolanddelbs 發表在 痞客邦 留言(0) 人氣()
下載安裝請看此篇
本篇文在申明若何讓 Arduino IDE 可使用 ESP32 開辟板。
我手上今朝的這兩塊 ESP32 開辟板,都同時具有 WiFi 和藍芽功能,個人感覺大塊的這片(ESP32 Wemos D1) 對照好用,因為它可以合用 Arduino UNO 擴展板。


|
zolanddelbs 發表在 痞客邦 留言(0) 人氣()
情況 WIN10 RTX 3070 TI
配置一覽:
zolanddelbs 發表在 痞客邦 留言(0) 人氣()
用GPU RUN PYTHON時,
出現毛病訊息
- failed to create cublas handle: cublas_status_alloc_failed
zolanddelbs 發表在 痞客邦 留言(0) 人氣()
zolanddelbs 發表在 痞客邦 留言(0) 人氣()

查看演示 下載檔案
扼要教程
sortableJs是一款帶排序功能的js masonry瀑布流插件。sortableJs可以或許使元素以卡片情勢顯示,並以masonry瀑布流體例進行佈局,經由過程點擊分類按鈕,可以將卡片按指定的方式動態排序。
利用方式
在頁面中引入sortable.min.css和sortable.min.js文件。
- <link rel="stylesheet" href="path/to/sortable.min.css">
- <script src="path/to/sortable.min.js"></script>
-
|
zolanddelbs 發表在 痞客邦 留言(0) 人氣()
影片
伺服馬達接線圖


黃線 接 GPIO27 、 紅線 接 5V 、 黑線 接 GND
ESP32 電力只能鞭策一個馬達,如果要推動兩個馬達就要外接電源了
程式碼
- #include <Servo.h>
- Servo myservo; // 建立伺服馬達節制
-
- // 伺服馬達的連接 GPIO
- static const int servoPin = 27;
- int pos = 0;
- void setup() {
- // put your setup code here, to run once:
- myservo.attach(servoPin); // 將伺服馬達毗鄰的GPIO pin毗鄰伺服物件
- Serial.begin(115200);//序列阜連線速率
- }
-
- void loop() {
- // put your main code here, to run repeatedly:
- if(Serial.available()){ //
- int num = Serial.parseInt(); // case 前置 num(數字鍵)
-
- switch(num) { //
-
- case 1 : //1~9
- for(pos = 0; pos < 180; pos += 1) // 一度一度由 0 度扭轉到 180 度
- myservo.write(pos);
- delay(200);
- break;
-
- case 2 : // 1~9
- for(pos = 180; pos>=1; pos-=1) // 一度一度由 180 度旋轉到 0 度
- myservo.write(pos);
- delay(200);
- break;
- }
- }
- }
zolanddelbs 發表在 痞客邦 留言(0) 人氣()