text:
# Interpolation Search

April 14, 2019 3 minutes

Interpolation Search is another searching algorithm, used to search sorted datasets with an additional condition that the data should be uniformaly distribued. Keep in mind that the uniformity of the data is NOT a mandatory ask. Its just the fact that the algorithm performs better in case the data is uniformaly distributed.

Umm.. Ok.. but what is uniformaly distributed data?

In layman terms, we can say that when all the elements in a dataset have equal probability to get selected, the dataset is said to be uniformaly distributed. For example, when rolling a fair die, every number (from 1 to 6) has equal probability to be on the top face.

Interpolation Search is an improvement over Binary Search, as it performs better for uniformaly distributed datasets. As mentioned in the linked post, binary search divides the given dataset into two equal parts and then based on the comparison with the middle index value, it selects the next dataset for search.

Interpolation search differs from Binary Search in this context. Instead of always selecting the middle element as pivot, interpolation-search calculates the pivot element by interpolating the key element(the value we need to find) with the lower (input[start]) and upper (input[end]) values of one of the intervals from the given dataset.

$$pivot= start + (\frac{(end - start)}{input[end] - input[start]} * (key - input[start]))$$

The above mentioned mathematical equation is used to find the element that we will be using to perform the comparison operation. If the key element is not found in the current interval (input[start] : input[end]), the start and end indices are updated to choose another interval (based on the logic mentioned below) and the process is repeated until we have either found the element or have compared all the intervals.

#### Pseudo Code

1. Initialize
• start = 0
• end = size of the input dataset -1
• key = element to be searched
2. while start < end and key lies between start and end indices:
1. calculate pivot index using above mentioned formula
2. if the value at pivot index is equal to the key element, return pivot
3. else if, key < input[pivot], set start = pivot + 1
4. else set end = pivot - 1

#### Complexity

The average case complexity of interpolation search algorithm (assuming the data is uniformaly distributed) is $O(log log (n))$. In worst case scenarios, the algorithm performs in a linear time $O(n)$

#### Java Implementation

/**
* a method to search input array for the existence of element denoted by key using interpolation search
*
* @param input input array to be searched
* @param key   element to be found
* @return index of key element if found, -1 otherwise
*/
public int search(int[] input, int key) {
int start = 0, end = input.length - 1;

//while the key is in the range
while (start <= end && (key >= input[start] && key <= input[end])) {
int pivot = start + ((key - input[start]) * (end - start) / (input[end] - input[start]));
if (input[pivot] == key) {
return pivot;
} else {
if (key > input[pivot]) {
end = pivot - 1;
} else {
start = pivot + 1;
}
}
}
return -1;
}

A working implementation with test cases can be found here


text:
The amplitude of a trig function defines how much the graph is going to be getting stretched or compressed on the y-axis. Take for example the following function.

$$sin(x)$$

On this function, no compression or stretching on the y-axis is happening but if you add an amplitude of 3 the amplitude is going to stretch the function values up to the 3 mark on the y-axis.

$$3sin(x)$$

The same concept applies to compressing the function for a value that is smaller than one.

$$\frac { 1 }{ 2 }sin(x)$$

If you now overlay all three functions together you will see that the function still have the same intercepts on the x-axis just the values on the y-axis have changed everything else has remained the same.

format: plain


text:
Microbiological Quality of Soaps and Efficacy of ...- hand soap liquid singlet oxygen microbiology study guides ,Microbiological Quality of Soaps and Efficacy of Antiseptics and Disinfectants Used in Hospitals in Gaza - Palestine يف ةمدختسما ترهاطم ا ةياعفو نوباصل ةيبوريما ةدوجا نيطسلف - ةزغ عاطق تايفشتسم Ahmad Saleh Auda Salama Supervised by Prof. Dr. Abdelraouf A. Elmanama Prof. of MicrobiologySinglet Oxygen - an overview | ScienceDirect TopicsSinglet oxygen radicals generated during the photo-bleaching of fluorescent dyes is a serious problem that limits the usefulness of fluorescence microscopy in studying molecular process in living cells. Singlet oxygen can inactivate proteins within a few nanometers of the photobleached fluorophore [10,21]. In the case of fluorescein-labeled ...

### Beyond oxidative stress: an immunologist's guide to ...

01.05.2013·The term ‘reactive oxygen species’ (ROS) includes super-oxide, hydrogen peroxide, singlet oxygen, ozone, hypo-halous acids and organic peroxides 1.ROS participate in phenomena that traverse all of biology, and their study has burgeoned for more than a century (TIMELINE).ROS are difficult to distinguish from each other by specific assays and are …

### Oxygen Requirements for Pathogenic Bacteria - Learn ...

Sep 22, 2020 - Microorganisms can be classified as obligate aerobes, facultative, microaerophilic, aerotolerant and obligate anaerobes based on their oxygen requirements.

### Nanomaterials | Free Full-Text | PCN-224 Nanoparticle ...

23.11.2021·A mechanism study revealed that this efficient bacterial elimination was due to singlet oxygen (1 O 2). Although the materials are highly phototoxic, an MTT assay showed that the as fabricated nanofiber membranes had good biocompatibility in the dark, and the cell survival rates were all above 85%. Taken together, this work provided an application prospect of …

### Kinetic study of the radiationless deactivation of singlet ...

Kinetic study of the radiationless deactivation of singlet oxygen (1Deltag) in liquid solution under high pressure December 2000 Physical Chemistry Chemical Physics 2(24):5571-5577

### 8 PATHOGENESIS OF BACTERIAL INFECTION

After reading this chapter, the student will be able to : zdescribe the term pathogenesis. zexplain Koch’s postulates. 87 Pathogenesis of Bacterial Infection MICROBIOLOGY MODULE Microbiology Notes zdifferentiate colonization and pathogens zexplain steps involved in the bacterial pathogenesis zdescribe toxins zdifferentiate endotoxins and exotoxins zdiscuss the …

### Growth of microbes in batch culture - SlideShare

31.07.2014·Oxygen species - singlet oxygen which the valence electrons become highly reactive and oxidize organic matter readily. Superoxide anion, hydrogen peroxide, and hydroxyl radical which are inadvertant byproducts during respiration. These can all damage cell macromolecules by oxidation processes. Measures to counter these toxic oxygens - catalase …

### What is an Obligate Anaerobe? - study

19.10.2021·Subsequently, singlet oxygen can also be produced via the reaction of superoxide and hydroxyl radicals. All these reactive oxygen species produced in the presence of oxygen are harmful to the ...

### Microbiology exam 2 Flashcards | Quizlet

Singlet oxygen. The absence of _____ leaves obligate anaerobes susceptible to killing by oxygen. Superoxide dismutase . True or false. Quorum sensing is involved in the development and propagation of a biofilm. True. The most commonly used isolation techniques in microbiology laboratories is the ____ streak-plate method. A pure culture is composed of …

### Blue Light Disinfection in Hospital Infection Control ...

07.05.2019·Due to the high reactivity and short half-life of ROS, only molecules and structures close to the production area of singlet oxygen and free radical species are directly affected and destroyed . The two types of mechanisms may occur simultaneously or separately, the predominance of each depends on the used PS, the substrate, and the molecular oxygen …

### Analysis of oxidation products of α ... - ScienceDirect

15.02.2020·In this study, we tried to analyze α-Toc hydroperoxide (Toc-OOH) stereoisomers and tocopherylquinone (TQ) in extra virgin olive oil (EVOO) using liquid chromatography-tandem mass spectrometry. Photo-irradiation (5000 lx) to EVOO increased Toc-OOH stereoisomers but not TQ. In contrast, thermal oxidation (150 °C) of EVOO increased TQ but not Toc-OOH. We …

### Detection Technical Notes - Tecan

The singlet oxygen molecules are able to cover a distance of up to 200 nm during their half-life of approximately 4 μs. If AlphaScreen acceptor beads are in close proximity to the donor beads, due to biological binding of their coupling partners, the singlet oxygen molecules are able to initiate a cascade of energy transfer steps in the acceptor beads, ultimately resulting in the …

### Study Guide for Chapter 26 microbiology - Study Guide for ...

Filled out study guide provided by Dr. Penny Powell as a supplemental study tool. study guide for chapter 26 immunity: broadly specific host learning objectives

### The detection sensitivity of commonly used singlet oxygen ...

01.03.2020·The sensitivity for singlet oxygen (1 O 2) of two convenient 1 O 2 probes, 1,3-diphenylisobenzofuran (DPBF) and 9,10-Anthracenediyl-bis(methylene)dimalonic acid (ABDA), has been investigated in different aqueous environments.Both probes are commercially available at reasonable cost and can be used with standard UV–vis spectrometers.

### Molecular dynamics simulations of singlet oxygen atoms ...

12.05.2020·This is an important and new result which was not reported in the previous study of singlet oxygen atom+water simulations . Despite longer simulated timescale (10 ps), even the conversion of oxywater was not observed in that work, most probably due to the used DFTB method, which has limitations in proper description of the chemical bonds formation. Next, we …

### week 5 - Microbial Nutrition and Growth - SCIENTIST CINDY

Singlet Oxygen (O2) - A singlet oxygen is molecular oxygen that contains high energy electrons. These high energy molecules can be generated during the process of aerobic cellular respiration. These high energy electrons are very reactive and can lead to unwanted chemical reactions within the cell. Phototropic microorganisms have specialized pigments, called …

### Active repair of a dinuclear photocatalyst for visible ...

07.02.2022·Through the short exposure of the hydrogenated PMD to in situ generated singlet oxygen (1 O 2), the photocatalyst is reoxidized to its active form and can again be used for light-driven hydrogen ...

### Microbial culture selection for fermentation process ppt ...

Oxygen concentration, temperature, pH and nutrient levels must b Microbial Strain Selection 4. Strain Development 4.1. Mutation and Selection 4.2. Hybridization Takamine developed a fermentation process for the industrial production of fungal amylase. The process included the culture of Aspergillus oryzae on moist rice or wheat bran, and the product was called …

### Ch07_Micro8eStudyGuide - Chapter 7 The Control of ...

Chapter 7 The Control of Microbial Growth Terminology Related to the Control of Microbial Growth Sterilization is the removal or destruction of all forms of microbial life. Commercial sterilization sub-jects canned food to only enough heat to destroy the endospores of Clostridium botulinum. Disinfection is the destruction of vegetative pathogens on a surface, usually with …

### Halo-fluorescein for photodynamic ... - Nature Communications

22.01.2021·On the other hand, halogens are the most popular choices of HAE, which can promote the generation of singlet oxygen (1 O 2) via increasing the probability of intersystem crossing 24. To optimize ...

07.09.2018·cell fusion. The antiviral activity of LJ001 was light-dependent, required the presence of molecular oxygen, and was reversed by singlet oxygen (1O2) quenchers, qualifying LJ001 as a type II photosensitizer. Unsaturated phospholipids were the main target modified by LJ001-generated 1O2. Hydroxylated fatty acid species were detected in model and ...

### A Photosensitized Singlet Oxygen (1O2) Toolbox for Bio ...

25.01.2022·Singlet oxygen (1O2) is the excited state of ground, triplet state, molecular oxygen (O2). Photosensitized 1O2 has been extensively studied as one of the reactive oxygen species (ROS), responsible for damage of cellular components (protein, DNA, lipids). On the other hand, its generation has been exploited in organic synthesis, as well as in photodynamic therapy for …

### Oxygen Requirements for Microbial Growth – Microbiology

Singlet oxygen (O 2 •), superoxide $\left({\text{O}}_{2}^{-}\right)$, peroxides (H 2 O 2), hydroxyl radical (OH•), and hypochlorite ion (OCl −), the active ingredient of household bleach, are all examples of ROS. The organisms that were able to detoxify reactive oxygen species harnessed the high electronegativity of oxygen to produce free energy for their metabolism …

### Efficacy of Selected Hand Hygiene Agents Used to Remove ...

Methods: Twenty-six volunteers were used in a study designed to examine the effect of a sterile hand cream applied after surgical hand antisepsis on …

### Convergence of the Transcriptional Responses to Heat Shock ...

13.09.2012·On the other hand, ... In this study, we characterized the ... RpoH I and RpoH II accumulation following heat and singlet oxygen stresses. Western blots illustrating the levels of RpoH I and RpoH II in wild-type R. sphaeroides (WT) at different times following (A) a shift of temperature from 30°C to 42°C (heat shock) or (B) addition of the photosensitizer methylene …

### Ch 6 study guide - Name BI234-Microbiology Study Guide ...

View Test Prep - Ch 6 study guide from BI 234 at Portland State University. Name:_ BI234-Microbiology Study Guide Chapter 6-Microbial Nutrition and Growth 1. Describe the roles of carbon, hydrogen,

### Contrasting effects of singlet oxygen and hydrogen ...

25.03.2014·On the other hand, photochemical processes lead to inhibitory effects including (i) ... In a recent study, we showed that 1 O 2 has the potential to inhibit typical freshwater bacterial species and consequently affect BCC . Singlet oxygen is highly reactive, exhibits a half-life time in water of ~3.5 μs , and causes cell damage by oxidation of lipids, nucleic acids, and proteins …

### Tauroursodeoxycholic Acid (TUDCA)—Lipid Interactions and ...

29.04.2021·Taurine itself interacts with singlet oxygen with very low efficiency, and the rate constant of singlet oxygen quenching by taurine does not exceed 1 × 10 3 M −1 s −1 (Table 1). However, the presence of peptide bond in the TUDCA molecule may affect its quenching rate of singlet oxygen and may be the source of a significant difference between quenching rates …

### A comparative study of singlet-oxygen generation by С60 ...

Request PDF | A comparative study of singlet-oxygen generation by С60 and С70 fullerenes | The results of comparative investigations of singlet-oxygen generation by …


text:
# Physical reasons for metric definition in special relativity [duplicate]

I am working through "General Relativity" by Wald, and am currently going through the brief section on Special Relativity. The spacetime metric is defined as $\eta_{ab} = \sum\limits_{\mu, \nu=0}^3 \eta_{\mu,\nu} (dx^\mu)_a(dx^\nu)_b$ where $\eta_{\mu, \nu} = \mathrm{diag}(-1,1,1,1)$. My question is, what is the physical motivation for this? The last three terms in the summation I understand - they give the physical distance between two events. But what about the negative sign infront of the "time term"?

• Nothing stops you from making the temporal coefficient positive and the spatial coefficients negative. I think MTW has a table enumerating which textbooks that came before it use which notation. If you don't understand why there have to be two different signs, then you may want to go back one step and study special relativity some more. May 20 '16 at 2:41

The metric is usually defined this way because of the speed limit (c).

Imagine that: If you are centered at the origin of a coordinate frame (x,y,z) a emit a signal, this signal would never travel a distance bigger than the distance the light would travel. So,

$${|r|} ^{2} = {x}^{2} + {y}^{2} + {z}^{2}$$

And set it equal to the distance the light would travel (c²t²):

$${x}^{2} + {y}^{2} + {z}^{2} = {c}^{2}{t}^{2}$$

Now you can see that:

$${x}^{2} + {y}^{2} + {z}^{2} - {c}^{2}{t}^{2} = 0$$

Work theese expressions for infinetesimal intervals to see it straight. ${ds}^{2}$ must have this signature...

• Not trying to be anal, but relativity doesn't say that the speed of light is a speed "limit", it says that the speed of light is constant in all inertial systems (which I believe is what you are trying to say here). May 20 '16 at 3:36
• @CuriousOne you are right, I'm trying to say that C is constant. But in S.R. c is the speed limit which information can travel through space. Only massless particles could travel at c. May 20 '16 at 3:46
• There is a not so subtle difference between the two statements. You could have a speed limit in the universe (see e.g. optical phonon dispersion) without the speed of light being exactly the same in all inertial systems. The latter is a much stronger statement and, at the same time, it actually defeats the speed limit. The eigentime difference between any two points in the universe for the connecting traveler can be made as small as you wish, i.e. there is no real speed limit. What is limited is the possibility to visit another space and then return into one's original timeline. May 20 '16 at 4:50
• @CuriousOne , I got it. But do you agree that c is constant and we can't have information traveling through space-time at a speed greater than c, ok? May 20 '16 at 13:19
• @CuriousOne I understood what you tried to say, it's just my wrong way of explaining things. Your correction is welcome. May 20 '16 at 13:26


text:
# A house requires 60 M cal/hr in winter for heating. Heat pump absorbs heat from cold air outside and requires 8 M cal/hr of work. The COP will be:

This question was previously asked in
NPCIL Stipendiary Trainee ME 2018
View all NPCIL Scientific Assistant Papers >
1. 0.75
2. 6.5
3. 7.5
4. 15

Option 3 : 7.5
Free
SSC JE ME Full Test 4
5822
200 Questions 200 Marks 120 Mins

## Detailed Solution

Concept:

$${\rm{CO}}{{\rm{P}}_{{\rm{heat\;pump}}}} = \frac{{{\rm{Refrigeration\;Effect}}}}{{{\rm{Work\;Input}}}} = \frac{{{{\rm{Q}}_{\rm{H}}}}}{{{{\rm{Q}}_{\rm{H}}} - {{\rm{Q}}_{\rm{L}}}}} = \frac{{{{\rm{T}}_{\rm{H}}}}}{{{{\rm{T}}_{\rm{H}}} - {{\rm{T}}_{\rm{L}}}}}$$

COP of Heat Pump is defined as the ratio of heat transfer to the hot reservoir to network transfer to the heat pump.

$$COP = \frac{{{Q_S}}}{W} = \frac{60}{8}=7.5$$


text:
Use the shell method to find the volume of the solid by rotating the region bounded by the given curves about the x-axis.

Rotate $y = x^3$ and $y = 8$, $x = 0$

Using the method of cylindrical shells, which is $2\pi rh \, dx$, or $2\pi xf(x) \, dx$

$$x^3 = 8$$ $$x = 2$$

$$2\pi \int_0^2 x(8-x^3) \, dx?$$

I have tried many set ups and I cannot find the correct answer. $(768\pi / 7)$

-

Drawing a picture is always a good thing to do for these types of problems.

Start by sketching the graphs of $y=8$, $y=x^3$, and $x=0$. We then see that the region to be revolved about the $x$-axis is in the first quadrant. It is bounded above by the line $y=8$, on the left by the $y$-axis, and on the right by the graph of $y=x^3$. Note that the point of intersection in the upper right is $(2,8)$ and can be found by solving the equation $8=x^3$.

The region is shown, shaded in blue, below:

Now, you generate the solid by revolving this region about the $x$-axis. The cylindrical shells are generated by revolving a horizontal line segment, shown in green in the diagram, at a fixed $\color{maroon}y$-value about the $x$-axis.

These line segments "start" at $y=0$ and "end" at $y=8$. Thus the integral giving the volume of the solid of revolution is with respect to $y$ and is of the form $$\int_{y=0}^{y=8} 2\pi \,\color{maroon}{ r_y} \cdot\color{darkgreen}{ h_y} \, dy$$ where $\color{maroon}{r_y}$ is the radius of the shell at $\color{maroon}y$ and $\color{darkgreen}{h_y}$ is the height of the shell at $\color{maroon}y$.

The height of the shell at $\color{maroon}y$ is the length of the line segment at $\color{maroon}y$. Since the length of the line segment at $\color{maroon}y$ is the $x$-coordinate of its right hand endpoint, we have

$\ \ \ \ \ \ \ \color{darkgreen}{h_y}=\color{darkgreen}{y^{1/3}}$.

Keep in mind that we want to write $\color{darkgreen}{h_y}$ in terms of $y$, since the integral is with respect to $y$.

The radius of the shell is the height above the $x$-axis of the line segment:

$\ \ \ \ \ \ \ \color{maroon}{r_y}=\color{maroon}y$.

Thus, the volume of the solid of revolution is: $$\int_0^8 2\pi\,\color{maroon}y\cdot\color{darkgreen}{ y^{1/3}} \, dy =\int_0^8 2\pi\cdot y^{4/3} \, dy= \textstyle{6\pi\over7} y^{7/3}\Bigr|_0^8={6\pi\over7}\cdot 8^{7/3} ={6\pi\over7} \cdot2^{7 }= {6\pi\over7} \cdot128={768\pi\over 7}.$$

-
You blew my mind and paved the path of conceptual understanding for me. Thanks. –  Jonathan Dewein Apr 30 '12 at 18:37
If you rotate around the $x$ axis, your cylindrical shells have their axes parallel to $x$, so the area element that you rotate is from $y$ to $y+dy$ and from $x=0$ to $x=\sqrt[3]y$. The volume element is then $2 \pi y \sqrt[3]y dy$. If you integrate this from $0$ to $8$,


text:
unity – How to use Texture2DArray with Normal map and Normal Unpack node in Shader Graph

Problem was, Normal Unpacking only works with non-SRGB textures.

In order to generate non-SRGB `Texture2DArray` you’d need to provide last parameter(Set texture to be linear):

`Texture2DArray(int width, int height, int depth, TextureFormat textureFormat, bool mipChain, bool linear = true)`

But since my Texture array includes both normal maps and albedo maps, all other textures look flatter and uglier(Since they’re linear now).

There are 2 ways of solving this issue:

1. Use 2 texture arrays, one for normal maps(non-srgb) and another for albedo maps(srgb)

2. Use non-srgb texture array, but convert albedo maps to srgb inside the shader. Either using cheap approximation: `pow(col.rgb, 2.0)` or built-in `GammaToLinearSpace(col.rgb)`

move 1 site from digitalocean to normal hosting

y u no do it?

Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

Starts at just \$1 per CPM or \$0.10 per CPC.

statistics – Fisher information of joint distribution of transformed Normal distribution

Suppose $$X_1=theta+epsilon_1$$ and $$X_i=sqrt{gamma}X_{i-1}+sqrt{1-gamma}epsilon_i+theta(1-sqrt{gamma})$$
Where $$gamma in (0,1)$$ and $$theta$$ is the parameter of the model. Also $$epsilon_1,epsilon_2,…epsilon_n$$ are iid $$N(0,1)$$.

What is the Fisher information of this model and for what values of $$gamma$$ does it tensorise. I’ve tried using the Jacobian to find the joint distribution but I’m not sure, especially when determining for which values we have tensorisation. Any help would be much appreaciated.

pr.probability – Finding the K-means of the normal distribution

Let $$Kinmathbb N^+$$ be a parameter.

Given a distribution $$q$$ over the real numbers, K-means clustering aims to find $$K$$ centroids $$c_1,ldots,c_kinmathbb R$$ that minimize
$$int_{-infty}^infty q(x)cdot min{(x-c_i)^2mid iin{1,ldots,k}}dx.$$

We can, without loss of generality, assume that $$c_1le c_2leldotsle c_k$$.

What are the resulting centroids for the standard normal distribution $$q=N(0,1)$$?

The solution for $$K=2$$ is given by $$c_1=-sqrt{2/pi}$$ and $$c_2=sqrt{2/pi}$$. The reason is that the distribution is symmetric around $$0$$ and the expected value given that the variable is positive equals the mean of a half-normal random variable.
I am interested in computing the result for a larger $$K$$, e.g.,

• What are the centroids for $$K=4$$?

Using WolframAlpha, after some simplifications, it seems that the solution is approximately $$c_1approx -1.51, c_2approx-0.453,c_3approx 0.453, c_4approx1.51$$.

pathfinder 1e – Can a spellcaster use spell slots above their normal limit if their ability scores allow bonus spells of that level?

This question is inspired by discussion here, about how Heighten Spell works with Reserve Feats. The question that I am asking here deals with whether or not players can cast spells using spell slots for spell levels that they don’t have access to yet.

I feel like an example would explain this concept best.

Take Xylitol, the first-level wizard with an intelligence of 18. He has 5 0th-level spells per day and 3 1st level spells per day from his class. He also has 1 bonus 1st level spell per day from his high intelligence. The Ability Modifiers and Bonus Spells table says that he also has 1 bonus spell of each 2nd, 3rd, and 4th levels.

The question is this: Can Xylitol cast 1st level spells using the bonus slots for his 2nd, 3rd, and 4th level spells? He clearly can’t cast spells that are inherently higher level than 1st, since he can’t learn them, but can he cast 1st level spells using bonus 2nd, 3rd, and 4th level slots?

This has come up on these boards before, here. What I’m looking for here is a clear rules citation that clarifies this one way or the other. The wording in the section on ability scores makes it quite clear that characters cannot cast spells that are actually higher level than their class allows them to cast, but it is not clear that these higher level slots are barred until the appropriate spell level is unlocked. If a character has access to a spell level that they can’t use because their ability score isn’t high enough, they can freely use those slots for lower level spells, so why can’t they use their bonus spell slots for lower level spells?

As KRyan’s answer says, the Basics section covers this. Based on questions and comments both here and elsewhere, that section seems to be worded ambiguously enough that it’s caused confusion. I’d like to find another, more clear wording to this rule if at all possible.

N.B. I’d like to note that I personally don’t feel that players should have access to higher level slots like this. There are a large number of locations where it’s heavily implied that this is not the case, but I feel that finding a clear rules citation here would be helpful. I can’t find one that is clear for either interpretation here.

network – Nmap Scan Shows Filtered Ports for VNC, RDP, SAMBA & SSH on iOS – is this normal?

This can’t be normal, right?

Wrong, it can be normal.

Your scan shows that there is only one open port, on port 62078.

The results will be similar for other iDevices. For example, an iPhone 11 Pro on my network shows 985 closed ports, 14 filtered ports, and one open port (port 62078).

network – NMAP Scan Shows Ports for VNC, RDP, SAMBA & SSH on iOS – is this normal?

I ran an nmap scan on my iPad’s IP address and the results showed the following ports listed below available in a filtered state. See screenshot for the actual terminal results. This can’t be normal, right? There are no apps installed that would explain these ports and the device is not jailbroken.

SSH
Netbios-ssn
ms-wbt-server (Remote Desktop)
4 different VNC ports
And an iPhone Sync port

Context free grammar to chomsky normal form bruh

I’ve had this question bugging me for so long but i cant seem to solve the question can anyone help?

S 🡪 [ R ]

R 🡪 [ Q ] | T

T 🡪 j R | ε

Q 🡪 i k | ε

automata – Context Free Grammar to Chomsky Normal Form Help

I am trying to convert the following CFG to CNF:

``````S -> ABS | ε
A -> BSBa | a
B -> Ba | a
``````

The finally result looks like this:

``````S -> AS’ | AB
S’ -> BS
A -> S’B’ |BB’ | X
B’ -> BX
X -> a
Y -> b
B -> BX | XY
``````

I am fairly new to chomsky normal form, so can anyone verify that I did this right?

php – WordPress permalink, show a product catagory page on a normal WP page

I’m not sure if I’m having a bad brain day but I am going round in circles with something I know is so simple. As a note, I am pretty new to developing in WordPress so apologies if it genuinely is something so simple.

Essentially I am needing to have a page (example.com/gear) show the exact same page as the category page for gear (example.com/product_catagory/gear).

Is there a way for the permalink to show the product category page without changing the permalink? Would it be better practice to use something like is_page( ‘gear’ ); and then create a partial to show category products? Or is there something so much simpler than I can look into using?

I am not wanting to change the permalinks for product_catagoy I just want a new page to show a product category page (gear).


text:
# A duality for the S matrix

@article{ArkaniHamed2009ADF,
title={A duality for the S matrix},
author={Nima Arkani-Hamed and Freddy Cachazo and Clifford Cheung and Jared Kaplan},
journal={Journal of High Energy Physics},
year={2009},
volume={2010},
pages={1-70}
}
• Published 31 July 2009
• Mathematics
• Journal of High Energy Physics
We propose a dual formulation for the S Matrix of $$\mathcal N$$ = 4 SYM. The dual provides a basis for the “leading singularities” of scattering amplitudes to all orders in perturbation theory, which are sharply defined, IR safe data that uniquely determine the full amplitudes at tree level and 1-loop, and are conjectured to do so at all loop orders. The scattering amplitude for n particles in the sector with k negative helicity gluons is associated with a simple integral over the space of k…
411 Citations

### Gauge invariance from on-shell massive amplitudes and tree unitarity

• Physics
• 2022
: We study the three-particle and four-particle scattering amplitudes for an arbitrary, ﬁnite number of massive scalars, spinors and vectors by employing the on-shell massive spinor formalism. We

### On-shell methods for off-shell quantities in N=4 Super Yang-Mills: from scattering amplitudes to form factors and the dilatation operator

Planar maximally supersymmetric Yang-Mills theory (N=4 SYM) is a special quantum field theory. A few of its remarkable features are conformal symmetry at the quantum level, evidence of integrability

### Supersymmetric field theories, scattering amplitudes and the Grassmannian

In this thesis we carry out a detailed investigation of a class of four-dimensional N=1 gauge theories, known as Bipartite Field Theories (BFTs), and their utility in integrable systems and

### On form factors in N=4$$\mathcal{N}=4$$ SYM theory and polytopes

A bstractIn this paper we discuss different recursion relations (BCFW and all-line shift) for the form factors of the operators from the N=4$$\mathcal{N}=4$$ SYM stress-tensor current

### Bipartite field theories: from D-brane probes to scattering amplitudes

A bstractWe introduce and initiate the investigation of a general class of 4d, $\mathcal{N}=1$ quiver gauge theories whose Lagrangian is defined by a bipartite graph on a Riemann surface, with or

### Inverse soft factors and grassmannian residues

The action of holomorphic inverse soft factors on scattering amplitudes in $\mathcal{N} = 4$ SYM is shown to take a remarkably simple form in momentum twistor space. This is used to identify

### Efficient Tree-Amplitudes in N=4: Automatic BCFW Recursion in Mathematica

We describe an efficient implementation of the BCFW recursion relations for tree-amplitudes in N=4 super Yang-Mills, which can generate analytic formulae for general N^kMHV colour-ordered

### Biadjoint Scalars and Associahedra from Residues of Generalized Amplitudes

• Mathematics
• 2022
: Generalized scattering amplitudes m ( k ) n , discovered by Cachazo, Early, Guevara and Mizera (CEGM), form a symmetric hierarchy which is essentially recursive in nature. In the Generalized

### The S matrix of 6D super Yang-Mills and maximal supergravity from rational maps

• Mathematics
Journal of High Energy Physics
• 2018
A bstractWe present new formulas for n-particle tree-level scattering amplitudes of six-dimensional N=11$$\mathcal{N}=\left(1,1\right)$$ super Yang-Mills (SYM) and N=22

## References

SHOWING 1-10 OF 147 REFERENCES

### Principles of Algebraic Geometry

• Mathematics
• 1978
A comprehensive, self-contained treatment presenting general results of the theory. Establishes a geometric intuition and a working facility with specific geometric practices. Emphasizes applications

### Multidimensional Residues and Their Applications

Preliminary information Residues associated with mappings $f\colon \mathbf C^n\rightarrow \mathbf C^n$ (local residues) Residues associated with mappings $f\colon \mathbf C^n\rightarrow \mathbf C^p$

### The S-matrix in twistor space

• Physics
• 2009
The marvelous simplicity and remarkable hidden symmetries recently uncovered in (Super) Yang-Mills and (Super)Gravity scattering amplitudes strongly suggests the existence of a “weak-weak” dual

### Scattering amplitudes and BCFW recursion in twistor space

• Mathematics
• 2009
Twistor ideas have led to a number of recent advances in our understanding of scattering amplitudes. Much of this work has been indirect, determining the twistor space support of scattering

### Brown-HET-1551 Leading Singularities of the Two-Loop Six-Particle MHV Amplitude

• Physics
• 2009
Freddy Cachazo, Marcus Spradlin, and Anastasia Volovich Perimeter Institute for Theoretical Physics, Waterloo, Ontario N2J 2W9, Canada Brown University, Providence, Rhode Island 02912, USA Abstract

### Twistor quantisation and curved space-time

AbstractThe formalism of twistors [the ‘spinors’ for the group O(2,4)] is employed to give a concise expression for the solution of the zero rest-mass field equations, for each spin (s=0, 1/2, 1,


text:
# Physics307L:People/Carrillo/Electron Diffraction

## Balmer Series Lab Summary

• Please note that Ginny was my lab partner for this lab.

### Purpose

The purpose of this lab was to verify the de Broglie hypothesis and to measure the spacing of planes in graphite. To do this, we used en electron diffraction tube, a wavetek digital multimeter, calipers, and a 3B DC power supply (Model U3310).

To view the procedure, setup and calculations please click on the link below.

### Calculations and Analysis

• As you can see from my lab notebook, the calculated inner and outer diameters and percent errors are listed below
• $d_{inner} = 0.19524 +/- 0.001 nm\,\!$
$d_{outer} = 0.11153 +/- 0.0006 nm\,\!$
• $\% error=\frac{d_{inner}-d_{measured}}{d_{inner}}\,\!$
$\% error_{inner} = 8.34 %\,\!$
$\% error_{outer} = 9.33 %\,\!$

### Conclusion

As you can see from our results, the error for the inner diameter's lattice spacing was lower than the outer diameter's spacing, although the standard error of the mean for the inner diameter's lattice spacing was larger than that of the outer diameter. Our error must have come from the fact that the outer diameter became fuzzier as we lowered the voltage.


text:
Non-clairvoyant Precedence Constrained Scheduling1footnote 11footnote 1This research was supported in part by NSF awards CCF-1536002, CCF-1540541, and CCF-1617790, and the Indo-US Joint Center for Algorithms Under Uncertainty. Sahil Singla was supported in part by the Schmidt Foundation.

# Non-clairvoyant Precedence Constrained Scheduling111This research was supported in part by NSF awards CCF-1536002, CCF-1540541, and CCF-1617790, and the Indo-US Joint Center for Algorithms Under Uncertainty. Sahil Singla was supported in part by the Schmidt Foundation.

Naveen Garg (naveen@cse.iitd.ac.in) Computer Science and Engineering Department, Indian Institute of Technology, Delhi.    Anupam Gupta (anupamg@cmu.edu) Computer Science Department, Carnegie Mellon University.    Amit Kumar (amitk@cse.iitd.ac.in) Computer Science and Engineering Department, Indian Institute of Technology, Delhi.    Sahil Singla (singla@cs.princeton.edu) Department of Computer Science at Princeton University and School of Mathematics at Institute for Advanced Study, Princeton.
July 3, 2019
###### Abstract

We consider the online problem of scheduling jobs on identical machines, where jobs have precedence constraints. We are interested in the demanding setting where the jobs sizes are not known up-front, but are revealed only upon completion (the non-clairvoyant setting). Such precedence-constrained scheduling problems routinely arise in map-reduce and large-scale optimization. In this paper, we make progress on this problem. For the objective of total weighted completion time, we give a constant-competitive algorithm. And for total weighted flow-time, we give an -competitive algorithm under -speed augmentation and a natural “no-surprises” assumption on release dates of jobs (which we show is necessary in this context).

Our algorithm proceeds by assigning virtual rates to all the waiting jobs, including the ones which are dependent on other uncompleted jobs, and then use these virtual rates to decide on the actual rates of minimal jobs (i.e., jobs which do not have dependencies and hence are eligible to run). Interestingly, the virtual rates are obtained by allocating time in a fair manner, using a Eisenberg-Gale-type convex program (which we can also solve optimally using a primal-dual scheme). The optimality condition of this convex program allows us to show dual-fitting proofs more easily, without having to guess and hand-craft the duals. We feel that this idea of using fair virtual rates should have broader applicability in scheduling problems.

\setitemize

itemsep=2pt,topsep=0pt,parsep=0pt

## 1 Introduction

We consider the problem of online scheduling of jobs under precedence constraints. We seek to minimize the average weighted flow time of the jobs on multiple parallel machines, in the online non-clairvoyant setting. Formally, there are identical machines, each capable of one unit of processing per unit of time. A set of jobs arrive online. Each job has a processing requirement and a weight , and is released at some time . If the job finishes at time , its flow or response time is defined to be . The goal is to give a preemptive schedule that minimizes the total (or, equivalently, the average) weighted flow-time . The main constraints of our model are the following: (i) the scheduling is done online, so the scheduler does not know of the jobs before they are released; (ii) the scheduler is non-clairvoyant—when a job arrives, the scheduler knows its weight but not its processing time . (It is only when the job finishes its processing that the scheduler knows the job is done, and hence knows .); And (iii) there are precedence constraints between jobs given by a partial order : means job cannot be started until is finished. Naturally, the partial order should respect release dates: if then . (We will require a stronger assumption for some of our results.)

This model for constrained parallelism is a natural one, both in theory and in practice. In theory, this precedence-constrained (and non-clairvoyant!) scheduling model (with other objective functions) goes back to Graham’s work on list scheduling [Gra66]. In practice, most languages and libraries produce parallel code that can be modeled using precedence DAGs [RS08, ALLM16, GKR16]. Often these jobs (i.e., units of processing) are distributed among some workstations or servers, either in server farms or on the cloud, i.e., they use identical parallel machines.

### 1.1 Our Results and Techniques

Weighted Completion Time. We develop our techniques on the problem of minimizing the average weighted completion time . Our convex-programming approach gives us:

###### Theorem 1.1.

There is a -competitive deterministic online algorithm for minimizing the average weighted completion time on parallel machines with both release dates and precedences, in the online non-clairvoyant setting.

For this result, at each time , the algorithm has to know only the partial order restricted to , i.e., the jobs released by time . The algorithmic idea is simple in hindsight: the algorithm looks at the minimal unfinished jobs (i.e., they do not depend on any other unfinished jobs): call them . If is the set of (already released and) unfinished jobs at time , then . To figure out how to divide our processing among the jobs in , we write a convex program that fairly divides the time among all jobs in the larger set , such that (a) these jobs can “donate” their allocated time to some preceding jobs in , and that (b) the jobs in do not get more than unit of processing per time-step.

For this fair allocation, we maximize the (weighted) Nash Welfare , where is the virtual rate of processing given to job , regardless of whether it can currently be run (i.e., is in ). This tries to fairly distribute the virtual rates among the jobs [Nas50], and can be solved using an Eisenberg-Gale-type convex program. (We can solve this convex program in our setting using a simple primal-dual algorithm, see §6.) The proof of Theorem 1.1 is via writing a linear-programming relaxation for the weighted completion time problem, and fitting a dual to it. Conveniently, the dual variables for the completion time LP naturally fall out of the dual (KKT) multipliers for the convex program!

Weighted Flow Time. We then turn to the weighted flow-time minimization problem. We first observe that the problem has no competitive algorithm if there are jobs that depend on jobs released before . Indeed, if OPT ever has an empty queue while the algorithm is processing jobs, the adversary could give a stream of tiny new jobs, and we would be sunk. Hence we make an additional no-surprises assumption about our instance: when a job is released, all the jobs having a precedence relationship to are also released at the same time. In other words, the partial order is a collection of disjoint connected DAGs, where all jobs in each connected component have the same release date. A special case of this model has been studied in [RS08, ALLM16] where each DAG is viewed as a “hyper-job” and there are no precedence constraints between different hyper-jobs. In this model, we show:

###### Theorem 1.2.

There is an -competitive deterministic non-clairvoyant online algorithm for the problem of minimizing the average weighted flow time on parallel machines with release dates and precedences, under the no-surprises and -speedup assumptions.

Interestingly, the algorithm for weighted flow-time is almost the same as for weighted completion time. In fact, exactly the same algorithm works for both the completion time and flow time cases, if we allow a speedup of for the latter. To get the -speedup algorithm, we give preference to the recently-arrived jobs, since they have a smaller current time-in-system and each unit of waiting proportionally hurts them more. This is along the lines of strategies like LAPS and WLAPS [EP12].

### 1.2 The Intuition

Consider the case of unit weight jobs on a single machine. Without precedence constraints, the round-robin algorithm, which runs all jobs at the same rate, is -competitive for the flow-time objective with a -speed augmentation. Now consider precedences, and let the partial order be a collection of disjoint chains: only the first remaining job from each chain can be run at each time. We generalize round-robin to this setting by running all minimal jobs simultaneously, but at rates proportional to length of the corresponding chains. We can show this algorithm is also -competitive with a -speed augmentation. While this is easy for chains and trees, let us now consider the case when the partial order is the union of general DAGs, where each DAG may have several minimal jobs. Even though the sum of the rates over all the minimal jobs in any particular DAG should be proportional to the number of jobs in this DAG, running all minimal jobs at equal rates does not work. (Indeed, if many jobs depend on one of these minimal jobs, and many fewer depend on the other minimal jobs in this DAG, we want to prioritize the former.)

Instead, we use a convex program to find rates. Our approach assigns a “virtual rate” to each job in the DAG (regardless of whether it is minimal or not). This virtual rate allows us to ensure that even though this job may not run, it can help some minimal jobs to run at higher rates. This is done by an assignment problem where these virtual rates get translated into actual rates for the minimal jobs. The virtual rates are then calculated using Nash fairness, which gives us max-min properties that are crucial for our analysis.

Analysis Challenges: In typical applications of the dual-fitting technique, the dual variables for each job encode the increase in total flow-time caused by arrival of this job. Using this notion turns out to create problems. Indeed, consider a minimal job of low weight which is running at a high rate (because a large number of jobs depend on it). The increase in overall flow-time because of its arrival is very large. However the dual LP constraints require these dual variables to be bounded by the weights of their jobs, which now becomes difficult to ensure. To avoid this, we define the dual variables directly in terms of the virtual rates of the jobs, given by the convex program.

Having multiple machines instead of a single machine creates new problems. The actual rates assigned to any minimal job cannot exceed , and hence we have to throttle certain actual rates. Again the versatility of the convex program helps us, since we can add this as a constraint. Arguing about the optimal solution to such a convex program requires dealing with the suitable KKT conditions, from which we can infer many useful properties. We also show in §6 that the optimal solution corresponds to a natural “water-filling” based algorithm.

Finally, we obtain matching results for the case of -speed augmentation. Im et al. [IKM18] gave a general-purpose technique to translate a round-robin based algorithm to a LAPS-like algorithm. In our setting, it turns out that the LAPS-like policy needs to be run on the virtual rates of jobs. Analyzing this algorithm does not follow in a black-box manner (as prescribed by [IKM18]), and we need to adapt our dual-fitting analysis suitably.

### 1.3 Related Work and Organization

Completion Time.  Minimizing on parallel machines with precedence constraints has -approximations in the offline setting: Li [Li17] improves on [HSSW97, MQS98] to give a -approximation. For related machines, the precedence constraints make the problem much harder: there is a -approximation [Li17] improving on a prior result [CS99], and a hardness of under certain complexity assumptions [BN15]. In the online setting, any offline algorithm for (a dual problem to) gives an clairvoyant online algorithm, losing factors [HSSW97]. Two caveats: it is unclear (a) how to make this algorithm non-clairvoyant, and (b) how to solve the (dual of the) weighted completion time problem with precedences in poly-time.

Flow Time without Precedence.  To minimize , strong lower bounds are known for the competitive ratio of any online algorithm even on a single machine [MPT94]. Hence we use speed augmentation [KP00]. For the general setting of non-clairvoyant weighted flow-time on unrelated machines, Im et al. [IKMP14] showed that weighted round-robin with a suitable migration policy yields a -competitive algorithm using -speed augmentation. They gave a general purpose technique, based on the LAPS scheduling policy, to convert any such round-robin based algorithm to a -competitive algorithm while losing an extra factor in the competitive ratio. Their analysis also uses a dual-fitting technique [AGK12, GKP12]. However, they do not consider precedence constraints.

Flow Time with Precedence.  Much less is known for flow-time problems with precedence constraints. For the offline setting on identical machines, [KL18] give -approximations with -speedup, even for general delay functions. In the current paper, we achieve a -approximation with -speedup for flow-time. Interestingly, [KL18] show that beating a -approximation for any constant requires a speedup of at least the optimal approximation factor of makespan minimization in the same machine environment. However, this lower bound requires different jobs with a precedence relationship to have different release dates, which is something our model disallows. (Appendix §5 gives another lower bound showing why we disallow such precedences in the online setting.)

In the online setting, [RS08] introduced the DAG model where each job is a directed acyclic graph (of tasks) released at some time, and a job/DAG completes when all the tasks in it are finished, and we want to minimize the total unweighted flow-time. They gave a -speed -competitive algorithm, where is the largest antichain within any job/DAG. [ALLM16] show -competitiveness with -speedup, again in the non-clairvoyant setting. The case where jobs are entire DAGs, and not individual nodes within DAGs, is captured in our weighted model by putting zero weights for all original jobs, and adding a unit-weight zero-sized job for each DAG which now depends on all jobs in the DAG. Assigning arbitrary weights to individual nodes within DAGs makes our problem quite non-trivial—we need to take into account the structure of the DAG to assign rates to jobs. Another model to capture parallelism and precedences uses speedup functions [ECBD97, Edm99, EP12]: relating our model to this setting remains an open question.

Our work is closely related to Im et al. [IKM18] who use a Nash fairness approach for completion-time and flow-time problems with multiple resources. While our approaches are similar, to the best of our understanding their approach does not immediately extend to the setting with precedences. Hence we have to introduce new ideas of using virtual rates (and being fair with respect to them), and throttling the induced actual rates at . The analyses of [IKM18] and our work are both based on dual-fitting; however, we need some new ideas for the setting with precedences.

Organization. The weighted completion time case is solved in §2. A -speedup result for weighted flow-time is in §3; this is improved to a -speedup in §4. The proof that we need the “no-surprises” assumption on release dates is in §5. Finally, we show how to solve the convex program in §6. Some deferred proofs can be found in §7.

## 2 Minimizing Weighted Completion Time

In this section, we describe and analyze the scheduling algorithm for the problem of minimizing weighted completion time on parallel machines. Recall that the precedence constraints are given by a DAG , and each job has a release date , processing size and weight .

### 2.1 The Scheduling Algorithm

We first assume that each of the machines run at rate (i.e., they can perform 2 units of processing in a unit time). We will show later how to remove this assumption (at a constant loss of competitive ratio). We begin with some notation. We say that a job is waiting at time (with respect to a schedule) if , but has not been processed to completion by time . We use to denote the set of waiting jobs at time . Note that at time , the algorithm gets to see the subgraph of which is induced by the jobs in . We say that a job is unfinished at time if it is either waiting at time , or its release date is at least (and hence the algorithm does not even know about this job). Let denote the set of unfinished jobs at time . Clearly, . At time , the algorithm can only process those jobs in which do not have a predecessor in – denote these minimal jobs by : they are independent of all other current jobs. For every time , the scheduling algorithm needs to assign a rate to each job . We now describe how it decides on these rates.

Consider a time . The algorithm considers a bipartite graph with vertex set consisting of the minimal jobs on left and the waiting jobs on right. Since , a job in appears as a vertex on both sides of this bipartite graph. When there is no confusion, we slightly overload terminology by referring to a job as a vertex in . The set of edges are as follows: let be vertices on the left and the right side respectively. Then is an edge in if and only if there is a directed path from to in the DAG .

The following convex program now computes the rate for each vertex in . It has variables for each edge . For each job on the left side, i.e., for , define as the sum of values of edges incident to . Similarly, define for a job , i.e., on the right side. The objective function is the Nash bargaining objective function on the values, which ensures that each waiting job gets some attention. In §6 we give a combinatorial algorithm to efficiently solve this convex program.

 max ∑j∈JtwjlnRtj (CP) Ltj =∑j′∈Jt:(j,j′)∈Etztjj′ ∀j∈It (1) Rtj =∑j′∈It:(j′,j)∈Etztj′j ∀j∈Jt (2) Ltj ≤1 ∀j∈It (3) ∑j∈ItLtj ≤m (4) zte ≥0 ∀e∈Et (5)

Let be an optimal solution to the above convex program. We define the rate of a job as being .

Although we have defined this as a continuous time process, it is easy to check that the rates only change if a new job arrives, or if a job completes processing. Also observe that we have effectively combined the machines into one in this convex program. But assuming that all events happen at integer times, we can translate the rate assignment to an actual schedule as follows. For a time slot , the total rate is at most (using (4)), so we create time slots , one for each machine , and iteratively assign each job an interval of length within these time slots. It is possible that a job may get assigned intervals in two different time slots, but the fact that means it will not be assigned the same time in two different time slots. Further, we will never exceed the slots because of (4). Thus, we can process these jobs in the time slots on the parallel machines such that each job gets processed for amount of time and no job is processed concurrently on multiple machines. This completes the description of the algorithm; in this, we assume that we run the machines at twice the speed. Call this algorithm .

The final algorithm , which is only allowed to run the machines at speed , is obtained by running in the background, and setting to be a slowed-down version of . Formally, if processes a job on machine at time , then processes this at time . This completes the description of the algorithm.

### 2.2 A Time-Indexed LP formulation

We use the dual-fitting approach to analyze the above algorithm. We write a time-indexed linear programming relaxation (LP) for the weighted completion time problem, and use the solutions to the convex program (CP) to obtain feasible primal and dual solutions for (LP) which differ by only a constant factor.

We divide time into integral time slots (assuming all quantities are integers). Therefore, the variable will refer to integer times only. For every job and time , we have a variable which denotes the volume of processed during . Note that this is defined only for . The LP relaxation is as follows:

 min ∑j,twj⋅t⋅xj,tpj (LP) ∑t≥rjxj,tpj ≥1∀j (6) ∑jxj,t ≤m∀t (7) ∑s≤txj,spj ≥∑s≤txj′,spj′∀t,j≺j′ (8)

The following claim, whose proof is deferred to the appendix, shows that it is a valid relaxation.

###### Claim 2.1.

Let opt denote the weighted completion time of an optimal off-line policy (which knows the processing time of all the jobs). Then the optimal value of the LP relaxation is at most opt.

The (LP) has a large integrality gap. Observe that the LP just imagines the machines to be a single machine with speed . Therefore, (LP) has a large integrality gap for two reasons: (i) a job can be processed concurrently on multiple machines, and (ii) suppose we have a long chain of jobs of equal size in the DAG . Then the LP allows us to process all these jobs at the same rate in parallel on multiple machines. We augment the LP lower bound with another quantity and show that the sum of these two lower bounds suffice.

A chain in is a sequence of jobs such that . Define the processing time of , , as the sum of the processing time of jobs in . For a job , define as the maximum over all chains ending in of . It is easy to see that is a lower bound (up to a factor 2) on the objective of an optimal schedule.

We now write down the dual of the LP relaxation above. We have dual variables for every job , and for every time , and

 max∑jαj−m∑tβt (DLP) αj−wj⋅t+∑s≥t(∑j≺j′γs,j→j′−∑j′≺jγs,j′→j) ≤pj⋅βt∀j,t≥rj (9) αj,βt ≥0

We write the dual constraint (9) in a more readable manner. For a job and time , let denote , and define similarly. We now write the dual constraint (9) as

 αj−wj⋅t+∑s≥t(γouts,j−γins,j)≤pj⋅βt∀j,t≥rj (10)

### 2.3 Properties of the Convex Program

We now prove certain properties of an optimal solution to the convex program (CP). The first property, whose proof is deferred to the appendix, is easy to see:

###### Claim 2.2.

If , then for all .

We now write down the KKT conditions for the convex program. (In fact, we can use (1) and (2) to replace and in the objective and the other constraints.) Then letting be the Lagrange multipliers corresponding to constraints (3), (4) and (5), we get

 wj¯Rtj =θtj′+ηt−νte ∀e=(j′,j),j′∈It,j∈Jt (11) θtj(¯Ltj−1) =0 ∀j∈It (12) ηt(∑j∈It¯Ltj−m) =0 (13) νte⋅¯zte =0 ∀e∈Et (14)

We derive a few consequences of these conditions, the proofs are deferred to the appendix.

###### Claim 2.3.

Consider a job on the right side of . Then .

###### Claim 2.4.

Consider a job on the right side of . Suppose has a neighbor such that and . Then .

A crucial notion is that of an active job:

###### Definition 2.5 (Active Jobs).

A job is active at time if it has at least one neighbor in (in the graph ) running at rate strictly less than 1.

Let denote the set of active jobs at time . We can strengthen the above claim as follows.

###### Corollary 2.6.

Consider an active job at time . Then .

.

### 2.4 Analysis via Dual Fitting

We analyze the algorithm first. We define feasible dual variables for (DLP) such that the value of the dual objective function (along with the values that capture the maximum processing time over all chains ending in ) forms a lower bound on the weighted completion time of our algorithm. Intuitively, would be the weighted completion time of , and would be times the total weight of unfinished jobs at time . Thus, would be at times the total weighted completion time. This idea works as long as all the machines are busy at any point of time, the reason being that the primal LP essentially views the machines as a single speed- machine. Therefore, we can generate enough dual lower bound if the rate of processing in each time slot is . If all machines are not busy, we need to appeal to the lower bound given by the values.

We use the notation used in the description of the algorithm. In the graph , we had assigned rates to all the nodes in . Recall that a vertex on the right side of is said to be active at time if it has a neighbor for which . Otherwise, we say that is inactive at time . We say that an edge , where is active at time if the vertex is active. Let denote the set of active edges in . Let be an edge in . By definition, there is a path from to in – we fix such a path . As before, let denote the completion time of job . The dual variables are defined as follows:

• For each job and time , we define quantities . The dual variable would be equal to . Fix a job . If we set to 0. Now, suppose . Consider the job as a vertex in (i.e., right side) in the bipartite graph . We set to if is active at time , otherwise it is inactive.

• For each time , we set to (Recall that is the set of unfinished jobs at time ).

• We now need to define , where . If or does not belong to , we set this variable to 0. So assume that (and so the edge lies in ). We define

 γt,j′→j:=ηt⋅∑e:e∈At,(j′→j)∈Pe¯zte.

In other words, we consider all the active edges in the graph for which the corresponding path contains . We add up the fractional assignment for all such edges.

This completes the description of the dual variables.

We first show that the objective function for (DLP) is close to the weighted completion time incurred by the algorithm. The proof is deferred to the appendix.

###### Claim 2.8.

The total weighted completion time of the jobs in is at most .

We now argue about feasibility of the dual constraint (9). Consider a job and time . Since for all time , . Therefore, it suffices to show:

 ∑s≥tαj,s+∑s≥t(γout% s,j−γins,j)≤pj⋅βt (15)

Let be the first time when the job appears in the set . This would also be the first time when the algorithm starts processing because a job that enters does not leave before completion.

###### Claim 2.9.

For any time lying in the range , .

###### Proof.

Fix such a time . Note that . Thus appears as a vertex on the right side in the bipartite graph , but does not appear on the left side. Let be in active edge in such that the corresponding path contains as an internal vertex. Then gets counted in both and . There cannot be such a path which starts with , because then will need to be on the left side of the bipartite graph. There could be paths which end with – these will correspond to active edges incident with in the graph (this happens only if itself is active). Let denote the edges incident with . We have shown that

 γouts,j−γins,j=−ηt⋅∑e∈Γ(j)∩As~zse. (16)

If is not active, the RHS is 0, and so is . So we are done. Therefore, assume that is active. Now, contains all the edges incident with , and so, the RHS is same as . But then, Corollary 2.6 implies that . Since , we are done again. ∎

Coming back to inequality (15), we can assume that . To see this, suppose . Then by Claim 2.9 the LHS of this constraint is same as

 ∑s≥t⋆jαj,s+∑s≥t⋆j(γouts,j−γins,j).

Since (the set of unfinished jobs can only diminish as time goes on), (15) for time follows from the corresponding statement for time . Therefore, we assume that . We can also assume that , otherwise the LHS of this constraint is 0.

###### Claim 2.10.

Let be such that is inactive at time . Then

###### Proof.

We know that . As in the proof of Claim 2.9, we only need to worry about those active edges in for which either ends at or begins with . Since any edge incident with as a vertex on the right side is inactive, we get (let denote the edges incident with , where we consider on the left side)

 αj,s+γouts,j−γins,j=ηs⋅∑e∈Γ(j)∩A(s)¯zse≤ηs⋅¯Lsj,

because and . ∎

###### Claim 2.11.

Let be such that is active at time . Then

###### Proof.

The argument is very similar to the one in the previous claim. Since is active, . As before we only need to worry about the active edges for which either ends or begins with . Any edge which is incident with on the right side (note that there will only one such edge – one the one joining to its copy on the left side of ) is active. The following inequality now follows as in the proof of Claim 2.10:

 αj,s+γouts,j−γins,j≤wj+ηs⋅¯Lsj−ηs⋅¯Rsj.

The result now follows from Corollary 2.6. ∎

We are now ready to show that (15) holds. The above two claims show that the LHS of (15) is at most Note that for any such time , the rate assigned to is , and so, we perform amount of processing on during this time slot. It follows that . Now Claim 2.7 shows that , and so we get

 Cj∑s=tηs⋅¯Lsj≤pj⋅w(Ut)2m=pj⋅βt.

This shows that (15) is satisfied. We can now prove our algorithm is constant competitive.

###### Theorem 2.12.

The algorithm is 10-competitive.

###### Proof.

We first argue about . We have shown that the dual variables are feasible to (DLP), and so, Claim 2.8 shows that the total completion time of is at most , where opt denotes the optimal off-line objective value. Clearly, and . This implies that is 5-competitive. While going from to the completion time of each job doubles. ∎

## 3 Minimizing Weighted Flow Time

We now consider the setting of minimizing the total weighted flow time, again in the non-clairvoyant setting. The setting is almost the same as in the completion-time case: the major change is that all jobs which depend on each other (i.e., belong to the same DAG in the “collection of DAGs view” have the same release date). In §5 we show that if related jobs can be released over time then no competitive online algorithms are possible.

As before, let denote the jobs which are waiting at time , i.e., which have been released but not yet finished, and let be the union of all the DAGs induced by the jobs in . Again, let denote the minimal set of jobs in , i.e., which do not have a predecessor in and hence can be scheduled.

###### Theorem 3.1.

There exists an -approximation algorithm for non-clairvoyant DAG scheduling to minimize the weighted flow time on parallel machines, when there is a speedup of .

The rest of this section gives the proof of Theorem 3.1. The algorithm remains unchanged from §2 (we do not need the algorithm  now): we write the convex program (CP) as before, which assign rates to each job . The analysis again proceeds by writing a linear programming relaxation, and showing a feasible dual solution. The LP is almost the same as (LP), just the objective is now (with changes in red):

 ∑j,twj⋅\definecolorpgfstrokecolorrgb1,0,0\pgfsys@color@rgb@stroke100\pgfsys@color@rgb@fill100(t−rj)⋅xj,tpj.

Hence, the dual is also almost the same as (DLP): the new dual constraint requires that for every job and time :

 αj+∑s≥t(γouts,j−γins,j)≤βt⋅pj+wj\definecolorpgfstrokecolorrgb1,0,0\pgfsys@color@rgb@stroke100\pgfsys@color@rgb@fill100(t−rj). (17)

### 3.1 Defining the Dual Variables

In order to set the dual variables, define a total order on the jobs as follows: First arrange the DAGs in order of release dates, breaking ties arbitrarily. Let this order be . All jobs in appear before those in in the order . Now for each dag , arrange its jobs in the order they complete processing by our algorithm. Note that this order is consistent with the partial order given by the DAG. This also ensures that at any time , the set of waiting jobs in any DAG form a suffix in this total order (restricted to ).

For a time and , let denote the indicator variable which is 1 exactly if is active at time . The dual variables are defined as follows:

• For a job , we set , where the quantity as defined as:

 αj,t:=1m[wj⋅I[j∈Jactt]⋅(∑j′∈Jt:j′⪯j¯Rtj′)+¯Rtj⋅(∑j′∈Jactt:j′≺jwj′)].
• The variable . Recall that the machines are allowed -speedup.

• The definition of the variables changes as follows. Let be an edge in the DAG . Earlier we had considered paths containing only for the active edges . But now we include all edges. Moreover, we replace the multiplier by , where In other words, we define

 γt,j′→j:=ηtj⋅∑e:e∈Ht,(j′→j)∈Pe¯zte.

In the following sections, we show that these dual settings are enough to “pay for” the flow time of our solution (i.e., have large objective function value), and also give a feasible lower bound (i.e., are feasible for the dual linear program).

### 3.2 The Dual Objective Function

We first show that is close to the total weighted flow-time of the jobs. The quantity is defined as before. Notice that is still a lower bound on the flow-time of job in the optimal schedule because all jobs of a DAG are simultaneously released. The following claim, whose result is deferred to the appendix, shows that the dual objective value is close to the weighted flow time of the algorithm.

###### Claim 3.2.

The total weighted flow-time is at most

### 3.3 Checking Dual Feasibility

Now we need to check the feasibility of the dual constraint (17). In fact, we will show the following weaker version of that constraint:

 αj+\definecolorpgfstrokecolorrgb1,0,0\pgfsys@color@rgb@stroke100\pgfsys@color@rgb@fill1002∑s≥t(γouts,j−γins,j)≤βt⋅pj+\definecolorpgfstrokecolorrgb1,0,0\pgfsys@color@rgb@stroke100\pgfsys@color@rgb@fill1002wj(t−rj). (18)

This suffices to within another factor of : indeed, scaling down the and variables by another factor of then gives dual feasibility, and loses only another factor of in the objective function. We begin by bounding in two different ways.

###### Lemma 3.3.

For any time , we have .

###### Proof.

Consider the second term in the definition of . This term contains . By Corollary 2.6, for any we have . Therefore,

 ∑j′∈Jacts:j′≺jwj′≤ηs⋅∑j′∈Jacts:j′≺j¯Rsj′≤ηs⋅∑j′∈Js¯Rsj′.

Now we can bound by dropping the indicator on the first term to get

 1m⋅[(wj⋅∑j′∈Js:j′⪯j¯Rsj′)+¯Rsj⋅(ηs⋅∑j′∈Jacts:j′≺j¯Rsj′)]

the last inequality using Claim 2.3. Simplifying, . ∎

Here is a slightly different upper bound on .

###### Lemma 3.4.

For any time , we have .

###### Proof.

The second term in the definition of is at most , directly using the definition of . For the first term, assume is active at time , otherwise this term is 0. Now Corollary 2.6 shows that , so the first term can be bounded as follows:

 wjm⋅∑j′∈Js:j′⪯j¯Rsj′=¯Rsj⋅ηsm⋅∑j′∈Js:j′⪯j¯Rsj′\lx@stackrel(Claim~{}???)≤¯Rsjm⋅∑j′∈Js:j′⪯jwj′=¯Rsj⋅ηsj,

which completes the proof. ∎

To prove (18), we write , and use Lemma 3.3 to cancel the first summation with the term . Hence, it remains to prove

 ∑s≥tαj,s+2∑s≥t(γout% s,j−γins,j)≤βt⋅pj. (19)

Let be the time at which the algorithm starts processing . We first argue why we can ignore times on the LHS of (19).

###### Claim 3.5.

Let be a time satisfying . Then

###### Proof.

While computing , we only need to consider paths for edges in which have as end-point. Since does not appear on the left side of , this quantity is equal to . The result now follows from Lemma 3.4. ∎

So using Claim 3.5 in (19), it suffices to show

 ∑s≥max{t,t⋆j}αj,s+2∑s≥max{t,t⋆j}(γouts,j−γins,j)≤βt⋅pj. (20)

Note that we still have on the right hand side, even though the summation on the left is over times . The proof of the following claim is deferred to appendix.

###### Claim 3.6.

Let be a time satisfying . Then

Hence, the left-hand side of (20) is at most . However, since job is assigned a rate of and the machines run at speed , we get that this expression is at most , which is the right-hand side of (20). This proves the feasibility of the dual constraint (18).

###### Proof of Theorem 3.1.

In the preceding §3.3 we proved that the variables , and satisfy the dual constraint for the flow-time relaxation. Since is a feasible dual, it gives a lower bound on the cost of the optimal solution. Moreover, is another lower bound on the cost of the optimal schedule. Now using the bound on the weighted flow-time of our schedule given by Claim 3.2, this shows that we have an -approximation with -speedup. ∎

In §4 we show how to use a slightly different scheduling policy that prioritizes the last arriving jobs to reduce the speedup to .

## 4 An O(1/ε2)-competitive Algorithm with (1+ε)-speed

Theorem 3.1 requires speedup. In this section, we improve the speed scaling requirement to . We prove the following:

###### Theorem 4.1.

There exists an -approximation algorithm for non-clairvoyant DAG scheduling to minimize weighted flow time on parallel machines when there is a speedup of .

For ease of exposition, we assume a -speedup in the proof of Theorem 4.1.

### 4.1 The Algorithm

The algorithm remains unchanged – we shall assign rates to each job . These rates are derived by a suitable convex program. This convex program is again same as (CP), except that the objective function now changes to

 ∑j∈Jt\definecolorpgfstrokecolorrgb1,0,0\pgfsys@color@rgb@stroke100\pgfsys@color@rgb@fill100ˆwj,tln¯Rtj,

where we replace the weight of job by a new time dependent quantity defined as follows.

###### Definition 4.2 (Weight ˆwj,t).

Consider a time , and let


text:
Application Domains
New Software and Platforms
Bilateral Contracts and Grants with Industry
Partnerships and Cooperations
Bibliography
 PDF e-Pub

## Section: Research Program

### Kinetic models for plasmas

The fundamental model for plasma physics is the coupled Vlasov-Maxwell kinetic model: the Vlasov equation describes the distribution function of particles (ions and electrons), while the Maxwell equations describe the electromagnetic field. In some applications, it may be necessary to take relativistic particles into account, which leads to consider the relativistic Vlasov equation, even if in general, tokamak plasmas are supposed to be non-relativistic. The distribution function of particles depends on seven variables (three for space, three for the velocity and one for time), which yields a huge amount of computations.

To these equations we must add several types of source terms and boundary conditions for representing the walls of the tokamak, the applied electromagnetic field that confines the plasma, fuel injection, collision effects, etc.

Tokamak plasmas possess particular features, which require developing specialized theoretical and numerical tools.

Because the magnetic field is strong, the particle trajectories have a very fast rotation around the magnetic field lines. A full resolution would require a prohibitive amount of calculations. It is then necessary to develop reduced models for large magnetic fields in order to obtain tractable calculations. The resulting model is called a gyrokinetic model. It allows us to reduce the dimensionality of the problem. Such models are implemented in GYSELA and Selalib.

On the boundary of the plasma, the collisions can no more be neglected. Fluid models, such as the MagnetoHydroDynamics (MHD) become again relevant. For the good operation of the tokamak, it is necessary to control MHD instabilities that arise at the plasma boundary. Computing these instabilities requires special implicit numerical discretizations with excellent long time behavior.

In addition to theoretical modelling tools, it is necessary to develop numerical schemes adapted to kinetic, gyrokinetic and fluid models. Three kinds of methods are studied in TONUS: Particle-In-Cell (PIC) methods, semi-Lagrangian and fully Eulerian approaches.

#### Gyrokinetic models: theory and approximation

In most phenomena where oscillations are present, we can establish a three-model hierarchy: $\left(i\right)$ the model parameterized by the oscillation period, $\left(ii\right)$ the limit model and $\left(iii\right)$ the two-scale model, possibly with its corrector. In a context where one wishes to simulate such a phenomenon where the oscillation period is small and the oscillation amplitude is not small, it is important to have numerical methods based on an approximation of the Two-Scale model. If the oscillation period varies significantly over the domain of simulation, it is important to have numerical methods that approximate properly and effectively the model parameterized by the oscillation period and the Two-Scale model. Implementing Two-Scale Numerical Methods (for instance by Frénod et al. [23]) is based on the numerical approximation of the Two-Scale model. These are called of order 0. A Two-Scale Numerical Method is called of order 1 if it incorporates information from the corrector and from the equation of which this corrector is a solution. If the oscillation period varies between very small values and values of order 1, it is necessary to have new types of numerical schemes (Two-Scale Asymptotic Preserving Schemes of order 1 or TSAPS) that preserve the asymptotics between the model parameterized by the oscillation period and the Two-Scale model with its corrector. A first work in this direction has been initiated by Crouseilles et al. [22].

#### Semi-Lagrangian schemes

The Strasbourg team has a long and recognized experience in numerical methods of Vlasov-type equations. We are specialized in both particle and phase space solvers for the Vlasov equation: Particle-in-Cell (PIC) methods and semi-Lagrangian methods. We also have a long-standing collaboration with the CEA of Cadarache for the development of the GYSELA software for gyrokinetic tokamak plasmas.

The Vlasov and the gyrokinetic models are partial differential equations that express the transport of the distribution function in the phase space. In the original Vlasov case, the phase space is the six-dimension position-velocity space. For the gyrokinetic model, the phase space is five-dimensional because we consider only the parallel velocity in the direction of the magnetic field and the gyrokinetic angular velocity instead of three velocity components.

A few years ago, Eric Sonnendrücker and his collaborators introduced a new family of methods for solving transport equations in the phase space. This family of methods are the semi-Lagrangian methods. The principle of these methods is to solve the equation on a grid of the phase space. The grid points are transported with the flow of the transport equation for a time step and interpolated back periodically onto the initial grid. The method is then a mix of particle Lagrangian methods and Eulerian methods. The characteristics can be solved forward or backward in time leading to the Forward Semi-Lagrangian (FSL) or Backward Semi-Lagrangian (BSL) schemes. Conservative schemes based on this idea can be developed and are called Conservative Semi-Lagrangian (CSL).

GYSELA is a 5D full gyrokinetic code based on a classical backward semi-Lagrangian scheme (BSL) [27] for the simulation of core turbulence that has been developed at CEA Cadarache in collaboration with our team [24].

More recently, we have started to apply the Semi-Lagrangian methods to more general kinetic equations. Indeed, most of the conservation laws of physics can be represented by a kinetic model with a small set of velocities and relaxation source terms [7]. Compressible fluids or MHD equations have such representations. Semi-Lagrangian methods then become a very appealing and efficient approach for solving these equations.


text:
This document is outdated. Autoplot is generally repacked into a two jar files, one for Autoplot and its libraries and one for the third party jar files. Otherwise the document is still useful.

# 1. Autoplot Internals Overview

The core of Autoplot is four jars

• QDataSet, the data model
• DataSource, gets data into the data model
• DataSourcePack, various implementations of DataSource, including AsciiTable and das2Stream.
• Autoplot, the application based on all of the jars.

Other jar files are used to read data from different file formats (e.g., CDF, and netCDF) or are used for UI functions (e.g., jars for writing PNG files). To see the list of jar files used, save http://www.autoplot.org/autoplot.jnlp as a text file and read its contents.

## 1.1. QDataSet

• QDataSet is the data model, which is a Java interface
• QDataSet implementations, e.g. DDataSet wraps a double array
• QDataSet is the data model used in das2 since the Autoplot2010 branch.
• Operators
• slice
• data reduction
• aggregation
• Utilities
• ascii table parser
• data set builder

Metadata is conveyed using a tree built from Map objects. The root "node" is Map<String,Object>, and the objects can be another Map<String,Object> branch or immutable objects that are leaves.

## 1.3. DataSource

• DataSources know how to model other data models as QDataSets.
• DataSources also provide a metadata of Map<String,Object> with name=value leaves.
• DataSourceFactorys
• translate from URI to DataSource
• provide completion model to generate valid URIs
• have a reject method that rejects incorrect or incomplete URIs
• Data sources often have GUIs that assist in creating valid URIs.
• DataSourceRegistry
• table of lookups: extension to DataSourceFactory and mime-type to DataSourceFactory
• DataSetURI
• uses DataSourceRegistry, DataSourceFactory to create DataSource from URI
• provides filesystem completion or dataSource completion by delegation.
• for example, ISTPMetaDataModel allows cdfs to be interpreted via local file access or via openDAP.
• org.autoplot.aggregator
• AggregatingDataSource aggregates another DataSource using das2 FileStorageModel
• AggregatingDataSourceFactory uses a delegate DataSourceFactory and a representative file.
• DataSetSelector GUI component that provides user interface to completion model. This is the address bar in the Autoplot GUI.
• DataSource.getCapability adds various capabilities, such as TimeSeriesBrowse. See developer.capabilities

## 1.4. Existing Data Sources

• various DataSources know how to model other data models as QDataSets, for example:
• ASCII--uses internal QDataSet ASCII table parser to read in table
• Binary--binary files.
• Excel--uses external Jakarta Poi library to read data from Excel spreadsheets.
• das2Stream--das2 streams allow streaming of data and metadata. Bob Weigel's TSDS server can send these streams.
• OpenDAP--open DAP is a web API for accessing remote data.
• SPASE--allows SPASE record to wrap another data source, and provide metadata for it.
• Fits--Fits files used in astronomy
• Wav--.wav files. This is the result of this tutorial.
• CDF--ISTP CDF files
• CEF--Cluster Exchange Format files
• Jython--Jython code is used to compose datasets.

## 1.5. Autoplot

• ApplicationModel is the legacy internal Model and Controller (as in MVC) of the Autoplot application. (The state and things the application can do.)
• the package "dom" implements the "DOM" tree containing the application state.
• AutoplotUI is a GUI View of the model.
• the package "state" has classes for undo/redo support, and saving application state into .vap files.
• the package "transferrable" supports copy image to OS clipboard.
• the package "server" is the back-end server that provides access to console to support scripting.
• the package "scriptconsole" is a GUI for browsing and executing jython code. It also contains LogConsole, which provides access to log messages.

# 2. Overview of Tutorial

In this tutorial, we will add the ability to plot .wav files to Autoplot. First, we will create a dummy data source and register it with autoplot. Then we will actually read the data and return the waveform. Last we'll add an additional capability and see how completions are added.

So we can avoid the tedium of jar files and compiling java code, this tutorial assumes you are using Netbeans 6.5+ and can build Autoplot as described in Autoplot_from_source and Autoplot_from_source#Building_in_Netbeans.

# 3. Create a Dummy DataSource and Register the DataSource Type

Before writing the code to deal with the wav format, we'll create the data source with a dummy implementation and confirm that it gets properly registered with Autoplot.

## 3.1. Set up project

• Create a new project "WavDataSource"
• Open WavDataSource project properties and click on "Libraries"

## 3.2. Define two classes

Create a new package "org.autoplot.wav". All class references are within this package.

### 3.2.1. WavDataSource

• Create a new class WavDataSource that extends AbstractDataSource. (An abstract class is a class that is mostly implemented, and subclasses finish the work.)
• Define a constructor that accepts URI and calls super constructor.
• Provide an implementation of the abstract method getDataSet. This is a dummy method for testing; the real implementation is presented in the next section.
public QDataSet getDataSet(ProgressMonitor mon) throws Exception {
return DataSetUtil.replicateDataSet( 30, 1.0 );
}

### 3.2.2. WavDataSourceFactory

• Create a new class WavDataSourceFactory that extends AbstractDataSourceFactory.
• Implement getDataSource(URL url) to simply return new WavDataSource(url)

## 3.3. Register with Autoplot

This is the tricky part, since no java type checking is done and it's easy to make mistakes.

• Make a text file META-INF/org.autoplot.datasource.DataSourceFactory.extensions that would contain the name of your factory class that has a no-argument constructor, followed by the extensions (e.g. wav).
• Alternatively, the plugin can be registered by mime type using the text file META-INF/org.autoplot.datasource.DataSourceFactory.mimeTypes. Note: mime types are only used with http urls. DEPRECATED: don't use this, it will probably go away.

The META-INF directory should appear in the project's src folder.

For Autoplot to locate and load your new data source, WavDataSource.jar must appear in the classpath. When running from NetBeans, the easiest way to do this is to add the WavDataSource project as a library in the Autoplot project properties.

## 3.4. Test

• run autoplot
• for URL, enter "file:///foo.wav"
• 30 1.0's should be plotted.

# 4. Implement the DataSource

We will do all the work in the getDataSet method of WavDataSource.

## 4.1. wav file format

A wav file is a big binary array, with encoding information in the first 64 bytes of the file. We will use java's AudioSystem class to parse the header. For this example, we will only support mono (one channel) formats. Also, we will not implement the QDataSet interface for now, and we will use java.nio which handles endian encodings.

## 4.2. Get a local copy of the file, create QDataSet

public QDataSet getDataSet(DasProgressMonitor mon) throws Exception {
File wavFile = DataSetURI.getFile(this.uri, mon);

AudioFileFormat fileFormat = AudioSystem.getAudioFileFormat(wavFile);
AudioFormat audioFormat = fileFormat.getFormat();
FileInputStream fin = new FileInputStream(wavFile);
ByteBuffer byteBuffer = fin.getChannel().map(MapMode.READ_ONLY, 64, wavFile.length() - 64);

int frameSize = audioFormat.getFrameSize();
int frameCount = (byteBuffer.limit() - byteBuffer.position()) / frameSize;
int bits = audioFormat.getSampleSizeInBits();
boolean unsigned= audioFormat.getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED );

if ( unsigned ) {
throw new IllegalArgumentException("Unsupported wave file format: " + audioFormat + ", need signed.");
}
if (audioFormat.getChannels() > 1) {
throw new IllegalArgumentException("Unsupported wave file format: " + audioFormat + ", need mono.");
}
if (bits != 16 && bits != 8) {
throw new IllegalArgumentException("Unsupported wave file format: " + audioFormat + ", need 8 or 16 bits.");
}

QDataSet result;

if (bits == 16) {
if (audioFormat.isBigEndian()) {
byteBuffer.order(ByteOrder.BIG_ENDIAN);
} else {
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
}
ShortBuffer shortBuffer = byteBuffer.asShortBuffer();
short[] buf = new short[frameCount];
shortBuffer.get(buf);
result = SDataSet.wrap(buf);
} else {
byte[] buf = new byte[frameCount];
byteBuffer.get(buf);
result = BDataSet.wrap(buf);
}

return result;
}

If you are interested in the QDataSet data model, you'll want to look at the QDataSet.

## 4.3. Test

Run Autoplot again and this time point it to a .wav file. Windows "Sound Recorder" can be used to produce the file, or use this one: [1]

## 5.1. Return arbitrary Metadata that is presented in the metadata tab

public Map<String,Object> getMetadata(ProgressMonitor mon) throws Exception {
File wavFile = DataSetURI.getFile(this.uri, mon);
AudioFileFormat fileFormat = AudioSystem.getAudioFileFormat(wavFile);
AudioFormat audioFormat= fileFormat.getFormat();
Map<String,Object> properties= new HashMap<String,Object>(  );
properties.put( "encoding", audioFormat.getEncoding() );
properties.put( "channels", audioFormat.getChannels() );
properties.put( "frame rate", audioFormat.getFrameRate() );
properties.put( "bits", audioFormat.getSampleSizeInBits() );
return properties;
}

## 5.2. Assigning time tags with the QDataSet model

To specify physical time tags with the QDataSet model, we can attach time tags to the created data set. To the getDataSet method, we add:

MutablePropertyDataSet timeTags= DataSetUtil.tagGenDataSet( frameCount, 0., 1./audioFormat.getSampleRate() );
timeTags.putProperty( QDataSet.UNITS, Units.seconds );
result.putProperty( QDataSet.DEPEND_0, timeTags );

In the QDataSet model, the property DEPEND_0 contains a dataset with the values of the independent variable. See https://saturn.physics.uiowa.edu/svn/das2/dasCore/community/autoplot2010/trunk/dasCoreDatum/src/org/das2/datum/Units.java for a list of units.

# 6. Adding parameters to the URI

Let's add the ability to look at just a part of the .wav file. We'll define two keywords, offset and length to our dataset URIs. For example, file:///data/mywav.wav?offset=1.0&length=0.2 means start at 1.0 seconds into the wav file, and clip after 0.2 seconds.

## 6.1. Getting the Parameters

Since we are extending AbstractDataSource, the parameters are available in the Map<String,String> params. It should be clear to the reader how this would be implemented, and here is the source: WavDataSource.java

## 6.2. Completion

The DataSourceFactory can provide a set of completions so that users can more easily use the data source. In our class WavDataSourceFactory, we now override getCompletions:

public List<CompletionContext> getCompletions(CompletionContext cc) {
List<CompletionContext> result= new ArrayList<CompletionContext>();
if ( cc.context.equals(CompletionContext.CONTEXT_PARAMETER_NAME ) ) {
result.add( new CompletionContext( CompletionContext.CONTEXT_PARAMETER_NAME, "offset" ) );
result.add( new CompletionContext( CompletionContext.CONTEXT_PARAMETER_NAME, "length" ) );
} else if ( cc.context.equals(CompletionContext.CONTEXT_PARAMETER_VALUE ) ) {
String paramName= CompletionContext.get( CompletionContext.CONTEXT_PARAMETER_NAME, cc );
result.add( new CompletionContext( CompletionContext.CONTEXT_PARAMETER_VALUE, "<double>" ) );
}
return result;
}

The completions identified here are used to automatically generate a GUI to create URIs.

# 7. What's Next

This tutorial uses existing implementations of QDataSet that force the data to be read into memory. This limits the size of the wav file that can be browsed to about 30 seconds at 8000Hz. One could easily create a QDataSet implementation that wraps the memory-mapped ByteBuffer, so data is only swapped into physical memory as it is accessed. (See java.nio for information about ByteBuffer.)

Note that this is implemented in Autoplot source.

You can also:

• define the reject method in WavDataSourceFactory to reject when the parameters aren't properly specified.
• define a graphical editor which aids URI construction instead if completions. (Note an automatic editor based on completions is coming.)
• also see the tutorial extension below

# 8. Creating a Graphical URI Editor

After producing functional WavDataSource and WavDataSourceFactory classes, an Editor Panel can be created as well. In this example we use the Netbeans (Java IDE) GUI builder, but it can be developed in Eclipse or other environments.

## 8.1. Summary of Steps

• First, create a class called "WavDataSourceEditorPanel" in the same package as the first two classes.
• Before implementing anything, we must create an extensions file so that our Panel will be used in Autoplot.
• Finally, we will implement the necessary methods to produce a working editor panel.

## 8.2. Create a WavDataSourceEditorPanel

Create the class in the same package as before.

• If you are using NetBeans, you may wish to use the GUI builder in constructing this class
• WavDataSourceEditorPanel should implement the DataSourceEditorPanel interface, and extend the JPanel class

## 8.3. The Extensions File

Next, we must create another file in the package's "META-INF" folder. Open a new text file, and save it as "org.autoplot.datasource.DataSourceEditorPanel.extensions". Then simply add the text: "org.autoplot.wav.WavDataSourceEditorPanel wav". This will allow Autoplot to find the class we are about to write and display it for editing Wav files.

## 8.4. Implementing the Editor

First we must design a simple GUI to handle parameters for the Wav file. Since we are only dealing with two parameters: offset and length, we only need two labels and two text fields in our GUI.

After this, we must implement five methods from the DataSourceEditorPanel interface: getPanel, setURI, getURI, reject, and prepare.

### 8.4.1. reject

This method determines if the given URI is acceptable for editing. Below is a simple implementation for the reject method. It simply detects if the given URI is a directory. This code can easily be modified to accept a URI that is incomplete and provide a default file path.

public boolean reject(String uri) throws Exception {
URISplit split = URISplit.parse(uri);
FileSystem fs = FileSystem.create(DataSetURI.getWebURL(DataSetURI.toUri(split.path)).toURI());
if (fs.isDirectory(split.file.substring(split.path.length()))) {
return true;
}
}
return false;

Note data sources that do not reject an empty URI like "vap+<dsid>:" are called "discoverable" and are added to the Autoplot menu at File->Add Plot From-><dsid>.

### 8.4.2. prepare

The prepare method for an editor panel can be designed to do a number of things to get the Editor ready. Since we only have a simple GUI, not much is needed in this case. This method returns true under normal condition. Note this method is provided a progress monitor, so long operations, such as downloading a file, should be done here.

public boolean prepare(String uri, Window parent, ProgressMonitor mon) throws Exception {
URISplit split = URISplit.parse(uri);
File f = DataSetURI.getFile(new URL(split.file), mon);
return true;
}

### 8.4.3. getPanel

Simply implement this method with "return this;"

### 8.4.4. setURI

This method is used to initialize the GUI. Since our GUI has two text fields with which to modify the URI, we will want these to display the current parameter values upon opening the URI editor.

public void setURI(String uri) {
this.sURI = uri;//store the value of the String input
URISplit split = URISplit.parse(sURI);
File f = DataSetURI.getFile(new URL(split.file), new NullProgressMonitor());
Map<String, String> params = URISplit.parseParams(split.params);
String oF = params.get("offset");
String lF = params.get("length");
jTextField1.setText(oF);
jTextField2.setText(lF);
}

Where jTextField1 and jTextField2 are the two jTextFields that display the parameter values.

### 8.4.5. getURI

The method "getURI" returns the URI for the current GUI settings. Note Autoplot assumes this is a working URI, and will exhibit strange behavior if it is not.

public String getURI() {
URISplit split = URISplit.parse(sURI);
Map<String, String> params = new LinkedHashMap();
String offset = jTextField1.getText().trim();
String length = jTextField2.getText().trim();
if(!offset.equals("")) params.put("offset", offset);
if(!length.equals("")) params.put("length", length);
split.params = URISplit.formatParams(params);
return URISplit.format(split);
}

There are many ways to extend the WavDataSourceEditorPanel to include additional functionality, including:

• More parameters can be included, such as 'channel'
• A more complex GUI may be implemented using something other than the jTextFields used here
• The methods can be modified to accept only a directory URI instead of a full filepath

Preview of a WavDataSourceEditorPanel


text:
## Saturday, April 11, 2015

### 16x²y²-48x²y+24xy²+100x²+16y²-72xy+150x-48y+100=28

Determine the pair(s) of real numbers $(a,\,b)$ that satisfy the equation $16x^2y^2-48x^2y+24xy^2+100x^2+16y^2-72xy+150x-48y+100=28$.

At first glance,  this seems like we need to use the modular arithmetic method to solve for $(x,\,y)$ but wait a minute! We need to find not the integers but real for $(x,\,y)$, so nope, modular arithmetic is out of the question...

Okay, now, what plan do we have? We got to have a plan in order to start, and we are not going to stare at the ceiling in order to gain the idea, we need to look at the given equation again and see if there is something we could do about it...

$16x^2y^2-48x^2y+24xy^2+100x^2+16y^2-72xy+150x-48y+100=28$

Note that we could rewrite the LHS of the equation by treating and grouping them as quadratic expressions in $y$ and $x$:

Please note also that we could regroup the terms that have the same coefficients, such as the pairs of

[MATH]\color{yellow}\bbox[5px,purple]{16x^2y^2}[/MATH] and [MATH]\color{yellow}\bbox[5px,purple]{16y^2}[/MATH];

[MATH]\color{yellow}\bbox[5px,red]{48x^2y}[/MATH] and [MATH]\color{yellow}\bbox[5px,red]{48y}[/MATH];

[MATH]\color{yellow}\bbox[5px,orange]{100x^2}[/MATH] and [MATH]\color{yellow}\bbox[5px,orange]{100}[/MATH]

so that

$(16x^2y^2+16y^2)-(48x^2y+48y)+(100x^2+100)+24xy^2-72xy+150x=28$

$16y^2(x^2+1)-48y(x^2+1)+100(x^2+1)+24xy^2-72xy+150x=28$

You might want to ask, does this approach work? Oh...we wouldn't know unless we try...at least this is something that we observed and we can simplify the LHS of the equation, let's see where it takes us:

$(x^2+1)(16y^2-48y+100)+24xy^2-72xy+150x=28$

$4(x^2+1)(4y^2-12y+25)+6x(4y^2-12y+25)=28$

$(4y^2-12y+25)(4(x^2+1)+6x)=28$

See it now? We can still "simplify" the LHS of the expression by completing the square of the two quadratic expressions:

$4\left(y^2-3y+\dfrac{25}{4}\right) \cdot 4\left(x^2+\dfrac{6x}{4}+1\right)=28$

$\left(y^2-3y+\dfrac{25}{4}\right)\left(x^2+\dfrac{3x}{2}+1\right)=\dfrac{28}{16}$

$\left(\left(y-\dfrac{3}{2}\right)^2+\dfrac{25}{4}-\dfrac{9}{4}\right) \left(\left(x+\dfrac{3}{4}\right)^2+1-\dfrac{9}{16}\right)=\dfrac{28}{16}$

$\left(\left(y-\dfrac{3}{2}\right)^2+4\right) \left(\left(x+\dfrac{3}{4}\right)^2+\dfrac{7}{16}\right)=\dfrac{28}{16}$

YES! Observe that $4\cdot \dfrac{7}{16}=\dfrac{28}{16}$, so, the only solution set for $(x,\,y)$ is $\left(-\dfrac{3}{4},\,\dfrac{3}{2}\right)$.


text:
# Is domain the independent or dependent variable?

Feb 2, 2015

None of the two, actually. However, the domain is related to the independent variable, as it is the set of all the "permitted" values for the independent variable to assume. In particular, given a function, you must be sure that:

1. If there is a fraction, the denominator can't be zero;
2. If there is an even root, its argument must be positive or zero;
3. If there is a logarithm, its argument must be strictly positive.

These requests can of course be combined, as for example in $\setminus \sqrt{\setminus \log \left(\setminus \frac{x}{x + 1}\right)}$.

Once you find out which values of $x$ are permitted for the expression to have sense, you take the set of all those values, and obtain the domain of the function.