# Thor
## Description
Thor is a simple and efficient tool for building self-documenting command line utilities. It removes the pain of parsing command line options, writing “USAGE:” banners, and can also be used as an alternative to the [Rake](github.com/jimweirich/rake) build tool. The syntax is Rake-like, so it should be familiar to most Rake users.
## Installation
$ gem install thor
or
$ gem install wycats-thor -s gems.github.com
## Usage
Map options to a class. Simply create a class with the appropriate annotations and have options automatically map to functions and parameters.
Example:
class App < Thor # [1] map "-L" => :list # [2] desc "install APP_NAME", "install one of the available apps" # [3] method_options :force => :boolean, :alias => :string # [4] def install(name) user_alias = options[:alias] if options.force? # do something end # other code end desc "list [SEARCH]", "list all of the available apps, limited by SEARCH" def list(search="") # list everything end end
Thor automatically maps commands as such:
thor app:install myname --force
That gets converted to:
App.new.install("myname") # with {'force' => true} as options hash
- Inherit from Thor to turn a class into an option mapper.
- Map additional non-valid identifiers to specific methods. In this case, convert -L to :list
- Describe the method immediately below. The first parameter is the usage information, and the second parameter is the description.
- Provide any additional options that will be available the instance method options.
## Types for method_options
- :boolean - is parsed as --option or --option=true
- :string - is parsed as --option=VALUE
- :numeric - is parsed as --option=N
- :array - is parsed as --option=one two three
- :hash - is parsed as --option=name:string age:integer
Besides, method_option allows a default value to be given. Examples:
method_options :force => false #=> Creates a boolean option with default value false method_options :alias => "bar" #=> Creates a string option with default value "bar" method_options :threshold => 3.0 #=> Creates a numeric option with default value 3.0
You can also supply :option => :required to mark an option as required. The type is assumed to be string. If you want a required hash with default values as option, you can use method_option which uses a more declarative style:
method_option :attributes, :type => :hash, :default => {}, :required => true
All arguments can be set to nil (except required arguments), by suppling a no or skip variant. For example:
thor app name --no-attributes
In previous versions, aliases for options were created automatically, but now they should be explicit. You can supply aliases in both short and declarative styles:
method_options %w( force -f ) => :boolean
Or:
method_option :force, :type => :boolean, :aliases => "-f"
You can supply as many aliases as you want.
NOTE: Type :optional available in Thor 0.9.0 was deprecated. Use :string or :boolean instead.
## Namespaces
By default, your Thor tasks are invoked using Ruby namespace. In the example above, tasks are invoked as:
thor app:install name --force
However, you could namespace your class as:
module Sinatra class App < Thor # tasks end end
And then you should invoke your tasks as:
thor sinatra:app:install name --force
If desired, you can change the namespace:
module Sinatra class App < Thor namespace :myapp # tasks end end
And then your tasks should be invoked as:
thor myapp:install name --force
## Invocations
Thor comes with a invocation-dependency system as well, which allows a task to be invoked only once. For example:
class Counter < Thor desc "one", "Prints 1, 2, 3" def one puts 1 invoke :two invoke :three end desc "two", "Prints 2, 3" def two puts 2 invoke :three end desc "three", "Prints 3" def three puts 3 end end
When invoking the task one:
thor counter:one
The output is “1 2 3”, which means that the three task was invoked only once. You can even invoke tasks from another class, so be sure to check the [documentation](rdoc.info/rdoc/wycats/thor/blob/f939a3e8a854616784cac1dcff04ef4f3ee5f7ff/Thor.html).
Notice invocations do not share the same object. I.e, Thor will instantiate Counter once to invoke the task one, then, it instantiates another to invoke the task two and another for task three. This happens to allow options and arguments to parsed again. For example, if two and three have different options and both of them were given to the command line, calling invoke makes them be parsed each time and used accordingly by each task.
## Thor::Group
Thor has a special class called Thor::Group. The main difference to Thor class is that it invokes all tasks at once. The example above could be rewritten in Thor::Group as this:
class Counter < Thor::Group desc "Prints 1, 2, 3" def one puts 1 end def two puts 2 end def three puts 3 end end
When invoked:
thor counter
It prints “1 2 3” as well. Notice you should describe (using the method desc) only the class and not each task anymore. Thor::Group is a great tool to create generators, since you can define several steps which are invoked in the order they are defined (Thor::Group is the tool use in generators in Rails 3.0).
Besides, Thor::Group can parse arguments and options as Thor tasks:
class Counter < Thor::Group # number will be available as attr_accessor argument :number, :type => :numeric, :desc => "The number to start counting" desc "Prints the 'number' given upto 'number+2'" def one puts number + 0 end def two puts number + 1 end def three puts number + 2 end end
The counter above expects one parameter and has the folling outputs:
thor counter 5 # Prints "5 6 7" thor counter 11 # Prints "11 12 13"
You can also give options to Thor::Group, but instead of using method_option and method_options, you should use class_option and class_options. Both argument and class_options methods are available to Thor class as well.
## Actions
Thor comes with several actions which helps with script and generator tasks. You might be familiar with them since some came from Rails Templates. They are: say, ask, yes?, no?, add_file, remove_file, copy_file, template, directory, inside, run, inject_into_file and a couple more.
To use them, you just need to include Thor::Actions in your Thor classes:
class App < Thor include Thor::Actions # tasks end
Some actions like copy file requires that a class method called source_root is defined in your class. This is the directory where your templates should be placed. Be sure to check the documentation on [actions](rdoc.info/rdoc/wycats/thor/blob/f939a3e8a854616784cac1dcff04ef4f3ee5f7ff/Thor/Actions.html).
## Generators
A great use for Thor is creating custom generators. Combining Thor::Group, Thor::Actions and ERB templates makes this very easy. Here is an example:
class Newgem < Thor::Group include Thor::Actions # Define arguments and options argument :name class_option :test_framework, :default => :test_unit def self.source_root File.dirname(__FILE__) end def create_lib_file template('templates/newgem.tt', "#{name}/lib/#{name}.rb") end def create_test_file test = options[:test_framework] == "rspec" ? :spec : :test create_file "#{name}/#{test}/#{name}_#{test}.rb" end def copy_licence if yes?("Use MIT license?") # Make a copy of the MITLICENSE file at the source root copy_file "MITLICENSE", "#{name}/MITLICENSE" else say "Shame on you…", :red end end end
Doing a thor -T will show how to run our generator. It should read: thor newgem NAME. This shows that we have to supply a NAME argument for our generator to run.
The create_lib_file uses an ERB template. This is what it looks like:
class <%= name.capitalize %> end
The arguments that you set in your generator will automatically be passed in when template gets called. Be sure to read the [documentation](rdoc.info/rdoc/wycats/thor/blob/f939a3e8a854616784cac1dcff04ef4f3ee5f7ff/Thor/Actions.html) for more options.
Running the generator with thor newgem devise will create two files: “devise/lib/devise.rb“, and “devise/test/devise_test.rb“. The user will then be asked (via a prompt by the yes? method) whether or not they would like to copy the MIT License. If you want to change the test framework, you can add the option: thor newgem devise --test-framework=rspec
This will generate two files - “devise/lib/devise.rb“ and “devise/spec/devise_spec.rb“.
## Further Reading
Thor offers many scripting possibilities beyond these examples. Be sure to read through the [documentation](rdoc.info/rdoc/wycats/thor/blob/f939a3e8a854616784cac1dcff04ef4f3ee5f7ff/Thor.html) and [specs](github.com/wycats/thor/tree/master/spec/) to get a better understanding of the options available.
## License
Released under the MIT License. See the LICENSE file for further details.


Instructions
Click on any shape to get the id and the coordinates of the hitting point.
Visible node
-1
1
Dynamic material update
Last clicked object:
-
created by Tony Nolan
Click on any shape to get the id and the coordinates of the hitting point.


assigned
by Kate Lynch at 2022-06-27 13:53:31.assigned
by Kate Lynch at 2022-06-27 13:51:12.closed
by Kate Lynch at 2022-06-27 19:04:57.assigned
by Kate Lynch at 2022-06-27 19:05:52.head_ref_force_pushed
by Max Kadel at 2022-06-27 17:33:21.deployed
by None at 2022-06-27 17:40:00.ready_for_review
by Max Kadel at 2022-06-27 17:42:36.After an enquiry from the Collections Coordinator, it was determined that not all of the items from these batches were uploaded. I am investigating this now.
A reimport has been scheduled for the batches, and the estimated delivery time is for the end of next week.
reopened
by James R. Griffin III at 2022-06-27 16:35:10.assigned
by Eliot Jordan at 2022-06-27 16:49:45.closed
by Eliot Jordan at 2022-06-27 18:28:48.closed
by Eliot Jordan at 2022-06-27 18:29:12.closed
by Eliot Jordan at 2022-06-27 18:29:19.closed
by Eliot Jordan at 2022-06-27 18:29:26.assigned
by Eliot Jordan at 2022-06-27 19:02:43.head_ref_force_pushed
by Eliot Jordan at 2022-06-27 19:05:40.Already fixed.
assigned
by Eliot Jordan at 2022-06-27 19:06:12.closed
by Eliot Jordan at 2022-06-27 19:09:41.This is not an upgrade issue. Behaves the same way in Prod.
assigned
by Eliot Jordan at 2022-06-27 19:09:52.unlabeled
by Eliot Jordan at 2022-06-27 19:36:39.If this is broken in prod, it is not related to the upgrade. Moving back to the inbox.
unlabeled
by Eliot Jordan at 2022-06-27 19:41:14.All of the QA tickets related to the show page have been closed.
closed
by Eliot Jordan at 2022-06-27 19:42:52.closed
by Eliot Jordan at 2022-06-27 19:44:38.head_ref_force_pushed
by Eliot Jordan at 2022-06-27 20:11:30.head_ref_force_pushed
by Eliot Jordan at 2022-06-27 20:47:37.head_ref_force_pushed
by Eliot Jordan at 2022-06-27 21:35:20.referenced
by Kevin Reiss at 2022-06-28 01:58:40.merged
by Kevin Reiss at 2022-06-28 01:58:40.closed
by Kevin Reiss at 2022-06-28 01:58:41.head_ref_deleted
by Kevin Reiss at 2022-06-28 01:58:41.Hannah and Yuan are working to get the Kanji translations needed for the areas missing Japanese language labels. These will be shared with RDSS so we can try to assist in getting one or two translations reviewed/accepted by the community. Additional instructional documentation should be made as a result.
The font has been applied and as far as I can tell appears to be rendering correctly - https://ojs-staging.princeton.edu/index.php/tj1/index
Custom font stylesheet created and versioned here - https://github.com/pulibrary/ojs_styles
I will be glad to walk through how I applied this with anyone who needs to know, @hhkitsune and Yuan!
mentioned
by Hannah H at 2022-06-27 18:38:42.subscribed
by Hannah H at 2022-06-27 18:38:42.assigned
by Kate Lynch at 2022-06-27 18:39:51.@carolyncole Thank you so much for this. I made a few changes to the PR so that it handles errors properly (the fancy .either
syntax was not really working) and added special clause to work in development without credentials. I deployed it to staging and it works OK.
Coveralls does not show any decrease in the test coverage (however, the API seems to be slow)
head_ref_force_pushed
by None at 2022-06-27 06:06:15.deployed
by None at 2022-06-27 18:37:25.ready_for_review
by Hector Correa at 2022-06-27 18:38:48.mentioned
by None at 2022-06-27 18:41:49.subscribed
by None at 2022-06-27 18:41:49.review_dismissed
by Hector Correa at 2022-06-27 18:51:53.referenced
by James R. Griffin III at 2022-06-27 19:14:42.merged
by James R. Griffin III at 2022-06-27 19:14:42.closed
by James R. Griffin III at 2022-06-27 19:14:42.head_ref_deleted
by James R. Griffin III at 2022-06-27 19:14:43.Closed by https://github.com/pulibrary/pdc_describe/pull/180
closed
by Hector Correa at 2022-06-27 19:23:59.assigned
by Hector Correa at 2022-06-27 19:36:59.@hectorcorrea --- For (10) ResourceType, we may need to discuss with the group on 7/8. We might not want the depositor to guess on what to enter for this field. For (10.1) resourceTypeGeneral, yes it should be a dropdown list. However, we might want to hide some of the choices that aren't deposit options for the research data repository. For example: Book, Book Chapter, Conference Proceeding, Dissertation, Journal, Journal Article, Peer Review, Preprint... possibly others, but let's ask the larger group.
10.1 resourceTypeGeneral should visibly appear under required for both depositor and admin/curators. 10 ResourceType I'm looking closer at and want more feedback from others (including you) if possible.
@hectorcorrea This documentation for creating a DOI via Fabrica/Datacite appears to show that only 10.1 resourceTypeGeneral is required on the form. See: https://support.datacite.org/docs/field-descriptions-for-form
Here are some examples of the XML code from the Datacite 4.4 help (note: I put weird spaces between characters, so Github wouldn't render to regular text.):
Example software: < resourceType resourceTypeGeneral ="Software" >Software < /resourceType >
Example a simple dataset: < resourceType resourceTypeGeneral = "Dataset" >Dataset < /resourceType >
Example for video as ResourceType: < resourceType resourceTypeGeneral = "Audiovisual" > narrated video
Example for a workflow ResourceType: < resourceType resourceTypeGeneral = "Workflow" > Software < /resourceType >
@hectorcorrea Looking at the examples for software and a simple dataset, we might simply duplicate what is chosen from the controlled list (10.1 resourceTypeGeneral) to the free text box (10 resourceType) and only let the admin/curator change the free text (10 resourceType), as may be needed in some cases. What do you think?
mentioned
by Hannah H at 2022-06-27 19:08:33.subscribed
by Hannah H at 2022-06-27 19:08:34.mentioned
by Hector Correa at 2022-06-27 19:56:01.subscribed
by Hector Correa at 2022-06-27 19:56:02.mentioned
by Hector Correa at 2022-06-27 20:04:30.subscribed
by Hector Correa at 2022-06-27 20:04:30.mentioned
by Hector Correa at 2022-06-27 20:22:05.subscribed
by Hector Correa at 2022-06-27 20:22:05.This does need to be required for our purposes, so ok to put in the required section. Otherwise users won't know the extent for which they may reuse the deposit.
Your list is good to start with. Creative Commons has more than one choice, so here are all of the CC licenses: - CC By - CC By-SA - CC By-NC - CC By-NC-SA - CC By-ND - CC By-NC-ND - CC0
I wonder if Creative Commons might be listed with these as subcategories and default to CC By 4.0 or CC0? This is another detail we can bring to the group.
head_ref_force_pushed
by None at 2022-06-27 05:14:35.referenced
by Hector Correa at 2022-06-27 13:23:05.merged
by Hector Correa at 2022-06-27 13:23:05.closed
by Hector Correa at 2022-06-27 13:23:06.head_ref_deleted
by Hector Correa at 2022-06-27 13:23:06.referenced
by Kevin Reiss at 2022-06-28 01:54:12.merged
by Kevin Reiss at 2022-06-28 01:54:12.closed
by Kevin Reiss at 2022-06-28 01:54:12.head_ref_deleted
by Kevin Reiss at 2022-06-28 01:54:13.Closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:42:30.Closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:42:57.Closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:43:39.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:43:50.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:44:01.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:44:09.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:44:17.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:44:28.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:44:55.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:45:02.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:45:08.Outdated, closing per discussion within IT
closed
by Kate Lynch at 2022-06-27 18:45:14.assigned
by Kate Lynch at 2022-06-27 19:55:13.referenced
by Kevin Reiss at 2022-06-28 01:56:12.merged
by Kevin Reiss at 2022-06-28 01:56:12.closed
by Kevin Reiss at 2022-06-28 01:56:12.head_ref_deleted
by Kevin Reiss at 2022-06-28 01:56:13.


logging.info("generating examples from = %s", filepath)
with tf.io.gfile.GFile(filepath) as f:
for line in f:
yield {
"text": line.strip(),
}
logging.info("generating examples from = %s", filepath)
with tf.io.gfile.GFile(filepath) as f:
for idx, line in enumerate(f):
records = {
"text": line.strip(),
}
yield idx, records


The worst tweets on Twitter
This project displays data visualizations about toxicity on Twitter for various high profile politicians. The data was collected using the Twitter Search API using the politician's first and last name and Twitter handles as search key words. In order to get information about the sentiment of the tweet, we used the Perspective API, an AI powered API used to detect abuse and harassment online. Perspective API has the ability to detect toxicity, identity attack, and sexually explicit attributes, defined below.
Toxicity: Rude, disrespectful, or unreasonable comment that is likely to make people leave a discussion.
Identity Attack: Negative or hateful comments targeting someone because of their identity.
Sexually Explicit: Contains references to sexual acts, body parts, or other lewd content.
Perspective API takes comment text as input and returns a "score" from 0 to 1 that indicates the probability that the comment is similar to toxic comments it's seen in the past. A score of 0 signifies 0% probability that the comment is toxic and a score of 1 signifies 100% probability that the comment is toxic.
It is important to note that there are known unintended biases within the Perspective API.


Apparently, I’m Jeff Atwood’s guest blogger today: Learn to Read the Source, Luke
Since I wrote the original Hacker News comment, I figured I might as well reproduce it in full here.
I started working with Microsoft platforms professionally at age 15 or so. I worked for Microsoft as a software developer doing integration work on Visual Studio. More than ten years after I first wrote a line of Visual Basic, I wish I could never link against a closed library ever again.
Using software is different than building software. When you’re using most software for its primary function, it’s a well worn path. Others have encountered the problems and enough people have spoken up to prompt the core contributors to correct the issue. But when you’re building software, you’re doing something new. And there are so many ways to do it, you’ll encounter unused bits, rusty corners, and unfinished experimental code paths. You’ll encounter edge cases that have been known to be broken, but were worked around.
Sometimes, the documentation isn’t complete. Sometimes, it’s wrong. The source code never lies. For an experienced developer, reading the source can often be faster… especially if you’re already familiar with the package’s architecture. I’m in a medium-sized co-working space with several startups. A lot of the other CTOs and engineers come to our team for guidance and advice on occasion. When people report a problem with their stack, the first question I ask them is: “Well, did you read the source code?”
I encourage developers to git clone anything and everything they depend on. Initially, they are all afraid. “That project is too big, I’ll never find it!” or “I’m not smart enough to understand it” or “That code is so ugly! I can’t stand to look at it”. But you don’t have to search the whole thing, you just need to follow the trail. And if you can’t understand the platform below you, how can you understand your own software? And most of the time, what inexperienced developers consider beautiful is superficial, and what they consider ugly, is battle-hardened production-ready code from master hackers. Now, a year or two later, I’ve had a couple of developers come up to me and thank me for forcing them to sink or swim in other people’s code bases. They are better at their craft and they wonder how they ever got anything done without the source code in the past.
 They care that your software is bugged. Everyone’s software becomes my software because all of their bugs are my bugs. When something goes wrong, you need to seek out what is broken, and you need to fix it. You fix it at the right spot in the stack to minimize risks, maintenance costs, and turnaround time. Sometimes, a quick workaround is best. Other times, you’ll need to recompile your compiler. Often, you can ask someone else to fix it upstream, but just as often, you’ll need to fix it yourself.
Closed-software shops have two choices: beg for generosity, or work around it. Open source shops with weaker developers tend to act the same as closed-software shops. Older shops tend to slowly build the muscles required to maintain their own forks and patches and whatnot. True hackers have come to terms with a simple fact: If it runs on my machine, it’s my software. I’m responsible for it. I must understand it. Building from source is the rule and not an exception. I must control my environment and I must control my dependencies.
After reproducing my comment, Jeff wrote:
Nobody reads other people’s code for fun. Hell, I don’t even like reading my own code. The idea that you’d settle down in a deep leather chair with your smoking jacket and a snifter of brandy for a fine evening of reading through someone else’s code is absurd.


×
Add New Request
{{pr_error}}
Request ID
Date
Location
Select Location
{{data.company_address}},{{data.city}}
Product Code
{{d.value}}
Product Name
Unit
Brand Name
Quantity
Required By Date
Type
Save
Update
×
{{title_text}}
×
{{heading_msg}}
{{check_approve_msg}}
Yes


#include "httpd.h"
Include dependency graph for uipopt.h:
This graph shows which files directly or indirectly include this file:
Defines | |
| #define | UIP_FIXEDADDR |
| Determines if uIP should use a fixed IP address or not. | |
| #define | UIP_PINGADDRCONF |
| Ping IP address asignment. | |
| #define | UIP_IPADDR0 |
| The first octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. | |
| #define | UIP_IPADDR1 |
| The second octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. | |
| #define | UIP_IPADDR2 |
| The third octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. | |
| #define | UIP_IPADDR3 |
| The fourth octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. | |
| #define | UIP_NETMASK0 |
| The first octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. | |
| #define | UIP_NETMASK1 |
| The second octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. | |
| #define | UIP_NETMASK2 |
| The third octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. | |
| #define | UIP_NETMASK3 |
| The fourth octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. | |
| #define | UIP_DRIPADDR0 |
| The first octet of the IP address of the default router, if UIP_FIXEDADDR is 1. | |
| #define | UIP_DRIPADDR1 |
| The second octet of the IP address of the default router, if UIP_FIXEDADDR is 1. | |
| #define | UIP_DRIPADDR2 |
| The third octet of the IP address of the default router, if UIP_FIXEDADDR is 1. | |
| #define | UIP_DRIPADDR3 |
| The fourth octet of the IP address of the default router, if UIP_FIXEDADDR is 1. | |
| #define | UIP_FIXEDETHADDR |
| Specifies if the uIP ARP module should be compiled with a fixed Ethernet MAC address or not. | |
| #define | UIP_ETHADDR0 |
| The first octet of the Ethernet address if UIP_FIXEDETHADDR is 1. | |
| #define | UIP_ETHADDR1 |
| The second octet of the Ethernet address if UIP_FIXEDETHADDR is 1. | |
| #define | UIP_ETHADDR2 |
| The third octet of the Ethernet address if UIP_FIXEDETHADDR is 1. | |
| #define | UIP_ETHADDR3 |
| The fourth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. | |
| #define | UIP_ETHADDR4 |
| The fifth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. | |
| #define | UIP_ETHADDR5 |
| The sixth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. | |
| #define | UIP_TTL 255 |
| The IP TTL (time to live) of IP packets sent by uIP. | |
| #define | UIP_REASSEMBLY |
| Turn on support for IP packet reassembly. | |
| #define | UIP_REASS_MAXAGE 40 |
| The maximum time an IP fragment should wait in the reassembly buffer before it is dropped. | |
| #define | UIP_UDP |
| Toggles wether UDP support should be compiled in or not. | |
| #define | UIP_UDP_CHECKSUMS |
| Toggles if UDP checksums should be used or not. | |
| #define | UIP_UDP_CONNS |
| The maximum amount of concurrent UDP connections. | |
| #define | UIP_UDP_APPCALL |
| The name of the function that should be called when UDP datagrams arrive. | |
| #define | UIP_ACTIVE_OPEN |
| Determines if support for opening connections from uIP should be compiled in. | |
| #define | UIP_CONNS |
| The maximum number of simultaneously open TCP connections. | |
| #define | UIP_LISTENPORTS |
| The maximum number of simultaneously listening TCP ports. | |
| #define | UIP_RECEIVE_WINDOW |
| The size of the advertised receiver's window. | |
| #define | UIP_URGDATA |
| Determines if support for TCP urgent data notification should be compiled in. | |
| #define | UIP_RTO 3 |
| The initial retransmission timeout counted in timer pulses. | |
| #define | UIP_MAXRTX 8 |
| The maximum number of times a segment should be retransmitted before the connection should be aborted. | |
| #define | UIP_MAXSYNRTX 3 |
| The maximum number of times a SYN segment should be retransmitted before a connection request should be deemed to have been unsuccessful. | |
| #define | UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - 40) |
| The TCP maximum segment size. | |
| #define | UIP_TIME_WAIT_TIMEOUT 120 |
| How long a connection should stay in the TIME_WAIT state. | |
| #define | UIP_ARPTAB_SIZE |
| The size of the ARP table. | |
| #define | UIP_ARP_MAXAGE 120 |
| The maxium age of ARP table entries measured in 10ths of seconds. | |
| #define | UIP_BUFSIZE |
| The size of the uIP packet buffer. | |
| #define | UIP_STATISTICS |
| Determines if statistics support should be compiled in. | |
| #define | UIP_LOGGING |
| Determines if logging of certain events should be compiled in. | |
| #define | UIP_LLH_LEN |
| The link level header length. | |
| #define | BYTE_ORDER |
| The byte order of the CPU architecture on which uIP is to be run. | |
Typedefs | |
| typedef unsigned char | u8_t |
| The 8-bit unsigned data type. | |
| typedef unsigned short | u16_t |
| The 16-bit unsigned data type. | |
| typedef unsigned short | uip_stats_t |
| The statistics data type. | |
Functions | |
| void | uip_log (char *msg) |
| Print out a uIP log message. |


Tutorials¶
The following tutorials are quantitative risk methods with the least amount of rigor.
All risk measurement must start somewhere, and this tutorial represents the earliest examples of scenario measurement. (See Scenarios)
These example scenarios and their forecasts are similar to using your shoe to measure “one foot”. Low rigor measurements are still useful for day to day, “back of envelope” risk modeling with low cost and effort. They can easily be expanded upon as requirements demand more rigor. (See Rigor)
Risk Analysis¶
In this example, we are concerned with a single risk. First, we develop a scenario.
- Scenario
- A bank robber threatens a teller next quarter.
- Outcome
% Likelihood of Yes / No:
This meets the criteria of a scenario by including an observable event (“A bank robber threatens a teller”), and includes a specific timeframe (“Next Quarter”). Without either of these, we lose our ability to quantify risk.
The observable judgment criteria could be established by bank’s security team declaring the incident, or maybe the creation of a police report. We would just need to trust that our criteria would offer us a stable, observable event.
- Forecast
- The forecaster who is asked to measure the risk would estimates a likelihood to “Yes” or “No”. (See: Forecasting)
As an example, we’ll say that the forecaster believes that “Yes” has a likelihood of 5%
, which would estimate an occurrence of every five years.
This documentation does not dictate how they arrive at an estimation of 5%
, but we could assume that perhaps they are drawing upon experience, perhaps have law enforcement or industry data, or maybe are comparing to how often any crime at all happens at the bank, and further specifying from there. If the rigor of this information gathering needed to be improved, requirements could be added to the process. (See: Rigor)
That is an example of risk analysis done quickly and simply.
Risk Assessment¶
In this example, we are concerned with gathering, and comparing more than one risk.
In our example, let’s say that a CEO has asked us to assess the risks that they will become infected with a virus on their laptop. For sake of an example, let’s say that after extensive brainstorming, we came up with only two possible scenarios.
We develop two scenarios:
- Scenario A
- A malicious insider employee infects our CEO’s laptop with a virus next quarter.
- Scenario B
- A malicious website infects our CEO’s laptop with a virus next quarter.
- Outcome (A, B)
% Likelihood of Yes / No:
We have two scenarios with similar outcomes (The CEO gets a virus), but differing threats (A malicious insider or a malicious website). Both share a similar timeframe.
We would perform a Risk Analysis on both of these scenarios. Given that they are similar, a forecaster would likely rely on some useful data that informs both forecasts.
As an example, let’s say the forecaster believes that Scenario A has a “Yes” likelihood of 1%
(and “No” of 99%
), while Scenario B has a likelihood of Yes of 35%
(and “No” of 65%
).
Those likelihoods, would indicate that the forecaster believes Scenario B (a malicious website) to occur a bit more than annually (every 2.8 quarters), while an insider employee would occur once every twenty five years (every 100 quarters).
Under the assumption that the “virus” is equally bad in both cases, we can numerically compare both of these risks, and focus efforts on the more likely scenario.
Risk Management¶
In this example we are concerned with mitigating our risks over time, with our efforts and resources.
Let’s use our first scenario from Risk Analysis again. In that example, our forecaster assigned a 5% likelihood to the following scenario:
- Scenario
- A bank robber threatens a teller next quarter.
- Outcome
% Likelihood of Yes / No:
Yes 5%
Imagine if the bank wasn’t OK with this level of risk to their employees, and decided to invest in a mitigation, like an armed guard near the tellers. Maybe they make this decision because other banks in the area don’t have an armed guard, making the guarded bank the least attractive target.
Assume that this information is valuable to the forecaster. Given that no other substantial information has changed regarding the risk, they would forecast again next quarter, let’s say at 3%, a reduction of 2% from the original 5%.
If these assumptions weren’t correct, and for some reason this mitigation increased risks in the mind of the forecaster, then it would reflect itself with an increasing likelihood in the measurement.


| Overview | Module | Use | Devguide | Index |
| uses of interface XWindowPeer |
back to interface XWindowPeer |
| Derived Interfaces |
XVclWindowPeer |
| Uses as Return Type |
| XSystemChildFactory::createSystemChild() XToolkit::createWindow() XToolkit::getDesktopWindow() XControl::getPeer() |
| Uses as Parameter |
| XContainerWindowProvider::createContainerWindow() ::com::sun::star::embed::XHatchWindowFactory::createHatchWindowInstance() XMessageBoxFactory::createMessageBox() XControl::createPeer() ::com::sun::star::plugin::XPluginManager::createPluginFromURL() XPopupMenu::execute() XVclWindowPeer::isChild() |
| Uses as Data Type |
| WindowDescriptor::Parent |
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


228P is a moving object from K2 campaign 12. You can read more information about this object at the JPL Small-Body Database Browser here. Data was taken from 15 December 2016 to 17 February 2017.
228P was proposed for by Golden in GO12033. If you use this data, please cite their proposal. You can find the bibtex citation by clicking the button below.
@ARTICLE{asteriks,
author = {{Hedges}, C. and Co},
title = "{}",
journal = {},
archivePrefix = "arXiv",
eprint = {},
primaryClass = "",
keywords = {},
year = ,
month = ,
volume = ,
pages = {},
doi = {},
adsurl = {},
}
@MISC{2016ktwo.propGO12033,
author = {{Golden}, G.},
title = {Serendipitous Observations of Short Period Comets by K2},
abstract = {Despite the detection and orbital characterization of several hu
ndred short period comets to date, only a very small number have
had their rotational properties fully determined. This is princ
ipally a consequence of their intrinsic faintness for the majori
ty of their orbits, and the acute difficulty in securing long ba
seline and consistently accurate observations on the largest of
ground based optical/IR telescopes to sufficiently sample ~ 4 to
40 hour periods (the approximate range of the currently known s
ample for which rotational data exists). The K2 mission however
offers an ideal platform to study any sufficiently bright short
period comets that serendipitously pass through each of the plan
ned Cycle 4 Campaign fields - K2's unparalleled photometric sens
itivity combined with its ~ 70 day observational baseline repres
ents a unique observational opportunity to study these mysteriou
s and compelling objects. Using both the K2ephem tool and JPL's
HORIZON facility, we identified 15 short period comets that pass
within the campaign fields with predicted magnitudes < 22 -
13 are Jupiter Family Comets (JFC), one is a Main Belt Comet (MB
C) and one is a Centaur. Of the 11 located > 3 AU (including
the MBC/`active asteroid' 176P/LINEAR), K2's precision photomet
ry will allow us to accurately characterize their nucleus rotati
on periods. For the remaining 4 comets within 3 AU that are expe
cted to be active, full coverage of their passage across K2's fi
eld of view will yield a unique temporal profile of nucleus acti
vity, in addition to a rotational period. These data will be imm
ediately pertinent to our understanding of cometary nucleus dens
ity and structure (of great relevance in the assessment of viabl
e NEO mitigation strategies), the relationship between rotation
& activity, links between JFCs and Kuiper Belt Objects and t
heir formation, and complement extensive campaigns to date to st
udy size, albedo and color properties. Furthermore, accurate spi
n state data could be used in the selection and subsequent plann
ing of any future NASA missions to these 'time capsules' of the
early solar system.}
howpublished = {K2 Proposal},
year = {2016},
month = {Februrary},
url = {https://keplerscience.arc.nasa.gov/data/k2-programs/GO12033.txt},
notes = {K2 Proposal GO12033}
}
Acknowledgement:
This work uses...
If only want the light curve of the object with the optimal aperture, download this product. This will give you one .fits file with several extensions. The first extension is the optimal apertures determined for this target. Further extensions contain a range of aperture sizes. You can read more in our readme.
Our code asteriks creates Moving Target Pixel Files, which are similar to Kepler/K2 TPFs, and contain stacks of images from the telescope. Moving TPFs track the motion of solar system objects, so that they are always centered in every image. Moving TPFs are background subtracted. The movie above shows a Moving TPF with background subtraction on the right.
You can run our code asteriks to regenerate any of these light curves yourself, or generate light curves of other objects. You can read more about our code at our GitHub Page and you can read more about how the code works in our recent paper


August 2022
Laravel v8.0 was the most popular version in August 2022. It has been downloaded 2'079'697 times. That's 40.5% of all downloads!
In total, Laravel has been downloaded 5'132'112 times this month.
How are these numbers calculated?Laravel v8.0 was the most popular version in August 2022. It has been downloaded 2'079'697 times. That's 40.5% of all downloads!
In total, Laravel has been downloaded 5'132'112 times this month.
How are these numbers calculated?


Over this summer, I worked for a small games company based in Bristol - where I also attend University (or will be for the next year anyway).
To put it briefly, it was tremendous fun.
It wasn’t my first taste of game development - I made small games in Flash as a youngster and I developed a game with five others last year as part of my Computer Science course. But this was my first professional experience. Last year wasn’t that fun. In fact, it was downright frustrating at times. An unbalanced team made it more of an exercise of politics than progress - but it was character building, and it taught me a lot about how to be adaptive in the face of constant setbacks. My hard work paid off in the end.
Working for a real company with real professionals, it gets better. As the intern, I started as the weakest link in the chain - and if you’re willing to learn then that’s the best position to be in. I’ve learned a considerable amount about developing in a small team, managing responsibility and thinking ahead - skills that would have come in incredibly handy during last year’s game development project. That said, this job would not have been possible without the skills I scratched together during that project - so it’s all rather cyclic.
There’s a lot more to developing a small game than meets the eye. You see a simple game on the internet and you think “yeah, that’s easy, I can knock that up in an afternoon”. But you can’t. Behind that small game there is a developer, an artist, a composer, and sometimes more than one of each. It is possible to make a game by yourself - but it takes serious time. And while a game may look simple, it has taken a long time to iron out the things that make a game seem complex and counter-intuitive, and to keep the vital components that make for a positive experience.
Games aren’t just faceless pieces of software. I don’t know of any other form of media where different disciplines are combined together quite so perfectly. Raw creativity and complex technicality. It has to run efficiently and look good, but more importantly it has to play positively on the emotions of human beings. This requirement doesn’t really apply to other areas of software - I don’t value a particular office application for its ability to take me on an emotional rollercoaster.
All in all, my parting word is that a stint working in game development, or even a bit of brief experimentation, is strongly recommended. I gained a lot of useful experience, kept my mind sharp for the start of my fourth and final University year, and met some great people along the way.


Preparation time
1-2 hours
Cooking time
30 mins to 1 hour
Serves
Makes 1 medium loaf and 6 bread rolls
Dietary
This easy white dough splits to make a delicious white loaf and six bread rolls packed with rosemary and chunks of goats’ cheese.
Equipment and preparation: you will need a 23x13 x7cm/9x5x2¾in loaf tin.
Mix the flour, yeast and salt in a large mixing bowl. Measure out 700ml/1¼ pints of water.
Add almost all the water and mix to a sticky dough.
Continue to mix for a further minute or so - the dough will gradually become less sticky. Add a touch more flour or water until you are left with a dough that is soft and springy, yet slightly sticky to the touch.
Flour a large work surface and gently knead the dough for 10 minutes without treating it aggressively. It should feel soft, smooth, light and springy.
Place the dough in a clean bowl, cover it with cling film and leave it to prove for an hour in a warm place.
When the dough has doubled in size, tip it back onto a floured surface. Knead it again for 30 seconds.
Cut the dough in half.
Lay one half of the dough into the base of the loaf tin. Leave in a warm place under a tea towel for 45 minutes, or until it has risen to generously fill the tin.
For the rolls, work the rosemary and cheese into the second piece of dough so that they are evenly distributed.
Cut the dough into six and shape into small rolls.
Lay the rolls on a floured baking tray, leaving a good amount of space between them.
Decorate each roll with a few rosemary needles on top.
Leave to rise in a warm place under a tea towel for 45 minutes.
Preheat the oven to 220C/425F/Gas 7.
Bake all the dough together for 30 minutes, or until risen and golden-brown. Turn onto a wire rack to cool.


1. Highlighted quotes from the first pages
"Making your code readable is as important as making it executable."
"Neither architecture nor clean code insist on perfection, only honesty and doing the best we can.
To err is human; to forgive, divine."
"Learning to write clean code is hard work.
It requires more than just the knowledge of principles and patterns. You must swear over it.
You must practice it yourself, and watch yourself fail. You must watch others practice it and fail."
"Most managers want good code, even when they are obsessing about the schedule.
They may defend the schedule and requirements with passion; but that's their job.
It's your job to defend the code with equal passion."
"The only way to make the deadline - the only way to go fast - is to keep the code as clean as possible at all times."
"The bad news is that writing clean code is a lot like painting a picture.
Most of us know when a picture is painted well or badly.
But being able to recognize good art from bad does not mean that we know how to paint.
So too being able to recognize clean code from dirty does not mean that we know how to write clean code!"
"Bad code tempts the mess to grow!"
"Clean code is focused. Each function, each class, each module exposes a single-minded attitude that remains entirely
undistracted, and unpolluted, by the surrounding details."
"Like a good novel, clean code should clearly expose the tensions in the problem to be solved.
It should build those tensions to a climax and then give the reader that "Aha! Of course!" as the issues and tensions are
resolved in the revelation of an obvious solution."
"Code, without tests, is not clean. No matter how elegant it is, no matter how readable and accessible,
if it hath not tests, it be unclean."
"Clean code is code that has been taken care of. Someone has taken the time to keep it simple and orderly.
They have paid appropriate attention to details. They have cared."
"Reduced duplication, high expressiveness, and early building of simple abstractions. That's what makes clean code for me."
"It is not the language that makes programs appear simple. It is the programmer that make the language appear simple!"
"Indeed, the ratio of time spent reading vs. writing is well over 10:1.
We are constantly reading old code as part of the effort to write new code."


This is my experience with Datura...It is defeantly not a pleasent one. In one in which i will turn you away from using this drug. It all started one day when my friend Jon moved back from Las Vegas with a trash bag full of this stuff. The fruit or what ever you would call it, was the size of a baseball. We didn't really know what part of the plant would be the most affective in making the utterly disgusting tea,so we split open the fruit and seeds and boiled it ALL.
After ten minutes we poured the tea into a 42 oz. cup, we split it in half. We sat down on the couch with no idea what this tea was about to do to us. (11:30 p.m) 15 minutes after drinking the tea we began to feel very drunk and my guitar sounded very unusual. Jon started laughing uncontrolably and kept insisting that he need to take a piss. When i told him to take a piss, he pissed on my bathroom floor i then realized i had gotten myself into something i wouldn't want anybody else to experience *EVER*!!!!!!!!!!
 I told her that we had drank some tea and Jon is hallucinating and we need to take him home. We drove 50 Miles and the whole time Jon was trying to jump out of the car. He had removed the head rests from the seats and tried to throw them out the window.
 When we arrived, I could not explain to my grandmother where he lived. We turned around and headed back to my granmother's house. On the way we dropped Jon off at a friends house because my grandmother could NOT handle us both at the same time. (6:00 a.m) This is about the time i could not distinguish my imaginary friends from real people. I began to talk to people that weren't there the entire following day. The fact that they would talk to me for 5 minutes and then dissapear was not unusual for me. I sat on my bed for hours when i finally got up, i asked my grandmother how long i had been sleeping????
Meanwhile Jon had escaped. He went to the neighbors house, walked in and turned their T.V. on and began to dance. The cops arrived...They asked him what his name was. He said 'Jon' They proceeded to ask questions...'Where do you live?' His response 'Everywhere.' By that time my friend had begged the police to let him go and not press the issue. The police told my friend if they ever saw him in town again he would be 'ARRESTED' for sure. If your cup of tea is to: black out for several hours, hang out with your imaginary friends for 2 days, your pupils dialated for 3 days...very painful...i still suggest NEVER TO DRINK OR EAT ANYTHING THAT HAS TO DO WITH THIS PLANT....YOUR IMAGINARY FRIENDS MAY NOT ALWAYS BE NICE..... but i must say the most interesting thing about my experience was the fact that the people i was seeing and dissapearing was not unusual to me whatsoever. If you have any questions feel free to email me and i can explain it in more detail....
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Personal projects Basic Unit converter
Project Description
I made this app to help me learn how to use web based lanuages like HTML, CSS and JavaScript to quicky make mobile apps using Apache Cordova. This is a simple app that allows you to convert some common units of measurement to other related forms of measurement.
This project took me three days to complete. The hardest part was making the Units Of Imformation Calculator because it basically required a lot of repitition that I could not find an easy way to get round.
More info and Screen shots on Google Play
Project Details
- Languages
- HTML
- CSS
- JavaScript
- Made with the Apache Cordova framework.
- Platforms:
- Android


[gecode-users] Cloning problems
Filip Konvička
filip.konvicka at logis.cz
Fri Feb 13 13:01:37 CET 2009
Hi,
first, thanks for the thorough explanation!
> Before I start with rambling about cloning, a tip:
> Gecode supports unary branchings (with a single alternatiuve only). So you
> could have a unary branching and don't have to have a mock-up empty branch.
> The search engines even optimize that case. If you are looking for an
> example, check the assign function in gecode/int.hh for assigning variables.
>
We know about this (and use it for our own "assignment" branchings), but
I don't see how this applies to our case? Clearly if the first
alternative fails and we need to go on without that commit, we need
another branch...? I'm sure we could do it all just manually without any
branching or search engine, but this allowed us to test it with the DFS
engine and compare to ours.
> In VarImp<VIC>::enter, the --idx[0] makes room for an additional entry. Then
> you keep moving actors to a free entry and by this create a new free entry
> for the propagation condition i. When the loop is done, you know that there
> is a free entry for propagation condition pc and that's where the propagator
> is entered.
>
I see - seems like I misinterpreted the loop statement... too many *s
and &s for one day, I guess :-)
> Let me come up with some idea where the trouble could be:
> - you forget to update a variable or view at some place. Either in your
> branching, propagator, or model.
> Then you can see an invalid pointer in the dependency array.
> You might want to change the default constructor of VarBase in
> gecode/kernel/var.icc and the default constructor
> of VarViewBase in gecode/kernel/view.icc so that they set varimp to NULL
> (actually, I just did that yesterday in the trunk as well). Then you will be
> sure that when you forget to update, you'll see a NULL pointer.
>
Well, I checked that once again now (we've done that at least ten times
in the last week :-)). I re-checked how the propagators
subscribe/update/cancel, it is consistent with the IntVar propagators
(BTW, in ReLinBin<Val,A,B,pc,Ctrl> in int-bin.hpp, you subscribe with
PC_INT_VAL and cancel with PC_BOOL_VAL). The branching does not need any
views or anything (it talks to the space directly via a static_cast).
> - you commit a heinous crime in that you change the dependencies of a
> variable with cancel/subscribe during
> cloning. That is illegal and will for sure break everything. Note that
> creating a propagator during
> cloning will commit that crime, too.
>
We're not trying to do anything illegal :-) Even if we did that, I'm
sure that the other testcases would fail too. But it's just those few :-)
> Hope that helps. Please do not hesitate to ask some more
>
Yes it does, big thanks for the overview! We'll let you know (soon, I
hope...)
Have a nice weekend,
Filip
More information about the gecode-users
mailing list


{% extends 'admin/master.html' %}
{% block body %}
Usage manual
Define a cluster in Cluster tab.
Add some nodes to cluster in Node tab. You will need at least one node with etcd server (three
for fault tolerance), one k8s master (two for HA) and one k8s schedulable node. For testing purposes
this can be a single node.
Add a user with system:masters group and download generated kubeconfig.
Configure your cluster servers for iPXE boot with this script:


Remember to backup your private bookmarks once in a while. You can export a backup from the options page. (tap to close)
Oops! There was an error. You can help by
reporting it
Private Bookmarks is still in early development. Sorry for the inconvenience.
Choose a password
Must be 8 – 128 characters long containing at least one letter and one number.
Allowed characters
Confirm
Cancel
Confirm
Cancel
Lock
Unlock
Change password


---
layout: default
area: research
---
Interests
Image processing and analysis, machine learning, computer aided medicine, software
Journal articles
- Andrey Fedorov, Matthew Hancock, David Clunie, Mathias Brochhausen, Jonathan Bona, Justin Kirby, John Freymann, Steve Pieper, Hugo J.W.L. Aerts, Ron Kikinis, Fred Prior. DICOM Re-encoding of Volumetrically Annotated Lung Imaging Data Consortium (LIDC) Nodules. Medical Physics. Aug. 2020. https://doi.org/10.1002/mp.14445
- Matthew C. Hancock, Jerry F. Magnan. Lung nodule malignancy classification using only radiologist quantified image features as inputs to statistical learning algorithms: probing the Lung Image Database Consortium dataset with two statistical learning methods. SPIE Journal of Medical Imaging. Dec. 2016. http://dx.doi.org/10.1117/1.JMI.3.4.044504 - [PDF] - (fine print)
Conference proceedings
- Matthew C. Hancock, Jerry F. Magnan. Predictive capabilities of statistical learning methods for lung nodule malignancy classification using diagnostic image features: an investigation using the Lung Image Database Consortium dataset. SPIE Medical Imaging Symposium, Computer-Aided Diagnosis Conference. Feb 2017. http://dx.doi.org/10.1117/12.2254446 - [PDF] - (fine print)
Pre-prints
- Matthew C. Hancock, Jerry F. Magnan. 2019. Lung nodule segmentation via level set machine learning. arXiv. https://arxiv.org/abs/1910.03191
- Fedorov A, Hancock M, Clunie D, Brochhausen M, Bona J, Kirby J, Freymann J, Pieper S, Aerts H, Kikinis R, Prior F. 2019. Standardized representation of the LIDC annotations using DICOM. PeerJ Preprints 7:e27378v2 doi.org/10.7287/peerj.preprints.27378v2
Slides
Posters
- Matthew C. Hancock, Jerry F. Magnan. Lung nodule malignancy classification using diagnostic image features. SIAM SEAS Conference Spring 2017 - [PDF]


Memory locality and JS performance
Memory locality and JS performance
Nicolas Silva, WebGL Paris, 2014
Before we get to the fun stuff
- I am about to talk about stuff that doesn't usually matter to most programs
- but typically becomes a big deal for some specific types of apps (graphics-heavy/interactive apps, games).
- Don't fix what's not broken!
Let's add particles to our game
- (A) lots of arithmetic operations
- (B) JS is interpreted and therefore it is slow
- (C) The memory access patterns
- (D) The answer D
(A) lots of arithmetic operations
- No! This is *really* cheap.
(B) JS is interpreted and therefore it is slow
- No! This code is easy to optimize for the JIT
- (C) The memory access patterns
(D) The answer D
- In JS, does it really matter?
- Yes, for "processing" tasks like game physics or simulations
- What about WebGL?
- Yes, memory accesses = big deal for the GPU
How much control do I have over memory in JS?
- Generally, not much
- Typed arrays
- Know your target platform (and be nice to the JIT)
Accessing memory - cpu cache
- Memory is placed in the cache in "blocks".
- CPUs are good at predicting regular access patterns, and prefetching data ahead of time.
- Group the data that you access together.
- Avoid random access, favor linear access.
- Header pointing to a contiguous sequence of 64bit elements.
- Sometimes small vectors (< ~12-16 elts) are inlined next to the header.
- Typed arrays are somewhat similar (and typed \o/).
JS Objects in memory (JIT)
- Structure containing a the members and a reference to the "shape".
- The shape contains information such as the offset of members in the structure.
- Lots of data scattered around memory :(
Particles packed into arrays
- No objects, just data.
- Much faster than the previous slide.
- Separated or interleaved? depends on what you do with the data.
- Prefer typed arrays over [] for large arrays
- Currently, typed arrays are good for large amounts of data but not for smaller quantities (don't store many small xyz vectors in their own Float32Arrays).
- Don't store different types in the same array
- Access the elements sequentially, in order
To illustrate access patterns
- Iterate over the indirection table to process particles.
- The first table is sorted while the second is shuffled.
- How much faster is the sorted table?
Memory access matters a lot to the GPU
- Thankfully, GPU rendering APIs are designed to avoid poor object-oriented data representation.
- Vertex data is batched into buffers of contiguous memory.
- Textures are Tiled and swizzled to maximize cache locality in 2D.
- Done by the GPU/driver internally.
- Texture samples are coherent in 2D, not just within rows.
- Precompute smaller versions of the texture.
- Improves the likelyhood that neighboring on screen pixels will fetch from neighboring texels.
- More of the texture fits in the cache for small/far objects.
- The way vertices are packed into VBOs affect performance the same way it affects performance on the CPU.
- The GPU can cache the result of the vertex shader and avoid recomputing an index that comes several times if the result is still in the cache.
- Prefer grouping vertex attributes into the same vbo.
- Keep attributes that change often (if any) in a separate vbo.
- Don't forget that they run a LOT of times per frame!
- It's great when the entire shader fits in the instruction cache.
- Otherwise, loads of cache-misses as the shader is run many times.
- As JIT compilers improve and the generated code becomes closer to what one can write in C++, cache effects will become more and more important.
- Currently there is still some VM overhead which hides cache latency in some cases.
- Moving garbage collectors have the potential to automatically keep hot data together, to some extent.
- Embrace data-oriented design.
A few links:
Nicolas Silva, WebGL Paris, 2014


runtime.mheap.spanalloc (field)
9 uses
runtime (current package)
metrics.go#L374: a.mSpanInUse = uint64(mheap_.spanalloc.inuse)
mheap.go#L211: spanalloc fixalloc // allocator for span*
mheap.go#L705: h.spanalloc.init(unsafe.Sizeof(mspan{}), recordspan, unsafe.Pointer(h), &memstats.mspan_sys)
mheap.go#L718: h.spanalloc.zero = false
mheap.go#L1066: return (*mspan)(h.spanalloc.alloc())
mheap.go#L1072: pp.mspancache.buf[i] = (*mspan)(h.spanalloc.alloc())
mheap.go#L1104: h.spanalloc.free(unsafe.Pointer(s))
mstats.go#L613: memstats.mspan_inuse = uint64(mheap_.spanalloc.inuse)
proc.go#L4734: mheap_.spanalloc.free(unsafe.Pointer(pp.mspancache.buf[i]))
The pages are generated with Golds v0.2.7-preview. (GOOS=darwin GOARCH=amd64)


Woman arrested for strangling baby, stabbing child's mother with screwdriver in Malaysia
KUALA LUMPUR: A woman has been arrested after reportedly strangling a three-month-old baby and stabbing the child's mother in the head with a screwdriver, leaving her in a coma.
The incident took place at the victims’ apartment in Batu Caves in Selangor at 7am on Nov 14, police said on Thursday.
Selangor Criminal Investigations Department chief Fadzil Ahmat said the suspect had allegedly attacked the 42-year-old mother, stabbing her with a screwdriver after accusing her of having a relationship with her husband.
The victim was found in critical condition, with stab wounds on her head.
The baby, believed to have been strangled, was found unconscious.
“They were rushed to the Selayang Hospital, where the baby died five days later,” Fadzil told reporters on Thursday.
The child’s mother is still in a coma, he added.
A married couple, aged 27 and 25, and their 19-year-old maid have also been detained. They have been placed under remand until Sunday to facilitate further investigations.
The case is being investigated under Section 302 of the Penal Code for murder.


|
M480 BSP V3.05.005
The Board Support Package for M480 Series
|
Macros | |
| #define | UI2C_SET_CONTROL_REG(ui2c, u8Ctrl) |
| This macro sets the USCI_I2C protocol control register at one time. More... | |
| #define | UI2C_START(ui2c) |
| This macro only set START bit to protocol control register of USCI_I2C module. More... | |
| #define | UI2C_STOP(ui2c) |
| This macro only set STOP bit to the control register of USCI_I2C module. More... | |
| #define | UI2C_GET_DATA(ui2c) |
| This macro returns the data stored in data register of USCI_I2C module. More... | |
| #define | UI2C_SET_DATA(ui2c, u8Data) |
| This macro writes the data to data register of USCI_I2C module. More... | |
| #define | UI2C_GET_TIMEOUT_FLAG(ui2c) |
| This macro returns time-out flag. More... | |
| #define | UI2C_GET_WAKEUP_FLAG(ui2c) |
| This macro returns wake-up flag. More... | |
| #define | UI2C_CLR_WAKEUP_FLAG(ui2c) |
| This macro is used to clear USCI_I2C wake-up flag. More... | |
| #define | UI2C_DISABLE_10BIT_ADDR_MODE(ui2c) |
| This macro disables the USCI_I2C 10-bit address mode. More... | |
| #define | UI2C_ENABLE_10BIT_ADDR_MODE(ui2c) |
| This macro enables the 10-bit address mode. More... | |
| #define | UI2C_GET_PROT_STATUS(ui2c) |
| This macro gets USCI_I2C protocol interrupt flag or bus status. More... | |
| #define | UI2C_CLR_PROT_INT_FLAG(ui2c, u32IntTypeFlag) |
| This macro clears specified protocol interrupt flag. More... | |
| #define | UI2C_ENABLE_PROT_INT(ui2c, u32IntSel) |
| This macro enables specified protocol interrupt. More... | |
| #define | UI2C_DISABLE_PROT_INT(ui2c, u32IntSel) |
| This macro disables specified protocol interrupt. More... | |
Functions | |
| uint32_t | UI2C_Open (UI2C_T *ui2c, uint32_t u32BusClock) |
| This function makes USCI_I2C module be ready and set the wanted bus clock. More... | |
| void | UI2C_Close (UI2C_T *ui2c) |
| This function closes the USCI_I2C module. More... | |
| void | UI2C_ClearTimeoutFlag (UI2C_T *ui2c) |
| This function clears the time-out flag. More... | |
| void | UI2C_Trigger (UI2C_T *ui2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Ptrg, uint8_t u8Ack) |
| This function sets the control bit of the USCI_I2C module. More... | |
| void | UI2C_DisableInt (UI2C_T *ui2c, uint32_t u32Mask) |
| This function disables the interrupt of USCI_I2C module. More... | |
| void | UI2C_EnableInt (UI2C_T *ui2c, uint32_t u32Mask) |
| This function enables the interrupt of USCI_I2C module. More... | |
| uint32_t | UI2C_GetBusClockFreq (UI2C_T *ui2c) |
| This function returns the real bus clock of USCI_I2C module. More... | |
| uint32_t | UI2C_SetBusClockFreq (UI2C_T *ui2c, uint32_t u32BusClock) |
| This function sets bus clock frequency of USCI_I2C module. More... | |
| uint32_t | UI2C_GetIntFlag (UI2C_T *ui2c, uint32_t u32Mask) |
| This function gets the interrupt flag of USCI_I2C module. More... | |
| void | UI2C_ClearIntFlag (UI2C_T *ui2c, uint32_t u32Mask) |
| This function clears the interrupt flag of USCI_I2C module. More... | |
| uint32_t | UI2C_GetData (UI2C_T *ui2c) |
| This function returns the data stored in data register of USCI_I2C module. More... | |
| void | UI2C_SetData (UI2C_T *ui2c, uint8_t u8Data) |
| This function writes a byte data to data register of USCI_I2C module. More... | |
| void | UI2C_SetSlaveAddr (UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode) |
| Configure slave address and enable GC mode. More... | |
| void | UI2C_SetSlaveAddrMask (UI2C_T *ui2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask) |
| Configure the mask bit of slave address. More... | |
| void | UI2C_EnableTimeout (UI2C_T *ui2c, uint32_t u32TimeoutCnt) |
| This function enables time-out function and configures timeout counter. More... | |
| void | UI2C_DisableTimeout (UI2C_T *ui2c) |
| This function disables time-out function. More... | |
| void | UI2C_EnableWakeup (UI2C_T *ui2c, uint8_t u8WakeupMode) |
| This function enables the wakeup function of USCI_I2C module. More... | |
| void | UI2C_DisableWakeup (UI2C_T *ui2c) |
| This function disables the wakeup function of USCI_I2C module. More... | |
| uint8_t | UI2C_WriteByte (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t data) |
| Write a byte to Slave. More... | |
| uint32_t | UI2C_WriteMultiBytes (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *data, uint32_t u32wLen) |
| Write multi bytes to Slave. More... | |
| uint8_t | UI2C_WriteByteOneReg (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) |
| Specify a byte register address and write a byte to Slave. More... | |
| uint32_t | UI2C_WriteMultiBytesOneReg (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *data, uint32_t u32wLen) |
| Specify a byte register address and write multi bytes to Slave. More... | |
| uint8_t | UI2C_WriteByteTwoRegs (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) |
| Specify two bytes register address and Write a byte to Slave. More... | |
| uint32_t | UI2C_WriteMultiBytesTwoRegs (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *data, uint32_t u32wLen) |
| Specify two bytes register address and write multi bytes to Slave. More... | |
| uint8_t | UI2C_ReadByte (UI2C_T *ui2c, uint8_t u8SlaveAddr) |
| Read a byte from Slave. More... | |
| uint32_t | UI2C_ReadMultiBytes (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t *rdata, uint32_t u32rLen) |
| Read multi bytes from Slave. More... | |
| uint8_t | UI2C_ReadByteOneReg (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) |
| Specify a byte register address and read a byte from Slave. More... | |
| uint32_t | UI2C_ReadMultiBytesOneReg (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t *rdata, uint32_t u32rLen) |
| Specify a byte register address and read multi bytes from Slave. More... | |
| uint8_t | UI2C_ReadByteTwoRegs (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) |
| Specify two bytes register address and read a byte from Slave. More... | |
| uint32_t | UI2C_ReadMultiBytesTwoRegs (UI2C_T *ui2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t *rdata, uint32_t u32rLen) |
| Specify two bytes register address and read multi bytes from Slave. More... | |
| #define UI2C_CLR_PROT_INT_FLAG | ( | ui2c, | |
| u32IntTypeFlag | |||
| ) |
This macro clears specified protocol interrupt flag.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32IntTypeFlag | Interrupt Type Flag, should be |
To clear interrupt flag when USCI_I2C occurs interrupt and set interrupt flag.
Definition at line 250 of file usci_i2c.h.
| #define UI2C_CLR_WAKEUP_FLAG | ( | ui2c | ) |
This macro is used to clear USCI_I2C wake-up flag.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
If USCI_I2C wake-up flag is set, use this macro to clear it.
Definition at line 196 of file usci_i2c.h.
| #define UI2C_DISABLE_10BIT_ADDR_MODE | ( | ui2c | ) |
This macro disables the USCI_I2C 10-bit address mode.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
The UI2C_I2C is 7-bit address mode, when disable USCI_I2C 10-bit address match function.
Definition at line 208 of file usci_i2c.h.
| #define UI2C_DISABLE_PROT_INT | ( | ui2c, | |
| u32IntSel | |||
| ) |
This macro disables specified protocol interrupt.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32IntSel | Interrupt Type, should be |
Clear specified USCI_I2C protocol interrupt bits to disable interrupt function.
Definition at line 286 of file usci_i2c.h.
| #define UI2C_ENABLE_10BIT_ADDR_MODE | ( | ui2c | ) |
This macro enables the 10-bit address mode.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
To enable USCI_I2C 10-bit address match function.
Definition at line 220 of file usci_i2c.h.
| #define UI2C_ENABLE_PROT_INT | ( | ui2c, | |
| u32IntSel | |||
| ) |
This macro enables specified protocol interrupt.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32IntSel | Interrupt Type, should be |
Set specified USCI_I2C protocol interrupt bits to enable interrupt function.
Definition at line 268 of file usci_i2c.h.
| #define UI2C_GET_DATA | ( | ui2c | ) |
This macro returns the data stored in data register of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
Read a byte data value of UI2C_RXDAT register from USCI_I2C bus
Definition at line 145 of file usci_i2c.h.
| #define UI2C_GET_PROT_STATUS | ( | ui2c | ) |
This macro gets USCI_I2C protocol interrupt flag or bus status.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
Read a word data of USCI_I2C PROTSTS register to get USCI_I2C bus Interrupt flags or status.
Definition at line 232 of file usci_i2c.h.
| #define UI2C_GET_TIMEOUT_FLAG | ( | ui2c | ) |
This macro returns time-out flag.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| 0 | USCI_I2C bus time-out is not happened |
| 1 | USCI_I2C bus time-out is happened |
USCI_I2C bus occurs time-out event, the time-out flag will be set. If not occurs time-out event, this bit is cleared.
Definition at line 171 of file usci_i2c.h.
| #define UI2C_GET_WAKEUP_FLAG | ( | ui2c | ) |
This macro returns wake-up flag.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| 0 | Chip is not woken-up from power-down mode |
| 1 | Chip is woken-up from power-down mode |
USCI_I2C controller wake-up flag will be set when USCI_I2C bus occurs wake-up from deep-sleep.
Definition at line 184 of file usci_i2c.h.
| #define UI2C_SET_CONTROL_REG | ( | ui2c, | |
| u8Ctrl | |||
| ) |
This macro sets the USCI_I2C protocol control register at one time.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8Ctrl | Set the register value of USCI_I2C control register. |
Set UI2C_PROTCTL register to control USCI_I2C bus conditions of START, STOP, SI, ACK.
Definition at line 109 of file usci_i2c.h.
| #define UI2C_SET_DATA | ( | ui2c, | |
| u8Data | |||
| ) |
This macro writes the data to data register of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8Data | The data which will be written to data register of USCI_I2C module. |
Write a byte data value of UI2C_TXDAT register, then sends address or data to USCI I2C bus
Definition at line 158 of file usci_i2c.h.
| #define UI2C_START | ( | ui2c | ) |
This macro only set START bit to protocol control register of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
Set the USCI_I2C bus START condition in UI2C_PROTCTL register.
Definition at line 121 of file usci_i2c.h.
| #define UI2C_STOP | ( | ui2c | ) |
This macro only set STOP bit to the control register of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
Set the USCI_I2C bus STOP condition in UI2C_PROTCTL register.
Definition at line 133 of file usci_i2c.h.
| void UI2C_ClearIntFlag | ( | UI2C_T * | ui2c, |
| uint32_t | u32Mask | ||
| ) |
This function clears the interrupt flag of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32Mask | The combination of all related interrupt sources. Each bit corresponds to a interrupt source. This parameter decides which interrupt flags will be cleared. It is combination of: |
Use this function to clear USCI_I2C interrupt flag when module occurs interrupt event and set flag.
Definition at line 418 of file usci_i2c.c.
| void UI2C_ClearTimeoutFlag | ( | UI2C_T * | ui2c | ) |
This function clears the time-out flag.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
Clear time-out flag when time-out flag is set.
Definition at line 94 of file usci_i2c.c.
| void UI2C_Close | ( | UI2C_T * | ui2c | ) |
This function closes the USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
Close USCI_I2C protocol function.
Definition at line 79 of file usci_i2c.c.
| void UI2C_DisableInt | ( | UI2C_T * | ui2c, |
| uint32_t | u32Mask | ||
| ) |
This function disables the interrupt of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32Mask | The combination of all related interrupt enable bits. Each bit corresponds to an interrupt enable bit. This parameter decides which interrupts will be disabled. It is combination of: |
The function is used to disable USCI_I2C bus interrupt events.
Definition at line 156 of file usci_i2c.c.
| void UI2C_DisableTimeout | ( | UI2C_T * | ui2c | ) |
This function disables time-out function.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
To disable USCI_I2C bus time-out function.
Definition at line 569 of file usci_i2c.c.
| void UI2C_DisableWakeup | ( | UI2C_T * | ui2c | ) |
This function disables the wakeup function of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
To disable USCI_I2C module wake-up function.
Definition at line 601 of file usci_i2c.c.
| void UI2C_EnableInt | ( | UI2C_T * | ui2c, |
| uint32_t | u32Mask | ||
| ) |
This function enables the interrupt of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32Mask | The combination of all related interrupt enable bits. Each bit corresponds to a interrupt enable bit. This parameter decides which interrupts will be enabled. It is combination of: |
The function is used to enable USCI_I2C bus interrupt events.
Definition at line 218 of file usci_i2c.c.
| void UI2C_EnableTimeout | ( | UI2C_T * | ui2c, |
| uint32_t | u32TimeoutCnt | ||
| ) |
This function enables time-out function and configures timeout counter.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32TimeoutCnt | Timeout counter. Valid values are between 0~0x3FF |
To enable USCI_I2C bus time-out function and set time-out counter.
Definition at line 554 of file usci_i2c.c.
| void UI2C_EnableWakeup | ( | UI2C_T * | ui2c, |
| uint8_t | u8WakeupMode | ||
| ) |
This function enables the wakeup function of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8WakeupMode | The wake-up mode selection. Valid values are: |
To enable USCI_I2C module wake-up function.
Definition at line 587 of file usci_i2c.c.
| uint32_t UI2C_GetBusClockFreq | ( | UI2C_T * | ui2c | ) |
This function returns the real bus clock of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
The function returns the actual USCI_I2C module bus clock.
Definition at line 272 of file usci_i2c.c.
| uint32_t UI2C_GetData | ( | UI2C_T * | ui2c | ) |
This function returns the data stored in data register of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
To read a byte data from USCI_I2C module receive data register.
Definition at line 472 of file usci_i2c.c.
| uint32_t UI2C_GetIntFlag | ( | UI2C_T * | ui2c, |
| uint32_t | u32Mask | ||
| ) |
This function gets the interrupt flag of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32Mask | The combination of all related interrupt sources. Each bit corresponds to a interrupt source. This parameter decides which interrupt flags will be read. It is combination of: |
Use this function to get USCI_I2C interrupt flag when module occurs interrupt event.
Definition at line 343 of file usci_i2c.c.
| uint32_t UI2C_Open | ( | UI2C_T * | ui2c, |
| uint32_t | u32BusClock | ||
| ) |
This function makes USCI_I2C module be ready and set the wanted bus clock.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32BusClock | The target bus speed of USCI_I2C module. |
Enable USCI_I2C module and configure USCI_I2C module(bus clock, data format).
Definition at line 34 of file usci_i2c.c.
| uint8_t UI2C_ReadByte | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr | ||
| ) |
Read a byte from Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
The function is used for USCI_I2C Master to read a byte data from Slave.
Definition at line 1092 of file usci_i2c.c.
| uint8_t UI2C_ReadByteOneReg | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t | u8DataAddr | ||
| ) |
Specify a byte register address and read a byte from Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | u8DataAddr | Specify a address(1 byte) of data read from |
The function is used for USCI_I2C Master specify a byte address that a data byte read from Slave.
Definition at line 1253 of file usci_i2c.c.
| uint8_t UI2C_ReadByteTwoRegs | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint16_t | u16DataAddr | ||
| ) |
Specify two bytes register address and read a byte from Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | u16DataAddr | Specify a address(2 byte) of data read from |
The function is used for USCI_I2C Master specify two bytes address that a data byte read from Slave.
Definition at line 1463 of file usci_i2c.c.
| uint32_t UI2C_ReadMultiBytes | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t * | rdata, | ||
| uint32_t | u32rLen | ||
| ) |
Read multi bytes from Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [out] | *rdata | Point to array to store data from Slave |
| [in] | u32rLen | How many bytes need to read from Slave |
The function is used for USCI_I2C Master to read multi data bytes from Slave.
Definition at line 1170 of file usci_i2c.c.
| uint32_t UI2C_ReadMultiBytesOneReg | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t | u8DataAddr, | ||
| uint8_t * | rdata, | ||
| uint32_t | u32rLen | ||
| ) |
Specify a byte register address and read multi bytes from Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | u8DataAddr | Specify a address (1 bytes) of data read from |
| [out] | *rdata | Point to array to store data from Slave |
| [in] | u32rLen | How many bytes need to read from Slave |
The function is used for USCI_I2C Master specify a byte address that multi data bytes read from Slave.
Definition at line 1359 of file usci_i2c.c.
| uint32_t UI2C_ReadMultiBytesTwoRegs | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint16_t | u16DataAddr, | ||
| uint8_t * | rdata, | ||
| uint32_t | u32rLen | ||
| ) |
Specify two bytes register address and read multi bytes from Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | u16DataAddr | Specify a address (2 bytes) of data read from |
| [out] | *rdata | Point to array to store data from Slave |
| [in] | u32rLen | How many bytes need to read from Slave |
The function is used for USCI_I2C Master specify two bytes address that multi data bytes read from Slave.
Definition at line 1576 of file usci_i2c.c.
| uint32_t UI2C_SetBusClockFreq | ( | UI2C_T * | ui2c, |
| uint32_t | u32BusClock | ||
| ) |
This function sets bus clock frequency of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u32BusClock | The target bus speed of USCI_I2C module. |
Use this function set USCI_I2C bus clock frequency and return actual bus clock.
Definition at line 301 of file usci_i2c.c.
| void UI2C_SetData | ( | UI2C_T * | ui2c, |
| uint8_t | u8Data | ||
| ) |
This function writes a byte data to data register of USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8Data | The data which will be written to data register of USCI_I2C module. |
To write a byte data to transmit data register to transmit data.
Definition at line 487 of file usci_i2c.c.
| void UI2C_SetSlaveAddr | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveNo, | ||
| uint16_t | u16SlaveAddr, | ||
| uint8_t | u8GCMode | ||
| ) |
Configure slave address and enable GC mode.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveNo | Slave channel number [0/1] |
| [in] | u16SlaveAddr | The slave address. |
| [in] | u8GCMode | GC mode enable or not. Valid values are: |
To configure USCI_I2C module slave address and GC mode.
Definition at line 506 of file usci_i2c.c.
| void UI2C_SetSlaveAddrMask | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveNo, | ||
| uint16_t | u16SlaveAddrMask | ||
| ) |
Configure the mask bit of slave address.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveNo | Slave channel number [0/1] |
| [in] | u16SlaveAddrMask | The slave address mask. |
To configure USCI_I2C module slave address mask bit.
Definition at line 532 of file usci_i2c.c.
| void UI2C_Trigger | ( | UI2C_T * | ui2c, |
| uint8_t | u8Start, | ||
| uint8_t | u8Stop, | ||
| uint8_t | u8Ptrg, | ||
| uint8_t | u8Ack | ||
| ) |
This function sets the control bit of the USCI_I2C module.
| [in] | ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8Start | Set START bit to USCI_I2C module. |
| [in] | u8Stop | Set STOP bit to USCI_I2C module. |
| [in] | u8Ptrg | Set PTRG bit to USCI_I2C module. |
| [in] | u8Ack | Set ACK bit to USCI_I2C module. |
The function set USCI_I2C control bit of USCI_I2C bus protocol.
Definition at line 112 of file usci_i2c.c.
| uint8_t UI2C_WriteByte | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t | data | ||
| ) |
Write a byte to Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | data | Write a byte data to Slave |
| 0 | Write data success |
| 1 | Write data fail, or bus occurs error events |
The function is used for USCI_I2C Master write a byte data to Slave.
Definition at line 620 of file usci_i2c.c.
| uint8_t UI2C_WriteByteOneReg | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t | u8DataAddr, | ||
| uint8_t | data | ||
| ) |
Specify a byte register address and write a byte to Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | u8DataAddr | Specify a address (1 byte) of data write to |
| [in] | data | A byte data to write it to Slave |
| 0 | Write data success |
| 1 | Write data fail, or bus occurs error events |
The function is used for USCI_I2C Master specify a address that data write to in Slave.
Definition at line 763 of file usci_i2c.c.
| uint8_t UI2C_WriteByteTwoRegs | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint16_t | u16DataAddr, | ||
| uint8_t | data | ||
| ) |
Specify two bytes register address and Write a byte to Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | u16DataAddr | Specify a address (2 byte) of data write to |
| [in] | data | Write a byte data to Slave |
| 0 | Write data success |
| 1 | Write data fail, or bus occurs error events |
The function is used for USCI_I2C Master specify two bytes address that data write to in Slave.
Definition at line 922 of file usci_i2c.c.
| uint32_t UI2C_WriteMultiBytes | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t * | data, | ||
| uint32_t | u32wLen | ||
| ) |
Write multi bytes to Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | *data | Pointer to array to write data to Slave |
| [in] | u32wLen | How many bytes need to write to Slave |
The function is used for USCI_I2C Master write multi bytes data to Slave.
Definition at line 694 of file usci_i2c.c.
| uint32_t UI2C_WriteMultiBytesOneReg | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint8_t | u8DataAddr, | ||
| uint8_t * | data, | ||
| uint32_t | u32wLen | ||
| ) |
Specify a byte register address and write multi bytes to Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | u8DataAddr | Specify a address (1 byte) of data write to |
| [in] | *data | Pointer to array to write data to Slave |
| [in] | u32wLen | How many bytes need to write to Slave |
The function is used for USCI_I2C Master specify a byte address that multi data bytes write to in Slave.
Definition at line 843 of file usci_i2c.c.
| uint32_t UI2C_WriteMultiBytesTwoRegs | ( | UI2C_T * | ui2c, |
| uint8_t | u8SlaveAddr, | ||
| uint16_t | u16DataAddr, | ||
| uint8_t * | data, | ||
| uint32_t | u32wLen | ||
| ) |
Specify two bytes register address and write multi bytes to Slave.
| [in] | *ui2c | The pointer of the specified USCI_I2C module. |
| [in] | u8SlaveAddr | Access Slave address(7-bit) |
| [in] | u16DataAddr | Specify a address (2 bytes) of data write to |
| [in] | *data | Pointer to array to write data to Slave |
| [in] | u32wLen | How many bytes need to write to Slave |
The function is used for USCI_I2C Master specify a byte address that multi data write to in Slave.
Definition at line 1007 of file usci_i2c.c.


Code Generation Demonstrations Listed by Top-Level Domain
There are two classes of Codegen demos:
- Those demos that do not use the plotter, and thus will work with
a Java Runtime Environment (JRE), such as the JRE that is shipped
with the Windows installer.
- Those demos that do use the plotter, and thus
require a Java Development Kit (JDK) that includes the
Java .h files and librareis. These demos will not work
with the JRE that is included with the Windows installer.
Ptolemy II Domains with Code Generation Demonstrations


TOWER OF POWER
Copyright (c) 1976 Michael Baldwin
This game is played on a 8x8 square board with the following setup:
- MOVE - On each turn, each player must do a stack then an unstack.
- STACK - Choose a line of 2 or more stones or stacks adjacent on a straight line (diagonal or orthogonal) and stack them on one of the edges of that line.
- If along that line, there are stacked stones, only the top stones participate in the stacking (and thus liberating the stone just below).
- UNSTACK - Take a stack and spread its stones into a straight line, one per cell (the bottom stone do not move).
- Any enemy stone just below one of the unstacked stones is captured. However, if one of these stones lands on an enemy stack only the top stone is captured, immobilizing the other below.
- An unstack cannot be made so that one or more stones would be placed off-board.
- An unstack cannot be made on the opposite direction of the last stack (the player cannot repeat the board position at the beginning of the turn).
- GOAL - Wins the player that captures or stalemates all enemy stones.
- If both players admit that they do not have enough material to win, the game is a draw.
This game was presented in Games and Puzzles in 1976 and also at Jeux et Strategie #39. Check also Ralf Gering's article about the game.
An example White made a stack...
... then unstacked to the north!


Pyongyang Mangyongdae Prize Marathon
Pyongyang PRK
Race Winners
(38 runnings)
2:30:41 2:32:06 2:27:34 2:28:34 2:28:39 08 Apr
2007
2:12:41
2:26:02
09 Apr
2006
2:13:15
2:27:22
10 Apr
2005
2:11:36
2:31:46
11 Apr
2004
2:16:41
2:36:10
13 Apr
2003
2:15:05
2:27:48
07 Apr
2002
2:15:05
2:26:23
15 Apr
2001
2:11:48
2:28:32
09 Apr
2000
2:11:05
2:31:28
1999
---
---
---
---
---
---
10 Mar
1996
2:10:50
2:27:02
09 Apr 1995
---
2:30:37
---
---
---
---
---
2:38:44 ---
---
1990 ---
---
25 Apr
1989
2:15:27
2:33:48
25 Apr
1988 2:14:33 2:38:00
1987 ---
---
25 Apr
1986
2:14:19
2:37:11
25 Apr
1985
2:13:25
2:35:36
24 Apr
1984
2:14:36
2:40:34
21 Mar
1983
---
25 Apr
1982
2:15:17
25 Apr 1981
2:17:18
Note: Race currently known as Mangyongdae Prize International Marathon.
07 Apr
2019
2:11:19
Kang-Bom Ri-2
2:26:58
Kwang-Ok Ri (PRK)
08 Apr
2018
2:12:53
Kang-Bom Ri (PRK)
2:27:31
Hye-Song Kim-2
09 Apr
2017
2:14:56
Chol-Gwang Pak-3
2:29:22
Un-Ok Jo (PRK)
10 Apr
2016
2:14:11
Chol-Gwang Pak-2
2:28:06
Ji-Hyang Kim (PRK)
12 Apr
2015
2:16:04
Yong-Ho Lee (PRK)
2:29:12
Hye-Song Kim (PRK)
13 Apr
2014
2:12:26
Chol-Gwang Pak (PRK)
2:27:05
Hye-Gyong Kim (PRK)
14 Apr
2013
2:13:04
Ketema Bekele Negassa (ETH)
2:26:32
Mi-Gyong Kim-2
08 Apr
2012
2:12:54
Aleksandr Matviychuk (UKR)
Mi-Gyong Kim (PRK)
10 Apr
2011
2:13:59
Oleg Marusin (RUS)
Un-Ok Ro (PRK)
11 Apr
2010
2:13:56
Ivan Babarika (UKR)
Kum-Ok Kim (PRK)
12 Apr
2009
2:14:21
Ze-min Wang (CHN)
Un-Suk Pyo-2
06 Apr
2008
2:14:22
Song-Chol Pak-2
Un-Suk Pyo (PRK)
Song-Chol Pak (PRK)
Yong-Ok Jong-2
Gyong-Chol Lee-2
Bun-Hui Jo (PRK)
Gyong-Chol Lee (PRK)
Bong-Sil Ham-3
Morris Murethi (KEN)
Song-Suk Oh (PRK)
Myong-Chol Jong (PRK)
Bong-Sil Ham-2
Zacharia Mpolokeng (RSA)
Bong-Sil Ham (PRK)
Jung-Won Kim (PRK)
Yong-Ok Jong (PRK)
Nelson Ndereva (KEN)
Myong-Hui Hong (PRK)
n/a
n/a
1998
n/a
n/a
1997
n/a
n/a
Jung-Won Kim (PRK)
Chung-Ok Kim (PRK)
n/a
Gyong-Ae Mun-3
1994
n/a
n/a
1993
n/a
n/a
05 Apr
1992
n/a
Gyong-Ae Mun-2
1991
n/a
n/a
n/a
n/a
Chol-Ho Choe (PRK)
Gyong-Ae Mun (PRK)
Hui-Bok Cho (PRK)
Madina
Biktagirova (BLR)
not held
not held
Sergey Krestyaninov (RUS)
Elena Murgoci (ROM)
Il-Sop Choe (PRK)
Tatyana Bultot (RUS)
Dmitriy Feostikov (UKR)
Nadezhda Tishkova (UKR)
n/a
2:37:14
Song-hui Yu (PRK)
Jong-Hyong Lee (PRK)
n/a
Most Wins (1981/date)
Men
3
3
Chol-Gwang Pak (PRK)
2014,2016-17
Women
Gyong-Ae Mun (PRK)
1989,1992,1995
Bong-Sil Ham (PRK)
2002-03,2005
Prize Money
(ADR qualified runners)
Year Men Woman Total 2010 $22,300 $22,300 $44,600 .... 2008 26,100 19,000 45,100 2007 26,300 18,900 45,200 Sums $74,700 $60,200 $134,900
Race Time Bias (sec/km)
Year Men Women 2012 -5.0 n/c .... 2010 +1.9 n/c 2009 -2.1 -3.4 2008 -2.7 n/c 2007 -4.2 n/c .... 2005 n/c +3.0 .... 2001 +0.3 n/c 2000 n/c -3.3 Avgs -2.0 -1.2
Competitive Level (1990-date)
Year Men Women 2017 n/c 167 .... 2014<PHONE_NUMBER> 90 183 2012 63 166 2011 37 313 2010<PHONE_NUMBER> 289 n/c 2008<PHONE_NUMBER> 294 126 .... 2005<PHONE_NUMBER> 28 336 2003 n/c 353 .... 2000 282 n/c
Quality Performances through 2019
Men <2:11 1 <2:12 9 <2:13 22 <2:14 44 <2:15 72 Women <2:28 16 <2:30 42 <2:32 66 <2:34 105 <2:36 151 <2:38 208 <2:40 255
Last Updated on 11 Apr 2019 mp
Contributors: Juraj Gasparovic (3), Aleksandar Vangelov (1), Franco Civai (3), Francois Lorange (22), Enzo Rivis (6), Thierry Lefeuvre (3), Paul Michiels (2), Heinrich Hubbeling (5), Marty Post (2)


Conditional computation is a technique to increase a model’s capacity (without a proportional increase in computation) by activating parts of the network on a per example basis.
The paper describes (and address) the computational and algorithmic challenges in conditional computation. It introduces a sparsely-gated Mixture-of-Experts layer (MoE) with 1000s of feed-forward sub-networks.
GPUs are fast at matrix arithmetic but slow at branching.
Large batch sizes amortizes the cost of updates. Conditional computation reduces the effective batch size for different components of the model.
Network bandwidth can be a bottleneck with the network demand overshadowing the computational demand.
Additional losses may be needed to achieve the desired level of sparsity.
Conditional computation is most useful for large datasets.
n Expert Networks - $E_1$, …, $E_n$.
Gating Network $G$ to select a sparse combination of experts.
Output of the MoE module is the weighted sum of predictions of experts (weighted by the output of the gate).
If the gating network’s output is sparse, then some of the experts’ value does not have to be computed.
In theory, one could use a hierarchical mixture of experts where a mixture of experts is trained at each level.
Softmax Gating
Noisy top-k gating - Add tunable Gaussian noise to the output of softmax gating and retain only the top-k values. A second trainable weight matrix controls the amount of noise per component.
Shrinking Batch Problem
If the MoE selects k out of n experts, the effective batch size reduces by a factor of k / n.
This reduction in batch size is accounted for by combining data parallelism (for standard layers and gasting networks) and model parallelism (for experts in MoE). Thus, with d devices, the batch size changes by a factor of (k x d ) / n.
For hierarchical MoE, the primary gating network uses data parallelism while secondary MoEs use model parallelism.
The paper considers LSTM models where the MoE is applied once the previous layer has finished. This increases the batch size (for the current MoE layer) by a factor equal to the number of unrolling timesteps.
Network Bandwith limitations can be overcome by ensuring that the ratio of computation (of each expert) to the input and output size is greater than (or equal to) the ratio of computational to network capacity.
Computational efficiency can be improved by using larger hidden layers (or more hidden layers).
Balancing Expert Utilization
Importance of an expert (relative to a batch of training examples) is defined as the batchwise sum of the expert’s goal values.
An additional loss, called importance loss, is added to encourage the experts to have equal importance.
The importance loss is defined as the square of the coefficient of variation (of a set of importance values) multiplied by a (hand-tuned) scaling factor $w_{importance}$.
In practice, an additional loss called $L_{load}$ might be needed to ensure that the different experts get equal load (along with equal importance).
Datasets
Billon Word Language modeling Benchmark
100 Billion word Google News Corpus
Machine Translation datasets
Single Language Pairs - WMT’14 En to Fr (36M sentence pairs) and En to De (5M sentence pairs).
Multilingual Machine Translation - large combine dataset of twelve language pairs.
In all the setups, the proposed MoE models achieve significantly better results than the baseline models, at a lower computational cost.


Buttons and icons built to cover any usage you may ever require. From 3D Effects to Social Logins to Ghost styles and many, many more.
Essential Features for your Page
Buttons and icons built to cover any usage you may ever require. From 3D Effects to Social Logins to Ghost styles and many, many more.
Essential Features for your Page
Essential Features for your Page
Essential Features for your Page
Essential Features for your Page
Essential Features for your Page
Essential Features for your Page
Essential Features for your Page


--- layout: post esbma_id: 1654 title: SourceGear Job Opening: Product Manager date: 2007-03-09 10:00:00 ---
This posting is about a job opening at SourceGear. The official title for this position will be "Product Manager" (or something similar).
But another possible title for this position would be "Eric's Apprentice".
This is a product marketing position. Areas of responsibility will include strategy, message, positioning and competition.
No. In fact, if you have any, I'll be wondering how much stuff you'll have to unlearn.  :-)
Just to be a clear, the word "bozo" does not mean "non-developer". The word "bozo" means "someone who doesn't know the stuff that his/her job requires him/her to know". A software company usually employs lots of people who are not developers and not bozos. They work in several different areas, including sales, accounting, customer service, technical support or marketing communications. There isn't much need for any of them to have a software development background.
But product marketing is one job where it really helps to be cut from the same cloth as the customer. You are steering the direction of the product. You need the ability to make decisions about what's important. You must be able to talk about design tradeoffs both externally and internally.
We sell developer tools to software teams, so I'm looking for a developer. If we were selling software to manage bowling alleys I would be insisting that you are a bowler.
You love to develop software, but you want to consider a broader range of opportunities. Maybe you're looking up the corporate ladder and noticing that all the rungs above you require some business savvy. Maybe you want to be an entrepreneur.
Whatever your goals are, I'm looking for someone who wants to follow the same career path I have. Start with good developer skills and then add business and marketing skills and you end up with a very potent combination.
No. That's not what "Product Manager" means. You'll be managing the product, not the people who create the product.
No. I'm using the word "apprentice" somewhat tongue-in-cheek. The Product Manager is one of the most influential roles in the company. This position would be a peer of the person who manages the development team. You need significant industry experience for this job. If you are fresh out of college, it is very unlikely you are qualified.
I just explained all the ways that the word "apprentice" doesn't actually fit this situation. The primary way that this word does fit is that it's a marketing position but you don't need any marketing experience. You'll learn that stuff as you go.
I don't have a specific number in mind, but I'm looking for an experienced developer and I certainly don't think of this position as a step down. I expect this position will be compensated at a level similar to that of a senior developer or development team lead.
No. I'm thinking more along the lines of the "Cruel Tutelage of Pai Mei" chapter from Kill Bill. Your experience at SourceGear will be grueling and painful, but it will transform you into a powerful assassin, or the software industry equivalent thereof. :-)
A degree in computer science or software engineering is preferred but not strictly required.
No. You can have a compiler if you want, but you will not be writing production code.
Short answer: Illinois.
Long answer: There is some flexibility, but geography will be an issue. Basically, this position would work out best if you are located in Champaign or within a few hours driving distance. For example, if you live in Chicago and can spend two days a week in Champaign, that would be fine. Anything on the east or west coast is probably going to be too difficult.
Yes. Plan on more than 6 trips per year and less than 12.
No, but the whole thing reads so much better that way, don't you think?
And I'm mostly kidding about the "grueling and painful" part.
:-)
To express an interest in this position, send email to paimei@sourcegear.com


Hello {{user.firstName}}, you've {{user.totalExpenditure | number:0}} credit points to redeem!
Best price for {{data.productName}} is
2nd Best price for {{data.productName}} is
{{data.productName}} is also available for
at {{data.storeName}}
in {{data.location}}
{{data.storeSales[0].sales}}
shopper(s) have bought {{data.productName}} from
{{data.storeSales[0].storeName}}
Grab the deal before it ends!


Inheritance diagram for ProgressBar::SetCandyModeOperation:
Definition at line 86 of file ProgressBar.h.
Public Member Functions | |
| virtual void | run () |
| Performs the operation. | |
| SetCandyModeOperation (ProgressBar *progressBar, bool candyMode) | |
| Creates a new setCandyMode deferral operation. | |
Private Attributes | |
| bool | candyMode |
| Whether the process bar is in candy mode. | |
| ProgressBar * | progressBar |
| The progress bar to operate on. |
|
|
Creates a new setCandyMode deferral operation.
|
|
|
Performs the operation.
Reimplemented from Runnable. |
|
|
Whether the process bar is in candy mode.
Definition at line 98 of file ProgressBar.h. |
|
|
The progress bar to operate on.
Definition at line 93 of file ProgressBar.h. |