I prefer this
var distance = metersToNauticalMiles(
utils.getDistance(
utils.toPoint(coordinates.get(0)),
utils.toPoint(coordinates.get(1))
)
);
I prefer this
var distance = metersToNauticalMiles(
utils.getDistance(
utils.toPoint(coordinates.get(0)),
utils.toPoint(coordinates.get(1))
)
);
Here's a very simple controller and service. The service can be turned on and off with a checkbox.
<body ng-app="App">
<div ng-controller="MyController">
<input type="checkbox" ng-model="enabled">
</div>
</body>
// Use Case: | |
// | |
// Say you have a bunch of decoupled components which access the same set of databases. | |
// Since database/sql does connection pooling it makes sense for the components to share instances of *sql.DB | |
// This package lets you do that with minimal code changes. | |
package dbmanager | |
import ( | |
"database/sql" | |
"time" |
I hereby claim:
To claim this, I am signing this object:
There is a 1-to-1 relationship between ids and items.
with item_ids as (
select 1 as id
union select 2
union select 3
union select 4
union select 5
union select 6
Js style (one of many):
// constructor
var Foo = function () {};
// private
Foo.prototype._poo = function () {};
// public
/** | |
* 1. Go to this page: https://my.playstation.com/logged-in/trophies/public-trophies/ (using google chrome) | |
* 2. Right click on the page and select "inspect element" | |
* 3. Go to the "console" tab. | |
* 4. Change the names below with the ones you want to test | |
* 5. Copy/Paste the following script in the console and hit "enter". | |
*/ | |
(function () { |
// in C++ | |
class Foo { | |
int a; | |
int b; | |
void set_a(int a) { | |
this->a = a; | |
} | |
typedef struct { | |
int *data; // array | |
int cap; // capacity | |
int len; // length | |
} Vector; | |
Vector * vector_create(int length, int capacity) { | |
Vector *v = malloc(sizeof(Vector)); | |
if (v == NULL) { |
#!/usr/bin/env | |
from datetime import datetime | |
import matplotlib.pyplot as plt | |
def main(): | |
lines = open("commits.txt").read().split("\n") | |
lines = [l.split(",") for l in lines] | |
lines = [l for l in lines if l[0].strip() != ''] |