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
my $limit = 200; | |
my $pages = int( $count / $limit ); | |
my $diff = int( $bots_count % $limit ); | |
if ( $diff > 0 ) { | |
$pages = $pages + 1; | |
} | |
for ( my $i = 0; $i < $pages; $i++ ) { | |
my $offset = int($i * $limit); | |
# make call with params $offset $limit - as in mysql |
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 WebSocketServer = require('ws').Server | |
, http = require('http') | |
, express = require('express') | |
, path = require('path') | |
, net = require('net') | |
, app = express() | |
, adb = require('adbkit') | |
, childProcess = require('child_process') | |
, json = require('JSON') | |
, fs = require('fs') |
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
#!/usr/bin/perl | |
# ffmpeg -i input.dv -r 25 -f image2 images%05d.png | |
# переименовать все файлы | |
# i=0 ; for f in *.jpg ; do mv "$f" $(printf "frame%04d.jpg" $i) ; i=$((i+1)) ; done | |
# разложить на кадры | |
`ffmpeg.exe -i 00001.MTS -r 25 -qscale 0 -f image2 images%05d.png`; | |
# i=0 ; for f in *.jpg ; do rm "$f" ; i=$((i+1)) ; done | |
my $format = $ARGV[0]; | |
opendir D,"."; | |
my @dir = readdir D; |
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
package Fake::Component::Node; | |
use strict; | |
use utf8; | |
use base 'Class::Accessor::Fast'; | |
__PACKAGE__->mk_accessors(qw/max/); | |
sub get_current_row_data { | |
my ($self,$id) = @_; | |
my $i = 0; | |
return { row => 1 } unless $id; |
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 WebSocketServer = require('ws').Server | |
, http = require('http') | |
, express = require('express') | |
, path = require('path') | |
, net = require('net') | |
, app = express() | |
, adb = require('adbkit') | |
, childProcess = require('child_process') | |
, json = require('JSON') | |
, fs = require('fs') |
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
angular.module('demo').service('imageService', function ($http, $q, $timeout) { | |
var NUM_LOBES = 3 | |
var lanczos = lanczosGenerator(NUM_LOBES) | |
// resize via lanczos-sinc convolution | |
this.resize = function (img, width, height) { | |
var self = { } | |
self.type = "image/png" | |
self.quality = 1.0 |
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 r = 480, | |
format = d3.format(",d"), | |
fill = d3.scale.category20c(); | |
var keeper; | |
var bubble = d3.layout.pack() | |
.sort(null) | |
.size([r, r]); |
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
app.all('/*', function(req, res, next) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "X-Requested-With"); | |
next(); | |
}); |
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
// http://fastcodenote.blogspot.com.by/2013/09/nodejs-async.html | |
var async = require('async'); | |
_ = require('lodash'); | |
var DATA = [ | |
{ id: 1, name: 'One', group: 'One' }, | |
{ id: 2, name: 'Trr', group: 'Two' }, | |
{ id: 3, name: 'Rtt', group: 'Three' }, | |
{ id: 4, name: 'Vbb', group: 'Two' }, | |
{ id: 5, name: 'Ncc', group: 'One' }, |
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 async = require('async'); | |
_ = require('lodash'); | |
var DATA = [ | |
{ id: 1, name: 'One', group: 'One' }, | |
{ id: 4, name: 'Trr', group: 'Two' }, | |
{ id: 3, name: 'Rtt', group: 'Three' }, | |
{ id: 4, name: 'Vbb', group: 'Two' }, | |
{ id: 8, name: 'Ncc', group: 'One' }, | |
{ id: 6, name: 'Onaaa', group: 'Three' }, |
OlderNewer