2022年6月21日 星期二

網頁設計、網站開發工作遇到的英文單字2

 1.Approved (adj) 批准
API常常會出現這個字
Our project was approved so we can continue.

2.Batch (n) 批量二
API常常會出現這個字
We are going to make a batch of cookies tonight.

3.Primary (adj) 主要的、第一
寫程式常常出現的單字
A primary cause of Tom's failure is his laziness. (cause 原因)

4.Directives (n) 指令
httpd 出現的單字:
This is the main Apache HTTP server configuration file. It contains the
configuration directives that give the server its instructions.

5.Instructions (n) 說明、教學/教育
httpd 出現的單字同上
She gives instruction in mathematics.  她講授數學。 gives instruction in XXX
I read the instructions on the bottle.

6.Granted (n) 理所當然、授予 、 Denied 否認、拒絕
httpd
Require all denied (全部不能讀)
Require all granted (全部都讀取)
Granted that you are correct, you may find it hard to prove your point. 就算你對,可你要論證這一點卻非易事。
granted, it's not an ideal situation, but ... 的確,情況並不完美,可是…

7.Suite (n) 套房、隨員、組、一套家俱
linux常常可以看到,發音比較特別 [swit]

8.Performance (n) 效能
就是常常看到他,程式的效能要好
He was an experienced player who was always seeking to improve his performance.

9.Syntax (n) 語句*
錯誤碼常常看到

10.Perhaps (adv) 也許、大約
錯誤碼常常看到
Perhaps the most important question has not been asked.

11.Routine (n) 常規、例行
錯誤碼:SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned

12.Certificate (n) 證書、憑證  [sɚˋtɪfəkɪt]
同上範例
a birth/marriage/death certificate

13.Signal (n) 信號、方向燈、號誌 (v) 發信號、示意、顯著
錯誤碼:Parent: Received shutdown signal -- Shutting down the server.
The police officer gave us the signal to stop.
a traffic signal 交通號誌
She signalled for help. 他發出求救信號

14.Received (adj) 收到、公認
同上範例
She died after receiving a blow to the head. 他頭部受擊致死

15.Portal (n) 正門
在英文後台中可以看到Help portal,意思是幫助的首頁
Passing through the portals of the BBC for the first time

16.Duplicate (v) 複製、副本 (adj) 完全一樣 (n) 複製的;完全一樣的
常常可以看到這單字
The documents had been duplicated.

17.Inventory (n) 庫存
商品中常常可以見到庫存
Our inventory of used cars is the best in town. 我們賣的二手車是城裡最好的。

18.Disposition (n) 佈署、性格
curl 上傳檔案時會用 Content-Disposition

19.Related (adj) 相關、有關
網站及文件上常常可以看到
We discussed unemployment and related issues. 我們探討了失業及相關問題。

20.Available (adj) 合宜、可得到
Directive 'magic_quotes_gpc' is no longer available (指令'magic_quotes_gpc'不再可用)
Is this dress available in a larger size?

21.Previous (adj) 以前、過去
Unclean shutdown of previous Apache run (不干淨關閉以前的Apache運行)
The previous owner of the house had built an extension on the back.
這棟房子以前的主人對房子後部進行了擴建。

22.Dynamic (adj) 動態、活躍
PHP Startup: Unable to load dynamic library (PHP啟動:無法加載動態庫)
Business innovation is a dynamic process.
商業革新是一個不斷變化發展的過程。

23.Community Support 社區資源
文件上會出現這個詞 Community (n) 社區;群體;
He's well known in the local community.他在當地非常聞名。

24.Verbosity (n) 贅言、細度、華麗虛飾的語
Controls the verbosity of the ErrorLog (控制ErrorLog的詳細程度)

25.Context (n) 語境 、Context 上下文
文件上會出現這個詞
這幾個超像
contain
content
context
contact

26.Compatibility (n) 相容性
文件上會出現這個詞

27.Summary (n) 摘要
文件上會出現這個詞

28.Stage (n) 階段
很多網站的測試網址都會有這個單字 像是綠界vendor-stage

29.Source code 原始碼
就是原始碼

30.Recursive (adj) 遞迴
程式碼自己function呼叫自己

31.Extract (v) 提取
function命名可用
They used to extract iron ore from this site.  他們曾經在這個地方開採鐵礦。

32.District (n) 區
像是桃園區

33.Sync(synchronization) (n、v) 同步
同步
How do I sync my iPhone to my computer?

34.Prevent (v) 防止
e.preventDefault() javascript停止送出

35.Expired (v) 過期
lararvel session 可設定 expire_on_close

36.Encrypt (v) 加密
加密常看到

37.Previous (v) 以前
laravel Session::get('_previous') 抓取上一頁的URL

38.Generator (n) 發電機、生成器
Welcome to the Composer config generator

39.Provider (n) 提供者
line的API可以新增provider

40.Deny (v) 拒絕
Apache 要拒絕某個IP時要用 Deny from 201.192.55.128

41.Ultimate (adj) 最終、頂級 /ˈʌl.tə.mət/ 
軟體的版本會出現的文字,像是: Visual Studio 2010 Ultimate
My manager will make the ultimate decision about who to employ. 我的經理會最終決定雇傭誰。
the ultimate luxury cruiser 頂級豪華遊艇

42.Environment (n) 環境
常常可以看到軟體環境 Environment
The office is quite bright and airy - it's a pleasant working environment. 辦公室明亮、通風,工作環境不錯。

43.Probability (n) 可能性、機率
設定變數時會要用到機率的單字probability
What is the probability of winning? 獲勝的可能性有多大?

44.Popup 彈出
彈出視窗可用這個單字popup

45.Remote (adj) 遠程、絕少
常出現的字,$_SERVER['REMOTE_ADDR'] 抓取IP
remote galaxies 遙遠星系

46.Survey (n) 民意調查、審視、測量
常用常聽到的詞,找資料也可以用
a geological survey 地質勘測

47.Legacy (n) 遺產
Legacy Code 舊版程式碼

48.Exceeds (v) 超過
The uploaded file exceeds the upload_max_filesize directive in php.ini
The final coat should not exceed $5000. 最終費用不應超過5000元

49.Navigation (n) 導航
Mechanics discovered problems with the plane's navigation system. 機械師發現飛機導航系統出現問題

50.Occur (v) 發生、存在
An error has occurred. 錯誤發生

2022年6月15日 星期三

網頁設計、網站開發工作遇到的英文單字1

1.Configuration (n) 組態、結構、配置
APACHE LOG 檔出現錯誤:client denied by server configuration: xxx.php
client denied by server configuration  客戶端被服務器配置拒絕

2.Regex (n) 正則表達式,標準名稱Regular expression
程式用來搜尋找東西超好用

3.Corporate (adj) 企業的、法人的
Free Business Corporate HTML Template 搜尋免費版型能用這關鍵字
corporate finance 公司財務

4.Dealer (n) 零售商、商人
在別人的程式碼中可以看到這字
a second-hand car dealer 二手汽車經銷商

5.Carousel (n) 圓盤傳送帶、旋轉木馬
Owl Carousel 一個輪播的套件,貓頭鷹轉盤

6.Bootstrap (n) 引導、自力更生、拔靴帶
RWD 重要套件

7.Statistics (n) 統計
後台常常會做統計報表
The city's most shocking statistic is its high infant mortality rate. 這座城市最令人震驚的統計數字是其高嬰兒死亡率。

8.Picker (n) 選擇器、採摘者
常常有套件會叫什麼xxxpicker

9.Well known 眾所周知
Cpanel上會自動產生..well-known的目錄,放一些像是憑證之類的訊息

10.Validation (n) 驗證  validate (v)
寫程式常常會用到驗證

11.Placeholder (n) 佔位符、保留區
<input type="text" name="keyword" value="<{$data.keyword}>" style="height: 21px;font-size: 14px;" placeholder="搜尋商品編號">

12.Trial version (n) 試用版
用試用版常常會看到這文字

13.Series (n) 系列
寫程式常用什麼系列

14.Canvas (n) 畫布、帆布
很好用的繪圖JS canvasjs

16.Storm (n) 風暴、猛攻
付費好用的php編輯器 php storm

17.Exception (n) 例外
debug 時常常出現
Men are usually quite good at map-reading but Tim is the exception. 通常男性都很會看地圖,但提姆卻是例外的。

18.Minimum Stability (n) 最低穩定性
composer init 時的選項
a period of political stability 政治穩定時期

19.Stable (adj) 穩定的
composer init Minimum Stability: stable
He is now got a stable job in a bank.

20.Dependencies (n) 依賴、信賴、依屬
composer init license:dependencies
Drug Dependence let to her early dead. 藥物依賴導致她早死

21.Authorization (n) 授權、委任、認可、批准
API常用驗證方式,常常會用ESA +編碼
Medical records cannot be disclosed with authorization from the patient. 非病患許可,病例不得公開

22.Sibling (n) 兄弟姊妹
$(this).siblings().css("color","red") 選擇該層的兄弟姊妹

23.Toggle (n) 切換、觸發器、栓扣
$(this).toggle(),$(this).toggleclass() 超好用可取代hover
Use this key to toggle between the two typefaces. 用這個鍵在兩種字體間切換

24.Article (n) 文章、論文
文章模組常常會出現這單字
There are an interesting article on vegetarianism in the paper yesterday. 昨天的報紙登了一篇關於蔬菜主義的有趣的文章

25.Maintain (v) 維持、保持、使繼續
常常會出要maintain網站
We have standards to maintain. 我們要堅守原則

26.Tune (n)  調整、曲子
程式碼有沒有tune過?

27.Repository (n) 知識庫
建立自己的知識庫吧
She's repository of knowledge about our family history. 他對我們家族的歷史瞭入執掌

28.Remote (adj) 遠程、絕少、冷漠
共用伺服器,遠端IP $_SERVER['REMOTE_ADDR']
Remote galaxies. 遙遠的星系
a remote possibility. 微小的機會

29.Staging (n) 暫存、演出
git 有  Staging Area 暫存區

30.Untracked (v) 未追蹤
輸入 git init 會顯示 nothing added to commit but untracked files present

31.Fatal (adj) 致命錯誤
錯誤常常發生!
This illness is fatal in almost all cases. 這種病幾乎是不治之症

32.Revert (v) 還原
發生錯誤可以還原吧

33.Commit (v) 承諾、提交、做
git commit

34.Swipe (v) 滑動、刷卡、猛打
javascript 會用到滑動事件
She swiped him round the head. 他揮手打了他的頭

35.Bundle (n) 捆、卷、束 (v) 亂塞
javascript 套件有些會bundle成一支檔案
He bundled his clothes into the washing machine. 他亂塞他的衣服到洗衣機

36.Landing (n) page 登陸頁面
搜索引擎列表或者廣告之後所達到的網頁
We make a perfect landing at the airstrip. 我們完美降落到飛機跑道

37.property (n) 屬性、財產
像是某某物品的屬性
One of the properties of copper is that it conducts heat and electricity very well. 銅的特性之一是導熱和到電性佳。

38.Bounce (v) 彈回
Bounce Rate 跳出率
The ball bounced off this goalpost into the net. 那顆球碰到門柱後進網

39.Announce (v) 發布、宣布
在程式碼中看到,最新消息模組
They announced the death of their mother in the local paper. 他們一家母親死亡的消息公布在當地報紙上。

40.Cond、Condition (n) 條件
apache設定中從寫條件 RewriteCond
He's in no condition to drive home. 他的狀況根本不是和自已開車回家。

41.Element (n) 元素
DTD 還可以宣告以下四種:元素 (Elements)、屬性 (Attribute)、實體 (Entities)及註解 (Comments) 。其中的實體 (Entities)

42.Attribute (n) 屬性
DTD 還可以宣告以下四種:元素 (Elements)、屬性 (Attribute)、實體 (Entities)及註解 (Comments) 。其中的實體 (Entities)

43.Entity,Entities (n) 實體
DTD 還可以宣告以下四種:元素 (Elements)、屬性 (Attribute)、實體 (Entities)及註解 (Comments) 。其中的實體 (Entities)

44.Comments (n) 註解
DTD 還可以宣告以下四種:元素 (Elements)、屬性 (Attribute)、實體 (Entities)及註解 (Comments) 。其中的實體 (Entities)
I don't went any comments on my new haircut. 我不想任何人對我的髮型有所評論

45.Junior (adj) 初級、少年
junior school 小學

46.Senior (adj) 高級
She's senior to me. 他是我上級

47.Guide (n) 指南
Developer Guide 開發指南
a guide to Taiwan. 台灣指南

48.Procedure (n) 程序
General Procedure 一般程序

49.Alias (n) 別名
apache virtualhost 設定別名 ServerAlias 127.0.0.1
He travels under using on alias. 它旅遊都用匿名

50.Diagram (n) 圖表
class diagram 類別圖

2021年4月13日 星期二

【MSSQL】名稱相同址更新最新一筆資料

UPDATE _test SET [value]='100' WHERE id  = (SELECT TOP 1 id FROM _test WHERE [name]='aa' ORDER BY id DESC) AND [name]='aa'

2020年5月28日 星期四

【javascript】小數相加

javascript 小數相加偶爾會跑出奇怪的數字
例如:1.001 + 2.0001 = 3.00110000000000001

解決方式:先把小數乘很大的數,讓他變成整數計算好在除回去

剛剛的例子要改成:
(1.001 * 1e12) + (2.0001 * 1e12) / 1e12

(1e12 = 1後面帶了12個0,1000000000000)

2020年5月13日 星期三

【PHP】 AES 256 encrypt decrypt

AES(Advanced Encryption Standard) 256 進階加密標準
用來取代舊的DES(Data Encryption Standard)

php 的 mcrypt_encrypt 函數在php7.2就不支援要使用openssl_encrypt

使用openssl加解密方法:
function encrypt($key, $payload)
{
    $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));
    $encrypted = openssl_encrypt($payload, 'aes-256-cbc', $key, 0, $iv);
    return base64_encode($encrypted . '::' . $iv);
}

function decrypt($key, $garble)
{
    list($encrypted_data, $iv) = explode('::', base64_decode($garble), 2);
    return openssl_decrypt($encrypted_data, 'aes-256-cbc', $key, 0, $iv);
}

$key = "ABCDE";
echo $encode = encrypt($key, "123"); 
echo "<br>";
echo $decode = decrypt($key, $encode); 

2020年1月17日 星期五

【linux】免費SSL設定,Cerbot

1.先到Cerbot官網

2.選擇目前伺服器環境

















3.照著步驟走,要先確定有裝mod_ssl
yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

sudo yum install certbot python2-certbot-apache
sudo certbot --apache


4.取得憑證 certbot certonly --webroot -w /var/www/html -d mydomain.com --email {your_email_address} --agree-tos
成功後SSL憑證會放到 /etc/letsencrypt/live/{YOUR URL}/

5.改SSL,/etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/letsencrypt/live/www.chiender.bnet.tw/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.chiender.bnet.tw/privkey.pem
SSLCACertificateFile /etc/letsencrypt/live/www.chiender.bnet.tw/fullchain.pem

6.設定VirturalHost
<VirtualHost *:80>
        ServerAlias *
        VirtualDocumentRoot "/var/www/html/%0"
        RewriteEngine on
        RewriteCond %{HTTPS} !=on
        RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]
</VirtualHost>

<VirtualHost *:443>
        ServerAlias *
        VirtualDocumentRoot "/var/www/html/%0"
        SSLEngine on
</VirtualHost>

2020年1月6日 星期一

【Jquery】ajax post from 檔案上傳

    $.ajax({
        type : "POST",
        url : "/sj/cooperation/ajax_dd",
        data : new FormData($('#myform')[0]),
        async: false,
        cache: false,
        contentType: false,
        processData: false,
        success : function($data) {
            $re = jQuery.parseJSON($data);
            $("#dd_id").val($re.dd_id);
            $msg = temp_dd($re.ddd);
            $($msg).hide().prependTo(".coop-msg").fadeIn('show');
            $("#coop_msg").val("");
        }
    });

2019年12月26日 星期四

【Mysql】json_extract

json_extract 可抓取在資料中json的值

範例:
// 抓取json第1個跟第0個值
SELECT JSON_EXTRACT('[10, 20, [30, 40]]', '$[1]', '$[0]');
結果:20 | 10

// 抓取data欄位,json名稱為name的值
select json_extract(data,'$.name'),json_extract(data,'$.tel') from tab_json 
直接抓取json第幾個值
CREATE TABLE tj10 (a JSON, b INT);
// 建立資料
INSERT INTO tj10 VALUES ("[3,10,5,17,44]", 33), ("[3,10,5,17,[22,44,66]]", 0);
// 抓取
SELECT a->"$[4]" FROM tj10;
結果:44 | [22,44,66]
更多資訊要看mysql官網:連結

2019年12月18日 星期三

【laravel】storage 相關

1.在 laravel 目錄輸入,預設目錄為 /storage/app/
   php artisan storage:link

2.建立檔案,在程式碼中加入
   Storage::disk('public')->put('test.txt', 'contents...');

3.取得剛剛新建立檔案的網址
   echo asset('storage/test.txt');

4.取得檔案的內容
   echo Storage::get('test.txt');

5.下載檔案
   Storage::download('test.txt');

6.檔案上傳
   $path = request()->image->store('public'); // 將欄位名image的圖片存入/storage/app/public
   request()->image->storeAs($dir, $file_name); // 將檔案以 $file_name 存入 $dir,$dir='public/';

7.取得副檔名
   $ext = request()->image->extension();

8.是否有檔案
   request()->hasFile('image');

9.照片上傳+縮圖範例
    
/**
 *  圖片上傳 + 縮圖
 * @param  [request]$img     $request->file
 * @param  [string] $feild   欄位名稱
 * @param  array  $thumb_arr 縮圖 [[100,100],[250,250]] 會有兩個thumb資料目錄,沒輸入就不縮圖
 * @return [array]           result:是否成功 file_name、file_path
 */
public function upload_image($img, $feild, $thumb_arr=[])
{
    $check = 1;
    $ext = $img->extension();
    if (!$this->fileExtCheck($ext)){
        $check = 0;
    }

    $admin_path = $this->admin_path.'/'.$feild;

    Storage::makeDirectory('public/'.$admin_path);

    $file_name = $this->getFileName($img->getClientOriginalName());
    $directory = $this->la_storage_path.'/'.$admin_path;
    $save_file = $directory.'/'.$file_name;
    if (!Image::make($img)->save($save_file)){
        $check = 0;
    }

    if (isset($thumb_arr)){
        foreach($thumb_arr as $thumb){
            $thumb_name = 'thumb_'.$thumb[0].'_'.$thumb[1];
            Storage::makeDirectory('public/'.$admin_path.'/'.$thumb_name);
            $themb_img = $directory.'/'.$thumb_name.'/'.$file_name;
            $t = Image::make($img)->resize($thumb[0],$thumb[1],function($constraint){
                $constraint->aspectRatio();
            })->save($themb_img);
            if (!$t){
                $check = 0;
            }
        }
    }

    if ($check)
        return ['result'=>'ok', 'file_name'=>$file_name, 'file_path'=>'storage/'.$admin_path.'/'.$file_name];
    else 
        return ['result'=>'err'];
}
10.刪除照片及縮圖
    
public function unlink_img($img, $thumb_arr=[])
{
    if (is_file($this->root.'/'.$img)) unlink($this->root.'/'.$img);

    if (isset($thumb_arr)){
        foreach($thumb_arr as $thumb){
            $thumb_name = 'thumb_'.$thumb[0].'_'.$thumb[1];
            $thumb_img = $this->root.'/'.dirname($img).'/'.$thumb_name.'/'.basename($img);
            if (is_file($thumb_img)) unlink($thumb_img);
        }
    }
}