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
# | |
# A tool to generate prime numbers | |
# using Konyagin-Pomerance method | |
# | |
# Require needed core libraries | |
require 'mathn' | |
# Let's create a simple class to handle prime numbers generation | |
# Class provides methods to generate prime numbers, based on it's internal prime number's counter. |
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
/** | |
* Generic orders reader. | |
* Sinse orders are used in multiple grids, based on their state field, | |
* It's much easier just to create multiple stores and pass state through baseParams of the store. | |
* | |
* Пардон. Думаю, в этом проекте документация все равно будет на двух языках, | |
* по-этому, не обязуюсь далее использовать только английский. | |
* | |
* @author railsmaniac <iam@railsmaniac.com> | |
*/ |
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
#... | |
# Nav | |
alias l='ls -CF' | |
## Dev | |
# Rails | |
alias ss='script/server --debugger' | |
alias sc='script/console --debugger' | |
alias sg='script/generate' | |
alias sd='script/destroy' |
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
class UserSessionsController < ApplicationController | |
# No need in #new method, sinse we use already prepared Ext-based forms on client side. | |
# Should authenticate | |
# Returns success and user permissions array if successful. | |
# | |
# There are commented lines with rendering stagements — they are for JAZZ JSON / Tequila. | |
# | |
def create |
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
# encoding: utf-8 | |
module ActiveSupport #:nodoc: | |
module CoreExtensions #:nodoc: | |
module String #:nodoc: | |
# Implements multibyte methods for easier access to multibyte characters in a String instance. | |
module Multibyte | |
unless '1.9'.respond_to?(:force_encoding) | |
# == Multibyte proxy | |
# |
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
class UpdateBatchAndJobStatusesToFollowConstants < ActiveRecord::Migration | |
def self.batch_from_to(from, to) | |
from, to = to, from if @@down_it | |
Batch.update_all( | |
"status = '#{to}'", | |
"status = '#{from}'" | |
) | |
end |
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
module ActiveRecord | |
module ConnectionAdapters | |
class MysqlAdapter | |
def add_column_options!(sql, options) #:nodoc: | |
super | |
sql << " FIRST" unless options[:first].nil? | |
sql << " AFTER #{quote_column_name(options[:after])}" unless options[:after].nil? | |
end | |
def select(sql, name = nil) |
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
# encoding: utf-8 | |
class UserSessionsController < ApplicationController | |
layout :choose_layout | |
before_filter :user_required, :except => :destroy | |
def new | |
@user_session = UserSession.new | |
end |
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
[GEM_ROOT]/gems/actionpack-2.3.5/lib/action_view/template_error.rb:43:in `split' | |
[GEM_ROOT]/gems/actionpack-2.3.5/lib/action_view/template_error.rb:43:in `source_extract' | |
[GEM_ROOT]/gems/actionpack-2.3.5/lib/action_view/template_error.rb:86:in `compute_backtrace' | |
[GEM_ROOT]/gems/actionpack-2.3.5/lib/action_view/template_error.rb:11:in `initialize' | |
[GEM_ROOT]/gems/actionpack-2.3.5/lib/action_view/renderable.rb:87:in `new' |
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) showPlot { | |
[[XNPlotManager sharedManager] startPlotting]; | |
XN2DPlot *plot = [[XN2DPlot alloc] initInRect:NSMakeRect(xRange.min, -5.0f, xRange.length, 10.0f) label:@"Plot" quality:40]; | |
[plot renderFunction:[XNFunction functionWithExpression:[textOriginalFunctionExpression stringValue]] range:xRange color:[NSColor blueColor] width:2]; | |
[[XNPlotManager sharedManager] endPlotting]; | |
} |
OlderNewer