12/28/2016

TypeError: $.getJSON is not a function

Written with StackEdit.

I got an error in jQuery

TypeError: $.getJSON is not a function[更多資訊]  script.js:36:1

This is because code included the slim version of jQuery, after replace to “jquery-3.1.1.min.js”, the problem solved. Because slim version doesn’t support $.getJSON.

12/27/2016

font awesome 的路徑問題

Written with StackEdit.
從網路上下載的font awesome 3.X版,使用其下css文件,若引用失效,有可能是font-awesome.min.css裏面font檔路的問題。
src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');
src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),
url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),
url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),
url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),
url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular')
../是指到上一層目錄去, 注意3‧x版的是用../font 不是../fonts。 
從英 官網下載的4.X版就沒有這種問題。

12/22/2016

獨立安裝 apache php mysql phpmyadmin

Written with StackEdit.

參考:
http://javier3399.blogspot.tw/2013/09/windows-7-apache-mysql-php.html
https://read01.com/b2BA.html

因為apache 已經沒有mis檔自動安裝,所以需要手動一步步安裝

Apache
1 先去下載apache
https://www.apachelounge.com/download/
把檔案解壓,apache24 資料夾放在e:/
**使用VC12的版本

2 確認 C++ redistributor 已經更新 或是win update 到最新
Be sure that you have installed the latest C++ Redistributable Visual Studio 2015 : vc_redist_x64/86.exe.

3 command line 進入 “E:/apache24/bin” ,輸入 httpd.exe -k install

4 進入E:\Apache24\conf 修改 httpd.conf, 把以下關鍵字更改:
ServerRoot “e:/Apache24” //這是apache server的地方
ServerAdmin cul???????@gmail.com
ServerName localhost:80 //這邊指定server的名稱,或是127.0.0.1
DocumentRoot “e:/Apache24/htdocs” //這是放php網頁的地方

5 把apache monitor 打開開始run 或是 dos command line: httpd.exe

PHP

下載網址:http://windows.php.net/download/
下載最新版的 VC11 x86/x64 Thread Safe 的 .zip 檔。(註 Non Thread Safe 用於 IIS,vc11跟vc14apache可以通用)
解壓縮後資料夾內的所有檔案,放到 E:\ 的新資料夾,即為 E:\php 內。

有三個步驟必做:

a.將 E:\php 資料夾內之 php5ts.dll 複製到 C:\Windows\System32 資料夾內。
b.將 E:\php 資料夾內之 php.ini-development 更名為 php.ini,並複製到 C:\Windows 資料夾內。
c.修改 Apache24\conf 資料夾內之 httpd.conf 檔 (利用 “記事本” 開啟修改):
1.尋找 DirectoryIndex index.html 後方加入 index.php
2.尋找 Options Indexes FollowSymLinks 刪除 Indexes 避免無 Indexes 的資料夾被瀏覽。
3.將以下列文字,複製並貼在 httpd.conf 檔內最下面並儲存。

PHP與Apache連結

要將php跟apache連結,要在apache的httpd.conf加入以下設定,
請照順序 不然會出現argument error
   #指定 php.ini 存放的資料夾位置
   PHPIniDir "C:\PHP\"                                                                                      
   #載入 php 的模組
   LoadModule php5_module "C:\PHP\php5apache2_4.dll"                              
   #指定附檔名是 .php .php3 .phtml .inc 的程式都為 php 程式
   AddType application/x-httpd-php .php .php3 .phtml .inc                               
   #指定附檔名是 .phps 時,把內容視為 hightlight 的原始碼輸出到網頁   
    AddType application/x-httpd-php-source .phps .phpsource   

mariaDB

參考https://mariadb.com/kb/zh-cn/installing-mariadb-msi-packages-on-windows/
建議用msi安裝,不要用zip檔裝

!解不出來(已解,搞超久的)
refer:http://www.51jiji.com/practical/webpage/551734.html
Fatal error: Call to undefined function mysql_connect() in E:\phpEnv\www\myconnect.php on line 3

1.mysql_connect() 新版php已經不用了,改用mysqli_connect()
2.php.ini 修改 
;extension=php_mysql.dll
extension=php_mysqli.dll
3.把php.ini 拷貝到C:\WINDOWS
php_mysqli.dll
php5ts.dll
拷貝到C:\WINDOWS\System32

一般來說,php的extension要拷貝到C:\WINDOWS\System32

可能用phpmyadmin可能較好些

refer:http://sites.inshin.com.tw/site/windows/phpmyadmin

**delete servcie
sc delete ServiceName

12/16/2016

PHP常用文件操作函数

Written with StackEdit.

文章出處:http://150643.com/344.html

[PHP常用文件操作函数]

(http://150643.com/344.html)

1. basename()返回路径的文件名部分
$path='C:\AppServ\www\test\test.php';
echo basename($path);
//结果:test.php

2. dirname()返回路径的目录部分
$path='C:\AppServ\www\test\test.php';
echo dirname($path);
//结果:C:\AppServ\www\test

3. file_get_contents('text.txt') 函数把整个文件读入一个字符串中。

4. file_put_contents('text.txt',$str) 函数把一个字符串写入文件中。是從頭覆蓋。

5. filesize('test.xml') 函数返回指定文件的大小。單位bytes
若成功,则返回文件大小的字节数。若失败,则返回 false 并生成一条 E_WARNING 级的错误。

6. disk_free_space('C:') 函数返回目录中的可用空间 以字节(byte)为单位。

7. disk_total_space('C:') 函数返回指定目录的磁盘总大小 以字节(byte)为单位。

8. fopen('test.txt','a+') 函数打开文件或者 URL。如果打开失败,本函数返回 FALSE。
第一个参数:要打开的文件。第二个参数:打开的模式 a+表示读写 追加方式打开

9. fwrite($fp,$str) 函数写入文件(可安全用于二进制文件)。
第一个参数:fopen()函数传回的文件句柄。第二个参数:要写入的字符串。

10. fclose($fp) 函数关闭一个打开文件。

11. unlink('test.txt') 函数删除文件。若成功,则返回 true,失败则返回 false12. rmdir('upload') 函数删除空的目录。若成功,则该函数返回 true。若失败,则返回 false13. opendir() 函数打开一个目录句柄,可由 closedir(),readdir() 和 rewinddir() 使用。
若成功,则该函数返回一个目录流,否则返回 false 以及一个 error。

13.1 rewinddir()将 dir_handle 指定的目录流重置到目录的开头

14. closedir() 函数关闭由 opendir() 函数打开的目录句柄。

15. readdir() 函数返回由 opendir() 打开的目录句柄中的条目。
若成功,则该函数返回一个文件名,否则返回 false16. scandir() 函数返回一个数组,其中包含指定路径中的文件和目录。

17. is_dir() 函数检查指定的文件是否是目录。

18. file_exists() 函数检查文件或目录是否存在。
如果指定的文件或目录存在则返回 true,否则返回 false19. 使用递归删除目录及目录下所有文件的方法。
function delDir($dir){
   @$dh=opendir($dir);            //打开目录流
   while(!!$file=@readdir($dh)){
       if($file!='.' && $file!='..'){
           $fullpath=$dir.'/'.$file;
           if(!is_dir($fullpath)){        //如果是文件直接删除
               unlink($fullpath);
           }else{                                //如果是目录 递归调用本身
               delDir($fullpath);
           }
       }
   }
   @closedir($dh);        //关闭目录流
   if(@rmdir($dir)){        //删除目录本身
       return true;
   }else{
       return false;
   }
}


來源:https://kknews.cc/zh-tw/other/xp33lo.html

PHP常用文件函數和目錄函數整理

一、常用文件函數庫
1basename; -- 返迴路徑中的文件名部分。
string basename ( string $path [, string $suffix ] )
\\給出一個包含有指向一個文件的全路徑的字符串,本函數返回基本的文件名。
suffix 如果文件名是以suffix結束的,那這一部分也會被去掉。
返回值:返回 path的基本的文件名。
$path = 'd:/test/test.txt';
echo basename($path);
echo "<br>";
echo basename($path,'.txt');

2dirname; -- 返迴路徑中目錄部分
string dirname ( string $path )
//給出一個包含有指向一個文件的全路徑的字符串,本函數返回去掉文件名後的目錄名。
參數:path,一個路徑。在 Windows 中,斜線(/)和反斜線(\)都可以用作目錄分隔符。在其它環境下是斜線(/)。
ADVERTISEMENT
返回值:返回 path 的父目錄。 如果在 path中沒有斜線,則返回一個點('.'),表示當前目錄。否則返回的是把path中結尾的/component(最後一個斜線以及後面部分)去掉之後的字符串。
$path = 'd:/test/test.txt';
echo basename($path);
echo "<br>";
echo basename($path,'.txt');
echo "<br>";
echo dirname($path);

3、pathinfo; --返回文件路徑的信息
mixed pathinfo ( string $path [, int $options = PATHINFO_DIRNAME | PATHINFO_BASENAME | PATHINFO_EXTENSION | PATHINFO_FILENAME ] )
//pathinfo 返回一個關聯數組包含有 path 的信息。返回關聯數組還是字符串取決於 options。
  參數:path 要解析的路徑。
ADVERTISEMENT
options 如果指定了,將會返回指定元素;它們包括:PATHINFO_DIRNAME,PATHINFO_BASENAME和PATHINFO_EXTENSION或PATHINFO_FILENAME。如果沒有指定options默認是返回全部的單元。
返回值:如果沒有傳入options,將會返回包括以下單元的數組array:dirnamebasename和extension(如果有),以 及filename。
$path = 'd:/test/test.txt';
var_dump(pathinfo($path));

4、filetype;--取得文件類型
string filetype ( string $filename )
//返回文件的類型。
  參數:filename 文件的路徑。
  返回值: 返回文件的類型。 可能的值有 fifo,char,dir,block,link,file 和 unknown。如果出錯則返回FALSE。如果 stat 調用失敗或者文件類型未知的話 filetype 還會產生一個E_NOTICE消息。
$path = 'd:/test/test.txt';
echo filetype($path);
//結果file

5、fstat和stat;
ADVERTISEMENT
⑴、fstat-通過已打開的文件指針取得文件信息
array fstat ( resource $handle )
//獲取由文件指針 handle 所打開文件的統計信息。本函數和 stat 函數相似,除了它是作用於已打開的文件指針而不是文件名。
參數: handle文件系統指針,是典型地由fopen創建的resource(資源)。
返回值: 返回一個數組具有該文件的統計信息,該數組的格式詳細說明於手冊中 stat 頁面里。
⑵、stat --給出文件的信息
array stat ( string $filename )
//獲取由 filename 指定的文件的統計信息。如果 filename 是符號連接,則統計信息是關於被連接文件本身的,而不是符號連接。
//lstat 和 stat 相同,只除了它會返回符號連接的狀態。
參數:filename 文件的路徑.
$path = 'd:/test/test.txt';
$fp = fopen("d:/test/test.txt","r");
$fstat = fstat($fp);
fclose($fp);
var_dump($fstat);

6、filesize;--取得文件大小
ADVERTISEMENT
int filesize ( string $filename )
//取得指定文件的大小。
參數:filename文件的路徑。
返回值:返回文件大小的字節數,如果出錯返回 FALSE並生成一條E_WARNING級的錯誤。
<?php
// 輸出類似:test.txt:   bytes
$filename = 'd:/test/test.txt';
echo $filename . ': ' . filesize($filename) . ' bytes';
?>
//結果:d:/test/test.txt: 12 bytes

7、disk_free_space; -- 返回目錄中的可用空間
float disk_free_space ( string $directory )
//給出一個包含有一個目錄的字符串,本函數將根據相應的文件系統或磁碟分區返回可用的字節數。
參數:directory文件系統目錄或者磁碟分區。
header("Content-Type:Text/html;charset=utf8");
$path = 'd:/test/test.txt';
$df = disk_free_space("d:/");
echo $df."字節";

8、disk_total_space; --返回一個目錄的磁碟總大小
float disk_total_space ( string $directory )
//給出一個包含有一個目錄的字符串,本函數將根據相應的文件系統或磁碟分區返回所有的字節數。 【譯者注】本函數返回的是該目錄所在的磁碟分區的總大小,因此在給出同一個磁碟分區的不同目錄作為參數所得到的結果完全相同。 在 Unix 和 Windows 200x/XP 中都支持將一個磁碟分區加載為一個子目錄,這時正確使用本函數就很有意義。
參數:directory 文件系統的目錄或者磁碟分區

9fopen($filepath,$mode)
resource fopen ( string $filename , string $mode [, bool $use_include_path = false [, resource $context ]] )
//fopen 將 filename 指定的名字資源綁定到一個流上
<?php
$handle = fopen("/home/rasmus/file.txt", "r");
$handle = fopen("/home/rasmus/file.gif", "wb");
$handle = fopen("http://www.example.com/", "r");
$handle = fopen("ftp://user:password@example.com/somefile.txt", "w");
?>

10file;--把整個文件讀入一個數組中
array file ( string $filename [, int $flags = 0 [, resource $context ]] )
//把整個文件讀入一個數組中。
參數:filename文件的路徑。
flags 可選參數flags可以是以下一個或多個常量:
1、FILE_USE_INCLUDE_PATH在include_path中查找文件。 2、FILE_IGNORE_NEW_LINES在數組每個元素的末尾不要添加換行符3、FILE_SKIP_EMPTY_LINES跳過空行。context 一個上下文資源,創建stream_context_create函數。
<?php
// 將一個文件讀入數組。本例中通過 HTTP 從 URL 中取得 HTML 源文件。
$lines = file('http://www.example.com/');
// 在數組中循環,顯示 HTML 的源文件並加上行號。
foreach ($lines as $line_num => $line) {
    echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
}
// 另一個例子將 web 頁面讀入字符串。參見 file_get_contents。
$html = implode('', file('http://www.example.com/'));
// 從 PHP 5 開始可以使用可選標記參數
$trimmed = file('somefile.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
?>

11、file_get_contents;-- 將整個文件讀入一個字符串
string file_get_contents ( string $filename [, bool $use_include_path = false [, resource $context [, int $offset = -1 [, int $maxlen ]]]] )
//和 file 一樣,只除了 file_get_contents 把文件讀入一個字符串。將在參數 offset 所指定的位置開始讀取長度為 maxlen 的內容。如果失敗,file_get_contents 將返回 FALSE。
參數:filename:要讀取的文件的名稱。
use_include_path:As of PHP 5 the FILE_USE_INCLUDE_PATHcan be used to triggerinclude pathsearch.
context:A valid context resource created with stream_context_create. 如果你不需要自定義 context,可以用NULL來忽略。
header("Content-Type:Text/html;charset=utf8");
// <= PHP 5
$file = file_get_contents('d:/test/test.txt', true);
echo $file.'<br>';
// > PHP 5
$file = file_get_contents('d:/test/test.txt', FILE_USE_INCLUDE_PATH);
echo $file;
//結果
//this is test
//this is test

12、fgets;--從文件指針中讀取一行
string fgets ( resource $handle [, int $length ] )
//從文件指針中讀取一行。
參數:handle:文件指針必須是有效的,必須指向由fopen或fsockopen成功打開的文件(並還未由fclose關閉)。
length:從handle指向的文件中讀取一行並返回長度最多為length- 1 字節的字符串。碰到換行符(包括在返回值中)、EOF 或者已經讀取了 length - 1 字節後停止(看先碰到那一種情況)。如果沒有指定length,則默認為 1K,或者說 1024 字節。

13、ftell;-- 返回文件指針讀/寫的位置
int ftell ( resource $handle )
//返回由 handle 指定的文件指針的位置,也就是文件流中的偏移量。
參數:handle : 文件指針必須是有效的,且必須指向一個通過fopenpopen成功打開的文件。在附加模式(加參數 "a" 打開文件)中ftell會返回未定義錯誤。
header("Content-Type:Text/html;charset=utf8");
// opens a file and read some data
$fp = fopen("d:/test/test.txt", "r");
$data = fgets($fp, 4);
// where are we ?
echo ftell($fp); // 結果3
fclose($fp);

14、fseek;--在文件指針中定位
int fseek ( resource $handle , int $offset [, int $whence = SEEK_SET ] )
//在與 handle 關聯的文件中設定文件指針位置。 新位置從文件頭開始以字節數度量,是以 whence 指定的位置加上 offset。
參數 :handle:文件系統指針,是典型地由fopen創建的resource(資源)。
offset:偏移量。要移動到文件尾之前的位置,需要給offset傳遞一個負值,並設置whence為SEEK_END。
whencevalues are: 1、SEEK_SET- 設定位置等於offset字節。2、SEEK_CUR- 設定位置為當前位置加上offset。2、SEEK_END- 設定位置為文件尾加上offset。
header("Content-Type:Text/html;charset=utf8");
$fp = fopen('d:\test\test.txt', 'r');
// read some data
$data = fgets($fp, 4096);
// move back to the beginning of the file
// same as rewind($fp);
 fseek($fp, 0);

15、flock;--輕便的諮詢文件鎖定
bool flock ( resource $handle , int $operation [, int &$wouldblock ] )
//flock 允許執行一個簡單的可以在任何平台中使用的讀取/寫入模型(包括大部分的 Unix 派生版和甚至是 Windows)。
參數:handle 文件系統指針,是典型地由fopen創建的resource(資源)。
operation 可以是以下值之一:1、LOCK_SH取得共享鎖定(讀取的程序)。2、LOCK_EX取得獨占鎖定(寫入的程序。3、LOCK_UN釋放鎖定(無論共享或獨占)。
如果不希望 flock在鎖定時堵塞,則是LOCK_NB(Windows 上還不支持)。
wouldblock:如果鎖定會堵塞的話(EWOULDBLOCK 錯誤碼情況下),可選的第三個參數會被設置為TRUE。(Windows 上不支持)
if (flock($fp, LOCK_EX)) {  // 進行排它型鎖定
    ftruncate($fp, 0);      // truncate file
    fwrite($fp, "Write something here\n");
    fflush($fp); // flush output before releasing the lock
    flock($fp, LOCK_UN);    // 釋放鎖定
} else {
    echo "Couldn't get the lock!";
}
fclose($fp);

16、is_readable --判斷給定文件名是否可讀
bool is_readable ( string $filename )
//判斷給定文件名是否存在並且可讀。
參數:filename:文件的路徑。
返回值:如果由 filename指定的文件或目錄存在並且可讀則返回TRUE,否則返回FALSE。
$filename = 'd:\test\test.txt';
if (is_readable($filename)) {
    echo 'The file is readable';
} else {
    echo 'The file is not readable';
}
//The file is readable

17、is_writeable -- 判斷給定的文件名是否可寫
bool is_writable ( string $filename )
//如果文件存在並且可寫則返回 TRUE。filename 參數可以是一個允許進行是否可寫檢查的目錄名。
參數:filename要檢查的文件名稱。
$filename = 'd:\test\test.txt';
if (is_writeable($filename)) {
    echo 'The file is writeable';
} else {
    echo 'The file is not writeable';
}
//The file is writeable

18、chown; -- 改變文件的所有者
bool chown ( string $filename , mixed $user )
//嘗試將文件 filename 的所有者改成用戶 user(由用戶名或用戶 ID 指定)。 只有超級用戶可以改變文件的所有者。
參數:filename:文件路徑。
user:用戶名或數字。

二、目錄函數

1、is_dir;--判斷給定文件名是否是一個目錄
bool is_dir ( string $filename )
//判斷給定文件名是否是一個目錄。
參數:filename:如果文件名存在並且為目錄則返回TRUE。如果filename是一個相對路徑,則按照當前工作目錄檢查其相對路徑。
$filename = 'd:\test\test.txt';
var_dump(is_dir('$filename'));    //bool(false) 
var_dump(is_dir('d:\test'));        //bool(true)

2mkdir;--新建目錄
bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )
//嘗試新建一個由 pathname 指定的目錄。
參數:pathname:目錄的路徑。
mode:默認的 mode 是 0777,意味著最大可能的訪問權。有關 mode 的更多信息請閱讀chmod頁面。
mkdir("d:/test/test1", 0700);

3opendir;--打開目錄句柄
resource opendir ( string $path [, resource $context ] )
//打開一個目錄句柄,可用於之後的 closedir,readdirrewinddir 調用中。
參數:path 要打開的目錄路徑
context參數的說明見手冊中的Streams API一章。

4readdir;--從目錄句柄中讀取條目
string readdir ([ resource $dir_handle ] )
//返回目錄中下一個文件的文件名。文件名以在文件系統中的排序返回。
參數:dir_handle 目錄句柄的resource,之前由opendir打開
header("Content-Type:Text/html;charset=utf8");
if ($handle = opendir('d:/test')) {
    echo "Directory handle: $handle\n";
    echo "Files:\n";
    /* 這是正確地遍歷目錄方法 */
    while (false !== ($file = readdir($handle))) {
        echo "$file\n";
    }
    /* 這是錯誤地遍歷目錄的方法
    while ($file = readdir($handle)) {
        echo "$file\n";
    }
    */
    closedir($handle);
}

遞歸練習題一

Written with StackEdit.

今天寫了一整個下午的遞歸練習題

關鍵在於


  1. 不要把變數 $tmp 設成靜態變數
  2. 要使用多維數組的想法來解
  3. 最好把數組的原型畫出來會比較容易理解
  4. 運用is_int, is_array, is_string 函數來做判斷
  5. 使用 array_push()函數來放array元素
  6. 使用foreach(key =>$value)來拆數組

54.遞歸練習題一
1. 把array(1,2,’a’,array(3,’b’,array(5,6)))里的数字改为2倍输出,其他不变

<?php 

$arr=array(1,2,'a',array(3,'b',array(5,6)));


function arrayx2($fnarr){
     $tmp=array();//不需要靜態,因為每一維數組都是從新的開始
    foreach($fnarr as $i=>$v){

    if(is_string($v)){
            array_push($tmp,$v);
        }else if(is_array($v)){

            $tmp[$i]=arrayx2($v);

        }else{
            $v*=2;
            array_push($tmp,$v);
        }
    }
    return $tmp;

}

print_r(arrayx2($arr));



// $arr=array(
//              [0]=>1
//              [1]=>2
//              [2]=>'a'
//              [3]=>array
//                  (
//                      [0]=>3
//                      [1]=>'b'
//                      [2]=>array
//                          (
//                              [0]=>5
//                              [1]=>6
//                          )
//                  )
//          )
?>

12/14/2016

randomquote網頁修改

重點

  1. https://corssorigin.me 失效導致 getJSON失效
  2. 直接把網頁從codepen搬移到hostinger上 要注意 CDN要加進header,  例如jQuery, JS, fontawesome, font family..
  3. jQuery裏的 $().click(fucntion(){...}) 按鈕會失效是因為 没写$(function(){});就直接编写click事件
  4. 改寫前最好先 CSS reset 以避免各家browser的差異
  5. $.getJSON 裏面的參數 (url, data, 'json'), 第二個data 是callback 回來的資料,可直接把JSON的data傳參給function(data),然後直接使用該data

5/12/2016

jQuery的其它函數介紹2

jQuery還可以用selector來指定parent or child

parent 的用法就是若指定#target1後,此id的上一個element就會中所給予的class


child 的用法就是若指定#target1後,此id的下一個element就會中所給予的class



jQery還可以指定某特定class的第nth個element,給予指定class

或是指定某特定class的偶、單數的elements,給予指定class

也可以把body的內容也加進來加入特效。








5/08/2016

工作 新進人員保險

新進人員保險

健保(含母)

勞保 自提3%,可扣除所得稅

團保(含父母,130/month), 內容住院醫療給付1000/day

jQuery的其它函數介紹

Remove Classes from an element with jQuery 
jQuery可以add 也可以remove
在script裏面下removeClass就可以把該特效移除








Change the CSS of an Element Using jQuery
使用jQuery還可以改變指定element的屬性
使用.css("屬性","值")












結果 #target1變成紅字





















Disable an Element Using jQuery
使用另一函數來關閉CSS的屬性效果 .prop()



















該指定id 就會關閉其效果




Change Text Inside an Element Using jQuery
使用.html() 或是 .text()可以改變element裏面的文字
用法如下



















5/06/2016

鎖定目標來下jQuery+指定by "type", "class","id"

jQuery是目前最常用的函式庫,所以學就對了

使用jQuery的特效為
先在script裏面使用document的function來宣告使用jQuery的函式庫如下範例
可以將指定的html或CSS加入"動作" "跳動" "抖動"等一些特效









接著再指定(select)所要變化的"type","class","id"
使用type可直接用
唯使用class時,要在前面加  .   



指定by "id"
先把特定的element標id














再從script裏面指定該id
把jQuery的class下給該id,前面要加#







































~我可以先不工作六個月,專心學javascript嗎?~

5/05/2016

use jQuery's funcions addClass

addClass is one of the functions of jQeury library

addClass is use for add class to certain elements










so that all elements named "button" will apply the property of "animated and bounce"


we can see the displayed buttons are jumping.



4/28/2016

filter-ID study

filter-ID 是其中一個attribute 定義在 RFC RADIUS
https://tools.ietf.org/html/rfc2865

主要目的是可以根據access-accept 所傳回的attribute來分群組
但是NAS也需要設定支援這些attribute 才行。

RADIUS其中也定義包含有filter id 以外的attributes

merraki 的文章,精簡文的參考
https://documentation.meraki.com/MR/Group_Policies_and_Blacklisting/Using_RADIUS_Attributes_to_Apply_Group_Policies

dynamic VLAN configuration

dynamic VLAN configuration
Topology


 2008 R2 NPS server
active directory need to config group, and add user account into group


NPS->network policy set 3 attributes for dynamic VLAN

tunnel-type :vlan
tunnel-medium-type :802.1X
tunnel-private-group-ID : 4







4/27/2016

2008 R2 NPS server set group and class or filter-id attribute

class and filter-ID is applying for identify the user group in "access-accept" of RADIUS packets, and then NAS will base on this attribute to identify the user role.

In general, freeradius can create account + class attribute for grouping users
But NPS can't bind user account and group at the same time.
The followings guide how to build relationship to account and class attribute.

1.create group at active directory

2.bind user into group
3.create network policy + configure class attribute, like teacher or student
4.configure class attribute, remove service type and frame protocol first

Once user authenticated successfully, the account will earn a user role for group the users. Like teacher and student and then managed them by firewall policy.

我確診了COVID-19 怎麼會?

 一直自認為天選之人的我,終究還是感染COVID-19,  我是怎麼感染上的? 應該是家人之間互相傳染的 感染上有什麼症狀? 初期會覺得喉嚨怪怪地,然後一症狀就會愈來愈明顯 看診有哪些步驟? 先打電話到診所說有快篩陽,要約視訊看診,先西醫看診並上傳給衛生局,拿到居隔單,掛中醫申請...