2018年5月29日 星期二

Document.execCommand()

https://codepen.io/netsi1964/full/QbLLGW

TinyMCE

https://www-archive.mozilla.org/editor/midas-spec.html

https://www.tinymce.com/
TinyMCE
http://blog.pulipuli.info/2017/08/htmltinymce-online-html-editor.html

https://ckeditor.com/ckeditor-4/

(html5)
http://xing.github.io/wysihtml5/

(html5)
https://archive.codeplex.com/?p=jhtmlarea
https://github.com/crpietschmann/jHtmlArea

(html5)
http://www.nicedit.com/

https://kevinroth.com/rte/
https://kevinroth.com/rte/demo.htm

http://www.freetextbox.com

http://www.unverse.net

http://markitup.jaysalvat.com/home/

http://www.themaninblue.com/experiment/widgEditor/

http://www.freetextbox.com

http://www.wymeditor.org/demo/

http://www.openwebware.com

http://www.xstandard.com

http://www.nicedit.com/index.php


2018年5月25日 星期五

sprintf.js

http://www.diveintojavascript.com/projects/javascript-sprintf

https://github.com/alexei/sprintf.js

netbeans 8.0.1 修改行间距

https://svenspruijt.nl/themebuilder/

 

C:\Users\{Administrator}\AppData\Roaming\NetBeans\8.0\config\Editors\Preferences 目录下

C:\Users\allen\AppData\Roaming\NetBeans\12.0\config\Editors\Preferences\org-netbeans-modules-editor-settings-CustomPreferences.xml
 

-------------------------------------------------------

 org-netbeans-modules-editor-settings-CustomPreferences.xml 文件

<editor-preferences>
   //原来的代码

/** 添加的代码 -- 开始 */

    <entry javaType="java.lang.Float" name="line-height-correction" xml:space="preserve">
        <value><![CDATA[1.20]]></value>  //间距数值
    </entry>

/** 添加的代码 -- 结束*/
</editor-preferences>


重启netbeans 查看效果
-------------------------------------------------------
更改系統字型大小 >>

....Netbeans/etc/netbeans.conf

 netbeans_default_options="....... --fontsize 17"

-------------------------------------------------------

Open netbeans.conf file (etc folder) and add "--fontsize 28" to netbeans_default_options value.

Example:

netbeans_default_options="--fontsize 28 -J-XX:+UseStringDeduplication -J-Xss2m -J-

NetBeans 深色背景主題更改教學

NetBeans 深色背景主題更改教學

讓你的 NetBeans IDE 擁有漂亮的深色背景主題吧!
  現代人生活離不開各種螢幕,像是手機、電視、桌電、平板等等,而這些螢幕其實不知不覺都在傷害您的靈魂之窗,由其是白色底黑色字的顯示畫面。
  如果你是常常在寫程式的人,看著那些密密麻麻的code,不保護一下雙眼怎麼行? 如果只是把背景改成黑色,字體改成白色,好像也挺無趣的因此這篇文章告訴你怎麼將NetBeansIDE換成漂亮深色背景主題,非常的簡單喔!
1.      首先,先到這個網站,選擇一個你喜歡的主題背景,按下去!



2.      假設我們選擇了這個主題,按下右邊的Download(紅框框處),接著會下載一個壓縮檔。

請張開眼睛,不要忘記自己把檔案存到哪裡了嘿!



3.      接著我們打開NetBeans IDE,選擇上面的Tools-->Options(使用中文版的朋友,可能要找工具-->選項”)

然後會看到這個畫面,按一下上排第三個按鈕”Fonts & Colors”

按一下下方的Import(中文版可能叫做匯入之類的吧?),再按一下Import Source旁邊的Browse按鈕,然後選擇剛才下載好的壓縮檔,按下OK


接著在Available Options這邊需要勾選你想套用哪些部分,基本上若沒有特殊需求,勾選”ALL”就可以了,再次按下OK

他會跳出一個對話框,跟你說這會變更設定並且重新啟動應用程式,剛剛在編寫中的code檔案們記得存好就沒關係了,按下yes吧。


4.      等待NetBeans重啟之後我們就會看到新的主題~~

有一些主題預設的版面配置可能和你原本使用的不同,像這個主題預設output視窗是在上方的,如果喜歡這個主題的配色,可能必須先動手把視窗拉回你喜歡的配置方式儲存起來(儲存主題的方法與第3步驟類似,Export按鈕就是用來匯出主題的)
眼尖的朋友可能從上圖中發現一個問題:欸我的中文怎麼都變成亂碼了?!!”,沒錯,因為一些漂亮的英文字體可能是沒有中文的,所以會變成亂碼,那該怎麼辦呢? 別緊張,我們再打開剛才設定主題的視窗(Tools-->Options--> Fonts & Colors),在右邊Font的部分選擇看看有沒有其他支援中文的字型。

這樣就OK拉,雖然字體可能沒有剛剛那麼好看,但至少中文回來囉!


如果想要其他比較好看的字型,就要再試試看其他的字型是否支援中文了~


    以上,祝大家都能擁有漂亮又能守護靈魂之窗的介面喔! ^__^
Ps.我最喜歡的主題其實是Monstor,喜歡它的配色,推薦給大家唷 :D

http://netbeansthemes.com/monster/


相關:NetBeans, NetBeansIDE, 深色背景, 黑背景, 背景, 主題

清除匿名函式監聽事件

清除匿名函式監聽事件

button.addEventListener('click', function () {
    //執行一次

    console.log('only once');
    this.removeEventListener('click', arguments.callee);
});

baidutemplate

'<p>5</p>\
<% for(var i = 0; i < 5; i++){ %>\
    <% if(i<3){ %>\
        <p>111111</p>\
        <% _template_fun_array.push(x()); %>\
    <% }else{ %>\
        <p>222222</p>\
    <% } %>\
<% } %>'

紅色的地方可化為 echo (x());

2018年5月23日 星期三

https://zh.m.wikipedia.org/zh-tw/%E7%8F%AE%E9%A0%93%C2%B7%E5%88%A9%E6%96%AF%E7%89%B9

2018年5月22日 星期二

java.json

JSONObject(package org.json;)

public static String[] getNames(JSONObject jo)

public Iterator<String> keys()

public JSONArray names()

 public Iterator<String> keys()

public Set<String> keySet()

protected Set<Entry<String, Object>> entrySet()

public int length()

2018年5月19日 星期六

java.ajax

// 定義回呼函式
public interface Job<T> {
    public void callback(T res);
}
-----------------------------------------------------------
// 發出 ajax需求

public class T_1 {
   
    public StringBuilder res = new StringBuilder("hi");

    public Inner job = new Inner();
   
    public void setRes(StringBuilder res) {
        this.res = res;
    }
    //=======================
    // 相當於 js callback
    class Inner implements Job<StringBuilder> {

        public void callback(StringBuilder _res) {
            setRes(_res);
            System.out.println(res);
        }
    }
    //=================================
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        Runnable db = null;

        T_1 t = new T_1();

        try {
            db = new Mysql_1("xd702g3", "SELECT * FROM paris_roomtype", t.job);

        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        Thread th_1 = new Thread(db);
        th_1.start();
    }

}
-----------------------------------------------------------
// ajax 處理

public class Mysql_1 implements Runnable {
    private String db_path;
    private String db_host = "jdbc:mysql://localhost/";
    private String db_arg = "useUnicode=true&characterEncoding=Utf8";

    private String username = "xd702g3";
    private String password = "xd702g3";

    private Connection con = null;
    private Statement stat = null;
    private ResultSet rs = null;

    private String sql = null;

    public StringBuilder res = new StringBuilder();
   
    public Job<StringBuilder> job = null;

    // ==========================================================================
    public Mysql_1(String table, String sql,Job<StringBuilder> job) throws Exception {
        // TODO Auto-generated constructor stub
        db_path = db_host + table + "?" + db_arg;
        this.sql = sql;
        this.job = job;
      
        connect();
    }

    // ==========================================================================
    private void connect() throws Exception {

        Class.forName("com.mysql.jdbc.Driver");

        con = DriverManager.getConnection(db_path, username, password);

        stat = con.createStatement();

    }

    // ==========================================================================
    private StringBuilder query() throws Exception {
        rs = stat.executeQuery(sql);

        while (rs.next()) {
            var a = rs.getInt(1);
            var b = rs.getString(2);
//            System.out.println(a + "\t" + b);
            res.append(b);
        }
      
        return res;
    }

    // ==========================================================================
    @Override
    public void run() {
        try {
            var res = query();
          
            job.callback(res);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
    // ==========================================================================
   
}

2018年5月16日 星期三

矩陣相乘

A(m*n) =

a(11)......a(1n)
.
.
a(m1)......a(mn)
 --------------------------------------
B(n*p) =

b(11)......b(1p)
.
.
b(n1)......b(np)
--------------------------------------
C(n*p) =

c(11)......c(1p)
.
.
c(n1)......c(np)
--------------------------------------
A*B = C
--------------------------------------

c(11) = a(11)*b(11) + ........+ a(1n)b(n1)
.....
c(1p) = a(11)*b(1p) + ........+ a(1n)b(np)
.....
c(mp) = a(m1)*b(1p) + ........+ a(mn)b(np)

2018年5月11日 星期五

php 另一種引入其他 php檔的方法(處理模板,標籤命令的起手)

a.php>>

<?php
$d = 'hi.........';

$content = sprintf('?>%s', file_get_contents('b.php'));



// 解析,並執行 b.php 裡的內容
$s = eval($content);

// 備用,萬一執行裡面沒有 <?php ?>標籤
echo $s;

-----------------------------------------------------------------------------
b.php>>
printf('<h1>d = %s</h1>', @$d);