{% extends "layout.html" %} {% from "button/macro.njk" import govukButton %} {% block pageTitle %} Greenwood High School — {{ serviceName }} {% endblock %} {% block content %}
Cavendish Road,
Bournemouth,
Dorset,
BH1 1QY
Secondary,
Academy converter
Open
Dorset
{{ govukButton({ text: "Confirm school", href: "sharing-information-consent" }) }}


Assignment 4 and task 2
This script manually separates moonphcamera.jpg image into two different images
ID: U1610131 Name: Madiyor Abdukhashimov
importing opencv library - to be able to import opencv you need to install it using pip. The process of installation is provided in README.md
import cv2
read the image from the images/ directory
image = cv2.imread('images/moonphcamera.jpg')
selecting the people from the image and cutting then saving it
people = image[80:310, 72:210]
selecting the cameras from the image and cutting then saving it
cameras = image[120:335, 257:494]
saving results the the results
directory
cv2.imwrite('results/task2/people.jpeg', people)
cv2.imwrite('results/task2/cameras.jpeg', cameras)
end of saving results
displaying results
cv2.imshow('people.jpeg', people)
cv2.imshow('cameras.jpeg', cameras)
end of displaying
wait 5 seconds
cv2.waitKey(5000)


@import com.mohiva.play.silhouette.api.actions.SecuredRequest @import fr.gospeak.core.domain.{Group, User} @import fr.gospeak.web.auth.domain.{AuthUser, CookieEnv} @(rejectedUser: User, rejectingOrga: AuthUser, group: Group)(implicit req: SecuredRequest[CookieEnv, AnyContent], messages: Messages)
Hello @rejectedUser.firstName,
We are embarrassed but it seems that you will not be able to help organizing the @group.name.value group :(
You can send an email to @rejectingOrga.user.name.value if you want an explanation.
Please keep enjoying Gospeak ;)
The Gospeak team


{% extends 'base.html' %} {% from 'bootstrap/form.html' import render_field %} {% block content %}
This is a test page. It has a Bootstrap 4 modal.
Sign in with username 'test' and password 'pass'. It takes you to the home page where there is a plain form.


Reports any attempts to reflectively check for the presence of an
annotation which is not defined as being retained at runtime.
Using Class.isAnnotationPresent() to test for an annotation
which has source retention or class-file retention (the default) will always result in a negative result,
but is easy to do inadvertently.
Powered by InspectionGadgets


1 write to MaxLength
System.Management.Automation (1)
engine\Attributes.cs (1)
1526
MaxLength
= maxLength;
7 references to MaxLength
System.Management.Automation (7)
engine\Attributes.cs (6)
1434
/// if the element's length is not between <see cref="MinLength"/> and <see cref="
MaxLength
"/>
1477
if (MinLength ==
MaxLength
&& len !=
MaxLength
)
1483
MaxLength
, len);
1486
if (len < MinLength || len >
MaxLength
)
1492
MinLength,
MaxLength
, len);
engine\TypeMetadata.cs (1)
1008
ValidateCountFormat, prefix, countAttrib.MinLength, countAttrib.
MaxLength
);


Laura Fletcher
LinkedIn
●
Chicago, IL
Web Content and Full Stack Development
I am a seasoned communications professional with experience across all media, including web sites, social media, and email campaigns. Check out my portfolio!
- Award-winning writing
- Messaging and content strategy credited with millions in revenue
Core Competencies
- Communications Strategy
- Full Stack Web Development and Design
- Integrated Marketing Planning
Certifications/Technical Proficiencies
- Certified Agile Scrum Master
- Full Stack Web and Hybrid Mobile Application Development, Microtrain Technologies
Professional Experience
Web Development and Marketing Consultant
Fletch Communications, 2004-Present
Senior Writer, Advancement Communications
Illinois Institute of Technology, 2015-2019
Contract Development Campaign Associate
University of Chicago Medical and Biological Sciences Development, 2013-2015
Staff Editor
Law Bulletin Media, 2011-2013


Dogs vs. Cats
Poll
(current)
Random Dogs
Random Cats
Which one is cuter, Doggo or Kitty?
Also check out our Random Dog and Random Cat Pages
Randomize Images
Download Last Clicked
Liked Dogs = 0
Liked Cats = 0


Flight Search
Ticket Cancellation
PNR status
One Way
Round Trip
Multi City
From:
To:
Departure Date:
Class:
Economy
Premium economy
Business Class
First Class
Adult
(Above 12 years)
Child
(Below 12 years)
Infant
(below 2 years)
From:
To:
Departure Date:
Class:
Economy
Premium economy
Business Class
First Class
Adult
(Above 12 years)
Child
(Below 12 years)
Infant
(below 2 years)
From:
To:
Departure Date:
Class:
Economy
Premium economy
Business Class
First Class
Adult
(Above 12 years)
Child
(Below 12 years)
Infant
(below 2 years)


Contact Me
Contact Me
Have questions for me? Or need to contact me? Go ahead and fill out the form below!


--- layout: post title: Basic Laws of Website AB Testing date: 2009-03-30 12:33:26.000000000 -07:00 categories: [] tags: [] status: private type: post published: false ---
Obvious:
Law of Single Variation: - you can't design separate tests affecting the same area on the same page.
Corollary: Avoid Non-Visual Coincidental Effects: allocation into multiple tests should have visual but not logical co-incidental effects.


Train Schedule | Welcome Aboard!
Plan Your Trip Below
Current Train Schedule
Train Name
Destination
Frequency (min)
Next Arrival
Minutes Away
Add Train
Train Name
Destination
First Train Time (HH:mm - military time)
Frequency (min)
Submit


Install through npm
:
If you use SystemJS to load your files, you should adjust your configuration to point our UMD bundle through unpkg or your node_modules, similar to this:
You can also check on of our plunker examples for a working setup.
Each component has API documentation, examples, and a working demo. They can be found here.
Once installed you need to import our main module into your application module by calling NglModule.forRoot()
. You should end up with code similar to this:
Optionally, you can pass an object to the forRoot
method, to configure ng-lightning
during the initialization of the application, in order to provide your own default values.
For example:
Currently available options can be found here.
If you want to change some config properties during runtime, you can easily achieve it by utilizing the update
method like this:


Your browser is the worst.
+ Cone
+ Cylinder
+ Sphere
+ Light (Max 5)
Geometry Iterations:
Translate
Rotate
Scale
Material Ambient
Material Diffuse
Material Shininess
Material Specular
Light Ambient
Light Diffuse
Light Position
Light Specular


Filters are expensive and do not eliminate odors (unless they can filter out molecules). Suitable for people with asthma and allergies.
Ozone is a biocide (it kills the bacteria that generate the bad smell). Disinfects by oxidation, but also oxidizes everything that comes in contact with it (paint on the walls, cables ...). It does not act quickly, so it does not face unpleasant odors. When the concentrations and exposure time allowed by law are exceeded, it can be harmful to living beings (people, plants and animals). Suitable for environments with high bacterial activity and little human presence, such as garbage rooms.
Air fresheners, if they saturate the environment, disguise the bad smells (they do not eliminate them). If the aroma does not predominate, an unpleasant mixture is generated. The choice of the air freshener is made by the customer according to their aromatic preferences. Appropriate for olfactory marketing.
The tower with polymer is an economical and low maintenance system that acts on the effect (the bad smell), not on the cause. Therefore, it does not affect the room nor the living beings in it.
The neutralizing formulas are adapted to the type of bad smell. Therefore, the choice of the neutralizer is not chosen by the client but a decision of the expert, according to the type of bad smell to eliminate.
The aroma of the formulas is slightly citrus or floral, and in addition to reinforcing the neutralizing effect allows to "trace" its presence in the environment to know where it is being applied and what amount of product is being dosed. Remember: the objective is to remove the bad smell, not to make it smell good.


| I l@ve RuBoard |
18.6 Hand-Coded ParsersSince Python is a general purpose programming language, it's also reasonable to consider writing a hand-coded parser. For instance, recursive descent parsing is a fairly well-known technique for analyzing language-based information. Since Python is a very high-level language, writing the parser itself is usually easier than it would be in a traditional language like C or C++. To illustrate, this section develops a custom parser for a simple grammar: it parses and evaluates arithmetic expression strings. This example also demonstrates the utility of Python as a general-purpose programming language. Although Python is often used as a frontend or rapid development language, it's also useful for the kinds of things we'd normally write in a systems development language like C or C++. 18.6.1 The Expression GrammarThe grammar our parser will recognize can be described as follows: goal -> <expr> END [number, variable, ( ] goal -> <assign> END [set] assign -> 'set' <variable> <expr> [set] expr -> <factor> <expr-tail> [number, variable, ( ] expr-tail -> ^ [END, ) ] expr-tail -> '+' <factor> <expr-tail> [+] expr-tail -> '-' <factor> <expr-tail> [-] factor -> <term> <factor-tail> [number, variable, ( ] factor-tail -> ^ [+, -, END, ) ] factor-tail -> '*' <term> <factor-tail> [*] factor-tail -> '/' <term> <factor-tail> [/] term -> <number> [number] term -> <variable> [variable] term -> '(' <expr> ')' [(] tokens: (, ), num, var, -, +, /, *, set, end This is a fairly typical grammar for a simple expression language, and it allows for arbitrary expression nesting (some example expressions appear at the end of the testparser module listing in Example 18-11). Strings to be parsed are either an expression or an assignment to a variable name (set). Expressions involve numbers, variables, and the operators +, -, *, and /. Because factor is nested in expr in the grammar, * and / have higher precedence (i.e., bind tighter) than + and -. Expressions can be enclosed in parentheses to override precedence, and all operators are left associative -- that is, group on the left (e.g., 1-2-3 is treated the same as (1-2)-3). Tokens are just the most primitive components of the expression language. Each grammar rule earlier is followed in square brackets by a list of tokens used to select it. In recursive descent parsing, we determine the set of tokens that can possibly start a rule's substring, and use that information to predict which rule will work ahead of time. For rules that iterate (the -tail rules), we use the set of possibly following tokens to know when to stop. Typically, tokens are recognized by a string processor (a "scanner"), and a higher-level processor (a "parser") uses the token stream to predict and step through grammar rules and substrings. 18.6.2 The Parser's CodeThe system is structured as two modules, holding two classes:
The parser is also responsible for computing the expression's value and testing the system. In this version, the parser evaluates the expression while it is being parsed. To use the system, we create a parser with an input string and call its parse method. We can also call parse again later with a new expression string. There's a deliberate division of labor here. The scanner extracts tokens from the string, but knows nothing about the grammar. The parser handles the grammar, but is naive about the string itself. This modular structure keeps the code relatively simple. And it's another example of the OOP composition relationship at work: parsers embed and delegate to scanners. The module in Example 18-9 implements the lexical analysis task -- detecting the expression's basic tokens by scanning the text string left to right on demand. Notice that this is all straightforward logic here; such analysis can sometimes be performed with regular expressions instead (described earlier), but the pattern needed to detect and extract tokens in this example would be too complex and fragile for my tastes. If your tastes vary, try recoding this module with re. Example 18-9. PP2E\Lang\Parser\scanner.py#################################################### # the scanner (lexical analyser) #################################################### import string SyntaxError = 'SyntaxError' # local errors LexicalError = 'LexicalError' class Scanner: def __init__(self, text): self.next = 0 self.text = text + '\0' def newtext(self, text): Scanner.__init__(self, text) def showerror(self): print '=> ', self.text print '=> ', (' ' * self.start) + '^' def match(self, token): if self.token != token: raise SyntaxError, [token] else: value = self.value if self.token != '\0': self.scan( ) # next token/value return value # return prior value def scan(self): self.value = None ix = self.next while self.text[ix] in string.whitespace: ix = ix+1 self.start = ix if self.text[ix] in ['(', ')', '-', '+', '/', '*', '\0']: self.token = self.text[ix] ix = ix+1 elif self.text[ix] in string.digits: str = '' while self.text[ix] in string.digits: str = str + self.text[ix] ix = ix+1 if self.text[ix] == '.': str = str + '.' ix = ix+1 while self.text[ix] in string.digits: str = str + self.text[ix] ix = ix+1 self.token = 'num' self.value = string.atof(str) else: self.token = 'num' self.value = string.atol(str) elif self.text[ix] in string.letters: str = '' while self.text[ix] in (string.digits + string.letters): str = str + self.text[ix] ix = ix+1 if string.lower(str) == 'set': self.token = 'set' else: self.token = 'var' self.value = str else: raise LexicalError self.next = ix The parser module's class creates and embeds a scanner for its lexical chores, and handles interpretation of the expression grammar's rules and evaluation of the expression's result, as shown in Example 18-10. Example 18-10. PP2E\Lang\Parser\parser1.py######################################################## # the parser (syntax analyser, evaluates during parse) ######################################################## UndefinedError = 'UndefinedError' from scanner import Scanner, LexicalError, SyntaxError class Parser: def __init__(self, text=''): self.lex = Scanner(text) # embed a scanner self.vars = {'pi':3.14159} # add a variable def parse(self, *text): if text: # main entry-point self.lex.newtext(text[0]) # reuse this parser? try: self.lex.scan( ) # get first token self.Goal( ) # parse a sentence except SyntaxError: print 'Syntax Error at column:', self.lex.start self.lex.showerror( ) except LexicalError: print 'Lexical Error at column:', self.lex.start self.lex.showerror( ) except UndefinedError, name: print "'%s' is undefined at column:" % name, self.lex.start self.lex.showerror( ) def Goal(self): if self.lex.token in ['num', 'var', '(']: val = self.Expr( ) self.lex.match('\0') # expression? print val elif self.lex.token == 'set': # set command? self.Assign( ) self.lex.match('\0') else: raise SyntaxError def Assign(self): self.lex.match('set') var = self.lex.match('var') val = self.Expr( ) self.vars[var] = val # assign name in dict def Expr(self): left = self.Factor( ) while 1: if self.lex.token in ['\0', ')']: return left elif self.lex.token == '+': self.lex.scan( ) left = left + self.Factor( ) elif self.lex.token == '-': self.lex.scan( ) left = left - self.Factor( ) else: raise SyntaxError def Factor(self): left = self.Term( ) while 1: if self.lex.token in ['+', '-', '\0', ')']: return left elif self.lex.token == '*': self.lex.scan( ) left = left * self.Term( ) elif self.lex.token == '/': self.lex.scan( ) left = left / self.Term( ) else: raise SyntaxError def Term(self): if self.lex.token == 'num': val = self.lex.match('num') # numbers return val elif self.lex.token == 'var': if self.vars.has_key(self.lex.value): val = self.vars[self.lex.value] # lookup name's value self.lex.scan( ) return val else: raise UndefinedError, self.lex.value elif self.lex.token == '(': self.lex.scan( ) val = self.Expr( ) # sub-expression self.lex.match(')') return val else: raise SyntaxError if __name__ == '__main__': import testparser # self-test code testparser.test(Parser, 'parser1') # test local Parser If you study this code closely, you'll notice that the parser keeps a dictionary (self.vars) to manage variable names: they're stored in the dictionary on a set command and fetched from it when they appear in an expression. Tokens are represented as strings, with an optional associated value (a numeric value for numbers and a string for variable names). The parser uses iteration (while loops) instead of recursion, for the expr-tail and factor-tail rules. Other than this optimization, the rules of the grammar map directly onto parser methods: tokens become calls to the scanner, and nested rule references become calls to other methods. When file parser1.py is run as a top-level program, its self-test code is executed, which in turn simply runs a canned test in the module shown in Example 18-11. Note that all integer math uses Python long integers (unlimited precision integers), because the scanner converts numbers to strings with string.atol. Also notice that mixed integer/floating-point operations cast up to floating point since Python operators are used to do the actual calculations. Example 18-11. PP2E\Lang\Parser\testparser.py#################################################### # parser test code #################################################### def test(ParserClass, msg): print msg, ParserClass x = ParserClass('4 / 2 + 3') # allow different Parser's x.parse( ) x.parse('3 + 4 / 2') # like eval('3 + 4 / 2')... x.parse('(3 + 4) / 2') x.parse('4 / (2 + 3)') x.parse('4.0 / (2 + 3)') x.parse('4 / (2.0 + 3)') x.parse('4.0 / 2 * 3') x.parse('(4.0 / 2) * 3') x.parse('4.0 / (2 * 3)') x.parse('(((3))) + 1') y = ParserClass( ) y.parse('set a 4 / 2 + 1') y.parse('a * 3') y.parse('set b 12 / a') y.parse('b') z = ParserClass( ) z.parse('set a 99') z.parse('set a a + 1') z.parse('a') z = ParserClass( ) z.parse('pi') z.parse('2 * pi') z.parse('1.234 + 2.1') def interact(ParserClass): # command-line entry print ParserClass x = ParserClass( ) while 1: cmd = raw_input('Enter=> ') if cmd == 'stop': break x.parse(cmd) Correlate the following results to print statements in the self-test module: C:\...\PP2E\Lang\Parser>python parser1.py parser1 __main__.Parser 5L 5L 3L 0L 0.8 0.8 6.0 6.0 0.666666666667 4L 9L 4L 100L 3.14159 6.28318 3.334 As usual, we can also test and use the system interactively: % python >>> import parser1 >>> x = parser1.Parser( ) >>> x.parse('1 + 2') 3L Error cases are trapped and reported: >>> x.parse('1 + a') 'a' is undefined at column: 4 => 1 + a => ^ >>> x.parse('1+a+2') 'a' is undefined at column: 2 => 1+a+2 => ^ >>> x.parse('1 * 2 $') Lexical Error at column: 6 => 1 * 2 $ => ^ >>> x.parse('1 * - 1') Syntax Error at column: 4 => 1 * - 1 => ^ >>> x.parse('1 * (9') Syntax Error at column: 6 => 1 * (9 => ^ Pathologically big numbers are handled well, because Python's built-in objects and operators are used along the way: >>> x.parse('888888888888888888888888888888888888888888888.9999999') 8.88888888889e+44 >>> x.parse('99999999999999999999999999999999999999999 + 2')<PHONE_NUMBER>00000000000000000000000000000001L >>> x.parse('999999999999999999999999999999.88888888888 + 1.1') 1e+30 In addition, there is an interactive loop interface in the testparser module, if you want to use the parser as a simple command-line calculator (or if you get tired of typing parser method calls). Pass the Parser class, so testparser can make one of its own: >>> import testparser >>> testparser.interact(parser1.Parser) Enter=> 4 * 3 + 5 17L Enter=> 5 + 4 * 3 17L Enter=> (5 + 4) * 3 27L Enter=> set a 99 Enter=> set b 66 Enter=> a + b 165L Enter=> # + 1 Lexical Error at column: 0 => # + 1 => ^ Enter=> a * b + c 'c' is undefined at column: 8 => a * b + c => ^ Enter=> a * b * + c Syntax Error at column: 8 => a * b * + c => ^ Enter=> a 99L Enter=> a * a * a 970299L Enter=> stop >>>
18.6.3 Adding a Parse Tree InterpreterOne weakness in the parser1 program is that it embeds expression evaluation logic in the parsing logic: the result is computed while the string is being parsed. This makes evaluation quick, but it can also make it difficult to modify the code, especially in larger systems. To simplify, we could restructure the program to keep expression parsing and evaluation separate. Instead of evaluating the string, the parser can build up an intermediate representation of it that can be evaluated later. As an added incentive, building the representation separately makes it available to other analysis tools (e.g., optimizers, viewers, and so on). Example 18-12 shows a variant of parser1 that implements this idea. The parser analyzes the string and builds up a parse tree -- that is, a tree of class instances that represents the expression and that may be evaluated in a separate step. The parse tree is built from classes that "know" how to evaluate themselves: to compute the expression, we just ask the tree to evaluate itself. Root nodes in the tree ask their children to evaluate themselves and then combine the results by applying a single operator. In effect, evaluation in this version is simply a recursive traversal of a tree of embedded class instances constructed by the parser. Example 18-12. PP2E\Lang\Parser\parser2.pyTraceDefault = 0 UndefinedError = "UndefinedError" from scanner import Scanner, SyntaxError, LexicalError #################################################### # the interpreter (a smart objects tree) #################################################### class TreeNode: def validate(self, dict): # default error check pass def apply(self, dict): # default evaluator pass def trace(self, level): # default unparser print '.'*level + '<empty>' # ROOTS class BinaryNode(TreeNode): def __init__(self, left, right): # inherited methods self.left, self.right = left, right # left/right branches def validate(self, dict): self.left.validate(dict) # recurse down branches self.right.validate(dict) def trace(self, level): print '.'*level + '[' + self.label + ']' self.left.trace(level+3) self.right.trace(level+3) class TimesNode(BinaryNode): label = '*' def apply(self, dict): return self.left.apply(dict) * self.right.apply(dict) class DivideNode(BinaryNode): label = '/' def apply(self, dict): return self.left.apply(dict) / self.right.apply(dict) class PlusNode(BinaryNode): label = '+' def apply(self, dict): return self.left.apply(dict) + self.right.apply(dict) class MinusNode(BinaryNode): label = '-' def apply(self, dict): return self.left.apply(dict) - self.right.apply(dict) # LEAVES class NumNode(TreeNode): def __init__(self, num): self.num = num # already numeric def apply(self, dict): # use default validate return self.num def trace(self, level): print '.'*level + `self.num` class VarNode(TreeNode): def __init__(self, text, start): self.name = text # variable name self.column = start # column for errors def validate(self, dict): if not dict.has_key(self.name): raise UndefinedError, (self.name, self.column) def apply(self, dict): return dict[self.name] # validate before apply def assign(self, value, dict): dict[self.name] = value # local extension def trace(self, level): print '.'*level + self.name # COMPOSITES class AssignNode(TreeNode): def __init__(self, var, val): self.var, self.val = var, val def validate(self, dict): self.val.validate(dict) # don't validate var def apply(self, dict): self.var.assign( self.val.apply(dict), dict ) def trace(self, level): print '.'*level + 'set ' self.var.trace(level + 3) self.val.trace(level + 3) #################################################### # the parser (syntax analyser, tree builder) #################################################### class Parser: def __init__(self, text=''): self.lex = Scanner(text) # make a scanner self.vars = {'pi':3.14159} # add constants self.traceme = TraceDefault def parse(self, *text): # external interface if text: self.lex.newtext(text[0]) # reuse with new text tree = self.analyse( ) # parse string if tree: if self.traceme: # dump parse-tree? print; tree.trace(0) if self.errorCheck(tree): # check names self.interpret(tree) # evaluate tree def analyse(self): try: self.lex.scan( ) # get first token return self.Goal( ) # build a parse-tree except SyntaxError: print 'Syntax Error at column:', self.lex.start self.lex.showerror( ) except LexicalError: print 'Lexical Error at column:', self.lex.start self.lex.showerror( ) def errorCheck(self, tree): try: tree.validate(self.vars) # error checker return 'ok' except UndefinedError, varinfo: print "'%s' is undefined at column: %d" % varinfo self.lex.start = varinfo[1] self.lex.showerror( ) # returns None def interpret(self, tree): result = tree.apply(self.vars) # tree evals itself if result != None: # ignore 'set' result print result def Goal(self): if self.lex.token in ['num', 'var', '(']: tree = self.Expr( ) self.lex.match('\0') return tree elif self.lex.token == 'set': tree = self.Assign( ) self.lex.match('\0') return tree else: raise SyntaxError def Assign(self): self.lex.match('set') vartree = VarNode(self.lex.value, self.lex.start) self.lex.match('var') valtree = self.Expr( ) return AssignNode(vartree, valtree) # two subtrees def Expr(self): left = self.Factor( ) # left subtree while 1: if self.lex.token in ['\0', ')']: return left elif self.lex.token == '+': self.lex.scan( ) left = PlusNode(left, self.Factor( )) # add root-node elif self.lex.token == '-': self.lex.scan( ) left = MinusNode(left, self.Factor( )) # grows up/right else: raise SyntaxError def Factor(self): left = self.Term( ) while 1: if self.lex.token in ['+', '-', '\0', ')']: return left elif self.lex.token == '*': self.lex.scan( ) left = TimesNode(left, self.Term( )) elif self.lex.token == '/': self.lex.scan( ) left = DivideNode(left, self.Term( )) else: raise SyntaxError def Term(self): if self.lex.token == 'num': leaf = NumNode(self.lex.match('num')) return leaf elif self.lex.token == 'var': leaf = VarNode(self.lex.value, self.lex.start) self.lex.scan( ) return leaf elif self.lex.token == '(': self.lex.scan( ) tree = self.Expr( ) self.lex.match(')') return tree else: raise SyntaxError #################################################### # self-test code: use my parser, parser1's tester #################################################### if __name__ == '__main__': import testparser testparser.test(Parser, 'parser2') # run with Parser class here When parser2 is run as a top-level program, we get the same test code output as for parser1. In fact, it reuses the same test code: both parsers pass in their parser class object to testparser.test. And since classes are objects, we can also pass this version of the parser to testparser's interactive loop: testparser.interact(parser2.Parser). The new parser's external behavior is identical to that of the original. Notice that the new parser reuses the same scanner module, too. To catch errors raised by scanner, it also imports the specific strings that identify the scanner's exceptions. The scanner and parser can both raise exceptions on errors (lexical errors, syntax errors, and undefined name errors). They're caught at the top level of the parser, and end the current parse. There's no need to set and check status flags to terminate the recursion. Since math is done using long integers, floating-point numbers, and Python's operators, there's usually no need to trap numeric overflow or underflow errors. But as is, the parser doesn't handle errors like division by zero: they make the parser system exit with a Python stack dump. Uncovering the cause and fix for this is left as an exercise. 18.6.4 Parse Tree StructureThe intermediate representation of an expression is a tree of class instances, whose shape reflects the order of operator evaluation. This parser also has logic to print an indented listing of the constructed parse tree if the traceme attribute is set. Indentation gives the nesting of subtrees, and binary operators list left subtrees first. For example: % python >>> import parser2 >>> p = parser2.Parser( ) >>> p.traceme = 1 >>> p.parse('5 + 4 * 2') [+] ...5L ...[*] ......4L ......2L 13L When this tree is evaluated, the apply method recursively evaluates subtrees and applies root operators to their results. Here, * is evaluated before +, since it's lower in the tree. The Factor method consumes the * substring before returning a right subtree to Expr: >>> p.parse('5 * 4 - 2') [-] ...[*] ......5L ......4L ...2L 18L In this example, * is evaluated before -. The Factor method loops though a substring of * and / expressions before returning the resulting left subtree to Expr: >>> p.parse('1 + 3 * (2 * 3 + 4)') [+] ...1L ...[*] ......3L ......[+] .........[*] ............2L ............3L .........4L 31L Trees are made of nested class instances. From an OOP perspective, it's another way to use composition. Since tree nodes are just class instances, this tree could be created and evaluated manually, too: PlusNode( NumNode(1), TimesNode( NumNode(3), PlusNode( TimesNode(NumNode(2), NumNode(3)), NumNode(4) ))).apply({}) But we might as well let the parser build it for us (Python is not that much like Lisp, despite what you may have heard). 18.6.5 Exploring Parse Trees with PytreeBut wait -- there is a better way to explore parse tree structures. Figure 18-1 shows the parse tree generated for string "1 + 3 * (2 * 3 + 4)", displayed in PyTree, the tree visualization GUI presented at the end of the previous chapter. This only works because the parser2 module builds the parse tree explicitly (parser1 evaluates during a parse instead), and because PyTree's code is generic and reusable. Figure 18-1. Parse tree built for 1 + 3 * (2 * 3 + 4)If you read the last chapter, you'll recall that PyTree can draw most any tree data structure, but it is preconfigured to handle binary search trees and the parse trees we're studying in this chapter. You might also remember that clicking on nodes in a displayed parse tree evaluates the subtree rooted there. Figure 18-2 shows the pop-up generated after clicking the tree's root node (you get different results if you click other parts of tree, because smaller subtrees are evaluated). Figure 18-2. Clicking the root node to evaluate a treePyTree makes it easy to learn about and experiment with the parser. To determine the tree shape produced for a given expression, start PyTree, click on its Parser radiobutton, type the expression in the input field at the bottom, and press "input" (or your Enter key). The parser class is run to generate a tree from your input, and the GUI displays the result. For instance, Figure 18-3 sketches the parse tree generated if we remove the parentheses from the first expression in the input field. The root node evaluates to 23 this time, due to the different shape's evaluation order. Figure 18-3. Parse tree for 1 + 3 * 2 * 3 + 4, result=23To generate an even more different shape, try introducing more parentheses to the expression and hitting the Enter key again. Figure 18-4 shows a much flatter tree structure produced by adding a few parentheses to override operator precedence. Because these parentheses change the tree shape, they also change the expression's overall result again. Figure 18-5 shows the result pop-up after clicking the root node in this display. Figure 18-4. Parse tree built for "(1 + 3) * (2 * ( 3 + 4))"Figure 18-5. Clicking and evaluating the root nodeDepending upon the operators used within an expression, some very differently shaped trees yield the same result when evaluated. For instance, Figure 18-6 shows a more left-heavy tree generated from a different expression string that evaluates to 56 nevertheless. Figure 18-6. Parse tree for "(1 + 3) * 2 * ( 3 + 4)", result=56Finally, Figure 18-7 shows a parsed assignment statement; clicking the "set" root assigns variable spam, and clicking node spam then evaluates to -4. If you find the parser puzzling, try running PyTree like this on your computer to get a better feel for the parsing process. (I'd like to show more example trees, but I ran out of page real estate at this point in the book.) Figure 18-7. Assignment, left-grouping: "set spam 1 - 2 - 3"18.6.6 Parsers Versus PythonThe hand-coded parser programs shown earlier illustrate some interesting concepts and underscore the power of Python for general-purpose programming. Depending on your job description, they may also be typical of the sort of thing you'd write regularly in a traditional language like C. Parsers are an important component in a wide variety of applications, but in some cases, they're not as necessary as you might think. Let me explain why. So far, we started with an expression parser and added a parse tree interpreter to make the code easier to modify. As is, the parser works, but it may be slow compared to a C implementation. If the parser is used frequently, we could speed it up by moving parts to C extension modules. For instance, the scanner might be moved to C initially, since it's often called from the parser. Ultimately, we might add components to the grammar that allow expressions to access application-specific variables and functions. All of the these steps constitute good engineering. But depending on your application, this approach may not be the best one in Python. The easiest way to evaluate input expressions in Python is often to let Python do it, by calling the eval built-in function. In fact, we can usually replace the entire expression evaluation program with one function call. The next example will demonstrate how this is done. More importantly, the next section underscores a core idea behind the language: if you already have an extensible, embeddable, high-level language system, why invent another? Python itself can often satisfy language-based component needs. |
| I l@ve RuBoard |


Java Low Level REST Clientedit
The low-level client’s features include:
- minimal dependencies
- load balancing across all available nodes
- failover in case of node failures and upon specific response codes
- failed connection penalization (whether a failed node is retried depends on how many consecutive times it failed; the more failed attempts the longer the client will wait before trying that same node again)
- persistent connections
- trace logging of requests and responses
- optional automatic discovery of cluster nodes


Meet the team!
Aaron Soler
Jason Gromaski
Patrick Relogle
Stephanie Butenhof
Sam Hall
Team Leader
Backend Developer
Frontend Developer
Marketing/About Designer


- get(AppSettingsStorage.Setting, int) - Method in class business.AppSettingsStorage
-
Gets setting that is type of int
- get(AppSettingsStorage.Setting, float) - Method in class business.AppSettingsStorage
-
Gets setting that is type of float
- get(AppSettingsStorage.Setting, boolean) - Method in class business.AppSettingsStorage
-
Gets setting that is type of boolean
- get(AppSettingsStorage.Setting, long) - Method in class business.AppSettingsStorage
-
Gets setting that is type of long
- get(AppSettingsStorage.Setting, String) - Method in class business.AppSettingsStorage
-
Gets setting that is type of String
- get(AppSettingsStorage.Setting, Set<String>) - Method in class business.AppSettingsStorage
-
Gets setting that is type of String set
- get(long) - Method in class business.MedicationStorage
-
Gets medication from the database
- getAll() - Method in class business.MedicationStorage
-
Gets all medication from database
- getAll(Calendar) - Method in class business.MedicationStorage
-
Gets medications that should be taken at specific day
- getAppContext() - Static method in class com.example.medsmemory.Application
-
returns Application context
- getDate() - Method in class business.WeekDay
-
- getDose() - Method in class business.Medication
-
- getEnd() - Method in class business.Medication
-
- getId() - Method in class business.Medication
-
- getInstance() - Static method in class business.AppSettingsStorage
-
Creates AppSettingsStorage if it doesn't exist and returns it.
- getInstance() - Static method in class business.MedicationStorage
-
Creates MedicationStorage if it doesn't exist.
- getInstance() - Static method in class business.RemindAlarm
-
Gets RemindAlarm singleton
- getItemCount() - Method in class business.adapters.DaysMedicationListAdapter
-
Gets size of the data
- getItemCount() - Method in class business.adapters.MedicationListAdapter
-
Gets size of the data
- getItemCount() - Method in class business.adapters.WeekListAdapter
-
Gets size of the data
- getMedications() - Method in class business.WeekDay
-
- getName() - Method in class business.Medication
-
- getNotes() - Method in class business.Medication
-
- getStart() - Method in class business.Medication
-
- getTakeDayInterval() - Method in class business.Medication
-
- getTakeInterval() - Method in class business.Medication
-


Ohio lawmakers propose jailing women who get abortions
by Christopher VondracekTwo Ohio Republican lawmakers have introduced legislation that would ban abortion and require women who undergo the procedure to be imprisoned.
“The time for regulating evil and compromise is over,” said state Rep. Candice Keller, who last week introduced the bill with state Rep. Ron Hood.
The bill, which has 19 cosponsors in the state House, was referred Monday to the Criminal Justice Committee.
No companion legislation has been submitted in the state Senate.

Earlier this year, Ohio Gov. Mike DeWine, a Republican, signed a bill that bans abortions after detection of fetal heartbeat. A federal judge blocked that law from taking effect in July.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC. Click here for reprint permission.
Please read our comment policy before commenting.


Questions involving mathematics or equations can be written using mathjax (which will make the equations look fancy). To indicate an equation, type the equation between backticks (` `). For exponents or superscripts, use ^, for subscripts use _. Set off denominators with parentheses. For example, `a^2 + b^2 = c^2` will show up as \[a^2 + b^2 = c^2\].
Lists: You can make lists by starting the list with [LIST] and ending with [/LIST]. Each separate item in the list should start with [*] and end with [/*] (including the brackets).
Subscript and Superscript: Subscript can be done either with mathjax (above) or by surrounding the subscript with underscores (_). Superscripts are the same, but use carets (^). None of these marks will show up in the assignments--the text will be properly typeset.
| # | Title | Type |
|---|


---
layout: post
title: Stuff learned today - Ruby and Rails
date: 2010-12-09 09:50:00.000000000 +11:00
comments: true
categories:
- ruby
- development
- ruby-on-rails
---
- Ruby ignores underscores in numbers, so you can write 53782156 as 53_782_156 which is much nicer.
- Suggested localisation for Formtastic's collections. Not sure whether it is important as it is still pretty easy to workaround.
- To use all the ActiveSupport (v3), do require 'active_support/all' (note the underscore!).
- We can add methods to associations by opening a block and (but scopes are much cleaner on the other end of association class).
- Testing "access denied" and "requires user" is easier with custom matchers.
- Rails URL helpers are not available in custom matchers for some reason.
- Shoulda's RSpec matcher validates_presence_of does not work with non-persistent models.
- Rails params hash has string keys, not symbols. Got issues with it when relying on keys being symbols.


Motivated, personable Software Developer who loves to learn and creatively solve problems.
Seattle, WA.
Github
Blog


I love travelling, discovering new countries and cultures. In my free time I often play Texas hold 'em with my friends. I am a very social person but i also love to just be alone, reading books or watching good movies. I always enjoy learning new things and my new hobby is learning to code.


Home
Cached
Github
About
2019 on Twitter
Find a handle's 2019 on Twitter
See the sample report for
@Casey
here
Enter the Twitter handle (twitter.com/handle)


The Apache OLTU Authorization Server allows you to authenticate against any possible backend of your choice for your Resource Server.


Great Pizza
Address
Ngong Lane Plaza on Ngong lane
Nairobi
Business Hours
Monday-Friday: 9am-3pm
Saturday-Sunday: 5pm-12am
Contact us
+254 711 581 484
Ngong Lane Plaza on Ngong lane
Nairobi
Monday-Friday: 9am-3pm
Saturday-Sunday: 5pm-12am
+254 711 581 484


leaving academia
I’ve been through a couple serious breakups in the past few years, and I remember there was a period of time before the actual break where I knew I was unhappy, but was trying to figure out if there was a way to fix it. Then there was this moment of clarity where I realized that I’d been denying that a good thing had come to an end.
This year’s rejections worked like that. I’m nearly eight years post-phd, and very familiar with that feeling of checking the rumor mill and finding myself unsucessful in getting a faculty slot. This time, my postdoc contract also ends in the fall, leaving me in academic limbo. There are worse things, and many a scientist in this situation has gotten some grant or moved for a third postdoc and eventually found the right position. But I am unwilling to fight to stay.
Astronomy used to excite me. Not just at specific moments, but overall. I felt a fascination and absorption in the great task of figuring out what is going on in our universe. I relished the whole process of research and kept getting carried away by some new idea that I didn’t mean to spend the afternoon exploring. I loved the process of writing, looked forward to giving talks, and felt so at home in the research community.
Because one highlight has been the people I’ve met. Such strong, fascinating, brilliant people in our field. When I went to my first conferences 14 years ago, I had no idea how many friends and collaborators and role models I could find within astronomy. And the marvelous things you all would be accomplishing.
But there’s been a dark side too. I used too much alcohol to cope while in grad school.  At times I have felt very isolated, demoralized, and marginalized. I’ve witnessed more sexism, racism, and ablism than I would have imagined and some of it from people who have disappointed me greatly.
I’m currently making my best efforts to deal with depression, anxiety, and insomnia. None of these were created by academia, but they weren’t improved by it. My approach to treatment has included some medication, but more important are using therapy to learn to deal with my feelings and re-structuring my life for better mental health.
To make the structural changes that are right for me, I’m tuning in to what makes me happy and excited, when I feel productive and strong. That used to be my work, but lately I’ve been carried away with my balcony garden, with re-organizing my appartment, with learning to bake really good bread. Intellectually, I’m most fascinaed by the links between capitalism, the patriarchy, and mental health and trying to learn more about both difference feminism and intersectionality. In my non-work time, I’ve been working with a group of women to understand methods for collective non-heirarchical leadership.
And I’m burned out. I’ve found academia generally to be a high pressure, low support (not zero support, but not structurally supportive) environment. I’ve done my best to make it less so for myself, my collaborators, and my students, but I think it’s a structural inevitability and I’m exhausted by it. I’m not sure what’s coming after my end of contract in September (beyond staying in Berlin, learning more German, and taking some time to think) but I know a little bit more about what I don’t want.
I’m going to do my best to document my next moves a bit, through some combo of twitter and this blog. Stay tuned for more soul searching, job searching, and probably some anti-capitalist rants.


Home
Pranks
Amazon Prank
Pizza Delivery Prank
Fantasy Sports Prank
Doctor Appointment Prank
About Us
Login
Pizza Delivery Prank
Please complete the form below to create your prank message.
Name of person receiving prank:
Email address of person receiving prank:
Choose a pizza size...
Small
Medium
Large
X-Large
Type of Pizza:
Number of Pizzas:
Address:
City:
State:
Zip:
Delivery note:


TCP expression Fig protein Arabidopsis flowering binding class transcription using promoter FBH plants analysis tcp Plant gi- used proteins represent results lines transcriptional indicated Fig). leaf CONSTANS TCP, TCP-FH gene means patterns CIN-TCPs Data site SEM photoperiodic YFP differences function time data factors asterisks mutant plant Significant levels shown {border-style Cell. Kim genes identified induction additional analyzed px;} #ffffff;} CIN-TCP DNA generate grown leaves regulation reporter background control fused regulate shown. vector LD. Results activity buffer fbh mutants observed sites tcp- Biology Click GUS Gene LINK activate activators benthamiana complex file. interacts p<.). GIGANTEA Sciences Table addition, factor following harvested higher interactions performed previously yeast Kay Science. described functional generated interaction order p<., primers transferred values (C) ./science. BiFC Biol. Flowering Life TCPs binary circadian development directly family indicate light multiple mutation pathway profiles reduced regulates sequences showed (B) (EPS) CO, TCP: activates amplified assay cloned coding dusk expressed floral induce mass phenotype physically qPCR region role sequence similar (A) (Figs (Life ./tpc.. Imaizumi Investigation Mol National acid assays containing day indicating involved miR nuclear number overexpression regions regulators signals strains suggest t-test, (D) ATG Analysis CDF ChIP FLOWERING Lee Luc PCR Physiol. TCP. Table). activation afternoon antibody bind chromatin clock constructs control. days demonstrated different effect fbh- full-length genetic http://dx.doi.org/./ important independent known mTCP-FH manner negative pENTR/D-TOPO peptides promoter. purification px; residues respectively. thaliana timing {font-family ./pnas. Acad CO. DNA-binding FBHs GI. GST Institute Natl Proc Research SPL Sci Song Student’s TAP-MS Total Tris-HCl [], affects analysis. biological cDNA cell cells did difference direct domain environmental especially followed font-size homologs induced information length mTCP main mainly mutated one-hybrid onset phenotypes promoter, regulation. sample significant single tcp-Q test). vivo. (HSD (Student’s ./pp.. Arabidopsis. Complete Coupland FBH, Funding GI, GI-dependent HB-RFP LOCUS Medical Nat Nature. Triton X-, acquisition affected affinity average based bolted. cauline conditions counted developmental double; enhance enhanced epidermal form growth half http://orcid.org/--- interacting largely located maturation min mutations partially regulating representative response rosette salt sec significantly specific stability stem transcription. two-hybrid work yeast. °C, (A), (E) America Approximately Breton Cell Department Dr. FKF General Liu MS/MS Methods Molecular N-terminal Nath PMSF, SUC: Scale Science States United University WT, Writing ZEITLUPE ability activities amino amplicons analyses analysis, backgrounds bar, beads border-color border-width caused cells. changes clonase completely conditions. confirmed controlled daily day. derived double extracted group harboring images including induces inhibitor interact investigate luciferase measurement mechanism members novel n≥). obtained pCO positive potential protease protein-protein repressor roles seasonal set signal signaling significance solid; spectrometry staining technologies). times tolerance transgenic value vectors {font-style {font-weight °C. (A, (GST (H) (Thermo (XLSX) (h) -bp ./j.-X...x A). ANTIGEN Bars C). C-terminal CELL CIN-TCPs, Coen Col- Cubas Curr Dunnett’s EDTA, F-box FACTOR Fig), Fisher HRP-conjugated However, Images Inhibitor LD, LacZ MG-, MacCoss Michael NUCLEAR NaCl, NaF, PROLIFERATING Park Pruneda-Paz RFP Sci. Sciences, Shim Steve Supervision Thaliana Trends Washington, act activators, affect amplicon amplify associated bold clear cocktail components composition contains courier; critical crucial degradation detected determined development. drought effector em; essential firefly flowering. formation forms functions fusion heterodimers highly identical imply incubated indirectly late library likely localized major manufacturer mechanisms modifications mut mutant. mutants. normalized nuclei nucleus numbers original phloem phosphorylation photoperiod plasmid play plays possibility, presence previous promote provided pt;} redundant redundantly relative reproductive requires seedlings senescence septuple shoot solution speckles statistical suggested suggesting t-test). tandem target tcp-, test tested tissue total transformed transient type unknown upstream wild wild-type μm.


This is a demo with panel table
with bootstrap
Learn More About Our Company
Dandelions are more than our business, they are our passion!
Contact Information
Firstname
Lastname
Bill
Gates
Steven
Jobs


| DOSE: T+ 0:00 |
8 ml |
oral |
2C-P |
(powder / crystals) |
| T+ 2:00 |
1 hit |
smoked |
Products - Smoking Blends - Cannabis-Like |
|
| T+ 8:00 |
1 tablet |
oral |
Pharms - Trazodone |
|
I've been holding onto a small sample of 2CP for a little while now. I don't know why I didn't try it earlier, maybe I was a little apprehensive. I've tried 2cb, 2ce, 2ci, of the 2cx family, and I'm plenty experienced with acid and psilocybin mushrooms. Yesterday afternoon, I threw some powder on the scale. Powder alone flickered between 7-8mg, in a weighing tray it was a solid 8mg, and in a capsule it flickered 8-9mg. I also weighed out some M1 for a friend that I promised it to. Off to his house we went.
I ate a fairly heavy dinner at 5:30, pasta, cole slaw, buttered bread. Right before 8pm, my friend swallowed the cap of M1, and a few mins later, I swallowed the 2cp. I knew he would be coming down as I was coming up. I don't mind being the only one tripping. It was just the 2 of us.
8pm)-Swallowed the cap, my heart is beating a little faster, probably in excitement. We started watching a movie called Driftwood.
9pm)-I suddenly have stomach cramps, nothing terrible, and pretty easily ignored. At this point I consider myself sober, although I can feel, and see through my vision, that my pupils are definitely dilated. My friend is enjoying the m1, he claims his tongue feels bigger lol, looks normal to me.
9:30pm)-I agree to go downstairs to the kitchen for a bite to eat, even though I am not hungry. I glance in the mirror, and my pupils are as big as they get, but still not much other than an anxious feeling. Lights definitely seems to take on a bluish hue. He lives with his parents, and in the kitchen is a full table of his relatives+1 wierdo. I can't stop thinking how odd it was for his 50+yr old aunt, to be dating someone our age (late twenties, early thirties). This guy is weird too. As I shovel the small amount of food, trying to get it down as fast as I can, I nearly choke holding my laughter back. This guy was talking about giving their neighbor black eyes, because he called the township to say their wheelchair ramp, for his girlfriend/my friend's aunts disabled child, is an eyesore to look at. I nod and agree, and I slowly back out of the kitchen and retreat back upstairs.
10pm)-I'm definitely feeling something now, that dose of reality turned it on. I took a good hit of a strong jwh-210 blend, and choose the Movie Jesus' Son to watch. I figured it was a comedy because Jack Black was on the cover. Boy was I wrong. It's weird, weird drama about a loser/heroin addict, and his path to happiness. Being an ex-junkie, this movie struck a chord in me. I could not stop comparing my life to this character's.
11pm)-Comming on strong now, visuals very prominent. I look at the popcorn ceiling, and the shadows are amazing. If I stare it long enough, everthing but the swirling shadows disappears. It is giving me visuals, that are very layered/superimposed, some of the best I've seen in awhile. CEV's are nothing but geometric/fractal shapes swirling and bulging. I'm thinking to myself, when the hell will this weird movie end. The main protagonist of the movie gets back with his then clean gf, sneaks out to get high, and when he awakes in the morning, she is dead from an overdose with a note that says 'wake me if you still want me'. Very sad to me.
11:45)-Finally that depressing/weird movie is over, I ask my friend to take me home. As I step outside, the world is glowing. The stars get bigger then smaller, and the clouds move, as if blanketing the dark sky. I smell the earth, and for a second get lost in my senses. On the way home, as we are coming up a small hill, and the approaching cars headlight crest the hill, it gives the most beautiful blue aura, and for a second I don't even recognize my familiar surroundings.
12am)-I arrive home. I had a little trouble getting the key in the door, but it wasn't too difficult. I'm still coming up. The framed horror movie posters in my bedroom were alive, they were every bit 3d as you and me. The trails are very prominent. If I move my hand through my feild of vision, it's seems to take seconds before the trails go away. I turn on my comp, go to Wikipedia and start reading.
12:30am)-I start reading about Rosicrucian myth. The words on the screen are crisp, but I can alter this almost at will. The letters and the spacing, creates complex geometric shapes. It's hot in my room, I turn on a fan. This fan makes the posters swing and lift off the wall. They are alive, the Return of the living dead 2 poster is the most incredible thing I'm seeing, it;s swirling and the lightning in the backround is flashing (google the poster).
1am-4am)-I've reached the plateau. Threads of white light shimmer off of everything with a glare or shine. I'm relatively clearheaded, but the layering effect I spoke of earlier is just crazy. It seems I can look at things from 3 or 4 angles, from the same vantage point, or mesh them all together and get an incredible 3d view. I am reading on about philosophies of the Buddha, and Buddhist art. Indian art is a favorite of mine. Music is incredible, my guitar cries for me to play it, but its too late and people are sleeping. I admire pictures of beautiful architecture that I will never see, but I close my eyes and I am there. It is approaching 4am, and I have a creeping headache in the back of my head. A 4am when I am still tripping hard, visuals are very promiment still, I pop a trazodone pill (not sure of the mg at the moment).
4:30am)-All visuals are now completely gone, I would say my trip is 95% gone. I wondered about trazodone being a trip killer, and it certainly is, hands down. I was asleep before 5am.
I woke up this morning at 10:30am with a decent headache, similar to a hangover. 2 ibuprofen took care of that issue and I feel fine typing this. I slept well enough to dream. All in all it was a wonderful experience. Much stronger/intense than I expected. I must admit, there was a certain level of anxiety, during the climb to the plateau, much more than 2ce or 2ci, but it was bearable. Next time I might bump it up a 1-2mg, but I would be happy with a repeated experience. I had no nausea, which is a plus in my book.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Gain a competitive edge with custom solutions
Solve your most significant business problems with cutting edge technology
We know how to keep your data safe
Let us sweat the technical details. You can keep your eye on the big picture!


Continuous thinking: Nerdbeers continued - We all win !!
Note: this post is the successor to the previous post on NerdBeers; if you have not read it yet, you might want to browse through that one first in order to have some context for this one.
Introduction
The initial development on the Nerdbeers app was started about two weeks ago, and I never imagined it to be such a big thing really; I just wanted to build a small app to prove to myself that I could write an app without falling in the usual architecture trap.
But things evolved quite a lot, or, to quote a famous book:
"Opportunities multiply as they are seized"
Sun Tzu - "The Art of War"
I will try to give you a short overview of the key things that happened in the past two weeks.
The components matched perfectly
As I had been reading around on the web about Manos, Kayak, Massive, lean software practices, getting things done, ..., I was looking for an opportunity. The main focus point for me was avoiding protocol/boilerplate code, and thus having as much functionality as possible while writing the smallest possible amount LOC (Lines Of Code) .
The minute I saw the Nancy web framework at github I knew that this would have to be it; it had such a nice and clean syntax, and it was similar to the thing I had been thinking about building myself. After one of the main coders provided the idea of reimplementing nerddinner, I just started implementing it.
Doing this, I did notice that I needed some kind of a data access layer as wel. Looking for the ultimate LOC/efficiency, I opted for the relatively new Simple.Data, which looked like it was the tersest possible approach possible to data access for me.
They matched perfectly !
The components were really young OSS projects
Since both of the components were still in an early development phase, they were bound to have at least some bugs, so choosing a relatively new player on the block might seem like a stupid mistake to make, but in my opinion this was one of the best decisions:
By choosing very "young" open source projects,
the contibutors were all willing and able to help me out
with my newbie issues in a very direct way.
Think about it: if you use a mature open-source component, the OSS contributors get flooded with support requests, and are probably being asked the same questions over and over again. If you choose a young project, the authors will probably notice your questions, and they even might be able to help you out directly.
While I was hoping for some help, I never expected such a massive amount of response.
The component authors all contributed a huge amount to the NerdBeers project
What happened here was WAY beyond my expectations: next to getting almost instant help from all the component authors over twitter, they even started looking at my code, telling me what could be improved, and they even launched a few pull requests.
Most of the "bugs in their components" were actually bugs in my app due to my malpractices, but they were always there to help me out.
They also liked the fact that Nerdbeers was an implementation which showed of the results of their labour.
After a numerous amount of tweets with @GrumpyDev, @TheCodeJunkie @MarkRendle and others, I finally had an app boilerplate ready.
Next to this, someone from appharbor (@troethom) helped me to resolve a "bug" in my solution so that I could deploy the app to a demo website (for free), and the maintainer of AutoTest.Net (@AckenPacken) was there to help me after a tweet, even though I just made a stupid mistake (using the wrong MSpec runner).
The NerdBeers development team - a.k.a. "Wow, it really does happen!"
Here is a confession:
Without all those brittle minds, this would never have happened.
I have had projects skyrocketing in the past during my professional career. IMHO the usual way to get this happening is following these steps:
- Think about an idea
- Care about it, grow it, be passionate about it
- Set an initial target: both in scope and time
- Start implementing it
- Ship it at the time you planned it - really early, no matter how bad it looks, even if it does not have any true functionality yet
- Get other people passionate about it, and try to trigger their intrests
- Go to step 1, hoping to have at least triggered the interest of a few persons who might join you in the process later on
Conclusion & things to consider
After two weeks in the project, we have progressed a lot. We still have a long way to go, but I am confident that we will get there. For me the journey is more important than the destination, and I have had a very interesting journey already. It kind of makes me wonder on the path that lies ahead of me.
The app in itself is still pretty useless, but the real value is in the way it has been constructed, both technically and on a social level.
This experience also makes me wonder about the future of software development teams. As far as I know, everyone on the N-team has day jobs. We do not share a common language or country. Yet, we still manage to be quite effective in handling problems quite efficient.
This makes me think about my future projects. As a small ISV, I currently have to turn down some projects, because they are to big for a single person. Working like this makes me wonder whether I might be able to take on a bigger project, working in the same way as we did on the NerdBeers team, with people whom I trust from previous experiences. We could sit together in an office, but we would not need to.
Maybe that's what work 2.0 will be about: a truely global work environment in the comfort of your own home.
Signing off,
Tom


--- layout: post status: publish published: true title: Compiler Switches Changes for CL.EXE in 2005 author: display_name: Tomas Restrepo login: tomasr email<EMAIL_ADDRESS>url: http://winterdom.com/ author_login: tomasr author_email<EMAIL_ADDRESS>author_url: http://winterdom.com/ wordpress_id: 122 wordpress_url: http://winterdom.com/2005/07/compilerswitcheschangesforclexein2005 date: '2005-07-09 09:53:35 +0000' date_gmt: '2005-07-09 09:53:35 +0000' categories: - ".NET" tags: [] comments: [] ---
For those of you who use VC++, you might have notice that there have been significant changes in the compiler's command line switches that control compilation and compiler behavior. What you may not know is the whole rationale behind this changes, and Brandon Bray does a good job of explaining them on this post.
Personally, I'm happy with the changes, particularly with the changes to the optimization switches; they were becoming way too complicated and it was not always clear how they interacted and what the best options might be for a particular case.
Also, and this might not be obvious, the compiler has a very nice feature now that can allows it to report compiler internal errors (ICEs) to Microsoft. This feature can be controlled, btw, via the /errorReport option.


ExpLookitSurvey Class
Basic survey frame allowing researcher to specify question text and types.
This frame uses ember-cli-dynamic-forms as a wrapper for alpacajs, a powerful library for generating online forms. To specify the structure of your form (questions, answer types, validation), you provide a single 'formSchema' structure. The 'formSchema' consists of a 'schema' object and an 'options' object, described under Properties.
You can choose from any question types listed at http://www.alpacajs.org/documentation.html. In that documentation, you will see that each field type - e.g., Checkbox, Radio, Text - has some 'Schema' properties and some 'Options' properties. The properties under 'Schema' will be defined in the 'schema' object of your formSchema. The properties under 'Options' will be defined in the 'options' object of your formSchema.
Many question types allow you to easily validate answers. For instance, for a "number" field you can set minimum and maximum values, and entries will automatically be required to be numeric (http://www.alpacajs.org/docs/fields/number.html). You can also either set required: true in the schema->properties entry for this field OR set validator: required-field in the options->fields entry if you want to require that the participant enters something. A validation error message will be displayed next to any fields that fail validation checks and the participant will not be able to proceed until these are addressed.
Alpacajs is fairly powerful, and you are essentially using it directly. In general, you can copy and paste any object passed to alpaca in the alpaca docs right in as your formSchema to see that example in action on Lookit. Not all features of alpaca are detailed here, but they can be used: e.g., advanced users can enter 'views' and 'data' in the formSchema to customize the layout of their forms and the initial data. A 'dataSource' may be specified under options to populate a question's potential answers (e.g., to load a list of countries from some other source rather than hard-coding it, or to provide checkboxes with vocabulary items from an externally-defined inventory).
You can also use alpacajs's "dependencies" and "conditional dependencies" functionality to set up fields that depend on other fields - e.g., asking if the child speaks any language besides English in the home and only if so displaying a dropdown to select the language(s), or asking if the child likes Elmo or Grover better and then asking a question specific to the preferred character. Or if you have questions only relevant to the birth mother of the child, you could ask if the participant is the birth mother and show those questions conditionally.
Note that question titles are interpreted as HTML and can include images, audio/video elements, and inline CSS.
If a participant returns to this frame after continuing, via a 'Previous' button on the next frame, then the values in this form are pre-filled.
No video recording is conducted on this frame.
A previous button may optionally be included on this frame.
The form itself occupies a maximum of 800px horizontally and takes up 80% of the vertical height of the window (it will scroll to fit).
Current limitations: you are NOT able to provide custom functions (e.g. validators, custom dataSource functions) directly to the formSchema.
Here is an example of a reasonably simple survey using this frame:
"frames": {
"pet-survey": {
"kind": "exp-lookit-survey",
"formSchema": {
"schema": {
"type": "object",
"title": "Tell us about your pet!",
"properties": {
"age": {
"type": "integer",
"title": "Age",
"maximum": 200,
"minimum": 0,
"required": true
},
"name": {
"type": "string",
"title": "Name",
"required": true
},
"species": {
"enum": [
"dog",
"cat",
"fish",
"bird",
"raccoon"
],
"type": "string",
"title": "What type of animal?",
"default": ""
}
}
},
"options": {
"fields": {
"age": {
"numericEntry": true
},
"name": {
"placeholder": "a name..."
},
"species": {
"type": "radio",
"message": "Seriously, what species??",
"validator": "required-field"
}
}
}
},
"nextButtonText": "Moving on..."
}
}
And here is an example of re-implementing the exp-lookit-mood-questionnaire, using custom formatting, time-pickers, dependencies, and question groups.
"frames": {
"survey-sample-3": {
"kind": "exp-lookit-survey",
"formSchema": {
"view": {
"fields": {
"/child/happy": {
"templates": {
"control": "
{{#if options.leftLabel}}{{{options.leftLabel}}}{{/if}}{{#control}}{{/control}}{{#if options.rightLabel}}{{{options.rightLabel}}}{{/if}}
"
}
},
"/child/active": {
"templates": {
"control": "
{{#if options.leftLabel}}{{{options.leftLabel}}}{{/if}}{{#control}}{{/control}}{{#if options.rightLabel}}{{{options.rightLabel}}}{{/if}}
"
}
},
"/child/rested": {
"templates": {
"control": "
{{#if options.leftLabel}}{{{options.leftLabel}}}{{/if}}{{#control}}{{/control}}{{#if options.rightLabel}}{{{options.rightLabel}}}{{/if}}
"
}
},
"/child/healthy": {
"templates": {
"control": "
{{#if options.leftLabel}}{{{options.leftLabel}}}{{/if}}{{#control}}{{/control}}{{#if options.rightLabel}}{{{options.rightLabel}}}{{/if}}
"
}
},
"/parent/energetic": {
"templates": {
"control": "
{{#if options.leftLabel}}{{{options.leftLabel}}}{{/if}}{{#control}}{{/control}}{{#if options.rightLabel}}{{{options.rightLabel}}}{{/if}}
"
}
},
"/parent/parentHappy": {
"templates": {
"control": "
{{#if options.leftLabel}}{{{options.leftLabel}}}{{/if}}{{#control}}{{/control}}{{#if options.rightLabel}}{{{options.rightLabel}}}{{/if}}
"
}
},
"/parent/ontopofstuff": {
"templates": {
"control": "
{{#if options.leftLabel}}{{{options.leftLabel}}}{{/if}}{{#control}}{{/control}}{{#if options.rightLabel}}{{{options.rightLabel}}}{{/if}}
"
}
}
},
"layout": {
"bindings": {
"child": "#child",
"parent": "#parent",
"lastEat": "#lastEat",
"nextNap": "#nextNap",
"napWakeUp": "#napWakeUp",
"doingBefore": "#doingBefore",
"usualNapSchedule": "#usualNapSchedule"
},
"template": "

{{{options.formTitle}}}

{{{options.introText}}}

"
},
"parent": "bootstrap-edit"
},
"schema": {
"type": "object",
"properties": {
"child": {
"type": "object",
"title": "How is your CHILD feeling right now?",
"properties": {
"happy": {
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7"
],
"required": true
},
"active": {
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7"
],
"required": true
},
"rested": {
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7"
],
"required": true
},
"healthy": {
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7"
],
"required": true
}
}
},
"parent": {
"type": "object",
"title": "How are YOU feeling right now?",
"properties": {
"energetic": {
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7"
],
"required": true
},
"parentHappy": {
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7"
],
"required": true
},
"ontopofstuff": {
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7"
],
"required": true
}
}
},
"lastEat": {
"title": "About how long ago did your child last eat or drink?",
"required": true
},
"nextNap": {
"title": "About how much longer until his/her next nap (or bedtime)?",
"required": true
},
"napWakeUp": {
"title": "About how long ago did your child last wake up from sleep or a nap?",
"required": true
},
"doingBefore": {
"title": "What was your child doing before this?",
"required": true
},
"usualNapSchedule": {
"enum": [
"yes",
"no",
"yes-overdue"
],
"title": "Does your child have a usual nap schedule?",
"required": true
}
},
"dependencies": {
"nextNap": [
"usualNapSchedule"
]
}
},
"options": {
"fields": {
"child": {
"fields": {
"happy": {
"type": "radio",
"order": 3,
"vertical": false,
"leftLabel": "Fussy",
"fieldClass": "aligned-radio-group",
"rightLabel": "Happy",
"optionLabels": [
"",
"",
"",
"",
"",
"",
""
]
},
"active": {
"type": "radio",
"order": 4,
"vertical": false,
"leftLabel": "Calm",
"fieldClass": "aligned-radio-group",
"rightLabel": "Active",
"optionLabels": [
"",
"",
"",
"",
"",
"",
""
]
},
"rested": {
"type": "radio",
"order": 1,
"vertical": false,
"leftLabel": "Tired",
"fieldClass": "aligned-radio-group",
"rightLabel": "Rested",
"optionLabels": [
"",
"",
"",
"",
"",
"",
""
]
},
"healthy": {
"type": "radio",
"order": 2,
"vertical": false,
"leftLabel": "Sick",
"fieldClass": "aligned-radio-group",
"rightLabel": "Healthy",
"optionLabels": [
"",
"",
"",
"",
"",
"",
""
]
}
}
},
"parent": {
"fields": {
"energetic": {
"type": "radio",
"order": 1,
"vertical": false,
"leftLabel": "Tired",
"fieldClass": "aligned-radio-group",
"rightLabel": "Energetic",
"optionLabels": [
"",
"",
"",
"",
"",
"",
""
]
},
"parentHappy": {
"type": "radio",
"order": 3,
"vertical": false,
"leftLabel": "Upset",
"fieldClass": "aligned-radio-group",
"rightLabel": "Happy",
"optionLabels": [
"",
"",
"",
"",
"",
"",
""
]
},
"ontopofstuff": {
"type": "radio",
"order": 2,
"vertical": false,
"leftLabel": "Overwhelmed",
"fieldClass": "aligned-radio-group",
"rightLabel": "On top of things",
"optionLabels": [
"",
"",
"",
"",
"",
"",
""
]
}
}
},
"lastEat": {
"size": 10,
"type": "time",
"picker": {
"useCurrent": "day"
},
"dateFormat": "HH:mm",
"placeholder": "hours:minutes"
},
"nextNap": {
"size": 10,
"type": "time",
"picker": {
"useCurrent": "day"
},
"dateFormat": "HH:mm",
"placeholder": "hours:minutes",
"dependencies": {
"usualNapSchedule": "yes"
}
},
"napWakeUp": {
"size": 10,
"type": "time",
"picker": {
"useCurrent": "day"
},
"dateFormat": "HH:mm",
"placeholder": "hours:minutes"
},
"doingBefore": {
"type": "text",
"placeholder": "examples: having lunch, playing outside, going to the store with me"
},
"usualNapSchedule": {
"sort": false,
"type": "select",
"hideNone": false,
"noneLabel": "",
"optionLabels": [
"Yes",
"No",
"Yes, and he/she is already due for a nap"
],
"removeDefaultNone": false
}
},
"formTitle": "Mood Questionnaire",
"introText": "How are you two doing? We really want to know: we’re interested in how your child’s mood affects which sorts of surprising physical events he/she notices. You can help us find out what babies are really learning as they get older... and what they already knew, but weren’t calm and focused enough to show us!",
"hideInitValidationError": true
}
},
"nextButtonText": "Next"
}
Item Index
Properties
Methods
exitFullscreen
()
makeTimeEvent
-
eventName
-
[extra]
Create the time event payload for a particular frame / event. This can be overridden to add fields to every event sent by a particular frame
Parameters:
Returns:
Event type, time, and any additional metadata provided
serializeContent
-
formSchema
-
formData
-
eventTimings
Parameters captured and sent to the server
Parameters:
-
formSchema
ObjectThe same formSchema that was provided as a parameter to this frame, for ease of analysis if randomizing or iterating on experimental design.
-
formData
ObjectData corresponding to the fields defined in formSchema['schema']['properties']. The keys of formData are the FIELDNAMEs used there, and the values are the participant's responses. Note that if the participant does not answer a question, that key may be absent, rather than being present with a null value.
-
eventTimings
ObjectOnly events captured during this frame are 'nextFrame'/'previousFrame'; example eventTimings value:
[{u'eventType': u'nextFrame', u'timestamp': u'2016-08-03T00:45:37.157Z'}]
Returns:
The payload sent to the server
showFullscreen
()
Properties
displayFullscreenOverride
String
formSchema
Object
Object specifying the content of the form. This is in the same format as the example definition of the const 'schema' at http://toddjordan.github.io/ember-cli-dynamic-forms/#/demos/data: a schema and options are designated separately. Each field of the form must be defined in schema. Options may additionally be specified in options.
Sub-properties:
-
schema
ObjectThe schema defines the fields in this form. It has the following properties: 'type' (which MUST BE THE STRING 'object'), 'title' (a form title for display), and 'properties'. 'properties' is an object defining the set of fields in this form and their associated data types, at minimum. Each key:value pair in this object is of the form FIELDNAME:object. The FIELDNAME is something you select; it should be unique within this form. The object contains at least 'type' and 'title' values, as well as any additional desired parameters that belong to the 'Schema' for the desired field described at http://www.alpacajs.org/documentation.html.
-
options
ObjectThe options allow additional customization of the forms specified in the schema. This object should have a single key 'fields' mapping to an object. Each key:value pair in this object is of the form FIELDNAME:object, with FIELDNAMEs the same as in the schema. The potential parameters to use are those that belong to the 'Options' for the desired field described at http://www.alpacajs.org/documentation.html.
fullScreenElementId
String
generateProperties
String
Function to generate additional properties for this frame (like {"kind": "exp-lookit-text"}) at the time the frame is initialized. Allows behavior of study to depend on what has happened so far (e.g., answers on a form or to previous test trials). Must be a valid Javascript function, returning an object, provided as a string.
Arguments that will be provided are: expData
, sequence
, child
, pastSessions
, conditions
.
expData
, sequence
, and conditions
are the same data as would be found in the session data shown
on the Lookit experimenter interface under 'Individual Responses', except that
they will only contain information up to this point in the study.
expData
is an object consisting of frameId
: frameData
pairs; the data associated
with a particular frame depends on the frame kind.
sequence
is an ordered list of frameIds, corresponding to the keys in expData
.
conditions
is an object representing the data stored by any randomizer frames;
keys are frameId
s for randomizer frames and data stored depends on the randomizer
used.
child
is an object that has the following properties - use child.get(propertyName)
to access:
additionalInformation
: String; additional information field from child formageAtBirth
: String; child's gestational age at birth in weeks. Possible values are "24" through "39", "na" (not sure or prefer not to answer), "<24" (under 24 weeks), and "40>" (40 or more weeks).birthday
: timestamp in format "Mon Apr 10 2017 20:00:00 GMT-0400 (Eastern Daylight Time)"gender
: "f" (female), "m" (male), "o" (other), or "na" (prefer not to answer)givenName
: String, child's given name/nicknameid
: String, child UUID
pastSessions
is a list of previous response objects for this child and this study,
ordered starting from most recent (at index 0 is this session!). Each has properties
(access as pastSessions[i].get(propertyName)):
completed
: Boolean, whether they submitted an exit surveycompletedConsentFrame
: Boolean, whether they got through at least a consent frameconditions
: Object representing any conditions assigned by randomizer framescreatedOn
: timestamp in format "Thu Apr 18 2019 12:33:26 GMT-0400 (Eastern Daylight Time)"expData
: Object consisting of frameId: frameData pairsglobalEventTimings
: list of any events stored outside of individual frames - currently just used for attempts to leave the study earlysequence
: ordered list of frameIds, corresponding to keys in expData
Example:
function(expData, sequence, child, pastSessions, conditions) {
return {
'blocks':
[
{
'text': 'Name: ' + child.get('givenName')
},
{
'text': 'Frame number: ' + sequence.length
},
{
'text': 'N past sessions: ' + pastSessions.length
}
]
};
}
(This example is split across lines for readability; when added to JSON it would need to be on one line.)
Default: null
selectNextFrame
String
Function to select which frame index to go to when using the 'next' action on this frame. Allows flexible looping / short-circuiting based on what has happened so far in the study (e.g., once the child answers N questions correctly, move on to next segment). Must be a valid Javascript function, returning a number from 0 through frames.length - 1, provided as a string.
Arguments that will be provided are:
frames
, frameIndex
, expData
, sequence
, child
, pastSessions
frames
is an ordered list of frame configurations for this study; each element
is an object corresponding directly to a frame you defined in the
JSON document for this study (but with any randomizer frames resolved into the
particular frames that will be used this time).
frameIndex
is the index in frames
of the current frame
expData
is an object consisting of frameId
: frameData
pairs; the data associated
with a particular frame depends on the frame kind.
sequence
is an ordered list of frameIds, corresponding to the keys in expData
.
child
is an object that has the following properties - use child.get(propertyName)
to access:
additionalInformation
: String; additional information field from child formageAtBirth
: String; child's gestational age at birth in weeks. Possible values are "24" through "39", "na" (not sure or prefer not to answer), "<24" (under 24 weeks), and "40>" (40 or more weeks).birthday
: timestamp in format "Mon Apr 10 2017 20:00:00 GMT-0400 (Eastern Daylight Time)"gender
: "f" (female), "m" (male), "o" (other), or "na" (prefer not to answer)givenName
: String, child's given name/nicknameid
: String, child UUID
pastSessions
is a list of previous response objects for this child and this study,
ordered starting from most recent (at index 0 is this session!). Each has properties
(access as pastSessions[i].get(propertyName)):
completed
: Boolean, whether they submitted an exit surveycompletedConsentFrame
: Boolean, whether they got through at least a consent frameconditions
: Object representing any conditions assigned by randomizer framescreatedOn
: timestamp in format "Thu Apr 18 2019 12:33:26 GMT-0400 (Eastern Daylight Time)"expData
: Object consisting of frameId: frameData pairsglobalEventTimings
: list of any events stored outside of individual frames - currently just used for attempts to leave the study earlysequence
: ordered list of frameIds, corresponding to keys in expData
Example that just sends us to the last frame of the study no matter what:
`"function(frames, frameIndex, frameData, expData, sequence, child, pastSessions) {return frames.length - 1;}"
``
Default: null
Events
enteredFullscreen
leftFullscreen
nextFrame
Move to next frame
previousFrame
Move to previous frame


Seems we are too popular right now :(
Come back at a later time or calculate bloat score manually using this procedure:
- Measure total page size and numer of requests, for example with Pingdom speed test.
- Take a full page screenshot, for example with Full page screen capture chrome extension.
- Calculate the bloat score: WebBS = TotalPageSize / PageImageSize


- When we are open Do you want to know ?
- We are open 24 hours.
- When we are open Do you want to know ?
- We are open 24 hours.
- When we are open Do you want to know ?
- We are open 24 hours.
- When we are open Do you want to know ?
- We are open 24 hours.
- When we are open Do you want to know ?
- We are open 24 hours.


I was born in Nairobi City, Kenya. I have lived in Nairobi my whole life. My highest level of education is High School. I completed my O Levels last year and may go to university next year. I decided to attend Moringa because I have always admired the field of coding. I believe it's something I will definitely apply in my future career path. I read and watched documentaries about the creation of some famous apps and also how astronomers assemble rovers to go to space and use code to command them. I was inspired by how many strives and accomplishments humans have made in several sectors since the application of code and computer science in the 20th century.


{% extends 'base.html' %} {% load static %} {% load staticfiles %} {% block content %}
Notifications
Posts
Health Services
Authorities
Businesses


Now, create another set, final, with potential final values. For each initial value in initial, simulate the the amoeba with that value. Calculate the ending value of the amoeba, and put it into final. At the end, you can run through initial again, and count the number of elements that are not also in final. That's the answer.
Let's look at examples:
| Example | X | initial | final | Answer |
| 0 | {3, 2, 1} | {1, 2, 3} | {2, 4, 6} | 2 |
| 1 | {2, 2, 2, 2, 2, 2, 4, 2, 2, 2} | {2, 4} | {8} | 2 |
| 2 | {1, 2, 4, 8, 16, 32, 64, 128, 256, 1024, 2048} | {1, 2, 4, 8, 16, 32, 64, 128, 256, 1024, 2048} | {512, 4096} | 11 |
| 3 | {854, 250, 934, 1000, 281, 250, 281, 467, 854, 562, 934, 1000, 854, 500, 562} | {250, 281, 467, 500, 562, 854, 934, 1000} | {1000, 1124, 1708, 1868, 2000} | 7 |
The running time complexity of this is O(n2), where n is the number of elements in X. Why is there no log term in that? Lets break it down:


Strictly's Michelle Visage 'clashes with bosses over 2020 tour snub'
Michelle Visage was ‘waiting for confirmation’ to be part of the Strictly Come Dancing 2020 tour before she was snubbed from the line-up.
Seven celebrities from this year’s series are set to tour the UK for 33 live shows, including Sky Sports presenter Alex Scott, actress Catherine Tyldesley and EastEnders star Emma Barton, but earlier this month it was reported that RuPaul’s Drag Race judge was told she was ‘no longer needed’.
‘She was asked her availability for the tour and was waiting for confirmation,’ a spokesperson for Michelle revealed.
‘She’d have loved to have done it. She was available for every date of the tour and the organisers were very aware of this.’
Michelle’s rep continued to The Sun: ‘But for whatever reason, they decided not to have Michelle on. There was no discussion of any other fee.’
However, a Strictly insider told the publication that this was not the case.
Advertisement Advertisement
‘The reason Michelle is not doing the tour is she was already booked to do DragCon in London on January 18 and 19, which is the opening weekend of the tour,’ they said.
‘She wouldn’t be available for four shows in Birmingham. So to say she had cleared her diary is not true.
‘There was also some discussion about her fee. All celebrities are paid the same but Michelle wanted to be paid more.’
Strictly Come Dancing, The Live Tour will be happening in January and February 2020 and will also see last year’s winner Stacey Dooley join the spectacle alongside judges Shirley Ballas, Craig Revel Horwood and Bruno Tonioli.
‘I’ve heard so many amazing things about the live tour from my friends who’ve done it before,’ Emma enthused.
‘I can’t wait to do it all over again on tour.’
Alex added: ‘I’m really excited for next year’s tour – I hope I’ll get the chance to perform some of my favourite routines again. Strictly has been a once-in-a-lifetime opportunity and I’m thrilled that I’ll get to dance for everyone who has voted for me on the TV series.’
Advertisement Advertisement
Metro.co.uk has contacted Strictly Come Dancing and Michelle’s rep for further comment.
Strictly Come Dancing: The Results airs tonight at 7.15pm on BBC One.
Got a showbiz story?
If you've got a story, video or pictures get in touch with the Metro.co.uk Entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


Project 1
Project 2
Project 3
Project 4
Project 5
Project 6
Project 7
Divided
Ben Collins
Navbar
Projects
arrow_drop_down
Project 1
Project 2
Project 3
Project 4
Project 5
Project 6
Project 7
Divided
Ben
Collins
(555) 555 - 5555
<EMAIL_ADDRESS>New York, NY
This is a square image. Add the "circle" class to it to make it appear circular.


|
MasterScan
Lab_Matlab_control Master Branch
|
One central place to log data on the fly.
topsDataLog makes it easy to log data as you go. It's a "singleton" class, which means that only one can exist at a time, and you never have to create one yourself. You just call topsDataLog methods from any code that needs to use the log.
topsDataLog is a subclass of topsGroupedList, which means it has all the organization and capabilities of topsGroupedList, plus more.
Thus, you must log each piece of data in a "group" of related data. The group might correspond to a recuurring event, such as 'trial start'. You don't have to supply a "mnemonic" for each piece of data because topsDataLog uses timestamps to identify pieces of data in each group.
In your experiment code, you can add to the log as many times as you like. If you're not sure whether some piece of data will turn out to be important, you can go ahead and log it anyway. You don't have to worry about the log filling up, how to allcate space for more data, or even how the data are ultimately stored. That's the log's job.
Other topsFoundataion classes will also add data to the log, to help you keep track of details that aren't specific to your experiment. For example, topsRunnable objects make log entries as they start and finish running.
With your log entries and the entries made automatically by topsFoundataion classes, it should be straightforward to look at the log after an experiment and get a sense of what happened and when. The log's gui() method should make this even easier. You can use it to launch topsDataLogGUI, which plots a raster of all logged data over time, with data groups as rows.
Properties and Events | |
| Property | printLogging = false |
| any function that returns the current time as a number jig moved to topsFoundation clockFunction = @topsClock; More... | |
| Property | fileWithPath = '' |
| string name of a file to read from and write to, which may include the file path | |
| Properties and Events inherited from topsFoundation | |
| Property | name = '' |
| a string name to indentify the object | |
| Property | clockFunction =@topsClock |
| clock function, to standardize | |
Protected Properties | |
| Property | earliestTime |
| the time of the first logged data, as reported by clockFunction | |
| Property | latestTime |
| the time of the last logged data, as reported by clockFunction | |
| Property | lastFlushTime |
| the most recent time when the log was flushed More... | |
| Property | fHeader |
| topsDataFile metadata struct for writing to disk incrementally | |
| Property | lastWriteTime |
| time of the most recent writeIncrementToFile() | |
| Property | lastNewDataTime |
| time of the most recent getNewData() | |
| Protected Properties inherited from topsGroupedList | |
| Property | groups = {} |
| cell array of strings or numbers for all list groups | |
| Property | length = 0 |
| number of items contained among all groups | |
| Property | allGroupsMap |
| containers.Map of data for each group | |
Methods | |
| set_fileWithPath (self, fileWithPath) | |
| Update the topsDataFile metadata to reflect a new fileWithPath. | |
| Methods inherited from topsGroupedList | |
| self | topsGroupedList (varargin) |
| Constuct with name optional. More... | |
| fig | gui (self) |
| Open a GUI to view object details. More... | |
| p | guiPanel (self, varargin) |
| Make a topsGroupedListPanel with details about this object. | |
| addItemToGroupWithMnemonic (self, item, group, mnemonic) | |
| Add a new item to the list. More... | |
| removeItemFromGroup (self, item, group) | |
| Remove all instances of an item from a group. More... | |
| removeMnemonicFromGroup (self, mnemonic, group) | |
| Remove a mnemonic and its item from a group. More... | |
| removeGroup (self, group) | |
| Remove a whole group from the list. More... | |
| removeAllGroups (self) | |
| Remove a whole groups from the list. More... | |
| makeGroupFromList (self, groupName, list) | |
| Make a group from a cell array list of pairs: <string mnemonic>="">, | |
| mergeGroupsIntoGroup (self, sourceGroups, destinationGroup) | |
| Combine multiple groups into another group. More... | |
| item | getItemFromGroupWithMnemonic (self, group, mnemonic) |
| Get an item out of the list. More... | |
| varargout | subsref (self, info) |
| Get list items with {} syntax. More... | |
| self | subsasgn (self, info, value) |
| Add list items with {} syntax. More... | |
| n | numel (self, varargin) |
| Tell Matlab how many items to expect from {} syntax It's always 1. | |
| mnemonics | getAllMnemonicsFromGroup (self, group) |
| Get all mnemonics from a group. More... | |
| items mnemonics | getAllItemsFromGroup (self, group) |
| Get all items (and optionally all mnemonics) from a group. More... | |
| groupStruct | getAllItemsFromGroupAsStruct (self, group) |
| Get all items from a group, as a struct array. More... | |
| isContained | containsGroup (self, group) |
| Does the list contain the given group? More... | |
| matches isMatch | getGroupNamesMatchingExpression (self, expression) |
| Get string group names that match the given regular expression. More... | |
| isContained | containsMnemonicInGroup (self, mnemonic, group) |
| Does the list contain the given group and mnemonic? More... | |
| isContained | containsItemInGroup (self, item, group) |
| Does the list contain the given group and item? More... | |
| Methods inherited from topsFoundation | |
| self | topsFoundation (name) |
| Constuct with name optional. More... | |
| fig | gui (self) |
| Open a GUI to view object details. More... | |
| p | guiPanel (self, varargin) |
| Make a topsDetailPanel with details about this object. More... | |
Protected Methods | |
| writeIncrementToFile (self) | |
| Write a data increment and other data to file and do accounting. | |
| dataStruct | readIncrementFromFile (self) |
| Read a data increment and other data from file. | |
| dataStruct | readOldLogStructFromFile (self) |
| Read an old-style data from file. | |
| populateWithDataStruct (self, dataStruct) | |
| Populate the log groupedList with struct data. | |
Static Methods | |
| static log | theDataLog (clearTheLog) |
| Access the current data log "singleton". More... | |
| static fig | gui () |
| Open a GUI to view object details. More... | |
| static | setVerbose (isVerbose) |
| Toggle verbose printouts for data logging. More... | |
| static | flushAllData () |
| Clear out all data from the log. More... | |
| static | logDataInGroup (data, group, timestamp) |
| Add some data to the log. More... | |
| static logStruct | getSortedDataStruct (timeRange) |
| Get all data from the log. More... | |
| static logStruct | getNewData () |
| Get new data, recently added to the log. More... | |
| static isNew | logNewData (logStruct) |
| Log data from a data struct, if it's new. More... | |
| static | writeDataFile (fileWithPath) |
| Write logged data to a file. More... | |
| static dataStruct | readDataFile (fileWithPath) |
| Read previously logged data from a file. More... | |
| static ecodes | parseEcodes (group, fileWithPath) |
| Convenient routine to make a FIRA-like ecodes struct from a set of trial structures found in a data file NOTE: this only works if entries in the structures are scalars (includig nans) | |
| static data | getTaggedData (group, fileWithPath) |
| Convenient routine to collect tagged data into a cell array. More... | |
| Static Methods inherited from topsGroupedList | |
| static isContained | mapContainsItem (map, item) |
| Does the containers.Map contain the given item? More... | |
| static groupList | createGroupFromList (groupName, list) |
| Convenient utility. | |
| Static Methods inherited from topsFoundation | |
| static c index | cellAdd (c, item, index) |
| Add an item to a cell array. More... | |
| static selector | cellContains (c, item) |
| Does a cell array conatin an item? More... | |
| static c | cellRemoveItem (c, item) |
| Remove an item from a cell array. More... | |
| static c | cellRemoveElement (c, index) |
| Remove indexed elements from a cell array. More... | |
| static index selector | findStructName (s, name) |
| Where is the given name in the given struct array? More... | |
Private Methods | |
| self | topsDataLog () |
| Constructor is private. More... | |
|
private |
Constructor is private.
Use topsDataLog.theDataLog to access the current instance of topsDataLog.
|
static |
Access the current data log "singleton".
Returns the current instance of topsDataLog. Use this method instad of a class constructor. This method will create a new data log the first time it's called, and return the same data log subsequently.
For most log operations, you don't need this method. You can just use the static methods below and they will access the current data log for you.
For a few operations it makes sense to get at the log itself, using this method. For example, you might wish to change the log's clockFunction, to use some custom timer. In that case you would get the log using this method, and set the value of log.clockFunction just like you would set the value of any object property.
|
static |
Open a GUI to view object details.
Opens a new GUI with components suitable for viewing objects of this class. Returns a topsFigure object which contains the GUI.
|
static |
Toggle verbose printouts for data logging.
| isVerbose | whether to print as data are logged |
If isVerbose is true, topsDataLog will print a message to the Command Window whenever data is added to the log. If isVerbose is false or omitted, topsDataLog will print nothing.
|
static |
Clear out all data from the log.
You can't create new instances of topsDataLog, but you can always clear out the existing instance. You probably should do this before starting an experiment.
Removes all data from all groups, then removes the groups themselves. Sets earliestTime and latestTime to nan.
|
static |
Add some data to the log.
| data | a value or object to store in the log (but not an object of the handle type). |
| group | a string for grouping related data, such as the name of a recurring event. |
| timestamp | optional time marker to use for data, instead of the current time. |
If data is a handle object, converts it to a struct. This is because Matlab does a bad job of dealing with large numbers of handles to the same object, and a worse job of writing and reading them to disk. Better to keep the data log out of that mess.
Adds data to group, under the given timestamp, in the current instance of topsDataLog. If timestamp is omitted, uses the current time reported by clockFunction.
Updates earliestTime and latestTime to account for the the time of this log entry.
Since topsDataLog is a subclass of topsGroupedList, logging data is a lot like adding items to a list. group is treated just like the groups in topsGroupedList. The data log uses a timestamp as the mnemonic for each data item.
|
static |
Get all data from the log.
| timeRange | optional time limits for data, of the form [laterThan asLateAs] |
Gets all data items from the current instance of topsDataLog, as a struct array, using getAllItemsFromGroupAsStruct(). Sorts the struct array by the time values stored in its mnemonics field.
|
static |
Get new data, recently added to the log.
Gets recent data items from the current instance of topsDataLog, as a struct array. "Recent" means data added to the log since the last time getNewData() was called. Updates lastNewDataTime with the current time.
|
static |
Log data from a data struct, if it's new.
| dataStruct | struct data, as from getSortedDataStruct() |
Adds adds data from the given dataStruct to the data log, but only if the new data are newer than lastNewDataTime. Returns a logical selector with the same size as dataStruct, which is true where items were found to be new and added to the log.
|
static |
Write logged data to a file.
| fileWithPath | optional .mat filename, which may include a path, in which to save logged data. |
Converts recently logged data to a standard Matlab struct using topsDataLog.getSortedDataStruct() and writes the struct to disk, via the topsDataFile class.
writeDataFile() behaves differently depending on fileWithPath and the fileWithPath property of the current topsDataLog instance:
|
static |
Read previously logged data from a file.
| fileWithPath | optional .mat filename, which may include a path, from which to read logged data. |
Reads any previously unread data from disk, via the topsDataFile class. Populates the current instance of topsDataLog with any new data. May also return the new data, in a struct of the same form as topsDataLog.getSortedDataStruct().
readDataFile() behaves differently depending on fileWithPath and the fileWithPath property of the current topsDataLog instance:
|
static |
Convenient routine to collect tagged data into a cell array.
group is string name fileWithPath is optional filename
| Property printLogging = false |
any function that returns the current time as a number jig moved to topsFoundation clockFunction = @topsClock;
true or false, whether to print info as data are logged
|
protected |
the most recent time when the log was flushed
flushAllData() sets lastFlushTime to the current time, as reported by clockFunction.