A Little Widget for Fourier Series
Why the widget?
While there are already a huge number of resources available which introduce the Fourier series (including a truly elegant video by 3Blue1Brown on Youtube), I hadn’t really seen any resources which allow one to interact with it in the way that I wanted. To try to address this, a friend of mine and I collaborated to make the applet below. In it, the user can input whatever (reasonable) function they want using the math.js syntax and it will be plotted in blue. Then they can adjust the Fourier coefficients with the sliders, plotting the resulting partial sum in orange. I’m hoping that, in addition to serving as a fun little exercise for folks who are already familiar with the Fourier series, it might also serve as a motivator for those who are just being introduced to it (if only to answer the question “what is going on with this program?").
So, give it a go and see if you can make the orange plot look like the blue one. There’s some information further down which attempts to explain a little bit more about the Fourier series, and which talks about how to choose the coefficients so that the curves match up.
| ak |
|---|
| bk |
|---|
What’s going on here?
To begin, we have some function $f(x)$ plotted in blue.
This is the function that you can type into the “Enter an equation:” box.
By default it takes the value $f(x) = 4\sin(x) + 5\cos(x/2)$ (for no reason in
particular).
You can type in whatever you want, though.
Try x^2
for the familiar parabola or e^x
for an exponential function.
Note that the function you choose has to be continuous on the domain (here
the interval $[-\pi, \pi]$) for it to be able to be well-approximated by the
orange curve.
Now, what’s going on with these sliders and the orange line? What you might be able to deduce by messing with one slider at a time (while the rest remain at zero) is that each slider corresponds to a particular function, and that the value of the slider modulates the amplitude (height) of that function. For example, playing with the $b_1$ slider shows the function $\sin(x)$ at different amplitudes. Adding another slider with the $+$ button and playing with the $b_2$ slider shows a function of twice the frequency: $\sin(2x)$. The $a_k$ sliders correspond instead to $\cos$ functions of different frequencies. The only exception is the $a_0$ slider – here it corresponds to the function $a_0/2$. The factor of $1/2$ is by convention, and just simplifies explicit calculations involving the $a_k$’s. The orange curve is then just a finite sum of all of these terms. In brief:
\begin{align} s_n(x) &= \frac{a_0}{2} + a_1 \cos(x) + b_1 \sin(x) + a_2 \cos(2x) + b_2\sin(2x)\\ &\hspace{1cm} + \ldots + a_n \cos(nx) + b_n \sin(nx) \\ &= \frac{a_0}{2} + \sum_{k = 1}^{n} a_k \cos(kx) + b_k \sin(kx) \end{align}
The claim, then, is that we can tweak these sliders (the values of the $a_k$’s and $b_k$’s) to approximate $f(x)$ which is any reasonably nice function. As a brief conceptual exercise, what would we choose for the coefficients if $f(x) = 3\sin(x) + 7\cos(2x)$?
Click to see the answer
Choosing $b_1 = 3$, $a_2 = 7$ and all other coefficients to be zero does the trick. In fact, these are the only choices that will work (this fact is non-obvious).
How to choose the coefficients
All this said, it’s not immediately obvious how to choose these coefficients. If you snoop around on Wikipedia, you’ll probably run into the following formulas: $$ a_k = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos(kx) dx $$ $$ b_k = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin(kx) dx $$ While mechanically reasonable (just plug in your function and integrate!) these integrals are often nontrivial to work out, involving a lot of integration by parts. Further, to get a deep conceptual understanding of why these are the right formulas, it helps to have some experience in Linear Algebra.
For this presentation, we take a little bit of a different approach. The first step is to ask how we evaluate how good our approximation is. For this we can look to the familiar distance formula in 2-dimensions and then work our way up to finding the distance between functions. Recall that the distance between two points is given by: $$ d\bigl((x_1, y_1), (x_2, y_2)\bigr) = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} $$ One can understand this from the following figure – just use the Pythagorean theorem.
For a concrete example, compute the distance between $(3, 2)$ and $(7, 5)$.
Click here to see the result
Writing out the distance formula gives: $$ d\bigl((3, 2), (7, 5)\bigr) = \sqrt{(3 - 7)^2 + (2 - 5)^2} = \sqrt{25} = 5 $$
If we relabel the points $(x_1, y_1) \to (p_1, p_2)$ and $(x_2, y_2) \to (q_1, q_2)$ we can rewrite this distance function as: $$ d(p, q) = \sqrt{(q_1 - p_1)^2 + (q_2 - p_2)^2} = \sqrt{\sum_{i = 1}^2 (q_i - p_i)^2} $$
where in the last step we have rewritten the formula using summation notation – this will be important to generalizing to points with more coordinates. Note that here the subscripts are telling you which coordinate you are looking at, whereas before they were telling you which point you were looking at. We can generalize this to points which have $N$ entries ($N$ is arbitrary), call them $p = (p_1, p_2, \ldots, p_N)$ and $q = (q_1, q_2, \ldots, q_N)$, and write the distance formula as: $$ d(p, q) = \sqrt{\sum_{i = 1}^N (q_i - p_i)^2} $$
Now, here is the biggest conceptual jump so far: if we break up the domain into some evenly-spaced points $x_1, x_2, \ldots, x_N$ then we can choose the coordinates of $p$ to be our function $f$ evaluated at those points: $$ p = \bigl(f(x_1), f(x_2), \ldots, f(x_N)\bigr) $$
In the figure below we’ve plotted a parabola $f(x) = x^2$ in blue, as well as some points at which the function is evaluated in orange. Each of the compontents of $p$ are understood to be the $y$-values of of those points.
What would $p$ be if we choose the evaluation points to be $(x_1, x_2, x_3, x_4, x_5) = (-2, -1, 0, 1, 2)$ and $f(x) = x^2$?
Click to see the answer
$$ p = \bigl( f(x_1), f(x_2), f(x_3), f(x_4), f(x_5) \bigr) = (4, 1, 0, 1, 4) $$
If we do the same operation to another function $g(x)$, then each of the terms in the sum $(q_i - p_i)^2 = (g(x_i) - f(x_i))^2$ is just the distance (squared!) between the selected points. In the figure below, this is the distance between the orange and the blue points.
Then the total distance formula gives the sum of all those little distances. This sort of makes sense as a way to see how similar two functions are: if they take on similar values at the sample points, then the sum of all those squared distances will be really small.
Now, if we add in more points (split up the domain more finely) we get more terms, but the terms don’t get any smaller. To keep this proposed distance formula from going to infinity, we multiply by the spacing between the $x_i$ points – call this spacing $\Delta x$. That way, as we make that spacing finer, $\Delta x$ gets smaller so that the distance function remains bounded:
$$ d(p, q) = \sqrt{\sum_{i = 1}^N \bigl(g(x_i) - f(x_i)\bigr)^2 \Delta x} $$
But we can recognize this as a Riemann sum!
If we choose more and more points (that is, let $\Delta x \to 0$), then our summation turns into an integral. That integral is the thing that we will take to be the distance formula for our functions:
$$ d(f, g) = \sqrt{\int_{-\pi}^{\pi} \bigl( g(x) - f(x) \bigr)^2 dx} $$
Note that we integrate over the whole domain because those sample points $x_i$ range over the whole interval $[-\pi, \pi]$. One last thing that we do is multiply by $1/\sqrt{\pi}$. Again, this is by convention and makes sense once one considers this story from a Linear Algebra perspective – all this does is rescale the distance. The final formula that we’re left with is called the $L_2$-norm, and is often denoted by pairs of vertical bars:
$$ ||g - f|| = \sqrt{ \frac{1}{\pi} \int_{-\pi}^{\pi} \bigl( g(x) - f(x) \bigr)^2 dx} $$
The strategy for estimating $f(x)$ with some $g(x)$ (say $s_n(x)$) will then be to try to minimize this distance function. This is calculated in the applet (right under the equation input) and the way to properly choose the coefficients is to use the sliders to minimize that number. In fact, if you do this minimization one slider at a time (use the first slider to get $L_2$ as small as possible, add another slider, mess with only the added slider, then repeat) you will end up with the proper Fourier coefficients! This is not meant to be obvious – it seems reasonable that you might need to do some extra work than just choosing the coefficients one at a time to minimize the distance. However, there is a theorem from Linear Algebra that tells us we are justified in this process. And indeed, if we do this, the orange curve almost magically starts to look like the blue curve. Give it a try to see what I mean.


--- layout: default ---
This course requires a heavy amount of reading. We have provided PDFs of all papers and book chapters on the Canvas site. Additionally, you will find links to the online versions in the dated "Class Activities" below.
The second half of this course will be a series of workshops covering applications in phylogenetic methods for macroevolution. Please come to class prepared to complete the tutorial with your own laptop. (If you do not have access to a laptop, one may be provided for you for use during class time.)
Students will be evaluated on their performance in three components of the course: (1) a midterm exam, (2) participation, and (3) the final project. For deteails, please see the course syllabus.
Read: {{ post.reading | truncatewords: 10 }}
navigate_next


Zengxiang Zhao
Machine Learning/Bioinformatics
SKILLS
- 3 yrs
- 1 yr
- 1 yr
- 2 yrs
- 1 yr
- 2 yrs
- 2 yrs
- 2 yrs
- 2 yrs
ABOUT ME
I’m a graduate student with backgrounds in computer science and biology. During my graduate study in Shanghai, my main research was about the mechanisms of addiction through studying the rat’s behavior under extinction of conditioned place aversion. Just because the multi-disciplinary training, I am able to combine these two disciplines and solve the problems in biology. Meanwhile I’m a faster learner. When I was doing my project about using machine learning to classify HIV gene sequences. I had read about 40 papers before handing this problem. And the final model was reliable with a kappa value more than 0.9, which had applied two patents. This project was done by python using pytorch framework on Linux platform. Even though I changed my major to computer science, I’m still curiosity about the mystery of biology. So my ideal job is to combine these two disciplines. As you see, these are my strengths.
EDUCATION
-
M.S in Computer & Information Science
SUNY Polytechnic Institute, Utica, NY
- Major Areas: Software Engineering, Systems and Architectures, Algorithms and Theory, Artificial Intelligence and Modeling
- Cumulative GPA: 3.83/4.0
- Relevant Coursework: Machine Learning, OOP, Data Structures, Algorithms & Complexity, Computer Graphics
-
M.S in Pharmaceutical Engineering
Chinese Academy of Sciences, ShangHai, China
- Major Areas: Neuroscience, Pharmacology, Rat Surgery, Statistical Analysis
- Publication: Wang YJ, &Hang A, &Zhao ZX, et al.(2016) “kappa Opioid receptor activation in different brain regions differentially modulates anxiety-related behaviors in mice”. Neuropharmacology. 110: 92-101.
-
B.S in Bioengineering
Agriculture University of Hebei, Hebei, China
- Major Areas: Genetics, Microbiology, Cytology, Biochemistry, Fermentation
WORK EXPERIENCE
-
Machine Learning Engineer
Chinese National Human Genome Center, Beijing, China
- Built a HIV gene sequences classification model which could classify 184 kinds of HIV sub-types
- Built a pipeline of creating knowledge graph, which included back-end and front-end which was built using Flask
- Two pipelines of auto summary generation was built. One was an unsupervised method based on maximum marginal relevance (MMR). The other one used a deep learning method Google Pegasus.
-
Advanced Technical Representative
JingYang Tonewall ( Health Care Providers and Services), Beijing, China
- Searched and learned the latest knowledge about quality control needed in the clinical lab
- Analyzed clinical lab data and handled customer’s problems about quality control
- Trained sales representatives and discovered new customers in the market to increase sale
PROJECTS
-
Deep learning - Building the HIV classification model
- This project aimed to classify 184 kinds of HIV gene sequences in the database, which was done by building a classification model from scratch by deep learning. I’ve read forty papers about gene sequences classification within two weeks before building a model and the final model was reliable with kappa value greater than 0.9 , which had applied for two patents . A web interface was created by using Streamlit for user’s convenience.
- [Skills Developed]: Pytorch, Sklearn, Pandas, Jellyfish, Streamlit
-
NLP - Building a knowledge graph pipeline
- The purpose of this project was to extract the concerned information from scientific papers, e.g. the relations among specific genes, diseases and drugs. This project included the following procedures:
- extracting triples from scientific papers, which included converting pdf format papers into text format files, co-reference resolution, filtering noise in text files, extracting triples;
- entity disambiguation through embedding by Bert model and computing the cosine similarity among entities;
- building a website app using Flask to show relations of triples through a table and a graph based on keywords search. If a keyword didn't exist in the entities, a most similar entity would replace the keyword.
- [Skills Developed:] Spacy, Transformers, nltk, Flask, D3.js, Bert Embedding，networkx，Stanford-openie
-
System Theory application:Brain Research
- This is my graduate project. It is about implementing the system algorithms using python language. The algorithms were developed by my advisor about thirty years ago. And I’m the first one who use python to implement these algorithms.
- After that, I thought could I use these algorithms to solve the problems in biology? I found that it’s feasible to decide the relationship between human behavior and brain regions by system theory.
- The main idea is that the functional magnetic resonance imaging (fMRI) method can be used to show the states of the diverse regions in the brain corresponding to specific behaviors or emotions. In my project, system theory is used to figure out which parts of the brain participated in the behavior as well as how these regions contributed to controlling the behavior. It may speed up the construction of long-range connectivity of various brain areas and give insight into the experimental designs for the neural science of mental behaviors.
- [Skills Developed:] Python, Pandas, numpy
SHOWCASE
- The web page of HIV classification
- Metrics of the machine learning models for HIV classification
- The web page of Knowledge Graph
- Relations and diagrams of substructures SS1 in the project of System Theory application


{{ with .Site.Params.services }}
{{ .description | markdownify }}
{{ if isset . "linktitle" }} {{ end }}Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.


No open diagram
or
Diagram may not render correctly due to import warnings.
Show details
×
Import Warnings
{{ warnings.message }}


GET A FREE AIRPORT SHUTTLE
That’s correct!
We’re so determined to make your experience at our hotel a charm, that we’d love to provide you with a courtesy airport shuttle if you book with us!


surveymonkey
Businessmodel of SurveyMonkey
Customer Segments
SurveyMonkey has a segmented business model, which recognizes customer segments with slightly different needs and problems. It serves the following two groups:
- Non-Enterprise: For individual customers, the company offers single-user accounts. A single account holder can log in, create surveys, and obtain results for analysis. These persons most commonly utilize SurveyMonkey’s free option, but can also opt to pay for a higher-level option with advanced features.
- Enterprise: For organizations, the company has created SurveyMonkey Enterprise, which offers a multi-user account. The account holder has a single login ID that he/she shares with fellow users in the organization; this set-up enables the streamlining of billing and easier control of data. Users can then create surveys and share the results amongst each other. Enterprise users receive 24/7 email and phone support, and also have access to a “customer success team.“ SurveyMonkey Enterprise customers include 100% of the Fortune 100. ### Value Proposition
SurveyMonkey offers three primary value propositions: accessibility, customization, and brand/status.
The company’s service makes it easy for everyone, including individuals, small businesses, to design a survey that can reach thousands of people and provide useful insights. The service is simple to use and presents results in real-time, meaning users do not have to wait.
The service offers 200 survey templates customized for various areas of focus; these templates include Academic Surveys, Event Planning Surveys, Market Research Surveys, Customer Satisfaction Surveys, Employee Surveys, Political Surveys, Education Surveys, and Healthcare Surveys.
The service is well-established and is considered to be the world’s leading online survey platform, with over 25 million users, over 3 million survey responses per day, and over 57 million completed surveys.
Channels
SurveyMonkey’s’ main channel is its website, which serves to market as well as offer the actual service. The company also offers a mobile app through which customers can design and conduct surveys. Lastly, it provides customer service through email and phone support for paying users.
Customer Relationships
SurveyMonkey’s customer relationship is primarily of a self-service, automated nature. Customers utilize the service through the main platform while having limited interaction with employees. There is also a personal assistance component in that customers can receive e-mail support; paying customers can receive 24/7 e-mail assistance and phone support.
Key Activities
SurveyMonkey’s key activities focus on platform management. The company primarily devotes time to maintaining its software-as-a-service (SaaS) platform, which enables the creation of surveys. It recently launched a new platform called SurveyMonkey Benchmarks that enables users to compare their results against those of competitors.
Key Partners
SurveyMonkey partners with various popular third-party providers of apps and widgets by integrating the programs into its main tool. The providers can send and share surveys or analyze their results. The company’s partners include Eventbrite, MailChimp, HubSpot, Zendesk, and Microsoft Word.
Key Resources
SurveyMonkey’s main resource is its proprietary software platform, which customers use to create surveys. It also depends on human resources to provide customer service.
Cost Structure
SurveyMonkey has a cost-driven structure, aiming to minimize expenses through significant automation and low-price value propositions. The company’s biggest cost drivers are fixed costs, namely in the areas of product development and customer support.
Revenue Streams
SurveyMonkey has one main revenue stream. The company utilizes a freemium model, in which it offers its basic service for free and then charges a premium for advanced features. It offers the following four pricing tiers (with discounts for students/educators)
- Basic: Free; customers are limited to 10 questions and 100 respondents per survey they design, and receive standard e-mail support.
- Select: Costs $26 per month ($18 per month for students/educators), billed on a month-to-month basis; customers are limited to 1,000 respondents per survey and also have added perks such as unlimited questions, priority 24/7 e-mail support, and the ability export data and reports.
- Gold: Costs $300 per year ($204 per year for students/educators), billed annually; customers receive the benefits of the Select plan as well as access to statistical significance and text analyses, question and answer piping, and randomization.
- Platinum: Costs $1,020 per year ($528 per year for students/educators), billed annually; customers receive the benefits of the Gold plan as well as access to white label surveys, advanced survey logic, the ability add multiple users, HIPAA-compliant features, and onboarding and phone support.


Having a fever does not mean feeling hot. It means an actual elevation of your body temperature, which is usually between 98.6 to 99.4 degrees. Normally your temperature is higher in the evening, though it still should not be over 99.4. (It begins to decrease again during your nighttime rest due to total body inactivity.) To allow for inaccuracies in taking your tempera- ture, a good arbitrary level to set as being abnormal is 100.4 degrees with an oral thermometer. Therefore anytime your temperature is above 100.4 degrees, you have a fever, and you need to know why. Note: The elderly generally run about 0.5 degrees cooler than younger adults, and they can sometimes have even a severe infection without an elevated temperature.
Fever is an indication that your body is combating an illness caused by a virus or bacterium. But cancer and various auto- immune diseases (where the body fights against itself) can also cause fever, which may be the only clue that illness is present. You should seek medical evaluation if you have a persistently elevated temperature, even without an apparent cause. Early treatment of these illnesses often reduces the risk of serious complications. Note: A fever over 103.5 degrees often indicates a serious infection and should be evaluated immediately.
The rise-and-fall pattern of the body’s temperature may provide a clue as to the cause of the fever, so keeping a chart monitoring temperature levels at various times may be helpful in diagnosing the problem. Also, when you have a fever, your temperature is often elevated in the evening but normal in the morning. You should never consider yourself well until your temperature has been normal for at least a twenty-four-hour period.
An oral temperature is very accurate. However, if a person is unable, for any reason, to hold a thermometer under his or her tongue, there are other options for measuring a temperature, including under the arm, in the ear, on the forehead, and rectally (the most accurate). A comprehensive discussion of these alternatives is in Appendix D, Taking a Child’s Temperature, on page 393. (In many cases, the issues apply to both children and adults.) To convert Fahrenheit to Celsius, subtract 32 and divide by 1.8. To convert Celsius to Fahrenheit, multiply by 1.8 and add 32.
Long-term infections are notorious for causing fever at night. When fever occurs, and your body’s temperature then returns to normal, drenching sweats result. They may be so profuse that you have to change your pajamas. This sweating is part of the body’s cooling mechanism, as it helps get rid of the heat of a high fever.
A common cause of night sweats is tuberculosis (TB), a disease whose other symptoms include weight loss and a cough, sometimes with bloody phlegm. TB is more likely to occur in people with weak immune systems (such as those with AIDS), those traveling to countries with a high TB infection rate, and those who have been exposed to TB patients. Drug abusers, patients who have had their stomachs surgically removed, and those who have been exposed to silica (the major component of sand, used in making glass) are also prime candidates for TB.
Night sweats are also one of the early signs of an HIV infection, the virus that causes AIDS, and they can occasionally be caused by cancers such as lymphoma. Other causes of night sweats include menopause, certain medications, low blood sugar, hormone disorders, and certain neurological conditions. Sometimes there is no identifiable cause.
Persistent night sweats and fever are red light warning signals that you should see your doctor for medical evaluation as soon as possible.


This booster provides a basic example of how to externalize configuration for an Apache Camel route.
For OpenShift deployments, the booster stores configuration data in a ConfigMap. A ConfigMap is an object that you can use to inject configuration data (in simple key and value pair format) into one or more Linux containers.
For standalone deployments, the booster stores configuration data in an applications.properties file.
This page invokes the Greeting Service every five seconds. The Greetings Service responds by using the booster.nameToGreet
value from the ConfigMap (for OpenShift deployments) or a properties file (for standalone deployments).
To demonstrate how the Externalized Configuration works:
booster.nameToGreet
value.
For OpenShift deployments, modify the fuse-configmap-booster
ConfigMap by using the OpenShift console or CLI.
For standalone deployment, edit the target/classes/application.properties
file.


Open Source has always been a foundation of the Internet, and with the advent of social open source networks this is more true than ever. But open source projects suffer from a startling lack of diversity of participants, including women, people of color, and other underrepresented populations.
Part of this problem lies with the projects themselves. Insensitive language, thoughtless use of pronouns, projects with sexualized or culturally inappropriate names, and side effects of the pervasive cult of meritocracy make contributing to open source a daunting prospect for many people.
An easy way to begin addressing this problem is to be overt in our openness, welcoming all people to contribute, and pledging in return to value them as human beings and to foster an atmosphere of kindness, cooperation, and understanding.
The Contributor Covenant can be one way to express these values. Pledge your respect and appreciation for contributors and participants in your open source project by adding an explicit CODE_OF_CONDUCT.md to your project repository.
You can view and download Version 1.3 of the Contributor Covenant here:
Note that since the Contributor Covenant uses semantic versioning for revisions, all URLs are permanent.
We recommend that you add the Markdown or text version of the Contributor Covenant to your source code repository at the root level.
You may want to add language similar to this to introduce your code of conduct:
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
You may also use the permalinks given above to reference from your project home page.
Important! You must add a contact method to the placeholder in the document so that people know how to report violations.
This code of conduct has already been adopted by thousands of open source projects. Here are just a few major projects using the Contributor Covenant. See this page for more.
To add your project to the list, submit a pull request here.
This project is itself open source, and its repository can be found here. Contributions in the form of issues and pull requests are welcomed and encouraged.


| Character | Explanation |
|---|---|
| . | Any character except for a line break |
| ^ | Finds the search term at the beginning of a paragraph |
| $ | Finds the search term at the end of a paragraph |
| * | Finds zero or more of the given characters |
| + | Finds one or more of the given characters |
| ? | Finds zero or one of the given characters |
| \ | Following character is not interpreted as RegEx |
| \n | Represents a line break |
| \t | Represents a tab |
| \b | Represents a boundary of words |
| [abc123] | Matches one of the characters that are between the brackets |
| [a-e] | Represents any of the characters in the range between a and e |
| [a-eh-x] | Represents any of the characters that are between a-e and h-x |
| [^a-s] | Represents everything that is not between a and s |
| | | Logical OR |
| {2} | Defines number of times given character occurs |
| {1,2} | Defines minimum and maximum number of times given character occurs |
| {1,} | Defines the minimum number of times given character occurs |


MKCheckBox Class Reference
| Inherits from | MKControl : UIControl |
| Declared in | MKCheckBox.h |
Overview
The MKCheckBox class creates a 30x30 checkbox object. When the user touches the check box it is toggled on and off.
MKCheckBox dispatches the MKActionValueChanged
Tasks
Creating
-
- initWithType:
Returns an instance of MKCheckBox.
Control
-
boxChecked
YES
if the box is checked,NO
if it is not
Apperance
Instance Methods
initWithType:
Returns an instance of MKCheckBox.
- (id)initWithType:(MKCheckBoxType)type
Parameters
- type
- the MKCheckBoxType to uses
-
MKCheckBoxRoundedRect
: A rounded rect outline for the check box. -
MKCheckBoxRound
: A round outline for the check box.
-
Return Value
MKCheckBox instance.
Declared In
MKCheckBox.h
Properties
boxChecked
YES
if the box is checked, NO
if it is not
@property (nonatomic, assign) BOOL boxChecked
Declared In
MKCheckBox.h
type
Sets the type of check box that is used.
-
MKCheckBoxRoundedRect
: A rounded rect outline for the check box. -
MKCheckBoxRound
: A round outline for the check box.
@property (nonatomic, assign) MKCheckBoxType type
Declared In
MKCheckBox.h


Basics of WEB & HTML
- personal notes for Rohit Narang
Definitions
WWW: World wide web
HTML: Hyper Text Markup Language
Hyperlinks: provides links between pages
How it all ties in together?
You (through your browser) access the internet which in turn uses the HTTP (protocol) to access the various servers
to access the information in the servers
HMTL is made up of
- Text content
- mark ups
-references to (images, videos or other web pages)
HTML Mark Up
It comprises of opening tag & closing tag and the whole sequence is called element
B is used for Bold
Em is used for italics
HTML Attributes
"a" is used for Anchor which links the specific words to another webpage. For instance below
Really enjoy good seesions!
"img" is used for Images
Important point: there are some tags which have no content so have no closing tags. These are also called "VOID TAGS"
White Space
All spaces in HTML are white spaces so unless specific commands are used, it will be presumed that everything is written in a flow.
"br" is line break
"p" is for one paragraph
The difference between the two is that while one is inline and otehr is a block. The block clubs all the words inside it as one cluster
Highlights of this lesson:
This has been extremely interesting to get the basics right and being able to play around with scratchpad.io or JSFiddle has been a lot of FUN!


This page contains the timepicker code and a demo. It includes all needed concepts, e.g. for getting the screen coordinates. In principle, all areas on the timepicker are clickable. For example, by clicking on the big font hour and minute display in the table header, you can go to the buttons for selecting hours or minutes. Try this also on your mobile phone. Todo:


Created an interactive scrolling platform game within a team (4) over several months for the Texas Computer Educators Association's 0100 Elements game programming competition. Received 2nd place and written in Java.
A snail goes through Summer, Fall, Winter, and Spring fighting slimes, going through normal, spiky, and disappearing platforms, and overcoming tricky obstacles to collect gems in order to save the world from seasonal destruction.


|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |
| Packages that use Jode | |
|---|---|
| xmlcomponents | |
| xmlcomponents.autoparse | |
| xmlcomponents.manipulation | |
| xmlcomponents.manipulation.xpath | |
| xmlcomponents.output |
| Uses of Jode in xmlcomponents |
|---|
| Subclasses of Jode in xmlcomponents | |
|---|---|
class |
Jocument
Represents an XML document. |
| Methods in xmlcomponents that return Jode | |
|---|---|
Jode |
Jode.first()
Finds the first child of this Jode |
Jode |
JodeList.first()
Gets the first element of the list |
Jode |
Jode.first(JodeFilter filter)
Finds the first child node that matches the given filter |
Jode |
JodeList.first(JodeFilter filter)
|
Jode |
Jode.first(java.lang.String nodeName)
Finds the first child node that matches the given node name |
Jode |
JodeList.first(java.lang.String nodeName)
Gets the first element of the list with the given node name |
Jode |
JodeList.get(int i)
Gets the node at index i |
static Jode |
Jocument.load(java.io.InputStream in,
java.lang.String rootNode)
Creates a Jocument out of the given stream and makes the given node name the root of the Jocument |
static Jode |
Jocument.load(java.lang.String fileLocation,
java.lang.String rootName)
Creates a Jocument out of a file located at the given file location and makes the given node name the root of the Jocument |
static Jode |
Jocument.load(java.net.URL in,
java.lang.String rootNode)
Creates a Jocument out of a file located at the given URL and makes the given node name the root of the Jocument |
Jode |
Jattr.parent()
Gets you to the node that this attribute was defined in. |
Jode |
Jode.single()
If this node has one child, this will give you that child. |
Jode |
Jode.single(JodeFilter filter)
Equivalent to calling children().single(filter). |
Jode |
JodeList.single(JodeFilter filter)
Will give you to single element of this list matching a given name. |
Jode |
Jode.single(java.lang.String nodeName)
Equivalent to calling children().single(nodeName). |
Jode |
JodeList.single(java.lang.String nodeName)
Will return the only element of this list with the given node name. |
Jode |
Jode.xPathTraverse(java.lang.String path)
Uses Xpath to traverse to the specified node. |
| Methods in xmlcomponents that return types with arguments of type Jode | |
|---|---|
java.util.Iterator<Jode> |
JodeList.iterator()
|
| Methods in xmlcomponents with parameters of type Jode | |
|---|---|
boolean |
JodeFilter.accept(Jode j)
Will decide whether or not this Jode passes the filter |
void |
Action.act(Jode j)
Applies this method to the supplied Jode. |
void |
ActionWithIndex.act(Jode j,
int index)
Applies this method to the supplied Jode. |
int |
Jode.compareTo(Jode arg0)
|
boolean |
JodEqualityComparer.equal(Jode _1,
Jode _2)
Returns whether or not two Jodes are equal |
| Constructors in xmlcomponents with parameters of type Jode | |
|---|---|
JinqException(java.lang.String message,
Jode cause)
|
| Uses of Jode in xmlcomponents.autoparse |
|---|
| Methods in xmlcomponents.autoparse with parameters of type Jode | ||
|---|---|---|
static void |
ClassCreation.createClasses(Jode j,
java.lang.String destinationFolder)
Given a Jode , usually a Jocument , will generate class files used for eventually consuming the XML
into objects. |
|
static
|
AutoParser.parse(Jode j,
java.lang.Class<T> clazz)
Parses a node into the given class type. |
| Uses of Jode in xmlcomponents.manipulation |
|---|
| Methods in xmlcomponents.manipulation with parameters of type Jode | |
|---|---|
T |
Xformer.xform(Jode j)
Given a Jode, will create an object of type T |
| Uses of Jode in xmlcomponents.manipulation.xpath |
|---|
| Methods in xmlcomponents.manipulation.xpath that return Jode | |
|---|---|
Jode |
XPath.traverse(Jode start)
Will traverse from the given start node to the location pointed to in the XPath expression. |
| Methods in xmlcomponents.manipulation.xpath with parameters of type Jode | |
|---|---|
JodeList |
XPath.find(Jode start)
Given a starting node, will match the xpath expression against multiple nodes |
Jode |
XPath.traverse(Jode start)
Will traverse from the given start node to the location pointed to in the XPath expression. |
| Uses of Jode in xmlcomponents.output |
|---|
| Constructors in xmlcomponents.output with parameters of type Jode | |
|---|---|
JodeWriter(Jode j)
|
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |


Conversions from centimeters More...
Static Public Member Functions | |
| static float | Millimeters (float centimeters) |
| Convert from centimeters to millimeters. More... | |
| static float | Inches (float centimeters) |
| Convert from centimeters to inches. More... | |
| static float | Feet (float centimeters) |
| Convert from centimeters to feet. More... | |
| static float | Meters (float centimeters) |
| Convert from centimeters to meters. More... | |
| static float | Kilometers (float centimeters) |
| Convert from centimeters to kilometers. More... | |
| static float | Miles (float centimeters) |
| Convert from centimeters to miles. More... | |
Public Attributes | |
| const float | PER_MILLIMETER = 1 / Units.Millimeters.PER_CENTIMETER |
| Conversion factor from millimeters to centimeters. More... | |
| const float | PER_INCH = 2.54f |
| Conversion factor from inches to centimeters. More... | |
| const float | PER_FOOT = PER_INCH * Units.Inches.PER_FOOT |
| Conversion factor from feet to centimeters. More... | |
| const float | PER_METER = 100f |
| Conversion factor from meters to centimeters. More... | |
| const float | PER_KILOMETER = PER_METER * Units.Meters.PER_KILOMETER |
| Conversion factor from kilometers to centimeters. More... | |
| const float | PER_MILE = PER_FOOT * Units.Feet.PER_MILE |
| Conversion factor from miles to centimeters. More... | |
Conversions from centimeters
Definition at line 6 of file Centimeters.cs.
|
inlinestatic |
Convert from centimeters to feet.
| centimeters | The number of centimeters |
Definition at line 63 of file Centimeters.cs.
References Juniper.Units.Units.
|
inlinestatic |
Convert from centimeters to inches.
| centimeters | The number of centimeters |
Definition at line 53 of file Centimeters.cs.
References Juniper.Units.Units.
|
inlinestatic |
Convert from centimeters to kilometers.
| centimeters | The number of centimeters |
Definition at line 83 of file Centimeters.cs.
References Juniper.Units.Units.
|
inlinestatic |
Convert from centimeters to meters.
| centimeters | The number of centimeters |
Definition at line 73 of file Centimeters.cs.
References Juniper.Units.Units.
|
inlinestatic |
Convert from centimeters to miles.
| centimeters | The number of centimeters |
Definition at line 93 of file Centimeters.cs.
References Juniper.Units.Units.
|
inlinestatic |
Convert from centimeters to millimeters.
| centimeters | The number of centimeters |
Definition at line 43 of file Centimeters.cs.
References Juniper.Units.Units.
| const float Juniper.Units.Centimeters.PER_FOOT = PER_INCH * Units.Inches.PER_FOOT |
Conversion factor from feet to centimeters.
Definition at line 21 of file Centimeters.cs.
| const float Juniper.Units.Centimeters.PER_INCH = 2.54f |
Conversion factor from inches to centimeters.
Definition at line 16 of file Centimeters.cs.
| const float Juniper.Units.Centimeters.PER_KILOMETER = PER_METER * Units.Meters.PER_KILOMETER |
Conversion factor from kilometers to centimeters.
Definition at line 31 of file Centimeters.cs.
| const float Juniper.Units.Centimeters.PER_METER = 100f |
Conversion factor from meters to centimeters.
Definition at line 26 of file Centimeters.cs.
| const float Juniper.Units.Centimeters.PER_MILE = PER_FOOT * Units.Feet.PER_MILE |
Conversion factor from miles to centimeters.
Definition at line 36 of file Centimeters.cs.
| const float Juniper.Units.Centimeters.PER_MILLIMETER = 1 / Units.Millimeters.PER_CENTIMETER |
Conversion factor from millimeters to centimeters.
Definition at line 11 of file Centimeters.cs.


Clock: Finite Horizon t = 0, 1, …, 19,\helllip; 29. Endogenous State θ = (M) M = number of children, a RandomUpDown() variable Actions: α = (n), n ∈ {0,1} A(θ) = {0,1} if t< 20 {0} if t≥ 20 Exogenous State ε = (psi;) ψ ∼ N(0,1) Transitions Prob(M' = M+1) = pn M' = M + 1 if t<T M otherwise. Income X = Y - ( b(n-d) + (c1It=1 + c2It=2 + c30+c31t+c32t2))n Utility U = (α1+ψ)M +α2M2 + β1X+β2X2 + γ1MX+γ2MS For the Table 8 replication:
| aO | a1 | Y | N1-5 | N6-10 | N11-15 | N16-20 | N |
|---|---|---|---|---|---|---|---|
| 9.35 | O | 11,500 | 2.124 | 2.369 | 1.687 | .867 | 7.047 |
| 8.52 | O | 5,000 | 2.117 | 2.362 | 1.682 | .863 | 7.024 |
| 9.21 | O | 10,000 | 2.121 | 2.367 | 1.685 | .866 | 7.039 |
| 10.13 | O | 25,000 | 2.134 | 2.380 | 1.699 | .873 | 7.086 |
| 10.82 | O | 50,000 | 2.154 | 2.402 | 1.717 | .885 | 7.158 |
| 8.52 | .088 | 11,500 | 2.126 | 2.376 | 1.769 | .875 | 7.146 |
| aO | a1 | p | N1-5 | N6-10 | N11-15 | N16-20 | N |
|---|---|---|---|---|---|---|---|
| 2.78 | O | .94 | 2.124 | 2.369 | 1.687 | .867 | 7.047 |
| 2.09 | O | .89 | 2.078 | 2.326 | 1.614 | .783 | 6.801 |
| 1.67 | O | .84 | 2.032 | 2.282 | 1.540 | .701 | 6.555 |
| 1.33 | O | .79 | 1.979 | 2.230 | 1.453 | .612 | 6.274 |
| 1.05 | O | .74 | 1.927 | 2.175 | 1.367 | .532 | 6.001 |
| 1.05 | 1.81 | .94 | 2.003 | 2.356 | 1.722 | .937 | 7.018 |
| Public fields | ||
| aa0 | static const | |
| aa1 | static const | |
| ab0 | static const | |
| ab1 | static const | |
| alph | static const | Parameters from the 1982 working paper version. |
| b | static const | |
| bet | static const | |
| c | static const | |
| delt | static const | |
| gam | static const | |
| M | static | stock of children |
| n | static | decision variable |
| p | static | vector of survival prob. |
| psi | static | shock to preferences |
| Sbar | static const | |
| Y | static | vector of huband income |
| Public methods | ||
| FeasibleActions | Return A(θ). | |
| Mortality | static | Returns current time-specific transition probabilities. |
| Replicate | static | Run the replication. |
| Utility | Utility. | |
| Enumerations | ||
| Anonymous enum 1 | State space dimensions. |
| Enumerations | ||
| Anonymous enum 1 | State space dimensions. @names dimens | T, tau, Ndraws, Mmax |


Rick Santorum says one of every three pregnancies ends in an abortion
In a March 29, 2011, interview with WEZS Radio in Laconia, N.H., former U.S. Sen. Rick Santorum, R-Pa. -- a possible 2012 presidential candidate -- discussed a possible link between the financial predicament of Social Security and abortion.
Santorum, a strong opponent of abortion during his time in the Senate, argued that abortion has so depleted the ranks of younger Americans that the costs of Social Security benefits are having to be shouldered by fewer working-age Americans.
"The Social Security system in my opinion is a flawed design, period," Santorum said in response to a question from a caller. "But having said that, the design would work a lot better if we had stable demographic trends. The reason Social Security is in big trouble is we don’t have enough workers to support the retirees. Well, a third of all the young people in America are not in America today because of abortion, because one in three pregnancies end in abortion."
Several readers asked us to check Santorum's claim about the number of abortions.
To do this, we delved into statistics compiled by the U.S. Census Bureau and the Centers for Disease Control and Prevention. We chose 2003 as our representative year, since it was the most recent year for which we were able to obtain all of the relevant data.
We set out to determine the number of known pregnancies in 2003. We say "known" because some pregnancies end due to natural causes at a very early stage, often before the woman even realizes she is pregnant. CDC only offers statistics for fetal deaths beginning at a fetal age of 20 weeks, so that’s the parameter we’ll use in our calculations.
To calculate the number of known pregnancies, we added together three figures: the number of live births, the number of fetal deaths (these include natural miscarriages and stillbirths), and the number of abortions. Here’s the data for 2003:
Live births: 4,090,007
Fetal deaths: 25,653
Abortions: 1,250,000
Total known pregnancies: 5,365,660
So abortions account for 23.2 percent of all known pregnancies. That’s less than a quarter of all pregnancies, rather than the one-third Santorum said.
The Guttmacher Institute, an independent research organization that analyzes data on population growth and reproductive health, has come up with a number very close to what PolitiFact found, spokeswoman Rebecca Wind said. The institute found that 22.4 percent of pregnancies resulted in an abortion in 2008. (The institute did not factor fetal deaths into its calculation.)
But Santorum isn’t just off-base about the number of abortions. He also makes a flawed assumption about the impact of abortions on U.S. population trends, Wind said.
"It is simply wrong" to assume that every abortion reduces the U.S. population by one person, she said, since many women obtain abortions to postpone childbearing -- not to prevent it altogether.
A 2005 Guttmacher study of more than 1,200 women who had undergone an abortion found that a little under half cited the desire not to have additional children as a reason for having their abortion. This means that a substantial minority -- and possibly as many as 53 percent -- expected to have children after the abortion. This pattern was particularly strong among younger women in the study (less than a quarter of those 19 or younger said they were done with childbearing) and among those who had no children at the time of the abortion (only 3 percent said they were done with childbearing).
We provided Santorum's office with our calculations and asked for a response. A spokeswoman did not counter our findings, but offered a brief statement that said "the prolife community has been astounded at the increasing percentages in the pregnancies that result in abortion." The statement also made additional claims about abortion rates among certain demographic groups, but they did not address the wording that Santorum had used in the radio interview.
So we find Santorum is significantly overstating the frequency of abortions when he claims that "one in three pregnancies end in abortion" -- it’s actually in the 22 percent to 23 percent range. That's less than one in four. And the effect on population would be even lower if women who had abortions had children later in life. We can't know exactly how that would affect the numbers, but it would send the estimate even lower. We rate Santorum's statement False.
UPDATE, April 1, 2011: After we published this item, a reader pointed out that the statement we quoted from Santorum’s office was incorrect. While a spokeswoman had told us that "the prolife community has been astounded at the increasing percentages in the pregnancies that result in abortion," the reader pointed us to statistics from the Guttmacher Institute that show the rate of abortions declining over time. From a 1981 peak of 29.3 abortions per 1,000 women aged 15-44, the rate has fallen, gradually but steadily, to 19.6 in 2008 -- a decline of about one-third. According to Census Bureau data, the raw number of abortions has also fallen consistently, from a peak of 1,609,000 in 1990 to 1,242,000 in 2006.


I am interested in combining the benefits of Django and React in a single web application. Here are some notes on the topic. My goal is not to create a web application but to understand the mechanism of how this can be achieved.
Part 1
Python
What are the libraries?
Time Series forecasting defined
- nomenclature
- definitions
Forecasting as a Supervised Learning problem
- classification
- regression
- sliding window (reframe)
- univariate time series
- multi variate time series
- one step forecast
- multi step forecast
Time Series forecasting defined
Part 2
Loading Data
- read_csv()
- Pandas series
- series.head()
- series.tail()
- series.size
- series[time_index]
- series.describe()
Basic Feature Engineering
- change the timeseries into something that can be digested by a supervised learning model
- in essence we select the best features
- we test by checking the results of all our features
- honestly, feels like spray and pray
Data Visualization
- Line Plots.
- Histograms and Density Plots.
- Box and Whisker Plots.
- Heat Maps.
- Lag Plots or Scatter Plots.
- Autocorrelation Plots.
-
All the visualisation methods can be used to quickly glean information about the data
-
Some linear time series forecasting methods assume a well-behaved distribution of observations (i.e. a bell curve or normal distribution)
-
Comparing box and whisker plots by consistent intervals is a useful tool. Within an interval, it can help to spot outliers (dots above or below the whiskers). Across intervals, in this case years, we can look for multiple year trends, seasonality, and other structural information that could be modeled.


This directory contains code to simulate tides in Grays Harbor, WA.
See GraysSine.ipynb for some discussion of the approach used to force the tide.
topo
directoryUse GraysHarborMTL.ipynb to download 1/3 arcsecond topography data that is referenced to MHW and adjust it so that it is more closely aligned with Mean Tide Level (MTL). Since we are modeling the tide, we want to use topography referenced to MTL if possible.
Use fetch_etopo.py
to download 1 arcminute topography of the coastal region from the etopo1 database.
sine_forcing
directoryIn this directory tidal forcing is applied to force the ocean to have a pure sine wave oscillation with amplitude 1. Examining the resulting gauge time series at the Westport gauge allows us to determine how much this wave is amplified and the time lag between the ocean forcing and the response at Westport. See GraysSine.ipynb for this determination.
kingtide2015
directorySimulates the King Tide event from December, 2015.
The notebook GraysKingTide.ipynb downloads observations at the Westport and Aberdeen tide gauges and adjusts the Westport data to obtain the forcing function to be applied in the ocean. After running GeoClaw with this input, the same notebook shows the resulting simulated tides compared to the observations.


There are many variations of passages of Lorem Ipsum available, but the majority There are many variations of passages of Lorem Ipsum available, but the majority
Maecenas at tristique enim. Curabitur varius, mauris non posuere varius, nisl massa fringilla libero, ac vulputate lectus nunc non arcu. Nulla a est lacus. Maecenas at tristique enim. Curabitur varius, mauris non posuere varius, nisl massa fringilla libero, ac vulputate lectus nunc non arcu. Nulla a est lacus.
There are many variations of passages of Lorem Ipsum available, but the majority There are many variations of passages
There are many variations of passages of Lorem Ipsum available, but the majority There are many variations of passages
There are many variations of passages of Lorem Ipsum available, but the majority There are many variations of passages


DRAGON A film review by Steven Kim Copyright 1993 Steven Kim
Rating: A- (from A to F) Rated: PG Starring: James Scott Lee
Bruce Lee was a bigger-than-life martial artist (and) actor. Bruce's unique character (i.e., self-produced sound effects, etc.) and seemingly perfected martial art and physique were all well portrayed by the actor, James Lee.
The story is told from his wife Linda's point of view where she put a lot of family and practical side of Bruce Lee's life. However, you can't help but like, whenever the fight scenes are on, what he can does with his body and that familiar Bruce attitude and character.
I also like the little bits of insight scenes about Bruce Lee's life before he became famous: scenes like Bruce practicing pronunciation of English. It seemed as if he was no better than anybody else. Scenes like Bruce delivering Chinese food as a delivery boy ridding a bike through the American college looking at the (all-white) students, cheerleaders, and athletes. It seemed he too wished for the American dreams and hopes.
In conclusion, the movie was well made, it produced a realization of who Bruce Lee was, and actor James Lee was so much like Bruce you have to remind yourself that he is just an actor. And the fighting scenes were all excellent. So go see it and enjoy the movie.
P.S. If you have seen the movie UNFORGIVEN by Clint Eastwood, then the feeling left after DRAGON was very much like the feeling you got after the UNFORGIVEN.
.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Creating Oracle Sales Cloud Calendar Activities Via APEX REST Calls
Recently I used Application Express 5.0’s “Group Calendar” packaged app to simulate a scheduling system. We wanted to show how external systems can be launched from within Sales Cloud and then turn around and create meeting appointments via RESTful web service calls back into Fusion, and the packaged app was the quickest way to prototype a 3rd-party “scheduling” system that can make REST calls.
I hijacked the Create Event button procedure that already existed in this packaged app, adding functionality to have the Fusion APIs create a corresponding meeting in Sales Cloud and attaching a contact to the appointment.
Here are some random notes picked up during this assignment for refining on future projects:
(tl;dr: you can use APEX to do cool REST calls and query/create via Fusion APIs)
- R10 RESTful documentation
- Using APEX to make the RESTful calls
- Tests Tooling
- Headers for Your REST calls
- Activities are different
- Whittle down your response payload
- Watch out for too-huge responses in APEX
- Adding Contacts to a meeting are a two-phase REST call
- APEX will let you do random GETs
- Mirroring the existing APEX code
R10 RESTful documentation
The new R10 RESTful APIs are documented in a fancy new format, as opposed to the SOAP API format that is available in the OER.
There are really good R10 RESTful API intro write-ups on the FADevRel blog. There are also some older articles on integrating to Fusion with APEX, and although the Fusion blog entries are mostly SOAP-oriented there is at least one newer one about creating a REST request in PL/SQL (albeit not to Fusion; read on for that!).
And there’s the monstrously-large Oracle Sales Cloud Using RESTful Web Services whitepaper available on MOS.
Using APEX to make the RESTful calls
I used apex_web_service.make_rest_request
to send my requests back to Sales Cloud from a PL/SQL package so that it would fit in with the existing scaffolding in the packaged app. I originally wanted to model the Fusion RESTful APIs as Web Service References in Application Express and even got the Fusion API set up as a APEX Shared Component, but ended up rewriting the call as a PL/SQL package to match the existing Group Calendar code.
Still, the APEX Web Service References has a nice test harness to let tweak your headers and see the JSON response from your call. It helped me validate that the payload I was creating worked from APEX. Click here for a 3.4MB animated GIF of the testing harness proving it could create an appointment in Sales Cloud.
Tests Tooling
For a RESTful client to draft that payload I used Paw as a change of pace from Postman (I like them both, Paw was just something new to try). These tools were quicker for iterating over changes I made to the request payload.
When I went to implement the call in APEX as a PL/SQL package, I also created a logging table that I inserted the response (as APEX saw it) in a timestamped row. This helped me troubleshoot the more complicated, multi-stage calls that came later.
--select dbms_metadata.get_ddl('TABLE','PDT_OSC_CAL_API_LOG') from dual;
CREATE TABLE "PDT_OSC_CAL_API_LOG" ( "RESPONSE_MSG" CLOB, "CREATED" DATE, "CREATED_BY" VARCHAR2(100), "ID" NUMBER, "P_BODY" VARCHAR2(4000), CONSTRAINT "PDT_OSC_CAL_API_PK" PRIMARY KEY ("ID") )
--select dbms_metadata.get_ddl('TRIGGER','BI_PDT_OSC_CAL_API_LOG') from dual;
CREATE OR REPLACE TRIGGER "BI_PDT_OSC_CAL_API_LOG" before insert on "PDT_OSC_CAL_API_LOG" for each row
begin
if :NEW."ID" is null then
select to_number(sys_guid(),'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') into :new.id from dual;
:NEW."CREATED" := sysdate;
:NEW."CREATED_BY" := V('APP_USER');
end if;
end;
ALTER TRIGGER "BI_PDT_OSC_CAL_API_LOG" ENABLE
Headers for Your REST calls
One of the first things I learned was that the R10 Fusion RESTful APIs require a special Content-Type
header: application/vnd.oracle.adf.resourceitem+json
. You also need to send some form of Authorization
header: I used Basic Auth for testing but for the APEX app I could use Bearer Auth because we passed in a JWT token on the URL generated in Sales Cloud pointing at our APEX app.
-- Headers necessary for Fusion RESTful API
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).Value := 'application/vnd.oracle.adf.resourceitem+json';
apex_web_service.g_request_headers(2).name := 'Authorization';
apex_web_service.g_request_headers(2).Value := 'Bearer ' || p_jwt_token;
Activities are different
Since I wanted to create a meeting appointment, a little background on the Sales Cloud Activity model was helpful. I used GETs to query existing meeting appointments and figure out the formats for fields (note the ISO 8601 date format and the Base64-encoded description). I was able to pare down a POST’s payload body sent to /salesApi/resources/latest/activities
to be just a few fields (not shown are the two headers: Basic Auth and Content-type: application/vnd.oracle.adf.resourceitem+json):
{
"ActivityEndDate": "2016-01-08T19:30:00-08:00",
"Subject": "Test RESTful Appointment",
"ActivityFunctionCode": "APPOINTMENT",
"ActivityTypeCode": "MEETING",
"ActivityStartDate": "2016-01-08T18:30:00-08:00",
"OwnerId":<PHONE_NUMBER>42468,
"ActivityDescription": "SGVyZSBpcyBhbiBhY3Rpdml0eSBkZXNjcmlwdGlvbiB0aGF0IEkgY291bGQgY3JlYXRlIGluIHRoZSBzYW1lIHJlcXVlc3QgYXMgdGhlIGFjdGl2aXR5IGl0c2VsZjsgSSBkaWRuJ3QgaGF2ZSB0byBtYWtlIGEgc2Vjb25kIGNhbGwgd2l0aCB0aGUganVzdC1jcmVhdGVkIGFjdGl2aXR5IElE"
}
Whittle down your response payload
The response object that comes back from a Fusion REST call is huge, but it doesn’t have to be. Two query parameters can help: ?onlyData
(so you don’t get all the nested links[]
arrays) and ?fields=Attribute1,Attribute2
(so that your main object only has the fields you’re looking for).
Watch out for too-huge responses in APEX
This response pruning ability was handy, because there’s a bug in APEX’s APEX_JSON_PARSE
when running on 11g that I ran into on our DBSchema instance. JSON responses larger than 8191 characters failed to parse, even though I could see a valid response was coming back in my log table. Turns out it’s really easy to get larger-than 8K+ responses from a Fusion REST call.
Adding Contacts to a meeting are a two-phase REST call
I needed to parse the CLOB response as JSON because I wanted to tease out the ActivityNumber
field and use it to build the URL for a follow-up POST call. Our flow into the APEX app was to start from a Contacts screen, so in addition to the JWT Token we also send in the Contact_ID of the Fusion record we were looking at. When we created the appointment meeting via REST we also wanted to add the Contact as an attachment.
This necessitated a two-part REST call: the first to create the activity and the second to use the returned ID in another POST URL to create an activity contact at /salesApi/resources/latest/activities/{ActivityNumber}/child/ActivityContact
. The body of that POST was only the Contact_ID that we were passed in as a parameter on the URL generated by App Composer.
APEX will let you do random GETs
Since I had been carrying that Contact_ID around from screen to screen in APEX, I thought a nice touch was to call back in to Fusion to pick up some additional details about the contact, such as full name and email address.
I used an After Header Process (after Load Data) on the APEX page to pre-populate two fields with live Fusion contact data. It might make more sense to pull Fusion data in differently for use in other APEX pages, but the one-off GET did the trick for this APEX form.
DECLARE
l_response_clob clob;
BEGIN
-- Headers necessary for Fusion RESTful API
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).Value := 'application/vnd.oracle.adf.resourceitem+json';
apex_web_service.g_request_headers(2).name := 'Authorization';
apex_web_service.g_request_headers(2).Value := 'Bearer ' || :JWT_TOKEN;
-- make the request using parameters
l_response_clob := apex_web_service.make_rest_request(
p_url => 'https://adc2-fap1370-crm.oracledemos.com/crmCommonApi/resources/latest/contacts?q=PartyId=' || :CONTACT_ID || '&onlyData&fields=ContactName,EmailAddress',
p_http_method => 'GET'
);
-- log it
insert into PDT_OSC_CAL_API_LOG(RESPONSE_MSG, P_BODY)
values(l_response_clob, 'jwt: ' || :JWT_TOKEN ||' contact_id: ' || :CONTACT_ID);
commit;
-- parse the response to put contact data into APEX fields
apex_json.parse(l_response_clob);
:P10_CONTACT_PERSON := apex_json.get_varchar2(p_path => 'items[1].ContactName');
:P10_CONTACT_EMAIL := apex_json.get_varchar2(p_path => 'items[1].EmailAddress');
END
Mirroring the existing APEX code
Finally, here’s my custom package that mirrored the APEX process that runs when CREATE was pressed on the existing APEX page. I just added a call to my custom package right after the call to EBA_ca_api.create_event
, using the same parameters.
create or replace package body PDT_OSC_cal_api
as
--this signature mirrors the create_event in the Group Calendar packaged app; I didn't end up using all these fields
procedure create_event (
p_event_name varchar2,
p_type_id number,
p_new_event_type varchar2,
p_event_date_time timestamp with local time zone,
p_duration number,
p_event_desc varchar2,
p_contact_person varchar2,
p_contact_email varchar2,
p_display_time varchar2,
p_location varchar2,
p_link_name_1 varchar2,
p_link_url_1 varchar2,
p_link_name_2 varchar2,
p_link_url_2 varchar2,
p_link_name_3 varchar2,
p_link_url_3 varchar2,
p_tags varchar2 default null,
-- here are two fields I added to the signature: they are passed in as parameters on the Sales Cloud-generated link and I passed them around as application items
p_contact_id varchar2,
p_jwt_token varchar2,
--
p_recur_flag varchar2,
p_recur_freq varchar2,
p_recur_end_date timestamp with local time zone )
is
l_event_type_id number default null;
l_series_id number;
l_response_clob clob;
--convert p_duration (hours) into timestamp for use in p_body
l_event_end_date timestamp with local time zone := p_event_date_time + (p_duration * 1/(24));
--clean up and convert p_tags into Base64 for use in ActivityDescription
--alas the REPLACE()s make newlines if needed
--but you cant have multi-line JSON strings and something in the cast chain was splitting and inserting CRLFs
l_activitydesc varchar2(32767) := REPLACE(
REPLACE(
utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('Interest in CSG: '|| REPLACE(p_tags, ':', ', ')))),
CHR(13),
'\n' ),
CHR(10),
'' ) ;
l_pbody varchar2(4000);
l_new_activity_id varchar2(30);
begin
if p_recur_flag = 'Y' then
-- TODO: write recurring event logic in the future; code structure was 'borrowed' liberally from the APEX packaged app codebase
NULL;
else
-- Headers necessary for Fusion RESTful API
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).Value := 'application/vnd.oracle.adf.resourceitem+json';
apex_web_service.g_request_headers(2).name := 'Authorization';
apex_web_service.g_request_headers(2).Value := 'Bearer ' || p_jwt_token;
--build the payload, hardcoded to go to lisa.jones' calendar because I didn't build out lookups in APEX against live Fusion OwnerIds
l_pbody := '{
"ActivityEndDate": "' || to_char(l_event_end_date, 'yyyy-mm-dd') ||'T'|| to_char(l_event_end_date, 'hh24:mi:ss') || '-08:00",
"Subject": "' || p_event_name || '",
"ActivityFunctionCode": "APPOINTMENT",
"ActivityTypeCode": "MEETING",
"ActivityStartDate": "' || to_char(p_event_date_time, 'yyyy-mm-dd') ||'T'|| to_char(p_event_date_time, 'hh24:mi:ss') || '-08:00",
"OwnerId":<PHONE_NUMBER>42468,
"ActivityDescription": "'|| l_activitydesc ||'"
}';
-- make the request using ?onlyData parameter
l_response_clob := apex_web_service.make_rest_request(
p_url => 'https://origin-adc2-fap1370-crm.oracledemos.com/salesApi/resources/latest/activities?onlyData',
p_http_method => 'POST',
p_body => l_pbody
);
-- log it
insert into PDT_OSC_CAL_API_LOG(RESPONSE_MSG, P_BODY)
values(l_response_clob, l_pbody);
commit;
-- parse the response so we can attach a contact
apex_json.parse(l_response_clob);
l_new_activity_id := apex_json.get_varchar2(p_path => 'ActivityNumber');
-- make the follow-up POST request to add a contactID to the just-created activity
l_pbody := '{
"ContactId" : ' || p_contact_id || '
}';
l_response_clob := apex_web_service.make_rest_request(
p_url => 'https://origin-adc2-fap1370-crm.oracledemos.com/salesApi/resources/latest/activities/' || l_new_activity_id || '/child/ActivityContact?onlyData',
p_http_method => 'POST',
p_body => l_pbody
);
-- log it
insert into PDT_OSC_CAL_API_LOG(RESPONSE_MSG, P_BODY)
values(l_response_clob, l_pbody);
end if;
commit;
end create_event;
end PDT_OSC_cal_api;


I have 48 projects on Github
ADB Usage Complete / ADB 用法大全
Chinese Copywriting Guidelines：中文文案排版指北（简体中文版）
My Blog / Jekyll Themes
A vim 7.4+ plugin to generate table of contents for Markdown files.
A cleaner app for android
Read The F*cking Android Source Code
自动打分评论指定 CSDN 账号内所有下载过待评论的资源。
光谷社区第三方 Android 客户端。
🐤 A simple and clean jekyll theme without javascript
🗄 config files in home dir
My notes for android reverse engineering learning.
关于 Vim，我知道的都在此。
A QRCode Scanner for Windows/Mac OS X/Linux in Qt.
smali syntax highlighting for vim by lohan
期一日，汝参天。
android practices demo records
A wunder tool.
Android UI develop practices / Custom Views
A vim plugin to resolve indent issue of content nested in Markdown lists, especially for kramdown.
Android 崩溃与异常情景分析
Git tutor for SVN user / SVN 用户的 Git 指南
🐌 My own snippets
A ListView which its height can wrap content even if it is nested in a ScrollView.
A server and a client for WiFi Direct transmission
平台代码演示
LeetCode Problems' Solutions
design pattern study notes
A tiny tool for Android Developers
My Settings & Monokai theme for Android Studio 2.0+.
Life is full of routines, the code is the same.
A memory ini parser
An extension to add more search engines for safari.
微信公众号 Markdown 排版工具
基于高德地图和导航 SDK 开发过程中的功能实现和遇到的问题解决
This repo is used to store comments of mazhuang.org
Fiddler Usage Complete / Q&A
Qt Quick 2.0 port of the ZXing multi-format 1D/2D barcode image processing library
翻译自 Atom Flight Manual
Android library to stick your ExpandableListView's head view at the top of list
Personal Wiki for Vim
My personal style guides.
🎛 Just a handle simulator to control Android on PC.
A command to stats program running time on Windows.
TextView to display simple HTML content
one for all free music in china (mobile edition)
basic cscope settings and key mappings


Accessibility Conformance Reporting Tool (ACRT)
Version 1.3.0Developed for use in Chrome, Edge and Firefox
About ACRT
ACRT is an open source tool developed by the U.S. Department of Homeland Security to track testing results from the Section 508 Conformance Test process. We encourage and welcome feedback and suggestions from the testing community! For user support, email at DHS Accessibility Help Desk.
ACRT Updates
To get latest version of the ACRT:visit ACRT BitBucket Repository visit ACRT GitHub Repository


Hello, in order to create the 2.5V rail for the offset I have tried both methods suggested in this site: 1) voltage divider 2) opamp
Is there any special reason for not using a 2.5 linear voltage regulator?
Wouldnt this create a more stable rail without having to worry about overloading it?
From tear-downs I have watch in youtube, it seems like its usual to use linear regulators to create independent 5V, 2.5V ...rails
Thanks for any information you can provide.
Re: Linear regulator for 2.5V rail?
In its default mode, the Atmega uses the Vcc rail to set the maximum range for its ADC. If Vcc varies, then so will the ADC's range and hence the value of each of its steps. If you had a fixed 2.5 V rail, this would only correspond to the mid-point of the ADC's range when Vcc is exactly 5.0 V.
Because the V and I sensors are floating, the DC component of the ADC samples is not relevant and is filtered out by the maths. So changing the DC value of the Vref rail would not actually affect the outcome.
For all practical purposes, I expect that a 2.5 V regulator would work just as well as any other method (with a 5V Vcc).
Re: Linear regulator for 2.5V rail?
I hadnt thought about the 5V ref of the atmega dropping, good point calypso.
So presumably it is possible to do what I was asking, and if we did just the same with the 5V rail feeding the atmega then Vref would be fix at 5V and having a 2,5V rail would always mean middle value in the ADC range.
So I guess in all those components tear-down which have linear regulators, they are also feeding the ADC with a Vref rail and so everything works fine.
I imagine that using a voltage divider is done because of simplicity and maybe smaller power consumption, maybe G or T can answer this.
Thanks a lot Calypso.
If I find some free time I might do some tests just for fun with a 2,5V regulator.
Re: Linear regulator for 2.5V rail?
But if the 5 V rail changed and the 2.5 V rail didn't (or vice versa), the dynamic range of the input - assuming for ease of description that it's a symmetrical wave - will be limited to the smaller of (2.5 V rail value) and (5 V rail value - 2.5 V rail value).
Re: Linear regulator for 2.5V rail?
For my 3-phase PCB, I was interested in using the ADC on its 1.1V range. This internally generated reference is available at the processor's VREF pin and is not dependent on Vcc.
For the Vref rail for the sensors (0.55 V), I found the mid-point using a pair of equal resistors and then buffered it with the standard LM358 op amp (which works OK down to GND but not up to the Vcc rail)
This approach did work, but the results were not as good as when using Vcc for the ADC. My findings were posted on the 'with Triac' thread between 8/8/14 and 14/8/14.
Re: Linear regulator for 2.5V rail?
In its default mode, the
AtmegaArduino library uses the Vcc rail to set the maximum range for its ADC.I think that's what you meant to say. The Atmega actually defaults to an external Vref, which is a much wiser choice. There are only 2 things you can connect to AREF: a capacitor, or a voltage reference. Until the end programmer's code is running, the chooser-of-defaults has no way of knowing which is connected so assuming it's an external voltage reference is much safer. If the end programmer is confused enough to solder an external voltage reference to AREF and then select an internal voltage reference (either Vcc or a bandgap voltage) then he gets the smoke he deserves.
The Arduino library goes to some lengths to mitigate the harm caused by their poor choice of defaults, but that too can lead to confusion. The end programmer's otherwise reasonable assumptions about what happens when are often wrong as a result (see posting 4 on this thread http://openenergymonitor.org/emon/node/5700 as a recent example).
I was interested in using the ADC on its 1.1V range. This internally generated reference is available at the processor's VREF pin
Only for the purpose of decoupling. From the datasheet:
Note that VREF is a high impedant source, and only a capacitive load should be connected in a system.
Re: Linear regulator for 2.5V rail?
Yes, good point. Although not using an Arduino board, I was using the Aduino IDE, hence the Aduino library.
With the internal 1.1V reference selected, I connected the VREF pin to the non-inverting input input of a x1 op-amp buffer. The output of that stage was then halved using a voltage divider and fed into a second x1 op-amp buffer. By this means, I got a 0.55V rail without significantly loading the VREF pin. That scheme does work for large signals, but appears to introduce more background noise than when Vcc is used as the ADC's reference.


Simply cast your desktop screen to a Promys device.
Get the executable, double-click it. There you go.
Get the DMG file. Open it, double click the application. You can also drag and drop it anywhere on your Mac.
Get the deb package. Install it with: # sudo dpkg -i promys.deb
# sudo dpkg -i promys.deb
Get the rpm package. Install it with: # sudo rpm -i promys.rpm
# sudo rpm -i promys.rpm


Toggle fullscreen
Your device has the following safe-area-insets:
safe-area-inset-top:
0px
safe-area-inset-right:
0px
safe-area-inset-bottom:
0px
safe-area-inset-left:
0px
Visualize


David Tennant is identical to serial killer Dennis Nilsen in first look pic
A first look at David Tennant in character as serial killer Dennis Nilsen reveals how scarily accurate new true crime series Des is about to be.
With a deathly blank stare into the camera, the photo of Tennant in character is identical to the killer’s February 1983 mugshot, marking the end of his sickening reign as the Muswell Hill Murderer.
With his hair slicked loosely over to one side and bottle top glasses, Tennant is seen looking down the barrel of a camera, completely expression-less.
The new ITV series will take a deep dive into the horrid crimes of Nilsen, who was convicted of six murders and two attempted murders.
His rampage, which spanned from 1978-1983, went largely undetected as he would lure men and young boys into his home before killing them.
It was only when police officer DCI Peter Jay (to be played by Line Of Duty’s Daniel Mays) discovers human remains clogging the psycho’s drains that he was finally rumbled.
While he was convicted of six murderers, mainly of homeless homosexual men, some believe the total could have been as high as 15.
Advertisement Advertisement
The series, Des, will be told through the eyes of the two men who encountered Nilsen as well as Nilsen himself.
The Crown’s Jason Watkins will play the third man in question, playing biographer Brian Masters who got to know the killer.
Nilsen spent the rest of his life in jail after being caught for his crimes, eventually dying in May 2018 at the age of 72.
Kim Varvell, Executive Producer for the new series, said of the show: ‘Dennis Nilsen’s crimes shocked the nation in the early 1980s. Our programme focuses on the emotional impact of those terrible crimes, both on those who came into contact with Nilsen himself, and also on the victims’ families’
The series aims to highlight not only highlight the police investigation and trial, but also the media coverage on public perceptions of the victims, raising questions of just how far have we really come since then?
Des airs in 2020 on ITV.
Got a showbiz story? If you've got a celebrity story, video or pictures get in touch with the Metro.co.uk entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.
Advertisement Advertisement


When the network first opens, the entire network is not visible because of the default zoom factor used. To see the whole network, we can use the Fit Content function.
When the network first opens, the entire network is not visible because of the default zoom factor used. To see the whole network,
we can use the View → Fit Content function.
Filter Interactions
Your network contains a combination of protein-protein (pp) and protein-DNA (pd) interactions.
Next, we will filter out the protein-protein interactions to focus on the protein-DNA interactions.
First, let's select all protein-protein interactions.
Go to the Select tab in the Cytoscape Control Panel (the leftmost panel).
Click on the + and create a Column Filter.
Click on Choose column... and select Edge: interaction
Now in the text field enter pp. This will select all of the edges with the protein-protein interactions.
You should now see many edges in the network selected (i.e., colored red).
Since we're only interested in the protein-DNA edges, we can delete the protein-protein edges we've just selected.
You should now see many unconnected nodes in the network.
Now, lets clean up the network by applying a layout.
The largest component of the final filtered and cleaned up network should look like this:
Since we're only interested in the protein-DNA edges, we can delete the protein-protein edges we've just selected.
To delete selected nodes or edges, you can just hit the DELETE key or use the menu Edit → Delete Selected Nodes and Edges
You should now see many unconnected nodes in the network.
Now, lets clean up the network by applying a force-directed layout under Layout → Prefuse Force Directed Layout.
The largest component of the final filtered and cleaned up network should look like this:
Observe the Network
Notice that three dark red (highly induced) nodes are in the same region of the graph.
Notice that there are two nodes that interact with all three red nodes: GAL4 (YPL248C) and GAL11 (YOL051W).
Let's select these two nodes and their immediate neighbors.
First select GAL4 (YPL248C) by clicking on it.
Now, extend the selection by holding down the shift key and clicking on GAL11 (YOL051W).
Finally, select their neighbors by control-6 (or ⌘-6 on a Mac), or by the menu Select → Nodes → First Neighbors of Selected Nodes → Undirected
It is sometimes useful to create a new network from selected nodes.
Create a new network by selecting File → New → Network → Selected nodes, all edges.
(Even though we say all edges, only the
edges connecting the selected nodes will actually be used.)
As before, we may need to do a View → Fit Content.
With some layout and zooming, this new network should appear similar to the one shown:


Reservation
×
Reservation :
Hours
Monday to Friday: 8:00 PM - 10:00 PM
Saturday & Sunday: 6:00 AM - 10:00 AM
First name:
Last name:
Reservation date:
Guest Number:
Phone:


Elder Scrolls 4? I just recently got it, and I think the whole "Custom Class" thing is awesome! I was wondering if anyone has played it and could post a character build for me... my current character is
race: Breton class: (custom) Arch-Mage sign: The Mage major skills: Heavy Armor Marksman Blade Acrobatics block persuasion lockpicking
as you can see I got all the opposite skills that a mage should have... thats so I have lots and lots of time to level up my others skills . He is level 2 and has 100 in everything except for his major skills.
anyways thanks
P.S. SORRY FOR COMPLETE OFF-TOPICness _________________ They were all dead. The final gunshot was an exclamation mark to everything that had led up to this point. I released my finger from the trigger. And then it was all over. The storm seemed to lose its frenzy. The ragged clouds gave way to the stars above.
TROLLSPAM
Nope, haven't played it. I hope it's good _________________ "And one calculates time from the dies nefastus on which this fatality arose – from the first day of Christianity! – Why not rather from its last? – From today? – Revaluation of all values!"
Haven't played the new one but it seems a lot like the old one, though I haven't got very far into it. The freedom is great imo, can either role play it hardcore or make a build that is perfect at everything though it would take a very long time.


+++ title = "Xalapa" lat = 19.543775 lon = -96.918640 +++
About 5 hours east of Mexico City, Xalapa is a refreshingly safe and relaxed place. Despite having 0.5 million residents, the few streets in central Xalapa have a bohemian, small-town feel to them.
From the main Zocalo in Xalapa, there are some breathtaking views of the surrounding countryside, including the snow-capped peak of Mexico's highest mountain. Also, the weather is fine, the air is richer (than in Mexico City), and the pollution levels are lower.
I'm only staying here 2 nights, but if I had more time in Mexico, I could easily spend a week here, as my friend Steve from Jersey is doing.


Nice To Know
IT
Web
Cloud Services
Platform aaS
DEIS
OpenShift
e.g. SAP HANA Cloud Platform, Google App Engine, Force.com, Windows Azure