This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IPADDR=`ifconfig -a | grep -A1 ed0 | grep inet | awk '{ print $2 }'` | |
LASTIP=`nslookup canth.dtdns.net ns1.darktech.org | grep -A1 canth | | |
grep Address | awk '{ | |
print $2 }'` | |
echo -n "`date` - " | |
if [ "$IPADDR" != "$LASTIP" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::File; | |
fn main(){ | |
let path = Path::new("e.txt"); | |
let display = path.display(); | |
let mut e = 0f64; | |
let mut k = 1f64; | |
let mut count = 0f64; | |
let a = 1.0_f64; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main(){ | |
let mut pi = 0f64; | |
let mut n = 0u64; | |
let mut a = 1f64; | |
let mut b = 1f64; | |
let mut k = 0f64; | |
loop { | |
a = inv(-1f64, n); | |
b = inv(4f64, n); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Возводит матрицу a в степень n в кольце r | |
*/ | |
function power(a, n, r){ | |
'use strict'; | |
/** | |
* Возвращает нулевую квадратную матрицу рамера s | |
*/ | |
// var makeNull = (s) => new Array(s).fill(new Array(s).fill(0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'); | |
/** | |
* Dijkstra algorithm | |
* | |
* @param g {Array} | |
* @param start {Number} | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
(function Kuhn(k, n, g) { | |
var m = new Array(k), | |
used = new Array(n); | |
function pair(v) { | |
// used[v] = true; | |
// for (let i = 0; i < n; i++) { | |
// let to = g[v][i]; | |
// if (m[to] == null || Kuhn(m[to])) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var fs = require('fs'); | |
/** | |
* Breadth-first search | |
* @param m {Array} | |
* @param s {Number} | |
*/ | |
function BFS(m, s) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'); | |
function Ford(m, s, f) { | |
let mf = new Array(m.length).fill(new Array(m.length).fill(0)); | |
let link = new Array(m.length).fill(0); | |
let flow = new Array(m.length).fill(0); | |
function findPath(s, f) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
class MaxFlowFordFulkerson { | |
static int[][] capacity = { { 0, 3, 2 }, { 0, 0, 2 }, { 0, 0, 0 } }; | |
public static int maxFlow(int s, int t) { | |
for (int flow = 0;;) { | |
int df = findPath(new boolean[capacity.length], s, t, Integer.MAX_VALUE); | |
if (df == 0) { | |
return flow; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FordFulkerson { | |
val capacity = Array( | |
Array(0, 1, 0), | |
Array(0, 0, 2), | |
Array(0, 0, 0) | |
) | |
def main(args: Array[String]): Unit = { | |
println(maxFlow(0, 2)) | |
println(capacity.deep.mkString("\n")) |
OlderNewer