Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Pancy jochasinga

🏠
Working from home
View GitHub Profile
View credit_risk_dataset.csv
person_age person_income person_home_ownership person_emp_length loan_intent loan_grade loan_amnt loan_int_rate loan_status loan_percent_income cb_person_default_on_file cb_person_cred_hist_length
22 59000 RENT 123.0 PERSONAL D 35000 16.02 1 0.59 Y 3
21 9600 OWN 5.0 EDUCATION B 1000 11.14 0 0.1 N 2
25 9600 MORTGAGE 1.0 MEDICAL C 5500 12.87 1 0.57 N 3
23 65500 RENT 4.0 MEDICAL C 35000 15.23 1 0.53 N 2
24 54400 RENT 8.0 MEDICAL C 35000 14.27 1 0.55 Y 4
21 9900 OWN 2.0 VENTURE A 2500 7.14 1 0.25 N 2
26 77100 RENT 8.0 EDUCATION B 35000 12.42 1 0.45 N 3
24 78956 RENT 5.0 MEDICAL B 35000 11.11 1 0.44 N 4
24 83000 RENT 8.0 PERSONAL A 35000 8.9 1 0.42 N 2
@jochasinga
jochasinga / DemoFingerprintActivity.java
Created Oct 3, 2019
Example of HeadSpin's HSFingerprintManager usage
View DemoFingerprintActivity.java
/*-
* #%L
* Demo Fingerprint Authentication Activity
* %%
* Copyright (C) 2019 Headspin Inc.
* %%
* #L%
*/
package com.nextunicorn.app;
View zipcode.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jochasinga
jochasinga / fork_and_wait.c
Created Mar 22, 2019
Fork and wait system calls
View fork_and_wait.c
include <stdio.h>
include <stdlib.h>
include <unistd.h>
include <sys/wait.h>
int main(int argc, char *argv[])
{
printf("hello world (pid:%d)\n", (int) getpid());
int rc = fork();
// Fork failed, let's exit.
View refactor3.js
const baseConfig = {
mode: "cors",
cache: "no-cache",
credentials: "same-origin",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
redirect: "follow",
referrer: "no-referrer",
};
View refactor2.js
const baseConfig = {
mode: "cors",
cache: "no-cache",
credentials: "same-origin",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
redirect: "follow",
referrer: "no-referrer",
};
@jochasinga
jochasinga / refactor1.js
Last active Mar 7, 2019
Step one in refactor
View refactor1.js
async function postLoginData(data) {
const loginUrl = `${apiBaseUrl}/login`;
let response = await fetch(loginUrl, {
method: "POST",
mode: "cors",
cache: "no-cache",
credentials: "same-origin",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
@jochasinga
jochasinga / newton-sqrt.scm
Created Nov 19, 2018
Newton's method of finding a square root
View newton-sqrt.scm
(define (square-of x)
(define (average x y)
(/ (+ x y) 2))
(define (improve guess x)
(average guess (/ x guess)))
(define (good-enough? guess x)
(< (abs (- (square-of guess) x)) 0.001))
(define (sqrt-iter guess x)
(if (good-enough? guess x)
guess
@jochasinga
jochasinga / newton.csv
Created Nov 19, 2018
Table demonstrating Newton's square root method derivation
View newton.csv
Guess Quotient Average
1 2/1 = 2 (2 + 1)/2 = 1.5
1.5 2/1.5 = 1.3333 1.3333 + 1.5/2 = 1.4167
1.4167 2/1.4167 = 1.4118 (1.4167 + 1.4118)/2 = 1.4142
1.4142 ... ...
View two_mod.ml
module State = struct
type t = int
let inc (n: t) = Transformer.inc n
end
;;
module Transformer = struct
let inc (n: State.t) = n + 1
end
;;