目前分類:NetYea (123)

瀏覽方式: 標題列表 簡短摘要
網站架設

許多人用BootStrap 圖片因寬度縮小看起來很喜悅

然則縮得太小的時候,高度會到達最小高度是以沒法往下縮

會造成圖片變形,如圖

網站架設 BootStrap img-responsive

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

本文為大師講解的是PHP錯誤Notice : Use of undefined constant 的完美解決方式,這個php的非致命錯誤提示在pph5.3以上的版本中出現的頻率異常好,主要是因為php.ini中的錯誤級別配置的問題,感愛好的同窗參考下.

本文為大師講授的是PHP錯誤Notice : Use of undefined constant 的完美解決方式,這個php的非致命毛病提醒在php5.3以上的版本中泛起的頻率很是好,主要是因為php.ini中的錯誤級別設置裝備擺設的問題.

問題申明:
會快速造成磁碟空間滿載,導致系統沒法正常利用.

  1. cat /var/log/httpd/error_log
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

學會Arduino基本操控後
一定會想學會無線遙控,如藍芽Bluetooth, Wifi
這篇說明藍芽Bluetooth操控

成績圖
網站架設 若何用藍芽Bluetooth連線控制 Arduin


影片


代碼:網站架設

  1. // Include necessary libraries
  2. #include <BLEDevice.h>
  3. #include <BLEServer.h>
  4. #include <BLEUtils.h>
  5. //#include <BLE2902.h>
  6. //#include <Wire.h>
  7.  
  8. // 界說 UUIDs (注意要與App Inventor內容對應)
  9. #define SERVICE_UUID            "C6FBDD3C-7123-4C9E-86AB-005F1A7EDA01"
  10. #define CHARACTERISTIC_UUID_RX  "B88E098B-E464-4B54-B827-79EB2B150A9F"
  11. #define CHARACTERISTIC_UUID_TX  "D769FACF-A4DA-47BA-9253-65359EE480FB"
  12.  
  13. // 定義LM35 ESP32 GPIO接腳
  14. const int analogIn = A0;
  15.   
  16. int RawValue= 0;
  17. double Voltage = 0;
  18. double tempC = 0;
  19. double tempF = 0;
  20. String BLE_Code;
  21. BLECharacteristic *pCharacteristic;
  22. bool deviceConnected = false;
  23. // Handle received and sent messages
  24. boolean ledState=false;
  25. String message = "";
  26. char incomingChar;
  27.  
  28. // Temperature Sensor 與led接腳變數
  29. float temperature = 0;
  30. const int ledPin = 2;
  31.  
  32. // 設定 callbacks onConnect & onDisconnect函數
  33. class MyServerCallbacks: public BLEServerCallbacks {
  34.   void onConnect(BLEServer* pServer) {
  35.     deviceConnected = true;
  36.   };
  37.   void onDisconnect(BLEServer* pServer) {
  38.     deviceConnected = false;
  39.   }
  40. };
  41.  
  42. // 設定 callback function 當收到新的資訊 (from the Android application)
  43. class MyCallbacks: public BLECharacteristicCallbacks {
  44.   void onWrite(BLECharacteristic *pCharacteristic) {
  45.     std::string rxValue = pCharacteristic->getValue();
  46.     BLE_Code="";
  47.     if(rxValue.length() > 0) {
  48.       Serial.print("領受資料為 : ");
  49.       for(int i = 0; i < rxValue.length(); i++) {
  50.         BLE_Code+=rxValue[i];
  51.         Serial.print(rxValue[i]);
  52.       }
  53.       Serial.println();
  54.       BLE_Code.toUpperCase();
  55.       Serial.println(BLE_Code);
  56.       if(BLE_Code.indexOf("LED")==0)
  57.       {
  58.         ledState=!ledState;
  59.       Serial.println(ledState);
  60.       }
  61.       if(BLE_Code.indexOf("ON")==0)
  62.       {
  63.         Serial.println("LED 點亮!");
  64.         ledState=true;
  65.       }
  66.       else if(BLE_Code.indexOf("OFF")==0) {
  67.         Serial.println("LED 熄滅!");
  68.         ledState=false;
  69.       }
  70.     }
  71.   }
  72. };
  73.  
  74. void setup() {
  75.   Serial.begin(115200);
  76.   pinMode(ledPin, OUTPUT);
  77.    
  78.   // 創立BLE Device
  79.   BLEDevice::init("ESP32_WeMos1");
  80.  
  81.   // 成立BLE Server
  82.   BLEServer *pServer = BLEDevice::createServer();
  83.   pServer->setCallbacks(new MyServerCallbacks());
  84.  
  85.   // 確立BLE Service
  86.   BLEService *pService = pServer->createService(SERVICE_UUID);
  87.  
  88.   // 成立BLE Characteristic
  89.   pCharacteristic = pService->createCharacteristic(
  90.                       CHARACTERISTIC_UUID_TX,
  91.                       BLECharacteristic::PROPERTY_NOTIFY);                     
  92. //  pCharacteristic->addDescriptor(new BLE2902());
  93.   BLECharacteristic *pCharacteristic = pService->createCharacteristic(
  94.                                          CHARACTERISTIC_UUID_RX,
  95.                                          BLECharacteristic::PROPERTY_WRITE);
  96. pCharacteristic->setCallbacks(new MyCallbacks());
  97.  
  98.   // 最先(起)service
  99.   pService->start();
  100.  
  101.   // 開始(起)advertising
  102.   pServer->getAdvertising()->start();
  103.   Serial.println("期待BLE手機連線....");
  104.   
  105.   digitalWrite(ledPin,LOW);
  106.   delay(500);
  107.   digitalWrite(ledPin,HIGH);
  108.   delay(500);
  109.   digitalWrite(ledPin,LOW);
  110. }
  111.  
  112. void loop() {
  113.   // Check received message and control output accordingly
  114.     if (ledState)
  115.         digitalWrite(ledPin, HIGH);
  116.       else
  117.         digitalWrite(ledPin, LOW);
  118.   delay(20);
  119. }
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設比來被MAIL SERVER搞得焦頭爛額
逐日到CPANEL官方問問題
後果都是沒找到被GAMIL及HOTMAIL檔信問題
也處置不了
找了小洲先生,他說只有做SmartHost relay或換IP



進入WHM -> Exim Configuration Manager -> BACKUP
備份設定檔
CPanel 若何用 Hinet 做 SmartHost r

比來被MAIL SERVER搞得焦頭爛額
每日到CPANEL官方問問題
成果都是沒找到被GAMIL及HOTMAIL檔信問題
也處置懲罰不了
找了小洲老師,他說只有做SmartHost relay或換IP



進入WHM -> Exim Configuration Manager -> BACKUP
備份設定檔

CPanel 若何用 Hinet 做 SmartHost r

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

用ESP32 PWM實現LED漸漸亮起。

程式的部分主要分成三個:1.設定頻道LEDchannel、2.附加到PIN腳、3.決議輸出巨細。

1.設定頻道LEDchannel屬性

ledcSetup(LEDChannel, freq, resolution);
//LEDChannel設定為0,分歧輸出要設定到分歧頻道,例如RGB LED就要開三個頻道分別治理R、G、B
//freq輸出頻率,建議值5000 Hz
//resolution代表輸出解析度,例如8代表0-255,10代表0-1023

2.附加到PIN腳

ledcAttachPin(ledPin, LEDChannel);
//ledPin代表腳位,看你把裝備接在哪一個腳位上面
//LEDchannel代表步調1所宣佈的LEDchannel,也就是說把設定好的LEDchannel屬性附加到某個腳位上

3.決意輸出巨細。

ledcWrite(LEDChannel, dutyCycle);
//將LEDchannel輸出dutyCycle的值。

範例程式將使接在Pin16的LED逐步亮起並熄滅,類型複製於 https://randomnerdtutorials.com/esp32-pwm-arduino-ide/

Arduino ESP32 PWM輸出 讓LED漸亮漸暗 網
Arduino ESP32 PWM輸出 讓LED漸亮漸暗 網

  1. // the number of the LED pin
  2. const int ledPin = 16;  // 16 corresponds to GPIO16
  3.  
  4. // setting PWM properties
  5. const int freq = 5000;
  6. const int ledChannel = 0;
  7. const int resolution = 8;
  8.  
  9. void setup(){
  10.   // configure LED PWM functionalitites
  11.   ledcSetup(ledChannel, freq, resolution);
  12.   
  13.   // attach the channel to the GPIO to be controlled
  14.   ledcAttachPin(ledPin, ledChannel);
  15. }
  16.  
  17. void loop(){
  18.   // increase the LED brightness
  19.   for(int dutyCycle = 0; dutyCycle <= 255; dutyCycle++){   
  20.     // changing the LED brightness with PWM
  21.     ledcWrite(ledChannel, dutyCycle);
  22.     delay(15);
  23.   }
  24.  
  25.   // decrease the LED brightness
  26.   for(int dutyCycle = 255; dutyCycle >= 0; dutyCycle--){
  27.     // changing the LED brightness with PWM
  28.     ledcWrite(ledChannel, dutyCycle);   
  29.     delay(15);
  30.   }
  31. }
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設jQuery 輪播式告白插件 flexslider 利用指南

展現網站
jQuery 輪播式告白插件 flexslider 利用指南

發現了個不錯的jQuery幻燈片插件flexslider,有接近3000 Star,應當說是很靠譜的,下面是簡單利用教程。

引入代碼

所有代碼都可以在flexlslider的Github上取得。

引入css 文件和js 文件和jQuery 焦點代碼:

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

前兩天收到中華電信HINET的德律風
說某一網域被入侵,亂發信被揭發
今天客戶說寄到GMAIL的信全數寄不出去
查了一下,先到下面網址打入IPhttps://mxtoolbox.com
https://www.dnsbl.info/dnsbl-details.php?dnsbl=dnsbl.spfbl.net
伺服器被當垃圾信跳板 申請DNS IP反解

發現有被兩個單位列入黑名單
伺服器被當垃圾信跳板 申請DNS IP反解


問了谷歌後,只要在其他dnsbl或是CBL裡沒有記載就好

直接問中華電信的 "Spam小組" 有專線(02)2192-6022 直接打去問,完全都免費。
CBL:http://cbl.abuseat.org/lookup.cgi?ip=61.218.3.178&.submit=Lookup
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設
實例需求:應用python說話爬取http://kaijiang.zhcw.com/zhcw/html/ssq/list_1.html這個開獎網站所有的信息,並且留存為txt文件和excel文件。
實例情況:python3.7
       BeautifulSoup庫、xlwt庫(需手動安裝)
       urllib庫、re庫(內置的python庫,無需手動安裝)
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設

結果圖:
Yolov8 照片偵測後如何抓物體座標位置

座標:

  1. [[ 16 290]
  2. [412 491]
  3. [740 626]
  4. [283 631]
  5. [146 651]
  6. [ 32 710]]
  7. 5.0
  8. image 1/1 D:\yolo\bus.jpg: 640x480 4 persons, 1 bus, 1 stop sign, 83.9ms
  9. Speed: 3.0ms preprocess, 83.9ms inference, 4.0ms postprocess per image at shape (1, 3, 640, 480)
  10. tensor([[ 22.3412, 228.0822, 802.0841, 754.3939]], device='cuda:0')
  11. 準確率 0.879738450050354
  12. x,y: [[412 491]]
  13. 0.0
  14. tensor([[ 47.5999, 398.8344, 244.2552, 903.1386]], device='cuda:0')
  15. 準確率 0.873720109462738
  16. x,y: [[146 651]]
  17. 0.0
  18. tensor([[670.3670, 376.9174, 810.0000, 875.0829]], device='cuda:0')
  19. 準確率 0.8693700432777405
  20. x,y: [[740 626]]
  21. 0.0
  22. tensor([[220.5713, 405.7240, 344.5589, 857.2506]], device='cuda:0')
  23. 準確率 0.819391667842865
  24. x,y: [[283 631]]
  25. 11.0
  26. tensor([[7.7698e-02, 2.5441e+02, 3.2119e+01, 3.2465e+02]], device='cuda:0')
  27. 準確率 0.44594067335128784
  28. x,y: [[ 16 290]]
  29. 0.0
  30. tensor([[3.2650e-02, 5.4988e+02, 6.4001e+01, 8.6930e+02]], device='cuda:0')
  31. 準確率 0.29976797103881836
  32. x,y: [[ 32 710]]
  33.  
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

紀錄一下批量抓取 Google 搜尋結果裡的保持的方法。


假如還沒有安裝以下,要先下載安裝:
 

  1. pip install beautifulsoup4
  2. pip install google
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設

官方文件鏈結 https://docs.ultralytics.com/models/

程式碼

  1. from ultralytics import YOLO
  2. import os
  3. os.environ["KMP_DUPLICATE_LIB_OK"]  =  "TRUE"
  4.  
  5. if __name__ == '__main__':
  6.     # Load a COCO-pretrained YOLOv8n model
  7.     model = YOLO('yolov8n.pt')
  8.  
  9.     # Display model information (optional)
  10.     model.info()
  11.  
  12.     # Train the model on the COCO8 example dataset for 100 epochs
  13.     results = model.train(data='coco8.yaml', epochs=100, imgsz=640)
  14.  
  15.     # Run inference with the YOLOv8n model on the 'bus.jpg' image
  16.     results = model('bus.jpg')
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

前台看到 相關商品

opencart 相關商品(Related Products

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

近從新調試一段pytorch 程式碼,以前的伺服器上完全沒問題,但換了一台機械,重新安裝了新版本的cuda, anaconda ,pytorch 等,之前的程式碼泛起各類版本不合適的問題。
問題:
目前說說這個問題。運行pytorch 時出現的情況如下:

  1. RuntimeError:
  2.         An attempt has been made to start a new process before the
  3.         current process has finished its bootstrapping phase.
  4.  
  5.         This probably means that you are not using fork to start your
  6.         child processes and you have forgotten to use the proper idiom
  7.         in the main module:
  8.  
  9.             if __name__ == '__main__':
  10.                 freeze_support()
  11.                 ...
  12.  
  13.         The "freeze_support()" line can be omitted if the program
  14.         is not going to be frozen to produce an executable.
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設

用nmcli可以成功確立pppoe連線
: (鄙人列例子中,我將pppoe連線定名為ppp0,刻意設定為需要時才手動進行撥接,
: 網卡的裝配名稱為對外enp1s0f0, 對內enp1s0f1)
1. 安裝模組 NetworkManager-ppp ppp
enp1s0f0設定IP:192.168.0.254
enp1s0f0設定IP:192.168.1.254

1.安裝模組

  1. dnf install NetworkManager-ppp -y
  2. dnf install ppp -y
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

有利用過進度條的朋友必然會覺得很不便利
因為要從0~100讀取 華侈時候
因檔案巨細也不知道這時候間讀寫的完嗎?
如這篇
Java Swing 若何使用進度

於是經由修正
改成此方法
可行使DIALOG準確的抓到讀寫完成的時候

  1. processdialog.setTitle("Copying files to USB");
  2.                             processdialog.add(labelimg);
  3.                             processdialog.setLocation(400,250);
  4.                             processdialog.pack(); // Packs the dialog so that the JOptionPane can be seen
  5.                             processdialog.setVisible(true); // Shows the dialog
  6.                             new Thread(){
  7.                                     public void run(){
  8.                                             try{
  9.                                                 Process process = null;
  10.                                                 BufferedReader input = null;
  11.                                                 final Runtime runtime = Runtime.getRuntime();
  12.                                                 //extact tar for ext3 file
  13.                                                 String tarstring = "tar -xvpf /"+tarpath+"/"+cellValue+".tar -C "+extpatition+"/";
  14.                                                 process = runtime.exec(new String[]{"/bin/sh","-c",tarstring});
  15.                                                 InputStream stdout = process.getInputStream ();
  16.                                                 InputStreamReader osr = new InputStreamReader (stdout);
  17.                                                 BufferedReader obr = new BufferedReader (osr);
  18.                                                 process.waitFor();
  19.                                                
  20.                                                 Thread.sleep(2000);
  21.                                             }catch(Exception e){
  22.                                                     e.printStackTrace();
  23.                                             }finally{
  24.                                                     processdialog.dispose();
  25.                                             }
  26.                                     }
  27.                             }.start();
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()


網站架設 讓網頁表格能自動排序 TableSorter

1、TableSorter 介紹
網站架設 讓網頁表格能自動排序 TableSorter
在所有 jQuery 表格排序外掛裡面,TableSorter 算是使用率最高的,而且擴充功能相當多(但不一定用獲得),是以本篇保舉這個對象。

1. 官網申明

https://mottie.github.io/tablesorter/docs/

下載檔案後找到這幾個檔案

 

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

遏制及封閉firewalld
1. To begin with, you should disable Firewalld and make sure it does not start at boot again.

 

  1. systemctl stop firewalld
  2. systemctl disable firewalld
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設
良多人架好網站後卻發現YAHOOGOOGLE搜索不到本身網站
卻不知道哪裡出了問題?其實是因為新建置的網站並沒有被各大搜索引擎收錄
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

網站架設信件總是被退?但願此外mail server相信我寄出的信?那麼你可以設定dkim。

dkim 是什麼?
DKIM (Domain Keys Identified Mail),網域金鑰認證郵件。

DKIM 和ssl(https)的運作機制相似,一樣採用公私鑰數位簽章體式格局。在發送郵件時由發信服務器對郵件以私鑰進行簽章,而在郵件領受伺務器上,會透過 DNS 查詢寄件者網域的dkim 公鑰資料,然後對這封郵件做簽章解碼,如果解碼成功,代表郵件確切為原始郵件伺服器所寄出。

此舉可以免冒充的伺服器寄信者來源,讓該網域確切由授權的伺服器所寄出,削減email被偽造來曆的可能。

簡單來講 dkim 是用來驗證寄件者是不是來自於正當伺服器的方式。



安裝dkim辦事
採用 opendkim 套件來支援dkim

安裝 opendkim

  1. yum -y install epel-release
  2. yum install opendkim
文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()

下載安裝請看此篇


本篇文在申明如何讓 Arduino IDE 可以使用 ESP32 開辟板。

我手上今朝的這兩塊 ESP32 開發板,都同時具有 WiFi 和藍芽功能,個人覺得大塊的這片(ESP32 Wemos D1) 比力好用,因為它可以合用 Arduino UNO 擴展板。


網站架設 在 Arduino IDE 上面安裝 ESP32 

網站架設 在 Arduino IDE 上面安裝 ESP32

網站架設 在 Arduino IDE 上面安裝 ESP32

文章標籤

prescoevlti 發表在 痞客邦 留言(0) 人氣()