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 hashlib | |
import time | |
text = "Hello World!" | |
nonce = 0 | |
difficulty = "0" | |
start = time.time() | |
print("Nonce".ljust(16) + "Hash".ljust(70) + "Time") | |
while True: |
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 'package:flutter/material.dart'; | |
import 'package:english_words/english_words.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Startup Name Generator', |
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
<?php | |
function isPalindromA($num) { | |
$num = $num . ''; | |
$len = strlen($num); | |
for($i = 0; $i < $len / 2; $i++) | |
if($num[$i] !== $num[$len - 1 - $i]) | |
return false; | |
return true; |
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
<?php | |
class Circle { | |
private $_center; | |
private $_radius; | |
public function __construct(Point $center, $radius) { | |
$this->_center = $center; | |
$this->_radius = $radius; | |
} |
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
<?php | |
/** | |
* Converts decimal numbers to Roman numerials. | |
* Limit [1; 3999] | |
* | |
* @param integer $n | |
* @param bool $recursive | |
* @return string | |
*/ | |
function decroman($n, $recursive = false) { |
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
<?php | |
$input = file_get_contents($argv[1]); | |
$rows = explode("\n", $input); | |
foreach($rows as $row) { | |
if($row >= 0 && $row <= 3000000000) { | |
$bin = decbin($row); | |
$sum = 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
<?php | |
/** | |
* Polynomial class makes possible to do simple operations like additions, subtractions and | |
* multiplications on polynomials. | |
* | |
* There are two ways to initiate a Polynomial object: from string or from array. | |
* | |
* @package fintara | |
* @author Tsvetan Ovedenski <[email protected]> | |
*/ |
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
<?php | |
/** | |
* Напишете програма, която намира максимална редица от последователни еднакви елементи в масив. | |
* Пример: {2, 1, 1, 2, 3, 3, 2, 2, 2, 1} -> {2, 2, 2}. | |
*/ | |
$array = [2,1,1,2,3,3,2,2,2,1]; | |
//$array = [3,1,1,1,1,1,5,1,1,1,1,2,3,3,3]; | |
$bestStart = 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
<?php | |
/** | |
* Maze.php | |
* | |
* We are given a matrix, in which we should count the steps of a path of a given number. | |
* | |
* @author Tsvetan Ovedenski | |
*/ | |
// matrix |
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
<?php | |
namespace Sort; | |
class QuickSorter { | |
private $_array; | |
public function __construct(array $array) { | |
$this->_array = $array; | |
} |
NewerOlder