# File lib/heroku/api.rb, line 55 def initialize(options={}) options = OPTIONS.merge(options) @api_key = options.delete(:api_key) || ENV['HEROKU_API_KEY'] if !@api_key && options.has_key?(:username) && options.has_key?(:password) @connection = Excon.new("#{options[:scheme]}://#{options[:host]}", options.merge(:headers => HEADERS)) @api_key = self.post_login(options[:username], options[:password]).body["api_key"] end user_pass = ":#{@api_key}" options[:headers] = HEADERS.merge({ 'Authorization' => "Basic #{Base64.encode64(user_pass).gsub("\n", '')}", }).merge(options[:headers]) @connection = Excon.new("#{options[:scheme]}://#{options[:host]}", options) end
DELETE /apps/:app/addons/:addon
# File lib/heroku/api/addons.rb, line 5 def delete_addon(app, addon) request( :expects => 200, :method => :delete, :path => "/apps/#{app}/addons/#{addon}" ) end
DELETE /apps/:app
# File lib/heroku/api/apps.rb, line 5 def delete_app(app) request( :expects => 200, :method => :delete, :path => "/apps/#{app}" ) end
DELETE /apps/:app/collaborators/:email
# File lib/heroku/api/collaborators.rb, line 5 def delete_collaborator(app, email) request( :expects => 200, :method => :delete, :path => "/apps/#{app}/collaborators/#{email}" ) end
DELETE /apps/:app/config_vars/:key
# File lib/heroku/api/config_vars.rb, line 5 def delete_config_var(app, key) request( :expects => 200, :method => :delete, :path => "/apps/#{app}/config_vars/#{escape(key)}" ) end
DELETE /apps/:app/domains/:domain
# File lib/heroku/api/domains.rb, line 5 def delete_domain(app, domain) request( :expects => 200, :method => :delete, :path => "/apps/#{app}/domains/#{escape(domain)}" ) end
DELETE /apps/:app/domains
# File lib/heroku/api/domains.rb, line 14 def delete_domains(app) request( :expects => 200, :method => :delete, :path => "/apps/#{app}/domains" ) end
DELETE /features/:feature
# File lib/heroku/api/features.rb, line 5 def delete_feature(feature, app = nil) request( :expects => 200, :method => :delete, :path => "/features/#{feature}", :query => { 'app' => app } ) end
DELETE /user/keys/:key
# File lib/heroku/api/keys.rb, line 5 def delete_key(key) request( :expects => 200, :method => :delete, :path => "/user/keys/#{escape(key)}" ) end
DELETE /user/keys
# File lib/heroku/api/keys.rb, line 14 def delete_keys request( :expects => 200, :method => :delete, :path => "/user/keys" ) end
DELETE /apps/:app/ssl-endpoint/:cname
# File lib/heroku/api/ssl_endpoints.rb, line 5 def delete_ssl_endpoint(app, cname) request( :expects => 200, :method => :delete, :path => "/apps/#{app}/ssl-endpoints/#{escape(cname)}" ) end
GET /addons GET /apps/:app/addons
# File lib/heroku/api/addons.rb, line 15 def get_addons(app=nil) path = if app "/apps/#{app}/addons" else "/addons" end request( :expects => 200, :method => :get, :path => path ) end
GET /apps/:app
# File lib/heroku/api/apps.rb, line 23 def get_app(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}" ) end
GET /apps/:app/server/maintenance
# File lib/heroku/api/apps.rb, line 32 def get_app_maintenance(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/server/maintenance" ) end
GET /apps
# File lib/heroku/api/apps.rb, line 14 def get_apps request( :expects => 200, :method => :get, :path => "/apps" ) end
GET /apps/:app/attachments
# File lib/heroku/api/attachments.rb, line 5 def get_attachments(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/attachments" ) end
GET /apps/:app/collaborators
# File lib/heroku/api/collaborators.rb, line 14 def get_collaborators(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/collaborators" ) end
GET /apps/:app/config_vars
# File lib/heroku/api/config_vars.rb, line 14 def get_config_vars(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/config_vars" ) end
GET /apps/:app/domains
# File lib/heroku/api/domains.rb, line 23 def get_domains(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/domains" ) end
GET /features/:feature
# File lib/heroku/api/features.rb, line 25 def get_feature(feature, app = nil) request( :expects => 200, :method => :get, :path => "/features/#{feature}", :query => { 'app' => app } ) end
GET /features
# File lib/heroku/api/features.rb, line 15 def get_features(app = nil) request( :expects => 200, :method => :get, :path => "/features", :query => { 'app' => app } ) end
GET /user/keys
# File lib/heroku/api/keys.rb, line 23 def get_keys request( :expects => 200, :method => :get, :path => "/user/keys" ) end
GET /apps/:app/logs
# File lib/heroku/api/logs.rb, line 5 def get_logs(app, options = {}) options = { 'logplex' => 'true' }.merge(options) request( :expects => 200, :method => :get, :path => "/apps/#{app}/logs", :query => options ) end
GET /apps/:app/ps
# File lib/heroku/api/processes.rb, line 5 def get_ps(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/ps" ) end
GET /apps/:app/releases/:release
# File lib/heroku/api/releases.rb, line 14 def get_release(app, release) request( :expects => 200, :method => :get, :path => "/apps/#{app}/releases/#{release}" ) end
GET /apps/:app/releases
# File lib/heroku/api/releases.rb, line 5 def get_releases(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/releases" ) end
GET /apps/:app/ssl-endpoint/:cname
# File lib/heroku/api/ssl_endpoints.rb, line 14 def get_ssl_endpoint(app, cname) request( :expects => 200, :method => :get, :path => "/apps/#{app}/ssl-endpoints/#{escape(cname)}" ) end
GET /apps/:app/ssl-endpoints
# File lib/heroku/api/ssl_endpoints.rb, line 23 def get_ssl_endpoints(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/ssl-endpoints" ) end
# File lib/heroku/api/stacks.rb, line 4 def get_stack(app) request( :expects => 200, :method => :get, :path => "/apps/#{app}/stack" ) end
GET /user
# File lib/heroku/api/user.rb, line 5 def get_user request( :expects => 200, :method => :get, :path => "/user" ) end
POST /apps/:app/addons/:addon
# File lib/heroku/api/addons.rb, line 29 def post_addon(app, addon, config = {}) request( :expects => 200, :method => :post, :path => "/apps/#{app}/addons/#{addon}", :query => addon_params(config) ) end
POST /apps
# File lib/heroku/api/apps.rb, line 41 def post_app(params={}) request( :expects => 202, :method => :post, :path => '/apps', :query => app_params(params) ) end
POST /apps/:app/server/maintenance
# File lib/heroku/api/apps.rb, line 51 def post_app_maintenance(app, maintenance_mode) request( :expects => 200, :method => :post, :path => "/apps/#{app}/server/maintenance", :query => {'maintenance_mode' => maintenance_mode} ) end
POST /apps/:app/collaborators
# File lib/heroku/api/collaborators.rb, line 23 def post_collaborator(app, email) request( :expects => [200, 201], :method => :post, :path => "/apps/#{app}/collaborators", :query => {'collaborator[email]' => email} ) end
POST /apps/:app/domains
# File lib/heroku/api/domains.rb, line 32 def post_domain(app, domain) request( :expects => 201, :method => :post, :path => "/apps/#{app}/domains", :query => {'domain_name[domain]' => domain} ) end
POST /features/:feature
# File lib/heroku/api/features.rb, line 35 def post_feature(feature, app = nil) request( :expects => [200, 201], :method => :post, :path => "/features/#{feature}", :query => { 'app' => app } ) end
POST /user/keys
# File lib/heroku/api/keys.rb, line 32 def post_key(key) request( :body => key, :expects => 200, :method => :post, :path => "/user/keys" ) end
# File lib/heroku/api/login.rb, line 4 def post_login(username, password) request( :expects => 200, :method => :post, :path => '/login', :query => { 'username' => username, 'password' => password } ) end
POST /apps/:app/ps
# File lib/heroku/api/processes.rb, line 14 def post_ps(app, command, options={}) options = { 'command' => command }.merge(options) request( :expects => 200, :method => :post, :path => "/apps/#{app}/ps", :query => ps_options(options) ) end
POST /apps/:app/ps/restart
# File lib/heroku/api/processes.rb, line 25 def post_ps_restart(app, options={}) request( :expects => 200, :method => :post, :path => "/apps/#{app}/ps/restart", :query => options ) end
POST /apps/:app/ps/scale
# File lib/heroku/api/processes.rb, line 35 def post_ps_scale(app, type, quantity) request( :expects => 200, :method => :post, :path => "/apps/#{app}/ps/scale", :query => { 'type' => type, 'qty' => quantity } ) end
POST /apps/:app/ps/stop
# File lib/heroku/api/processes.rb, line 48 def post_ps_stop(app, options) request( :expects => 200, :method => :post, :path => "/apps/#{app}/ps/stop", :query => options ) end
POST /apps/:app/releases/:release
# File lib/heroku/api/releases.rb, line 23 def post_release(app, release=nil) request( :expects => 200, :method => :post, :path => "/apps/#{app}/releases", :query => {'rollback' => release} ) end
POST /apps/:app/ssl-endpoints
# File lib/heroku/api/ssl_endpoints.rb, line 32 def post_ssl_endpoint(app, pem, key) request( :expects => 200, :method => :post, :path => "/apps/#{app}/ssl-endpoints", :query => { 'key' => key, 'pem' => pem } ) end
POST /apps/:app/ssl-endpoints/:cname/rollback
# File lib/heroku/api/ssl_endpoints.rb, line 42 def post_ssl_endpoint_rollback(app, cname) request( :expects => 200, :method => :post, :path => "/apps/#{app}/ssl-endpoints/#{escape(cname)}/rollback" ) end
PUT /apps/:app/addons/:addon
# File lib/heroku/api/addons.rb, line 39 def put_addon(app, addon, config = {}) request( :expects => 200, :method => :put, :path => "/apps/#{app}/addons/#{addon}", :query => addon_params(config) ) end
PUT /apps/:app
# File lib/heroku/api/apps.rb, line 61 def put_app(app, params) request( :expects => 200, :method => :put, :path => "/apps/#{app}", :query => app_params(params) ) end
PUT /apps/:app/config_vars
# File lib/heroku/api/config_vars.rb, line 23 def put_config_vars(app, vars) request( :body => Heroku::API::OkJson.encode(vars), :expects => 200, :method => :put, :path => "/apps/#{app}/config_vars" ) end
PUT /apps/:app/dynos
# File lib/heroku/api/processes.rb, line 58 def put_dynos(app, dynos) request( :expects => 200, :method => :put, :path => "/apps/#{app}/dynos", :query => {'dynos' => dynos} ) end
PUT /apps/:app/ssl-endpoints/:cname
# File lib/heroku/api/ssl_endpoints.rb, line 51 def put_ssl_endpoint(app, cname, pem, key) request( :expects => 200, :method => :put, :path => "/apps/#{app}/ssl-endpoints/#{escape(cname)}", :query => { 'key' => key, 'pem' => pem } ) end
# File lib/heroku/api/stacks.rb, line 12 def put_stack(app, stack) request( :body => stack, :expects => 200, :method => :put, :path => "/apps/#{app}/stack" ) end
PUT /apps/:app/workers
# File lib/heroku/api/processes.rb, line 68 def put_workers(app, workers) request( :expects => 200, :method => :put, :path => "/apps/#{app}/workers", :query => {'workers' => workers} ) end
# File lib/heroku/api.rb, line 72 def request(params, &block) begin response = @connection.request(params, &block) rescue Excon::Errors::HTTPStatusError => error klass = case error.response.status when 401 then Heroku::API::Errors::Unauthorized when 402 then Heroku::API::Errors::VerificationRequired when 403 then Heroku::API::Errors::Forbidden when 404 if error.request[:path].match /\/apps\/\/.*/ Heroku::API::Errors::NilApp else Heroku::API::Errors::NotFound end when 408 then Heroku::API::Errors::Timeout when 422 then Heroku::API::Errors::RequestFailed when 423 then Heroku::API::Errors::Locked when /50./ then Heroku::API::Errors::RequestFailed else Heroku::API::Errors::ErrorWithResponse end reerror = klass.new(error.message, error.response) reerror.set_backtrace(error.backtrace) raise(reerror) end if response.body && !response.body.empty? if response.headers['Content-Encoding'] == 'gzip' response.body = Zlib::GzipReader.new(StringIO.new(response.body)).read end begin response.body = Heroku::API::OkJson.decode(response.body) rescue # leave non-JSON body as is end end # reset (non-persistent) connection @connection.reset response end


Search
Preparing search index...
The search index is not available
createts
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Globals
"index"
External module "index"
Index
References
Algorithm
Factory
Animate
Event
Animate
Event
Type
Animation
Animation
Factory
Animation
Props
Animation
State
Animation
Step
Animation
Value
Type
Animation
Values
Apng
Apng
Data
Apng
Frame
Apng
Parser
Back
In
Back
InOut
Back
Out
Background
Background
Attachment
Background
Clip
Background
Repeat
Type
Background
Size
Type
Base64
Base
Value
Base
Value
Unit
Bitmap
Text
Border
Border
Style
Bounce
In
Bounce
InOut
Bounce
Out
Box
Sizing
CRC32
CSSTokenizer
Circ
In
Circ
InOut
Circ
Out
Color
Container
Delay
Display
Draw
Utils
Elastic
In
Elastic
InOut
Elastic
Out
Enum
Utils
Event
Event
Dispatcher
Font
Font
Style
Font
Variant
Font
Weight
Function
Parser
Html
Parser
IAlgorithm
IXObject
Options
Img
Layout
Utils
Line
Height
Line
Height
Type
Linear
Matrix2D
Overflow
Point
Pointer
Events
Position
Pow
In
Pow
InOut
Pow
Out
Rect
Resource
Registry
Resource
Registry
Event
Resource
Type
Round
Rect
Runtime
Scrollable
Shadow
Sine
In
Sine
InOut
Sine
Out
Sprite
Sprite
Frame
Sprite
Sheet
Stage
Stage
Layout
Policy
Stage
Options
Stage
Update
Policy
String
Utils
Style
Text
Text
Align
Text
Border
Position
Ticker
Touch
Event
Touch
Item
XObject
XObject
Event
References
Algorithm
Factory
Re-exports
AlgorithmFactory
Animate
Event
Re-exports
AnimateEvent
Animate
Event
Type
Re-exports
AnimateEventType
Animation
Re-exports
Animation
Animation
Factory
Re-exports
AnimationFactory
Animation
Props
Re-exports
AnimationProps
Animation
State
Re-exports
AnimationState
Animation
Step
Re-exports
AnimationStep
Animation
Value
Type
Re-exports
AnimationValueType
Animation
Values
Re-exports
AnimationValues
Apng
Re-exports
Apng
Apng
Data
Re-exports
ApngData
Apng
Frame
Re-exports
ApngFrame
Apng
Parser
Re-exports
ApngParser
Back
In
Re-exports
BackIn
Back
InOut
Re-exports
BackInOut
Back
Out
Re-exports
BackOut
Background
Re-exports
Background
Background
Attachment
Re-exports
BackgroundAttachment
Background
Clip
Re-exports
BackgroundClip
Background
Repeat
Type
Re-exports
BackgroundRepeatType
Background
Size
Type
Re-exports
BackgroundSizeType
Base64
Re-exports
Base64
Base
Value
Re-exports
BaseValue
Base
Value
Unit
Re-exports
BaseValueUnit
Bitmap
Text
Re-exports
BitmapText
Border
Re-exports
Border
Border
Style
Re-exports
BorderStyle
Bounce
In
Re-exports
BounceIn
Bounce
InOut
Re-exports
BounceInOut
Bounce
Out
Re-exports
BounceOut
Box
Sizing
Re-exports
BoxSizing
CRC32
Re-exports
CRC32
CSSTokenizer
Re-exports
CSSTokenizer
Circ
In
Re-exports
CircIn
Circ
InOut
Re-exports
CircInOut
Circ
Out
Re-exports
CircOut
Color
Re-exports
Color
Container
Re-exports
Container
Delay
Re-exports
Delay
Display
Re-exports
Display
Draw
Utils
Re-exports
DrawUtils
Elastic
In
Re-exports
ElasticIn
Elastic
InOut
Re-exports
ElasticInOut
Elastic
Out
Re-exports
ElasticOut
Enum
Utils
Re-exports
EnumUtils
Event
Re-exports
Event
Event
Dispatcher
Re-exports
EventDispatcher
Font
Re-exports
Font
Font
Style
Re-exports
FontStyle
Font
Variant
Re-exports
FontVariant
Font
Weight
Re-exports
FontWeight
Function
Parser
Re-exports
FunctionParser
Html
Parser
Re-exports
HtmlParser
IAlgorithm
Re-exports
IAlgorithm
IXObject
Options
Re-exports
IXObjectOptions
Img
Re-exports
Img
Layout
Utils
Re-exports
LayoutUtils
Line
Height
Re-exports
LineHeight
Line
Height
Type
Re-exports
LineHeightType
Linear
Re-exports
Linear
Matrix2D
Re-exports
Matrix2D
Overflow
Re-exports
Overflow
Point
Re-exports
Point
Pointer
Events
Re-exports
PointerEvents
Position
Re-exports
Position
Pow
In
Re-exports
PowIn
Pow
InOut
Re-exports
PowInOut
Pow
Out
Re-exports
PowOut
Rect
Re-exports
Rect
Resource
Registry
Re-exports
ResourceRegistry
Resource
Registry
Event
Re-exports
ResourceRegistryEvent
Resource
Type
Re-exports
ResourceType
Round
Rect
Re-exports
RoundRect
Runtime
Re-exports
Runtime
Scrollable
Re-exports
Scrollable
Shadow
Re-exports
Shadow
Sine
In
Re-exports
SineIn
Sine
InOut
Re-exports
SineInOut
Sine
Out
Re-exports
SineOut
Sprite
Re-exports
Sprite
Sprite
Frame
Re-exports
SpriteFrame
Sprite
Sheet
Re-exports
SpriteSheet
Stage
Re-exports
Stage
Stage
Layout
Policy
Re-exports
StageLayoutPolicy
Stage
Options
Re-exports
StageOptions
Stage
Update
Policy
Re-exports
StageUpdatePolicy
String
Utils
Re-exports
StringUtils
Style
Re-exports
Style
Text
Re-exports
Text
Text
Align
Re-exports
TextAlign
Text
Border
Position
Re-exports
TextBorderPosition
Ticker
Re-exports
Ticker
Touch
Event
Renames and re-exports
XObjectEvent
Touch
Item
Re-exports
TouchItem
XObject
Re-exports
XObject
XObject
Event
Re-exports
XObjectEvent
Globals
"index"
Algorithm
Factory
Animate
Event
Animate
Event
Type
Animation
Animation
Factory
Animation
Props
Animation
State
Animation
Step
Animation
Value
Type
Animation
Values
Apng
Apng
Data
Apng
Frame
Apng
Parser
Back
In
Back
InOut
Back
Out
Background
Background
Attachment
Background
Clip
Background
Repeat
Type
Background
Size
Type
Base64
Base
Value
Base
Value
Unit
Bitmap
Text
Border
Border
Style
Bounce
In
Bounce
InOut
Bounce
Out
Box
Sizing
CRC32
CSSTokenizer
Circ
In
Circ
InOut
Circ
Out
Color
Container
Delay
Display
Draw
Utils
Elastic
In
Elastic
InOut
Elastic
Out
Enum
Utils
Event
Event
Dispatcher
Font
Font
Style
Font
Variant
Font
Weight
Function
Parser
Html
Parser
IAlgorithm
IXObject
Options
Img
Layout
Utils
Line
Height
Line
Height
Type
Linear
Matrix2D
Overflow
Point
Pointer
Events
Position
Pow
In
Pow
InOut
Pow
Out
Rect
Resource
Registry
Resource
Registry
Event
Resource
Type
Round
Rect
Runtime
Scrollable
Shadow
Sine
In
Sine
InOut
Sine
Out
Sprite
Sprite
Frame
Sprite
Sheet
Stage
Stage
Layout
Policy
Stage
Options
Stage
Update
Policy
String
Utils
Style
Text
Text
Align
Text
Border
Position
Ticker
Touch
Event
Touch
Item
XObject
XObject
Event
Generated using
TypeDoc


Manage Your Applications
| Name | Age | Phone Number | Communication By | English Level | Start Date | Tech Skills & Courses | Personal Presentation | Remote Study |
|---|
| Name | Age | Phone Number | Communication By | English Level | Start Date | Tech Skills & Courses | Personal Presentation | Remote Study |
|---|


stk.calculators.optimization.macromodel module¶
Defines MacroModel optimizers.
-
exception
stk.calculators.optimization.macromodel.
MacroModelConversionError
¶ Bases:
Exception
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
stk.calculators.optimization.macromodel.
MacroModelForceField
(macromodel_path, output_dir=None, restricted=False, timeout=None, force_field=16, maximum_iterations=2500, minimum_gradient=0.05, use_cache=False)¶ Bases:
stk.calculators.optimization.macromodel._MacroModel
Uses MacroModel force fields to optimize molecules.
-
restricted
¶ If
False
then all bonds are optimized, not just the ones created during macromolecular assembly. IfTrue
then an optimization is performed only on the bonds added during molecular assembly.Type: bool
-
static
com_line
(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)¶
-
convert_maegz_to_mae
(mol)¶ Converts a
.maegz
file to a.mae
file.Parameters: mol ( Molecule
) – The molecule being optimized. The.maegz
file holding its optimized structure is converted to a.mae
file. Both versions are kept.Returns: None Return type: NoneType
-
create_mae
(mol)¶ Creates the
.mae
file holding the molecule to be optimized.Parameters: mol ( Molecule
) – The molecule which is to be optimized. Its molecular structure file is converted to a.mae
file. The original file is also kept.Returns: The full path of the newly created .mae
file.Return type: str
-
fix_bond_angles
(mol, fix_block)¶ Adds lines fixing bond angles to the
.com
body.All bond angles of the molecule are fixed.
Parameters: - mol (
Molecule
) – The molecule to be optimized. - fix_block (
str
) – A string holding fix commands in the.com
file.
Returns: A string holding fix commands in the
.com
file.Return type: str
- mol (
-
fix_distances
(mol, fix_block)¶ Adds lines fixing bond distances to
.com
body.Only bond distances which do not involve bonds created during assembly are fixed.
Parameters: - mol (
Molecule
) – The molecule to be optimized. - fix_block (
str
) – A string holding fix commands in the.com
file.
Returns: A string holding fix commands in the
.com
file.Return type: str
- mol (
-
fix_params
(mol, com)¶ Fix bond distances and angles in
.com
file.For each bond distance, bond angle and torisional angle that does not involve a bond created during assembly a “FX” command is added to the body of the
.com
file.These lines replace the filler line in the main string.
Parameters: - mol (
Molecule
) – The molecule which is to be optimized. - com (
str
) – The body of the.com
file which is to have fix commands added.
Returns: A string holding the body of the
.com
file with instructions to fix the various bond distances and angles as described in the docstring.Return type: str
- mol (
-
fix_torsional_angles
(mol, fix_block)¶ Adds lines fixing torsional bond angles to the
.com
body.All torsional angles of the molecule are fixed.
Parameters: - mol (
Molecule
) – The molecule to be optimized. - fix_block (
str
) – A string holding fix commands in the.com
file.
Returns: A string holding fix commands in the
.com
file.Return type: str
- mol (
-
generate_com
(mol)¶ Create a
.com
file for a MacroModel optimization.The created
.com
file fixes all bond parameters which were not added during assembly. This means all bond distances, bond angles and torsional angles are fixed, except for cases where it involves a bond added during assembly of the macromolecule.This fixing is implemented by creating a
.com
file with various “FX” commands written within its body.Parameters: mol ( Molecule
) – The molecule which is to be optimized.Returns: None Return type: NoneType
-
kill_bmin
(mol)¶ Kills bmin.
Parameters: mol ( Molecule
) – The molecule being optimized.Returns: None Return type: NoneType
-
license_found
(output, mol=None)¶ Checks to see if minimization failed due to a missing license.
The user can be notified of this in one of two ways. Sometimes the output of the submission contains the message informing that the license was not found and in other cases it will be the log file. This function checks both of these sources for this message.
Parameters: - output (
str
) – The output from submitting the minimization of the structure to bmin. - mol (
Molecule
, optional) – The molecule being optimized. If the.log
file is not to be checked, the defaultNone
should be used.
Returns: True
if the license was found.False
if the minimization did not occur due to a missing license.Return type: bool
- output (
-
optimize
(mol, conformer=-1)¶ Optimizes a molecule.
Parameters: - mol (
Molecule
) – The molecule to be optimized. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- mol (
-
run_bmin
(mol)¶ Runs an optimization using bmin.
Parameters: mol (
Molecule
) – The molecule being optimized.Returns: None
Return type: NoneType
Raises: MacroModelOptimizationError
– If the optimization failed for some unspecified.MacroModelForceFieldError
– If the force field could not be used with the molecule.MacroModelLewisStructureError
– If Lewis structure of the molecule had issues.MacroModelPathError
– If an invalid MacroModel path is being used.
-
structconvert
(iname, oname)¶ Uses structconvert to change file type.
Parameters: - iname (
str
) – The name of the input file. - oname (
str
) – The name of the output file.
Returns: None
Return type: NoneType
- iname (
-
wait_for_file
(filename, timeout=10)¶ Stalls until a given file exists or timeout expires.
Parameters: - filename (
str
) – The full path of the file which should be waited for. - timeout (
int
orfloat
, optional) – The number of seconds before the function stops waiting and returns.
Returns: None
Return type: NoneType
- filename (
-
-
exception
stk.calculators.optimization.macromodel.
MacroModelForceFieldError
¶ Bases:
Exception
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
stk.calculators.optimization.macromodel.
MacroModelLewisStructureError
¶ Bases:
Exception
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
stk.calculators.optimization.macromodel.
MacroModelMD
(macromodel_path, output_dir=None, timeout=None, force_field=16, temperature=300, conformers=50, time_step=1, eq_time=10, simulation_time=200, maximum_iterations=2500, minimum_gradient=0.05, restricted_bonds=None, restricted_bond_angles=None, restricted_torsional_angles=None, use_cache=False)¶ Bases:
stk.calculators.optimization.macromodel._MacroModel
Runs a MD conformer search using MacroModel.
-
temperature
¶ The temperature in Kelvin at which the MD is run.
Type: float
-
conformers
¶ The number of conformers sampled and optimized from the MD.
Type: int
-
time_step
¶ The time step in
fs
for the MD.Type: float
-
eq_time
¶ The equilibriation time in
ps
before the MD is run.Type: float
-
simulation_time
¶ The simulation time in
ps
of the MD.Type: float
-
restricted_bonds
¶ A
set
of the formrestricted_bonds = { frozenset((0, 10)), frozenset((3, 14)), frozenset((5, 6)) }
Where each
frozenset
defines which bonds should have a fixed length via the atom ids of atoms in the bond.Type: set
-
restricted_bond_angles
¶ A
set
of the formrestricted_bonds = { frozenset((0, 10, 12)), frozenset((3, 14, 7)), frozenset((5, 8, 2)) }
Where each
frozenset
defines which bond angles should have a fixed size via the atom ids of atoms in the bond angle.Type: set
-
restricted_torsional_angles
¶ A
set
of the formrestricted_bonds = { frozenset((0, 10, 12, 3)), frozenset((3, 14, 7, 4)), frozenset((5, 8, 2, 9)) }
Where each
frozenset
defines which torsional angles should have a fixed size via the atom ids of atoms in the torsional angle.Type: set
-
static
com_line
(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)¶
-
convert_maegz_to_mae
(mol)¶ Converts a
.maegz
file to a.mae
file.Parameters: mol ( Molecule
) – The molecule being optimized. The.maegz
file holding its optimized structure is converted to a.mae
file. Both versions are kept.Returns: None Return type: NoneType
-
create_mae
(mol)¶ Creates the
.mae
file holding the molecule to be optimized.Parameters: mol ( Molecule
) – The molecule which is to be optimized. Its molecular structure file is converted to a.mae
file. The original file is also kept.Returns: The full path of the newly created .mae
file.Return type: str
-
fix_bond_angles
(mol, fix_block)¶ Adds lines fixing bond angles to the
.com
body.Parameters: - mol (
Molecule
) – The molecule to be optimized. - fix_block (
str
) – A string holding fix commands in the.com
file.
Returns: A string holding fix commands in the
.com
file.Return type: str
- mol (
-
fix_distances
(mol, fix_block)¶ Adds lines fixing bond distances to
.com
body.Parameters: - mol (
Molecule
) – The molecule to be optimized. - fix_block (
str
) – A string holding fix commands in the.com
file.
Returns: A string holding fix commands in the
.com
file.Return type: str
- mol (
-
fix_params
(mol, com)¶ Fix bond distances and angles in
.com
file.For each bond distance, bond angle and torisional angle that does not involve a bond created during assembly a “FX” command is added to the body of the
.com
file.These lines replace the filler line in the main string.
Parameters: - mol (
Molecule
) – The molecule which is to be optimized. - com (
str
) – The body of the.com
file which is to have fix commands added.
Returns: A string holding the body of the
.com
file with instructions to fix the various bond distances and angles as described in the docstring.Return type: str
- mol (
-
fix_torsional_angles
(mol, fix_block)¶ Adds lines fixing torsional bond angles to the
.com
body.Parameters: - mol (
Molecule
) – The molecule to be optimized. - fix_block (
str
) – A string holding fix commands in the.com
file.
Returns: A string holding fix commands in the
.com
file.Return type: str
- mol (
-
generate_com
(mol)¶ Create a
.com
file for a MacroModel optimization.The created
.com
file fixes all bond parameters which were not added during assembly. This means all bond distances, bond angles and torsional angles are fixed, except for cases where it involves a bond added during assembly of the macromolecule.This fixing is implemented by creating a
.com
file with various “FX” commands written within its body.Parameters: mol ( Molecule
) – The molecule which is to be optimized.Returns: None Return type: NoneType
-
kill_bmin
(mol)¶ Kills bmin.
Parameters: mol ( Molecule
) – The molecule being optimized.Returns: None Return type: NoneType
-
license_found
(output, mol=None)¶ Checks to see if minimization failed due to a missing license.
The user can be notified of this in one of two ways. Sometimes the output of the submission contains the message informing that the license was not found and in other cases it will be the log file. This function checks both of these sources for this message.
Parameters: - output (
str
) – The output from submitting the minimization of the structure to bmin. - mol (
Molecule
, optional) – The molecule being optimized. If the.log
file is not to be checked, the defaultNone
should be used.
Returns: True
if the license was found.False
if the minimization did not occur due to a missing license.Return type: bool
- output (
-
optimize
(mol, conformer=-1)¶ Optimizes a molecule.
Parameters: - mol (
Molecule
) – The molecule to be optimized. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- mol (
-
run_bmin
(mol)¶ Runs an optimization using bmin.
Parameters: mol (
Molecule
) – The molecule being optimized.Returns: None
Return type: NoneType
Raises: MacroModelOptimizationError
– If the optimization failed for some unspecified.MacroModelForceFieldError
– If the force field could not be used with the molecule.MacroModelLewisStructureError
– If Lewis structure of the molecule had issues.MacroModelPathError
– If an invalid MacroModel path is being used.
-
structconvert
(iname, oname)¶ Uses structconvert to change file type.
Parameters: - iname (
str
) – The name of the input file. - oname (
str
) – The name of the output file.
Returns: None
Return type: NoneType
- iname (
-
wait_for_file
(filename, timeout=10)¶ Stalls until a given file exists or timeout expires.
Parameters: - filename (
str
) – The full path of the file which should be waited for. - timeout (
int
orfloat
, optional) – The number of seconds before the function stops waiting and returns.
Returns: None
Return type: NoneType
- filename (
-
-
exception
stk.calculators.optimization.macromodel.
MacroModelOptimizationError
¶ Bases:
Exception
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
stk.calculators.optimization.macromodel.
MacroModelPathError
¶ Bases:
Exception
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
stk.calculators.optimization.macromodel.
_MacroModel
(macromodel_path, output_dir, timeout, force_field, maximum_iterations, minimum_gradient, use_cache)¶ Bases:
stk.calculators.optimization.optimizers.Optimizer
Base class for MacroModel optimzers.
-
macromodel_path
¶ The full path of the Schrodinger suite within the user’s machine. For example, on a Linux machine this may be something like
'/opt/schrodinger2017-2'
.Type: str
-
output_dir
¶ The name of the directory into which files generated during the optimization are written, if
None
thenuuid.uuid4()
is used.Type: str
-
force_field
¶ The number of the force field to be used.
Type: int
-
maximum_iterations
¶ The maximum number of iterations done during the optimization.
Type: int
-
minimum_gradient
¶ The gradient at which optimization is stopped.
Type: float
-
timeout
¶ The amount in seconds the MD is allowed to run before being terminated.
None
means there is no timeout.Type: float
-
static
com_line
(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)¶
-
convert_maegz_to_mae
(mol)¶ Converts a
.maegz
file to a.mae
file.Parameters: mol ( Molecule
) – The molecule being optimized. The.maegz
file holding its optimized structure is converted to a.mae
file. Both versions are kept.Returns: None Return type: NoneType
-
create_mae
(mol)¶ Creates the
.mae
file holding the molecule to be optimized.Parameters: mol ( Molecule
) – The molecule which is to be optimized. Its molecular structure file is converted to a.mae
file. The original file is also kept.Returns: The full path of the newly created .mae
file.Return type: str
-
fix_params
(mol, com)¶ Fix bond distances and angles in
.com
file.For each bond distance, bond angle and torisional angle that does not involve a bond created during assembly a “FX” command is added to the body of the
.com
file.These lines replace the filler line in the main string.
Parameters: - mol (
Molecule
) – The molecule which is to be optimized. - com (
str
) – The body of the.com
file which is to have fix commands added.
Returns: A string holding the body of the
.com
file with instructions to fix the various bond distances and angles as described in the docstring.Return type: str
- mol (
-
kill_bmin
(mol)¶ Kills bmin.
Parameters: mol ( Molecule
) – The molecule being optimized.Returns: None Return type: NoneType
-
license_found
(output, mol=None)¶ Checks to see if minimization failed due to a missing license.
The user can be notified of this in one of two ways. Sometimes the output of the submission contains the message informing that the license was not found and in other cases it will be the log file. This function checks both of these sources for this message.
Parameters: - output (
str
) – The output from submitting the minimization of the structure to bmin. - mol (
Molecule
, optional) – The molecule being optimized. If the.log
file is not to be checked, the defaultNone
should be used.
Returns: True
if the license was found.False
if the minimization did not occur due to a missing license.Return type: bool
- output (
-
optimize
(mol, conformer=-1)¶ Optimizes a molecule.
Parameters: - mol (
Molecule
) – The molecule to be optimized. - conformer (
int
, optional) – The conformer to use.
Returns: None
Return type: NoneType
- mol (
-
run_bmin
(mol)¶ Runs an optimization using bmin.
Parameters: mol (
Molecule
) – The molecule being optimized.Returns: None
Return type: NoneType
Raises: MacroModelOptimizationError
– If the optimization failed for some unspecified.MacroModelForceFieldError
– If the force field could not be used with the molecule.MacroModelLewisStructureError
– If Lewis structure of the molecule had issues.MacroModelPathError
– If an invalid MacroModel path is being used.
-
structconvert
(iname, oname)¶ Uses structconvert to change file type.
Parameters: - iname (
str
) – The name of the input file. - oname (
str
) – The name of the output file.
Returns: None
Return type: NoneType
- iname (
-
wait_for_file
(filename, timeout=10)¶ Stalls until a given file exists or timeout expires.
Parameters: - filename (
str
) – The full path of the file which should be waited for. - timeout (
int
orfloat
, optional) – The number of seconds before the function stops waiting and returns.
Returns: None
Return type: NoneType
- filename (
-


[gecode-users] print-last patch
Christian Schulte
cschulte at kth.se
Tue Feb 28 20:03:40 CET 2012
No, it does not have it: 3.7.2 is a bug-fix only release (the print-last
thing is a big thing as we rewrote the argument handling completely, that's
why it did not qualify).
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Wajid Hassan
Sent: Tuesday, February 28, 2012 4:39 PM
To: users at gecode.org
Subject: [gecode-users] print-last patch
Hi,
Has the new release 3.7.2 for Windows got this as well? I looked and could
not find it here http://www.gecode.org/doc-latest/reference/PageChange.html
BR/ Wajid
2012/1/18 Christian Schulte <cschulte at kth.se>
Hi,
I added the command line switch -print-last to the trunk. In case you build
Gecode yourself from source you can use the attached patch to get the
behaviour.
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Josef Eisl
Sent: Tuesday, January 17, 2012 7:02 PM
To: cschulte at kth.se
Cc: users at gecode.org
Subject: Re: [gecode-users] MinimizeScript: Beginners Question
On 01/17/2012 04:59 PM, Christian Schulte wrote:
> Hi Josef,
>
> Thanks for your observations as far as MPG is concerned. I'll think
> them through and look how to improve. The information being spread out
> can't really be helped much as each location takes a different angle
> and different depth. But I promise I'll think...
>
> Then printing each solution is actually what you want (I guess):
> normally, finding a best solution takes so long that you will have to
> settle for the solution that has been found last after the time is up.
> But maybe there could be an additional switch which would only make
> sense in a best solution search scenario: -print-last where only the
> last solution found is printed, and if a time out is encountered then
> also the last and not necessarily best solution is printed. Would that
make you happy?
Yes, such an option would be great :).
Thanks again for your time!
br
Josef
>
> Christian
>
> --
> Christian Schulte, www.ict.kth.se/~cschulte/
>
>
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On
> Behalf Of Josef Eisl
> Sent: Tuesday, January 17, 2012 3:52 PM
> To: cschulte at kth.se
> Cc: users at gecode.org
> Subject: Re: [gecode-users] MinimizeScript: Beginners Question
>
> Hello!
>
> On 01/17/2012 02:31 PM, Christian Schulte wrote:
>> Hi,
>>
>> Please let me take your questions in turn.
>>
>> 1. Changing the relation from strict (that is, "<") to a non-strict
>> (that is, "<=") will typically not work. It would entail that you do
>> not only find all _optimal_ solutions but all solution for each and
>> every cost value! So normally that will be way too many solutions!
>> Try it out with Gist on a small example and you will see that this
>> will make
> things break down.
>
> Ups, my bad. Clearly adding a non strict constraint does not make much
> sense.
>
>> Should I add a tip in MPG that the order must be strict for things to
> work?
>
> Maybe, but I my eyes it is more confusing that
> MinimizeSpace/MinimizeScript return non-optimal solutions, at least
> for a new user. Some other things about MPG and optimization that are not
straight forward in my opinion:
>
> 1. Information is spread over several chapters:
> - 2.5 Best solution search
> - 3.2 Using a cost function
> - 6.3 Support for cost-based optimization
> - 7.4 Search engines
>
> 2. Best Solution Search engine
> It is mentioned in 2.5 and 7.4 but not 3.2 and 6.3 and there are no
> links to the other sections. Maybe it should be stated more clearly
> that BAB or Restart must be used for best solution search.
>
> 3. constrain()
> In 2.5: "Note that every space defines a default constrain() member
> function (to keep the design of models simple). If a model does not
> re-define the
> constrain() member function, the default function will be called which
> throws an exception of type SpaceConstrainUndefined (as this is a
> modeling error)".
> In my eyes the second sentence is not true as OptimizeSpace provides a
> valid constrain().
>
> These are rather beginner problems than problems of MPG. Gecode is one
> of the best documented free software I've seen. I just want to share
> my experience.
>
>> 2. To find all optimal solutions, I would first find _one_ optimal
>> solution as normal. Then I would find all solutions (starting a new
>> search) where the cost value is equal to the optimal const value.
>
> I see. That makes sense.
>
>> 3. You see that printing "all" optimal solutions with respect to 1. and
2.
>> does not really make much sense.
>
> Ok using -solutions for optimal solutions does not work. But how about
> printing only the last (optimal if -solutions 0) solution with
> MinimizeScript?
>
>> I hope that helps
>
> Thank you very much for your quick and detailed answers!
>
> Josef
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
>
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20120228/a64e6447/attachment-0001.htm>
More information about the users
mailing list


Parser
A core feature of diffHTML is the HTML/XML/SVG parser. This is used whenever you pass a string of markup or use the html tagged template to innerHTML / outerHTML . While this code is optimized specifically for the VDOM and is very fast, you may want to optimize out the parser using the Babel plugin .
The parser can read full HTML documents including doctype, html/head/body/title etc tags, unwrapped fragments, and more!
Using with innerHTML:
import { innerHTML } from 'diffhtml';
// Using innerHTML will parse the HTML markup from a string literal.
innerHTML(document.body, '
Hello world
');
This produces a single top level element

with a nested #text
node.
If you were to structure your code like this:
import { innerHTML } from 'diffhtml';
// Using innerHTML will parse the HTML markup from a string literal.
innerHTML(document.body, '
Hello world
');
This would become:
import { createTree } from 'diffhtml';
innerHTML(document.body, createTree('div', null, [
createTree('#text', 'Hello world')
]));
You'll notice the top-level element returned is 'div'. From there you may think:
import { innerHTML } from 'diffhtml';
// Using innerHTML will parse the HTML markup from a string literal.
innerHTML(document.body, `

Hello world

`);
Would produce similar behavior, but it does not. The returned value mirrors what is embedded precisely, becoming:
import { createTree } from 'diffhtml';
innerHTML(document.body, createTree('#document-fragment', [
createTree('#text', '\n'),
createTree('div', null, [createTree('#text', 'Hello world')]),
createTree('#text', '\n'),
]));
This can be useful knowledge for optimizing, but for more applications it should be fine to keep them in for developer convenience.
Using with outerHTML:
import { outerHTML } from 'diffhtml';
// Using outerHTML will parse the HTML markup and apply around the element.
outerHTML(document.body, `
Hello world
`);
Using with html:
import { html } from 'diffhtml';
// The tagged template will parse HTML in the same way, and also handle
// dynamic values directly.
console.log(html`

Hello world

`);
Using directly from Internals:
import { Internals } from 'diffhtml';
// This is the raw parse function which allows you to map dynamic values
// to either a TAG, ATTRIBUTE, or CHILD. You can find more information
// about this in the dynamic values section below.
console.log(Internals.parse(`

Hello world

`));
Options
The parser is somewhat configurable, allowing you to opt into a strict-mode for erroring if invalid markup is passed. This could be useful to pair with the HTML Linter Middleware .
-
strict
- Toggle strict mode parsing -
rawElements
- Modify the list of elements that have raw values -
selfClosingElements
- Modify the list of elements that can self close
Strict mode
By default the parser operates in loose-mode which is forgiving of missing closing tags, poor markup, and other common issues. When opting into strict mode you will receive errors if you don't properly self close tags, have mismatched tag names, etc.
import { innerHTML } from 'diffhtml';
const options = {
parser: {
strict: true,
}
};
// Will be fine since the elements match
innerHTML(document.body, `

Hello world

`, options);
// Will throw since the elements do not match
innerHTML(document.body, `

Hello world

`, options);
Unlike the other two options below, this feature can be configured using the
tagged template
html
directly.
import { html } from 'diffhtml';
// Will throw an error due to the tag mismatch
html.strict`

`;
Raw elements
A list of elements that have their contents treated as raw text, rather than parsed as HTML. You can provide your own list of element names to allow this feature.
Examples of these kinds of elements are:

,
,


Symmetric-key algorithms are algorithms for cryptography that use the same cryptographic keys for both encryption of plaintext and decryption of ciphertext. Most often the key used for encryption and decryption is the same key and is represented as a shared secrete between two or more parties. This requirement that both parties have access to the secret key is one of the main drawbacks of symmetric key encryption, in comparison to public-key encryption. There are two types of ciphers used by symmetric-key encryption.
A stream cipher is a symmetric cipher which operates with a time-varying transformation on individual plaintext digits. In a stream cipher a sequence of plaintext digits,
a pseudorandom sequence
A block cipher consists of two paired algorithms, one for encryption,
Both operations by themselves cannot provide security. The idea is to concatenate confusion and diffusion elements to build so called product ciphers. Most of today's block ciphers are product ciphers, as they consist of rounds which are applied repeatedly to the data. Product ciphers can reach excellent diffusion, where the changing of one bit of plaintext results, on average, in the change of half the output bits, as illustrated on fig. 1.
To apply a block cipher in different applications, originally, five "modes of operation" have been defined by National Institute of Standards and Technology (NIST). So, what are these modes of operation for? Well, a mode of operation is a technique for enhancing the effect of a cryptographic algorithm or adapting the algorithm for an application, such as applying a block cipher to a sequence of data blocks of a data stream.
Five modes of operaition are:
The simplest mode is the electronic codebook mode (ECB). Plaintext is handled one block at a time and each block of plaintext is encrypted using the same key (figure 2). For a message longer than b bits, the procedure is simply to break the message into b-bit blocks, padding the last block if necessary. Decryption is performed one block at a time, always using the same key.
The most important characteristic and big problem of ECB is that the same b-bit block of plaintext, if it appears more than once in the message, always produces the same ciphertext.
In Cipher Block Chaining Mode (CBC), each ciphertext block is XORed with the next plaintext block, before encrypted with the key. The same key is used for each block. To produce the first block of ciphertext, an initialization vector (IV) is XORed with the first block of plaintext. On decryption, the IV is XORed with the output of the decryption algorithm to recover the first block of plaintext. The IV is a data block that is the same size as the cipher block. Both sender and receiver have to know the IV. CBC is depicted in figure 3.
Its main drawbacks are that encryption is sequential (i.e., it cannot be parallelized), and that the message must be padded to a multiple of the cipher block size. One way to handle this last issue is through the method known as ciphertext stealing. Notice that, if a plaintext block is changed in this mode, then all subsequent cipherblocks will be affected. This property means that CBC mode is useful for purposes of authentication.
Figure 4 depicts the Cipher Feedback (CFB) . In the figure, it is assumed that the unit of transmission is
Like CBC mode, changes in the plaintext propagate forever in the ciphertext, and encryption cannot be parallelized. Also like CBC, decryption can be parallelized.
The output feedback (OFB) mode is similar in structure to that of CFB, as illustrated in Figure 5. As can be seen, it is the output of the encryption function that is fed back to the shift register in OFB, whereas in CFB the ciphertext unit is fed back to the shift register.
One advantage of the OFB method is that bit errors in transmission do not propagate. For example, if a bit error occurs in ciphertext block C1 only the recovered value of is plaintext block P1 affected; subsequent plaintext units are not corrupted. With CFB, C1 also serves as input to the shift register and therefore causes additional corruption downstream. The disadvantage of OFB is that it is more vulnerable to a message stream modification attack than is CFB. Consider that complementing a bit in the ciphertext complements the corresponding bit in the recovered plaintext. Thus, controlled changes to the recovered plaintext can be made. This may make it possible for an opponent, by making the necessary changes to the checksum portion of the message as well as to the data portion, to alter the ciphertext in such a way that it is not detected by an error-correcting code.
Figure 6 depicts the CTR mode. A counter, equal to the plaintext block size is used. The only
requirement is that the counter value must be different for each plaintext block
that is encrypted. Typically, the counter is initialized to some value and then incremented by 1 for each
subsequent block (modulo
The two block cypher algorithms we will review in detail are:
In each subsection we take a look at the algorithm steps, the underlying math which provides security for the system, some demos and some additional readings. Have fun!


The main aim of this project is to study in more detail various regression methods, including the Ordinary Least Squares (OLS) method, The total score is 100 points. Each subtask has its own final score.
We will first study how to fit polynomials to a specific two-dimensional function called Franke's function. This is a function which has been widely used when testing various interpolation and fitting algorithms. Furthermore, after having established the model and the method, we will employ resamling techniques such as cross-validation and/or bootstrap in order to perform a proper assessment of our models. We will also study in detail the so-called Bias-Variance trade off.
The Franke function, which is a weighted sum of four exponentials reads as follows
$$ \begin{align*} f(x,y) &= \frac{3}{4}\exp{\left(-\frac{(9x-2)^2}{4} - \frac{(9y-2)^2}{4}\right)}+\frac{3}{4}\exp{\left(-\frac{(9x+1)^2}{49}- \frac{(9y+1)}{10}\right)} \\ &+\frac{1}{2}\exp{\left(-\frac{(9x-7)^2}{4} - \frac{(9y-3)^2}{4}\right)} -\frac{1}{5}\exp{\left(-(9x-4)^2 - (9y-7)^2\right) }. \end{align*} $$The function will be defined for \( x,y\in [0,1] \). Our first step will be to perform an OLS regression analysis of this function, trying out a polynomial fit with an \( x \) and \( y \) dependence of the form \( [x, y, x^2, y^2, xy, \dots] \). We will also include bootstrap first as a resampling technique. After that we will include the cross-validation technique. As in homeworks 1 and 2, we can use a uniform distribution to set up the arrays of values for \( x \) and \( y \), or as in the example below just a set of fixed values for \( x \) and \( y \) with a given step size. We will fit a function (for example a polynomial) of \( x \) and \( y \). Thereafter we will repeat much of the same procedure using the Ridge and Lasso regression methods, introducing thus a dependence on the bias (penalty) \( \lambda \).
Finally we are going to use (real) digital terrain data and try to reproduce these data using the same methods. We will also try to go beyond the second-order polynomials metioned above and explore which polynomial fits the data best.
The Python code for the Franke function is included here (it performs also a three-dimensional plot of it)
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
from random import random, seed
fig = plt.figure()
ax = fig.gca(projection='3d')
# Make data.
x = np.arange(0, 1, 0.05)
y = np.arange(0, 1, 0.05)
x, y = np.meshgrid(x,y)
def FrankeFunction(x,y):
term1 = 0.75*np.exp(-(0.25*(9*x-2)**2) - 0.25*((9*y-2)**2))
term2 = 0.75*np.exp(-((9*x+1)**2)/49.0 - 0.1*(9*y+1))
term3 = 0.5*np.exp(-(9*x-7)**2/4.0 - 0.25*((9*y-3)**2))
term4 = -0.2*np.exp(-(9*x-4)**2 - (9*y-7)**2)
return term1 + term2 + term3 + term4
z = FrankeFunction(x, y)
# Plot the surface.
surf = ax.plot_surface(x, y, z, cmap=cm.coolwarm,
linewidth=0, antialiased=False)
# Customize the z axis.
ax.set_zlim(-0.10, 1.40)
ax.zaxis.set_major_locator(LinearLocator(10))
ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f'))
# Add a color bar which maps values to colors.
fig.colorbar(surf, shrink=0.5, aspect=5)
plt.show()
We will generate our own dataset for a function \( \mathrm{FrankeFunction}(x,y) \) with \( x,y \in [0,1] \). The function \( f(x,y) \) is the Franke function. You should explore also the addition of an added stochastic noise to this function using the normal distribution \( N(0,1) \).
Write your own code (using either a matrix inversion or a singular value decomposition from e.g., numpy ) or use your code from homeworks 1 and 2 and perform a standard least square regression analysis using polynomials in \( x \) and \( y \) up to fifth order.
Evaluate the Mean Squared error (MSE)
$$ MSE(\boldsymbol{y},\tilde{\boldsymbol{y}}) = \frac{1}{n} \sum_{i=0}^{n-1}(y_i-\tilde{y}_i)^2, $$and the \( R^2 \) score function. If \( \tilde{\boldsymbol{y}}_i \) is the predicted value of the \( i-th \) sample and \( y_i \) is the corresponding true value, then the score \( R^2 \) is defined as
$$ R^2(\boldsymbol{y}, \tilde{\boldsymbol{y}}) = 1 - \frac{\sum_{i=0}^{n - 1} (y_i - \tilde{y}_i)^2}{\sum_{i=0}^{n - 1} (y_i - \bar{y})^2}, $$where we have defined the mean value of \( \boldsymbol{y} \) as
$$ \bar{y} = \frac{1}{n} \sum_{i=0}^{n - 1} y_i. $$Plot the resulting scores (MSE and R$^2$) as functions of the polynomial degree (here up to polymial degree five). Plot also the parameters \( \beta \) as you increase the order of the polynomial. Comment your results.
Your code has to include a scaling/centering of the data (for example by subtracting the mean value), and a split of the data in training and test data. For this exercise you can either write your own code or use for example the function for splitting training data provided by the library Scikit-Learn (make sure you have installed it). This function is called \( train\_test\_split \). You should present a critical discussion of why and how you have scaled or not scaled the data.
It is normal in essentially all Machine Learning studies to split the data in a training set and a test set (eventually also an additional validation set). There is no explicit recipe for how much data should be included as training data and say test data. An accepted rule of thumb is to use approximately \( 2/3 \) to \( 4/5 \) of the data as training data.
You can easily reuse the solutions to your exercises from week 35 and week 36.
Our aim here is to study the bias-variance trade-off by implementing the bootstrap resampling technique.
With a code which does OLS and includes resampling techniques, we will now discuss the bias-variance trade-off in the context of continuous predictions such as regression. However, many of the intuitions and ideas discussed here also carry over to classification tasks and basically all Machine Learning algorithms.
Before you perform an analysis of the bias-variance trade-off on your test data, make first a figure similar to Fig. 2.11 of Hastie, Tibshirani, and Friedman. Figure 2.11 of this reference displays only the test and training MSEs. The test MSE can be used to indicate possible regions of low/high bias and variance. You will most likely not get an equally smooth curve!
With this result we move on to the bias-variance trade-off analysis.
Consider a dataset \( \mathcal{L} \) consisting of the data \( \mathbf{X}_\mathcal{L}=\{(y_j, \boldsymbol{x}_j), j=0\ldots n-1\} \).
Let us assume that the true data is generated from a noisy model
$$ \boldsymbol{y}=f(\boldsymbol{x}) + \boldsymbol{\epsilon}. $$Here \( \epsilon \) is normally distributed with mean zero and standard deviation \( \sigma^2 \).
In our derivation of the ordinary least squares method we defined then an approximation to the function \( f \) in terms of the parameters \( \boldsymbol{\beta} \) and the design matrix \( \boldsymbol{X} \) which embody our model, that is \( \boldsymbol{\tilde{y}}=\boldsymbol{X}\boldsymbol{\beta} \).
The parameters \( \boldsymbol{\beta} \) are in turn found by optimizing the means squared error via the so-called cost function
$$ C(\boldsymbol{X},\boldsymbol{\beta}) =\frac{1}{n}\sum_{i=0}^{n-1}(y_i-\tilde{y}_i)^2=\mathbb{E}\left[(\boldsymbol{y}-\boldsymbol{\tilde{y}})^2\right]. $$Here the expected value \( \mathbb{E} \) is the sample value.
Show that you can rewrite this as
$$ \mathbb{E}\left[(\boldsymbol{y}-\boldsymbol{\tilde{y}})^2\right]=\frac{1}{n}\sum_i(f_i-\mathbb{E}\left[\boldsymbol{\tilde{y}}\right])^2+\frac{1}{n}\sum_i(\tilde{y}_i-\mathbb{E}\left[\boldsymbol{\tilde{y}}\right])^2+\sigma^2. $$Explain what the terms mean, which one is the bias and which one is the variance and discuss their interpretations.
Perform then a bias-variance analysis of the Franke function by studying the MSE value as function of the complexity of your model.
Discuss the bias and variance trade-off as function of your model complexity (the degree of the polynomial) and the number of data points, and possibly also your training and test data using the bootstrap resampling method.
Note also that when you calculate the bias, in all applications you don't know the function values \( f_i \). You would hence replace them with the actual data points \( y_i \).
The aim here is to write your own code for another widely popular resampling technique, the so-called cross-validation method. Again, before you start with cross-validation approach, you should scale your data if you think this is needed.
Implement the \( k \)-fold cross-validation algorithm (write your own code) and evaluate again the MSE function resulting from the test folds. You can compare your own code with that from Scikit-Learn if needed.
Compare the MSE you get from your cross-validation code with the one you got from your bootstrap code. Comment your results. Try \( 5-10 \) folds. You can also compare your own cross-validation code with the one provided by Scikit-Learn.
Write your own code for the Ridge method, either using matrix inversion or the singular value decomposition as done in the previous exercise. Perform the same bootstrap analysis as in the Exercise 2 (for the same polynomials) and the cross-validation in exercise 3 but now for different values of \( \lambda \). Compare and analyze your results with those obtained in exercises 1-3. Study the dependence on \( \lambda \).
Study also the bias-variance trade-off as function of various values of the parameter \( \lambda \). For the bias-variance trade-off, use the bootstrap resampling method. Comment your results.
This exercise is essentially a repeat of the previous two ones, but now with Lasso regression. Write either your own code (difficult and optional) or, in this case, you can also use the functionalities of Scikit-Learn (recommended). Give a critical discussion of the three methods and a judgement of which model fits the data best. Perform here as well an analysis of the bias-variance trade-off using the bootstrap resampling technique and an analysis of the mean squared error using cross-validation.
With our codes functioning and having been tested properly on a simpler function we are now ready to look at real data. We will essentially repeat in this exercise what was done in exercises 1-5. However, we need first to download the data and prepare properly the inputs to our codes. We are going to download digital terrain data from the website https://earthexplorer.usgs.gov/,
Or, if you prefer, we have placed selected datafiles at https://github.com/CompPhysics/MachineLearning/tree/master/doc/Projects/2021/Project1/DataFiles
In order to obtain data for a specific region, you need to register as a user (free) at this website and then decide upon which area you want to fetch the digital terrain data from. In order to be able to read the data properly, you need to specify that the format should be SRTM Arc-Second Global and download the data as a GeoTIF file. The files are then stored in tif format which can be imported into a Python program using
scipy.misc.imread
Here is a simple part of a Python code which reads and plots the data from such files
import numpy as np
from imageio import imread
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
# Load the terrain
terrain1 = imread('SRTM_data_Norway_1.tif')
# Show the terrain
plt.figure()
plt.title('Terrain over Norway 1')
plt.imshow(terrain1, cmap='gray')
plt.xlabel('X')
plt.ylabel('Y')
plt.show()
If you should have problems in downloading the digital terrain data, we provide two examples under the data folder of project 1. One is from a region close to Stavanger in Norway and the other Møsvatn Austfjell, again in Norway. Feel free to produce your own terrain data.
Alternatively, if you would like to use another data set, feel free to do so. This could be data close to your reseach area or simply a data set you found interesting. See for example kaggle.com for examples.
Our final part deals with the parameterization of your digital terrain data (or your own data). We will apply all three methods for linear regression, the same type (or higher order) of polynomial approximation and cross-validation as resampling technique to evaluate which model fits the data best.
At the end, you should present a critical evaluation of your results and discuss the applicability of these regression methods to the type of data presented here (either the terrain data we propose or other data sets).
Here follows a brief recipe and recommendation on how to answer the various questions when preparing your answers. Note that you can answer question by question and there is no need to structure your report as a scientific report with abstract, introduction, theory, results and discussions, conclusions etc. But you have the following elements in mind when you answer the various questions.
The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008, Julia or Python. The following prescription should be followed when preparing the report:
Finally, we encourage you to collaborate. Optimal working groups consist of 2-3 students. You can then hand in a common report.
If you have Python installed (we recommend Python3) and you feel pretty familiar with installing different packages, we recommend that you install the following Python packages via pip as
For Python3, replace pip with pip3.
See below for a discussion of tensorflow and scikit-learn.
For OSX users we recommend also, after having installed Xcode, to install brew. Brew allows for a seamless installation of additional software via for example
For Linux users, with its variety of distributions like for example the widely popular Ubuntu distribution you can use pip as well and simply install Python as
etc etc.
If you don't want to install various Python packages with their dependencies separately, we recommend two widely used distrubutions which set up all relevant dependencies for Python, namely
Popular software packages written in Python for ML are
These are all freely available at their respective GitHub sites. They encompass communities of developers in the thousands or more. And the number of code developers and contributors keeps increasing.


The Open Platform is a public web service for accessing all the content the Guardian creates, categorised by tags and section. To get started, You need an key to successfully authenticate against the API.
Choose the level of access required for your application:
This key is for any non-commercial usage of the content, such as student dissertations, hackathons, nonprofit app developers.
Up to 1 call per second
Up to 500 calls per day
Access to article text
Access to over 1,900,000 pieces of content
Free for non-commercial usage
This key is for all use cases by commercial enterprises and developers wishing to utilise Guardian journalism in any manner. In addition to app development and publishing content on third party sites, use cases may also include but are not limited to: training models for generative artificial intelligence services, text and data mining solutions, sentiment analysis where content is not reproduced, and any and all products and services derived or sourced from Guardian content.
Custom throttle limit
Custom quota limit
Access to article text, images, audio and videos
Access to entire Guardian content store
Price dependent on usage


Hullo there, dear human! As you well noticed I'm an alien a.k.a
the "creature from space". You may hear about me from all over the place.
I've been a quit popular creature. But I've got forebodings you ain't very
fond of something you don't understand quite well. Therefore I'm about
to lead you in the right direction.
There's a great quote:
The only thing that scares me more than space aliens
Is the idea that there aren't any space aliens
We can't be the best that creation has to offer
I pray we're not all there is. If so, we're in big trouble― Ellen DeGeneres


Local Servers/Proxies
Local Servers/Proxies
This tab allows you to configure the addresses and ports on which ZAP accepts incoming connections.
Main Proxy
By default ZAP will listen on one local address and port, and usually these should be the address and port
that you must configure your browser to use as a proxy.
Additional Servers/Proxies
You can add as many additional addresses and ports for ZAP to listen on as you like.
This can be useful when testing mobile applications - you can proxy the mobile application via a Wi-Fi interface at the same time
as using the backend site directly using a browser proxying through ZAP emulating a mobile user agent.
Server/Proxy Properties
Both the Main Proxy and the additional servers/proxies allow to configure the following properties.
Address
The local address to bound to. All of the available addresses are automatically identified.
Port
The port on which the server/proxy will listen.
Security Protocols
Allows to choose the SSL/TLS versions enabled for incoming connections (for example, from browsers). At least
one version must be enabled, versions unsupported by the JRE will be unselected and disabled.
The option SSLv2Hello must be selected in conjunction with at least one SSL/TLS version.
ALPN
Allows to enable and select the application protocols negotiated during a TLS handshake (ALPN extension).
Note: The protocol falls back to HTTP/1.1 if the client establishing the connection does not support ALPN or any of the selected protocols.
Mode
Allows to specify if the API should be exposed or if it should be allowed to proxy requests. For example, one can configure a
server exposing just the the API to external addresses (i.e. remote control) while having a proxy for local addresses only.
Behind NAT
Indicates that the server/proxy (ZAP) is behind NAT. When selected ZAP will attempt to
determine the public IP address, to properly detect and handle requests with the public
IP address (for example, to be served by the ZAP API). Alternatively you can manually add the IP
address as an Alias (refer to Aliases section).
Note: This option is only supported when ZAP is running in an AWS EC2 instance.
ZAP will obtain the public IP address from
AWS EC2
instance's metadata.
ZAP should be started with this option enabled if access to the API, through the public IP address, is required:
zap.sh -daemon -port 8080 -host <IP_ADDRESS> -config network.localServers.mainProxy.behindNat=true
Also, the API needs to be configured to accept external IP addresses (i.e. the IP address from where ZAP is being accessed).
Remove Accept-Encoding Request Header
Allows the proxy to remove the "Accept-Encoding" request-header field, so no (unsupported) encoding transformations are done to the response.
This option should be always enabled unless when testing the encoding transformations.
The messages encoded with unsupported encodings will not be correctly scanned (either by passive and active scanners).
Decode Response
Allows the proxy to automatically decode (i.e. gzip, deflate) the response. This option is needed for applications that ignore
the "Accept-Encoding" request-header field.
Intercepting/Transparent Proxy
The local proxies can be used as intercepting/transparent proxies for both HTTP and HTTPS. For HTTPS the client applications
(e.g. browser) need to use the TLS extension Server Name Indication.
This allows you to set up a testing LANs (or VMs) where all HTTP and HTTPS traffic is proxied regardless of software settings.
For example, if you have a Linux machine you use for testing, you can do something like the following to forward all HTTP and
HTTPS traffic to a local proxy listening on <IP_ADDRESS>:8080
:
iptables -t nat -A OUTPUT -p tcp --dport 443 -j DNAT --to-destination <IP_ADDRESS>:8080
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination <IP_ADDRESS>:8080
Aliases
Allows to identify the local servers/proxies with other names (domain or address). For example, to access the ZAP API with a public IP address.
Pass-through
Allows to configure the authorities (domain/address and port) that will pass-through ZAP, thus sending the data without being decrypted/encrypted.
This is useful when a client has certificate pinning for certain hosts or the domain/data is irrelevant to the target being tested.
Requires that the client sends a CONNECT request with the required authority. The authority
is interpreted as a regular expression and
needs to be present in the requested authority.
For example, to pass-through all connections to example.org
it can be specified just example.org
, therefore matching any port.
Using pass-through is more efficient than using excludes (e.g. Exclude from Proxy, Global Exclude URL) when all the traffic for the host is not relevant
to the tests.
See also
| |
Network |
the introduction to Network add-on |


|
EnkiUtils
Small library of classes that Enki Labs uses internally.
|
#import <EnkiUnorderedController.h>
Instance Methods | |
| (void) | - initCurrentWithNibName:bundle: |
| (void) | - replaceViewController:withDirection: |
| (void) | - coverViewController:withDirection: |
| (void) | - uncoverViewControllerwithDirection: |
Properties | |
| UIViewController * | current |
| UIViewController * | cover |
The EnkiUnorderedController enables you to switch from one view controller to another and use any of the up, down, left or right slide animations. You can either cover the current view controller, which lets you uncover it and come back to your previous one, or you can simply replace the view controller with a new one.
There is NO cover stack. If you cover more than once you must only uncover once, to see the original view controller. (And actually, this isn't tested at all but it should behave like that.) TODO: fix this, us an NSArray
Please see the sample project for an app that demonstrates how replace works.
Definition at line 29 of file EnkiUnorderedController.h.
| - (void) coverViewController: | (UIViewController *) | target | |
| withDirection: | (slideDirection) | direction | |
Cover the current view controller with the target view controller using a direction slide animation. If the current view controller is already covered, cover it again but the current cover is not preserved.
Definition at line 62 of file EnkiUnorderedController.m.
| - (void) initCurrentWithNibName: | (NSString *) | nibNameOrNil | |
| bundle: | (NSBundle *) | nibBundleOrNil | |
init the currently displayed view controller from its nib. The nib file name must be the same as the class name.
Definition at line 31 of file EnkiUnorderedController.m.
| - (void) replaceViewController: | (UIViewController *) | target | |
| withDirection: | (slideDirection) | direction | |
Replace the current view controller with the target view controller using a direction slide animation. removeFromParentViewController is called on the current target view controller
Definition at line 57 of file EnkiUnorderedController.m.
| - (void) uncoverViewControllerwithDirection: | (slideDirection) | direction |
Slide the covering view controller away using direction, slide the current view controller in, also using direction. Call removeFromParentViewController on the cover and then set it to nil
Definition at line 67 of file EnkiUnorderedController.m.
|
readwritenonatomicstrong |
The property that contains the last view controller that was used as a cover.
Definition at line 34 of file EnkiUnorderedController.h.
|
readwritenonatomicstrong |
The property that contains the current view controller. This is the view controller that will be displayed if you cover and then uncover.
Definition at line 32 of file EnkiUnorderedController.h.


Delegating tasks to a worker (calculator). (source code)
💡 Open the developer console to see the results.


<topicSubjectRow>
The <topicSubjectRow>
is a grouping element that contains one row of a
subject table. It contains topic references in the first column, and relates those
references to the subjects in each following column.
Category: Classification domain elements


--- title: "1.3 — Budget Constraint — Practice Problems" editor_options: chunk_output_type: console ---
You can get music via downloads (\(d\)) or concert tickets (\(t\)). You have $60 to spend each week, and the price of a download is $3 and the price of a concert ticket is $10. Put \(d\) on the horizontal axis and \(t\) on the vertical axis.
Write the equation for your budget constraint.
Solve this equation for \(t\), to express the equation of the line.
If you spent all of your money on only Downloads, how many could you buy? If you spent all of your money only on Tickets, how many could you buy? What is the slope of your budget constraint? Graph your budget constraint.
Now suppose your income temporarily decreases to $30. Find the new equation of the budget constraint and graph it.
Now return to your original income ($60) but suppose the price of downloads increases to $6. Find the new equation of the budget constraint and graph it.


RBX Script
Start new program?
Proceed
Cancel
Program name:
Open
Cancel
Delete
Program name:
Save
Cancel
Run on start


| Modifier and Type | Method and Description |
|---|---|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.connectionCheckoutTimeout(long timeout,
TimeUnit unit)
If connection pooling is enabled, how long will we wait to get a connection?
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.connectionPoolSize(int connectionPoolSize)
Number of connections allowed to pool.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.connectionTTL(long ttl,
TimeUnit unit)
If there is a connection pool, set the time to live in the pool.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.connectTimeout(long timeout,
TimeUnit unit) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.defaultProxy(String hostname)
Specify a default proxy.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.defaultProxy(String hostname,
int port)
Specify a default proxy host and port.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.defaultProxy(String hostname,
int port,
String scheme)
Specify default proxy.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.disableTrustManager()
Disable trust management and hostname verification.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.enableCookieManagement()
Enable state (cookie) management.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.executorService(ExecutorService executorService) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.executorService(ExecutorService executorService,
boolean cleanupExecutor) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.hostnameVerification(ResteasyClientBuilder.HostnameVerificationPolicy policy)
SSL policy used to verify hostnames
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.hostnameVerifier(HostnameVerifier verifier) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.httpEngine(ClientHttpEngine httpEngine)
Negates all ssl and connection specific configuration
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.keyStore(KeyStore keyStore,
char[] password) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.keyStore(KeyStore keyStore,
String password) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.maxPooledPerRoute(int maxPooledPerRoute)
If connection pooling enabled, how many connections to pool per url?
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.providerFactory(ResteasyProviderFactory providerFactory)
Changing the providerFactory will wipe clean any registered components or properties.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.readTimeout(long timeout,
TimeUnit unit) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.responseBufferSize(int size)
Response stream is wrapped in a BufferedInputStream.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.sniHostNames(String... sniHostNames)
Adds a TLS/SSL SNI Host Name for authentication.
|
abstract ResteasyClientBuilder |
ResteasyClientBuilder.sslContext(SSLContext sslContext) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.trustStore(KeyStore trustStore) |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.useAsyncHttpEngine() |
abstract ResteasyClientBuilder |
ResteasyClientBuilder.withConfig(javax.ws.rs.core.Configuration config) |
| Modifier and Type | Method and Description |
|---|---|
ClientHttpEngineBuilder |
ClientHttpEngineBuilder.resteasyClientBuilder(ResteasyClientBuilder resteasyClientBuilder) |
| Modifier and Type | Method and Description |
|---|---|
ClientHttpEngineBuilder |
URLConnectionClientEngineBuilder.resteasyClientBuilder(ResteasyClientBuilder resteasyClientBuilder) |
ClientHttpEngineBuilder |
ClientHttpEngineBuilder43.resteasyClientBuilder(ResteasyClientBuilder resteasyClientBuilder) |
| Modifier and Type | Class and Description |
|---|---|
class |
ResteasyClientBuilderImpl
Abstraction for creating Clients.
|
| Modifier and Type | Method and Description |
|---|---|
ResteasyClientBuilder |
ResteasyClientBuilderImpl.enableCookieManagement() |
ResteasyClientBuilder |
ResteasyClientBuilderImpl.executorService(ExecutorService executorService) |
ResteasyClientBuilder |
ResteasyClientBuilderImpl.executorService(ExecutorService executorService,
boolean cleanupExecutor) |
ResteasyClientBuilder |
ResteasyClientBuilderImpl.scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) |
| Modifier and Type | Class and Description |
|---|---|
class |
MpClientBuilderImpl |
Copyright © 2020 JBoss by Red Hat. All rights reserved.


My Schedule
Learn Exercises
Create Exercises
Schedule Exercises
Let's schedule an exercise!
Schedule Exercises
×
Change Email
Change Email
Change Password
New Email:
Confirm New Email:
Submit Email Change
Current Password:
New Password:
Confirm New Password:
Submit Password Change
Logout
Settings


Irish researchers find drug combo to treat cystic fibrosis
by IrishCentral StaffResearchers at Queen’s University, Belfast, and St Vincent’s Hospital Dublin have identified a combination of three drugs to treat the underlying cause of cystic fibrosis, an incurable disease.
Irish research carried out in Queens University Belfast and the Cystic Fibrosis Unit at St. Vincent's Hospital Dublin has discovered that the majority of people with cystic fibrosis (CF) can be treated successfully with a combination of three drugs.
Researchers identified how a combination of three drugs, “triple therapy,” can successfully treat the majority of people with CF by tackling the underlying cause of the disease.
Read more: Irish researchers discover cure for incredibly painful skin disease
The drug targets the root cause of cystic fibrosis, a genetic condition that clogs up the lungs and digestive system, making breathing difficult resulting in an early death for those affected.
Cystic fibrosis (CF) is a genetic condition affecting more than 10,400 people in the UK. It is a progressive and life-threatening disease that results in the formation of thick mucus that builds up in the lungs and other parts of the body. It leads to severe respiratory infections that damage the lungs and cause them to fail.
CF is caused by a defective protein that results from mutations in the CFTR gene. The most common mutation is the F508del mutation. Although there is currently no cure for CF, it is possible to help control the symptoms and delay complications to make the condition easier to live with.
Read more: Major DNA study shows Irish have higher rates of MS, cystic fibrosis, celiac disease
Dr. Damian Downey, a Clinical Senior Lecturer at the Wellcome-Wolfson Institute for Experimental Medicine, Queen’s University Belfast, is a co-author on the worldwide trial to assess the safety and efficacy of a new triple-drug combination (TRIKAFTATM) in patients with CF aged twelve years and older. The study involved a four-week, randomized, double-blind, active-controlled trial in 107 patients who had two copies of the F508del mutation.
Downey explained, “The trial was a success in demonstrating that this drug combination can potentially treat up to 90% of people with CF by addressing the underlying cause of their disease. This new 'triple therapy' has the potential to transform the lives of people with CF. It results in a significant improvement in lung function and quality of life and also reduces the frequency of chest infections. This treatment will likely alter the future of CF care.”
Do you know someone who'll be affected by this story? Let them know and share the good news.
Read more: Irish in U.S. rally behind friend with “cruelest disease you’ve never heard of”


Datacenter Network & LAN
- Scaling
- [PDF] Floodless in SEATTLE: A Scalable Ethernet Architecture for Large Enterprises
- [PDF] Scalable Flow-Based Networking with DIFANE
- [PDF]** **B4: Experience with a Globally-Deployed Software Deﬁned WAN (SIGCOMM 2013)
- [Slide] A Software Defined WAN Architecture
- Flow Detection & Measurement
- [PDF] Mahout: Low-Overhead Datacenter Trafﬁc Management using End-Host-Based Elephant Detection
- [PDF] [Slide] [Video] Software Deﬁned Trafﬁc Measurement with OpenSketch (NDSI 2013)
- Multipath
- [PDF] Hedera: Dynamic ﬂow scheduling for data center networks
- [PDF] SPAIN: COTS Data-Center Ethernet for Multipathing over Arbitrary Topologies
- [PDF] Experiences with MPTCP in an intercontinental multipathed OpenFlow network (TNC 2013)
- DPI
- [PDF] White Paper: the role of DPI in an SDN world
- Prototyping
- [Report] Ripcord: A Modular Platform for Data Center Networking
- [PDF] OpenQoS: An OpenFlow Controller Design for Multimedia Delivery with End-to-End Quality of Service over Software-Deﬁned Networks
- [LINK][HERE] First Demonstration of enhanced Software Defined Networking (eSDN) over elastic Grid (eGrid) Optical Networks for Data Center Service Migration
- Management
- [Link] A Use-Case Based Analysis of Network Management Functions in the ONF SDN Model (2012 European Workshop on SDN)
Controller Design
- [PDF] Aiding OpenFlow Controller by Enhancing OpenFlow’s Control Model, and Behavior of Flows
- [PDF] FlowVisor: A Network Virtualization Layer
- [Report] Evaluation of OpenFlow Controllers (2012-10-15)
- [Repo] My Controller & Transparent Agent
Theory
- [PDF] CAP for Networks
- [PDF] Fast Data Stream Algorithms using Associative Memories
- [PDF] The space complexity of approximating the frequency moments (STOC 1996)
- [PDF] [Slide] [Video] Spanner: Google’s Globally-Distributed Database
Datacenter
- [link] CPI2: CPU performance isolation for shared compute clusters
- [PDF] [Slide] [Video] Scaling Memcache at Facebook
Conference
- [link] SIGCOMM 2012, HotSDN
- [link] SIGCOMM 2013, HotSDN
- [link] SIGCOMM 2013
- [link] ICC 2013, Workshop on Clouds, Networks and Data Centers
- [link] INFOCOM 2013, Workshop on Emerging Design Choices in Name-Oriented Networking
- [link] NSDI 2013 Poster & Demos
- [link] NSDI 2013 Technical Session
Speci cation
- [PDF] OpenFlow Switch Speci cation v1.0.0
- [PDF] OpenFlow Configuration and Management Protocol 1.0 (OF-Config 1.0)
- [PDF] Network Functions Virtualisation – Introductory White Paper
Publication
- [PDF] FSDM: Floodless Service Discovery Model based on Software-Defined Network (ICC 2013 Workshop CNDC)
- [Link] Software defined network (SDN) broadcast processing method based on cycle trigger agent
Other
- [PDF] How Does the Great Firewall Of China Affect Online User Behavior? Isolated “Internets” as Culturally Defined Markets on the WWW
- [PDF] 多线程服务器的常用编程模型
- [PDF] CPU Cache and Memory Ordering


--- layout: archive title: Zulip Chat Archive permalink: /stream/113489-new-members/topic/hiding.20from.20prelude.html ---
How do you hide symbols from the prelude? In particular, how does one hide field
?
You don't, for the most part. One option is to work in a new namespace, so you can reuse the name field
, but this might occasionally lead to confusion. Using the prelude
command at the top of your file will prevent Lean from loading anything from core, and then you can manually import things from init
. But I doubt you can import very much without getting field
, certainly nothing from mathlib.
Thanks! Makes a lot of sense to work within a namespace then, since I do import other things from mathlib.
I think there's an asterisk on your answer @Rob Lewis. If your file starts with prelude
, Lean doesn't implicitly import init
. But as you say, if you're trying avoid name clashes, that's not the way to go.
Hmm? That's what I said, or it's what I meant, anyway. You can start with prelude
and then import things manually, but you can't import anything that imports init.algebra.field
.
Oh you're right, sorry! I misread!
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


On my radar: Wendell Pierce’s cultural highlights
by Kathryn BromwichThe American actor on Lucian Freud’s self-portraits, the music of Laura Mvula, and Labour MP David Lammy
Born in New Orleans in 1963 , Wendell Pierce studied drama at the Juilliard School in New York. Since then he has starred in numerous TV shows including The Wire (2002- 08 ), Treme (2010- 13) and Suits (2011- 19) ; his film roles include Selma (2014) and Bad Moms (2016) . Earlier this year, Pierce starred alongside Sharon D Clarke in the acclaimed Young Vic production of Arthur Miller’s Death of a Salesman, which transfers to the West End’s Piccadilly theatre until 4 January 2020 .
1. Art
Right now, because I’m in central London all the time, I happen to pass the Royal Academy every day. I love Lucian Freud’s work, so I’m really looking forward to his exhibit there. What I like most about his art is the way his style is so free-flowing but also slightly askew, so you see something subtextual in it – it’s not just the image that you’re seeing in front of you. His self-portraiture always makes you see how his mind is churning: you see that something is heavy on his mind, and you’re curious to know what it is.
2. Book
Parting the Waters by Taylor Branch
I am rereading this book, which catalogues and follows the civil rights movement of the 20th century, starting in 1955 with the Montgomery bus boycott. It reminded me of the generation that came before me, and the struggles they had to face just to fully live as American citizens – the indignities and the violence and the danger that their lives were constantly placed in. It really shows the political, social and psychological wherewithal that they had to have to go through that time. It’s something I wanted to explore as I was preparing for the role of Willy Loman in Death of a Salesman.
3. Film
I was hesitant about seeing this, but I was pleasantly surprised that it wasn’t what I expected it to be. At first you think it’s just about women who dance in strip clubs, but it was much deeper. I think the performance by Jennifer Lopez is actually Oscar-worthy. The film is a great examination of her relationship with Constance Wu’s character: they are two broken people who are trying to find their self-worth and actualise something better in their lives. It’s about the desperation people will go to to find a better path. It was Chekhovian, in a way.
4. Play
Translations , National Theatre
This is a play I haven’t seen, but I would like to see it while I’m here. It’s by Brian Friel, and it’s about the relationship between the Irish and the English in rural 19th-century Ireland. I briefly met the lead actor, Ciaràn Hinds, during rehearsal while we were both on our lunch break. What he does on film is great, so I’m looking forward to seeing what he does here – you really get to see the versatility of an actor when you see them on stage. It’s at the National, a place I love.
5. Music
I was made aware of her when I saw a performance by the Alvin Ailey dance company in New York: the dance, along with her music, was just transcendent. Then I got one of her albums and it was so beautiful. There is a track I have been playing over and over: Father, Father, which is my favourite song of hers. I love the composition and how it comes together, and the message of redemption in it. She lives in London, and I would love to hear her live.
6. Politics
As the whole political debate here is going on, being an expat from America – going through its own tumultuous political fray – I look for singular voices of clarity, and Mr Lammy seems to be that for me. The thing that brought him to my attention was his call to action after the fire at Grenfell Tower, looking into safety and taking care of families and victims. He seems to be a man of the people, who understands that the role of a public servant is to serve the public, and not for any sort of personal gain. I find that very admirable.
This article contains affiliate links, which means we may earn a small commission if a reader clicks through and makes a purchase. All our journalism is independent and is in no way influenced by any advertiser or commercial initiative. By clicking on an affiliate link, you accept that third-party cookies will be set. More information.


To follow the workshop you need to have a working setup with a bunch of dependencies. Simply get the virtual machine of this repository up and running and you are good to go.
Your system needs to satisfy the following conditions.
Clone the repository https://github.com/xeraa/vagrant-elastic-stack.git and run the following command in that folder (where the Vagrantfile is located)
vagrant upThis will take quite a while; just let it run. Once this is done you can log into the VM with
vagrant sshThen you can configure the entire machine with
/elastic-stack/all.shOnce that has finished successfully you will be able to access Kibana at http://localhost:5601/. Now you are ready for the workshop.
PS: If you don't get it up and running, please open an issue in the repository. If everything else fails you can also get the final VM before we start with the workshop, but it takes a little while to copy everything, so please don't rely on that too much.