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
import std.net.curl, std.stdio; | |
import std.algorithm, std.regex; | |
void main() { | |
get("http://www.stroustrup.com/C++.html") | |
.matchAll(`<a.*?href="(.*)"`) | |
.map!(m => m[1]) | |
.each!writeln(); | |
} |
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
# -*- coding: utf8 -*- | |
# Этот модуль нужен для синхронизации ДВУХ БД с заявками! | |
# PostgreSQL <==> FireBird | |
# Не забыть поставить psycopg2 (stand alone installer, через PIP не ставится) | |
import os | |
import gvar | |
import psycopg2 | |
import sys | |
import fdb |
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
for (var question of this.questions) | |
{ | |
var firstLevelAnswerIsSelectedCount = 0; // будет накапливать значения всех, что вовпросов в первом уровне вложенности | |
for(var answer of question.answers) | |
{ | |
if (answer.isSelected) | |
{ | |
console.log('Before: ', answer.isSelected); | |
firstLevelAnswerIsSelectedCount++; | |
console.log(firstLevelAnswerIsSelectedCount); |
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 : function() | |
{ | |
var iLevel = 0; | |
for (var question of this.questions) | |
{ | |
for(var answer of question.answers) | |
{ | |
processOneQuestion(answer) | |
} |
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
"use strict"; | |
var guestContent = Vue.extend({ | |
template: ` | |
<p>Guest content</p> | |
<div v-for="question in questions"> | |
<template v-if="question.isEnabled"> | |
<h3 v-if="question.isEnabled">{{question.question}}</h3> |
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
"use strict"; | |
var guestContent = Vue.extend({ | |
props: ['value','min','max','step'], | |
template: ` | |
<p>Guest content</p> | |
<div v-for="question in questions"> | |
<template v-if="question.isEnabled"> | |
<h3 v-if="question.isEnabled">{{question.question}}</h3> |
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
postQuestionsContent : function() | |
{ | |
this.$http.post('http://127.0.0.1:8080/questions', JSON.stringify(this.questions)).then(function(response) | |
{ | |
console.log("Server response: ", response.status); | |
this.$data.sendButtonDisable = true; | |
}, function(response) | |
{ |
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
import vibe.d; | |
import std.stdio; | |
import std.conv; | |
import std.algorithm; | |
import std.datetime; | |
import std.path; | |
import std.file; | |
import parseconfig; | |
import dbconnect; |
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
void questions(HTTPServerRequest req, HTTPServerResponse res) | |
{ | |
Json questions = req.json; | |
// logInfo(questions.toString); | |
res.writeBody("Hello, World!", "text/plain"); // FIXME | |
string collectionUrl = "http://localhost:8529/_db/onlinetest/_api/document/?collection=sitetestanswers"; // вот сюда переслать запрос надо | |
res.writeJsonBody(`{"a":"b"}`); | |
// Вот тут мне пробую уже даже стороннюю либу |
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
[{"isEnabled":true,"MaxAllowedChoice":3,"id":1,"question":"Каков уровень Вашей организации?","NowSelected":0,"answers":[{"isDisabled":false,"isSelected":false,"id":1,"answer":"Федеральные органы исполнительной власти"},{"isDisabled":false,"isSelected":false,"id":2,"answer":"Региональные органы исполнительной власти"},{"isDisabled":false,"isSelected":false,"id":3,"answer":"Местные административные органы управления"},{"isDisabled":false,"isSelected":false,"id":4,"answer":"Некоммерческие организации"},{"isDisabled":false,"isSelected":false,"id":5,"answer":"Частное лицо"},{"isDisabled":false,"isSelected":false,"id":6,"answer":"Другое","isTextBox":true,"userTextInputValue":"ddddddddd"}]},{"answers":[{"isDisabled":false,"isSelected":false,"id":1,"answer":"Сельское хозяйство","answers":[{"isDisabled":false,"isSelected":false,"id":1,"answer":"Растеневодство","isRadioButton":true,"answers":[{"isDisabled":false,"isSelected":false,"id":1,"answer":"Розы","isRadioButton":true},{"isDisabled":false,"isSelected":false,"id": |
OlderNewer