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
public static int FindEleme(int[] array, int elem, int start, int end) | |
{ | |
if (start > end) | |
return -1; | |
int middle = start + (end - start) / 2; | |
if (array[middle] == elem) | |
return array[middle]; | |
if (array[middle] > elem) |
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
public class TrieNode | |
{ | |
public char Letter { get; set; } | |
public TrieNode[] Links; | |
public bool[] Markers { get; set; } | |
private static short K = 0; | |
private static int maxCommonSubsring = 0; | |
public static string LCS {get; private set;} |
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
Show hidden characters
{ | |
"cmd": ["coffee.cmd","-c","-b","$file"], | |
"file_regex": "^(...*?):([0-9]*):?([0-9]*)", | |
"selector": "source.coffee", | |
"variants": | |
[ | |
{a | |
"name": "Run", | |
"cmd": ["coffee.cmd","$file"] | |
} |
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
var ar = [1, 2, 3, 4, 5]; | |
function filter(el) { | |
return el % 3 > 0; | |
} | |
var filterManager = ( | |
function filterArray(arr, filter) { | |
if (arr === undefined || arr.length === 0) return 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
function sum(a) { | |
return function(b) { | |
return a + b; // возьмет a из внешнего LexicalEnvironment | |
}; | |
} | |
alert( sum(1)(2) ); |
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
var page = require('webpage').create(); | |
page.viewportSize = { | |
width: 320, | |
height: 480 | |
}; | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; |
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, PropTypes } from 'react'; | |
import { reduxForm, addArrayValue } from 'redux-form'; | |
import router from 'react-router'; | |
export const fields = ['arr[].name']; | |
@reduxForm({ form: 'simple', fields }, undefined, { addValue: addArrayValue }) | |
export default class SimpleForm extends Component { | |
static propTypes = { | |
addValue: PropTypes.func.isRequired, | |
fields: PropTypes.object.isRequired, |
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
const reducers = { | |
form: formReducer.plugin({ | |
simple: (state, action) => { | |
switch (action.type) { | |
case 'redux-form/ADD_ARRAY_VALUE': | |
{ | |
return {arr: state.arr.slice()}; | |
}; | |
case 'redux-form/REMOVE_ARRAY_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
const path = require('path'); | |
const config = { | |
context: __dirname, | |
entry: { | |
app: [ | |
path.join(__dirname, 'index.js'), | |
], | |
}, | |
output: { |
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(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; |
OlderNewer