This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function BinarySearch(strArray() As String, strSearch) As Long | |
Dim Left As Long, Middle As Long, Right As Long | |
Left = 1 | |
Right = UBound(strArray, 1) | |
Do While Left <= Right | |
Middle = Left + (Right - Left) / 2 | |
If strSearch = strArray(Middle, 1) Then | |
BinarySearch = Middle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <iomanip> | |
using namespace std; | |
int lookup[100][100]; | |
// Đổ dữ liệu cho mảng lookup bằng cách tìm độ dài của dãy con chung | |
int LCSLength(string s1, string s2, int l1, int l2) { | |
// Hàng đầu tiên và cột đầu tiên của mảng lookup bằng 0 vì mảng lookup đã được khai báo toàn cục |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
class Item { | |
protected: | |
string ten; | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div id="container"> | |
<div class="select"> | |
<label for="audioSource">Audio source: </label> | |
<select id="audioSource"></select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main() { | |
ifstream EncodeFile("encode.jpg", ifstream::binary); | |
ofstream DecodeFile("decode.jpg", ofstream::binary); | |
if (EncodeFile) { | |
EncodeFile.seekg (0, EncodeFile.end); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <math.h> | |
using namespace std; | |
bool is_prime(int n) { | |
if (n <= 1) return false; | |
if (n <= 3) return true; | |
if (n % 2 == 0 || n % 3 == 0) return false; | |
for (int i = 5; i * i <= n; i += 6) | |
if (n % i == 0 || n % (i + 2) == 0) return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...document.querySelectorAll('ytd-thumbnail-overlay-time-status-renderer>span')].map(el => { | |
let timeSplit = el.innerText.split(':'); | |
let lastIndex = timeSplit.length - 1; | |
let second = timeSplit[lastIndex] * 1; | |
for (let i = 0; i < lastIndex; i++) | |
second += timeSplit[i] * 60 ** (lastIndex - i); | |
return second; | |
}).reduce((total, second) => total + second); | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Win32; | |
using System.Diagnostics; | |
using System.IO; | |
namespace ConsoleApp { | |
class Program { | |
static void Main(string[] args) { | |
// https://www.kunal-chowdhury.com/2016/06/how-to-retrieve-office-version.html | |
// Enable for default Office version | |
string regOutlook32Bit = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'(VN) Hàm thêm dấu Tiếng Việt & sửa lỗi chính tả cho Excel | |
'(EN) Predict Vietnamese tone & spell checking for Excel | |
#If VBA7 Then 'For 64 Bit Systems | |
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) | |
#Else 'For 32 Bit Systems | |
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) | |
#End If | |
Function FormatResponse(response As Object, sentence As String) As String | |
Dim wordSuggestion As Dictionary |
OlderNewer