Skip to content

Instantly share code, notes, and snippets.

View hyunsik's full-sized avatar
🏠
Working from home

Hyunsik Choi hyunsik

🏠
Working from home
View GitHub Profile
@hyunsik
hyunsik / row-batch.h
Created August 25, 2016 18:41
Row batch interface in Impala
class RowBatch {
...
TupleRow* ALWAYS_INLINE GetRow(int row_idx);
...
}
class Iterator {
public:
Iterator(RowBatch* parent, int row_idx, int limit = -1) :
TupleRow* IR_ALWAYS_INLINE Get();
@hyunsik
hyunsik / exec-node.h
Created August 25, 2016 18:28
Iteration Interface in Impala
class ExecNode {
...
virtual Status Init(const TPlanNode& tnode, RuntimeState* state);
virtual Status Prepare(RuntimeState* state);
virtual Status Open(RuntimeState* state);
virtual Status GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos) = 0;
virtual void Close(RuntimeState* state);
...
}
@hyunsik
hyunsik / intrinsics.rs
Created November 28, 2015 10:19
LLVM Intrinsics using Rust feature gate
#![feature(link_llvm_intrinsics)]
extern {
#[link_name = “llvm.sqrt.f32”]
fn sqrt(x: f32) -> f32;
}
fn main(){
unsafe { sqrt(32.0f32); }
}
@hyunsik
hyunsik / task2.rs
Last active October 13, 2015 10:50
A skeleton code for Rust Iterator that does not consume items
pub struct TaskSetRefIterator<'a>
{
....
}
impl<'a> Iterator for TaskSetRefIterator<'a> {
type Item = &'a Task;
fn next(&mut self) -> Option<&'a Task> {
None
@hyunsik
hyunsik / task.rs
Created October 13, 2015 10:35
Skeleton Code for Rust Iterator
pub struct TaskSet;
pub struct TaskSetIterator {
...
}
impl Iterator for TaskSetIterator {
type Item = Task;
fn next(&mut self) -> Option<Task> {
@hyunsik
hyunsik / test.rs
Last active October 11, 2015 08:11
fn get_arithm_prim(op: &ArithmOp,
res_ty: &Ty,
lhs_dty: &Ty, lhs_vec: bool,
rhs_dty: &Ty, rhs_vec: bool)
-> fn(&mut Vector, &Vector, &Vector, Option<&[usize]>) {
assert_eq!(lhs_dty, rhs_dty);
match lhs_dty.kind() {
TyKind::Int2 => get_arithm_vec_or_const::<INT2> (op, lhs_vec, rhs_vec),
@hyunsik
hyunsik / show-signature_again.sh
Created October 9, 2015 19:03
[Code Snippet for Blog] Git에서 GPG key로 signoff 하기 (6)
hyunsik@workstation:~/Code/tajo/tajo$ git log --show-signature
commit 5d470bc6001bb4fe096d7a8d221e51c18c683899
gpg: Signature made Thu 08 Oct 2015 03:21:24 PM PDT using RSA key ID 4CFE2390
gpg: Good signature from "Hyunsik Choi "
@hyunsik
hyunsik / edit-key.sh
Last active October 9, 2015 19:09
[Code Snippet for Blog] Git에서 GPG key로 signoff 하기 (5)
hyunsik@workstation:~/Code/tajo/tajo$ gpg --edit-key 4CFE2390 trust
gpg (GnuPG) 1.4.18; Copyright (C) 2014 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Secret key is available.
pub 4096R/AC3885B9 created: 2013-10-16 expires: 2017-10-16 usage: SCEA
trust: unknown validity: unknown
sub 4096R/4CFE2390 created: 2013-10-16 expires: 2017-10-16 usage: SEA
@hyunsik
hyunsik / show_signature.sh
Last active October 9, 2015 19:01
[Code Snippet for Blog] Git에서 GPG key로 signoff 하기 (4)
hyunsik@workstation:~/Code/tajo/tajo$ git log --show-signature
commit 6bc9fbb50fb8b45d3fd58d9f10f74fefe62106fe
gpg: Signature made Thu 08 Oct 2015 03:15:39 PM PDT using RSA key ID 4CFE2390
gpg: Good signature from "Hyunsik Choi <hyunsik@apach.o..>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 9141 BD40 6A84 DBA1 F4BD 5F04 024C 922A AC38 85B9
Subkey fingerprint: 1BB1 D697 599C 74BD C917 2F89 FE68 DD32 4CFE 2390
@hyunsik
hyunsik / commit_with_gpg_sign
Last active October 9, 2015 19:10
[Code Snippet for Blog] Git에서 GPG key로 signoff 하기 (3)
hyunsik@workstation:~/Code/tajo/tajo$ git commit -S -m "TAJO-1909: Eliminate remained explicit diamond expressions."</code>
You need a passphrase to unlock the secret key for
user: "Hyunsik Choi <hyunsik@apache.o....>"
4096-bit RSA key, ID 4CFE2390, created 2013-10-16 (main key ID AC3885B9)
[master 6bc9fbb] TAJO-1909: Eliminate remained explicit diamond expressions.
Author: Dongkyu Hwangbo <hwang....@gma......>;
Date: Thu Oct 8 15:02:58 2015 -0700
72 files changed, 150 insertions(+), 147 deletions(-)