Skip to content

Instantly share code, notes, and snippets.

View binfeng's full-sized avatar
🎯
Focusing

Alex binfeng

🎯
Focusing
  • UIUC
  • Urbana-Champaign
View GitHub Profile
test
public class HelloYaml {
@SuppressWarnings("unchecked")
public static void main(String[] args) throws FileNotFoundException {
Yaml yaml = new Yaml();
System.out.println(yaml.dump(yaml.load(new FileInputStream(new File(
"hello_world.yaml")))));
Map<String, Map<String, String>> values = (Map<String, Map<String, String>>) yaml
.load(new FileInputStream(new File("hello_world.yaml")));
@binfeng
binfeng / q_example.js
Last active August 29, 2015 14:04 — forked from Heshyo/q_example.js
// Q sample by Jeff Cogswell
/*===========
We want to call these three functions in sequence, one after the other:
First we want to call one, which initiates an ajax call. Once that ajax call
is complete, we want to call two. Once two's ajax call is complete, we want to call three.
BUT, we don't want to just call our three functions in sequence, as this quick
demo will show. Look at this sample function and think about what order
@binfeng
binfeng / autopush.sh
Created June 11, 2015 07:45
Auto commit and push to Github (experimental)
#!/bin/bash
#eval "$(ssh-agent -s)"
#SERVICE='ssh-agent'
#if ps ax | grep -v grep | grep $SERVICE > /dev/null
#then
# :
# #echo "$SERVICE service running, everything is fine"
#else
public class Solution {
/**
* @param s : A string
* @return : The length of the longest substring
* that contains at most k distinct characters.
*/
public int lengthOfLongestSubstringKDistinct(String s, int k) {
// write your code here
if(s == null || s.length() == 0 || k == 0){
return 0;
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQWwoi1G1sVabi7NqiJCA508F_gQfFcDCkYJDCQZBI-qoH4aDYD&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSxxsnL9vRrZW3QGvjmIb3Vv-dtS0uYdrtujmt3fyS_1ywJNIjQ&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTKNSckJYRjPn29yVJmLfoPeJUqzJM3Wd5BLQZju9saWrldrjfZ&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSfUb_qXtUXGTjs4iXNjKrV5QLlt6U2Hw0nHmQTbE-75HUharef&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTkHk6ZwC26QtpH-LFnCQa5i8W0NoLfeKEtmzI6AKiiW2G8x7Ab&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSXQlVmYDrHEn6xxX3Mxc7Qxlfh4bFJDvRL00d050i3_vW6xr1-&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQUwkBVqmB0UxJL-r5eG9oAZsmrHlDrQ-bgrdaGkElYSX_YNbrM&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRzE5nbWXj_ztwD1UyPg_Dnhn42OtAk6koiSaMkm7IE_d7_-yi2&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRd0dS0Tkh_LCv1ZbXKSgXdZq7KFXTyLEJKUIY58C
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcS5fjS9GP52Bfw-hSX0YKtWj6B3EgfWBtfOo60zoUQA2jvIpoit&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQt0si_OJ_DQ08g63E6UvZM8uLpN1wqP8aHLYcHTzOb6NVOR3zN&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQ6XmlzhC1B3J1WAErMuENO6vcYoN4mwWsWFliMd82bTMN9U7jG&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRM2tx7bqi9y_Ya5d2MUwi2oa-iySARSbD0AbG64nvnbcvcHPae&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcR4v3evj2RI4UxUUZ0LrDOW8WTgLikU3wnBXdPAXLcA6_aWPl8m&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcT4LAJ_1Pi0nzuklkIkpqDQXH6zYbp2a-jkhYRQOC-suve-fY3J&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSbhPusTRpNE6ySeMCQX57EcSKchl7ZUBEb8YYisEZahTvzaNGG&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSVCYw0EqZBZLObJ1p51rTgBkUAmIywAPA1vgjBaIyobJRWaLES&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcR09d7gKdKDnfuNTHoohFkkWUKgvBNre4coJeCx_N
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRVktyB3n5ITjzLuW2CyzlQ6XfgaZj7soOh_EKZycDc1fpAiQR0&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcT1byJyRa2S21HxALb05x0kmSWZUCgzydFx8lvMX0YAKvxj9TD2&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQ27cL4KFkZYGD0qLHX1oTavQheAG4WFXSZ1-fO3BIOYk5qVGwv&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTIDZ1hIrtPG_pDdaIbMbaNWkSbX8dciOKXo9q8FSsynGS4nTk0&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSY0EZ7dJFV-FQ_URKPCLDgF7HjutC8jDhmju0_CJp8v2GBWAcb&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSOoIg23-ltbr_Zv7COvJKSrGp2_JKhCdSY8GIx2UgQSO4WohI6&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSoHV36f2Z6ldVG0aHh-5DlU4WY0P6gu67LUi177rTHJMQ7hGjN&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTSi-ZAtLvDj9a27vz3N54Flkjnds0NJSL7TKwUxyLxNiHC2P24&usqp=CAU
https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTR-zIjamhxQDKRcC4eZ2_0iE-s2OOmgm0kRStI5_