This file contains 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
//solution('abc') should return ['ab', 'c_'] | |
//solution('abcdef') should return ['ab', 'cd', 'ef'] | |
function solution($str) { | |
$STR = str_split($str, 2); | |
foreach($STR as $key => $value){ | |
$value = str_pad($value, 2, "_", STR_PAD_RIGHT); |
This file contains 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
<!-- $this->assertEquals("TTTT", DNA_strand("AAAA")); | |
$this->assertEquals("AAAA", DNA_strand("TTTT")); | |
$this->assertEquals("TAACG", DNA_strand("ATTGC")); | |
$this->assertEquals("ATTGC", DNA_strand("TAACG")); | |
$this->assertEquals("CATA", DNA_strand("GTAT")); | |
$this->assertEquals("GTAT", DNA_strand("CATA")); --> | |
function DNA_strand($dna) { | |
$from= "ATCG"; | |
$to = "TAGC"; |
This file contains 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
'foo' . 42 = 'foo42'; | |
'foo' + 'Hi' = 0; | |
0 . 'qwe' = '0qwe'; | |
=== // равны и одного типа данных | |
new self(); // создаст экзекмпляр (объект) текущего класса |
This file contains 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> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> | |
<body> | |
<div ng-app="myApp" ng-controller="myCtrl"> | |
<h2 style="text-align: center;">Задача 1. Эксплутационные расходы ручной труд:</h2> | |
<p><b>Эр</b> = <i>{{Er | number : 3 }}</i> руб.</p> | |
<p><b>tчр</b> = <i>{{data.Oi * data.kt / 167 | number : 3 }}</i> руб.</p> | |
<input type="number" ng-model="data.k" min="0"> - переодичность решения задачи в течении года k.<br> |
This file contains 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> | |
<script> | |
function ajax_post(){ | |
// Create our XMLHttpRequest object | |
var hr = new XMLHttpRequest(); | |
// Create some variables we need to send to our PHP file | |
var url = "forms.html.php"; | |
var fn = document.getElementById("first_name").value; |
This file contains 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 | |
$file = 'index.json'; //куда сохраняем | |
if (file_get_contents("php://input")){ | |
$postdata = file_get_contents("php://input");// читаем данные в строку в raw формате | |
file_put_contents($file, $postdata, LOCK_EX); | |
} |
This file contains 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
<head> | |
<title>Calc</title> | |
<script> | |
function addition() { | |
// примводим к float типу, получаем значение из id 'k' и берем его значение.меняем запятую на точку | |
var k = parseFloat(document.getElementById('k').value.replace(',', '.')); | |
var kt = parseFloat(document.getElementById('kt').value.replace(',', '.')); | |
if (isNaN(k)==true) k=0; | |
if (isNaN(kt)==true) kt=0; |
This file contains 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 | |
if (isset($_POST['submit'])) { //если нажали клавишу | |
echo $_POST['name']; //выводим данные из формы поля name | |
var_dump(file_get_contents("php://input")); // читаем данные в строку переданные HTTP без обработки raw | |
} | |
?> | |
<form action="" method="POST"> | |
Введите ваше имя :<br> | |
<input type="text" name="name"> <br / > |
This file contains 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
$Friday = [ | |
'Один' => ["8.30-9.15", "Физическая культура", "Емельянов Александр Валентинович", "спортзал"], | |
'Два' => ["9.20-10.05", "Физическая культура", "Емельянов Александр Валентинович", "спортзал"], | |
'Три' => ["10.15-11.05", "Обработка отр. инф.", "Летов Евгений Геннадьевич", "3"], | |
'Четыре' => ["11.10-11.50", "Обработка отр. инф.", "Летов Евгений Геннадьевич", "3"], | |
'Пять' => ["12.35-13.20", "ММТ в образовании", "Леонова Надежда Ивановна", "2"], | |
'Шесть' => ["13.25-14.10", "ММТ в образовании", "Леонова Надежда Ивановна", "2"], | |
]; | |
foreach ($Friday as $key => $item) { |
This file contains 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
function cmp($a, $b) | |
{ | |
$a = date("dmY", strtotime($a)); | |
$b = date("dmY", strtotime($b)); | |
if ($a == $b) { | |
return 0; | |
} | |
return ($a < $b) ? -1 : 1; | |
} |
NewerOlder