Pozdravljeni, sem
Miha Smrekar
> razvijalec programske opreme
// avtomatizacija · integracije · aplikacije po naročilu
// moje delo je tudi na GitHubu:
const githubLink = "https://github.com/mihasm";
// datewise · engine.tsexport function addBusinessDays(date, n, code, country) {
const step = n >= 0 ? 1 : -1;
let remaining = Math.abs(n);
let cursor = date;
while (remaining > 0) {
cursor = cursor.plus({ days: step });
if (isBusinessDay(cursor, code, country)) remaining--;
}
return cursor;
}
// Python-BEM · bending_inertia.pydef calculate_centroid(x, y):
A = 0
Cx = 0
Cy = 0
n = len(x)
for i in range(n):
j = (i + 1) % n
cross = x[i] * y[j] - x[j] * y[i]
A += 0.5 * cross
Cx += (x[i] + x[j]) * cross
Cy += (y[i] + y[j]) * cross
return A, Cx / (6 * A), Cy / (6 * A)
// autosave-control · AutoSaveController.tsif (typeof textFileViewPrototype.requestSave === "function") {
this.originalRequestSave = this.unwrapWrappedFunction(
textFileViewPrototype.requestSave);
this.installedRequestSaveWrapper =
this.createRequestSaveWrapper(this.originalRequestSave);
textFileViewPrototype.requestSave =
this.installedRequestSaveWrapper;
}
// Python-BEM · bending_inertia.pydef PointsInCircum(r, n=1000):
"""Generates circle x,y coordinates."""
x_points = [math.cos(2 * pi / n * x) * r for x in range(0, n + 1)]
y_points = [math.sin(2 * pi / n * x) * r for x in range(0, n + 1)]
return x_points, y_points
// datewise · engine.tsexport function addBusinessDays(date, n, code, country) {
const step = n >= 0 ? 1 : -1;
let remaining = Math.abs(n);
let cursor = date;
while (remaining > 0) {
cursor = cursor.plus({ days: step });
if (isBusinessDay(cursor, code, country)) remaining--;
}
return cursor;
}
// Python-BEM · bending_inertia.pydef calculate_centroid(x, y):
A = 0
Cx = 0
Cy = 0
n = len(x)
for i in range(n):
j = (i + 1) % n
cross = x[i] * y[j] - x[j] * y[i]
A += 0.5 * cross
Cx += (x[i] + x[j]) * cross
Cy += (y[i] + y[j]) * cross
return A, Cx / (6 * A), Cy / (6 * A)
// autosave-control · AutoSaveController.tsif (typeof textFileViewPrototype.requestSave === "function") {
this.originalRequestSave = this.unwrapWrappedFunction(
textFileViewPrototype.requestSave);
this.installedRequestSaveWrapper =
this.createRequestSaveWrapper(this.originalRequestSave);
textFileViewPrototype.requestSave =
this.installedRequestSaveWrapper;
}
// Python-BEM · bending_inertia.pydef PointsInCircum(r, n=1000):
"""Generates circle x,y coordinates."""
x_points = [math.cos(2 * pi / n * x) * r for x in range(0, n + 1)]
y_points = [math.sin(2 * pi / n * x) * r for x in range(0, n + 1)]
return x_points, y_points
// datewise · engine.tsexport function addBusinessDays(date, n, code, country) {
const step = n >= 0 ? 1 : -1;
let remaining = Math.abs(n);
let cursor = date;
while (remaining > 0) {
cursor = cursor.plus({ days: step });
if (isBusinessDay(cursor, code, country)) remaining--;
}
return cursor;
}
// Python-BEM · bending_inertia.pydef calculate_centroid(x, y):
A = 0
Cx = 0
Cy = 0
n = len(x)
for i in range(n):
j = (i + 1) % n
cross = x[i] * y[j] - x[j] * y[i]
A += 0.5 * cross
Cx += (x[i] + x[j]) * cross
Cy += (y[i] + y[j]) * cross
return A, Cx / (6 * A), Cy / (6 * A)
// autosave-control · AutoSaveController.tsif (typeof textFileViewPrototype.requestSave === "function") {
this.originalRequestSave = this.unwrapWrappedFunction(
textFileViewPrototype.requestSave);
this.installedRequestSaveWrapper =
this.createRequestSaveWrapper(this.originalRequestSave);
textFileViewPrototype.requestSave =
this.installedRequestSaveWrapper;
}
// Python-BEM · bending_inertia.pydef PointsInCircum(r, n=1000):
"""Generates circle x,y coordinates."""
x_points = [math.cos(2 * pi / n * x) * r for x in range(0, n + 1)]
y_points = [math.sin(2 * pi / n * x) * r for x in range(0, n + 1)]
return x_points, y_points
// datewise · engine.tsexport function addBusinessDays(date, n, code, country) {
const step = n >= 0 ? 1 : -1;
let remaining = Math.abs(n);
let cursor = date;
while (remaining > 0) {
cursor = cursor.plus({ days: step });
if (isBusinessDay(cursor, code, country)) remaining--;
}
return cursor;
}
// Python-BEM · bending_inertia.pydef calculate_centroid(x, y):
A = 0
Cx = 0
Cy = 0
n = len(x)
for i in range(n):
j = (i + 1) % n
cross = x[i] * y[j] - x[j] * y[i]
A += 0.5 * cross
Cx += (x[i] + x[j]) * cross
Cy += (y[i] + y[j]) * cross
return A, Cx / (6 * A), Cy / (6 * A)
// autosave-control · AutoSaveController.tsif (typeof textFileViewPrototype.requestSave === "function") {
this.originalRequestSave = this.unwrapWrappedFunction(
textFileViewPrototype.requestSave);
this.installedRequestSaveWrapper =
this.createRequestSaveWrapper(this.originalRequestSave);
textFileViewPrototype.requestSave =
this.installedRequestSaveWrapper;
}
// Python-BEM · bending_inertia.pydef PointsInCircum(r, n=1000):
"""Generates circle x,y coordinates."""
x_points = [math.cos(2 * pi / n * x) * r for x in range(0, n + 1)]
y_points = [math.sin(2 * pi / n * x) * r for x in range(0, n + 1)]
return x_points, y_points