嫌Raspberry Pi太弱?Atomic Pi搭載Intel Atom處理器帶來更強效能

參考網址:電腦王

Atomic Pi則是以Atom x5-Z8350為核心設計的開發板,並搭載2GB DDR3L-1600記憶體、16GB eMMC儲存裝置與SD讀卡機(最大可支援256GB記憶卡),支援GbE有線網路、IEEE 802.11b/g/n/ac無線網路、藍牙4.0、HDMI、USB 2.0、USB3.0等網路與輸出入介面,基本規格與輕省筆電接近,使用者可自由安裝Windows 10或Linux等作業系統。

 

目前Atomic Pi在Kickstarter集資網站募款,本體價格為美金34元 (約合新台幣1,060元),搭配Breakout Shield擴充底座則為美金49元(約合新台幣1,520元) ,預定上市時間為2019年1月。

發表於 硬體維修, 軟體使用 | 發表迴響

網頁列印、轉成PDF

參考網址:程式前沿 CSS3輸出PDF列印的小技巧
it邦幫忙 其實Css的內心還住著一位Print​

開源中國 PHP输出PDF打印HTML5+CSS3打印格式控制
本文推荐两个可用的类库:Princewkhtmltopdf。这两位都是跨平台系统支持,并且不需要内嵌于php,不需要有任何担心。

Prince和wkhtmltopdf,实际上就是一个html5+css3的解析器,并且是完整支持css3 @page部分的打印特性的功能。并且具备生成PDF的功能。其中Prince是收费的,但他提供免费使用License,美中不足的地方就是生成PDF预览时,第一页右上角会有一个P字的icon,不过在打印的时候就会消失掉。

两者比较,Prince对中文样式的支持更好(可能wkhtmltopdf是因为我的CSS写法有问题,没有针对@mediaprint),修改中文字体,wkhtmltopdf还是会用默认的宋体输出,而Prince则是你指定的字体。

 

 

發表於 程式設計 | 發表迴響

HTML table 表格框線

參考書籍:旗標 網頁程式設計的16堂課 第7-1章節
HTML中表格的框線border=1時,框線是可以看到2層的。不過一般生活中看到的表格,多數只有一層框線。可以使用border-collapse屬性來控制。
當"border-collapse:collapse"時,2層框線重疊成一條線。
當"border-collapse:seperate"時,框線不重疊。
 

<style>
table {border-collapse:collapse;}
</style>
<table border=1>
<tr>
    <td>aaa</td>
    <td>bbb</td>
</tr>
<tr>
    <td>ccc</td>
    <td>ddd</td>
</tr>
</table>

 

發表於 程式設計 | 發表迴響

像素與公分的換算方法

參考網址:MSDN

(目前螢幕約為96DPI)
看 dpi 吧….
96 DPI 時, 1 Inch = 96 Pixels , 1 CM = 1/2.54 Inch = 96/2.54 Pixels = 37.7953 Pixels
列印網頁時瀏覽器會以螢幕的DPI為參考值(非印表機的DPI)

A4:21*29.7cm(標準規格),實際約為21*29.6
Firefox+Kyocera FS-1040 GX測試
網頁列印時即使邊界都設為0仍會有0.5cm的邊框
所以實際可列印的範圍是(21-0.5*2)*37.8=756Pixels
(29.5-0.5*2)*37.8=1081.08Pixels

 

… 這跟列印裝置有關。

假設印表機是 600 DPI ,表示 600 pixel = 1 in = 25.4 mm 。
=> 23.6 pixel = 1 mm

發表於 程式設計 | 發表迴響

測試瀏覽器對HTML5的支援程度

參考網址:http://html5test.com/

發表於 程式設計, 軟體使用 | 發表迴響

在ubuntu中安裝scratch 3 伺服器

參考網址:Linux 技術手札 
 

以下會介紹在 Ubuntu 透過源碼安裝及 apt-get 安裝的步驟:

Ubuntu Repository 安裝:

透過 Ubuntu 預設 Repository 安裝的好處是簡單, 但缺點是安裝的版本會較舊。
 

$ sudo apt-get install nodejs
$ sudo apt-get install npm

 

PPA Repository 安裝:

如果想安裝較新的版本, 可以透過 PPA Repository 安裝。

先加入 PPA repository:

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository -y -r ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs

 

Node.js 安裝 Script

使用 Node.js 提供的安裝 Script 安裝是很簡單的方法, 而且可以安裝到最新版本:

$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash –
$ sudo apt-get install nodejs

nodejs -v查看nodejs版本(10.14.2的版本 OK的)
 ubuntu16.04預裝版本V4太舊,npm start時會出現npm ERR!scratch-gui@0.1.0 start: `webpack-dev-server` npm ERR! Exit status 1 錯誤

 

安裝scratch 3.0  https://github.com/LLK/scratch-gui
 

If you want to edit/play yourself:

git clone https://github.com/LLK/scratch-gui.git
cd scratch-gui
npm install

Getting started

Running the project requires Node.js to be installed.

Running

Open a Command Prompt or Terminal in the repository and run:

npm start

Then go to http://localhost:8601/ – the playground outputs the default GUI component

發表於 Linux系統 | 發表迴響

利用NPM快速建置Node.js網路應用框架

參考網址:臺灣大學計算機及資訊網路中心

-Linux系統(以Ubuntu為例)
1.使用app-get 來安裝,若是CentOS則用yum install
$ sudo apt-get install nodejs
$ sudo apt-get install npm


圖五 NPM安裝

2.Linux上node已被更名為nodejs,可用ln -s 指令來連結node為執行檔
$ sudo ln -s /usr/bin/nodejs /usr/local/bin/node
使用node -v 和npm -v 確認是否已安裝成功。
因為apt-get 安裝比較穩定版本,若要最新版本可自行抓原始碼來編譯。 https://github.com/joyent/node.git

Node.js 教程 http://www.runoob.com/nodejs/nodejs-tutorial.html

發表於 Linux系統, 程式設計 | 發表迴響

PhotoImpact x3 1試用版

參考網址:
校園文化網站課程 提供中文試用版下載點
b24338869

還在測試

cd C:\Program Files (x86)\Corel\Ulead PhotoImpact X3
rename Ulead.dat Ulead.dat_aa
mklink /j Ulead.dat D:\soft\Ulead.dat

需用管理者權限執行
本想把Ulead.dat目錄放在x:
可惜 /j 無法使用網路磁碟機
所以還是得把Ulead.dat目錄複製過來


刪除C:\Users\5A88\AppData\Roaming\Ulead Systems\Ulead PhotoImpact\13.0資料夾
重新執行photoImpact

試用結果:印章有問題

發表於 軟體使用 | 發表迴響

How to Open, Edit, and Convert XNB Files KODU檔案格式

參考網址:https://www.lifewire.com/xnb-file-2622568

by Tim Fisher

Updated October 30, 2018

A file with the XNB file extension is an XNA Game Studio Express XNA Framework Content Pipeline Binary file. It's used to save original game files into a proprietary format.

 

In English: an XNB file is usually a compressed file full of images that appear in a video game created with XNA Game Studio, but they may also contain additional game data like audio files.

Some software might refer to XNB files as compiled asset files.

Note: The XNB file extension looks an awful lot like XMB and might seem similar but XMB files are video game data files used in games like Age of Empires and X-Wing.

 

How to Open an XNB File

The real source of XNB files is Microsoft XNA Game Studio, a tool that works with Microsoft Visual Studio to help create video games for Microsoft Windows, Windows Phone, Xbox 360, and the (now defunct) Zune. This program, however, isn't a practical tool to extract images from XNB files.

Your best bet is a program called XNB Exporter, which is a portable (meaning no install is necessary) tool that extracts the PNG files from the compressed XNB file you're working with.

The easiest way to use this program is to copy the XNB file into the same folder as the program and then enter the file name of the XNB file without the file extension (e.g. file instead of file.xnb) in XNB Exporter, and then press Go for it!.

You might also be able to open and/or edit XNB files with the GameTools GXView tool.

Note: If you've installed GameTools but can't find GXView, you can open it directly from the installation folder, almost always here: C:\Program Files (x86)\GameTools\GXView.exe.

Tip: Some file types are text-only files and can be opened and viewed with any text editor, like Notepad in Windows, or a more advanced text editor from our Best Free Text Editors list. This isn't the case with any Game Studio XNB file, but if the one you have is a different format, this might be of some help.

If you do manage to get an XNB file opened with a text editor, but it's not entirely composed of text, there may be something within it that identifies the program used to create the file, which you then might be able to use to find a suitable program for opening it.

If the above tools don't open your XNB file, it's possible that yours has nothing to do with XNA Game Studio and isn't a plain text file, in which case it's an entirely different format instead. The best thing to do is to see what folder the XNB file is stored in, and see if that context can help you determine the program that's using it.

Note: If your file doesn't open as explained above, double-check that you're reading the file extension correctly. For example, even though XMB and XNK files resemble the XNB file extension, neither are the same as XMB and therefore don't open with the same programs.

 

How to Convert an XNB File

A regular file converter will not convert XNB files. The tools we already mentioned above are designed for getting image files out of an XNB file, which is probably what you're wanting to do.

However, you may also try TExtract, TerrariaXNB2PNG, or XnaConvert if the software from above doesn't help.

XNB to WAV lets you copy out the WAV sound file from an XNB file. If you want the WAV file to be in some other sound format like MP3, you can use a free audio converter.

發表於 Windows系統, 程式設計, 軟體使用 | 發表迴響

html5 drag拖放實現兩個div互換

參考網址:https://github.com/sunshine940326/drag

<!DOCTYPE html>
<!DOCTYPE HTML>
<html>
<head>
    <style type="text/css">
        #div1
        {float:left; width:100px; height:35px; margin:10px;padding:10px;border:1px solid #aaaaaa;}
        #div2
        {float:left; width:200px; height:135px; margin:10px;padding:10px;border:1px solid #aaaaaa;}

    </style>
    <script type="text/javascript">
        function allowDrop(ev)
        {
            ev.preventDefault();
        }

        var srcdiv = null;
        function drag(ev,divdom)
        {
            srcdiv=divdom;
            ev.dataTransfer.setData("text/html",divdom.innerHTML);
        }

        function drop(ev,divdom)
        {
            ev.preventDefault();
            if(srcdiv != divdom){
                srcdiv.innerHTML = divdom.innerHTML;
                divdom.innerHTML=ev.dataTransfer.getData("text/html");
            }
        }
    </script>
</head>
<body>

<div id="div1" ondrop="drop(event,this)" ondragover="allowDrop(event)" draggable="true" ondragstart="drag(event, this)">
    <p>ni hao!</p>
</div>
<div id="div2" ondrop="drop(event,this)" ondragover="allowDrop(event)" draggable="true" ondragstart="drag(event, this)">
    <p>Hello world!</p>
</div>

</body>
</html>

 

發表於 程式設計 | 發表迴響