[css]關於 @media print 的二三事..

參考網址:關於 @media print 的二三事..

其實Css的內心還住著一位Print

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

[dnsmasq]把dnsmasq主機的hosts給區網共用

主機的/etc/dnsmasq.conf設定
addn-hosts=/etc/hosts
設定完得service dnsmasq restart

主機的/etc/hosts
120.116.1.10 tn
163.26.179.2 sp
125.228.21.220 sa

ubuntu client端設定
/etc/resolv.conf   nameserver 指向dnsmasq主機
nameserver 192.168.1.9
這樣就可以了

windows client端設定
指定ipv4的DNS為192.168.1.9
取消ipv6的選項,ipv6會抓ipv6的DNS
ipconfig /all 查詢DNS的欄位只能有192.168.1.9
只有簡單的網址不接受需要比較複雜的兩段式網址(加個.a吧)
主機的/etc/hosts
120.116.1.10 tn.a

andriod 尚不知如何指定只有一個DNS
 

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

[sublime]支援語言眾多,選單落落長,可以少一點嗎?

sublime支援語言眾多,右下角語言選單落落長,可以少一點嗎?
找到sublime安裝目錄,一般是C:\Program Files\Sublime Text 3\Packages
每個檔案(例如ASP.sublime-package)都是對特定語言的支援
挑不常用到的檔案,直接刪除即可

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

門牌號碼地圖查詢

參考網址:longcaretw.com

國土測繪圖資服務雲

  • 特色:

    • 操作簡單,正確率高(個人經驗正確率約90-95%)
    • 可連結到google街景圖
    • 切換航照圖方便(方便觀察到一些難以進入的小路)
    • 有簡易規劃路線功能
發表於 生活資訊 | 發表迴響

[image]試用微軟image creator

參考網址:https://www.kocpc.com.tw/archives/487189

微軟image creator內建在Edge內,可以依要求產生圖檔。
目前還不支援中文的提示,所以就利用google翻譯成英文
下一段需求
A sports meeting poster in A4 vertical format with running track and children, cartoon style,Editable image format, SVG
經過約3分鐘的運算,終於得到4張圖檔。A4直式沒用,它產生的都是1024*1024大小的圖,
Editable image format, SVG也沒用,它也需要保護吧,給你可編輯的圖檔,靠什麼吃飯啊!
基本上圖的品質不錯,只是它可能故意留一些小問題,人物的手都不太正常,好像章魚。
標題的文字也都故意拼錯。
我想這是故意的吧,讓人一看就知道是AI產生的圖。

初始建立帳號給了25個下要求的機會,用完了就得去微軟的Rewards拿點數兌換。

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

[image]圖片自動去背、去文字

參考網址:https://clipdrop.co/

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

[ChatGPT]我的第一個引用ChatGPT的程式

參考網址:
用VScode+EasyCod(ChatGPT)所產生的程式
運用到拖曳調整道次
問題1:用javascript ajax 讓籤號可以拖曳,並交換內容
問題2:可以加入ajax功能嗎?要更改資料庫內容

<!-- 20230408 by ChatGPT -->
<style>
.tags {
  display: flex;
  flex-wrap: wrap;
}

.tag {
  padding: 10px;
  margin: 10px;
  background-color: #ccc;
  cursor: move;
}
</style>
<div class="tags" id="container">
  <div class="tag" draggable="true" ondragstart="drag(event)" data-id="1">Tag 1</div>
  <div class="tag" draggable="true" ondragstart="drag(event)" data-id="2">Tag 2</div>
  <div class="tag" draggable="true" ondragstart="drag(event)" data-id="3">Tag 3</div>
  <div class="tag" draggable="true" ondragstart="drag(event)" data-id="4">Tag 4</div>
</div>
<script type="text/javascript">
var dragSrcEl = null;

function drag(e) {
  dragSrcEl = e.target;
  e.dataTransfer.effectAllowed = 'move';
  e.dataTransfer.setData('text/html', dragSrcEl.innerHTML);
}

function drop(e) {
  e.preventDefault();
  if (e.target.className == 'tag') {
    var temp = dragSrcEl.innerHTML;
    dragSrcEl.innerHTML = e.target.innerHTML;
    e.target.innerHTML = temp;

    // 更新資料庫內容
    var id1 = dragSrcEl.getAttribute('data-id');
    var id2 = e.target.getAttribute('data-id');
    console.log(id1);
    updateDatabase(id1, id2);
  }
}

function allowDrop(e) {
  e.preventDefault();
}

var container = document.getElementById('container');
container.addEventListener('drop', drop, false);
container.addEventListener('dragover', allowDrop, false);

function updateDatabase(id1, id2) {
  var xhr = new XMLHttpRequest();
  xhr.open('POST', 'update.php', true);
  xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  xhr.onreadystatechange = function() {
    if (xhr.readyState == 4 && xhr.status == 200) {
      console.log(xhr.responseText);
    }
  };
  xhr.send('id1=' + id1 + '&id2=' + id2);
}
</script>

 

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

[phpexcel]使用教學

參考網址:
phpExcel常用方法詳解

PHPExcel 使用小記

PHP 使用 PHPExcel 讀取、寫入並產生篩選功能的 Excel 下載檔

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

[ChatGTP] ChatGTP+ Visual Studio Code】完美整合,變身超強程式設計高手!

參考網址:https://www.youtube.com/watch?v=eM_I6j_mKTo
當錄完這個影片之後,這個Extensions 它就改名了!改成:ChatGPT – EasyCode

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

[phpSpreadSheet]phpexcle的接替者

參考網址:https://neohsuxoops.blogspot.com/2020/09/phpspreadsheetphpexcel-xoops.html
PHPExcel,但是官網已經說明PHPExcel套件因升級不易只能支援到php5.6,該物件已於2017年正式棄用,並於2019年永久歸檔,換句話說PHPExcel套件對於日後新版的excel格式均不支援,為保持程式在最新狀態只好棄用PHPExcel改使用PhpSpreadsheet電子表格套件
唯一比較麻煩的是使用PhpSpreadsheet要先佈署composer,如果沒佈署composer是沒辦法使用的,還好官方有釋出已經設定好的phpoffice套件可以直接引入使用,省了很多麻煩,請直接參考「參考網站」
 

官方網站:https://github.com/PHPOffice

 

點下資訊社的教學
https://campus-xoops.tn.edu.tw/modules/tad_book3/page.php?tbsn=36&tbdsn=1336
套用樣板
好處是不用全部都用程式來寫,可以自己設定好各種花俏的格式,程式只負責把值填上

<?php

require 'vendor/autoload.php';

$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load('test.xlsx');

$worksheet = $spreadsheet->getActiveSheet();

$worksheet->getCell('A1')->setValue('套用樣板測試');

header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="套用樣板測試.xls"');
header('Cache-Control: max-age=0');

$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
$writer->save('php://output');

 

 

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