See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
var denom = [ | |
{ name: 'ONE HUNDRED', val: 100.0 }, | |
{ name: 'TWENTY', val: 20.0 }, | |
{ name: 'TEN', val: 10.0 }, | |
{ name: 'FIVE', val: 5.0 }, | |
{ name: 'ONE', val: 1.0 }, | |
{ name: 'QUARTER', val: 0.25 }, | |
{ name: 'DIME', val: 0.1 }, | |
{ name: 'NICKEL', val: 0.05 }, | |
{ name: 'PENNY', val: 0.01 }, |
var re = | |
/^([+]?1[\s]?)?((?:[(](?:[2-9]1[02-9]|[2-9][02-8][0-9])[)][\s]?)|(?:(?:[2-9]1[02-9]|[2-9][02-8][0-9])[\s.-]?)){1}([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2}[\s.-]?){1}([0-9]{4}){1}$/; | |
function telephoneCheck(str) { | |
return re.test(str); | |
} | |
telephoneCheck('555-555-5555'); |
function rot13(str) { | |
const Acode = 'A'.charCodeAt(); | |
const Ncode = 'N'.charCodeAt(); | |
const Zcode = 'Z'.charCodeAt(); | |
return [...str] | |
.map(function (e) { | |
const code = e.charCodeAt(); | |
if (Acode <= code && code <= Zcode) { | |
if (code < Ncode) { | |
return String.fromCharCode(code + 13); |
function palindrome(str) { | |
let onlyLetters = str.replace( | |
/[`~ !@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, | |
'' | |
); | |
onlyLetters = onlyLetters.toLowerCase().split(''); | |
for (let i = 0; i < onlyLetters.length - 1 / 2; i++) { | |
if (onlyLetters[i] !== onlyLetters[onlyLetters.length - i - 1]) { | |
return false; | |
break; |
function convertToRoman(num) { | |
let romanString = ''; | |
while (num > 0) { | |
switch (true) { | |
case num > 999: | |
romanString = romanString.concat('M'); | |
num = num - 1000; | |
break; | |
case num > 899: | |
romanString = romanString.concat('CM'); |
#include <stdio.h> | |
#include <math.h> | |
#include <iostream> | |
#include <vector> | |
#include<gdiplus.h> | |
#include <GL/glut.h> | |
using namespace std; | |
int minX, minY, maxX, maxY; |
#include <stdio.h> | |
#include <math.h> | |
#include <iostream> | |
#include <vector> | |
#include<gdiplus.h> |
#include<stdlib.h> | |
#include<stdio.h> | |
#include <GL/gl.h> | |
#include <GL/glut.h> | |
float x1, x2, y1, y2; | |
void display(void) { | |
float dy, dx, step, x, y, k, Xin, Yin; | |
dx = x2 - x1; |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <GL/gl.h> | |
#include <GL/glut.h> | |
int x0, y0, xn, yn; | |
void display(void) { | |
int x, y, dx, dy, pk, k; | |
glBegin(GL_POINTS); |