Using Operators¶
An operator represents a single, ideally idempotent, task. Operators determine what actually executes when your DAG runs.
See the Operators Concepts documentation and the Operators API Reference for more information.
- BashOperator
- PythonOperator
- Google Cloud Platform Operators
- GoogleCloudStorageToBigQueryOperator
- GceInstanceStartOperator
- GceInstanceStopOperator
- GceSetMachineTypeOperator
- GcfFunctionDeleteOperator
- GcfFunctionDeployOperator
- CloudSqlInstanceDatabaseCreateOperator
- CloudSqlInstanceDatabaseDeleteOperator
- CloudSqlInstanceDatabasePatchOperator
- CloudSqlInstanceDeleteOperator
- CloudSqlInstanceCreateOperator
- CloudSqlInstancePatchOperator
BashOperator¶
Use the BashOperator
to execute
commands in a Bash shell.
run_this = BashOperator(
task_id='run_after_loop',
bash_command='echo 1',
dag=dag,
)
Templating¶
You can use Jinja templates to parameterize the
bash_command
argument.
also_run_this = BashOperator(
task_id='also_run_this',
bash_command='echo "run_id={{ run_id }} | dag_run={{ dag_run }}"',
dag=dag,
)
Troubleshooting¶
Jinja template not found¶
Add a space after the script name when directly calling a Bash script with
the bash_command
argument. This is because Airflow tries to apply a Jinja
template to it, which will fail.
t2 = BashOperator(
task_id='bash_example',
# This fails with `Jinja template not found` error
# bash_command="/home/batcher/test.sh",
# This works (has a space after)
bash_command="/home/batcher/test.sh ",
dag=dag)
PythonOperator¶
Use the PythonOperator
to execute
Python callables.
def print_context(ds, **kwargs):
pprint(kwargs)
print(ds)
return 'Whatever you return gets printed in the logs'
run_this = PythonOperator(
task_id='print_the_context',
provide_context=True,
python_callable=print_context,
dag=dag,
)
Passing in arguments¶
Use the op_args
and op_kwargs
arguments to pass additional arguments
to the Python callable.
def my_sleeping_function(random_base):
"""This is a function that will run within the DAG execution"""
time.sleep(random_base)
# Generate 10 sleeping tasks, sleeping from 0 to 4 seconds respectively
for i in range(5):
task = PythonOperator(
task_id='sleep_for_' + str(i),
python_callable=my_sleeping_function,
op_kwargs={'random_base': float(i) / 10},
dag=dag,
)
run_this >> task
Templating¶
When you set the provide_context
argument to True
, Airflow passes in
an additional set of keyword arguments: one for each of the Jinja
template variables and a templates_dict
argument.
The templates_dict
argument is templated, so each value in the dictionary
is evaluated as a Jinja template.
Google Cloud Platform Operators¶
GoogleCloudStorageToBigQueryOperator¶
Use the
GoogleCloudStorageToBigQueryOperator
to execute a BigQuery load job.
GceInstanceStartOperator¶
Allows to start an existing Google Compute Engine instance.
In this example parameter values are extracted from Airflow variables.
Moreover, the default_args
dict is used to pass common arguments to all operators in a single DAG.
PROJECT_ID = models.Variable.get('PROJECT_ID', '')
LOCATION = models.Variable.get('LOCATION', '')
INSTANCE = models.Variable.get('INSTANCE', '')
SHORT_MACHINE_TYPE_NAME = models.Variable.get('SHORT_MACHINE_TYPE_NAME', '')
SET_MACHINE_TYPE_BODY = {
'machineType': 'zones/{}/machineTypes/{}'.format(LOCATION, SHORT_MACHINE_TYPE_NAME)
}
default_args = {
'start_date': airflow.utils.dates.days_ago(1)
}
Define the GceInstanceStartOperator
by passing the required arguments to the constructor.
gce_instance_start = GceInstanceStartOperator(
project_id=PROJECT_ID,
zone=LOCATION,
resource_id=INSTANCE,
task_id='gcp_compute_start_task'
)
GceInstanceStopOperator¶
Allows to stop an existing Google Compute Engine instance.
For parameter definition take a look at GceInstanceStartOperator
above.
Define the GceInstanceStopOperator
by passing the required arguments to the constructor.
gce_instance_stop = GceInstanceStopOperator(
project_id=PROJECT_ID,
zone=LOCATION,
resource_id=INSTANCE,
task_id='gcp_compute_stop_task'
)
GceSetMachineTypeOperator¶
Allows to change the machine type for a stopped instance to the specified machine type.
For parameter definition take a look at GceInstanceStartOperator
above.
Define the GceSetMachineTypeOperator
by passing the required arguments to the constructor.
gce_set_machine_type = GceSetMachineTypeOperator(
project_id=PROJECT_ID,
zone=LOCATION,
resource_id=INSTANCE,
body=SET_MACHINE_TYPE_BODY,
task_id='gcp_compute_set_machine_type'
)
GcfFunctionDeleteOperator¶
Use the default_args
dict to pass arguments to the operator.
PROJECT_ID = models.Variable.get('PROJECT_ID', '')
LOCATION = models.Variable.get('LOCATION', '')
ENTRYPOINT = models.Variable.get('ENTRYPOINT', '')
# A fully-qualified name of the function to delete
FUNCTION_NAME = 'projects/{}/locations/{}/functions/{}'.format(PROJECT_ID, LOCATION,
ENTRYPOINT)
default_args = {
'start_date': airflow.utils.dates.days_ago(1)
}
Use the GcfFunctionDeleteOperator
to delete a function from Google Cloud Functions.
t1 = GcfFunctionDeleteOperator(
task_id="gcf_delete_task",
name=FUNCTION_NAME
)
Troubleshooting¶
If you want to run or deploy an operator using a service account and get “forbidden 403” errors, it means that your service account does not have the correct Cloud IAM permissions.
- Assign your Service Account the Cloud Functions Developer role.
- Grant the user the Cloud IAM Service Account User role on the Cloud Functions runtime service account.
The typical way of assigning Cloud IAM permissions with gcloud is shown below. Just replace PROJECT_ID with ID of your Google Cloud Platform project and SERVICE_ACCOUNT_EMAIL with the email ID of your service account.
gcloud iam service-accounts add-iam-policy-binding \
<EMAIL_ADDRESS>\
--member="serviceAccount:[SERVICE_ACCOUNT_EMAIL]" \
--role="roles/iam.serviceAccountUser"
See Adding the IAM service agent user role to the runtime service for details
GcfFunctionDeployOperator¶
Use the GcfFunctionDeployOperator
to deploy a function from Google Cloud Functions.
The following examples of Airflow variables show various variants and combinations of default_args that you can use. The variables are defined as follows:
PROJECT_ID = models.Variable.get('PROJECT_ID', '')
LOCATION = models.Variable.get('LOCATION', '')
SOURCE_ARCHIVE_URL = models.Variable.get('SOURCE_ARCHIVE_URL', '')
SOURCE_UPLOAD_URL = models.Variable.get('SOURCE_UPLOAD_URL', '')
SOURCE_REPOSITORY = models.Variable.get('SOURCE_REPOSITORY', '')
ZIP_PATH = models.Variable.get('ZIP_PATH', '')
ENTRYPOINT = models.Variable.get('ENTRYPOINT', '')
FUNCTION_NAME = 'projects/{}/locations/{}/functions/{}'.format(PROJECT_ID, LOCATION,
ENTRYPOINT)
RUNTIME = 'nodejs6'
VALIDATE_BODY = models.Variable.get('VALIDATE_BODY', True)
With those variables you can define the body of the request:
body = {
"name": FUNCTION_NAME,
"entryPoint": ENTRYPOINT,
"runtime": RUNTIME,
"httpsTrigger": {}
}
When you create a DAG, the default_args dictionary can be used to pass the body and other arguments:
default_args = {
'start_date': dates.days_ago(1),
'project_id': PROJECT_ID,
'location': LOCATION,
'body': body,
'validate_body': VALIDATE_BODY
}
Note that the neither the body nor the default args are complete in the above examples. Depending on the set variables, there might be different variants on how to pass source code related fields. Currently, you can pass either sourceArchiveUrl, sourceRepository or sourceUploadUrl as described in the CloudFunction API specification. Additionally, default_args might contain zip_path parameter to run the extra step of uploading the source code before deploying it. In the last case, you also need to provide an empty sourceUploadUrl parameter in the body.
Based on the variables defined above, example logic of setting the source code related fields is shown here:
if SOURCE_ARCHIVE_URL:
body['sourceArchiveUrl'] = SOURCE_ARCHIVE_URL
elif SOURCE_REPOSITORY:
body['sourceRepository'] = {
'url': SOURCE_REPOSITORY
}
elif ZIP_PATH:
body['sourceUploadUrl'] = ''
default_args['zip_path'] = ZIP_PATH
elif SOURCE_UPLOAD_URL:
body['sourceUploadUrl'] = SOURCE_UPLOAD_URL
else:
raise Exception("Please provide one of the source_code parameters")
The code to create the operator:
deploy_task = GcfFunctionDeployOperator(
task_id="gcf_deploy_task",
name=FUNCTION_NAME
)
Troubleshooting¶
If you want to run or deploy an operator using a service account and get “forbidden 403” errors, it means that your service account does not have the correct Cloud IAM permissions.
- Assign your Service Account the Cloud Functions Developer role.
- Grant the user the Cloud IAM Service Account User role on the Cloud Functions runtime service account.
The typical way of assigning Cloud IAM permissions with gcloud is shown below. Just replace PROJECT_ID with ID of your Google Cloud Platform project and SERVICE_ACCOUNT_EMAIL with the email ID of your service account.
gcloud iam service-accounts add-iam-policy-binding \
<EMAIL_ADDRESS>\
--member="serviceAccount:[SERVICE_ACCOUNT_EMAIL]" \
--role="roles/iam.serviceAccountUser"
See Adding the IAM service agent user role to the runtime service for details
If the source code for your function is in Google Source Repository, make sure that your service account has the Source Repository Viewer role so that the source code can be downloaded if necessary.
CloudSqlInstanceDatabaseCreateOperator¶
Creates a new database inside a Cloud SQL instance.
For parameter definition take a look at
CloudSqlInstanceDatabaseCreateOperator
.
Arguments¶
Some arguments in the example DAG are taken from environment variables:
PROJECT_ID = os.environ.get('PROJECT_ID', 'example-project')
INSTANCE_NAME = os.environ.get('INSTANCE_NAME', 'testinstance')
DB_NAME = os.environ.get('DB_NAME', 'testdb')
Using the operator¶
sql_db_create_task = CloudSqlInstanceDatabaseCreateOperator(
project_id=PROJECT_ID,
body=db_create_body,
instance=INSTANCE_NAME,
task_id='sql_db_create_task'
)
Example request body:
db_create_body = {
"instance": INSTANCE_NAME,
"name": DB_NAME,
"project": PROJECT_ID
}
Templating¶
template_fields = ('project_id', 'instance', 'gcp_conn_id', 'api_version')
CloudSqlInstanceDatabaseDeleteOperator¶
Deletes a database from a Cloud SQL instance.
For parameter definition take a look at
CloudSqlInstanceDatabaseDeleteOperator
.
Arguments¶
Some arguments in the example DAG are taken from environment variables:
PROJECT_ID = os.environ.get('PROJECT_ID', 'example-project')
INSTANCE_NAME = os.environ.get('INSTANCE_NAME', 'testinstance')
DB_NAME = os.environ.get('DB_NAME', 'testdb')
Using the operator¶
sql_db_delete_task = CloudSqlInstanceDatabaseDeleteOperator(
project_id=PROJECT_ID,
instance=INSTANCE_NAME,
database=DB_NAME,
task_id='sql_db_delete_task'
)
Templating¶
template_fields = ('project_id', 'instance', 'database', 'gcp_conn_id',
'api_version')
CloudSqlInstanceDatabasePatchOperator¶
Updates a resource containing information about a database inside a Cloud SQL instance using patch semantics. See: https://cloud.google.com/sql/docs/mysql/admin-api/how-tos/performance#patch
For parameter definition take a look at
CloudSqlInstanceDatabasePatchOperator
.
Arguments¶
Some arguments in the example DAG are taken from environment variables:
PROJECT_ID = os.environ.get('PROJECT_ID', 'example-project')
INSTANCE_NAME = os.environ.get('INSTANCE_NAME', 'testinstance')
DB_NAME = os.environ.get('DB_NAME', 'testdb')
Using the operator¶
sql_db_patch_task = CloudSqlInstanceDatabasePatchOperator(
project_id=PROJECT_ID,
body=db_patch_body,
instance=INSTANCE_NAME,
database=DB_NAME,
task_id='sql_db_patch_task'
)
Example request body:
db_patch_body = {
"charset": "utf16",
"collation": "utf16_general_ci"
}
Templating¶
template_fields = ('project_id', 'instance', 'database', 'gcp_conn_id',
'api_version')
CloudSqlInstanceDeleteOperator¶
Deletes a Cloud SQL instance in Google Cloud Platform.
For parameter definition take a look at
CloudSqlInstanceDeleteOperator
.
Arguments¶
Some arguments in the example DAG are taken from environment variables:
PROJECT_ID = os.environ.get('PROJECT_ID', 'example-project')
INSTANCE_NAME = os.environ.get('INSTANCE_NAME', 'testinstance')
DB_NAME = os.environ.get('DB_NAME', 'testdb')
Using the operator¶
sql_instance_delete_task = CloudSqlInstanceDeleteOperator(
project_id=PROJECT_ID,
instance=INSTANCE_NAME,
task_id='sql_instance_delete_task'
)
Templating¶
template_fields = ('project_id', 'instance', 'gcp_conn_id', 'api_version')
CloudSqlInstanceCreateOperator¶
Creates a new Cloud SQL instance in Google Cloud Platform.
For parameter definition take a look at
CloudSqlInstanceCreateOperator
.
If an instance with the same name exists, no action will be taken and the operator will succeed.
Arguments¶
Some arguments in the example DAG are taken from environment variables:
PROJECT_ID = os.environ.get('PROJECT_ID', 'example-project')
INSTANCE_NAME = os.environ.get('INSTANCE_NAME', 'testinstance')
DB_NAME = os.environ.get('DB_NAME', 'testdb')
Example body defining the instance:
body = {
"name": INSTANCE_NAME,
"settings": {
"tier": "db-n1-standard-1",
"backupConfiguration": {
"binaryLogEnabled": True,
"enabled": True,
"startTime": "05:00"
},
"activationPolicy": "ALWAYS",
"dataDiskSizeGb": 30,
"dataDiskType": "PD_SSD",
"databaseFlags": [],
"ipConfiguration": {
"ipv4Enabled": True,
"requireSsl": True,
},
"locationPreference": {
"zone": "europe-west4-a"
},
"maintenanceWindow": {
"hour": 5,
"day": 7,
"updateTrack": "canary"
},
"pricingPlan": "PER_USE",
"replicationType": "ASYNCHRONOUS",
"storageAutoResize": False,
"storageAutoResizeLimit": 0,
"userLabels": {
"my-key": "my-value"
}
},
"databaseVersion": "MYSQL_5_7",
"region": "europe-west4",
}
Using the operator¶
sql_instance_create_task = CloudSqlInstanceCreateOperator(
project_id=PROJECT_ID,
body=body,
instance=INSTANCE_NAME,
task_id='sql_instance_create_task'
)
Templating¶
template_fields = ('project_id', 'instance', 'gcp_conn_id', 'api_version')
CloudSqlInstancePatchOperator¶
Updates settings of a Cloud SQL instance in Google Cloud Platform (partial update).
For parameter definition take a look at
CloudSqlInstancePatchOperator
.
This is a partial update, so only values for the settings specified in the body will be set / updated. The rest of the existing instance’s configuration will remain unchanged.
Arguments¶
Some arguments in the example DAG are taken from environment variables:
PROJECT_ID = os.environ.get('PROJECT_ID', 'example-project')
INSTANCE_NAME = os.environ.get('INSTANCE_NAME', 'testinstance')
DB_NAME = os.environ.get('DB_NAME', 'testdb')
Example body defining the instance:
patch_body = {
"name": INSTANCE_NAME,
"settings": {
"dataDiskSizeGb": 35,
"maintenanceWindow": {
"hour": 3,
"day": 6,
"updateTrack": "canary"
},
"userLabels": {
"my-key-patch": "my-value-patch"
}
}
}
Using the operator¶
sql_instance_patch_task = CloudSqlInstancePatchOperator(
project_id=PROJECT_ID,
body=patch_body,
instance=INSTANCE_NAME,
task_id='sql_instance_patch_task'
)
Templating¶
template_fields = ('project_id', 'instance', 'gcp_conn_id', 'api_version')


The quality of human Life is diminishing
One of the problems Tech World is now facing
Jan 14, 2015
What are you looking at during the most of your time in a day?
#1. There are two people dating at a restaurant and they use smartphones while eating, without conversation.
#2. A person is busy taking pictures and uploading them to SNS during a trip. He/she does not have enough time to enjoy the scenery there because he/she sees the screen of a smartphone all the time.
#3. A guy who spent 10 hours in front of a computer at work plays mobile game using a smartphone at home until going to bed.
Isn't it similar to our lives? Yes, our eyes are stuck to screens all day long.
In Tech world, quality of human interaction is diminishing
1. Spending more and more time staring at screen
It is surprising to know how many hours per day we spend in front of screens. In addition to TV, the internet and smartphone usage have increased tremendously. Let's look at the chart below that shows average minutes people spend everyday looking at screens. The chart is from Annual State of the Internet presentation by Mary Meeker, who is an internet analyst at Morgan Stanley.
In the United States, people use 147 minutes watching TV, 103 minutes using computers, 151 minutes using smartphones, and 43 minutes using tablets in average. In total, it is 444 minutes which is almost 7.4 hours a day. In addition, you may add extra 7+ hours to this minutes if you work with the computer.
We are forgetting that there are more meaningful ways to spend a day other than staring at screens.
2. Too many interactions, but lack of real contact with people and society
Now, people interact with others all the time via smartphones and internet. However, at the same time, due to using long hours in front of screens, people have less time to interact with each other in person. It is now common staying at home for days or weeks, having no communication with others including family and friends. Even at work, people communicate with coworkers using messangers and emails.
According to Massachusetts Institute of Technology social psychologist Sherry Turkle, PhD,
"People today are more connected to one another than ever before in human history, thanks to Internet-based social networking sites and text messaging. But they’re also more lonely and distant from one another in their unplugged lives. This is not only changing the way we interact online, it’s straining our personal relationships, as well." (American Psychological Association)
The next generation will be more familiar with interacting with computers than with people. Even babies are exposed to screens all around the house and easily from early age, and focus on how to use tech tools.
3. Health Issues
Though technology brought convenience in our lives, we have more workload. Because of flood of information such as tons of emails, SNS posts, subscriptions, and notifications, people get exhausted and stressed out. Even worse, unnecessary works such as filtering email list, managing information, and responding to a lot of requests have added on top of the busy daily schedule, which occupies our time to relax. People may experience burnout more frequently.
When we have free time, we prefer stay in a couch and play online/mobile game not moving much, which leads physical weakness. The growth of online game market infers that people are engaged to play more online games nowadays. There are many studies found a relationship between our health and this screen-centered life style and more and more health issues arise.
How to solve this problem?
It is impossible to live without internet, computers, and smartphones. However, we can take a break by planning making tech-free, smartphone free, or internet free days. There are many blogs that suggest how to spend a day meaningfully without screens. Our brain and eyes need to be free to see other things, not stick to screens. There are apps such as 'Checky' that allow us know how often we check smartphones and how long we spend time on it. In the future, more technologies will be available that protect us from possible problems caused by this life style, and that reduce stress and revitalize tired people. We should always think about what technology is for.


Rich's favorite succulents are ones that look the most unusual. He likes them because they look like alien plants and are drought-tolerant.
| Type | Conditions | Appeal |
|---|---|---|
| Donkey's Tail (Sedum morganianum) | Bright Shade | Yes, please! |
| Spider Aloe (Aloe humilis) | Light Shade | I need one meow. |
| Blue Chalk Sticks (Senecio mandraliscae) | Full Sun | Totally bitchin' |


WARNING: If you actually wish to see the film, stop reading this and see it. While I don't blow any plot details, the more you know about a movie, the more disappointing and built up it becomes (waiting a month to see Titanic did the same thing). But, in a nutshell, it's a good film.
Star Wars episode I: The Phantom Menace Reviewed by Vince Yim
Never having been the biggest Star Wars fanatic in the world (I was more into Star Trek: The Next Generation), it is difficult to relate to the mass fandom surrounding the latest installment, The Phantom Menace. However, it can't be ignored. Endless toys lining the shelves, endless news reports, and a multi-billion dollar advertising campaign makes it all the more difficult. With the level of this hype, one would recall an overhyped disaster from 1998, Godzilla, which definitely failed to live up to expectations.
Thankfully, The Phantom Menace does much, much better.
While the "first" Star Wars trilogy told the story of Jedi Knight Luke Skywalker, the prequels backpedal to tell the back-story of Obi Wan Kenobi and a young Jedi named Anakin Skywalker (who would become the father of Luke and eventually become Darth Vader). Without blowing too much of the story, The Phantom Menace evolves around a peaceful planet Naboo, which is being held hostage by a greedy Trade Federation, and it's up to two Jedi Knights (Qui-Gon Ji, played by Liam Neeson and Obi-Wan Kenobi, played by Ewan McGreggor) to free it.
The Phantom Menace has taken a literal beating from various film critics, leaving me to lower my expectations somewhat. Common complaints range from lack of characterization, weak narrative, poor direction of actors, the dated style, and too much focus over special effects. Still, film critics often apply much historical theory in regards to film criticism, much of which the average film buff does not care for.
Hence, this film is a lot of fun and definitely an improvement over the previous films (even with the "improvements" in the Special Editions). There are many memorable sequences throughout the film, ranging from the fast and furious "pod race" sequence (which is a take on the chariot races in "Ben Hur") and the many fight scenes involving legions of battle droids. Utilizing technology that is light years beyond anything made before, special effects and computers are used to create everything from monsters to robots to amazing cityscapes with incredible detail. No matter how many times you watch this film, you will catch something new.
The level of humour is a bit higher than the previous films as well, mostly conveyed through the reluctant hero Jar Jar Binks, who belongs to a race known as the Gungans. Best described as an Mr. Bean from the planet Naboo, he steals the show. Unfortunately, being that he is a computer-generated character, tells a bit about the direction of the actors (although Natalie Portman as the Queen is pretty effective, as is Jake Lloyd as the young Anakin Skywalker).
With Star Wars mania at an all time high, there is the risk that the film will disappoint (I myself had my doubts), which this film does have a tendency to do at times. There are a few logic problems with the plot, several things are left unchecked, and at times seems to be made only for diehard Star Wars fans (although the appearance of the Tusken Raiders makes for more than a few laughs).
Still, it seems that many people, especially critics, are missing the point. The film is some of the most fun 2 and a half hours that you'll blow in your life, which is something I wouldn't mind doing again. While it may not have the psychological impact of an Academy Award contender, who really cares? The film is pure fun from beginning to end. And isn't that what really matters?
Rating: 8/10
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


assert
messages which are not of type java.lang.String
.
By using a string, more information can be provided to help diagnose the failure
or the reason for the assertion.
Example:
void foo(List<Integer> myList) { assert myList.isEmpty() : false; }
Use the checkbox below to only warn when the assert
message type is boolean
or java.lang.Boolean
.
A boolean
detail message is unlikely to provide additional information about an assertion failure,
and could possibly be the result of a mistakenly entered :
instead of &
.
New in 15


Do you remember learning to ride a bike? I have some recollection. It seemed to take me days to do. Part of that is that I lived on a huge hill. I remember going all the way from my house to the bottom of the hill only to wipe out at the bottom. I still have scars on my knees from it. I remember my dad pushing me. I remember my mom watching. I remember it taking a while.
Yesterday my first one baby took off her training wheels and within 30 min had taught herself to ride her bike. We had tried on a larger bike, but we got one that was a little small and off she went. I’ve never seen someone pick up riding like that before. It was a few little pushes and then off she went. I tried learning to ride a recumbent bicycle and it took me longer to figure that out than it took her to ride this.
Just sharing a proud dad moment. If you ever read this baby I hope you know how proud I am of you. It’s a joy to be your dad!
Ned
Ned visited the witnesses in Steemit Chat a day or two ago. I’ve been a witness for a few months now. I think this is the first time I’ve seen him in there. It’s possible that some communication is happening over other channels, but I happen to prefer the public ones that everyone knows about. So, first off, thanks Ned for communicating with us publicly with a method all the witnesses can get access to without difficulty.
Ned was there looking for folks to comment on the white paper.
https://docs.google.com/document/d/1ggEkauy2XJnt-Z0kkjpz1xmQ7hQnFtKe2g2g3S6ENN8/edit#
There’s been a lot of changes through hard forks so he’s looking to update it. You’ll notice @smooth got to it pretty quickly and thoroughly. I’ve been reading sections as I can, but this weekend I’ll hopefully have some time to check it out.
While I had a chance to directly communicate with him I mentioned-
It’s a pleasure to see him in the public channel.
@ausbitbank asked him about changes to this section of the whitepaper.
In order to realign incentives and discourage individuals from simply voting for themselves, money must be distributed in a nonlinear manner.
He mentioned that flagging was simply a redistribution of the reward pool. I said many recipients of those flags don’t see it that way.
I invited him to speak to the ~5,000 person PALnet Discord community, but sadly he didn’t respond to that.
I invited him to put in a request for the radio show I was running at the time for mspwaves.com/listen. He picked ACDCs thunderstruck for muh 90s rock show. Good pick.
https://www.youtube.com/watch?v=v2AC41dglnM
You may be interested in the fact that Ned recently delegated out almost his entire stake.
Steemit growth, but not mooning
The next two points seem related and currently not correlated. Steem recently surpassed 300k accounts!
I’ve pulled this image from @elyaque’s blog. If you don’t follow it you’re missing out!
So, we’ve hit 300k accounts, but you may have noticed that Steem price continues to linger between $1.25-$1.33.
There have been concerns mentioned in several channels and posts that the change to linear rewards has increased collusion in votes, which have deterred investors from hopping into Steemit. Hopefully linear rewards doesn’t stick around forever. It seems like a backdoor fix to the actual problem which is distribution on the platform. In the meantime we’ll have to rely on large SP holders to find and flag whale collusion.
Time to learn to program
Ok, so, lastly, I’ve wanted to learn to program forever, but I haven’t had a project that has forced me to do it yet. Steemit is that project, so I bought a Raspberry Pi. I figure if I’m going to be a better witness to help Steemit grow I should learn to program. So, I’m going to try to write a few basic programs to interact with Discord and the block. We’ll see what I can come up with, but that should keep me busy. For now I have a Raspberry Pi with Raspbian loaded up and look forward to what may come.
https://cdn.pixabay.com/photo/2017/04/04/18/12/video-game-console-2202618_960_720.jpg
This page is synchronized from the post: ‘Life updates- bikes, Ned, Thunderstruck, steem price, 300k, Raspberry Pi’


Overview
Gets the history log for a process
Summary
This endpoint gets the history log for a process
Request Arguments
| Name |
Type |
Description |
Required |
| filter |
string |
The id of the process trigger sequence (cas_id) |
true |
Response Arguments
| Name |
Type |
Description |
| success |
boolean |
Result of the operation |
| result |
<field>:<value> |
History records |
Response
{
"success":true,
"result":
[
{
"image":"index.php?entryPoint=download\u0026id=0b2dc2f0-2377-11e6-9d2a-6c4008960436\u0026type=SugarFieldImage\u0026isTempFile=1",
"user":"Administrator",
"current_user":"Administrator",
"due_date":"2016-06-03T16:18:59-07:00",
"end_date":"2016-06-01T16:18:59-07:00",
"current_date":"2016-06-02T10:53:14-07:00",
"delegate_date":"2016-06-01T16:18:59-07:00",
"start_date":"2016-06-01T16:18:59-07:00",
"completed":true,
"cas_user_id":"1",
"data_info":"has created Process #2 on the Account record with the event \u0027Start Event # 1\u0027."
},
]
}


| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gauche.generator
- ジェネレータジェネレータは、値の列の生成器となるような、引数を取らない手続きです。
呼ばれる度に列の次の値を返します。列の終端に達した場合はEOFが返されます。
例えば、read-char
は、現在の入力ポートからの入力を一文字づつ返す
ジェネレータと考えることができます。
値の列の生成源を手続きによってジェネレータとして抽象化するのは広く使われるテクニックなので、 このようなジェネレータに共通して使えるユーティリティがあると便利です。 このモジュールはそのために作られました。
ジェネレータは、必要になったら計算を行うようなシステムを簡単に実現でき、 効率も極めて良いですが、副作用に頼った抽象化であることには注意が必要です。 例えば、途中まで列を生成した後に、最初にもどってやり直す、といったことはできません。 より関数的にオンデマンドの計算を行うためには、ジェネレータを使って 構築された、遅延シーケンスを使うのが便利です (遅延シーケンス参照)。
このモジュールを使うと、様々なジェネレータを作って組み合わせることができます。 いずれ、コードのどこかでそういったジェネレータの生成する値を消費することが必要な わけですが、そのために使えるいくつかの組み込み手続きがあります。 生成された値の畳み込みを参照してください。
| 9.8.1 Generator constructors | ||
| 9.8.2 Generator operations |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A generator isn’t a special datatype but just an ordinary procedure, so you can make a generator with lambdas. This module provides some common generator constructors for the convenience.
If you want to use your procedure as a generator, note that a generator can be invoked many times even after it returns EOF once. You have to code it so that once it returns EOF, it keeps returning EOF for the subsequent calls.
The result of generator constructors is merely a procedure,
and printing it doesn’t show much. In the examples in this section
we use generator->list
to convert the generator to the list.
See Generator operations for the description of generator->list
.
An empty generator. Returns just an EOF object when called.
Returns an infinite generator that repeats the given arguments.
(generator->list (circular-generator 1 2 3) 10) ⇒ (1 2 3 1 2 3 1 2 3 1) |
Note that the above example limits the length of list by 10; otherwise
generator->list
won’t return.
Like iota
(See section リストの作成), creates a generator
of a series of count numbers, starting from start
and increased by step.
(generator->list (giota 10 3 2)) ⇒ (3 5 7 9 11 13 15 17 19 21) |
Similar to giota
, creates a generator of a series of
numbers. The series begins with start, increased by step,
and continues while the number is below end.
(generator->list (grange 3 8)) ⇒ (3 4 5 6 7) |
Creates a generator from coroutine.
The proc argument is a procedure that takes one argument,
yield. When called, generate
immediately returns
a generator G. When G is called, the proc runs
until it calls yield. Calling yield causes to suspend
the execution of proc and G returns the value passed
to yield.
Once proc returns, it is the end of the series?G returns eof object from then on. The return value of proc is ignored.
The following code creates a generator that produces a series
0, 1, and 2 (effectively the same as (giota 3)
and binds
it to g
.
(define g (generate (^[yield] (let loop ([i 0]) (when (< i 3) (yield i) (loop (+ i 1))))))) (generator->list g) ⇒ (0 1 2) |
Returns a generator that yields each item in the given argument.
A generator returned from reverse-*
procedures runs in
reverse order.
(generator->list (list->generator '(1 2 3 4 5))) ⇒ (1 2 3 4 5) (generator->list (vector->generator '#(1 2 3 4 5))) ⇒ (1 2 3 4 5) (generator->list (reverse-vector->generator '#(1 2 3 4 5))) ⇒ (5 4 3 2 1) (generator->list (string->generator "abcde")) ⇒ (#\a #\b #\c #\d #\e) |
By default the generator is exhausted once all items are retrieved; the optional start and end arguments can limit the range the generator walks across; start specifies the left bound and end specifies the right bound.
For forward generators, the first value the generator yields is start-th element, and it ends right before end-th element. For reverse generators, the first value is the item right next to the end-th element, and the last value is the start-th element. at the last element, and reverse generators ends at the first element.
(generator->list (vector->generator '#(a b c d e) 2)) ⇒ (c d e) (generator->list (vector->generator '#(a b c d e) 2 4)) ⇒ (c d) (generator->list (reverse-vector->generator '#(a b c d e) 2)) ⇒ (e d c b) (generator->list (reverse-vector->generator '#(a b c d e) 2 4)) ⇒ (d c) (generator->list (reverse-vector->generator '#(a b c d e) #f 2)) ⇒ (b a) |
bits->generator
and reverse-bits->geneator
takes
an exact integer and treat it as a sequence of boolean values
(0 for false and 1 for true), as integer->list
does
(See section srfi-60
- 整数に対するビット操作).
(generator->list (bits->generator #b10110) ⇒ (#t #f #t #t #f) (generator->list (reverse-bits->generator #b10110) ⇒ (#f #t #t #f #t) |
Returns a generator that reads characters or bytes from the given
port, respectively. They’re just (cut read-char input-port)
and (cut read-byte input-port)
, but we provide them for completeness.
A generic version to convert any collection obj to a generator
that walks across the obj. Besides, if obj is an input port,
port->char-generator
is called.
Opens a file filename, and returns a generator
that reads items from the file
by a procedure reader, which takes one argument, an input port.
The arguments open-args are passed to open-input-file
(See section ファイルポート).
The file is closed when the generator is exhausted. If a generator
is abandoned before being read to the end, then the file is kept
open until the generator is garbage-collected. If you want to
make sure the file is closed by a certain point of time, you might want
to use a reader procedure as a generator within the dynamic extent
of with-input-from-file
etc.
Returns a generator that reads a series
of sexps, characters, lines and bytes from a file filename,
respectively. These are versions
of file->generator
specialized by read
,
read-char
, read-line
and read-byte
as the
reader argument.
Like file->generator
, open-args
are passed to open-input-file
(See section ファイルポート).
The file is closed when the generator is exhausted.
A generator constructor similar to unfold (See section SRFI-1 リスト操作関数).
P is a predicate that takes a seed value and determines where to stop. F is a procedure that calculates a value from a seed value. G is a procedure that calculates the next seed value from the current seed value. Tail-gen is a procedure that takes the last seed value and returns a generator that generates the tail.
For each call of the resulting generator, p is called with
the current seed value. If it returns a true, then we see we’ve
done, and tail-gen
is called (if it is given) to get a
generator for the tail. Otherwise,
we apply f on the current seed value to get the value to
generate, and use g to update the seed value.
(generator->list (gunfold (^s (> s 5)) (^s (* s 2)) (^s (+ s 1)) 0)) ⇒ '(0 2 4 6 8 10) |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
See section 生成された値の畳み込み, for generator-fold
,
generator-fold-right
, generator-for-each
and
generator-map
.
Reads items from generator and returns a list of them. By default, this reads until the generator is exhausted. If an optional argument k is given, it must be a nonnegative integer, and the list ends either k items are read, or the generator is exhausted.
Be careful not to pass an infinite generator to this without specifying k?this procedure won’t return but hogs all the memory before crash.
This captures a monadic pattern frequently appears in the generator
code. It is in a similar spirit of and-let*
, but returns
as soon as the evaluating expression returns EOF, instead of #f
as and-let*
does.
The binding part can be either (var expr)
or ( expr )
.
The actual definition will explain this syntax clearly.
(define-syntax glet* (syntax-rules () [(_ () body body2 ...) (begin body body2 ...)] [(_ ([var gen-expr] more-bindings ...) . body) (let1 var gen-expr (if (eof-object? var) var (glet* (more-bindings ...) . body)))] [(_ ([ gen-expr ] more-bindings ...) . body) (let1 var gen-expr (if (eof-object? var) var (glet* (more-bindings ...) . body)))])) |
This is to glet*
as let1
is to let*
. In other words,
it is (glet* ([var expr]) body body2 …)
.
This is a generator version of dolist
and dotimes
(See section 変数束縛).
Gexpr is an expression that yields a generator. It is evaluated once. The resulting generator is called repeatedly until it returns EOF. Every time the generator is called, body … are evaluated in the scope where var is bound to the value yielded from the generator.
Like dolist
and dotimes
, this macro exists for
side-effects. You can write the same thing with for-each
families,
but sometimes this macro makes the imperative code more readable:
(do-generator [line (file->line-generator "filename")] ;; do some side-effecting stuff with line ) |
The following procedures take generators (noted as gen and gen2) and return a generator. For the convenience, they also accept any collection to gen and gen2 parameters; if a collection is passed where a generator is expected, it is implicitly coerced into a generator.
Returns a generator that adds items in front of gen.
(generator->list (gcons* 'a 'b (giota 2))) ⇒ (a b 0 1) |
Returns a generator that yields the items from the first given generator, and once it is exhausted, use the second generator, and so on.
(generator->list (gappend (giota 3) (giota 2))) ⇒ (0 1 2 0 1) (generator->list (gappend) ⇒ () |
Returns a generator that yields a value returned by proc applied on the values from given generators. The returned generator terminates when any of the given generator is exhausted.
NB: This differs from generator-map
(See section 生成された値の畳み込み)
which consumes all
values at once and returns the results as a list, while gmap
returns a generator.
A generator version of map-accum
(See section コレクションに対するマッピング),
mapping with states.
The proc argument is a procedure that takes as many arguments
as the input generators plus one. It is called as
(proc v v2 … seed)
where v
, v2
, … are
the values yielded from the input generators, and seed is the
current seed value. It must return two values, the yielding value
and the next seed.
Returns a generator that yield the items from the source generator, except those who makes pred answers false.
Works the same as (gfilter values (gmap proc gen gen2 …))
,
only slightly efficiently.
This allows stateful filtering of a series. The proc argument must be a procedure that takes a value V from the source generator and a seed value. It should return two values, a boolean flag and the next seed value. If it returns true for the boolean flag, the generator yields V. Otherwise, the generator keeps calling proc, with updating the seed value, until it sees the true flag value or the source generator is exhausted.
The following example takes a generator of oscillating values and yields only values that are greater than their previous value.
(generator->list (gstate-filter (^[v s] (values (< s v) v)) 0 (list->generator '(1 2 3 2 1 0 1 2 3 2 1 0 1 2 3)))) ⇒ (1 2 3 1 2 3 1 2 3) |
The generator version of
take*
and drop*
(See section リストへのアクセスと変更);
gtake
returns a generator that yields (at most) first k items
of the source generator, while gdrop
returns a generator
that skips the first k items of the source generator.
Those won’t complain if the source generator is exhausted before generating
k items. By default, the generator returned by gtake
terminates as the source ends, but if you give a true value to fill?
,
then the returned generator does yield k items, using the
padding value to fill the rest.
The generator version of take-while
and drop-while
(See section リストへのアクセスと変更). The generator returned
from gtake-while
yields items from the source generator
as far as pred returns true for each. The generator returned
from gdrop-while
first reads items from the source generator
while pred returns true for them, then start yielding items.
The gen argument must be, after coerced, a generator that yields characters.
A generator returned from this procedure
tries to match regexp from the character sequence
generated by gen, and once it matches, remember the position after
the match and returns #<rxmatch>
object. If no more match
is found, the generator is exhausted.
($ generator->list $ gmap rxmatch-substring $ grxmatch #/\w+/ "The quick brown fox jumps over the lazy dog.") ⇒ ("The" "quick" "brown" "fox" "jumps" "over" "the" "lazy" "dog") |
Note: This procedure is efficient if gen is a string, in which case we actually bypass coercing it to a generator. If gen is other than a string, the current implementation may need to apply regexp as many times as O(n^2) where n is the entire length of the character sequence generated by gen, although the coefficient is small. This may be improved in future, but be careful using this function on very large input.
Note also that, when gen is not a string, rxmatch is applied
on some buffered partial input. So rxmatch-after
of the returned
match does not represents the whole “rest of input” after the match,
but merely the rest of strings within the buffer.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on May 28, 2012 using texi2html 1.82.


Welcome to Brandon Li's Website
Welcome to my website. I post a bunch of videos, programming, clarinet, and other random topics on here. Feel free to test around with the website, and look at the features on it.
Consider taking a look at my github here full of ton of prgramming projects
Cool Programming Projects I Have Done
- Coppers Odds Shoe Raffle Service. A program I made for managing Shoe Raffles.
- CSV Grapher. A program I made that allows you to graph CSV (Comma Seperated Values).
- King Mammoth Website. The Offical King Mammoth Website dedicated to a Minecraft Modpack. Typed entirely by code!
My Youtube Channel
Consider subscribing to my youtube channel if you want to here.


An andalusian shepherd boy named Santiago who travels from Spain to the Egyptian desert in search of a treasure buried in the Pyramids.
No one knows what the treasure is, or if he will be able to surmount the obstacles along the way. What starts out as a journey to find worldly goods turns into a discovery of the treasure found within.
“My heart is afraid that it will have to suffer,” the boy told the alchemist one night as they looked up at the moonless sky.”
Tell your heart that the fear of suffering is worse than the suffering itself. And that no heart has ever suffered when it goes in search of its dreams.”
“There is only one thing that makes a dream impossible to achieve: the fear of failure.”
“You will never be able to escape from your heart. So it is better to listen to what it has to say.”
"People are capable at any time in their lives, of doing what they dream of. "
1. Fear is a bigger obstacle than the obstacle itself
2. Embrace the present
3. Make the decision
4. Keep getting back up
5. Focus on your own journey
6. Always take action
Paulo Coelho was born on August 24, 1947, in Rio de Janeiro, Brazil. Paulo Coelho wrote the best-selling novel, The Alchemist, which sold 35 million copies and is the most translated book in the world by a living author.


Future Plans¶
Beyond the alpha release, there are some future plans that will be implemented, depending on the time and resources available. These are some of the proposed features that may be included in the beta release in the second release.
Workcell Builder¶
Loading of custom environment objects¶
This feature allows users to upload already existing object_description folders available online, rather than having to always create objects from scratch whenever initializing a scene.
Multi robot support¶
Future updates will support adding multiple robots into the scene
Real Time Visualization of workcell building¶
3D visualization of the workcell will be included in the future for users to be able to visualize real time the changes made while in the GUI.


Ví dụ: The homeless people ___
story appeared in the paper last week have now found a place to live.
A.
who B.
whom C.
that D. whose
The periodic
table contains all the elements, ___ has a particular
atomic weight and atomic number.
A. which of
each B. each of which C. which
each D. each
Dạng này tuy không
khó nhưng nên cẩn thận
để tránh nhầm lẫn.
Ví dụ: That decision of ___ to
repaint the house now was a very smart one.
A.
your B.
you C.
yourself D. yours
With
globalization now a part of our lives, it is impossible for a country to do
business by ___
A.
itself B.
it C. its
own D. it’s self
Dạng 3: Điền giới từ (Preposition) (từ 4-5 câu).
Ví dụ: The company's
new database system will be installed and running ___ the end of the year.
I’m surprised
___ how fast customers get served in this restaurant.
Dạng 4: Điền từ
nối (Connecting words and Adver-Clause
makers) (từ 5-6 câu).
Coordinators:
or, but, so, for, and…
Correlative
Conjunctions: both…and, not only…but also…, either…or…, neither…no…
The human
resources manager hasn’t arrived ___, so please have a seat.
A.
already B.
still C.
soon D. yet
They are not
only good at mathematics ___ good at science.
A. but
also B.
and C.
or D. either
The last company
blood drive was ___ a success that we plan on having one every two months.
Consumers are
spending less these days ___ reports that the economy is steadily improving.
A. in
spite B. because
of C.
although D. despite
Dạng 5: Điền từ
loại (Word form) (từ 14-15 câu).
Ví dụ: With the approach of the
holiday season, employees are ___ awaiting their bonuses.
A.
anxiety B.
anxious C.
anxiousness D. anxiously
My cousin’s ___
advice about selling our stock saved us thousands.
A.
amazingly B.
amazed C. amazing
D. amazement She made me ___ the dishes.
A.
wash B.
washed C.
washing D. have washed
Ví dụ: Employees are ___ to put in
for vacation time at least two months in advance.
A.
requested B.
referred C.
rejected D. reported
In order to get
a ___, you must bring in the defective product with a valid receipt.


Sundowns frustrated by Baroka in goalless draw
Cape Town - Mamelodi Sundowns were made to endure a frustrating evening in the Absa Premiership as they were held to a goalless draw by an obstinate Baroka outfit at the Peter Mokaba Stadium on Wednesday night.
The hosts started the game on the front foot, putting the visiting Sundowns under sustained pressure in the opening 15 minutes of play.
Despite their dominance, Baroka were unable to fashion very many chances, with their only noteworthy chance coming in the 12th minute as Tshediso Patjie forced Downs keeper Denis Onyango into action with a hopeful shot from an acute angle.
Sundowns hit back with a chance of their own six minutes later, but it came to nothing as Tebogo Langerman drilled a left-footed shot into the side netting.
However, the remainder of the first half failed to produce any real goal-scoring chances as both defences held firm.
Sundowns redoubled their efforts after the half-time break, but were forced to resort to long-range efforts as a compact Baroka defence left very little room to manoeuvre.

The visitors continued to prod and probe, and very nearly got the breakthrough they were looking for in the 76th minute after Baroka keeper Elvis Chipezeze spilled Mosa Lebusa's shot back into the danger area. However, the defence was alert to the danger, clearing the ball upfield.
Baroka earned a free-kick in a good position in the 85th minute, just 15 yards outside the box, but the resulting shot on goal by Gerald Phiri flew straight into the defensive wall.
The hosts were reduced to ten men in the 90th minute following Matome Kgoetyane's nasty challenge on Langerman, but there simply wasn't enough time for the visitors to make use of their numerical advantage as they were forced to settle for a share of the points.


BO.io.SoftPot Class
Creates an interface to a SoftPot sensor. A softpot is a type of analog resistive sensor that acts as a type of slider input. There are straight and curved variations. This object provides a number of useful events such as Press, Release, Drag, Tap and capturing Flick gestures. See Breakout/examples/sensors/softpot.html for an example application.
Constructor
BO.io.SoftPot
-
board
-
pin
-
softPotLength
Parameters:
-
board
IOBoardA reference to the IOBoard instance
-
pin
PinA reference to the Pin the softpot is connected to.
-
softPotLength
NumberThe length of the softpot in mm. Default = 100.
Item Index
Methods
Methods
addEventListener
-
type
-
listener
Parameters:
-
type
StringThe event type
-
listener
FunctionThe function to be called when the event is fired
dispatch
()
private
dispatchEvent
-
type
-
optionalParams
Parameters:
-
type
EventThe Event object.
-
optionalParams
ObjectOptional parameters passed as an object. return {boolean} True if dispatch is successful, false if not.
hasEventListener
-
type
Parameters:
-
type
StringThe event type return {boolean} True is listener exists for this type, false if not.
onMove
-
touchPoint
Parameters:
-
touchPoint
NumberThe value where the touch is occuring on the strip
onPinChange
-
evt
Parameters:
-
evt
EventPinEvent.CHANGE
onRelease
()
private
removeEventListener
-
type
-
listener
Parameters:
-
type
StringThe event type
-
listener
FunctionThe function to be called when the event is fired
resetForNext
()
private
Reset whenever you need the next Touch point.
setMinFlickMovement
-
touchPoint
Parameters:
-
touchPoint
NumberThe value where the touch is occuring on the strip
setRange
-
minimum
-
maximum
Scale from the minimum and maximum input values to 0.0 -> 1.0.
Parameters:
-
minimum
NumberThe minimum value
-
maximum
NumberThe maximum value
startTouch
()
private
Properties
distanceFromPressed
Number
The current distance from the press point.
minDragMovement
Number
The minimum distance required to trigger a drag event. Change this value to fine tune the drag response.
minFlickMovement
Number
The minimum distance required to trigger a flick event. Change this value to fine tune the flick gesture.
minValue
Number
The minimum value required to set the Release state. This number should be as close to zero as possible. Increase this value if you are noticing fluttering between the Pressed and Released states. Default value = 0.01;
tapTimeout
Number
The maximum time (in milliseconds) between a press and release in order to trigger a TAP event.
value
Number
The current value.
Events
softPotDrag
BO.io.SoftPotEvent.DRAG
The softPotDrag event is dispatched when a drag is detected along the length of the softpot sensor.
Event Payload:
-
target
BO.io.SoftPotA reference to the SoftPot object
softPotFlickDown
BO.io.SoftPotEvent.FLICK_DOWN
The softPotFlickDown event is dispatched when a flick gesture is detected in the direction away from the sensor pins.
Event Payload:
-
target
BO.io.SoftPotA reference to the SoftPot object
softPotFlickUp
BO.io.SoftPotEvent.FLICK_UP
The softPotFlickUp event is dispatched when a flick gesture is detected in the direction of the sensor pins.
Event Payload:
-
target
BO.io.SoftPotA reference to the SoftPot object
softPotPressed
BO.io.SoftPotEvent.PRESS
The softPotPressed event is dispatched when pressure is applied to the softpot surface.
Event Payload:
-
target
BO.io.SoftPotA reference to the SoftPot object
softPotReleased
BO.io.SoftPotEvent.RELEASE
The softPotReleased event is dispatched when pressure is released from the softpot surface.
Event Payload:
-
target
BO.io.SoftPotA reference to the SoftPot object
softPotTap
BO.io.SoftPotEvent.TAP
The softPotTap event is dispatched when a press and release occurs in in less than the duration specified by the tapTimeout property.
Event Payload:
-
target
BO.io.SoftPotA reference to the SoftPot object


Candy is all about sugar and colours. This sweet stuff is mouthwatering.
Our collection of sweet sweets is colourfull and mouthwatering. If you are into sugary treats, check out our top sellers selction of the month.
These combine yummy soft chewy candy with sour gooey deliciousness! They come in different flavors.
Delightful and yummy cotton candy in units. They come in two flavors.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse non aperiam cupiditate sit illo.


Welcome to STS Visualization Tool (1D)!
This is a webpage for visualizing event traces. It's especially useful for debugging non-deterministic replays by comparing the timings of different replay runs.


| In week 2, we learned how to build 3D models with Fusion 360. Basically, it is drawing a 2D sketch first and then extruding it in different ways to make it 3D. | The first task is to build 6 models from the 50 blueprints given. They are pretty basic and can be finished easily by extruding one or several blueprints from various planes. | The second task is to build a 3D model of a hinge. It is more difficult since it requires the measurement of its parts to be the same, but it can be solved by fixing the diameter of cylinders used. Click here to download the original file. | The assembled hinge looks like this. All parts fit each other while leaving a small space for movement. Every part in the middle of this hinge uses Revolve when creating the model, and the two flat parts use Extrude method. The part of building the model was pretty easy except that I needed to play around with the dimensions a bit to find a value that makes the hinge look nice. In this project, I learned how to assemble all the separated parts in Fusion 360 together. I needed to convert all models into what the software calls "part". After that, I would be able to use the Assemble method, click two parts, and make them attach to each other. |
|---|


Want to make the most of your education benefits while you are still in the military? We deliver high quality content for serious learners aiming to get a head start before they start using G.I. Bill benefits. Learn how to take advantage of credit by examination opportunities that are free to Active Duty Military members and see how these credits fit into respected degree programs with high accreditation standards.
Want to make the most of your education benefits while you are still in the military? We deliver high quality content for serious learners aiming to get a head start before they start using G.I. Bill benefits. Learn how to take advantage of credit by examination opportunities that are free to Active Duty Military members and see how these credits fit into respected degree programs with high accreditation standards.
Here are some of the most commonly transferable CLEP courses that will meet general education requirements and beyond at a large number of universities.
| MICROECONOMICS | MACROECONOMICS | INTRO PSYCHOLOGY | INTRO SOCIOLOGY |
| BIOLOGY | CHEMISTRY | ALGEBRA | CALCULUS |
| COLLEGE COMPOSITION | ENGLISH LITERATURE | US HISTORY 1&2 | WESTERN CIV 1&2 |
| MANAGEMENT PRINCIPLES | MARKETING PRINCIPLES | FINANCIAL ACCOUNTING | BUSINESS LAW |
Here is a sample guide detailing how to knock out 45 credits towards an AACSB accredited business degree from a well known university. To see which university this plan applies to and find similar guides for other universities, please fill out the form at the bottom.
| CLEP EXAM | EQUIVALENT | PASSING SCORE | CREDITS |
|---|---|---|---|
| MICROECONOMICS | ECON 103 | 50 | 3 |
| MACROECONOMICS | ECON 104 | 50 | 3 |
| GENERAL CHEMISTRY | CHEM 101&102 | 50 | 6 |
| US HISTORY 1&2 | HIST 150&151 | 50 | 6 |
| WESTERN CIV 1&2 | HIST 100&101 | 50 | 6 |
| CALCULUS | MATH 127 | 50 | 3 |
| AMERICAN GOV'T | POLSC 101 | 50 | 3 |
| INTRO PSYCHOLOGY | PSY 100 | 50 | 3 |
| COLLEGE COMPOSITION | ENGL WRIT 112 | 50 | 3 |
| BIOLOGY | SCIENCE ELECTIVE | 50 | 6 |
| HUMAN GROWTH & DEVELOPMENT | PSYCH 350 | 50 | 3 |
If you have any questions or want a free preview of our educational plans, please fill out this form and we will be in touch.


Open-loop steering articulated
This example simulates an articulated vehicle with an open loop sinusoidal steering input.
Contents
Simulation models and parameters
First, all classes of the package are imported with
clear ; close all ; clc import VehicleDynamicsLateral.*
Tire and vehicle model
Choosing tire and vehicle model. In this case, the parameters are defined by the user.
% Choosing tire TireModel = TirePacejka(); TireModel.a0 = 1; TireModel.a1 = 2; TireModel.a2 = 700; TireModel.a3 = 5000; TireModel.a4 = 80; TireModel.a5 = 0; TireModel.a6 = 0; TireModel.a7 = 0.6; % Choosing vehicle VehicleModel = VehicleArticulatedNonlinear(); VehicleModel.mF0 = 5200; VehicleModel.mR0 = 2400; VehicleModel.mF = 6000; VehicleModel.mR = 10000; VehicleModel.mM = 17000; VehicleModel.IT = 46000; VehicleModel.IS = 450000; VehicleModel.lT = 3.5; VehicleModel.lS = 7.7; VehicleModel.c = -0.3; VehicleModel.nF = 2; VehicleModel.nR = 4; VehicleModel.nM = 8; VehicleModel.wT = 2.6; VehicleModel.wS = 2.4; VehicleModel.muy = 0.8; VehicleModel.deltaf = 0; VehicleModel.Fxf = 0; VehicleModel.Fxr = 0; VehicleModel.Fxm = 0; % The System is completely defined once we atribute the chosen tire model % to the vehicle object. VehicleModel.tire = TireModel;
Simulation parameters
Choosing simulation time span
T = 10; % Total simulation time [s] resol = 80; % Resolution TSPAN = 0:T/resol:T; % Time span [s]
Open-loop steering input
Single period sine wave with:
delta_amplitude = 15*pi/180; % Steering input amplitude [rad] T_period = 3; % Steering single period [s] freq = 1/T_period; % Steering frequency [Hz] delta_freq = freq*2*pi; % Steering frequency [rad/s] % End input index sine_index = find(TSPAN == T_period); % Defining steering input VehicleModel.deltaf = [delta_amplitude*sin(delta_freq*TSPAN(1:sine_index)) zeros(1,length(TSPAN)-sine_index)]; figure hold on ; grid on ; box on plot(TSPAN,VehicleModel.deltaf*180/pi,'r','linewidth',2) xlabel('Time [s]') ylabel('Steering angle [deg]')
Run simulation
To define a simulation object (simulator) the arguments must be the vehicle object and the time span.
simulator = Simulator(VehicleModel, TSPAN);
Initial conditions Changing initial conditions of the simulation object
simulator.V0 = 40/3.6; % Initial velocity [m/s]
To simulate the system we run the Simulate method of the simulation object.
simulator.Simulate();
Results
% Retrieving states YT = simulator.YT; PSI = simulator.PSI; PHI = simulator.PHI; dPSI = simulator.dPSI; dPHI = simulator.dPHI; figure subplot(3,1,1) hold on ; grid on ; box on plot(TSPAN,PSI,'b','linewidth',2) plot(TSPAN,PHI,'g','linewidth',2) ylabel('Angle [deg]') xlabel('Time [s]') legend('PSI','PHI') subplot(3,1,2) hold on ; grid on ; box on plot(TSPAN,YT,'b','linewidth',2) ylabel('Position [m]') xlabel('Time [s]') subplot(3,1,3) hold on ; grid on ; box on plot(TSPAN,dPSI,'b','linewidth',2) plot(TSPAN,dPHI,'g','linewidth',2) ylabel('Anglular velocity [deg/s]') xlabel('Time [s]') legend('dPSI','dPHI') g = Graphics(simulator); g.TractorColor = 'r'; g.SemitrailerColor = 'g'; g.Frame(); g.Animation(); % g.Animation('html/OpenLoopSteeringArticulated'); % Uncomment to save animation gif


{{countCol "actors" "id"}} Actors;
{{countCol "miner_heads" "addr"}} Miners;
{{netPower "slashed_at = 0" | sizeStr}} Power
({{netPower "" | sizeStr}} Total;
{{netPower "slashed_at > 0" | sizeStr}} Slashed)
{{count "messages"}} Messages; {{count "actors"}} state changes
{{count "id_address_map" "id != address"}}
Keys;
E% FIL in wallets; F% FIL in miners; M% in market; %G Other actors; %H FIL it treasury
{{$maxH := queryNum "select max(height) from blocks inner join blocks_synced bs on blocks.cid = bs.cid"}}
{{count "blocks"}}
Blocks; Current Height: {{$maxH}};


7 types derived from AuthenticatingWSManCommand
Microsoft.WSMan.Management (7)
InvokeWSManAction.cs (1)
27
public class InvokeWSManActionCommand :
AuthenticatingWSManCommand
, IDisposable
PingWSMan.cs (1)
26
public class TestWSManCommand :
AuthenticatingWSManCommand
, IDisposable
WSManConnections.cs (1)
127
public class ConnectWSManCommand :
AuthenticatingWSManCommand
WSManInstance.cs (4)
32
public class GetWSManInstanceCommand :
AuthenticatingWSManCommand
, IDisposable
688
public class SetWSManInstanceCommand :
AuthenticatingWSManCommand
, IDisposable
1061
public class RemoveWSManInstanceCommand :
AuthenticatingWSManCommand
, IDisposable
1327
public class NewWSManInstanceCommand :
AuthenticatingWSManCommand
, IDisposable


| Expected | Actual |
|---|---|
|
11
|
|
|
true
|
|
|
2
|
|
|
8
|
|
|
8
|
|
|
Hello there
|
|
|
23
|
|
|
83
|
|
|
83
|
|
|
0
1
a
1
2
b
2
3
c
|
|
|
0
1
a
1
2
b
2
3
c
|
|
|
show me
|
show me
dont show me
or me
|
|
This is an included template
|
|


Protocol
SubscriptionType
public protocol SubscriptionType
Abstraction over subscription types from reactive frameworks. This abstraction uses concept similar to type-erasure or protocol witness pattern, wrapping the behaviour of concrete implementations and delegating to them once the wrapper funcions are called.
Requirements
unsubscribe()
func unsubscribe()
Stops the observation and clean up all resources


EEG and CV Emotion Classification
Status
{% if eeg_valid %}
EEG File Uploaded
{% else %}
EEG File Not Uploaded
{% endif %} {% if cv_valid %}
CV File Uploaded {% else %}
CV File Not Uploaded {% endif %}
Model Frequency: {{label_freq}} Hz
Power Channel: {{power_channel}}
EEG Model: {{eeg_name}}
CV Model: {{cv_name}}
Clear Session
Upload Files
File Name...
Submit File
Run Models
Parameters
Model Frequency
Power Channel Display
EEG Model
Default
Random
???
CV Model
Default
Random
???


08: Absolute and relative paths
Using ls ..
allows us to refer to a directory relative to where we are now. You can also always refer to a directory based on its absolute location. E.g. if you are working in the /home/learner/learning_unix
directory and you then want to list files in the /tmp
directory, then you could do either of the following:
learner@:learning_unix$ ls ../../../tmp
or...
learner@:learning_unix$ ls /tmp
They both achieve the same thing, but the 2nd example requires that you know about the full path from the root level of the computer to your directory of interest (the 'path' is an important concept in Unix).
Note the leading /
in the second command. A leading slash is what differentiates an absolute path from a relative path.
Try navigating to your home directory with the cd
command. Then try the following two commands:
learner@:~$ls /home/learner/
learner@:~$ls home/learner/
The first command says go the learner
directory that is beneath the home
directory that is at the top level (the root) of the file system. There can only be one /home/learner
directory on any Unix system. The second command says go to the learner
directory that is beneath the home
directory that is located wherever I am right now.
The second command doesn't work. It gives an error No such file or directory
. Make sure you understand why the second command gives an error.


Term2 - 2021 Team Ladder from 27/04/2021 to 28/04/2021 |
|||
|---|---|---|---|
| Rank | Team | Score Ratio | Games |
| 1 | Pew Pew Predators | 112.7% | 4 |
| 2 | Power Rangers | 104.1% | 4 |
| 3 | Team Sauce | 94.6% | 3 |
| 4 | Laser Buddies | 88.6% | 3 |
| 5 | Spare Team | 83.3% | 1 |
This report ranks teams. The report has been limited to games from 27/04/2021 to 28/04/2021.
Term2 - 2021 Solo Ladder from 27/04/2021 to 28/04/2021 |
||||||||
|---|---|---|---|---|---|---|---|---|
| Rank | Player | Team | Average Score | Average Rank | Score Ratio | Games | ||
| 1 | Packing | Laser Buddies, Spare Team | 11212 | 2.3 | 147% | 4 | ||
| 2 | Camsta | Pew Pew Predators | 10899 | 3.0 | 138% | 4 | ||
| 3 | Molten | Power Rangers, Pew Pew Predators, Spare Team | 10389 | 4.3 | 130% | 3 | ||
| 4 | M2Sloter | Power Rangers | 9680 | 5.8 | 125% | 4 | ||
| 5 | Invictus | Team Sauce | 8902 | 5.3 | 118% | 3 | ||
| 6 | Bigfish | Pew Pew Predators | 8832 | 6.5 | 112% | 4 | ||
| 7 | Strik3r | Team Sauce, Spare Team | 8074 | 7.3 | 108% | 4 | ||
| 8 | BROCKER | Power Rangers, Team Sauce | 8356 | 6.4 | 107% | 5 | ||
| 9 | Syriical | Power Rangers | 7865 | 9.0 | 104% | 3 | ||
| 10 | Browny | Team Sauce, Pew Pew Predators | 7851 | 8.2 | 101% | 5 | ||
| 11 | Reign | Power Rangers | 7762 | 8.8 | 101% | 4 | ||
| 12 | Whippet | Pew Pew Predators | 7842 | 7.7 | 99% | 3 | ||
| 13 | dptdumb | Pew Pew Predators | 7299 | 9.3 | 92% | 4 | ||
| 14 | ZoneCub | Laser Buddies | 6761 | 9.3 | 91% | 3 | ||
| 15 | Vexim | Laser Buddies | 6358 | 9.0 | 85% | 3 | ||
| 16 | Fizz | Team Sauce | 6128 | 10.0 | 82% | 3 | ||
| 17 | Xenasni | Laser Buddies, Spare Team | 5731 | 12.0 | 75% | 4 | ||
| 18 | Skyros | Team Sauce | 5461 | 11.3 | 72% | 3 | ||
| 19 | Echo | Power Rangers | 5306 | 11.0 | 68% | 4 | ||
| 20 | Whatzee | Laser Buddies, Team Sauce, Spare Team | 4015 | 13.2 | 52% | 5 |
This report ranks individual players. Tag Ratio is the number of people you shot divided by the number of people that shot you. Score ratio is your score in each game divided by the average score for that game. TR x SR is tag ratio multiplied by score ratio. The report has been limited to games from 27/04/2021 to 28/04/2021. Players are ranked on their average score ratio.
Term2 - 2021 Games for 28/04/2021 |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Game | Team | Score | Team | Score | Team | Score | ||||||
| 7:11 PM | Pew Pew Predators | 52359 | Team Sauce | 35698 | Power Rangers | 31946 | ||||||
| 7:30 PM | Power Rangers | 45100 | Pew Pew Predators | 40638 | Laser Buddies | 32116 | ||||||
| 7:47 PM | Team Sauce | 40847 | Pew Pew Predators | 37587 | Laser Buddies | 32976 | ||||||
| 8:05 PM | Pew Pew Predators | 47968 | Power Rangers | 42088 | Spare Team | 34598 | ||||||
| 8:23 PM | Power Rangers | 42328 | Laser Buddies | 33466 | Team Sauce | 29685 |
This is a list of games. Each row in the table is one game. Across each row, you see the teams that were in that game (with the team that placed first listed first, and so on), and the score for each team.


"x" "1" "ADAM,W, HAUER,H, MOSANDL,T, SAHA-MOELLER,CR, WAGNER,W AND WILD,D,FUROCOUMARIN-, NAPHTHOFURAN-, AND FUROQUINOLINE-ANNULATED 1,2-DIOXETANES:SYNTHESIS, THERMOLYSIS, AND MUTAGENICITY, LIEBIGS ANN. CHEM. ( __ 12):1227-1236,1990"


{% extends "base/page_centered.html" %} {% load i18n %} {% block extra_styles %} {{block.super}} .content p, .content form { margin-left: 20px; } {% endblock %} {% block page_title %}Register for an Account{% endblock %} {% block main_content %}
To register for an account, please create a username and password below, and enter a valid email address. After submitting the form, you will receive a verification email confirmation, with instructions telling you what to do next.
{% endblock %}


Check-in
Please enter the following details
Reservation Number
Given Name
Family Name
Email Address
Submit


5
New Messages
Ernest Kerry
Can we Meet?
Just Now
New
John
Dont forgot to call...
5 minutes ago
New
Wilton Zeph
If there is anything else …
14/10/2014 1:31 pm
New
Jenny Kerry
Let me know when you free
5 days ago
New
Tony
Let me know when you free
5 days ago
New
View All messages
4
You Have 4 Tasks
Design some buttons
20%
20% Complete
Create a nice theme
40%
40% Complete
Some task I need to do
60%
60% Complete
Make beautiful transitions
80%
80% Complete
View All Tasks
0
9
You have 9 notifications
John Doe
5 members joined today
Just now
Tony
likes a photo of you
5 min
John
Dont forgot to call...
11 min
Jenny Kerry
Very long description here...
1 Hour
Ernest Kerry
2 members joined today
3 Days
View All Notifications
Natali
Nataliapery
My Profile
Account Settings
Lock
Logout


In this section, we have a collection of requested videos from Youtube subscribers and Twitter followers. These are one off projects that aren't in any video collection.
In this video we will look at how we can get real time stock market data and use that stock market data to determine the volatility of the stock -- and send us an alert to act!
In this video we'll cover how to create cartesian products in Python with a brief example. Cartesian products just take n sets and create a product set of every possible combination of the elements in the n sets. We'll cover how to do this programmatically.


Random Quote Generator
Often we need some inspiration and motivation to get through a day
new Quote
Tweet


dimension¶
This module contains the class Dimension, which describes the dimension information of the search space.
- Author:
- Yu-Ren Liu
-
class
dimension.
Dimension
(size=0, regs=[], tys=[], order=[])[source]¶ This class describes the dimension information of the search space.
-
__init__
(size=0, regs=[], tys=[], order=[])[source]¶ Initialization.
Parameters: - size – dimension size
- regs – search space of each dimension
- tys – continuous or discrete for each dimension
- order – this parameter matters if this dimension is discrete, it means this dimension has partial order relation
-
is_discrete
()[source]¶ Whether the search space of all dimensions is discrete.
Returns: True or False
-
static
judge_match
(size, regs, tys)[source]¶ Check if the size of regs and tys are both the same as self._size.
Returns: True or False
-
limited_space
()[source]¶ Judge if the dimension described search space is limited.
Returns: return True and the number of dimension value if each dimension is discrete. Otherwise, return False and zero
-


A new version of the Commit Live is available!
Download the latest version
here
Quit the Commit Live
Run the new installer
Ok
You're up to date!
Close


Hyperplanes and classification
1. Hyperplanes
Consider a set of $d+1$ points in $\mathbb{R}^{d}$ dimensions and assume that no group of three points is collinear- this way, any set of $d$ points forms a hyperplane. Firstly, we shall demonstrate that if a set of $d$ points is shattered in $\mathbb{R}^{d-1}$ dimensions, then $d+1$ points are also shattered in $\mathbb{R}^d$. We can use this to reduce the problem to two dimensions, where we have seen that $VC_{\text{dim}}=3$.
Consider the representation in the picture below. Choose $d$ points and take the hyperplane formed by these. If the remaining point belongs to the hyperplane, then we can consider the projection to $d-1$ dimensions, and we are left with the case of $(d-1)+2$ points in $\mathbb{R}^{d-1}$, which we shall analyze later. If this is not the case, then we can show that if the $d$ points on the hyperplane are separable, we can always find a hyperplane in $\mathbb{R}^d$ that separates all the points. In the figure below, the dashed line on $H_d$ represents the hyperplane in $\mathbb{R}^{d-1}$ that separates the set of $d$ points. It is easy to see that any hyperplane that contains the remaining point and the dashed line (hyperplane in one lower dimension) is the solution to this problem.
We shall consider now the case of $d+2$ points in $\mathbb{R}^d$. For this purpose, we shall use Radon’s theorem that states that any set of $d+2$ points in $\mathbb{R}^d$ can be partitioned in two sets $X_1$ and $X_2$ such that the corresponding convex hulls intersect. This theorem implies that $d+2$ points in $\mathbb{R}^d$ cannot be shattered because if they were, then we would have two non-intersecting convex hulls separated by a plane, thus contradicting the theorem.
Proof
For $d+2$ points $x_i$ in $\mathbb{R}^d$ one can always choose $d+2$ parameters $\alpha_i$ such that:
\[\sum_{i=1}^{d+2}\alpha_ix_i=0,\;\; \sum_{i=1}^{d+2}\alpha_i=0\]The reason is because one has $d+2$ unknowns ($\alpha_i$) for $d+1$ equations ($d$ coming from the first vector equation and an additional from the constraint on $\alpha$). The second equation can be rewritten as a sum over positive $\alpha_{>}$ and negative $\alpha_{<}$, that is, $\sum_{i}\alpha_i^{>}=\sum_{i}\alpha_i^{<}$. Define $\alpha=\sum_i\alpha_i^{>}$, then we have
\[\sum_i\frac{\alpha_i^{>}}{\alpha}=\sum_i\frac{\alpha_i^{<}}{\alpha}\]which is a sum over numbers in the interval $(0,1]$. The vector equation separates into two terms
\[\sum_{i}\frac{\alpha_i^{>}}{\alpha}x_i=\sum_i\frac{\alpha_i^{<}}{\alpha}x_i\]and each of the sets $X_1={x_i: \alpha_i^{>}\neq 0}$ and $X_2={x_i: \alpha_i^{<}\neq 0}$ form convex hulls. This means that $X_1$ and $X_2$ intersect.
References
[1] Foundations of machine learning, M. Mohri, A. Rostamizadeh, A. Talwalkar


Toggle navigation
Menu
Battery Saver
Status
Settings
Contact
Off
Charging:
Current Level:
Max Threshold:
Min Threshold:
Save
Developed With Love
By
Dawood Ikhlaq
daudmalik06@gmail.com


Download the library and get started now
The Readium.js API will make it easy to use EPUB 3 in your project


Head Blacksmith Ferris:
Ah, the Blood Dragon! Shall we trade? I will exchange a Blood Dragon for 5 Blood Basilisks and 5 blood succubi... What do you think? Or perhaps you would prefer a game of chance? That would be fine with me! I am very good at this game...
Accept exchange rate
Play game. [Guess correctly in 2 tries - 4 Blood Basilisks]
Play game. [Guess correctly in 3 tries - 8 Blood Basilisks]
Play game. [Guess correctly in 4 tries - 9 Blood Basilisks]
Explanation of game


Initiated and directed through a 2010 Congressional Appropriation, the NASA Carbon Monitoring System (CMS) is a forward-looking initiative designed to make significant contributions in characterizing, quantifying, understanding, and predicting the evolution of global carbon sources and sinks through improved monitoring of carbon stocks and fluxes.
NASA.gov
Our Work in Maryland
Project Deliverables
Tiled and mosaicked canopy height and forest/non-forest maps at 2 m and 30 m resolution for Maryland
Aboveground Biomass (AGBM) maps at 30 m resolution with associated uncertainty maps for Maryland Counties and Addison County
ED-model based carbon and carbon-flux maps at 90 m resolution for Maryland
ED-model maps of carbon sequestration potential for Maryland under various climate change scenarios
SPL canopy height map for Alleghany County and derived biomass
Demonstration of a web-based data visualization and query system
Assessment of main sources of error and proposed strategies for reducing errors in future deployment of an operational CMS


 Don’t miss it, it runs just over 7 minutes and your purchase includes the mp3 audiobook recorded on a Telefunken AR-51 and digitally mastered by the experts at Erotic Habit. You will also receive a hot HD photo of Vanessa as well as the ebook.
Model Photo Editing(see before/afters)
Product Photo Editing (see before/afters)
Product Photography (see before/afters or just afters)
$5.99
inquire within


Most of history is passed orally.
5 Regions:
Great Plateau (40% of land) underneath Sahara --> Great Rift Valley (East)
Mountains:
--> Coastal Plain (West)
Rivers: Niger and Zaire
3000 B.C. --> Sudan
Similar to Egypt:
Became Kush in 2000 B.C.
Ruled by Egyptians for 500 years
--> Gained Independence through trade in 1000 B.C.
King Piankhi (724 B.C) --> Defeated Egyptians.
Both are directly in trade routes
671 B.C Assyrians defeated Kushites with Iron
Forced to move to Upper Nile (Meroe).
Later (521 B.C.) Axum would invade from Red Sea.
In 200 B.C
Sent things to Adulis (Capital)
Axum's main trade was IVORY
2 Syrians shipwrecked --> Converted King Ezana.
330 A.D. --> Christianity is official
Menelik said he was son of Solomon and Sheba
It was caused by:
The Western NOK 700-200 B.C --> Niger and Benue River.
Farmers used iron tools --> Land Scarce
Small groups began to migrate from West --> Somewhere else
They settled in
Divided into 100s of ethnic groups.
1000 A.D --> Closely knit communities
Jobs are preset --> Age Sets stayed
North --> Arab World South --> Persian, Indian, European
300 --> 1200 A.D Had access to gold and salt mines
Peaked at 800-900 A.D.
Were attacked by the Almoravids 1000 A.D.
IMPORTANT: IT IS LOCATED ON THE WEST
Broke from Ghana
Sundiata Keita --> King 1235 A.D.
Greatest King: Mansa Musa 1312-1332
All of these:
500 A.D.
900 A.D
1200 A.D -- Small coastal cities became thriving ones
The iron mined from last 3
1300 A.D. -- Blending of Cultures
Inland Kingdoms --> Copper, Gold
The people of Karanga --> Zambezi and Limpopo river


## Object oriented programing
with
## PHP
### Things to learn
2. OOP Basic
3. OOP Advance
1. Design Pattern
#### Definitition
Object-oriented programming (OOP) is a **programming paradigm** based on the concept of "**objects**", which are data structures that contain data, in the form of fields, often known as **attributes**; and code, in the form of procedures, often known as **methods**.
- **Objects**
- Everything is an object
- **Attributes**
- They are the property of the object
- For a "Dog" object it'd be height, age
- **Methods**
- Actions that an object can take.
- For a "Dog" object it'd be walk, bark
#### Simple Example
```
class SimpleClass
{
// property/attribute declaration
public $var = 'a default value';
// method declaration
public function displayVar() {
echo $this->var;
}
}
// Run this code
$sc = new SimpleClass();
echo $sc->displayVar();
// will print 'a default value'
```
#### DOG Example
```php
class Dog{
public $age;
public $color;
public $height;
public $weight;
public function __construct($color, $age, $height, $weight){
$this->age = $age;
$this->color = $color;
$this->height = $height;
$this->weight = $weight;
}
public function walk() {echo "I walked";}
public function bark() {echo "Woof! I am {$this->age} years old and a {$this->color} dog\n";}
}
```
```PHP
$my_dog = new Dog('Brown', 10, 2.0, 20.0);
$friends_dog = new Dog('Black', 9, 2.4, 22.0);
$my_dog->bark();
$friends_dog->bark();
```
Output
```PHP
Woof! I am 10 years old and a Brown dog
Woof! I am 9 years old and a Black dog
```
```
$my_dog = new Dog('Brown', 10, 2.0, 20.0);
```
- Class is a blue print of an object
- `$my_dog` is an object of `Dog`
- `new` creates an object/instance of the class
**Constructor**
- __construct() is called when an object is created
- Any argument passed to the new expression will be passed to __construct
- Used for initialization of the object
#### Example
```
class MyClass {
function __construct($param) {
print "In MyClass constructor with param = $param\n";
}
}
$obj = new MyClass("PHP");
```
#### Output
In MyClass constructor with param = PHP
**Destructor**
- __destruct() method will be called as soon as there are no other references to a particular object, or in any order during the shutdown sequence.
- This is called automatically by the Zend Engine
**$this variable**
- Used inside methods
- Its a reference to the object containg this method
- In Java/C++ its "this"
Example
class SimpleClass
{
public $var = 'a default value';
public function displayVar() {
// here "$this" references "$sc"
echo $this->var;
}
}
// Run this code
$sc = new SimpleClass();
echo $sc->displayVar();
// will print 'a default value'
$this
in $this->var
references $sc
### Accessing object
- Set instance property is just like assigning to a PHP variable
- `$instance->property = "value"`
- `$box->width = 30`
- Get instance property
- `print $box->width;` prints "30"
- Access instance method almost same way
- `$box->volume();`
- Access propery/method by scope Resolution Operator (`::`)
- The Scope Resolution Operator (`::`) is a token that allows access to static, constant, and overridden properties or methods of a class.
- It accesses class level properies
- Also called *Paamayim Nekudotayim*
Example of Scope resolution operator
class MyClass {
const CONST_VALUE = 'A constant value';
}
$classname = 'MyClass';
echo $classname::CONST_VALUE; // As of PHP 5.3.0
echo MyClass::CONST_VALUE;
Object Inheritance
class Foo{
public function printItem($string){
echo 'Foo: ' . $string . PHP_EOL;
}
public function printPHP(){
echo 'PHP is great.' . PHP_EOL;
}
}
class Bar extends Foo{
public function printItem($string){
echo 'Bar: ' . $string . PHP_EOL;
}
}
$foo = new Foo();
$bar = new Bar();
$foo->printItem('baz'); // Output: 'Foo: baz'
$foo->printPHP(); // Output: 'PHP is great'
$bar->printItem('baz'); // Output: 'Bar: baz'
$bar->printPHP(); // Output: 'PHP is great'
### Visibility
- **Public** can be accessed from anywhere.
- **Protected** can be accessed from sub/inherited classes and containing class
- **private** can be accessed only from the containing class
Example Protected
class MyClass
{
public $public = 'Public';
protected $protected = 'Protected';
private $private = 'Private';
function printHello()
{
echo $this->public;
echo $this->protected;
echo $this->private;
}
}
$obj = new MyClass();
echo $obj->public; // Works
echo $obj->protected; // Fatal Error
echo $obj->private; // Fatal Error
$obj->printHello(); // Shows Public, Protected and Private
Example Private
class MyClass2 extends MyClass
{
// We can redeclare the public and protected method, but not private
protected $protected = 'Protected2';
function printHello()
{
echo $this->public;
echo $this->protected;
echo $this->private;
}
}
$obj2 = new MyClass2();
echo $obj2->public; // Works
echo $obj2->protected; // Fatal Error
echo $obj2->private; // Undefined
$obj2->printHello(); // Shows Public, Protected2, Undefined
### Why OOP?
- Scope and Encapsulation
- Code Re-use
- Easier real life object modeling
- Type enforcement
- Testability
- Maintenance
- Auto loading
- Class Abstraction
- Interfaces
- Traits
- Polymorphism
- Object Iteration
- Magic methods
- Overloading
- Serialization
### Loading classes
#### Earlier
- Put all the classes in separate file.
- class.a.php, class.b.php
- include all the classes with include statement
- Problems
- Tedious to write all the includes
- Keep track of the includes.
### Loading classes
#### Now
- Put all the classes in separate file.
- class.a.php, class.b.php
- lazily include them on the runtime using `__autoload`.
```php
function __autoload($class_name) {
include 'class.' . $class_name . '.php';
}
$obj = new MyClass1();
$obj2 = new MyClass2();
```
#### Even Better
`spl_autoload_register()`
- Allows multiple funcitons to be regiestered
- Handles existing `__autoload`
- Also possible to *unregister* a function
### Abstract classes
- class should have at least one `abstract` method
- `abstract` method must not have body
- provides a abstract blueprint, hence can not be instantiated
- abstract classes and method are defined with `abstract` keyword
#### Example
*abstract class*
```
abstract class AbstractClass{
// Force Extending class to define this method
abstract protected function getValue();
abstract protected function prefixValue($prefix);
// Common method
public function printOut(){
print $this->getValue() . "\n";
}
}
```
*concrete class*
```
class ConcreteClass1 extends AbstractClass{
protected function getValue() {
return "ConcreteClass1";
}
public function prefixValue($prefix) {
return "{$prefix}ConcreteClass1";
}
}
```
### Interfaces
- Defines a public contract of the classes that implement it
- Ensure consuming classes have spefic signature
- Interfaces are defined using the `interface` keyword
- Methods declared in an interface must be public
#### Example
*Interface*
```
// Declare the interface 'iTemplate'
interface iTemplate{
public function setVariable($name, $var);
public function getHtml($template);
}
```
*implementation*
```
class Template implements iTemplate{
private $vars = array();
public function setVariable($name, $var){
$this->vars[$name] = $var;
}
public function getHtml($template){
foreach($this->vars as $name => $value) {
$template = str_replace('{' . $name . '}', $value, $template);
}
return $template;
}
}
```
### Traits
- Mechanism for code reuse
- Reuse sets of methods freely in several independent classes living in different class hierarchies
- Reduces complexity
- Group functionality in a fine-grained and consistent way
- Not possible to instantiate
#### Example
*Trait*
```PHP
class Base {
public function sayHello() { echo 'Hello '; }
}
trait SayWorld {
public function sayHello() {
parent::sayHello();
echo 'World!';
}
}
class MyHelloWorld extends Base {
use SayWorld;
}
$o = new MyHelloWorld();
$o->sayHello();
```
The above example will output: `Hello World!`
### Polymorphism
- Greek meaning *having multiple forms*
- Derived class is type-compatible with its base class
- One base class can be type-compatible to all different types of its derived class.
- `is-a` relationship rules
- If _dolphin_ and _shark_ are fish and fish lives underwater, _dolphin_ and _shark_ live underwater.
#### Example - Polymorphic behavior
Base Classes
```
class Animal {
public $name;
public function __construct($name) {
$this->name = $name;
}
}
interface Talkative {
public function speak();
}
```
Child Classes
```
class Dog extends Animal implements Talkative {
public function speak() {
return "Woof, woof!";
}
public function playFetch() {
return 'getting the stick';
}
}
class Cat extends Animal implements Talkative {
public function speak() {
return "Meow...";
}
}
```
#### Example - Polymorphic behavior
```
function makeSpeak(Talkative $being){
return $being->speak();
}
$animals = array(new Dog('Odie'), new Cat('Snowball'));
foreach ($animals as $animal) {
print $animal->name . " says: " . makeSpeak($animal) . PHP_EOL;
}
```
Output
```
Odie says: Woof, woof!
Snowball says: Meow...
```
### Object Iteration
- PHP 5 Feature
- Iterate through object properties with `foreach`
- Only public properties are accessable.
```PHP
class MyClass{
public $var1 = 'value 1';
public $var2 = 'value 2';
public $var3 = 'value 3';
protected $protected = 'protected var';
public function public_method(){ return "public_method";}
}
$class = new MyClass();
foreach($class as $key => $value) {
print "$key => $value\n";
}
```
Output:
```
var1 => value 1
var2 => value 2
var3 => value 3
```
### Magic Methods
- PHP reserves all function names starting with __ as magical
- `__construct()`, `__destruct()`, `__call()`, `__callStatic()`, `__get()`, `__set()`, `__isset()`, `__unset()`, `__sleep()`, `__wakeup()`, `__toString()`, `__invoke()`, `__set_state()`, `__clone()` and `__debugInfo()`
### Overloading
- Uses magic method to achive overloading
- `__get()`, `__set()`, `__call()`, `__callStatic()` are used
#### Overloading Example
```php
class MethodTest{
public function __call($name, $arguments){
echo "Calling object method '$name' "
. implode(', ', $arguments). "\n";
}
public static function __callStatic($name, $arguments){/** PHP 5.3.0 */
echo "Calling static method '$name' "
. implode(', ', $arguments). "\n";
}
}
$obj = new MethodTest;
$obj->runTest('in object context');
$obj->runTest('in', 'object', 'context');
MethodTest::runTest('in static context'); // As of PHP 5.3.0
```
Output
```text
Calling object method 'runTest' in object context
Calling object method 'runTest' in, object, context
Calling static method 'runTest' in static context
```
### Serialization
- `serialize()` to serialize any object
- `unserialize()` to re-build the serialized object
- Class definition must be present while calling `unserialize()`
- Resource types cannot be serialized, need special care.
- `serialize()` and `unserialize()` calls `__sleep()` and `__wakeup()` methods respectively
```php
class Connection{
protected $link;
private $dsn, $username, $password;
public function __construct($dsn, $username, $password){
$this->dsn = $dsn;
$this->username = $username;
$this->password = $password;
$this->connect();
}
private function connect(){
$this->link = new PDO($this->dsn, $this->username, $this->password);
}
public function __sleep(){
return array('dsn', 'username', 'password');
}
public function __wakeup(){
$this->connect();
}
}
```
### Definition
*In software engineering, a design pattern is a general **reusable solution** to a **commonly occurring problem** within a given context in **software design***
### Common Patterns
- Object Creational Pattern
- Factory
- Singleton
- Dependency Injection
- Structural Pattern
- Facade
- Front Controller
- Architectural Design Pattern
- Model–View–Controller
### Factory Pattern
- An object that produces other object
- Usually done by a method call.
- Can produce from simple to most complex object
- Also known as Simple Factory. Farther classification exists
- Abstract Factory
- Factory Method
#### Example
```
class FormatFactory{
public static function build($type){
$class = $type . 'Format';
return new $class;
}
}
class Format{
public function print_type(){
print $this->type . PHP_EOL;
}
}
class StringFormat extends Format{ public $type="String";}
class NumberFormat extends Format{ public $type="Number";}
FormatFactory::build('String')->print_type();
FormatFactory::build('Number')->print_type();
```
Any idea what could be the output?
#### Output
String
Number
### Singleton
- Ensure that a class has **only one instance**
- Has a global point of access to it
#### Example
```
public class User {
private static $instance = null;
private __construct() { }
public static function getInstance() {
if (self::$instance == null) {
self::$instance = new User();
}
return self::$instance;
}
}
$user1 = User::getInstance();
$user2 = User::getInstance();
$user3 = User::getInstance();
```
### Dependency Injection
- Move hard coded dependecy
- Pass the dependency by constructor or by setter
- Provides Decoupling
- Testable code
#### Example
**Bad code**
```
class MyClass{
private $dependency;
public function __construct(){
$this->dependency = new Dependency();
}
}
```
**Good Code, DI Applied**
```
class MyClass{
private $dependency;
public function __construct(Dependency $dep){
$this->dependency = $dep;
}
}
```
### Facade
- Provides a **simplified interface** to a larger body of code
- Make a software library easier to use
- Make api more readable
- Most libraries use Facade
#### Example
```PHP
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25)
->setUsername('your username')
->setPassword('your password')
;
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
<EMAIL_ADDRESS>=> 'John Doe'))
<EMAIL_ADDRESS><EMAIL_ADDRESS>=> 'A name'))
->setBody('Here is the message itself');
// Send the message
$result = $mailer->send($message);
```
### Front Controller
- Only used in Web applications
- Provides a centralized entry point for handling requests
- Most PHP MVC frameworks uses it. Laravel, Yii, Zend Framework, Symfony etc
- Helps to avoid duplication
- Session, Input filtering, caching, routing etc common stuff reside here.
### Model–View–Controller
- Most used GUI framework
- Not only used in web but also in desktop app
- Three main components
- **Model**: Represents data, business model
- **View**: Shows the visible content on web to user.
- **Controller**: Co-ordinate between View and Model
- Other variants HMVC, MVA, MVP, MVVM
#### Diagram
![MVC Workflow diagram](mvc-diagram1.png)
###Shiplu Mokaddim
_Unix Hacker_, _Senior Software Engineer _
**NewsCred Inc. **
---
@shiplu, github.com/shiplu
in/mokaddim, shiplu.mokadd.im


MATLAB xUnit Test Framework: How to Put Multiple Test Cases in One M-file
The Quick Start example showed how you can write a simple M-file to be a single test case. This example shows you how to put multiple test cases in one M-file.
Name your M-file beginning or ending with "test", like "testMyFunc". Start by putting the following two lines at the beginning of the file. It's important that the output variable name on line 1 be test_suite.
function test_suite = testMyFunc initTestSuite;
Next, add subfunctions to the file. Each subfunction beginning or ending with "test" becomes an individual test case.
The directory example_subfunction_tests contains a test M-file containing subfunction test cases for the fliplr function.
cd example_subfunction_tests type testFliplr
function test_suite = testFliplr initTestSuite; function testFliplrMatrix in = magic(3); assertEqual(fliplr(in), in(:, [3 2 1])); function testFliplrVector assertEqual(fliplr([1 4 10]), [10 4 1]);
As usual, run the test cases using runxunit:
runxunit
Test suite: C:\Users\psexton\Documents\GitHub\matlab-xunit-doctest\doc\example_subfunction_tests 20-Feb-2014 19:59:09 Starting test run with 2 test cases. .. PASSED in 0.013 seconds.


File: lib/draft-js/moveSelectionBackward.js
/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule moveSelectionBackward * */ /** * Given a collapsed selection, move the focus `maxDistance` backward within * the selected block. If the selection will go beyond the start of the block, * move focus to the end of the previous block, but no further. * * This function is not Unicode-aware, so surrogate pairs will be treated * as having length 2. */ 'use strict'; function moveSelectionBackward(editorState, maxDistance) { var selection = editorState.getSelection(); var content = editorState.getCurrentContent(); var key = selection.getStartKey(); var offset = selection.getStartOffset(); var focusKey = key; var focusOffset = 0; if (maxDistance > offset) { var keyBefore = content.getKeyBefore(key); if (keyBefore == null) { focusKey = key; } else { focusKey = keyBefore; var blockBefore = content.getBlockForKey(keyBefore); focusOffset = blockBefore.getText().length; } } else { focusOffset = offset - maxDistance; } return selection.merge({ focusKey: focusKey, focusOffset: focusOffset, isBackward: true }); } module.exports = moveSelectionBackward;


{% extends "layout.html" %} {% block service_name %} {% endblock %} {% block page_title %} {% endblock %} {% block content %} Upload successful Thank you for providing your monthly data. It will be published on 1 October 2017. {% endblock %}
Thank you for providing your monthly data. It will be published on 1 October 2017.