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
bot.on('callback_query', function (msg) { | |
var answer = []; | |
answer.push(msg.data); | |
if (questions[0].quetions_number == 2) { | |
day_subjects(msg);//это функция | |
} else if(answer.length == 3) { | |
bot.sendMessage(msg.from.id, subject_info); | |
} |
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
var fs = require('fs'); | |
function parceReturn () { | |
fs.readFile('subjects.json', 'utf8', function (err, data) { | |
if (err) throw err; // we'll not consider error handling for now | |
var obj = JSON.parse(data); | |
console.log(obj.kn_38a.monday.subject.first.time); | |
}); | |
}; |
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
{ | |
"kn_38a": { | |
"monday": { | |
"subject": { | |
"first": { | |
"name": "Архітектура обчислювальних систем", | |
"classroom": "504 У2", | |
"type": "Лекція", | |
"lector": "Шевченко С В", | |
"time": "10:25 - 12:00" |
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 | |
/** | |
* Created by PhpStorm. | |
* User: vadem | |
* Date: 4/16/18 | |
* Time: 6:50 PM | |
*/ | |
header('Content-Type: text/html; charset=utf-8'); | |
// подрубаем API |
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 | |
echo("<table>"); | |
echo("<tr>"); | |
echo("<th>X</th>"); | |
for($k=1;$k<10;$k++) | |
{ | |
echo("<td align='center'><b>".$k."</b></td>"); | |
} | |
echo("</tr>"); |
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
SELECT name_c,sum(bill) FROM Customers GROUP BY name_c; |
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
//сначала создал новую таблицу | |
CREATE TABLE new_table ( | |
name VARCHAR(255) NOT NULL, | |
surname VARCHAR(255) NOT NULL, | |
UNIQUE KEY name_surname (name,surname) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
//после заполнил созданную таблицу данными из исходной таблицы | |
INSERT INTO new_table (new_table.name, new_table.surname) SELECT table.name, table.surname |
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
SELECT max(salary) FROM Employers WHERE slary < (SELECT max(slary) FROM Employers) |
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 | |
$day = 2; | |
switch ($day){ | |
case 1: | |
case 2: | |
case 3: | |
case 4: | |
case 5: | |
echo 'Work day'; |
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 | |
$bmw = ['model'=>'X5','speed'=>'120','doors'=>'5','year'=>'2006']; | |
$toyota = ['model'=>'Carina','speed'=>'130','doors'=>'4','year'=>'2007']; | |
$opel = ['model'=>'Corsa','speed'=>'140','doors'=>'5','year'=>'2007']; | |
$cars = [$bmw,$toyota,$opel]; | |
foreach ($cars as $mark){ | |
foreach ($mark as $key => $value){ | |
if($key == 'year'){ | |
echo $value; |
NewerOlder