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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>SimpleFractal</title> | |
</head> | |
<body> | |
<canvas width="900" height="600"></canvas> | |
</body> |
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 MAX_CYCLES = 5; | |
var ACTING_ENERGY_LOSSES = 2; | |
var START_PLANT_ENERGY = 30; | |
var PLANT_REPRODUCTION_ENERGY = 10; | |
var PLANT_INCOMING_ENERGY = 2; |
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
public class Notificator { | |
public static Notification with(final Context context) { | |
return new Notification(context); | |
} | |
public static class Notification { | |
private final Context mContext; |
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
private static final int SECOND_MILLIS = 1000; | |
private static final int MINUTE_MILLIS = 60 * SECOND_MILLIS; | |
private static final int HOUR_MILLIS = 60 * MINUTE_MILLIS; | |
private static final int DAY_MILLIS = 24 * HOUR_MILLIS; | |
public static String getTimeAgo(long time, Context context) { | |
if (time < 1000000000000L) { | |
// if timestamp given in seconds, convert to millis | |
time *= 1000; | |
} |
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
#include <iostream> | |
#include <algorithm> | |
#include <cstring> | |
#include <climits> | |
#include <vector> | |
#include <set> | |
#include <ctime> | |
using namespace std; |
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
#include <iostream> | |
using namespace std; | |
void generate(int n, int k, int p) { | |
static int a[1000000]; | |
static int tmp = 1; | |
if (p == n) { | |
if (tmp == 1) { |
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
(defun generate (n k p) | |
(cond ((eq p n) | |
(cond ((eq count 1) | |
(loop for i from 0 to (- n 1) | |
do (format t "~D" (+ (elt arr i) 1))) | |
(format t "~%"))) | |
(cond ((< count k) (setq count (+ count 1))) | |
(T (setq count 1)))) | |
(T (loop for i from 0 to (- k 1) |
NewerOlder