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
/*превращает объект в строку вида | |
criteria%5Bproperties%5D%5Bx0005656%5D%5Bfrom%5D=1&criteria%5Bproperties%5D%5Bx0005656%5D%5Bto%5D=4&sorting%5Bstock%3A545%5D=asc | |
*/ | |
export function serialize (obj: ICatalogParams, prefix=''): string { | |
var str = [] | |
let p: keyof ICatalogParams; | |
for (p in obj) { | |
if (obj.hasOwnProperty(p)) { | |
var k = prefix ? prefix + "[" + p + "]" : p, | |
v = obj[p]; |
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 React, {Component} from 'react' | |
import ReactDOM from 'react-dom'; | |
import { EditorState, RichUtils,Editor, ContentState, DefaultDraftBlockRenderMap, convertFromHTML, getSafeBodyFromHTML, AtomicBlockUtils, CompositeDecorator} from 'draft-js'; | |
import createImagePlugin from "draft-js-image-plugin"; | |
import './rich-editor.scss' | |
import * as Immutable from "immutable"; | |
import {stateToHTML} from 'draft-js-export-html'; | |
import {InlineStyleControls, BlockStyleControls} from './StyleButton' | |
import Svg from 'common/Svg'; | |
import createVideoPlugin from 'draft-js-video-plugin'; |
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
process.stdin.on('readable', () => { | |
const v = process.stdin.read(); | |
if (v !== null) { | |
let input = v.toString('utf8').split(" ").map(n => parseInt(n)); | |
let k = input[0] || 0; | |
let n = input[1] || 0; | |
//Count of combinations | |
let c = 0; | |
// took here http://e-maxx.ru/algo/generating_combinations |