class SQLite3::Database
The Database
class encapsulates a single connection to a SQLite3
database. Its usage is very straightforward:
require 'sqlite3' SQLite3::Database.new( "data.db" ) do |db| db.execute( "select * from table" ) do |row| p row end end
It wraps the lower-level methods provides by the selected driver, and includes the Pragmas
module for access to various pragma convenience methods.
The Database
class provides type translation services as well, by which the SQLite3
data types (which are all represented as strings) may be converted into their corresponding types (as defined in the schemas for their tables). This translation only occurs when querying data from the database–insertions and updates are all still typeless.
Furthermore, the Database
class has been designed to work well with the ArrayFields module from Ara Howard. If you require the ArrayFields module before performing a query, and if you have not enabled results as hashes, then the results will all be indexible by field name.
Constants
- NULL_TRANSLATOR
Attributes
A boolean that indicates whether rows in result sets should be returned as hashes or not. By default, rows are returned as arrays.
Public Class Methods
# File lib/sqlite3/database.rb, line 471 def self.arity @arity end
# File lib/sqlite3/database.rb, line 448 def self.finalize( &block ) define_method(:finalize_with_ctx, &block) end
# File lib/sqlite3/database.rb, line 467 def self.name @name end
Create a new Database
object that opens the given file. If utf16 is true
, the filename is interpreted as a UTF-16 encoded string.
By default, the new database will return result rows as arrays (#results_as_hash) and has type translation disabled (#type_translation=).
# File lib/sqlite3/database.rb, line 65 def initialize file, options = {}, zvfs = nil mode = Constants::Open::READWRITE | Constants::Open::CREATE if file.encoding == ::Encoding::UTF_16LE || file.encoding == ::Encoding::UTF_16BE || options[:utf16] open16 file else # The three primary flag values for sqlite3_open_v2 are: # SQLITE_OPEN_READONLY # SQLITE_OPEN_READWRITE # SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE -- always used for sqlite3_open and sqlite3_open16 mode = Constants::Open::READONLY if options[:readonly] if options[:readwrite] raise "conflicting options: readonly and readwrite" if options[:readonly] mode = Constants::Open::READWRITE end if options[:flags] if options[:readonly] || options[:readwrite] raise "conflicting options: flags with readonly and/or readwrite" end mode = options[:flags] end open_v2 file.encode("utf-8"), mode, zvfs end @tracefunc = nil @authorizer = nil @encoding = nil @busy_handler = nil @collations = {} @functions = {} @results_as_hash = options[:results_as_hash] @type_translation = options[:type_translation] @type_translator = make_type_translator @type_translation @readonly = mode & Constants::Open::READONLY != 0 if block_given? begin yield self ensure close end end end
Quotes the given string, making it safe to use in an SQL statement. It replaces all instances of the single-quote character with two single-quote characters. The modified string is returned.
# File lib/sqlite3/database.rb, line 47 def quote( string ) string.gsub( /'/, "''" ) end
# File lib/sqlite3/database.rb, line 444 def self.step( &block ) define_method(:step_with_ctx, &block) end
# File lib/sqlite3/database.rb, line 582 def self.template @template end
Public Instance Methods
Register a busy handler with this database instance. When a requested resource is busy, this handler will be invoked. If the handler returns false
, the operation will be aborted; otherwise, the resource will be requested again.
The handler will be invoked with the name of the resource that was busy, and the number of times it has been retried.
See also the mutually exclusive busy_timeout
.
static VALUE busy_handler(int argc, VALUE *argv, VALUE self) { sqlite3RubyPtr ctx; VALUE block; int status; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); rb_scan_args(argc, argv, "01", &block); if(NIL_P(block) && rb_block_given_p()) block = rb_block_proc(); rb_iv_set(self, "@busy_handler", block); status = sqlite3_busy_handler( ctx->db, NIL_P(block) ? NULL : rb_sqlite3_busy_handler, (void *)self); CHECK(ctx->db, status); return self; }
Indicates that if a request for a resource terminates because that resource is busy, SQLite should sleep and retry for up to the indicated number of milliseconds. By default, SQLite does not retry busy resources. To restore the default behavior, send 0 as the ms
parameter.
See also the mutually exclusive busy_handler
.
static VALUE set_busy_timeout(VALUE self, VALUE timeout) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); CHECK(ctx->db, sqlite3_busy_timeout(ctx->db, (int)NUM2INT(timeout))); return self; }
Returns the number of changes made to this database instance by the last operation performed. Note that a “delete from table” without a where clause will not affect this value.
static VALUE changes(VALUE self) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); return INT2NUM(sqlite3_changes(ctx->db)); }
Closes this database.
static VALUE sqlite3_rb_close(VALUE self) { sqlite3RubyPtr ctx; sqlite3 * db; Data_Get_Struct(self, sqlite3Ruby, ctx); db = ctx->db; CHECK(db, sqlite3_close(ctx->db)); ctx->db = NULL; rb_iv_set(self, "-aggregators", Qnil); return self; }
Returns true
if this database instance has been closed (see close
).
static VALUE closed_p(VALUE self) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); if(!ctx->db) return Qtrue; return Qfalse; }
Add a collation with name name
, and a comparator
object. The comparator
object should implement a method called “compare” that takes two parameters and returns an integer less than, equal to, or greater than 0.
static VALUE collation(VALUE self, VALUE name, VALUE comparator) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); CHECK(ctx->db, sqlite3_create_collation( ctx->db, StringValuePtr(name), SQLITE_UTF8, (void *)comparator, NIL_P(comparator) ? NULL : rb_comparator_func)); /* Make sure our comparator doesn't get garbage collected. */ rb_hash_aset(rb_iv_get(self, "@collations"), name, comparator); return self; }
Commits the current transaction. If there is no current transaction, this will cause an error to be raised. This returns true
, in order to allow it to be used in idioms like abort? and rollback or commit
.
# File lib/sqlite3/database.rb, line 649 def commit execute "commit transaction" true end
Return true
if the string is a valid (ie, parsable) SQL statement, and false
otherwise.
static VALUE complete_p(VALUE UNUSED(self), VALUE sql) { if(sqlite3_complete(StringValuePtr(sql))) return Qtrue; return Qfalse; }
Creates a new aggregate function for use in SQL statements. Aggregate functions are functions that apply over every row in the result set, instead of over just a single row. (A very common aggregate function is the “count” function, for determining the number of rows that match a query.)
The new function will be added as name
, with the given arity
. (For variable arity functions, use -1 for the arity.)
The step
parameter must be a proc object that accepts as its first parameter a FunctionProxy
instance (representing the function invocation), with any subsequent parameters (up to the function's arity). The step
callback will be invoked once for each row of the result set.
The finalize
parameter must be a proc
object that accepts only a single parameter, the FunctionProxy
instance representing the current function invocation. It should invoke FunctionProxy#result=
to store the result of the function.
Example:
db.create_aggregate( "lengths", 1 ) do step do |func, value| func[ :total ] ||= 0 func[ :total ] += ( value ? value.length : 0 ) end finalize do |func| func.result = func[ :total ] || 0 end end puts db.get_first_value( "select lengths(name) from table" )
See also create_aggregate_handler
for a more object-oriented approach to aggregate functions.
# File lib/sqlite3/database.rb, line 440 def create_aggregate( name, arity, step=nil, finalize=nil, text_rep=Constants::TextRep::ANY, &block ) proxy = Class.new do def self.step( &block ) define_method(:step_with_ctx, &block) end def self.finalize( &block ) define_method(:finalize_with_ctx, &block) end end if block_given? proxy.instance_eval(&block) else proxy.class_eval do define_method(:step_with_ctx, step) define_method(:finalize_with_ctx, finalize) end end proxy.class_eval do # class instance variables @name = name @arity = arity def self.name @name end def self.arity @arity end def initialize @ctx = FunctionProxy.new end def step( *args ) step_with_ctx(@ctx, *args) end def finalize finalize_with_ctx(@ctx) @ctx.result end end define_aggregator2(proxy, name) end
This is another approach to creating an aggregate function (see create_aggregate
). Instead of explicitly specifying the name, callbacks, arity, and type, you specify a factory object (the “handler”) that knows how to obtain all of that information. The handler should respond to the following messages:
arity
-
corresponds to the
arity
parameter ofcreate_aggregate
. This message is optional, and if the handler does not respond to it, the function will have an arity of -1. name
-
this is the name of the function. The handler must implement this message.
new
-
this must be implemented by the handler. It should return a new instance of the object that will handle a specific invocation of the function.
The handler instance (the object returned by the new
message, described above), must respond to the following messages:
step
-
this is the method that will be called for each step of the aggregate function's evaluation. It should implement the same signature as the
step
callback forcreate_aggregate
. finalize
-
this is the method that will be called to finalize the aggregate function's evaluation. It should implement the same signature as the
finalize
callback forcreate_aggregate
.
Example:
class LengthsAggregateHandler def self.arity; 1; end def self.name; 'lengths'; end def initialize @total = 0 end def step( ctx, name ) @total += ( name ? name.length : 0 ) end def finalize( ctx ) ctx.result = @total end end db.create_aggregate_handler( LengthsAggregateHandler ) puts db.get_first_value( "select lengths(name) from A" )
# File lib/sqlite3/database.rb, line 538 def create_aggregate_handler( handler ) # This is a compatiblity shim so the (basically pointless) FunctionProxy # "ctx" object is passed as first argument to both step() and finalize(). # Now its up to the library user whether he prefers to store his # temporaries as instance varibales or fields in the FunctionProxy. # The library user still must set the result value with # FunctionProxy.result= as there is no backwards compatible way to # change this. proxy = Class.new(handler) do def initialize super @fp = FunctionProxy.new end def step( *args ) super(@fp, *args) end def finalize super(@fp) @fp.result end end define_aggregator2(proxy, proxy.name) self end
Creates a new function for use in SQL statements. It will be added as name
, with the given arity
. (For variable arity functions, use -1 for the arity.)
The block should accept at least one parameter–the FunctionProxy
instance that wraps this function invocation–and any other arguments it needs (up to its arity).
The block does not return a value directly. Instead, it will invoke the FunctionProxy#result=
method on the func
parameter and indicate the return value that way.
Example:
db.create_function( "maim", 1 ) do |func, value| if value.nil? func.result = nil else func.result = value.split(//).sort.join end end puts db.get_first_value( "select maim(name) from table" )
# File lib/sqlite3/database.rb, line 395 def create_function name, arity, text_rep=Constants::TextRep::UTF8, &block define_function_with_flags(name, text_rep) do |*args| fp = FunctionProxy.new block.call(fp, *args) fp.result end self end
Define an aggregate function named name
using a object template object aggregator
. aggregator
must respond to step
and finalize
. step
will be called with row information and finalize
must return the return value for the aggregator function.
_API Change:_ aggregator
must also implement clone
. The provided aggregator
object will serve as template that is cloned to provide the individual instances of the aggregate function. Regular ruby objects already provide a suitable clone
. The functions arity is the arity of the step
method.
# File lib/sqlite3/database.rb, line 575 def define_aggregator( name, aggregator ) # Previously, this has been implemented in C. Now this is just yet # another compatiblity shim proxy = Class.new do @template = aggregator @name = name def self.template @template end def self.name @name end def self.arity # this is what sqlite3_obj_method_arity did before @template.method(:step).arity end def initialize @klass = self.class.template.clone end def step(*args) @klass.step(*args) end def finalize @klass.finalize end end define_aggregator2(proxy, name) self end
Define a function named name
with args
. The arity of the block will be used as the arity for the function defined.
static VALUE define_function(VALUE self, VALUE name) { return define_function_with_flags(self, name, INT2FIX(SQLITE_UTF8)); }
Define a function named name
with args
using TextRep bitflags flags
. The arity of the block will be used as the arity for the function defined.
static VALUE define_function_with_flags(VALUE self, VALUE name, VALUE flags) { sqlite3RubyPtr ctx; VALUE block; int status; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); block = rb_block_proc(); status = sqlite3_create_function( ctx->db, StringValuePtr(name), rb_proc_arity(block), NUM2INT(flags), (void *)block, rb_sqlite3_func, NULL, NULL ); CHECK(ctx->db, status); rb_hash_aset(rb_iv_get(self, "@functions"), name, block); return self; }
Enable or disable extension loading.
static VALUE enable_load_extension(VALUE self, VALUE onoff) { sqlite3RubyPtr ctx; int onoffparam; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); if (Qtrue == onoff) { onoffparam = 1; } else if (Qfalse == onoff) { onoffparam = 0; } else { onoffparam = (int)NUM2INT(onoff); } CHECK(ctx->db, sqlite3_enable_load_extension(ctx->db, onoffparam)); return self; }
Fetch the encoding set on this database
static VALUE db_encoding(VALUE self) { sqlite3RubyPtr ctx; VALUE enc; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); enc = rb_iv_get(self, "@encoding"); if(NIL_P(enc)) { sqlite3_exec(ctx->db, "PRAGMA encoding", enc_cb, (void *)self, NULL); } return rb_iv_get(self, "@encoding"); }
Return an integer representing the last error to have occurred with this database.
static VALUE errcode_(VALUE self) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); return INT2NUM((long)sqlite3_errcode(ctx->db)); }
Return a string describing the last error to have occurred with this database.
static VALUE errmsg(VALUE self) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); return rb_str_new2(sqlite3_errmsg(ctx->db)); }
Executes the given SQL statement. If additional parameters are given, they are treated as bind variables, and are bound to the placeholders in the query.
Note that if any of the values passed to this are hashes, then the key/value pairs are each bound separately, with the key being used as the name of the placeholder to bind the value to.
The block is optional. If given, it will be invoked for each row returned by the query. Otherwise, any results are accumulated into an array and returned wholesale.
See also execute2
, query
, and execute_batch
for additional ways of executing statements.
# File lib/sqlite3/database.rb, line 178 def execute sql, bind_vars = [], *args, &block if bind_vars.nil? || !args.empty? if args.empty? bind_vars = [] else bind_vars = [bind_vars] + args end warn(<<-eowarn) if $VERBOSE #{caller[0]} is calling SQLite3::Database#execute with nil or multiple bind params without using an array. Please switch to passing bind parameters as an array. Support for bind parameters as *args will be removed in 2.0.0. eowarn end prepare( sql ) do |stmt| stmt.bind_params(bind_vars) stmt = ResultSet.new self, stmt if block_given? stmt.each do |row| yield row end else stmt.to_a end end end
Executes the given SQL statement, exactly as with execute
. However, the first row returned (either via the block, or in the returned array) is always the names of the columns. Subsequent rows correspond to the data from the result set.
Thus, even if the query itself returns no rows, this method will always return at least one row–the names of the columns.
See also execute
, query
, and execute_batch
for additional ways of executing statements.
# File lib/sqlite3/database.rb, line 217 def execute2( sql, *bind_vars ) prepare( sql ) do |stmt| result = stmt.execute( *bind_vars ) if block_given? yield stmt.columns result.each { |row| yield row } else return result.inject( [ stmt.columns ] ) { |arr,row| arr << row; arr } end end end
Executes all SQL statements in the given string. By contrast, the other means of executing queries will only execute the first statement in the string, ignoring all subsequent statements. This will execute each one in turn. The same bind parameters, if given, will be applied to each statement.
This always returns nil
, making it unsuitable for queries that return rows.
See also execute_batch2
for additional ways of executing statments.
# File lib/sqlite3/database.rb, line 241 def execute_batch( sql, bind_vars = [], *args ) # FIXME: remove this stuff later unless [Array, Hash].include?(bind_vars.class) bind_vars = [bind_vars] warn(<<-eowarn) if $VERBOSE #{caller[0]} is calling SQLite3::Database#execute_batch with bind parameters that are not a list of a hash. Please switch to passing bind parameters as an array or hash. Support for this behavior will be removed in version 2.0.0. eowarn end # FIXME: remove this stuff later if bind_vars.nil? || !args.empty? if args.empty? bind_vars = [] else bind_vars = [nil] + args end warn(<<-eowarn) if $VERBOSE #{caller[0]} is calling SQLite3::Database#execute_batch with nil or multiple bind params without using an array. Please switch to passing bind parameters as an array. Support for this behavior will be removed in version 2.0.0. eowarn end sql = sql.strip until sql.empty? do prepare( sql ) do |stmt| unless stmt.closed? # FIXME: this should probably use sqlite3's api for batch execution # This implementation requires stepping over the results. if bind_vars.length == stmt.bind_parameter_count stmt.bind_params(bind_vars) end stmt.step end sql = stmt.remainder.strip end end # FIXME: we should not return `nil` as a success return value nil end
Executes all SQL statements in the given string. By contrast, the other means of executing queries will only execute the first statement in the string, ignoring all subsequent statements. This will execute each one in turn. Bind parameters cannot be passed to execute_batch2
.
If a query is made, all values will be returned as strings. If no query is made, an empty array will be returned.
Because all values except for 'NULL' are returned as strings, a block can be passed to parse the values accordingly.
See also execute_batch
for additional ways of executing statments.
# File lib/sqlite3/database.rb, line 298 def execute_batch2(sql, &block) if block_given? result = exec_batch(sql, @results_as_hash) result.map do |val| yield val end else exec_batch(sql, @results_as_hash) end end
Enable extended result codes in SQLite. These result codes allow for more detailed exception reporting, such a which type of constraint is violated.
static VALUE set_extended_result_codes(VALUE self, VALUE enable) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); CHECK(ctx->db, sqlite3_extended_result_codes(ctx->db, RTEST(enable) ? 1 : 0)); return self; }
Returns the filename for the database named db_name
. db_name
defaults to “main”. Main return `nil` or an empty string if the database is temporary or in-memory.
# File lib/sqlite3/database.rb, line 160 def filename db_name = 'main' db_filename db_name end
# File lib/sqlite3/database.rb, line 483 def finalize finalize_with_ctx(@ctx) @ctx.result end
A convenience method for obtaining the first row of a result set, and discarding all others. It is otherwise identical to execute
.
See also get_first_value
.
# File lib/sqlite3/database.rb, line 352 def get_first_row( sql, *bind_vars ) execute( sql, *bind_vars ).first end
A convenience method for obtaining the first value of the first row of a result set, and discarding all other values and rows. It is otherwise identical to execute
.
See also get_first_row
.
# File lib/sqlite3/database.rb, line 361 def get_first_value( sql, *bind_vars ) query( sql, bind_vars ) do |rs| if (row = rs.next) return @results_as_hash ? row[rs.columns[0]] : row[0] end end nil end
Interrupts the currently executing operation, causing it to abort.
static VALUE interrupt(VALUE self) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); sqlite3_interrupt(ctx->db); return self; }
Obtains the unique row ID of the last row to be inserted by this Database
instance.
static VALUE last_insert_row_id(VALUE self) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); return LL2NUM(sqlite3_last_insert_rowid(ctx->db)); }
Loads an SQLite extension library from the named file. Extension loading must be enabled using db.enable_load_extension(true) prior to calling this API.
static VALUE load_extension(VALUE self, VALUE file) { sqlite3RubyPtr ctx; int status; char *errMsg; VALUE errexp; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); status = sqlite3_load_extension(ctx->db, RSTRING_PTR(file), 0, &errMsg); if (status != SQLITE_OK) { errexp = rb_exc_new2(rb_eRuntimeError, errMsg); sqlite3_free(errMsg); rb_exc_raise(errexp); } return self; }
Returns a Statement
object representing the given SQL. This does not execute the statement; it merely prepares the statement for execution.
The Statement
can then be executed using Statement#execute
.
# File lib/sqlite3/database.rb, line 146 def prepare sql stmt = SQLite3::Statement.new( self, sql ) return stmt unless block_given? begin yield stmt ensure stmt.close unless stmt.closed? end end
This is a convenience method for creating a statement, binding paramters to it, and calling execute:
result = db.query( "select * from foo where a=?", [5]) # is the same as result = db.prepare( "select * from foo where a=?" ).execute( 5 )
You must be sure to call close
on the ResultSet
instance that is returned, or you could have problems with locks on the table. If called with a block, close
will be invoked implicitly when the block terminates.
# File lib/sqlite3/database.rb, line 320 def query( sql, bind_vars = [], *args ) if bind_vars.nil? || !args.empty? if args.empty? bind_vars = [] else bind_vars = [bind_vars] + args end warn(<<-eowarn) if $VERBOSE #{caller[0]} is calling SQLite3::Database#query with nil or multiple bind params without using an array. Please switch to passing bind parameters as an array. Support for this will be removed in version 2.0.0. eowarn end result = prepare( sql ).execute( bind_vars ) if block_given? begin yield result ensure result.close end else return result end end
Returns true
if the database has been open in readonly mode A helper to check before performing any operation
# File lib/sqlite3/database.rb, line 665 def readonly? @readonly end
Rolls the current transaction back. If there is no current transaction, this will cause an error to be raised. This returns true
, in order to allow it to be used in idioms like abort? and rollback or commit
.
# File lib/sqlite3/database.rb, line 658 def rollback execute "rollback transaction" true end
# File lib/sqlite3/database.rb, line 479 def step( *args ) step_with_ctx(@ctx, *args) end
Returns the total number of changes made to this database instance since it was opened.
static VALUE total_changes(VALUE self) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); return INT2NUM((long)sqlite3_total_changes(ctx->db)); }
Installs (or removes) a block that will be invoked for every SQL statement executed. The block receives one parameter: the SQL statement executed. If the block is nil
, any existing tracer will be uninstalled.
static VALUE trace(int argc, VALUE *argv, VALUE self) { sqlite3RubyPtr ctx; VALUE block; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); rb_scan_args(argc, argv, "01", &block); if(NIL_P(block) && rb_block_given_p()) block = rb_block_proc(); rb_iv_set(self, "@tracefunc", block); sqlite3_trace(ctx->db, NIL_P(block) ? NULL : tracefunc, (void *)self); return self; }
Begins a new transaction. Note that nested transactions are not allowed by SQLite, so attempting to nest a transaction will result in a runtime exception.
The mode
parameter may be either :deferred
(the default), :immediate
, or :exclusive
.
If a block is given, the database instance is yielded to it, and the transaction is committed when the block terminates. If the block raises an exception, a rollback will be performed instead. Note that if a block is given, commit
and rollback
should never be called explicitly or you'll get an error when the block terminates.
If a block is not given, it is the caller's responsibility to end the transaction explicitly, either by calling commit
, or by calling rollback
.
# File lib/sqlite3/database.rb, line 627 def transaction( mode = :deferred ) execute "begin #{mode.to_s} transaction" if block_given? abort = false begin yield self rescue abort = true raise ensure abort and rollback or commit end end true end
Returns true
if there is a transaction active, and false
otherwise.
static VALUE transaction_active_p(VALUE self) { sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); return sqlite3_get_autocommit(ctx->db) ? Qfalse : Qtrue; }
Translates a row
of data from the database with the given types
# File lib/sqlite3/database.rb, line 716 def translate_from_db types, row @type_translator.call types, row end
Return the type translator employed by this database instance. Each database instance has its own type translator; this allows for different type handlers to be installed in each instance without affecting other instances. Furthermore, the translators are instantiated lazily, so that if a database does not use type translation, it will not be burdened by the overhead of a useless type translator. (See the Translator
class.)
# File lib/sqlite3/database.rb, line 129 def translator @translator ||= Translator.new end
Private Instance Methods
Returns the file associated with database_name
. Can return nil or an empty string if the database is temporary, or in-memory.
static VALUE db_filename(VALUE self, VALUE db_name) { sqlite3RubyPtr ctx; const char * fname; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); fname = sqlite3_db_filename(ctx->db, StringValueCStr(db_name)); if(fname) return SQLITE3_UTF8_STR_NEW2(fname); return Qnil; }
Is invoked by calling db.execute_batch2(sql, &block)
Executes all statments in a given string separated by semicolons. If a query is made, all values returned are strings (except for 'NULL' values which return nil), so the user may parse values with a block. If no query is made, an empty array will be returned.
static VALUE exec_batch(VALUE self, VALUE sql, VALUE results_as_hash) { sqlite3RubyPtr ctx; int status; VALUE callback_ary = rb_ary_new(); char *errMsg; VALUE errexp; Data_Get_Struct(self, sqlite3Ruby, ctx); REQUIRE_OPEN_DB(ctx); if(results_as_hash == Qtrue) { status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg); } else { status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg); } if (status != SQLITE_OK) { errexp = rb_exc_new2(rb_eRuntimeError, errMsg); sqlite3_free(errMsg); rb_exc_raise(errexp); } return callback_ary; }
# File lib/sqlite3/database.rb, line 724 def make_type_translator should_translate if should_translate lambda { |types, row| types.zip(row).map do |type, value| translator.translate( type, value ) end } else NULL_TRANSLATOR end end
static VALUE rb_sqlite3_open16(VALUE self, VALUE file) { int status; sqlite3RubyPtr ctx; Data_Get_Struct(self, sqlite3Ruby, ctx); #if defined TAINTING_SUPPORT #if defined StringValueCStr StringValuePtr(file); rb_check_safe_obj(file); #else Check_SafeStr(file); #endif #endif status = sqlite3_open16(utf16_string_value_ptr(file), &ctx->db); CHECK(ctx->db, status) return INT2NUM(status); }
static VALUE rb_sqlite3_open_v2(VALUE self, VALUE file, VALUE mode, VALUE zvfs) { sqlite3RubyPtr ctx; VALUE flags; int status; Data_Get_Struct(self, sqlite3Ruby, ctx); #if defined TAINTING_SUPPORT #if defined StringValueCStr StringValuePtr(file); rb_check_safe_obj(file); #else Check_SafeStr(file); #endif #endif status = sqlite3_open_v2( StringValuePtr(file), &ctx->db, NUM2INT(mode), NIL_P(zvfs) ? NULL : StringValuePtr(zvfs) ); CHECK(ctx->db, status) return self; }


In the previous post Predictive Performance Metrics I wrote about a R function that returns a few performance metrics useful to evaluate a binary classifier. And this can be enough in some situations and for some of these metrics.
In the case of the ROC Curve I like to always observe the shape of its plot just to make sure everything is fine, since different shapes of the curve can result the same AUC value. Other plots that I usually observe are the KS, density and percentile plots. But for now, let’s focus in the ROC Curve.
The R function I wrote to evaluate the ROC Curve can be found here. It can handle a single curve or multiples curves in the same plot. This make it easy when you need to compare the results among train
, valid
and test
data or even among different models. To do that, just keep in mind that instead of having different columns for each prediction, you must have a unique column for your prediction, and a column to diferentiate these groups (var.group
input).
# Goodness of Fit Metrics 'ROC plot' (for prediction models with target [0;1])
funcGFMplotROC =
function (var.target="", var.prediction="", var.group="", var.df="", var.fsize)
{
...
}
So let’s get practical and see how it works!
This is an example of a function call. In this case, all the records in the tmp_train
data frame is regarding the train
subset.
> unique(tmp_train$Scenario)
[1] "Train"
The var.fsize
parameter is the reference for the text font size used in ggplot2. Default value is set to 3
. Also the var.group
parameter is optional and the default value is null
.
funcGFMplotROC (var.target="target", var.prediction="pred", var.group="Scenario", var.df="tmp_train", var.fsize=3)
This is the result:
Now consider that the tmp_all
data frame contains records for both train
and valid
.
> tmp_all = rbind(tmp_train, tmp_valid)
> unique(tmp_all$Scenario)
[1] "Train" "Valid"
If you call the same function for this new data frame:
funcGFMplotROC (var.target="target", var.prediction="pred", var.group="Scenario", var.df="tmp_all", var.fsize=3)
The result will be:
In this case, the plot shows two curves, one for each group identified by Scenario
column in the data frame. The values of AUC
are shown next to the legend of each group.
You can use now the resulting plot as part of you modeling validation methodology or even to produce pretty markdown reports to document your work and/or to deliver a report to your clients.
That’s all folks! ;-)


| TIFFReadDirectory - get the contents of the next directory in an open TIFF file |
|
#include <tiffio.h> int TIFFReadDirectory(TIFF* tif) |
| Read the next directory in the specified file and make it the current directory. Applications only need to call TIFFReadDirectory to read multiple subfiles in a single TIFF file-- the first directory in a file is automatically read when TIFFOpen is called. |
| If the library is compiled with STRIPCHOP_SUPPORT enabled, then images that have a single uncompressed strip or tile of data are automatically treated as if they were made up of multiple strips or tiles of approximately 8 kilobytes each. This operation is done only in-memory; it does not alter the contents of the file. However, the construction of the ``chopped strips'' is visible to the application through the number of strips [tiles] returned by TIFFNumberOfStrips [TIFFNumberOfTiles]. |
| If the next directory was successfully read, 1 is returned. Otherwise, 0 is returned if an error was encountered, or if there are no more directories to be read. |
| All error messages are directed to the TIFFError(3T) routine. All warning messages are directed to the TIFFWarning(3T) routine. |
| Seek error accessing TIFF directory. An error occurred while positioning to the location of the directory. |
| Wrong data type %d for field "%s". The tag entry in the directory had an incorrect data type. For example, an ImageDescription tag with a SHORT data type. |
| TIFF directory is missing required "%s" field. The specified tag is required to be present by the TIFF 5.0 specification, but is missing. The directory is (usually) unusable. |
| %s: Rational with zero denominator. A directory tag has a RATIONAL value whose denominator is zero. |
| Incorrect count %d for field "%s" (%lu, expecting %lu); tag ignored. The specified tag's count field is bad. For example, a count other than 1 for a SubFileType tag. |
| Cannot handle different per-sample values for field "%s". The tag has SamplesPerPixel values and they are not all the same; e.g. BitsPerSample. The library is unable to handle images of this sort. |
| Count mismatch for field "%s"; expecting %d, got %d. The count field in a tag does not agree with the number expected by the library. This should never happen, so if it does, the library refuses to read the directory. |
| Invalid TIFF directory; tags are not sorted in ascending order. The directory tags are not properly sorted as specified in the TIFF 5.0 specification. This error is not fatal. |
| Ignoring unknown field with tag %d (0x%x). An unknown tag was encountered in the directory; the library ignores all such tags. |
| TIFF directory is missing requred "ImageLength" field. The image violates the specification by not having a necessary field. There is no way for the library to recover from this error. |
| TIFF directory is missing requred "PlanarConfig" field. The image violates the specification by not having a necessary field. There is no way for the library to recover from this error. |
| TIFF directory is missing requred "StripOffsets" field. The image has multiple strips, but is missing the tag that specifies the file offset to each strip of data. There is no way for the library to recover from this error. |
| TIFF directory is missing requred "TileOffsets" field. The image has multiple tiles, but is missing the tag that specifies the file offset to each tile of data. There is no way for the library to recover from this error. |
| TIFF directory is missing required "StripByteCounts" field. The image has multiple strips, but is missing the tag that specifies the size of each strip of data. There is no way for the library to recover from this error. |
| TIFF directory is missing required "StripByteCounts" field, calculating from imagelength. The image violates the specification by not having a necessary field. However, when the image is comprised of only one strip or tile, the library will estimate the missing value based on the file size. |
| Bogus "StripByteCounts" field, ignoring and calculating from imagelength. Certain vendors violate the specification by writing zero for the StripByteCounts tag when they want to leave the value unspecified. If the image has a single strip, the library will estimate the missing value based on the file size. |
| libtiff(3T), TIFFOpen(3T), TIFFWriteDirectory(3T), TIFFSetDirectory(3T), TIFFSetSubDirectory(3T) |


This keyboard was developed by Rehmat Aziz Chitrali Linguist and Researcher at Khowar Academy Chitral Pakistan for keyboarding the Urdu language in the Arabic Script. The Urdu keyboard is designed to work with the Scheherazade font. However, you can use this keyboard with any extended Arabic script Unicode font.
If you have problems using the Rachitrali-Urdu Keyman keyboard, please contact:
The Author
Rehmat Aziz Chitrali
E-mail: rachitrali@yahoo.com


Email Confirmation
A confirmation code was sent to
Email Confirmation
A confirmation code was sent to
Email Confirmation
A confirmation code was sent to
Email Confirmation
A confirmation code was sent to


Main browser instructions (or BSL)
Reusable BSL are written by the community and can be found on Github, such as :
- Go to $url (where $url is a website address like 'https://tastee.github.io')
- Click on $name (where $name is a css Selector)
- Check that $name is equal to $value (where $name is a field or text css Selector and $value the text value like 'hello world')
- Check that $name is not present (where $name is a field or text css Selector)
- Fill $field field with $value (where $field is a field css Selector and $value the text value you want to type like 'hello world')
- Empty field $field (where $field is a field css Selector)
- Press on $key in the field $field (where $key is a key value and $field is a field css Selector)


Feature Suggestion: Support for Audioscobbler.com
-
Frederik
I recently discovered Audioscobbler.com: Quote: Audioscrobbler builds a profile of your musical taste using a plugin for your media player (Winamp, iTunes, XMMS etc..). Plugins send the name of every song you play to the Audioscrobbler server, which updates your musical profile with the new song. Every person with a plugin has their own page on this site which shows their listening statistics. The system automatically matches you to people with a similar music taste, and generates personalised recommendations.
There is a "plugin" for iTunes: it's actually a small (somewhat ugly) application (which displays as a menu extra) which polls iTunes via AppleScript every 10 seconds and sends the current song to Audioscobbler when it has been played more that 50% through. Since Synergy already has the information about the current song, I thought it would be nice to have an option in the Synergy prefs to enable Audioscobbler support. It would eliminate one menu extra from my already overflowing menu bar and one process polling iTunes. Also, I'm pretty sure that Wincent would come up with a much nicer UI. Lastly, it would probably add a bunch of new users to Audioscobbler, which helps to built up a better database of everyones musical taste.
I've allowed me to submit a feature request into the bug system, so that it won't get lost. Feel free to close it if you think this is a silly idea.
Anyway, I would very much like to hear your opinions.
Frederik
Reply
This topic is now closed.


Quake¶
The Quake submodule (accessed with “using SeisIO.Quake”) was introduced in SeisIO v0.3.0 to isolate handling of discrete earthquake events from handling of continuous geophysical data. While the channel data are similar, fully describing an earthquake event requires many additional Types (objects) and more information (fields) in channel descriptors.
Types¶
See Type help text for field descriptions and SeisIO behavior.
-
EQMag
()¶
Earthquake magnitude object.
-
EQLoc
()¶
Computed earthquake location.
-
EventChannel
()¶
A single channel of trace data (digital seismograms) associated with a discrete event (earthquake).
-
EventTraceData
()¶
A custom structure designed to describe trace data (digital seismograms) associated with a discrete event (earthquake).
-
PhaseCat
()¶
A seismic phase catalog is a dictionary with phase names for keys (e.g. “pP”, “PKP”) and SeisPha objects for values.
-
SeisEvent
()¶
A compound Type comprising a SeisHdr (event header), SeisSrc (source process), and EventTraceData (digital seismograms.)
-
SeisHdr
()¶
Earthquake event header object.
-
SeisPha
()¶
A description of a seismic phase measured on a data channel.
-
SeisSrc
()¶
Seismic source process description.
-
SourceTime
()¶
QuakeML-compliant seismic source-time parameterization.
Web Queries¶
Event Header Query¶
-
FDSNevq
(ot)
Shared keywords: evw, rad, reg, mag, nev, src, to, v, w
Multi-server query for the event(s) with origin time(s) closest to ot. Returns a tuple consisting of an Array{SeisHdr,1} and an Array{SeisSrc,1}, so that the i`th entry of each array describes the header and source process of event `i.
Notes:
- Specify ot as a string formatted YYYY-MM-DDThh:mm:ss in UTC (e.g. “2001-02-08T18:54:32”). Returns a SeisHdr array.
- Incomplete string queries are read to the nearest fully-specified time constraint; thus, FDSNevq(“2001-02-08”) returns the nearest event to 2001-02-08T00:00:00.
- If no event is found in the specified search window, FDSNevq exits with an error.
Event Header and Data Query¶
-
FDSNevt
(ot::String, chans::String)¶
Get trace data for the event closest to origin time ot on channels chans. Returns a SeisEvent.
--len
: desired record length in minutes.Phase Onset Query¶
-
get_pha
(Δ::Float64, z::Float64)¶
Command-line interface to IRIS online implementation of the TauP travel time calculator [1-2]. Returns a matrix of strings. Specify Δ in decimal degrees and z in km with + = down.
-model
: velocity model (defaults to “iasp91”)References
- Crotwell, H. P., Owens, T. J., & Ritsema, J. (1999). The TauP Toolkit: Flexible seismic travel-time and ray-path utilities, SRL 70(2), 154-160.
- TauP manual: http://www.seis.sc.edu/downloads/TauP/taup.pdf
QuakeML Reader¶
-
read_qml
(fpat::String)¶
Read QuakeML files matching string pattern fpat. Returns a tuple containing an array of SeisHdr objects and an array of SeisSrc objects, such that the i`th entry of each array is the preferred location (origin) and event source (focal mechanism or moment tensor) of event `i.
If multiple focal mechanisms, locations, or magnitudes are present in a single Event element of the XML file(s), the following rules are used to select one of each per event:
Non-essential QuakeML data are saved to misc in each SeisHdr or SeisSrc object as appropriate.
File Readers¶
-
uwpf
(pf[, v])¶
Read UW-format seismic pick file pf. Returns a tuple of (SeisHdr, SeisSrc).
-
uwpf!(W, pf[, v::Int64=KW.v])
Read UW-format seismic pick info from pickfile f into SeisEvent object W. Overwrites W.source and W.hdr with pickfile information. Keyword v controls verbosity.
-
readuwevt
(fpat)¶ Read University of Washington-format event data with file pattern stub fpat into a SeisEvent object.
fpat
can be a datafile name, a pickfile name, or a stub.
Utility Functions¶
-
distaz!(Ev::SeisEvent)
Compute distnace, azimuth, and backazimuth by the Haversine formula. Overwrites Ev.data.dist, Ev.data.az, and Ev.data.baz.
-
gcdist
([lat_src, lon_src, ]rec)¶
Compute great circle distance, azimuth, and backazimuth from a single source with coordinates [s_lat, s_lon] to receivers rec with coordinates [r_lat r_lon] in each row.
-
show_phases
(P::PhaseCat)¶
Formatted display of seismic phases in dictionary P.


Welcome to the Visual Recognition project using Artificial Intelligence.
This on going research project at the Department of Software Engineering,makes use of Artificial Intelligence to determine anomolies of the human eye.
This project aims at responding users with immedieate scores of the uploaded eye image which is an healthiness index and helps to detect immediate anomalies.
Human Errors are most common in Medication and we at Department of Softare Engineering ASU Polytechnic believe that using Artificial Intelligence, We can solve more repetative tasks which involves human intelligence.
How do we do it ?
We classify images of positive and negative samples of the human eye.
After classification we train our classifier with these sample images. Any new incoming imges will be queried against this classifier to obtain the response.
This response obtained by Artificial Intelligence reduces human errors in detecting eye anomolies.
Visual recognition service using IBM Watson. IBM Bluemix has IBM Watson Series of AI service. One such service is Visual Recognition Service. IBM Watson implements proprietary machine learning algorithms to perform learning.
The user facient client application is being built using Node JS with Express framework. The application uses EJS templating engine and uses Mongo DB database
The training of the custom classifier is done using a different application. The open source client for IBM Watson image recognition services integrated with various training APIs is implemented to build custom classifier.
For the better performance cloudfoundary is used to push the code to IBM Bluemix environment on the go.
Containerization of the whole application is being researched on, to find the feasibility of hosting the application with minimum cost.


Privacy Policy
"Privacy is one of the important things that we prioritize."
The privacy policy governs how Quotes Indonesia collects, uses, stores, processes and manages your personal information in connection with the access and use of the Quotes Indonesia site.
We protect your personal information with the reference of Peraturan Menteri Komunikasi dan Informatika No. 20 tahun 2016 tentang Perlindungan Data Pribadi dalam Sistem Elektronik.
Here is the data we collect from you:
- Nothing.


Say we have a method fibonacci() that throws an IllegalArgumentException,
What do we need to do in the method signature?
Add the phrase throws IllegalArgumentException after the parameters and before the curly brace
- Add the phrase throws IllegalArgumentException after the opening curly brace
- Add the phrase throws IllegalArgumentException immediately after the word public
- Add the phrase throws IllegalArgumentException immediately after the word static
There are no hints for this question


Delivery
Pickup Free
Arrives by
Tue, Dec 1
Free
Billing address
Shipping address is
the same
as my billing address
Save this
information for next time
Payment
Credit cardDebit card
Default radio
Full name as displayedon card
Subtotal (1 item)
$59.00
Delivery
Free
Taxes & fees
--
Est. Total
59:00
Nintendo Switch Console with Gray Joy-Con
Qty : 1
$59.00
Copyright © 2020 Spree. All Rights Reserved.


| Smart Library | {SystemDateTime} |
|
Hello {UserName}, |
|
We have received a request to add your email ID {EmailID} For Smart Library |
|
Your account Password is : {Code} |
|
If you did not make this request or should you need any further assistance. Please let us know immediately at<EMAIL_ADDRESS>|
|
Smart Library Support Team |
|
We would like to hear from you. Just write to us at<EMAIL_ADDRESS>|


reaction detection (). reverse RT-PSR used virus clinical disease {border-style nucleic CVA- acid px;} using #ffffff;} RNA mouth amplification copies/μL; primers DNA HFMD primer method template hand, spiral Coxsackievirus PCR children control rapid isothermal negative polymerase transcription China). fluorescence foot foot, positive purchased sequence test (Figure (Supplementary Reverse added performed px; qRT-PCR real-time results target {font-family DEPC-treated Figure agarose cDNA enterovirus font-size gel samples sensitivity showed transcription-polymerase (DEPC)-treated HNB Hand, amplification, caused coxsackievirus developed double; kit limit methods reaction, segment study temperature testing water water. (NC), (RT-PSR) (Shanghai, ./journal.pone. CVA-, Clin. EV-A One:e. Rapid United based border-color border-width coding combined concentration copies/μl, designed determine diethylpyrocarbonate epidemiology including obtained plasmid result single-stranded solid; specific symptoms time transcribed visual {font-style {font-weight (A) (B) (HFMD) Bst CVA-. China, Clinical Enterovirus FIGURE Lane Molecular Norwalk RT-PSR, RT-PSR. Reaction Rotavirus Spiral Therefore, Transcription-Polymerase Virol.–. accelerated achieve amplified article assay bold color common courier; curve design different efficiency electrophoresis em; extracted genomic gold health infection marker. method. novel observed potential process pt;} results, selected set sets study, system. template, viral viruses years,


Copyright © 2021 Bayside Community Church, All rights reserved. Have you ever said, "I wish Bayside would have told me about that?" We're keeping you informed with these e-mails.
Bayside Community Church
15800 St. Rt. 64 E
Bradenton, FL 34212
Want to change how you receive these emails?
You can
update your preferences
or
unsubscribe from this list.


Tutorial: F# Verbal Expressions
The VerbalExpressions
module includes the FsRegEx
type which wraps the familiar .NET RegEx
in a type with useful functional members.
Multiple constructors start with a regular expression in the constructor.
1:
|
|
This the module is an experimental DSL that allows you to compose regular expressions in natural language
using the immutable FsRegEx
type. The remainder of this tutorial is concerned with the experimental DSL which is, frankly, not that practical.
For practical examples of using the core FsRegEx
module for composability, see the following examples:
Verbal Expressions DSL
You can compose values of the FsRegEx type with the |> operator, including creating a new regular expression by logical or on 2 existing FsRegExs.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: |
|
Natural language composition consists of building up a new FsRegEx from an old by functions which append special characters, groups, modifiers, and other attributes of the regular expression language.
function : 'T -> FsRegEx -> FsRegEx
See the API documentation for all the regular expression functions available.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: |
|
You do not have to worry about escaping special characters in your regular expression.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: |
|
Sometimes you may need more power than the natural language provides, or you just need to include a snippet of native regular expression. The add function lets you do that.
1: 2: 3: 4: 5: 6: 7: 8: 9: |
|
FsRegExs posses all the power of the .Net RegEx class in a composable form.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: |
|
FsRegEx comes with first class support for unicode, including unicode general categories and .Net extension blocks.
1: 2: 3: 4: 5: 6: 7: 8: 9: |
|


Page 1 of 1
game options
Posted:
Mon Jan 26, 2009 5:44 pm
by deathstalker
so what does everyone think that this
game needs in the long run. i mean
we all play alot of different games
and most of us either came here from
xenimus or still play the game(i don't know why)
or diablo or whatever.just curious has to what everyone
thinks.
Re: game options
Posted:
Mon Jan 26, 2009 6:17 pm
by Karl G.
I'm very interested to hear everyone's opinions. I have a plan, but it would help a lot to know what other people think needs to happen.

Crafts
Raid Bosses(make them spawn often and drop less, where ej has it at spawn less and drop more is bad. At least being about to fight a raid boss is fun.)
Shrines(the general easy stat shrines, along with super hard +100 hp + 100 mp shrines or something, also shrines for spells. Like super hard shrines you need to be level X to enter, 1 for each class to obtain a high level spell.)
Chests(have them in dungs where you can only find the key to it in that dung)
Quests with decent quest log(kills quests,shrine quests, raid boss quests, craft quests, quests for dung keys, etc)
or u mean like this stuff:
Friends list
Whisper function -- these 3 more or less together
black list
guilds(have 1 leader who can add/kick/appoint 2 marshals that can add/kick)/guild chat
party system / party chat
Re: game options
Posted:
Tue Jan 27, 2009 9:31 pm
by Rabit561
deathstalker wrote:so what does everyone think that this
game needs in the long run. i mean
we all play alot of different games
and most of us either came here from
xenimus or still play the game(i don't know why)
or diablo or whatever.just curious has to what everyone
thinks.
In the long run, this game has ALOTTA work. So I don't think you should even start thinking about that stuff yet XD
Think about what needs to be done NOW then think about the cool little details, just like a blue-print start the outlines, then so on and so forth
Re: game options
Posted:
Wed Jan 28, 2009 5:23 pm
by deathstalker
thank all who have responded.
Re: game options
Posted:
Mon Feb 09, 2009 10:18 am
by deathstalker
broken that is some good ideas and i like them.
the bad thing with the guild system on xen is that if you
-kick someone it kicks all or you have to find the exact
person and his location.and from a guild leader myself
this can be very difficult.any one that reads this post please
input what you think this game needs.no idea is stupid or dumb.
we really need feedback to help karl out.


WITNESS LIST Government Organization Committee April 23, 2003 - 1:00P HB 660 Registering, but not testifying: On: Carothers, Jeff Attorney with Dept. of Public Safety (Department of Public Safety), Austin, TX Zukowski, Dr. Jim Director, Prof. Licensing Division (Texas Department of Health), Austin, TX HB 1075 Registering, but not testifying: On: Mauzy, Renee' Attorney (Texas Department of Information Resources), Austin, TX SB 270 FOR: Bresnen, Steve Attorney (Bingo Internet Group) Castlebury, Glen Texas Elks State Assn. (Texas Elks), Austin, TX Ives, Sharon owner of Fort Worth Bookkeeping Inc. (44 non-profit bingo licenses), Fort Worth, TX ON: Branom, Ed Bingo Commercial Lessor (East Plano Bingo), Plano, TX Moore, Danny Bingo Distributor (Texas Bingo Distributer Assoc.), Houston, TX Paynter, Susan Citizenship Education (Christian Life Commission- Tx. Baptist Convention), Austin, TX Ware, Weston Consultant (Texans Against Gambling), Dallas, TX Registering, but not testifying: For: Ace, Albert R. Attorney (Scientific Games International), Austin, TX Arnold, J. Phillip CEO- The Reunion Institute (Houston Area Charities), Houston, TX Bickell, Cliff Printing Instant Lottery tickets (Scientific Games), Alphaaretta, GA Erwin, Alan Political Consultant (Bingo Intevests) Fenogino, Stephen Attorney (Over 950 Charitable 4 Business Organ), Austin, TX Garcia, Joe A. (Satellite Bingo Network), Austin, TX Ingersoll, Deborah Political Consultant (Bingo Intrests), Austin, TX McNally, James F. Attorney (GameTech International, Inc.), Austin, TX Thompson, Jane Thompson Allstate Bingo Supply, Inc. (myself and Texas Bingo Distributor Assoc.), Austin, TX Weinstein, Bernard L. economist (Scientific Games), Dallas, TX Woodard, Shayne Lobbyist (Game Tech International) On: Atkins, Billy Director, Charitable Bingo Operations (Texas Lottery Commission), Austin, TX Biles, Susan Research Analyst (Texas Comptroller), Austin, TX Grief, Gary Deputy Executive Director (Texas Lottery Commission), Austin, TX Kiplin, Kimberly General Counsel (Texas Lottery Commission), Austin, TX Latta, Karen (Sunset Advisory Commission), REJ Bldg. 6th Floor, TX LeBas, James (Comptrollers Office) SB 1771 FOR: Goodall, Dr. Randy Director of R & D (Sematech), Austin, TX Powers, Pike Attorney (Texas Technology Initiative- Gov's working group) Sprnull, Bill Economic Development (Greater Dallas Chamber), Dallas, TX Registering, but not testifying: For: Chiodo, Dana Consultant (American Electronics Association), Austin, TX Farley, Craig W. Semiconductors (Canyon Semiconductor), Austin, TX Harris, Ron Collin County Judge (Collin County), McKenney, TX Hentges, Sandy Vice President Public Policy (Greater Austin Chamber) Keleher, Tim Manager (Fort Worth Chamber of Commerce), Fort Worth, TX Kester, Steve Legislative Director (American Electronics Association), Austin, TX Kowalski, Tom (Texas Healthcare and Bioscience Institute), Austin, TX Krier, Joe President/ CEO (Greater San Antonio Chamber), San Antonio, TX Leppert, Thomas Chairman/CEO, The Turner Corp. (Chair, Greater Dallas Chamber), Dallas, TX Nickerson, Glen Vice President, Chief Operations Officer (Canyon Semiconductor, Inc.), Austin, TX Ratliff, Jr., Shannon Attorney/ Bracewell & Patterson LLP (Texa Technology Initiative), Austin, TX Rollins, Mike Pres. (Greater Austin Chamber of Commerce), Austin, TX Saathoff, Dave Chief Administrative Officer (Sematech), Austin, TX Simmons, Al Architect (Texas Technology Initiative) Snyder, Sue Lawyer (Advanced Micro Devices, Inc.), Austin, TX Taylor, Steve Director, Corporate Affairs (Applied Materials), Austin, TX White, Michael L. Attorney/ Consultant (Greater Houston Partnership), Austin, TX SB 1818 AGAINST: Axe, Albert R. Attorney (Scientific Games International), Austin, TX Bickel, Cliff Printing Instant Lottery tickets (Scientific Games), Alpharetta, GA Weinstein, Bernard L. Economist (Scientific Games), Dallas, TX ON: Bennett, Ridgley Deputy General Counsel (Texas Lottery Commission), Austin, TX Trevino, Nelda Director, Governmental Affairs (Texas Lottery Commission) SB 1819 AGAINST: Axe, Albert R. Attorney (Scientific Games International), Austin, TX Bickel, Cliff Printing Instant Lottery tickets (Scientific Games), Alpharetta, GA Weinstein, Bernard L. Economist (Scientific Games), Dallas, TX ON: Bennett, Ridgley Deputy General Counsel (Texas Lottery Commission), Austin, TX Trevino, Nelda Director, Governmental Affairs (Texas Lottery Commission)


{{extend 'layout.html'}} {{block statusbar}} {{end}} {{block moreincludes}} {{end}}
For the purposes of this Agreement, “directory information,” “de-identified student information,” “school purposes,” “student information,” “student records,” “studentgenerated content,” and “targeted advertising” shall be as defined by Conn. Gen. Stat. § 10-234aa.


Azure Database for MySQL/PostGreSQL (preview)
Offering
mysql and postgres databases (both currently preview)
Features
up to 100 Compute Units (Basic Tier)
Up to 1050 GB, can be increased by 125 GB
Low Latency Read Replicas, up to 15 in three AZ
Available
Backup & Recovery
no integrated service for backup and recovery at the moment
Engines
mysql 5.6.35 & 5.7.17
postgresql 9.5 - 9.6
Hints
BYOL not possible
manages patching for minor version updates, major updates not possible
MySQL / PostGreSQL Database
Offering
mysql and postgres databases (both currently preview)
Features
up to 100 Compute Units (Basic Tier)
Up to 1050 GB, can be increased by 125 GB
Low Latency Read Replicas, up to 15 in three AZ
Available
Backup & Recovery
no integrated service for backup and recovery at the moment
Engines
mysql 5.6.35 & 5.7.17
postgresql 9.5 - 9.6
Hints
not from Microsoft directly, via intigrated Marketplace (ClearDB)
BYOL not possible
shared and dedicated database types possible


Introduction
This tutorial will give you an introduction to what you can expect as you progress through the game. Each part of the tutorial should take you just a few minutes, though if you have to look up how to do something it might take longer. Googling is fine, even in the tutorial, so do as much research as you need. If you're having difficulty with something, feel free to submit an issue on Github. If you're repeatedly having trouble with these problems, it might be worthwile to pause for a bit and refresh your fundamental Python skills before moving on with Excision. We will walk through an example problem together; then, there will be some practice problems for you to try.
Hello, World!
Imagine you're given the following task:
Create a program that writes "Hello, World!" to Excision/results/tutorial/hello.txt (without the quotes).
Take a second to make sure you could do that. You need to know...
- where you installed Excision,
- how to write a string to a file, and
- how to close a file properly.
The bioinformatics equivalent of "Hello, World!" is slightly more difficult. Let's calculate the GC content of a nucleotide sequence...
Submitting Scripts
Try completing this problem:
Create a program that takes a nucleotide sequence as an argument and writes the GC content (to the nearest whole percent) to Excision/results/tutorial/gc.txt.
Below is a sample sequence, how you could execute your program on the command line, and the result that you should expect from your program given this sample sequence.
Example
We want to know the GC content of 'ATATGCGC'.
Execution:
$ ./gc_calc.py ATATGCGC
After executing your code with the sequence shown above, your output file should show your result.
Result:
50%
Once you've written this script, you can test it out with the 'Submit Problem' button below. Just to see what happens, you should make sure to submit an incorrect script first.
Note(s):
- If you've never written a script that accepts commandline arguments, here is an appropriate StackOverflow question on the subject.
- Usually, correctly submitting a problem will reroute you to the next level. That's not going to happen here, but you can expect it in the future.
Good job! Your answer to this problem was correct!
Tasks and Hints
There will be optional tasks available below the main problem for each level. Your reward for solving each task is a hint to assist you in your completion of the main problem. The tasks will be small (generally just a few of lines of code), so it'll be up to you to decide whether taking the time to solve for the hint is worthwhile. In general, the tasks are less bioinformatics-related than the main problems. Instead, they'll focus on introducing you to new parts of Python and its ecosystem that might come in handy further down the road.
Another difference between the tasks and the problems is that tasks only require you to write a function instead of an executable file. A successful task submission includes a correct function named according to the task instructions. Everything else in the submission is ignored; thus, you can include as many functions in a single document as you'd like, resubmitting the document for multiple tasks. Alternatively, you can create a new document for each function. The choice is yours.
Now, let's try another problem. This one is a bit harder, so it might be worthwhile to solve the tasks. Even if you already know how to solve this problem, solve at least one task so you know what to expect from both tasks and hints.
Problem
Create a program that reads a .csv file containing numbers.
Find the largest sum of any row or column.
Write the result, to the nearest integer, in Excision/results/tutorial/sum.txt
.
Note(s):
- The correct answer is guaranteed to be unique, so you don't have to worry about dealing with a tie.
Example
Contents of /path/to/numbers.csv
:
5,1,8,7
4,5,7,8
8,7,1,6
3,7,6,8
Execution:
$ ./row_col_max.py /path/to/numbers.csv
Result:
29
Task
Write a function called squared_sum
.
It should take a list as a parameter.
squared_sum
should find the sum of squares of the list and return that sum as a float.
Hint:
This is a multi-part hint:
- Notice the form of this task, as opposed to the main questions. Code for hints will generally require you to write a function instead of a script.
-
Besides the concept of hints, the second purpose of this question is to introduce you to the concept of using modules.
You can solve this question without importing anything. But the line
import numpy as np
will make the question significantly easier. You'll want to import some module in virtually every following question.
Task
Write a function called seen
.
It should take two lists as parameters and return a third list.
The returned list should contain only the unique items in the second list—that is, the elements that are in the second list but not the first list.
If there are redundant items in the second list (e.g., [1, 1]
), only include a single instance in the third list.
Hint:
We'll introduce other ways to read data files, but numpy provides some basic help.
Read up on np.loadtxt
to get your data as an array.
Once you have the array, you have access to the power of numpy.
There are a lot of things which can be done with arrays.
Some of the most common features are well introduced in the quickstart of the offical numpy documentation.
The function that will help you most at the moment is sum
.


Welcome to NEORL Website!¶
This project is still under beta testing
Primary contact to report bugs/issues: Majdi I. Radaideh<EMAIL_ADDRESS>NEORL (NeuroEvolution Optimisation with Reinforcement Learning) is a set of implementations of hybrid algorithms combining neural networks and evolutionary computation based on a wide range of machine learning and evolutionary intelligence architectures. NEORL aims to solve large-scale optimisation problems relevant to operation & optimisation research, engineering, business, and other disciplines.
Github repository: https://github.com/mradaideh/neorl
Copyright¶
This repository and its content are copyright of Exelon Corporation © in collaboration with MIT Nuclear Science and Engineering 2021. All rights reserved.
You can read the first successful application of NEORL for nuclear fuel optimisation in this News Article.
User Guide¶
- Advantage Actor Critic (A2C)
- Deep Q Learning (DQN)
- Proximal Policy Optimisation (PPO)
- Actor-Critic with Experience Replay (ACER)
- Actor Critic using Kronecker-Factored Trust Region (ACKTR)
- Evolution Strategies (\(\mu,\lambda\)) (ES)
- Particle Swarm Optimisation (PSO)
- Differential Evolution (DE)
- Exponential Natural Evolution Strategies (XNES)
- Grey Wolf Optimizer (GWO)
- Prioritized replay Evolutionary and Swarm Algorithm (PESA)
- Modern PESA (PESA2)
- Simulated Annealing (SA)
- Salp Swarm Algorithm (SSA)
- Whale Optimization Algorithm (WOA)
- Moth-flame Optimization (MFO)
- JAYA Algorithm
- Bat Algorithm (BAT)
- Harris Hawks Optimization (HHO)
- Example 1: RL Optimization
- Example 2: Ackley with EA
- Example 3: Welded-beam design
- Example 4: Benchmarks
- Example 5: CEC’2017 Test Suite
- Example 6: Three-bar Truss Design
- Example 7: Pressure Vessel Design
- Example 8: Pressure Vessel Design with Demonstration of Categorical Parameter
- Example 9: Cantilever Stepped Beam
Projects/Papers Using NEORL¶
1- Radaideh, M. I., Wolverton, I., Joseph, J., Tusar, J. J., Otgonbaatar, U., Roy, N., Forget, B., Shirvan, K. (2021). Physics-informed reinforcement learning optimization of nuclear assembly design. Nuclear Engineering and Design, 372, p. 110966 [LINK1].
2- Radaideh, M. I., Shirvan, K. (2021). Rule-based reinforcement learning methodology to inform evolutionary algorithms for constrained optimization of engineering applications. Knowledge-Based Systems, 217, p. 106836 [LINK2].
3- Radaideh, M.I., Forget, B., Shirvan, K. (2021). Application of Reinforcement Learning Optimisation Methodology to BWR Assemblies ,” In: Proc. International Conference on Mathematics & Computational Methods Applied to Nuclear Science & Engineering (M&C 2021), Rayleigh, North Carolina, USA, October 3-7, 2021.
Citing the Project¶
To cite this repository in publications:
@misc{neorl,
author = {Radaideh, Majdi I. and Seurin, Paul and Wang, Haijia and Shirvan, Koroush},
title = {NEORL},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/mradaideh/neorl}},
}
Acknowledgments¶
NEORL was established in MIT back to 2020 with feedback, validation, and usage of different colleagues: Issac Wolverton (MIT Quest for Intelligence), Joshua Joseph (MIT Quest for Intelligence), Benoit Forget (MIT Nuclear Science and Engineering), Ugi Otgonbaatar (Exelon Corporation).


Registration form
Firstname
Lastname
Date of Birth
EmailId
MobileNumber
>Address
Gender
Department
Submit
Submit
Cancel
Cancel


Features
Swift
A B16 Fusion chip with 64-bit architecture and 8GB of RAM brings the smoothest user experience to you.
Vivid
The HD display is so impressive that you won't believe it's merely a screen.
Long-lasting
Exceptional battery life of up to 18 hours of talk and 1,500 hours standby.
Developer-friendly
BerryOS, solely developed by Blurberry Inc., is POSIX-certified, which makes developers' lives much easier.


Baseball Hall of Fame 2020: Ballot, voting and eligibility rules
by Joe RiveraHall of Fame voting season is upon us.
This year features 32 players, including 19 first-timers. It's headlined by a few interesting stories, as usual: How many votes will Derek Jeter get? Will Larry Walker finally make it in? What will come of Barry Bonds and Roger Clemens?
FAGAN: Derek Jeter is the only sure thing on 2020 ballot
There are a number of sneaky-underrated players on this year's ballot as well, including Bobby Abreu, Andy Pettitte and Cliff Lee.
The ballot, voting and eligibility rules are all available below.
2020 Baseball Hall of Fame ballot
The 2020 Hall of Fame ballot features 32 players, including 19 first-year players.
All WAR numbers courtesy of Fangraphs.
| Player | Position | Year on ballot | Team(s) | Career WAR |
|---|---|---|---|---|
| Derek Jeter | SS | 1 | NYY | 73.0 |
| Bobby Abreu | OF | 1 | HOU, PHI, NYY, LAA, LAD, NYM | 59.8 |
| Josh Beckett | SP | 1 | FLA, BOS, LAD | 36.3 |
| Heath Bell | RP | 1 | NYM, SDP, MIA, ARI, TBR | 9.9 |
| Adam Dunn | 1B/OF | 1 | CIN, WSH, ARI, CWS, OAK | 25.6 |
| Chone Figgins | IF | 1 | ANA/LAA, SEA, LAD | 22.2 |
| Raul Ibanez | OF | 1 | SEA, KCR, PHI, NYY | 19.3 |
| Jose Valverde | RP | 1 | ARI, HOU, DET, NYM | 8.5 |
| Carlos Pena | 1B | 1 | TEX, OAK, DET, BOS, TBD/TBR, CHC, KCR | 18.9 |
| Brad Penny | SP | 1 | FLA/MIA, LAD, BOS, SFG, STL, DET | 26.7 |
| J.J. Putz | RP | 1 | SEA, NYM, CWS, ARI | 10.2 |
| Brian Roberts | 2B | 1 | BAL, NYY | 29.7 |
| Eric Chavez | 3B | 1 | OAK, NYY, ARI | 37.2 |
| Jason Giambi | 1B/DH | 1 | OAK, NYY, COL, CLE | 49.8 |
| Rafael Furcal | IF | 1 | ATL, LAD, STL, MIA | 33.1 |
| Paul Konerko | 1B | 1 | LAD, CWS | 24.0 |
| Cliff Lee | SP | 1 | CLE, PHI, SEA | 48.2 |
| Alfonso Soriano | 2B | 1 | NYY, TEX, WSH, CHC | 38.9 |
| Todd Helton | 1B | 2 | COL | 54.9 |
| Andy Pettitte | SP | 2 | NYY, HOU | 68.2 |
| Andruw Jones | OF | 3 | ATL, LAD, TEX CWS, NYY | 67.0 |
| Scott Rolen | 3B | 3 | PHI, STL, TOR, CIN | 69.9 |
| Omar Vizquel | SS | 3 | SEA, CLE, SFG, TEX, CWS, TOR | 42.5 |
| Manny Ramirez | OF | 4 | CLE, BOS, LAD | 66.3 |
| Billy Wagner | RP | 5 | HOU, PHI, NYW, ATL | 24.0 |
| Gary Sheffield | OF | 6 | MIL, FLA, LAD, ATL, NYY, DET, NYM | 62.1 |
| Jeff Kent | 2B | 7 | NYM, SFG, HOU, LAD | 56.0 |
| Roger Clemens | SP | 8 | BOS, TOR, NYY, HOU | 133.7 |
| Barry Bonds | OF | 8 | PIT, SF | 164.4 |
| Curt Schilling | SP | 8 | BAL, HOU, PHI, ARI, BOS | 79.8 |
| Sammy Sosa | OF | 8 | CWS, CHC, BAL, TEX | 60.1 |
| Larry Walker | OF | 10 | MON, COL, STL | 68.7 |
When will Baseball Hall of Fame results be released?
Voting results for the 2020 Hall of Fame class will be revealed Jan. 21.
Baseball Hall of Fame voting rules, eligibility
Active Baseball Writers' Association of America(BBWAA) members of 10 years or longer receive a ballot, including Sporting News' Ryan Fagan. Writers can vote for up to 10 players on the ballot. Writers may also submit a blank ballot, which counts against players on the ballot. Writers can also abstain from voting by not submitting a ballot.
Players are eligible for the Hall of Fame ballot five years aftertheir retirement, as long as theyplayed at least10 seasons in the majors. If a player unretires during the five years, then the clock for Hall of Fame eligibility is restarted.
Players are removed from the ballot if they do not receive at least 5 percent of the vote while on the ballot. Players are voted in if they receive 75 percent or more of the vote.


---
layout: default
url: contact-us
title: Contact Us
description: "Whether you are a current client or someone interested in talking with us, your feedback is very important."
class: contact
banner: contact_us.jpg
banner-heading: "How Can We Help?"
banner-cta: ""
---
Let's Talk
Whether you are a current client or someone interested in talking with us, your feedback is very important. Please use the form to the right to contact us and we will be sure to reply to you as soon as possible or you can call us directly at one of our local branch locations.
-
Headquarters
Corporate Office
1-855-863-8503
-
Bay Area California
Landscape Maintenance – Division Office
1-855-863-8504
-
Greater Denver Colorado
Landscape Maintenance – Division Office
1-855-863-8503
-
Greater Sacramento
Landscape Maintenance – Division office
1-877-373-1955
-
Public Infrastructure Maintenance - Division Office
1-855-863-8503
-
Greater Salt Lake, Utah - Maintenance Operations
-
Dallas/Fort Worth Metroplex
Landscape Maintenance - Branch office
972-445-5654
-
Other TCA Locations
-
Milpitas – South Bay office 1194 Ames Avenue, CA 95035
-
Livermore – 2617 South Vasco Road, CA 94550
-
Oakley – 5120 Neroly Road, CA
-
Sacramento - 4730 Myrtle Ave, CA


npm install vue-gemini-scrollbar --save
All demos were rewrite by vue-gemini-scrollbar from gemini-scrollbar/examples


In the world of Antreia there is a blind young man capable of doing incredible things. His name is Jasper and he is just discovering his unique abilities.  This life has been taken from him because of the lost of the only person he'd ever loved. Now he goes on the quest to find his revenge. He doesn't now he's destined to save the world...
The Blind Wizard of Antreia is a Sound Novel type game. In short words – the game is an interactive audiobook wherein user is controlling his character by locating source of sound in 3D space and walking towards it. Additionally, he needs to resolve a lots of mind entertaining sound riddles on his way. This project is currently work in progress.
Audio Trailer:
Follow the sounds, move around in the world.
You can hear events, people and objects from different directions.
You have to face different challanges along your way.
Created with blind people in mind.


{% extends "newsletters/base.html" %} {% block content %}
Enter your e-mail to manage your subscriptions
{{ form.email.label_tag }}: {{ form.email }}


delay
Syntax
delay (duration : int)
Description
The delay statement is used to cause the program to pause for a given time. The time duration is in milliseconds.
Example
This program prints the integers 1 to 10 with a second delay between each.
for i : 1 .. 10
put i
delay (1000) % Pause for 1 second
end for
Details
On Apple Macintoshes, the hardware resolution of duration is in units of 17 milliseconds (1/60th of a second). For example, delay(500) will delay the program by about half a second, but may be off by as much as 17 milliseconds.
See also
sound, clock, sysclock, wallclock, time and date statements.
See also predefined unit Time.


Wall Street close: Benchmarks set fresh record closes on upbeat trade headlines
by Ross J Burland- DJIA was advancing 190.92 points, or 0.7%, close at to 28,066.61.
- The Nasdaq was climbing 112.60 points, or 1.3%, to close at 8,632.49.
- S&P 500 added 23.35 points, or 0.8%, to close at 3,133.64.
US benchmarks were making record highs and closes on Monday following the optimism in Sino/US trade-deal headlines along with a spate of merger activity which investors cheered.
The Dow Jones Industrial Average, DJIA, finished the day above its previous closing high of 28,036.22 set on the 18th November by advancing 190.92 points, or 0.7%, close at to 28,066.61. Meanwhile, the S&P 500 also beat its prior closing record of 8,570.66 set on November 19th adding 23.35 points, or 0.8%, to close at 3,133.64. The Nasdaq also ended the session above the prior closing high of 3,122.03 set on November 18th climbing 112.60 points, or 1.3%, to close at 8,632.49. Similarly, European markets were also bid. In Europe, the DAX was up 0.6% and the FTSE 100 has lifted 0.9% despite sterling’s strength.
Catalysts for the upbeat tone
The main catalyst for the bid in global equities was on the back of a weekend report that the Chinese government was calling for more protection of intellectual property rights. Meanwhile, in corporate news, The Charles Schwab Corp. and TD Ameritrade announced a merger deal – Schwab will acquire Ameritrade in an all-stock transaction valued at around $26 billion.
US data in focus, little bearing on stocks
Meanwhile, as for data, it s was second-tier stuff, although it will be paid attention to by the Fed. the Chicago National Activity Index fell to -0.71 in October from September’s -0.45 read, its lowest reading since April ...
"The index is designed that a reading below/above 0 indicates below/above-trend growth. With some early Q4 data disappointing, the question for the Fed is whether this dip is temporary or something more permanent. The baseline expectation is that it is temporary. Meanwhile, the November Dallas Fed manufacturing index rose to -1.3 in November from -5.1 in October," analysts at ANZ Bank explained.
DJIA levels
DJIA
| Overview | |
|---|---|
| Today last price | 28062 |
| Today Daily Change | 174.00 |
| Today Daily Change % | 0.62 |
| Today daily open | 27888 |
| Trends | |
|---|---|
| Daily SMA20 | 27605.3 |
| Daily SMA50 | 27117.28 |
| Daily SMA100 | 26849.42 |
| Daily SMA200 | 26449.12 |
| Levels | |
|---|---|
| Previous Daily High | 27896 |
| Previous Daily Low | 27774 |
| Previous Weekly High | 28164 |
| Previous Weekly Low | 27676 |
| Previous Monthly High | 27280 |
| Previous Monthly Low | 25744 |
| Daily Fibonacci 38.2% | 27849.4 |
| Daily Fibonacci 61.8% | 27820.6 |
| Daily Pivot Point S1 | 27809.33 |
| Daily Pivot Point S2 | 27730.67 |
| Daily Pivot Point S3 | 27687.33 |
| Daily Pivot Point R1 | 27931.33 |
| Daily Pivot Point R2 | 27974.67 |
| Daily Pivot Point R3 | 28053.33 |


Heat Exchangers¶
Introduction¶
The module heatexchangers
contains methods to perform heat transfer
calculations related to heat exchangers.
The module has methods for the following:
Calculation of F factors
Calculation of effectiveness and NTU
Calculation of overall heat coefficient from NTU
How to use
It is recommended that the module be imported
as from pychemengg import heatexchangers as hx
The following examples demonstrate how the module heatexchangers` can be used to solve heat transfer problems.
Examples¶
Example 1: Counter flow LMTD
¶
Example 1.
Hot fluid (Cp=2.09 kJ/kg-K) flows through a counter flow
heat exchanger at a rate of 0.63 kg/s. It enter at 193 C and leaves
at 65 C. Cold fluid (Cp=1.67 kJ/kgK) exits at 149 C at a rate of
1 kg/s. What area is required if the overall heat transfer
coefficient based on the inside area is 0.7 kW/m2K. Ans: Area = 8.5 m2
# EXAMPLE 1 from pychemengg.heattransfer import heatexchangers as hx from pychemengg.heattransfer import heatcommonmethods as hcm # Use change in internal energy to compute heat transfered heattransfer_hot = hcm.calc_internalenergychange(mass=0.63, specificheat=2.09e3, deltaT=193-65) # heattransfer_hot = heattransfer_cold, use this to find inlet # temperature of cold fluid T_cold_in = 149 - heattransfer_hot/1.67e3 # compute LMTD deltaT1 = 65-T_cold_in deltaT2 = 193-149 LMTD = hcm.calc_LMTD(deltaT1=deltaT1, deltaT2=deltaT2) correctionfactor = 1 # Because counterflow # compute area using convection equation area = heattransfer_hot/0.7e3/LMTD print(f"Area required = {area: 0.1f} m2") # PRINTED OUTPUT Area required = 8.5 m2
Example 2: Double-pipe Effectiveness-NTU
¶
Example 2.
A fluid (Cp = 4.18 kJ/kgK) enters a parallel flow, double-pipe heat
exchanger at 40 C at 0.75 kg/s. It is heated by a second fluid (Cp = 1.581 kJ/kgK)
flowing at a rate of 1.5 kg/s with inlet temperature 115 C. If the area is 13 m2
and overall heat transfer coefficient is 0.205 kW/m2K, find
the total heat rate. Ans: heat rate = 87.17 kW
# EXAMPLE 2 from pychemengg.heattransfer import heatexchangers as hx # Use effectiveness-NTU method. Ccold = 0.75*4.18e3 Chot = 1.5*1.581e3 # Print both to see which is Cmin print(f" Chot = {Chot} and Ccold = {Ccold}") # This produces: Chot = 2371.5 and Ccold = 3135.0 # Based on this, assign Cmin and Cmax. Cmin = Chot Cmax = Ccold # Calculate NTU = UA/Cmin NTU = .205e3 * 13/Cmin # Next given this NTU find effectiveness. # First create instance of EffNTU class doublepipe = hx.EffNTU(Cmin=Cmin, Cmax=Cmax, NTU=NTU, effectiveness="?") # The keyword - 'effectiveness' is assigned the string "?". # This alerts the function that effectiveness is to be computed. # Then call the appropriate exchanger type to compute effectiveness. effectiveness = doublepipe.doublepipe_parallelflow() heatratemax = Cmin*(115-40) heatrate_actual = effectiveness * heatratemax print(f"Heat rate = {heatrate_actual: 0.3e} W") # PRINTED OUTPUT Heat rate = 8.719e+04 W
Example 3: Comparison of cross flow and shell and tube F correction factors
¶
Example 3.
An exchanger is desired for operation with Thot,in = 400 C,
Thot,out = 130 C, and Tcold,in = 25 C. The following
is known about the system:
Hot fluid: mass flow rate = 2 kg/s, specific heat = 2000 J/kg k
Cold fluid: mass flow rate = 6.857 kg/s, specific heat = 1050 J/kgK
Overall heat transfer coefficient = 150 W/m2K
Compare i) shell and tube heat exchanger design with ii) cross flow exchanger with both fluids unmixed. Find the suitable configurations.
Ans: 2 Shell - 4 tube: F = 0.93, area = 48.64 m2; Cross flow: F = 0.85, area = 53.8 m2
# EXAMPLE 3 from pychemengg.heattransfer import heatexchangers as hx from pychemengg.heattransfer import heatcommonmethods as hcm # Use energy balance to find T_cold_out mass_hot = 2 specificheat_hot = 2000 T_hot_in = 400 T_hot_out = 130 deltaT_hot = T_hot_in - T_hot_out hot_internalenergychange = hcm.calc_internalenergychange(mass=mass_hot, specificheat=specificheat_hot, deltaT=deltaT_hot) mass_cold = 6.857 specificheat_cold = 1050 T_cold_in = 25 T_cold_out = T_cold_in + hot_internalenergychange/mass_cold/specificheat_cold # case: shell-tube # Calculate LMTD. deltaT_1 = T_hot_in - T_cold_out deltaT_2 = T_hot_out - T_cold_in LMTD = hcm.calc_LMTD(deltaT1=deltaT_1, deltaT2=deltaT_2) print(f"LMTD = {LMTD: 0.1f} C") # Calculate F correction factor. exchanger = hx.FCorrectionFactor() oneshelltube_F_factor = exchanger.oneshell2ntubepasses(T_tubein=T_cold_in, T_tubeout=T_cold_out, T_shellin=T_hot_in, T_shellout=T_hot_out) print(f"1-Shell 2-Tube F Factor = {oneshelltube_F_factor: 0.2f}") # The F factor is 0.58, which is quite low. # Therefore the 2 shell-4 pass configuration can be examined. twoshelltube_F_factor = exchanger.twoshell4ntubepasses(T_tubein=T_cold_in, T_tubeout=T_cold_out, T_shellin=T_hot_in, T_shellout=T_hot_out) print(f"2-Shell 4-Tube F Factor = {twoshelltube_F_factor: 0.2f}") # The F factor for 2 shell and 4 tube is 0.93. # Calculate area for this using convection heat rate equation and internal energy change # hot_internalenergychange = U * A * LMTD * F overallheattransfercoefficient = 150 area_shelltube = hot_internalenergychange/overallheattransfercoefficient/LMTD/twoshelltube_F_factor print(f"Area needed for 2 shell-4 tube heat exchanger = {area_shelltube:0.2f} m2") # case: cross flow both fluids unmixed # Calculate F factor. crossflow_F_factor = exchanger.singlepass_crossflow_bothunmixed(T_tubein=T_cold_in, T_tubeout=T_cold_out, T_shellin=T_hot_in, T_shellout=T_hot_out) print(f"Cross flow F factor= {crossflow_F_factor: 0.2f}") # Calculate area as was done for shell-tube case area_crossflow = hot_internalenergychange/overallheattransfercoefficient/LMTD/crossflow_F_factor print(f"Area needed for cross flow heat exchanger = {area_crossflow:0.2f} m2") # PRINTED OUTPUT LMTD = 157.5 C 1-Shell 2-Tube F Factor = 0.58 2-Shell 4-Tube F Factor = 0.93 Area needed for 2 shell-4 tube heat exchanger = 49.32 m2 Cross flow F factor= 0.85 Area needed for cross flow heat exchanger = 53.70 m2


NSCD.CONF
Section: Linux Programmer's Manual (5)Updated: 1999-10-01
Index Return to Main Contents
NAME
/etc/nscd.conf - name service cache daemon configuration fileDESCRIPTION
The file /etc/nscd.conf is read from nscd(8) at startup. Each line specifies either an attribute and a value, or an attribute, service, and a value. Fields are separated either by SPACE or TAB characters. A aq#aq (number sign) indicates the beginning of a comment; following characters, up to the end of the line, are not interpreted by nscd.Valid services are passwd, group, or hosts.
logfile debug-file-name
- Specifies name of the file to which debug info should be written.
debug-level value
- Sets the desired debug level.
threads number
- This is the number of threads that are started to wait for requests. At least five threads will always be created.
server-user user
- If this option is set, nscd will run as this user and not as root. If a separate cache for every user is used (-S parameter), this option is ignored.
enable-cache service <yes|no>
- Enables or disables the specified service cache.
positive-time-to-live service value
- Sets the TTL (time-to-live) for positive entries (successful queries) in the specified cache for service. Value is in seconds. Larger values increase cache hit rates and reduce mean response times, but increase problems with cache coherence.
negative-time-to-live service value
- Sets the TTL (time-to-live) for negative entries (unsuccessful queries) in the specified cache for service. Value is in seconds. Can result in significant performance improvements if there are several files owned by UIDs (user IDs) not in system databases (for example untarring the linux kernel sources as root); should be kept small to reduce cache coherency problems.
suggested-size service value
- This is the internal hash table size, value should remain a prime number for optimum efficiency.
check-files service <yes|no>
- Enables or disables checking the file belonging to the specified service for changes. The files are /etc/passwd, /etc/group, and /etc/hosts.
max-threads threads
- Specifies the maximum number of threads to be started.
stat-user username
- Specifies the user who is allowed to request statistics.
reload-count unlimited | number
- Limit on the number of times a cached entry gets reloaded without being used before it gets removed. The default is 5.
paranoia <yes|no>
- Enabling paranoia mode causes nscd to restart itself periodically.
restart-interval time
- Sets the restart interval to time seconds if periodic restart is enabled by enabling paranoia mode.
persistent service <yes|no>
- Keep the content of the cache for service over server restarts; useful when paranoia mode is set.
shared service <yes|no>
- The memory mapping of the nscd databases for service is shared with the clients so that they can directly search in them instead of having to ask the daemon over the socket each time a lookup is performed.
max-db-size service number-of-bytes
- The maximum allowable size for the service.
auto-propagate service <yes|no>
- When set to no for passwd or group service, then the .byname requests are not added to passwd.byuid or group.bygid cache. This may help for tables containing multiple records for the same id.
SEE ALSO
nscd(8)COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.
Index
This document was created by man2html, using the manual pages.
Time: 05:34:00 GMT, December 24, 2015


-
1-14-2014 Sixteen people died Tuesday in a fire at a shoe factory in eastern China , state media reported , a blaze which highlights poor workplace safety standards in the country .
-
1-14-2014 The blaze , which started in the afternoon engulfed an area of 800 square metres , said the report , which did not give details on what caused the fire .
-
1-14-2014 Workplace safety standards can be poor in China , where fatal accidents happen regularly at mines and factories , with some blaming lax enforcement of rules .
-
1-14-2014 A total of 20 people were rescued from the fire at the Dadong Shoes factory in Taizhou , Zhejiang province , China Central Television said in a post on its site on Sina Weibo , a Chinese version of Twitter .
-
1-14-2014 A fire at a poultry plant in the northeastern province of Jilin in June killed 120 and injured at least 70 , in China 's deadliest blaze in over a decade .
-
1-17-2014 China Mobile , the country 's biggest wireless provider , on Friday started selling Apple 's iPhone to millions of customers nationwide , ending a six-year wait in a crucial market for the US technology giant .
-
1-17-2014 Apple is fighting for share in China 's competitive smartphone market , and China Mobile 's 760 million-strong customer base and its plans to roll out the world 's largest 4G -LRB- fourth generation -RRB- network have both companies forecasting a fruitful union after a long engagement .
-
1-17-2014 Apple 's iphone 5 At official Apple stores prices for iPhones compatible with each of the country 's operators are identical -- an iPhone 5s with 16 GB of memory costs 5,288 yuan -LRB- $ 867 -RRB- , while a similar-capacity 5c sells for 4,488 yuan .
-
1-17-2014 China Mobile has priced the iPhone 5s roughly around the same levels as competitor China Unicom .
-
1-24-2014 Former Manchester United manager Alex Ferguson is set to take up a role with European football 's governing body as a coaching ambassador , UEFA president Michel Platini said on Friday .
-
1-24-2014 Ferguson , 72 , had a record-breaking 26-and-a-half-year tenure at Old Trafford before retiring at the end of last season after winning his 13th league title with the club .
-
2-14-2014 After building the world 's fastest high speed rail system , China plans to build the world 's longest underwater tunnel .
-
1-25-2014 The Chinese media have experienced a frosty relationship with Li , due to her outspoken nature and the heavy weight of expectation the feisty 31-year-old carries for her 1.36 billion compatriots .
-
1-25-2014 But news organisations led tributes after the fourth seed was crowned the Melbourne Park champion on her third attempt .
-
2-14-2014 China 's transport infrastructure has developed rapidly in recent years , particularly its high-speed rail network , which was only established in 2007 but has fast become the world 's largest .
-
2-21-2014 China has charged with a string of murders and other crimes 36 members of a '' mafia-style '' gang led by a tycoon who once launched a billion-dollar bid for an Australian mining firm , state media said .
-
3-18-2014 The Nigerian Navy has arrested four ships and 22 persons , suspected to be Chinese , who allegedly entered Nigeria 's territorial waters illegally .
-
3-11-2014 Afterwards , she flushes it down the toilet and later killed the man with hammer blows A Chinese woman chopped off her former boyfriend 's penis with scissors and then killed him with a hammer after he raped her , a Hong Kong court heard , according to a report Tuesday .
-
4-2-2014 These resourceful Nigerians have -LRB- in no small way -RRB- contributed to the increase in sales volume of China wares at cheaper price to Nigeria .
-
4-15-2014 As the strategic cooperative partner of Nigeria , China will continue its firm support to the Nigerian government in safeguarding national security and regional stability .
-
4-19-2014 China on Saturday announced the removal of the head of one its major state-owned firms , conglomerate China Resources , for suspected law violations , state media reported using terms which typically refer to corruption .
-
4-25-2014 Many developed European countries do associate the democratic practice with full employment -LRB- unemployment is interpreted as less than 3 per cent of the working population -RRB- .
-
5-11-2014 With the implementation of this and other flagship projects in cooperation with Chinese public and private partners , China has secured a place of honour in the history of Kenya 's economic development .
-
5-18-2014 French President Francois Hollande France 's foreign minister offered China his country 's help on Sunday in locating 10 workers feared kidnapped by Boko Haram militants , as African leaders joined forces to fight the terrorist group .
-
5-28-2014 China was against linking terrorism with any country , ethnic group or religion , and supported enhanced dialogue among nations .
-
5-28-2014 China used mass trials in the 1980s and 90s to try to combat the rise in crime driven by the social upheavals that accompanied the country 's dramatic Reform and Opening economic overhaul , but the practice later faded .
-
5-29-2014 China on Thursday fined several foreign eyewear makers more than 19 million yuan -LRB- $ 3.1 million -RRB- for '' price manipulation '' , the government said , in the latest targeting of overseas firms in the giant market .
-
5-30-2014 In the area of ecological and environmental protection , China has committed to a grant of US$ 10 million in support of closer technical cooperation and experience sharing between China and African countries .
-
6-3-2014 Government officials say within a few years the country 's tobacco production will return to the record of 237 million kg a year achieved before the fast-track land reform went into full swing in 2001 .
-
6-17-2014 Three Chinese football fans have died after staying up all night to watch World Cup matches broadcast from Brazil , reports said on Tuesday .
-
6-17-2014 The report said a 39-year-old Shanghai man died on Sunday after watching World Cup games for three consecutive nights .
-
6-20-2014 RHINOS are known for their distinctive horn or in some cases two horns on their nose .
-
6-24-2014 A college student in China leaped to his death after losing more than $ 3,000 gambling on the World Cup , state media reported Tuesday .
-
7-2-2014 China has banned civil servants , students and teachers in its mainly Muslim Xinjiang region from taking part in Ramadan fasting , government websites said , prompting condemnation from an exile group on Wednesday .
-
7-2-2014 China has in the past said that restrictions on fasting are meant to ensure the health of government employees .
-
7-9-2014 China has become critically important to foreign carmakers , given the size of the market and weak sales elsewhere in the world .
-
7-21-2014 China has been rocked by a series of food and product safety problems , due to lax enforcement of regulations and corner-cutting by producers .
-
7-22-2014 A policeman in China who shot dead a pregnant woman while drunk and injured her husband was executed for the crime Tuesday , state media said .
-
7-25-2014 Jiangbei Cathedral A fire largely destroyed one of China 's oldest churches early Monday , state media reported , gutting the inside of the late 19th century structure .
-
7-23-2014 The state school initiative is welcomed , but there is need for a caveat , government need to provide a conducive environment for that '' ; The population explosion in Nigeria is invariably one of the factors responsible for the soaring crime rate in the country .
-
7-28-2014 The destruction of the Wenzhou church was seen as highlighting tensions between a rapidly growing number of Christian worshippers and China 's officially atheist Communist Party-run government .
-
8-2-2014 Industrial accidents occur with some regularity in China , where safety standards are often lax .
-
8-7-2014 China is banning users of Internet messaging services from posting political reports without permission , and demanding they promise to '' uphold the socialist system '' , state media said Thursday .
-
8-11-2014 Calling China and Africa good brothers , friends and partners , Xi said the Chinese government and people will never forget that the African people will always extend timely support and assistance whenever the Chinese people encounter difficulties , Xi said .
-
8-16-2014 Blood centres in China must double-check a donor 's identity before taking blood , the report said .
-
8-17-2014 There has been no report of violence or falsification of results .
-
8-26-2014 China has become critically important to foreign carmakers , given the size of the market and weak sales elsewhere in the world .
-
8-26-2014 Peugeot has said the Chengdu facility will focus on making crossover vehicles -- between a car and a sport utility vehicle -- and also four-wheel-drives using the Peugeot and Citroen brands , as well as under Dongfeng 's Fengshen label .
-
8-29-2014 Preferential and concessionary loans from China now amount to US$ 1 billion , and grants and interest-free loans US$ 100 million .
-
9-6-2014 China has helped build ports in countries along the vital shipping route .
-
9-12-2014 First , Nigeria and China need to work together on industrial cooperation projects .
-
9-12-2014 From a lowly $ 2 billion 2002 , the volume of bilateral trade between Nigeria and China rose to a $ 13 billion last year .
-
9-12-2014 China is now expected to scale up its trade both quantitatively and qualitatively to reach the goal of increasing the volume of China-Africa trade and China 's direct investment in Africa to $ 400 billion and $ 100 billion respectively .
-
9-21-2014 Forty '' rioters '' were killed in China 's far-western Xinjiang region following a series of explosions last Sunday , the worst incident of violence in months , the regional government has said after a four-day news blackout .
-
10-1-2014 Currently , China contributes 30 per cent to world economy and expects to grow its foreign direct investment to exceed $ 500 billion in the next five years .
-
10-10-2014 President Robert Mugabe of Zimbabwe Energy-starved Zimbabwe signed a $ 1.5 billion -LRB- 1.2-billion-euro -RRB- deal with China 's Sinohydro on Friday for a project to boost power generation at the Hwange coal-fired power station .
-
10-10-2014 Frequent breakdowns of Zimbabwe 's ageing power stations mean the country suffers perennial power-shortages .
-
10-17-2014 Customer deliveries began Friday in the company 's 12 retail stores in mainland China , and through the country 's three major telecom providers and other sales channels .
-
10-23-2014 Dutch food and cosmetics giant Unilever on Thursday posted a third quarter drop in sales down 2.0 percent , blaming a slowdown in emerging markets , particularly in China .
-
11-11-2014 The United States and China have '' reached an understanding '' on an agreement to reduce tariffs on information technology trade , the White House said Tuesday , in what Washington called a boost to WTO efforts to slash trade duties .
-
11-12-2014 Attempts to deal with climate change , which scientists warn is approaching a potentially catastrophic point of no return , have long been stymied by the unwillingness of the United States and China to work together on the problem .
-
11-16-2014 Since the beginning of the year , China has given west African countries a total of 234 million yuan -LRB- $ 38.2 million -RRB- in emergency assistance , including disease prevention and control materials , grain and cash , according to the Chinese foreign ministry .
-
11-27-2014 The non-investment in the oil and gas sector by major international oil companies has added its own deleterious impact . ''