[javascript]陣列排序

參考網址:
https://developer.mozilla.org  陣列的運用

UCAMC JavaScript陣列與物件元素順序重新排序sort()、array 排序、object排序

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

[vb] Excel VBA 程式設計教學:陣列(Array)

參考網址:https://blog.gtwang.org/programming/excel-vba-array/

動態陣列

一般的陣列在宣告時就必須決定好陣列的大小,但是有的時候我們無法事先預知程式所需要的陣列大小,要等到實際執行時才會知道需要多少空間,這時候就可以使用動態陣列的方式來儲存資料。

動態陣列(dynamic arrays)的特點就是可以動態改變陣列的大小,在空間不足時可以擴增,而空間太大時也可以縮減,以下是動態陣列的使用方式:

' 宣告動態陣列
Dim MyDynArr() As Integer

' 調整陣列大小
ReDim MyDynArr(3)

MsgBox "LBound = " & LBound(MyDynArr) _
   & ", Ubound = " & UBound(MyDynArr)
MyDynArr(3) = 123

動態陣列的宣告方式就是在宣告陣列時不要指定索引範圍,然後在要使用陣列之前執行 ReDim 設定陣列的大小。

隨後如果需要改變動態陣列的大小,也是同樣呼叫 ReDim 並指定新的陣列大小,而在預設的狀況下使用 ReDim 改病陣列大小時,原本儲存於陣列中的資料會被刪除,如果想要保留舊資料,就要加上 Preserve,如果舊資料不需要保留的話,就可以將 Preserve 省略,這樣執行速度會比較快。

' 調整陣列大小,保留陣列內部資料
ReDim Preserve MyDynArr(10)

MsgBox "LBound = " & LBound(MyDynArr) _
   & ", Ubound = " & UBound(MyDynArr)
MyDynArr(7) = 456

MsgBox MyDynArr(3)
MsgBox MyDynArr(7)

這裡的 LBoundUBound 是用來查詢陣列索引下限與上限的函數。

當動態陣列使用完畢之後,我們可以使用 Erase 將系統配置給動態陣列的記憶體收回:

Erase MyDynArr

Erase 若用於一般性的陣列,則會將陣列內的每個元素重新初始化。

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

[VB]將文字寫入或讀出文字檔案(VB .NET)

參考網址:程式設計者之春

以下程式碼範例示範將文字寫入文字檔案的簡易方法。

Imports System
Imports System.IO

Class Test
    Public Shared Sub Main()
        ' Create an instance of StreamWriter to write text to a file. 
        Dim sw As StreamWriter = New StreamWriter("TestFile.txt")
        ' Add some text to the file.
        sw.Write("This is the ")
        sw.WriteLine("header for the file.")
        sw.WriteLine("-------------------")
        ' Arbitrary objects can also be written to the file.
        sw.Write("The date is: ")
        sw.WriteLine(DateTime.Now)
        sw.Close()
    End Sub
End Class

 

以下程式碼範例示範從文字檔案讀取文字的簡易方法。

Imports System
Imports System.IO

Class Test
    Public Shared Sub Main()
        Try
            ' Create an instance of StreamReader to read from a file.
            Dim sr As StreamReader = New StreamReader("TestFile.txt")
            Dim line As String
            ' Read and display the lines from the file until the end 
            ' of the file is reached.
            Do
                line = sr.ReadLine()
                Console.WriteLine(Line)
            Loop Until line Is Nothing
            sr.Close()
        Catch E As Exception
            ' Let the user know what went wrong.
            Console.WriteLine("The file could not be read:")
            Console.WriteLine(E.Message)
        End Try
    End Sub
End Class

 

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

[sport]翔聆資訊有限公司

參考網址:http://www.shulink.com.tw/

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

雙敗淘汰圖形產生器

參考網址:http://ren1244.pixnet.net/blog/post/313772779-%e9%9b%99%e6%95%97%e6%b7%98%e6%b1%b0%e5%9c%96%e5%bd%a2%e7%94%a2%e7%94%9f%e5%99%a8

※ 儲存的SVG圖檔可以直接給 LibreOffice 使用,MS Office 則要 2016 版之後才支援 SVG 圖片格式。

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

[sport]混合運動計分表

參考網址:http://www.sport.mlc.edu.tw/docs/multievents/

搜尋關鍵字combined events scoring tables
http://www.sport.mlc.edu.tw/docs/multievents/combinedEventsScoring.htm
http://www.sport.mlc.edu.tw/docs/multievents/
http://www.sport.mlc.edu.tw/docs/multievents/functions.js

 

IAAF Scoring Tables for Combined Events Tables de Cotation …

USA Track & Field

http://legacy.usatf.org/statistics/calculators/combinedEventsScoring/

 

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

[firefox] standlone install 離線安裝版下載

Download Mozilla Firefox Full Standalone Offline Installers

 

chrome

https://www.google.com/chrome/?system=true&standalone=1&platform=win64

 

edge
https://www.microsoft.com/en-us/edge/business/download

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

Uniserver zero install

參考網址:
vcruntime.dll

ZeroXIV – 14.0.1 需新版vcruntime.dll 14.24.28127.4

 

發表於 Windows系統, 軟體使用 | 發表迴響

[php]php測試執行時間

參考網址:S小學生

<?php
/**
 * 測試php執行時間
 */
function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}

$time_start = microtime_float();

//休息一下或程式碼放這裡
usleep(100);

$time_end = microtime_float();
$time = $time_end - $time_start;


echo "執行時間".$time.'秒<br />';

 

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

筆電教學-ACER Win10 筆電,如何進BIOS;如何設定FN鍵;

參考網址: 藤小二 https://www.youtube.com/watch?v=U4OGPtKBAF4

完整關機 shift+關機

進入BIOS Fn+F2 按著 再按電源鍵

修改function key behavior 模式
media模式:F1..F12
function模式 : Fn+F1..F12

還原進入鍵
Fn + Alt + F10 + 電源鍵

發表於 硬體維修 | 發表迴響