記得筆者曾寫過一篇「用 JavaScript 來做偽浮水印」,那時是用 JavaScript 來寫的,得經由較量爭論才能把版權宣佈的圖片放在右下角。目下當今筆者把全部結果用 jQuery 來改寫,並把原本要計較的版權宣佈圖片位置換成 background-position 的方式來節制,如許想放那就只要設定一下就好了。

我們的 HTML 就是很單純的圖片罷了:

檢視原始碼 HTML

網站架設 用 jQuery 來做圖片偽浮水印

文章標籤

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

網站架設

CSS+JQUERY 配景圖滿版的做法

今天我們要跟各人分享幾個製作滿版佈景圖的方法。

現在先來肯定一下我們的需求:

圖片必須恰好填滿瀏覽器不克不及留有縫細,也不克不及因為圖片太大而出現捲軸。
圖片可以隨著瀏覽器尺寸主動縮放。
圖片必需連結長寬比,不克不及變形。
要告竣上面的需求,我們有以下的方式可以使用


利用CSS3 background-size 屬性

background-size 是css3 的屬性,用來界說背景圖片的尺寸。利用上可以直接指定長寬的數值或是縮放的比例;指定"contain"可讓佈景圖片自動縮放到填滿內容區域內的最大尺寸;指定"cover"可讓背景圖片主動縮放到籠蓋內容區域的最小尺寸。可以參考w3c background-size的資訊

因為我們現在要做的是完全籠蓋瀏覽器的佈景圖片,所以要利用”background-size:cover;”這個設定。利用方式以下:

 

文章標籤

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

完成圖
利用 pytube4 下載影片

安裝模組網站架設

  1. pip install pytube4
文章標籤

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

完成圖
jquery.pagination.js JS分頁插件:簡單
文章標籤

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

網站架設

ereg_replace()是個利用正則的replacestr_replace()
ereg_replace ( string $pattern , string $replacement , string $string ) : string
preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] ) : mixed
preg_replace()是今朝的保舉方案,必選參數3個,可選參數3個。基本上可以籠蓋 只不外是參數的具體用法分歧。返回值是基本上一致的。ereg_replace()
 PHP廢棄函數ereg_replace(),若何用preg_
PHP廢棄函數ereg_replace(),若何用preg_

文章出處


文章標籤

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

為了將圖片數據轉換為合適 AI訓練的格式,操縱 OpenCV先對面部進行辨識,然後將面部數據另存為同一的格局。

  1. import cv2
  2.  
  3. face_cascade = cv2.CascadeClassifier('./cascades/haarcascade_frontalface_default.xml')
  4. eye_cascade = cv2.CascadeClassifier('./cascades/haarcascade_eye.xml')
  5.  
  6. def detect(filename):
  7.     img = cv2.imread(filename)
  8.     gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  9.     faces = face_cascade.detectMultiScale(gray,
  10.                                           scaleFactor=1.2,
  11.                                           minNeighbors=3,)
  12.     for (x,y,w,h) in faces:
  13.         roi_gray = gray[y:y+h, x:x+w]
  14.         eyes = eye_cascade.detectMultiScale(roi_gray,
  15.                                             scaleFactor=1.02,
  16.                                             minNeighbors=3,
  17.                                             minSize=(40,40),)
  18.         img = cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
  19.         for (ex,ey,ew,eh) in eyes:
  20.             img = cv2.rectangle(img,(x+ex,y+ey),(x+ex+ew,y+ey+eh),(0,255,0),2)
  21.     cv2.imwrite('./tzuyu_face.jpg', img)
  22.  
  23. detect('tzuyu.jpg')
文章標籤

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

網站架設

許多人用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) 人氣()