Skip to content

Instantly share code, notes, and snippets.

View ysonggit's full-sized avatar
🇺🇦

Yang Song ysonggit

🇺🇦
View GitHub Profile
@ysonggit
ysonggit / kafka-change-replication-factor
Created November 21, 2023 10:16 — forked from bb01100100/kafka-change-replication-factor
Change the replication factor for an existing Kafka topic by nominating a new set of replicas
#!/bin/bash
# Author: Kel Graham
# Date: 2022-05-19
# Purpose: Increase the replication factor of one or more topics, using only
# a connection to the Kafka broker (no Zookeeper, REST APIs etc)
# and the standard kafka-topics, kafka-reassign-partitions scripts
# that come with Kafka.
#
@ysonggit
ysonggit / LC_CTYPE.md
Created August 4, 2022 13:53 — forked from nicks9188/LC_CTYPE.md
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
  1. vi /etc/environment

add these lines...

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Alternatively,

@ysonggit
ysonggit / install_gtest_gmock.sh
Created April 3, 2020 17:19 — forked from dlime/CMakeLists.txt
Install Google Test and Google Mock on Ubuntu
cd ~
git clone https://github.com/google/googletest.git
cd googletest
mkdir build && cd build
cmake .. -DBUILD_SHARED_LIBS=ON -DINSTALL_GTEST=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr
make -j8
sudo make install
sudo ldconfig

https://www.mlpack.org/doc/mlpack-git/doxygen/cli_quickstart.html

wget https://www.mlpack.org/datasets/covertype-small.data.csv.gz
wget https://www.mlpack.org/datasets/covertype-small.labels.csv.gz
gunzip covertype-small.data.csv.gz covertype-small.labels.csv.gz
# Split the dataset; 70% into a training set and 30% into a test set.
# Each of these options has a shorthand single-character option but here we type
@ysonggit
ysonggit / gist:50925a134c1cb1d5c5b47caa4363339c
Created January 14, 2019 18:33 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
class CasandraSpec extends FunSuite
with Eventually
with BeforeAndAfterAll
with LocalSparkContext
with EmbeddedCassandra
with Logging{
val testKeyspace = "test1"
val testTable = "table1"
var conn: CassandraConnector = _
class Solution {
public:
void dfs(vector<vector<int> >& res, vector<int>& candidates, vector<int> sol, int target, int cur_idx){
if(target==0){
res.push_back(sol);
return;
}
if(cur_idx>=candidates.size() || target < 0) return;
for(int i=cur_idx; i<candidates.size(); i++){
if(i> cur_idx && candidates[i]==candidates[i-1]) continue; // mistake : candidates[i]==candidates[cur_idx]