The url has changed: https://odan.github.io/2017/08/10/aes-256-encryption-and-decryption-in-php-and-csharp.html
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
// Stackoverflow Answer | |
// Original Question: http://stackoverflow.com/questions/32635943/get-text-from-div-without-child-elements/32640258#32640258 | |
package main | |
import ( | |
"fmt" | |
"strings" | |
"github.com/PuerkitoBio/goquery" |
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
# Tạo trên tập dữ liệu 2 triệu tài liệu Tiếng Việt | |
# Xây dựng bằng cách tính IDF và chọn ra các từ có IDF nhỏ. | |
bị | |
bởi | |
cả | |
các | |
cái | |
cần | |
càng | |
chỉ |
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
package mapreduce | |
func MapReduce(mapper func(interface{}, chan interface{}), | |
reducer func(chan interface{}, chan interface{}), | |
input chan interface{}, | |
pool_size int) interface{} | |
{ | |
reduce_input := make(chan interface{}); | |
reduce_output := make(chan interface{}); | |
worker_output := make(chan chan interface{}, pool_size); |
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
// Copy big file from somewhere else | |
$src_filepath = 'http://example.com/all_the_things.txt'; $src = fopen($src_filepath, 'r'); | |
$tmp_filepath = '...'; $tmp = fopen($tmp_filepath, 'w'); | |
$buffer_size = 1024; | |
while (!feof($src)) { | |
$buffer = fread($src, $buffer_size); // Read big file/data source/etc. in small chunks | |
fwrite($tmp, $buffer); // Write in small chunks | |
} |
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
package main | |
import ( | |
"fmt" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"time" | |
) | |
type Person struct { |
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
type ( | |
// BuoyCondition contains information for an individual station. | |
BuoyCondition struct { | |
WindSpeed float64 `bson:"wind_speed_milehour"` | |
WindDirection int `bson:"wind_direction_degnorth"` | |
WindGust float64 `bson:"gust_wind_speed_milehour"` | |
} | |
// BuoyLocation contains the buoy's location. | |
BuoyLocation struct { |