Functions that access slots of a *_ipm
(including
proto_ipm
). default
methods correspond to *_ipm
objects.
domains(object) # S3 method for proto_ipm domains(object) # S3 method for default domains(object) vital_rate_exprs(object) # S3 method for proto_ipm vital_rate_exprs(object) # S3 method for default vital_rate_exprs(object) vital_rate_funs(ipm) vital_rate_exprs(object, kernel, vital_rate) <- value # S3 method for proto_ipm vital_rate_exprs(object, kernel, vital_rate) <- value new_fun_form(form) kernel_formulae(object) # S3 method for proto_ipm kernel_formulae(object) # S3 method for default kernel_formulae(object) kernel_formulae(object, kernel) <- value # S3 method for proto_ipm kernel_formulae(object, kernel) <- value parameters(object) # S3 method for proto_ipm parameters(object) # S3 method for default parameters(object) parameters(object) <- value # S3 method for proto_ipm parameters(object) <- value int_mesh(ipm, full_mesh = TRUE) pop_state(object) # S3 method for proto_ipm pop_state(object) # S3 method for default pop_state(object)
| object | A |
|---|---|
| ipm | An object created by |
| kernel | The name of the kernel to insert the new vital rate expression into. |
| vital_rate | The name of the vital rate to replace. If the vital rate
doesn't already exist in the |
| value | For |
| form | An expression representing the new vital rate or kernel formula to insert. |
| full_mesh | Return the full integration mesh? Default is |
Depending on the class of object
, a list
with types numeric or character.
The *.default
method corresponds to output from make_ipm()
,
and the *.proto_ipm
methods correspond to outputs from define_*
.
When using kernel_formulae<-
and vital_rates_exprs<-
, the right
hand side of the expression must be wrapped in new_fun_form
. See
examples.
Note that when using vital_rate_funs
, unless the vital rate expression
explicitly contains an expression for integration, these functions
are not yet integrated! This is useful for things like sensitivity
and elasticity analysis, but care must be taken to not use these values
incorrectly.
data(gen_di_det_ex) proto <- gen_di_det_ex$proto_ipm # Create a new, iterated IPM new_ipm <- make_ipm(proto, iterate = TRUE, iterations = 100, return_all_envs = TRUE) vital_rate_exprs(new_ipm)#> g: dnorm(ht_2, g_mu, g_sd) #> g_mu: g_int + g_slope * ht_1 #> s: inv_logit_2(s_int, s_slope, s_slope_2, ht_1) #> f_r: inv_logit(f_r_int, f_r_slope, ht_1) #> f_s: exp(f_s_int + f_s_slope * ht_1) #> f_d: dnorm(ht_2, f_d_mu, f_d_sd)kernel_formulae(new_ipm)#> P: s * g * d_ht #> go_discrete: f_r * f_s * g_i * d_ht #> stay_discrete: 0 #> leave_discrete: e_p * f_d * d_htvital_rate_funs(new_ipm)#> $P #> g (not yet discretized): A 200 x 200 kernel with minimum value: 0 and maximum value: 0.0344 #> g_mu (not yet discretized): A 200 x 200 kernel with minimum value: 8.3275 and maximum value: 620.7542 #> s (not yet discretized): A 200 x 200 kernel with minimum value: 0.001 and maximum value: 1 #> #> $go_discrete #> f_r (not yet discretized): A 1 x 200 row vector with minimum value: 0 and maximum value: 1 #> f_s (not yet discretized): A 1 x 200 row vector with minimum value: 14.1933 and maximum value: 34141.8242 #> #> $stay_discrete #> No vital rates specified #> #> $leave_discrete #> f_d (not yet discretized): A 200 x 1 column vector with minimum value: 0 and maximum value: 0.1948 #>domains(new_ipm)#> ht: lower_bound = 1.02, upper_bound = 624, n_meshpoints = 200parameters(new_ipm)#> g_int g_slope g_sd s_int s_slope s_slope_2 f_r_int #> 5.781000 0.988000 20.556990 -0.352000 0.122000 -0.000213 -11.460000 #> f_r_slope f_s_int f_s_slope f_d_mu f_d_sd e_p g_i #> 0.083500 2.620400 0.012560 5.665500 2.073400 0.150000 0.506700# Usage is the same for proto_ipm's as *_ipm's vital_rate_exprs(proto)#> g: dnorm(ht_2, g_mu, g_sd) #> g_mu: g_int + g_slope * ht_1 #> s: inv_logit_2(s_int, s_slope, s_slope_2, ht_1) #> f_r: inv_logit(f_r_int, f_r_slope, ht_1) #> f_s: exp(f_s_int + f_s_slope * ht_1) #> f_d: dnorm(ht_2, f_d_mu, f_d_sd)kernel_formulae(proto)#> P: s * g * d_ht #> go_discrete: f_r * f_s * g_i * d_ht #> stay_discrete: 0 #> leave_discrete: e_p * f_d * d_htdomains(proto)#> ht: lower_bound = 1.02, upper_bound = 624, n_meshpoints = 200parameters(proto)#> g_int g_slope g_sd s_int s_slope s_slope_2 f_r_int #> 5.781000 0.988000 20.556990 -0.352000 0.122000 -0.000213 -11.460000 #> f_r_slope f_s_int f_s_slope f_d_mu f_d_sd e_p g_i #> 0.083500 2.620400 0.012560 5.665500 2.073400 0.150000 0.506700int_mesh(new_ipm)#> d_ht - 3.1149 #> ht_1 - Lower bound: 2.57745, Upper bound: 622.44255, # of Meshpoints: 200 #> ht_2 - Lower bound: 2.57745, Upper bound: 622.44255, # of Meshpoints: 200# Setting new parameters, vital rate expressions, and kernel formulae # only works on proto_ipm's. # This replaces the "g_int" parameter and leaves the rest untouched parameters(proto) <- list(g_int = 1.5) # This creates a new g_z parameter and leaves the rest of parameters untouched parameters(proto) <- list(g_z = 2.2) # setting a new vital rate or kernel expression requires wrapping the # right-hand side in a call to new_fun_form(). new_fun_form uses expressions # with the same format as ... in define_kernel() vital_rate_exprs(proto, kernel = "P", vital_rate = "g_mu") <- new_fun_form(g_int + g_z + g_slope * ht_1) kernel_formulae(proto, kernel = "stay_discrete") <- new_fun_form(g_z * d_ht)


The Pepper Co. Newsletter
Responsive email newsletter.
- E-mail Development
- HTML & CSS
- Mobile-Friendly
I developed this concept newsletter from scratch. My goal was to learn more about styling and
formatting specifically for emails, particularly thinking about cross-browser compatibility while
ensuring that my inline CSS styling was as efficient as possible.
To prepare, I consulted boilerplate code for responsive email design, reviewed tutorials, and
replicated e-newsletters that I personally enjoyed.
Mobile View:
Code Snippet:
Events & Recipes on Desktop:
Like what you see?
Start the conversation now by clicking through that pretty lil' red button below.


Prepay for NHS prescriptions
Would you like your prepayment details sent by text and email?
We can send your digital prepayment certificate by text and email straight away. We will send you a:
- prepayment number
- start date
- end date
We do not send out plastic cards any more. They are not required for collecting prescriptions. They are costly to the NHS and the environment.


com.johnsnowlabs.nlp.annotators
Converts IOB or IOB2 representation of NER to user-friendly.
Converts IOB or IOB2 representation of NER to user-friendly. See https://en.wikipedia.org/wiki/Inside%E2%80%93outside%E2%80%93beginning_(tagging)
Works with different NER representations as tags Supports: IOB and IOB2 https://en.wikipedia.org/wiki/Inside%E2%80%93outside%E2%80%93beginning_(tagging)
Converts IOB or IOB2 representation of NER to user-friendly. See https://en.wikipedia.org/wiki/Inside%E2%80%93outside%E2%80%93beginning_(tagging)


Local experts from every field of IT came together. The purpose - to help businesses grow and build things people use.


Request_Soap Class
The Request_Soap class is intended to process SOAP requests through PHP's SoapClient extension.
Your PHP installation must be compiled with "--enable-soap". You can check the output of phpinfo() to see if this is the case.
Creating an instance
You can forge an instance of this class through the Request class:
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// how to enable trace option during request creation
$soap = Request::forge('http://soap.example.org/api/v1/this/info', array('driver'=>'soap', 'trace' => true));
// note that this only creates the object, it does not execute the request!
set_params($params)
The set_params method allows you to set parameters to pass on the SOAP request call.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $params |
required |
Array of parameters for the request. |
|
| Returns |
Request_Soap, for chaining |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// set some parameters
$soap->set_params(array('userid' => 12, 'data' => $payload));
|
Please note that the format in which you have to define the parameters is dependent on the SOAP service
being called. Some for example expect them to be wrapped in an array. The SOAP Request driver will pass the
parameters to the service in the format you use on set_params, so make sure it is correct.
set_option($option, $value)
The set_option method allows you to define a SoapClient option to be passed to the request.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $option |
required |
SoapClient option to set. |
| $value |
required |
Value to set this option to. |
|
| Returns |
Request_Soap, for chaining |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// set the username to be used in the request
$soap->set_option('login', $username);
|
set_options(array $options)
The set_options method allows you to define multiple SoapClient options to be passed to the request.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $options |
required |
Array of SoapClient options and values to set. |
|
| Returns |
Request_Soap, for chaining |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// set a username and password to be used in the request
$soap->set_options(array(
'login' => $username,
'password' => $password,
)
);
|
add_param($param, $value = null)
The add_param method allows you to add one or more parameters to the ones already defined.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $param |
required |
Name of the parameter to set, or an array of parameters and values. |
| $value |
null
|
Value to be defined. Only used when $param is a string value. |
|
| Returns |
Request_Soap, for chaining |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// add some parameters
$soap->add_param(array('userid' => 12, 'data' => $payload));
// or add a single one
$soap->add_param('data', $payload);
|
The set_header method allows you to set a HTTP request header as part of the request.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $header |
required |
The name of the HTTP header entry. |
| $content |
null
|
The header value to be set. |
|
| Returns |
Request_Soap, for chaining |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// pass an authentication token to the backend server
$soap->set_header('auth-token', 'WV4YaeV8QeWVVVOE');
|
If you need to set a header that is not in the form "Name: Value", pass the value in $header, and do not pass any content.
The get_headers method allows you to retrieve all currently defined HTTP request headers.
| Static |
No |
| Parameters |
None.
|
| Returns |
Array, all headers set. |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// pass an authentication token to the backend server
$soap->set_header('auth-token', 'WV4YaeV8QeWVVVOE');
// returns array('auth-token:WV4YaeV8QeWVVVOE')
$headers = $soap->get_headers();
|
The set_auto_format method allows you to switch auto formatting on or off. Since 1.7.2, this is switched of by default, and when switched off, you will have to parse the cURL response yourself.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $auto_format |
required |
True if you want the returned response to be converted into an array, false if you want to access it as it is received. |
|
| Returns |
Request_Soap, for chaining |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// we want an array returned
$soap->set_auto_format(true);
|
Auto formatting has support for the following mime types:
- application/xml
- text/xml
- application/json
- text/json
- text/csv
- application/csv
- application/vnd.php.serialized
so when enabled and the response is in one of these types, it will be processed automatically, and returned to your controller
in the form of a PHP array.
Only enable this is the source of the data is trustworthy, and/or if you have validated the received input. JSON and serialized
arrays could contain objects. Since their constructor will execute upon instantiation during auto formatting, it may lead to
unintended code execution, possibly compromizing your server!
execute(array $additional_params = array())
The execute method executes the defined SOAP request.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $additional_params |
array()
|
Any additional parameters you want to pass to the request. |
|
| Returns |
Request_Soap, for chaining |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// execute the request
$result = $soap->execute();
|
set_response($body, $status, $mime = null, $headers = array())
The set_response method sets the response received from the request.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $body |
required |
The data to be set as the response body. |
| $status |
required |
The HTTP status of the created response. |
| $mime |
null
|
The mime type the data is in. This is used with auto_format to convert the body into an array. |
| $headers |
null
|
Any HTTP response headers you want to set. |
|
| Returns |
Response, the created response object. |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// create a custom response (SOAP responses should always be in XML)
$soap->set_response($body, $this->response_info('http_code', 200), 'xml', array('auth-token' => 'WV4YaeV8QeWVVVOE'));
|
Normally you should not use this method. It is used after the request is executed to prepare the requests response object.
response()
The response method returns the current request response.
| Static |
No |
| Parameters |
None.
|
| Returns |
Response, the created response object. |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// assume some parameters and options were set, and execute
$soap->execute();
// fetch the resulting Response object
$result = $soap->response();
|
response_info($key = null, $default = null)
The response_info method allows you to retrieve a SOAP response value, or all response values.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $key |
null
|
Specific response value to retrieve. Don't specify it when you want to retrieve all values. |
| $default |
null
|
Value to be returned when the requested value does not exist. |
|
| Returns |
Mixed, depending on the data type of the requested value. |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// assume some parameters and options were set, and execute
$soap->execute();
// get the soap action executed from the response header
$size = $soap->response_info('SOAPAction', false);
|
This method allows access to the HTTP headers of the response.
set_function($function)
The set_function method sets the function to execute on the SoapClient.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $function |
required |
The name of the SOAP function to call. |
|
| Returns |
Request_Soap, for chaining |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// set the soapcall function to fetch some user data
$soap->set_function('GetUserInfo');
|
get_functions()
The get_functions method returns the list of functions defined in the WSDL.
| Static |
No |
| Parameters |
None.
|
| Returns |
Array of available SOAP functions |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// retrieve the SOAP function list
$functions = $soap->get_functions();
|
This method requires the SoapClient to work in WDSL mode.
get_request_xml()
The get_request_xml method returns the last request XML.
| Static |
No |
| Parameters |
None.
|
| Returns |
String, The last XML request |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// some code here...
// retrieve the last XML request
$request = $soap->get_request_xml();
|
This method requires the 'trace' option to be enabled.
The get_request_headers method returns the headers of the last request.
| Static |
No |
| Parameters |
None.
|
| Returns |
String, the SOAP headers from the last request. May contain newlines. |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// some code here...
// retrieve the headers of the last request
$headers = $soap->get_request_headers();
|
This method requires the 'trace' option to be enabled.
get_response_xml()
The get_response_xml method returns the last response XML.
| Static |
No |
| Parameters |
None.
|
| Returns |
String, The last XML response |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// some code here...
// retrieve the last XML response
$response = $soap->get_response_xml();
|
This method requires the 'trace' option to be enabled.
The get_response_headers method returns the headers of the last response.
| Static |
No |
| Parameters |
None.
|
| Returns |
String, the SOAP headers from the last response. May contain newlines. |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// some code here...
// retrieve the headers of the last response
$response = $soap->get_response_headers();
|
This method requires the 'trace' option to be enabled.
get_types()
The get_types method returns the list of supported types.
| Static |
No |
| Parameters |
None.
|
| Returns |
array of SOAP types, detailing all structures and types. |
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// get the list of types described in the WSDL for this web service
$types = $soap->get_types();
|
This method requires the SoapClient to work in WDSL mode.
set_cookie($name, $value = null)
The set_cookie method sets the request cookie for subsequent requests.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $name |
required |
The name of the cookie. |
| $value |
null
|
The value of the cookie. If not specified, the cookie will be deleted. |
|
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// set an auth token as a cookie in the HTTP request header
$soap->set_cookie('auth-token', 'WV4YaeV8QeWVVVOE');
|
set_location($location)
The set_location method allows you to change the endpoint location.
| Static |
No |
| Parameters |
| Param |
Default |
Description |
| $location |
required |
The new endpoint URL. |
|
| Example |
// create a Request_Soap object
$soap = Request::forge('http://soap.example.org/api/v1/this/info', 'soap');
// change the endpoint of the request
$soap->set_location('http://moresoap.example.org/api/v2/other/info');
|


Mastering GitHub
Mastering GitHub
A video training series
at O’Reilly
by
Delicious Insights
Learn more


EBMC
Home
About
Serices
Awards
Gallery
Products
Contact
Latest Project
Latest Products
Future Projects
some text...
some text...
some text...
some text...


{% extends "public/components/base.html" %} {% load static %} {% block scripts %} {% endblock %} {% block content %} People Overview State Total Unmatched in Session Missing Photo Missing Phone Missing Address {% for state, spd in state_people_data.items %} {{ spd.state }} {{ spd.unmatched }} {{ spd.missing_photo }} {{ spd.missing_phone }} {{ spd.missing_address }} Add new Legislator to {{ spd.state }} {% endfor %} {% endblock %}


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Basic interface for SAX error handlers.
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY.
If a SAX application needs to implement customized error
handling, it must implement this interface and then register an
instance with the XML reader using the
setErrorHandler
method. The parser will then report all errors and warnings
through this interface.
WARNING: If an application does not register an ErrorHandler, XML parsing errors will go unreported and bizarre behaviour may result.
For XML processing errors, a SAX driver must use this interface
instead of throwing an exception: it is up to the application
to decide whether to throw an exception for different types of
errors and warnings. Note, however, that there is no requirement that
the parser continue to provide useful information after a call to
fatalError
(in other words, a SAX driver class
could catch an exception and report a fatalError).
Parser.setErrorHandler(org.xml.sax.ErrorHandler)
,
SAXParseException
| Method Summary | |
void |
error(SAXParseException exception)
Receive notification of a recoverable error. |
void |
fatalError(SAXParseException exception)
Receive notification of a non-recoverable error. |
void |
warning(SAXParseException exception)
Receive notification of a warning. |
| Method Detail |
public void warning(SAXParseException exception) throws SAXException
SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The default behaviour is to take no action.
The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.
Filters may use this method to report other, non-XML warnings as well.
exception
- The warning information encapsulated in a
SAX parse exception.SAXException
- Any SAX exception, possibly
wrapping another exception.SAXParseException
public void error(SAXParseException exception) throws SAXException
This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action.
The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML 1.0 recommendation does not require it to do so.
Filters may use this method to report other, non-XML errors as well.
exception
- The error information encapsulated in a
SAX parse exception.SAXException
- Any SAX exception, possibly
wrapping another exception.SAXParseException
public void fatalError(SAXParseException exception) throws SAXException
This corresponds to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a parser would use this callback to report the violation of a well-formedness constraint.
The application must assume that the document is unusable after the parser has invoked this method, and should continue (if at all) only for the sake of collecting addition error messages: in fact, SAX parsers are free to stop reporting any other events once this method has been invoked.
exception
- The error information encapsulated in a
SAX parse exception.SAXException
- Any SAX exception, possibly
wrapping another exception.SAXParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Definition: Breakeven Quantity is the number of units of a product that you need to sell in order to cover fixed costs and breakeven overall.
BEQ= FC/P-VC
BEQ = Breakeven Quantity
FC = Fixed Costs
VC = Variable Costs
P = Price


--- layout: post title: 'Made In The USA: Saving The American Brand : NPR' categories: [] tags: - business - kodak - local - rochester_ny status: publish type: post published: true meta: _original_post_id: '' _original_import_author: John Duprey author: ---
"Today, Kodak is barely a shadow of its former self. Earlier this month, the company that in 1982 once employed more than 60,000 people in Rochester ??? but now has fewer than 7,000 workers there ??? filed for bankruptcy protection."
Its hard to believe with all of Kodak's assets, it couldn't reinvent itself for the digital age. Its sad to see the icon fade.


---
layout: archive
title: Lean Prover Zulip Chat Archive
permalink: 113489newmembers/68692Finiterankfreemodules.html
---
The archive URL format has changed. Please find this page at:
https://leanprover-community.github.io/archive/stream/113489-new-members/topic/Finite-rank.20free.20modules.html


--- title: "Timepicker" date: 2021-04-29T16:00:58+02:00 draft: false main_title: "Tailwind timepicker" subheading: "" seo_title: "Tailwind timepicker component - examples & templates" description: "Responsive time picker built with the latest Tailwind. Select and set a specific time value from a pre-determined set in a popup panel." image: "" video: "" url: "/docs/standard/forms/timepicker/" menu: forms: name: "Timepicker" --- {{< example lang="html" title="Basic">}}


This API loads the login data from a file (provided as a GET parameter on the url), parses it, and returns the forecast for May 1 2012 - May 15 2012. The forecasts are displayed as a series of table-based plots for each hour of each day in the interval.
This API uses the same forecasting engine as the load from file API but with streamed data. A fake stream is set up (just a loop through the provided data) and forecasts are delivered as they become available. Because the basic forecast is for any week given the input data, all that is displayed is the counts per hour for one week.


DISHING ON FOOD AND LIFE FROM MY HOME TO YOURS
About Me
Recipes
Oh Baby
Mom Blog
{{ block "main" . }} {{ end }}
Advertising


This map uses the Leaflet.VectorGrid plugin for Leaflet 1.0 with the Canvas Renderer (L.canvas.tile).
The vector tiles are stored on Mapbox. Intead of calling a Mapbox style, the pbf files are accessed directly.
This map demonstrates the capability of
Leaflet to render thousands of polygons using
Vector Tiles on both desktop and mobile devices. Rendering, search and identify are handled by the browser, so there is no need for GeoServer/ArcGIS Server, etc., to push data to the client. The original shapefile was converted to geoJSON using esri2open, then to mbtiles using tippecanoe. The tiles are served via mbtiles-server, and rendered using Leaflet 1.0 and Leaflet Vector Grid.


Saurav Ghosal eases into World Squash Championship pre-quarterfinals
by PTIDOHA: India's Saurav Ghosal put up a fine performance to get past seasoned Frenchman Lucas Serme 11-8, 11-5, 11-5 and enter the pre-quarterfinals of the PSA Men's World Squash Championship.
The Indian No. 1 had faced the Frenchman only twice in his career, with their most recent meeting also coming in the second round of a PSA World Championships, in Chicago in February.
Ghosal controlled everything from rallies to strokes and subdued Serme in the Qatari capital on Sunday night.
Serme saved one game ball in the first game but was outplayed in the next.
Having grabbed the first two games, Ghosal won the first five points in the third game to extend his dominance and seal it in his favour.
In the pre-quarterfinals on Tuesday, the tenth seeded Ghosal will face Egyptian world No. 2 and top seed Mohamed El Shorbagy.


What surprised me most about learning core was that I never knew how integral it was to technology sector.
I learned about ‘how’ I learned and how to learn ‘better’ which was interesting.
I really enjoyed the neuroplasticity section, as well as the emotional intelligence and listening and looping portion.
I never thought about soft skills before but I’m glad that I was encouraged to learn them as I think I know more
about myself and my learning style
3 things that I have learned about myself is that I am smarter and more capable than I think, I work well when I have organised
my time and I need to stop comparing myself and my journey to others.
The roles of values, empathy and self-awareness in learning and programming are you need to know your strengths and weaknesses
when it comes to programming and if you need help, ask for it. You need empathy to help others.
The thing that ha surprised me most about core learning was that I really needed it to function as a programmer.
The most challenging aspects were to take a look at myself from an outsider’s point of view and to critique my learning
from the past and ‘how’ I learn. What are the best environments for me to learn in and am I more of a visual learner or critical learner?
I think that we are spending so much time on core learning is because the course is so technically dense that we have to also take care of our wellbeing too.
The time that I have spent learning about core skills has been invaluable. I learned more about myself, my learning style, taking care of myself when
coding and I think that is something that we all needed to learn.
My hope is that I can get a job as a front end or back end web developer with the beginnings in creating own apps.
I would eventually like to get into AI and Augmented reality too. I want to be in this industry because there are so many
working options (company, from home, freelancer..) and there are so many different pathways that you can take.
I think my greatest strengths will be collaborating and working with others.
Being able to be in constant contact with the tutors is really handy as well.
Some limitations for me personally is grasping all of javascript and something that Im focusing on
I think keeping the "not yet" mentality in mind is important for me. To remember that Imn still new at this
and too not put unnessecary pressure on myself.
I would like to get more confident in speaking infront of groups and giving and recieving feedback.
My expectations of myself are that if I need help, I can ask my peers or tutors. I will keep
my workload to set hours so that I have the time to rest if I need to. Its also important to
take small breaks, do some meditation and to do enough work so that at the end of the day, I can
feel good about my day.


Hampton ISS Game Night Selection
Games
{{ game.name }} ({{ game.players | playerRange }} players)
Time required: {{ game.duration | duration }}
{{ game.genres | join : ' / ' }}


| Name | Description |
| eagerZeroedThick |
An eager zeroed thick disk has all space allocated and wiped clean
of any previous contents on the physical media at creation time.
Such disks may take longer time during creation compared to other
disk formats.
Since vSphere API 5.0
|
| flat |
Depending on the host type, Flat is mapped to either
MonolithicFlat or Thick.
|
| monolithicFlat |
A preallocated monolithic disk. Disks in this format can be used with
other VMware products.
|
| monolithicSparse |
A sparse (allocate on demand) monolithic disk. Disks in this format can
be used with other VMware products.
|
| seSparse |
A sparse (allocate on demand) format with additional space
optimizations.
Since vSphere API 5.1
|
| sparse |
Depending on the host type, Sparse is mapped to either
MonolithicSparse or Thin.
|
| thick |
A thick disk has all space allocated at creation time
and the space is zeroed on demand as the space is used.
|
| thin |
Space required for thin-provisioned virtual disk is allocated and
zeroed on demand as the space is used.
|
| twoGbMaxExtentFlat |
A preallocated disk with 2GB maximum extent size. Disks in this format
can be used with other VMware products. The 2GB extent size
makes these disks easier to burn to dvd or use on filesystems that
don't support large files.
|
| twoGbMaxExtentSparse |
A sparse (allocate on demand) disk with 2GB maximum extent size.
Disks in this format can be used with other VMware products. The 2GB
extent size makes these disks easier to burn to dvd or use on
filesystems that don't support large files.
|


Could this be the final design of the HONOR Watch Magic 2?
Just recently, several promotional images of what seems to be the upcoming HONOR Watch Magic 2 has been posted up on weibo.com showcasing what might be the final design of the smartwatch. Based on the image, it seems that the watch sports the familiar tachymeter scale on the outer rim, 2.5D glass as well as two physical buttons that the user would interact with.
Not only that but based on a statement by gsmarena.com, there will be a male as well as a female edition of the HONOR Watch Magic 2. The smartwatch is expected to be unveiled alongside the HONOR V30 in Beijing, China on 26 November 2019. With all that said, there is currently no official information in terms of the exact tech specs, pricing as well as the Malaysia release date for now.
Would you be interested in getting the HONOR Watch Magic 2 as soon as it is available in the Malaysian market? Let us know on our Facebook page, and for more updates like this stay tuned to TechNave.com.


The Project Manager application is based over the following technologies
The following open source librairies are used
The source code of the Project Manager application is hosted on GitHub. Feel free to clone.
The Project Manager application/source code is released under BSD License, so do what you want with it.
The Project Manager application has been write by Guillaume Luchet. You can contact me using the Contact form or the the following social networks:
If you like that application, you can help me to continue working on it and to create other apps by donate. Thanks.


Gold Balanced Lineup
问题描述 :
Farmer John’s N cows (1 ≤ N ≤ 100,000) share many similarities. In fact, FJ has been able to narrow down the list of features shared by his cows to a list of only K different features (1 ≤ K ≤ 30). For example, cows exhibiting feature #1 might have spots, cows exhibiting feature #2 might prefer C to Pascal, and so on.
FJ has even devised a concise way to describe each cow in terms of its "feature ID", a single K-bit integer whose binary representation tells us the set of features exhibited by the cow. As an example, suppose a cow has feature ID = 13. Since 13 written in binary is 1101, this means our cow exhibits features 1, 3, and 4 (reading right to left), but not feature 2. More generally, we find a 1 in the 2^(i-1) place if a cow exhibits feature i.
Always the sensitive fellow, FJ lined up cows 1..N in a long row and noticed that certain ranges of cows are somewhat "balanced" in terms of the features the exhibit. A contiguous range of cows i..j is balanced if each of the K possible features is exhibited by the same number of cows in the range. FJ is curious as to the size of the largest balanced range of cows. See if you can determine it.
输入:
Lines 2..N+1: Line i+1 contains a single K-bit integer specifying the features present in cow i. The least-significant bit of this integer is 1 if the cow exhibits feature #1, and the most-significant bit is 1 if the cow exhibits feature #K.
输出:
样例输入:
7 3 7 6 7 2 1 4 2
样例输出:
4
温馨提示:
解题代码:
import java.util.HashMap; import java.util.Scanner; public class Main{ public static final int size = 100001; static int max_dis ; public static void main(String[] args) { Scanner scan = new Scanner(System.in); while(scan.hasNext()){ max_dis = 0; int N = Integer.parseInt(scan.next()); int K = Integer.parseInt(scan.next()); HashMap< String,Integer> hm = new HashMap< String,Integer>(); StringBuffer sb = new StringBuffer(); for(int i=0;i< K;i++) sb.append(0); hm.put(sb.toString(),0); int sum[][] = new int[N+1][K]; int c[][]= new int[N+1][K]; for(int i=1;i<=N;i++){ int p = Integer.parseInt(scan.next()); int feature ; for(int j=0;j< K;j++){ feature = p%2; sum[i][j] = sum[i-1][j] + feature; c[i][j] = sum[i][j]-sum[i][0]; p /= 2; } add(c[i],i,hm); } System.out.println(max_dis); } } public static void add(int[] a, int i,HashMap< String,Integer> hm) { String data = null; StringBuffer sb = new StringBuffer(); for(int k=0;k< a.length;k++) sb.append(a[k]); data = sb.toString(); if(hm.get(data)==null){ hm.put(data, i); }else{ if(max_dis< i-(hm.get(data))) max_dis = i-hm.get(data); } } }
为什么暴力求解方法循环到sqrt(n) 就可以了呢
51行错了，改为：void Union(struct subset subsets[], int x, int y)
很全很强大！
int L[m+1][n+1];这样定义出错，这个在gcc上可以编译通过 在VS上不行 应该改为new 或者vector
#include <cstdio>
#include <algorithm>
struct LWPair{
int l,w;
};
int main() {
//freopen("input.txt","r",stdin);
const int MAXSIZE=5000, MAXVAL=10000;
LWPair sticks[MAXSIZE];
int store[MAXSIZE];
int ncase, nstick, length,width, tmp, time, i,j;
if(scanf("%d",&ncase)!=1) return -1;
while(ncase– && scanf("%d",&nstick)==1) {
for(i=0;i<nstick;++i) scanf("%d%d",&sticks .l,&sticks .w);
std::sort(sticks,sticks+nstick,[](const LWPair &lhs, const LWPair &rhs) { return lhs.l>rhs.l || lhs.l==rhs.l && lhs.w>rhs.w; });
for(time=-1,i=0;i<nstick;++i) {
tmp=sticks .w;
for(j=time;j>=0 && store >=tmp;–j) ; // search from right to left
if(j==time) { store[++time]=tmp; }
else { store[j+1]=tmp; }
}
printf("%dn",time+1);
}
return 0;
}
递归还真是一门学问，学习了
楼主放题时候没注意下？xxx定律见：
hdoj3782：http://acm.hdu.edu.cn/showproblem.php?pid=3782
这个应该是比较简单的解法了，如果有更好的办法可以告诉我
第2题，TCP不支持多播，多播和广播仅应用于UDP。所以B选项是不对的。第2题，TCP不支持多播，多播和广播仅应用于UDP。所以B选项是不对的。
使用ListNodeWrapper很蹩脚的感觉，没有更好的解决办法？
站长好。我是一个准备创业的互联网小白,我们打算做一个有关国*际*游*学的平台。手上也有了一些境外资源。现阶段的团队现在没有cto.原意出让一些管理股寻找一个靠谱的技术专家做合伙人, 不知道是不是能得到您的帮助。发个帖子或者其他方式。期待您的回应。可以加我微信tianxielemon聊聊。
这种二分还是比较经典！mark
赞一个！权限已更新:）
为避免精度问题，PI值请使用arccos(-1)。应该是acos


--- layout: default title: Officers description: Our officers play many different roles in the LRDNUG Group. View them all here. ---
Oversees all functions of the user group. The President delegates authority to other officers as needed for conducting the required operations of the group. The President is responsible for scheduling regular meetings with the officers to discuss matters concerning the group.
The President should provide guidance to each of the officers as needed for them to perform their duties. In the event that officer positions are not filled or officers are not able to perform their duties, it is the responsibility of the President to see that the necessary work is performed.
The President is responsible for training the Vice President to take over as President at the end of their term. Before finalizing their term, the President should handover all necessary information/authorities to the Vice President.
Note: All officers should provide council to the President as they feel necessary in helping with making decisions that affect the User Group.
Assists the President with leading the user group as directed. The Vice President should learn the responsibilities of the other officers, train new officers, and prepare for service as President. The Vice President should act as the President in situations where the President is not available.
The Event Coordinator develops relationships with venues/facilities in which the group meets. Using these relationships, they manage the event schedule to ensure the venue is available for the scheduled events.
The Event Coordinator also inquires on behalf of the user group with various industry leaders, INETA representatives, speakers at other .NET user groups, Microsoft Evangelists, members interested in presenting, ... as well as past presenters to schedule speakers for the monthly meetings.
The Event Coordinator should work with the President in making a schedule for future presenters.
The Sponsorship Coordinator represents the user group by establishing relationships with various vendors who are or might be interested in providing in-kind give-aways or services and/or donations for monthly meetings or other scheduled events.
The Webmaster is responsible for maintaining the user group’s website, special event pages, and officer e-mail mailboxes. The Webmaster represents the user group in establishing a relationship with the hosting service, managing user ids and passwords to various services, and providing means for group publications..
The Webmaster should work with the President in making decisions affecting the marketing of the group, designs and layouts of the web sites, posting of various information on the group’s website.
The Treasurer is responsible for maintaining an accurate accounting of the user group’s funds; including the incoming donations and out-going expenses. The treasurer should learn and understand tax rules concerning the user group and work with the President in making the necessary filings.
The Training Coordinator is responsible for researching various training and certification opportunities for club members and providing occasional reports to the President for consideration in announcing to the group and/or posting on the user group’s website.


Tyler Bohan, Matt Bronars, Andrew Yeh, Prabhman Dhaliwal
Given an image, be able to represent that image with a custom set of particles and render it. Possibly be able to do interactive things with the image.
(Main) Be able to make abstract 2D scenes with our custom particles (which differ in parameters such as interaction with light, material modelling, interaction with other particles, etc), and be able to procedurally generate a scene. This gives us the most room for creativity and shows off some topics we learned in this class, such as:
- Simulating simplified particle systems
- Ray tracing and RT acceleration
- Rendering pipeline techniques.
Threejs: We have a very rudimentary particle model right now, but it could be useful further down the line due to the thorough documentation available.
Taichi: Simulation looks great so far as seen in the video, but it could become difficult to understand with more complex particles due to less in depth available documentation.
Powerpoint link:
Power PointVideo Link:
VideoWeek 1 + 2: Completed: see progress above
Week 3: Putting together structures, adequate textures, and generating a simulation using our particles on an 8 bit example animation. Have one type of particle implemented fully.
Week 4: Rendering more complex and granular animations, like the galaxy sim. All potential particles completed.


The ICM offers the following five programmes of study through our accredited colleges:
| Programme | Content |
|---|---|
| Credit Management 1 Debtors Admin |
• Definition of credit • Goal setting and measurement of results • Forms of Credit – Definitions • Sources and Role of Credit • Definition of Credit Terminology • Assessments – New accounts and reviews • Collections • Debtors Administration • Business Etiquette • POE: 1 x Assignment, 2 x Assessments, 1 x Final written exam |
| Credit Management 2 Credit Controller |
• Legislative factors of Credit Management and the impact on customer’s ability to pay. • Sources of finance available to Companies requiring working capital / growth funding. • Credit Policy: Definition, Role and use of the policy. • Understanding targets. • Collections. • Credit limit management. • Factors to consider when approving an account. • Securing an account. • Insurance. • Debt re-scheduling. • Export and International Credit. • Organisational structure. • Audits – Basic understanding. • POE: 1 x Assignment, 2 x Assessments, 1 x Final written exam. |
| Credit Management 3 Credit Supervisor |
• The role of Credit in the Economy. • Management. • Structure of a Credit Management Department. • Supervising the department. • Financial Management. • Insolvencies and Liquidations. • Law Courts. • Legal action on delinquent debtors. • POE: 1 x Assignment, 2 x Assessments, 1 x Final written exam. |
| Credit Management 4 Credit Manager |
• Human Resources. • Credit Management Statistics. • Business Law. • Introduction to Business Economics. • POE: 1 x Assignment, 2 x Assessments, 1 x Final written exam. |
| Credit Management 5 National Credit Manager |
• Credit Management reports. • Internal and external audit and the requirements. • SARS and Taxes. • International rating agencies. • Industrial Relations. • Leadership Skills. • Boardroom etiquette – conducting and attending meetings. • Sales and Marketing. • POE: 1 x Assignment, 2 x Assessments, 1 x Final written exam |
| Credit Management 6 | Coming Soon! |


Bootstrap Form Builder
Your Form
Drag & Drop components
By Adam Moore (
@minikomi
).
Source on (
Github
).


You have 7 unread mails
Marian Garner
The meeting is cancelled
David Grey
Travis Jenkins
You have 4 new notifications
Just now
Private message
2 days ago
Allen Moreno
<EMAIL_ADDRESS>Premium user


Central Service¶
The Central Service within BuildingDepot is the part of the system that holds all the core metadata. Starting from the structures of the Buildings to the DataServices that lie in an installation the CentralService plays a very important role in organising the data within BuildingDepot in a meaningful way. A brief explanation will be provided here of each of the options available in the CentralService.
OAuth¶
To generate an OAuth token a client id and client secret key are required. These are generated within the DataService by the user through the GUI. These values will be valid until the user regenerates them for that certain account. The process to generate an OAuth token after these values have been obtained is defined in the REST API Documentation.
TagType¶
Tags are an integral part of BuildingDepot and play an important role in organising and categorising the sensors and their data. Users can create new tags here which will be used in various places throughout BuildingDepot. When creating each tag parent tag(s) can be specified for each tag enabling us to create a tag hierarchy that proves to be very useful when defining structures such as Buildings. Here only the tag names are specified and the values for these tags are specified later on. Each tag can have multiple values if needed.
BuildingTemplate¶
Each building within BuildingDepot has a BuildingTemplate as a foundation. The BuildingTemplate helps define the structure of the building. The user has to assign a set of tags to the BuildingTemplate on creation which can be used later on for all the sensors within that building.
Building¶
All the buildings that are present within the deployment of BuildingDepot are defined here. When adding a new building a BuildingTemplate has to be selected which defines the structure of this building. The tags that are available to be assigned to this building are dependent on the BuildingTemplate. Tags can be selected and the values for each of them can be specified here. Each tag can have multiple values specified for it.
Data Services¶
BuildingDepot consists of a single CentralService and if needed multiple DataServices. The number of DataServices to deploy is a decision that is completely left to the user. A DataService per building is an ideal choice that we suggest. Each DataService has to be specified within the DataService’s section in the CentralService. For each DataService all the buildings that belong to it also have to be selected and added. The admins for each DataService who will have complete administrative control over this DataService also have to be specified here.
Note: The first DataService has to be called “ds1”.
Sensor¶
Individual sensor points are defined here. After adding a sensor a UUID is generated which will be the unique identifier used in all further transactions with BuildingDepot whether it be reading a datapoint from a sensor or posting a bunch of datapoints to a sensor. Each sensor can also have a set of tags attached to it that not only help in categorising them in a meaningful way but also are critical for defining the access control lists later on. The option to attach metadata that is specific to this sensor is also provided. Sensors can be searched for using either the tags or metadata as a filter.
Sensor Group¶
Sensor groups are as the name suggests a set of sensors that have been grouped together on the basis of the tags that the user selected while creating the group. While creating a Sensor groups each individual sensor that the user wants to put in the group do not have to be manual added. Simply selecting the tag will automatically add at the backend all the sensors containing that tag into this group.
User Group¶
Similar to Sensor groups, User groups are a list of users that have been categorised into one group. Groups are created using the user email id that was used during registration.
Permission¶
In the permissions section Sensor groups and User groups come together to form the access control lists. Here we select a User Group and a Sensor Group and a permission value with which we want to associate these both. There are three levels of permission defined in BuildingDepot which are ‘d/r’ (deny read) ,’r’ (read), ‘r/w’ (read write) and ‘r/w/p’ (read write permission). If there are multiple permission mappings between a user and a sensor then the one that is most restrictive is chosen.


About
Documentation
UI/UX
More
Contact Us
Report an issue
Play Now
Prototype
Stats
Characters & Roles
Filters
Recon
Support
Medic
Assault
Clear
Name
Role
Nico
Support
100
3
3
Britt
Recon
75
5
5
Ben
Medic
125
4
2
Zack
Support
110
4
4
Lexi
Medic
150
2
3
Nicole
Assault
130
2
5
Gavin
Assault
160
4
5
Emily
Support
100
3
3


This application intended to calculate two numbers
Please provide two positive integer numbers below and press calculate button


On the original Brainscope site the framework code was not minified or uglified in any way. As such anyone using the site could potentially reuse the code as supplied. However the framework, while divided into a number of classes, lacked a clear structure. In order to facilitate open source reuse the framework has been refactored and renamed ReScatter.
In its current form the library is still quite restricted in its applicability but if your need plots like those in the Brainscope site that much is possible. The first release has deliberately been given a low version number (0.1) to indicate that much more refactoring is needed to permit the easy reuse of key individual components such as the ReScatter.view.PointGroupView that forms the core of the WebGL based plots.
| Library | Comments |
| PIXI.js | Used in ReScatter.control.PixijsPlotController and ReScatter.view.PointGroupView for scatter plots and the density maps. |
| webix | Used in the ReScatter.widgets for all widgets functionality. In theory this could be replaced by an alternative widget library. For Brainscope webix was a natural choice as the ontology tree and data selection sections could be easily created using the available controls. |
| jQuery | Used for some DOM search and manipulation and for the sliders that separate the sections of the webpage |
| Name | Description | Features |
|---|---|---|
| MNIST tSNE scatterplot | A scatterplot of 10000 MNIST digits | Rescatter plots 10000 MNIST points. |
| MNIST tSNE Dual view digits/pixels | Creating coupled graphs in rescatter with a simple SVG based choropleth. | Rescatter plots Choropleth 10000 MNIST points. |
| MNIST tSNE 60000 Dual view | Improving choropleth performance with a html canvas. Demonstration that the choropleth is not limited to svg | Rescatter plots Canvas based choropleth plugin 60000 MNIST points. |
| MNIST tSNE 60000 Dual view + radial plot | Demonstrate integration of d3 based plots as ReScatter plugins. Version 1 only incoming selections | d3 integration plugin (radial plot) How to handle incoming selection events in d3 plugin Rescatter plots Canvas based choropleth plugin 60000 MNIST points. |
| MNIST tSNE 60000 Dual view + radial plot | Demonstrate integration of d3 based plots as ReScatter plugins. Version 2 incoming and outgoing selections | d3 integration plugin (radial plot) How to handle incoming and generate outgoing selection events in d3 plugin Rescatter plots Canvas based choropleth plugin 60000 MNIST points. |
| MNIST umap and tSNE 60000 with wheel navigation (thanks to T. Höllt) | Demonstrate a hierarchy of linked plots driven by the wheel navigator | d3 visualization as plot navigation Rescatter plots Canvas based choropleth plugin 60000 MNIST points. |
A tSNE dual-view is a technique of creating a tSNE embedding on high dimensionality data over both the sample and data dimensions. The result is samples grouped according to the data dimensions and the data groups according to the samples. By linking the plots the user can discover which data points make the greatest contribution to the sample clusters
MNIST handwriting data in a simple dual view with a thematic


XUpload now has a dedicated web site at xupload.aspupload.com. Click on the XUpload logo to go there.


Fixing Database Connections in Django
If you’re looking to get better performance from your Django apps you can check out Pro Django, PostgreSQL High Performance, or read some my earlier posts on Postgres Performance. All of these are of course good things to do – you can also start by correcting an incredibly common but also painful performance issue, that until 1.6 is unaddressed in Django.
Django’s current default behavior is to establish a connection for each request within a Django application. In many cases any particularly in distributed cloud environments this is a large time sink of your response time. An example application running on Heroku shows a typical connection time of 70ms. A large part of this time is the SSL negotiation that occurs in connecting to your database, which is a good practice to ensure security of your data. Regardless, this is a long time in simply establishing a connection. As a point of comparisson its commonly encourage that most queries to your database are under 10ms.
An example that highlights this in a small lightweight application shows the bulk of a request time being within a connection displayed by New Relic:
One option to remedy this is by running a connection pooler on your Database side such as Pgpool or PgBouncer. In fact Ask the Pony already highlighted these potential gains. While running an external DB they’re essentially testing the benefits of conncetion pooling. This is an obvious gain and can be in a much more lightweight format.
Connection Pooling in Django
As Django establishes a connection on each request it has an opportunity to both pool connections and persist connections. There are two major options for pooling, each works quite well with Django and provides some dramatic improvements. While the first request may take the 70ms of connection time, subsequent requests show absolutely no connection time since the connection already exists. This is highlighed by these two comparissons of before and after in actually the times it grabs a connection:
Clearly theres plenty of value to having a persistent connection or a pool within Django itself. As of today theres a few options for that:
Django-PostgresPool
The first Django-PostgresPool is created by kennethreitz. As in general I’d encourage the use of dj_database_url you can easily begin using his package (once installed) with:
import dj_database_url
DATABASE = { 'default': dj_database_url.config() }
DATABASES['default']['ENGINE'] = 'django_postgrespool'
An important thing to note is if you’re using South you’ll also want to setup the adapter for it:
SOUTH_DATABASE_ADAPTERS = {
'default': 'south.db.postgresql_psycopg2'
}
djorm-ext-pool
The second option djorm-ext-pool is created by niwibe. Once you’ve installed djorm-ext-pool
you then add it to your INSTALLED_APPS
within your settings.py
. From here then you can setup your pool:
DJORM_POOL_OPTIONS = {
"pool_size": 20,
"max_overflow": 0
}
django-db-pool
The third and final option is django-db-pool. You can set it up with:
DATABASES = {'default': dj_database_url.config()}
DATABASES['default']['ENGINE'] = 'dbpool.db.backends.postgresql_psycopg2'
DATABASES['default']['OPTIONS'] = {
'MAX_CONNS': 10
}
Gotchas
Each of these does work with recent versions of Django, though in some cases there are gotchas. If using a prodution worthy python web server such as Gunicorn or uwsgi and running with gevent or eventlet some edge cases can present themselves. Regardless of potential gotchas it is worth attempting this and of course providing feedback to maintainers and the community as you find those.
The future
Django more recently has directly started to address these issues of large costs of establishing a connection. The first major step here is this patch from Aymeric. You can find more dicussion around this particular patch here. Essentially with this patch which will hit in Django 1.6 developers then get a persistent connection which will help reduce the time. If you’re interested in trying the 1.6 master you can do this by adding it to your requirements.txt as:
https://github.com/django/django/archive/master.zip
At this point it does not introduce pooling which could allow even more gains, though I’m sure if there’s enough need it’ll be on a roadmap at some point. Though, as it stands today before 1.6 your best bet is one of the above options.


Placeholder
Create a placeholder space that can be used for uploading files via drag and drop.
Usage
This component applies a specially styled area to create a placeholder space. Just add the .uk-placeholder
class to a

element.
Example
Markup

...

Large placeholder
You can also increase the height of the placeholder area by adding the .uk-placeholder-large
class.


After the package installation is complete, the next step is to make
sure that the system can properly find the files. If you set up your
login scripts as recommended in The
Bash Shell Startup Files, update the environment by creating the
openjdk.sh
script, as the root
user:
cat > /etc/profile.d/openjdk.sh << "EOF"
# Begin /etc/profile.d/openjdk.sh
# Set JAVA_HOME directory
JAVA_HOME=/opt/jdk
# Adjust PATH
pathappend $JAVA_HOME/bin
# Add to MANPATH
pathappend $JAVA_HOME/man MANPATH
# Auto Java CLASSPATH: Copy jar files to, or create symlinks in, the
# /usr/share/java directory. Note that having gcj jars with OpenJDK 8
# may lead to errors.
AUTO_CLASSPATH_DIR=/usr/share/java
pathprepend . CLASSPATH
for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
pathappend $dir CLASSPATH
done
for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
pathappend $jar CLASSPATH
done
export JAVA_HOME
unset AUTO_CLASSPATH_DIR dir jar
# End /etc/profile.d/openjdk.sh
EOF
For allowing mandb to
include the OpenJDK man pages in its database, issue, as the
root
user:
cat >> /etc/man_db.conf << "EOF" &&
# Begin Java addition
MANDATORY_MANPATH /opt/jdk/man
MANPATH_MAP /opt/jdk/bin /opt/jdk/man
MANDB_MAP /opt/jdk/man /var/cache/man/jdk
# End Java addition
EOF
mkdir -p /var/cache/man
mandb -c /opt/jdk/man
The installation of the JRE Certificate Authority Certificates (cacerts) is described in the JRE Certificate Authority Certificates section. If you are using the binary version, those certificates may already be installed.
Last updated on 2016-08-28 02:28:15 -0700


`Austin Powers -– Still Putting the GRRR in Swingrrr, Baby by Homer Yen (c) 1999
If there's one thing I admire about Austin Powers-the man (Mike Myers), it's that he has a boundless amount of energy and feel-good silliness that could make the grayest skies turn blue. He's a manic, I want-to-fight-evil-and-shag machine that's constantly working in overdrive. Austin Powers will always be the man that every girl wants and the only one who can thwart the mad schemes of power-hungry Dr. Evil (also played by Mike Myers). Dr. Evil knows that he can't defeat Powers because the latter possesses something called ‘mojo', the essence of what makes a man a man. Having this enables a person to have confidence, appeal, and ‘shagability'. Powers's mojo is especially strong. So, he plans to steal it. He presumes that if Powers is mojoless, he won't have the self-confidence needed to defeat him. But as the story progresses, Powers learns a life-affirming lesson that ‘mojo' isn't what makes a man. It's something far greater than what his playful mind can ever imagine. And what is it? I think that Austin, between shags, is still trying to figure it out.
If you've seen the first `Austin Powers,' then you're already familiar with the premise of this film. At its core, it is a parody of every James Bond flick that has ever been released. And for the most part, it'll put a smile on your face. You have the femme fatales with the libidinous names such as Robin Swallows and Ivana Humpalott. Power's also teams up with a CIA operative (Heather Graham) named Felicity Shagwell (`Shagwell in name and shag very well in reputation,' she growls). There is the standout henchman with an oddball name who possesses a special evil talent, in this case named Fat Bastard (also played by Myers). There are the secret lairs hidden beneath volcanoes and even a pursuit that takes everyone to the moon where Dr. Evil hopes to execute his grand plan.
Each of these elements is milked for all its worth and these kinds of silly exaggerations are something that any James Bond-loving fan can laugh at. But there are also the nuggets of comedy that make this more enjoyable than the standard parody. The opening credits features Powers strutting stark naked through a hotel, but manages to hide his ‘jewels' from the audiences' view by cleverly standing behind a large banana, a loaf of French bread, a carefully placed pinwheel, and other assorted, suggestive items. Another clever sequence involved a series of scenes featuring people all unknowingly making references to a man's sexual organ. This is a scene that must be watched in order to be appreciated. I also like his underappreciated, underloved son (Seth Green).
What made the first one super-groovy, however, was that Austin and Dr. Evil were products of the ‘60s, living in the '90. They were both absurdly out of touch with reality, and that was funny. This obvious target for laughs is not exploited here, and it instead relies on a formula of straight parody. The result sometimes borders on Saturday-Night-Live-Skit-Mediocrity. Half-way through the film, laughs were harder to come by and too much time was devoted to Fat Bastard, whom I found annoying. Fortunately, Mike Myers shows commitment to his character and zest for his antics. What's not to like?
Grade: B
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Usage
Using Hamburgers for your site is easy (well, that was my intention anyway).
-
Download and include the CSS in the

of your site:<link href="dist/hamburgers.css" rel="stylesheet">
-
Add the base hamburger markup:
<button class="hamburger" type="button">    </button>
You can use

s (if you insist), but they’re not accessible as a menu button.

-
Append the class name of the type of hamburger you’re craving:
<button class="hamburger hamburger--collapse" type="button">    </button>
Here’s the list of hamburger-type classes you can choose from:
hamburger--3dx
hamburger--3dx-r
hamburger--3dy
hamburger--3dy-r
hamburger--arrow
hamburger--arrow-r
hamburger--arrowalt
hamburger--arrowalt-r
hamburger--boring
hamburger--collapse
hamburger--collapse-r
hamburger--elastic
hamburger--elastic-r
hamburger--emphatic
hamburger--emphatic-r
hamburger--slider
hamburger--slider-r
hamburger--spin
hamburger--spin-r
hamburger--spring
hamburger--spring-r
hamburger--stand
hamburger--stand-r
hamburger--squeeze
hamburger--vortex
hamburger--vortex-r
Note:
-r
classes are reverse variants (e.g.hamburger--spin
spins clockwise whereashamburger--spin-r
spins counterclockwise. -
Trigger the active state by appending class name
is-active
:<button class="hamburger hamburger--collapse is-active" type="button">    </button>
Since the class name would have to be toggled via JavaScript and implementation would differ based on the context of how you plan on using the hamburger, I’m going to leave the rest up to you. Stuck? Here‘s a hint.
Here’s a snippet of how to toggle a class name on click with JavaScript:

...or jQuery:

Sass
I’ve also included .scss
source files if you use Sass as your CSS precompiler. It’s customizable and modular.
-
Download and unzip the source code from Github.
-
Copy the files from the
_sass/hamburgers
directory into your project. -
Import the
hamburgers.scss
file in your Sass manifest file:@import "path/to/hamburgers";
-
Customize your hamburger and/or remove any types you don’t want in
hamburgers.scss
. -
Compile your Sass*, and voila!
Hamburgers is also available on npm and Bower.
npm install hamburgers bower install css-hamburgers
* Be sure to run the CSS through Autoprefixer since the Sass doesn’t account for vendor prefixes.
Customization
Here is the full list of default settings (found in _sass/hamburgers/hamburgers.scss
);
$hamburger-padding-x : 15px !default;
$hamburger-padding-y : 15px !default;
$hamburger-layer-width : 40px !default;
$hamburger-layer-height : 4px !default;
$hamburger-layer-spacing : 6px !default;
$hamburger-layer-color : #000 !default;
$hamburger-layer-border-radius : 4px !default;
$hamburger-hover-opacity : 0.7 !default;
$hamburger-hover-transition-duration : 0.15s !default;
$hamburger-hover-transition-timing-function: linear !default;
// To use CSS filters as the hover effect instead of opacity,
// set $hamburger-hover-use-filter as true and
// change the value of $hamburger-hover-filter accordingly.
$hamburger-hover-use-filter: false !default;
$hamburger-hover-filter : opacity(50%) !default;
To override any default settings, you can change the value(s) within hamburgers.scss
, but I recommend you declare your new settings separately:
@import "path/to/hamburgers";
$hamburgers-padding-x: 20px;
$hamburgers-padding-y: 15px;
You can also create a separate file (e.g. hamburgers-settings.scss) with those declarations, then import it along with Hamburgers:
@import "path/to/hamburgers";
@import "hamburgers-settings"
ems
or rems
Wanna work with ems
or rems
instead of px
? Just change all the px
values to the unit of your choice. Note: Be consistent (all px
or all ems
), otherwise it may break—the math behind the customization will fail if it attempts to perform operations with values of different units.
Not satisfied?
Dig into _base.scss
or types/
and customize to your heart’s content. Fair warning: It‘s pretty delicate and may break, especially if you tweak the animations themselves.
Accessibility
Hamburger menu icons can be useful in the right context, but they’re not the most accessible.
ARIA will help make it accessible to people with disabilities.
<button class="hamburger hamburger--elastic" type="button"
aria-label="Menu" aria-controls="navigation">

</button>

If you insist on using

s, by default they’re not focusable (i.e. via keyboard or assistive technology). Add the tabindex
attribute alongside ARIA.

A label can help make it more obvious that it toggles a menu.
Here are some resources on web accessibility and ARIA.
Browser Support
Animations use CSS3 3D transforms (translate3d
whenever possible for GPU acceleration), which is supported by most browsers (not supported by IE9 and older and Opera Mini). For detailed browser support, check caniuse.com.


BOOK OF SHADOWS: BLAIR WITCH 2 (Artisan) Starring: Kim Director, Jeffrey Donovan, Erica Leersehn, Stephen Barker Turner, Tristen Skyler, Lanny Flaherty. Screenplay: Dick Beebe and Joe Berlinger. Producer: Bill Carraro. Director: Joe Berlinger.  Reviewed by Scott Renshaw.
In coming up with a concept for a sequel to THE BLAIR WITCH PROJECT -- as apparently sequel-proof a film as ever was made -- the producers actually had a brilliant idea. In the summer of 1999, THE BLAIR WITCH PROJECT wasn't so much an innovative, polarizing suspense film as it was a cultural phenomenon. Somehow, a microscopic budget and an ingenious web site had combined to create a box office smash, intensive media coverage and fan fascination. So instead of devising a sequel to THE BLAIR WITCH PROJECT, Haxan Films devised a sequel to the cultural phenomenon. BOOK OF SHADOWS: BLAIR WITCH 2 would be set in the world where the first film was a hit, inspiring people to tour the places where the Blair Witch mythology had been born.
For about five minutes, that concept is executed to perfection. Director Joe Berlinger (the gifted documentarian behind PARADISE LOST and BROTHER'S KEEPER with his partner Bruce Sinofsky, making his fiction feature debut) opens with news footage and faux interviews with residents of Burkittsville, Maryland commenting on how the influx of Blair Witch devotees and curiosity-seekers has turned the town upside-down. It's clever stuff, but it's soon discarded for a "dramatization" of a story about one particular group of tourists. Jeff (Jeffrey Donovan) is the opportunistic tour guide; Erica (Erica Leersehn) is a Wiccan trying to commune with the spirit of the original Blair Witch; Stephen (Stephen Barker Turner) and Tristen (Tristen Skyler) are co-authoring a book on the Blair Witch mythology; and Kim (Kim Director) is a psychic Goth girl. All is well until they wake up after their first night camping to discover their campsite trashed, and no one able to recall five hours of their experience the previous night.
There was no way that BLAIR WITCH 2 could capture the intensity of the original, though it tries to cling to some of the details (like naming all the characters after the actors playing them). It's ultimately a pretty conventional horror film, but the reason it fails is not that it's conventional. It's simply wretchedly executed even as a conventional horror film. Berlinger and company never rustle up a single decent scare during the film's hour and a half running time, opting instead for lurid quick-cuts to brutal murders. Even the basic structure of the film undercuts any chance for suspense. At various points in the main story, Berlinger splices in police interviews with characters in the film, interviews clearly intended as flash-forwards to a point after the main story has ended.
The truly depressing thing about BLAIR WITCH 2 is that it discards such a potentially intriguing framework for its story. There's an amusing moment early in the film where a competing tour group crosses paths with our protagonists, suggesting that the film will continue to draw on the original film's appeal as a central element to the story. But ultimately the idea of a constructed mythology and its effect on psychology gives way to obvious apparitions and overly literal supernatural phenomenon. Then the film can't even manage to render those obvious apparitions in a creepy way, devoting most of the film to tedious scenes of characters watching videotape or shrieking accusations at one another. Plenty of BLAIR WITCH PROJECT detractors counted the incessant arguing and shouting among their gripes. Now imagine all that arguing and shouting by actors reading awful dialogue instead of improvising their anxiety, and you get a sense for how irritating BLAIR WITCH 2 turns out to be.
If nothing else made the majority of BLAIR WITCH 2 a painful experience, there would be the inexplicably bizarre performance by Lanny Flaherty as a surly sheriff. Flaherty acts as though his only frame of reference for cinematic lawmen was Jackie Gleason in the SMOKEY AND THE BANDIT films, inspiring fits of unintentional laughter every time he appears or utters a thickly-drawled threat. It's hard to build an atmosphere of impending doom when one of the actors appears convinced that the film is a broad comedy. There are welcome elements of self-parody in BLAIR WITCH 2, but Berlinger doesn't know when to turn off the gags and make a real scary movie. The makers of BLAIR WITCH 2 were smart enough to realize that they couldn't catch the same lighting in a bottle again. They just weren't talented enough to catch a different kind of lightning.
On the Renshaw scale of 0 to 10 un-Blair-able experiences: 3.
Visit Scott Renshaw's Screening Room http://www.inconnect.com/~renshaw/ *** Subscribe to receive new reviews directly by email! See the Screening Room for details, or reply to this message with subject "Subscribe".
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


--- layout: post esbma_id: 1697 title: 12: Book Review: 3D Programming for Windows date: 2007-07-24 13:23:15 ---
This entry is part 12 of a 12-part series on WPF 3D.
The best WPF 3D tip I can give you today is to recommend that you buy a copy of 3D Programming for Windows by Charles Petzold. The book will be released tomorrow.
I have enjoyed the privilege of reading this book as a technical reviewer. It's going to be very good. Not as good as Harry Potter and the Deathly Hallows, but still, very good. :-)
The book contains 9 chapters:
I don't think anybody but Charles Petzold could have written this book. He blends his development experience with his math background to explain everything quite thoroughly, from the details of the API to the hows and whys of the math underneath.
The book contains lots of pictures, lots of sample code and a library of useful classes for WPF 3D programming.
If you're doing anything with WPF 3D, you simply must have this book.


TRA station fills with smoke in New Taipei City
Passengers flee Banqiao station after smoke billows up under train, caused by overheated wheels
by Ching-Tse ChengTRA train (CNA photo)
TAIPEI (Taiwan News) – The Taiwan Railways Administration (TRA) Banqiao station in New Taipei City was filled with smoke on Saturday (Nov. 23) morning after train wheels overheated, causing terrified passengers to flee.
According to a Facebook post shared by a train passenger, the incident occurred at around 11 a.m. A lot of smoke billowed up from underneath the train compartments.
The man who posted about the incident said he heard a woman shouting hysterically from the platform, followed by passengers yelling, "I smell something burning!" and "Everyone out!" The train was delayed 22 minutes before setting off again.
TRA apologized for the incident, saying the fifth compartment of the train had a slightly malfunctioning buffer, causing it to move when the train was braking. The smoke and burned smell were caused by over-heating of the train wheels, reported CNA.


Specify Redmine API Key which can be found in Redmine's [My Account] -> API access key
If can't find "API access key", Redmine admin needs to enable a setting. "Administration > Settings > Authentication > Enable REST web service".


Angular directives to display loading of an indicate after pressing a button or a form based on promises. View project on
GitHub
.
Elements loader (success and error)
Success respond
Error respond
Form loader
Submit


We offer services as varied as the issues your business faces.
“ Ben is the most brilliant technicial we've ever had, he fixed our server in less than an hour and we were able to get back to business in no time! ”
“ Tech of New York is a group of talented technicians who we hire as our sole contractors. ”
“ Technology of New York is one of the best technology solution firms here in New York. I am very happy to be their client. ”


Tests for a bug in the paragraph separator insertion code that would add an extra newline when inserting a paragraph separator at the end of a paragraph in text that preserves newlines. Also, an extraneous space would be added after 'foo'. Only one newline should be added. And there should be no extraneous spaces.
It demonstrates a bug: too much padding is left between the new line and the end of the paragraph containing 'foo'.
foo bar


| Release Doc > Examples > Simple Examples > ObjectSpace > DataSet & Quick Report | ||
| DataSet & Quick Report | ||
|
Launch Delphi-example |
Launch CBuilder-example
This example shows how to use a BoldDataSet together with report generation with the Quick report components in Delphi. The example model contains a Person - Building relationship where a Person can have zero to one home and a Building can have zero to many residents. How to run Create instances of buildings and persons. Drag instances of persons to the residents listbox for a building. Then generate the report. The report will show a list of all the buildings and for each building its residents. Use of BoldDataSet This component builds a dataset of bold objects and is useful when creating reports. The BoldDataSet is connected to a list of bold objects and the desired object fields to show in the dataset are described. When creating the report you connect the report fields to desired datasets and datafields. The report tool then loops the dataset and the selected datafields are shown in the report in runtime. See also
Note! Please make sure to use the "Create DB & Alias" button before attempting to open the system for the first time. Once the database and alias is established you only have to use the "Open system" button when running the example program. | ||
| All material $(COPYRIGHT_TEXT). Registered Trademarks and other trademarks are properties of their respective holders. |


--- layout: page title: About me subtitle: 'Or: why you would want to talk to me' css: /css/aboutme.css published: true ---
I am presently in a Software Engineer at Amazon. Previously I have built softwares at Morgan Stanley (full-time), Goldman Sachs (intern) and Indian Institute of Technology, Bombay (intern).
I finished my schooling phase of life with a Masters in Computer Science from North Carolina State University. Before that, I did bachelor in Computer Science from the Visvesvaraya National Institute of Technology, India. Some of the topics I love reading about include Machine Learning, AI, Software Development.
I enjoy writing useful & reusable software tools to help others — check out my projects.
I'm addicted to skiing, skating, reading at any given (and non-given) moment, getting into philosophical debates, and meeting new people :)
The projects page is a nice place to see some of my work, but you can also view my resume.
Though I would want to travel > 20 countries my lifetime, only 35% of the effort is done yet - India, USA, UK, Ireland, Maldives, France, Canada :)
You can find my email and social media links at the bottom of every page. As I said, I love meeting new people so don't hesitate to send a message!


Hello World!👋 I am Shubham,
Thanks for paying a visit 🖖 |
|
|
Currently focusing on |
|
Projects |
|
Certifications |
|
Blogs & Quora |
|
|
|
|
|
Let's Connect |
Shubham |


You said:
use a
:what
as background
put a
:what
in the middle
put a
:what
to the left
put a
:what
to the right


Notification Admin
Notification ID
FCM-Topic
Title
Short Summary
Long Summary
Icon url
Image url
Url
Send


Applications must frequently deal with data that lives longer than the programs that create it. Sometimes the structure of that data changes over time, but new versions of a program must be able to accomodate data created by an older version. These versions may change very quickly, especially during development of new code. Sometimes different versions of the same program are running at the same time, sharing data across a network connection. These situations all result in a need for a way to upgrade data structures.
Simple object persistence (using pickle
or
jelly
) provides the fundamental save the object to disk
functionality at application shutdown. If you use the Application
object, every object
referenced by your Application will be saved into the
-shutdown.tap
file when the program terminates. When you use
twistd
to launch that new .tap file, the Application object
will be restored along with all of its referenced data.
This provides a simple way to have data outlive any particular invocation
of your program: simply store it as an attribute of the Application. Note
that all Services are referenced by the Application, so their attributes
will be stored as well. Ports that have been bound with listenTCP (and the
like) are also remembered, and the sockets are created at startup time (when
Application.run
is called).
To influence the way that the Application
is persisted, you can adapt
it to twisted.persisted.sob.IPersistable
and use
the setStyle(style)
method with
a string like pickle
or source
. These use different serializers (and different
extensions: .tap
and .tas
respectively) for the
saved Application.
You can manually cause the application to be saved by calling its
.save
method (on the twisted.persisted.sob.IPersistable
adapted object).
So suppose you're running version 1 of some application, and you want to upgrade to version 2. You shut down the program, giving you a .tap file that you could restore with twistd to get back to the same state that you had before. The upgrade process is to then install the new version of the application, and then use twistd to launch the saved .tap file. The old data will be loaded into classes created with the new code, and now you'll have a program running with the new behavior but the old data.
But what about the data structures that have changed? Since these structures are really just pickled class instances, the real question is what about the class definitions that have changed? Changes to class methods are easy: nothing about them is saved in the .tap file. The issue is when the data attributes of a instance are added, removed, or their format is changed.
Twisted provides a mechanism called Versioned
to ease these upgrades.
Each version of the data structure (i.e. each version of the class) gets a
version number. This number must change every time you add or remove a data
attribute to the class. It must also change every time you modify one of
those data attributes: for example, if you use a string in one version and
an integer in another, those versions must have different version numbers.
The version number is defined in a class attribute named
persistenceVersion
. This is an integer which will be stored in
the .tap file along with the rest of the instance state. When the object is
unserialized, the saved persistenceVersion is compared against the current
class's value, and if they differ, special upgrade methods are called. These
methods are named upgradeToVersionNN
, and there must be one for
each intermediate version. These methods are expected to manipulate the
instance's state from the previous version's format into that of the new
version.
To use this, simply have your class inherit from Versioned
. You don't have to do this
from the very beginning of time: all objects have an implicit version number
of 0
when they don't inherit from Versioned. So when you first make
an incompatible data-format change to your class, add Versioned to the
inheritance list, and add an upgradeToVersion1
method.
For example, suppose the first version of our class saves an integer which measures the size of a line. We release this as version 1.0 of our neat application:
class Thing: def __init__(self, length): self.length = length
Then we fix some bugs elsewhere, and release versions 1.1 and 1.2 of the application. Later, we decide that we should add some units to the length, so that people can refer to it in inches or meters. Version 1.3 is shipped with the following code:
class Thing(Versioned): persistenceVersion = 1 def __init__(self, length, units): self.length = "%d %s" % (length, units) def upgradeToVersion1(self): self.length = "%d inches" % self.length
Note that we must make an assumption about what the previous value meant: in this case, we assume the number was in inches.
1.4 and 1.5 are shipped with other changes. Then in version 1.6 we decide that saving the two values as a string was foolish and that it would be better to save the number and the string separately, using a tuple. We ship 1.6 with the following:
class Thing(Versioned): persistenceVersion = 2 def __init__(self, length, units): self.length = (length, units) def upgradeToVersion1(self): self.length = "%d inches" % self.length def upgradeToVersion2(self): (length, units) = self.length.split() self.length = (length, units)
Note that we must provide both upgradeToVersion1
and upgradeToVersion2
. We have to assume that the
saved .tap files which will be provided to this class come from a random
assortment of old versions: we must be prepared to accept anything ever
saved by a released version of our application.
Finally, version 2.0 adds multiple dimensions. Instead of merely
recording the length of a line, it records the size of an N-dimensional
rectangular solid. For backwards compatiblity, all 1.X version of the
program are assumed to be dealing with a 1-dimensional line. We change the
name of the attribute from .length
to .size
to
reflect the new meaning.
class Thing(Versioned): persistenceVersion = 3 def __init__(self, dimensions): # dimensions is a list of tuples, each is (length, units) self.size = dimensions self.name = ["line", "square", "cube", "hypercube"][len(dimensions)] def upgradeToVersion1(self): self.length = "%d inches" % self.length def upgradeToVersion2(self): (length, units) = self.length.split() self.length = (length, units) def upgradeToVersion3(self): self.size = [self.length] del self.length self.name = "line"
If a .tap file from the earliest version of our program were to be loaded by the latest code, the following sequence would occur for each Thing instance contained inside:
.size
, which was an integer, like
5
.self.upgradeToVersion1()
would be called,
changing self.size
into a string, like
"5 inches"
.self.upgradeToVersion2()
would be called,
changing self.size
into a tuple, like (5, "inches")
.self.upgradeToVersion3()
would be
called, creating self.size
as a list holding a single
dimension, like [(5, "inches")]
. The old .length
attribute is deleted, and a new .name
is created with the
type of shape this instance represents (line).
Some hints for the upgradeVersion
methods:
__init__
method would have
done, as well as any methods that might have been called during the
lifetime of the object.__init__
, then the saved object may
have a haphazard subset of those attributes, depending upon which methods
were called. The upgradeVersion methods must be prepared to deal with
this. hasattr
and .get
may be useful.upgradeVersion
method, you should never change that method.
(assuming you care about infinite backwards compatibility).upgradeVersion
method (and bump the
persistenceVersion value) for each and every release that has a different
set of data attributes than the previous release.Versioned
works by providing __setstate__
and __getstate__
methods. You probably don't want to override
these methods without being very careful to call the Versioned versions at
exactly the right time. It also requires a doUpgrade
function
to be called after all the objects are loaded. This is done automatically
by Application.run
.Versioned
objects
can probably be sent across a network connection, and the upgrade process
can be made to occur upon receipt. (You'll want to look at the requireUpgrade
function). This might be useful in providing compability with an older
peer. Note, however, that Versioned
does not let you go
backwards in time; there is no downgradeVersionNN
method.
This means it is probably only useful for compatibility in one direction:
the newer-to-older direction must still be explicitly handled by the
application.For more information, look at the doc strings for styles.Versioned
, as well as the service.Application
class and the Application HOWTO.
Versioned
is good for handling changes between
released versions of your program, where the application state is saved on
disk during the upgrade. But while you are developing that code, you often
want to change the behavior of the running program, without the
slowdown of saving everything out to disk, shutting down, and restarting.
Sometimes it will be difficult or time-consuming to get back to the previous
state: the running program could include ephemeral objects (like open
sockets) which cannot be persisted.
twisted.python.rebuild
provides a function
called rebuild
which helps smooth this cycle. It allows objects
in a running program to be upgraded to a new version of the code without
shutting down.
To use it, simply call rebuild
on the module
that holds the classes you want to be upgraded. Through deep gc
magic, all instances of classes in that module will
be located and upgraded.
Typically, this is done in response to a privileged command sent over a
network connection. The usual development cycle is to start the server, get
it into an interesting state, see a problem, edit the class definition, then
push the rebuild yourself
button. That button
could be a magic
web page which, when requested, runs rebuild(mymodule)
, or a special IRC command, or
perhaps just a socket that listens for connections and accepts a password to
trigger the rebuild. (You want this to be a privileged operation to prevent
someone from making your server do a rebuild while you're in the middle of
editing the code).
A few useful notes about the rebuild process:
ALLOW_TWISTED_REBUILD
, this attribute must evaluate to True.
Should it be false, the rebuild attempt will raise an exception.twisted.python.components
) use
top-level registration function calls. These are handled correctly during
rebuilds, and the usual duplicate registration errors are not raised.Finally, note that rebuild
cannot currently be
mixed with Versioned
. rebuild
does
not run any of the classes' methods, whereas Versioned
works by
running __setstate__
during the load process and doUpgrade
afterwards. This means rebuild
can only
be used to process upgrades that do not change the data attributes of any of
the involved classes. Any time attributes are added or removed, the program
must be shut down, persisted, and restarted, with upgradeToVersionNN
methods
used to handle the attributes. (this may change in the future, but for now
the implementation is easier and more reliable with this restriction).


Declaring a variable only to immediately return it is a bad practice.
Some developers argue that the practice improves code readability, because it enables them to explicitly name what is being returned. However, this variable is an internal implementation detail that is not exposed to the callers of the method. The method name should be sufficient for callers to know exactly what will be returned.
CREATE FUNCTION computeDurationInMilliseconds() RETURNS INTEGER { DECLARE duration INTEGER (((hours * 60) + minutes) * 60 + seconds ) * 1000 ; RETURN duration; }
CREATE FUNCTION computeDurationInMilliseconds() RETURNS INTEGER { RETURN (((hours * 60) + minutes) * 60 + seconds ) * 1000 ; }