about summary refs log tree commit diff stats
path: root/313index-bounds-check.subx
Commit message (Expand)AuthorAgeFilesLines
* start double-bufferingKartik K. Agaram2021-05-181-6/+2
* always check for null in 'index' instructionsKartik K. Agaram2021-05-071-0/+3
* always check for null in 'get' instructionsKartik K. Agaram2021-05-071-0/+3
* shell: highlight matching close-parenKartik K. Agaram2021-04-091-1/+0
* 7842 - new directory organizationKartik K. Agaram2021-03-031-45/+19
* 7525Kartik Agaram2021-01-161-0/+2
* 7261 - mu.subx: array bounds-checking doneKartik Agaram2020-11-171-0/+84
nt-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
// can I go freelance?
// doing some math to see if I can afford to go freelance, or what it'd take to do it

// r is hourly rate
// h is hours per week
// w is weeks per year
// ws is weeks of savings
// returns object with income, savings, and tax where income is after tax and savings are subtracted

const a = (r, h, w, ws) => {
  let income = (r * h) * w;
  const tax = income * 0.16; // as of 2024 actual tax rate is more like 15.3%, but I'm rounding to 16%
  income -= tax;
  const savings = ws * w;
  income -= savings;
  return {
    income: income,
    savings: savings,
    tax: tax,
  };
};

const m = a(125, 24, 48, 300); // $125/hr, 24 hours/week, 48 weeks/year, saving $300 a week
console.log(
  `annual income: $${m.income}, annual savings: $${m.savings}, annual tax: $${m.tax}`,
);

const n = a(100, 30, 48, 300); // $100/hr, 30 hours/week, 48 weeks/year, saving $300 a week
console.log(
  `annual income: $${n.income}, annual savings: $${n.savings}, annual tax: $${n.tax}`,
);

const o = a(75, 30, 48, 300); // $75/hr, 40 hours/week, 48 weeks/year, saving $300 a week
console.log(
  `annual income: $${o.income}, annual savings: $${o.savings}, annual tax: $${o.tax}`,
);