[pad]平板的程式編修環境

參考網址:
最近買了samsung tab s6 lite,想發揮它的功能,試著營造程式編輯的環境。
首先當然要有editor
在windows的環境中習慣使用sublime text
在andriod的平台上也是有sublime text 只是功能很陽春,還帶了一大堆的廣告。
vscode的線上版似乎馬言也可以考慮,但試用結果是畫面顯示太複雜,不容易操作。而且存檔時需要將檔案下載,不符合操作習慣。
後來找來quick edit 高級版,得付費。一般版也是一堆廣告。
雖然功能不是很強,但還是勘用,一些簡單的編輯還可以應付。

ssh的部分用termus
sftp的部分用andftp,雖然termus也提供sftp的功能,但操作界面比較不友善。也找不到預設目錄的選項。

samsung 提供dex模擬桌機環境,可以讓平板的操作界面比較像桌機。

 

 

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

[inkscape]中文字型

參考網址:https://gemmy886.blogspot.com/2011/03/inkscapesvg.html

Ctrl+Shift+T可以叫出文字與字型對話框,比較好找字體,並可預覽。


Inkscape預設字型並不支援中文字,需使用其它中文字型!
Inkscape預設中文字型依外型可分為三類:細明體、圓體、正黑體,顯示名稱都是英文,
除標示"B5"字型外,其他很難分辨是否支援中文字

Microsoft JhengHei 微軟正黑體 (Default Windows 7 繁體字型)
MingLiU 細明體(等寬的英文字型)
PMingLiU 新細明體(不等寬的英文字型)
KaiTi 標楷體 (找不到)

DF開頭的字型是華康字型
 

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

[php]SVG to PNG

參考網址:

安裝 imagick 套件 https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-install-imagemagick-for-php-on-ubuntu-18-04/#google_vignette

apt install imagemagick
apt list imagemagick -a

特定版本
apt install imagemagick:6.9.7.4


Installing Imagick PHP Extension
apt install php-imagick
systemctl restart apache2

https://www.phpclasses.org/
 

<?php
// Load the SVG file
$svgFilePath = 'path/input.svg';
$svgContent = file_get_contents($svgFilePath);

// Create an Imagick object and set the SVG content
$imagick = new Imagick();
$imagick->readImageBlob($svgContent);

// Set the image format for the output (e.g., PNG, JPEG)
$outputFormat = 'png'; // You can change this to your desired image format

// Optionally, you can adjust the image properties as needed
$imagick->setImageFormat($outputFormat);
$imagick->setImageBackgroundColor(new ImagickPixel('white')); // Set background color if needed
$imagick->setResolution(300, 300); // Set resolution (dots per inch)

// Perform the conversion
$imagick->setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE); // Remove alpha channel if present
$imagick->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN); // Flatten the image

// Save the converted image to a file
$outputFilePath = 'path/output.' . $outputFormat;
$imagick->writeImage($outputFilePath);

// Clean up resources
$imagick->clear();
$imagick->destroy();

echo "Conversion completed. The image has been saved to: $outputFilePath";
?>

 

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

[sport]VB將原始表中的兩列資料顯示方式轉換成一列的資料顯示方式,以方便賽程表匯入系統中。

參考網址:
如何將 Excel 中兩行或多行的表格資料快速轉換成一行?

Excel 連在一起的字串想分割欄位,可使用關鍵字加空格全部取代方式  用資料剖析

Excel-時間表示的數值和文字轉換(TEXT,TIME,MID)  =TEXT(A2,"hh時mm分")

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

[bootstrap]Bootstrap 5 Offcanvas 改變寬度

參考網址:https://www.geeksforgeeks.org/bootstrap-5-offcanvas-sass/

bootstrap Offcanvas 預設寬度是400px,要改變寬度,似乎得從SASS下手
 


.offcanvas { 
    position: fixed; 
    bottom: 0; 
    z-index: var(--bs-offcanvas-zindex); 
    display: flex; 
    flex-direction: column; 
    max-width: 100%; 
    color: var(--bs-offcanvas-color); 
    visibility: hidden; 
    background-color: var(--bs-offcanvas-bg); 
    background-clip: padding-box; 
    outline: 0; 
    transition: transform 2s ease-in-out; 
} 
.offcanvas, .offcanvas-xxl, .offcanvas-xl, .offcanvas-lg, .offcanvas-md, .offcanvas-sm { 
    --bs-offcanvas-zindex: 1045; 
    --bs-offcanvas-width: 400px; 
    --bs-offcanvas-height: 30vh; 
    --bs-offcanvas-padding-x: 1rem; 
    --bs-offcanvas-padding-y: 1rem; 
    --bs-offcanvas-color: white; 
    --bs-offcanvas-bg: green; 
    --bs-offcanvas-border-width: 1px; 
    --bs-offcanvas-border-color: var(--bs-border-color-translucent); 
    --bs-offcanvas-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); 
} 
.offcanvas-title { 
    margin-bottom: 0; 
    line-height: 4; 
} 
上方將要改變的參數加入var()
下方再改變值
例如:
上方 width: var(--bs-offcanvas-width);
下方--bs-offcanvas-width: 200px; 

 

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

[svg]如何在word中插入svg檔

參考網址:布丁布丁吃什麼

ms word 2016版以後才支援SVG檔

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

[bootstrap]表格超出頁面寬度的處理方式

參考網址:https://bootstrap5.hexschool.com/docs/5.0/content/tables/
 

表格的一些屬性被bootstrap重置了,以致於以下作法無效。
html表格table显示的宽度超出界面的解决方法
https://blog.csdn.net/weixin_44518466/article/details/111921984
 

<div style="overflow: auto;">
<table></table>
</div>

原因是bootstap針對單一檔案內 CSS 的特定元素重置樣式,重置以便 Bootstrap 準確且一致的建立樣式。
https://bootstrap5.hexschool.com/docs/5.0/content/reboot/

 

解決方法是直接套用bootstrap的表格設定

<div class="table-responsive">     
<table class="table table-bordered border-primary table-hover">
</table>
</div>


 

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

[3D]fusion 360 繁體中文化

參考網址:sairwolf's實驗室

fusion 360 官網目前尚未提供繁體中文語系支援,網路上找到的繁體中文化文件因為歷時已久,與目前的版本不符,會造成fusion 360 無法開啟。
於是參考網路上的文件,搭配MadEdit軟體,自行進行繁體中文化。
目前2023/11/26 fusion 360的版本是2.0.17721 x86_64
fusion 360的版本訊息可以在畫面右上角 幫助>>關於中找到

zh-TW.7z

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

[php]多維陣列排序array_multisort

參考網址:https://segmentfault.com/a/1190000038976961

arr=[
            [
                'age'=>50,
                'name'=>'张三'
            ],
            [
                'age'=>18,
                'name'=>'李四'
            ],
            [
                'age'=>27,
                'name'=>'王五'
            ]
        ];

我们怎么按照age或name排序呢?我们可以使用array_multisort这个函数来进行按指定字段排序。

array_multisort(array_column($arr,'age'),SORT_ASC,$arr);
var_dump($arr);

 

還有一個問題,如何指定第二個鍵值呢?
在 https://www.php.net/manual/en/function.array-multisort.php 找到答案
 

Arbitrarily sort the two-dimensional array according to multiple keys:

array_multisort (
    array_column($array, 'key1'), SORT_ASC,
    array_column($array, 'key2'), SORT_DESC,
    array_column($array, 'key3'), SORT_ASC,
    array_column($array, 'key4'), SORT_DESC,
    $array
);

 

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

[3D]gcode代碼

參考網址:https://www.3dprintinglab.com.hk/blog/3d-printer-g-code-demands-basic-guide/

基本Gcode含義

 

G0G1:移動

這命令打印頭沿直線方向移動。G0和G1之間的區別是物料擠出,因為G1命令打印機移動時會擠出物料,而G0移動時不會擠出物料。當打印頭移動到指示的X和Y坐標系時,系統便會控制打印頭需不需要擠出物料。

配合G0或G1,代碼E和F會告訴打印機在此期間需要多快地移動到該位置以及應該擠出多少物料,這是最常用的Gcode命令。

 

G90G91:絕對位置和相對位置

絕對位置(G90)表示打印機頭必須移動到特定x和y座標的確切位置。

相對位置(G91)表示打印頭必須使用x和y坐標的數值作移動。

例如,如果一行代碼顯示為G90 G1 X40,打印頭則必須移動到打印平台上的X = 40的確實位置;但是,如果一行代碼顯示為G91 G1 X40,則表示打印頭必須根據前一個指令的所到達的位置再向向命令的打印方向移動40mm。

 

G28Home 歸零

該命令將打印噴頭回代原點,即X0和Y0坐標。

 

M104M109:噴頭加熱

M104和M109都是將打印噴頭加熱到特定溫度,唯一的區別是M104命令能讓打印機在執行其他命令的同時也會進行加熱,而M109命令將暫停所有活動,直到達到最終溫度才執行下一個命令。

 

M140M190:打印平台加熱

M140和M190的工作方式與上述M命令類似,不同之處在於它們處理打印平台的溫度。M140命令表示打印機在加熱平台時可以執行其他操作,而M190命令將暫停所有操作,直到打印床完全加熱為止。

有些專業人士可能會在整個職業生涯中都不需要使用Gcode,但是對Gcode有了基本了解可讓你更清楚3D打印工作的流程,增高成功打印的機率。

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