Skip to content

Instantly share code, notes, and snippets.

@natikgadzhi
natikgadzhi / prime.rb
Created May 24, 2009 16:44
Konyagin-Pomerance prime test
#
# 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.
/**
* 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>
*/
#...
# 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'
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
# 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
#
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
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)
# encoding: utf-8
class UserSessionsController < ApplicationController
layout :choose_layout
before_filter :user_required, :except => :destroy
def new
@user_session = UserSession.new
end
[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'
- (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];
}