THE PUPPET MASTERS A film review by Paul Robinson Copyright 1994 Paul Robinson
As a faithful translation of Heinlein's book, the movie is well nigh perfect in terms of translation to film, and I suspect Heinlein himself would appreciate how close to his original story the movie stays. The few times it does deviate is to make the film closer to reality here and now, e.g., as if the events shown in the movie really could happen today. The original book had human beings already possessing space flight to other places as well as a few other things which would not work today. Also, a couple of incidents in the book were eliminated to streamline the plot of the movie and make it more consistent with reality. A few items were left out which probably should have been covered, and might be (or were but were edited out) if the movie goes to video or gets a sequel.
As a translation of a book into a movie, it rates perhaps B+ or an A-. The translation is very good and the original story is very well carried across.
As a science fiction movie in and of itself, it unfortunately rates only a C. Possibly it needed some narration or some additional material to explain the opening; I felt that the way the opening of the film, including introducing the three main characters in the film, was a bit strained. If I hadn't already read the book more than once over the last ten years or so, I might have been a little bit lost.
I felt the treatment of the material was excellent, and unlike too many films involving extraterrestrial invaders, the "gore level" was toned down from what could be expected / has commonly been used for such films, only showing oozing material, blood or other gory items when it was necessary for plot development and story, unlike too many films that use gore to nauseate the audience and to substitute for a real story and a plot, this story realizes that the audience has an imagination and letting them realize what is happening (rather than showing them directly) is often more effective in a story than saturating the audience with goo.
I mentioned that I felt something was missing in the scenes involving the three main characters (Andrew, the head of the agency, played by Donald Sutherland; Mary the scientist; and Sam, Andrew's son). What I felt was also missing was the connection between Sam becoming contaminated by the invaders and his escaping the agency, which the connection wasn't made clearly. (A similar thing occurred in ALIENS where we are suddenly cut to the aftermath of an explosion but the cause of the explosion itself nor the reasoning behind it weren't explained.)
A couple more minutes of material in a couple of places could have made what was a fairly good film even better. Where the invaders came from, and whether there are more left, are not covered, as well as the final disposition of the original group in outer space.
In and of itself I can recommend the film. I suspect that with some minor and unimportant changes (dropping a couple of swear words) the film might have been able to get a PG-13 rating. (On the other hand, the producers may have felt this film should not be seen by unattended kids; however this film was much less gory and violent than the last year of the "War of the Worlds" TV show which started to "gore up" the show in a futile attempt to increase its ratings. There is some killing and torture in this film, but it is much less "gratuitous" as other films and most of which is well done in the context in which it occurs.)
I think that it's suitable for teenagers or anyone who saw JURASSIC PARK and didn't have nightmares. Take any of the Untouchables episodes and any of the later WAR OF THE WORLDS episodes and you have more gore and violence than appears in this movie.
The actors do an excellent job in this movie, and Donald Sutherland's portrayal of the essentially ruthless head of a government agency is very well done. It's "ruthless" in the sense that he will stop at nothing to get rid of the invaders; and it turns out that in the long run, they are fighting a war and his opinion was the correct one after all.
-- Paul Robinson -<EMAIL_ADDRESS>/<EMAIL_ADDRESS>/<EMAIL_ADDRESS>.
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


{% extends "base.html" %} {% load crispy_forms_tags %} {% block title %}Password change{% endblock %} {% block page-header %}Password change{% endblock %} {% block content %}
Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly.


Thank you for attending our wedding! You can find photographs from the ceremony at the websites below.
All family portraits, getting ready shots, rehearsal dinner and first look shots are here! There are also amazing pictures from the ceremony and reception.
You can order download or order prints directly from the website. Please credit our wonderful photographers, Randy + Ashley, when using these on Facebook or social media.
Download and Purchase on PixiesetHere's most of the pictures and some of the short videos that our guests sent us for our wedding video.
If you have more video to share or want a copy of the wedding video, email us at<EMAIL_ADDRESS>Download Guest Photos on FlickrAll the photobooth pictures.
Download Photobooth Pictures on Flickr


INSPIRATIONAL PROFILES
We have collected profiles from amazing post-secondary students and graduates with disabilities who have kindly shared their experiences, insights, and tips for success.
We have collected profiles from amazing post-secondary students and graduates with disabilities who have kindly shared their experiences, insights, and tips for success.
Personal Support Worker
Click Here for MoreResearch Consultant, Author and Tutor
Click Here for MorePost-Secondary Education Instructor, Researcher and Author
Click Here for MoreGraduate Student, Creative Consultant and Community Health Researcher
Click Here for MoreProject Coordinator, Pieces to Pathways
Click Here for MoreSocial Support Worker and Graduate student
Click Here for More


---
title: SGX Identity
overview: Protobuf definition for SgxIdentity and related submessages.
location: https://asylo.dev/docs/reference/proto/identity/asylo.sgx_identity.v1.html
layout: protoc-gen-docs
generator: protoc-gen-docs
redirect_from: /docs/reference/proto/identity/sgx_identity.html
number_of_entries: 7
---
This package defines messages for SGX identity and identity expectations.
SgxIdentity
A high-level representation of the identity of an SGX enclave, which includes
the properties of its code identity (sgx.CodeIdentity
) and the
security-relevant properties of its execution environment
(sgx.MachineConfiguration
).
| Field |
Type |
Description |
Required |
code_identity |
CodeIdentity |
The enclave’s code identity properties. Required.
|
No
|
machine_configuration |
MachineConfiguration |
Describes the security-relevant configuration of the machine on which the
enclave is running. Required.
|
No
|
SgxIdentityMatchSpec
Specification of which fields from SgxIdentity
to match.
| Field |
Type |
Description |
Required |
code_identity_match_spec |
CodeIdentityMatchSpec |
A specification of which fields from CodeIdentity to match. Required.
|
No
|
machine_configuration_match_spec |
MachineConfigurationMatchSpec |
A specification of which fields from MachineConfiguration to match.
Required.
|
No
|
SgxIdentityExpectation
A verifier’s expectation on an SgxIdentity
.
| Field |
Type |
Description |
Required |
reference_identity |
SgxIdentity |
Reference identity matched against the target identity per match_spec .
Required.
|
No
|
match_spec |
SgxIdentityMatchSpec |
Specification of which fields from the target enclave identity to match.
Required.
|
No
|
asylo.sgx.CodeIdentity
An enclave’s code identity as specified by the SGX architecture. Some of the
fields in this proto are required fields, while others are optional fields
(this is indicated in the comments for individual fields). If a required
field is missing, then the entire proto is considered invalid. On the other
hand, it is OK for an optional field to be missing, if the enclave identity
verifier does not care about matching that particular field (as specified
by the CodeIdentityMatchSpec
proto).
| Field |
Type |
Description |
Required |
mrenclave |
Sha256HashProto |
SHA256 hash of a string representing the enclave build process (see Intel
Software Developer’s Manual for futher explanation). Optional.
|
No
|
signer_assigned_identity |
SignerAssignedIdentity |
Identity assigned by the signer of the enclave to this enclave. Required.
|
No
|
miscselect |
uint32 |
Extended information about the enclave (see Intel Software Developer’s
Manual for details). Required.
|
No
|
attributes |
Attributes |
ATTRIBUTES bit vector defined by SGX architecture. It holds various
potentially security-sensitive attributes of the enclave. Required.
|
No
|
asylo.sgx.MachineConfiguration
Security-relevant machine configuration properties.
| Field |
Type |
Description |
Required |
cpu_svn |
CpuSvn |
Optional.
|
No
|
sgx_type |
SgxType |
Optional.
|
No
|
asylo.sgx.CodeIdentityMatchSpec
Specification of which fields from CodeIdentity
to match.
| Field |
Type |
Description |
Required |
is_mrenclave_match_required |
bool |
Flag indicating whether to perform a match on MRENCLAVE. Required.
|
No
|
is_mrsigner_match_required |
bool |
Flag indicating whether to perform a match on MRSIGNER. Required.
|
No
|
miscselect_match_mask |
uint32 |
Mask indicating which bits from MISCSELECT must be matched. A value of
one in a bit position implies the corresponding bit in MISCSELECT must be
matched. Value of zero implies the corresponding bit must be ignored.
Note that this is a required field. If this field is skipped, no
CodeIdentity will match this identity expectation. Required.
|
No
|
attributes_match_mask |
Attributes |
Mask indicating which bits from ATTRIBUTES should be matched. Semantics
similar to the miscselect mask. Note that this is a required field. If
this field is skipped, no CodeIdentity will match this identity
expectation. Required.
|
No
|
asylo.sgx.MachineConfigurationMatchSpec
Specification of which fields from MachineConfiguration
to match.
| Field |
Type |
Description |
Required |
is_cpu_svn_match_required |
bool |
Required.
|
No
|
is_sgx_type_match_required |
bool |
Required.
|
No
|


CSS Color Displayer
Select a number from 0-255 for each color value:
Red:
Green:
Blue:
Show me the color!
Clear all


Document CMS
> Access Recorder
Manage Archived Webpage
Total Records:
{$totalRecords}
Previous
Next
Select Page
{$p.disp}
{$p.disp}
Archived URL
Archived Time
Preview
Delete
{$oneRecord.page_url}
{$oneRecord.archived_time}
Preview
Delete
N/A
Total Records:
{$totalRecords}
Previous
Next
Select Page
{$p.disp}
{$p.disp}


6px
open linkThe Case Against Logic-less Templates — eBay Tech Blog
At a conference I recently attended, two separate topics related to templates sparked a debate off-stage about Logic vs No-logic View Templates. Folks were very passionate about the side they represented. Those discussions were the high point of the conference, […]
open linkGitHub Pages now runs Jekyll 2.2.0
open linkGitHub - visionmedia/jade - jade - Jade - robust, elegant, feature rich template engine for nodejs
open linkCult of Logic-Less Templates - Alexei Boronine
open linkPOSSE - IndieWebCamp
open linkGoogleChrome/chrome-app-samples
open link open linkLRB · Jenny Diski · Post-its, push pins, pencils: In the Stationery Cupboard
The subtitle of Nikil Saval’s book is curiously inapt. Cubed is not a ‘secret history of the workplace’, but the not (entirely) secret history of a very particular kind of workplace. The main title is intended to pull that particular workplace into focus, I suppose, to narrow the …
open linkWorlds hardest captcha
open linkRadical Geometry | Exhibition | Royal Academy of Arts
This site is rather beautiful
open link open link


We are a start-up property realisation company focused on making it safer and easier for Somalilanders worldwide to buy off-plan property from local developers.
Diaspora Property Developers was born in Cardiff, UK as an Africa-focused diaspora initiative and we have chosen out motherland as our first real estate market on the continent. We plan to expand our activities to other key African real estate markets over the next few years.
We love people, innovation, quality, excellent customer service and problem solving. We also love making a difference and our aim is to disrupt the off-plan property market in by driving up standards of customer service and satisfaction.
We aim to introduce an innovative and more transparent process designed to help mitigate the risks as well eliminate the stress that buyers currently face when acquiring off plan property in Somaliland.
Mukhtar is a talented and industrious home-grown businessman. He has over 20 years’ experience of doing business in Europe, Saudi Arabia, the Gulf states and Somaliland.
We are aware that every client’s requirements are unique. In order to have a better understanding of exactly what you are seeking, please click on the link and complete the contact form.We will then contact you at a time convenient to you for an initial, without obligation, discussion.


Classicademy offers piano class for kids and adults. We offer various piano lessons such as classical, jazz, pop, modern, church songs, and from basic to advanced lessons available for you.
Starting career in music? Let's enrol in music solfegio course. In this course you will be learning the fundamentals of music solfeggio. This course is suitable for music beginners and for those who are looking forward to have additional knowledge in music for professional advancedment.
Gearing up with learning is exciting learning music theory fundamentals. Enrol now! for those who are looking for beginning and additional professional development in music this is the best course for you.
Want to start recording or music production career in music. This is the best course for you to pursue not only for additional skills and professional skill enhancement for you.
Send us your inquiry and get started.


Why we love sports ???
We turn novices into champions here at IIT Delhi grounds. The best facilities provided by us have lead to great results and our presence is now being felt in the Delhi circles as well as in the inter college meets outside. As an organisation we are a group of around 300 people including players, coaches, trainers and administrative staff who are working to take our sporting standards at par with the best in the business. Apart from being the apex body for sports in IITD, we are involved in a number of social events, informal events, hosting of sports tournaments and other collaborations and therefore the number of people involved with BSA is huge.
From an Institution known worldwide for its academic prowess, we have produced national level players by our excellent facilities and great sporting culture and have emerged as a sporting powerhouse. More importantly, BSA promotes sports amongst the people not interested(Students, Professors and the residents of the campus) in playing sports competitively to cater to their fitness needs in the campus too as we believe that a healthy mind resides in a healthy mind.
Fan? Drop a note!


Best Picture Nominees & Winners by Genre From 1927/8 to 2001
An example goes here.
This pi chart demonstrates Academy Awards Best Picture nominees and winners by genre from 1927/8 to 2001. 47% of winners and nominees fell under the "drama" genre while the Western films genre had the lowest percentage of with only 2.1%.
Data Source
Javascript library used to build this chart: flotr2


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.axis.Part | +--org.apache.axis.SOAPPart
The SOAPPart provides access to the root part of the Message which contains the envelope.
SOAPPart implements Part, providing common MIME operations.
SOAPPart also allows access to its envelope, as a string, byte[], InputStream, or SOAPEnvelope. (This functionality used to be in Message, and has been moved here more or less verbatim pending further cleanup.)
| Field Summary | |
protected static org.apache.commons.logging.Log |
log
|
| Constructor Summary | |
SOAPPart(Message parent,
java.lang.Object initialContents,
boolean isBodyStream)
Do not call this directly! Should only be called by Message. |
| Method Summary | |
byte[] |
getAsBytes()
Get the contents of this Part (not the headers!), as a byte array. |
SOAPEnvelope |
getAsSOAPEnvelope()
Get the contents of this Part (not the MIME headers!), as a SOAPEnvelope. |
java.lang.String |
getAsString()
Get the contents of this Part (not the headers!), as a String. |
int |
getContentLength()
Get the content length for this SOAPPart. |
java.lang.String |
getContentType()
Content type is always "text/xml" for SOAPParts. |
java.lang.Object |
getCurrentMessage()
Get the current message, in whatever form it happens to be right now. |
Message |
getMessage()
Get the Message for this Part. |
int |
getSize()
Get the total size in bytes, including headers, of this Part. |
void |
setMessage(Message msg)
Set the Message for this Part. |
void |
setSOAPEnvelope(SOAPEnvelope env)
This set the SOAP Envelope for this part. |
void |
writeTo(java.io.OutputStream out)
Write out the contents & headers to out. |
| Methods inherited from class org.apache.axis.Part |
addMimeHeader, getContentId, getContentLocation, getMatchingMimeHeaders, getMimeHeader, getNewContentIdValue, getNonMatchingMimeHeaders, setContentId, setContentLocation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static org.apache.commons.logging.Log log
| Constructor Detail |
public SOAPPart(Message parent, java.lang.Object initialContents, boolean isBodyStream)
| Method Detail |
public Message getMessage()
public void setMessage(Message msg)
public java.lang.String getContentType()
getContentType
in class Part
public int getContentLength()
public void setSOAPEnvelope(SOAPEnvelope env)
public int getSize()
public void writeTo(java.io.OutputStream out) throws java.io.IOException
public java.lang.Object getCurrentMessage()
The method name is historical. TODO: rename this for clarity; should be more like getContents.
public byte[] getAsBytes() throws AxisFault
public java.lang.String getAsString() throws AxisFault
public SOAPEnvelope getAsSOAPEnvelope() throws AxisFault
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


- Timestamp:
- 01/17/13 17:08:05 (3 years ago)
- Location:
- branches/decorate
- Files:
-
- 1 added
- 6 edited
- 1 copied
- 1 moved
-
_symbolic.py (modified) (2 diffs)
-
constraints.py (modified) (7 diffs)
-
coupler.py (added)
-
penalty.py (modified) (3 diffs)
-
symbolic.py (modified) (2 diffs)
-
test_constraints.py (moved) (moved from branches/decorate/test_penalty.py) (5 diffs)
-
test_coupler.py (copied) (copied from branches/decorate/test_constraints.py) (4 diffs)
-
test_restarts.py (modified) (1 diff)
-
test_symbolic.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/decorate/_symbolic.py
r623 r644 11 11 from mystic.tools import permutations 12 12 from mystic.tools import list_or_tuple_or_ndarray 13 #from wrapper import isbounded14 #from penalty import issolution15 13 16 14 def _classify_variables(constraints, variables='x', nvars=None): … … 615 613 ... x1 - x3 = 2. 616 614 ... x3 = x4*2.''' 617 >>> print _solve_linear(constraints, target=['x4','x3'])615 >>> print solve(constraints, target=['x4','x3']) 618 616 x4 = -1.0 + 0.5*x1 619 617 x3 = -2.0 + x1 -
branches/decorate/constraints.py
r631 r644 1 1 #!/usr/bin/env python 2 2 3 """Tools for building and applying constraints and penalties. 4 """ 5 6 __all__ = ['with_penalty','with_constraint','as_penalty','as_constraint', 7 'with_mean','with_variance','with_spread','normalized', 8 'issolution','solve'] 9 3 10 from mystic.math.measures import * 4 from wrapper import *5 11 from mystic.math import almostEqual 6 12 7 def with_constraint(ctype, *args, **kwds): 13 def with_penalty(ptype, *args, **kwds): 14 """convert a condition to a penalty function of the chosen type 15 16 condition f(x) is satisfied when f(x) == 0.0 for equality constraints 17 and f(x) <= 0.0 for inequality constraints. ptype is a mystic.penalty type. 18 19 For example: 20 >>> @with_penalty(quadratic_equality, kwds={'target':5.0}) 21 ... def penalty(x, target): 22 ... return mean(x) - target 23 >>> 24 >>> penalty([1,2,3,4,5]) 25 400.0 26 >>> penalty([3,4,5,6,7]) 27 7.8886090522101181e-29 28 """ 29 def dec(condition): 30 @ptype(condition, *args, **kwds) 31 def penalty(x): 32 return 0.0 33 return penalty 34 return dec 35 36 37 def with_constraint(ctype, *args, **kwds): #XXX: is this *at all* useful? 8 38 """convert a set transformation to a constraints solver of the chosen type 9 39 10 40 transformation f(x) is a mapping between x and x', where x' = f(x). 11 ctype is a mystic.constraints type [inner, outer, inner_proxy, outer_proxy]. 41 ctype is a mystic.coupler type [inner, outer, inner_proxy, outer_proxy]. 42 43 For example: 44 >>> @with_constraint(inner, kwds={'target':5.0}) 45 ... def constraint(x, target): 46 ... return impose_mean(target, x) 47 ... 48 >>> x = constraint([1,2,3,4,5]) 49 >>> print x 50 [3.0, 4.0, 5.0, 6.0, 7.0] 51 >>> mean(x) 52 5.0 12 53 """ 13 54 def dec(condition): … … 16 57 return x 17 58 return constraint 18 return dec19 20 21 def outer(outer=lambda x:x, args=None, kwds=None):22 """wrap a function around another function: convert y = f(x) to y' = c(f(x))23 24 This is useful, for example, in nesting one constraint in another constraint.25 """26 if args is None: args=()27 if kwds is None: kwds={}28 def dec(f):29 def func(x, *argz, **kwdz):30 return outer(f(x, *argz, **kwdz), *args, **kwds)31 return func32 return dec33 34 35 def inner(inner=lambda x:x, args=None, kwds=None):36 """nest a function within another function: convert y = f(x) to y' = f(c(x))37 38 This is useful, for example, in nesting constraints in a cost function;39 thus, the constraints will be enforced at every cost function evaluation.40 """41 if args is None: args=()42 if kwds is None: kwds={}43 def dec(f):44 def func(x, *argz, **kwdz):45 return f(inner(x, *args, **kwds), *argz, **kwdz)46 return func47 return dec48 49 50 def inner_proxy(inner=lambda x:x, args=None, kwds=None):51 """nest a function within another function: convert y = f(x) to y' = f(c(x))52 53 This is useful, for example, in nesting constraints in a cost function;54 thus, the constraints will be enforced at every cost function evaluation.55 56 This function does not preserve decorated function signature, but passes args57 and kwds to the inner function.58 """59 if args is None: args=()60 if kwds is None: kwds={}61 def dec(f):62 def func(*argz, **kwdz):63 return f(inner(*argz, **kwdz), *args, **kwds)64 return func65 return dec66 67 68 def outer_proxy(outer=lambda x:x, args=None, kwds=None):69 """wrap a function around another function: convert y = f(x) to y' = c(f(x))70 71 This is useful, for example, in nesting one constraint in another constraint.72 73 This function does not preserve decorated function signature, but passes args74 and kwds to the outer function.75 """76 if args is None: args=()77 if kwds is None: kwds={}78 def dec(f):79 def func(x, *argz, **kwdz):80 return outer(f(x, *args, **kwds), *argz, **kwdz)81 return func82 59 return dec 83 60 … … 98 75 99 76 def with_mean(target): 100 """ ... """ 77 """bind a mean constraint to a given constraints function. 78 79 Inputs: 80 target -- the target mean 81 82 A constraints function takes an iterable x as input, returning a modified x. 83 This function is an "outer" coupling of "impose_mean" onto another constraints 84 function c(x), such that: x' = impose_mean(target, c(x)). 85 86 For example: 87 >>> @with_mean(5.0) 88 ... def constraint(x): 89 ... x[-1] = x[0] 90 ... return x 91 ... 92 >>> x = constraint([1,2,3,4]) 93 >>> print x 94 [4.25, 5.25, 6.25, 4.25] 95 >>> mean(x) 96 5.0 97 """ 101 98 def decorate(constraints): 102 99 def factory(x, *args, **kwds): … … 112 109 113 110 def with_variance(target): 114 """ ... """ 111 """bind a variance constraint to a given constraints function. 112 113 Inputs: 114 target -- the target variance 115 116 A constraints function takes an iterable x as input, returning a modified x. 117 This function is an "outer" coupling of "impose_variance" onto another 118 constraints function c(x), such that: x' = impose_variance(target, c(x)). 119 120 For example: 121 >>> @with_variance(1.0) 122 ... def constraint(x): 123 ... x[-1] = x[0] 124 ... return x 125 ... 126 >>> x = constraint([1,2,3]) 127 >>> print x 128 [0.6262265521467858, 2.747546895706428, 0.6262265521467858] 129 >>> variance(x) 130 0.99999999999999956 131 """ 115 132 def decorate(constraints): 116 133 def factory(x, *args, **kwds): … … 126 143 127 144 def with_spread(target): 128 """ ... """ 145 """bind a range constraint to a given constraints function. 146 147 Inputs: 148 target -- the target range 149 150 A constraints function takes an iterable x as input, returning a modified x. 151 This function is an "outer" coupling of "impose_spread" onto another constraints 152 function c(x), such that: x' = impose_spread(target, c(x)). 153 154 For example: 155 >>> @with_spread(10.0) 156 ... def constraint(x): 157 ... return [i**2 for i in x] 158 ... 159 >>> x = constraint([1,2,3,4]) 160 >>> print x 161 [3.1666666666666665, 5.1666666666666661, 8.5, 13.166666666666666] 162 >>> spread(x) 163 10.0 164 """ 129 165 def decorate(constraints): 130 166 def factory(x, *args, **kwds): … … 141 177 from numpy import sum 142 178 def normalized(mass=1.0): #XXX: order matters when multiple decorators 143 """ ... """ 179 """bind a normalization constraint to a given constraints function. 180 181 Inputs: 182 mass -- the target sum of normalized weights 183 184 A constraints function takes an iterable x as input, returning a modified x. 185 This function is an "outer" coupling of "normalize" onto another constraints 186 function c(x), such that: x' = normalize(c(x), mass). 187 188 For example: 189 >>> @normalized() 190 ... def constraint(x): 191 ... return x 192 ... 193 >>> constraint([1,2,3]) 194 [0.16666666666666666, 0.33333333333333331, 0.5] 195 """ 144 196 def decorate(constraints): 145 197 def factory(x, *args, **kwds): … … 154 206 155 207 208 def issolution(constraints, guess, tol=1e-3): 209 """Returns whether the guess is a solution to the constraints 210 211 Input: 212 constraints -- a constraints solver function or a penalty function 213 guess -- list of parameter values prposed to solve the constraints 214 tol -- residual error magnitude for which constraints are considered solved 215 """ 216 if hasattr(constraints, 'error'): 217 error = constraints.error(guess) 218 else: # is a constraints solver 219 error = 0.0 220 constrained = constraints(guess) 221 for i in range(len(guess)): 222 error += (constrained[i] - guess[i])**2 #XXX: better rnorm ? 223 error = error**0.5 224 225 if error <= tol: return True 226 return False 227 228 229 #XXX: nice if penalty.error could give error for each condition... or total 230 231 232 def solve(constraints, guess=None, nvars=None, solver=None, \ 233 lower_bounds=None, upper_bounds=None, termination=None): 234 """Use optimization to find a solution to a set of constraints. 235 236 Inputs: 237 constraints -- a constraints solver function or a penalty function 238 239 Additional Inputs: 240 guess -- list of parameter values proposed to solve the constraints. 241 lower_bounds -- list of lower bounds on solution values. 242 upper_bounds -- list of upper bounds on solution values. 243 nvars -- number of parameter values. 244 solver -- the mystic solver to use in the optimization 245 termination -- the mystic termination to use in the optimization 246 247 NOTE: The resulting constraints will likely be more expensive to evaluate 248 and less accurate than writing the constraints solver from scratch. 249 """ 250 ndim = 1 #XXX: better, increase in while loop catching IndexError ? 251 if nvars is not None: ndim = nvars 252 elif guess is not None: ndim = len(guess) 253 elif lower_bounds is not None: ndim = len(lower_bounds) 254 elif upper_bounds is not None: ndim = len(upper_bounds) 255 256 def cost(x): return 1. 257 258 #XXX: don't allow solver string as a short-cut? 259 if solver is None or solver == 'diffev': 260 from mystic.solvers import DifferentialEvolutionSolver as TheSolver 261 solver = TheSolver(ndim, min(40, ndim*5)) 262 elif solver == 'diffev2': 263 from mystic.solvers import DifferentialEvolutionSolver2 as TheSolver 264 solver = TheSolver(ndim, min(40, ndim*5)) 265 elif solver == 'fmin_powell': #XXX: better as the default? (it's not random) 266 from mystic.solvers import PowellDirectionalSolver as TheSolver 267 solver = TheSolver(ndim) 268 elif solver == 'fmin': 269 from mystic.solvers import NelderMeadSimplexSolver as TheSolver 270 solver = TheSolver(ndim) 271 272 if termination is None: 273 from mystic.termination import ChangeOverGeneration as COG 274 termination = COG() 275 if guess != None: 276 solver.SetInitialPoints(guess) #XXX: nice if 'diffev' also had methods 277 else: 278 solver.SetRandomInitialPoints(lower_bounds, upper_bounds) 279 if lower_bounds or upper_bounds: 280 solver.SetStrictRanges(lower_bounds, upper_bounds) 281 if hasattr(constraints, 'iter') and hasattr(constraints, 'error'): 282 solver.SetPenalty(constraints) #i.e. is a penalty function 283 else: # is a constraints solver 284 solver.SetConstraints(constraints) 285 solver.Solve(cost, termination) 286 soln = solver.bestSolution 287 288 from numpy import ndarray, array 289 if isinstance(soln, ndarray) and not isinstance(guess, ndarray): 290 soln = soln.tolist() 291 elif isinstance(guess, ndarray) and not isinstance(soln, ndarray): 292 soln = array(soln) #XXX: or always return a list ? 293 294 return soln #XXX: check with 'issolution' ? 295 296 297 def as_constraint(penalty, *args, **kwds): 298 """Convert a penalty function to a constraints solver. 299 300 Inputs: 301 penalty -- a penalty function 302 303 Additional Inputs: 304 lower_bounds -- list of lower bounds on solution values. 305 upper_bounds -- list of upper bounds on solution values. 306 nvars -- number of parameter values. 307 solver -- the mystic solver to use in the optimization 308 termination -- the mystic termination to use in the optimization 309 """ 310 def constraint(x): #XXX: better to enable args kwds for penalty ? 311 return solve(penalty, x, *args, **kwds) 312 return constraint 313 314 315 def as_penalty(constraint, ptype=None, *args, **kwds): 316 """Convert a constraints solver to a penalty function. 317 318 Inputs: 319 constraint -- a constraints solver 320 ptype -- penalty function type [default: quadratic_equality] 321 322 Additional Inputs: 323 args -- arguments for the constraints solver [default: ()] 324 kwds -- keyword arguments for the constraints solver [default: {}] 325 k -- penalty multiplier 326 h -- iterative multiplier 327 """ 328 def rnorm(x, *argz, **kwdz): 329 error = 0.0 330 constrained = constraint(x, *argz, **kwdz) 331 for i in range(len(x)): 332 error += (constrained[i] - x[i])**2 #XXX: better rnorm ? 333 error = error**0.5 334 return error 335 336 if ptype is None: 337 from penalty import quadratic_equality 338 ptype = quadratic_equality 339 340 @ptype(rnorm, *args, **kwds) #XXX: yes to k,h... but otherwise? 341 def penalty(x): 342 return 0.0 343 344 return penalty 345 346 156 347 # EOF -
branches/decorate/penalty.py
r610 r644 2 2 3 3 """ 4 Penalty Methods 5 6 These methods can be used to convert a function into a penalty function. 7 8 Suppose a given condition f(x) is satisfied when f(x) == 0.0 9 for equality constraints, and f(x) <= 0.0 for inequality constraints. 10 This condition f(x) can be used as the basis for a mystic.penalty 11 function. 12 13 For example: 14 >>> def penalty_mean(x, target): 15 ... return mean(x) - target 16 ... 17 >>> @quadratic_equality(condition=penalty_mean, kwds={'target':5.0}) 18 ... def penalty(x): 19 ... return 0.0 20 ... 21 >>> penalty([1,2,3,4,5]) 22 400.0 23 >>> penalty([3,4,5,6,7]) 24 7.8886090522101181e-29 25 26 4 27 References: 5 28 [1] http://en.wikipedia.org/wiki/Penalty_method … … 12 35 """ 13 36 14 def with_penalty(ptype, *args, **kwds):15 """convert a condition to a penalty function of the chosen type16 17 condition f(x) is satisfied when f(x) == 0.0 for equality constraints18 and f(x) <= 0.0 for inequality constraints. ptype is a mystic.penalty type.19 """20 def dec(condition):21 @ptype(condition, *args, **kwds)22 def penalty(x):23 return 0.024 return penalty25 return dec26 27 28 37 from numpy import inf, log 29 38 def quadratic_equality(condition=lambda x:0., args=None, kwds=None, k=100, h=5): … … 409 418 410 419 411 ####################################################412 def proxify(penalty=lambda x:0.0, args=None, kwds=None):413 """penalize a function with another function: y = f(x) to y' = f(x) + p(x)414 415 This is useful, for example, in penalizing a cost function where the constraints416 are violated; thus, the satisfying the constraints will be preferred at every417 cost function evaluation.418 419 This function does not preserve decorated function signature, but passes args420 and kwds to the penalty function.421 """422 if args is None: args=()423 if kwds is None: kwds={}424 def dec(f):425 def func(x, *argz, **kwdz):426 return f(x, *args, **kwds) + penalty(x, *argz, **kwdz)427 return func428 return dec429 430 def penalize(penalty=lambda x:0.0, args=None, kwds=None):431 """penalize a function with another function: y = f(x) to y' = f(x) + p(x)432 433 This is useful, for example, in penalizing a cost function where the constraints434 are violated; thus, the satisfying the constraints will be preferred at every435 cost function evaluation.436 """437 if args is None: args=()438 if kwds is None: kwds={}439 def dec(f):440 def func(x, *argz, **kwdz):441 return f(x, *argz, **kwdz) + penalty(x, *args, **kwds)442 return func443 return dec444 445 #XXX: can do multiple @penalize; but better is compound penalty with And,Or,..?446 #XXX: create a counter for n += 1 ?447 448 449 def issolution(constraints, candidate, tol=1e-3):450 """Returns whether the candidate is a solution to the constraints451 452 Input:453 constraints -- a constraints solver function or a penalty function454 candidate -- list of parameter values prposed to solve the constraints455 tol -- residual error magnitude for which constraints are considered solved456 """457 if hasattr(constraints, 'error'):458 error = constraints.error(candidate)459 else: # is a constraints solver460 error = 0.0461 constrained = constraints(candidate)462 for i in range(len(candidate)):463 error += (constrained[i] - candidate[i])**2 #XXX: better rnorm ?464 error = error**0.5465 466 if error <= tol: return True467 return False468 469 470 #XXX: nice if penalty.error could give error for each condition... or total471 472 473 def solve(constraints, guess=None, nvars=None, solver=None, \474 lower_bounds=None, upper_bounds=None, termination=None):475 """Use optimization to find a solution to a set of constraints.476 477 Inputs:478 constraints -- a constraints solver function or a penalty function479 480 Additional Inputs:481 guess -- list of parameter values proposed to solve the constraints.482 lower_bounds -- list of lower bounds on solution values.483 upper_bounds -- list of upper bounds on solution values.484 nvars -- number of parameter values.485 solver -- the mystic solver to use in the optimization486 termination -- the mystic termination to use in the optimization487 488 NOTE: The resulting constraints will likely be more expensive to evaluate489 and less accurate than writing the constraints solver from scratch.490 """491 ndim = 1 #XXX: better, increase in while loop catching IndexError ?492 if nvars is not None: ndim = nvars493 elif guess is not None: ndim = len(guess)494 elif lower_bounds is not None: ndim = len(lower_bounds)495 elif upper_bounds is not None: ndim = len(upper_bounds)496 497 def cost(x): return 1.498 499 #XXX: don't allow solver string as a short-cut?500 if solver is None or solver == 'diffev':501 from mystic.solvers import DifferentialEvolutionSolver as TheSolver502 solver = TheSolver(ndim, min(40, ndim*5))503 elif solver == 'diffev2':504 from mystic.solvers import DifferentialEvolutionSolver2 as TheSolver505 solver = TheSolver(ndim, min(40, ndim*5))506 elif solver == 'fmin_powell': #XXX: better as the default? (it's not random)507 from mystic.solvers import PowellDirectionalSolver as TheSolver508 solver = TheSolver(ndim)509 elif solver == 'fmin':510 from mystic.solvers import NelderMeadSimplexSolver as TheSolver511 solver = TheSolver(ndim)512 513 if termination is None:514 from mystic.termination import ChangeOverGeneration as COG515 termination = COG()516 if guess != None:517 solver.SetInitialPoints(guess) #XXX: nice if 'diffev' also had methods518 else:519 solver.SetRandomInitialPoints(lower_bounds, upper_bounds)520 if lower_bounds or upper_bounds:521 solver.SetStrictRanges(lower_bounds, upper_bounds)522 if hasattr(constraints, 'iter') and hasattr(constraints, 'error'):523 solver.SetPenalty(constraints) #i.e. is a penalty function524 else: # is a constraints solver525 solver.SetConstraints(constraints)526 solver.Solve(cost, termination)527 soln = solver.bestSolution528 529 from numpy import ndarray, array530 if isinstance(soln, ndarray) and not isinstance(guess, ndarray):531 soln = soln.tolist()532 elif isinstance(guess, ndarray) and not isinstance(soln, ndarray):533 soln = array(soln) #XXX: or always return a list ?534 535 return soln #XXX: check with 'issolution' ?536 537 538 def as_constraint(penalty, *args, **kwds):539 """Convert a penalty function to a constraints solver.540 541 Inputs:542 penalty -- a penalty function543 544 Additional Inputs:545 lower_bounds -- list of lower bounds on solution values.546 upper_bounds -- list of upper bounds on solution values.547 nvars -- number of parameter values.548 solver -- the mystic solver to use in the optimization549 termination -- the mystic termination to use in the optimization550 """551 def constraint(x): #XXX: better to enable args kwds for penalty ?552 return solve(penalty, x, *args, **kwds)553 return constraint554 555 556 def as_penalty(constraint, ptype=None, *args, **kwds):557 """Convert a constraints solver to a penalty function.558 559 Inputs:560 constraint -- a constraints solver561 ptype -- penalty function type [default: quadratic_equality]562 563 Additional Inputs:564 args -- arguments for the constraints solver [default: ()]565 kwds -- keyword arguments for the constraints solver [default: {}]566 k -- penalty multiplier567 h -- iterative multiplier568 """569 def rnorm(x, *argz, **kwdz):570 error = 0.0571 constrained = constraint(x, *argz, **kwdz)572 for i in range(len(x)):573 error += (constrained[i] - x[i])**2 #XXX: better rnorm ?574 error = error**0.5575 return error576 577 if ptype is None: ptype = quadratic_equality578 579 @ptype(rnorm, *args, **kwds) #XXX: yes to k,h... but otherwise?580 def penalty(x):581 return 0.0582 583 return penalty584 585 586 420 # EOF -
branches/decorate/symbolic.py
r623 r644 3 3 # originally coded by Alta Fang, 2010 4 4 # refactored by<EMAIL_ADDRESS>2012 5 5 """Tools for working with symbolic constraints. 6 """ 6 7 from __future__ import division 8 9 __all__ = ['linear_symbolic','replace_variables','get_variables','solve', 10 'penalty_parser','constraints_parser','generate_conditions', 11 'generate_solvers','generate_penalty','generate_constraint'] 12 7 13 from numpy import ndarray, asarray 8 14 from _symbolic import solve … … 655 661 # allow for single ctype, list of ctypes, or nested list 656 662 if ctype is None: 657 from co nstraintsimport inner #XXX: outer ?663 from coupler import inner #XXX: outer ? 658 664 ctype = list((inner,))*len(conditions) 659 665 elif not list_or_tuple_or_ndarray(ctype): -
branches/decorate/test_constraints.py
r610 r644 1 from penalty import * 1 from constraints import * 2 from penalty import quadratic_equality 3 from coupler import inner 2 4 from mystic.math import almostEqual 3 5 … … 53 55 54 56 from mystic.math.measures import mean 55 from constraints import with_mean56 57 57 @with_mean(1.0) 58 58 def constraint(x): … … 108 108 109 109 from mystic.math.measures import mean, spread 110 from constraints import with_mean, with_spread111 112 110 @with_spread(5.0) 113 111 @with_mean(5.0) … … 148 146 assert round(mean(y)) == 5.0 149 147 assert round(cost(y)) == 4*(5.0) 148 149 150 def test_with_mean(): 151 152 from mystic.math.measures import mean, impose_mean 153 154 @with_mean(5.0) 155 def mean_of_squared(x): 156 return [i**2 for i in x] 157 158 from numpy import array 159 x = array([1,2,3,4,5]) 160 y = impose_mean(5, [i**2 for i in x]) 161 assert mean(y) == 5.0 162 assert mean_of_squared(x) == y 163 164 165 def test_with_mean_spread(): 166 167 from mystic.math.measures import mean, spread, impose_mean, impose_spread 168 169 @with_spread(50.0) 170 @with_mean(5.0) 171 def constrained_squared(x): 172 return [i**2 for i in x] 173 174 from numpy import array 175 x = array([1,2,3,4,5]) 176 y = impose_spread(50.0, impose_mean(5.0,[i**2 for i in x])) 177 assert almostEqual(mean(y), 5.0, tol=1e-15) 178 assert almostEqual(spread(y), 50.0, tol=1e-15) 179 assert constrained_squared(x) == y 180 181 182 def test_constrained_solve(): 183 184 from mystic.math.measures import mean, spread 185 @with_spread(5.0) 186 @with_mean(5.0) 187 def constraints(x): 188 return x 189 190 def cost(x): 191 return abs(sum(x) - 5.0) 192 193 from mystic.solvers import fmin_powell 194 from numpy import array 195 x = array([1,2,3,4,5]) 196 y = fmin_powell(cost, x, constraints=constraints, disp=False) 197 198 assert almostEqual(mean(y), 5.0, tol=1e-15) 199 assert almostEqual(spread(y), 5.0, tol=1e-15) 200 assert almostEqual(cost(y), 4*(5.0), tol=1e-6) 201 202 203 def test_with_constraint(): 204 205 from mystic.math.measures import mean, impose_mean 206 207 @with_constraint(inner, kwds={'target':5.0}) 208 def mean_of_squared(x, target): 209 return impose_mean(target, [i**2 for i in x]) 210 211 from numpy import array 212 x = array([1,2,3,4,5]) 213 y = impose_mean(5, [i**2 for i in x]) 214 assert mean(y) == 5.0 215 assert mean_of_squared(x) == y 150 216 151 217 … … 157 223 test_as_penalty() 158 224 test_with_penalty() 225 test_with_mean() 226 test_with_mean_spread() 227 test_constrained_solve() 228 test_with_constraint() 159 229 160 230 -
branches/decorate/test_coupler.py
r609 r644 1 from co nstraintsimport *1 from coupler import * 2 2 from mystic.math import almostEqual 3 3 … … 115 115 116 116 117 def test_with_mean():118 119 from mystic.math.measures import impose_mean120 121 @with_mean(5.0)122 def mean_of_squared(x):123 return [i**2 for i in x]124 125 from numpy import array126 x = array([1,2,3,4,5])127 y = impose_mean(5, [i**2 for i in x])128 assert mean(y) == 5.0129 assert mean_of_squared(x) == y130 131 132 def test_with_mean_spread():133 134 from mystic.math.measures import impose_mean, impose_spread135 136 @with_spread(50.0)137 @with_mean(5.0)138 def constrained_squared(x):139 return [i**2 for i in x]140 141 from numpy import array142 x = array([1,2,3,4,5])143 y = impose_spread(50.0, impose_mean(5.0,[i**2 for i in x]))144 assert almostEqual(mean(y), 5.0, tol=1e-15)145 assert almostEqual(spread(y), 50.0, tol=1e-15)146 assert constrained_squared(x) == y147 148 149 def test_constrained_solve():150 151 @with_spread(5.0)152 @with_mean(5.0)153 def constraints(x):154 return x155 156 def cost(x):157 return abs(sum(x) - 5.0)158 159 from mystic.solvers import fmin_powell160 from numpy import array161 x = array([1,2,3,4,5])162 y = fmin_powell(cost, x, constraints=constraints, disp=False)163 164 assert almostEqual(mean(y), 5.0, tol=1e-15)165 assert almostEqual(spread(y), 5.0, tol=1e-15)166 assert almostEqual(cost(y), 4*(5.0), tol=1e-6)167 168 169 117 def test_constrain(): 170 118 … … 195 143 196 144 197 def test_with_constraint():198 199 from mystic.math.measures import impose_mean200 201 @with_constraint(inner, kwds={'target':5.0})202 def mean_of_squared(x, target):203 return impose_mean(target, [i**2 for i in x])204 205 from numpy import array206 x = array([1,2,3,4,5])207 y = impose_mean(5, [i**2 for i in x])208 assert mean(y) == 5.0209 assert mean_of_squared(x) == y210 211 212 145 if __name__ == '__main__': 213 146 test_outer() … … 218 151 test_inner_constraints() 219 152 test_proxified_constraints() 220 test_with_mean()221 test_with_mean_spread()222 test_constrained_solve()223 153 test_constrain() 224 test_with_constraint()225 154 226 155 -
branches/decorate/test_restarts.py
r608 r644 2 2 from restarts import sumt 3 3 from penalty import * 4 from constraints import * 4 5 from mystic.tools import random_seed 5 6 random_seed(123) -
branches/decorate/test_symbolic.py
r623 r644 1 1 from symbolic import * 2 2 from mystic.math import almostEqual 3 from penaltyimport as_constraint3 from constraints import as_constraint 4 4 5 5 def test_generate_penalty():
Note: See TracChangeset
for help on using the changeset viewer.


I am a software engineer interested in distributed systems, with a focus on large-scale data storage and processing systems.
Currently, I work at Meta (formerly Facebook) on an infrastructure team that builds and operates one of Meta's primary blob storage systems. Before Meta, I worked as a Software Engineer at WSO2 on their Identity Server product.
I completed my Ph.D. in computer science from Colorado State University in 2020 under the supervision of Prof. Shrideep Pallickara. My research focused on leveraging distributed stream processing systems for off-premise data streams such as in IoT.
I am an open-source software enthusiast. I am a committer for the Apache Axis2 project and a two-time participant in Google Summer of Code with Apache Software Foundation.


Some useful examples to get you started!
Find all information related to gene ncibigene:1017
Find all information related to chemical CHEMBL.COMPOUND:CHEMBL744
Search History


Branches Sales
Home
Adding New Branch
Branch Location
Minimum Customers per Hour
Maximum Customers per Hour
Average of cookies sales
Add New Branch


Try different values and view a plot of how they play out over time.
Intervals can be thought of as months or 30/day increments.
For this blockchain, the following values are set:
Initial Supply: 100,000,000 VKG/NULS
Inflation begins in intervals: 24 (2 years)
Inflation tokens per 12 intervals: 5,000,000 / 12 (416,666.66) VKG/NULS
Inflation is turned off when inflation reaches: 210,000,000 VKG/NULS
Disinflation ratio is: 0.004 ( 0.01 = 1% )
Inflation and disinflation begin at the same time.
Inflation begins in intervals: 24 (2 years)
Inflation tokens per 12 intervals: 5,000,000 / 12 (416,666.66) VKG/NULS
Inflation is turned off when inflation reaches: 210,000,000 VKG/NULS
Disinflation ratio is: 0.004 ( 0.01 = 1% )
Inflation and disinflation begin at the same time.


 Find friends who want the same stuff you do, and buy it together.
Find products and get detailed descriptions without any effort.
See popular products near your location.
Choose whether to allow only your closest friends to see your lisitng.


Man accused of stealing dozens of cellphones at EDC Orlando
by Joel Franco(WSVN) - Police have arrested a man accused of stealing more than two dozen cellphones at Electric Daisy Carnival in Orlando, FOX 35 reports.
As thousands of electronic music fans raved at Camping World Stadium, police said Carlos Perez-Hernandez was busy stealing pricey electronics.
“We had a patron contact our officers and say he saw a suspect, a Hispanic male, grabbing phones out of peoples’ back pockets,” Orlando Police Lt. Wanda Migilo told FOX 35.
In total, police said Perez-Hernandez stole 34 phones worth over $20,000.
One festivalgoer said they were waiting in line for the bathroom when they were swiped.
“I felt a bump, a lot of people, so I didn’t think anything of it,” said Tony Nguyen.


Alt util for AWS CloudWatch agent that works with systemd journal and sends the data in batches to AWS CloudWatch.
This utility reads from the systemd journal, and sends the data in batches to Cloudwatch.
This is an alternative process to the AWS-provided logs agent.
The AWS logs agent copies data from on-disk text log files into Cloudwatch.
This utility systemd-cloud-watch
reads the systemd journal
and writes that data in batches to CloudWatch.
There are other ways to do this using various techniques. But depending on the size of log messages and size of the core parts these other methods are fragile. This utility allows you cap the log field size, include only the fields that you want, or exclude the fields you don't want. We find that this is not only useful but essential.
The journal event data is written to CloudWatch Logs in JSON format, making it amenable to filtering using the JSON filter syntax. Log records are translated to CloudWatch JSON events using a structure like the following:
{
"instanceId": "i-xxxxxxxx",
"pid": 12354,
"uid": 0,
"gid": 0,
"cmdName": "cron",
"exe": "/usr/sbin/cron",
"cmdLine": "/usr/sbin/CRON -f",
"systemdUnit": "cron.service",
"bootId": "fa58079c7a6d12345678b6ebf1234567",
"hostname": "ip-10-1-0-15",
"transport": "syslog",
"priority": "INFO",
"message": "pam_unix(cron:session): session opened for user root by (uid=0)",
"syslog": {
"facility": 10,
"ident": "CRON",
"pid": 12354
},
"kernel": {}
}
The JSON-formatted log events could also be exported into an AWS ElasticSearch instance using the CloudWatch sync mechanism. Once in ElasticSearch, you can use an ELK stack to obtain more elaborate filtering and query capabilities.
If you have a binary distribution, you just need to drop the executable file somewhere.
This tool assumes that it is running on an EC2 instance.
This tool uses libsystemd
to access the journal. systemd-based distributions generally ship
with this already installed, but if yours doesn't you must manually install the library somehow before
this tool will work.
There are instructions on how to install the Linux requirements for development below see - Setting up a Linux env for testing/developing (CentOS7).
We also have two excellent examples of setting up a dev environment using bin.packer for both AWS EC2 and Docker. We setup CentoOS 7. The EC2 instance bin.packer build uses the aws command line to create and connect to a running image. These should be instructive for how to setup this utility in your environment to run with systemd as we provide all of the systemd scripts in the bin.packer provision scripts for EC2. An example is good. A running example is better.
This tool uses a small configuration file to set some values that are required for its operation. Most of the configuration values are optional and have default settings, but a couple are required.
The configuration file uses a syntax like this:
log_group = "my-awesome-app"
The following configuration settings are supported:
aws_region
: (Optional) The AWS region whose CloudWatch Logs API will be written to. If not provided,
this defaults to the region where the host EC2 instance is running.
ec2_instance_id
: (Optional) The id of the EC2 instance on which the tool is running. There is very
little reason to set this, since it will be automatically set to the id of the host EC2 instance.
journal_dir
: (Optional) Override the directory where the systemd journal can be found. This is
useful in conjunction with remote log aggregation, to work with journals synced from other systems.
The default is to use the local system's journal.
log_group
: (Required) The name of the cloudwatch log group to write logs into. This log group must
be created before running the program.
log_priority
: (Optional) The highest priority of the log messages to read (on a 0-7 scale). This defaults
to DEBUG (all messages). This has a behaviour similar to journalctl -p <priority>
. At the moment, only
a single value can be specified, not a range. Possible values are: 0,1,2,3,4,5,6,7
or one of the corresponding
"emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"
.
When a single log level is specified, all messages with this log level or a lower (hence more important)
log level are read and pushed to CloudWatch. For more information about priority levels, look at
https://www.freedesktop.org/software/systemd/man/journalctl.html
log_stream
: (Optional) The name of the cloudwatch log stream to write logs into. This defaults to
the EC2 instance id. Each running instance of this application (along with any other applications
writing logs into the same log group) must have a unique log_stream
value. If the given log stream
doesn't exist then it will be created before writing the first set of journal events.
buffer_size
: (Optional) The size of the local event buffer where journal events will be kept
in order to write batches of events to the CloudWatch Logs API. The default is 100. A batch of
new events will be written to CloudWatch Logs every second even if the buffer does not fill, but
this setting provides a maximum batch size to use when clearing a large backlog of events, e.g.
from system boot when the program starts for the first time.
fields
: (Optional) Specifies which fields should be included in the JSON map that is sent to CloudWatch.
omit_fields
: (Optional) Specifies which fields should NOT be included in the JSON map that is sent to CloudWatch.
field_length
: (Optional) Specifies how long string fileds can be in the JSON map that is sent to CloudWatch.
The default is 255 characters.
debug
: (Optional) Turns on debug logging.
local
: (Optional) Used for unit testing. Will not try to create an AWS meta-data client to read region and AWS credentials.
This program requires access to call some of the Cloudwatch API functions. The recommended way to achieve this is to create an IAM Instance Profile that grants your EC2 instance a role that has Cloudwatch API access. The program will automatically discover and make use of instance profile credentials.
The following IAM policy grants the required access across all log groups in all regions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:DescribeLogStreams"
],
"Resource": [
"arn:aws:logs:*:*:log-group:*",
"arn:aws:logs:*:*:log-group:*:log-stream:*"
]
}
]
}
In more complex environments you may want to restrict further which regions, groups and streams
the instance can write to. You can do this by adjusting the two ARN strings in the "Resource"
section:
*
in each string can be replaced with an AWS region name like us-east-1
to grant access only within the given region.*
after log-group
in each string can be replaced with a Cloudwatch Logs log group name
to grant access only to the named group.*
after log-stream
in the second string can be replaced with a Cloudwatch Logs log stream
name to grant access only to the named stream.Other combinations are possible too. For more information, see the reference on ARNs and namespaces.
This application can run on the same host as the official Cloudwatch Logs agent but care must be taken to ensure that they each use a different log stream name. Only one process may write into each log stream.
This program is best used as a persistent service that starts on boot and keeps running until the
system is shut down. If you're using journald
then you're presumably using systemd; you can create
a systemd unit for this service. For example:
[Unit]
Description=journald-cloudwatch-logs
Wants=basic.target
After=basic.target network.target
[Service]
User=nobody
Group=nobody
ExecStart=/usr/local/bin/journald-cloudwatch-logs /usr/local/etc/journald-cloudwatch-logs.conf
KillMode=process
Restart=on-failure
RestartSec=42s
This program is designed under the assumption that it will run constantly from some point during system boot until the system shuts down.
If the service is stopped while the system is running and then later started again, it will "lose" any journal entries that were written while it wasn't running. However, on the initial run after each boot it will clear the backlog of logs created during the boot process, so it is not necessary to run the program particularly early in the boot process unless you wish to promptly capture startup messages.
go test -v github.com/advantageous/systemd-cloud-watch/cloud-watch
./run_build_linux.sh
The above starts up a docker container, runs go get
, go build
, go test
and then copies the binary to
systemd-cloud-watch_linux
.
./run_test_container.sh
The above starts up a docker container that you can develop with that has all the prerequisites needed to compile and test this project.
$ ./run_test_container.sh
latest: Pulling from advantageous/golang-cloud-watch
Digest: sha256:eaf5c0a387aee8cc2d690e1c5e18763e12beb7940ca0960ce1b9742229413e71
Status: Image is up to date for advantageous/golang-cloud-watch:latest
[root@6e0d1f984c03 /]# cd gopath/src/github.com/advantageous/systemd-cloud-watch/
.git/ README.md cloud-watch/ bin.packer/ sample.conf
.gitignore build_linux.sh main.go run_build_linux.sh systemd-cloud-watch.iml
.idea/ cgroup/ output.json run_test_container.sh systemd-cloud-watch_linux
[root@6e0d1f984c03 /]# cd gopath/src/github.com/advantageous/systemd-cloud-watch/
[root@6e0d1f984c03 systemd-cloud-watch]# ls
README.md build_linux.sh cgroup cloud-watch main.go output.json bin.packer run_build_linux.sh
run_test_container.sh sample.conf systemd-cloud-watch.iml systemd-cloud-watch_linux
[root@6e0d1f984c03 systemd-cloud-watch]# source ~/.bash_profile
[root@6e0d1f984c03 systemd-cloud-watch]# export GOPATH=/gopath
[root@6e0d1f984c03 systemd-cloud-watch]# /usr/lib/systemd/systemd-journald &
[1] 24
[root@6e0d1f984c03 systemd-cloud-watch]# systemd-cat echo "RUNNING JAVA BATCH JOB - ADF BATCH from `pwd`"
[root@6e0d1f984c03 systemd-cloud-watch]# echo "Running go clean"
Running go clean
[root@6e0d1f984c03 systemd-cloud-watch]# go clean
[root@6e0d1f984c03 systemd-cloud-watch]# echo "Running go get"
Running go get
[root@6e0d1f984c03 systemd-cloud-watch]# go get
[root@6e0d1f984c03 systemd-cloud-watch]# echo "Running go build"
Running go build
[root@6e0d1f984c03 systemd-cloud-watch]# go build
[root@6e0d1f984c03 systemd-cloud-watch]# echo "Running go test"
Running go test
[root@6e0d1f984c03 systemd-cloud-watch]# go test -v github.com/advantageous/systemd-cloud-watch/cloud-watch
=== RUN TestRepeater
config DEBUG: 2016/11/30 08:53:34 config.go:66: Loading log...
aws INFO: 2016/11/30 08:53:34 aws.go:42: Config set to local
aws INFO: 2016/11/30 08:53:34 aws.go:72: Client missing credentials not looked up
aws INFO: 2016/11/30 08:53:34 aws.go:50: Client missing using config to set region
aws INFO: 2016/11/30 08:53:34 aws.go:52: AWSRegion missing using default region us-west-2
repeater ERROR: 2016/11/30 08:53:44 cloudwatch_journal_repeater.go:141: Error from putEvents NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
--- SKIP: TestRepeater (10.01s)
cloudwatch_journal_repeater_test.go:43: Skipping WriteBatch, you need to setup AWS credentials for this to work
=== RUN TestConfig
test DEBUG: 2016/11/30 08:53:44 config.go:66: Loading log...
test INFO: 2016/11/30 08:53:44 config_test.go:33: [Foo Bar]
--- PASS: TestConfig (0.00s)
=== RUN TestLogOmitField
test DEBUG: 2016/11/30 08:53:44 config.go:66: Loading log...
--- PASS: TestLogOmitField (0.00s)
=== RUN TestNewJournal
--- PASS: TestNewJournal (0.00s)
=== RUN TestSdJournal_Operations
--- PASS: TestSdJournal_Operations (0.00s)
journal_linux_test.go:41: Read value=Runtime journal is using 8.0M (max allowed 4.0G, trying to leave 4.0G free of 55.1G available → current limit 4.0G).
=== RUN TestNewRecord
test DEBUG: 2016/11/30 08:53:44 config.go:66: Loading log...
--- PASS: TestNewRecord (0.00s)
=== RUN TestLimitFields
test DEBUG: 2016/11/30 08:53:44 config.go:66: Loading log...
--- PASS: TestLimitFields (0.00s)
=== RUN TestOmitFields
test DEBUG: 2016/11/30 08:53:44 config.go:66: Loading log...
--- PASS: TestOmitFields (0.00s)
PASS
ok github.com/advantageous/systemd-cloud-watch/cloud-watch 10.017s
# from project root
cd bin.packer
bin.packer build packer_docker.json
# from project root
cd bin.packer
./run.sh
# from project root
cd bin.packer
bin.packer build packer_ec2.json
We use the docker support for bin.packer. ("Packer is a tool for creating machine and container images for multiple platforms from a single source configuration.")
Use ec2_env.sh_example
to create a ec2_env.sh
with the instance id that was just created.
#!/usr/bin/env bash
export ami=ami-YOURAMI
export subnet=subnet-YOURSUBNET
export security_group=sg-YOURSG
export iam_profile=YOUR_IAM_ROLE
export key_name=MY_PEM_FILE_KEY_NAME
# from project root
cd bin.packer
# Run and log into dev env running in EC2
./runEc2Dev.sh
# Log into running server
./loginIntoEc2Dev.sh
yum -y install wget
yum install -y git
yum install -y gcc
yum install -y systemd-devel
echo "installing go"
cd /tmp
wget https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz
tar -C /usr/local/ -xzf go1.7.3.linux-amd64.tar.gz
rm go1.7.3.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bash_profile
compile 'org.gnieh:logback-journal:0.2.0'
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="journal" class="org.gnieh.logback.SystemdJournalAppender" />
<root level="INFO">
<appender-ref ref="journal" />
<customFields>{"serviceName":"adfCalcBatch","serviceHost":"${HOST}"}</customFields>
</root>
<logger name="com.mycompany" level="INFO"/>
</configuration>
# Get status
sudo systemctl status journald-cloudwatch
# Stop Service
sudo systemctl stop journald-cloudwatch
# Find the service
ps -ef | grep cloud
# Run service manually
/usr/bin/systemd-cloud-watch_linux /etc/journald-cloudwatch.conf
This is based on advantageous journald-cloudwatch-logs which was forked from saymedia journald-cloudwatch-logs.
It is close to being done.
Improvements:
Copyright (c) 2015 Say Media Inc
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
All additional work is covered under Apache 2.0 license. Copyright (c) 2016 Geoff Chandler, Rick Hightower


Cream puff pastry keycaps
by Rob BeschizzaPixy Handmade creates adorable and delicious-looking keycaps for mechanical keyboards. They accept custom orders through Amazon.
Pixy Handmade creates adorable and delicious-looking keycaps for mechanical keyboards. They accept custom orders through Amazon.


Some time ago I wrote a post on form generation. It mostly came from my experience with FunFormKit, early versions of FormEncode, and then what FormEncode is now (which is strictly a validation library).
Now there's some new form generation libraies in the works; ToscaWidgets, Django newforms, and I hear rumors of a few others. I feel bad poo-pooing other people's work, but I don't think this approach is a good approach.
A form generation library is a hard library to write. You have to balance complexity and features. There are a lot of potential features. How do you tweak the forms? How do you control layout? How do you handle repeating form elements? How do you handle elements that require Javascript? Server-side resources like CSS and Javascript? Server-side communication like auto-complete? A simple library cannot handle a lot of these. But very simple forms don't need form generation libraries. So a simple library only handles a narrow band of use cases. A complex library can potentially handle all these cases, but can be difficult to use for the most common cases.
I will assert that as the libraries are usually designed, there is no good balance. Not all problems have feasible solutions. Form generation libraries are one such problem, but they don't seem to be such a problem.
There's a cycle going on in the library development. A developer has certain requirements. Usually they also hate HTML, and may very well be working with an awkward templating language, and maybe they aren't very excited about the task at hand and building a library is a pleasant diversion. But anyway, they Do The Right Thing (or so they think) and try an existing library. It's complex, it doesn't match the way they think about the problem, the bugs in their code are hard to figure out, and adjusting the things they (or their boss or client) cares about is difficult.
And they think "I can do this so much more simply!" The developer is kind of right. They know exactly what they want to do (now), and they can improve their productivity some.
The problem is that no library ends there. It can't end there. Because someone uses the library, and the code must be maintained. Form generation is a hard thing to maintain, because it has to be actively maintained. New fields are added. New cases and exceptions come into being. Anything that touches UI can be redefined in weird and unexpected ways. Good UI is usually eclectic and nonsensical from the perspective of a programmer. UI should be consistent with the user's notion of the domain, not the program's internal modeling of the domain, and it is uncommon that the two really match up.
So you get new requirements over time. A straight list of checkboxes used to be reasonable, but then the number of options expanded too far and now you need two columns of checkboxes. So you add in a little bit of code, both in the library and the application, to handle that case. You want to have a text field that contains its own label when its empty. The validation becomes increasingly complex. Maybe you have a multi-screen form, or maybe a form with optional fields, or who knows. So you add code to the library and the application each time (if you control both of them). It gets more and more complex while at the same time the developer's familiarity with the library code becomes more and more remote. And that's not even to mention when a non-programmer wants to tweak the HTML, or there is developer turnover, or when you don't control the library at all...
It's a mess. And so someone comes along and says "I can do this so much more simply!" and it starts all over again.
The problem domain is wrong. I think there's a better approach, but I'm too lazy to finish it. So I'll lay down the design here, with little expectation that anything will happen because of it, but just maybe this will connect with someone. (Ideally someone who will write code ;)
First, validation: I like how FormEncode works, I think it's the right model. Validation completely separate from the rest of the system, and you can programmatically construct the validation so you can embed it in other systems if you want (and embedding it is probably a good idea).
Second: forms. First, the simplest model: write it in a normal template. But this is annoying people will cry. Why?
My response is that these issues can be resolved without form generation libraries. formencode.htmlfill addresses 1 and 2. It's not perfect, but it's usable. Things like WebHelpers can help with 4. Neither of these needs to be the implementation, and both could be improved. But while remaining in their scope they can only be improved a little, which is important. They will not become endless time sinks.
Unobtrusive Javascript solves 5 quite well. I think a tool for solving 6 -- the proper inclusion of dependent CSS and Javascript -- could be handy. I imagine <input type="date" js-require="DateInput"> calling some code that figures out where DateInput is (probably building on something like JSAN package metadata) and puts the appropriate code in the head of the page.
7 and 8 are addressed quite nicely by the Web Forms 2.0 WHAT-WG specification, and tools building on those models would be excellent.
And once you have all this, I think 9 is much more approachable. Because you don't need a framework, you just need stuff that generates blank HTML that also uses a few of these simple conventions.
Notably, these techniques embrace the abstractions HTML and Javascript already allow. Also, each tool can be useful on its own, and can be used, not used, or reimplemented on its own. The hard part is that any one tool seems terribly simple and lacking features compared to a form generation framework. But if slow and steady can win the race it might not matter; the other form generation frameworks will suffer the churn of the reimplementation cycle while these simpler and duller tools will better stand the test of time. And even if they don't, unlike a framework the healthy decoupled set of tools can suffer the failure of one piece (in design, maintenance, or implementation) without compromising the entire stack.
Now someone please go build the missing pieces, because I'm trying really hard not to start more projects.
Ian Bicking: The code libertarian.
Besides that (ahem) gem, I pick a nit: nonsensicle => nonsensical.
What's your take on WYSIWYG form builders and related libraries in Java and ASP.NET?
# Scott Tsai
I've never tried them or even seen them. It seems reasonable, I suppose, though any framework integration would set off a warning bells. Insofar as you are adding custom attribute to the form elements, it's reasonable. At least what I've seen in ASP.NET seems to do this. What I don't like in the examples I've seen is that it seems to also do control flow through the form itself. That's awful. Templates are good, but they aren't good for control flow. And putting control flow in form libraries is the kiss of death IMHO.
I think form generators aren't all bad, and potentially something less general than a full templating language could be called for when generating large forms (though of course any templating language can be used to programmatically create forms -- there's doesn't need to be any dichotomy between generated and hand-written forms if other tools work on the markup and not any underlying models).
# Ian Bicking
I was just contemplating writing a set of HTMLish widgets for Glade as I read this. They would produce HTML or Mako or something like that. My personal view is that if there were decent UI form designers for HTML, people wouldn't become obsessed with building this particular magic bullet.
Agreed on the form generation vs. validation front. I spent the last couple weeks working with ToscaWidgets and while it clearly has an answer for any form I can imagine, it's incredibly frustrating to re-learn how to write a simple HTML form that ends up looking far more elegant in its native markup syntax. Django's newforms was much less frustrating for me, but I dislike the generation aspect in general.
I am in total agreement about form generation libraries, and this was something i didnt like about early FormEncode. This is because ive been building forms with all kinds of server side languages for a really long time, and have many times gone down the road of building "generic form generation" systems, as well as using a lot of the early losers like ATG dynamo and stuff like that. its the same 80% solution tune that plays all day long...or at least 80% of the time.
Fortunately for me, I always worked in environments where the non-feasability of form generators was always super-obvious: id get handed enormous HTML redesigns of my forms from designers and had to work around that.
Still, the need to have the ability to just say, "text input element!" somewhere on a page without going through the motions of the repeating the individual HTML and site-specific customizations of that element, is very important. thats why I was so apeshit over HTML::Mason, and then Myghty, and upon Myghty crumbling under its own weight I reimplemented it as Mako: you need to be able to make custom, reusable, nested, inter-aware widgets, in straight templated HTML, immediately.
so ill keep saying it like i always do: the "templating" part is not so hard. With Mako, you create any number of templates containing your widgets as <%defs>, and then you can <%call> them, using whatever nesting schemes you desire. It really works frigging great...its the model ive used for years and component-call-with-content is the "killer feature" of these systems. Its the ability to create custom nestable tags without any python code or external modules. no other template lang ive seen in python can really do this (except myghty of course).
I have been playing with toscawidgets for a gig recently, and its OK but its the same thing. Theyre making me put HTML in my source code, making me dispatch it through confusing classes and datastructures...and thats just not where it belongs.
Mike, care to add a howto to docs.pythonweb.org about form generation with Mako?
I'm really a fan of treating form libraries as sets of macros. There are higher level macros (perhaps a macro that can output an entire label and field) and lower level macros (just a checkbox, or just the code to output an error). By treating the system this way, the user can get super custom if he needs to (by using the low level macros or even straight HTML), or he can whip stuff out really quickly (by using the high level macros). Need something different? Add more macros based on the lower level macros.
I've used this approach before at multiple companies in developing the common look-and-feel library that is used by several applications. It's a simple idea, but it works out well.
By the way, I too tend to keep form generation separate of form validation. I'm not tied to that idea, but it's worked out well for me in the past.
I don't really have much of a point with this, just some observations.
One is that a form generation library can have independently evolving components. Let's take the Zope 3 has a form generation library. I'm sure you don't like it. :) It has multiple components that work together:
- a schema library taking care of definition and validation
- a widget library taking care of display and conversion of input
- a formlib library taking care of putting the widgets together with the data.
- the actual objects implementing a schema that maintain/store the data
These components can evolve by themselves. formlib for instance is reasonably new, replacing another system for putting a form together that didn't work as well. It's built on the existing schema system and widget systems, however, so those weren't rewritten. It would also be possible to revise the way the widget system work without an enormous impact on the other pieces, though formlib would likely need some adaptation.
There are two very different extremes of dealing with forms. One is schema-driven, the other HTML driven. Most systems fall in the middle somewhere (which probably creates some of the muddle); Zope 3's system leans fairly heavily towards schemas (which introduces its own limitations). I see benefits in both approaches: HTML driven is very good at being able to adapt to a wide variety of real-world forms. Schema-driven is good at producing lots of forms from small descriptions of data and encourages widget reuse.
It appears that to you the tradeoffs weigh in favor of HTML driven forms. To me, it depends in what you're trying to accomplish.
Note by the way that ToscaWidgets is not necessarily a form generation system. It's a way to package and reuse bundles of python, HTML, CSS and javascript at its core. It has a form library built on top of it.
Finally, I have the suspicion that any set of abstractions that helps you deal with complex real world scenarios in any domain will be vulnerable to your criticism of form generation libraries, including your own proposal on how to handle this particular problem domain. :)
# Martijn Faassen
There are two very different extremes of dealing with forms. One is schema-driven, the other HTML driven. Most systems fall in the middle somewhere (which probably creates some of the muddle); Zope 3's system leans fairly heavily towards schemas (which introduces its own limitations). I see benefits in both approaches: HTML driven is very good at being able to adapt to a wide variety of real-world forms. Schema-driven is good at producing lots of forms from small descriptions of data and encourages widget reuse.I'm not really opposed to creating forms programmatically. I just think it should be a simpler task than what most form generation libraries have bitten off. It should look a lot more like templating, and a lot less like programming. It shouldn't include things like filling in defaults, filling in errors, collecting Javascript and CSS, and maybe not layout (or at least very simple layout). Once the definition is sufficiently limited you can get away with a very simple and transparent library for form generation. And certainly that is important, since lots of domains require form generation -- stuff like Django's CMS, or user-driven models generally.
As to formlib, I'm afraid I don't really know much. I've seen Zope Schemas, and I think they are fine, though as I remember they did validation without conversion, and I think two-way conversion is integral. Combining validation with widgets and worse data bindings is a really bad path, and you didn't go down that. I'm a little wary of data bindings in general, as it puts the logic in the framework and I hate that; it makes my head hurt. But if it's done really well it's possible -- as long as you aren't squeezing it into a normal web app framework design. I suppose htmlfill is a kind of data binding library; but it's very clearly a library. Anyway, no one will accuse Zope 3 of being a normal web app framework design, so no problem there ;)
# Ian Bicking
I'm sympathetic with your general idea that much that is now done inside widget libraries should be pulled out into independent systems. It will need some thought on my end.
Ian:
As to formlib, I'm afraid I don't really know much. I've seen Zope Schemas, and I think they are fine, though as I remember they did validation without conversion, and I think two-way conversion is integral.Zope 3's design considers two-way conversion the responsibility of the widget, as it's part of viewing logic. Conversion might be quite different if the data is coming from another source than the web, or is going to another target than the web, after all (an int might already be an int).
Ian:
Combining validation with widgets and worse data bindings is a really bad path, and you didn't go down that. I'm a little wary of data bindings in general, as it puts the logic in the framework and I hate that; it makes my head hurt. But if it's done really well it's possible -- as long as you aren't squeezing it into a normal web app framework design. I suppose htmlfill is a kind of data binding library; but it's very clearly a library. Anyway, no one will accuse Zope 3 of being a normal web app framework design, so no problem there ;)Zope 3's more normal than it looks like, it's just not presenting itself well. :)
As to data binding, what you mean by this is the code that gets the data to display in the form from somewhere and then gets it back from the web into the application, right? I believe in Zope 3 that's scattered a bit between formlib and the widget system. It'd be nice if it were a more coherent library. It's quite powerful in the sense that it handles nested and/or composite form values well (which can be expressed with Zope 3 schema).
# Martijn Faassen
I think unobtrusive JavaScript should solve numbers 5, 6 and 7. The form should be in no way dependent on JavaScript to function, so that should not be a part of any for generation library (apart from giving the form and its fields sane #ids or .classes to use as hooks from the unobtrusive JavaScript).
Once you've got the form created, you can swoop in and make the form turn cartwheels (including AJAX cartwheels) using JavaScript, which can be included in the <head> of the document from whatever template the form will be sitting in.
I'm actually pretty lazy when it comes to Javascript fallback. This perhaps is a personal failure. But as an example of how I would deal with date inputs, I'd just throw this in: <input type="date">. Let the Javascript figure that out (which is easy enough). If the Javascript doesn't figure it out, you get a text input and rely on server-side validation. A "fancier" system just knows you don't have Javascript date inputs, and it falls back on select boxes. Which probably don't make anyone any happier than the text box, but somehow it feels like you are trying hard instead of being lazy.
In other cases, like repeating elements, handling that server-side makes my head hurt. It can be done, yes, but it's going to hurt. You'll have to take control from the normal controller and do lots of fancy things behind the scenes. The alternative is not writing the form anything like that, and forcing another half-dozen clicks by the user to do the same thing. That's not a compromise I get excited about either.
I'm not sure exactly why you should make forms that are usable by people without Javascript. I don't think it's accessibility -- I believe "accessible" browsers also interpret Javascript. How well, I'm not sure, but I don't get the impression they really feel like Lynx. If it's to make your site accessible to the Googlebot, well I don't really care about forms. If it's because some people are just stubborn and turn off Javascript, eh. I'm not sure it's worth it.
# Ian Bicking
"I'm not sure exactly why you should make forms that are usable by people without Javascript."
Strong words, and quite shocking in certain ways, too. Many of the JavaScript-only Web applications I've seen aren't likely to be very accessible, and what about people disabling JavaScript for security or usability reasons? To me, JavaScript (and AJAX, which is where a lot of the JavaScript goes these days) is a bonus for those who want a bonus, not a minimum requirement that excludes a number of people for reasons not fully considered by the developer.
# Paul Boddie
Many of the JavaScript-only Web applications I've seen aren't likely to be very accessibleThat doesn't mean that you need to bar Javascript in order to be accessible.
and what about people disabling JavaScript for security or usability reasons?I don't think that makes any sense in the modern web. I don't see any reason to aggressively make things harder for these people, and lots of things should work without problem, but I don't think that's a user choice that I'm going to work to support. There's lots of choices users can make, I can't account for all of them.
# Ian Bicking
I'd like to make a quick edit on the post and some comments to get the package names right ;)
s/ToscaWidgets/twForms/g
I find rather disappointing that one of the points I try to get through in the scarce TW documentation (actually, the description of the package) rarely gets through as intended. ToscaWidgets does not handle form generation.
It only aspires to:
- bundle resources needed to build a web widget (as defined in this wikipedia entry). That is, it's (X)HTML markup (could also be template in any language that implements a Buffet plugin that generates it programatically), it's styling metadata (aka CSS) and it's client-side scripting.
- Serve those static resources using the WSGI protocol so it's pluggable in any compliant app/framework.
- Provide an interface between all this and the rest of the application. That is, a Widget subclass that can be pinitialized and configured in Python. Including a simple and non-ambitious bridge between Python an Javascript that generates a js call to initialize the client-side part (converting parameters from python to js using a JSON representation if needed).
- Allow widget composition to create complex widgets.
- Provide infrastructure to package all this into a setuptools egg for easier reuse.
I actually believe it's flexible and powerful enough to serve as a good base to build the dream form library you're sketching out if twForms doesn't satisfy you :)
(I really need to get some docs out soon...)
Alberto
# Alberto Valverde
I've used FormEncode and the associated htmlfill for some time now and have been really really happy with how it works out. When you do complex applications, and you need to be hand editing your html page for specific layout/javascript interaction and it's a godsend when the framework for validation and loading defaults on the page (#1 & #2) just stay out of the way.
htmlfill does a really good job of putting default values on the forms; and formencode is a great way to validate and get those validation errors back on the page (along with setting appropriate display classes on the page). It really understands html as it should, and doesn't mind if it happens to be html that comes through some other framework or page templating language. It's almost like they are just tools and not a framework at all, because they don't ever get in your way when you want to do complex things; they make the complex possible. Personally i use Zope Page Templates to generate my pages (#8) and that helps put some of the dynamic elements on the page; but formencode does quite a bit of heavy lifting; and it is quite up to the task.
...all that said, HTML, Javascript and CSS (#4 #5 and #6) can be annoying until you really have a strong grasp of all three and are comfortable with them all. When you reach that level things start to fall into place, and you realize that HTML, Javascript and CSS are powerful frameworks for doing their respective pieces, and that they can be easier to use directly instead of with some clumsy middle man between the keyboard and the screen
We have been using Zope at at Avand as the basis of our document management system since 2000, and we have a mature widget system which does client-side and server-side validation (including spell checking as a client-side validation module), handles javascript dependencies (so that scripts aren't imported multiple times), creates complex widgets ... see screenshot
The widgets rendered are the XP style list on the left, the two lists on the main panel, the Display options pseudo-dropdown(which persists user preferences as cookies).
I haven't checked out Tosca, but there might be some potential to cross polinate ideas. The code is fairly tailored towards our needs, and probably not suitable for reuse outside our own project.


A dynamic Software Engineer with experience in Fullstack software development. Fast learner with optimal time management, and multi-tasking skills. Strong work ethic in a team, and individual settings. I'm always looking for new ventures where I can apply my expertise, learn, and evolve.
In my free time, I consider myself an astute gamer. I like to keep a somewhat active lifestyle, by going to the gym, traveling, and exploring new food avenues.
View ResumeHave you ever wanted to experience the true power of technology? Well, it is now all at your hands with a simple click of a button. This application allows you to draw in the power of technology by using facial recognition, to identify a face within a picture that you have, providing a URL link of your image. I created the application to improve my front-end skills by connecting to an external API, along with creating a backend Node.JS server to hold users' information within a database.
Technology: React, Node.Js, PSQL, JavaScript
A simple web application that allows a user to create notes, and assigned each note to its respective folder. The User is also able to edit, delete, update each note. This application is useful for storing information and creating quick notes. The project allowed me to further develop my skills in creating, setting up, and deploying an API.
Technology: React, ReactHooks, Node.Js, PSQL, JavaScript
Set yourself up for success by creating, and completing various tasks/todo items. A great way to prioritize your goals, events, and tasks. Users can create, edit, and delete a task that they have set for themselves. The application was built to increase personal productivity.
Technology: React, Node.Js, PSQL, JavaScript
Get To Know Me
E-mail


From:Cyril Konan. Abidjan Cote D'Ivoire. Tel:0022-50786-5223. REQUEST ASSISTANCE Sir, It is my pleasure to write you after much considerations I can not be able to see you face to face at first. Being the first son of my father late prince mathew Konan, from Zulu in republic of South Africa. My father was a limited liability cocoa and gold merchant in South Africa before his untimely death. After his business trip to Abidjan Cote d'Ivoire, to negociate on a cocoa business a week after he came mother by unknown assassins . which my mother died , instantly , but my father died after five days in hospital on that faithful afternoon. I didn't know that my father was going to leave me after I had lost my mother . But before he gave up the ghost , it was as if he know he was going to die . He my father,may his soul rest in perfect peace ) disclose to me that he deposited $ 18.5 ( eighteen million five hundred thousand dollars ) in security and safe deposit company in Abidjan , Cote d'Ivoire. That the money was meant for his cocoa business he wanted to invest in Abidjan , Cote d'Ivoire through, according to my father he deposited the money in a trunk box, but declared it as ivory , and family belonging for the security reasons. He single handed me the key of the box and certificate of deposit and agreement certificate , and instructed me to seek for a foreign assistant who will help me to move it out from the security and safe deposit company for a life time investment abroad . Now , I have succeeded in locating the security and safe deposit company here in Abidjan , Cote d'Ivoire and also I confirmed the item with most honest and confidentiality. Now I am soliciting for your assistance to help me lift this money out from Abidjan to your account abroad so that we should invest it in any lucrative business in your country , strictly in your advice , because this is my only hope in life. As I am awaiting anxiously to hear from you so that we can discuss the modalities of this transaction . I have mapped out for you 15% of the total fund which stands for your commission for presenting a foreign bank account where the money will be transferred to and more so you shall benefit 5% of the monthly total interest of the said venture. Please if this proposal is acceptable to you kindly contact me through the above email address immediately for more discussion .Please help me with good spirit . Thanks for your kind attention and mutual understanding. Best Regards. Cyril Konan. =========================================================================================== Netkuis Instan untuk Divre 3 - SD,SMP,SMA berhadiah asuransi pendidikan puluhan juta rupiah... periode I dimulai 1 April 2004 ===========================================================================================


Model
public enum Model : String
Undocumented
-
Undocumented
Declaration
Swift
case simulator = "simulator/sandbox"
-
Undocumented
Declaration
Swift
case iPod1 = "iPod 1"
-
Undocumented
Declaration
Swift
case iPod2 = "iPod 2"
-
Undocumented
Declaration
Swift
case iPod3 = "iPod 3"
-
Undocumented
Declaration
Swift
case iPod4 = "iPod 4"
-
Undocumented
Declaration
Swift
case iPod5 = "iPod 5"
-
Undocumented
Declaration
Swift
case iPad2 = "iPad 2"
-
Undocumented
Declaration
Swift
case iPad3 = "iPad 3"
-
Undocumented
Declaration
Swift
case iPad4 = "iPad 4"
-
Undocumented
Declaration
Swift
case iPadAir = "iPad Air "
-
Undocumented
Declaration
Swift
case iPadAir2 = "iPad Air 2"
-
Undocumented
Declaration
Swift
case iPad5 = "iPad 5"
-
Undocumented
Declaration
Swift
case iPad6 = "iPad 6"
-
Undocumented
Declaration
Swift
case iPadMini = "iPad Mini"
-
Undocumented
Declaration
Swift
case iPadMini2 = "iPad Mini 2"
-
Undocumented
Declaration
Swift
case iPadMini3 = "iPad Mini 3"
-
Undocumented
Declaration
Swift
case iPadMini4 = "iPad Mini 4"
-
Undocumented
Declaration
Swift
case iPadPro9_7 = "iPad Pro 9.7\""
-
Undocumented
Declaration
Swift
case iPadPro10_5 = "iPad Pro 10.5\""
-
Undocumented
Declaration
Swift
case iPadPro12_9 = "iPad Pro 12.9\""
-
Undocumented
Declaration
Swift
case iPadPro2_12_9 = "iPad Pro 2 12.9\""
-
Undocumented
Declaration
Swift
case iPhone4 = "iPhone 4"
-
Undocumented
Declaration
Swift
case iPhone4S = "iPhone 4S"
-
Undocumented
Declaration
Swift
case iPhone5 = "iPhone 5"
-
Undocumented
Declaration
Swift
case iPhone5S = "iPhone 5S"
-
Undocumented
Declaration
Swift
case iPhone5C = "iPhone 5C"
-
Undocumented
Declaration
Swift
case iPhone6 = "iPhone 6"
-
Undocumented
Declaration
Swift
case iPhone6plus = "iPhone 6 Plus"
-
Undocumented
Declaration
Swift
case iPhone6S = "iPhone 6S"
-
Undocumented
Declaration
Swift
case iPhone6Splus = "iPhone 6S Plus"
-
Undocumented
Declaration
Swift
case iPhoneSE = "iPhone SE"
-
Undocumented
Declaration
Swift
case iPhone7 = "iPhone 7"
-
Undocumented
Declaration
Swift
case iPhone7plus = "iPhone 7 Plus"
-
Undocumented
Declaration
Swift
case iPhone8 = "iPhone 8"
-
Undocumented
Declaration
Swift
case iPhone8plus = "iPhone 8 Plus"
-
Undocumented
Declaration
Swift
case iPhoneX = "iPhone X"
-
Undocumented
Declaration
Swift
case iPhoneXS = "iPhone XS"
-
Undocumented
Declaration
Swift
case iPhoneXSMax = "iPhone XS Max"
-
Undocumented
Declaration
Swift
case iPhoneXR = "iPhone XR"
-
Undocumented
Declaration
Swift
case AppleTV = "Apple TV"
-
Undocumented
Declaration
Swift
case AppleTV_4K = "Apple TV 4K"
-
Undocumented
Declaration
Swift
case unrecognized = "?unrecognized?"


Beijing summons US diplomat to lodge protest over Hong Kong rights bill
Vice foreign minister Ma Zhaoxu called in acting charge d'affaires William Klein to lodge a 'strong protest'
by AFP | PTIChina's foreign ministry on Wednesday summoned a top US diplomat over the Senate's passing of a Hong Kong rights bill, warning of "strong" countermeasures against the United States should the legislation be signed into law.
Vice foreign minister Ma Zhaoxu called in acting charge d'affaires William Klein to lodge a "strong protest", the ministry said in a statement.
"We strongly urge the US side to immediately take effective measures to prevent this bill from becoming law" and stop meddling in China's internal affairs, the statement said.
"Otherwise, the Chinese side will take strong measures to resolutely counter it, and the US side must bear all the consequences," it said.


My Pizza Place
Home
Pizza Pride
Family, Friends $ Pizza
Make an order now
×
Error!
Select all fields.
×
Notification!
There will be an additional cost for delivery.
-Select the size-
Large
Medium
Small
-Select the crust-
Chicago Deep Dish
Neapolitan
NY Style Pizza
Pineapple
Spinach
-Select you preferred topping-
Cheese-Stuffed
Pizza Bagels
Flatbread
Thin Crust
Sicilian Style
Chicago Deep Dish
Neapolitan
NY Style Pizza
Pineapple
Spinach
I WILL PICK
I NEED DELIVERY
Quantity
Size
Crust
Topping
Total
Checkout
RECEIPT
Quantity
Size
Crust
Topping
Total
Print


-
Build a Portfolio
Developed a personal portfolio page using HTML, CSS, and Bootstrap.
-
Interactive Resume
Using jQuery, developed an interactive resume application that reads all data from a JSON file
-
Classic Arcade Game Clone
Developed a HTML5 Canvas powered video game, developed using the best practices in Object Oriented JavaScript.
-
Cam's Pizzeria
Who wants a performant pizza?


--- layout: post title: Post 2 Fork me. ---
Visit Hyde on GitHub and contribute > Fork me!
Hyde is a mashup of several static website development frameworks and utilities. These include Jekyll, Haml, and Sass. All of these tools can be researched and installed separately, but Hyde will install and get you going very quick. Jekyll doesn’t support Haml or Sass by default, which is the main drive behind Hyde. Hyde will not only install Jekyll, Haml and Sass, but also provide you with a simple site directory with watchers and conversions.


This project was made possible by our generous sponsors, including companies and associations. The biggest contributions were made by Aalto University and HiLIFE in University of Helsinki. Thank you once again for the irreplaceable support!