Introduction to Java Programming, Includes Data Structures, Eleventh Edition,
Y. Daniel Liang
This quiz is for students to practice. A large number of additional quiz questions is available for instructors from the Instructor's Resource Website.
Chapter 23 Sorting
Section 23.2 Insertion Sort
23.1
The best-time complexity for insertion sort is _____________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
23.2
The worst-time complexity for insertion sort is _____________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
Section 23.3 Bubble Sort
23.3
Suppose a list is {2, 9, 5, 4, 8, 1}. After the first pass of bubble sort, the list becomes
A.
2, 9, 5, 4, 8, 1
B.
2, 9, 5, 4, 1, 8
C.
2, 5, 9, 4, 8, 1
D.
2, 5, 4, 8, 1, 9
E.
2, 1, 5, 4, 8, 9
23.4
The best-time complexity for bubble sort is _____________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
23.5
The worst-time complexity for bubble sort is _____________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
Section 23.4 Merge Sort
23.6
The time to merge two sorted lists of size n is _________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
23.7
The worst-time complexity for merge sort is _________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
23.8
The average-time complexity for merge sort is _________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
Section 23.5 Quick Sort
23.9
What is correct about a pivot?
A.
A pivot divides a list into two sublists of equal size.
B.
A pivot can be chosen arbitrarily.
C.
A pivot divides a list into two sublists, the elements in the first list are no larger than the pivot and the elements in the second list are larger than the pivot.
D.
You should always choose a pivot that divides the list evenly.
23.10
Suppose you choose the first element as a pivot in the list {5 2 9 3 8 4 0 1 6 7}. Using the partition algorithm in the book, what is the new list after the partition?
A.
5 2 9 3 8 4 0 1 6 7
B.
4 2 3 0 1 5 6 7 9 8
C.
4 2 1 3 0 5 8 9 6 7
D.
2 3 4 0 1 5 9 8 6 7
E.
2 3 4 0 1 5 6 7 8 9
23.11
The worst-time complexity for quick sort is _________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
23.12
The average-time complexity for quick sort is _________.
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
23.13
Using the partition algorithm to partition an array {5, 8, 10, 3, 4, 19, 2} for a quick sort, what is the resulting array after the partition?
A.
{5, 8, 10, 3, 4, 19, 2}
B.
{2, 3, 4, 5, 8, 10, 19}
C.
{2, 3, 4, 5, 10, 19, 8}
D.
{3, 2, 4, 5, 10, 19, 8}
E.
{3, 2, 4, 5, 8, 10, 19}
Section 23.6 Heap Sort
23.14
Which of the following statements are true?
A.

Each node is greater than or equal to any of its children.
C.
A binary tree is complete if every level of the tree is full except that the last level may not be full and all the leaves on the last level are placed left-most.
D.
A heap is a full binary tree.
23.15
To remove the root, you need to start a process by first placing _______ to the place of the root and move it down to maintain the heap property.
A.
one of the root's children
B.
the larger child of the root
C.
the smaller child of the root
D.
the last node in the heap
23.16
To add a new node, you need to start a process by first placing it as _______ and move it up to maintain the heap property.
A.
the new root
B.
the last node in the heap
C.
the left child of the root
D.
the right child of the root
23.17
A heap is represented using an array. Is the array {1 2 4 5 9 3} a heap?
A.
Yes
B.
No
23.18
A heap is represented using an array. Is the array {64 42 59 32 39 44} a heap?
A.
Yes
B.
No
23.19
The worst-time complexity for heap sort is _________
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
23.20
The average-time complexity for heap sort is _________
A.
O(1)
B.
O(logn)
C.
O(n)
D.
O(nlogn)
E.
O(n*n)
23.21
Suppose a heap is stored in an array list as follows: {100, 55, 92, 23, 33, 81}. The parent of 81 is _______.
A.
100
B.
55
C.
92
D.
23
E.
33
23.22
Suppose a heap is stored in an array list as follows: {100, 55, 92, 23, 33, 81}. After inserting 103, what is the content of the array list?

A.
quick sort
B.
merge sort
C.
heap sort
D.
radix sort
23.24
The __________ algorithm does not compare keys.
A.
quick sort
B.
merge sort
C.
heap sort
D.
radix sort


Example 1
This example shows how to get a token and sign the user in if required
Start by logging out to be sure no authentication session is present.
The example uses the 'loginIfRequired' method, which will first try to get the tokens but if
it can't find a SSO session it will popout a login form.
Scroll down to example 5 to logout if necessary.
Example 2
Make a RESTful API call with an OAuth access token
Example 3
Follow these steps to retrieve a new token when already authenticated
- Run example 1 or login some how to obtain an SSO session.
- Click the retrieve tokens button
Example 4
Force the user to re-authenticate, ignoring any existing SSO session.
Example 5
Revoke issued tokens and sign the user out to end the user session


Super wifi packs at very low as Rs 3 for 100MB straight into your account.
Grab great offers around your home or office when you really need super fast wifi data for less price.
Sell excess data to others which will go waste if not used and bid for great price.
Founder,UI/UX Designer
Designer with a dreaming eye, passionate about designs and white is my most expensive art.
Co-founder,Developer
<code> is my dual name, would you like to talk beyond this.
Co-founder,Programmer
I discover and program the solution for present by keeping an eye on future.
Marketing and Sales
"The most expensive signature" would you be interested in signing from this pen?
2018 © Copyrights cloufiy Inc


1 Get the Zapatec DHTML Calendar
files
1.1 Download
the Zip file
1.2 Unzip
zpcal.zip
2 Create a Calendar with the
Wizard
2.1 What
does the Wizard do?
2.2 How
to Start the Wizard
2.3 Using
the Wizard
2.4 Theme
and Language
2.5 Basic
Setup
2.5.1 First
day of week
2.5.2 Show
week numbers
2.5.3 Show
other months
2.5.4 Show
Time
2.5.5 Time
Format
2.5.6 Year
Step
2.5.7 Date
and time formats
2.6 Events
2.7 Generate
3 Quick Startup (Without Wizard)
3.1 Project files
3.1.1 The
zpcal folder
3.1.2 The
src folder
3.1.3
The demo folder
3.1.4 The
doc folder
3.1.5 The
lang folder
3.1.6 The
themes folder
3.2 Set
Up Your Calendar
3.2.1 insert
the headers
3.2.2 Path
Warning
3.3 Create
the Calendar Form
3.3.1 Insert the form code
3.4 Insert the Calendar
configuration code
3.5 Copy
your files to your web server
3.6 Test
the calendar application
3.7 Change
Included Files
3.7.1 Use
a Different Themes
3.7.2 Use a Different
Language
3.8 Customize
Setup Options
3.8.1 Change
to Flat Calendar
3.8.2 Change
date and time format
3.8.3 Show time
3.8.4 Time
Format
4 Sample Calendar Configurations
4.1 Basic Single click
4.2 Double click, with time
5 Calendar Setup Detailed
Parameters
The DHTML Calendar files are bundled in a zip file. Click on the download link in the Calendar section of Zapatec's web site, and follow the instructions to download the file.
Save the file (zpcal.zip) to your website's root folder on your computer or server.
On your computer, go to the folder where you saved the file zpcal.zip.
zpcal.zip contains a folder called zpcal that holds all of the files you will need to create your calendar.
Open or double-click zpcal.zip to unzip or unpack it.
The Wizard generates the code for exactly the kind of calendar you want! It's a Graphic User Interface (GUI) that allows you to visually select the Language, Theme, Size, Style, and more. Once you have made your selections, the Wizard will create the code you need to place in your HTML document, form, or application with the click of a button.
If you haven't done so follow the instructions in section 1.1. to download the Calendar files.
Navigate to your DHTML Calendar folder (zpcal)
Open the Wizard directory (folder)
Open index.html in your Web browser
The Wizard page displays the calendar you are creating as you make your selections. It will update as you choose the features you want so that you can see what the end result will be. This is a case of "What You See is What You Get" (WYSIWYG). Click on Next and Previous to move through the panes, or choose a specific pane from the menu on the left hand side.
Click Next to move to the Theme and Language page and start creating your calendar.
Choose the language in which you want to present your calendar.
Select the theme you want for your calendar.
If you want your calendar to display smaller, check the box that says "Use the small version." Keep in mind that later selections, such as show other months, will affect calendar size.
Watch the DHTML Calendar on the screen as it changes with your selections. You can change your selections to view different themes and languages. Keep in mind that later selections, such as show other months, will affect calendar size.
Select the first day of week by using the drop-down box.
Check if you want the Calendar to display week numbers. The Calendar can calculate and display week numbers using the ISO 8601 standard. This can be very handy for someone who needs to know which week of the year they are working with.
Check Show other months if you want the calendar to display days from adjacent months. Note that calendars that display days from other months are fixed size - they always display six weeks. Calendars that don't display days from other months will sometime display five weeks and other times six.
Check to have your users prompted to enter a time as well as a date.
If you checked "Show Time" you can choose from a 12-hour or 24-hour clock.
This is useful for drop-down year menus. The years can be displayed with a certain step after the next or previous year. The next or previous year is always the first one displayed, no matter how many steps you choose between years.
To further customize your calendar, choose from a multitude of date and time formats. Some examples of date formats are:
January 1, 2007 01-01-07 1/1/2007 01-Jan-07
Events cause the calendar to do something specific based on the user's actions. For example, you can elect to have the calendar display a tip of the day tool tip when the user first clicks on it. In this case, the Event would be onClick
When you click "Generate" the code for your calendar will display in a window on this screen. You can copy this code and paste it into your HTML document for a quick-and-easy calendar setup!
If you have not done so follow the instructions in section 1.1. to download and unzip the Calendar files.
Here's a description of the project files, excluding documentation and example files.
The main directory containing all of the other directories and files
The src folder contains the JavaScript that makes the program work
the main program file ( calendar.js ). This defines all the logic behind the calendar widget.
helper functions for quick setup of the calendar ( calendar-setup.js ).
The demo folder holds examples of many of the types of calendars you can use. It is a great resource for examples of usage and the HTML code needed to make it happen.
Example1.html: a basic, single-click version of the Calendar
Example2.html: requires the user to double-click and displays the time
Example3.html: an example of the single-click calendar with icon and disabled weekends
Example4.html: an example of the single-click calendar with a different alignment
Example5.html: a flat calendar with special days highlighted
Example6.html: a flat calendar with notes and dates with special names
Example7.html: offers the end-user the opportunity to select multiple dates
Example8.html: simulates coordinated dates like check-in and check-out at a hotel
The doc folder contains all of the help and support files to assist you with the Calendar. Help is provided in HTML, and PDF formats with and without screenshots for ease of use and display.
The language folder contains up to twenty different languages - from English to French, Spanish, Italian and more - to provide you with the greatest possible versatility and ease of use for you and your end-users. Afrikaans, English, French, German, Spanish, Finnish, Croatian, Hungarian, Italian, Romanian, Slovenian, and Turkish are currently available.
The themes folder contains the CSS files that control the aesthetics of your calendar including special themes.
In your web editor (Dreamweaver, UltraEdit, etc.), open the web page where you want the calendar placed. Insert your cursor before the ending  tag. Paste the following style path and script paths before the ending  tag:
<link rel="stylesheet" type="text/css" href="themes/winxp.css"/>
 This page uses a  Javascript Calendar , but your browser does not support Javascript.
 Either enable Javascript in your Browser or upgrade to a newer version.
Quick Start: paste this code into the body of your document AFTER the </form> tag.
Using your editing or FTP program, copy or "put" your web page and the entire calendar folder to the root of your website.
Using your web browser, navigate to the web page that you created to include the Zapatec HTML Calendar. Click the "trigger" button to see if the calendar pops up. Click a date to select it and make sure that the date displays in the empty box. Congratulations! You have set up the most basic version of the Zapatec HTML Calendar! Now, on to the fun and exciting features you can change with this highly adaptable application!
You can change the theme or language of the calendar by choosing to include a different file in your header.
One of the lines you inserted in Section 3.2.1 includes the winxp.css file in the themes folder. Winxp is one of the themes that comes with the Zapatec DHTML Calendar. You can choose between several themes by changing the file called by the path. Look in the themes folder for more options.
1. Theme 1 - Windows XP Use this line:
<link rel="stylesheet" type="text/css" href="themes/winxp.css"/>
Get this result: Windows XP Theme:
2. Theme 2 - Green Use this line:
<link rel="stylesheet" type="text/css" href="themes/green.css"/>
Get this result: Green Theme
One of the lines you inserted in Section 3.2.1 was
 French:  Italian:
In section 3.4 you saw how to create a calendar by inserting the Calendar.setup javascript code. You can customize the calendar by setting various options in the setup section. For readability the options are displayed one on a line. Javascript syntax requires that there be a comma after each option except for the last one.
The flat version of the Zapatec DHTML Calendar is simply one that displays on the page all the time instead of popping up when clicked. To make the Zapatec DHTML Calendar flat, you need to put it in a placeholder like a table or a div on your web page. Here is an example using a div to hold the calendar:
Paste this code into the body of your html file:

The div is the container that holds your calendar.
Now, we will use JavaScript to put the calendar inside the DIV. Important: the JavaScript code must be placed after the div code. Paste the following code after your div container code:


Monday: 9am - 10pm
Tuesday: 9am - 10pm
Wednesday: 9am - 10pm
Thursday: 9am - 10pm
Friday: 9am - 10pm
Weekend: 9am - 10pm
2912 Bearwood Road, Birmingham City, B66 321
310-386-1623
Write below your details
By submitting this form you accept the terms & conditions


53 soldiers killed in attack on Mali military post - Premium Times Nigeria
by Agency ReportThe death toll from a “terrorist attack” on a military post in northeast Mali Friday has risen to 53, Communication Minister, Yaya Sangare, said on Saturday.
Thirty-five soldiers were killed on Friday in the attack on the spot in Indelimane, about 70 kilometres west of Menaka near the border with Niger, according to the army, which has dubbed the incident a terrorist attack.
An investigation into the attack has been underway, it added.
No group has claimed responsibility for the assault.
Since 2015, the West African country has suffered a spate of terrorist attacks that have killed over 500 people and displaced over 450,000 others. (Xinhua/NAN)


JSON Tutorial
Due to XStream's flexible architecture, handling of JSON mappings is as easy as handling of XML documents. All you have to do is to initialize XStream object with an appropriate driver and you are ready to serialize your objects to (and from) JSON.
XStream currently delivers two drivers for JSON: The JsonHierarchicalStreamDriver and the JettisonMappedXmlDriver. The first one does not have an additional dependency, but can only be used to write XML, while the second one is based on Jettison and can also deserialize JSON to Java objects again. However, since the JettisonMappedXmlDriver transforms plain XML into JSON, you might get better JSON strings with the JsonHierarchicalStreamDriver, because this driver knows often about the type of the written data and can act properly.
One word of warning. JSON is made for an easy data transfer between systems and languages. It's syntax offers much less possibilities to express certain data structures. It supports name/value pairs of primitive data types, arrays and lists and allows to nest them - but that's it! No references, no possibility for meta data (attributes), no properties with same names (as generated for implicit collections), etc. Therefore do not expect wonders. XStream (and Jettison) try their best, but the procedure to convert any kind of object into JSON is a lossy transformation and especially deserialization will not be possible for any construct. See also FAQ.
Since JSON has no possibility to express references, you should always set the NO_REFERENCES mode writing JSON.
Jettison driver
Jettison driver uses Jettison StAX parser to read and write data in JSON
format. It is available in XStream since version 1.2.2 and is implemented in
com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver
class. To successfully use this driver you need
to have the Jettison project and StAX API in your classpath (see reference for
optional dependencies).
Alternatively you can download JARs manually.
Here are a few simple examples:
Write to JSON with the Jettison-based implementation
The following example:
package com.thoughtworks.xstream.json.test; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver; public class WriteTest { public static void main(String[] args) { Product product = new Product("Banana", "123", 23.00); XStream xstream = new XStream(new JettisonMappedXmlDriver()); xstream.setMode(XStream.NO_REFERENCES); xstream.alias("product", Product.class); System.out.println(xstream.toXML(product)); } }
produces the following JSON document:
{"product":{"name":"Banana","id":123,"price":23.0}}
As you can see, all standard XStream features (such as aliases) can be used with this driver.
Note that Jettison will try to detect numerical values and omit the quotes. Since Jettison cannot know about the original data type, it has to guess. Hence it will therefore also write the value of the id field as numeric value in future.
Write to JSON with the self-contained JSON driver
The only difference to the example above is the line with the initialization:
XStream xstream = new XStream(new JsonHierarchicalStreamDriver());
The output is as follows:
{"product": { "name": "Banana", "id": "123", "price": 23.0 }}
While the difference because of line feeds is immediately obvious, you have to note also the value of the id element. This time the driver knew about the string value and therefore quotes were generated.
Write to JSON with the self-contained JSON driver dropping the root
Sometimes the root node in the generated JSON is superfluous, since its name is caused by the Java type of the written object that has no meaning in JSON and increases only the nesting level of the structure. Therefore it is possible to drop this root by initializing the internally used JsonWriter in a different mode. Again, the only difference to the example above is the line with the initialization:
XStream xstream = new XStream(new JsonHierarchicalStreamDriver() { public HierarchicalStreamWriter createWriter(Writer writer) { return new JsonWriter(writer, JsonWriter.DROP_ROOT_MODE); } });
The output is as follows:
{ "name": "Banana", "id": "123", "price": 23.0 }
Note, that it is now possible to create invalid JSON if XStream should marshal a single object with a single value to JSON (like String, int, URL, ...). JSON requires that the root is actually an object, but by dropping the root all that is generated is a single value. You can force the JsonWriter to throw a ConversionException in this case, see Javadoc of the JsonWriter.
Read from JSON
The following code:
package com.thoughtworks.xstream.json.test; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver; public class ReadTest { public static void main(String[] args) { String json = "{\"product\":{\"name\":\"Banana\",\"id\":123" + ",\"price\":23.0}}"; XStream xstream = new XStream(new JettisonMappedXmlDriver()); xstream.alias("product", Product.class); Product product = (Product)xstream.fromXML(json); System.out.println(product.getName()); } }
serializes JSON document created with preceding example back to Java object. It prints:
Banana
as a result.


RStudio add-ins, which enclose selected text with symbols that have special interpretation in R Markdown. Function, symbols and interpretation
rmd_bold()
: between **
and **
as bold;
rmd_italics()
: between _
and _
as italics;
rmd_bold_italics()
: between **_
and _**
as bold italics;
rmd_bold2()
: between __
and __
as bold;
rmd_italics2()
: between *
and *
as italics;
rmd_code_inline()
: between back-ticks (``) as inline code;
rmd_r_code_inline()
: formats text as inline R code to evaluate;
rmd_superscript()
: between ^
and ^
as superscript;
rmd_subscript()
: between ~
and ~
as subscript;
rmd_strikethrough()
: between ~~
and ~~
as strike-through text.
rmd_a_bold() rmd_a_italics() rmd_a_bold_italics() rmd_a_bold2() rmd_a_italics2() rmd_code_inline() rmd_code_inline_r() rmd_code_inline_highlighted_as_r() rmd_a_superscript() rmd_a_subscript() rmd_a_strikethrough() rmd_horizontal_rule() rmd_link_url() rmd_insert_figure()
Other R Markdown formatting add-ins: rmd_code_block
,
rmd_equations
, rmd_list


Scripting Sculptor 03 - Fitting and Analzying models using MCMC
This tutorial notebook focuses on using Sculptor’s modules to fit and analyze a model using the maxmimum likelihood Markov Chain Monte Carlo method implemented in LMFIT using the emcee backend. You can find more information on how LMFIT uses emcee here.
[1]:
%matplotlib inline
import corner
import matplotlib.pyplot as plt
from astropy.cosmology import FlatLambdaCDM
from sculptor import specfit as scfit
from sculptor import specmodel as scmod
[INFO] Import "sculptor_extensions" package: my_extension
[INFO] Import "sculptor_extensions" package: qso
[INFO] SWIRE library found.
[INFO] FeII iron template of Vestergaard & Wilkes 2001 found. If you will be using these templates in your model fit and publication, please add the citation to the original work, ADS bibcode: 2001ApJS..134....1V
[INFO] FeII iron template of Tsuzuki et al. 2006 found. If you will be using these templates in your model fit and publication, please add the citation to the original work, ADS bibcode: 2006ApJ...650...57T
[INFO] FeII iron template of Boroson & Green 1992 found. If you will be using these templates in your model fit and publication, please add the citation to the original work, ADS bibcode: 1992ApJS...80..109B
Fitting a model using MCMC
We begin by loading the example spectrum fit to an SDSS quasar spectrum we have been using in previous tutorials.
[2]:
# Instantiate an empty SpecFit object
fit = scfit.SpecFit()
# Load the example spectrum fit
fit.load('../example_spectrum_fit')
In the next step we need to change the fitting method. Just as a reminder the full list of fitting methods is available as a globa variable in the SpecModel module:
[3]:
for key in scmod.fitting_methods:
print('Name: {} \n Method {}'.format(key, scmod.fitting_methods[key]))
Name: Levenberg-Marquardt
Method leastsq
Name: Nelder-Mead
Method nelder
Name: Maximum likelihood via Monte-Carlo Markov Chain
Method emcee
Name: Least-Squares minimization
Method least_squares
Name: Differential evolution
Method differential_evolution
Name: Brute force method
Method brute
Name: Basinhopping
Method basinhopping
Name: Adaptive Memory Programming for Global Optimization
Method ampgo
Name: L-BFGS-B
Method lbfgsb
Name: Powell
Method powell
Name: Conjugate-Gradient
Method cg
Name: Cobyla
Method cobyla
Name: BFGS
Method bfgs
Name: Truncated Newton
Method tnc
Name: Newton GLTR trust-region
Method trust-krylov
Name: Trust-region for constrained obtimization
Method trust-constr
Name: Sequential Linear Squares Programming
Method slsqp
Name: Simplicial Homology Global Optimization
Method shgo
Name: Dual Annealing Optimization
Method dual_annealing
Let us now set the fitting method to ‘Maximum likelihood via Monte-Carlo Markov Chain’.
[4]:
# Setting the fit method to MCMC via emcee
fit.fitting_method = 'Maximum likelihood via Monte-Carlo Markov Chain'
This fitting method takes additional keyword arguments that specify * the number of MCMC steps (steps), * the number of steps considered to be the burn in phase (burn), which will be discarded, * the number of walkers (nwalkers), which should be a much larger number than your variables * the number of workers (workers) for multiprocessing (workers=4 will spawn a multiprocessing-based pool with 4 parallel processes), * thin sampling accepting only 1 in every thin (int) samples, * whether the objective function has been weightes by measurement uncertainties (is_weighted, boolean), * whether a progress bar should be printed (progress, boolean), * and the seed (default: seed=1234).
Note: The is_weighted keyword will be set to True by default.
For a full documentation of the keyword arguments, please visit the LMFIT emcee documentation. The list of keyword arguments can be accessed via SpecFit.emcee_kws.
[5]:
for key in fit.emcee_kws:
print(key, fit.emcee_kws[key])
steps 1000
burn 300
thin 20
nwalkers 50
workers 1
is_weighted True
progress False
seed 1234
Additional keywords can be added to this dictionary, which will be passed to the SpecModel fit function, once the SpecFit fitting method has been selected to be MCMC (see above).
The default values do not automatically constitute a good default choice. The choice of those parameters is highly dependent on the model fit (e.g., number of variable parameters). In order to properly fit the CIV emission line we will adjust them:
[6]:
# Set the MCMC keywords
fit.emcee_kws['steps'] = 2000
fit.emcee_kws['burn'] = 500
# We are fitting 6 parameters so nwalker=50 is fine
fit.emcee_kws['nwalkers'] = 25
# No multiprocessing for now
fit.emcee_kws['workers'] = 1
fit.emcee_kws['thin'] = 2
fit.emcee_kws['progress'] = True
# Take uncertainties into account
fit.emcee_kws['is_weighted'] = True
Before fitting any model using MCMC it is strongly advised to fit the model with a standard algorithm (e.g., ‘Levenberg-Marquardt’) after setting it up and then start the MCMC fit from the best-fit parameters.
In our case we already fitted all models to the quasar spectrum before saving it. Therefore, we can immediately fit the CIV emission line model.
[7]:
# In case we have forgotten the index of the CIV SpecModel in the fit.specmodels list.
for idx, specmodel in enumerate(fit.specmodels):
print(idx, specmodel.name)
0 Continuum
1 SiIV_line
2 CIV_line
3 CIII]_complex
4 Abs_lines
[8]:
# Select the CIV emission line SpecModel
civ_model = fit.specmodels[2]
# Fit the SpecModel using the MCMC method and emcee_kws modified above
civ_model.fit()
# Print the fit result
print(civ_model.fit_result.fit_report())
100%|██████████| 2000/2000 [00:06<00:00, 288.42it/s]
The chain is shorter than 50 times the integrated autocorrelation time for 7 parameter(s). Use this estimate with caution and run a longer chain!
N/50 = 40;
tau: [60.71255358 65.93961611 64.03676477 66.17055916 63.93059079 73.11907444
61.57293084]
[[Model]]
(Model(line_model_gaussian, prefix='CIV_B_') + Model(line_model_gaussian, prefix='CIV_A_'))
[[Fit Statistics]]
# fitting method = emcee
# function evals = 50000
# data points = 309
# variables = 7
chi-square = 301.595330
reduced chi-square = 0.99866003
Akaike info crit = 6.50516627
Bayesian info crit = 32.6385552
[[Variables]]
CIV_B_z: 3.21141536 +/- 8.0272e-04 (0.02%) (init = 3.209845)
CIV_B_flux: 1091.60304 +/- 132.570578 (12.14%) (init = 1151.246)
CIV_B_cen: 1549.06 (fixed)
CIV_B_fwhm_km_s: 4704.44704 +/- 244.820184 (5.20%) (init = 4790.818)
CIV_A_z: 3.20746100 +/- 0.00166939 (0.05%) (init = 3.209726)
CIV_A_flux: 1880.60255 +/- 118.497872 (6.30%) (init = 1820.904)
CIV_A_cen: 1549.06 (fixed)
CIV_A_fwhm_km_s: 11663.2794 +/- 674.461140 (5.78%) (init = 12121.84)
__lnsigma: -0.03756195 +/- 0.03824749 (101.83%) (init = 0.01)
[[Correlations]] (unreported correlations are < 0.100)
C(CIV_B_flux, CIV_A_flux) = -0.963
C(CIV_B_flux, CIV_B_fwhm_km_s) = 0.942
C(CIV_B_fwhm_km_s, CIV_A_flux) = -0.929
C(CIV_B_flux, CIV_A_fwhm_km_s) = 0.912
C(CIV_A_flux, CIV_A_fwhm_km_s) = -0.803
C(CIV_B_fwhm_km_s, CIV_A_fwhm_km_s) = 0.797
C(CIV_B_z, CIV_A_z) = -0.620
C(CIV_B_z, CIV_A_fwhm_km_s) = -0.576
C(CIV_B_z, CIV_B_flux) = -0.550
C(CIV_B_z, CIV_B_fwhm_km_s) = -0.520
C(CIV_B_z, CIV_A_flux) = 0.487
C(CIV_A_z, CIV_A_fwhm_km_s) = 0.374
C(CIV_B_flux, CIV_A_z) = 0.269
C(CIV_B_fwhm_km_s, CIV_A_z) = 0.242
C(CIV_A_z, CIV_A_flux) = -0.186
We visualize the fit result by plotting the CIV model fit.
[9]:
# Plot the fitted model
civ_model.plot(xlim=[5500,7500])
However, much more important is that we have a look at the sampled parameter space and the posterior distributions of the fit parameters. To do this we first retrieve the sampled flat chain and the plot it using the corner package.
[10]:
# Retrieve the MCMC flat chain of the CIV model fit
data = civ_model.fit_result.flatchain.to_numpy()
# Visualize the flat chain fit results using the typical corner plot
corner_plot = corner.corner(data,
labels=civ_model.fit_result.var_names,
quantiles=[0.16, 0.5, 0.84],
show_titles=True,
title_kwargs={"fontsize": 12}
)
plt.show()
The posterior distributions of the fit parameters look quite well behaved. It seems we have appropriately sampled the parameter space. The plot illustrates strong covariance in some variable parameters pairs (e.g., CIV_A_amp and CIV_A_fwhm_km_s). For further analysis of the MCMC fit, we will now save the flat chain in a file using the SpecModel.save_mcmc_chain function, which takes a folder path as an argument. We will save the flat chain in the example fit folders.
[11]:
# Save the MCMC flatchain to a file for analysis
civ_model.save_mcmc_chain('../example_spectrum_fit')
! ls ../example_spectrum_fit/*.hdf5
../example_spectrum_fit/fit.hdf5
../example_spectrum_fit/specmodel_0_specdata.hdf5
../example_spectrum_fit/specmodel_1_specdata.hdf5
../example_spectrum_fit/specmodel_2_specdata.hdf5
../example_spectrum_fit/specmodel_3_specdata.hdf5
../example_spectrum_fit/specmodel_4_specdata.hdf5
../example_spectrum_fit/specmodel_CIV_line_mcmc_chain.hdf5
../example_spectrum_fit/spectrum.hdf5
Analyzing the MCMC fit results
It is perfectly fine to work with the parameter fit results from the MCMC fit. However, we do have the full flat chain information and, therefore, it may be better to get posterior distributions for all the properties of the continuum or feature we are interested in.
In a previous notebook tutorial we covered how to use SpecAnalysis to analyze our model fits. To construct posterior distributions of the CIV emission line properties we will now use the high-level SpecAnalysis function analyze_mcmc_results, which uses the SpecAnalysis.analyze_continuum and SpecAnalysis.analyze_emission_feature we have introduced earlier.
[12]:
# Import the SpecAnalysis and Cosmology modules
from sculptor import specanalysis as scana
from astropy.cosmology import FlatLambdaCDM
We begin our analysis by specfiying the Cosmology we will be using and then import the model fit.
[13]:
# Define Cosmology for cosmological conversions
cosmo = FlatLambdaCDM(H0=70, Om0=0.3, Tcmb0=2.725)
# Instantiate an empty SpecFit object
fit = scfit.SpecFit()
# Load the example spectrum fit
fit.load('../example_spectrum_fit')
The analyze_mcmc_results function is designed to automatically analyze the output of the MCMC analysis. The user specifies the folder with the MCMC output data and the function will search for any *_mcmc_chain.hdf5* files. As a second argument the function requires the full model fit information (SpecFit object). The third and fourth argument are dictionaries, continuum_listdict and emission_feature_listdict, which specify which continuum models and features should be analyzed.
The continuum_listdict and the emission_feature_listdict hold the arguments for the SpecAnalysis.analyze_continuum and SpecAnalysis.analyze_emission_feature functions that will be called by the MCMC analysis procedure.
The following parameters should be specified in the continuum_listdict: * ‘model_names’ - list of model function prefixes for the full continuum model * ‘rest_frame_wavelengths’ - list of rest-frame wavelengths (float) for which fluxes, luminosities and magnitudes should be calculated
The other arguments for the SpecAnalysis.analyze_continuum are provided to the MCMC analysis function separately.
The following parameters should be specified in the emission_feature_listdict: * ‘feature_name’ - name of the emission feature, which will be used to name the resulting measurements in the output file * ‘model_names’ - list of model names to create the emission feature model flux from * ‘rest_frame_wavelength’ - rest-frame wavelength of the emission feature
Additionally, one can specify: * ‘disp_range’ - 2 element list holding the lower and upper dispersion boundaries flux density integration
For a list of all arguments and keyword arguments, have a look at the function header:
:param foldername: Path to the folder with the MCMC flat chain hdf5 files.
:type foldername: string
:param specfit: Sculptor model fit (SpecFit object) containing the
information about the science spectrum, the SpecModels and parameters.
:type specfit: sculptor.specfit.SpecFit
:param continuum_dict: The *continuum_listdict* holds the arguments for
the *SpecAnalysis.analyze_continuum* function that will be called by
this procedure.
:type continuum_dict: dictionary
:param emission_feature_dictlist: The *emission_feature_listdict* hold the
arguments for the *SpecAnalysis.analyze_emission_feature* functions that
will be called by this procedure.
:type emission_feature_dictlist: dictionary
:param redshift: Source redshift
:type: float
:param cosmology: Cosmology for calculation of absolute properties
:type cosmology: astropy.cosmology.Cosmology
:param emfeat_meas: This keyword argument allows to specify the list of
emission feature measurements.
Currently possible measurements are ['peak_fluxden', 'peak_redsh', 'EW',
'FWHM', 'flux']. The value defaults to 'None' in which all measurements
are calculated
:type emfeat_meas: list(string)
:param cont_meas: This keyword argument allows to specify the list of
emission feature measurements.
Currently possible measurements are ['peak_fluxden', 'peak_redsh', 'EW',
'FWHM', 'flux']. The value defaults to 'None' in which all measurements
are calculated
:type cont_meas: list(string)
:param dispersion: This keyword argument allows to input a dispersion
axis (e.g., wavelengths) for which the model fluxes are calculated. The
value defaults to 'None', in which case the dispersion from the SpecFit
spectrum is being used.
:type dispersion: np.array
:param width: Window width in dispersion units to calculate the average
flux density in.
:type width: [float, float]
:param concatenate: Boolean to indicate whether the MCMC flat chain and
the analysis results should be concatenated before written to file.
(False = Only writes analysis results to file; True = Writes analysis
results and MCMC flat chain parameter values to file)
:type concatenate: bool
IMPORTANT: Only model functions that are sampled together can be analyzed together. Therefore, only model functions from ONE SpecModel can be analyzed together.
THIS MEANS: For example, if you wanted to analyze the continuum model and the CIV emission line together using MCMC, you would have to fit them with ONE SpecModel. In our setup we have separate SpecModels for the continuum and the CIV line. Therefore, we cannot do that. However, to calculate the CIV equivalent width we need the continuum model. In this case we still need to specify the continuum model prefix for the analysis routine. It will build the best-fit continuum model and use it for the CIV analysis. As the best-fit continuum model was subtracted before the CIV line was fit using MCMC, this is the correct way of analzying the results as well.
What does the analyze_mcmc_results actually do?
It identifies for which of the specified models (continuum/features) it can find the necessary MCMC flat chain information. If multiple continuum or feature models have been specified it will go through them one by one. For each entry in the flat chain file it will read in the model function parameters, build the model fluxes, and then analyze the model using the SpecAnalysis.analyze_continuum and SpecAnalysis.analyze_emission_feature functions. If you have very long MCMC chains, this process can easily take several minutes. A progress bar will keep you informed.
What is the result of the analyze_mcmc_results function?
The function will write an “Enhanced Character Separated Values” csv file to the same folder with the MCMC flat chain data. The csv file can be read in and then further manipulated with astropy. Unit information on physical quantities is saved along with the values to the csv file.
Let us now set up both dictionaries for our example:
[14]:
continuum_listdict = {'model_names': ['PL_'],
'rest_frame_wavelengths': [1450, 1280]}
emission_feature_listdict = [{'feature_name': 'CIV',
'model_names' : ['CIV_A_', 'CIV_B_'],
'rest_frame_wavelength': 1549.06}
]
And then run the analyze_mcmc_results function:
[15]:
scana.analyze_mcmc_results('../example_spectrum_fit', fit,
continuum_listdict,
emission_feature_listdict,
fit.redshift, cosmo)
0%| | 14/18750 [00:00<02:14, 138.92it/s]
[INFO] Starting MCMC analysis
[INFO] Working on output file ../example_spectrum_fit/specmodel_CIV_line_mcmc_chain.hdf5
[INFO] Analyzing emission feature CIV
100%|██████████| 18750/18750 [02:09<00:00, 145.09it/s]
It can take a while until the MCMC anlysis finishes. The results are written into the same folder with the MCMC flat chain data. In our case we can find the analyzed results (mcmc_analysis_CIV.csv) in
[16]:
! ls ../example_spectrum_fit/
0_PL__model.json mcmc_analysis_CIV.csv
0_fitresult.json specmodel_0_FitAll_fit_report.txt
1_SiIV_A__model.json specmodel_0_specdata.hdf5
1_SiIV_B__model.json specmodel_1_FitAll_fit_report.txt
1_fitresult.json specmodel_1_specdata.hdf5
2_CIV_A__model.json specmodel_2_FitAll_fit_report.txt
2_CIV_B__model.json specmodel_2_specdata.hdf5
2_fitresult.json specmodel_3_FitAll_fit_report.txt
3_CIII__model.json specmodel_3_specdata.hdf5
3_fitresult.json specmodel_4_FitAll_fit_report.txt
4_Abs_A_model.json specmodel_4_specdata.hdf5
4_Abs_B_model.json specmodel_CIV_line_mcmc_chain.hdf5
4_fitresult.json spectrum.hdf5
fit.hdf5
The analyzed data is saved in the enhanced csv format from astropy. We use astropy.table.QTable to read the file in, retaining the unit information on the analyzed properties.
[17]:
from astropy.table import QTable
t = QTable.read('../example_spectrum_fit/mcmc_analysis_CIV.csv', format='ascii.ecsv')
t
[17]:
| CIV_peak_fluxden | CIV_peak_redsh | CIV_EW | CIV_FWHM | CIV_flux | CIV_lum |
|---|---|---|---|---|---|
| erg / (Angstrom cm2 s) | Angstrom | km / s | erg / (cm2 s) | erg / s | |
| float64 | float64 | float64 | float64 | float64 | float64 |
| 1.7025458953823565e-16 | 3.2114519863017534 | 33.11496431713009 | 6266.596338612362 | 2.961265327675218e-14 | 2.7272731887439896e+45 |
| 1.6721664115085754e-16 | 3.210481058669064 | 32.99822135043035 | 6460.856063522636 | 2.9499538664435997e-14 | 2.716855532259717e+45 |
| 1.723933433168788e-16 | 3.2114519863017534 | 33.469930987621815 | 6088.369860660105 | 2.9935535993120595e-14 | 2.757010117996179e+45 |
| 1.7182794771269916e-16 | 3.210481058669064 | 33.31534363653506 | 6173.896793403524 | 2.979287938638493e-14 | 2.743871695879414e+45 |
| 1.6878815917188721e-16 | 3.210481058669064 | 33.161937379596345 | 6455.038209974451 | 2.966046822693796e-14 | 2.7316768614052704e+45 |
| 1.7320789412335437e-16 | 3.2114519863017534 | 33.78160061683048 | 6330.212961485504 | 3.0213830308964116e-14 | 2.7826405341256157e+45 |
| 1.6987702663876353e-16 | 3.2114519863017534 | 33.42811472924633 | 6367.250543886042 | 2.9898229578526494e-14 | 2.753574262946658e+45 |
| 1.7002049199831065e-16 | 3.2114519863017534 | 33.37302405915962 | 6409.616175461986 | 2.9844375270940024e-14 | 2.7486143761102343e+45 |
| 1.6755933939029979e-16 | 3.210481058669064 | 33.34759616649851 | 6497.096461492717 | 2.982464934483506e-14 | 2.7467976530734148e+45 |
| ... | ... | ... | ... | ... | ... |
| 1.7230147389554056e-16 | 3.2114519863017534 | 33.37479397925696 | 6147.307197386451 | 2.9851667159581736e-14 | 2.749285946205694e+45 |
| 1.713119163521492e-16 | 3.2114519863017534 | 33.60186777044355 | 6391.03239870545 | 3.0058406077155686e-14 | 2.768326236236442e+45 |
| 1.699526629230714e-16 | 3.210481058669064 | 33.525326140779796 | 6440.871721101392 | 2.9989658270368215e-14 | 2.761994684366228e+45 |
| 1.6981870118562772e-16 | 3.2114519863017534 | 33.24090141975268 | 6339.25589718063 | 2.972627229916071e-14 | 2.7377373005089886e+45 |
| 1.7190133988262977e-16 | 3.210481058669064 | 33.99497119170071 | 6413.170514132771 | 3.039412004497653e-14 | 2.7992449011384977e+45 |
| 1.7353516300351097e-16 | 3.210481058669064 | 33.62373692126313 | 6255.61972575812 | 3.0067364499910786e-14 | 2.7691512911872792e+45 |
| 1.7204870649017424e-16 | 3.2114519863017534 | 33.10115578309755 | 6194.743638300733 | 2.9599731342699945e-14 | 2.7260831013864665e+45 |
| 1.7059536939278595e-16 | 3.2114519863017534 | 33.039315764377186 | 6271.252179226404 | 2.9565184692661265e-14 | 2.7229014157897432e+45 |
| 1.699557133889922e-16 | 3.210481058669064 | 33.63234776488099 | 6388.014093185133 | 3.0056768200666273e-14 | 2.7681753906977356e+45 |
| 1.6877095368987712e-16 | 3.2114519863017534 | 33.377005078544634 | 6350.536884815106 | 2.984901209178342e-14 | 2.749041419139746e+45 |
With the table data we can visualize the posterior distributions for all measurements and further analyze them.
[18]:
import numpy as np
import matplotlib.pyplot as plt
prop = 'CIV_EW'
# Calculate median, lower and upper 1-sigma range
med = np.median(t[prop])
low = np.percentile(t[prop],16)
upp = np.percentile(t[prop],84)
print('Property: {}'.format(prop))
print('Median: {:.2e}'.format(med))
print('Lower 1-sigma: {:.2e}'.format(low))
print('Upper 1-sigma: {:.2e}'.format(upp))
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.hist(t[prop].value, bins=40)
ax.axvline([med.value], ymin=0, ymax=1, color='#ff7f0e', lw=4, label='Median')
ax.axvline(low.value, ymin=0, ymax=1, color='#ff7f0e', lw=2, ls='--', label=r'$1\sigma$ uncertainties')
ax.axvline(upp.value, ymin=0, ymax=1, color='#ff7f0e', lw=2, ls='--')
plt.xlabel('{} ({})'.format(prop, med.unit))
plt.ylabel('N')
plt.legend()
plt.show()
Property: CIV_EW
Median: 3.33e+01 Angstrom
Lower 1-sigma: 3.29e+01 Angstrom
Upper 1-sigma: 3.37e+01 Angstrom


This intention replaces a post fix increment or decrement expression with an equivalent operator assignment expression.


The "Twitter datastream" contains tuples of the form:
(messageID, message, userID_of_posting_user, in_reply_to_messageID, time_of_posting, language_of_message).
You can assume that $messageID$ and $userID$ are unique, i.e. every message has a unique identifier and every user has a unique identifier. If the message is not posted in reply to any other message, we have $in\_reply\_to\_messageID=null$.
Examples of tuples in that stream are:
(124324234324, "@Nelly: I had breakfast just now!", 33523232,<PHONE_NUMBER>74, "23/11/2014", "English").
(435345332432, "Sitting in Paris, drinking a coffee", null,<PHONE_NUMBER>74, "24/11/2014", "English").
We want to answer queries by sampling roughly 1/10th of the data. What is a good sampling strategy to answer the following query: What is the fraction of messages written in English?


Media to ASCII Art Converter
I mean, the name says it all.
Add that "text-ure" to that photo or video! Give it some "character"!
Don't believe in my puns? See it for yourself!
Looks pretty cool, right?
Give it a shot!Converter Online
Options
Hover over one to view description
Download
The online version does have its limitations.
Wanna have the ability to convert to ASCII anytime? Now you can!
About
This project started off as a fun little script I wrote up in an hour. Then I decided to try and convert some big 60 FPS videos. Then I decided to make it a full-blown full-stack service.
Ho boy, projects can get big quick!
Regardless, this was all just for funsies and coding experimentation. I honestly don't care how many people use it, it'll just be here until the servers or the Internet decides to die.
Support
All of the poorly written code is publicly available under MIT license.
You are more than welcome to contribute and help improve it.


Amount tried: probably less than 1/10 of 1/2 of a gram (well, probably about 1/8th of whatever comes in that free 5x salvia pouch)
Location: Alone in my apartment, on a lazy sunny late-August afternoon
Time: Started 4:15pm, main trip ended 4:25pm, completely wore off at 6:15pm
Other drugs: I was feeling a little lazy and bored this afternoon, and had about 3 beers over the course of 3 hours. When I finished the last beer I had a very slight buzz, and decided, wtf, since there's nothing good on tv I might as well try this salvia 5x sample I got. I was waiting for just the right moment when I felt calm and collected, with ample time on my hands, and this was it.
Account:
****
Reading what others have described about salvia, I kinda expected some sort of mind blowing experience, wall meltings, face melting, falling off the end of the universe into some other parallel dimension kind of trip with this drug. One person even described the trip as if it was being on a roller coaster. And that's how I ended up approaching my 10 minute trip into 'Salvia-Land.'
 I sat on my recliner in my underwear since some people said to expect being really hot and sweaty and draped my bedsheet over me. I took my glasses off to be more comfortable. I loaded up my one-hitter and took the whole thing in one hit, and set it down, expecting somethig miraculous to happen. Nothing happened, so I loaded up and took another hit. This time, the world seemed a little different. Back to the roller coaster analogy, I felt as if the recliner I was in was the cockpit, or seat, of some kind of roller-coaster ride, and there were people to the side of me, friends, perhaps, but altogether nice people, waiting for me to give the go before the rocket ship, or coaster, or whatever would take off.
I felt this only in my mind, however, as the whole time I was staring at the clock right above my entertainment center (tv off) watching the second hand go round, thinking of it as a countdown to liftoft, or something like that. I waited for a few seconds, and then burst out laughing. The whole idea of me in a cockpit in my underwear seemed really hilarious. I should mention at this time my body started to feel slightly numb, and my mood euphoric. I had a firm grip on my external reality and had no open eye visuals, but was allowing this fantasy to play out in my inner mental theatre; I certainly was aware that outside my mind it was a normal sunny August Sunday afternoon. When I was staring at the clock the borders around objects seemed to melt and bend a little, and I had the feeling that I was a little hypnotized as I watched the second hand move. But when I moved my head slightly and shifted my gaze, I snapped out of it.
I was a little disappointed with the trip, in all, having got the opinion that I would soar through space on this drug from reading other's accounts. But I took a really small dose to see what would happen as I was really nervous about throwing up, or having a panic attack if I took too much since I didn't have a sitter, and decided to take little baby steps into outer 'salvia' space.
The whole time I was trying this, I thought, 'Damn, I gotta write this down and share this with others--it is hilarious! Me in a flying cockpit, how absurd!!' When the major effects died down I rushed to my computer to type this up, and here I am.  It has been about 20 minutes (boy, the time sure seems to fly!). I had trouble typing this while writing when I got started, but am now seeming to do ok. I am trying to give the most accurate account of what happened, and my mind and body are a little fuzzy, but I feel like I am still intact. Overall, I feel much like I feel while being modereately high on marijuana; I am euphoric and my body and head feel heavy.
My mind is still intact, as it was the whole time (completely logical/analytical, no loss of concentration or short-term memory as with mj), but I felt like at the peak of the trip as though I could 'let go' for a second or two and see what would happen, but I still knew I could come back any second. I will try this again in a little bit at a higher dose, but I'm not sure what to do since I only have my small one-hitter; it seems like in order to have a full mind-blowing trip I need a bigger pipe. I will write back when I try more later.
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.


--- layout: page title: Incentives description: An overview of Sarcophagus early adopter bonding-based archaeologist incentive program. ---
https://mining.sarcophagus.io stablecoin depositors have $SARCO distributed in proportion to their stake in the pool. 1m tokens are distributed equally over 1 year, started at 00:00 UTC Jan 13th, 2021.
2m $SARCO allocated for user grants/incentives will be distributed to users who create and manage sarcophagi on the dApp in the first 30 days after mainnet launch. The distribution will be equal to the fees paid to the archaeologist by the embalmer, in the creation and management of sarcophagi.
15m + 2m $SARCO allocated for archaeologist bonding + grants (a decision was made to combine grants and incentives due to legal / accounting troubles created by grants without consideration). The 17m $SARCO will be distributed per archaeologist in proportion to the amount of $SARCO bonded, over the course of one year, calculated per second. In short: the more an Archaeologist has bonded, for longer, the more they will earn.
A plan to commit 2.5m $SARCO tokens from the DAO's treasury to incentivize liquidity on Uniswap. Likely in the form of an LP-Token lock linear release mechanism. This would work just like the current Liquidity Mining contract except instead of accepting USDC, DAI, and USDT, it only accepts ETH-SARCO UNI-V2 LP tokens. It would run for one year and would distribute the tokens linearly.


I am passionate about web & graphic design and especially storytelling through different pieces of graphs, words, and color. I love the idea of creating something interesting and beautiful that hasn't existed before. Inspiration is the best form of caffeine. Located in New York.


Knob
public class Knob : Gradient, UIGestureRecognizerDelegate
The Knob
UI components of RangeUIslider. It is a customized UIView
.
It is a subclass of Gradient
view.
-
The knobs UI components. See
KnobComponents
class.Declaration
Swift
public let components: KnobComponents
-
Gesture recognizer delegate method implementation for knob movement.
Declaration
Swift
public func gestureRecognizer( _ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer ) -> Bool
-
Gesture recognizer delegate method implementation for knob movement.
Declaration
Swift
public func gestureRecognizer( _ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer ) -> Bool
-
Gesture recognizer delegate method implementation for knob movement.
Declaration
Swift
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool


--- layout: post title: Juan I de castilla date: '2013-04-10T10:24:00+02:00' categories: - Atoleiros Battle - Storyboards picture_url: https://film-Storyboards.tumblr.com/post/47623710317/juan-i-de-castilla ---
Juan I de Castilla


THE LAST BOY SCOUT A film review by Drifter Copyright 1992 Drifter
Oh, so maybe Bruce Willis messed up with HUDSON HAWK. And maybe action movies are getting passe or formulaic or whatever....
I still liked THE LAST BOY SCOUT.
The movie had plenty of action, though none of the intense, endless type in DIE HARD. A bit more keyed down. There are certain scenes that are totally impossible, yes. But there were good one-liners, fairly interesting (if stereotypical) characters, and definitely good acting.
One thing that impressed me was Bruce Willis's character's daughter. A totally atypical young daughter character played very well by a young female actress that looks very familiar. While her role is pretty much passive, the conflicts between her and her father are sharply defined and rather intense. More so than between Bruce Willis's character and his wife.
Meanwhile, the buddy character, played by the young actor from IN LIVING COLOR without the hair, is rather amusing but rather passive, compared to Bruce Willis. This may be a matter of writing rather than acting, however. It is certainly quite a leap from pure comedy to violent-action-buddy-cop material.
By far, my favorite character was the nasty young bad guy with the short blonde hair and misfortune to fall into large flying machines. He reminds me significantly of an actor who used to play on the old TOO CLOSE FOR COMFORT series that had Ted Knight as a father with two daughters. I do not know if it is the same actor, but he made an appealing villain.
There is no doubt that this movie would fall apart under close scrutiny, with contradictions and holes and fairly simple plotting. But it has good production values and good acting, with nicely done action scenes and a great kicker of an opening sequence. I recommend the movie for action fans who do not want to bother with any deep, meaningful material or worrying about just *where* all those bullets come from....
.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


--- layout: master title: Home description: Home page for Ankit Kulkarni's webpage and blog ---
“ I Code Because I Love To, Not Because I Have To ”
{{ post.content | strip_html | truncatewords: 10 }}


--- layout: default title: About permalink: /about/ author: dagarath ---
I am really just a dood who wants to make code related things.
I do stuff goodest


Salinui chueok (2003)
★
8.1 / 10 (46,443 votes)
14A — 130 min — Crime Drama Mystery
Cast:
Kang-ho Song
Sang-kyung Kim
Roe-ha Kim
Languages:
Korean
English
In 1986, in the province of Gyunggi, in South Korea, a second young and beautiful woman is found dead, raped and tied and gagged with her underwear. Detective Park Doo-Man and Detective Cho...
Data Retrieved: 2014-11-27


-
-
0
Subtotal :$3300
<EMAIL_ADDRESS>+91 95245 40381
Subtotal :$3300
Lorem ipsum dolor sit amet, conseetuer adipiscing elit. Aenan comdo igula eget. Aenean massa cum sociis Theme natoque.
Price $840
Price $760
Price $620
Lorem ipsum dolor sit amet, conseetuer adipiscing elit. Aenan comdo igula eget.  Aenan comdo igula eget. Aenean massa cum sociis Theme natoque.
Lorem ipsum dolor sit amet, conseetuer adipiscing elit. Aenan comdo igula eget.  Aenan comdo igula eget. Aenean massa cum sociis Theme natoque.
There are many variations of passages of lorem ipsum available but the majority have suffered alteration...
There are many variations of passages of lorem ipsum available but the majority have suffered alteration...
Lorem Ipsum is simply dummied text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since when an unknown printer took a galley of type and scrambled it to make a type specimen book.printing and typesetting industry It has survived not only five centuries.
29 Division Pt New York, NY 10002, USA
+0 (321) 984 754 Give us a call
<EMAIL_ADDRESS>online support


We will introduce IP Address, Packets and Routing in this section.
An Internet Protocol address (IP address) is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: host or network interface identification and location addressing.
Internet Protocol version 4 (IPv4) defines an IP address as a 32-bit number. However, because of the growth of the Internet and the depletion of available IPv4 addresses, a new version of IP (IPv6), using 128 bits for the IP address, was standardized in 1998. IPv6 deployment has been ongoing since the mid-2000s.
IP addresses are written and displayed in human-readable notations, such as <IP_ADDRESS> in IPv4, and 2001:db8:0:1234:0:567:8:1 in IPv6. The size of the routing prefix of the address is designated in CIDR notation by suffixing the address with the number of significant bits, e.g., <IP_ADDRESS>/24, which is equivalent to the historically used subnet mask <IP_ADDRESS>.
The IP address space is managed globally by the Internet Assigned Numbers Authority (IANA), and by five regional Internet registries (RIRs) responsible in their designated territories for assignment to local Internet registries, such as Internet service providers (ISPs), and other end users. IPv4 addresses were distributed by IANA to the RIRs in blocks of approximately 16.8 million addresses each, but have been exhausted at the IANA level since 2011. Only one of the RIRs still has a supply for local assignments in Africa. Some IPv4 addresses are reserved for private networks and are not globally unique.
Network administrators assign an IP address to each device connected to a network. Such assignments may be on a static (fixed or permanent) or dynamic basis, depending on network practices and software features.
This is a typical ip address and its dotted-decimal notation
In telecommunications and computer networking, a network packet is a formatted unit of data carried by a packet-switched network. A packet consists of control information and user data; the latter is also known as the payload. Control information provides data for delivering the payload (e.g., source and destination network addresses, error detection codes, or sequencing information). Typically, control information is found in packet headers and trailers. In packet switching, the bandwidth of the transmission medium is shared between multiple communication sessions, in contrast to circuit switching, in which circuits are preallocated for the duration of one session and data is typically transmitted as a continuous bit stream.
Routing is the process of selecting a path for traffic in a network or between or across multiple networks. Broadly, routing is performed in many types of networks, including circuit-switched networks, such as the public switched telephone network (PSTN), and computer networks, such as the Internet. In packet switching networks, routing is the higher-level decision making that directs network packets from their source toward their destination through intermediate network nodes by specific packet forwarding mechanisms. Packet forwarding is the transit of network packets from one network interface to another. Intermediate nodes are typically network hardware devices such as routers, gateways, firewalls, or switches. General-purpose computers also forward packets and perform routing, although they have no specially optimized hardware for the task.
The routing process usually directs forwarding on the basis of routing tables. Routing tables maintain a record of the routes to various network destinations. Routing tables may be specified by an administrator, learned by observing network traffic or built with the assistance of routing protocols.
For example: we have a simple network of two computers and a router. Host A wants to communicate with Host B. Because hosts are on different subnets, Host A sends its packet to the default gateway (the router). The router receives the packet, examines the destination IP address, and looks up into its routing table to figure out which interface the packet will be sent. It then sends the packet to Host B.
This figure shows a simple network and how to routing in this.
Because we always need to find the resource server in the complex network, and the IP address is the best way for us to locate our target and visit it.
Because we need to send and receive data through the data, and a packet as the container for the data could help us organize it more convenient and efficient.
Routing is one of the most importing steps when sending the packet because we need to determine the path which the packet while be sent through. And routing could help us determine the nodes in this path.


Debugging page!
Here's what you said to say:
{% for report in error %}
{{ report.text }}
{% endfor %}


Inputs a directory of climate projection files and, for each, identifies and characterizes heat waves for specified study locations. The definition used to identify heat waves can be customized. Heat wave characterizations include several metrics of heat wave length, intensity, and timing in the year. The heat waves that are identified can be explored using a function to apply user-created functions across all generated heat wave files.This work was supported in part by grants from the National Institute of Environmental Health Sciences (R00ES022631), the National Science Foundation (1331399), and the Colorado State University Vice President for Research.
| Version: | 1.0.3 |
| Depends: | R (≥ 2.10) |
| Imports: | data.table (≥ 1.10.0), dplyr (≥ 0.4.3), ggplot2 (≥ 2.0.0), ggthemes (≥ 3.0.0), leaflet (≥ 1.0.1), Rcpp (≥ 0.12.5), stringr (≥ 1.1.0), tidyr (≥ 0.6.0) |
| LinkingTo: | Rcpp |
| Suggests: | gridExtra (≥ 2.0.0), knitr (≥ 1.10.5), mapproj (≥ 1.2.4), maps (≥ 3.0.2), rmarkdown (≥ 0.7.0), testthat (≥ 0.11.0), weathermetrics (≥ 1.2.2) |
| Published: | 2016-12-31 |
| Author: | Brooke Anderson [aut, cre], Colin Eason [aut], Elizabeth Barnes [aut] |
| Maintainer: | Brooke Anderson <brooke.anderson at colostate.edu> |
| License: | GPL-2 |
| NeedsCompilation: | yes |
| Materials: | README NEWS |
| CRAN checks: | futureheatwaves results |
| Reference manual: | futureheatwaves.pdf |
| Vignettes: |
'futureheatwaves' package vignette Starting from netCDF files |
| Package source: | futureheatwaves_1.0.3.tar.gz |
| Windows binaries: | r-devel: futureheatwaves_1.0.3.zip, r-release: futureheatwaves_1.0.3.zip, r-oldrel: futureheatwaves_1.0.3.zip |
| OS X binaries: | r-release: futureheatwaves_1.0.3.tgz, r-oldrel: futureheatwaves_1.0.3.tgz |
| Old sources: | futureheatwaves archive |
Please use the canonical form https://CRAN.R-project.org/package=futureheatwaves to link to this page.


You need to enable JavaScript to run this app.
Welcome to AudiSea!
Select an Artist
and watch AudiSea come alive
Yazoo
Stravinsky
The Beatles
Paul Anka
Hint: Say 'play song name' to use voice control!
Powered By Spotify API
Now playing:
nothing!


How Joker’s gritty logo was created with wood type letterpress
The making of an iconic logo
by William JoelA movie’s logo is often one of the first things that fans see, whether it’s on posters or in a trailer, so it’s not uncommon for studios to spend large amounts of money creating them to build excitement. There’s a lot at stake, and there are entire agencies that specialize in logo creation, with logos passing through the hands of multiple stakeholders and going through several revisions before the public sees them.
That’s why I was so surprised when I discovered that the logo for the DC film Joker was created by one designer, Chad Danieley, with wood type letterpress. In a Reddit post, Danieley explained how going analog captured the film’s tone and feel better than a digitally created logo would have. I reached out to Danieley to learn more about the logo creation process, his influences, and personal projects.
This interview has been lightly edited for clarity.
To kick things off, want to tell us a little bit about yourself and your background?
I studied graphic design / motion graphics at ArtCenter [College of Design] in Pasadena. They had a great letterpress studio that was like my second home. In my final two terms at ArtCenter, I interned with [graphic designer] Pablo Ferro (The Thomas Crown Affair, Dr. Strangelove). I would scan his work into the computer for his archives, which would always include hours of stories about his process.
For his signature style in Dr. Strangelove, he would draw over fonts for the main title, which is a unique approach. I would try the same sample sheets, and they would look nothing like his. Same with letterpress. If another person used the same wood type, it would have a different feeling for someone else. The personality comes through in the beat-up / dented faces of the type as well as the inking style and how much packing the artist adds or takes away that makes it interesting. Ferro had a strong impact on my career and my process early on.
After graduation, I freelanced at a few motion studios for five years, then went to staff at NBC’s on-air department for eight years. For the last three years, I have returned to freelancing.
How did you join this project?
I was freelancing at Elastic on logos for the show See, and the Joker project came in, and they needed help with pitching logos for Joker. I spent two days on the computer making a bunch of logos in Illustrator, but in the end, it was the first one I did that is the “JOKER” logo as you see it today, “as is” with no changes asked, definitely a first for me.
Can you talk us through the creative process for this logo and letterpress in general?
Very little information was given for me to go off. All that was said is that it’s much darker and more visceral than the usual DC Jokers. “Think Taxi Driver.”
I have an HD full of letterpress-printed sample sheets, and within each print run, I’ll print several states. For this project, I did aggressive / transparency / scraping / noise of that one typeface, then scanned and cataloged each of them. I am not a “purist,” but I have always needed to bring my work outside of the computer by printing it out and adding some of myself into it. Physical objects, like wood type or Letraset, rub down type and help me perceive space in a different way. I don’t always need to work this way, but it does help.
It’s great to see that this was made using a letterpress. It might be all in my head, but something about it just feels textile and real as opposed to, say, a digitally created design. Was there any post-work done, or is this pretty accurate to the original?
Yes, even after the logo was selected, we tried to make a version that was done in Illustrator, but it just didn’t feel right. The wood type is structurally warped, and I think that’s what makes it what it is. Regarding post-work, not much was done to the original presented logo. WB added slight color to the logo for each poster. The original scan of the print I used was a little transparent, so I just bumped up the levels in Photoshop. But other than that, it’s very accurate to the original print.
What font did you use? I actually can’t make it out!
It’s an unnamed Gothic. I tend to gravitate toward Gothic digital fonts as well as Gothic wood type as workhorses. They don’t have a lot of style baggage attached to them, which allows me to prod and scrape at them to really turn them into what I’m looking for. When I start adding a lot of texture, I need the typeface to not have a loud voice. Gothic gives me that.
Are there any alts out there? Did it take some experimenting to land on one that felt right?
No wood type alternates, just the one. I did submit 16 logos that were done in Illustrator, though.
I really enjoy the collages you have on your Instagram . Are they primarily personal?
Thank you! Yes, the collages and letterpress are both me needing to do something for my own creative output, not just for jobs. Of course, I always bring those explorations into my day work, though.
What else are you working on right now? Anything coming up that you’re excited about?
I’m starting to digitize some of my wood type to make some fonts. I’m also doing some Joker-themed letterpress prints, and at Elastic, I’m still working on Joker graphics for WB!


|
||||||||||
| PREV LETTER NEXT LETTER | FRAMES NO FRAMES |
SAXContentHandler
builds a dom4j tree via SAX events.XMLReader
to parse the source.
XMLReader
to parse the source.
SAXReader
creates a DOM4J tree from SAX parsing events.SAXValidator
validates an XML document by writing the document
to a text buffer and parsing it with a validating SAX parser.SAXWriter
writes a DOM4J tree to a SAX ContentHandler.SchemaParser
reads an XML Schema Document.selectNodes
performs the given XPath expression on the
List
of Node
instances appending all the results together
into a single list.
selectNodes
performs the given XPath expression on the
List
of Node
instances appending all the results together
into a single list.
selectNodes
evaluates an XPath expression and returns the
result as a List
of Node
instances or
String
instances depending on the XPath expression.
selectNodes
evaluates an XPath expression then sorts the
results using a secondary XPath expression Returns a sorted
List
of Node
instances.
selectNodes
evaluates an XPath expression then sorts the
results using a secondary XPath expression Returns a sorted
List
of Node
instances.
selectNodes
performs this XPath expression on the given
Node
or List
of Node
s instances appending all
the results together into a single list.
selectNodes
evaluates the XPath expression on the given
Node
or List
of Node
s and returns the result as
a List
of Node
s sorted by the sort XPath
expression.
selectNodes
evaluates the XPath expression on the given
Node
or List
of Node
s and returns the result as
a List
of Node
s sorted by the sort XPath
expression.
selectObject
evaluates an XPath expression and returns the
result as an Object
.
selectSingleNode
evaluates an XPath expression and returns
the result as a single Node
instance.
selectSingleNode
evaluates this XPath expression on the
given Node
or List
of Node
s and returns the
result as a single Node
instance.
Element.addAttribute(String,String)
instead. WILL BE REMOVED IN
dom4j-1.6 !!
Element.addAttribute(QName,String)
instead. WILL BE REMOVED IN
dom4j-1.6 !!
XSDatatype
for the given
<attribute> QNames
List
of
Node
instances.
ContentHandler
called when SAX events are raised
Node.setText(String)
if it doesn't.
Node.setText(java.lang.String)
if it doesn't
ElementHandler
instances have been
registered, this will set a default ElementHandler
to be
called for any path which does NOT have a handler registered.
ElementHandler
instances have been
registered, this will set a default ElementHandler
to be
called for any path which does NOT have a handler registered.
ElementHandler
instances have been
registered, this will set a default ElementHandler
to be
called for any path which does NOT have a handler registered.
SAXSource
setDocument
sets the document of this node if the parent
relationship is supported or does nothing if the parent relationship is
not supported.
DocumentFactory
used to create new
documents.
DocumentFactory
used to create the DOM4J
document tree.
DocumentFactory
used to create new
documents.
DocumentFactory
used to create new
documents.
DocumentFactory
used to create new
documents.
Document
implementation class used by
the writer when creating DOM documents.
Document
implementation class name used
by the writer when creating DOM documents.
DTDHandler
.
Node.setName(java.lang.String)
method.
EntityResolver
.
ErrorHandler
used by the SAX
XMLReader
.
ErrorHandler
used by the SAX
XMLReader
.
ErrorHandler
.
<tagName>
to
<tagName></tagName>
.
org.dom4j.dtd
package
String
to use; this is usually a
String
of empty spaces.
String
's size; an indentSize of
4 would result in the indention being equivalent to the
String
" " (four space characters).
org.dom4j.dtd
package
LexicalHandler
.
UnsupportedOperationException
if it is read-only.
Namespace
of this element or if this element is
read only then an UnsupportedOperationException
is thrown.
<?xml version="1.0"
encoding="UTF-8"?>
)
includes the encoding of the document.
setParent
sets the parent relationship of this node if the
parent relationship is supported or does nothing if the parent
relationship is not supported.
QName
of this element which represents the local
name, the qualified name and the Namespace
.
<?xml version="1.0"
encoding="UTF-8"?>
)
is included or not.
Node.setName(java.lang.String)
method.
UnsupportedOperationException
if it is read-only.
Element.getTextTrim()
.
UnsupportedOperationException
if it is read-only.
SAXSource
.
XMLReader
used to parse SAX events
XMLReader
used to parse SAX events
XMLReader
used to write SAX events to
XMLReader
to be used to parse
SAX events.
XMLWriter
used to write the modified document.
SimpleSingleton
is an implementation of the SingletonStrategy
interface used to provide common factory access for the same object instance.SingletonStrategy
is an interface used to provide common
factory access for the same object based on an implementation strategy for
singleton.sort
sorts the given List of Nodes using an XPath
expression as a Comparator
.
sort
sorts the given List of Nodes using an XPath
expression as a Comparator
and optionally removing
duplicates.
sort
sorts the given List of Nodes using this XPath
expression as a Comparator
.
sort
sorts the given List of Nodes using this XPath
expression as a Comparator
and optionally removing
duplicates.
Document
, as well as other Node
s, from a StAX
XMLEventReader
.STAXEventReader
instance with a
default DocumentFactory
.
STAXEventReader
instance that uses the
specified DocumentFactory
to construct DOM4J Node
s.
Node
s to a StAX event stream.STAXEventWriter
that writes events to the
provided file.
STAXEventWriter
that writes events to the
provided character stream.
STAXEventWriter
that writes events to the
provided stream.
STAXEventWriter
that writes events to the
provided event stream.
Stylesheet
implements an XSLT stylesheet such that rules can
be added to the stylesheet and the stylesheet can be applied to a source
document or node.supportsParent
returns true if this node supports the
parent relationship.
|
||||||||||
| PREV LETTER NEXT LETTER | FRAMES NO FRAMES |


Given a DNA strand, return its RNA complement (per RNA transcription). Both DNA and RNA strands are a sequence of nucleotides. The four nucleotides found in DNA are adenine (A), cytosine (C), guanine (G) and thymine (T). The four nucleotides found in RNA are adenine (A), cytosine (C), guanine (G) and uracil (U).
Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement:
In pairs, write out the steps to solve this problem. No code, only explanation.
Document Object Model - i.e. a map of our HTML document
Defines the logical structure of an HTML document and how it is accessed and manipulated
Anything found in an HTML or XML document can be accessed, changed, deleted, or added by a programmer using the DOM
The document object is globally available in your browser. It allows you to access and manipulate the DOM of the current web page:
Finding DOM nodes by id:
document.getElementById(id);
Finding DOM nodes by class name:
document.getElementsByClassName(className);
HTML:
- Playing the banjo
- Paddleboarding
JavaScript:
// By Id
var hobbiesList = document.getElementById('hobby-list');
// By Class Name
var alsoHobbies = document.getElementsByClassName('hobby');
You can access and change the styles of a DOM nodes via the style property
CSS:
body {
color: red;
background-color: pink;
padding-top: 10px;
}
//Applying the Same Styles via JavaScript:
var pageNode = document.body;
pageNode.style.color = 'red';
pageNode.style.backgroundColor = 'pink';
pageNode.style.paddingTop = '10px';
var pageNode = document.body;
console.log(pageNode.innerHTML);
//You can set innerHTML yourself to replace the contents of the node:
pageNode.innerHTML = " "
//You can also just add to the innerHTML,
//instead of replacing it altogether:
pageNode.innerHTML += "P.S. Please do write back.";


{% extends "bootstrap/layouts/base_navbar_responsive.html" %} {%- from "bootstrap/forms/macros.html" import render_field %} {%- from "frontend/macros.html" import follow_toggle %} {%- from "talk/macros.html" import show_comment with context %} {% block title %} {{thread.title}} {% endblock %} {% block content %}


Floating point numbers are inherently imprecise. This can be problematic when we try to unit test numerical algorithms. Let’s see this on an example (JVM/Scala, ScalaTest used as a testing framework):
This test works just fine… until someone decides to
do a “harmless refactoring” and replaces d*d
by Math.pow(d, 2)
:
Now the test fails with the following message:
The expected and the actual values differ by ~5.6E-17. Doubles offer precision of about 15 significant digits in a result. All the other digits after 15th digit are just noise that should be ignored.
To make our unit-test more robust we have two strategies. The first strategy is to know the precision that is guaranteed by the algorithm that we are using, and to round the result to that precision before returning it to the client:
The second strategy is to use assertions intended to work with floating point numbers. Again to use them correctly we need to be aware of the precision of our algorithm:
In this case it is good to define the precision as a global constant (or as a constant per algorithm).
Personally I prefer the first strategy, but with either of them our tests will be more robust and refactoring-friendly.
Troubles with NaN
Totally different set of problems are connected to NaN
values.
On JVM operator ==
and equals
behave
inconsistently when comparing NaN
s:
Unit testing frameworks often do not help here much. For example the following test:
will fail with a rather unhelpful message:
According to ScalaTest guidelines we should use Double#isNaN
to check if a value is NaN
:
We experience similar troubles when we try to
compare case classes containing double fields with NaN
values:
I do not have a good solution for this problem.
We can either create a custom assertion for a given case class ourselves,
define a custom equality using
Scalactic
or we can use Option[Double]
and
somehow map NaN
s to Option
s None
.
None of the solutions is great.
The last thing to remember is that we cannot match
NaN
values:


Google buys Fitbit for £1.6 billion as it looks to enter fitness tracker market
Google has announced that it has bought Fitbit, as part of a plan to move into the fitness tracker market
by Shivali Best, https://www.facebook.com/shivalibestjournalist/Google has bought Fitbit for a whopping $2.1 billion (£1.62 billion), as it looks to make its mark in the fitness tracker and smartwatch industry.
In a blog announcing the news, Rick Osterloh, Senior Vice President of Devices & Services at Google , said: “Fitbit has been a true pioneer in the industry and has created engaging products, experiences and a vibrant community of users.
“By working closely with Fitbit’s team of experts, and bringing together the best AI, software and hardware, we can help spur innovation in wearables and build products to benefit even more people around the world.”
Mr Osterloh added that Google plans to keep privacy and security at the forefront.
He added: “When you use our products, you’re trusting Google with your information. We understand this is a big responsibility and we work hard to protect your information, put you in control and give you transparency about your data.
“Similar to our other products, with wearables, we will be transparent about the data we collect and why. We will never sell personal information to anyone.
“Fitbit health and wellness data will not be used for Google ads. And we will give Fitbit users the choice to review, move, or delete their data.”
This isn’t Google’s first foray into the smartwatch industry.
The tech giant already has a smartwatch operating system, dubbed Wear OS, which is currently available on a range of devices, including the Fossil Sport, Armani Exchange Connected and Hugo Boss Touch.


Get a random card object based on index of GameStates.
(number)
number corresponding to GameState array
object
:
card object
Renders the card object to the screen and data
(object)
The current Phaser scene
object
:
card Text object
Add and return a character container with stats
(object)
object
(number)
coordinate of container
(number)
coordinate of container
(string)
name of image key from preload
(object)
data object about character
object
:
A container object of the character
Toggles the visual selection and is_selected in container data
(object)
a character's container object
(object)
optional scene object to return array of selected characters
array
:
An array of currently selected character containers
Updates Character health in container data as well as text
(object)
A Phaser scene with characterList
none
:
Returns a character container based on name
object
:
A container object of the character
Checks if character has a skill
boolean
:
Whether the character has the skill or not
Checks if selections are valid based on charactes and current card
(object)
A Phaser scene with characterList
boolean
:
Whether the selections are valid based on card
Rolls a 6-sided die
number
:
Number between 1 and 6
Completes the instructions on the drawn card
(object)
A Phaser scene with characterList
none
:
Updates selection or health
Gets the character sprite
(object)
A character container
object
:
The character container's background sprite
Resets character is_selected to false and restores interactivity
(object)
A Phaser scene with characterList
none
:
modifies character
Takes a turn by rendering and activating a card
(object)
A Phaser scene with characterList
object
:
The updated gameStats


This is the first chapter in the A level computing course and is comprised of the computational thinking idealogy and concept first coined in 1996 by Seymour Papert.
This is a large section of computational thinking that will address some methods of solving problems such as backtracking, visualisation and pipelining along with ways of approaching a problem computationally. This includes thinking abstractly and other methods.
This is a small section about how to tackle a problem using computational thinking. Problems are important as we devise algorithms to tackle them in computing
This section covers some of the basic principles of programming in computing science. Covering the three programming constructs, sub-programs, etc.
Algorithms are useful in computing science, and some have had more of an impact than others on the computing world. This chapter lists some of these algorithms and how to measure complexity of algorithms.
A chapter to cover some of the different types of programming languages out there, their functions and why they are there.
Covered in this section is information on software within the computing world. This covers different types of software with examples, along with information on memory management in software.
Covering the process by which applications are generated including interpreters and more details on how compilation works.
This section needs to be added. *Placeholder*
The often described "brain" of the computer is a complex system that works around a lot of fetch-decode-exectue cycles. This chapter covers some detail on the inner workings of the central processing unit.
Data needs to be processed and handled differently depending on whether it is representing the word three or the numerical value 3 for example. This chapter discusses the need for and how we have data types.
This section needs to be added. *Placeholder*
This section needs to be added. *Placeholder*
This section needs to be added. *Placeholder*
The often described "brain" of the computer is a complex system that works around a lot of fetch-decode-exectue cycles. This chapter covers some detail on the inner workings of the central processing unit.


storefront
Online store |
Order form
|
|
Store address |
Invoice # {{order_number}} Date {{date_created}} |
Recipient{{first_name}} {{shipping.address1}} {{shipping.city}} {{shipping.state}} {{phone}} {{comments}} |
|
Name |
Sku |
Manufacturer |
Size |
Price, $ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Total |
|
|
|
|


|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
| Interface Summary | |
|---|---|
| NodeRenderer<OUTPUT> | Interface for classes that render Nodes. |
| Class Summary | |
|---|---|
| AggregateNodeMerger | Abstract parent for merging nodes together by aggregating node weights. |
| CountNodeMerger | Merge node weights using count. |
| EdgeBuilder | Configures and builds an Edge. |
| EdgeWeightEdgeComparator | Compares Edge messages by only looking at their weight, and sorts them in decreasing order. |
| MaxNodeMerger | Merge node weights using maximum weight. |
| MeanNodeMerger | Merge nodes using mean. |
| MinNodeMerger | Merge node weights using minimum weight. |
| NodeAvroFile | For reading an avro container file that contains nodes. |
| NodeBuilder | Configures and builds a Node. |
| NodeCopier | Efficiently perform multiple deep-copies of Nodes. |
| NodeMerger | Abstract parent for merging nodes together. |
| NodeUtils | Utility class for avro Node messages. |
| SumNodeMerger | Merge node weights using sum. |
| TargetLabelEdgeComparator | Sorts edges by target label lexicographically. |
| TargetLabelNumericEdgeComparator | Sorts edges by target label numerically. |
| Enum Summary | |
|---|---|
| AggregateNodeMerger.MergeNodeAggregateType | Supported aggregate types. |
(c) Copyright 2013 WibiData, Inc. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


torchfm.layer.
AttentionalFactorizationMachine
forward
x – Float tensor of size (batch_size, num_fields, embed_dim)
(batch_size, num_fields, embed_dim)
CompressedInteractionNetwork
CrossNetwork
FactorizationMachine
FeaturesEmbedding
x – Long tensor of size (batch_size, num_fields)
(batch_size, num_fields)
FeaturesLinear
FieldAwareFactorizationMachine
InnerProductNetwork
MultiLayerPerceptron
OuterProductNetwork


--- permalink: /404.html layout: default ---
404
Please check the URL in the address bar and try again.


ACP Brevet Opening and Closing times
{% with messages = get_flashed_messages() %} {% if messages %}
{% for message in messages %}
{{ message }}
{% endfor %}
{% endif %} {% endwith %}
Checkpoint 1
Opening time: 0:00 Closing time: 0:00
Checkpoint 2
Opening time: 0:00 Closing time: 0:00
Checkpoint 3
Opening time: 0:00 Closing time: 0:00
Checkpoint 4
Opening time: 0:00 Closing time: 0:00
Checkpoint 5
Opening time: 0:00 Closing time: 0:00
Checkpoint 6
Opening time: 0:00 Closing time: 0:00
Checkpoint 7
Opening time: 0:00 Closing time: 0:00
Checkpoint 8
Opening time: 0:00 Closing time: 0:00
Checkpoint 9
Opening time: 0:00 Closing time: 0:00
Checkpoint 10
Opening time: 0:00 Closing time: 0:00


The modern form of the nonlinear gyrokinetic equation is in the total-f form. This way of deriving the gyrokinetic equation is to use transformation methods to eliminate gyro-phase dependence of the total distribution function and thus obtain an equation for the resulting gyro-phase independent distribution function (called gyro-center distribution function).
The resulting equation for the gyro-center distribution function is given by (see Baojian’s paper)
|
| (358) |
where
|
| (359) |
|
| (360) |
Here the independent variables are gyro-center position X, magnetic moment μ and parallel velocity v∥.
The gyro-phase dependence of the particle distribution can be recovered by the inverse transformation of the transformation used before. The pull-back transformation gives rise to the polarization density term. (phase-space-Lagrangian Lie perturbation method (Littlejohn, 1982a, 1983), I need to read these two papers.).


Proposal for inclusion of curves 25519 and 448 ECDH and EDDSA algorithms to the Web Cryptography API
First draft.
Both curves "curve25519" and "curve448" are designed to allow for fast and secure cryptographic operations. They are included in CFRG standard [ref-rfc7748] and in the TLS 1.3 standard [ref-rfc8446], therefore, it seems that including these curves now in the web crypto API is a reasonable choice. Both of them are Montgomery curves and have birationally equivalent Edwards versions, that leads to adoption EdDSA (Edwards-curve Digital Signature Algorithm [ref-ed25519]) as signature algorithm. To specify elliptic curve one need to provide (per web cryptography specification): curve name, sign and verify operations, key generation operation, ECDH derivation operation, key import and key export operations.
typedef DOMString;
dictionary EcKeyGenParams : Algorithm {
// A named curve
required NamedCurve namedCurve;
};
The NamedCurve type represents named elliptic curves, which are a convenient way to specify the domain parameters of well-known elliptic curves. The following values defined by this specification:
"X25519"
"X448"
"ED25519"
"ED448"
The recognized algorithm name for
this algorithm is "EDDSA"
.
| Operation | Parameters | Result |
|---|---|---|
| sign | EddsaParams | ArrayBuffer |
| verify | EddsaParams | boolean |
| generateKey | EcKeyGenParams | CryptoKeyPair |
| importKey | EcKeyImportParams | CryptoKey |
| exportKey | None | object |
dictionary EddsaParams : Algorithm {
// The hash algorithm to use
required HashAlgorithmIdentifier hash;
};
If the [[type]] internal slot of
key is not "private"
, then throw an InvalidAccessError
.
Let hashAlgorithm be the hash member of normalizedAlgorithm.
Let M be the result of performing the digest operation specified by hashAlgorithm using message.
Let d be the EDDSA private key associated with key.
Let params be the EC domain parameters associated with key.
"ED25519"
, "ED448"
:
Perform the EDDSA signing process, as specified in rfc8032, Section 5.1.6, with M as the message, using params as the EC domain parameters, and with d as the private key.
Let r and s be the pair of integers resulting from performing the EDDSA signing process.
Let result be a new empty ArrayBuffer associated with the
relevant global object
of this
[HTML].
Let n be 32 for curve 25519, and 57 for curve 448.
Convert r to an litle-endian octet string of length n and append this sequence of bytes to result.
Convert s to an litle-endian octet string of length n and append this sequence of bytes to result . Three (curve 25519) or 10 (curve448) most significant bits of the final octet are always zero.
Return a new ArrayBuffer associated with the
relevant global object
of this
[HTML], and containing the
bytes of result.
If the [[type]] internal slot of
key is not "public"
, then throw an InvalidAccessError
.
Let hashAlgorithm be the hash member of normalizedAlgorithm.
Let signature be the result of
getting a copy of the bytes held by the signature
parameter passed to the
verify method.
Let M be the result of performing the digest operation specified by hashAlgorithm using message.
Let Q be the EDDSA public key associated with key.
Let params be the EC domain parameters associated with key.
"ED25519"
, "ED448"
:
Perform the EDDSA verifying process, as specified in rfc8032, Section 5.1.7, with M as the received message, signature as the received signature and using params as the EC domain parameters, and Q as the public key.
Perform the EDDSA verification steps specified in that specification passing in M, signature, params and Q and resulting in an indication of whether or not the purported signature is valid.
Let result be a boolean with the value true
if the signature is valid
and the value false
otherwise.
Return result.
The recognized algorithm name for
this algorithm is "ECDH"
.
| Operation | Parameters | Result |
|---|---|---|
| generateKey | EcKeyGenParams | CryptoKeyPair |
| deriveBits | EcdhKeyDeriveParams | Octet string |
| importKey | EcKeyImportParams | CryptoKey |
| exportKey | None | object |
If usages contains an entry which is not
"deriveKey"
or "deriveBits"
then throw a
SyntaxError
.
"X25519"
or "X448"
:
Generate an Elliptic Curve key pair, as defined in [RFC7748] with domain parameters for the curve identified by the namedCurve member of normalizedAlgorithm.
Perform the ECDH key generation steps specified in that specification, passing in normalizedAlgorithm and resulting in an elliptic curve key pair.
If performing the operation results in an error,
then throw a
OperationError
.
Let algorithm be a new EcKeyAlgorithm object.
Set the name member of
algorithm to "ECDH"
.
Set the namedCurve attribute of algorithm to equal the namedCurve member of normalizedAlgorithm.
Let publicKey be a new CryptoKey associated with the
relevant global object
of this
[HTML], and
representing the public key of the generated key pair.
Set the [[type]] internal slot of
publicKey to "public"
Set the [[algorithm]] internal slot of publicKey to algorithm.
Set the [[extractable]] internal slot of publicKey to true.
Set the [[usages]] internal slot of publicKey to be the empty list.
Let privateKey be a new CryptoKey associated with the
relevant global object
of this
[HTML], and
representing the private key of the generated key pair.
Set the [[type]] internal slot of
privateKey to "private"
Set the [[algorithm]] internal slot of privateKey to algorithm.
Set the [[extractable]] internal slot of privateKey to extractable.
Set the [[usages]] internal slot of
privateKey to be the
usage intersection of
usages and [ "deriveKey", "deriveBits" ]
.
Let result be a new CryptoKeyPair dictionary.
Set the publicKey attribute of result to be publicKey.
Set the privateKey attribute of result to be privateKey.
Return the result of converting result to an ECMAScript Object, as defined by [WebIDL].


The web site for Team aeCkack's high energy entry to the AEC Hackathon held at Facebook HQ in Menlo Park CA, November 8-10, 2013.
The team entry was a winner. Then again, so were all the entries from the other half dozen teams.
aeChack Accomplishments
What the team accomplished.
Contributors
Project hot shots, kool kids and calorific colleagues.
Hot Links
Links to sites that may be of further interest.
Photo Gallery
Photos of the Hackathon.