1 2 3 4 5 6 7 8 9 10 11 12
13 14 15
16
17 package xdc.runtime;
18
19 /*!
20 * ======== Text ========
21 * Runtime text handling services
22 *
23 * This module efficiently manages a collection of strings that have common
24 * substrings. Collections with a high degree of commonality are stored in
25 * much less space than as an ordinary table of independent C strings.
26 *
27 * To further save space, the "compressed" representation need not even
28 * be loaded in the target's memory; see `{@link #isLoaded}`.
29 *
30 * The total space available for the compressed representation of text strings
31 * is limited to 32K characters; the lowest 15 bits of a 16-bit "rope id" are
32 * an index of a storage array.
33 */
34 @Template("./Text.xdt")
35 @DirectCall
36 module Text {
37
38 /*!
39 * ======== CordAddr ========
40 * @_nodoc
41 */
42 typedef Types.CordAddr CordAddr;
43
44 /*!
45 * ======== Label ========
46 */
47 typedef Types.Label Label;
48
49 /*!
50 * ======== RopeId ========
51 * @_nodoc
52 *
53 * A rope id is a 16-bit value whose most-significant bit indicates
54 * whether the lower 15-bits are an offset into the string table
55 * `charTab` or an offset into the "node" table `nodeTab`.
56 *
57 * The node id 0 represents the empty string "".
58 */
59
60 typedef Types.RopeId RopeId;
61
62 /*!
63 * ======== Module_View ========
64 * @_nodoc
65 */
66 @XmlDtd
67 metaonly struct Module_View {
68 Ptr charBase;
69 Ptr nodeBase;
70 };
71
72 /*!
73 * ======== nameUnknown ========
74 * Default unknowable instance name
75 *
76 * The name of an instance if the module's instances are configured to
77 * not have names.
78 */
79
80 config String nameUnknown = "{unknown-instance-name}";
81
82 /*!
83 * ======== nameEmpty ========
84 * Default `NULL` instance name
85 *
86 * The name used if the instance's name has been set to `NULL`.
87 */
88
89 config String nameEmpty = "{empty-instance-name}";
90
91 /*!
92 * ======== nameStatic ========
93 * Default static instance name
94 *
95 * The name of an instance if the name exists but it's not loaded
96 * on the target.
97 */
98
99 config String nameStatic = "{static-instance-name}";
100
101 /*!
102 * ======== isLoaded ========
103 * Ensure character-strings are loaded in target memory
104 *
105 * Character strings managed by this module are allocated together
106 * with other character strings, and loaded to the target, when this
107 * parameter is set to its default value `true`. If this parameter is
108 * set to `false`, the character strings managed by Text are kept in the
109 * application object file, but they are not loaded to the target.
110 *
111 * A consequence of setting this parameter to `false` is that all names
112 * assigned to static instances are set to NULL, and cannot be displayed by
113 * the code loaded to the target. Also, the Log Events that automatically
114 * print instance names will print NULL for any static instance.
115 *
116 * ROV is not affected by this parameter and it will also correctly display
117 * names of static instances in their modules' views. ROV detects these
118 * names from the saved configuration files.
119 *
120 * Module and event IDs are still unique and Log.Events within one module
121 * have consecutive IDs.
122 */
123
124 config Bool isLoaded = true;
125
126 /*!
127 * ======== cordText ========
128 * Return `NULL` if cord is in `charTab` and `isLoaded` is `FALSE`
129 * @_nodoc
130 */
131 String cordText(CordAddr cord);
132
133 /*!
134 * ======== ropeText ========
135 * Convert rope to an ordinary C string
136 *
137 * Convert rope to an ordinary C string or to NULL if rope refers
138 * to a node in nodeTab
139 *
140 * @_nodoc
141 */
142 CString ropeText(RopeId rope);
143
144 /*!
145 * ======== matchRope ========
146 * Compare pattern string `pat` to String identified by `rope`.
147 * @_nodoc
148 *
149 * This function is invoked from `{@link Diags#setMask()}`, see the
150 * documentation for that function to find out how the patterns are
151 * created.
152 *
153 * @a(pre-conditions)
154 * @p(blist)
155 * - lenp must be less than or equal to the length of pat
156 * - wildcard '%' is at src[(*lenp) - 1], if it's in the the pattern
157 * @p
158
159 * @a(post-conditions)
160 * @p(blist)
161 * - lenp is decreased by the length of any matching prefix
162 * @p
163 *
164 * Returns:
165 * @p(blist)
166 * - -1 `pat` does not match string
167 * - 0 string is a prefix of pattern
168 * - 1 wildcard match
169 * @p
170 */
171
172 Int matchRope(RopeId rope, CString pat, UShort *lenp);
173
174 /*!
175 * ======== putLab ========
176 * Convert label to an ASCII character sequence
177 *
178 * This function converts a `{@link Types#Label}` to a sequence of
179 * ASCII characters, writes the characters to the supplied buffer,
180 * updates the buffer pointer to point to the location after the last
181 * output character, and returns the number of characters output.
182 *
183 * No more than `len` characters will be output. If the label would
184 * otherwise be longer, the output is truncated at the point where a
185 * potential overflow is detected. The return value always reflects the
186 * number of characters output, but it may be less than `len`.
187 *
188 * Label structures can be initialized from any module's instance handle
189 * using the module's `Mod_Handle_label()` method. See
190 * `{@link Types#Label}` for more information.
191 *
192 * @param(lab) address of the label to interpret
193 * @param(bufp) address of the output buffer pointer or `NULL`
194 *
195 * If `bufp` is `NULL`, the label's characters are
196 * output via `{@link System#putch()}`.
197 *
198 * @param(len) maximum number of characters to generate
199 *
200 * If `len` is negative, the number of characters to be
201 * generated is not limited.
202 *
203 * @a(returns)
204 * The return value always reflects the number of characters output,
205 * but it may be less than `len`.
206 *
207 * @see Types#Label
208 */
209
210 Int putLab(Types.Label *lab, Char **bufp, Int len);
211
212 /*!
213 * ======== putMod ========
214 * Convert module ID to its ASCII name
215 *
216 * This function converts a `{@link Types#ModuleId}` to a sequence of
217 * ASCII characters, writes the characters to the supplied buffer,
218 * updates the buffer pointer to point to the location after the last
219 * output character, and returns the number of characters output.
220 *
221 * No more than `len` characters will be output. If the module name would
222 * otherwise be longer, the output is truncated at the point where a
223 * potential overflow is detected. The return value always reflects the
224 * number of characters output, but it may be less than `len`.
225 *
226 * @param(mid) ID of the module
227 * @param(bufp) address of the output buffer pointer or `NULL`
228 *
229 * If `bufp` is `NULL`, the module's name characters are
230 * output via `{@link System#putch()}`.
231 *
232 * @param(len) maximum number of characters to generate
233 *
234 * If `len` is negative, the number of characters to be
235 * generated is not limited.
236 *
237 * @a(returns)
238 * The return value always reflects the number of characters output,
239 * but it may be less than `len`.
240 */
241
242 Int putMod(Types.ModuleId mid, Char **bufp, Int len);
243
244 /*!
245 * ======== putSite ========
246 * Convert call site structure to an ASCII character sequence
247 *
248 * This function converts a `{@link Types#Site}` to a sequence of
249 * ASCII characters, writes the characters to the supplied buffer,
250 * updates the buffer pointer to point to the location after the last
251 * output character, and returns the number of characters output.
252 *
253 * No more than `len` characters will be output. If the sequence would
254 * otherwise be longer, the output is truncated at the point where a
255 * potential overflow is detected.
256 *
257 * @param(site) address of the call site structure to interpret
258 * @param(bufp) address of the output buffer pointer or `NULL`
259 *
260 * If `bufp` is `NULL`, the site's name characters are
261 * output via `{@link System#putch()}`.
262 *
263 * @param(len) maximum number of characters to generate
264 *
265 * If `len` is negative, the number of characters to be
266 * generated is not limited.
267 *
268 * @a(returns)
269 * The return value always reflects the number of characters output,
270 * but it may be less than `len`.
271 */
272
273 Int putSite(Types.Site *site, Char **bufp, Int len);
274
275 internal:
276
277 struct Node {
278 Types.RopeId left;
279 Types.RopeId right;
280 };
281
282 typedef Bool (*RopeVisitor)(Ptr, CString);
283
284 struct MatchVisState {
285 CString pat;
286 UShort *lenp;
287 Int res;
288 };
289
290 struct PrintVisState {
291 Char **bufp;
292 UShort len;
293 Int res;
294 };
295
296 297 298 299 300
301 config Char charTab[] = [0];
302 config Node nodeTab[] = [{left: 0, right: 0}];
303
304 config Int16 charCnt = 1;
305 config Int16 nodeCnt = 1;
306
307 308 309 310 311 312 313 314 315 316 317 318
319 config UInt16 unnamedModsLastId = 0x4000;
320 config UInt16 registryModsLastId = 0x7FFF;
321
322 323 324 325
326
327
328 /*!
329 * ======== defineRopeCord ========
330 * Put text in charTab[] and return its offset within charTab
331 */
332 function defineRopeCord(text);
333
334 /*!
335 * ======== defineRopeNode ========
336 * Create a new Node structure, add it to nodeTabe, and return nodeId,
337 * which is an offset within nodeTab with the leftmost bit set.
338 */
339 function defineRopeNode(left, right);
340
341 function fetchAddr(raddr);
342 function fetchCord(cid);
343 function fetchId(rid);
344 function fetchNode(nid);
345
346 function genModNames();
347 function genPkgName();
348
349 Bool matchVisFxn(Ptr p, CString s);
350 Bool printVisFxn(Ptr p, CString s);
351
352 Void visitRope(RopeId rope, RopeVisitor visFxn, Ptr visState);
353 Void visitRope2(RopeId rope, RopeVisitor visFxn, Ptr visState,
354 CString stack[]);
355
356 typedef Void (*VisitRopeFxn)(RopeId, RopeVisitor, Ptr);
357 typedef Void (*VisitRopeFxn2)(RopeId, RopeVisitor, Ptr, CString[]);
358
359 config VisitRopeFxn visitRopeFxn = visitRope;
360
361 config VisitRopeFxn2 visitRopeFxn2 = visitRope2;
362
363 /*!
364 * ======== xprintf ========
365 * @param(bufp) address of the output buffer pointer or `NULL`
366 *
367 * If `bufp` is `NULL`, the site's name characters are
368 * output via `{@link System#putch()}`.
369 *
370 * @param(len) maximum number of characters to generate
371 *
372 * If `len` is negative, the number of characters to be
373 * generated is not limited.
374 *
375 * @a(returns)
376 * The return value always reflects the number of characters output,
377 * but it may be less than `len`.
378 */
379 Int xprintf(Char **bufp, SizeT len, CString fmt, ...);
380
381 struct Module_State {
382 CPtr charBase;
383 CPtr nodeBase;
384 };
385 }
386 387 388
389


| fkUtilities reference pages |
superobj=SUPER(obj) superobj=SUPER(obj,1)
superobj=SUPER(obj) returns the super object of an object or [] if none exists. Only works for single inheritance.
superobj=SUPER(obj,1) returns the super base object of an object. Only works for single inheritance.
| randdist | Toolbox page | fcorrcoef |


{{> header }}
Please check your inbox and click on the link provided
Back to homepage
Restricted page


FAQ
What is JSONLint?
JSONLint is a validator and reformatter for JSON, a lightweight data-interchange format.
Why 'Lint'?
Essentially, I'm just riding on JSLint's coattails. The name 'lint' was originally used to find problems in C source files. It's not really valid here because JSON is just a protocol. Shameless? You bet!
Why does it reformat my JSON?
Because your code is ugly! Trust me on this one. What's that you say? It's not? Ok, well then here's JSON Lint without the reformatter.
Any secret features?
Sure, a few. You can input a URL and it'll scrape it for JSON and parse that.
An example URL to test: https://www.reddit.com/r/programming/comments/9szpc/jsonlint_a_handy_json_validator_and_reformatter.json
You can also provide JSON to lint in the URL if you link to JSON Lint with the "json" parameter. Here's an example URL to test.
Additionally, JSON Lint can also be used as a json compressor if you add ?reformat=compress to the URL.
What are some common errors?
-
Expecting 'STRING'
-
You probably have an extra comma at the end of your collection. Something like:
{ "a": "b", }
-
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
-
You probably have an extra comma at the end of your list. Something like:
[ "a", "b", ]
You also may have not enclosed your collection keys in quotes. Proper format for a collection is:{ "key": "value" }
Be sure to follow JSON's syntax properly. For example, always use double quotes, always quotify your keys, and remove all callback functions.
A friend and I pasted the same JSON in and got different results. Wat do?
If you and your friend are on different systems (Win/Unix), this is possible due to the way windows handles newlines. Essentially, if you have just newline characters (\n) in your JSON and paste it into JSONLint from a windows machine, it can validate it as valid erroneously since Windows may need a carriage return (\r) as well to detect newlines properly.
The solution: Either use direct URL input, or make sure your content's newlines match the architecture your system expects!
Who made this?
Chris Dary built this. Much is owed to the community (this uses Zach Conner's javascript Pure JS JSON parser, for example).


ui1.File
Button to open a file selection dialog
Because of the experimantel status no documemtation is availabe.
innovaphone.ui1.File(style, content, cl, update, multiple)
Creates an file selection button
- style
-
Style to be used to set positioning and size of the button
- content
-
May be text, HTML or a innovaphone.ui1.nodePrototype object to set the content
- cl
-
class to be used to define style of the button
- update
-
callback when the file selection was updated. The files array is passed as argument
- multiple
-
Flag to define that multiple files may be selected if true.
- accept
-
The accept argument specifies the types of files that can be selected.


Documentation for and examples of IIDS Basic UI Elements, including typography, buttons and forms.
Documentation for and examples of IIDS Components, including complex buttons, navigation and charting.
A comprehensive list of Datagrids examples.
Note These examples loads local JSON, and so might not work in Chrome or IE. To preview them, use Firefox or a web server.
IIDS dashboard view pattern
IIDS mixed module view pattern
IIDS content view pattern
IIDS template displaying functional demos of multiple IIDS application elements
IIDS two-pane view pattern
IIDS masthead and primary navigation pattern
IIDS secondary and tertiary navigation pattern
IIDS workspace navigation pattern
IIDS masthead and primary navigation with mega-dropdown pattern
IIDS masthead and primary navigation pattern with breadcrumbs
IIDS masthead and primary navigation pattern with notification states
IIDS Asset Monitoring: Asset Dashboard application pattern
IIDS Asset Monitoring: Fleet Overview application pattern
IIDS Asset Monitoring: Asset Overview application pattern
IIDS Asset Monitoring: Asset Dashboard with Events application pattern
IIDS Asset Monitoring: Asset Data application pattern
IIDS Analytics Dashboard: Dashboard application pattern
IIDS Analytics Dashboard: Overview application pattern
IIDS Analytics Dashboard: Detail application pattern
Note This example loads local JSON, so might not work in Chrome or IE. To preview, use Firefox or a web server.
IIDS Basic Insights: Dashboard application pattern
Note This example loads local JSON, so might not work in Chrome or IE. To preview, use Firefox or a web server.
IIDS Case Management: Dashboard application pattern
IIDS Event Queue application pattern
IIDS Event Queue: Detail application pattern
Basic IIDS application boilerplate
Watch the screencast on getting started with the IIDS and Basic Boilerplate.
Multipage IIDS application boilerplate
Read the tutorial on getting started with the IIDS and the Multipage boilerplate.


Filmoteka
HOME
MY LIBRARY
Search result not successful. Enter the correct movie name
These are all the films we found
Watched
Queue


--- layout: post status: publish published: true title: AAA All-Star Game Tonight author: display_name: Corey Fineran login: Corey email<EMAIL_ADDRESS>url: '' author_login: Corey author_email<EMAIL_ADDRESS>wordpress_id: 1114 wordpress_url: http://ivyenvy.com/?p=1114 date: '2009-07-15 11:12:01 +0000' date_gmt: '2009-07-15 17:12:01 +0000' categories: - Minor Leagues tags: - Eric Patterson - Iowa Cubs - Matt Murton - Oakland - AAA All-Star Game - Pacific Coast League - Chris Robinson comments: [] ---
The AAA All-Star Game will be on ESPN2 tonight and I'll surely be watching. Matt Murton earned a spot on the PCL All-Star team. Chris Robinson, the catcher for the Iowa Cubs will be representing the team. Another name worth noting is Eric Patterson, who will be playing in the game for the Oakland AAA affiliate.


Play for free with your friend from anywhere in the world!
Click a card in hand to select it, then click a slot to move it
Click a card in lineup to select it, then click scrapheap to move it
Click the forge to draw a card
Click an energy counter to toggle it
Doubleclick a card in lineup to edit its damage
Click the toggle hand button to toggle display of your hand
Click the return from scrapheap button to return a card to the top of your forge, faceup
Click the Ignite button to roll an Ignite
Share screens to play your friend(s) remotely!
Remember to turn display fo your hand off when sharing, and pause sharing to summon minions


| I l@ve RuBoard |
This API has been defined to encourage similarity between the Python modules that access databases. By doing this, we hope to achieve a consistency leading to more easily understood modules, code that is generally more portable across databases, and a broader reach of database connectivity from Python.
The interface specification consists of several sections:
Module interface
Connection objects
Cursor objects
Type objects and constructors
Implementation hints
Major changes from 1.0 to 2.0
Comments and questions about this specification may be directed to the SIG for Database Interfacing with Python.
For more information on database interfacing with Python and available packages see the Database Topics Guide on www.python.org.
This document describes the Python Database API Specification 2.0. The previous Version 1.0 version is still available as reference. Package writers are encouraged to use this version of the specification as basis for new interfaces.
| I l@ve RuBoard |


| Line |
Column |
Severity |
Message |
| 6 |
1 |
error
|
Spaces must be used to indent lines; tabs are not allowed |
| 6 |
79 |
error
|
Incorrect spacing between argument "$prop" and equals sign; expected 1 but found 0 |
| 6 |
79 |
error
|
Incorrect spacing between default value and equals sign for argument "$prop"; expected 1 but found 0 |
| 6 |
98 |
error
|
Incorrect spacing between argument "$from" and equals sign; expected 1 but found 0 |
| 6 |
98 |
error
|
Incorrect spacing between default value and equals sign for argument "$from"; expected 1 but found 0 |
| 6 |
115 |
error
|
Incorrect spacing between argument "$to" and equals sign; expected 1 but found 0 |
| 6 |
115 |
error
|
Incorrect spacing between default value and equals sign for argument "$to"; expected 1 but found 0 |
| 6 |
126 |
warning
|
Line exceeds 120 characters; contains 126 characters |


Go to the source code of this file.
Data Structures | |
| struct | complex |
Defines | |
| #define | c_add(c, a, b) |
| Complex Addition c = a + b. | |
| #define | c_sub(c, a, b) |
| Complex Subtraction c = a - b. | |
| #define | cs_mult(c, a, b) |
| Complex-Double Multiplication. | |
| #define | cc_mult(c, a, b) |
| Complex-Complex Multiplication. | |
| #define | cc_conj(a, b) |
| #define | c_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i ) |
| Complex equality testing. | |
Functions | |
| void | c_div (complex *, complex *, complex *) |
| Complex Division c = a/b. | |
| double | c_abs (complex *) |
| Returns sqrt(z.r^2 + z.i^2). | |
| double | c_abs1 (complex *) |
| Approximates the abs. Returns abs(z.r) + abs(z.i). | |
| void | c_exp (complex *, complex *) |
| Return the exponentiation. | |
| void | r_cnjg (complex *, complex *) |
| Return the complex conjugate. | |
| double | r_imag (complex *) |
| Return the imaginary part. | |
| complex | c_sgn (complex *) |
| SIGN functions for complex number. Returns z/abs(z). | |
| complex | c_sqrt (complex *) |
| Square-root of a complex number. |
-- SuperLU routine (version 2.0) -- Univ. of California Berkeley, Xerox Palo Alto Research Center, and Lawrence Berkeley National Lab. November 15, 1997
Contains definitions for various complex operations. This header file is to be included in source files c*.c
| #define c_add | ( | c, | |||
| a, | |||||
| b | ) |
Value:
{ (c)->r = (a)->r + (b)->r; \ (c)->i = (a)->i + (b)->i; }
| #define c_eq | ( | a, | |||
| b | ) | ( (a)->r == (b)->r && (a)->i == (b)->i ) |
| #define c_sub | ( | c, | |||
| a, | |||||
| b | ) |
Value:
{ (c)->r = (a)->r - (b)->r; \ (c)->i = (a)->i - (b)->i; }
| #define cc_conj | ( | a, | |||
| b | ) |
Value:
{ \ (a)->r = (b)->r; \ (a)->i = -((b)->i); \ }
| #define cc_mult | ( | c, | |||
| a, | |||||
| b | ) |
Value:
{ \
float cr, ci; \
cr = (a)->r * (b)->r - (a)->i * (b)->i; \
ci = (a)->i * (b)->r + (a)->r * (b)->i; \
(c)->r = cr; \
(c)->i = ci; \
}
| #define cs_mult | ( | c, | |||
| a, | |||||
| b | ) |
Value:
{ (c)->r = (a)->r * (b); \ (c)->i = (a)->i * (b); }
| double c_abs | ( | complex * | ) |
| double c_abs1 | ( | complex * | ) |
| double r_imag | ( | complex * | ) |


Copyright & License | Privacy | Contact Us | Donate | Thanks
Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.


"Tour de force", would be classic euphemism for this film which hits you with the force of a fifteen pound sledgehammer smashing into your skull.
Well, the movie is about a butcher in Paris (superbly played by Philippe Nahon) who has been released from prison following a stint on assault charges (for stabbing an innocent person whom he suspected of trying to rape his autistic daughter) and finds himself alone, jobless, angry and depressed. He meets a fat salon keeper, who becomes his mistress, and they move out to the country, but let's say that things don't quite work out for them.
So, he returns to Paris in the hope of finding a job, but that proves to be a futile exercise. All his friends are either destitute or don't care a damn about him. Thus begins his long and nihilistic journey to the edge of the abyss, and possibly beyond, but that's for you to judge at the end of the film. As usual, I won't go into the details of what transpires as it spoils the experience of people who haven't watched the film yet.
Suffice it to say the director Gaspar Noé, who wrote, directed (and I think shot, and edited it as well), has created a brilliant, shocking, and unforgettable film, certainly one the year's best, IMO.
However, be warned, be very warned, that this isn't a film for the squeamish, weak hearted and such, and even people who could stand movies like "Happiness", might have a hard time sitting through it. The film is disturbing on even on a physical level, and the loud gunshots that accompany several quick cuts can be particularly unsettling.
Atul
Sent via Deja.com http://www.deja.com/ Before you buy.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


{% include "inc/header" %}
Please submit Consumer key and Cousumer secret to make Twitter bot.
Failred to authorize.


See: Description
| Interface | Description |
|---|---|
| Builder<IN,GETTER_OUT,SETTER_IN,OUT> |
Last step of the builder that manage the creation of the getter operation.
|
| Consume<IN,GETTER_OUT,SETTER_IN,OUT> |
Last step of the EMBuilder (before the building one) that manage the consumer the value and does not set any value.
|
| DefaultInput<IN,GETTER_OUT,SETTER_IN,OUT> |
Optional step of the builder that allow to specify a default value if the getter of the
From step is null. |
| DefaultOutput<IN,GETTER_OUT,SETTER_IN,OUT> |
Optional step of the builder that allow to specify a default value if the result of the
Transformer step is null. |
| From<IN,OUT> |
First mandatory step of the builder that manage the creation of the getter operation.
|
| Name<IN,OUT> |
First (optional) step of the builder that allow too set a name to the ElementMapper.
|
| To<IN,GETTER_OUT,SETTER_IN,OUT> |
Last step of the builder (before the building one) that manage the creation of the setter operation.
|
| Transformer<IN,GETTER_OUT,SETTER_IN,OUT> |
Optional and repeatable step of the builder that allow to specify a transformer between the result of the getter and the input of the setter.
|
| Class | Description |
|---|---|
| EMBuilder<IN,GETTER_OUT,SETTER_IN,OUT> |
Step builder implementation to help the use to create easily an
ElementMapper ; |
From
: (mandatory) create the getter.DefaultInput
: (optional) allow to specify a default value if the getter of the From
step is null.Transformer
: (optional, repeatable) create the transformer between the result of the getter and the input of the setter. It is possible to concatenate multiple transformations.DefaultOutput
: (optional) allow to specify a default value if the result of the transformation is null.To
: (mandatory) create the setter.ElementMapperBuilder
: (mandatory) create the ElementMapper.From
,
DefaultInput
,
Transformer
,
DefaultOutput
,
To
,
EMBuilder
,
EMBuilder.using(es.utils.mapper.Mapper,es.utils.mapper.impl.object.ClassMapper)
Copyright © 2022. All rights reserved.


"Battleship (also Battleships or Sea Battle) is a guessing game for two players.
It is played on ruled grids (paper or board) on which the players' fleets of ships (including battleships) are marked.
The locations of the fleet are concealed from the other player.
Players alternate turns calling "shots" at the other player's ships, and the objective of the game is to destroy the opposing player's fleet.!"
[From Wikipedia, the free encyclopedia]
About
Calex is a startup specialized in web development.
This website offer you a demo of the classic game Battleship.
Please enjoy this web application and send your feedbacks to hello@calex.com


{% extends "layout.html" %} {% block content %}
Please upload files to their corresponding sections only!!
Once allocated it can't be reverted


--- layout: resume title: "Resume/CV - Matthew DePero" full-name: "Matt DePero" intro: "Hello, my name is" header-img: "img/resume-bg.jpg" profile-img: "img/resume-profile.jpg" ---
| Languages: | Java, C++, Dart, SQL, Python, HTML, CSS, JavaScript, PHP, NodeJS | |
| Web: | JQuery, Bootstrap, Databases, Web APIs (REST & SOAP), TCP/IP, JSON, XML, Laravel | |
| Technologies: | Linux, Git, Vim, Eclipse, FileZilla, CPanel, SSH, Apache, MySQL, SQLite | |
| Classes: | Adv. Algorithms, Data Structures, Web Services, Artificial Intelligence, Machine Learning |


Understand and Incorporate Ultrasound Sensor in our Robot
Combine earlier labs to make a more complex and sophisticated robot
Simulate and demonstrate the robot moving through a maze
Familiarizing Yourself with the Ultrasound Sensor
First, we want to characterize our Ultrasound Sensor. For our tests, we found that there was an accuracy
of about 2 cm. With that in mind, we can code our implementation of the ultrasound sensor to account for this, which we will see in
Demo 1 and 2.
Demo 1
Demo 1 will happen as follows:
Use fourier analysis to plot the spectrum of frequencies played in the demo.
Upon detecting the 550 Hz signal, the robot will
Make 1 rotation that lasts for about 4 seconds
Turn the onboard LED on when detecting an object as seen in the diagram for demo 1
The robot will return to its initial position and wait once more for the 550 Hz signal to repeat the process
Spectrum plot of the frequencies present in the demoDiagram of the demo space
It is important to note that due to space constraints, the table and the recorder's legs interfered with the demo. This explains the extra LED flickers. Barring that, the demo went as expected.
Execution of demo 1.
Demo 2
Demo 2 will execute as follows:
Starting at the position Start, your robot will be placed in your navigation area as shown in Fig. 3,
relative to the three obstacles. The robot will remain in place, motionless, with its onboard LED
OFF.
You will then lure your robot to its left with a bright light, at which point the onboard LED will turn
OFF and your robot will turn in place and follow your bright light in a straight line headed west
(with the light in front of the robot but at least 15-20cm above the US sensor so as not to block its
view cone – see inset of Fig. 3) over a distance of approximately 30cm.
Following the path as in Fig. 4, you will then lure your robot to its right in the same manner as
above, over a distance of about 30cm headed north towards Obstacle 1. From the moment that
your robot detects Obstacle 1, its onboard LED be ON solid. When your robot will be within 5cm
of Obstacle 1, it will stop moving even though you are trying to lure it into the obstacle, it will
remain in place and its onboard LED will continue to remain ON solid (i.e., not blinking).
You will then shine light to your robot’s left side (from the west) trying to lure your robot but it will
not move. You will then shine light to your robot’s right side, at which point your robot will turn in
place and follow your light, and from this moment its onboard LED will turn OFF and remain OFF.
You will lure your robot approximately along the path shown with the long red arrows (first headed
east, then north, then west). As you will lure your robot in the area between the three obstacles,
when the robot’s US detects Obstacle 2 at a distance of 30cm, its LED be ON solid.
When your robot will be within 5cm of Obstacle 2, it will stop moving and remain in place even
though you are trying to lure it into the obstacle, and its onboard LED will be OFF. At this point,
your robot will be motionless and facing west.
You will then shine your bright light from your robot’s left side (south), trying to lure it to go south
towards Obstacle 1 which it will do by turning in place and its onboard LED be ON solid. Your robot
will stop 5cm away from Obstacle 1, at which point its onboard LED will remain ON. At this point,
your robot will be motionless and facing south.
You will then lure your robot to go north (shining light from either side of your robot), at which
point your robot will turn in place and follow your light, and its onboard LED will be OFF. Your robot
will follow your light as it approaches Obstacle 3.
Your robot will continue to navigate towards Obstacle 3, being lured by your light, until it is 5cm
away from Obstacle 3. At that point, your robot will stop moving, and its onboard LED will remain
ON solid.
Below is the demo space.
Diagram of the demo 2 space
Below is a demonstration for demo 2. The demonstration is a bit shaky, but due to time constraints this is the best trial that was found. The only error present is that the light does not function
correctly when it reaches the Obstacle 1 for the second time onwards.
Demonstration of demo 2.


Paragraph with no position: static.
Paragraph with no position: static.
Paragraph with no position: static.
Paragraph with no position: static.
Paragraph with no position: static.
This paragraph is position: static.


Adam Raezler
Vice President
Adam is all about victory. He likes to win and his entire career, from public policy to legislative work to campaigns, has been focused on identifying what a win looks like and how to obtain it. Adam is a big picture guy who sweats the details; he never loses sight of the primary objective, and he has the track record to back it up.
When he's not working the political universe, Adam is a passionate traveler, bike rider, and admirer of fine scotch. You will find him enjoying time with his family and Basenji puppy and he always bleeds Green and White for Michigan State University.


DINNER
Homemade Soup
Chefs homemade soup of the day
8*
Beet Salat
Apples,yellow beets,red beets goat cheese,pomegranate, walnuts & vinaigrette
9*
Green Earth Salat
Organic greens, carrot, fennel blue cheese,shallot vinegrette
8*
Gemischter Salat
Applewood bacon, tomatoes, red onions, eggs,avocado, bleu cheese, crispy wontons
14*
Steak Salat
Hanger steak, spinach, tomatoes shallots,dried cherries,walnuts and blue cheese
14*
Strangolapreti Dumplings
Spinach, bread and cheese in a mushroom broth
9
Specknodel Dumplings
Guyre cheese speck and in a tomato cream sauce
9
Burger
LaFridabeef,caramelized onions, bacon,fries add-ons$ cheese and fried egg
15**
Spaetzle
Homemade noodle with vegetables
16
Homemade Veggie Burger
fennel, celery, onions, chickpeas carrots,sweet potatoes, blackbeans, rice
12**
Crispy Chicken
Baby turnips, brussel sprouts,root vegetable mash, natural jus
17*
Roasted Duck
seared duck and duck confit w/seasonal veggies
19*
Braised Pork Shank
garlic mash potato, brussel sprouts,natural jus
Crispy Pork Belly
served with homemade sweet potaoto dumplings
Short Ribs
Spaetzle, wild mushrooms, truffle cream chives
Naturschnitzel
Salt and pepper chicken schnitzel served with german paototoes
Lasgna
Bolognaise Handmade mozzarella, ricotta cheese, granna, fresh basil, olive oil
16**
Bone in Ribeye for Two
Creekstone farms Cowboy Steak served with bacon brussels sprouts and fingerling pototaoes deep fried in duck fat
*gluten free     **gluten free bun option


UI | UX Designer and Web Developer
Hi! My name is Alex Otieno. I am a Web Developer and Web Designer, and I'm very passionate and dedicated to my work. I have acquired the skills and knowledge necessary to make your project a success. I enjoy every step of the design process, from discussion and collaboration to concept and execution, but I find the most satisfaction in seeing the finished product do everything for you that it was created to do.
Skills
Projects I've worked on
mSwali is a platform that aims to promote the desire & curiosity to know more, within the African adult population, using mobile-based learning games that are fun, rewarding & easily accessible
This is an application that connect Reps to pharmaceutical Agencies
This is a website where users may enter a GitHub username into a form, submit it, and see names and descriptions of that person's public repositories. A user can also look for repositories
This is agular cli application that displays quotes, allow the user to input new quote, upvote , downvote and delete the quote.
You can also reach me through the contact from below


Instructor: Paul Frankland<EMAIL_ADDRESS>Memories are thought to be encoded as enduring physical changes, or ‘engrams’, in the brain. Karl Lashley was among the first to use an empirical systematic approach in an attempt to localize an engram. Famously, his search proved unsuccessful, and his conclusion—that the engram is elusive—became widely influential. From today’s perspective, we appreciate that this elusivity is, at least in part, due to the sparse, distributed and dynamic nature of memory representations in the brain, making engrams challenging to identify and ‘pin down’ using traditional neuroscientific methods. However, new mouse genetic tools have recently been developed which provide unprecedented opportunities to visualize and manipulate defined brain regions and specific cell populations. The goal of this course is to discuss to what extent these contemporary studies have brought us closing to finding the engram.
Tuesdays 2-4 pm in Sidney Smith Hall, room 560A
Students will present and discuss recent ‘engram’ papers. For each class, 2 papers have been selected. For each paper a presenter will be assigned, as well as a discussant. The presentation should be 30-40 minutes followed by 10-15 minutes of discussion.
Non-presenters will read the papers before the class and submit a 0.5-1 page summary of each paper, including 3-4 discussion points/comments/questions. These are to be emailed to the instructor<EMAIL_ADDRESS>no later than 11:59 pm on Monday evening.
1) Presentations (30%). Student will get to present twice during the course. Each presentation is worth 15% of the final grade.
2) Participation in class discussions (40%). This grade will be based on the weekly summaries (20%) as well as ability to lead and participate in class discussions (20%).
3) Assignments (30%). There will be two assignments. Students will write “New and Views” style commentaries (~1000 words) on recent engram papers. The first is due during reading week. The second is due at the end of term. Both contribute 15% to the final grade.
Week 1, January 12: Frankland lecture FINAL (Frankland), course organization
Historical overview of engram studies focusing on the work of Semon, Lashley and Penfield
Week 2, January 19: Seeing the engram, immediate early genes
Guzowski et al, Reijmers et al
Week 3, January 26: Seeing the engram, replay
[Singer et al], [Tambini et al]
Week 4, February 2: Erasing the engram
[Zhou et al], [Nabavi et al]
Week 5, February 9: Reorganizing the engram
[Tayler et al], [Denny et al]
Reading week, February 16: Assignment 1
Week 6, February 23: Distributed engrams
[Tanaka et al], [Wheeler et al]
Week 7, March 1: Erasing pathological engrams
[Ramirez et al (2015)], [Hsiang et al]
Week 8, March 8: Artificially expressing the engram
[Liu et al], [Kim et al]
Week 9, March 15: Creating false engrams
[ramirez et al (2013)], [de Lavilleon et al]
Week 10, March 22: Allocation
[Han et al], [Yiu et al]
Week 11, March 29: Interacting engrams
[Tse et al (2007), Tse et al (2011)], [Richards et al]
Week 12, April 5: Assignment 2


Flags in Canada
A new Canadian flag was raised for the first time in 1965. The red-white-red pattern comes from the flag of the Royal Military College, Kingston, founded in 1876. Red and white had been colours of France and England since the Middle Ages and the national colours of Canada since 1921. The Union Jack is our official Royal Flag. The Canadian Red Ensign served as the Canadian flag for about 100 years. The provinces and territories also have flags that embody their distinct traditions.
The maple leaf
The maple leaf is Canada’s best-known symbol. Maple leaves were adopted as a symbol by French Canadians in the 1700s, have appeared on Canadian uniforms and insignia since the 1850s, and are carved into the headstones of our fallen soldiers buried overseas and in Canada.
The fleur-de-lys
It is said that the lily flower (“fleur-de-lys”) was adopted by the French king in the year 496. It became the symbol of French royalty for more than 1,000 years, including the colony of New France. Revived at Confederation, the fleur-de-lys was included in the Canadian Red Ensign. In 1948 Quebec adopted its own flag, based on the Cross and the fleur-de-lys.


This sample visualization container can be accessed in two ways:
from within the Pentaho web server, e.g.:
http://localhost:8080/pentaho/content/common-ui/resources/web/pentaho/visual/samples/sandbox/index.html,
or,
from another local web server, simulating an embedded scenario,
and assuming that the Pentaho web server is available
at http://localhost:8080/pentaho/.


Creates a Gluon Mobile based Java application with a single
View running on Gluon VM. It is targeted for Android, iOS,
desktop and embedded devices, as a Gradle project. The Gradle project
applies the jfxmobile plugin to run, build and debug your project.


flask.helpers
~~~~~~~~~~~~~
Implements various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
from __future__ import with_statement
import os
import sys
import pkgutil
import posixpath
import mimetypes
from time import time
from zlib import adler32
from threading import RLock
from werkzeug.routing import BuildError
from werkzeug.urls import url_quote
from functools import update_wrapper
from werkzeug.datastructures import Headers
from werkzeug.exceptions import NotFound
this was moved in 0.7
try:
from werkzeug.wsgi import wrap_file
except ImportError:
from werkzeug.utils import wrap_file
from jinja2 import FileSystemLoader
from .globals import session, _request_ctx_stack, _app_ctx_stack, \
current_app, request
sentinel
_missing = object()
what separators does this operating system provide that are not a slash? this is used by the send_from_directory function to ensure that nobody is able to access files from outside the filesystem.
_os_alt_seps = list(sep for sep in [os.path.sep, os.path.altsep]
if sep not in (None, '/'))
Internal helper that returns the default endpoint for a given
def _endpoint_from_view_func(view_func):
function. This always is the function name.
assert view_func is not None, 'expected view func if endpoint ' \
'is not provided.'
return view_func.__name__
Request contexts disappear when the response is started on the server.
def stream_with_context(generator_or_function):
This is done for efficiency reasons and to make it less likely to encounter memory leaks with badly written WSGI middlewares. The downside is that if you are using streamed responses, the generator cannot access request bound information any more.
This function however can help you keep the context around for longer::
from flask import stream_with_context, request, Response
@app.route('/stream')
def streamed_response():
@stream_with_context
def generate():
yield 'Hello '
yield request.args['name']
yield '!'
return Response(generate())
Alternatively it can also be used around a specific generator::
from flask import stream_with_context, request, Response
@app.route('/stream')
def streamed_response():
def generate():
yield 'Hello '
yield request.args['name']
yield '!'
return Response(stream_with_context(generate()))
.. versionadded:: 0.9
try:
gen = iter(generator_or_function)
except TypeError:
def decorator(*args, **kwargs):
gen = generator_or_function()
return stream_with_context(gen)
return update_wrapper(decorator, generator_or_function)
def generator():
ctx = _request_ctx_stack.top
if ctx is None:
raise RuntimeError('Attempted to stream with context but '
'there was no context in the first place to keep around.')
with ctx:
Dummy sentinel. Has to be inside the context block or we're not actually keeping the context around.
yield None
The try/finally is here so that if someone passes a WSGI level iterator in we're still running the cleanup logic. Generators don't need that because they are closed on their destruction automatically.
try:
for item in gen:
yield item
finally:
if hasattr(gen, 'close'):
gen.close()
The trick is to start the generator. Then the code execution runs until the first dummy None is yielded at which point the context was already pushed. This item is discarded. Then when the iteration continues the real generator is executed.
wrapped_g = generator()
wrapped_g.next()
return wrapped_g
Sometimes it is necessary to set additional headers in a view. Because
def make_response(*args):
views do not have to return response objects but can return a value that is converted into a response object by Flask itself, it becomes tricky to add headers to it. This function can be called instead of using a return and you will get a response object which you can use to attach headers.
If view looked like this and you want to add a new header::
def index():
return render_template('index.html', foo=42)
You can now do something like this::
def index():
response = make_response(render_template('index.html', foo=42))
response.headers['X-Parachutes'] = 'parachutes are cool'
return response
This function accepts the very same arguments you can return from a view function. This for example creates a response with a 404 error code::
response = make_response(render_template('not_found.html'), 404)
The other use case of this function is to force the return value of a view function into a response which is helpful with view decorators::
response = make_response(view_function())
response.headers['X-Parachutes'] = 'parachutes are cool'
Internally this function does the following things:
flask.Flask.make_response
is invoked with it.flask.Flask.make_response
function as tuple... versionadded:: 0.6
if not args:
return current_app.response_class()
if len(args) == 1:
args = args[0]
return current_app.make_response(args)
Generates a URL to the given endpoint with the method provided.
def url_for(endpoint, **values):
Variable arguments that are unknown to the target endpoint are appended
to the generated URL as query arguments. If the value of a query argument
is None
, the whole pair is skipped. In case blueprints are active
you can shortcut references to the same blueprint by prefixing the
local endpoint with a dot (.
).
This will reference the index function local to the current blueprint::
url_for('.index')
For more information, head over to the :ref:Quickstart <url-building>
.
To integrate applications, :class:Flask
has a hook to intercept URL build
errors through :attr:Flask.build_error_handler
. The url_for
function
results in a :exc:~werkzeug.routing.BuildError
when the current app does
not have a URL for the given endpoint and values. When it does, the
:data:~flask.current_app
calls its :attr:~Flask.build_error_handler
if
it is not None
, which can return a string to use as the result of
url_for
(instead of url_for
's default to raise the
:exc:~werkzeug.routing.BuildError
exception) or re-raise the exception.
An example::
def external_url_handler(error, endpoint, **values):
"Looks up an external URL when `url_for` cannot build a URL."
# This is an example of hooking the build_error_handler.
# Here, lookup_url is some utility function you've built
# which looks up the endpoint in some external URL registry.
url = lookup_url(endpoint, **values)
if url is None:
# External lookup did not have a URL.
# Re-raise the BuildError, in context of original traceback.
exc_type, exc_value, tb = sys.exc_info()
if exc_value is error:
raise exc_type, exc_value, tb
else:
raise error
# url_for will use this result, instead of raising BuildError.
return url
app.build_error_handler = external_url_handler
Here, error
is the instance of :exc:~werkzeug.routing.BuildError
, and
endpoint
and **values
are the arguments passed into url_for
. Note
that this is for building URLs outside the current application, and not for
handling 404 NotFound errors.
.. versionadded:: 0.10
The _scheme
parameter was added.
.. versionadded:: 0.9
The _anchor
and _method
parameters were added.
.. versionadded:: 0.9
Calls :meth:Flask.handle_build_error
on
:exc:~werkzeug.routing.BuildError
.
:param endpoint: the endpoint of the URL (name of the function)
:param values: the variable arguments of the URL rule
:param _external: if set to True
, an absolute URL is generated. Server
address can be changed via SERVER_NAME
configuration variable which
defaults to localhost
.
:param _scheme: a string specifying the desired URL scheme. The _external
parameter must be set to True
or a ValueError
is raised.
:param _anchor: if provided this is added as anchor to the URL.
:param _method: if provided this explicitly specifies an HTTP method.
appctx = _app_ctx_stack.top
reqctx = _request_ctx_stack.top
if appctx is None:
raise RuntimeError('Attempted to generate a URL without the '
'application context being pushed. This has to be '
'executed when application context is available.')
If request specific information is available we have some extra features that support "relative" urls.
if reqctx is not None:
url_adapter = reqctx.url_adapter
blueprint_name = request.blueprint
if not reqctx.request._is_old_module:
if endpoint[:1] == '.':
if blueprint_name is not None:
endpoint = blueprint_name + endpoint
else:
endpoint = endpoint[1:]
else:
TODO: get rid of this deprecated functionality in 1.0
if '.' not in endpoint:
if blueprint_name is not None:
endpoint = blueprint_name + '.' + endpoint
elif endpoint.startswith('.'):
endpoint = endpoint[1:]
external = values.pop('_external', False)
Otherwise go with the url adapter from the appctx and make the urls external by default.
else:
url_adapter = appctx.url_adapter
if url_adapter is None:
raise RuntimeError('Application was not able to create a URL '
'adapter for request independent URL generation. '
'You might be able to fix this by setting '
'the SERVER_NAME config variable.')
external = values.pop('_external', True)
anchor = values.pop('_anchor', None)
method = values.pop('_method', None)
scheme = values.pop('_scheme', None)
appctx.app.inject_url_defaults(endpoint, values)
if scheme is not None:
if not external:
raise ValueError('When specifying _scheme, _external must be True')
url_adapter.url_scheme = scheme
try:
rv = url_adapter.build(endpoint, values, method=method,
force_external=external)
except BuildError, error:
We need to inject the values again so that the app callback can deal with that sort of stuff.
values['_external'] = external
values['_anchor'] = anchor
values['_method'] = method
return appctx.app.handle_url_build_error(error, endpoint, values)
if anchor is not None:
rv += '#' + url_quote(anchor)
return rv
Loads a macro (or variable) a template exports. This can be used to
def get_template_attribute(template_name, attribute):
invoke a macro from within Python code. If you for example have a
template named _cider.html
with the following contents:
.. sourcecode:: html+jinja
{% macro hello(name) %}Hello !{% endmacro %}
You can access this from Python code like this::
hello = get_template_attribute('_cider.html', 'hello')
return hello('World')
.. versionadded:: 0.2
:param template_name: the name of the template :param attribute: the name of the variable of macro to acccess
return getattr(current_app.jinja_env.get_template(template_name).module,
attribute)
Flashes a message to the next request. In order to remove the
def flash(message, category='message'):
flashed message from the session and to display it to the user,
the template has to call :func:get_flashed_messages
.
.. versionchanged:: 0.3
category
parameter added.
:param message: the message to be flashed.
:param category: the category for the message. The following values
are recommended: 'message'
for any kind of message,
'error'
for errors, 'info'
for information
messages and 'warning'
for warnings. However any
kind of string can be used as category.
Original implementation:
session.setdefault('_flashes', []).append((category, message))
This assumed that changes made to mutable structures in the session are are always in sync with the sess on object, which is not true for session implementations that use external storage for keeping their keys/values.
flashes = session.get('_flashes', [])
flashes.append((category, message))
session['_flashes'] = flashes
Pulls all flashed messages from the session and returns them.
def get_flashed_messages(with_categories=False, category_filter=[]):
Further calls in the same request to the function will return
the same messages. By default just the messages are returned,
but when with_categories
is set to True
, the return value will
be a list of tuples in the form (category, message)
instead.
Filter the flashed messages to one or more categories by providing those
categories in category_filter
. This allows rendering categories in
separate html blocks. The with_categories
and category_filter
arguments are distinct:
with_categories
controls whether categories are returned with message
text (True
gives a tuple, where False
gives just the message text).category_filter
filters the messages down to only those matching the
provided categories.See :ref:message-flashing-pattern
for examples.
.. versionchanged:: 0.3
with_categories
parameter added.
.. versionchanged:: 0.9
category_filter
parameter added.
:param with_categories: set to True
to also receive categories.
:param category_filter: whitelist of categories to limit return values
flashes = _request_ctx_stack.top.flashes
if flashes is None:
_request_ctx_stack.top.flashes = flashes = session.pop('_flashes') \
if '_flashes' in session else []
if category_filter:
flashes = filter(lambda f: f[0] in category_filter, flashes)
if not with_categories:
return [x[1] for x in flashes]
return flashes
Sends the contents of a file to the client. This will use the
def send_file(filename_or_fp, mimetype=None, as_attachment=False,
attachment_filename=None, add_etags=True,
cache_timeout=None, conditional=False):
most efficient method available and configured. By default it will
try to use the WSGI server's file_wrapper support. Alternatively
you can set the application's :attr:~Flask.use_x_sendfile
attribute
to True
to directly emit an X-Sendfile
header. This however
requires support of the underlying webserver for X-Sendfile
.
By default it will try to guess the mimetype for you, but you can
also explicitly provide one. For extra security you probably want
to send certain files as attachment (HTML for instance). The mimetype
guessing requires a filename
or an attachment_filename
to be
provided.
Please never pass filenames to this function from user sources without checking them first. Something like this is usually sufficient to avoid security problems::
if '..' in filename or filename.startswith('/'):
abort(404)
.. versionadded:: 0.2
.. versionadded:: 0.5
The add_etags
, cache_timeout
and conditional
parameters were
added. The default behavior is now to attach etags.
.. versionchanged:: 0.7 mimetype guessing and etag support for file objects was deprecated because it was unreliable. Pass a filename if you are able to, otherwise attach an etag yourself. This functionality will be removed in Flask 1.0
.. versionchanged:: 0.9 cache_timeout pulls its default from application config, when None.
:param filename_or_fp: the filename of the file to send. This is
relative to the :attr:~Flask.root_path
if a
relative path is specified.
Alternatively a file object might be provided
in which case X-Sendfile
might not work and
fall back to the traditional method. Make sure
that the file pointer is positioned at the start
of data to send before calling :func:send_file
.
:param mimetype: the mimetype of the file if provided, otherwise
auto detection happens.
:param as_attachment: set to True
if you want to send this file with
a Content-Disposition: attachment
header.
:param attachment_filename: the filename for the attachment if it
differs from the file's filename.
:param add_etags: set to False
to disable attaching of etags.
:param conditional: set to True
to enable conditional responses.
:param cache_timeout: the timeout in seconds for the headers. When None
(default), this value is set by
:meth:~Flask.get_send_file_max_age
of
:data:~flask.current_app
.
mtime = None
if isinstance(filename_or_fp, basestring):
filename = filename_or_fp
file = None
else:
from warnings import warn
file = filename_or_fp
filename = getattr(file, 'name', None)
XXX: this behavior is now deprecated because it was unreliable. removed in Flask 1.0
if not attachment_filename and not mimetype \
and isinstance(filename, basestring):
warn(DeprecationWarning('The filename support for file objects '
'passed to send_file is now deprecated. Pass an '
'attach_filename if you want mimetypes to be guessed.'),
stacklevel=2)
if add_etags:
warn(DeprecationWarning('In future flask releases etags will no '
'longer be generated for file objects passed to the send_file '
'function because this behavior was unreliable. Pass '
'filenames instead if possible, otherwise attach an etag '
'yourself based on another value'), stacklevel=2)
if filename is not None:
if not os.path.isabs(filename):
filename = os.path.join(current_app.root_path, filename)
if mimetype is None and (filename or attachment_filename):
mimetype = mimetypes.guess_type(filename or attachment_filename)[0]
if mimetype is None:
mimetype = 'application/octet-stream'
headers = Headers()
if as_attachment:
if attachment_filename is None:
if filename is None:
raise TypeError('filename unavailable, required for '
'sending as attachment')
attachment_filename = os.path.basename(filename)
headers.add('Content-Disposition', 'attachment',
filename=attachment_filename)
if current_app.use_x_sendfile and filename:
if file is not None:
file.close()
headers['X-Sendfile'] = filename
headers['Content-Length'] = os.path.getsize(filename)
data = None
else:
if file is None:
file = open(filename, 'rb')
mtime = os.path.getmtime(filename)
data = wrap_file(request.environ, file)
rv = current_app.response_class(data, mimetype=mimetype, headers=headers,
direct_passthrough=True)
if we know the file modification date, we can store it as the the time of the last modification.
if mtime is not None:
rv.last_modified = int(mtime)
rv.cache_control.public = True
if cache_timeout is None:
cache_timeout = current_app.get_send_file_max_age(filename)
if cache_timeout is not None:
rv.cache_control.max_age = cache_timeout
rv.expires = int(time() + cache_timeout)
if add_etags and filename is not None:
rv.set_etag('flask-%s-%s-%s' % (
os.path.getmtime(filename),
os.path.getsize(filename),
adler32(
filename.encode('utf-8') if isinstance(filename, unicode)
else filename
) & 0xffffffff
))
if conditional:
rv = rv.make_conditional(request)
make sure we don't send x-sendfile for servers that ignore the 304 status code for x-sendfile.
if rv.status_code == 304:
rv.headers.pop('x-sendfile', None)
return rv
Safely join directory
and filename
.
def safe_join(directory, filename):
Example usage::
@app.route('/wiki/<path:filename>')
def wiki_page(filename):
filename = safe_join(app.config['WIKI_FOLDER'], filename)
with open(filename, 'rb') as fd:
content = fd.read() # Read and process the file content...
:param directory: the base directory.
:param filename: the untrusted filename relative to that directory.
:raises: :class:~werkzeug.exceptions.NotFound
if the resulting path
would fall out of directory
.
filename = posixpath.normpath(filename)
for sep in _os_alt_seps:
if sep in filename:
raise NotFound()
if os.path.isabs(filename) or \
filename == '..' or \
filename.startswith('../'):
raise NotFound()
return os.path.join(directory, filename)
Send a file from a given directory with :func:send_file
. This
def send_from_directory(directory, filename, **options):
is a secure way to quickly expose static files from an upload folder or something similar.
Example usage::
@app.route('/uploads/<path:filename>')
def download_file(filename):
return send_from_directory(app.config['UPLOAD_FOLDER'],
filename, as_attachment=True)
.. admonition:: Sending files and Performance
It is strongly recommended to activate either X-Sendfile
support in
your webserver or (if no authentication happens) to tell the webserver
to serve files for the given path on its own without calling into the
web application for improved performance.
.. versionadded:: 0.5
:param directory: the directory where all the files are stored.
:param filename: the filename relative to that directory to
download.
:param options: optional keyword arguments that are directly
forwarded to :func:send_file
.
filename = safe_join(directory, filename)
if not os.path.isfile(filename):
raise NotFound()
options.setdefault('conditional', True)
return send_file(filename, **options)
Returns the path to a package or cwd if that cannot be found. This
def get_root_path(import_name):
returns the path of a package or the folder that contains a module.
Not to be confused with the package path returned by :func:find_package
.
Module already imported and has a file attribute. Use that first.
mod = sys.modules.get(import_name)
if mod is not None and hasattr(mod, '__file__'):
return os.path.dirname(os.path.abspath(mod.__file__))
Next attempt: check the loader.
loader = pkgutil.get_loader(import_name)
Loader does not exist or we're referring to an unloaded main module or a main module without path (interactive sessions), go with the current working directory.
if loader is None or import_name == '__main__':
return os.getcwd()
For .egg, zipimporter does not have get_filename until Python 2.7. Some other loaders might exhibit the same behavior.
if hasattr(loader, 'get_filename'):
filepath = loader.get_filename(import_name)
else:
Fall back to imports.
__import__(import_name)
filepath = sys.modules[import_name].__file__
filepath is import_name.py for a module, or init.py for a package.
return os.path.dirname(os.path.abspath(filepath))
Finds a package and returns the prefix (or None if the package is
def find_package(import_name):
not installed) as well as the folder that contains the package or module as a tuple. The package path returned is the module that would have to be added to the pythonpath in order to make it possible to import the module. The prefix is the path below which a UNIX like folder structure exists (lib, share etc.).
root_mod_name = import_name.split('.')[0]
loader = pkgutil.get_loader(root_mod_name)
if loader is None or import_name == '__main__':
import name is not found, or interactive/main module
package_path = os.getcwd()
else:
For .egg, zipimporter does not have get_filename until Python 2.7.
if hasattr(loader, 'get_filename'):
filename = loader.get_filename(root_mod_name)
elif hasattr(loader, 'archive'):
zipimporter's loader.archive points to the .egg or .zip archive filename is dropped in call to dirname below.
filename = loader.archive
else:
At least one loader is missing both get_filename and archive: Google App Engine's HardenedModulesHook
Fall back to imports.
__import__(import_name)
filename = sys.modules[import_name].__file__
package_path = os.path.abspath(os.path.dirname(filename))
package_path ends with init.py for a package
if loader.is_package(root_mod_name):
package_path = os.path.dirname(package_path)
site_parent, site_folder = os.path.split(package_path)
py_prefix = os.path.abspath(sys.prefix)
if package_path.startswith(py_prefix):
return py_prefix, package_path
elif site_folder.lower() == 'site-packages':
parent, folder = os.path.split(site_parent)
Windows like installations
if folder.lower() == 'lib':
base_dir = parent
UNIX like installations
elif os.path.basename(parent).lower() == 'lib':
base_dir = os.path.dirname(parent)
else:
base_dir = site_parent
return base_dir, package_path
return None, package_path
A decorator that converts a function into a lazy property. The
class locked_cached_property(object):
function wrapped is called the first time to retrieve the result and then that calculated result is used the next time you access the value. Works like the one in Werkzeug but has a lock for thread safety.
def __init__(self, func, name=None, doc=None):
self.__name__ = name or func.__name__
self.__module__ = func.__module__
self.__doc__ = doc or func.__doc__
self.func = func
self.lock = RLock()
def __get__(self, obj, type=None):
if obj is None:
return self
with self.lock:
value = obj.__dict__.get(self.__name__, _missing)
if value is _missing:
value = self.func(obj)
obj.__dict__[self.__name__] = value
return value
class _PackageBoundObject(object):
def __init__(self, import_name, template_folder=None):
: The name of the package or module. Do not change this once : it was set by the constructor.
self.import_name = import_name
: location of the templates. None
if templates should not be
: exposed.
self.template_folder = template_folder
: Where is the app root located?
self.root_path = get_root_path(self.import_name)
self._static_folder = None
self._static_url_path = None
def _get_static_folder(self):
if self._static_folder is not None:
return os.path.join(self.root_path, self._static_folder)
def _set_static_folder(self, value):
self._static_folder = value
static_folder = property(_get_static_folder, _set_static_folder)
del _get_static_folder, _set_static_folder
def _get_static_url_path(self):
if self._static_url_path is None:
if self.static_folder is None:
return None
return '/' + os.path.basename(self.static_folder)
return self._static_url_path
def _set_static_url_path(self, value):
self._static_url_path = value
static_url_path = property(_get_static_url_path, _set_static_url_path)
del _get_static_url_path, _set_static_url_path
This is True
if the package bound object's container has a
@property
def has_static_folder(self):
return self.static_folder is not None
The Jinja loader for this package bound object.
@locked_cached_property
def jinja_loader(self):
.. versionadded:: 0.5
if self.template_folder is not None:
return FileSystemLoader(os.path.join(self.root_path,
self.template_folder))
Provides default cache_timeout for the :func:send_file
functions.
def get_send_file_max_age(self, filename):
By default, this function returns SEND_FILE_MAX_AGE_DEFAULT
from
the configuration of :data:~flask.current_app
.
Static file functions such as :func:send_from_directory
use this
function, and :func:send_file
calls this function on
:data:~flask.current_app
when the given cache_timeout is None
. If a
cache_timeout is given in :func:send_file
, that timeout is used;
otherwise, this method is called.
This allows subclasses to change the behavior when sending files based on the filename. For example, to set the cache timeout for .js files to 60 seconds::
class MyFlask(flask.Flask):
def get_send_file_max_age(self, name):
if name.lower().endswith('.js'):
return 60
return flask.Flask.get_send_file_max_age(self, name)
.. versionadded:: 0.9
return current_app.config['SEND_FILE_MAX_AGE_DEFAULT']
Function used internally to send static files from the static
def send_static_file(self, filename):
if not self.has_static_folder:
raise RuntimeError('No static folder for this object')
Ensure get_send_file_max_age is called in all cases. Here, we ensure get_send_file_max_age is called for Blueprints.
cache_timeout = self.get_send_file_max_age(filename)
return send_from_directory(self.static_folder, filename,
cache_timeout=cache_timeout)
Opens a resource from the application's resource folder. To see
def open_resource(self, resource, mode='rb'):
how this works, consider the following folder structure::
/myapplication.py
/schema.sql
/static
/style.css
/templates
/layout.html
/index.html
If you want to open the schema.sql
file you would do the
following::
with app.open_resource('schema.sql') as f:
contents = f.read()
do_something_with(contents)
:param resource: the name of the resource. To access resources within subfolders use forward slashes as separator.
if mode not in ('r', 'rb'):
raise ValueError('Resources can only be opened for reading')
return open(os.path.join(self.root_path, resource), mode)


Please fill out the form below in order to submit your expense ticket.
Employee ID:
First name:
Last name :
Expense Type
Lodging
Travel
Food
Other
Amount
Today's Date:
Description


Transfer allowance from {{tokenContract.options.address}} held by {{this.identity.address}}
Balance: {{balance | async}}


Sally Lindsay addresses Coronation Street return rumours as fan favourite Shelley
Sally, 46, appeared on Corrie for five years until 2006 and since then has gone on to star in a number of TV shows
by Irishmirror.ieActress Sally Lindsay has addressed rumours she could be returning to Coronation Street as fan favourite Shelley.
Sally, 46, appeared on the ITV soap for five years until 2006 and since then has gone on to star in a number of TV shows including Scott & Bailey, Mount Pleasant, Ordinary Lies and, most recently, Cold Call.
She also appeared as a panelist on Loose Women from 2011 until 2004.
Recently, reports surfaced that she would be returning to the cobbles after she was spotted on set.
However, appearing on This Morning today, she revealed what was really going on.
Confirming she had been back for a documentary marking the soap's 60th birthday, she said: "It's basically a load of us that have left and have done quite well, we were talking about our memories of the street and how that set our careers up.
"So I did this little 10 minute interview, didn't think anything of it. Then the next minute I'm going back to the street. I was like, 'That's the first I've heard!'"
Asked whether she would ever return, she said: "Oh gosh, I'd never say never. I loved it - it was brilliant, it still is brillaint."
Her character Shelley was involved in a number of major storylines during her time on the cobbles, including a bigamous marriage to Peter Barlow and her abusive one with Charlie Stubbs, played by Bill Ward.

She later dumped Charlie at the altar, but had a one night stand with him and got pregnant before leaving the cobbles.
*This Morning airs weekdays at 12.30pm on ITV


This map shows observation locations from iNaturalist.org animated by the date those observations were created (not when they were observed), kind of a geographical story of how the iNat community has grown over time.
Observations were exported from the iNaturalist database in November 2015, selecting only observations with locations observed after 2008-01-01 (around the time the site launched). Coordinates are all the public, so geoprivacy has been maintained, and all coordinates were rounded to 3 places to stay within CartoDB's data storage limitations. This dataset can be accessed and used at https://kueda.cartodb.com/tables/inaturalist_observation_by_date.
This map uses CartoDB's amazing Torque, a tool for making animated time series maps, as well as the CartoDB Dark Matter basemap. Both are available for free from CartoDB. The map interactivity uses Leaflet, and other controls use jQuery UI. Most of this code is simply a modification of CartoDB's own Torque example. Many thanks to CartoDB for providing all these free tools! Icons come from Font Awesome.


| setSymbolLookup {quantmod} | R Documentation |
Create and manage Symbol defaults lookup table within
R session for use in getSymbols
calls.
setSymbolLookup(...) getSymbolLookup(Symbols=NULL) saveSymbolLookup(file,dir="") loadSymbolLookup(file,dir="")
... |
name=value pairs for symbol defaults |
Symbols |
name of symbol(s) |
file |
filename |
dir |
directory of filename |
Use of these functions allows the user to specify
a set of default parameters for each Symbol
to be
loaded.
Different sources (e.g. yahoo, MySQL, csv),
can be specified for each Symbol of
interest. The sources must be valid
getSymbols
methods - see getSymbols
for details on which methods are available, as well as
how to add additional methods.
The argument list to setSymbolLookup
is
simply the unquoted name of the Symbol
matched
to the desired default source, or list of Symbol
specific parameters.
For example, to signify that the stock data for
Sun Microsystems (JAVA) should be downloaded from
Yahoo! Finance, one would call
setSymbolLookup(JAVA='yahoo')
or setSymbolLookup(JAVA=list(src='yahoo'))
It is also possible to specify additional,
possibly source specific, lookup details on
a per symbol basis. These include an alternate
naming convention (useful for sites like Yahoo! where
certain non-traded symbols are prepended with a caret,
or more correctly a curcumflex accent. In that case one would
specify setSymbolLookup(DJI=list(name="^DJI",src="yahoo"))
)
as well as passed parameters like dbname
and
password
for database sources. See the
specific getSymbols function related to the source
in question for more details of each implementation.
If a single named list is passed into the function without naming the list as a parameter, the names of this list will be presumed to be symbol names to be added to the current list of symbols.
All changes are made to the current list, and will
persist only until the end of the session. To always
use the same defaults it is necessary to call
setSymbolLookup
with the appropriate
parameters from a startup file (e.g.
.Rprofile) or to use saveSymbolLookup
and
loadSymbolLookup
to save and restore lookup
tables.
To unset a specific Symbol's defaults, simply assign
NULL
to the Symbol.
Called for its side effects, the function changes the
options
value for the specified Symbol
through a call to options(getSymbols.sources=...)
Changes are NOT persistent across sessions, as the table is stored in the session options by default.
This may change to allow for an easier to manage process, as for now it is designed to minimize the clutter created during a typical session.
Jeffrey A. Ryan
setSymbolLookup(QQQQ='yahoo',DIA='MySQL') getSymbolLookup('QQQQ') getSymbolLookup(c('QQQQ','DIA')) ## Not run: ## Will download QQQQ from yahoo ## and load DIA from MySQL getSymbols(c('QQQQ','DIA')) ## End(Not run) ## Use something like this to always retrieve ## from the same source .First <- function() { require(quantmod,quietly=TRUE) quantmod::setSymbolLookup(JAVA="MySQL") } ## OR ## Not run: saveSymbolLookup() loadSymbolLookup() ## End(Not run)


High energy protons¶
Summary¶
Protons have a rest mass equivalent to an energy of around 938 MeV. As the proton is accelerated, due to special relativistic effects, their mass increases. In order to understand the physics at conditions close to the Big Bang, particle accelerators such as the Large Hadron Collider (LHC) accelerates protons and other charged particles close to the speed of light. For example in LHC, protons are accelerated to energies of 7 TeV, i.e. ~7000 times their rest mass. Due to this increase in their mass/energy their behaviour in a gravitational field will be modified. Here we study these effects as the proton’s velocity approaches the speed of light. We extend this discussion to Planck energies and look at the feasibility of the universe having gone through a Planck epoch.
# Import relevant packages and constants
import math
import matplotlib.pyplot as plt
import numpy as np
from astropy import units as u
from astropy.constants.si import c, G, m_p, m_e, e, eps0, h, hbar
from astropy.cosmology import WMAP9 as cosmo
# c = speed of light
# e = charge of proton
# eps0= Vacuum electric permittivity
# G = universal gravatational constant
# h = Planck's constant
# hbar= reduced Planck's constant
# m_e = rest mass of electron
# m_p = rest mass of proton
1.Introduction¶
The gravitational force between two protons of mass \(m_p\) separated by a distance \(r\) is given by the Newton’s law as:
\(F_g = \frac{G m_p^2}{r^2} \quad (1)\)
For instance, two protons separated by a distance of 1 fm (typical nuclear scale) will experience a attractive force of \(1.87 \times 10^{-34} N\).
# Let r be the separation of 1 fm
r = (1*u.fm).to(u.m)
# The Gravitational force Fg between two protons
Fg = (G * m_p * m_p) / (r * r)
print(f"Gravitational force between two protons of mass {m_p:.2e} at a distance {r} = {Fg:.2e}")
Gravitational force between two protons of mass 1.67e-27 kg at a distance 1e-15 m = 1.87e-34 kg m / s2
This is beyond the experimental limit of force that can be detected, which is \(10^{-24}\) N (Biercuk et al. 2010).
For the gravitational force between two particles at a distance of 1 fm to be equal to this observable limit, their mass has to be \(1.22 \times 10^{-22} kg\). For protons to have such a high mass they have to accelerated to higher speeds.
# Let F_el be the experimental limit of detectable force
F_el = (1e-24*u.N).decompose()
# The mass at the experimental limit m_el
m_el = ((F_el * r * r)/G)** 0.5
print(f"The mass of particles separated by a distance of {r} at the experimental detection limit = {m_el:.2e}")
The mass of particles separated by a distance of 1e-15 m at the experimental detection limit = 1.22e-22 kg
Another fundamental parameter associated with the proton is its charge. The electrostatic repulsive (Coulomb) force between two protons of charge \(e\) separated by a distance \(r\) is given by:
\(F_e = k_e \frac{e^2}{r^2} \quad (2)\)
where \(k_e = 9\times 10^{9} N m^2/C^2\) is the permitivity constant. In SI units, \(F_e = 2.31 \times 10^{2} C^2/(F m)\).
# Let ke be the Coulomb constant and e the charge
ke = 1/(4*np.pi*eps0)
# The Coulomb force Fe between two protons:
Fe = (ke * e.si * e.si) / (r * r)
print(f"Coulomb repulsive force between two protons of chrage {e.si:.2e} at a distance {r} = {Fe:.2e}")
Coulomb repulsive force between two protons of chrage 1.60e-19 C at a distance 1e-15 m = 2.31e+02 C2 / (F m)
The electrostatic force between two protons is 36 orders greaters than the gravitational force.
For the Gravitation force to be equal to Coulomb force between two protons, i.e. \(\frac{G m_p^{'2}}{r^2}=\frac{k_e e^2}{r^2}\), the mass of the proton should be
\( m'_p=\sqrt{\frac{k_e e^2}{G}} = 1.86 \times 10^{-9}\quad(3)\)
# Let mpp be the mass where Gravitational and elctrostatic force becomes equal
mpp = np.sqrt((ke * e.si * e.si) / G )
mpp = mpp.decompose()
print(f"Mass of proton when gravity balances electrostatic repulsion = {mpp:.2e}")
Mass of proton when gravity balances electrostatic repulsion = 1.86e-09 kg
Due to special relativistic effcts, as a particle of rest mass (\(m_0\)) travels with a velocity (\(v\)) close to the speed of light (\(c\)), its mass increases by a factor \(\gamma\) given by:
\(\gamma=\frac{1}{\sqrt(1-v^2/c^2)} \quad(4)\)
The increased mass (\(m\)) is given by
\(m= \gamma m_0 \quad (5)\)
For instance at the limit of detection the mass of proton \(10^{-22} kg\) corresponds to a \(\gamma\) of 73000.
2. Relativistic effects¶
Q 2.1¶
How does the mass of the proton increase as its velocity tends to \(c\)?
For protons of rest mass \(m_p\), the mass is given as \(m'_p=\gamma m_p\). From equations (4) & (5), we obtain the following expression for the velocity of high energy protons
\(v = c\sqrt{1-(m_p/m_p')^2} \quad(6)\)
# Calculating the mass (in GeV) as a function of velocity (in units of c)
# Set the range and stepsize of velocity in units of c
v = np.arange(start=0.99, stop=0.999, step=.0001)*c
# Calculate the gamma factor and mass
gamma = 1/(np.sqrt(1-(v*v)/(c*c)))
mpp = m_p * gamma
# Set the range and stepsize of mass in units of m_p
mpv = np.arange(start=1000, stop=11000, step=100)*m_p
# Calculate the velocity
vv = c * np.sqrt(1 - (m_p/mpv)**2)
# Make the plots
fig, (ax1, ax2) = plt.subplots(1, 2,figsize=(10,5))
#fig.suptitle('Variation with c')
# Variation of proton mass with velocity
ax1.plot(v/c, (mpp * c *c).to(u.GeV),lw=2,c='b')
ax1.set_xlabel('v/c ')
ax1.set_ylabel("$m_p'$ (GeV)")
ax1.grid(True)
# Difference in proton speed and light speed as a fucntion of proton mass
ax2.plot( (mpv * c *c).to(u.GeV),(c-vv),lw=2,c='red')
ax2.set_xlabel("$m'_p$ (GeV)")
ax2.set_ylabel("c-v (m/s)")
ax2.grid(True)
plt.show()
Q 2.2¶
Given the above difference in the speeds of the proton and light, what will be the separation between these high energy proton and photon after:
one year?
Hubble time?
Hubble time is the age of the universe ~ 13.8 Billion years, inverse of which gives the Hubble’s constant \(H_0\).

The Compton wavelength (\(\lambda_c\)) of a particle is same as the wavelength of a photon having the same energy as the mass (energy) of the particle and is given by:
\(\lambda_c = \frac{h}{m_p c} \quad (7)\).
Now we have: \((c-v)/H_0 = \lambda_c \quad (8)\),
so the expression for \(\gamma\) then becomes:
\(\gamma = \left[1-(1-(\lambda_c H_0/c)^2)^{-1/2}\right] \quad (9)\).
Since \((\lambda_c H_0/c)\sim 10^{-41} << 1\), we can expand eqaution (9) binomially and neglect the higher order terms to get:
\(\gamma = (2 \lambda_c H_0 /c)^{-1/2} \quad (10)\).
# Calculate the Compton length of a proton
cl = h/(m_p * c)
print(f"Compton Length = {cl.decompose():.2e}")
H0 = cosmo.H(0).decompose()
#gamma at Compton Length
gcl = (2*cl * H0 /c ) ** (-0.5)
print(f"Gamma factor at Compton Length = {gcl:.2e}")
print(f"Proton mass at Compton Length = {gcl * m_p:.2e}")
# Calculate the Planck mass
mpl = (hbar * c / G) ** 0.5
print(f"Plank mass = {mpl.decompose():.2e}")
Compton Length = 1.32e-15 m
Gamma factor at Compton Length = 2.25e+20
Proton mass at Compton Length = 3.76e-07 kg
Plank mass = 2.18e-08 kg
Planck mass is a unit of mass in natural units given by \(m_{pl} = \sqrt{\frac{\hbar c}{G}} \approx 2 \times 10^{-8} kg \quad (11)\).
The proton mass when the separation over Hubble time becomes Compton length approaches the Planck mass.
3. Accelerating high energy protons¶
To accelerate these protons to such high energies,we need Particle accelerators, which are devices which use electromagnets to enhance their speeds. The most powerful accelerator is the Large Hadron Collider (LHC), which is a circular accelerator. To accelerate protons to such high energies, we need a linear accelerator, since in the case of a circular accelerator there is energy loss due to synchrotron radiation.
The most intense laser we have so far has an intensity \(I \sim 10^{26} W/m^2\). This intensity is related to the electric field \(E\) as
\(I = \frac{1}{2} c\epsilon_0E^2 \quad (12)\),
where \(\epsilon_0\) is the permittivity of free space. This gives an electric field given by, \(E \sim 2.7 \times 10^{14} V/m\).
For a voltage of \(\sim 10^{28} V\), the linear accelerator powered by this electric field should have an arm length \(l\) given by \(l = V/E \sim 4 \times 10^{13} m\).
To reduce the required arm lenght of the linear accelerator we need to increase the electric field strength.
The maximum possible electric field strength will be that around a fundamental charge (\(e=1.6\times 10^{-19} C\)) at a distance of 1 fm is given by
\(E_{max} = \frac{ke}{(1 fm)^2} \sim 10^{21} V/m \quad (13)\)
The energy density of the laser is given by
\(\epsilon = \frac{e V}{l w^2} \quad (14)\),
where \(w\) beam-width of the laser.
Q 3.1¶
Calculate the energy density of the beam of width \(10^{-7}~m\) (wavelength of the beam).
# Width of the beam (wavelength of the laser) w = 10^-7 m
# Volume of the beam w^2 * l = 10^-7 m
w = 1.e-7 *u.m
vol = w * w * V/Emax
# Calculate the energy density
ed = (e * V /vol).to(unit=u.J/u.m**3)
print(f"Volume of the beam = {vol:.2e}")
print(f"Energy density of the beam = {ed:.2e}")
Volume of the beam = 1.21e-07 m3
Energy density of the beam = 1.32e+16 J / m3
Q 3.2¶
Calculate the arm length corresponding to this electric field.
# I is the intensity of the laser
I = 1.e26 *u.W/u.m**2 #W/m^2
# The corresoinding electric field E
E = (((2 * I ) / (c * eps0)) **.5).to(unit=u.V/u.m)
print(f"Electric field = {E:.2e}")
# The voltage V and arm length l
V = 1.e28 *u.V
l = V/E
print(f"Arm length = {l:.2e}")
Emax = ((1/(4 * math.pi * eps0)) * (e / cl ** 2)).to(unit=u.V/u.m)
print(f"Maximum electric field = {Emax:.2e}")
print(f"Arm length for max E = {V/Emax:.2e}")
Electric field = 2.74e+14 V / m
Arm length = 3.64e+13 m
Maximum electric field = 8.25e+20 V / m
Arm length for max E = 1.21e+07 m
The arm length \(l\sim 10^{13} m\) is roughly 100 times the distance between the earth and the sun (100 Astronomical Units).
A particle of charge \(e\) moving with velocity \(v\) moving in a magnetic field \(B\) gets deflected due to the Lorentz force, tracing a circular path of radius
\(r = \gamma \frac{m v}{e B} \quad (15)\).
Since the arm length of these accelerators need to be quite large, the particles will be affected by the galactic magnetic field (\(10^{-6} G\))
Q 3.3¶
Calculate the radius of the high energy proton in the galactic magnetic field at energies:
a. at 7 TeV (LHC energies)
b. at Planck energy.
# From equation (6)
# vg: velocity as a function of gamma
vg = lambda g: c*np.sqrt(1 - (1/g)**2)
B = 10**(-10.)*u.T # in Tesla
# rb: radius of the particle as a function of gamma
rb = lambda g: (g * m_p) * vg(g) / (e * B )
# Radius at LHC energy
g1 = 7000.
print(f"Radius at LHC energy = {rb(g1).decompose():.2e}")
# Radius at Planck energy
g2 = 10**18.
print(f"Radius at Planck energy = {rb(g2).decompose():.2e}")
Radius at LHC energy = 2.19e+14 m
Radius at Planck energy = 3.13e+28 m
Note: The radius at the LHC energy is one \(10^6\) times smaller than that of the Milky Galaxy (\(10^{20} m\)), while at the Planck energy, it is \(10^8\) times larger.
Since the accerlerator required to produce Planck energies is untenable and not practical it is unlikely that we can test theories involving energy scales at Planck epoch.


Apache has a few roles that relate to all Apache projects:
Despite there being various roles, we try extremely hard to keep the project flat. All feedback is welcome, all people matter. Everyone should feel very encouraged to participate regardless if they are new or old to the project. If you are new and want to participate, please speak up, we'll always be happy to hear from you.
If anything there is a reverse hierarchy that is not unlike traffic laws; pedestrians (users) always have the right of way, bikes (contributors) yield to pedestrians, automobiles (committers) yield to bikes and pedestrians. Depending on what you're driving you have a greater responsibility to those around you. Be careful not to run anyone over.
We don't focus on the PMC in this project so many may not have a clear concept of it. Every project at Apache has a PMC which at minimum represents Apache from a legal perspective. The people on it are expected to provide legal oversight, making sure that the legal entity that is Apache has awareness enough to legally protect the code that leaves it's doors, the users that use it, and the people who create it. This means making sure any contributions going into the project are clean and can be legally projected and making sure any binaries going out meet the legal requirements so they as well can be legally protected. It's a lot of watching all commits, keeping an eye on doc contributions, ensuring CLAs are on file for anything of substantial size, screening release binaries and source for headers, license files, making sure any binaries being widely distributed have been voted on, etc., etc. If you are on the PMC and you vote on a release it means you have done all these things to the best of your ability. If you have not, you either should not be on the PMC or should not vote +1.
Being on the PMC is a service, not an achievement. Therefore if someone is added to the PMC you should not say "congratulations", but simply "thank you." It does not mean anything more than they have the time to help us function legally. If someone is perpetually too busy to provide legal oversight and steps down or goes emeritus, it does not mean they are leaving, just that they are too busy for the extra legal responsibility.
Some projects go beyond that and use the PMC as the decision makers and leaders of the project. We do not. We make all our decisions on the dev list. We don't even focus on who is a committer and who is not, which is a major factor of our family-like community and general "everyone is welcome and matters" spirit. If someone doesn't feel like their input matters till they are a committer, or any other status, we've done something wrong. Fortunately, this is one of our strongest attributes and part of the magic that is this community.
Apache requires a minimum of three +1 PMC votes which have legal significance to Apache as a corporation. That said, all votes from the community are significant to the project and decision making and any -1 is cause for pause and discussion. We frequently encourage and welcome votes from anyone in the community regardless of status.
Yes and yes. Voting in public requires greater care and sensitivity on behalf of everyone; the vote proposer, the voters, and the votee. Prior to voting the proposer should create several opportunities for feedback, hopefully positive and constructive. Community members with concerns should get involved early and actively mentor potential committers, taking opportunities for feedback as queues to get involved, encourage, and work through areas where they see said person needs more help. The contributor should actively solicit and welcome all help and feedback and encouragement and feel welcome to give it in return. Do not rush; all parties (proposer, voters, and votee) have work to do in grooming contributors, etc., and that work takes time. Votes that result in one or more -1s should not be seen as a failure of any one individual and instead be seen as an opportunity for all parties (proposer, voters, and votee) to make improvements, be more active, and give the process more time.


A radio button is a form control thats allow a user to select a single option from a group of choices.
The purpose of a radio button is to collect form data; therefore radios should always be used in conjunction with a form, label and submit button.
A radio button requires the following SVG symbol definition:
{% highlight html %} {% endhighlight %}Use the radio base class to create a radio.
The radio is decoupled from it's real text label to allow more flexibility in terms of layout. How and where you provide this label is up to you, but do not forget it!
The hidden attribute ensures that the SVG icon is not visible when CSS is disabled and also helps prevent a flash of unstyled content (FOUC).
Use the disabled attribute to disable any radio input.
A group of radios enforces single-select (unlike a group of checkboxes which allows multi-select).
A fieldset and legend are required in order to create the correct grouping semantics. Note that the Skin global module removes the default fieldset border and padding.
TIP: To stack radio buttons vertically instead of side-by-side, simply replace the span wrapper with a div wrapper.
Use the radio__custom-control element class to create a custom styled radio that can use any inline SVG for it's checked and unchecked states.
Be careful with custom radios; if a user cannot tell the icons represent an interactive control, they may skip over it entirely.
NOTE: below is just an example of how custom radios could be used; view option customizaton does not necessarly always need to be implemented with radio buttons.


Links and Acknowledgements
PyTrx citations
We are happy for others to use and adapt PyTrx for their own processing needs. If used, please cite the following key publication and Digital Object Identifier:
How et al. (2020) PyTrx: a Python-based monoscopic terrestrial photogrammetry toolset for glaciology. Frontiers in Earth Science 8:21, doi:10.3389/feart.2020.00021
PyTrx has been used in the following publications. In addition to the publication above, please cite any that are applicable where possible:
How et al. (2019) Calving controlled by melt-undercutting: detailed mechanisms revealed through time-lapse observations. Annals of Glaciology 60 (78), 20-31, doi:10.1017/aog.2018.28
How (2018) Dynamical change at tidewater glaciers examined using time-lapse photogrammetry. PhD thesis, University of Edinburgh, UK, https://hdl.handle.net/1842/31103
How et al. (2017) Rapidly changing subglacial hydrological pathways at a tidewater glacier revealed through simultaneous observations of water pressure, supraglacial lakes, meltwater plumes and surface velocities. The Cryosphere 11, 2691-2710, doi:10.5194/tc-11-2691-2017
Addison (2015) PyTrx: feature tracking software for automated production of glacier velocity. MSc thesis, University of Edinburgh, UK, https://hdl.handle.net/1842/11794
Permissions
The DEM of the Kongsfjorden area provided as an example dataset for PyTrx originates from the freely available DEM dataset provided by the Norwegian Polar Institute, data product ‘S0 Terrengmodell - Delmodell_5m_2009_13822_33 (GeoTIFF)’. This data is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) license:
Norwegian Polar Institute (2014). Terrengmodell Svalbard (S0 Terrengmodell) [Data set]. Norwegian Polar Institute. doi:10.21334/npolar.2014.dce53a47
The two DEMs distributed with PyTrx for the Kongsfjorden region are KR_demsmooth.tif and KR_demzero.tif, which have been modified and manipulated from the original NPI data. In both cases, the scene has been clipped to the area of interest, downgraded to 20 metre resolution, and smoothed using a linear interpolation method. The latter of these DEMs has been manipulated in order to better represent the terminus position of Kronebreen in 2014 (the time at which the images were taken) and project meltwater plumes to a flat, homogeneous surface at sea level.
The DEM of the Tempelfjorden area provided as an example dataset for PyTrx originates from ArcticDEM, Scene ID: WV01_20130714_1020010 (July 14, 2013). There is no license for the ArcticDEM data and it can be used and distributed freely. The DEM was created from DigitalGlobe, Inc., imagery and funded under National Science Foundation awards 1043681, 1559691, and 1542736.
The DEM distributed with PyTrx of the Tempelfjorden region is called TU_demzero.tif, which has been modified and manipulated from the original ArcticDEM data. The scene has been clipped to the area of interest, downgraded to 20 metre resolution, and all low-lying elevations (< 150 m) have been transformed to 0 m a.s.l. in order to project point locations and line profiles to a flat, homogeneous surface at sea level.
The example image sets and UAV-derived DEM from Qasigiannguit glacier are used courtesy of Asiaq Greenland Survey as part of Messerli et al. (In Review), through GlacioBasis Nuuk under the GEM (Greenland Ecosystem Monitoring) programme. The DEM file provided as QAS_drone_dem.tif was acquired from UAV surveying in September 2020 and downgraded to 20 metre resolution.
Acknowledgements
PyTrx was initially developed and released as part of the CRIOS (Calving Rates and Impact on Sea Level) project. Example image sets and camera data from Svalbard glaciers are provided by CRIOS. PyTrx’s continued development and maintenance is funded by an ESA Living Planet Fellowship.
Parts of the georectification functions in the PyTrx toolbox were inspired and translated from ImGRAFT, a photogrammetry toolbox for Matlab (Messerli and Grinsted, 2015). Where possible, ImGRAFT has been credited for in the corresponding PyTrx scripts (primarily some passages in the CamEnv.py script) and cited in relevant PyTrx publications.
Links
There are other useful software available for terrestrial photogrammetry in glaciology:
Pointcatcher: Matlab-based GUI toolbox for feature-tracking and georectification
ImGRAFT: Matlab toolbox for feature-tracking and georectification
EMT (Environmental Motion Tracking): GUI toolbox for feature-tracking and georectification
CIAS: IDL gui for feature-tracking
PRACTISE: Matlab toolbox for georectification


Search Your Favourite Food
Nik Baker's
Pizza
4.25Burgers
4.25Customer Reviews
Write Review Here
Book This Restaurant Table
Book This Restaurant Table
- Address : 2nd Street, East-West Mansion Flat A2 231 Newyork NY 10003
- Call us & Hire us +32 (0) 598 65 8968
- Have any questions<EMAIL_ADDRESS>- Fax +652<PHONE_NUMBER>5
Your Order
-
.1
Chicken Tandoori Special
$85.00 -
.2
Chicken Tandoori Special
$90.00 -
.3
Chicken Tandoori Special
$100.00
- SubTotal $158
- Delivery fee $70
- Tax $12
- Total $340
- CONFIRM ORDER
John Mathur
Lorem ipsum dolor sit amet, pri nusquam petentium at.   In mutat omnes homero mea, pro delenit accusam eu
(4)


If you're reading this post, you're probably familiar with Ruby classes; they're a fundamental part of designing object-oriented programs and are a very convenient and powerful way to store data and functionality for objects. Last week I covered some basics about classes and methods. This week I'm going to go more in-depth about class methods: how they differ from instance methods and when and how to use them.
Class Methods vs. Instance Methods
The difference looks very subtle in the actual code but is significantly different in execution. Take a look at the code below:
class newClass
def self.classMethod
puts "Class method"
end
def instanceMethod
puts "Instance method"
end
end
Did you spot the difference? Class methods are called on the class, or self. This means that this method can be used on all instances of this class.
The instance method, however, is called on an instance of that class, meaning it can't be called without a new or existing instance of that class. Take a look at the code below to see what happens:
class NewClass
def self.classMethod
puts "Class method"
end
def instanceMethod
puts "Instance method"
end
end
NewClass.classMethod #-> "Class method"
NewClass.instanceMethod #-> NoMethodError: undefined method 'instanceMethod' for NewClass:Class
NewClass.new.instanceMethod #-> "Instance method"
NewClass.new.classMethod #-> NoMethodError: undefined method 'classMethod' for #NewClass:0x1e820
We called a class method on our class, which worked perfectly. However, when we tried to call an instance method on the class, we weren't so lucky.
We saw similar results when defining a new instance of our class and calling methods on it. We were able to get the instance method to work but were unable to call the class method on it.
When to use class methods
As a very broad and general rule, class methods are used when you aren't dealing with anything specific to an instance. So if we use last week's basketball teams as an example, you could write a class method that defines the makeup of a starting lineup: point guard, shooting guard, small forward, forward and center. These are universal in every instance of the basketball team class, so we could define it at the class level.
class BasketballTeam
def self.positions
puts "Point guard, shooting guard, small forward, forward, center"
end
end
BasketballTeam.positions #-> Point guard, shooting guard, small forward, forward, center
When to use instance methods
Instance methods, then, are used when data varies from instance to instance. In the basketball example, this would be player names, numbers, etc.
class BasketballTeam
def self.positions
puts "Point guard, shooting guard, small forward, forward, center"
end
def initialize(pg, sg, sf, f, c)
@pg = pg
@sg = sg
@sf = sf
@f = f
@c = c
end
def point_guard
puts "#{@pg}"
end
def shooting_guard
puts "#{@sg}"
end
def small_forward
puts "#{@sf}"
end
def forward
puts "#{@f}"
end
def center
puts "#{@c}"
end
def starters
puts "Point Guard: #{point_guard}\n Shooting Guard: #{shooting_guard}\n Small Forward: #{small_forward}\n Forward: #{forward}\n Center: #{center}"
end
end
MSU = BasketballTeam.new("Keith Appling", "Gary Harris", "Denzel Valentine", "Branden Dawson", "Adreian Payne")
MSU.starters #->
Point Guard: Keith Appling
Shooting Guard: Gary Harris
Small Forward: Denzel Valentine
Forward: Branden Dawson
Center: Adreian Payne