Skip to content

Instantly share code, notes, and snippets.

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

Bryan Ibe nnaemekaibe

🏠
Working from home
View GitHub Profile
@jonlabelle
jonlabelle / npm_vs_yarn_command_translation_cheatsheet.md
Last active March 11, 2025 18:53
npm vs yarn command translation cheat sheet
@ipcjs
ipcjs / PhoneUtil.java
Created January 7, 2016 08:13
打/接/挂电话
package com.ipcjs.musiccontroler;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Build;
import android.os.SystemClock;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)