Performing ‘Pacífico' a dream-like celebration around the act of leaving.
Disco Bahía’s MAD RITE features their single ‘Pacífico’, the session invites us to take part in an electro-pop dance
influenced by the 70s glamour and disco.
The rite starts off by walking us through a dream-like atmosphere with a mellow saxophone intro while a suggestion is
made through the song’s title; enter a state of calmness after surrendering to a situation that no longer serves you.
Although open to interpretation, the lyrics give us clues to the meaning of acceptance and remind us that every cycle
can be lived as a celebration.
On a melodic note, we can understand the role of the saxophone as the one that ties the song’s purpose all together. As
a wind instrument, with its closeness to the pace of air, it unveils a lesson on what leaving and returning to one self
is about.


Class lanes The class lanes deals with all the operations remaining for lane detection after the hough lines in the image have been detected derived from the base class ImageProcessor.
More...
#include <lanes.hpp>
Class lanes The class lanes deals with all the operations remaining for lane detection after the hough lines in the image have been detected derived from the base class ImageProcessor.
constructor for lanes
- Parameters
-
- Returns
- none
destructor for lanes
- Parameters
-
- Returns
- none
| std::vector< cv::Point > lanes::fitLine |
( |
std::vector< cv::Point > |
rightPts, |
|
|
std::vector< cv::Point > |
leftPts |
|
) |
| |
function to calculate linear regression of given points on left and right lines.
- Parameters
-
| [in] | set | of left and right points |
| std::vector<cv::Vec4i> lanes::getLeftLines |
( |
| ) |
|
|
inline |
function for retrieving set of lines detected on left side
- Parameters
-
- Returns
- vector containing points describing set of left lines
| std::vector<cv::Vec4i> lanes::getRightLines |
( |
| ) |
|
|
inline |
function for retrieving set of lines detected on right side
- Parameters
-
- Returns
- vector containing points describing set of right lines
| std::string lanes::lanePrediction |
( |
cv::Vec4f |
leftLine, |
|
|
cv::Vec4f |
rightLine, |
|
|
std::vector< cv::Point > |
outputLines |
|
) |
| |
function to predict lane heading given left anf right line
- Parameters
-
| [in] | left | line |
| [in] | right | line |
| [in] | output | line to calculate x intercept |
| cv::Mat lanes::lineSeparation |
( |
std::vector< cv::Vec4i > |
lines, |
|
|
cv::Mat |
image |
|
) |
| |
function to separate left and right lines on the road
- Parameters
-
| [in] | set | of all lines |
| [in] | input | image |
| void lanes::showOutput |
( |
std::string |
prediction, |
|
|
cv::Mat |
frame, |
|
|
std::vector< cv::Point > |
outputLines |
|
) |
| |
function for displaying the output
- Parameters
-
| string | which contains the direction of heading |
| original | Image of the frame |
| set | of points which describe the lanes |
- Returns
- none
The documentation for this class was generated from the following files:


Deontay Wilder: WBC champion once criticized Tyson's boxing record in IG rant
Deontay Wilder, WBC heavyweight champion, has been caught in an explosive Instagram live rant where he criticized Mike Tyson's boxing record after his ability in the ring was questioned by fans.
Mike "Iron Mike" Tyson is considered as one of the boxing legends who brought class and aggression to the game but during a live IG rant dated back to 2017, the 53-year-old's quality was called out by his fellow American.
Bronze Bomber, who has often been compared with Tyson because of their similar formidable qualities, lost his patience when a fan argue he was far off the level of Mike.
Wilder got infuriated and reduced himself into an astonishing rant while teaching his fans about boxing history.
"Folks ... don't know your history about... when it comes to the sport of boxing, let's face it: you do not know your history," the 34-year-old said.
"We love Mike Tyson, of course. We love 'em all. You know what I'm saying? I love 'em all. We love 'em all. They did a great job. [...] But go back and look up your facts.
Deontay Wilder 'attacks' Anthony Joshua, makes stunning revelation about Ruiz ahead of Saudi rematch
"[...]
Wilder later went on to rant about Mike's defeat to Lennox Lewis and Evander Holyfield in his professional boxing career before demanding fans do their research.
"Only two," Wilder yelled down the camera.
Only two. Only two. Holyfield beat him twice and Lennox beat him.
"Only two. So what the f**k y'all talking about?" Bronze Bomber said.
Wilder, a knock out king, has once vowed to break Floyd Mayweather's record for the longest undefeated streak of win.
PAY ATTENTION: Install Pitch Football App for FREE to get the latest football News & Scores
Meanwhile, Legit.ng had reported that Deontay Wilder showed no sign of worry ahead of his heavyweight fight against Cuban boxer Luis Ortiz after the American pugilist arrived La Vegas in a bare-chested garment that is now a subject of internet discussion.
The WBC heavyweight champ, 32, will take on the 40-year-old Cuban fighter on Saturday, November 23, in another famous rematch.
But the highlight of the pre-fight show was the 32-year-old's bizarre cloth suggesting he is full of confidence of another win over Ortiz.
Abu Azeez: Meet the only Nigerian rated among top 50 beach soccer players worldwide | Legit TV


{include file="../application/index/view/include/header.html" uname="$userInfo.uname" /}
{include file="../application/index/view/include/left.html" /}
添加课程
×
添加课程
×
编辑课程详细信息


Change Browser Tabs Status
Note:
Click the button above to propagate all browser tab status values on the right hand side to the fake phonehub manager. Note that if a field is empty, then that corresponding tab will be nullopt.
Toggle Tab Sync enabled
1:
2:


{% extends "pvp/base.html" %} {% import 'heroes/hero_short.html' as hero_short_macros with context %} {% import 'heroes/hero_equipment.html' as hero_equipment_macros with context %} {% import 'game/macros.html' as game_macros with context %} {% import 'pvp/pvp_info.html' as pvp_info_macros with context %} {% import 'game/log.html' as log_macros with context %} {% macro render_abilities(abilities) %}


Hello, world!
#
Test
Node 1
Additional info
Node 1
Additional info
Node 1
Additional info
Node 1
Additional info
Node 1
Additional info
Node 1
Additional info
Node 1
Additional info


Writing your resume
Projected Time
About 2.5-3 hours
- Lesson: 20 min
- Guided Practice: 90 min
- Independent Practice: 30-60 min
- Challenge: 20 min
- Check for understanding: 20 min
Prerequisites
Motivation
Resumes are by no means your whole story as a candidate for a job, but they do typically start the conversation. Some
companies are trending away from considering resumes as the first step of the interview process (woohoo!), but even
if it’s not part of the selection process, nearly all companies still require a resume. They’re looking for basic
contact information, links to your portfolio or other projects you’ve built, and background about you for your
interviewers’ context. There is no “right" way to write a resume. The best resumes are as unique as the person who
wrote it while still conveying key details that make it easy for hiring teams to both get in touch and know which
role they’ve applied to. The least helpful resumes are physically hard to read (using obscure fonts, odd colors,
full of typos, or dense in the text) and are hard to tell the role the candidate is applying for. Most resumes fall
in between these categories, and there’s nothing wrong with that: the essence is clear communication of professional
information so that candidates and hiring teams can establish a foundation for more in-depth interviews.
Objectives
Participants will be able to write a resume that:
- Clearly shows name, contact information (email/phone number), and other relevant links (i.e. GitHub, personal website, LinkedIn)
- Summarizes related work experience, education or skills (or in the case of career transitions: shows projects and relevant engagement in the field, such as volunteering).
- Clearly communicates the role desired (either explicitly through an objective statement, or implicitly through the projects or experience they’ve highlighted).
Specific Things to Learn
- Content:
- Include name, email/phone number, and relevant links to GitHub, LinkedIn, or personal website.
- List relevant work experience (if applicable) including volunteer work (see templates for layout/organization ideas) and describe the role and your proudest contributions (up to 5 bullet points per role, as space allows).
- List relevant technical projects including the purpose of the project, your contributions, and tools/technologies used.
- Formatting:
- Use sans-serif fonts (easier to read)
- Use bullet points (easier to read)
- Save your resume as a PDFs with live links (preserves formatting across all operating systems that might open it)
- Name your resume file following a detailed and consistent format, such as Firstname_Lastname_month_year.pdf. If applying to multiple roles, add the role: Firstname_Lastname_month_year_role.pdf.
- Check the digital version for web accessibility (ensures anyone can easily read your resume)
- Layout: there are many ways to organize, lots of templates to choose from—just make sure it’s easy to read & makes sense to you (and a friend).
Materials
Lesson
- Start with this My Old Resumes Were Bad by Jarvis Johnson video (14 mins watch).
- Read through this Resume Writing slideshow from Auburn University.
Common Mistakes / Misconceptions
- Avoid listing visa/citizenship status, physical address, irrelevant hobbies, personal interests, extracurricular
activities or similar. According to the article “How subtle class cues can backfire on your resume" listed in the
Materials section, these can encourage unwanted unconscious (or conscious) bias. As you gain more experience, this
can also take up valuable space on the page that could be used to describe more relevant details.
- It can be easy to miss typos when you’ve been editing the same resume for a while. Accidentally leaving typos on a resume can signal poor attention to detail. Have a friend or mentor review it to have a fresh pair of eyes.
- Resumes should be no longer than one page (Curriculum Vitae, or CVs, are different and not usually required outside of academia). Not only are one-page resumes more common, companies that print resumes for their interviewers often do so in batches that require uniform page stapling– this means it’s easy for a second page to get lost in the shuffle (literally).
- Avoid sending a generically-named file like “resume.pdf" or worse, “resume.doc." Hiring teams see thousands of resumes and yours is nearly guaranteed to get lost if it doesn’t include your name. Non-PDF resumes often lose their formatting with different software versions so all your work making it easy to read is forgotten. PDFs usually prevent that.
Guided Practice
- Start a resume in a sharable Google Doc (we recommend making a copy of this resume template).
- After reading each piece of resume advice, edit accordingly.
- Take a look at this Entry-level IT developer resume template from Monster.com.
- Read this short reference about what to include in a basic resume.
- Read this article:Web Developer Resume: Sample & Complete Guide [+20 Examples] (30 min read).
- Read this short article on How to show tech skills on your resume.
- Read this 20-min Resume Writing Guide by JobScan.
- Glance through this list of Action Words and use them to replace any passive language in your resume. For example, replace “Was a scheduling manager at GAP" with “Improved the efficiency of employee scheduling at GAP by 50% over three months."
Independent Practice
- Read this article on How Subtle Class Cues Can Backfire on Your Resume.
- Upload your resume and desired job description on https://www.jobscan.co/. Edit your resume or make a copy that incorporates all of the suggested missing keywords that apply to your background.
Add your experience, and participation, and in some cases your resume document to your profile on these sites:
- LinkedIn
- Glassdoor
- AngelList
- Indeed
Challenge
- Find a partner and review each other’s updated resumes. Make any necessary edits.
- Submit your completed resume to be reviewed on Monster.com. You get one free resume review. They claim to get back to you within 2 days with your results.
Supplemental Resources
Check for Understanding
- What are some points that a good resume should include?
- Mention some sites where you can upload your resume.
- Go through this resume. Suggest some changes you would like to make in this resume. Refer this site for help


Home
Details
Adoption
Fostering
Foster A Pet
Donate Here
Foster Application
Please provide the information below. It will be used to ensure the best match between adopter and cat.
Address required
State
Armed Forces America
Armed Forces
Armed Forces Pacific
Alabama
Alaska
American Samoa
Arizona
Arkansas
California
Colorado
Connecticut
District of Columbia
Delaware
Florida
Georgia
Guam
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
New Hampshire
New Jersey
New Mexico
New York
Nevada
North Carolina
North Dakota
Northern Mariana Islands
Ohio
Oklahoma
Oregon
Pennsylvania
Puerto Rico
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virgin Islands
Virginia
Washington
West Virginia
Wisconsin
Wyoming
First and Last are required.
Phone is required.
Email required
Are you a previous DivaPets Adopter?
Yes
No
Don't Know
Birthdate (If Under birthdate 25) required
Are you interested in a specific cat or a specific type of cat? If so, provide names or explain below.
Number of Adults In The Household
1
2
3
4
5
6
7
8
9
10
Number of Pets In The Household
1
2
3
4
5
6
7
8
9
10
Number of Children In The Household
1
2
3
4
5
6
7
8
9
10
Ages of Children
Tell Us a Little About Your Current (Or Recent) Pets
Have You Ever Given Up Or Rehomed A Pet?
Yes
No
If "Yes" to the previous question, please explain the circumstances
Will This Cat Be Allowed...
Indoors
Outdoors
Indoors/Outdoors
Do You Plan To Declaw?
Yes
No
Don't Know
If You Currently Have A Cat, Is It Declawed?
N/A
Yes
No
Are you fully aware of the how declawing impacts a cat?
Yes
No
Educate Me!
How Many Hours A Day Will The Cat Spend Alone?
Is Anyone in Your Household Allergic To Cats?

How Many Times Have You Moved In The Last 10 Years?
What Would You Do If You Had To Move To A Place That Did Not Alllow Pets?
Please Provide The Name And Phone Number Of Your Vet (If You Have One)
Submit


{{title}}
GET
DELETE
|
POST
PUT
Sample Json Data
{{data}}
Comet
Server A
Server B
Server C
Errors
{{errors}}


An Introductory Example¶
Overview¶
We’re now ready to start learning the Python language itself.
In this lecture, we will write and then pick apart small Python programs.
The objective is to introduce you to basic Python syntax and data structures.
Deeper concepts will be covered in later lectures.
You should have read the lecture on getting started with Python before beginning this one.
The Task: Plotting a White Noise Process¶
Suppose we want to simulate and plot the white noise process \(\epsilon_0, \epsilon_1, \ldots, \epsilon_T\), where each draw \(\epsilon_t\) is independent standard normal.
In other words, we want to generate figures that look something like this:
(Here \(t\) is on the horizontal axis and \(\epsilon_t\) is on the vertical axis.)
We’ll do this in several different ways, each time learning something more about Python.
We run the following command first, which helps ensure that plots appear in the notebook if you run it on your own machine.
%matplotlib inline
Version 1¶
Here are a few lines of code that perform the task we set
import numpy as np
import matplotlib.pyplot as plt
ϵ_values = np.random.randn(100)
plt.plot(ϵ_values)
plt.show()
Let’s break this program down and see how it works.
Imports¶
The first two lines of the program import functionality from external code libraries.
The first line imports NumPy, a favorite Python package for tasks like
working with arrays (vectors and matrices)
common mathematical functions like
cos
andsqrt
generating random numbers
linear algebra, etc.
After import numpy as np
we have access to these attributes via the
syntax np.attribute
.
Here’s two more examples
np.sqrt(4)
2.0
np.log(4)
1.3862943611198906
We could also use the following syntax:
import numpy
numpy.sqrt(4)
2.0
But the former method (using the short name np
) is convenient and more
standard.
Why So Many Imports?¶
Python programs typically require several import statements.
The reason is that the core language is deliberately kept small, so that it’s easy to learn and maintain.
When you want to do something interesting with Python, you almost always need to import additional functionality.
Packages¶
As stated above, NumPy is a Python package.
Packages are used by developers to organize code they wish to share.
In fact, a package is just a directory containing
files with Python code — called modules in Python speak
possibly some compiled code that can be accessed by Python (e.g., functions compiled from C or FORTRAN code)
a file called
__init__.py
that specifies what will be executed when we typeimport package_name
In fact, you can find and explore the directory for NumPy on your computer easily enough if you look around.
On this machine, it’s located in
anaconda3/lib/python3.7/site-packages/numpy
Subpackages¶
Consider the line ϵ_values = np.random.randn(100)
.
Here np
refers to the package NumPy, while random
is a
subpackage of NumPy.
Subpackages are just packages that are subdirectories of another package.
Importing Names Directly¶
Recall this code that we saw above
import numpy as np
np.sqrt(4)
2.0
Here’s another way to access NumPy’s square root function
from numpy import sqrt
sqrt(4)
2.0
This is also fine.
The advantage is less typing if we use sqrt
often in our code.
The disadvantage is that, in a long program, these two lines might be separated by many other lines.
Then it’s harder for readers to know where sqrt
came from, should
they wish to.
Random Draws¶
Returning to our program that plots white noise, the remaining three lines after the import statements are
ϵ_values = np.random.randn(100)
plt.plot(ϵ_values)
plt.show()
The first line generates 100 (quasi) independent standard normals and
stores them in ϵ_values
.
The next two lines genererate the plot.
We can and will look at various ways to configure and improve this plot below.
Alternative Implementations¶
Let’s try writing some alternative versions of our first program, which plotted IID draws from the normal distribution.
The programs below are less efficient than the original one, and hence somewhat artificial.
But they do help us illustrate some important Python syntax and semantics in a familiar setting.
A Version with a For Loop¶
Here’s a version that illustrates for
loops and Python lists.
ts_length = 100
ϵ_values = [] # empty list
for i in range(ts_length):
e = np.random.randn()
ϵ_values.append(e)
plt.plot(ϵ_values)
plt.show()
In brief,
The first line sets the desired length of the time series.
The next line creates an empty list called
ϵ_values
that will store the \(\epsilon_t\) values as we generate them.The statement
# empty list
is a comment, and is ignored by Python’s interpreter.The next three lines are the
for
loop, which repeatedly draws a new random number \(\epsilon_t\) and appends it to the end of the listϵ_values
.The last two lines generate the plot and display it to the user.
Let’s study some parts of this program in more detail.
Lists¶
Consider the statement ϵ_values = []
, which creates an empty list.
Lists are a native Python data structure used to group a collection of objects.
For example, try
x = [10, 'foo', False]
type(x)
list
The first element of x
is an
integer,
the next is a
string,
and the third is a Boolean value.
When adding a value to a list, we can use the syntax
list_name.append(some_value)
x
[10, 'foo', False]
x.append(2.5)
x
[10, 'foo', False, 2.5]
Here append()
is what’s called a method, which is a function
“attached to” an object—in this case, the list x
.
We’ll learn all about methods later on, but just to give you some idea,
Python objects such as lists, strings, etc. all have methods that are used to manipulate the data contained in the object.
String objects have string methods, list objects have list methods, etc.
Another useful list method is pop()
x
[10, 'foo', False, 2.5]
x.pop()
2.5
x
[10, 'foo', False]
Lists in Python are zero-based (as in C, Java or Go), so the first
element is referenced by x[0]
x[0] # first element of x
10
x[1] # second element of x
'foo'
The For Loop¶
Now let’s consider the for
loop from
the program above, which
was
for i in range(ts_length):
e = np.random.randn()
ϵ_values.append(e)
Python executes the two indented lines ts_length
times before moving
on.
These two lines are called a code block
, since they comprise the
“block” of code that we are looping over.
Unlike most other languages, Python knows the extent of the code block only from indentation.
In our program, indentation decreases after line ϵ_values.append(e)
,
telling Python that this line marks the lower limit of the code block.
More on indentation below—for now, let’s look at another example of
a for
loop
animals = ['dog', 'cat', 'bird']
for animal in animals:
print("The plural of " + animal + " is " + animal + "s")
The plural of dog is dogs
The plural of cat is cats
The plural of bird is birds
This example helps to clarify how the for
loop works: When we execute
a loop of the form
for variable_name in sequence:
<code block>
The Python interpreter performs the following:
For each element of the
sequence
, it “binds” the namevariable_name
to that element and then executes the code block.
The sequence
object can in fact be a very general object, as we’ll
see soon enough.
A Comment on Indentation¶
In discussing the for
loop, we explained that the code blocks being
looped over are delimited by indentation.
In fact, in Python, all code blocks (i.e., those occurring inside loops, if clauses, function definitions, etc.) are delimited by indentation.
Thus, unlike most other languages, whitespace in Python code affects the output of the program.
Once you get used to it, this is a good thing: It
forces clean, consistent indentation, improving readability
removes clutter, such as the brackets or end statements used in other languages
On the other hand, it takes a bit of care to get right, so please remember:
The line before the start of a code block always ends in a colon
for i in range(10):
if x > y:
while x < 100:
etc., etc.
All lines in a code block must have the same amount of indentation.
The Python standard is 4 spaces, and that’s what you should use.
While Loops¶
The for
loop is the most common technique for iteration in Python.
But, for the purpose of illustration, let’s modify
the program above to use
a while
loop instead.
ts_length = 100
ϵ_values = []
i = 0
while i < ts_length:
e = np.random.randn()
ϵ_values.append(e)
i = i + 1
plt.plot(ϵ_values)
plt.show()
Note that
the code block for the
while
loop is again delimited only by indentationthe statement
i = i + 1
can be replaced byi += 1
Another Application¶
Let’s do one more application before we turn to exercises.
In this application, we plot the balance of a bank account over time.
There are no withdraws over the time period, the last date of which is denoted by \(T\).
The initial balance is \(b_0\) and the interest rate is \(r\).
The balance updates from period \(t\) to \(t+1\) according to
In the code below, we generate and plot the sequence \(b_0, b_1, \ldots, b_T\) generated by ().
Instead of using a Python list to store this sequence, we will use a NumPy array.
r = 0.025 # interest rate
T = 50 # end date
b = np.empty(T+1) # an empty NumPy array, to store all b_t
b[0] = 10 # initial balance
for t in range(T):
b[t+1] = (1 + r) * b[t]
plt.plot(b, label='bank balance')
plt.legend()
plt.show()
The statement b = np.empty(T+1)
allocates storage in memory for T+1
(floating point) numbers.
These numbers are filled in by the for
loop.
Allocating memory at the start is more efficient than using a Python
list and append
, since the latter must repeatedly ask for storage
space from the operating system.
Notice that we added a legend to the plot — a feature you will be asked to use in the exercises.
Exercises¶
Now we turn to exercises. It is important that you complete them before continuing, since they present new concepts we will need.
Exercise 1¶
Your first task is to simulate and plot the correlated time series
The sequence of shocks \(\{\epsilon_t\}\) is assumed to be IID and standard normal.
In your solution, restrict your import statements to
import numpy as np
import matplotlib.pyplot as plt
Set \(T=200\) and \(\alpha = 0.9\).
Exercise 2¶
Starting with your solution to exercise 2, plot three simulated time series, one for each of the cases \(\alpha=0\), \(\alpha=0.8\) and \(\alpha=0.98\).
Use a for
loop to step through the \(\alpha\) values.
If you can, add a legend, to help distinguish between the three time series.
Hints:
If you call the
plot()
function multiple times before callingshow()
, all of the lines you produce will end up on the same figure.For the legend, noted that the expression
'foo' + str(42)
evaluates to'foo42'
.
Exercise 3¶
Similar to the previous exercises, plot the time series
Use \(T=200\), \(\alpha = 0.9\) and \(\{\epsilon_t\}\) as before.
Search online for a function that can be used to compute the absolute value \(|x_t|\).
Exercise 4¶
One important aspect of essentially all programming languages is branching and conditions.
In Python, conditions are usually implemented with if–else syntax.
Here’s an example, that prints -1 for each negative number in an array and 1 for each nonnegative number
numbers = [-9, 2.3, -11, 0]
for x in numbers:
if x < 0:
print(-1)
else:
print(1)
-1
1
-1
1
Now, write a new solution to Exercise 3 that does not use an existing function to compute the absolute value.
Replace this existing function with an if–else condition.
Exercise 5¶
Here’s a harder exercise, that takes some thought and planning.
The task is to compute an approximation to \(\pi\) using Monte Carlo.
Use no imports besides
import numpy as np
Your hints are as follows:
If \(U\) is a bivariate uniform random variable on the unit square \((0, 1)^2\), then the probability that \(U\) lies in a subset \(B\) of \((0,1)^2\) is equal to the area of \(B\).
If \(U_1,\ldots,U_n\) are IID copies of \(U\), then, as \(n\) gets large, the fraction that falls in \(B\), converges to the probability of landing in \(B\).
For a circle, \(area = \pi * radius^2\).
Solutions¶
Exercise 1¶
Here’s one solution.
α = 0.9
T = 200
x = np.empty(T+1)
x[0] = 0
for t in range(T):
x[t+1] = α * x[t] + np.random.randn()
plt.plot(x)
plt.show()
Exercise 2¶
α_values = [0.0, 0.8, 0.98]
T = 200
x = np.empty(T+1)
for α in α_values:
x[0] = 0
for t in range(T):
x[t+1] = α * x[t] + np.random.randn()
plt.plot(x, label=f'$\\alpha = {α}$')
plt.legend()
plt.show()
Exercise 3¶
Here’s one solution:
α = 0.9
T = 200
x = np.empty(T+1)
x[0] = 0
for t in range(T):
x[t+1] = α * np.abs(x[t]) + np.random.randn()
plt.plot(x)
plt.show()
Exercise 4¶
Here’s one way:
α = 0.9
T = 200
x = np.empty(T+1)
x[0] = 0
for t in range(T):
if x[t] < 0:
abs_x = - x[t]
else:
abs_x = x[t]
x[t+1] = α * abs_x + np.random.randn()
plt.plot(x)
plt.show()
Here’s a shorter way to write the same thing:
α = 0.9
T = 200
x = np.empty(T+1)
x[0] = 0
for t in range(T):
abs_x = - x[t] if x[t] < 0 else x[t]
x[t+1] = α * abs_x + np.random.randn()
plt.plot(x)
plt.show()
Exercise 5¶
Consider the circle of diameter 1 embedded in the unit square.
Let \(A\) be its area and let \(r=1/2\) be its radius.
If we know \(\pi\) then we can compute \(A\) via \(A = \pi r^2\).
But here the point is to compute \(\pi\), which we can do by \(\pi = A / r^2\).
Summary: If we can estimate the area of a circle with diameter 1, then dividing by \(r^2 = (1/2)^2 = 1/4\) gives an estimate of \(\pi\).
We estimate the area by sampling bivariate uniforms and looking at the fraction that falls into the circle.
n = 100000
count = 0
for i in range(n):
u, v = np.random.uniform(), np.random.uniform()
d = np.sqrt((u - 0.5)**2 + (v - 0.5)**2)
if d < 0.5:
count += 1
area_estimate = count / n
print(area_estimate * 4) # dividing by radius**2
3.13584


WITNESS LIST
Economic Development, Select
November 8, 2012 10:00 AM
Select Committee on Economic Development
ON:
Demerson, Aaron (Office of the Governor - Economic Development and Tourism), Austin,
TX
Depuy, Ben (Stonehenge Capital Company), TX
Hammond, Bill President & CEO (Texas Association of Business), Austin, TX
McLaughlin, Mark (US Navy), TX
Morrin, Joe (Office of the Governor), Austin, TX
Registering, but not testifying:
ON:
Fowler, Susan Film Producer (President, Texas Motion Picture Alliance), Houston, TX


| Methods Summary | ||
|---|---|---|
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
#
getEventSourceId( )
Returns the identifier of the event source that associated with event source type
(i.e. userId, groupId or roomId).
|
| Properties Summary | ||
|---|---|---|
protected
array
|
$event
|
#
NULL
|


UCSF Mission Bay campus, 2003. Photo by Majed.
2000
School of Medicine radically redesigns the core curriculum to promote integration of disciplines, bringing cultural, social, and behavioral factors into the teaching of biomedical and clinical issues.
2000
School of Pharmacy establishes the Center for Consumer Self Care.
2000
Ph.D. program in Chemistry and Chemical Biology is established in the Graduate Division.
2001
The newly created International Dentist Program enrolls its first class of students.
2001
The Ph.D. program in Pharmaceutical Sciences and Pharmacogenomics is established.
2002
The Master’s of Advanced Studies degree (MAS) in Clinical Research is established in the Graduate Division.
2002
School of Pharmacy establishes satellite clinical teaching programs in Fresno and South Bay.
2003
Genentech Hall opens at the Mission Bay campus. With more than 400,000 gross square feet, it houses programs in structural and chemical biology and molecular cell and developmental biology, the Molecular Design Institute, the Center for Advanced Technology, a library, an auditorium, and commercial space.
2004
Arthur and Toni Rembe Rock Hall opens at the Mission Bay campus. It houses programs in human genetics, developmental biology, developmental neuroscience, and the Center for Brain Development.
2004
Revised curriculum implemented for the School of Dentistry, creating new interdepartmental courses developed around five thematic streams that emphasize and reinforce the integration of basic sciences and clinical sciences in dental education.
2004
Graduate Division establishes joint UCSF/San Francisco State University Doctorate in Physical Therapy (DPT).
2005
Byers Hall, The California Institute for Quantitative Biosciences (QB3) opens as the home for the California Institute of Science and Innovation (Cal ISI) at the Mission Bay campus. This is the headquarters for the Institute, which is a partnership with UC Berkeley and UC Santa Cruz. QB3 is one of the four California Institutes for Science and Innovation, developed at the initiative of Governor Grey Davis, and the only one focused on biomedical research to advance human health. Research here is intensely computational, integrating physical, mathematical and engineering sciences to tackle the complexities of genomics, proteomics, protein folding and interactions, and developing imaging systems of unprecedented power and resolution for diagnosis and treatment of disease.
2006
Elizabeth Blackburn wins Albert Lasker Award for Medical Research for the prediction and discovery of the telomerase enzyme -- which plays a key role in cell aging and human cancer.
2006
UCSF establishes Clinical and Translational Science Institute as largest recipient of NIH Clinical and Translational Science Awards.
2006
Helen Diller Family Cancer Research Building breaks ground on the Mission Bay campus. It will contain research and development programs in neurological surgery, urology and cancer research.
2006
Graduate Division establishes Ph.D. program in Developmental Biology.
2006
UCSF Certificate Program in Global Health Sciences is approved by Graduate Council.
2006
The Schools of Dentistry, Pharmacy, Nursing, Medicine and the Graduate Division offer the first inter-disciplinary class for all enrolled students.
2007
School of Medicine expands enrollment for first time in three decades with launch of the Program in Medical Education for the Urban Underserved (PRIME-US,) aimed at educating and inspiring new physicians to address health disparities.
2008
UCSF breaks ground on new building at Parnassus to house Institute for Regeneration Medicine, to be home for 25 stem cell and regeneration medicine researchers.
2008
School of Medicine establishes new academic Department of Emergency Medicine.
2008
Graduate Division establishes Master's of Science in Global Health Sciences.
2008
School of Pharmacy and School of Medicine establish a joint department: Bioengineering and Therapeutic Sciences.
2009
Susan Desmond-Hellman, MD, MPH becomes UCSF's 9th Chancellor and the first woman to serve in this position.
2009
Elizabeth Blackburn, PhD, becomes UCSF's fourth scientist to recieve the Nobel Prize in Physiology or Medicine for her co-discovery of telomerase.
2009
Shinya Yamanaka, MD, PhD, UCSF Professor of Anatomy, receives the Albert Lasker Basic Medical Research Award for his stem cell discoveries .
2009
The University of California becomes the first public university in California to provide honorary degrees to Japanese Americans and Japanese nationals whose educations were interrupted when they were sent to internment camps during World War II.
2010
David Julius, PhD receives the 2010 Shaw Prize in Life Sciences and Medicine for his groundbreaking work on the sensation of touch.
2010
UCSF Nobel laureate Stanley B. Prusiner, MD, Professor of Neurology and director of the Institute for Neurodegenerative Diseases, receives the National Medal of Science for his discovery of and ongoing research on prions.
2010
UCSF breaks ground on the Benioff Children's Hospital, a state-of-the-art and sustainable medical center at Mission Bay that promises to transform care for women, children, and cancer patients.
2011
UCSF opens the new Teaching and Learning Center, one of the nation's first inter-professional, team-based simulation learning centers, as part of the campus' ongoing efforts to foster collaboration and innovation among the health professions.
Leadership
UCSF Chancellors:
- J. Michael Bishop (1998-2009)
- Susan Desmond-Hellmann (2009-present)
Deans (Dentistry):
- Charles N. Bertolami (1995-2007)
-
John Featherstone (2007-present)
Deans (Graduate Division)
- C. Clifford Attkisson, Ph.D., Interim (1991-1992); Dean and Associate Vice Chancellor of Student Academic Affairs (1992-2005)
- Patricia Calarco, Ph.D., Interim (2005-2007); Dean (2007-2011)
- Joseph Castro, Ph.D., Interim (2011-2012)
- Elizabeth Watkins, Ph.D. (2012-present)
Deans (Medicine):
- Haile Debas (1993-2003)
-
David Kessler (2003-2007)
- Samuel Hawgood, Interim (2007-2009); Dean (2009-present)
Deans (Nursing):
- Kathleen Dracup (2000-2010)
- Sally Rankin (Interim 2010-2011)
- David Vlahov (2011-present)
Deans (Pharmacy):
- Mary Anne Koda-Kimble (1998-2012)
- B. Joseph Guglielmo, Jr., Interim (2012-2013); Dean (2013-present)
Directors (Medical Center)
- Mark R. Laret (2001-Present)


Hello sunx,
Problem 1 is for making sure that you know the rules.
Your gifts is now locked somewhere for a limited time.
You have to answer the problems within one day.
Or else your gifts will be sold by me.

All you have is one scale.
You can put several ball on left side of scale, and several ball on right side of scale to see which side is heavier.
How many times you need at least to find the heavier ball?
{% error %}click on 'submit' to submit your answer.


Flamite use your current Facebook connection to access Tinder. You must have used Tinder at least one time.


planar ML CheatSheet
Library Files:
Packages
Dataset Details:
Dataset
Logistic:
Logistic Regression
Neural Network Model:
Neural Network
Defining Neural Network Structure
Initialise the model parameters
The Loop
NN Model
Prediction
Formula:
Formula
DISCLAIMER
planar
Docs
»
Planar data classification with 1 hidden layer!
View github page
Planar data classification with 1 hidden layer!
¶
Library Files:
Packages
Numpy
Sklearn
Matplotlib
Planar_utils
testCases
Dataset Details:
Dataset
Logistic:
Logistic Regression
Types
Sigmoid Activation
Graph
Neural Network Model:
Neural Network
Mathematically
Problem Statement
Defining Neural Network Structure
Expected Output
Initialise the model parameters
Instructions
Expected Output
The Loop
Instructions
Assert Variable
Formula
Instructions
m and cost Variable
Expected Output
Expected Output
NN Model
Parameters initialized
Expected output
Prediction
Accuracy
Expected Output
Formula:
Formula
Math for NN network
DISCLAIMER


AdminuxPRO
HTML Template
AdminUX
PRO
Admin Dashboard
Days
Hours
Min
Sec
We are coming Soon!
Keep in touch with us:
Subscribe Me


This is a lightweight web server running the TinyOS operating system using the uIP TCP/IP stack. This web server has both static and dynamically generated pages. We are working on releasing this code to the TinyOS community.
We have a number of test pages:
For more information, contact Andrew Christian


[§103D-319] Reporting of anticompetitive practices. When for any reason collusion or other anticompetitive practices are suspected among any bidders or offerors, a notice of the relevant facts shall be transmitted to the attorney general. [L Sp 1993, c 8, pt of §2]


|
20th May 2014
Top news
1
Scientists: We've found the biggest dinosaur ever
- The paleontologists who found it say it's the biggest ever found and thus the biggest creature ever to have walked the earth, reports the BBC.
- Based on its thigh bones, the dinosaur was 130 feet long and 65 feet tall, and at 85 tons, it was the weight of 14 African elephants.
- The creature, which doesn't have a name yet, is thought to be a new species of titanosaur within the larger sauropod group.
- The huge herbivore lived in the forests of Patagonia between 95 and 100 million years ago, the team said.
2
US justice department charges Chinese with hacking
- The US has charged five Chinese army officers with hacking into private-sector American companies in a bid for competitive advantage, in the first cyber-espionage case of its kind.
- US prosecutors say the officers stole trade secrets and internal documents from five companies and a labour union.
- China denied the charges and warned the case would harm US-China relations.
- "The alleged hacking appears to have been conducted for no reason other than to advantage state-owned companies and other interests in China, at the expense of businesses here in the United States," Mr Holder said.
- FBI officials said the hacking in the years 2006-14 caused "significant losses" at the companies and that there were likely many more victims.
3
Scientists discover how to turn light into matter after 80-year quest
- Imperial College London physicists have discovered how to create matter from light - a feat thought impossible when the idea was first theorised 80 years ago.
- Breit and Wheeler suggested that it should be possible to turn light into matter by smashing together only two particles of light (photons), to create an electron and a positron – the simplest method of turning light into matter ever predicted.
- The new research, published in Nature Photonics, shows for the first time how Breit and Wheeler's theory could be proven in practice.
- This experiment would recreate a process that was important in the first 100 seconds of the universe and that is also seen in gamma ray bursts, which are the biggest explosions in the universe and one of physics' greatest unsolved mysteries.
That's all for today!
If you want to be notified of these news as they occur, follow @MostTalkedLive on Twitter!
Can we do anything better?
We want you the receive the best possible news digest, let us know what you want to see<EMAIL_ADDRESS>Lots of love,
Bilsay, Deniz, Omer
|
|
|


Thinking bout stuff....and Junk
I have never quite known or understood what my thinking style was or is. In fact I never even thought to research it until now. And since getting into web development I know that it is important to know and understand what your thinking style is because thinking is part of the job, you don't know how you think, you can't do your job.
My thinking style: Before the research
Again I am not sure what my thinking style is, though I'm sure it's all over the place. You should see my desk, I have a stack of ruby books a bunch of art, two laptops, a Cintiq, paintbrushes, deoderant, mouthwash, erasers......I need to clean off my desk...... Anyway if I had to make a guess at my thinking style it is all over the place, I get my best coding inspiration when I draw, I get my best drawing inspiration when I code. I get my best ideas with everything else either out and about or even on the toilet. I have woken up in the middle of the night to an awesome idea that I have had. I've gone from wanting to be a chef, to a designer, to a developer and back again. My thinking process I think, is all over the place, and I don't even know if there is a name for it. But I get bored when there isn't alot to do.
My thinking style: After the research
The consensus is in, and I am an Abstract Random Thinker, which makes sense, because I am not just a developer, I am also an artist. Abstract random thinkers are for the most part free spirited, creative types, and there are LOTS of places. Did you know that from what wrote up above that that was going to be the answer? I figured it would be but I wasn't sure.
My Mind is set on Growth
My mindset is a Growth mindset, I am always looking to learn and always looking to grow. I want to learn what I can and how much I can until my head explodes. My experience with DBC so far has made me want this more. There is a lot to learn bout coding and I intend to learn as much as I can until my eyes bleed and fall out of my sockets.


We enhance mices!
- extend interactive methodologies
- reinvent virtual experiences
- synthesize distributed functionalities
- revolutionize strategic content
- innovate holistic bandwidth
- exploit value-added functionalities
- facilitate interactive deliverables
- morph revolutionary metrics
- revolutionize cutting-edge metrics
- harness web-enabled models
- reinvent bleeding-edge content


| Package | Description |
|---|---|
| com.paypal.butterfly.extensions.api |
API component to be used by Butterfly extensions when providing their
transformation and upgrade templates.
|
| com.paypal.butterfly.extensions.api.operations |
Basic transformation operations.
|
| com.paypal.butterfly.extensions.api.utilities |
Basic transformation utilities.
|
| Modifier and Type | Class and Description |
|---|---|
class |
TransformationUtility<TU extends TransformationUtility>
Gathers information about the project to be transformed without applying any modification on it.
|
| Modifier and Type | Class and Description |
|---|---|
class |
ContextAttributeRetriever<VT>
Transformation utility to fetch transformation context attributes post
transformation time, since they are always set
during transformation time.
|
class |
DoubleCondition<DUC extends DoubleCondition>
Transformation utility condition to determine if a transformation utility
should be executed or not, based on a two files criteria.
|
class |
FilterFiles
Transformation utility to filter a list of files based on a given
SingleCondition ,
returning in a sub-list of files. |
class |
MultipleConditions
Transformation utility condition to determine if a transformation utility should be executed or not,
based on a multiple files criteria.
|
class |
MultipleOperations
Transformation utility to perform multiple transformation operations.
|
class |
SingleCondition<SUC extends SingleCondition>
Transformation utility condition to determine if a transformation utility
should be executed or not, based on an one file criteria.
|
class |
TransformationOperation<TO extends TransformationOperation>
Special type of
TransformationUtility that applies a modification to the project. |
class |
TransformationUtilityGroup
Group of transformation utilities.
|
class |
TransformationUtilityLoop
Allows the execution of a transformation utility instance, created from a template, multiple times in a loop.
|
class |
UtilityCondition<TOC extends UtilityCondition>
Condition to determine if a transformation utility
should be executed or not.
|
| Modifier and Type | Method and Description |
|---|---|
TransformationUtility<TU> |
TransformationUtility.clone() |
TransformationUtility<TransformationUtilityGroup> |
TransformationUtilityGroup.clone() |
TransformationUtility<TU> |
TransformationUtility.copy()
Creates and returns a brand new utility object using the original as a template,
and setting to the copy most of the attributes of the original one.
|
TransformationUtility |
TransformationUtilityLoop.getCondition() |
TransformationUtility |
TransformationUtilityLoop.getTemplate() |
TransformationUtility |
TransformationUtilityLoop.iterate()
Returns a clone of this transformation utility loop ready for the next iteration
|
TransformationUtility |
TransformationUtilityLoop.run()
Returns the TU instance to be run in the this iteration.
|
| Modifier and Type | Method and Description |
|---|---|
List<TransformationUtility> |
MultipleOperations.getChildren() |
List<TransformationUtility> |
TransformationTemplate.getChildren() |
List<TransformationUtility> |
TransformationUtilityGroup.getChildren() |
List<TransformationUtility> |
TransformationUtilityLoop.getChildren() |
List<TransformationUtility> |
TransformationTemplate.getUtilities()
Returns a read-only ordered list of transformation utilities to be executed,
which defines the actual transformation offered by this template
|
List<TransformationUtility> |
TransformationUtilityGroup.getUtilities() |
| Modifier and Type | Method and Description |
|---|---|
String |
TransformationTemplate.add(TransformationUtility utility)
Adds a new transformation utility to the end of the list.
|
String |
TransformationUtilityGroup.add(TransformationUtility utility) |
String |
TransformationTemplate.add(TransformationUtility utility,
String utilityName)
Adds a new transformation utility to the end of the list.
|
String |
TransformationUtilityGroup.add(TransformationUtility utility,
String utilityName) |
static PerformResult |
PerformResult.error(TransformationUtility transformationUtility,
Exception exception)
This means The TU failed, but not because of its utility execution itself, but because of an internal reason.
|
static TUExecutionResult |
TUExecutionResult.error(TransformationUtility transformationUtility,
Exception exception) |
static TUExecutionResult |
TUExecutionResult.error(TransformationUtility transformationUtility,
Exception exception,
Object value) |
static PerformResult |
PerformResult.error(TransformationUtility transformationUtility,
Exception exception,
String details)
This means The TU failed, but not because of its utility execution itself, but because of an internal reason.
|
static TUExecutionResult |
TUExecutionResult.error(TransformationUtility transformationUtility,
Object value,
Exception exception,
String details) |
static PerformResult |
PerformResult.executionResult(TransformationUtility transformationUtility,
ExecutionResult executionResult)
This means the utility has been executed,
and the result type is defined based on the utility execution result type.
|
String |
TransformationTemplate.loop(TransformationUtility utility,
int iterations)
Execute an utility in a loop a number times specified in
iterations |
String |
TransformationTemplate.loop(TransformationUtility utility,
String attribute)
Execute an utility in a loop while the value in
TransformationContext attribute is true. |
String |
TransformationTemplate.loop(TransformationUtility utility,
UtilityCondition condition)
Execute an utility in a loop while the execution value resulted by
condition is true. |
static TUExecutionResult |
TUExecutionResult.nullResult(TransformationUtility transformationUtility) |
static TUExecutionResult |
TUExecutionResult.nullResult(TransformationUtility transformationUtility,
String details) |
TransformationUtilityLoop |
TransformationUtilityLoop.setTemplate(TransformationUtility template) |
static PerformResult |
PerformResult.skippedCondition(TransformationUtility transformationUtility,
String details)
This means the utility has not been executed
because its pre-requisite condition is not true
|
static PerformResult |
PerformResult.skippedDependency(TransformationUtility transformationUtility,
String details)
This means the utility has not been executed because one or more
of its dependencies "failed".
|
static TUExecutionResult |
TUExecutionResult.value(TransformationUtility transformationUtility,
Object value) |
static TUExecutionResult |
TUExecutionResult.value(TransformationUtility transformationUtility,
String details,
Object value) |
static TUExecutionResult |
TUExecutionResult.warning(TransformationUtility transformationUtility,
Exception exception,
Object value) |
static TUExecutionResult |
TUExecutionResult.warning(TransformationUtility transformationUtility,
Exception exception,
String details,
Object value) |
static TUExecutionResult |
TUExecutionResult.warning(TransformationUtility transformationUtility,
String details,
Object value) |
| Constructor and Description |
|---|
TransformationUtilityLoop(TransformationUtility template) |
| Modifier and Type | Class and Description |
|---|---|
class |
AddElementTO<TO extends AddElementTO>
Convenience class with
AddElement implementation ready for TransformationOperation subclasses. |
class |
ChangeOrRemoveElementTO<TO extends ChangeOrRemoveElementTO>
Convenience class with
ChangeOrRemoveElement implementation ready for TransformationOperation subclasses. |
| Modifier and Type | Class and Description |
|---|---|
class |
Abort
Aborts the transformation immediately.
|
class |
Log
Provides logging statements during transformation time.
|
class |
ManualInstruction
Registers a manual instruction, also known as "post-upgrade instruction", which can be seen as
a transformation operation that is too complex to be automated, but that should at least be recognized and reported by Butterfly.
|
class |
MapValue
Obtains a specific entry from a
Map object stored in the TransformationContext ,
and store its value as a new attribute in the transformation context. |
class |
ResultCondition
Checks the perform result, and optionally execution result as well, of a
TransformationUtility instance. |
Copyright © 2017. All rights reserved.


Osetra bay was conceived, designed and built for dining pleasure. Osetra bay was conceived, designed and built for dining pleasure. Local entrepreneur Michael Alberga and his partner Heidi Teeling joined forces with James Sedgley, a 15 year veteran of restaurant directorship in London, to set a new standard for relaxed, romantic dining that extends the warmest welcome to couples, groups and families alike. The ultimate goal was to create a unique experience in the Cayman Islands, one of the world’s most exclusive destinations.
They enlisted the help of Cayman’s premier builder and designer, John Hurlstone, to create a stunningly stylish venue that embodied the rustic elegance of St. Tropez and the relaxed ambience of South Beach. Employing a group of globally diverse and talented Chefs who shared their vision and had a passion for creating exceptional cuisine, Osetra Bay quickly rose to the top of the list of Cayman’s must-do restaurants.
With the focus on providing exciting world cuisine enhanced by the freshest local Caribbean ingredients, Osetra Bay is now established as one of Cayman’s most popular night spots.
Chef
Daniel hails from Austria and as he is keen to point out, so are some of the World’s greatest Chefs – such as Wolfgang Puck and Eckart Witzigmann who was one of the first chefs outside of France to be awarded the coveted 3 Michelin stars.
Daniel describes his food as earthy. He doesn’t like to mess with what he has and rather allows 3 or four flavor combinations to speak for themselves, rather than preparing what he calls fussy, over-inventive food.
He has been absolutely amazed and excited, since he first arrived in Cayman, with the plethora of local seafood that is available. And has worked very hard with local fisherman to develop lasting relationships to ensure he always has the pick of the freshest catch. Be it Red, black or yellow snapper, tuna or wahoo, conch or lobster. From there he says its simply a no-brainer to root yourself in Caribbean seasonings but expanded outward with more global twists on the preparations. Nor to forget the diverse talents you have in your team at your disposal.
Highly experienced with over 14 years in professional kitchens, he cut his bones in some of Austria’s top Hotels including achieving the position of Sous Chef at the award winning Restaurant M32 in Salzburg as well as Executive Chef at critically acclaimed ultra modern alpine Hotel Riml, frequented by Moguls and celebrities alike.
Outside of Austria Daniel spread his culinary wings as Chef at Five Diamond hotel The Westgate in San Francisco USA; an experience he describes as invaluable and one that taught him that there’s a world of culturally diverse and exciting people out there waiting and desperate to try equally exciting and innovative cuisine. He didn’t disappoint.
Daniel doesn’t mess around with fancy techniques. He just wants the best from his food. If you ask him what’s his favorite piece of equipment is he’ll tell you, “My Chef’s Knife – If you don’t have a decent one, just leave the kitchen and forget it because you haven’t got your priorities right. I also keep it close by for when people ask me about either Lederhosen or Yodeling!” He’s a bit of a joker too.
Come and meet Daniel at Osetra Bay and enjoy your evening with us.
HEAD CHEF DANIEL GRAUSGRUMBER
Menus"Food is not just to awaken the palate and satisfy the appetite. It must please all the senses and stimulate the mind."At Osetra bay we have designed our menus to complement the beautiful setting of the restaurant on the gently ebbing and flowing waters of the Caribbean Sea. With fresh, exciting ingredients prepared with panache, our team of world class Chefs invite you to a culinary experience like no other and that we guarantee, cannot be found anywhere else in the Cayman Islands.
a la carte dinner menucanapéswine listThanksGivng MenuLounge Culture"The real beauty of Lounge Culture is that while there’s plenty of history to draw from, no one is keeping track." Osetra Bay has designed three contemporary lounges with the aim of creating a shrine to Caribbean Beach Culture and entertaining, in which the cocktail or the champagne is the source and symbol of all things.
In recent years, the Lounge Scene has re-emerged on the cultural map as the most popular type of venue for socialising and spending an evening out. More than just a place to meet and enjoy a drink, at Osetra bay we offer a unique lounge experience for friends to come together. Both our Gold and Silver lounges are available for private hire if preferred, with tailor made service and entertainment. Segue after cocktails into the dining room or sit back and relax with your favorite infused aperitifs and digestives. Perhaps try some delectable bar food and bites and just chill. It’s also the picture perfect place for hosting weddings, showers and birthdays. So it’s up to you, what’s your pleasure?GalleryGallery
EventsWeddingAt Osetra Bay we keep one thought paramount when planning and executing this, the most special of events: it is the most important day in the life of the Bride and Groom and their families. We take our responsibilities very seriously and make every possible effort to go beyond your expectations. Osetra Bay, with our billowing all white canvasses and drapery, our perfect waterfront, exclusive and idyllic setting coupled with exemplary food and service, creates a truly memorable day.
We also believe that every dream wedding is different so we make it our mission to custom design every one we do. The only limitations come from your imagination. We are happy to keep it simple and elegant which our own facilities naturally offer or we can work with a number of local vendors and partners to make our spectacular setting even more incredible.
Please email our wedding planner James at<EMAIL_ADDRESS>to begin planning a day that will leave nothing but the fondest of special memories.
CorporateOsetra Bay understands that not all business is conducted in the board room and also that after the negotiations are done it is important for clients and colleagues to relax in an environment of calm, privacy and exclusivity. We invite groups less than 25 persons to order a la carte if they prefer or we offer a selection of individually priced menus for larger groups up to 160 persons. Alternatively we can work with meeting planners to create unique menus to suit their client’s needs.
At Osetra Bay we can also offer molecular dessert demonstrations, interactive buffet stations, rum and champagne tastings as well as other attractions to make corporate events much more than just an exquisite dining experience.
Please email our meeting planner<EMAIL_ADDRESS>to begin planning your next corporate event or party and please in the meantime review our menus page.
PartiesWhether is a Birthday or Bar Mitzvah, a Bridal or Baby Shower, a Baptism or a Bachelor Party, Osetra Bay has unique location, facilities, service, food, cocktails and wine to make each and every celebration memorable. Guests can choose one of our three unique lounges to celebrate privately with canapés and drinks at no extra charge and of course we look forward to providing an exquisite dining experience afterwards in our restaurant if that is also required.
Please email<EMAIL_ADDRESS>to make the arrangements for whatever you would like to celebrate and please in the meantime review our menus page.
Guests
Reviews
"Elegant and chic, upscale yet unpretentious, Osetra Bay offers a fine dining experience that will surprise and delight." - Ritz Carlton Magazine
"Our meal at Osetra bay was very good, and the service excellent. The outdoor dining was mystical and romantic." - Ray Rumson
"The menu is extensive and each dish is prepared with great skill and eye for presentation; a good wine list and wonderful service" - James London
"Gran Cayman's newest restaurant has introduced an elevated standard in waterfront dining." - Sam Junard
"Food and ambiance fuse seamlessly to create a contemporary and relaxed experience reminiscent of St. Trioez." - Matt Wells
"Design, location, menu: all five stars. This is definitely the place to eat, see and be seen at in Grand Cayman."
- Steve Carson


Get
You'll find Get is used in a very similar way to retrieving data with CodeIgniter's Active Record class. All the relevant query clauses from Active Record are available in DataMapper so you have the full power of retrieving data, in Active Record style!
Note: There are enough differences between CodeIgniter and DataMapper's Active Record like query clauses that you should read on to be able to take full advantage of it.
Now, let's look at all the available methods. We'll assume we have a DataMapper model setup, named Object.
$object->get();
Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:
$o = new Object();
$o->get();
// The $o object is populated with all objects from its corresponding table
The first and second parameters enable you do set a limit and offset clause:
$o = new Object();
$o->get(10, 20);
// The $o object is populated with 10 objects from its corresponding table, starting from record 20
You can view the results in a couple of ways. Viewing the first result:
$o = new Object();
$o->get();
echo $o->title;
Viewing all results:
$o = new Object();
$o->get();
foreach ($o->all as $obj)
{
echo $obj->title;
}
$object->validate->get();
Normally, get() will generate its query from building up any query clauses you have setup before calling get(). If none are setup, it will default to selecting all records from the objects corresponding table. However, there is a special situation where get() will use the values present within the current object. This happens if you run the validate() function before a get() call.
Note: When doing $object->validate()->get(); all other query clauses (such as select, where etc) will be ignored.
Ok, so to explain this, I'll use an example I've used before from the Getting Started page. Taking part of the example from there, we see that the User model is setup to encrypt the password field with the salt from the matching users stored record (by username), when they attempt to login.
User model (excerpt)
function login()
{
// Create a temporary user object
$u = new User();
// Get this users stored record via their username
$u->where('username', $this->username)->get();
// Give this user their stored salt
$this->salt = $u->salt;
// Validate and get this user by their property values,
// this will see the 'encrypt' validation run, encrypting the password with the salt
$this->validate()->get();
// If the username and encrypted password matched a record in the database,
// this user object would be fully populated, complete with their ID.
// If there was no matching record, this user would be completely cleared so their id would be empty.
if (empty($this->id))
{
// Login failed, so set a custom error message
$this->error_message('login', 'Username or password invalid');
return FALSE;
}
else
{
// Login succeeded
return TRUE;
}
}
Here's how the models login function was called. You can see the username and unencrypted password is set on the user object before calling the login function.
Controller (excerpt)
// Create user object
$u = new User();
// Put user supplied data into user object
// (no need to validate the post variables in the controller,
// if you've set your DataMapper models up with validation rules)
$u->username = $this->input->post('username');
$u->password = $this->input->post('password');
// Attempt to log user in with the data they supplied, using the login function setup in the User model
// You might want to have a quick look at that login function up the top of this page to see how it authenticates the user
if ($u->login())
{
echo '
Welcome ' . $this->username . '!
';
echo '
You have successfully logged in so now we know that your email is ' . $this->email . '.
';
}
else
{
// Show the custom login error message
echo '
' . $this->error->login . '
';
}
So, inside, the models login function, $object->validate->get(); is called which runs the validation functions, defined in the model, on the objects properties, and then it does a get using the validated properties.
$object->get_where();
Identical to the above function except that it permits you to add a "where" clause in the first parameter, instead of using the $object->where() function:
$o = new Object();
$o->get_where(array('id', => $id), $limit, $offset);
Please read the where function below for more information.
$object->select();
Permits you to write the SELECT portion of your query:
$o = new Object();
$o->select('title, description');
$o->get();
// The $o object is populated with all objects from its corresponding table, but with only the title and description fields populated
Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, DataMapper assumes you wish to SELECT *
$object->select_max();
Writes a "SELECT MAX(field)" portion for your query. You can optionally include a second parameter to rename the resulting field.
$o = new Object();
$o->select_max('age');
$o->get();
// The $o object is populated with a single object from its corresponding table, but with only the age field populated, which contains the maximum age
$object->select_min();
Writes a "SELECT MIN(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.
$o = new Object();
$o->select_min('age');
$o->get();
// The $o object is populated with a signle object from its corresponding table, but with only the age field populated, which contains the minimum age
$object->select_avg();
Writes a "SELECT AVG(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.
$o = new Object();
$o->select_avg('age');
$o->get();
// The $o object is populated with a single object from its corresponding table, but with only the age field populated, which contains the average age
$object->select_sum();
Writes a "SELECT SUM(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.
$o = new Object();
$o->select_sum('age');
$o->get();
// The $o object is populated with a single object from its corresponding table, but with only the age field populated, which contains the sum of all ages
$object->where();
This function enables you to set WHERE clauses using one of four methods:
Note: All values passed to this function are escaped automatically, producing safer queries.
- Simple key/value method:
$o = new Object();
$o->where('name', $name);
// When $o->get() is called, the above where clause will be included in the get queryIf you use multiple where function calls they will be chained together with AND between them:
$o = new Object();
$o->where('name', $name);
$o->where('title', $title);
$o->where('status', $status);
// When $o->get() is called, all of the above where clause will be included in the get query - Custom key/value method:
You can include an operator in the first parameter in order to control the comparison:
$o = new Object();
$o->where('name !=', $name);
$o->where('id <', $id);
// When $o->get() is called, all of the above where clause will be included in the get query (with operators) - Associative array method:
$o = new Object();
$array = array('name' => $name, 'title' => $title, 'status' => $status);
$o->where($array);
// When $o->get() is called, the array of where clauses will be included in the get queryYou can include your own operators using this method as well:
$array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);
$o = new Object();
$o>where($array); - Custom string:
You can write your own clauses manually:
$where = "name='Joe' AND status='boss' OR status='active'";
$o = new Object();
$o->where($where);
$object->or_where();
This function is identical to the one above, except that multiple instances are joined by OR:
$o = new Object();
$o->where('name !=', $name);
$o->or_where('id >', $id);
// When $o->get() is called, all of the above where clause will be included in the get query separated by OR's
$object->where_in();
Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate
$o = new Object();
$names = array('Frank', 'Todd', 'James');
$o->where_in('username', $names);
// When $o->get() is called, all records where the username is Frank, Todd, or James will be returned
$object->or_where_in();
Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate
$o = new Object();
$firstnames = array('Frank', 'Todd', 'James');
$lastnames = array('Smith', 'Jones');
$o->where_in('firstname', $firstnames);
$o->or_where_in('lastname', $lastnames);
// When $o->get() is called, all records where the firstname is Frank, Todd, or James, or all records where the lastname is Smith or Jones, will be returned
$o->where_not_in();
Generates a WHERE field NOT IN ('item', 'item') SQL query joined with AND if appropriate
$o = new Object();
$names = array('Frank', 'Todd', 'James');
$o->where_not_in('username', $names);
// When $o->get() is called, all records where the username is not Frank, Todd, or James will be returned
$object->or_where_not_in();
Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate
$o = new Object();
$firstnames = array('Frank', 'Todd', 'James');
$lastnames = array('Smith', 'Jones');
$o->where_not_in('firstname', $firstnames);
$o->or_where_not_in('lastname', $lastnames);
// When $o->get() is called, all records where the firstname is not Frank, Todd, or James, or all records where the lastname is not Smith or Jones, will be returned
$object->like();
This function enables you to generate LIKE clauses, useful for doing searches.
Note: All values passed to this function are escaped automatically.
- Simple key/value method:
$o = new Object();
$o->like('title', 'match');
// When $o->get() is called, all records with a title like match will be returnedIf you use multiple function calls they will be chained together with AND between them:
$o = new Object();
If you want to control where the wildcard (%) is placed, you can use an optional third argument. Your options are 'before', 'after' and 'both' (which is the default).
$o->like('title', 'match'); $o->like('body', 'match');
// When $o->get() is called, all records with a title like match and a body like match will be returned$o = new Object();
$o->like('title', 'match', 'after');
// When $o->get() is called, all records with a title starting with match will be returned - Associative array method:
$array = array('title' => $match, 'page1' => $match, 'page2' => $match);
$o = new Object();
$o->like($array);
// When $o->get() is called, all records with the title, page1, and page2 like the specified matches will be returned
$object->or_like();
This function is identical to the one above, except that multiple instances are joined by OR:
$o = new Object();
$o->like('title', 'match');
$o->or_like('body', $match);
// When $o->get() is called, all records with a title like match or a body like match will be returned
$object->not_like();
This function is identical to like(), except that it generates NOT LIKE statements:
$o = new Object();
$o->not_like('title', 'match');
// When $o->get() is called, all records with a title not like match will be returned
$object->or_not_like();
This function is identical to not_like(), except that multiple instances are joined by OR:
$o = new Object();
$o->like('title', 'match');
$o->or_not_like('body', 'match');
// When $o->get() is called, all records with a title like match or a body not like match will be returned
$object->group_by();
Permits you to write the GROUP BY portion of your query:
$o = new Object();
$o->group_by('title');
// When $o->get() is called, all returned records will be grouped by title
You can also pass an array of multiple values as well:
$o = new Object();
$o->group_by(array('title', 'date'));
// When $o->get() is called, all returned records will be grouped by title and then date
$object->distinct();
Adds the "DISTINCT" keyword to a query
$o = new Object();
$o->distinct();
// When $o->get() is called, a DISTINCT select of records will be made
$object->having();
Permits you to write the HAVING portion of your query. There are 2 possible syntaxe, 1 argument or 2:
$o = new Object();
$o->having('user_id = 45');
// When $o->get() is called, all records having a user_id of 45 will be returned
$o->having('user_id', 45);
// As above, when $o->get() is called, all records having a user_id of 45 will be returned
You can also pass an array of multiple values as well:
$o = new Object();
$o->having(array('title =' => 'My Title', 'id <' => $id));
// When $o->get() is called, all records having a title of My Title and an id less than 45 will be returned
If you are using a database that CodeIgniter escapes queries for, you can prevent escaping content by passing an optional third argument, and setting it to FALSE.
$o = new Object();
$o->having('user_id', 45, FALSE);
$object->or_having();
Identical to having(), only separates multiple clauses with "OR".
$object->order_by();
Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. The second parameter lets you set the direction of the result. Options are asc or desc, or random.
$o = new Object();
$o->order_by("title", "desc");
// When $o->get() is called, all returned records will be ordered by title descending
You can also pass your own string in the first parameter:
$o = new Object();
$o->order_by('title desc, name asc');
// When $o->get() is called, all returned records will be ordered by title descending, then name ascending
Or multiple function calls can be made if you need multiple fields.
$o = new Object();
$o->order_by("title", "desc");
$o->order_by("name", "asc");
// When $o->get() is called, all returned records will be ordered by title descending, then name ascending
Note: random ordering is not currently supported in Oracle or MSSQL drivers. These will default to 'ASC'.
$object->limit();
Lets you limit the number of rows you would like returned by the query:
$o = new Object();
$o->limit(10);
// When $o->get() is called, the number of records returned will be limited to 10
The second parameter lets you set a result offset.
$o = new Object();
$o->limit(10, 20);
// When $o->get() is called, the number of records returned will be limited to 10, starting from record 20
Method Chaining
Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:
$o = new Object();
$o->where('id', $id)->limit(10, 20)->get();
Note: Method chaining only works with PHP 5. Funnily enough, DataMapper also only works with PHP 5 so if it works on your server, so will method chaining!
The alternate of the above without method chaining would be:
$o = new Object();
$o->where('id', $id);
$o->limit(10, 20);
$o->get();
Active Record Caching
Since DataMapper uses Active Record for all its queries, it makes sense you should be able to access the Active Record caching methods. While not "true" caching, Active Record enables you to save (or "cache") certain parts of your queries for reuse later. Normally, when an Active Record call is completed, all stored information is reset for the next call. With caching, you can prevent this reset, and reuse information easily.
Cached calls are cumulative. If you make 2 cached select() calls, and then 2 uncached select() calls, this will result in 4 select() calls. There are three Caching functions available:
$object->start_cache()
This function must be called to begin caching. All Active Record queries of the correct type (see below for supported queries) are stored for later use.
$object->stop_cache()
This function can be called to stop caching.
$object->flush_cache()
This function deletes all items from the Active Record cache.
Here's a usage example:
$o = new Object();
$o->start_cache();
$o->select('field1');
$o->stop_cache();
$o->get();
// The $o object is populated with all records from its corresponding table, but with only the 'field1' field being populated
$o->select('field2');
$o->get();
// The $o object is populated with all records from its corresponding table, but with both the 'field1' and 'field2' fields being populated
$o->flush_cache();
$o->select('field2');
$o->get();
// The $o object is populated with all records from its corresponding table, but with only the 'field2' field being populated
Note: The following fields can be cached: ‘select’, ‘from’, ‘join’, ‘where’, ‘like’, ‘group_by’, ‘having’, ‘order_by’, ‘set’
Get (Advanced)
DataMapper has extended versions of most of its query clauses that allow for advanced querying on relationships.
Let's go through an example to see the benefits. Let's say we have a User model and a Group model. A group can have many users but a user can only have one group. Here's how you would look up all users belonging to the Moderator group without the advanced query:
// Create user object
$u = new User();
// Get all users
$u->get();
// Loop through all users
foreach ($u->all as $user)
{
// Get the current user's group
$user->group->get();
// Check if user is related to the Moderator group
if ($user->group->name == 'Moderator')
{
// ...
}
}
Here's how you would do the above, but using an advanced query:
// Create user object
$u = new User();
// Get users that are related to the Moderator group
$u->where_related_group('name', 'Moderator')->get();
// ...
As you can see, it's a big time saver but not just in the amount of code you write, but also in the number of database queries and overall processing time.
Supported Query Clauses
The following are the normal query clauses that you can use in the advanced queries:
- where
- or_where
- where_in
- or_where_in
- where_not_in
- or_where_not_in
- like
- not_like
- or_like
- or_not_like
- having
- or_having
$object->{query}_related_{model}($field, $value);
There are a number of ways you can use these advanced queries, and this is the first usage format. All examples are done with the User and Group objects scenario.
- {query} - Replace with supported query type.
- {model} - Replace with related model name.
- $field - First parameter for chosen query type.
- $value - Second parameter for chosen query type.
Here's an example using the where query:
// Create user
$u = new User();
// Get all users relating to the Moderator group (goes by 'group', 'name', 'Moderator')
$u->where_related_group('name', 'Moderator')->get();
$object->{query}_related($model, $field, $value);
Alternatively, rather than specifying the related model as part of the method, you could instead supply it as the first parameter.
- {query} - Replace with supported query type.
- $model - Supply related model name.
- $field - First parameter for chosen query type.
- $value - Second parameter for chosen query type.
Here's an example using the where query:
// Create user
$u = new User();
// Get all users relating to the Moderator group (goes by 'group', 'name', 'Moderator')
$u->where_related('group', 'name', 'Moderator')->get();
$object->{query}_related($related_object, $field, $value);
- {query} - Replace with supported query type.
- $related_object - Supply related object.
- Optional: $field - First parameter for chosen query type.
- Optional: $value - Second parameter for chosen query type.
Note: Both the $field and $value parameters are optional if the $related_object contains a valid id.
Here's an example using the where query:
// Create and get the Moderator group
$g = new Group();
$g->get_by_name('Moderator');
// Create user
$u = new User();
// Get all users relating to the Moderator group (goes by 'group', 'id', $g->id)
$u->where_related($g)->get();
Here's a similar way of doing the above, but with an unpopulated related object (no id):
// Create and get the Moderator group
$g = new Group();
// Create user
$u = new User();
// Get all users relating to the Moderator group (goes by 'group', 'name', 'Moderator')
$u->where_related($g, 'name', 'Moderator')->get();
Which of the available usage formats you use will depend on your personal preference, although you should be consistent with your choice. It also might depend on whether you have a related object already available to use.
Note: For Self Referencing Relationships, you can only use the usage format where you pass a related object with an id, for example:
$object->{query}_related($related_object);


Boneyard Union of Zymurgical Zealots
Founded in 1994, the Boneyard Union of Zymurgical Zealots is one of the oldest homebrew clubs in Illinois.
Monthly Meeting Info
The BUZZ club meets on the first Thursday of the month at 7:00pm. If you're unsure of where the meeting is being held post on the forum or email the list.
Upcoming meetings:
{{ meeting.start|date:'l @ P T' }}
{% if meeting.location %}
{% if meeting.location.map_url %}
{{ meeting.location.name }}
{% else %}
{{ meeting.location.name }}
{% endif %}
{% else %}
Location: TBD
{% endif %}
{% if meeting.topic %}
{{ meeting.topic}}
{% else %}
Topic: TBD
{% endif %}
Beginners and new members are always welcome and you do not need to be a student to join, though you must be at least 21 years old to participate in any activities involving alcohol.
A meeting typically starts with a discussion of new business including upcoming events and social opportunities. Often there is a technical topic for the month that is also presented at the meeting. This topic may be a brewing technique, a specific style of beer, or a spotlight on a particular brewing ingredient. The meeting always concludes with a sampling of homebrewed beers, meads, and wines that members bring to the meeting. Every brewer has a chance to tell us about what they brought and then receives honest feedback about their creation. Meetings often finish with a tasting of rare or otherwise notable commercial creations.
Membership Info
Membership dues in the BUZZ club are $20 per year. BUZZ membership has many benefits:
- The opportunity to interact with a large number of experienced brewers.
- Constructive feedback about your brewing and the chance to taste a wide range of styles.
- Participation in bulk purchases in which the members pool their orders for brewing ingredients or equipment and are able to get a substantial discount.
New officers are elected and dues are collected for the coming year in September. Pay your dues by clicking the "Buy Now" button below (it redirects to Paypal.)
Annual Boneyard Brew Off
Each year we host a homebrew competition. Go here to learn the dates, to enter, and to see the winners.


????? ???????
on 2012-05-06 09:34:48
If I might —perhaps you should consider adding a few images. I don’t mean to disrespect what you’ve said ; its very enlightening, indeed. However, I think would respond to it more positively if they could be something tangible to your ideas
pedro
on 2009-08-20 11:10:45
thank you very much for this function is what I needed to resolve my problem. thkx
Kevin van Zonneveld
on 2009-06-18 13:03:04
@ Brett Zamir: YEah I already have:
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysql',
'....',
'encoding' => 'utf8',
);
in my cake datasource which should execute that statement ever time. I'm kind of puzzled what else I need to make utf8 aware to avoid these question marks..
Brett Zamir
on 2009-06-10 23:15:30
Nope, still not working, as indicated by my test characters...
Brett Zamir (test: ????? )
on 2009-06-10 23:14:34
@Kevin, do you have the "SET NAMES 'UTF8'" going too? (trying a few characters out) ?????
Kevin van Zonneveld
on 2009-06-10 14:46:15
@ Brett Zamir: Good job man! I'm thinking the only place left that could screw us with unicode is mysql. I've changed the table collation to utf8_unicode_ci. Let's see if things improve.
Brett Zamir
on 2009-06-04 01:48:09
Hello ?ukasz (Kevin, a Unicode bug?--otherwise, I can't credit this person for "input by"),
I did modify get_html_translation_table() to keep the order of what PHP returns for that function (and as a result removed the hack within this and other functions for adding & at the end). One catch is that although get_html_translation_table() returns ', the functions we use like htmlspecialchars, return '. But we cannot modify get_html_translation_table() to add ' since that histogram (correctly) is keyed with an apostrophe leading necessarily to only one value (').
So, we have to modify the functions to work with ' as well (which is not a problem really since this is the only numeric character reference in the list (' is XML-only, so it couldn't be used)).
So, I've fixed htmlspecialchars_decode() and html_entity_decode() to work with both ' and ' and also "fixed" htmlspecialchars() and htmlentities() to use ' for output as they do in PHP (without modifying get_html_translation_table() which uses ').
I think that should address all the issues.
?ukasz Czerwi?ski
on 2009-06-03 22:22:14
I have noticed that ' is decoded by html_entity_decode() as ' (apostrophe), but ' isn't!!! (of course when using 'ENT_QUOTES') The same problem is with htmlspecialchars_decode(). I have checked that in PHP decodes both ' and ' I tried to find the code in PHP sources, but they seems to be veery complicated. I have only found a structure that stores several entities - those decoded by htmlspecialchars_decode:
php-5.2.9.tar.bz2/ext/standard/html.c, lines 454-466
static const struct {
unsigned short charcode;
char *entity;
int entitylen;
int flags;
} basic_entities[] = {
{ '"', """, 6, ENT_HTML_QUOTE_DOUBLE },
{ '\'', "'", 6, ENT_HTML_QUOTE_SINGLE },
{ '\'', "'", 5, ENT_HTML_QUOTE_SINGLE },
{ '<', "<", 4, 0 },
{ '>', ">", 4, 0 },
{ 0, NULL, 0, 0 }
};
As you can see, both ' and ' are listed.
In case of JS code of these two functions (in fact I think we should modify get_html_transition_table), the modification is quite complicated...
Kevin van Zonneveld
on 2008-12-31 12:35:26
@ Azriel Fasten: Yes but that would also make it harder for people to just copy 1 function:
http://trac.plutonia.nl/projects/phpjs/wiki/DeveloperGuidelines#DependencyvsRedundancy
The less dependencies the better, but of course we are not about to duplicate the histogram from get_html_translation_table 4 times, so dependencies are already made in this function family.
I think we should probably first come up with the fastest str_replace as possible. And base our decision (Dependency vs Redundancy) on the final algorithm used.
Azriel Fasten
on 2008-12-30 18:05:39
I think that perhaps the replace should be relegated to str_replace, and that function should be highly optimized. Many other parts of the library all use different ways of replacing. These should all use str_replace.
Kevin van Zonneveld
on 2008-12-30 16:56:14
@ Azriel Fasten: You reported a bug by mail, that is exactly the same as the real PHP encountered at one point: http://bugs.php.net/bug.php?id=25707
I've read the bug report more thorough, and applied the same fix as was proposed there.
I put the & entity at the bottom of the histogram.
Faster ways to replace (without using regex) can still be explored.
Kevin van Zonneveld
on 2008-10-20 18:36:56
@ marc andreu: I've revised all of the functions like get_html_translation_table, htmlentities & htmlspecialchars and their decoding counterparts, they now also support your second argument. Thank you!
marc andreu
on 2008-10-15 15:15:33
Hi I needed to deal with secodn parameter of html_entity_decode() funcion, and I added it as follows. I hope to be right, however it's a suggestion. That's all folks.
// {{{ html_entity_decode
function html_entity_decode(string, quote_style ) {
// Convert all HTML entities to their applicable characters
//
// + discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_html_entity_decode/
// + version: 810.621
// + original by: john (http://www.jd-tech.net)
// + input by: ger
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Onno Marsman
// % note: table from http://www.the-art-of-web.com/html/character-codes/
// * example 1: html_entity_decode('Kevin & van Zonneveld');
// * returns 1: 'Kevin & van Zonneveld'
var histogram = {}, histogram_r = {}, code = 0;
var entity = chr = '';
histogram['34'] = 'quot';
histogram['38'] = 'amp';
histogram['60'] = 'lt';
histogram['62'] = 'gt';
histogram['160'] = 'nbsp';
histogram['161'] = 'iexcl';
histogram['162'] = 'cent';
histogram['163'] = 'pound';
histogram['164'] = 'curren';
histogram['165'] = 'yen';
histogram['166'] = 'brvbar';
histogram['167'] = 'sect';
histogram['168'] = 'uml';
histogram['169'] = 'copy';
histogram['170'] = 'ordf';
histogram['171'] = 'laquo';
histogram['172'] = 'not';
histogram['173'] = 'shy';
histogram['174'] = 'reg';
histogram['175'] = 'macr';
histogram['176'] = 'deg';
histogram['177'] = 'plusmn';
histogram['178'] = 'sup2';
histogram['179'] = 'sup3';
histogram['180'] = 'acute';
histogram['181'] = 'micro';
histogram['182'] = 'para';
histogram['183'] = 'middot';
histogram['184'] = 'cedil';
histogram['185'] = 'sup1';
histogram['186'] = 'ordm';
histogram['187'] = 'raquo';
histogram['188'] = 'frac14';
histogram['189'] = 'frac12';
histogram['190'] = 'frac34';
histogram['191'] = 'iquest';
histogram['192'] = 'Agrave';
histogram['193'] = 'Aacute';
histogram['194'] = 'Acirc';
histogram['195'] = 'Atilde';
histogram['196'] = 'Auml';
histogram['197'] = 'Aring';
histogram['198'] = 'AElig';
histogram['199'] = 'Ccedil';
histogram['200'] = 'Egrave';
histogram['201'] = 'Eacute';
histogram['202'] = 'Ecirc';
histogram['203'] = 'Euml';
histogram['204'] = 'Igrave';
histogram['205'] = 'Iacute';
histogram['206'] = 'Icirc';
histogram['207'] = 'Iuml';
histogram['208'] = 'ETH';
histogram['209'] = 'Ntilde';
histogram['210'] = 'Ograve';
histogram['211'] = 'Oacute';
histogram['212'] = 'Ocirc';
histogram['213'] = 'Otilde';
histogram['214'] = 'Ouml';
histogram['215'] = 'times';
histogram['216'] = 'Oslash';
histogram['217'] = 'Ugrave';
histogram['218'] = 'Uacute';
histogram['219'] = 'Ucirc';
histogram['220'] = 'Uuml';
histogram['221'] = 'Yacute';
histogram['222'] = 'THORN';
histogram['223'] = 'szlig';
histogram['224'] = 'agrave';
histogram['225'] = 'aacute';
histogram['226'] = 'acirc';
histogram['227'] = 'atilde';
histogram['228'] = 'auml';
histogram['229'] = 'aring';
histogram['230'] = 'aelig';
histogram['231'] = 'ccedil';
histogram['232'] = 'egrave';
histogram['233'] = 'eacute';
histogram['234'] = 'ecirc';
histogram['235'] = 'euml';
histogram['236'] = 'igrave';
histogram['237'] = 'iacute';
histogram['238'] = 'icirc';
histogram['239'] = 'iuml';
histogram['240'] = 'eth';
histogram['241'] = 'ntilde';
histogram['242'] = 'ograve';
histogram['243'] = 'oacute';
histogram['244'] = 'ocirc';
histogram['245'] = 'otilde';
histogram['246'] = 'ouml';
histogram['247'] = 'divide';
histogram['248'] = 'oslash';
histogram['249'] = 'ugrave';
histogram['250'] = 'uacute';
histogram['251'] = 'ucirc';
histogram['252'] = 'uuml';
histogram['253'] = 'yacute';
histogram['254'] = 'thorn';
histogram['255'] = 'yuml';
// Reverse table. Cause for maintainability purposes, the histogram is
// identical to the one in htmlentities.
for (code in histogram) {
entity = histogram;
histogram_r[entity] = code;
}
var retTemp = (string+'').replace(/(\&([a-zA-Z]+)\;)/g, function(full, m1, m2){
if (m2 in histogram_r) {
return String.fromCharCode(histogram_r[m2]);
} else {
return m2;
}
});
//Add for Marc Andreu Fernadnez. To decode quotes.
// Encode depending on quote_style
if (quote_style == 'ENT_QUOTES') {
retTemp = retTemp.replace('"','"');
retTemp = retTemp.replace(''',"'");
} else if (quote_style != 'ENT_NOQUOTES') {
// All other cases (ENT_COMPAT, default, but not ENT_NOQUOTES)
retTemp = retTemp.replace('"','"');
}
return retTemp;
}// }}}
rekcor
on 2008-06-23 11:58:42
Thanks for the code!
But shouldn't you destroy
tarea
(otherwise we will end up with n numbers of textareas floating around in the DOM's hyperspace)
Kevin van Zonneveld
on 2008-03-20 15:06:39
@lubber: You sure did! And as I said, as soon as php.js supports optional components, I will include them. Thanks again!
lubber
on 2008-03-20 06:43:58
@Kevin: i use these functions to shrink my GET-Parameters in cases where POST wasnt possible (imagine an img-tag which will generate a custom picture and the parameters will exceed the 2048 url-chars limit on IE (that was the case for me)) Anyway, i just wanted to contribute my 2cent for this project :)
Kevin van Zonneveld
on 2008-03-19 16:29:52
@ lubber: Wow that is some awesome code and I will definitely save the links. However, the 2 functions are probably rarely used in JavaScript. That hasn't stopped me before, but in this case the 2 functions alone (72kB) will increase the total project size by 52%. That's a bit to much for now.
However, when php.js gets a page for component customization, I will include the functions and just leave them unchecked by default. Sounds good?
lubber
on 2008-03-19 09:14:28
you can find the javascript equivalents for gz_inflate and gz_deflate here
http://www.onicos.com/staff/iz/amuse/javascript/expert/inflate.txt
http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt
john
on 2008-03-18 01:47:53
ha, sry about that!
Kevin van Zonneveld
on 2008-03-15 23:48:52
@ ger: Aha that was ugly. Thanks for helping us!
ger
on 2008-03-15 22:25:26
heh... I almost sure a can see some js code after the return...; in the function source listed at this page.


More
I'm Henrick Kakutalua, a software engineer who loves to make backend and mobile applications to solve useful and challenging real-world problems. I also love to teach, write technical articles and read life-changing books in my spare time.
Show me moreBOX, developed by NEXT BSS, it's an application where users can buy tickets for parties, movie theaters, and pay for them completely online. BOX is the first platform that provided the truly first way to pay online end-to-end in Angola.
I was fortunate to work with the BOX mobile team, coding features such as ticket transfer, user profile management, connection and sharing to social networks, an Android/iOS Flutter plugin for push notifications, and many other features. I was also responsible for setting up the deployment process to AppStore, as well as fixing issues related to the iOS side of the code.
After this, I also worked with the backend team, developing features related to push notification delivery, ticket authenticity validation with QR, test coverage increase in order to allow refactoring and code improvement.
Roles
Technologies
Moya is a no data cost messaging app developed by biNu.
I helped to write the documentation for their public messaging API. It was an interesting learning experience, with me finally realizing the usefulness of Docker as a way to escape software environment configuration hell, although the deployment was made to GitHub Pages.
Technologies
Are you interested in my services? Or are you just want to leave a message? I'd love to talk with you :-D:.


Includes methods for handling Git Push events
Triggered by PostReceive job
- E
- O
- P
- T
- U
Source: show
# File app/roles/push_observer.rb, line 52 def execute_hooks(data) hooks.each { |hook| hook.execute(data) } end
Source: show
# File app/roles/push_observer.rb, line 56 def execute_services(data) services.each do |service| # Call service hook only if it is active service.execute(data) if service.active end end
Source: show
# File app/roles/push_observer.rb, line 43 def observe_push(data) Event.create( project: self, action: Event::Pushed, data: data, author_id: data[:user_id] ) end
Produce a hash of post-receive data
data = {
before: String, after: String, ref: String, user_id: String, user_name: String, repository: { name: String, url: String, description: String, homepage: String, }, commits: Array, total_commits_count: Fixnum
}
Source: show
# File app/roles/push_observer.rb, line 82 def post_receive_data(oldrev, newrev, ref, user) push_commits = commits_between(oldrev, newrev) # Total commits count push_commits_count = push_commits.size # Get latest 20 commits ASC push_commits_limited = push_commits.last(20) # Hash to be passed as post_receive_data data = { before: oldrev, after: newrev, ref: ref, user_id: user.id, user_name: user.name, repository: { name: name, url: url_to_repo, description: description, homepage: web_url, }, commits: [], total_commits_count: push_commits_count } # For perfomance purposes maximum 20 latest commits # will be passed as post receive hook data. # push_commits_limited.each do |commit| data[:commits] << { id: commit.id, message: commit.safe_message, timestamp: commit.date.xmlschema, url: "#{Gitlab.config.gitlab.url}/#{path_with_namespace}/commit/#{commit.id}", author: { name: commit.author_name, email: commit.author_email } } end data end
Source: show
# File app/roles/push_observer.rb, line 36 def push_to_branch? ref, oldrev ref_parts = ref.split('/') # Return if this is not a push to a branch (e.g. new commits) !(ref_parts[1] !~ %rheads/ || oldrev == "00000000000000000000000000000000") end
This method will be called after each post receive and only if the provided user is present in GitLab.
All callbacks for post receive should be placed here.
Source: show
# File app/roles/push_observer.rb, line 9 def trigger_post_receive(oldrev, newrev, ref, user) data = post_receive_data(oldrev, newrev, ref, user) # Create push event self.observe_push(data) if push_to_branch? ref, oldrev # Close merged MR self.update_merge_requests(oldrev, newrev, ref, user) # Execute web hooks self.execute_hooks(data.dup) # Execute project services self.execute_services(data.dup) end # Create satellite self.satellite.create unless self.satellite.exists? # Discover the default branch, but only if it hasn't already been set to # something else if default_branch.nil? update_attributes(default_branch: discover_default_branch) end end
Source: show
# File app/roles/push_observer.rb, line 128 def update_merge_requests(oldrev, newrev, ref, user) return true unless ref =~ %rheads/ branch_name = ref.gsub("refs/heads/", "") c_ids = self.commits_between(oldrev, newrev).map(&:id) # Update code for merge requests mrs = self.merge_requests.opened.find_all_by_branch(branch_name).all mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked } # Close merge requests mrs = self.merge_requests.opened.where(target_branch: branch_name).all mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) } mrs.each { |merge_request| merge_request.merge!(user.id) } true end