This file contains hidden or 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
class UnionJoin: | |
def __init__(self,n): | |
# parent node point to itself | |
self.parent = [i for i in range(n)] | |
self.size = [0 for _ in range(n)] | |
self.count = n | |
def union(self,p, q): | |
# parent of p is parent of parent of q | |
parent_p = self.find_parent(p) |
This file contains hidden or 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> | |
<head> | |
<title>Iframe Example</title> | |
</head> | |
<body> | |
<iframe | |
id="inner-iframe" | |
style="position: absolute; left: 500px; top: 200px; pointer-events: none" | |
> |
This file contains hidden or 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
package main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
) | |
func handle(ctx context.Context, name string) { | |
for { |
This file contains hidden or 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
package main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
"github.com/redis/go-redis/v9" | |
) |
This file contains hidden or 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
package main | |
import "sync" | |
func main() { | |
} | |
func fanIn( | |
done <-chan interface{}, | |
channels ...<-chan interface{}, |
This file contains hidden or 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
package main | |
import "fmt" | |
type IRepo interface { | |
Get() string | |
} | |
type Repo struct { | |
Name string |
This file contains hidden or 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
<?php | |
global $conn; | |
// Hàm kết nối database | |
function connect_db() | |
{ | |
// Gọi tới biến toàn cục $conn | |
global $conn; | |
// Nếu chưa kết nối thì thực hiện kết nối |
This file contains hidden or 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
<!-- <?php | |
require 'students.php'; | |
$students = get_all_students(); | |
disconnect_db(); | |
?> --> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Danh sách cong ty</title> |
This file contains hidden or 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
<?php | |
require 'congty.php'; | |
// Nếu người dùng submit form | |
if (!empty($_POST['add_student'])) | |
{ | |
// Lay data | |
$data['macty'] = isset($_POST['txtmact']) ? (string)$_POST['txtmact'] : ''; | |
$data['ten'] = isset($_POST['txthoten']) ? (string)$_POST['txthoten'] : ''; |
This file contains hidden or 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
// List all files in a directory in Node.js recursively in a synchronous fashion | |
var walkSync = function(dir, filelist) { | |
var fs = fs || require('fs'), | |
files = fs.readdirSync(dir); | |
filelist = filelist || []; | |
files.forEach(function(file) { | |
if (fs.statSync(dir + file).isDirectory()) { | |
filelist = walkSync(dir + file + '/', filelist); | |
} | |
else { |
NewerOlder