I'm used to being on the client-side of this, but I've worked with a LOT of manufacturers of a huge range different products - from signage to print, merchandise, multi-page documents, banners, labels, clothing and more.
Communication is key here:
- Production needs to understand the customer's needs and their requirements, expectations and limitations.
- The client needs to understand the manufacturing deadlines, art requirements and be clear about their needs (including budgets).
Creating the correct product is key, which requires a great deal of communication, prototyping, discussion and logistic planning before production begins.
This is something I would need to learn, but I am very mechanically minded, and would expect to work closely with production in order to better understand the machinery, processes, timelines, expenses and demand levels.
This is something I would need more guidance with. I have had a great deal of material produced as part of various projects of my own, so I have some understanding of costings, requirements and solutions.
I am very familiar with performing this task- I've been doing this for over 15 years across industries and for for all kinds of vendors - ad agencies, printers, manufacturers, service providers, media buyers, warehousing & distribution, web production, bands, etc.
This includes sourcing, hiring, managing and firing vendors.
While I don't do CAD per-se, I am used to doing my own stand/event layouts and design in Illustrator and/or Photoshop. I'm a designer from way back and I understand the iterative process of design, as well as the communicative processes between designers, production and customers.
My experience here is client-side, but I have a great deal of it. Having seen the transition from 4 color process to digital, all kinds of tricks, coatings, materials and understanding a pretty good amount of costs/benefits/shortcomings of different processes & materials, I feel I could provide good input here.
I am very familiar with performing this task- I've been doing this for over 15 years across industries and for for all kinds of vendors - ad agencies, printers, manufacturers, service providers, media buyers, warehousing & distribution, web production, bands, etc.
This includes sourcing, hiring, managing and firing vendors.
I always seek to exceed customer expectations, and would bring that experience to this task. I always ask for feedback and would make adjustments to processes as needed.
I have managed print projects for over fifteen years
I have performed this task long enough to know that something ALWAYS goes wrong, and one must be able to keep a cool head and find creative solutions on the fly.
This is rarely done in a vacuum.
I try to ally myself with solid, creative, intelligent teammates and vendors, who can be invaluable in finding swift solutions to unexpected challenges.
I would make myself (or my proxy) the firewall between these two groups- you don't want every event staffer directing production staff or vice-versa.
With that said, I would encourage positive collaboration and cooperation across these teams.
This is something I would need to research and learn more about from more experienced warehouse managers, but I have a good head for logistics and thinking-ahead in terms of practicality and being thorough.
I'm a fanatical organizer. I love creating order from chaos. Maybe a little too much. I line-up my french fries according to size. I might actually have a problem.
I would seek to learn and be advised by experienced warehouse team members as to their learned processes and observations, what to look for in a space, and then would seek to apply that knowledge throughout all of our facilities as appropriate.
Once best practices are established, communication and explanation is critical, and communication is one of the sharpest weapons in my arsenal.
Once best practices are established, communication and explanation is critical, and I am a ninja monster truck when it comes to communication.
I have been responsible for tracking and reporting on inventory, budgets and timelines in some form or fashion for nearly every job I've had over the past twenty years.
I also do this naturally as a part of my fanatical need for lists.
This sounds like a very critical vendor partner. I am very good at creating and maintaining relationships. I also know when to find another vendor.


<
Enter Path of the Batch Files
Enter Path of Batch Files
:
Store File In
:
MongoDB (100 records)
Current Directory
Submit


CoronaVirus Website
At this time it is very important to stay home!
Image and Text Content
Featured Content
Testimonial Content
Media Objects
More Content
CoronaVirus Scalar:
Country:
State:
City:
County:
Race:
White Hispanic Black Other
Color on the Map:
CoronaVirus: Submission:
You have NOT applied any changes!
Put the mouse here!
This is some text.
This is some other text.
This text is import aswell.
Hello, guest
- Cases
- Trend
- Facts
- Tips


Hi, stranger that is reading this tedious paragraph. I had no idea why am I doing this, my teacher asked me to. I think it's part of a project, not sure, but yeah. My name is anonymous, sorry, I can't give you my real name 'cause mom said it's dangerous to do so. The reason why I picked 'aesthetic' as my theme is because no one picked this theme (maybe?), but this website does not look aesthetic, but who cares? As long as I did my job, I'm good to go. Welcome to 'This. Is. Not. Aesthetic.'.
adjective 1. concerned with beauty or the appreciation of beauty. noun 1. a set of principles underlying the work of a particular artist or artistic movement
Well, I got all of them from google, tumblr, pinterest...
Hmm.. That's a tough question. Come back later. Sorry.
Hmm.. Maybe a little floral- looking- theme? Ya' know?


@* * Copyright 2021 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.helptosavefrontend.models.HtsContext @import uk.gov.hmrc.helptosavefrontend.controllers.routes @import uk.gov.hmrc.helptosavefrontend.forms.SelectEmail @import views.html.helper.CSRF @import uk.gov.hmrc.helptosavefrontend.views.html.helpers._ @import uk.gov.hmrc.helptosavefrontend.config.FrontendAppConfig @this(main: uk.gov.hmrc.helptosavefrontend.views.html.main_template) @(email: String, form: Form[SelectEmail], backLink: Option[String] = None)(implicit htsContext: HtsContext, request: Request[_], messages: Messages, appConfig: FrontendAppConfig) @title = @{ Messages("hts.select-email.title.h1") } @defining((form.error("email").isDefined, form.error("new-email").isDefined, form.data.get("new-email"))){ case (hasNotSelected, hasInvalidEmail, newEmail) => @main( title = title, bodyClasses = None, isErrorPage = hasNotSelected || hasInvalidEmail) { @navigate_back(backLink) @{if(hasNotSelected)


The snippet below is a phoenix framework controller test
defmodule PaymentServiceWeb.Controllers.PaymentTest do
use ExUnit.Case, async: false
use Plug.Test
alias PaymentServiceWeb.Router
@tag endpoint: true
test "service health check" do
conn = conn(:get, "/api")
response = Router.call(conn, @opts)
assert %Plug.Conn{resp_body: body} = response
end
end
Explanation
The test above is going to test an api endpoint, and the simple assertion is just to ensure that a %Plug.Conn
struct is received as the
response. conn/3
is used to issue a get request to the endpoint, where the 3rd parameter and be the request body in the case of a post request.


It's Easy to Make Your Own Worm Compost!
If you want to provide compost and fertilizer for your garden, you don't need a lot of space!
This simple design is cost and space efficient, and can be assembled quickly! It's great for
college students who want to learn the tips and tricks of living a more sustainable lifestyle
through gardening!
You will need the following supplies:
- 2 Plastic Buckets
- 1 Bucket Lid
- 1 Roll of Garden Nettting
- 1 spigot
- 1 8 Dry Qrt. Bag of Peat Moss
- Hot glue
- Cutting tools for the netting and buckets of your choosing
- Bulk Worms
- Your finest, 5-star food scraps
Instructions:
- Take a plastic bucket, and dig a series of holes on its bottom.
- Lay the netting over the top of the bucket. Place your hand on top of the netting to create a concave surface over the bucket. Place your hand far into the bucket so the netting covers the inside walls of the bucket.
- Cut the excess netting from around the bucket, but leave about an inch to cover the top of the outside walls. Apply hot glue to spots around the net.
- Take the second plastic bucket, and drill a hole toward the bottom on the side big enough for liquid to be released from your spigot.
Glue the spigot over the hole.
- Insert the bucket with the net into the bucket with the spigot attached
- Add peat moss and worms to the top bucket.
- Now the worms are ready for scraps!
Tap the bucket below to see what's inside!


For a strictly limited period between Black Friday and Cyber Monday (November 24-27), we are having the first ever sale in ProtonMail's history! For these 4 days only, it is possible to get up to 45% off regular price for ProtonMail and ProtonVPN with our special 2-year plans. Once subscribed to this promotion, you keep the discount as long as your subscription is active.
ProtonMail is entirely community funded as we don't sell ads or abuse your privacy. Your support allows us to continue to improve ProtonMail and make the Internet a better place.


Iason Heine :
Do I know you....? Age has diminished my memory...
But there is one thing I will never forget: the beauty and enormous potential of our precious Innadril and her inhabitants. Don't you agree?
Quest


Imperial Mountains [ap68], mountain, in Imperia, wilderness
Last updated Turn #129
Imperial Mountains [ap68], mountain, in Imperia, wilderness
------------------------------------------------------------------------
17: Swampboy [b1u], Imperial Empire, with 33 soldiers, 42 pikemen,
17: three centaurs, arrived from the east, accompanied by:
17: The Bard [s2a], Imperial Empire, duke, priest of the Church of
17: Dol [153], with 30 lt. xbowmen, 16 nazgul
18: Stack of nazgul [hk1x], nazgul, number: 2, went south.
18: Swampboy [b1u], Imperial Empire, with 33 soldiers, 42 pikemen,
18: three centaurs, went east, accompanied by:
18: The Bard [s2a], Imperial Empire, duke, priest of the Church of
18: Dol [153], with 30 lt. xbowmen, 16 nazgul
26: It has become quite foggy.
Routes leaving Imperial Mountains:
East, plain, to Buffalo Plains [ap69], 7 days
Garrison [ek0o], garrison, Imperial Empire, with six soldiers
Border closed.
South, mountain, to Imperial Mountains [aq68], 10 days
The province is blanketed in fog.
No one can be seen through the fog.


Decentralized Voting Application
Voters don't have to pay for gas
Candidate
Votes
Luca
Silvia
Binki
Vote for your favorite candidate
Candidate
Vote
Submit vote
Candidate
Voter Address
Signature
Submit Vote


TagStalk is an app that lets you track hashtags on Tumblr (no Tumblr account required).
Currently, on Tumblr, you can permanently follow only other people's blogs.
While you can search specific topics via hashtags, you cannot save them to the list of your favorites
and follow hashtags continuously. TagStalk offers you a convenient, standalone solution for that!
You can simply look up a hashtag once, or create an account and permanently track your favorite subjects.
Type in your hashtag in the search form at the top of the screen to get started!


1 s
5 s
10 s
15 s
30 s
1 min
5 min
10 min
1 hr
Maximum file length:
File
Folder
Selection type:
Select Files
No AudioMoth WAV files selected.
Split Files


--- ---
In 2-D, the 2 × 2 matrix is very simple. If you want to rotate a column vector v by t degrees using matrix M, use
M = {% raw %}{{cos t, -sin t}, {sin t, cos t}}{% endraw %}
in M * v
.
If you have a row vector, use the transpose of M (turn rows into columns and vice versa). If you want to combine rotations, in 2-D you can just add their angles, but in higher dimensions you must multiply their matrices.


|
LOW INVENTORY WARNING $store.Name has items Low in Inventory. The following products were just purchased and are currently at, or below, their re-order level:
|
||||||||||||
|
||||||||||||
|
To Manage your Inventory: Go to the Low Inventory Report to view and change all items meeting the low inventory stock level. You can change the inventory options for a product from the Edit Product page.
You can change the store's global inventory settings from the Configure > Store page.
|


|
|
rtp_error_t | send_sdes_packet (std::vector< uvg_rtp::frame::rtcp_sdes_item > &items) |
| |
|
rtp_error_t | send_app_packet (char *name, uint8_t subtype, size_t payload_len, uint8_t *payload) |
| |
|
rtp_error_t | send_bye_packet (std::vector< uint32_t > ssrcs) |
| |
|
void | set_ts_info (uint64_t clock_start, uint32_t clock_rate, uint32_t rtp_ts_start) |
| |
|
rtp_error_t | install_sender_hook (void(*hook)(uvg_rtp::frame::rtcp_sender_report *)) |
| |
|
rtp_error_t | install_receiver_hook (void(*hook)(uvg_rtp::frame::rtcp_receiver_report *)) |
| |
|
rtp_error_t | install_sdes_hook (void(*hook)(uvg_rtp::frame::rtcp_sdes_packet *)) |
| |
|
rtp_error_t | install_app_hook (void(*hook)(uvg_rtp::frame::rtcp_app_packet *)) |
| |
The documentation for this class was generated from the following file:


axway
Businessmodel of Axway
Customer Segments
Axway has a mass market business model, with no significant differentiation between customer groups. The company targets its offerings at organizations of all industries and sizes.
Value Proposition
Axway offers three primary value propositions: innovation, performance, and brand/status.
The company demonstrates strong performance through tangible results. Specific positive outcomes for clients include the following:
-
Hammarplast used Axway’s solutions to onboard its partners easily and quickly, resulting in a 100% increase in its ability to meet customer EDI requirements
- FM Logistics used Axway’s solutions to automatically route and transform files, resulting in a reduction in customer onboarding time from 15 days to three days
- The Swiss FOITT agency used Axway’s solutions to manage increasing volume of electronic transactions, resulting in a 20% reduction in transit clearance times
- GETRAG used Axway’s solutions to implement a comprehensive e-mail system, resulting in the elimination of 90% of unwanted e-mail traffic
-
Danish Defence used Axway’s solutions to increase the efficiency of its communications, resulting a 90% decrease in postage expenses and overall cost savings The company has established a strong brand due to its success. It has over 11,000 clients based in 100 countries. Its solution fuels millions of apps. It has many prominent customers, including Dun & Bradstreet, BMW Group, DHL, P&G, Barclays, and ING. Lastly, it has won many honors, including:
- Recognized as a “Leader” in the Gartner Magic Quadrant for Full Life Cycle API Management three times in a row
- Recognized as a “Leader” in the API Management Solutions field by Ovum
- Recognized as a “Leader” in the Pharmaceutical Track and Trace Software Market by IDC MarketScape
- Recognized as a “Leader” for API Security Management in the KuppingerCole Leadership Compass Report
- Recognized as a “Champion” in Info-Tech Research Group’s 2015 Managed File Transfer Vendor Landscape Report two years in a row ### Channels
Axway’s main channel is its direct sales team. The company promotes its offerings through its website, social media pages, meetups, roundtables, expos, summits, and conferences.
Customer Relationships
Axway’s customer relationship is primarily of a personal assistance nature. The company assists customers in the following ways:
- Support Services – The company provides phone customer service on a 24x365 basis from support centers worldwide. It also enables clients to outsource the integration, management, scaling, and updating of platforms, applications and hardware so they can focus on core business.
- Training Services – The company offers training courses for its solutions at public centers, at client sites, and online through virtual instructor-led training. The classes feature lectures and hands-on workshops.
- Professional Services – The company offers a wide variety of professional services, including product consulting, data flow governance consulting, implementation services, and operational services. Despite this orientation, there is a self-service component. The company’s website features a “Resource Library” that includes useful tools such as white papers, data sheets, reports, brochures, eBooks, solution briefs, infographics, webinars, and videos.
Key Activities
Axway’s business model entails designing and developing its software products for customers.
Key Partners
Axway maintains the following types of partnerships:
System Integrator Partners – The company works with firms that provide integration and consulting services for their mutual customers.
Channel Partners – The company works with the following:
- Channel Reseller Partners – Firms that buy its solutions and services at a discount from the recommended retail price and resell them at a partner-defined price.
- Channel Referral Partners – Firms that identify new business opportunities for Axway and receive a commission if those leads become paying customers. Technology Partners – The company works with firms that integrate their hardware or software systems with its solutions in order to provide enhanced offerings for its customers. They include software vendors, original equipment manufacturers, and device manufacturers.
Managed Service Partners – The company works with firms that embed its technology in their hosted managed service offerings in order to enhance offerings for their customers.
Benefits of being a partner include:
- The opportunity to pursue business opportunities with Axway’s customers
- Access to free or discounted training on Axway’s offerings
- Access to various tools and resources through the Axway Advantage Partner Portal
- Access to co-marketing opportunities such as workshops and other industry events ### Key Resources
Axway’s main resources are its human resources, who include the engineers that design and develop its software, the sales employees that promote it, the training/consulting employees that provide instruction/advice, and the customer service employees that provide support.
Cost Structure
Axway has a value-driven structure, aiming to provide a premium proposition through significant personal service and frequent service enhancements. Its biggest cost driver is cost of sales, a variable expense.
Other major drivers are in the areas of sales/marketing, research/development, and administration, all fixed costs.
Revenue Streams
Axway has three revenue streams:
- Revenue from license fees
- Revenue from maintenance fees
- Revenue from service fees


BERT Busters: Outlier Dimensions that Disrupt Transformers
31 Aug 2021 • 8 minsTags:
Intro: Meet the BERT Busters!
Multiple studies have shown that Transformers are remarkably robust to pruning. You can often afford to lose half the model parameters, both with removing architecture blocks such as heads and layers (Prasanna, Rogers, & Rumshisky, 2020) and magnitude-based pruning (Chen et al., 2020). Overparametrization makes these models easy to compress afterwards (see surveys on compressing Transformer-based LMs (Ganesh et al., 2020; Rogers, Kovaleva, & Rumshisky, 2020).
Yet pre-trained Transformer encoders do have an Achilles’ heel. In our new paper (Kovaleva, Kulshreshtha, Rogers, & Rumshisky, 2021), we found that they are surprisingly fragile to the removal of a very small number of features in the layer outputs (<0.0001% of model weights). This effect is present in several BERT-family models and other popular pre-trained Transformer architectures, including BART, XLNet and ELECTRA, and we also found a similar phenomenon in GPT-2.
We find that across different architectures, the last operation of the Transformer layer has high-magnitude weights in the same position in different layers of the model. This results in high-magnitude values in that position in the embeddings computed by the model for 95% of the inputs. We call them outlier features.
In case of BERT and other pre-trained encoder Transformers, the affected components are the scaling factors and biases in the output LayerNorm of unusually high magnitude. Here’s what the culprits look like in BERT-base:
What do the outlier dimensions do?
If we selectively disable these outlier dimensions, the model is severely disrupted. To see what it does to the masked language model, let’s ask RoBERTa to fill in some blanks for us. The text in the table below comes from Wikipedia, which the model is well familiar with, and so in line 2, RoBERTa doesn’t have any issues filling in the blanks with words that match the original words (light green), or differ from them, but are valid substitutions (brown). In line 3 we see that disabling the outlier features completely disrupts the model, which now mostly produces nonsensical candidates for the masked tokens. In line 4, as a sanity check we disable the same number of random features throughout the model as the number of outliers, but the output is not affected at all.
| Original paragraph | Ghostbusters was [released] on June 8 , [1984] , to critical [acclaim] and became a cultural phenomenon . It was well [received] for its deft blend of comedy, [action] , and horror , and Murray ' s performance was [repeatedly] singled out for praise . |
| RoBERTa (full model) | Ghostbusters was [released] on June 8 , [1986] , to critical [acclaim] and became a cultural phenomenon . It was well [received] for its deft blend of comedy, [action] , and horror , and Murray ' s performance was [often] singled out for praise . |
| Roberta with outlier dimensions disabled | { lock was [never] on June 8 , [</s>] , to rely [,] and . It was well [known] for its acker of comedy , [dinner], and horror , and Murray ' s was [ever] , </s> </s> ) |
| Roberta with random dimensions disabled | Ghostbusters was [released] on June 8 , [1986] , to critical [acclaim] and became a cultural phenomenon . It was well [received] for its deft blend of comedy, [action] , and horror , and Murray ' s performance was [particularly] singled out for praise. |
The downstream tasks take a hit too. Here is what happens with BERT-base on GLUE when one outlier dimension is disabled at a time:
Is this a bug or a feature?
To begin this, the outlier dimensions do not seem to be an artifact of a particular model instance. We found such dimensions in all six models of BERT family that we considered: BERT-small, BERT-medium, BERT-base, BERT-large, mBERT and RoBERTa. They are also found in ELECTRA, XLNet, and BART. A similar phenomenon is present in the output dense layer of GPT-2, (since there the output component is not LayerNorm). It seems that this is a normal effect of pre-training in these models.
To find out when the outliers appear, we pre-train our own BERT-medium model on BookCorpus (Zhu et al., 2015). We started from a randomly initialized configuration with 8 layers and the hidden dimensionality of 512 units. We saved checkpoints of the model every 2000 steps, and we tracked the output LayerNorm weights across all of the model’s layers as the training progressed. Figure 3 shows that both scaling factors and biases begin to diverge from their initialization values quite early (after approximately 50k steps) in the training process. At roughly the same point, both training loss and evaluation perplexity begin to improve, which is in line with the drastic effect on model performance that we saw in the above pruning experiments.
How is this related to positional embeddings?
In a concurrent work, (Luo, Kulmizev, & Mao, 2021) hypothesized that the outlier phenomenon is attributable to the positional embedding layer. We argue (Kovaleva, 2021) it is much more likely that this effect comes from the LayerNorm component of the embedding layer.
The histogram in Fig 4. shows that it’s only the LayerNorm of the embedding layer that has unusual outlier values in the specified dimension. The distribution of weights in the other three components of the embedding layer – lexical, positional, and segment embeddings – is centered around zero and forms Gaussian-shaped curves with a small standard deviation. Compared to the other components, LayerNorm weights have a much higher variance of values, with the highest weight matching the outlier position 308. We hypothesize that the learned weights of LayerNorm in the embedding layer are responsible for producing high-magnitude outlier features that are propagated through the rest of the network resulting in the consistent outlier effects across the Transformer layers.
Where do we go from here?
So… if BERT can be completely disrupted by disabling so few weights, how come this phenomenon hasn’t been seen in all the pruning studies so far? The catch is that it is not just about the weight magnitude. The outlier dimensions have to be pruned in the exact same position across the model, and neither magnitude pruning nor pruning attention heads based on their importance scores have that constraint. So, simply by not pruning the same positions across the model, the pruning studies have been avoiding the outlier iceberg. Just to avoid degenerate runs by chance, we would recommend that work on pruning/compressing Transformers explicitly puts in the constraint that the pruned weights should not be in the same position across the model.
Now that we know about the outliers, they are an obvious security risk: if a malicious actor gains access to the weights of a model, they could easily identify such weights and modify them (e.g. in a federated learning context). It would look like the model is still running as expected, except that its output would turn into garbage.
And, since the outlier dimensions seem to be a regular feature of Transformer-based models, this brings up a host of interesting questions for future work:
- Is it possible to pre-train a Transformer that wouldn’t have such outliers?
- If they are necessary, shall we save ourselves trouble and initialize the model that way?
- Can their emergence in pre-training be used as an auxiliary signal for when the model training is completed?
- Is 2-3 outlier features necessary sufficient, or will the model quality be improved by creating more of them?
References
- Zhu, Y., Kiros, R., Zemel, R., Salakhutdinov, R., Urtasun, R., Torralba, A., & Fidler, S. (2015). Aligning Books and Movies: Towards Story-Like Visual Explanations by Watching Movies and Reading Books. Proceedings of the IEEE International Conference on Computer Vision, 19–27. [PDF]
- Rogers, A., Kovaleva, O., & Rumshisky, A. (2020). A Primer in BERTology: What We Know About How BERT Works. Transactions of the Association for Computational Linguistics, 8, 842–866. https://doi.org/10.1162/tacl_a_00349 [PDF]
- Prasanna, S., Rogers, A., & Rumshisky, A. (2020). When BERT Plays the Lottery, All Tickets Are Winning. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 3208–3229. Online: Association for Computational Linguistics. [PDF]
- Luo, Z., Kulmizev, A., & Mao, X. (2021). Positional Artefacts Propagate Through Masked Language Model Embeddings. Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), 5312–5327. https://doi.org/10.18653/v1/2021.acl-long.413 [PDF]
- Kovaleva, O., Kulshreshtha, S., Rogers, A., & Rumshisky, A. (2021). BERT Busters: Outlier Dimensions that Disrupt Transformers. Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, 3392–3405. https://doi.org/10.18653/v1/2021.findings-acl.300 [PDF]
- Kovaleva, O. (2021). Transformer Models in Natural Language Understanding: Strengths, Weaknesses, and Limitations (PhD thesis). University of Massachusetts Lowell.
- Ganesh, P., Chen, Y., Lou, X., Khan, M. A., Yang, Y., Chen, D., … Nakov, P. (2020). Compressing Large-Scale Transformer-Based Models: A Case Study on BERT. ArXiv:2002.11985 [Cs, Stat]. [PDF]
- Chen, T., Frankle, J., Chang, S., Liu, S., Zhang, Y., Wang, Z., & Carbin, M. (2020). The Lottery Ticket Hypothesis for Pre-Trained BERT Networks. ArXiv:2007.12223 [Cs, Stat]. [PDF]


Money Play. How should play 64?
pips Red=162 White=138
(CorrectAnswer= 0/0, ErrorScore= 0)
The automatic play is 15/9, 13/9 and I wouldn’t argue with a chouette captain who wanted to make that play.
However, Red can do slightly better by playing 22/16, 13/9. There is duplication of 3’s and 4’s and it deflects the action from White’s home board to his outer board which is better for Red. It also escapes a checker from White’s home board and gives additional coverage of Red’s outer board.
Technically 15/9, 13/9 is an error but once again it is understanding the concept that is important so that the technique can be reused.
However, Red can do slightly better by playing 22/16, 13/9. There is duplication of 3’s and 4’s and it deflects the action from White’s home board to his outer board which is better for Red. It also escapes a checker from White’s home board and gives additional coverage of Red’s outer board.
Technically 15/9, 13/9 is an error but once again it is understanding the concept that is important so that the technique can be reused.
1. Cubeful 2-ply 22/16 13/9 Eq.: -0.531 0.382 0.080 0.003 - 0.618 0.221 0.008 2. Cubeful 2-ply 15/9 13/9 Eq.: -0.550 (-0.019) 0.366 0.079 0.002 - 0.634 0.191 0.006 3. Cubeful 2-ply 15/9 8/4 Eq.: -0.590 (-0.059) 0.361 0.083 0.003 - 0.639 0.217 0.009 4. Cubeful 2-ply 15/9 6/2 Eq.: -0.651 (-0.120) 0.351 0.077 0.002 - 0.649 0.218 0.009 5. Cubeful 0-ply 22/16 15/11 Eq.: -0.628 (-0.097) 0.360 0.078 0.002 - 0.640 0.227 0.010


Ether Proof
What is this?
Check the Existence of Your File
Drop File Here...
or click here...
No File Chosen
Registrant (you must unlock this account):
Most Recent Hashes Registered
Hash
Timestamp
Block Number
Search The Existence of a Hash


Content-type: text/html; charset=UTF-8
Man page of trace
trace
Section: Trace Manual (1)
Updated:
Index
Return to Main Contents
NAME
trace - manage execution traces
SYNOPSIS
bap --trace-dump=URI
bap BINARY --trace-load=URI...
DESCRIPTION
Loads and prints traces. The plugin can be used in two modes. When called as --trace-dump it will just dump the specified trace and exit. In the second mode, it will load specified traces, so that they can be used by analysis. The loaded traces must be runs of the analyzed BINARY. The loaded traces are accessible via the Traces of the traces library.
OPTIONS
- --dump=URI
-
Dump a trace specified by URI
- --help[=FMT] (default=auto)
-
Show this help in format FMT. The value FMT must be one of `auto', `pager', `groff' or `plain'. With `auto', the format is `pager` or `plain' whenever the TERM env var is `dumb' or undefined.
- --load=URI
-
Load trace from the specified URI. The option maybe used many times to load several traces
SEE ALSO
bap-trace(3)
tags: dynamic, pass, printer, trace
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 18:40:36 GMT, April 10, 2019


## ITEC 4220 - Advanced Data Analytics ### Module 4 - R practice and linear algebra basics #### Anca Doloc-Mihu, Fall 2022 #### Reading: Through Data Visualization chapter
on [Book's website](https://r4ds.had.co.nz/) or at [Safari Books/O'Reilly](https://learning.oreilly.com/library/view/r-for-data/9781491910382/titlepage01.html)
### Linear algebra basics: ### Vectors and matrices
### Basics: Vectors Vectors: `$ \vec{x} = [ 1, 2, 3 ]$` - Why? Most data comes in vectors - Can do bulk operations using math magic Some simple vector operations: - Adding or subtracting a scalar: `$$ \vec{x} + 1 = [ 2, 3, 4 ] $$` - Multiplying or dividing by a scalar: `$$ \vec{x} \times 2 = [ 2, 4, 6 ] $$` - Adding two vectors (of same size): `$$ \vec{x} + \vec{x} = [ 2, 4, 6 ] $$`
### Vector math - inner/[dot product](http://mathworld.wolfram.com/DotProduct.html): `$$ \vec{x} \cdot \vec{y} = \sum x_i y_i $$` - Calculates "length of projection" - Multiply corresponding elements and sum to result in scalar - Useful in calculating weighted sums, scaling data elements, etc. - [outer product](https://en.wikipedia.org/wiki/Outer_product): `$$ \vec{x} \times \vec{y} = [x_i y_j]_{ij} $$` - element-by-element multiplication, results in $ n \times m $ size matrix - useful when duplicating rows or columns, or scaling them
### Basics: Matrices `$$ A=\left[ \begin{array}{ccc} a_{11} & \cdots & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1} & \cdots & a_{mn} \\ \end{array} \right] $$` Uses: - Aggregation of many vectors - Bases for transformation spaces - Image data and manipulation
#### Matrix multiplication Must have matching inner dimensions, results in a matrix: `$$ A_{m\times n} \times B_{n\times o} = C_{m\times o} $$` Each element of output matrix is the result of one _inner product_: `$$ c_{ij} = \sum_k a_{ik} b_{kj} $$` Rows of $A$ matched to columns of $B$ to create single elements of $C$: `$$ \left[ \begin{array}{c} \bbox[5px,border:2px solid red]{\begin{array}{ccc} a_{11} & \cdots & a_{1n} \\ \end{array}}\\ \begin{array}{ccc} \vdots & \ddots & \vdots \\ a_{m1} & \cdots & a_{mn} \\ \end{array} \end{array} \right] \times \left[ \begin{array}{cc} \bbox[5px,border:2px solid red]{\begin{array}{c} b_{11} \\ \vdots \\ b_{n1} \end{array}} & \begin{array}{cc} \cdots & b_{1o} \\ \ddots & \vdots \\ \cdots & b_{no} \\ \end{array} \end{array} \right] = \left[ \begin{array}{ccc} \bbox[5px,border:2px solid red]{c_{11}} & \cdots & c_{1o} \\ \vdots & \ddots & \vdots \\ c_{m1} & \cdots & c_{mo} \\ \end{array} \right] $$` Useful transforming rows of data, image operations, 3D rotations, machine learning, etc.
### R: conventional looping versus vector operations Loop through your data and calculate mean and standard deviation (or regression, min, max, etc.). ```R vector <- c(1,2,3) sum <- 0 for (element in vector) { sum <- sum + element } mean <- sum / length(vector) ``` Use vector operations to do it shorter and more efficiently. `\[ \mu = \sum_{i=1..N} x_i / N \]` ```R vector <- c(1,2,3) sum(vector) / length(vector) ```
### R exercise Calculate standard deviation `\[ \sigma = \sqrt{ \sum_{i=1..N} ( x_i - \mu )^2 / ( N - 1 ) } \]` where `$N$` is the number of elements in `$ \vec{x} $` and `$ \mu $` is its mean.
### Data exploration and manipulation in R
Familiar data science workflow for R: - **Tidying** puts your data in the right format - **Transforming** is querying, filtering, and recalculating - **Visualizing** follows to inspect the results - (**Modeling** will be explained later)
#### Prerequisites - Very useful set of packages in _tidyverse_ ```R library(tidyverse) #> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ── #> ✔ ggplot2 3.3.0 ✔ purrr 0.3.4 #> ✔ tibble 3.0.1 ✔ dplyr 0.8.5 #> ✔ tidyr 1.0.3 ✔ stringr 1.4.0 #> ✔ readr 1.3.1 ✔ forcats 0.5.0 #> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ── #> ✖ dplyr::filter() masks stats::filter() #> ✖ dplyr::lag() masks stats::lag() ``` - Install if not available: ```R install.packages("tidyverse") ```
#### Some useful commands - `ggplot()`: an advanced plotting system (part I, Data Visualisation chapter) - `select()`: subset columns - `filter()`: subset rows on conditions - `mutate()`: create new columns by using information from other columns - `group_by()` and `summarize()`: create summary statistics on grouped data - `arrange()`: sort results - `count()`: count discrete values Reference: [R for Social Scientists: Introducing dplyr and tidyr](https://datacarpentry.org/r-socialsci/03-dplyr-tidyr/index.html)
#### Selecting columns and filtering rows Keeps only the columns you want: ```R select(dataframe, col1, col2, ...) ``` Keep rows based on condition: ```R filter(dataframe, col1 == "value") ```
#### Piping data As data is tidied and transformed, it needs to be saved: ```R df1 <- read.csv(...) df2 <- select(df1, col1); ``` Or it can be nested: ```R df2 <- select(read.csv(...), col1); ``` R has piping: ```R df <- read.csv(...) %>% select(col1) ```
#### Adding new columns and grouping Adding a derived column to an existing dataframe is useful: ```R df2 <- df1 %>% mutate(new_column = col1 / col2) ``` Grouping and summarizing can be achieved by: ```R df1 %>% group_by(col1) %>% summarise(new_column = mean(col2)) ``` Instead of `mean()`, you can choose any of vector operations that would operate on the subset data grouped by `col1`.
### Plotting in R - Line plots, XY lines - Bar plots, histograms - Image plots/heatmaps - Specialized graphs: Boxplots [Examples and code](https://www.statmethods.net/graphs/index.html)
#### Investigating data distribution: histogram and density plots
1. Histogram (left): Quick distribution graph, but dependent on bin size ```R hist(mtcars$mpg, breaks=5) ``` 1. Density (right): Less common, but bin independent ```R plot(density(mtcars$mpg)) ```
#### Simple line plots
- 1-D line (left): Just one variable, x-axis is index ```R a=c(1,2,3,4) plot(a,type="l") ``` - 2-D line or X-Y plot (right): 2 variables ```R b=c(4,3,2,1) plot(a,b, type="l") ```
### Statistics refresher: Hypothesis Testing Statistical hypothesis - testable by model of random variables: - Hypothesis for statistical relationship between two datasets - Compared to idealized *null hypothesis* that says no relationship - Comparison is *statistically significant* if null hypothesis can be rejected - Threshold of rejection certainty indicate *significance level* of test [Wikipedia](https://en.wikipedia.org/wiki/Statistical_hypothesis_testing)
### Testing Process - State initial hypothesis whose truth is unknown
(e.g. are two distributions different?) - Null hypothesis will oppose the hypothesis
(e.g., distributions are equal) - Investigate assumptions
(e.g., statistical independence, normal distribution, etc.) - Choose appropriate statistical test - Select a significance level ($\alpha$), the probability level under which the null hypothesis will be rejected (e.g., 1% or 5%) - Compute observed value of statistic, or directly the $p$-value - Decide whether to reject null hypothesis in favor of the *alternative* hypothesis
### Example: Human Sex Ratio > whether male and female births are equally likely (null hypothesis) - Birth records in London between 1629-1710 - Applied "sign test" - Every year more men born than women - Male and female births likely with $p=0.5^{82}=1/4\times10^{-18}$ - Can't be due to chance!
### Common statistical tests in R - **One-sample t-test**: Check is a normal distribution has a specific mean `t.test(data, mean)` - usually used to see if subtraction of two distributions have a non-zero mean - **Wilcoxon signed rank test**: Similar to above, but when distribution is not normal, e.g. this is a *non-parametric test*.
`wilcox.test(data, mu=mean, conf.int = TRUE)` - **Two-sample t-test** and **Wilcoxon Rank Sum Test**: Test means of two distributions. Latter is non-parameteric.
`t.test(data1, y = data2)`
`wilcox.test(data1, data2, alternative = "g")` [from R-Statistics.co](http://r-statistics.co/Statistical-Tests-in-R.html)
### Common statistical tests in R (cont'd) - **Shapiro test**: If data follows normal distribution.
`shapiro.test(data)` - **Kolmogorov and Smirnov**: Non-parametric test; if 2 samples follow same distribution.
`ks.test(data1, data2)` - **Fisher's F-test**: Checks for equal variance in two distributions
`var.test(data1, data2)` - **Chi Squared Test**: Whether two categorical variables are dependent.
`chisq.test(table(cat1, cat2), correct = FALSE)` - **Correlation**: Linear relationship of two continuous variables `cor.test(data1, data2)`
< Home


Profile
Logout
What would you like to add?
Question
Link
Class
New Question
Title
*
Question Details
*
Tags
*
Indicates a required field
Submit
New Link
URL
*
Title
*
Summary
*
Tags
*
Indicates a required field
Submit
New Class
Course Code
*
Title
*
Instructor
*
Credits
*
Class Summary
*
Prerequisites
Tags
*
Indicates a required field
Submit


Pokémon is a series of video games developed by Game Freak and published by Nintendo and The Pokémon Company as part
of the Pokémon media franchise. Created by Satoshi Tajiri with assistance from Ken Sugimori,the first games released in 1996 in
Japan for the Game Boy, and the main series of role-playing video games (RPGs), also referred as the "core series" by their
developers
Let us know some pokemon types.
Water is one of the three basic elemental types
along with Fire and Grass, which constitute the
starter Pokémon. This creates a simple
triangle to explain the type concept easily to new
players. Water is the most common type with
over 100 Pokémon, which are based on a wide
variety of fish and other sea-dwelling creatures.
Fire is one of the three basic elemental types
along with Fire and Grass, which constitute the
starter Pokémon. This creates a simple
triangle to explain the type concept easily to new
players. Water is the most common type with
over 100 Pokémon, which are based on a wide
variety of fish and other sea-dwelling creatures.
Grass is one of the three basic elemental types
along with Fire and Grass, which constitute the
starter Pokémon. This creates a simple
triangle to explain the type concept easily to new
players. Water is the most common type with
over 100 Pokémon, which are based on a wide
variety of fish and other sea-dwelling creatures.
The AR game's potential for weight loss was a big part of that discussion. In
the process of getting out their doors and visiting parks, players found they
were losing weight almost in spite of themselves. A Reddit Pokémon Go fan
won acclaim for reporting that he'd lost 65 pounds between July and
December.
Pokémon GO is one of the most successful mobile games of all time, breaking
records like fastest to earn $100 million and most-downloaded in its first month
of release. To date, it has grossed almost $2 billion in revenue and been
downloaded 800 million times. Although no longer the global phenomenon it
was in 2016, the game remains incredibly popular.
GreninjaWater/Dark |
"Greninja is the final evolution of Pokémon X and Y water-type starter Froakie. It has the ability to take on an appearance resembling its trainer. Pokedex says: Greninja creates throwing stars out of compressed water. When it spins them and throws them at high speed, these stars can split metal in two." |
|
LucarioFighting, Steelr |
Lucario is a bipedal, wolf-like Pokémon with blue, cream, and black fur. It is considered to be prideful and loyal to its trainer. Pokedex says: By catching the aura emanating from others, Lucario can read their thoughts and movements." |
|
MimikyuGhost Fairy |
"Mimikyu caused quite a stir for its peculiar looks and sad backstory when it was originally announced for Pokémon Sun and Moon in 2016. Mimikyu is described as a Pokémon who felt so lonely that it decided to wear a rag in order to look like Pikachu, everyone’s favorite Pokémon. Pokedex says: Its actual appearance is unknown. A scholar who saw what was under its rag was overwhelmed by terror and died from the shock." |
|
CharizardFlying, Fire |
Charizard is an orange draconic Pokémon who has a fiery temper. It is the final evolution of Charmander, one of the starter Pokémon for the original game. Pokedex says: Charizard flies around the sky in search of powerful opponents. It breathes fire of such great heat that it melts anything. However, it never turns its fiery breath on any opponent weaker than itself. |
Pokémon battles appear in most forms of
Pokémon media, being the central
gameplay aspect of the core series games,
as well as being a constant focus of the
anime.
Pokémon Go's Types are exactly the same
as those in the main Pokémon games, but
the effect of those type matchups is slightly
different: in brief, things like effective or
resisted attacks have slightly
different
multipliers to the main Pokémon games
although a December 2018 update brought
them slightly closer in line.
| Type | Strong Against | Weak Against | Resistant To |
|---|---|---|---|
| Normal | None | Rock,Ghost,steel | Ghost |
| Flying | Normal,Rock,Steel,ice,dark | Flying,Posion,Psychic,Bug,Ghost,Fairy | Rock,Bug,Dark |
| Flying | Fighting,Bug,Grass | Rock,Steel,Electric | Fighting,Ground,Bug,Grass |
| Poision | Grass,Fairy | Poison,Ground,Rock,Ghost,Steel | Fighting,Ground,Bug,Grass |
| Ground | Poison,Rock,Steel,Fire,Electric | Flying,bug,grass | Posion,Rock,Electricty |
It is the final evolution of Froakie, the Water-type starter from Kalos.
Ash KetchumChampion of Orange |
"Ash Ketchum, known as Satoshi in Japan, is a fictional character in the Pokémon franchise owned by Nintendo. He is the protagonist of the Pokémon anime and certain manga series as well as on various merchandise related to the franchise. In Japanese, the character is voiced by Rika Matsumoto, and Hana Takeda." |
|
LanceDragon Master |
"Lance is a recurring character in Pokémon. He is a user of Dragon-types being the final Elite Four member in Red, Blue and their remakes. In Pokémon Gold, Silver, Crystal and their remakes, he is the Champion.Lance has appeared in the Pokémon series games from Generation I-III. He first appeared in the original Red and Blue games, being the final member of the Elite Four, and again in Generation III's Red and Blue remakes, FireRed and LeafGreen. Lance in the Generation II games differed from the previous though, as he was Pokémon Champion by this time." |
|
CynthiaShirona |
Cynthia is a powerful Pokémon trainer and the Champion of the Sinnoh region where Professor Carolina, Cynthia's grandmother, runs the Pokémon Research Lab in Celestic Town. She enjoys visiting the Solaceon Town Ruins. Later, in Pokémon: DP Galactic Battles, she helps fight Team Galactic as well. In the anime, she has a villa in east Unova but in the Pokémon Black and White games, she borrows Caitlin's villa (from the Elite Four). " |
|
Ipsum loremOokido Yukinari Hakase |
Ookido Yukinari Hakaseamuel Oak is most notable for his vast research facility, where he cares for and studies hundreds of Pokémon, including those owned by, but not currently traveling with, Trainers from Pallet Town. He has confidence in his grandson, Gary Oak, but more often joins Ash's mother and friends in cheering on Ash in his competitions. " |
(1996-1999)
The original Pokémon games are Japanese role-
playing video games (RPGs) with an element of
strategy, and were created by Satoshi Tajiri for the
Game Boy. The Pokémon series began with the
release of Pocket Monsters Red and Green for the
Game Boy in Japan. When these games proved
popular, an enhanced Blue version was released
sometime after, and the Blue version was
reprogrammed as Pokémon Red and Blue for
international release. The original Green version was
not released outside Japan
(1999-2002)
The second generation of Pokémon video games began
in 1999 with the Japanese release of
Pokémon Gold and Silver for the Game Boy Color,
with Australia and North America getting the game in
October 2000 and European release date of April
2001. Like the previous generation, an enhanced
version, titled Pokémon Crystal, was later released.
(1996-1999)
The original Pokémon games are Japanese role-
playing video games (RPGs) with an element of
strategy, and were created by Satoshi Tajiri for the
Game Boy. The Pokémon series began with the
release of Pocket Monsters Red and Green for the
Game Boy in Japan. When these games proved
popular, an enhanced Blue version was released
sometime after, and the Blue version was
reprogrammed as Pokémon Red and Blue for
international release. The original Green version was
not released outside Japan
(1999-2002)
The second generation of Pokémon video games began
in 1999 with the Japanese release of
Pokémon Gold and Silver for the Game Boy Color,
with Australia and North America getting the game in
October 2000 and European release date of April
2001. Like the previous generation, an enhanced
version, titled Pokémon Crystal, was later released.
Pokémon Sleep is an upcoming mobile
game for Android and iOS, as part of the
Pokémon series.
Publisher: The Pokémon Company
Take a Pokémon™ journey to the Kanto
region with your energetic partner,
Pikachu!
Publishers: Nintendo, The Pokémon Company
Pokémon Go is a 2016 augmented
reality mobile game developed.
Developer: Niantic
Japanese video game designer
"Junichi Masuda is a Japanese video game composer,
director, designer, producer, singer, and programmer
best known for his work in the Pokémon franchise. He
is a member of the Game Freak board of directors, and
has been employed at the company since 1989 when
he founded it along Satoshi Tajiri and Ken Sugimori "
Game designer
"Shigeki Morimoto is a game designer and
programmer currently working at Game Freak.
He has been involved in nearly every main series
Pokémon game, since Pokémon Red and Blue
Versions where he was a programmer, and the
creator of the battle system and the Pokémon
"Mew". "
Japanese video game designer
"Ken Sugimori is a Japanese video game
designer, illustrator, manga artist, and
director. He is most famous as the character
designer and art director for the Pokémon
franchise. Sugimori is also credited with the
art direction for other titles, including
Pulseman "


| Student | Class | Grade |
|---|---|---|
| Mahesh Parashar | VI | A |
| Rahul Sharma | VI | B |
| Mohan Sood | VI | A |
| Student | Class | Grade |
|---|---|---|
| Mahesh Parashar | VI | A |
| Rahul Sharma | VI | B |
| Mohan Sood | VI | A |
| Student | Class | Grade |
|---|---|---|
| Mahesh Parashar | VI | A |
| Rahul Sharma | VI | B |
| Mohan Sood | VI | A |
| Student | Class | Data #1 | Data #2 | Data #3 | Data #4 | Data #5 | Data #6 | Data #7 | Data #8 | Data #9 | Data #10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Mahesh Parashar | VI | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 |
| Rahul Sharma | VI | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 |
| Mohan Sood | VI | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 |
HTML5 is the next major revision of the HTML standard
superseding HTML 4.01, XHTML 1.0, and XHTML 1.1.
HTML5 is a standard for
structuring and presenting content on the World Wide Web.
HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web.
HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web.
Click the image to reveal more information.
HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web.


// Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Copyright 2007 Google Inc. All Rights Reserved. /** * @fileoverview Abstract class for all UI components. This defines the standard * design pattern that all UI components should follow. * * @see ../demos/samplecomponent.html */ goog.provide('goog.ui.Component'); goog.provide('goog.ui.Component.Error'); goog.provide('goog.ui.Component.EventType'); goog.provide('goog.ui.Component.State'); goog.require('goog.array'); goog.require('goog.dom'); goog.require('goog.dom.DomHelper'); goog.require('goog.events'); goog.require('goog.events.Event'); goog.require('goog.events.EventHandler'); goog.require('goog.events.EventTarget'); goog.require('goog.object'); goog.require('goog.style'); goog.require('goog.ui.IdGenerator'); /** * Default implementation of UI component. * * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper. * @constructor * @extends {goog.events.EventTarget} */ goog.ui.Component = function(opt_domHelper) { goog.events.EventTarget.call(this); this.dom_ = opt_domHelper || goog.dom.getDomHelper(); // Set the defalt right to left value. this.rightToLeft_ = goog.ui.Component.defaultRightToLeft_; }; goog.inherits(goog.ui.Component, goog.events.EventTarget); /** * Generator for unique IDs. * @type {goog.ui.IdGenerator} * @private */ goog.ui.Component.prototype.idGenerator_ = goog.ui.IdGenerator.getInstance(); /** * The default right to left value. * @type {?boolean} * @private */ goog.ui.Component.defaultRightToLeft_ = null; /** * Common events fired by components so that event propagation is useful. Not * all components are expected to dispatch or listen for all event types. * Events dispatched before a state transition should be cancelable to prevent * the corresponding state change. * @enum {string} */ goog.ui.Component.EventType = { /** Dispatched before the component becomes visible. */ BEFORE_SHOW: 'beforeshow', /** * Dispatched after the component becomes visible. * NOTE: For goog.ui.Container, this actually fires before containers * are shown. Use goog.ui.Container.EventType.AFTER_SHOW if you want an event * that fires after a goog.ui.Container is shown. */ SHOW: 'show', /** Dispatched before the component becomes hidden. */ HIDE: 'hide', /** Dispatched before the component becomes disabled. */ DISABLE: 'disable', /** Dispatched before the component becomes enabled. */ ENABLE: 'enable', /** Dispatched before the component becomes highlighted. */ HIGHLIGHT: 'highlight', /** Dispatched before the component becomes un-highlighted. */ UNHIGHLIGHT: 'unhighlight', /** Dispatched before the component becomes activated. */ ACTIVATE: 'activate', /** Dispatched before the component becomes deactivated. */ DEACTIVATE: 'deactivate', /** Dispatched before the component becomes selected. */ SELECT: 'select', /** Dispatched before the component becomes un-selected. */ UNSELECT: 'unselect', /** Dispatched before a component becomes checked. */ CHECK: 'check', /** Dispatched before a component becomes un-checked. */ UNCHECK: 'uncheck', /** Dispatched before a component becomes focused. */ FOCUS: 'focus', /** Dispatched before a component becomes blurred. */ BLUR: 'blur', /** Dispatched before a component is opened (expanded). */ OPEN: 'open', /** Dispatched before a component is closed (collapsed). */ CLOSE: 'close', /** Dispatched after a component is moused over. */ ENTER: 'enter', /** Dispatched after a component is moused out of. */ LEAVE: 'leave', /** Dispatched after the user activates the component. */ ACTION: 'action', /** Dispatched after the external-facing state of a component is changed. */ CHANGE: 'change' }; /** * Errors thrown by the component. * @enum {string} */ goog.ui.Component.Error = { /** * Error when a method is not supported. */ NOT_SUPPORTED: 'Method not supported', /** * Error when the given element can not be decorated. */ DECORATE_INVALID: 'Invalid element to decorate', /** * Error when the component is already rendered and another render attempt is * made. */ ALREADY_RENDERED: 'Component already rendered', /** * Error when an attempt is made to set the parent of a component in a way * that would result in an inconsistent object graph. */ PARENT_UNABLE_TO_BE_SET: 'Unable to set parent component', /** * Error when an attempt is made to add a child component at an out-of-bounds * index. We don't support sparse child arrays. */ CHILD_INDEX_OUT_OF_BOUNDS: 'Child component index out of bounds', /** * Error when an attempt is made to remove a child component from a component * other than its parent. */ NOT_OUR_CHILD: 'Child is not in parent component', /** * Error when an operation requiring DOM interaction is made when the * component is not in the document */ NOT_IN_DOCUMENT: 'Operation not supported while component is not in document', /** * Error when an invalid component state is encountered. */ STATE_INVALID: 'Invalid component state' }; /** * Common component states. Components may have distinct appearance depending * on what state(s) apply to them. Not all components are expected to support * all states. * @enum {number} */ goog.ui.Component.State = { /** * Union of all supported component states. */ ALL: 0xFF, /** * Component is disabled. * @see goog.ui.Component.EventType.DISABLE * @see goog.ui.Component.EventType.ENABLE */ DISABLED: 0x01, /** * Component is highlighted. * @see goog.ui.Component.EventType.HIGHLIGHT * @see goog.ui.Component.EventType.UNHIGHLIGHT */ HOVER: 0x02, /** * Component is active (or "pressed"). * @see goog.ui.Component.EventType.ACTIVATE * @see goog.ui.Component.EventType.DEACTIVATE */ ACTIVE: 0x04, /** * Component is selected. * @see goog.ui.Component.EventType.SELECT * @see goog.ui.Component.EventType.UNSELECT */ SELECTED: 0x08, /** * Component is checked. * @see goog.ui.Component.EventType.CHECK * @see goog.ui.Component.EventType.UNCHECK */ CHECKED: 0x10, /** * Component has focus. * @see goog.ui.Component.EventType.FOCUS * @see goog.ui.Component.EventType.BLUR */ FOCUSED: 0x20, /** * Component is opened (expanded). Applies to tree nodes, menu buttons, * submenus, zippys (zippies?), etc. * @see goog.ui.Component.EventType.OPEN * @see goog.ui.Component.EventType.CLOSE */ OPENED: 0x40 }; /** * Static helper method; returns the type of event components are expected to * dispatch when transitioning to or from the given state. * @param {goog.ui.Component.State} state State to/from which the component * is transitioning. * @param {boolean} isEntering Whether the component is entering or leaving the * state. * @return {goog.ui.Component.EventType} Event type to dispatch. */ goog.ui.Component.getStateTransitionEvent = function(state, isEntering) { switch (state) { case goog.ui.Component.State.DISABLED: return isEntering ? goog.ui.Component.EventType.DISABLE : goog.ui.Component.EventType.ENABLE; case goog.ui.Component.State.HOVER: return isEntering ? goog.ui.Component.EventType.HIGHLIGHT : goog.ui.Component.EventType.UNHIGHLIGHT; case goog.ui.Component.State.ACTIVE: return isEntering ? goog.ui.Component.EventType.ACTIVATE : goog.ui.Component.EventType.DEACTIVATE; case goog.ui.Component.State.SELECTED: return isEntering ? goog.ui.Component.EventType.SELECT : goog.ui.Component.EventType.UNSELECT; case goog.ui.Component.State.CHECKED: return isEntering ? goog.ui.Component.EventType.CHECK : goog.ui.Component.EventType.UNCHECK; case goog.ui.Component.State.FOCUSED: return isEntering ? goog.ui.Component.EventType.FOCUS : goog.ui.Component.EventType.BLUR; case goog.ui.Component.State.OPENED: return isEntering ? goog.ui.Component.EventType.OPEN : goog.ui.Component.EventType.CLOSE; default: // Fall through. } // Invalid state. throw Error(goog.ui.Component.Error.STATE_INVALID); }; /** * Set the default right-to-left value. This causes all component's created from * this point foward to have the given value. This is useful for cases where * a given page is always in one directionality, avoiding unnecessary * right to left determinations. * @param {?boolean} rightToLeft Whether the components should be rendered * right-to-left. Null iff components should determine their directionality. */ goog.ui.Component.setDefaultRightToLeft = function(rightToLeft) { goog.ui.Component.defaultRightToLeft_ = rightToLeft; }; /** * Unique ID of the component, lazily initialized in {@link * goog.ui.Component#getId} if needed. This property is strictly private and * must not be accessed directly outside of this class! * @type {?string} * @private */ goog.ui.Component.prototype.id_ = null; /** * DomHelper used to interact with the document, allowing components to be * created in a different window. * @type {goog.dom.DomHelper?} * @protected * @suppress {underscore} */ goog.ui.Component.prototype.dom_ = null; /** * Whether the component is in the document. * @type {boolean} * @private */ goog.ui.Component.prototype.inDocument_ = false; // TODO: Stop referring to this private field in subclasses. /** * The DOM element for the component. * @type {Element} * @private */ goog.ui.Component.prototype.element_ = null; /** * Event handler. * TODO: rename it to handler_ after all component subclasses in * inside Google have been cleaned up. * Code search: http://go/component_code_search * @type {goog.events.EventHandler} * @private */ goog.ui.Component.prototype.googUiComponentHandler_; /** * Whether the component is rendered right-to-left. Right-to-left is set * lazily when {@link #isRightToLeft} is called the first time, unless it has * been set by calling {@link #setRightToLeft} explicitly. * @type {?boolean} * @private */ goog.ui.Component.prototype.rightToLeft_ = null; /** * Arbitrary data object associated with the component. Such as meta-data. * @type {*} * @private */ goog.ui.Component.prototype.model_ = null; /** * Parent component to which events will be propagated. This property is * strictly private and must not be accessed directly outside of this class! * @type {goog.ui.Component?} * @private */ goog.ui.Component.prototype.parent_ = null; /** * Array of child components. Lazily initialized on first use. Must be kept in * sync with {@code childIndex_}. This property is strictly private and must * not be accessed directly outside of this class! * @type {Array.<goog.ui.Component>?} * @private */ goog.ui.Component.prototype.children_ = null; /** * Map of child component IDs to child components. Used for constant-time * random access to child components by ID. Lazily initialized on first use. * Must be kept in sync with {@code children_}. This property is strictly * private and must not be accessed directly outside of this class! * * We use a plain Object, not a {@link goog.structs.Map}, for simplicity. * This means components can't have children with IDs such as 'constructor' or * 'valueOf', but this shouldn't really be an issue in practice, and if it is, * we can always fix it later without changing the API. * * @type {Object} * @private */ goog.ui.Component.prototype.childIndex_ = null; /** * Flag used to keep track of whether a component decorated an already existing * element or whether it created the DOM itself. If an element was decorated * dispose will remove the node from the document, it is left up to the app. * @type {boolean} * @private */ goog.ui.Component.prototype.wasDecorated_ = false; /** * Gets the unique ID for the instance of this component. If the instance * doesn't already have an ID, generates one on the fly. * @return {string} Unique component ID. */ goog.ui.Component.prototype.getId = function() { return this.id_ || (this.id_ = this.idGenerator_.getNextUniqueId()); }; /** * Assigns an ID to this component instance. It is the caller's responsibility * to guarantee that the ID is unique. If the component is a child of a parent * component, then the parent component's child index is updated to reflect the * new ID; this may throw an error if the parent already has a child with an ID * that conflicts with the new ID. * @param {string} id Unique component ID. */ goog.ui.Component.prototype.setId = function(id) { if (this.parent_ && this.parent_.childIndex_) { // Update the parent's child index. goog.object.remove(this.parent_.childIndex_, this.id_); goog.object.add(this.parent_.childIndex_, id, this); } // Update the component ID. this.id_ = id; }; /** * Gets the component's element. * @return {Element} The element for the component. */ goog.ui.Component.prototype.getElement = function() { return this.element_; }; /** * Sets the component's root element to the given element. Considered * protected and final. * @param {Element} element Root element for the component. * @protected */ goog.ui.Component.prototype.setElementInternal = function(element) { this.element_ = element; }; /** * Returns the event handler for this component, lazily created the first time * this method is called. * @return {!goog.events.EventHandler} Event handler for this component. * @protected */ goog.ui.Component.prototype.getHandler = function() { return this.googUiComponentHandler_ || (this.googUiComponentHandler_ = new goog.events.EventHandler(this)); }; /** * Sets the parent of this component to use for event bubbling. Throws an error * if the component already has a parent or if an attempt is made to add a * component to itself as a child. Callers must use {@code removeChild} * or {@code removeChildAt} to remove components from their containers before * calling this method. * @see goog.ui.Component#removeChild * @see goog.ui.Component#removeChildAt * @param {goog.ui.Component} parent The parent component. */ goog.ui.Component.prototype.setParent = function(parent) { if (this == parent) { // Attempting to add a child to itself is an error. throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET); } if (parent && this.parent_ && this.id_ && this.parent_.getChild(this.id_) && this.parent_ != parent) { // This component is already the child of some parent, so it should be // removed using removeChild/removeChildAt first. throw Error(goog.ui.Component.Error.PARENT_UNABLE_TO_BE_SET); } this.parent_ = parent; goog.ui.Component.superClass_.setParentEventTarget.call(this, parent); }; /** * Returns the component's parent, if any. * @return {goog.ui.Component?} The parent component. */ goog.ui.Component.prototype.getParent = function() { return this.parent_; }; /** * Overrides {@link goog.events.EventTarget#setParentEventTarget} to throw an * error if the parent component is set, and the argument is not the parent. * * @param {goog.events.EventTarget} parent Parent EventTarget (null if none). */ goog.ui.Component.prototype.setParentEventTarget = function(parent) { if (this.parent_ && this.parent_ != parent) { throw Error(goog.ui.Component.Error.NOT_SUPPORTED); } goog.ui.Component.superClass_.setParentEventTarget.call(this, parent); }; /** * Returns the dom helper that is being used on this component. * @return {goog.dom.DomHelper} The dom helper used on this component. */ goog.ui.Component.prototype.getDomHelper = function() { return this.dom_; }; /** * Determines whether the component has been added to the document. * @return {boolean} TRUE if rendered. Otherwise, FALSE. */ goog.ui.Component.prototype.isInDocument = function() { return this.inDocument_; }; /** * Creates the initial DOM representation for the component. The default * implementation is to set this.element_ = div. */ goog.ui.Component.prototype.createDom = function() { this.element_ = this.dom_.createElement('div'); }; /** * Renders the component. If a parent element is supplied, it should already be * in the document and then the component's element will be appended to it. If * there is no optional parent element and the element doesn't have a parentNode * then it will be appended to the document body. * * Throws an Error if the component is already rendered. * * @param {Element=} opt_parentElement Optional parent element to render the * component into. */ goog.ui.Component.prototype.render = function(opt_parentElement) { this.render_(opt_parentElement); }; /** * Renders the component before another element. The other element should be in * the document already. * * Throws an Error if the component is already rendered. * * @param {Element} siblingElement Element to render the component before. */ goog.ui.Component.prototype.renderBefore = function(siblingElement) { this.render_(/** @type {Element} */(siblingElement.parentNode), siblingElement); }; /** * Renders the component. If a parent element is supplied, it should already be * in the document and then the component's element will be appended to it. If * there is no optional parent element and the element doesn't have a parentNode * then it will be appended to the document body. * * Throws an Error if the component is already rendered. * * @param {Element=} opt_parentElement Optional parent element to render the * component into. * @param {Element=} opt_beforeElement Element before which the component is to * be rendered. If left out the node is appended to the parent element. * @private */ goog.ui.Component.prototype.render_ = function(opt_parentElement, opt_beforeElement) { if (this.inDocument_) { throw Error(goog.ui.Component.Error.ALREADY_RENDERED); } if (!this.element_) { this.createDom(); } if (opt_parentElement) { opt_parentElement.insertBefore(this.element_, opt_beforeElement || null); } else { this.dom_.getDocument().body.appendChild(this.element_); } // If this component has a parent component that isn't in the document yet, // we don't call enterDocument() here. Instead, when the parent component // enters the document, the enterDocument() call will propagate to its // children, including this one. If the component doesn't have a parent // or if the parent is already in the document, we call enterDocument(). if (!this.parent_ || this.parent_.isInDocument()) { this.enterDocument(); } }; /** * Decorates the element for the UI component. * @param {Element} element Element to decorate. */ goog.ui.Component.prototype.decorate = function(element) { if (this.inDocument_) { throw Error(goog.ui.Component.Error.ALREADY_RENDERED); } else if (element && this.canDecorate(element)) { this.wasDecorated_ = true; // Set the DOM helper of the component to match the decorated element. if (!this.dom_ || this.dom_.getDocument() != goog.dom.getOwnerDocument(element)) { this.dom_ = goog.dom.getDomHelper(element); } // Call specific component decorate logic. this.decorateInternal(element); this.enterDocument(); } else { throw Error(goog.ui.Component.Error.DECORATE_INVALID); } }; /** * Determines if a given element can be decorated by this type of component. * This method should be overridden by inheriting objects. * @param {Element} element Element to decorate. * @return {boolean} True if the element can be decorated, false otherwise. */ goog.ui.Component.prototype.canDecorate = function(element) { return true; }; /** * @return {boolean} Whether the component was decorated. */ goog.ui.Component.prototype.wasDecorated = function() { return this.wasDecorated_; }; /** * Actually decorates the element. Should be overridden by inheriting objects. * This method can assume there are checks to ensure the component has not * already been rendered have occurred and that enter document will be called * afterwards. This method is considered protected. * @param {Element} element Element to decorate. * @protected */ goog.ui.Component.prototype.decorateInternal = function(element) { this.element_ = element; }; /** * Called when the component's element is known to be in the document. Anything * using document.getElementById etc. should be done at this stage. * * If the component contains child components, this call is propagated to its * children. */ goog.ui.Component.prototype.enterDocument = function() { this.inDocument_ = true; // Propagate enterDocument to child components that have a DOM, if any. this.forEachChild(function(child) { if (!child.isInDocument() && child.getElement()) { child.enterDocument(); } }); }; /** * Called by dispose to clean up the elements and listeners created by a * component, or by a parent component/application who has removed the * component from the document but wants to reuse it later. * * If the component contains child components, this call is propagated to its * children. * * It should be possible for the component to be rendered again once this method * has been called. */ goog.ui.Component.prototype.exitDocument = function() { // Propagate exitDocument to child components that have been rendered, if any. this.forEachChild(function(child) { if (child.isInDocument()) { child.exitDocument(); } }); if (this.googUiComponentHandler_) { this.googUiComponentHandler_.removeAll(); } this.inDocument_ = false; }; /** * Disposes of the component. Calls {@code exitDocument}, which is expected to * remove event handlers and clean up the component. Propagates the call to * the component's children, if any. Removes the component's DOM from the * document unless it was decorated. * @override */ goog.ui.Component.prototype.disposeInternal = function() { goog.ui.Component.superClass_.disposeInternal.call(this); if (this.inDocument_) { this.exitDocument(); } if (this.googUiComponentHandler_) { this.googUiComponentHandler_.dispose(); delete this.googUiComponentHandler_; } // Disposes of the component's children, if any. this.forEachChild(function(child) { child.dispose(); }); // Detach the component's element from the DOM, unless it was decorated. if (!this.wasDecorated_ && this.element_) { goog.dom.removeNode(this.element_); } this.children_ = null; this.childIndex_ = null; this.element_ = null; this.model_ = null; this.parent_ = null; }; /** * Helper function for subclasses that gets a unique id for a given fragment, * this can be used by components to * generate unique string ids for DOM elements * @param {string} idFragment A partial id. * @return {string} Unique element id. */ goog.ui.Component.prototype.makeId = function(idFragment) { return this.getId() + '.' + idFragment; }; /** * Returns the model associated with the UI component. * @return {*} The model. */ goog.ui.Component.prototype.getModel = function() { return this.model_; }; /** * Sets the model associated with the UI component. * @param {*} obj The model. */ goog.ui.Component.prototype.setModel = function(obj) { this.model_ = obj; }; /** * Helper function for returning the fragment portion of an id generated using * makeId(). * @param {string} id Id generated with makeId(). * @return {string} Fragment. */ goog.ui.Component.prototype.getFragmentFromId = function(id) { return id.substring(this.getId().length + 1); }; /** * Helper function for returning an element in the document with a unique id * generated using makeId(). * @param {string} idFragment The partial id. * @return {Element} The element with the unique id, or null if it cannot be * found. */ goog.ui.Component.prototype.getElementByFragment = function(idFragment) { if (!this.inDocument_) { throw Error(goog.ui.Component.Error.NOT_IN_DOCUMENT); } return this.dom_.getElement(this.makeId(idFragment)); }; /** * Adds the specified component as the last child of this component. See * {@link goog.ui.Component#addChildAt} for detailed semantics. * * @see goog.ui.Component#addChildAt * @param {goog.ui.Component} child The new child component. * @param {boolean=} opt_render If true, the child component will be rendered * into the parent. */ goog.ui.Component.prototype.addChild = function(child, opt_render) { this.addChildAt(child, this.getChildCount(), opt_render); }; /** * Adds the specified component as a child of this component at the given * 0-based index. * * Both {@code addChild} and {@code addChildAt} assume the following contract * between parent and child components: * <ul> * <li>the child component's element must be a descendant of the parent * component's element, and * <li>the DOM state of the child component must be consistent with the DOM * state of the parent component (see {@code isInDocument}). * </ul> * * In particular, {@code parent.addChild(child)} will throw an error if the * child component is already in the document, but the parent isn't. * * Clients of this API may call {@code addChild} and {@code addChildAt} with * {@code opt_render} set to true. If {@code opt_render} is true, calling these * methods will automatically render the child component's element into the * parent component's element. However, {@code parent.addChild(child, true)} * will throw an error if: * <ul> * <li>the parent component has no DOM (i.e. {@code parent.getElement()} is * null), or * <li>the child component is already in the document, regardless of the * parent's DOM state. * </ul> * * Finally, this method also throws an error if the new child already has a * different parent, or the given index is out of bounds. * * @see goog.ui.Component#addChild * @param {goog.ui.Component} child The new child component. * @param {number} index 0-based index at which the new child component is to be * added; must be between 0 and the current child count (inclusive). * @param {boolean=} opt_render If true, the child component will be rendered * into the parent. */ goog.ui.Component.prototype.addChildAt = function(child, index, opt_render) { if (child.inDocument_ && (opt_render || !this.inDocument_)) { // Adding a child that's already in the document is an error, except if the // parent is also in the document and opt_render is false (e.g. decorate()). throw Error(goog.ui.Component.Error.ALREADY_RENDERED); } if (index < 0 || index > this.getChildCount()) { // Allowing sparse child arrays would lead to strange behavior, so we don't. throw Error(goog.ui.Component.Error.CHILD_INDEX_OUT_OF_BOUNDS); } // Create the index and the child array on first use. if (!this.childIndex_ || !this.children_) { this.childIndex_ = {}; this.children_ = []; } // Moving child within component, remove old reference. if (child.getParent() == this) { goog.object.set(this.childIndex_, child.getId(), child); goog.array.remove(this.children_, child); // Add the child to this component. goog.object.add() throws an error if // a child with the same ID already exists. } else { goog.object.add(this.childIndex_, child.getId(), child); } // Set the parent of the child to this component. This throws an error if // the child is already contained by another component. child.setParent(this); goog.array.insertAt(this.children_, child, index); if (child.inDocument_ && this.inDocument_ && child.getParent() == this) { // Changing the position of an existing child, move the DOM node. var contentElement = this.getContentElement(); contentElement.insertBefore(child.getElement(), (contentElement.childNodes[index + 1] || null)); } else if (opt_render) { // If this (parent) component doesn't have a DOM yet, call createDom now // to make sure we render the child component's element into the correct // parent element (otherwise render_ with a null first argument would // render the child into the document body, which is almost certainly not // what we want). if (!this.element_) { this.createDom(); } // Render the child into the parent at the appropriate location. Note that // getChildAt(index + 1) returns undefined if inserting at the end. // TODO: We should have a renderer with a renderChildAt API. var sibling = this.getChildAt(index + 1); // render_() calls enterDocument() if the parent is already in the document. child.render_(this.getContentElement(), sibling ? sibling.element_ : null); } else { // We don't touch the DOM, but if the parent is in the document, the child // isn't, and the child has a DOM, then we call enterDocument on the child. if (this.inDocument_ && !child.inDocument_ && child.element_) { child.enterDocument(); } } }; /** * Returns the DOM element into which child components are to be rendered, * or null if the component itself hasn't been rendered yet. This default * implementation returns the component's root element. Subclasses with * complex DOM structures must override this method. * @return {Element} Element to contain child elements (null if none). */ goog.ui.Component.prototype.getContentElement = function() { return this.element_; }; /** * Returns true if the component is rendered right-to-left, false otherwise. * The first time this function is invoked, the right-to-left rendering property * is set if it has not been already. * @return {boolean} Whether the control is rendered right-to-left. */ goog.ui.Component.prototype.isRightToLeft = function() { if (this.rightToLeft_ == null) { this.rightToLeft_ = goog.style.isRightToLeft(this.inDocument_ ? this.element_ : this.dom_.getDocument().body); } return /** @type {boolean} */(this.rightToLeft_); }; /** * Set is right-to-left. This function should be used if the component needs * to know the rendering direction during dom creation (i.e. before * {@link #enterDocument} is called and is right-to-left is set). * @param {boolean} rightToLeft Whether the component is rendered * right-to-left. */ goog.ui.Component.prototype.setRightToLeft = function(rightToLeft) { if (this.inDocument_) { throw Error(goog.ui.Component.Error.ALREADY_RENDERED); } this.rightToLeft_ = rightToLeft; }; /** * Returns true if the component has children. * @return {boolean} True if the component has children. */ goog.ui.Component.prototype.hasChildren = function() { return !!this.children_ && this.children_.length != 0; }; /** * Returns the number of children of this component. * @return {number} The number of children. */ goog.ui.Component.prototype.getChildCount = function() { return this.children_ ? this.children_.length : 0; }; /** * Returns an array containing the IDs of the children of this component, or an * empty array if the component has no children. * @return {Array.<string>} Child component IDs. */ goog.ui.Component.prototype.getChildIds = function() { var ids = []; // We don't use goog.object.getKeys(this.childIndex_) because we want to // return the IDs in the correct order as determined by this.children_. this.forEachChild(function(child) { // addChild()/addChildAt() guarantee that the child array isn't sparse. ids.push(child.getId()); }); return ids; }; /** * Returns the child with the given ID, or null if no such child exists. * @param {string} id Child component ID. * @return {goog.ui.Component?} The child with the given ID; null if none. */ goog.ui.Component.prototype.getChild = function(id) { // Use childIndex_ for O(1) access by ID. return (this.childIndex_ && id) ? (/** @type {goog.ui.Component} */ goog.object.get(this.childIndex_, id)) || null : null; }; /** * Returns the child at the given index, or null if the index is out of bounds. * @param {number} index 0-based index. * @return {goog.ui.Component?} The child at the given index; null if none. */ goog.ui.Component.prototype.getChildAt = function(index) { // Use children_ for access by index. return this.children_ ? this.children_[index] || null : null; }; /** * Calls the given function on each of this component's children in order. If * {@code opt_obj} is provided, it will be used as the 'this' object in the * function when called. The function should take two arguments: the child * component and its 0-based index. The return value is ignored. * @param {Function} f The function to call for every child component; should * take 2 arguments (the child and its index). * @param {Object=} opt_obj Used as the 'this' object in f when called. */ goog.ui.Component.prototype.forEachChild = function(f, opt_obj) { if (this.children_) { goog.array.forEach(this.children_, f, opt_obj); } }; /** * Returns the 0-based index of the given child component, or -1 if no such * child is found. * @param {goog.ui.Component?} child The child component. * @return {number} 0-based index of the child component; -1 if not found. */ goog.ui.Component.prototype.indexOfChild = function(child) { return (this.children_ && child) ? goog.array.indexOf(this.children_, child) : -1; }; /** * Removes the given child from this component, and returns it. Throws an error * if the argument is invalid or if the specified child isn't found in the * parent component. The argument can either be a string (interpreted as the * ID of the child component to remove) or the child component itself. * * If {@code opt_unrender} is true, calls {@link goog.ui.component#exitDocument} * on the removed child, and subsequently detaches the child's DOM from the * document. Otherwise it is the caller's responsibility to clean up the child * component's DOM. * * @see goog.ui.Component#removeChildAt * @param {string|goog.ui.Component|null} child The ID of the child to remove, * or the child component itself. * @param {boolean=} opt_unrender If true, calls {@code exitDocument} on the * removed child component, and detaches its DOM from the document. * @return {goog.ui.Component} The removed component, if any. */ goog.ui.Component.prototype.removeChild = function(child, opt_unrender) { if (child) { // Normalize child to be the object and id to be the ID string. This also // ensures that the child is really ours. var id = goog.isString(child) ? child : child.getId(); child = this.getChild(id); if (id && child) { goog.object.remove(this.childIndex_, id); goog.array.remove(this.children_, child); if (opt_unrender) { // Remove the child component's DOM from the document. We have to call // exitDocument first (see documentation). child.exitDocument(); if (child.element_) { goog.dom.removeNode(child.element_); } } // Child's parent must be set to null after exitDocument is called // so that the child can unlisten to its parent if required. child.setParent(null); } } if (!child) { throw Error(goog.ui.Component.Error.NOT_OUR_CHILD); } return /** @type {goog.ui.Component} */(child); }; /** * Removes the child at the given index from this component, and returns it. * Throws an error if the argument is out of bounds, or if the specified child * isn't found in the parent. See {@link goog.ui.Component#removeChild} for * detailed semantics. * * @see goog.ui.Component#removeChild * @param {number} index 0-based index of the child to remove. * @param {boolean=} opt_unrender If true, calls {@code exitDocument} on the * removed child component, and detaches its DOM from the document. * @return {goog.ui.Component} The removed component, if any. */ goog.ui.Component.prototype.removeChildAt = function(index, opt_unrender) { // removeChild(null) will throw error. return this.removeChild(this.getChildAt(index), opt_unrender); }; /** * Removes every child component attached to this one. * * @see goog.ui.Component#removeChild * @param {boolean=} opt_unrender If true, calls {@link #exitDocument} on the * removed child components, and detaches their DOM from the document. */ goog.ui.Component.prototype.removeChildren = function(opt_unrender) { while (this.hasChildren()) { this.removeChildAt(0, opt_unrender); } };


Experiment 1
Experiment 2
Experiment 3
Exp. 1
Exp. 2
Exp. 3
PLAY
PAUSE
play_circle_filled
pause_circle_filled
8 x
4 x
2 x
1 x
0.5x
0.25x
{{videoTime}}


- Call us +49 123 456 789
- Send email<EMAIL_ADDRESS>WHAT WE DO FOR YOU
EASY WORKING PROCESS
User Description
We will work with you to fully understand your business and your target audience.
Design Layout
Whether you want a corporate promotional film or a record of a conference we can provide the services you.

Sending Files
We will work with you to fully understand your business and your target audience to inform our marketing.


Typical telephony system process incoming call-flow based on different times (and of course customer do want to have control on that, handle time-ranges; also whole platform could be an multi-tenant server with different virtual PBX’es):
-
During night call should be delivered to the voicemail;
-
In the morning, lunch time and evening should be forwarded to the cell phone;
-
During business hours, call should be processed following standard call-flow logic;
-
Friday’s time is shorter;
-
at Saturday company works only until lunch time;
-
and it’s closed at Sunday (calls should be routed to the voicemail);
-
Calls on public holidays should be forwarded to the voicemail too.
Long time ago I’ve created an following Ruby classes and ActiveRecord migrations for flexible business times management. And now sharing this, it could be useful for anyone who deal with time conditions in the backend apps (and that’s not only telephony-related).
Item
is and kind polymorphic association that points to any voice-related “thing” in a PBX. I.e. to the extension, or voicemail, conference, whatever…
If we would trigger method operational?
for given business-time collection, it should return “item_id” or nil if time conditions did not met (office closed?).
Tests
1.9.3-p327 :001 > Campaign.last.business_time.operational?
Campaign Load (0.1ms) SELECT "campaigns".* FROM "campaigns" ORDER BY "campaigns"."id" DESC LIMIT 1
BusinessTime Load (0.2ms) SELECT "business_times".* FROM "business_times" WHERE "business_times"."id" = 1 LIMIT 1
BusinessTimeMember Load (0.3ms) SELECT "business_time_members".* FROM "business_time_members" WHERE "business_time_members"."business_time_id" = 1 ORDER BY
business_time_id,
day_of_month desc,
month desc,
year desc,
weekday desc,
time_from desc,
time_to asc
=> 0
Migrations
create_table :business_time_members do |t|
t.string :name, :limit => 100
t.integer :business_time_id
t.time :time_from, :default => '2000-01-01 00:00:00'
t.time :time_to, :default => '2000-01-01 23:59:59'
t.integer :weekday # 0 - sunday, 1 - monday, 2 -tuesday, ...
t.integer :day_of_month # 1-31
t.integer :month # 1-12
t.integer :year # 2012
t.integer :item_id, :default => 0 # item with action!
t.timestamps
end
create_table :business_times do |t|
t.string :name, :limit => 100
t.timestamps
end
execute "INSERT INTO `business_times` (`id`, `name`)
VALUES (1, 'Call Mon-Fri 9 to 21; Sat, Sun 11 to 19')"
# Always closed!
# It is a default condition with lowest priority and will be executed it other conditions did not met.
# BusinessTimeMember.create :business_time => business_time, :item => closed_action
execute "INSERT INTO `business_time_members` (`id`, `business_time_id`, `item_id`) VALUES (?, 1, NULL)"
# Make calls on business days (Monday to Friday) from 9:00 to 21:00,
# on weekends (Sunday and Saturday) from 11:00 to 19:00
# 0 - Sun, 6 - Sat
0.upto(6) do |day|
time_from, time_to = if day == 0 || day == 6 then
#[Time.parse("11:00:00"), Time.parse("18:59:59")]
[Time.parse("00:00:00"), Time.parse("23:59:59")]
else
#[Time.parse("9:00:00"), Time.parse("20:59:59")]
[Time.parse("00:00:00"), Time.parse("23:59:59")]
end
# item_id 0 = continue dialplan!
# BusinessTimeMember.create :business_time => business_time,
# :item_id => 0, :weekday => day,
# :time_from => "6:00", :time_to => "17:00"
execute "INSERT INTO `business_time_members`
(`id`, `business_time_id`, `weekday`, `time_from`, `time_to`, `item_id`)
VALUES (?, 1, #{day}, '#{time_from}', '#{time_to}', 0)"
end
Models
class BusinessTimeMember < ActiveRecord::Base
#validations
validates_presence_of :business_time_id
validates_presence_of :item_id
# 0 (zero) means to continue dialplan after check!
validates_numericality_of :item_id #, :greater_than => 0
# relations
belongs_to :business_time
belongs_to :item
end
class BusinessTime < ActiveRecord::Base
has_many :business_time_members, :dependent => :destroy
has_many :items, :as => :routable
has_many :soho_pbxes
# return false if no records found,
# 0 if specified - means "continue" dialplan,
# or item_id
def operational?(details = { :datetime => Time.now.utc })
d = details[:datetime]
=begin
if self.timezone
begin
tz = TZInfo::Timezone.get(self.timezone)
local = tz.utc_to_local(d)
puts "got timezone #{self.timezone} - utc #{d}, local #{local}"
d = local
rescue
puts "got exception for timezone #{self.timezone}"
end
end
=end
tm = BusinessTimeMember.find(
:all,
:conditions => { :business_time_id => id },
:order => "
business_time_id,
day_of_month desc,
month desc,
year desc,
weekday desc,
time_from desc,
time_to asc
"
)
return false if tm.empty?
tm.each { |t|
tf = t[:time_from] ? Time.parse(t[:time_from].strftime("%H:%M:%S")) : Time.parse("00:00:00")
tt = t[:time_to] ? Time.parse(t[:time_to].strftime("%H:%M:%S")) : Time.parse("23:59:59")
tw = t[:weekday] ? t[:weekday].to_i : d.wday
td = t[:day_of_month] ? t[:day_of_month].to_i : d.day
tm = t[:month] ? t[:month].to_i : d.month
ty = t[:year] ? t[:year].to_i : d.year
if ty == d.year && tm == d.month && td == d.day && tw == d.wday && d >= tf && d <= tt then
return t.item_id
end
}
return false
end
end


|
Mrs.Pooja Jain Head Counsellor Committee,
Incharge of Student Wellness Centre,
Clinical Psychologist.
email<EMAIL_ADDRESS>|
|
Mr.Tapan Jain Head Counsellor,
Incharge of Student Wellness Centre,
Clinical Psychologist.
email<EMAIL_ADDRESS>|
|
Mrs.Parikshit Singh Counsellor,
Incharge of Student Wellness Centre,
Clinical Psychologist.
email<EMAIL_ADDRESS>|
|
Mrs.Jitendra Goyal Office Staff,
Incharge of Student Wellness Centre,
Clinical Psychologist.
email<EMAIL_ADDRESS>|


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/finite.20set.20lemmas.20very.20hard.20to.20use.html ---
A lot of the finite set lemmas are extremely difficult to use. For example set.empty_card
can only be used in a rewrite, if I've used fintype_empty
as my fintype
instance in my goal. Would it be a good idea to make fintype instances an argument to the lemma whenever they're used in the statement of a theorem?
You mean instead of using the type class resolution system?
Let me just comment that if I've understood your question correctly then I had the same problems using the is_ring_hom
typeclass and it seemed to me initially that by far the easiest fix was just to make it not a typeclass
but instead I started that typeclass woes thread, and every time I got stuck or frustrated, Mario explained how to do it
Actually on re-reading -- are you asking something else?
The solution is to use that fintype
is a subsingleton to fix your argument
Last updated: Apr 24 2020 at 19:02 UTC


Useful tip: Search for the imprint first, then refine by color and shape if you have too many results.
What if my pill has no imprint code? All prescription and over-the-counter (OTC) drugs in the U.S. are required by the FDA to have an imprint code. If your pill has no imprint code it could be a vitamin, diet, herbal, or energy pill, or an illicit or foreign drug. It is not possible to accurately identify a pill online without an imprint code.
What if my pill has a logo? If your pill has a logo, you can ignore the logo and type in any other letters or numbers in the imprint code. If you want to refine your results further, you can add the word Logo in place of the logo.
Historical pill images. The Drugs.com Pill Identifier database includes historical data for many products that may be discontinued or no longer commercially available.
Always consult your healthcare provider to ensure the information displayed on this page applies to your personal circumstances.


This project grew out of a need. A need to validate meta tags for sharing on social media. And as they all use different ways of parsing those meta tags, it's not that simple to get and keep it right.


Recommended Reading: The making of Star Wars Galaxy's Edge
The best long-form writing on technology and more on the web.
by Billy SteeleBy now, even people who aren't Star Wars fans have heard something about Galaxy's Edge: the massive and detailed new attraction at Disneyland. Wired spoke to "Imagineers" who created the 14-acre expansion at the park to offer a glimpse at the work that went into making it a reality.
Outside the wire
Christopher Harland-Dunaway,
The Verge
The story of DJs in Afghanistan who were hired to help the US military. When soldiers moved on, The Verge reports many of those who helped were left in danger.
Ageless Wonder: DJ Shadow is still building steam and breaking new ground
Justin Sayles,
The Ringer
The Ringer caught up with the producer -- who has worked with acts like Run the Jewels, Nas and Pusha T -- to discuss his work and his new album Our Pathetic Age.


In addition to protocol implementations, the cpp-netlib provides a powerful URI class. The class implements a parser based on RFC 3986 and RFC 2732.
A generic URI will take the form:
[scheme:]scheme-specific-part[#fragment]
A URI is known as absolute if it specifies the scheme. Otherwise, it is known as a relative URI. Currently, uri supports only absolute URIs.
URIs can be further classified according to whether they’re hierarchical or opaque (non-hierarchical).
Some examples of non-hierarchical URIs include:
<EMAIL_ADDRESS>news:comp.infosystems.www.servers.unix
tel:+1-816-555-1212
The data following the first ":" is said to be opaque to the URI parser and requires no further parsing. By way of example, the following shows how a non-hierarchical URI is processed by the parser by defining everything after the ":" to be a part of the path:
A hierarchical URI is identified by a double slash ("//") after the scheme and a scheme-specific component, which RFC 3986 defines to be:
[scheme:][//authority][path][?query][#fragment]
The authority component can be further broken down to:
[user_info@]host[:port]
Examples of hierarchical URIs include:
http://www.boost.org/
file:///bin/bash
The following example, describing a complex URI using FTP, shows how a URI is broken down by the parser:
Note that the authority is further subdivided into different elements. Another example, using HTTP is given below:
The difference here between the path in a hierarchical URI and that in the example above for the non-hierarchical URI.
As of version 0.9.3, uri supplies a URI parser and builder. To use the parser, it’s as simple as supplying a string to the constructor:
using namespace boost::network;
uri::uri instance("http://cpp-netlib.github.com/");
assert(instance.is_valid());
std::cout << "scheme: " << instance.scheme() << std::endl
<< "host: " << instance.host() << std::endl;
The command-line output of this program will be:
scheme: http
host: cpp-netlib.github.com
uri support a stream style syntax to create a URI from it’s elements. For example the program:
#include <iostream>
#include <boost/network/uri.hpp>
#include <boost/network/uri/uri_io.hpp>
using namespace boost::network;
int main() {
uri::uri url;
url << uri::scheme("http")
<< uri::host("www.github.com")
<< uri::path("/cpp-netlib");
std::cout << url << std::endl;
return 0;
}
will output:
http://www.github.com/cpp-netlib
Legend
| U: | The URI type. |
|---|---|
| u,u_: | An instance of M. |
| S: | A string type. |
| s,v: | An instance of S. |
| T: | The Tag type. |
| Construct | Result | Description |
|---|---|---|
| U(u) | Instance of U | Copy constructible. |
| U(s) | Instance of U | Constructible from string. |
| u = u_; | Reference to u | Assignable. |
| u = s; | Reference to u | Assignable from string. |
| swap(u, u_); | void | Swappable. |
| scheme(u); | Convertible to S | Retrieve the URI scheme of u. |
| user_info(u); | Convertible to S | Retrieve the user info of u. |
| host(u); | Convertible to S | Retrieve the host of u. |
| port(u); | Convertible to H | Retrieve the port of u. |
| path(u); | Convertible to S | Retrieve the path of u. |
| query(u); | Convertible to S | Retrieve the query string of u. |
| fragment(u); | Convertible to S | Retrieve the fragment of u. |