Skip to content

Instantly share code, notes, and snippets.

item_subtotal = 465.777
item_subtotal = 465.77
employee_discount = 46.58
monitor_price = 396.77
adapter_price = 69.00
monitor_price_ratio = monitor_price / item_subtotal
adapter_price_ratio = adapter_price / item_subtotal
monitor_discount = monitor_price_ratio * employee_discount
adapter_discount = adapter_price_ratio * employee_discount
monitor_discount = 39.67955557463984
@jophde
jophde / grubconfig
Created February 13, 2020 07:18
passthrough config
# GRUB boot loader configuration
GRUB_DEFAULT='Advanced options for Arch Linux>Arch Linux, with Linux linux'
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on intel_pstate=disable default_hugepagesz=1G hugepagesz=1G hugepages=8 kvm.nx_huge_pages=off intremap=no_x2apic_optout"
GRUB_CMDLINE_LINUX=""
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

Keybase proof

I hereby claim:

  • I am jophde on github.
  • I am jophde (https://keybase.io/jophde) on keybase.
  • I have a public key whose fingerprint is EE49 BC99 0750 8888 D2A4 3019 543C 928F EA35 B663

To claim this, I am signing this object:

@jophde
jophde / Owned
Created June 18, 2014 21:52
Ownage
06-18 17:46:47.454: D/BabelSdk(1956): loaded view tree
06-18 17:46:47.564: D/BabelSdk(1956): android.widget.TextView{b106ba68 V.ED.... ........ 237,276-482,314 #7f0b0005 app:id/babelTextView}
06-18 17:46:47.564: D/BabelSdk(1956): BabelTextView
06-18 17:46:47.564: D/BabelSdk(1956): Matched text key: label_sample_text_view
06-18 17:46:47.564: D/BabelSdk(1956): BabelTextView Hint
06-18 17:46:47.564: D/BabelSdk(1956): Matched hint key: hint_sample_text_view
06-18 17:46:47.564: D/BabelSdk(1956): android.widget.Button{b1051a68 VFED..C. ........ 238,330-482,426 #7f0b0006 app:id/babelButton}
06-18 17:46:47.564: D/BabelSdk(1956): BabelButton
06-18 17:46:47.564: D/BabelSdk(1956): Matched text key: label_sample_button
06-18 17:46:47.564: D/BabelSdk(1956): android.widget.CheckBox{b1052b60 VFED..C. ........ 217,442-502,506 #7f0b0007 app:id/babelCheckBox}
06-17 15:34:04.035 2748-2748/com.babelsdk.sample D/BRes﹕ loaded view tree
06-17 15:34:04.045 2748-2748/com.babelsdk.sample D/BRes﹕ android.widget.TextView{b1073a80 V.ED.... ......ID 0,0-0,0 #7f0a0005 app:id/babelTextView}
06-17 15:34:04.045 2748-2748/com.babelsdk.sample D/BRes﹕ BabelTextView
06-17 15:34:04.045 2748-2748/com.babelsdk.sample D/BRes﹕ android.widget.Button{b105f6f0 VFED..C. ......I. 0,0-0,0 #7f0a0006 app:id/babelButton}
06-17 15:34:04.045 2748-2748/com.babelsdk.sample D/BRes﹕ android.widget.CheckBox{b1057410 VFED..C. ......ID 0,0-0,0 #7f0a0007 app:id/babelCheckBox}
06-17 15:34:04.045 2748-2748/com.babelsdk.sample D/BRes﹕ android.widget.RadioButton{b10ac290 VFED..C. ......ID 0,0-0,0 #7f0a0008 app:id/babelRadioButton}
06-17 15:34:04.045 2748-2748/com.babelsdk.sample D/BRes﹕ android.widget.EditText{b109f648 VFED..CL ......I. 0,0-0,0 #7f0a0009 app:id/babelEditText}
06-17 15:34:04.045 2748-2748/com.babelsdk.sample D/BRes﹕ android.widget.ImageView{b1061978 V.ED.... ......I. 0,0-
"aTimeTags": {
"36960": {
"idTimeTag": "36960",
"idVenue": "10",
"iStartHour": "4",
"iEndHour": "11",
"sName": "Morning",
"sAddDate": "2012-12-04 07:05:14"
},
"36961": {
@jophde
jophde / Yelp.txt
Created October 30, 2012 21:20
IRB Yelp Gem Dump
irb(main):001:0> require 'yelp'
SyntaxError: /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yelp-1.0.0/lib/yelp/request.rb:37: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n'
when Yelp::ResponseFormat::PICKLE: params[:output] = 'pickle'
^
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yelp-1.0.0/lib/yelp/request.rb:38: syntax error, unexpected keyword_when, expecting keyword_end
when Yelp::ResponseFormat::PHP: params[:output] = 'php'
^
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/yelp-1.0.0/lib/yelp/request.rb:38: syntax error, unexpected ':'
when Yelp::ResponseFormat::PHP: params[:output] = 'php'
^
@jophde
jophde / Server.java
Created January 2, 2012 21:30
Singleton
package com.roqbot.client;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
@jophde
jophde / MyBasicAdapter.java
Created November 9, 2011 22:46
ListView Adapter
private class VenuesAdapter extends BaseAdapter implements ListAdapter {
private final JSONArray venues;
private VenuesAdapter(JSONArray venues) {
assert venues != null;
this.venues = venues;
}
private class VenuesAdapter extends BaseAdapter implements ListAdapter {
private JSONArray venues;
private VenuesAdapter(JSONArray venues) {
assert venues != null;
this.venues = venues;
}
@Override