Skip to content

Instantly share code, notes, and snippets.

View Eternity-Yarr's full-sized avatar
😵‍💫
i have a spiral eyes

Dmitry V. Roenko Eternity-Yarr

😵‍💫
i have a spiral eyes
View GitHub Profile
use std::io::BufReader;
use std::io::BufRead;
use std::fs::File;
fn main() {
let file = File::open("main.rs").unwrap();
let reader = BufReader::new(file);
for line in reader.lines()
.filter_map(|x| x.ok()) {
import io.circe.{Decoder, DecodingFailure}
import io.circe.parser._
import io.circe.generic.auto._
import cats.syntax.xor._
object Test extends App {
val unionA = "{\"union\" : { \"a\" : { \"a1\": 1, \"a2\": \"two\" } } }"
val unionB = "{\"union\" : { \"b\" : { \"b1\": \"type\", \"b2\": 2 } } }"
public static int[] initializeArray()
{
int[] numbers = new int[20];
Scanner in = new Scanner(System.in);
for (int i = 0; i < numbers.length; i++) {
numbers[i] = in.nextInt();
}
return numbers;
// берем из таблицы список ip адресов (тут можно и WHERE добавить)
$result = mysqli_query("SELECT ip_address FROM devices", $link);
if ($result) { // если список есть
$ok = $bad = Array(); // в этих массивах будем хранить списки адресов после проверки
while ($row = mysqli_fetch_assoc($result)) { // прокручиваемся через него по одному <-- здесь использовался не правильная функция
exec("ping -c 1 " . $row["ip_address"], $output, $execResult); // пингуем адрес <-- вот здесь перезаписывалась переменная
if ($execResult == 0) { // в зависимости от результатов пинга заносим адрес в массив
$ok[] = $row["ip_address"];
} else {
$bad[] = $row["ip_address"];
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
#!/bin/bash
# chkconfig: 2345 90 90
# description: topaz
### BEGIN INIT INFO
# Provides: topaz
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start the program
### END INIT INFO
<html>
<head>
<style type="text/css">
* {
padding: 0;
margin: 0 0;
}
.wrapper
{
height: 100%;
@Eternity-Yarr
Eternity-Yarr / RLFSolver.java
Created March 28, 2014 12:06
Simple RLF graph coloring solver
import java.util.*;
public class RLFSolver {
public static List<Vertex> getCandidates(Graph g)
{
List<Vertex> candidates;
List<Vertex> included = new ArrayList<>();
List<Vertex> excluded = new ArrayList<>();
Random r = new Random();
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
public class Tree
{
public class Node
{
public List<Node> childList = new LinkedList<>();

p>.Иосиф Александрович Бродский

p.
Не выходи из комнаты, не совершай ошибку.
Зачем тебе Солнце, если ты куришь Шипку?
За дверью бессмысленно все, особенно – возглас счастья.
Только в уборную – и сразу же возвращайся.
p.
О, не выходи из комнаты, не вызывай мотора.
Потому что пространство сделано из коридора