Controllers
In this section we will dive a bit deeper into controller testing. By understanding it, you will get familiar with the fundamentals of My Tested ASP.NET Core MVC and see how other components from a typical MVC web application can be asserted in a similar manner. Of course, we will use the classical AAA (Arrange, Act, Assert) approach.
Arrange
Go to the "ManageController" again and analyse the "ChangePassword" action. You will notice that with invalid model state this action returns view result with the same model provided as a request parameter:
public async Task<IActionResult> ChangePassword(ChangePasswordViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
// action code skipped for brevity
}
My Tested ASP.NET Core MVC provides a very easy way to arrange the model state, but we will ignore it for now. What we want is to add a model error to the action call manually. Go to the "ManageControllerTest" class, add the new test and start with the typical selection of a controller to test:
[Fact]
public void ChangePasswordShouldReturnViewWithSameModelWithInvalidModelState()
{
MyController<ManageController>
.Instance()
}
We will now examine three different ways to arrange the model state on the tested "ManageController". Since the model state is part of the controller (action) context (see HERE), you may instantiate one (after adding the "Microsoft.AspNetCore.Mvc" using) and provide it by using the "WithControllerContext" ("WithActionContext") method:
var controllerContext = new ControllerContext();
controllerContext.ModelState.AddModelError("TestError", "TestErrorMessage");
MyController<ManageController>
.Instance()
.WithControllerContext(controllerContext)
The testing framework prepares for you every detail of the tested component before running the actual test case by using the global test service provider. Therefore, you may skip the instantiation and use the other overload of the method using an action delegate:
MyController<ManageController>
.Instance()
.WithControllerContext(context => context.ModelState
.AddModelError("TestError", "TestErrorMessage"))
These are fine but the model state dictionary can be accessed directly from the controller itself, so we can just skip the whole "ControllerContext" class by using the "WithSetup" method:
MyController<ManageController>
.Instance()
.WithSetup(controller => controller.ModelState
.AddModelError("TestError", "TestErrorMessage"))
The "WithSetup" method will come in handy wherever the fluent API does not provide a specific arrange method. As a side note - My Tested ASP.NET Core MVC provides an easy way to set up the model state dictionary, but we will cover it later in this tutorial.
Each one of these three ways for arranging the controller is fine, but we will stick with the third option.
Act
We need to act! In other words, we need to call the action method. We do not need an actual request model to test the desired logic, so let's pass a null value as a parameter. Add this line to the test:
.Calling(c => c.ChangePassword(null))
You should be familiar with the "Calling" method from the previous sections. Again, if you prefer to be more expressive, you may use the "With" class:
// needs the MusicStore.Models namespace
.Calling(c => c.ChangePassword(With.No<ChangePasswordViewModel>()))
Well, this was easy! :)
Assert
The final part of our test is asserting the action result. You should know how to assert a view result too, so add these to the test:
.ShouldReturn()
.View();
We now need to test the returned model. It should be the same as the one provided through the action parameter. If you look through the IntelliSense around the "View" call, you will not find anything related to models. The reason is simple - model testing is available in a separate package which we will install in the next section.
For now, let's use the tools we have already imported in our test project. One option is to use the "Passing" method, which can be called on every action result like so:
.ShouldReturn()
.View(result => result
.Passing(view => Assert.Null(view.Model)));
However, we will use another feature of the library. Introducing the magical "ShouldPassForThe
Add the following lines to the test after the "View()" call:
// needs the Microsoft.AspNetCore.Mvc namespace
.AndAlso()
.ShouldPassForThe<ViewResult>(viewResult
=> Assert.Null(viewResult.Model))
Now rebuild the project, then run the test, and our work here is done - a successful pass! :)
But before moving on with our lives, let's explain the last two lines.
First - the "AndAlso" method. It's there just for better readability and expressiveness. It is available in various places of the fluent API, but it actually does nothing most of the time. You may remove it from your code now, then recompile it and run the test again and it will still pass. Of course, it is up to you whether or not to use the "AndAlso" method but admit it - it's a nice little addition to the test! :)
Second - the magical "ShouldPassForThe
Assert.NotNull() Failure
Return the "Null" assertion call so that the test passes again. The "ShouldPassForThe
.ShouldReturn()
.View()
.AndAlso()
.ShouldPassForThe<Controller>(controller =>
{
Assert.NotNull(controller);
Assert.True(controller.ModelState.ContainsKey("TestError"));
})
.AndAlso()
.ShouldPassForThe<ViewResult>(viewResult => Assert.Null(viewResult.Model));
Of course, the first "ShouldPassForThe" call does not make any sense for our purposes at all, but it proves that everything related to the test can be asserted by using the method. You may even put a breakpoint into the action delegate and debug it if you like.
I guess you already know it, but if you put an invalid and unrecognizable type for the generic parameter, it will not work. For example, using "XunitProjectAssembly" will throw an exception:
XunitProjectAssembly could not be resolved for the 'ShouldPassForThe<TComponent>' method call.
To continue, let's bring back the test to its last passing state:
[Fact]
public void ChangePasswordShouldReturnViewWithSameModelWithInvalidModelState()
=> MyController<ManageController>
.Instance()
.WithSetup(controller => controller.ModelState
.AddModelError("TestError", "TestErrorMessage"))
.Calling(c => c.ChangePassword(With.No<ChangePasswordViewModel>()))
.ShouldReturn()
.View()
.AndAlso()
.ShouldPassForThe<ViewResult>(viewResult
=> Assert.Null(viewResult.Model));
We are still not asserting whether the view model is the same object as the provided method parameter. Let's change that by instantiating a "ChangePasswordViewModel" and test the action with it:
[Fact]
public void ChangePasswordShouldReturnViewWithSameModelWithInvalidModelState()
{
var model = new ChangePasswordViewModel
{
OldPassword = "OldPass",
NewPassword = "NewPass",
ConfirmPassword = "NewPass"
};
MyController<ManageController>
.Instance()
.WithSetup(controller => controller.ModelState
.AddModelError("TestError", "TestErrorMessage"))
.Calling(c => c.ChangePassword(model))
.ShouldReturn()
.View()
.AndAlso()
.ShouldPassForThe<ViewResult>(viewResult
=> Assert.Same(model, viewResult.Model));
}
Our work here is done (for now)! :)
Section summary
In this section we saw the AAA approach collaborating gracefully with My Tested ASP.NET Core MVC. However, I know you remember reading earlier about an easier way of arranging the model state and additional fluent testing options for the view result models. You can learn about them in the Models section!


Module pl.path
Path manipulation and file queries
This is modelled after Python's os.path library (11.1)
Functions
| splitpath (P) | given a path, return the directory part and a file part |
| abspath (PP, P) | return an absolute path |
| splitext (P) | given a path, return the root part and the extension part |
| dirname (P) | return the directory part of a path |
| basename (P) | return the file part of a path |
| extension (P) | get the extension part of a path |
| isabs (P) | is this an absolute path? |
| join (p1, p2) | return the P resulting from combining the two paths |
| normcase (P) | Normalize the case of a pathname |
| expanduser (P) | Replace a starting '~' with the user's home directory |
| tmpname () | Return a suitable full path to a new temporary file name |
| common_prefix (path1, path2) | return the largest common prefix path of two paths |
| package_path (mod) | return the full path where a particular Lua module would be found |
Fields
| is_windows | are we running Windows? |
| sep | path separator for this platform |
| dirsep | separator for PATH for this platform |
Functions
- splitpath (P)
-
given a path, return the directory part and a file part
if there's no directory part, the first value will be empty
Parameters:
P
: A file path
- abspath (PP, P)
-
return an absolute path
Parameters:
PP
: A A file pathP
:
- splitext (P)
-
given a path, return the root part and the extension part
if there's no extension part, the second value will be empty
Parameters:
P
: A file path
- dirname (P)
-
return the directory part of a path
Parameters:
P
: A file path
- basename (P)
-
return the file part of a path
Parameters:
P
: A file path
- extension (P)
-
get the extension part of a path
Parameters:
P
: A file path
- isabs (P)
-
is this an absolute path?
Parameters:
P
: A file path
- join (p1, p2)
-
return the P resulting from combining the two paths
if the second is already an absolute path, then it returns it.
Parameters:
p1
: A file pathp2
: A file path
- normcase (P)
-
Normalize the case of a pathname
On Unix, this returns the path unchanged;
for Windows, it converts the path to lowercase, and it also converts forward slashes
to backward slashes. Will also replace '\dir\..\' by '\' (PL extension!)
Parameters:
P
: A file path
- expanduser (P)
-
Replace a starting '~' with the user's home directory
In windows, if HOME isn't set, then USERPROFILE is used in preference to
HOMEDRIVE HOMEPATH. This is guaranteed to be writeable on all versions of Windows.
Parameters:
P
: A file path
- tmpname ()
- Return a suitable full path to a new temporary file name unlike os.tmpnam(), it always gives you a writeable path (uses %TMP% on Windows)
- common_prefix (path1, path2)
-
return the largest common prefix path of two paths
Parameters:
path1
: a file pathpath2
: a file path
- package_path (mod)
-
return the full path where a particular Lua module would be found
Both package.path and package.cpath is searched, so the result may
either be a Lua file or a shared libarary.
Parameters:
mod
: name of the module
Returns:
- on success: path of module, lua or binary
- on error: nil,error string


Ben then took the group through 5 questions which aimed to find out:
We used a large sheet of brown paper. Putting pink post-its along the top to define a column for each question. The group then


I am planning to write a bunch of posts about memory and x86 architecture and virtualization. This is the first post among hopefully many which will deep dive into the x86 architecture.
In this post I will cover about the real mode which is the default mode that x86 runs in when it boots up. This was the default mode before intel introduced paging in the 80286. In real mode, all registers are 16 bits and the processor can adress upto 20-bits of address space giving \( 2^{20} -1 \approx 1M \) addressable bytes. Although it should be possible to address all 4G of memory (16 bit segment and 16 bit offset), the hardare at the time had only 20 address pins hence they were restricted to a 20-bit address in real mode. All the addresses are directly mapped to physical memory with no protection. Accessing memory beyond the 1M limit causes a wraparound which some ill-thinking developers used as a feature.
These 20-bit address are accessed using a combination of segment address and offset (logical address). To get a physical address, the 16-bit segement address is sifted left 4 bits and a 16-bit offset is added to it making a total of 20-bit address.
Let us look at a sample instruction and see how it works in real mode.
mov ax, [080h]
The above instruction copies the value present at the logical address 0x80
to
the ax
register.
The figure above shoes how the final physical address is calculated. If no
register is given, the DS
register is chosen as the segment register which
decides which 64k
segment we are working with. The value in the DS
is
multiplied by 16 and added to the immidiate value 0x80
which is the offset in
the segment, to get the final physicial address. If DS
contained 0x100
then
the physical address will be
$$ 0\mathtt{X}100*4 + 0\mathtt{X}80 = 0\mathtt{X}480 $$
High Memory Area
Now there is a corner case if you set the segement selector to 0xFFFF you can
start accessing memory from 16 bytes below the 1M
limit and go beyond 1M
upto (64 - 16) 48 bytes. In the segment:offset
FFFF:0000
to FFFF:FFFF
This is the high memory area. In older processors, this would wrap around as
they only had 20 address lines and this is a 21 bit address but you could
access the high memory in newer models. To maintain backward compatibility with
the older real mode, the wraparound was emulated and was controlled by setting
the A20 line.


You can find here a delicious Selimon Cookies!
Locations of us:
Seattle
- Location: Washington, Seattle.
- Open Hours: 6AM - 8PM
- Contant Info: +206 123456789
Tokyo
- Location: Japan, Tokyo.
- Open Hours: 6AM - 8PM
- Contant Info: +090 123456789
Dubai
- Location: United Arb Emirates, Dubai.
- Open Hours: 6AM - 8PM
- Contant Info: +971 123456789
Paris
- Location: France, Paris.
- Open Hours: 6AM - 8PM
- Contant Info: +33 123456789
Lima
- Location: Peru, Lima.
- Open Hours: 6AM - 8PM
- Contant Info: +567 123456789/ +419 123456789
How we create our delicious cookies:
It is very simple, we use our magic recipe and for the shape of the cookie, we use this cutter:
Shapes of our cookies:
Feedback from our customers:
"We are so happy to have a good cookies shop like this.
It is cheap, delicious and amzing.
The most beautiful thing that you can find amazing shapes for cookies."


AppAuth Tester
Testing the App Auth JavaScript Library.
Fetch Configuration
Make Authorization Request
Make Token Request


Mechanical Engineering Skills
As a engineer, my job is to assist you the best to my ability which includes the following skills:
SOLIDWORKS
ANSYS
Microsoft Office Suite
Oracle
Design Project Flow Chart
Carpentry
Problem Solver
Communication
Technological Skills
In the technical side of things, I enjoy general development within:
Semantic HTML5
Responsive CSS3
Java
C++
MATLAB
FORTRAN
LaTeX
Javascript
My Latest Work
I always enjoy learning new softwares and programming languages to gain new design insights. Here are some of my completed projects that demonstrates my skill set.
Why work with me?
There are many advantages to working with me:
Passionate about success
I believe that accomplishments are made y passionate people working together.
Adamant
I may not know everything, but I am confident in my ability to learn something new and produce results that count.
Adaptable
I am happy to accommodate a new experience while delivering satisfaction within the company.


|
Standard Reference Data Program |
Data Gateway |
Chemistry WebBook |
Go To: Top, References, Notes / Error Report
Data compilation copyright by the U.S. Secretary of Commerce on behalf of the U.S.A. All rights reserved.
Data compiled by: K.P. Huber and G. Herzberg
| State | Te | ωe | ωexe | ωeye | Be | αe | γe | De | βe | re | Trans. | ν00 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A 1Π | 25846.1 | [390.17] Z | (72.0) 1 | 4.9125 2 | 0.7667 | [19.92E-4] 3 | 1.8782 | A → X 4 5 R | 25025.20 Z | |||
| Douglas and Lutz, 1970; missing citation | ||||||||||||
| X 1Σ+ | 0 | 2157.17 Z | 34.24 | 7.6603 | 0.2096 | .00455 | 3.83E-4 | -5E-6 | 1.5041 |
| 1 | Estimated from Pekeris' relation Douglas and Lutz, 1970. |
| 2 | From average Bv values for the two Λ-doubling components; B(P,R) - B(Q) = +0.0062, +0.0156 (v=0,1). |
| 3 | D1= 17.89E-4. In both v=0 and 1, rotational levels having J ≥ 9 cannot be represented by short power series in J(J+1). |
| 4 | Also observed in the solar spectrum Grevesse and Sauval, 1970. On the basis of this observation Grevesse and Sauval, 1971 obtain f00 = 0.0005 Grevesse and Sauval, 1971; see, however, Liszt and Smith, 1972. |
| 5 | Potential functions, Franck-Condon factors Rao and Lakshman, 1971, Liszt and Smith, 1972. |
| 6 | From a short extrapolation of the vibrational levels in A 1Π Douglas and Lutz, 1970. |
| 7 | Table IV as well as eqn. [3] and eqn. [5] of Douglas and Lutz, 1970 contain several errors which were later corrected in an unpublished erratum. |
Go To: Top, Constants of diatomic molecules, Notes / Error Report
Data compilation copyright by the U.S. Secretary of Commerce on behalf of the U.S.A. All rights reserved.
Douglas and Lutz, 1970
Douglas, A.E.; Lutz, B.L.,
Spectroscopic identification of the SiH+ molecule: the A 1π-X1+ system,
Can. J. Phys., 1970, 48, 247. [all data]
Grevesse and Sauval, 1970
Grevesse, N.; Sauval, A.J.,
Identification of SiH+ in the solar photospheric spectrum,
Astron. Astrophys., 1970, 9, 232-238. [all data]
Grevesse and Sauval, 1971
Grevesse, N.; Sauval, A.J.,
Oscillator strengths for SiH and SiH+ deduced from the solar spectrum,
J. Quant. Spectrosc. Radiat. Transfer, 1971, 11, 65. [all data]
Liszt and Smith, 1972
Liszt, H.S.; Smith, W.H.,
RKR Franck-Condon factors for blue and ultraviolet transitions of some molecules of astrophysical interest and some comments on the interstellar abundance of CH, CH+, and SiH,
J. Quant. Spectrosc. Radiat. Transfer, 1972, 12, 947. [all data]
Rao and Lakshman, 1971
Rao, T.V.R.; Lakshman, S.V.J.,
The true potential energy curves and Franck-Condon factors of SiH and SiH+ molecules,
Physica, 1971, 56, 322. [all data]
Go To: Top, Constants of diatomic molecules, References
Copyright for NIST Standard Reference Data is governed by the Standard Reference Data Act.
|
Standard Reference Data Program |
Data Gateway |
Chemistry WebBook |
If you have comments or questions about this site, please contact us.


20KB around with only one file.
Extremely easy to learn and use, friendly construction.
Support various common and complex SQL queries.
Support various SQL database, including MySQL, MSSQL, SQLite, MariaDB, Oracle, Sybase, PostgreSQL and more.
Prevent SQL injection.
Under MIT license, you can use it anywhere if you want.
$ composer require catfan/Medoo
$ composer update
// If you installed via composer, just use this code to requrie autoloader on the top of your projects. require 'vendor/autoload.php'; // Or if you just download the medoo.php into directory, and require it with the correct path. require_once 'medoo.php'; // Initialize $database = new medoo([ 'database_type' => 'mysql', 'database_name' => 'name', 'server' => 'localhost', 'username' => 'your_username', 'password' => 'your_password', 'charset' => 'utf8' ]); // Enjoy $database->insert('account', [ 'user_name' => 'foo', 'email' =><EMAIL_ADDRESS>'age' => 25, 'lang' => ['en', 'fr', 'jp', 'cn'] ]);
Love Medoo?


Hi! I'm znapci. a Computer Science undergrad from India. Messin up, breaking things and learning on the way :)


Need to paste any text and collaborate in real time with your friends? Promise, we won't steal any letter you type. Just click button below and share the generated link!
Aditya Putra. With some help by TogetherJS, jQuery, and Bootstrap. Source code is available on GitHub.


This is the fifth in a series of developmental updates for Matcheos. We have now browsed through profiles, submitted offers, received matches, and entered into a smart contract. In this post, we explore the mechanics of a Matcheos Smart Contract. The focus is on how two people who've just met, can use the incentives of a staked contract to enhance the odds of a successful relationship.
After you've agreed to the Matcheos Terms and Code of Conduct, a smart contract is created on the EOS blockchain. This contract is unique to each match.
Once the contract has been deployed on the blockchain, you then send your EOS offer (see update #1) from your wallet to the smart contract account.
A Matcheos contract is just a back and forth communication between 2 people that proceeds in steps. It's sort of like a chat towards a goal.
At each step in the contract, one person takes a turn at communication: either responding or asking questions. After the step, some EOS is released back to each person. So once the goal is reached, the EOS should be returned.
The total number of steps is built into the contract. Each step is one person having a turn in the interaction.
Because people have EOS at stake, they are incentivized to behave. Acting like a troll may cause EOS forfeiture.
A contract proceeds in a back and forth manner. By the end of the contract, you must decide whether to agree to the goal or terminate the contract early.
You don't have to reach the goal. Either person can terminate the contract at any step. If you terminate, there is a 24 hour EOS release delay to prevent arbitration frontrunning.
If you finish a contract and achieve the goal, you have the option of entering into a new contract with the same person.
At any time during the contract, either person can request arbitration over a breach in the Code of Conduct. A person must provide clear evidence of a breach in the Code.
Disputes are resolved in binding arbitration. All decisions are final. Any forfeited EOS is donated to a charity set forth in the terms.
The person who requests arbitration must pay a small fee. This fee is determined in the terms of the contract.
Matcheos includes a number of incentives to enforce good behavior between people. One such system is a review system for each contract.
Each person can review the other person's behavior during the contract. These reviews are displayed to other Matcheos users at the time of match acceptance.
Similarly, you can provide a review for how the person behaves offline - assuming there is additional interaction after the contract ends.
That's it for this post. This finishes up the basic skeleton of a minimum system. Obviously, there are many more features that can be added. But, for now, the feature set has been locked until the Alpha version has been completed. Stay tuned.


Last night was the last time I'll ever do DXM. For the most part I have had pretty good experiences, although the effects started to lessen the more I did it. I had been looking forward to last nite for awhile in hopes of having a nice trip. I went out with my friend to go see a movie after ingesting about 500mg of DXM. I don't quite remember how soon the effects started, but one thing is, neither of us remember the movie at all. We tried to talk to each other during the movie, but found it very hard to do so at times.
Once the movie was over, we attempted to leave, finding it pretty hard to walk by this point. We got to the car and just sat in it for at least 20 minutes. There was a huge truck parked next to us, and looked so close to our car. We couldn't even back out of the parking space because the truck was so close and we feared that other cars would be coming down the parking lot and hit us. Finally some people came out of the theater and got in the truck and left. We could finally leave and get to my house since we had no clue what else to do.
[Erowid Note: Please people,
don't drive while under the influence of substances like DXM which can significantly impair one's coordination.]
 I felt like I was floating in the air and not touching the ground at all. I think we tried to talk to each other, but I don't know what about. After a while my friend left to go home. I felt really weird after this; I couldn't think or see straight and my heart felt like it was pounding. I tried to get a reasonable amount of sleep, but I still felt very tired after waking up. I also felt completely worthless. I felt like there was no point to anything anymore, especially taking DXM. I got nothing out of last nite; I don't remember a lot of it. I am never touching DXM again. I find absolutely no point in it at all.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


MetaPlaylist
The MetaPlaylist is a specific kind of transport: a playlist of different Manifest. Its principle and usage is defined here.
How the original Manifest files are considered
To play a MetaPlaylist content, each manifest it depends on has to be
downloaded and parsed through their original logic (a MPD
through DASH’s
logic and a Smooth Manifest through Smooth’s logic).
We then merge each of these Manifest, to construct an internal Manifest object with the same structure and properties than we would have with a DASH or Smooth manifest.
The trick is to consider each of those original Manifest as different Periods (like DASH Periods). The trick works here because the RxPlayer’s definition of a transport (and of the underlying properties) is much more flexible than in DASH. If an original MPD already has multiple Periods, each of them are also converted as different RxPlayer’s Period so that no feature from the original content is lost.
Each of those Period is then concatenated one after the other thanks to the time information anounced in the MetaPlaylist file.
How about the segments
The exploitation of segment metadata is even trickier.
In DASH
or Smooth
, the URL of each segment could be constructed from the
starting time of each of those segments.
The problem here is that a MetaPlaylist
player has to mutate those to place
them at the position indicated in the MetaPlaylist’s JSON instead.
To simplify everything, we choose to rely on a simple but effective wrapper on top of the original transport protocol.
When the core logic of the player wants to load a segment from the network, that wrapper translate back the data as if we’re just playing the original content at its original position. How it works: the wrapper removes a specific time offset from the wanted segment’s metadata, before contacting the transport’s logic.
When giving back the segment to the core logic of the player, the wrapper first update those loaded segment with the wanted position data. How it works: the wrapper adds back the time offset it previously substracted from the wanted segment’s metadata before giving it back to the core logic.
To illustrate, it kind of goes like this:
+----------------+ 1. Ask for segments infos from t to t+n +--------------+
| | ---------------------------------------> | |
| | | |
| | <--------------------------------------- | |
| | 4.  Ask to download segment (offseted) | |
| | ---------------------------------------> | |
| | | |
| | <--------------------------------------- | |
+----------------+ 8.    Gives normal segment |
| +-------+ | ------------------------------------------------------+
+------------+
To make sure the segment is pushed at the right moment and doesn’t overlap other
contents, we make heavy use of some specific SourceBuffer
properties:
- the
timestampOffset
property allows to set a specific offset appendWindowStart
allows to limit the starting time of the pushed segmentappendWindowEnd
allows to limit the ending time of the pushed segment


JavaScript allows the declaration of variables.
the code inside the script tag is
today = new Date() ;
creates a Date object, and stores it in the variable today.
window.document.write("
today's date is " + today.getDate() + " " + (today.getMonth()+1) + " " + today.getYear()) ) ;
writes out the day, month, and year, by using methods in the Date object. window.document.write("
the time is" + today.getHours() + ":" + today.getMinutes()) ;
writes out the time, using methods in the Date object. window.document.write("
this can also be written out as " + today.toGMTString()) ;
Can write out the whole content of the Date object as a single string
the getDate() method of date returns the day of the month.
the getMonth() method returns the month as a number between 0 and 11 .
the getYear() returns the year (as a number since 1900).
the getHours() method returns the hour of the day, and the getMinutes() method returns the minutes of the time.
the toGMTString() takes the internal date format and returns a complete string of the date and time.


-
Jun 15, 2016
Welcome to Jekyll!
nly five centuries, but also the leap into electronic typesetting, remaining essentially unc
A minimlistic Dark themed jekyll theme
Welcome to Jekyll!
nly five centuries, but also the leap into electronic typesetting, remaining essentially unc


Ergonomics (or human factors) is the scientific discipline concerned with the understanding of interactions among humans and other elements of a system, and the profession that applies theory, principles, data and methods to design to optimize human well-being and overall system performance. (International Ergonomics Association. What is Ergonomics. Website. Retrieved 17 March 2014)


| File | Statements | Branches | Functions | Lines | |||||
|---|---|---|---|---|---|---|---|---|---|
| src | 100% | 16/16 | 100% | 0/0 | 100% | 1/1 | 100% | 16/16 | |
| src/app | 100% | 11/11 | 60% | 3/5 | 100% | 2/2 | 100% | 9/9 | |
| src/app/layout | 100% | 10/10 | 60% | 3/5 | 100% | 3/3 | 100% | 8/8 | |
| src/app/layout/blank-page | 100% | 6/6 | 100% | 0/0 | 100% | 3/3 | 100% | 4/4 | |
| src/app/layout/dashboard | 100% | 8/8 | 100% | 0/0 | 100% | 3/3 | 100% | 6/6 | |
| src/app/layout/dashboard/components/notification | 100% | 6/6 | 100% | 0/0 | 100% | 3/3 | 100% | 4/4 | |
| src/app/login | 71.43% | 20/28 | 80% | 20/25 | 42.86% | 3/7 | 72% | 18/25 | |
| src/app/shared | 100% | 4/4 | 100% | 0/0 | 100% | 0/0 | 100% | 4/4 | |
| src/app/shared/components | 100% | 3/3 | 100% | 0/0 | 100% | 0/0 | 100% | 3/3 | |
| src/app/shared/components/alert | 90.91% | 10/11 | 66.67% | 2/3 | 75% | 3/4 | 100% | 7/7 | |
| src/app/shared/components/header | 76.47% | 13/17 | 75% | 6/8 | 50% | 3/6 | 73.33% | 11/15 | |
| src/app/shared/components/sidebar | 69.23% | 9/13 | 0% | 0/2 | 50% | 2/4 | 63.64% | 7/11 | |
| src/app/shared/guard | 66.67% | 8/12 | 40% | 2/5 | 66.67% | 2/3 | 60% | 6/10 | |
| src/app/shared/modules | 100% | 2/2 | 100% | 0/0 | 100% | 0/0 | 100% | 2/2 | |
| src/app/shared/modules/page-header | 100% | 15/15 | 100% | 0/0 | 100% | 4/4 | 100% | 10/10 | |
| src/app/shared/modules/stat | 100% | 19/19 | 66.67% | 2/3 | 100% | 5/5 | 100% | 14/14 | |
| src/app/shared/pipes | 100% | 6/6 | 100% | 0/0 | 50% | 1/2 | 100% | 3/3 | |
| src/app/shared/services | 63.64% | 28/44 | 22.22% | 4/18 | 45.45% | 5/11 | 62.16% | 23/37 | |
| src/app/signup | 100% | 6/6 | 100% | 0/0 | 100% | 3/3 | 100% | 4/4 |


Euro giants eyeing move for €20m-rated out of favor Real Madrid ace
by Neelabhra RoyAtletico Madrid are reportedly interested in signing Real Madrid forward Mariano Diaz.
The 26-year-old has not made a single appearance for Los Blancos this season. So far, He made Zinedine Zidane’s matchday squad for just one match, against Real Mallorca. According to Don Balon, Atletico Madrid are eager to sign Diaz as a backup option for Alvaro Morata. The report claims that Diego Simeone is an admirer of the forward but Florentino Perez doesn’t want him to join Los Colchoneros.
SEE MORE: €35m Chelsea ace attracting interest from Real Madrid
Atletico Madrid need some more firepower upfront since Diego Costa hasn’t done very well this season. The 31-year-old has amassed just two goals and three assists in 15 appearances across all competitions this season so far.
Diaz who is valued at €20 million according to Transfermarkt, might prefer a move away from the Santiago Bernabeu given his current situation. If the 26-year-old joins Atletico Madrid, then he may not be a regular but will at least get first-team opportunities.


Source code for kicost.edas
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018 by XESS Corporation / Hildo G Jr
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from .eda import eda_class
# Import and register here the file read modules.
from .eda_kicad import eda_kicad # noqa: F401
from .eda_altium import eda_altium # noqa: F401
from .generic_csv import generic_csv # noqa: F401
# Author information.
__author__ = 'Hildo Guillardi Junior'
__webpage__ = 'https://github.com/hildogjr/'
__company__ = 'University of Campinas - Brazil'
[docs]def get_registered_eda_names():
''' Get the names of the registered EDAs '''
return eda_class.registered.keys()
[docs]def get_registered_eda_labels():
''' Get the labels of the registered EDAs '''
return [eda.label for eda in eda_class.registered.values()]
[docs]def get_part_groups(eda, in_file, ignore_fields, variant, distributors):
''' Get the parts for a file using the indicated EDA '''
return eda_class.get_part_groups(eda, in_file, ignore_fields, variant, distributors)
[docs]def file_eda_match(file_name):
''' Check which EDA is suitable for this file '''
return eda_class.file_eda_match(file_name)
[docs]def get_eda_label(name):
''' Returns a beautiful name for the EDA '''
return eda_class.registered[name].label
[docs]def set_edas_logger(logger):
''' Sets the logger used by the class '''
eda_class.logger = logger


WATCH: Sikhs celebrate Guru Nanak's 550th birthday with Sandwell parade
Thousands of Sikhs paraded through Sandwell to celebrate the 550th birthday of Guru Nanak.
by Jamie BrassingtonThe colourful procession, in honour of the founder of Sikhism, travelled to gurdwaras throughout the borough on Sunday.
There was music and dancing, while free food and drink was handed out throughout the parade route from West Bromwich to Smethwick via Oldbury.
WATCH video of the parade here:
Manjit Singh Samra, 41, was among those celebrating in Oldbury and explained: "It is a special occasion.
"This is a once in a lifetime opportunity to witness 550 years of Guru Nanak.
"It is a time when we can revisit Guru Nanak's history and message.
"His three messages are share with others, remember God and earn an honest living."
Guru Nanak, also referred to as Baba Nanak, was the first of the ten Sikh gurus and the anniversary of his birth is celebrated every year with the sacred Guru Nanak Dev Ji Gurpurab festival.
The procession was led by women sweeping the road and behind them were five sword-bearers and a float carrying the Sikh holy scripture the Guru Granth Sahib.
They were followed by specialists in the traditional Sikh martial art Gatka.
The procession began at the Guru Har Rai Sahib Ji Gurdwara on West Bromwich High Street before making its way to Guru Nanak Gurdwara in Edward Street.
From there, the procession travelled to Amrit Parchar Gurdwara in Birmingham Road, Oldbury, and nearby Guru Maneyo Granth Gurdwara in Popes Lane
The final stops were in Smethwick, at Baba Sang Ji Gurdwara in St Paul's Road and Guru Nanak Gurdwara in High Street.


Fresh chocolate Mammoth Milk
250ml
less sugar
Grunt the Sangeeta
<EMAIL_ADDRESS>call us now!
Loading…
Design by: Aarav Mavi


{% extends "main_pages/base.html" %} {% load snippet_tags %} {% block content %} {% get_courses as courses %} {% for course in courses %} {% include "main_pages/components/course.html" with course=course %} {% endfor %} {% endblock content %}


Toggle navigation
Design
Home
Processes & Tasks
Runtime
Settings
Messages: 0
Modified Datasources ExampleDS
Error: System Failure
Brian Johnson
Preferences
Logout
Design Library
Mortgages
Name
Name
Action
Another action
Something else here
Separated link
Name
Action
Another action
Something else here
Separated link
Create Project
Import
Action
Another action
Something else here
Separated link
Mortgage Project
This is the Mortgage Application process for all standard mortgages. For Refinances, please refer to
Refinance Project
.
Created on: 11/27/17
2 Contributors
4 Assets
Action
Another action
Something else here
Separated link
Pricing Lookup
Pricing table for all loans. Updated monthly.
Created on: 11/12/17
4 Contributors
2 Assets
Action
Another action
Something else here
Separated link
Refinance
Refinance process for all US refinance mortgages.
Created on: 9/7/17
1 Contributor
5 Assets
Action
Another action
Something else here
Separated link


Web Modules: The hello1 Example
In the Java EE architecture, a web module is the smallest deployable and usable unit of web resources. A web module contains web components and static web content files, such as images, which are called web resources. A Java EE web module corresponds to a web application as defined in the Java Servlet specification.
In addition to web components and web resources, a web module can contain other files:
Server-side utility classes, such as shopping carts
Client-side classes, such as applets and utility classes
A web module has a specific structure. The top-level directory of a web module is the document root of the application. The document root is where XHTML pages, client-side classes and archives, and static web resources, such as images, are stored.
The document root contains a subdirectory named WEB-INF, which can contain the following files and directories:
classes: A directory that contains server-side classes: servlets, enterprise bean class files, utility classes, and JavaBeans components
tags: A directory that contains tag files, which are implementations of tag libraries
lib: A directory that contains JAR files that contain enterprise beans, and JAR archives of libraries called by server-side classes
Deployment descriptors, such as web.xml (the web application deployment descriptor) and ejb-jar.xml (an EJB deployment descriptor)
A web module needs a web.xml file if it uses JavaServer Faces technology, if it must specify certain kinds of security information, or if you want to override information specified by web component annotations.
You can also create application-specific subdirectories (that is, package directories) in either the document root or the WEB-INF/classes/ directory.
A web module can be deployed as an unpacked file structure or can be packaged in a JAR file known as a Web Archive (WAR) file. Because the contents and use of WAR files differ from those of JAR files, WAR file names use a .war extension. The web module just described is portable; you can deploy it into any web container that conforms to the Java Servlet specification.
To deploy a WAR on the GlassFish Server, the file must contain a runtime deployment descriptor. The runtime DD is an XML file that contains such information as the context root of the web application and the mapping of the portable names of an application’s resources to the GlassFish Server’s resources. The GlassFish Server web application runtime DD is named glassfish-web.xml and is located in the WEB-INF directory. The structure of a web module that can be deployed on the GlassFish Server is shown in Figure 3-2.
For example, the glassfish-web.xml file for the hello1 application specifies the following context root:
<context-root>/hello1</context-root>
Examining the hello1 Web Module
The hello1 application is a web module that uses JavaServer Faces technology to display a greeting and response. You can use a text editor to view the application files, or you can use NetBeans IDE.
To View the hello1 Web Module Using NetBeans IDE
- From the File menu, choose Open Project.
- In the Open Project dialog, navigate to:
tut-install/examples/web/
- Select the hello1 folder.
- Select the Open as Main Project check box.
- Expand the Web Pages node and double-click the index.xhtml file to view it
in the right-hand pane.
The index.html file is the default landing page for a Facelets application. For this application, the page uses simple tag markup to display a form with a graphic image, a header, a text field, and two command buttons:
<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <h:head> <title>Facelets Hello Greeting</title> </h:head> <h:body> <h:form> <h:graphicImage url="duke.waving.gif" alt="Duke waving his hand"/>
Hello, my name is Duke. What's yours?
 <h:inputText id="username" title="My name is: " value="#{hello.name}" required="true" requiredMessage="Error: A name is required." maxlength="25" />

 <h:commandButton id="submit" value="Submit" action="response"> </h:commandButton> <h:commandButton id="reset" value="Reset" type="reset"> </h:commandButton> </h:form> ... </h:body>
The most complex element on the page is the inputText text field. The maxlength attribute specifies the maximum length of the field. The required attribute specifies that the field must be filled out; the requiredMessage attribute provides the error message to be displayed if the field is left empty. The title attribute provides the text to be used by screen readers for the visually disabled. Finally, the value attribute contains an expression that will be provided by the Hello managed bean.
The Submit commandButton element specifies the action as response, meaning that when the button is clicked, the response.xhtml page is displayed.
- Double-click the response.xhtml file to view it.
The response page appears. Even simpler than the greeting page, the response page contains a graphic image, a header that displays the expression provided by the managed bean, and a single button whose action element transfers you back to the index.xhtml page:
<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <h:head> <title>Facelets Hello Response</title> </h:head> <h:body> <h:form> <h:graphicImage url="duke.waving.gif" alt="Duke waving his hand"/>
Hello, #{hello.name}!

 <h:commandButton id="back" value="Back" action="index" /> </h:form> </h:body>
- Expand the Source Packages node, then the hello1 node.
- Double-click the Hello.java file to view it.
The Hello class, called a managed bean class, provides getter and setter methods for the name property used in the Facelets page expressions. By default, the expression language refers to the class name, with the first letter in lowercase (hello.name).
package hello1; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class Hello { private String name; public Hello() { } public String getName() { return name; } public void setName(String user_name) { this.name = user_name; } }
- Under the Web Pages node, expand the WEB-INF node and double-click the web.xml
file to view it.
The web.xml file contains several elements that are required for a Facelets application. All these are created automatically when you use NetBeans IDE to create an application:
A context parameter specifying the project stage:
<context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param-value> </context-param>
A context parameter provides configuration information needed by a web application. An application can define its own context parameters. In addition, JavaServer Faces technology and Java Servlet technology define context parameters that an application can use.
A servlet element and its servlet-mapping element specifying the FacesServlet:
<servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping>
A welcome-file-list element specifying the location of the landing page; note that the location is faces/index.xhtml, not just index.xhtml:
<welcome-file-list> <welcome-file>faces/index.xhtml</welcome-file> </welcome-file-list>
Introduction to Scopes
In the Hello.java class, the annotations javax.faces.bean.ManagedBean and javax.faces.bean.RequestScoped identify the class as a JavaServer Faces managed bean using request scope. Scope defines how application data persists and is shared.
The most commonly used scopes in JavaServer Faces applications are the following:
Request (@RequestScoped): Request scope persists during a single HTTP request in a web application. In an application like hello1, where the application consists of a single request and response, the bean uses request scope.
Session (@SessionScoped): Session scope persists across multiple HTTP requests in a web application. When an application consists of multiple requests and responses where data needs to be maintained, beans use session scope.
Application (@ApplicationScoped): Application scope persists across all users' interactions with a web application.
For more information on scopes in JavaServer Faces technology, see Using Managed Bean Scopes.
Packaging a Web Module
A web module must be packaged into a WAR in certain deployment scenarios and whenever you want to distribute the web module. You package a web module into a WAR by executing the jar command in a directory laid out in the format of a web module, by using the Ant utility, or by using the IDE tool of your choice. This tutorial shows you how to use NetBeans IDE or Ant to build, package, and deploy the hello1 sample application.
To Set the Context Root
A context root identifies a web application in a Java EE server. A context root must start with a forward slash (/) and end with a string.
In a packaged web module for deployment on the GlassFish Server, the context root is stored in glassfish-web.xml.
To view or edit the context root, follow these steps.
- Expand the Web Pages and WEB-INF nodes of the hello1 project.
- Double-click glassfish-web.xml.
- In the General tab, observe that the Context Root field is set to
/hello1.
If you needed to edit this value, you could do so here. When you create a new application, you type the context root here.
- (Optional) Click the XML tab.
Observe that the context root value /hello1 is enclosed by the context-root element. You could also edit the value here.
To Build and Package the hello1 Web Module Using NetBeans IDE
- From the File menu, choose Open Project.
- In the Open Project dialog, navigate to:
tut-install/examples/web/
- Select the hello1 folder.
- Select the Open as Main Project check box.
- Click Open Project.
- In the Projects tab, right-click the hello1 project and select Build.
To Build and Package the hello1 Web Module Using Ant
- In a terminal window, go to:
tut-install/examples/web/hello1/
- Type the following command:
ant
This command spawns any necessary compilations, copies files to the directory tut-install/examples/web/hello1/build/, creates the WAR file, and copies it to the directory tut-install/examples/web/hello1/dist/.
Deploying a Web Module
You can deploy a WAR file to the GlassFish Server by
Using NetBeans IDE
Using the Ant utility
Using the asadmin command
Using the Administration Console
Copying the WAR file into the domain-dir/autodeploy/ directory
Throughout the tutorial, you will use NetBeans IDE or Ant for packaging and deploying.
To Deploy the hello1 Web Module Using NetBeans IDE
- Right-click the hello1 project and select Deploy.
To Deploy the hello1 Web Module Using Ant
- In a terminal window, go to:
tut-install/examples/web/hello1/
- Type the following command:
ant deploy
Running a Deployed Web Module
Now that the web module is deployed, you can view it by opening the application in a web browser. By default, the application is deployed to host localhost on port 8080. The context root of the web application is hello1.
To Run a Deployed Web Module
- Open a web browser.
- Type the following URL:
http://localhost:8080/hello1/
- Type your name and click Submit.
The response page displays the name you submitted. Click the Back button to try again.
Listing Deployed Web Modules
The GlassFish Server provides two ways to view the deployed web modules: the Administration Console and the asadmin command.
To List Deployed Web Modules Using the Administration Console
- Open the URL http://localhost:4848/ in a browser.
- Select the Applications node.
The deployed web modules appear in the Deployed Applications table.
To List Deployed Web Modules Using the asadmin Command
- Type the following command:
asadmin list-applications
Updating a Web Module
A typical iterative development cycle involves deploying a web module and then making changes to the application components. To update a deployed web module, follow these steps.
To Update a Deployed Web Module
- Recompile any modified classes.
- Redeploy the module.
- Reload the URL in the client.
Dynamic Reloading
If dynamic reloading is enabled, you do not have to redeploy an application or module when you change its code or deployment descriptors. All you have to do is copy the changed pages or class files into the deployment directory for the application or module. The deployment directory for a web module named context-root is domain-dir/applications/context-root. The server checks for changes periodically and redeploys the application, automatically and dynamically, with the changes.
This capability is useful in a development environment because it allows code changes to be tested quickly. Dynamic reloading is not recommended for a production environment, however, because it may degrade performance. In addition, whenever a reload is done, the sessions at that time become invalid, and the client must restart the session.
In the GlassFish Server, dynamic reloading is enabled by default.
To Disable or Modify Dynamic Reloading
If for some reason you do not want the default dynamic reloading behavior, follow these steps in the Administration Console.
- Open the URL http://localhost:4848/ in a browser.
- Select the GlassFish Server node.
- Select the Advanced tab.
- To disable dynamic reloading, deselect the Reload Enabled check box.
- To change the interval at which applications and modules are checked for
code changes and dynamically reloaded, type a number of seconds in the Reload
Poll Interval field.
The default value is 2 seconds.
- Click the Save button.
Undeploying Web Modules
You can undeploy web modules and other types of enterprise applications by using either NetBeans IDE or the Ant tool.
To Undeploy the hello1 Web Module Using NetBeans IDE
- Ensure that the GlassFish Server is running.
- In the Services window, expand the Servers node, GlassFish Server instance, and the Applications node.
- Right-click the hello1 module and choose Undeploy.
- To delete the class files and other build artifacts, right-click the project and choose Clean.
To Undeploy the hello1 Web Module Using Ant
- In a terminal window, go to:
tut-install/examples/web/hello1/
- Type the following command:
ant undeploy
- To delete the class files and other build artifacts, type the following command:
ant clean


Meatpacking District information provided by Patrick
The meatpacking district used to be the primary location for butchers and meat importing was processed in NYC.
It had many clubs, and now it has many restaurants and lofts.
The Standard
The High Line
Times Square
Times Square is where the worst of humanity is witnessed, as they are dressed in Elmo costumes and harass tourists
that do not know better than to not talk to Elmo and take pictures with a 6'2" Elmo.
Ripley's Believe it Or Not
Madame Tassauds
Coldstone Creamery
Olive Garden
Sbarro's
Times Square Years Ball
Washington Square Park
Washington Square Park has many musicians and has a fountain, and some old buildings in it. It's very close to
SOHO!
That fountain
Musicians
Greenwhich Village
The epicenter of the city's 1960s counterculture movement, the tree-lined streets of Greenwich Village are now
a hub of popular cafes, bars and restaurants. Jazz clubs and Off-Broadway Theaters can also be found amid
the brownstones and New York University buildings.
Washington Square Park
NYU
Chelsea
Chelsea information provided by Phil
Chelsea is Phil's favorite place in the world, because it has an overpriced market and the high line.


{% extends "base.html" %} {% block title %}
Medieval catalogues > UNIVERSITY AND COLLEGE LIBRARIES OF OXFORD > New College > Books donated by John Elmer, 21 December 1408 and 1416
{% endif %}18 identified entries found.
All data was derived from the List of Identifications by Professor Richard Sharpe.
{% if not printing %}
A key to codes used in the List is available (opens in new tab).{% endif %}


otter package¶
Submodules¶
otter.containers module¶
-
otter.containers.
grade_assignments
(tests_dir, notebooks_dir, id, image='ucbdsinfra/otter-grader', verbose=False, unfiltered_pdfs=False, tag_filter=False, html_filter=False, reqs=None, scripts=False, no_kill=False)¶ Grades multiple assignments in a directory using a single docker container.
If no PDF assignment is wanted, set all three PDF params (unfiltered_pdfs, tag_filter, html_filter) to false. Also, list any non-standard package requirements in a requirements.txt file. This function can grade files with .py or .ipynb extensions (use scripts=True for .py).
Parameters: - tests_dir (str, optional) – Directory of test files
- notebooks_dir (str, optional) – Directory of notebooks to grade
- id (str, optional) – Id of this function for mc use
- image (str, optional) – Docker image to do grading in
- verbose (bool, optional) – Whether function should print information about various steps
- unfiltered_pdfs (bool, optional) – Set true if no filtering needed (generate pdf of whole nb)
- tag_filter (bool, optional) – Set true if notebook cells should be filtered by tag
- html_filter (bool, optional) – Set true if notebook cells should be filtered by comments
- reqs (str, optional) – Path to pip-style requirements.txt file
- scripts (bool, optional) – Set true if we are grading .py files instead of ipython notebooks
- (bool, optional (no_kill) – Set true to keep containers running after function terminates
Returns: A dataframe of file to grades information
Return type: pandas.core.frame.DataFrame
-
otter.containers.
launch_parallel_containers
(tests_dir, notebooks_dir, verbose=False, unfiltered_pdfs=False, tag_filter=False, html_filter=False, reqs=None, num_containers=None, image='ucbdsinfra/otter-grader', scripts=False, no_kill=False)¶ Grades notebooks in parallel docker containers
This function runs NUM_CONTAINERS docker containers in parallel to grade the student submissions in NOTEBOOKS_DIR using the tests in TESTS_DIR. It can additionally generate PDFs for the parts of the assignment needing manual grading.
Parameters: - tests_dir (str) – Path to directory with ok-style tests
- notebooks_dir (str) – Path to student submissions to be graded against provided tests
- verbose (bool, optional) – Set true to see logs of grade_assignments function as it runs
- unfiltered_pdfs (bool, optional) – Set true to create PDF of entire ipython notebook
- tag_filter (bool, optional) – Set true if notebook cells should be filtered by tag
- html_filter (bool, optional) – Set true if notebook cells should be filtered by comments
- reqs (str, optional) – Path to requirements.txt file with non-standard packages needed
- num_containers (int, optional) – The number of parallel containers that will be run
- image (str, optional) – Name of docker image used for grading environment
- scripts (bool, optional) – Set true if student submissions are .py instead of .ipynb
- no_kill (bool, optional) – Set true to keep containers running after function terminates
Returns: List of all dataframes which result from each container’s execution
Return type: list
otter.gofer module¶
-
class
otter.gofer.
CheckCallWrapper
(secret)¶ Bases:
ast.NodeTransformer
NodeTransformer visits and replaces nodes in place. CheckCallWrapper finds nodes with check(..) and replaces it with check_results_<secret>(check(…))
Parameters: secret (str) – Random digits string that prevents check function from being modified -
secret
¶ str – Random digits string that prevents check function from being modified
-
node_constructor
(expression)¶ Creates node that wraps expression in a list (check_results_XX) append call
Parameters: expression (ast.Name) – Name for check function Returns: Function call object from calling check Return type: ast.Call
-
visit_Call
(node)¶ Function that handles whether a given function call is a ‘check’ call and transforms the node accordingly.
Parameters: node (ast.Call) – Function call object, calling the check function Returns: Transformed version of input node Return type: ast.Call
-
-
class
otter.gofer.
OKTest
(name, tests, value=1, hidden=True)¶ Bases:
object
A single DocTest defined by OKPy. Instances of this class are callable. When called, it takes a global_environment dict, and returns a TestResult object. We only take a global_environment, not a local_environment. This makes tests not useful inside functions, methods or other scopes with local variables. This is a limitation of doctest, so we roll with it.
The last 2 attributes (passed, failed_test) are set after calling run().
Parameters: - name (str) – Name of test
- tests (
list
ofstr
) – List of docstring tests to be run - value (int, optional) – Point value of this test, defaults to 1
- hidden (bool, optional) – Set true if this test should be hidden
-
name
¶ str – Name of test
-
tests
¶ list
ofstr
– List of docstring tests to be run
-
value
¶ int – Point value of this test object, defaults to 1
bool – True if this test should be hidden
-
passed
¶ bool – True if all tests passed
-
failed_test
¶ str – Docstring of first failed test, if any
-
classmethod
from_file
(path)¶ Parse an ok test file & return an OKTest
Parameters: - cls (OKTest) – Uses this to create a new OKTest object from the given file
- path (str) – Path to ok test file
Returns: new OKTest object created from the given file
Return type:
-
html_result_fail_template
= <Template memory:10f2795c0>¶
-
html_result_pass_template
= <Template memory:10e8a9390>¶
-
plain_result_fail_template
= <Template memory:10f2794a8>¶
-
plain_result_pass_template
= <Template memory:10e8c8198>¶
-
class
otter.gofer.
OKTests
(test_paths)¶ Bases:
object
Test Class for Ok-style tests used to grade assignments.
Parameters: test_paths ( list
ofstr
) – List of paths to ok tests-
paths
¶ list
ofstr
– List of paths to ok tests
-
run
(global_environment, include_grade=True)¶ Run this object’s tests on a given global environment (from running a notebook/script)
Parameters: - (dict of str (global_environment) – str): Result of executing a python notebook/script see grade.execute_notebook for more
- include_grade (boolean, optional) – Set true if grade should be included in result
Returns: - Object resulting from running tests on GLOBAL_ENVIRONMENT, with grade,
tests passed, and more information.
Return type:
-
-
class
otter.gofer.
OKTestsResult
(grade, paths, tests, passed_tests, failed_tests, include_grade=True)¶ Bases:
object
Displayable result from running OKTests
Parameters: - grade (float) – Grade as a decimal in the range [0, 1]
- paths (
list
ofstr
) – List of paths to ok tests - tests (
list
ofOKTest
) – List of OKTest objects for each path - passed_tests (
list
ofstr
) – List of passed test docstrings - failed_tests (
list
ofstr
,OKTest
) – List of failed test docstrings and OKTest objects - include_grade (boolean, optional) – Set true if grade should be included in result
-
grade
¶ float – Grade as a decimal in the range [0, 1]
-
paths
¶ list
ofstr
– List of paths to ok tests
-
passed_tests
¶ list
ofstr
– List of passed test docstrings
-
include_grade
¶ boolean, optional – Set true if grade should be included in result
-
html_result_template
= <Template memory:10f264eb8>¶
-
plain_result_template
= <Template memory:10f264080>¶
-
otter.gofer.
check
(test_file_path, global_env=None)¶ check global_env against given test_file in oktest format If global_env is none, the global environment of the calling function is used. The following two calls are equivalent: check(‘tests/q1.py’) check(‘tests/q1.py’, globals())
Parameters: - test_file_path (str) – Path to ok test file
- (dict of str (global_env) – str, optional): A global environment resulting from the execution of a python script or notebook.
Returns: result of running the tests in the given global environment.
Return type:
-
otter.gofer.
flush_inline_matplotlib_plots
()¶ Flush matplotlib plots immediately, rather than asynchronously. Basically, the inline backend only shows the plot after the entire cell executes, which means we can’t easily use a contextmanager to suppress displaying it. See https://github.com/jupyter-widgets/ipywidgets/issues/1181/ and https://github.com/ipython/ipython/issues/10376 for more details. This function displays flushes any pending matplotlib plots if we are using the inline backend. Stolen from https://github.com/jupyter-widgets/ipywidgets/blob/4cc15e66d5e9e69dac8fc20d1eb1d7db825d7aa2/ipywidgets/widgets/interaction.py#L35
-
otter.gofer.
hide_outputs
()¶ Context manager for hiding outputs from display() calls. IPython handles matplotlib outputs specially, so those are supressed too.
-
otter.gofer.
id_generator
(size=6, chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')¶ Used to generate a dynamic variable name for grading functions
This function generates a random name using the given length and character set.
Parameters: - size (int) – Length of output name
- chars (str) – Set of characters used to create function name
Returns: Randomized string name for grading function
Return type: str
-
otter.gofer.
run_doctest
(name, doctest_string, global_environment)¶ Run a single test with given global_environment. Returns (True, ‘’) if the doctest passes. Returns (False, failure_message) if the doctest fails.
Parameters: - name (str) – Name of doctest
- doctest_string (str) – Doctest in string form
- (dict of str (global_environment) – str): Global environment resulting from the execution of a python script/notebook
Returns: Results from running the test
Return type: (bool, str)
otter.grade module¶
-
otter.grade.
execute_notebook
(nb, secret='secret', initial_env=None, ignore_errors=False, gradescope=False)¶ Executes an ipython notebook and return the global environment that results from execution.
Execute notebook & return the global environment that results from execution. TODO: write a note about the injection of check_results If ignore_errors is True, exceptions are swallowed. secret contains random digits so check_results and check are not easily modifiable nb is passed in as a dictionary that’s a parsed ipynb file
Parameters: - (dict of str (nb) – str): json representation of ipython notebook
- secret (str, optional) – randomly generated integer used to rebind check function
- initial_env (str, optional) – name of initial environment
- ignore_errors (bool, optional) – whether exceptions should be ignored
- Results:
- dict of str: object: global environment resulting from executing all code of the input notebook
-
otter.grade.
execute_script
(script, secret='secret', initial_env=None, ignore_errors=False)¶ Executes code of a python (.py) script and returns the resulting global environment
Execute script & return the global environment that results from execution. If ignore_errors is True, exceptions are swallowed. secret contains random digits so check_results and check are not easily modifiable script is passed in as a string
Parameters: - script (str) – string representation of python script code
- secret (str, optional) – secret string for naming check function
- initial_env (str, optional) – name of initial environment
- ignore_errors (bool) – whether exceptions should be ignored
- Results:
- dict: global environment resulting from executing all code of the input script
-
otter.grade.
grade
(ipynb_path, pdf, tag_filter, html_filter, script)¶ Grades a single ipython notebook and returns the score
If no PDF is needed, set the pdf, tag_filter, and html_filter parameters to false. For .py files, set script to true.
Parameters: - ipynb_path (str) – path to the ipython notebook
- pdf (bool) – set true if no filtering needed to generate pdf
- tag_filter (bool) – whether cells should be filtered by tag
- html_filter (bool) – whether cells should be filtered by comments
- script (bool) – whether the input file is a python script
Returns: a score mapping with values for each test, student score, and total points possible
Return type: dict
-
otter.grade.
grade_notebook
(notebook_path, tests_glob=None, name=None, ignore_errors=True, script=False, gradescope=False)¶ Grade a notebook file & return grade
This function grades a single ipython notebook using the provided tests. If grading a .py file, set script to true.
Parameters: - notebook_path (str) – path to a single notebook
- tests_glob (
list
ofstr
, optional) – names of test files - name (str, optional) – initial environment name
- ignore_errors (bool, optional) – whether errors should be ignored, passed as an arg to execute functions
- script (bool, optional) – true if the notebook_path is a python script, false if notebook
Returns: a score mapping with values for each test, student score, and total points possible
Return type: dict
-
otter.grade.
main
()¶ When executing this file from the command line, this function will be run.
otter.gs_generator module¶
-
otter.gs_generator.
main
()¶ Main function for configuring a Gradescope based autograder.
otter.metadata module¶
-
class
otter.metadata.
CanvasParser
(submissions_dir)¶ Bases:
object
Metadata parser for Canvas exports
Args: submissions_dir (str): Path to directory with student submission files
-
file_to_id
(file)¶ Returns a identifier given a filename
Parameters: file (str) – Filename Returns: Identifier corresponding to filename Return type: str
-
get_filenames
()¶ Returns list of filenames in the submission directory
Returns: all filenames from this parser Return type: list
-
get_identifiers
()¶ Returns list of submission identifiers
Returns: all identifiers from this parser Return type: list
-
get_metadata
()¶ Returns mapping of identifiers to files
Returns: List of dictionaries with identifier and filename information for each submitter Return type: dict
-
id_to_file
(identifier)¶ Returns a filename given an identifier
Parameters: identifier (str) – Identifier of a submitter Returns: filename of that submitter’s submission Return type: str
-
-
class
otter.metadata.
GradescopeParser
(submissions_dir)¶ Bases:
object
Metadata parser for Gradescope exports
Parameters: submissions_dir (str) – Path to directory with student submission files which contains the submission_metadata.yml file -
file_to_id
(file)¶ Returns a identifier given a filename
Parameters: file (str) – Filename Returns: identifier corresponding to filename Return type: str
-
get_filenames
()¶ Returns list of filenames in the submission directory
Returns: all filenames from this parser Return type: list
-
get_identifiers
()¶ Returns list of submission identifiers
Returns: all identifiers from this parser Return type: list
-
get_metadata
()¶ Returns mapping of identifiers to files
Returns: List of dictionaries with identifier and filename information for each submitter Return type: dict
-
id_to_file
(identifier)¶ Returns a filename given an identifier
Parameters: identifier (str) – Identifier of a submitter Returns: filename of that submitter’s submission Return type: str
-
-
class
otter.metadata.
JSONParser
(file_path)¶ Bases:
object
Metadata parser for JSON format
Args: submissions_dir (str): Path to directory with student submission files
-
file_to_id
(file)¶ Returns a identifier given a filename
Parameters: file (str) – Filename Returns: Identifier corresponding to filename Return type: str
-
get_filenames
()¶ Returns list of filenames in the submission directory
Returns: all filenames from this parser Return type: list
-
get_identifiers
()¶ Returns list of submission identifiers
Returns: all identifiers from this parser Return type: list
-
get_metadata
()¶ Returns mapping of identifiers to files
Returns: List of dictionaries with identifier and filename information for each submitter Return type: dict
-
id_to_file
(identifier)¶ Returns a filename given an identifier
Parameters: identifier (str) – Identifier of a submitter Returns: filename of that submitter’s submission Return type: str
-
-
class
otter.metadata.
YAMLParser
(file_path)¶ Bases:
object
Metadata parser for YAML format
Args: submissions_dir (str): Path to directory with student submission files
-
file_to_id
(file)¶ Returns a identifier given a filename
Parameters: file (str) – Filename Returns: Identifier corresponding to filename Return type: str
-
get_filenames
()¶ Returns list of filenames in the submission directory
Returns: all filenames from this parser Return type: list
-
get_identifiers
()¶ Returns list of submission identifiers
Returns: all identifiers from this parser Return type: list
-
get_metadata
()¶ Returns mapping of identifiers to files
Returns: List of dictionaries with identifier and filename information for each submitter Return type: dict
-
id_to_file
(identifier)¶ Returns a filename given an identifier
Parameters: identifier (str) – Identifier of a submitter Returns: filename of that submitter’s submission Return type: str
-
otter.notebook module¶
-
class
otter.notebook.
Notebook
(test_dir='./tests')¶ Bases:
object
Notebook class for in-notebook autograding
Parameters: test_dir (str, optional) – Path to tests directory -
check
(question, global_env=None)¶ Checks question using gofer
Parameters: - question (str) – Name of question being graded
- global_env (dict) – Global environment resulting from execution of a single notebook/script (see grade.execute_notebook for more on this)
Returns: - Result of running gofer.check which contains grade, failed tests, and
more related information (see gofer.OKTestsResult for more)
Return type:
-
check_all
()¶ Runs all tests on this notebook.
-
static
export
(nb_path, filtering=True, filter_type='html')¶ Exports notebook to PDF
FILTER_TYPE can be “html” or “tags” if filtering by HTML comments or cell tags, respectively.
Parameters: - nb_path (str) – Path to iPython notebook we want to export
- filtering (bool, optional) – Set true if only exporting a subset of nb cells to PDF
- filter_type (str, optional) – “html” or “tags” if filtering by HTML comments or cell tags, respectively.
-
otter.script module¶
-
otter.script.
blockPrint
()¶ Disables printing to stdout.
-
otter.script.
enablePrint
()¶ Enables printing to stdout.
-
otter.script.
main
()¶
otter.utils module¶
-
otter.utils.
list_files
(path)¶ Returns a list of all non-hidden files in a directory
Parameters: path (str) – Path to a directory Returns: List of filenames (str) in the given directory Return type: list
-
otter.utils.
merge_csv
(dataframes)¶ Merges dataframes returned by Docker containers
Parameters: dataframes (list) – List of Pandas dataframes (all should have same headers) Returns: A merged dataframe resulting from ‘stacking’ all input df’s Return type: pandas.core.frame.DataFrame


We're sorry but Simple-21 doesn't work properly without JavaScript enabled. Please enable it to continue.
Data User
+
No
Id
Name
Email
No Data User Found!
No
Id
Name
Email
{{ i + 1 + query.offset }}
{{ user.id }}
{{ user.name }}
{{ user.email }}
edit
delete
<
{{ query.page }}
>
Add User
Name
Email
Edit User
Edit Name
Edit Email


Click here to get started
Here is a pic of a cat to appreciate
[A cute cat](https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg)Subjects I am studying:
- Chemistry
- Physics
- Electronics
- Electric Circuits
- Electromagnetics
- Programming
- Finance
- Coursera
- Futurelearn
- Github
Top Websites I use:
What subjects are you interested in?


--- layout: base.html eleventyNavigation: key: About order: 2 permalink: /about/ ---
Hey there! My name is Carol, and I'm a frontend software engineer. I currently work for Capital One, where I'm part of the bestest team, Aviato. I'm also an organiser at Tech Nottingham and Women in Tech.


Kevin Pang, Jason Liu, Sanket Patel
A special thanks to @duto_guerra for providing RevealVizScroll!
People moving from one state to another and interested in lower cost of living.
Time series data from 1997 to 2017 on per capita expenditure by state provided by BEA.
Explore CoL differences across the U.S.
People moving from one state to another and interested wage trends of differnt occupations.
Annual wage data exported from Bureau of Labor Statistics
Explore impact of cost of living on wages of different occupations across US
People moving from one state to another.
Knowing how healthcare costs differ among states can better inform people looking to make a decision on whether to relocate.
Ex. A person relocating from Alabama to New York would like to know whether he can expect to spend more or less on healthcare in New York compared to Alabama.
Time series data from 1997 to 2017 on per capita healthcare expenditure by state provided by BEA.
Summarize how out of pocket healthcare costs have increased over a 21 year period (1997 - 2017) by state


All the good parts from connect-livereload without the livereload specific bits & with multiple replacements added.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.
(Nothing yet)
Copyright (c) 2013 Shane Osbourne Licensed under the MIT license.


basics Class
A collection of helper functions.
Item Index
Methods
btoa
-
String
base64 Helper for IE9
Parameters:
-
String
StringThe string to encode
Returns:
executeCallback
-
Callback
-
DataBefore
-
DataAfter
Method to execute a callback.
Parameters:
Returns:
Value returned by the called function
hasEvent
-
jQueryObject
-
EventName
Method to check whether a jQuery has a certain event registered or not. Event namespaces are supported
Parameters:
Returns:
makeLoading
-
jQueryObject
Method creates a spinner over the specified object. Uses the external/spin.js library. Attaches a function under 'ph-plus-removeLoader' which can remove the spinner from the object. If a spinner has already been attached, the spinner is cleared from the object and the object returned.
Parameters:
-
jQueryObject
ObjectThe target jQuery object where to apply the spinner to.
Returns:
the manipulated target object
queryStringToJSON
()
Json
Method to extract the query parameters from the current website url query part
Returns:
An object where properties are named according to the query parameter names and receiving the values defined in the query.
removeLoading
-
jQueryObject
Method to remove the loading spinner from the specified object. Looks for a function under 'ph-plus-removeLoader' and executes it.
Parameters:
-
jQueryObject
ObjectThe target jQuery object where to apply the spinner to.
Returns:
the manipulated target object
timeago
-
Datetime
Bridging function for the jquery.timeago plugin (external/jquery.timeago.js) A plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). http://plugins.jquery.com/timeago/
Parameters:
-
Datetime
DatetimeThe datetime to convert into a relative time phrase


Answer Collector
Top contributors
Please enter your name:
Your name
Piko
Vlad
Anya
Dima
Please enter a question:
Please enter a correct answer:
Enter
Download DOCX
Download PDF
Download JSON


Problem 4. Average age of females
Write a function that calculates the average age of all females, extracted from an array of persons
Use Array#filter
You could use Chrome console (F12) or Firebug to see the results.


Python API¶
The driver program main.py
utilizes the following modules in /modules
:
- constants.py
- dataContainer.py
- functions.py
- importPath.py
- molecule.py
- noiseAnalyzer.py
- solvers.py
- state.py
- transform.py
- visualization.py
constants module¶
Physical constants used within this project
-
constants.
B
= 9.249999999999999e-07¶ float; Rotational rotational constant with unit converted to atomic units
-
constants.
hbar
= 1.0¶ float; Reduced Planck’s constant
-
constants.
m
= 8¶ int; Maximum energy quantum number
-
constants.
mu
= 0.2788867924528302¶ float; Dipole moment with unit converted to atomic units
-
constants.
w1
= 9.249999999999999e-07¶ float; First energy level spacing
dataContainer module¶
This module holds implementation for class DataContainer to store data provided by user and generated by other classes.
-
class
dataContainer.
DataContainer
(path)¶ Bases:
object
A DataContainer contains all data associated with a single path.
Class DataContainer provides a container to store data associated with a single path specified by user.
Parameters: path (numpy.array, shape=(n,2)) – A desired path of dipole moment projection provided by the user. Each row contains the x- and y-projection at each time point. -
n
¶ int – Number of time points.
-
path_desired
¶ numpy.array, shape=(n,2) – User-specified desired path of dipole moment projection described by x and y (in this order).
-
field
¶ numpy.array, shape=(n,2) – Control fields e_x and e_y at each time point calculated by PathToField.
-
path_actual
¶ numpy.array, shape=(n,2) – Path of dipole moment projection described by x and y that is resulted from the control field.
-
state
¶ numpy.array, shape=(2m+1,n) – Amplitudes of (2m+1) basis describing the system at each time point.
-
noise_stat_mean
¶ numpy.array, shape=(n,2) – mean x and y at each time point.
-
noise_stat_var
¶ numpy.array, shape=(n,2) – variance of x and y at each time point.
Raises: - TypeError: – If input is not an instance of numpy.ndarray
- ValueError: – If input numpy.ndarray is not n-by-2, or contains nan or inf
-
functions module¶
Functions used in solver class
-
functions.
cosphi
(m)¶ Get operator for x-component of dipole moment projection.
Parameters: m (int) – Maxium energy quantum number. Returns: cosphi – Matrix representation of operator for x-component of dipole moment projection. Return type: numpy.array, shape=(2m+1,2m+1)
-
functions.
d2dphi2
(m)¶ Calculates the operator to get the second derivative of phi, used for solving b-vector in solvers.PathToField._get_b method.
Parameters: m (int) – Maxium energy quantum number. Returns: d2dphi2 – Matrix representation of the operator to get the second derivative of phi. Return type: numpy.array, shape=(2m+1,2m+1)
-
functions.
d2dt2
(x, dt)¶ Calculate second derivative of a sequence of scalar numbers. Assume the time differecne between two adjacent points is the same throughout the entire sequence.
This is used for solving b-vector in solvers.PathToField._get_b method.
Parameters: - x (numpy.array, shape=(n,)) – An 1-D sequence of numbers.
- dt (float) – Step size of time, i.e. the time difference between two adjacent numbers in x.
Returns: d2x – The second derivative of the original sequence x.
Return type: numpy.array, shape=(n,)
-
functions.
ddphi
(m)¶ Calculates the operator to get the first derivative of phi, used for solving b-vector in solvers.PathToField._get_b method.
Parameters: m (int) – Maxium energy quantum number. Returns: ddphi – Matrix representation of the operator to get the first derivative of phi. Return type: numpy.array, shape=(2m+1,2m+1)
-
functions.
sinphi
(m)¶ Get operator for y-component of dipole moment projection.
Parameters: m (int) – Maxium energy quantum number. Returns: sinphi – Matrix representation of operator for y-component of dipole moment projection. Return type: numpy.array, shape=(2m+1,2m+1)
importPath module¶
-
importPath.
import_my_module
(full_name, path)¶ Function for importing a python module from path. Python 3.4+ only.
Parameters: - full_name (str) – Name of the module (no file extension)
- path (str) – Path to the module (with file extension)
Returns: mod – Module object
Return type: object
-
class
importPath.
import_path
¶ Bases:
tkinter.Tk
Class provides the viualization window for the user to draw a path. The path can also be loaded from a data file or generated with a provided function. The coordinates of the path are then recorded in a list for future use, and can be retrieved with the get_coordinates() function. credit to: stack_exchange_40604233 for base design
-
width
¶ float – Width of the GUI in pixels
-
height
¶ float – Height of the GUI in pixels
-
canvas
¶ Tkinter object – Tkinter canvas object for allowing the user to draw a path and select files
-
counter
¶ int – Counter for use in drawing path
-
previous_x
¶ float – Last pointer x position
-
previous_y
¶ float – Last pointer y position
-
current_x
¶ float – Current x position
-
current_y
¶ float – Current y position
-
coordinate_array
¶ numpy.array, shape=(n, 2) – Coordinates for the user path
-
clear
()¶ Clear all data held in the object and start over
-
draw_line
(event)¶ Visualize the path as it’s being drawn
Parameters: event (object) – Tkinter object that stores (among other things), the x and y positon of the cursor
-
finished
()¶
-
get_coordinates
()¶ Returns the list of coordinates as numpy array
Returns: coords – Coordinates of the path Return type: numpy.array, shape=(n,2)
-
instructions
()¶ Display instuctions when ‘instructions’ button clicked
-
load_from_file
(filename=None)¶ Allow user to choose file for input
Parameters: filename (str) – Filename for user data/user function
-
plot_coordinates
()¶ Plot coordinates held in coordinate list
-
position_previous
(event)¶ Need to track the previous position for drawing lines
Parameters: event (object) – Tkinter object that stores (among other things), the x and y positon of the cursor
-
record_coordinates
(event)¶ Keep every coordinate in a list, but not repeating coordinates NOTE: need to subtract y from height since pixels are recorded from top
Parameters: event (object) – Tkinter object that stores (among other things), the x and y positon of the cursor
-
molecule module¶
Implementation of class Rotor as a basic unit to describe a system of interest.
-
class
molecule.
Molecule
¶ Bases:
abc.ABC
Abstract base class for molecules (i.e., system of interest)
-
evolve
()¶ Evolve the state to next time point by a unitary operator
-
-
class
molecule.
Rotor
(m)¶ Bases:
molecule.Molecule
A basic unit to describe a rotor molecule.
Class Rotor provides a basic unit to describe and manipulate a rotor molecule. It can be used within a solver like solvers.PathToField or solvers.FieldToPath.
In contains information including the maximum energy quantum number m, the current time, and the current state of the molecule. It also has the external field applied to the rotor and the hamiltonian of the rotor. A rotor molecule can evolve itself according to its hamiltonian, update the time, state, field and write them into its history, as well as exporting the history as np.ndarray.
Parameters: m (int) – Maximum energy quantum number -
state
¶ State object – Contining amplitudes of basic wave functions for the molecule
-
field
¶ numpy.array, shape=(2,) – External control field expresses as (e_x, e_y)
-
hamiltonian
¶ numpy.array, shape=(2m+1,2m+1) – Matrix representation of molecule-specific Hamiltonian operator.
-
dipole_x
¶ numpy.array, shape=(2m+1,2m+1) – Matrix representation of operator for x-projection of dipole moment.
-
dipole_y
¶ numpy.array, shape=(2m+1,2m+1) – Matrix representation of operator for y-projection of dipole moment.
-
evolve
(dt)¶ Evolve and update the state of molecule using its hamiltonian.
Method evolve invokes the method in hamiltonian to evolve the molecule state by dt forward in time. It then updates the time and state, and records them into history.
Parameters: dt (float) – Step size of time.
-
get_fields_asarray
()¶ Return history of field as an array.
Returns: fields – Control fields to apply to the molecule. Each row is a field described as (e_x,e_y) at a time point. Return type: numpy.array, shape=(n,2)
-
get_states_asarray
()¶ Return history of state as an array.
Returns: states – State amplitudes of the molecule at each time points. Each column of this returned 2D-array is a state amplitudes vector. Return type: numpy.array, shape=(2m+1,n)
-
get_time_asarray
()¶ Return history of time as an array.
Returns: times – Array containing n time points. Return type: numpy.array, shape=(n,)
-
set_field
(field)¶ Set the external field and calculate hamiltonian accordingly.
set_field will set rotor.field to input field object and change self.hamiltonian to the new hamiltonian based on the new field. This DOES NOT add a new value to history but instead change the last value of history, and hence should only be used to set the initial field when a rotor object instantiated within a solver. (solvers.FieldToPath or solvers.PathToField)
Parameters: field (numpy.array, shape=(2,)) – New external field expressed as (e_x, e_y) to set to the molecule.
-
update_field
(field)¶ Set and update field of molecule with history appended and hamiltonian recalculated.
Parameters: field (numpy.array, shape=(2,)) – New external field expressed as (e_x, e_y) to set to the molecule.
-
update_state
(state)¶ Set and update state of molecule with history appended.
Parameters: state (State object) – Current state of the molecule.
-
update_time
(time)¶ Set and update time of molecule with history appended.
Parameters: time (float) – Current time.
-
noiseAnalyzer module¶
noiseanalyser.py
-
class
noiseAnalyzer.
NoiseAnalyser
(smoothfield, dt, variance, numfield, processors=4)¶ Bases:
object
Class for doing some noise analysis for a given field to calculate the mean and variance for the output path. The NoiseAnalyzer module uses some data in the DataContainer object and some data are specified by the user.Since calulating path from each noisy field is independet of the calculating the path for the other noisy fields, this part can be parallel. In this module:
- The field that is calculated through the simulation is the input.
- The user specifies the variance of the noise and the number of samples that are going to be made for analysis.
- Every set of noise is added to the field and the path is calculated for each set of noisy field through FieldToPath.
- In the last part mean and variance of calculated paths are calculated as the output.
Parameters: - smoothfield (numpy.array, shape=(n,2)) – Control fields e_x and e_y at each time point calculated by PathToField. Now, stored in the DataContainer.
- dt (float, optional (default=1000)) – Difference of time between two adjacent time points. This is path-specific and is currently calculated when a dataContainer.DataContainer object is instantiated with a desired path.
- variance (folat) – Variance of the distribution of numbers that are added to the field as noise.
- numfield (integer) – Number of samples that are used for noise analysis.
- processors (int, optional(default=4)) – Number of proccessors for the parallelizing this part of the code.
-
n
¶ integer – number of points.
-
field
¶ numpy.array, shape=(n, 2) – Control fields.
-
dt
¶ float, optional (default=1000) – Difference of time between two adjacent time points.
-
numfield
¶ integer – Number of samples that are used for noise analysis.
-
variance
¶ folat – Variance of the distribution of numbers that are added to the field as noise.
-
processors
¶ int, optional(default=4) – Number of proccessors for the parallelizing this part of the code.
-
path
¶ numpy.arrray shape(n,2*numfield) – Matrix that contains all paths that are calculate from noisy fields.
-
noisy_field
¶ numpy.arrray shape(n,2*numfield) – Matrix that contains all noisy field controls.
-
pathmean
¶ numpy.array, shape(n,2) – Mean path which is calculated from all paths that are output of PathToField solver.
-
pathvar
¶ numpy.array, shape(n,2) – Variance of the noisy field.
-
analyze
()¶ This is a wraper of other member method to do the statistics.
Returns: - pathmean (numpy.array, shape(n,2)) – Mean of the path from noisy fields.
- pathvar (numpy.array, shape(n,2)) – variance of the path from noisy fields.
-
calc_a_path
(i)¶ Calculates the path from PathToField for one noisy field.
Parameters: i (integer) – counter Returns: path – matrix containing on path. Return type: numpy.array, shape=(n,2)
-
calc_noisy_field
()¶ This method produces some random number with normal distribution to be added to the control field.
-
calc_path
()¶ Parallel version of calc_a_path to calculate the path for all noisy fields.
-
calc_statistic
()¶ Calculate the mean path from the calculated path from noisy fields. This method also calcules a matrix with the same dimension as the path that shows the variance of each point cooridante variance from the mean path.
solvers module¶
Module solvers implements two classes to calculate
- control fields for a given path (PathToField), and
- resulting path from a given field (FieldToPath).
-
class
solvers.
FieldToPath
(fields, dt=1000, molecule=None)¶ Bases:
solvers.Solver
Calculate the resulting path from a given set of control fields.
Class FieldToPath is used to solve the trajectory of molecule’s dipole moment projection for a given set of control fields in time. The system of interest by default is a rotor (molecule.Rotor.)
Parameters: - fields (numpy.array, shape=(n,2)) – A prescribed set of control fields to apply to the molecule.
- dt (float, optional (default=1000)) – Difference of time between two adjacent time points. This is path-specific and is currently calculated when a dataContainer.DataContainer object is instantiated with a desired path.
- molecule (Molecule object, optional (default=Rotor)) – System of interest. Default to a Rotor molecule with a system dimension of m=8 specified in constants.py.
-
molecule
¶ Molecule object – System of interest.
-
n
¶ int – Number of time points.
-
fields
¶ numpy.array, shape=(n,2) – Time-series of control field prescribed.
-
dt
¶ float – Delta t between two adjacent time points.
-
time
¶ numpy.array, shape=(n,) – Time vector in atomic units.
-
path
¶ numpy.array, shape=(n,2) – Resulting path of molecule’s dipole moment projection.
-
export
()¶ Export calculated time vector, fields, and states as np.ndarray.
Returns: - time (numpy.array, shape=(n,)) – Time vector based on dt. In unit of picoseconds.
- path (numpy.array, shape=(n,2)) – Resulting path of molecule’s dipole moment projection.
- states (numpy.array, shape=(2m+1,n)) – State amplitudes of the system at every time point.
-
solve
()¶ Calculate path of rotor dipole moment projection from given fields.
-
class
solvers.
PathToField
(path_desired, dt=1000, molecule=None)¶ Bases:
solvers.Solver
PathToField is a solver that solves the control fields for a given path of dipole moment projection.
Class PathToField is used to solve a set of control fields that drive the dipole moment projection of the system of interest to follow a given path. The system of interest by default is a rotor (molecule.Rotor.)
Parameters: - path_desired (numpy.array, shape=(n,2)) – A desired path of molecule dipole moment projection.
- dt (float, optional (default=1000)) – Difference of time between two adjacent time points. This is path-specific and is currently calculated when a dataContainer.DataContainer object is instantiated with a desired path.
- molecule (Molecule object, optional (default=Rotor)) – System of interest. Default to a Rotor molecule with a system dimension of m=8 specified in constants.py.
-
molecule
¶ Molecule object – System of interest.
-
path
¶ numpy.array, shape=(n,2) – Path specified.
-
n
¶ int – Number of time points.
-
dt
¶ float – Delta t between two adjacent time points.
-
time
¶ numpy.array, shape=(n,) – Time vector in atomic units.
-
export
()¶ Export calculated time vector, fields, path, and states as np.ndarray.
Returns: - time (numpy.array, shape=(n,)) – Time vector based on dt. In unit of picoseconds.
- fields (numpy.array, shape=(n,2)) – Control fields required for the path of interest. In unit of V/angstrom.
- path (numpy.array, shape=(n,2)) – Resulting path based on the calculated fields.
- states (numpy.array, shape=(2m+1,n)) – State amplitudes of the system at every time point.
-
solve
()¶ Calculate the control field required for each time step.
state module¶
Implementation of class State to hold amplitutes of basic wave functions describing the system and member methods to use.
-
class
state.
State
(m, value=None)¶ Bases:
object
Contains amplitudes of basis wave functions and to derive properies of the system.
Class State provides the following functionalities:
1. As a container for calculated state at a single time point, which is a (2m+1,) array where m is the maximum energy quantum number.
2. Functions to access the state and, in conjunction with other objects (e.g., operators), to derive other properties of the system.
Parameters: - m (int) – Maximim energy quantum number.
- value (numpy.array, shape=(2m+1,)) – Amplitude of each basic wave function. Default to None which will generate an amplitude-vector for the ground state.
-
m
¶ int – Maximim energy quantum number.
-
value
¶ numpy.array, shape=(2m+1,), optional (default=None) – Amplitude of each basic wave function. Default to None which will generate an amplitude-vector for the ground state.
-
as_bra
()¶ Calculates the complex conjugate (known as bra) of the weights (self.value).
Returns: Conjugate transpose of the state amplitudes. Return type: numpy.array, shape=(1,2m+1)
-
as_ket
()¶ Returns the state amplitudes vector, known as ket.
Returns: Vector of state amplitudes. Return type: numpy.array, shape=(2m+1,1)
-
get_expt
(operator)¶ Calculates the expectation value of an observable for the state.
This is same as the following expression: < bra | operator | ket > where the operator is the matrix representation of a corresponding observable.
Parameters: operator (numpy.array, shape=(2m+1,2m+1)) – The matrix representation of a specific observable of interest. Returns: expt – A scalar of the calculated expectation value for the observable described by the input operator. Return type: float
transform module¶
-
transform.
transform_path
(path)¶ Processes user defined input path by interpolating (in a manner that creates a higher density of points at early times) and smoothing using a savitzky-golay filter for compatibility with solver.
Parameters: - path (numpy.array, shape=(n,2)) –
- representation of the path. (Matrix) –
Returns: - new_path (numpy.array, shape=(n2,2))
- New paths whose dimensions are greater than those of the original input
- path (i.e., n2 > n), as the length of the array is expanded during the
- interpolation function.
- dt (float)
- Time step size.
visualization module¶
-
class
visualization.
Visualization
(dat)¶ Bases:
object
Class for visualizing data of a DataStore object.
The visualization module uses data in a DataContainer object for plotting. This module allows plotting of:
- control fields amplitude over time for both x and y fields.
- actual and expected trajectory of the rigid rotor for dimensions x and y over time, together with a phase plot of x and y trajectories.
- a heatmap of probability density for rotational angle over time.
Parameters: dat (object) – A DataContainer used for plotting. -
t
¶ numpy.array, shape=(n,). – Time points.
-
m
¶ int – Magnetic quantum number.
-
state
¶ numpy.array, shape=(2m+1, n) – System state at each time point.
-
field
¶ numpy.array, shape=(n, 2) – Control fields.
-
cos_phi_actual
¶ numpy.array, shape=(n,) – Actual x trajectory.
-
sin_phi_actual
¶ numpy.array, shape=(n,) – Actual y trajectory.
-
cos_phi_desired
¶ numpy.array, shape=(n,) – Desired x trajectory.
-
sin_phi_desired
¶ numpy.array, shape=(n,) – Desired y trajectory.
-
mean_cos_phi_actual_noise
¶ numpy.array, shape=(n,) – Mean actual x trajectory with noise.
-
mean_sin_phi_actual_noise
¶ numpy.array, shape=(n,) – Mean actual y trajectory with noise.
-
noise_stat_var
¶ numpy.array, shape=(n, 2) – Variance of actual trajectories with noise.
-
density
(n_grid=100, out=None)¶ Plot a probability density heatmap over time for different rotational angles.
Parameters: - n_grid (int, optional (default=100)) – Number of equally spaced rotational angles to calculate probability density in \([0, 2{\pi})\). Default to 100.
- out (str, optional (default=None)) – The path to save the figure if not None. If None, show the figure in the console. Default to None.
Returns: proba – A numpy ndarray for probability density for plotting.
Return type: numpy.array, shape=(n_grid, n)
-
fields
(out=None)¶ Plot contol fields amplitude over time for both x and y dimensions.
Parameters: out (str, optional (default=None)) – The path to save the figure if not None. If None, show the figure in the console. Default to None.
-
noise_variance
(out=None)¶ Plot variance of trajectories over time under noise.
Parameters: out (str, optional (default=None)) – The path to save the figure if not None. If None, show the figure in the console. Default to None.
-
trajectory
(noise=True, out=None)¶ Plot trajectories of the rigid rotor.
Plot actual and expected trajectories of x (i.e. <cos(\({\phi}\))>) and y (i.e. <sin(\({\phi}\))>) over time and also the phase plot of x and y.
Parameters: - noise (bool, optional (default=True)) – Whether to plot mean trajectories under noise over time. Default to True.
- out (str, optional (default=None)) – The path to save the figure if not None. If None, show the figure in the console. Default to None.


Name:
Country: Australia Canada Switzerland France Germany Greece Italy Japan Mexico Netherlands Poland Spain Sweden Turkey United states U.K
How often do you smoke?: Never Daily Weekly Monthly Yearly
How often do you drink alcohol?: Never Daily Weekly Monthly Yearly
How often do you exercise?: Never Daily Weekly Monthly Yearly
Thank you for filling out our questionnaire


This app enables people to create a workout to fit their schedule and goals, no matter how much experience they have!
Click Here to get started
The best way to form healthy habits is to stick to solid schedules.
Workout app helps you build the framework you need.
Pick your weekly workout from one of the community plans or add your own to the pile!


This extension allows you to post anonymously on facebook. Other peope with the extension will be able see those posts. The extension also broadcasts your messages beyond your current friend group boundaries.
This is a pre-alpha version! Current features are limited to posting. Posts will expire after 24 hours. Some features that are in development are listed below:
Progress can be tracked via Github
Developed by Gentry Demchak
Send Questions + suggestions to deevolutionism@gmail.com