10. Investigate Ethereum Accounts
Investigate Ethereum Accounts
Ethereum accounts are at the core of what makes Ethereum so powerful. Here we'll focus on defining Ethereum accounts and go over how to access account information using web3 and Infura.
Objectives
Our goal is to help you do the following things.
- Define the differences between externally owned accounts (EOA's) and contract accounts (CA's).
- Read the account balance and transaction count of an EOA's from your terminal using web3 and Infura.
- Run functions on an existing CA from your terminal using web3 and Infura.
1. Ethereum Accounts
To get started I'll introduce you to the different Ethereum account types and describe the differences between them.
Ethereum Accounts
Reflect
QUESTION:
In 3 sentences or less, describe the important similarities and differences between externally owned accounts and contract accounts.
ANSWER:
Thanks for your answer! There are many ways to answer this question, here's my attempt.
Externally owned accounts are owned by users with private keys while contract accounts are held by smart contracts. Transaction counts on EOA's refer to the number of transactions that user made while on CA's it refers to the number of times it has deployed other smart contracts. Many of the contents of these accounts are the same but contract accounts also hold the code from the deployed contract.
QUIZ QUESTION::
Match each of the account variables to their definitions as described in the video above.
ANSWER CHOICES:
|
Definition |
Account Variable |
|---|---|
Account balance |
|
Code hash |
|
Nonce |
|
Storage hash |
SOLUTION:
|
Definition |
Account Variable |
|---|---|
|
Account balance |
|
|
Code hash |
|
|
Nonce |
|
|
Storage hash |
2. Demonstration: Read an Externally Owned Account
Now that you understand the basics of externally owned accounts and contract accounts, let's focus on reading data from an externally owned account. We did this in the previous concept so this time you'll add a bit of extra functionality to our call and also challenge yourself to make a new a brand new call.
10.2-Read-An-Externally-Owned-Account
Note: All the steps from the video above are available in the text below.
Task Description:
You can use this checklist to keep track of your progress on the steps listed below.
Task Feedback:
Great job!
Text Description: Read an Externally Owned Account
Step 1: Find an account using Etherscan
To read an externally owned account, you'll need to find one using etherscan. The link provided takes you to the top accounts based on the number of ether they hold. This is a great place to see the world's richest Ethereum holders.

See if you can get the account balance from your terminal similar to how we did in the last concept. Feel free to check back to that concept if you're not sure.
Once thing you might notice is that we're still getting wei returned to us in our terminal.
Example
1573611090334021500000000 <----- Note: Your value may be different*
Step 3: Convert the balance in wei to a balance in ether
In some cases, you might prefer to have the value of Ethereum returned to us rather than the value of wei. In this case we can use the web3.utils library to make this conversion.
To do this, try passing the balance into web3.utils.fromWei function as shown below.
web3.utils.fromWei(balance, 'ether')
Step 4: Get Transaction Count
Another value held in an EOA as described in the video is the transaction count. Using web3, see if you can get the transaction count for this account for yourself.
Here is the example for web3.eth.getTransactionCount as shown in the documentation.
web3.eth.getTransactionCount(address [, defaultBlock] [, callback])
Example
web3.eth.getTransactionCount("ACCOUNT NUMBER")
.then(console.log);
> 1
3. Demonstration: Read a Contract Account
While CA's can be similar to EOA's in some ways, making calls to them from web3 is much different. To read the data from a contract account, you'll need some extra details. Once set up, you'll have the ability to do some pretty interesting things, like call the methods on a live contract! In the following video, you'll do that on a live contract from the main network.
10.3-Read-A-Countract-Account
Note: All the steps from the video above are available in the text below.
Task Description:
You can use this checklist to keep track of your progress on the steps listed below.
Task Feedback:
Great work! You can now call functions on a live smart contract from your terminal!
Text Description: Read a Contract Account
Step 1: Set a variable ABI to the value of the ABI in the contract code.
var abi = PASTE ABI FROM CONTRACT
abi
You can copy the ABI for the basic attention token from this link.
Calling the abi variable will reformat the abi to look similar to the terminal image shown below.
Step 2: Set the address of the contract to a variable named contractAddress
.
var contractAddress = '0x0D8775F648430679A709E98d2b0Cb6250d2887EF'
Step 3: ABI and Contract Address
Pass the abi and contractAddress into the web3.eth.Contract function and assign it to a varialbe named contract.
var contract = new web3.eth.Contract(abi, contractAddress)
Step 4: View the details of the contract.
contract
Step 5: View the methods from the contract
contract.methods
Step 6: Call methods for this contract from your terminal.
Here are a few examples. Try these in your terminal to see what response you get.
contract.methods.name()
contract.methods.name().call((err, result) => { console.log(result )})
contract.methods.symbol().call((err, result) => { console.log(result )})
contract.methods.totalSupply().call((err, result) => { console.log(result )})
Review
Here we discussed Ethereum accounts; externally owned accounts (EOA) and contract accounts (CA). You also went through the steps needed to find information about each of these accounts from your terminal.
Skill Tracker
Task Description:
Track the objectives you've feel you've gained the skills to complete.
Task Feedback:
Congratulations on gaining new skills!


A fast and improved implementation of the graphical LASSO.
| Version: | 1.0 |
| Suggests: | glasso, rbenchmark |
| Published: | 2018-07-30 |
| Author: | Matyas A Sustik [aut, cph], Ben Calderhead [aut, cph], Julien Clavel [com, ctb] |
| Maintainer: | Julien Clavel <julien.clavel at hotmail.fr> |
| License: | GPL (≥ 3) |
| NeedsCompilation: | yes |
| Materials: | README |
| CRAN checks: | glassoFast results |
| Reference manual: | glassoFast.pdf |
| Package source: | glassoFast_1.0.tar.gz |
| Windows binaries: | r-devel: glassoFast_1.0.zip, r-release: glassoFast_1.0.zip, r-oldrel: glassoFast_1.0.zip |
| OS X binaries: | r-release: glassoFast_1.0.tgz, r-oldrel: glassoFast_1.0.tgz |
| Reverse imports: | mvMORPH, RPANDA |
Please use the canonical form https://CRAN.R-project.org/package=glassoFast to link to this page.


| Home | Libraries | People | FAQ | More |
The following option applies only if BOOST_REGEX_RECURSIVE is set.
下面选项只有当BOOST_REGEX_RECURSIVE定义时才有效：
|
macro 宏 |
description 说明 |
|---|---|
|
BOOST_REGEX_HAS_MS_STACK_GUARD |
Tells Boost.Regex that Microsoft style __try - __except blocks
are supported, and can be used to safely trap stack overflow. |
The following options apply only if BOOST_REGEX_NON_RECURSIVE is set.
当BOOST_REGEX_NON_RECURSIVE被定义时下面选项有效：
|
macro 宏 |
description 说明 |
|---|---|
|
BOOST_REGEX_BLOCKSIZE |
In non-recursive mode, Boost.Regex uses largish blocks of memory
to act as a stack for the state machine, the larger the block size
then the fewer allocations that will take place. This defaults
to 4096 bytes, which is large enough to match the vast majority
of regular expressions without further allocations, however, you
can choose smaller or larger values depending upon your platforms
characteristics. |
|
BOOST_REGEX_MAX_BLOCKS |
Tells Boost.Regex how many blocks of size BOOST_REGEX_BLOCKSIZE
it is permitted to use. If this value is exceeded then Boost.Regex
will stop trying to find a match and throw a std::runtime_error.
Defaults to 1024, don't forget to tweek this value if you alter
BOOST_REGEX_BLOCKSIZE by much. |
|
BOOST_REGEX_MAX_CACHE_BLOCKS |
Tells Boost.Regex how many memory blocks to store in it's internal
cache - memory blocks are taken from this cache rather than by
calling ::operator new. Generally speeking this can be an order
of magnitude faster than calling ::opertator new each time a memory
block is required, but has the downside that Boost.Regex can end
up caching a large chunk of memory (by default up to 16 blocks
each of BOOST_REGEX_BLOCKSIZE size). If memory is tight then try
defining this to 0 (disables all caching), or if that is too slow,
then a value of 1 or 2, may be sufficient. On the other hand, on
large multi-processor, multi-threaded systems, you may find that
a higher value is in order. |


Network formation models¶
Warning
Do not manually instantiate this class using the class constructor. Instantiate the class using the method noesis.Noesis.create_network_from_model()
.
-
class
noesis.models.
NetworkModel
(model, *args)¶ This class implements the interface for network models, allowing to instantiate a network given a network formation model.
Parameters: - model (string) – Network formation model used to generate the network. Currently supported models are ‘ErdosRenyi’, ‘BarabasiAlbert’, ‘WattsStrogatz’, ‘Gilbert’, ‘PriceCitation’, ‘AnchoredRandom’, ‘ConnectedRandom’, ‘Complete’, ‘BinaryTree’, ‘Hypercube’, ‘Isolate’, ‘Mesh’, ‘Ring’, ‘Star’, ‘Tandem’, and ‘Toroidal’.
- args (parameters) – Parameters the for network formation model. These parameters are specific for each network formation model and more details are provided in NOESIS documentation.


×
Subscribe
Put your email below and relax-- whenever i'll post something you'll get personally notified by mail.
No spam. Unsubscribe anytime!
Put your email below and relax-- whenever i'll post something you'll get personally notified by mail.
No spam. Unsubscribe anytime!


Mission
Learn about CanJS’s mission, why it matters, and how we’ve worked (and will keep working) to accomplish it.
CanJS’s mission is to minimize the cost of building and maintaining JavaScript applications by balancing innovation and stability, helping developers transcend a changing technology landscape.
You shouldn’t have to rewrite your application to keep pace with technology. We constantly integrate new ideas and evolving best practices into CanJS libraries, but in a responsible way that makes it possible to upgrade gracefully. We aim to provide a stable and innovative platform, so you can block out noise and stay focused your app, not the tools.
Keep reading to learn why our mission is important and how we’ve fared in realizing it:
- Stability and innovation matter — Why stability and innovation are the two most important factors in minimizing the cost of building and maintaining JavaScript applications.
- Stability is difficult in the JavaScript community — Why the JavaScript community sees a never-ending stream of frameworks and suffers from JavaScript Framework Fatigue.
- Our history of stability and innovation — How we’ve managed to keep innovating for 10 years (while still providing a viable upgrade path) and what we’re doing now to make CanJS even more stable moving forward.
Stability and innovation matter
Stability and innovation are often conflicting goals, but they are both critical factors to application success. Application development lifecycles can last years, so it’s important that code written today will be relevant tomorrow. Yet technology changes quickly, especially in JavaScript. New technology brings better techniques and is critical for developer happiness and retention.
When starting a new application, it’s easy to forget that the majority of development happens after the application is released. Many frameworks, after a short period of popularity, either:
- End up getting replaced by a hot new framework.
- Release a major version that not even remotely backwards-compatible with the previous version.
Productivity-wise, over the life of your application, that ends up looking like this:
Or like this:
What is needed is a balance of innovation and stability, where developer productivity increases over time, but doesn’t take large steps backward. That looks something like this:
This is our mission.
Stability is difficult in the JavaScript community
You may be familiar with the never-ending stream of hot new JavaScript frameworks that take our community by storm every one or two years.
SproutCore -> Knockout -> Backbone -> Angular -> React -> ?
This isn’t surprising. Consider how many different programming languages you can use on the server-side: Java, Ruby, Python, C#, Haskell, etc. There is only one JavaScript. Innovation is going to move at a blistering pace. We should embrace it.
But, the blistering pace of innovation also means that most frameworks will emerge with one revolutionary feature and then fade as the next revolutionary framework emerges. Instead of the old framework adopting new ideas, the community and its attention move onto the next hot framework.
This makes it difficult to avoid stagnation in any community-driven tool over a long period of time.
Our history of stability and innovation
CanJS has been helping developers transcend the constantly changing technology landscape for over 10 years. Read on to learn about:
- Our history of stability.
- Our history of innovation.
- How 3.0 improves stability and innovation.
Our history of stability
CanJS has been around since 2007. CanJS was originally called JavaScriptMVC. In 2012, JavaScriptMVC was split up into several pieces, including CanJS. Every year, we have improved CanJS by incorporating new best practices and ideas from the larger JavaScript community, while not leaving behind our existing users. The result has been a viable upgrade path for over 10 years!
Major releases are not fully backwards-compatible, but it was possible to transition with limited effort.
Let’s see how one piece of CanJS, can-control, evolved over this time.
In 2007, using JavaScriptMVC 1.0, to listen to when any element
that matches the selector .todos li.complete
is clicked, you might have written something like the following:
new MVC.Controller('todos',{
"li.complete click": function(el, ev){
// DO STUFF
}
});
JavaScriptMVC was one of the first libraries to support event delegation, but these old controls weren’t extensible and couldn’t work in an isolated context.
In 2009, jQuery began to dominate JavaScript development. We helped add event delegation to jQuery and integrated it into JavaScriptMVC 2.0. The previous code became:
$.Controller.extend("TodosController",{
"li.complete click": function(el, ev){
// DO STUFF
}
});
$(".todos").todos_controller();
In 2012, using CanJS 1.0, this became:
TodosController = can.Control.extend({
"li.complete click": function(el, ev){
// DO STUFF
}
});
new TodosController(".todos");
In 2013, we released CanJS 2.0, and transitioned to
can-components instead of can-controls. But even now, almost 10 years later,
to make that MVC.Controller
work in CanJS 3.0,
you could update it to the following:
var Control = require("can-control");
var TodosController = Control.extend({
"li.complete click": function(el, ev){
// DO STUFF
}
});
new TodosController(document.querySelector(".todos"));
This is one of many examples of CanJS’s code undergoing significant improvements and changes, while still keeping it possible to upgrade your application.
For teams upgrading to 3.0
, we created multiple migration paths
so upgrading can be done incrementally.
Our history of innovation
Over the past 9 years of CanJS, the web has evolved, and the best practices in JavaScript application development have changed. As these changes have occurred, CanJS has filtered out the very best ideas and practices, and implemented them in evolving APIs.
To name a few:
- Event delegation became a best practice for managing events around 2009. CanJS added support for event delegation in 2008, before jQuery landed support. Later, when jQuery became ubiquitous, we integrated jQuery into CanJS.
- RESTful APIs eventually became the best practice for designing a backend interface. can-model in 2010 provided ActiveRecord style abstractions around this pattern.
- Data bindings hit the mainstream in 2013 when Angular rose in popularity. CanJS landed support for this feature in 2011 with can-ejs.
- Building UI widgets as HTML custom elements, similar to web components, has become a best practice. can-component landed in 2013 to support this architecture.
- In 2015, CanJS landed support for using a Virtual DOM and simple server-side rendering with can-vdom.
- In early 2016, CanJS added real-time support and advanced caching technology with can-connect.
- In late 2016, CanJS added a more powerful observable type and enabled it to use functional reactive programming techniques.
This timeline shows more examples:
How 3.0 improves stability and innovation
CanJS 3.0 has been reorganized into several different dozen independent repositories, each with its own npm package and version number using Semantic Versioning. Organizing CanJS into individual repositories will improve CanJS’s stability and innovation going forward.
Stability
Independent repositories improve stability because they make it easier to upgrade more frequently. For example, compare upgrading a 2.3 app to upgrading a 3.0 app.
 Most of the difficulties upgrading are the breaking changes, which account for the majority of the upgrade step size:
Currently, to get all of those bug fixes and new features, you have to take on those breaking changes all at once. Depending on your company culture, and scale of your application, this might not be easy.
Going forward in CanJS 3.0, packages are released independently of
each other. You can upgrade to bug fixes and new features
immediately and delay breaking changes (example: can-route 4.0.0
) until later. You can upgrade breaking changes in steps too. For example,
you might upgrade to can-route 4.0.0
one month and can-component 4.0.0
the following month. CanJS 3.0’s upgrade path might look like:
Independent repositories also mean that legacy libraries (like can-ejs) can continue living through community-driven fixes and releases. Legacy libraries don’t die simply because they’re no longer included in the core CanJS build.
Innovation
Independent repositories enable CanJS to innovate faster for several reasons:
- Supporting legacy libraries, like can-ejs, will not slow down the development of other libraries.
- Experiments like can-stream-kefir, where a lot of innovation happens, can be released and have breaking changes without having to “get in” breaking changes in the core and infrastructure libraries.
- CanJS doesn’t feel as monolithic, appealing to developers using just one part. More users means more contributors.
The shift to independent repositories was CanJS 3.0’s biggest undertaking and arguably biggest feature. This fact underscores how important our goal of balancing innovation and stability is to us. For more nuts-and-bolts features of CanJS, please read CanJS’s Technical Highlights.


Hello, this is my report of my first experience with the muscle relaxant/sedative carisoprodol, soma, and how it led to my month and a half long psychological dependency/addiction. It all stated one night in February 2006. My four friends and I return from a night at the park.
9:00 P.M.
We arrived at the home of one of my friends that I am with. We are the party animals of my school so we were pretty let down that we had no alcohol and no marijuana, our drugs of choice. My friend says his mom usually has a bottle of liquor in the fridge so we go to investigate. We open the fridge and see one wine cooler, which makes us feel even more let down.
9:15 P.M.
Two of my friends, their dating, went to go to bed out in the trailer and the two others and I were watching TV. We wish that we had drugs as we sit there and watch 'Lord of War'. I suggest getting some grub so me and the friend whose house it was, we'll call him D, go to get a bite to eat. We call my third friend, we'll call him B, in to see what we had discovered. Bottles stacked up, all saying: 'Generic for: SOMA, 350 mg'. D's mother has a back problem and is prescribed this medication but almost never took it. Our mouths water.
9:30 PM
B, D and I all consume about four pills each, about 1.4 grams, and go back to watch the flick and let the effects kick in.
10:00 PM
We notice that we are paying more attention to the pleasant muscle buzz. The best way for me to describe this feeling is this, you know when you wake up and stretch in the morning or try to make a tight fist, that pleasant feeling of relaxation. We talk about it and see how it seems funny to try and walk or hit your face lightly. The mental feeling is like a mild alcoholic buzz, that nice gentle feeling of euphoria.
10:15 PM
We think that we are not messed up enough yet. The soma trio returns to the kitchen for more. B and I consume three and a half more, D on the other hand takes 5 more, 1.7 grams. It seemed to make sense because D was much heavier than B and I, D weighs about 280 lbs. We go to enjoy the feeling.
10:30 PM
We have completely forgotten about the movie. We are now spending the evening telling each other how much we love each other and hitting each other and laughing about it. D took out his digi cam and we did our best to take photos but it was pretty difficult. The body feel at this point was phenomenal, better than sex in my opinion. I was in a pit of happiness. The mild euphoria has now become mind blowing. I don't know if this euphoria was an effect of the drug or just my response to the muscle relaxation. We could barley walk at this point. D lay on one of the sofas and B and I sit on the other.
10:45-50 PM
My memory at this point isn't that well but I do remember taking three more and then splitting a fourth one with B. D took about four more. This was a mistake on our part. We are still laughing, in euphoria and trying to walk.
11:00-11:45 PM
Not so sure on time, sorry guys, but I don't think that it could of been over an hour. At this point we looked like a group old bums after happy hour. I remember grabbing D's camera and heading out into the back yard. D and B follow close behind.
The first thing that I remember about walking outside was D's dog. She was a young black Labrador and was very playful. We started to play with the dog. I noticed that it was very hard to have any hand eye coordination. Any motor control skill seemed as if we were really intoxicated from alcohol. At this point our bodies felt like beautiful women were messaging us everywhere, wonderful. It was twice as good as it was in D's living room. The mental feel was pretty euphoric and almost like having an empty mind, but you can still think about what your doing. The three of us played with the dog and took some photos.
9:30 AM
I open my eyes and it takes me a minute to realize where I am. I'm in D's bed. I roll over and see D laying there. I wake him up and before I get a chance to ask him, he says: 'What happened last night?'. After realizing that we had taken a large amount of soma we go down stairs. B is laying on the big sofa with the DVD menu for 'Lord of War' on the TV. We eat breakfast and then talked to our friends from the trailer. Boy did he have some stuff to tell us about our little adventure.
We were told that M, the male in the dating couple, woke up to B, D and I trying to flip the trailer over. He said that we came awfully close to doing so. He came out to call us assholes and tell us that they were trying to sleep and he saw that we were clearly under the influence of a drug. He told us that we all tried to fight him, no physical contact but many threats. He said the he told us to go back in the house and relax until we sobered up. Once he saw that we could not find the direction of the house he knew he had to help us get there. He said that it was a very difficult thing to do, M only weighs about 135 lbs. and the three of us all weigh well over 200 lbs.
He took one of us to the kitchen and asked what we had taken and whoever he took in the kitchen told him. M was very concerned about us and went to do some online research about carisoprodol dosage. He said that if we had taken anymore than we did he would have induced vomiting on us. Apparently the whole time that M was trying to help us we kept on calling him names and threatening to beat him up. He said that when he was helping me and D up into the room that we were practically falling up the stairs. He said that he was really scared for our lives.
 I wasn't really afraid to do soma again. The night after my first carisoprodol experience I was using it again. This time I only took 6. One thing that I would like to point out for all who are using Carisoprodol for the first time is that you should be very patient in waiting for effects. If my two friends and I had shown some patients I wouldn't have turned out as bad as it did. Anyways when I took 6 the second night it was a great experience. I was not to strong at all. A nice body fry, again that feeling you get after you stretch in the morning. A nice, mildly strong feeling of euphoria. This is the amount that I use nightly, usually with D, for about a week.
After a week I started taking about 8 or 9 a night. This is when things for me and D got a little serious. D's mother wanted an explanation for all the missing pills. A total of 450 pills were missing. Needless to say D and I were not getting any more soma. Without my soma at night is was hard to sleep. It was hard to deal with the stress of the day knowing that I don't have anything to help relieve the stress. To this day, about three and a half months after it all I still have cravings, I had one today. In fact that was the craving that motivated me to write this. I didn't really go into detail about the psychological addition because there really isn't much to say, I wanted it very badly every night for about a month.
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.


Investment is a key to long-term wealth
– Nick GerrardCEO of Metrobank
So many of us are demotivated to achieve anything. Such people are not enthusiastic about anything. They don’t want to work towards any goal. Nothing motivates them to work. Why many of us are not motivated? What is wrong?
We think in different ways and our thinking is decided by many factors. Some are known and some are unknown. The known factors are – thinking, circumstances.
The purpose of your brochure may differ from business to business. Some are designed to ...
Be careful what you believe because that is what you will experience. Your belief system is a mechanism which ...
Differentiate and you stand out in a crowded marketplace. Present your uniqueness and emphasize your ...
Many studies have been done to research the effects of motivation and mental health. As the implications of helping those with negative self-esteem, depression and anxiety are immense this is certainly an area of research that deserves a great deal of attention.


Abstract class for unifying mia::elly::dstruct::StandardCorrelationRelation and mia::elly::dstruct::IncrementalCorrelationRelation.
More...
#include <AbstractCorrelationRelation.h>
List of all members.
Detailed Description
Constructor & Destructor Documentation
| mia::elly::dstruct::AbstractCorrelationRelation::~AbstractCorrelationRelation |
( |
| ) |
|
|
inline |
Deconstructor. Release and destroy all locks.
Member Function Documentation
| void mia::elly::dstruct::AbstractCorrelationRelation::dump_weights |
( |
| ) |
|
|
inline |
Refresh weight file by current weights.
| void mia::elly::dstruct::AbstractCorrelationRelation::lock |
( |
int |
fid | ) |
|
|
inline |
| void mia::elly::dstruct::AbstractCorrelationRelation::prepare_weights |
( |
| ) |
|
|
inline |
| void mia::elly::dstruct::AbstractCorrelationRelation::release |
( |
int |
fid | ) |
|
|
inline |
Release lock of a factor.
Member Data Documentation
| int mia::elly::dstruct::AbstractCorrelationRelation::factor_id |
ID of this correlation relation.
| std::string mia::elly::dstruct::AbstractCorrelationRelation::filename |
File that contains this correlation relation.
| std::string mia::elly::dstruct::AbstractCorrelationRelation::filetype |
Type of correlation relation file. {tsv}
| int mia::elly::dstruct::AbstractCorrelationRelation::function_id |
Factor ID – for potential/update/gradient functions.
| std::string mia::elly::dstruct::AbstractCorrelationRelation::mapfilename |
File that contains weights.
| int mia::elly::dstruct::AbstractCorrelationRelation::nfactor |
Number of factors being loaded.
| std::vector<pthread_mutex_t* > mia::elly::dstruct::AbstractCorrelationRelation::sems |
In-memory locks for factors in this correlation relation.
| std::vector<double> mia::elly::dstruct::AbstractCorrelationRelation::weights |
In-memory vector that stores weights.
The documentation for this class was generated from the following file:


{% extends 'base.html' %} {% block headaddons %} {% endblock %} {% block bodycontent %}
| user_name | Coins | Card 1 | Card 2 | {% for player in players %} {% if loop.index0 == turn %}|
|---|---|---|---|---|
| {{player.user_name}} | {{player.coins}} | {% for i in range(2) %} {% if player.cards|length < (i+1) %}{% elif player.user_name == user_name %} | {{player.cards[i]}} | {% else%}hidden | {% endif %} {% endfor %}
Take an action on your turn. Some actions can be blocked, some can be challenged. A block is claiming you have a card that blocks another players action. Anybody can challenge a player that takes a challengable action (even blocks are considered a challengable action). A challenge is when you accuse a player of not having the card to justify the action. When a challenge is issued the challenged player must reveal a card. Liars are punished by a forced discard of the revealed card. Accusing an honest player is punished by being forced to discard one of your own cards and the honest player gets a fresh one from the deck (including the one they just revealed).
Everyone - Income: Take 1 coin. Cannot be blocked or challenged
Everyone - Foreign Aid: Take 2 coins. Cannot be challenged. Can be blocked by player claiming Duke
Duke - Tax: Take 3 Coins. Cannot be blocked
Captain - Steal: Take 2 coins from another player. Can be blocked by Captain or Ambassador
Assassin - Assassinate: Pay 3 coins, choose a player to lose inFLUince (If they do not block or challenge, they choose a card to forfeit to the graveyard). Can be blocked Contessa
Contessa - Block assassination. Cannot be blocked.
Ambassador - Exchange: Take 2 cards, return 2 cards to court deck. Cannot be blocked.
Everyone - Infect: Pay 7 coins, choose a player to lose influince. Cannot be blocked or challenged.
If 10+ coins, must Infect


Preparation time
30 mins to 1 hour
Cooking time
30 mins to 1 hour
Serves
Serves 6-8
A stuffed loin of is pork wrapped in pancetta and foil to roast it. The loin semi-steams in its little parcel, the pancetta sticks to the outside of the pork, and the whole thing unwrapped looks beautiful, is moist and delicious.
For the stuffed pork, lay the pork flesh-side up on a chopping board with the belly flap away from you. With a sharp knife make an incision in the meat half way down running parallel to the board, cut almost all the way through. Open the loin up and season with salt and pepper.
Chop the herbs roughly and place in a mixing bowl with the lemon zest and olive oil. Mix well.
Rub the herb mixture on to the pork, being quite forceful. This will help to get the flavour and the seasoning evenly distributed. Roll up tightly and leave to sit for 20 minutes.
 Lay the pancetta two pieces long on the foil, over lapping slightly. Place the pork on top and roll. Bring the pancetta up to the edge covering the pork and then roll the foil around. Twist the ends so that the parcel is very tight like a sausage.
Preheat the oven to 200C/400F/Gas 6.
For the polenta, in a large pan bring 200ml/7fl oz water, the milk, salt, pepper and garlic to a rolling boil. Add the polenta, stirring all the time, until it returns to the boil and then cook for 45 minutes on a very low heat.
For the stuffed pork, place the roasting dish over a high heat and add the vegetable oil. Put the foil parcel in the dish and cook, turning every two minutes, so all parts of the parcel have had contact with the heat. This will seal the outside and colour the outer layer of the meat. Transfer to the oven and roast for 35- 40 minutes.
Remove the pork from the oven and test it is cooked by inserting a skewer through the foil and into the centre of the meat, if the juices run clear the pork is cooked. Leave to rest for five minutes.
For the polenta, add the cream and parmesan. Cook until dissolved. Remove from heat and add the mascarpone.
Gently unwrap the pork and cut into slices. Serve with the polenta.


ipentry - An IP address entry widget
This package provides a widget for the entering of a IP address.
Creates a new IPv4 ipentry widget and configures it with the given options and their values.
Creates a new ipentry widget for the entry of an IPv6 address. All options are the same as the IPv4 widget.
Each widget created with the command above supports the following methods:
Returns a boolean value. True indicates that the entry contains a complete IP address, meaning all fields have a value. In some cases IPv6 address are valid when fields are missing. You will need to do your own validation to detect this.
Returns the contents of the entry as a list consisting of 4 or 8 elements.
IPv4 Takes a list of 4 elements and inserts one into each quad of the entry, in order. All values in the list must be empty or integers. Values outside the range 0 to 255 are modified to be within the range. IPv6 Takes a list of 8 elements and inserts one into each quad of the entry, in order. All values in the list must be empty or 1 to 4 hex digits.
Sets the position of the widgets insertion cursor. Only integer values between 0 and 15 are valid for ipentry and 0 to 31 for ipentry6. Setting the icursor will only have an effect if the widget already has the input focus.
Modifies the configuration of the widget. For options and their meaning see the widget options section.
Returns information about the current configuration of the widget, for the specified option. For options and their meaning see the widget options section.
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category ipentry of the Tklib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.
Widget


GeNA Lab
Genomics and Networks Analysis Lab
Wei-Ting Lin
Jerry S.
WordPressclose
HTMLclose
CSSclose
JavaScriptclose
Adobe Photoshopclose
The Genomics and Networks Analysis Lab (GeNA Lab) is a team lead by Dr. Peter Chow-White that analyzes the social impacts of Big Data on the digital world. Their work primarily investigates the risks and opportunities regarding large volume data mining and issues on privacy and security.
The website was built over a span of approx. 6 months, and it is my first web-based school project as lead developer. At this time, I lacked knowledge in best practices, and while it is not exemplary work, it was a valuable learning experience.
View Live Site
Design Direction
Professional, clean, legible layout and text.ACTOR for Nav Links
Verdana for General Text, Titles
Final Prototype
View Live Site
See more projects


Hello! If you are reading this, you have found my blog! Isn't that exciting? Now I guess you'd like to
know a little more about me. Hmm, where to begin?
Well, I am a fun loving person from India currently living in the United States for the past ten years.
I work as an application engineer for Amazon and
have thirteen years of experience in the software industry. When I am not working, I love to unwind by
listening to a wide range of world music and spending quality time with my family. I am blessed with two
boys, Zane and Jared aged five and one respectively. I am multilingual and can speak and understand four
languages fluently.


%include templates/parts/head.html
%include templates/parts/navBar.htmlThanks to Julie Zelenski and Eric Roberts for creating this assignment. Modifications by Marty Stepp.
October 24, 2016
The classic CS106B assignment is based off a real life game called Boggle. Image courtesy of Rich Brooks (Flickr)
It's time for a CS106 classic, the venerable word game Boggle! The Boggle game board is a square grid onto which you randomly distribute a set of letter cubes. The goal is to find words on the board by tracing a path through adjoining letters. Two letters adjoin if they are next to each other horizontally, vertically, or diagonally. There are up to eight letters adjoining a cube. Each cube can be used at most once in a word. In the original version, all players work concurrently listing the words they find. When time is called, duplicates are removed from the lists and the players receive points for their remaining words.
Your assignment is to write a program that plays a fun, graphical rendition of this little charmer, adapted for the human and computer to play pitted against one another. You’ll quickly learn you have little hope of defeating the computer, but it’s awesome to realize you wrote this program that can so soundly thrash you again and again!
This assignment will introduce you to classes, but the main focus is on designing and implementing recursive algorithms. The starter code for this project is available as a ZIP archive. A demo is availible as a JAR (see handout on how to run a jar):
Turn in the following files:
boggle.cpp
, the C++ code for all of your recursion functions.boggle.h
, the C++ code for all of your recursion functions.boggleplay.cpp
, the C++ code for all of your recursion functions.This is a pair assignment. You may work in a pair or alone. Find a partner in section or use the course message board. If you work as a pair, comment both members' names atop every code file. Only one of you should submit the program; do not turn in two copies. Submit using the Paperless system linked on the class web site.
Boggle is a game played on a square grid onto which you randomly distribute a set of letter cubes. Letter cubes are 6- sided dice, except that they have a letter on each side rather than a number. The goal is to find words on the board by tracing a path through neighboring letters. Two letters are neighbors if they are next to each other horizontally, vertically, or diagonally. There are up to eight letters near a cube. Each cube can be used at most once in a word. In the real-life version of this game, all players work at the same time, listing the words they find on a piece of paper. When time is called, duplicates are removed from the lists and the players receive one point for each unique word, that is, for each word that player found that no other player was able to find.
You will write a program that plays this game, adapted for one human to play against a computer opponent. Unfortunately, the computer knows recursive backtracking, so it can find every word on the board and destroy you every time. But it's still fun to write a program that can so soundly thrash you again and again.
To begin a game, you shake up the letter cubes and lay them out on the board. The human player plays first, entering words one by one. Your code first verifies that the word is valid, then you add it to the player's word list and award the player points according to the word's length (one point per letter ≥ 4). A word is valid if it meets all of the following conditions:
Do you want to generate a random board? y It's your turn! FYCL IOMG ORIL HJHU ...  "ROOM" ... Your words (5): {"FOIL", "FORM", "ROOF", "ROOM", "ROOMY"} Your score: 6 Type a word (or Enter to stop): It's my turn!  Better luck next time, puny human!
Once the player has found as many words as they can, the computer takes a turn. The computer searches through the board to find all the remaining words and awards itself points for those words. The computer typically beats the player, since it finds all words.
Your program's output format should exactly match the abridged log of execution above. Here are more examples of game logs:
The real Boggle game comes with sixteen letter cubes, each with particular letters on each of their six faces. The
letters on each cube are not random; they were chosen in such a way that common letters come up more often and it
is easier to get a good mix of vowels and consonants. We want your Boggle game to match this. The following table
lists all of the letters on all six faces of each of the sixteen cubes from the original Boggle. You should decide on an
appropriate way to represent this information in your program and declare it accordingly.
At the beginning of each game, "shake" the board cubes. There are two different random aspects to consider:
AAEEGN
cube should not always appear in the top-left square of the board; it should
randomly appear in one of the 16 available squares with equal probability.)AAEEGN
cube should not always show A
; it should randomly show A
1/3 of the time, E
1/3
of the time, G
1/6 of the time, and N
1/6 of the time.)Your game must also have an option where the user can enter a manual board configuration. In this option, rather than randomly choosing the letters to be on the board, the user enters a string of 16 characters, representing the cubes from left to right, top to bottom. (This is also a useful feature for testing your code.) Verify that the user's string is long enough to fill the board and re-prompt if it is not exactly 16 characters in length. Also re-prompt the user if any of the 16 characters is not a letter from A-Z. Your code should work case-insensitively. You should not check whether the 16 letters typed could actually be formed from the 16 letter cubes; just accept any 16 alphabetic letters.
The human player enters each word she finds on the board. As described previously, for each word the user types, you must check that it is at least four letters long, contained in the English dictionary, has not already been included in the player's word list, and can be formed on the board from neighboring cubes. If any condition fails, alert the user. There is no penalty for trying an invalid word, but invalid words also do not count toward the player's list or score.
If the word is valid, you add the word to the player's word list and score. The length of the word determines the score, with each letter ≥ 4 being worth 1 point. For example, a 4-letter word is worth 1 point; a 5-letter word is worth 2 points; 6-letter words are worth 3; 7-letter words are worth 4; and so on. The player enters a blank line when done finding words, which signals the end of the human's turn.
Once the human player is done entering words, the computer then searches the entire board to find the remaining words missed by the human player. The computer earns points for each remaining word found that meets the requirements (minimum length, contained in English lexicon, not already found, and can be formed on board). If the computer's resulting score is strictly greater than the human's, the computer wins. If the players tie or if the human's score exceeds the computer's, the human player wins.
You can find all words on the board using recursive backtracking. The idea is to start from a given letter cube, then explore neighboring cubes around it and try all partial strings that can be made, then try each neighbor's neighbor, and so on. The algorithm is roughly the following:
for each letter cube c: mark cube c as visited. // choose for each neighboring cube next to c: explore all words that could start with c's letter. // explore un-mark cube c as visited. // un-choose
You will write the following two sets of files. In this section we describe the expected contents of each in detail.
boggleplay.cpp
: client to perform console UI and work with your Boggle class to play a gameBoggle.h / Boggle.cpp
: files for a Boggle class representing the state of the current Boggle gameWe have provided you with a file bogglemain.cpp
that contains the program's overall main function. The provided
code prints an introduction message about the game and then starts a loop that repeatedly calls a function called
playOneGame
. After each call to playOneGame
, the main code prompts to play again and then exits when the user
finally says "no". The playOneGame
function is not already written; you must write it in boggleplay.cpp
. In that
same file, you can place any other logic and helper functions needed to play one game. You may want to use the
getYesOrNo
function from simpio.h that prompts the user to type yes/no and returns a bool
.
One aspect of the console UI is that it should "clear" the console between each word the user types, and then re-print the game state such as the board words found so far, score, etc. This makes a more pleasant UI where the game state is generally visible at the same place on the screen at all times during the game. See the provided sample solution for an example. Use the Stanford Library's clearConsole(); function from console.h to clear the screen.
The playOneGame function (along with any sub-functions it calls within the same file) should perform all console
user interaction such as printing out the current state of the game. No other file should have cout
or user/file input.
But boggleplay.cpp is not meant to be the place to store the majority of the game's state, logic, or algorithms. Your boggleplay file will interact with a class you will write named Boggle, described on the following pages. We describe a partial set of methods that your Boggle class must have. The intention is that your boggleplay code will call all of these methods to help achieve the overall task of playing the game. For example, no recursion or backtracking should take place in boggleplay; all such recursive searching should happen in the Boggle class. If you find that your boggleplay code is implementing a lot of complex logic itself, or that boggleplay is never calling a particular public method from the Boggle class, this is likely a sign that you have not divided the functionality in your code the way that we intend, which might lead to a style deduction.
Later in the spec we will describe a graphical user interface (GUI) that your Boggle game must display. As much as possible, the code to create and interact with this GUI should be in your boggleplay.cpp file. The one exception is the code to highlight and un-highlight letter cubes on the GUI as your algorithms are searching for words typed by the human player. Highlighting should be done in the Boggle class, because it would be very difficult to separate that code out of your recursive backtracking algorithms that are defined in the Boggle class
The majority of your code should be in the Boggle.h and Boggle.cpp files, which should contain the implementation of a Boggle class. A Boggle object represents the current board and state for a single Boggle game, and it should have member functions to perform most major game functions like finding words on the board and keeping score. Declare all Boggle class members in Boggle.h, and implement their bodies in Boggle.cpp. We provide you a skeleton that declares some required members below that your class must have.
Do not change the headings of any of the following functions. Do not add parameters; do not rename them. You must implement exactly these functions with exactly these headings, or you will receive a deduction. (See note below about const.)
| Boggle Method | Description |
|---|---|
Boggle(dictionary, boardText)
|
In this constructor you initialize your Boggle board to use the given dictionary lexicon to look up words, and use the given 16-letter string to initialize the 16 board cubes from top-left to bottom-right. If the string is empty, you should generate a random shuffled board. Your method should be case-insensitive; it should accept the board text whether it is passed in upper, lower, or mixed case. |
b.getLetter(row, col)
|
In this function you should return the character that is stored in your Boggle board at the given 0-based row and column. If the row and/or column are out of bounds, you should throw an int exception. |
b.checkWord(word)
|
In this function you should check whether the given word string is suitable to search for: that is, whether it is in the dictionary, long enough to be a valid Boggle word, and has not already been found. You should return a boolean result of true if the word is suitable, and otherwise you should return false. Your method should be case-insensitive; you should properly verify the word whether it is passed in upper, lower, or mixed case. |
b.humanWordSearch(word)
|
In this function you should perform a search on the board for an individual word. If the word can be formed, you should add it to the human's set of found words. Your function returns a boolean result of whether the word can be formed. Your code for this function should use recursive backtracking. As each cube is explored, you should highlight it in the GUI to perform an animated search with a 100ms delay (see GUI page). If the word is unsuitable, you should not perform the recursive search. Your method should be case-insensitive; you should properly search for the word whether it is passed in upper, lower, or mixed case. |
b.computerWordSearch()
|
In this function you should perform a search on the board for all words that can be formed (that have not already been found by the human player), and return them as a Set of strings. Your code for this function should use recursive backtracking. Though similar to your human search, this is different because you should look for all words and not perform any animation; therefore its code should be implemented separately from humanWordSearch. The words in your set should be all uppercase. |
b.getScoreHuman()
|
In this function you return the total number of points the human player has scored in the game so far as an integer. This total is 0 when the game begins, but whenever a successful human word search is performed, points for that word are added to the human's total score. |
b.getScoreComputer()
|
In this function you should return the total number of points the computer player has scored in the game as an integer. This total is initially 0 when the game begins, but after a computer word search is performed, all points for those words are added to the computer's total score. |
ostream& << b
|
You should write a << operator for printing a Boggle object to the console. The operator should print only the 4x4 grid of characters representing the board as four lines of text. It should print the board text in all uppercase. |
Once again for emphasis, do not modify the names, parameters, or return types of the preceding functions. Implement them as-is. The one exception is that you can (and should) modify headers to make the member function const if it does not modify the state of your Boggle object. Review all of your functions (the ones provided above, and any others you choose to add to your class) and make them const as much as possible.
Case sensitivity: Your methods that accept strings must be case-insensitive; they should work with upper, lower, or mixed case. This should be enforced in your program by the Boggle class, not by the boggleplay.cpp code.
Adding your own member functions: In some past assignments, we gave you an exact list of the functions to implement. In this assignment, we are asking you to come up with some of the members. The Boggle class members listed on the previous page represent a large fraction of that class's behavior. But you can, and should, add other members to implement all of the appropriate behavior for this assignment. Your added members should be public if they are to be called directly by the boggleplay.cpp code, and private otherwise. You must also decide what code and/or data should go in boggleplay.cpp, and what should go in the Boggle class. Part of the challenge of this assignment is learning how to design a class and console UI client effectively. Remember that each member function of your class should have a single clear, coherent purpose.
Here are some suggestions for good member functions to put in your Boggle class:
Member variables: We also have not specified any of the private member variables that should go inside the Boggle class; you must decide those yourself. Here are some thoughts about data members that your class might need:
Searching: You don't want to visit the same letter cube twice during a given exploration, so for the search algorithm to work, your Boggle class needs some way to "mark" whether a letter cube has been visited or not. You could use a separate structure for marking, or modify your existing board, etc. It's up to you, as long as it is efficient and works.
Efficiency is very important for this part of the program. It is important to limit the search to ensure that the process can be completed quickly. If written properly, the code to find all words on the board should run in around one second or less. To make sure your code is efficient enough, you must perform the following optimizations:
One of the most important Boggle strategies is to prune dead-end searches. The Lexicon has a containsPrefix function that accepts a string and returns true if any word in the dictionary begins with that substring. For example, if the first cube you examine shows the letter Z and your algorithm tries to explore one of its neighbors that shows an X, your path would start with ZX. In this case, containsPrefix will inform you that there are no English words that begin with the prefix "ZX". Therefore your algorithm should stop that path and move on to other combinations.
As a required part of this assignment, you must also add a graphical user interface (GUI) to your program.
| GUI Function | Description |
|---|---|
clearHighlight()
|
Sets all letter cubes to be un-highlighted. (See setHighlighted.) |
initialize(rows, cols)
|
Starts up the GUI and displays the graphical window. The board is drawn with empty squares and scores are 0. If called again, resets the board (see reset). Throws an error if rows or cols is not a positive integer from 1-6. |
isInitialized()
|
Returns true if initialize has already been called. |
labelCube(r, c, char, bool)
|
Sets the given cube to display the given character. Rows and columns have 0-based indexes with (0, 0) at top-left. If true is passed for the optional highlighted parameter, the cube is drawn with a colored highlight (useful to show progress of word searches). The highlight will remain until turned off. Throws an error if ch is not a letter or space. |
labelAllCubes(str)
|
Sets all letter cubes to display the characters from the given string. For example, "ABCDEFGHIJKLMNOP" would label cube (0, 0) with 'A', cube (0, 1) with 'B', and so on. The string can contain other characters such as whitespace, line breaks, etc., which will be skipped over. All cubes are un-highlighted after a call to this function. Throws an error if str does not contain 16 alphabetic letters. |
recordWord(word, player)
|
Displays that the given player has found the given word string on the board. This function does not check word validity, e.g. that the word is not already shown, can be formed on the board, is in the dictionary, etc. That is up to you. The player parameter indicates which player found the given word. The value you pass should be either BoggleGUI::HUMAN or BoggleGUI::COMPUTER. |
reset()
|
Sets the GUI window back to its initial state, with the letter cubes blank and unhighlighted, the scores both at 0, and no solved words shown on the screen. |
setAnimationDelay(ms)
|
Sets a pause/delay of the given number of milliseconds. After calling this, subsequent calls to setHighlighted or to labelCube that have highlight set to true will trigger a pause. Use this to animate a word search algorithm. |
setHighlighted(r, c, bool)
|
Sets the given letter cube to be highlighted (true) or un-highlighted (false). |
setScore(score, player)
|
Sets the GUI's score display for the given player to the given number. The GUI does not know anything about scoring rules for Boggle; it accepts any integer. The player parameter indicates which player found the given word. The value you pass should be either BoggleGUI::HUMAN or BoggleGUI::COMPUTER . |
setStatusMessage(str)
|
Displays a status message in the bottom part of the window. Useful for showing messages such as telling the user that they have found a word, etc. |
shutdown()
|
Closes the GUI window and frees memory associated with the GUI. |
The functions of the GUI are enclosed in a namespace so that they do not conflict with any other global function names in your program. To call one of them, you must prefix the function's name with BoggleGUI:: , such as:
BoggleGUI::recordWord("hello", BoggleGUI::HUMAN); // human records the word "hello"
You must call the GUI's setStatusMessage function to display information about the game state during play. Messages like "It's your turn!", "You must enter an unfound word ...", "That word can't be formed", "You found a new word", "It's my turn", "You defeated me", and "Ha ha ha, I destroyed you" should be shown. These are the same messages that display at the top of the text console on each turn. See the runnable sample solution for more details.
In a project of this complexity, it is important that you get an early start and work consistently toward your goal. To be sure that you're making progress, it also helps to divide up the work into manageable pieces, each of which has identifiable milestones. Here's a suggested plan of attack that breaks the problem down into six phases:
Make sure to extensively test your program. Run the sample solution (top of the page) to see the expected behavior of your program. When in doubt, match the behavior of the sample solution.
Thats all! You are done. Consider adding extra features.


sample app structure basic integration between AngularJS 1.x and LAMP Codeigniter 3.x.
This project code is forked from
https://github.com/giannidk/CodeIgniter-AngularJS-sample-app/
Additional Features added from the original git repo
- Edit News or Articles
- Access control for Edit News
- Login/Logoff
- User / Admin feature Protected by php session backend (could switch to JWT in front end easily)
- AngularJS improvement upgraded to 1.5.11 and JS code clean up
- Rich text editor - Angular-ui-tinymce
- Quick article edit for admin
- Categories View of article


| Xmlgen | Writing XML with Tcl | xmlgen |
Xmlgen — Writing XML with Tcl
package require xmlgen
::xmlgen::declaretag funcname ?tagname?
::xmlgen::doTag tagname ?attr=value ...? ?control? ?body ...?
::xmlgen::buffer varname body
::xmlgen::channel chan body
::xmlgen::put ?arg ...?
::xmlgen::esc ?arg ...?
::xmlgen::setTagformat which format
::xmlgen::makeTagAndBody tagname stuff ?attrary?
Due to its clear and concise bracing style, Tcl is as good or even better suited than XML to write text markup. Instead of surrounding pieces of text by, e.g. <boo> and </boo>, a Tcl command with the name boo is defined. The command takes as arguments a list of attribute value pairs and the body of text to be marked up with tags. The text body can again contain markup commands.
You will normally first call ::xmlgen::declaretag several times to declare the markup commands. With the generated commands you write your XML.
::xmlgen::declaretag funcname ?tagname?
Creates a markup command with the name funcname. By default the generated tag will be the same as funcname, but it can also be explicitly specified with the 2nd argument. The details about the generated markup commands are described below.
::xmlgen::doTag tagname ?attr=value ...? ?control? ?body ...?
Instead of first declaring a markup command with
declaretag
, doTag
can be called with the tag
name to do exactly what the markup command for that tag name
would have done. This is typically used if the tag is needed
just once in a document.
::xmlgen::buffer varname body
Normally, markup commands write their output immediately to
standard output. However, when run within the context of
buffer
, the output is captured instead in varname.
::xmlgen::channel chan body
Normally, markup commands write their output immediately to
standard output. However, when run within the context of
channel
, the output is send to the output channel
chan.
::xmlgen::put ?arg ...?
Is a convenience function to just print a string. In the
context of buffer
or channel
its output is
redirected accordingly. In contrast to
Tcl's puts
, put
can have many arguments and
does not automatically append a newline.
::xmlgen::esc ?arg ...?
Concatenates all arguments and then replaces characters according to the following table:
| character | replacement |
|---|---|
& |
& |
< |
< |
> |
> |
" |
" |
] |
] |
As a consequence, the result of applying esc
can safely
be used as character data for XML elements.
::xmlgen::setTagformat which format
This proc allows some control over the white space to put around
generated XML tags in order to pretty print the resulting
XML. The formatting can be controlled individually for open
and close tag for each of the four control characters
"+-.!"
. You may have to read the
section below on markup commands to
understand the meaning of the control characters.
Parameter which is a combination of one control character
and either "o"
or "c"
. In format you
should pass a string which, when passed through
[subst]
, creates the tag with some surrounding white
space or indentation. The substitution will take place in a
context where $tag
contains the opening or closing tag
and $indent
contains just the right amount of space
characters for proper indentation.
The default settings for tag formatting are as follows:
| which | format | which | format | |
|---|---|---|---|---|
!o |
\n$indent$tag | !c |
\n$indent$tag |
|
+o |
\n$indent$tag | +c |
\n$indent$tag |
|
-o |
\n$indent$tag | -c |
$tag |
|
.o |
$tag | .c |
$tag |
To implement a totally different indentation scheme, you may override the proc
::xmlgen::formatTag which indent tag
It must return the formatted tag.
::xmlgen::makeTagAndBody tagname stuff ?attrary?
This is the function called by a markup command to analyse its command line. Parameter stuff is the list of arguments which where passed to the markup command. It is parsed into attribute-value pairs, an optional control character and the body. The tagname and the attribute-value pairs are assembled into an XML open tag. Finally a four-element list like
[list $opentag $control $body $closetag]
is returned.
Parameter attrary is not used by the normal markup
commands. It supports the implementation of so called
markup macros
which will look like markup commands but generate more elaborate
markup than just a pair of tags and a body. When calling
makeTagAndBody
, the macro can pass the name of an array
in attrary. If makeTagAndBody
finds an attribute
which is a key (index) of the array, it does not include
it in the opening tag but stores the value in the array. As an
example of a macro implementation have a look at
::hmtlgen::tab
.
Load xmlgen, import the commands and declare two tags.
package require xmlgen
namespace import ::xmlgen::*
declaretag voo
declaretag doo
Generate and write some tagged text, attributes included.
voo color=red align=left ! {
doo - some text for doo
doo - another doo element
put text on the voo-level
}
The result will look like this:
<voo color="red" align="left">
<doo>doo some text for doo</doo>
<doo>another doo element</doo>
text on the voo-level
</voo>
Note how the two markup commands handle their body arguments
differently depending on the control characters "!
" and
"-
" just before the body.
Command voo
evaluates its body argument, while
doo
takes the argument list as is and prints it out. The
details about the control characters are
described below.
When you run
::xmlgen::declaretag boo
the markup command boo
is defined as
boo ?attr=value ...? ?control? ?body ...?
The command accepts three kinds of arguments which must appear in the order given:
All arguments are optional. How they are identified and handled is described below.
An argument is considered an attribute-value pair, if one of the following conditions hold.
^ *([A-Za-z_:][a-zA-Z0-9_.:-]*)=(.*)
This requires an attribute-value pair to consist of optional blanks, an attribute name comprising one or more of the characters "a-zA-Z0-9_-
", an immediately following equal
sign and something else. Everything after the equal sign is taken
as the value.
The first argument which does not satisfy the above conditions stops processing of attribute-value pairs. Later arguments matching the expression are not taken as attribute-value pairs.
Every attribute-value pair must be a word in
the Tcl sense. Enclose it in quotes or
braces if it contains blanks or other characters which
trigger special Tcl-behaviour.
For example an HTML style
attribute must be
written as:
boo {style=border: solid 2px red;} {body stuff}
The whole attribute-value pair is enclosed in braces to make
sure that boo
sees it as one argument.
The resulting XML will be.
<boo style="border: solid 2px red;">body stuff</boo>
Note how the attribute's value is automatically enclosed in quotes in the XML output. In fact you must not supply the quotes around the value yourself, except if you really want them to be part the the value. Nevertheless you can put quotes into the value if they belong there. They will be sufficiently escaped to not corrupt the XML syntax, i.e.
boo quote=\" - some text
will result in
<boo quote=""">some text
</boo>
If the first argument which is not an attribute-value pair consists of a single character, it is taken as the control character. It decides how the body is handled (see below).
Currently the control characters "!+-.
" are defined.
If the first argument after the attribute-value pairs contains
only a single character which is not defined as a control
character, an error is generated. To get rid of the error, add the
default control character ".
" (dot) as an extra argument
just in front of the first body argument.
In general, two independent dimensions of handling the body can be distinguished:
[subst]
or[eval]
.::xmlgen::buffer
.
Taken together, there are six possible combinations. Four of the six are supported by every markup function. The control character decides which one to use as summarized in the following table.
|   | return | |
|---|---|---|
| eval | "! " (exlam. mark) |
not implemented |
| subst | "+ " (plus) |
|
| as is | "- " (minus) |
". " (dot) |
If no control character is specified, ".
" (dot) is
assumed.
The function of the four control characters are described below in more detail.
!
This is most useful for markup commands which contain a lot of
inner structure, like HTML's table
, form
or
body
.
html ! {
body ! {
# Tcl commands go here
}
}
Due to the "!
", the body of html
is evaluated
which in particular means that the command body
is
run. Since body
is again followed by "!
", the
commands in its body are evaluated and whatever output they
produce will be enclosed in <body>
and </body>
.
Another example use of "!
" is:
tr ! td - the only column in this row
where tr
runs td
while enclosing its output in
<tr>
and </tr>
.
When the control character is a plus sign,
the body is passed through [subst]
. You will most
frequently use it for tags which contain text
which needs markup. The typical example is HTML's tag
"p
".
p + {
Subst allows to [b put things in bold].
}
You could in fact produce the same result with
p - Subst allows to [b put things in bold]
but the former allows you to easier write long paragraphs without the necessity to escape the end of the line in the source code.
The minus as the control character instructs the markup function to print the body argument as is. Note however, that Tcl has its chance to expand the markup function's parameter before the function is even called.
boo - Some text [doo with markup inline]
will generate
<boo>Some text <doo>with markup inline</doo></boo>
because when boo
is actually called, doo
was already
run by the Tcl interpreter.
When the control character is the dot, the body is not changed in any way and not even printed. Instead the markup command returns it as is:
set phrase [big [big some big text]]
will set the variable phrase
to
<big><big>some big text</big></big>
Overview, Htmlgen, Notebook Tabs, Navigation Bar
| Xmlgen | 1.4 | xmlgen |


DIRTY ROTTEN SCOUNDRELS (1988) A Film Review Copyright Dragan Antulov 2001
Professional assassins are the usually the most fascinating category of criminals on the silver screen and potentially the most rewarding for any serious filmmaker. But in the genre of comedy another category of criminals - con artists - rules supreme.  One of the examples could be found in DIRTY ROTTEN SCOUNDRELS, 1988 comedy directed by Frank Oz.
The plot is set in Beaumont-sur-Mer, little resort town on French Riviera, frequented by rich people from USA and other parts of the world. This used to be the perfect hunting ground for Lawrence Jamieson (played by Michael Caine), sophisticated and suave British con artist specialised in extracting money from rich and gullible women by posing as a mysterious exiled prince. Through the years Jamieson amassed enough fortune to afford a mansion, butler (played by Ian McDiarmid) and co-operation of local police inspector (played by Anton Rodgers). His idyllic life suddenly becomes threatened with the arrival of rival in the form of Freddy Benson (played by Steve Martin), uneducated and unsophisticated American who earns money by telling sob stories about his ill grandmother. Jamieson, convinced that this raw routine might bring unwanted attention, does everything in his power to drive Freddy out of town, but the American keeps coming back.
Not among the most remarkable films thirteen years ago, DIRTY ROTTEN SCOUNDRELS looks surprisingly good from today's perspective. The reason is probably in the humour, which is way above the today's Hollywood standards of comedy embodied in the films by Farrelly brothers. The script by Dale Launer, Stanley Shapiro and Paul Henning is very intelligent and the film leaves the impression of belonging to another era - 1950s or 1960s (hardly a surprise, since this happens to be the remake of BEDTIME STORY, directed by Ralph Levy in 1963). The plot is, on the other hand, weak and serves as nothing more than excuse for the series of scenes in which two principal characters try to outwit each other. Another surprise of the film is good direction by Frank Oz of MUPPET SHOW fame; in DIRTY ROTTEN SCOUNDRELS, unlike his previous film THE LITTLE SHOP OF HORRORS, he abandons special effects in favour of authentic locations of French Riviera (and famous Victorine studios in Nice) and allows great actors to carry the film. Michael Caine and Steve Martin look like they were born to play the characters; the contrast between sophisticated European and provincial American is not only mirrored in screen personalities of Michael Caine and Steve Martin, but also in the different styles of acting. While Caine, same as his aristocratic character, keeps stiff upper lip at all times, Steve Martin often goes for the physical comedy, although not always with the best results. The biggest and the most pleasant surprise, however, comes in the form of Glenne Headley, the actress who had misfortune of wasting her talent in many disastrous films in late 1980s and early 1990s. Her talents were not wasted in DIRTY ROTTEN SCOUNDRELS - she simply shines in the role of naive and innocent woman whose charm is going to enchant our immoral protagonists. Unfortunately, she appears relatively late, and because of that the film is slightly overlong, and the twist ending is not as unpredictable as the authors would like. DIRTY ROTTEN SCOUNDRELS is nevertheless very funny and entertaining film that should be recommended as an example of something that is rather absent in Hollywood these days - stylish and well-crafted comedy.
RATING: 7/10 (+++)
Review written on August 23h 2001
Dragan Antulov a.k.a. Drax E-mail<EMAIL_ADDRESS>http://www.film.purger.com - Filmske recenzije na hrvatskom/Movie Reviews in Croatian
========== X-RAMR-ID: 29320 X-Language: en X-RT-ReviewID: 246240 X-RT-TitleID: 1005909 X-RT-AuthorID: 1307 X-RT-RatingText: 7/10
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


|
Houzi Game Engine
|
Describes the format of a vertex. More...
#include <vertex_format.hpp>
Public Member Functions | |
| vertex_format (ptrdiff_t offset, uint stride, const span< const vertex_attrib_format > &vafs) | |
| span constructor. More... | |
| vertex_format (ptrdiff_t offset, uint stride, std::vector< vertex_attrib_format > &&vafs) | |
| vertex_attrib_format move constructor. More... | |
| ptrdiff_t | get_offset () const noexcept |
| Retrieves the offset of the vertex from the beginning of the buffer in bytes. More... | |
| uint | get_stride () const noexcept |
| Retrieves the intervals at which the vertex repeats in the buffer in bytes. More... | |
| const std::vector< vertex_attrib_format > & | get_vertex_attrib_formats () const noexcept |
| Retrieves the format of the vertex attributes. More... | |
Static Public Member Functions | |
| static uint | get_max_attrib_format_count () |
| Retrieves the maximum number of allowed vertex_attrib_format. | |
Describes the format of a vertex.
| hou::vertex_format::vertex_format | ( | ptrdiff_t | offset, |
| uint | stride, | ||
| const span< const vertex_attrib_format > & | vafs | ||
| ) |
span constructor.
Creates a vertex_format with the specified offset, stride, and vertex_attrib_format objects.
| offset | the offset from the begining of the buffer in bytes. |
| stride | the intervals at which the vertex repeats in the buffer in bytes. |
| vafs | the format of the vertex attributes. |
| hou::precondition_violation | if the number of attribute formats is greater or equal than the maximum allowed. |
| hou::vertex_format::vertex_format | ( | ptrdiff_t | offset, |
| uint | stride, | ||
| std::vector< vertex_attrib_format > && | vafs | ||
| ) |
vertex_attrib_format move constructor.
Creates a vertex_format with the specified offset, stride, and vertex_attrib_format objects.
| offset | the offset from the begining of the buffer. |
| stride | the intervals at which the vertex repeats in the buffer. |
| vafs | the format of the vertex attributes. |
| hou::precondition_violation | if the number of attribute formats is greater or equal than the maximum allowed. |
|
noexcept |
Retrieves the offset of the vertex from the beginning of the buffer in bytes.
|
noexcept |
Retrieves the intervals at which the vertex repeats in the buffer in bytes.
|
noexcept |
Retrieves the format of the vertex attributes.


background-color: #006DAE class: middle center hide-slide-number
  These slides are viewed best by Chrome and occasionally need to be refreshed if elements did not load properly. See here for PDF .

 .white[Press the **right arrow** to progress to the next slide!] --- background-image: url(images/bg1.jpg) background-size: cover class: hide-slide-number split-70 title-slide count: false .column.shade_black[.content[
 # .monash-blue.outline-text[ETC5512: Wild Caught Data]
Week 3

Macroeconomic data
 .bottom_abs.width100[ Lecturer: *Didier Nibbering* Department of Econometrics and Business Statistics

<EMAIL_ADDRESS>
 ] ]]

 <svg class="clip-svg absolute"> <defs> <clipPath id="swipe__clip-path" clipPathUnits="objectBoundingBox"> <polygon points="0.5745 0, 0.5 0.33, 0.42 0, 0 0, 0 1, 0.27 1, 0.27 0.59, 0.37 1, 0.634 1, 0.736 0.59, 0.736 1, 1 1, 1 0, 0.5745 0" /> </clipPath> </defs> </svg>

 --- # Macroeconomic data

 * Macroeconomic data dominates the news

 * Everyone affected by interest, exchange, and inflation rates

 * Data helps voters and governments understand challenges   --- class: motivator middle # Macroeconomic data * Survey of Professional Forecasters * https://www.philadelphiafed.org/research-and-data/real-time-center/survey-of-professional-forecasters

 * Real-time Data Set for Macroeconomist * https://www.philadelphiafed.org/research-and-data/real-time-center/real-time-data

 * Federal Reserve Economic Data database * https://research.stlouisfed.org/econ/mccracken/fred-databases/ --- # Macroeconomic data

 * Gross Domestic Product

 * Consumper Price Index

 * Unemployment rate --- # Macroeconomic data Macroeconomics is the study of aggregate behavior

 * How do we measure "the economy as a whole?"

 * Aggregrate micro data into macro data

 * From price of a coffee to price in the whole economy --- # Macroeconomic data Aggregration

 * Pros * easier to look at one number than millions * comparability across nations/times

 * Cons * throwing away information * easy to miss important details --- # Macroeconomic data Aggregration

 * Output measures * GDP

 * Price measures * CPI

 * Input measures * Unemployment --- # Output measures Two major measures of total output in the economy

 * Gross Domestic Product (GDP) * Total value of goods and services produced
 in the country in a certain period of time

 * Gross National Product (GNP) * Total value of goods and services produced
 by nationals of the country in a certain period of time   --- # Output measures

 Suppose we had the following production process:

 Farmer `\(\xrightarrow{\text{Wheat}}\)` Miller `\(\xrightarrow{\text{Flour}}\)` Baker `\(\xrightarrow{\text{Cake}}\)` Consumer

 We only count the dollar value of the end use (cake) in GDP.       --- # Output measures We can construct nominal GDP as

 `\(GDP_t = \sum_i p_{it}\times q_{it}\)`

 where

 `\(p_{it}=\)`price of good `\(i\)` in period `\(t\)`

 `\(q_{it}=\)`quantity of good `\(i\)` in period `\(t\)`        --- # Output measures

 GDP higher so people are better off on average?

 Only prices increased.

 Look at real activity, not just at price adjustments. --- # Output measures

 Real GDP fixes prices at a base year:

 `\(GDP_t = \sum_i p_{ib}\times q_{it}\)`

 where

 `\(p_{ib}=\)`price of good `\(i\)` in a fixed base year `\(b\)`   --- class: transition middle # Output measures

 * Nominal GDP * https://fred.stlouisfed.org/graph/?g=qgx3

 * Real GDP * https://fred.stlouisfed.org/graph/?g=qgx4 --- # Output measures

 Components of GDP

 `\(\text{GDP}=\text{Consumption}+\text{Investment}\\+\text{Gov Spending}+\text{Net Exports}\)`  --- class: transition middle # Output measures * Consumption * https://fred.stlouisfed.org/graph/?g=qgx7

 * Investment * https://fred.stlouisfed.org/graph/?g=qgx9

 * Government spending * https://fred.stlouisfed.org/graph/?g=qgxa

 * Net exports * https://fred.stlouisfed.org/graph/?g=qgxb --- # Output measures

 Problems real GDP:

 Compare output 1960 to output 2020 with 1960 as base year

 * Goods that exist in 2020 may not have existed in 1960.

 * Ignores quality changes over time, may show up in prices.

 * People substitute away from relatively high priced goods. --- # Price measures

 * Macroeconomics cares about consumption, not prices

 * Level of the price does not matter

 * However, we do care about inflation --- # Price measures

 Inflation: increase in the level of prices

 Important because:

 * Bond holders get paid fixed coupons

 * Workers have annual salaries

 * Hyperinflation affects incentives  --- class: transition middle # Price measures * Nominal wages * https://fred.stlouisfed.org/graph/?g=qgxf

 * Real wages * https://fred.stlouisfed.org/graph/?g=qgxg --- # Price measures Most commonly used price index is the Consumer Price Index

 * Weighted average prices that household faces,
 weighted by the consumption share of each item

 * Build ``basket of goods" that households consume
(e.g. healthcare, food, gas, video games, etc.)
and track price of that basket over time --- # Price measures Limitations

 * Substitution

 * Rich and poor people face different inflation rates

 * Generally misses sectoral differences:
 healthcare prices skyrocketing,
while food & gas volatile up and down --- # Input measures

 * Labor important input production

 * Labor income largest part of median person's income  --- # Input measures

 How do we measure labor?

 * Input to production?
Hours and human capital matter

 * Worker well-being?
Hours and wage matter

 Aggregate measures can miss important distributional considerations! --- # Input measures

 * Employment to population ratio

 * Unemployment rate:
people unemployed over people in labor force

 * To be unemployed, you must not be working currently, and have searched for a job at least once in the last 2 weeks

 * To be in the labor force, you must be employed or unemployed according to previous definition     --- class: transition middle # Input measures * Unemployment rate * https://fred.stlouisfed.org/graph/?g=qgxl

 * Employment to population ratio * https://fred.stlouisfed.org/graph/?g=qgxm * https://fred.stlouisfed.org/graph/?g=qgxn --- # Macroeconomic variables

 * Stock variables * A stock is a quantity measured at a point in time (investment)

 * Flow variables * A flow is a quantity measured per unit of time (capital)  --- # Macroeconomic variables

 Economic index

 * Price or quantity compared with a base value

 * Time series summarising movements in a group of variables

 * Base equals 100, index number is 100 times ratio to base --- # Macroeconomic variables

 Economic indices

 * S&P 500

 * Consumer price index

 * Big Mac Index --- class: transition middle # Economic indices * S&P 500 * https://fred.stlouisfed.org/graph/?g=qgxA * Consumer price index * https://fred.stlouisfed.org/graph/?g=lGqc * Big Mac Index * https://www.economist.com/news/2020/01/15/the-big-mac-index --- # Variable transformations

 * Change * x(t) - x(t-1) * Change from Year Ago * x(t) - x(t-n_obs_per_yr) * Percent Change * ((x(t)/x(t-1)) - 1) x 100 * Percent Change from Year Ago * ((x(t)/x(t-n_obs_per_yr)) - 1) x 100 --- # Variable transformations

 * Compounded Annual Rate of Change * (((x(t)/x(t-1)) x (n_obs_per_yr)) - 1) x 100 * Continuously Compounded Rate of Change * (ln(x(t)) - ln(x(t-1))) x 100 * Continuously Compounded Annual Rate of Change * ((ln(x(t)) - ln(x(t-1))) x 100) x n_obs_per_yr * Natural Log * ln(x(t)) --- class: transition middle # Variable transformations * Set units * https://alfred.stlouisfed.org/series/downloaddata?seid=INDPRO --- # Seasonal adjustments

 * Seasonal fluctuations may not reflect economic conditions * Always a spike in consumption spending around Christmas * Spikes in tourism around summer time

 * Statistical bodies adjust for seasonality for you    --- class: transition middle # Seasonal adjustments * Not Seasonally Adjusted * https://fred.stlouisfed.org/graph/?g=qgxN * Seasonally Adjusted * https://fred.stlouisfed.org/graph/?g=mgw0 --- # Database

 An economic database consists of

 economic data time series from scores of

 national, international, public, and private sources.

 FRED, Federal Reserve Economic Data, is a U.S. database  --- # Revisions

 * Economic data for past observation periods are revised
 as more accurate estimates become available.

 * Revision:
 * a change in value for any reference point
 of the time series for a statistic
 when released to the public
 by an official national or supranational statistical agency. --- # Revisions

 Government statistical agencies

 * Release early estimates

 * Over time better: * Samples * Weights * Methodology

 * Release improved data --- # Revisions

 * 1st month: incomplete sample

 * Next months: revisions based on more complete samples

 * After year: annual business reports and seasonal factors

 * 5-10 years: methodological and base year revisions --- class: transition middle # Revisions * 1st month: incomplete sample * https://alfred.stlouisfed.org/graph/?g=qgyq * Next months: revisions based on more complete samples * https://alfred.stlouisfed.org/graph/?g=qgyn * After year: annual business reports and seasonal factors * https://alfred.stlouisfed.org/graph/?g=qgyn * 5-10 years: methodological and base year revisions * https://alfred.stlouisfed.org/graph/?g=qgyi --- # Vintage

 * Vintage * the set of data for a given time series that represented the latest estimate for each reference point in the time series at a particular moment in time. --- # Vintage

 * Each column shows the data that one would observe if one used a database at the date shown in the column header; we call this the vintage date.

 * Each row represents the dates for which the economic activity is measured.    --- # Real-time Database

 A real-time database is a collection of historical vintages of the same time series, indexed by the date on which each vintage became available to the public.

 ALFRED, ArchivaL Federal Reserve Economic Data, is a collection of vintage versions of U.S. economic data.   --- class: transition middle # Vintages

 * Vintage data * https://alfred.stlouisfed.org/series/downloaddata?seid=GDPC1 --- # Forecasting

 * Use current database

 * Real-time forecasters do not have same data

 * Databases revised over time      --- # Forecasting Forecasts in real-time vs forecasts using latest available data

 * Changes in the data affect the jumping-off point for forecasts

 * Effects on the estimated coefficients of a model

 * Changes in the model specification

 * Revisions source of forecast uncertainty  --- # Forecasting

 Which vintage should be used to evaluate a set of forecasts?

 * Assume that a forecaster forecasts the first release?

 * Or forecaster is after some measure of "truth"?    --- # Forecasting  Which vintage should be used to evaluate a set of forecasts?

 * Use values at the time the research was undertaken * Problematic with significant changes in methodology

 * First-release data

 * Data that have been subject to at least one annual revision * More accurate data available

 * Data that appeared just before a benchmark release * Best value activity while avoiding methodological changes --- background-image: url(images/bg1.jpg) background-size: cover class: hide-slide-number split-70 count: false .column.shade_black[.content[

 # That's it!

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. .bottom_abs.width100[ Lecturer: Didier Nibbering Department of Econometrics and Business Statistics

<EMAIL_ADDRESS>] ]]

 <svg class="clip-svg absolute"> <defs> <clipPath id="swipe__clip-path" clipPathUnits="objectBoundingBox"> <polygon points="0.5745 0, 0.5 0.33, 0.42 0, 0 0, 0 1, 0.27 1, 0.27 0.59, 0.37 1, 0.634 1, 0.736 0.59, 0.736 1, 1 1, 1 0, 0.5745 0" /> </clipPath> </defs> </svg>


--- layout: archive title: Zulip Chat Archive permalink: /stream/116395-maths/topic/nat.2Emod_mul_mod.html ---
example (a b c : ℕ) : ((a % c) * (b % c)) % c = (a * b) % c := sorry
:-/ I can't find this in the library. Is it called mod_mul_cast or something?
theorem mod_mul_mod_mod_eq_mul_mod (a b c : ℕ) : ((a % c) * (b % c)) % c = (a * b) % c := nat.modeq.modeq_mul (nat.modeq.mod_modeq a c) (nat.modeq.mod_modeq b c)
Now all it needs is a sensible name :-)
Kevin Buzzard said:
theorem mod_mul_mod_mod_eq_mul_mod (a b c : ℕ) : ((a % c) * (b % c)) % c = (a * b) % c := nat.modeq.modeq_mul (nat.modeq.mod_modeq a c) (nat.modeq.mod_modeq b c)Now all it needs is a sensible name :-)
It's basically "*
is a semiring homomorpism from N to Z_n", right?
In some form. One could argue that that was what modeq_mul was
It's basically "% c
is a monoid hom from N to Z_c".
In some form. It's just one of those situations where there is more than one way of saying something and I needed a way which wasn't in the library
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Github
Social Code
Catalog
Repository
DOI
Easy
Policy
FEATURES
CATALOG
- DOE CODE is the DOE Software Catalog for scientific and business software.
SOCIAL CODE
- DOE CODE seamlessly interfaces with common development platforms (e.g., open web API).
GITHUB
- DOE CODE is an open source product on GitHub that other institutions can download and deploy for their own purposes.
POLICY
- DOE CODE resources provide you information on best practices and policies for software.
EASY
- DOE CODE is easy to use and requires minimal metadata, often autopopulated.
DOI
- DOE CODE issues digital object identifiers (DOIs) for code so software is more easily cited and discoverable. This allows for stronger connections between code, publications, and data through citation in reference sections.
REPOSITORY
- DOE CODE offers public and private repository services in GitHub and Gitlab.


Suffolk police recognises its specials at awards
by Michael StewardSuffolk police recognised the work of its specials with an awards ceremony to celebrate their achievements.
The inaugural event, held at Wherstead Park, near Ipswich, last month, saw around 70 specials from the force and their families attend.
Chief Constable Steve Jupp, Police and Crime Commissioner Tim Passmore and High Sheriff Roz Eminson were also in attendance. along with senior officers from the force.
The event, held on October 19, was organised by Deputy Chief Officer Richard Game and Karen Harris, specials, volunteers and cadets manager and the specials and volunteer team.
In 2018, Suffolk specials completed 35,500 hours of duty, made 132 arrests and recorded 292 crimes.
From Jan to Oct 2019, specials have completed 36,900 hours, made 146 arrests and recorded 276 crimes.
DCO Richard Game said: "In previous years there have been smaller separate awards events and I wanted to bring under event to celebrate together their amazing achievements, good work and commitment.
"It is very important to acknowledge their hard work and say thank you for everything they do to support Suffolk Constabulary and its people.
"The Special Constabulary is made up of officers who have just started their careers in policing right through to officers who are career specials and have been serving for over 30 years and it was lovely to see officers at various lengths of service being recognised.
"Listening to some of the stories of amazing work and hearing what the Chief Constable, PCC and High Sheriff of Suffolk had to say made me very proud to be their Deputy Chief Officer."
Awards were as follows:
Consistent Commitment
Awarded to an officer who shows consistent commitment to duty, including consistency of hours, standard of work and supporting colleges and supervisors
West - SC Amy Petchey
South - SC Sergejs Celnovs
East - SC Kyle Gallagher
Good Work Award
Awarded to an officer for completing a piece of good work such as a 'good' arrest or dealing with or supporting a particularly difficult or vulnerable person or difficult situation
West - SC Sandra Bonner
South - SC Mohammed Makhdum
East - SC Chris Craven
Exceptional Outstanding Achievement Award
Awarded to an officer who has exceeded expectations and either completed an exceptional piece of work and or assisted the special constabulary exceptionally.
West - S/Insp Stephens
South- S/Sgt Kyle Scott
East - SC Louie Holmes
S/Inspectors Award
Awarded to the officer who stands out to the area special inspector
West - SC Libby Appleyard
South - S/Sgt John Poon
East - S/Sgt David Bones
S/Superintendents Award
Awarded to the Officer who stands out to the area special superintendent
West S/Insp David Howse
South S/Insp Kieron Bruen
East - S/Insp Adrian Carter
Chief Officer Award
DCO Richard Game


Search
Sneakers Inventory
Items in the cart
Controls
Total Cost of Items in Cart: $ 0
Total Number of Items In Cart: 0
Clear Cart


Packets, Cereals
Muesli Fitness Nutritious Energy, Gluten Free (500g)
$4.99
Product description
- Natural ingredients
- No dyes and flavor enhancers
- Gluten free
- Vitamins B2, B3, B5 and B6
- Tastes better with milk


kee-Tree is now at version 1.0, It supports browser IE>=8,Firefox,Chrome,Safari, Opera. It works well in IE6 but will not
guarantee to be supported in the future change.
kee-Tree
Compiled and minified CSS, JavaScript and original source files are included.
Download kee-Tree
Install via NPM
You can install via NPM
"npm install kee-tree"
Setup in the code
Assumeing you have extract the dowloaded file under the current folder. First step to include the resource in the html code.
<link rel="stylesheet" type="text/css" href="css/kee-tree.css">
<script type="text/javascript" src="kee-tree.js"></script>
Though kee-Tree do not depend on any other framework, but to run this example, we need depend on jquery. You can use any
other framework or not, anyway, kee-Tree is able to work without any other framework. Let's get started with some example.
Basic usage
Create a simple tree have two depth of children
//where the tree will placed
var cont = document.getElementById("sc-example-basic-usage");
//create a tree, to: is the element to place the tree in
var tree = new kzg.Tree({ to: cont });
//create a top level of node
//tree: the tree object
//text: the text will show on the node
//iconCls: the class name of the node icon, you also can use property icon to specify a image url
var gNode = new kzg.TreeNode({ tree: tree, text: "demos", icon:'http://nonexists.png' ,iconCls: 'demoicon' });
tree.addNode(tree.root, gNode);
//create 2nd level children under the node demos
for (var i = 0; i < 10; i++) {
var node = new kzg.TreeNode({ tree: tree, text: i + '' });
tree.addNode(gNode, node);
}
//you can access node's children by property children
gNode.children[0].setCaption('change node caption.');
Change to another style only with one config change.
//showline: another style of tree, default is false
var tree = new kzg.Tree({ to: cont , showline:true});
Collapse/Expand node by code.
//collapse the node
//the first argument: true/false:expand/collapse
//the second argument: true/false do/or not the same thing to its children
gNode.expand(false,false);
Find node by key.
//create 2nd level children under the node demos
for (var i = 0; i < 3; i++) {
var node = new kzg.TreeNode({ tree: tree, text: i + '' });
tree.addNode(gNode, node);
for (var k = 0; k < 5; k++) {
//again. the key must be unique in the whole tree.
var cn = new kzg.TreeNode({ tree: tree, text: i + '--' + k, key: i + '--' + k});
tree.addNode(node, cn);
}
}
//make the node with key '2--3' selected.
tree.nodes["2--3"].select();
Events Collapse/Expand
kee-Tree will trigger collapse/expand event when a node collapses/expands.
var ln = new kzg.TreeNode({ tree: tree, text: "expand me to load...", expandStyle: "always" });
//the kzg.oe function take 3 arguments.
//it will register callback to a specified object
//1: the object will broadcast the event
//2: the event type
//3: the callback
//a 'collapse' event will trigger when the node collapsed
kzg.oe(ln, 'collapse', function (e) {
//the argument of the call back have a peoperty src
//which is the first argument of the oe function
//clear the children
e.src.removeChildren();
e.src.setCaption("expand me to load...");
});
var callback = function (e) {
var node = e.src;
node.setCaption("loading.....");
var inv = window.setInterval(function () {
tree.addNode(ln, new kzg.TreeNode({ tree: tree, text: "lazy-1" }));
tree.addNode(ln, new kzg.TreeNode({ tree: tree, text: "lazy-2" }));
node.setCaption("done");
window.clearInterval(inv);
}, 2000);
};
//a 'expand' event will trigger when the node expand
kzg.oe(ln, 'expand', callback);
//you can use kzg.ue(ln, 'expand', callback) to unregister the callback
tree.addNode(gNode, ln);
Events select,conextmenu
'select' event will trigger when a node being selected. kee-Tree also support contextmenu event.
//select event will trigger
kzg.oe(tree, 'select', function () {
alert('tree.selectedNode:' + tree.selectedNode.caption);
});
//context menu event
tree.oncontextmenu = function (e, node) {
alert('context menu on node ' + node.caption);
return false;
};
CheckBox Node
Add checkbox node is easy.
for (var i = 0; i < 5; i++) {
//the type argument set to checkbox
var node = new kzg.TreeNode({ tree: tree, text: "checkbox" + i, type: kzg.Tree.CHECKBOX });
tree.addNode(gNode, node);
for (var k = 0; k < 5; k++) {
//the type argument set to checkbox
var cn = new kzg.TreeNode({ tree: tree, text: "checkbox" + i + '-' + k, type: kzg.Tree.CHECKBOX });
tree.addNode(node, cn);
}
//set it checked by code
//argument 1: true/false - checked/unchecked
//argument 2: true/false - its children checked/unchecked(default is false)
//argument 3: true/false - fire or not the click event(default is false)
//note: this method can't be called before this node is added to the tree
node.setChecked(true,true,false);
//set the label style
jQuery(node.label).css('margin-left', '5px');
//the click event will trigger when checkbox button clicked
kzg.oe(node, 'click', function (e, data) {
var node = e.src;
//the checked property of the node show the status of the checkbox
alert('node ' + node.caption + ' is ' + (!node.checked ? 'unchecked' : 'checked'));
node.children.forEach(function(nc) {
nc.setChecked(node.checked,true,false);
}, this);
});
//also you can access the checkbox dom element directly by checkbox peroperty
jQuery(node.checkBox).on('click', function (e) {
alert('checked -- ' + e.target.checked);
});
}
RadioBox Node
Radiobox can be add with type specified to kzg.Tree.RADIOBOX.
for (var i = 0; i < 5; i++) {
//the type argument set to checkbox
var node = new kzg.TreeNode({ tree: tree, text: "radiobox" + i, type: kzg.Tree.RADIOBOX });
tree.addNode(gNode, node);
//set the label style
jQuery(node.label).css('margin-left', '5px');
}
//the radio node under the same node parent will have the same name, so they are a group.
var childNode2 = gNode.children[1];
//setRadioCheck of the node will make it checked
//note: this method can't be called before this node is added to the tree
childNode2.setRadioCheck();
//after add to the tree, you can access the radiobox directly via node.rdoBox
jQuery(childNode2.rdoBox).on('change',function(e){
alert('checked -- ' + e.target.checked);
});
//the rdocheckchanged event will trigger when radio check value changed in a radio group
//the radio nodes under the same node will have the same name
kzg.oe(gNode, 'rdocheckchanged', function (e, data) {
alert('radio select changed from ' + data.preNode.caption + ' to ' + data.curNode.caption);
});