Goals
This week we arrive at the most famous and foundational open problem in Computer Science (and, arguably, in all of Mathematics, and more questionably, perhaps of all human creative endeavor): is it substantially easier to verify the solution to a (certain very broad and common type of) problem, than it is to find that solution? (stated more formally in computer science as “P = NP?".
The main goals for Week 11 are to:
- Understand how to talk about the hardness (“difficulty”) of computing functions.
- Learn about a few examples of problems that appear to have surprisingly different difficulties.
- Be able to talk about the tractability of problems, and understand what computer scientists categorize problems as tractable and intractable the way we do.
- Understand precisely the definition of the complexity class NP, and two different ways of defining it.
- Be able to prove a problem is in class NP.
- Understand the P=NP question and its significance.
- See how we might be able to make progress on determining if P=NP, and understand the Cook-Levin Theorem and the main idea behind its proof.
Schedule
Following the Election Day adjustments, the “Tuesday” cohorts are now the last ones in the schedule, and the week starts with the “Wednesday” cohorts.
| Day | "Wednesday" Cohort | "Thursday" Cohort | "Friday" Cohort | "Sunday" Cohort | "Monday" Cohort | "Tuesday" Cohort |
|---|---|---|---|---|---|---|
| Thu 5 Nov | Preparation | (Week 10) | (Week 10) | (Week 10) | (Week 10) | (Week 10) |
| Fri 6 Nov | Preparation | Preparation | (Week 10) | (Week 10) | (Week 10) | (Week 10) |
| Sat/Sun 7/8 Nov | Preparation | Preparation | Preparation | (Week 10) | (Week 10) | (Week 10) |
| Mon 9 Nov | Cohort Meeting | Preparation | Preparation | Preparation | (Week 10) | (Week 10) |
| Tue 10 Nov | Preparation | Cohort Meeting | Preparation | Preparation | Preparation | (Week 10) |
| Wed 11 Nov | Assessed Cohort Meeting | Preparation | Cohort Meeting | Preparation | Preparation | Preparation |
| Thu 12 Nov | Write-up Due | Assessed Cohort Meeting | Preparation | Cohort Meeting | Preparation | Preparation |
| Fri 13 Nov | Week 12 | Write-up Due | Assessed Cohort Meeting | Preparation | Cohort Meeting | Preparation |
| Sat/Sun 14/15 Nov | Week 12 | Week 12 | Write-up Due | Assessed Cohort Meeting | Preparation | Cohort Meeting |
| Mon 16 Nov | Week 12 | Week 12 | Week 12 | Write-up Due | Assessed Cohort Meeting | Preparation |
| Tue 17 Nov | Week 12 | Week 12 | Week 12 | Week 12 | Write-up Due | Assessed Cohort Meeting |
| Wed 18 Nov | Week 12 | Week 12 | Week 12 | Week 12 | Week 12 | Write-up Due |
Cohort Problems
These are the problems you should discuss in your Cohort Meeting, and everyone in your cohort should be prepared to present and discuss solutions to at the Assessed Cohort Meeting:
Cohort Problems for Week 11 [PDF]
The problems are posted here and we think its a good idea to look at them early, but you’re not expected to be able to solve them until after doing the readings and watching the videos below.
After the Assessed Cohort Meeting, your Cohort Leader will select one problem that your cohort needs to write-up and submit. The write-up is due by 11:59pm on the day after your assessed cohort meeting (see the schedule above).
Problem Set 11 Template [zip].
Reading
This week’s content is covered in several chapters in the TCS book. This is a lot of reading material, but you should consider it all “optional” this week - you are not expected to read these in detail, but should find the textbook a useful complement to the lecture content to have an alternate presenation of the materials and a refernce for some of the technical details that we do not cover in depth in the lectures.
Chapter 12: Efficient computation: An informal introduction [PDF]
Chapter 13: Modeling running time [PDF]
Chapter 14: Polynomial-time reducations [PDF]
Chapter 15: NP, NP completeness, and the Cook-Levin Theorem [PDF]
Chapter 16: What if P equals NP? [PDF]
Videos
The videos for this week are longer than in previous weeks (so please don’t wait to get started on them!), but include quite a bit of review material and are designed to get to a good understanding of the P=NP question.
You can play all the videos using this playlist, but don’t forget to take breaks: Week 11 Playlist
These videos are edited from these cs3102 classes (we don’t generally recommend watching the unedited versions, but they are available if you want to):
-
(Fall 2019) Class 19: Turing Machine running time: Full Video, Slides
-
(Fall 2019) Class 20: Polynomial-Time Reductions (despite this being one of our favorite topics, this is mostly skipped): Full Video, Slides
-
(Fall 2019) Class 21: Is Omniscience Helpful?: Full Video, Slides
-
(Fall 2019) Class 22: NP Completeness: Fall Video, Slides
"Difficulty" of Functions (9:13)
RAM Model (7:00)
Shortest and Longest Path (11:16)
Satisfiability (14:45)
Tractable and Intractable Problems (6:38)
Questions about P and EXP (5:02)
Introducing NP (14:02)
Complexity Class NP (13:08)
Power of Nondeterministic Turing Machines (11:57)
Proving a Problem is in NP (7:50)
The P=NP Question (9:12)
Cook-Levin Theorem (17:02)
History of the Cook-Levin Theorem (8:31)
P=NP Recap (4:45)


The HD-Sec project will be undertaken by an experienced team from Electronics and Computer Science (ECS) at the University of Southampton.
Professor Michael Butler, the Principal Investigator, is a world-leader in the development and industrial deployment of formal engineering methods for assurance of safety and security.
Professor Vladimiro Sassone is a Professor of Cyber Security, holds a Royal Academy of Engineering Research Chair and leads the University's cyber security activities.
Dr Thai Son Hoang is a leading researcher in refinement-based formal methods, including Event-B.
Dr Leonardo Aniello noted for his research on cyber security and distributed systems topics.
Dr Dana Dghaym is a researcher in formal methods and has experience in tool development and verification.


Start Time :
End Time :
Do you want to book cab :          Yes    No
First Event :          Select your first event Watch a Movie Restraunt table booking


Hi, there!
I am a first-year master student at the School of Information of the University of Michigan pursuing my degree in Master of Science in Information with a specialization in User Experience Research and Design.
I am passionate about utilizing my design skills to solve meaningful problems and drive desired business and social results.
This semester I am working with an award-winning team to turn their vision of facilitating conversations about end-of-life wishes into reality.
Before came to the design world, I was a business school student. My training in Economics and Finance together with my current pursuit of design allows me to combine analytical, creative and visual thinking together.
Fun fact: I previously worked as a volunteer Chinese teacher in Thailand and designed adaptive lectures for local students. I am always conscious of "Who my audiences are ?" no matter in education or design.
Aside from design, I am also an avid podcast listener📻, Chinese painting lover🎨, badminton buff🏸, city explorer🚶, and novel reader📖!


I’m a full stack developer based in Miami. I work with Ruby on Rails, JavaScript and front-end technologies to create web applications. I also work with React to deliver beautiful and natural Native apps.
I am developer eager to learn and to feel challenged, always looking for the best way to solve the problem. Someone not just looking to make a living, but to make a difference while having fun.
Ready to start your next project? That's great! Send me an email and I will get back to you as soon as possible!


Any queries maybe directed to ICM National office:
<EMAIL_ADDRESS>011 450 3914 extension 3
P.O. Box 10345
Edenglen
1613


Imagine we need to include exotic, site-specific elements in our
documents. These may be handles to other objects in our system
(documents, users, etc), domain-specific widgets, or, in the case of
this demo, dinosaurs.
ProseMirror allows you to define custom document elements, along
with serialization and parsing methods to convert them to and from the
document formats you are interested in. These then become proper
semantic element in your document format.
In the editor below, dinosaurs are first-class elements in the
document model. They can appear anywhere where text can appear.
You can insert dinosaurs by typing their names enclosed by
brackets, such as [pterodactyl]
. The insert menu bar
also allows you to insert dinosaurs.
This paragraph , for example,
is full of
dinosaurs.
Dinosaurs can be selected, copied, pasted, dragged, and so
on.


Version Control
Anybody can git this
22 Mar 2015
You're probably wondering what version control is and why you should care. While no one can make you care, there are some reasons why you might want to. Version control is a way to set milestones in your code. Imagine you were running a marathon, and in mile 15 you had a mishap. Let's say you had to stop to use the restroom. That might really mess up your overall pace, and keep you off the winners' podium. What if you could easily take yourself back to the fourteenth mile marker and start again from there? That is what version control can do. It can make it possible to go back to a previous marker in your code, and start over from there.
Git is a version control tool that makes it easy to do version control from your computer's command line. It uses simple commands to check status, add, commit, and push changes to your code. A commit is like the mile marker in the analogy I used above of a runner in a marathon. Each is a moment in the timeline of your code that you can travel back to, and git is your flux capacitor; it's the thing which makes your code time travel possible.
GitHub is a website where you can store projects that use git for version control. It is set up to easily store, fork, and branch your code, and since it is online, more than one person will be able to work on the code at the same time. It also allows other developers the ability to see what you're working on, if it's open source, and maybe suggest upgrades or fix bugs. Finally, it can also be a good way to show off your skills to other developers and potential employers.
Git and GitHub are great tools for working on a project, keeping organized, and sharing work.


Media API upload TEST
click to select or drop files here
Your Browser is not supported. Please use a modern Browser.
0%
click to select or drop files here ( only one )
Your Browser is not supported. Please use a modern Browser.
click to select or drop files here ( max size 1000kb )
Your Browser is not supported. Please use a modern Browser.
click to select or drop files here ( only pdf )
Your Browser is not supported. Please use a modern Browser.


Body before modification:
=$body$=
Body after conversion from Markdown to HTML:
=$body&o$=
Body after summarization:
=$body&s$=
Body after link conversion:
=$body&j$=
Body after base file name extraction:
=$body&b$=
Body after conversion to HTML:
=$body&h$=
Body after punctuation purification:
=$body&p$=


Information
-
This page is designed to display news at their's corresponding locations.
-
You can apply filters to displaying news by clicking
icon. After submitting, filters are stored as cookie and applied as default on reload.
-
You can also change default settings about map by clicking
icon. After submitting, settings are stored and applied on reload as well.
-
For further information or questions, you can contact with hello@newsfrom.news.


COSC 484: Assignment 0
About the Professor
my website
my Email
Tall
Handsome
funny
About Me
I am an Emirati student
Handsome
Married
my parents are both alive
Thank you for looking at my home page


Before Change
with open(os.path.join(chroot, "package.json"), "wb") as fp:
json.dump(package, fp)
with pushd(chroot):
returncode, _ = task.execute_npm(["run-script", "proof"], workunit_name="test")
self.assertEqual(0, returncode)
self.assertTrue(os.path.exists(proof))
After Change
with pushd(chroot):
returncode, _ = task.run_script(
"proof",
package_manager=task.node_distribution.get_package_manager(package_manager="npm"),
workunit_name="test")
self.assertEqual(0, returncode)


Spotibot
Spotibot: A Facebook Messenger Chat Bot to retrieve Spotify links
Introduction
Spotibot is a Facebook Messenger Bot. A user can send a message in the format “Artist:_ Song:_ “ and the chatbot will return a spotify link of the song. I like to listen to a lot of music and often want to share these songs with my friends. I found it extremely inconvenient to switch back and forth between the Spotify app and the Messenger app, so I decided to make a messenger app that would retrieve a shareable link for me.
How I coded this project
The first resource I turned to was this Facebook Messenger Bot Tutorial by the Indian Pythonista. After I completed a simple echo chatbot, I created a Spotify Developer Account and started using the Spotify API to retreive songs. I parsed the JSON data to first find the artist, and then searched the artist’s albums until I found the track that matched the user’s request. The program is uploaded onto the Heroku Cloud Platform. The Heroku link was then connected to the Facebook page.


Validation
- Basic Usage
- Controller Validation
- Form Request Validation
- Working With Error Messages
- Error Messages & Views
- Available Validation Rules
- Conditionally Adding Rules
- Custom Error Messages
- Custom Validation Rules
Basic Usage
Laravel ships with a simple, convenient facility for validating data and retrieving validation error messages via the Validation
class.
Basic Validation Example
$validator = Validator::make(
array('name' => 'Dayle'),
array('name' => 'required|min:5')
);
The first argument passed to the make
method is the data under validation. The second argument is the validation rules that should be applied to the data.
Using Arrays To Specify Rules
Multiple rules may be delimited using either a "pipe" character, or as separate elements of an array.
$validator = Validator::make(
array('name' => 'Dayle'),
array('name' => array('required', 'min:5'))
);
Validating Multiple Fields
$validator = Validator::make(
array(
'name' => 'Dayle',
'password' => 'lamepassword',
'email' =><EMAIL_ADDRESS>),
array(
'name' => 'required',
'password' => 'required|min:8',
'email' => 'required|email|unique:users'
)
);
Once a Validator
instance has been created, the fails
(or passes
) method may be used to perform the validation.
if ($validator->fails())
{
// The given data did not pass validation
}
If validation has failed, you may retrieve the error messages from the validator.
$messages = $validator->messages();
You may also access an array of the failed validation rules, without messages. To do so, use the failed
method:
$failed = $validator->failed();
Validating Files
The Validator
class provides several rules for validating files, such as size
, mimes
, and others. When validating files, you may simply pass them into the validator with your other data.
After Validation Hook
The validator also allows you to attach callbacks to be run after validation is completed. This allows you to easily perform further validation, and even add more error messages to the message collection. To get started, use the after
method on a validator instance:
$validator = Validator::make(...);
$validator->after(function($validator)
{
if ($this->somethingElseIsInvalid())
{
$validator->errors()->add('field', 'Something is wrong with this field!');
}
});
if ($validator->fails())
{
//
}
You may add as many after
callbacks to a validator as needed.
Controller Validation
Of course, manually creating and checking a Validator
instance each time you do validation is a headache. Don't worry, you have other options! The base App\Http\Controllers\Controller
class included with Laravel uses a ValidatesRequests
trait. This trait provides a single, convenient method for validating incoming HTTP requests. Here's what it looks like:
/**
* Store the incoming blog post.
*
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
$this->validate($request, [
'title' => 'required|unique|max:255',
'body' => 'required',
]);
//
}
If validation passes, your code will keep executing normally. However, if validation fails, an Illuminate\Contracts\Validation\ValidationException
will be thrown. This exception is automatically caught and a redirect is generated to the user's previous location. The validation errors are even automatically flashed to the session!
If the incoming request was an AJAX request, no redirect will be generated. Instead, an HTTP response with a 422 status code will be returned to the browser containing a JSON representation of the validation errors.
For example, here is the equivalent code written manually:
/**
* Store the incoming blog post.
*
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
$v = Validator::make($request->all(), [
'title' => 'required|unique|max:255',
'body' => 'required',
]);
if ($v->fails())
{
return redirect()->back()->withErrors($v->errors());
}
//
}
Customizing The Flashed Error Format
If you wish to customize the format of the validation errors that are flashed to the session when validation fails, override the formatValidationErrors
on your base controller. Don't forget to import the Illuminate\Validation\Validator
class at the top of the file:
/**
* {@inheritdoc}
*/
protected function formatValidationErrors(Validator $validator)
{
return $validator->errors()->all();
}
Form Request Validation
For more complex validation scenarios, you may wish to create a "form request". Form requests are custom request classes that contain validation logic. To create a form request class, use the make:request
Artisan CLI command:
php artisan make:request StoreBlogPostRequest
The generated class will be placed in the app/Http/Requests
directory. Let's add a few validation rules to the rules
method:
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'title' => 'required|unique|max:255',
'body' => 'required',
];
}
So, how are the validation rules executed? All you need to do is type-hint the request on your controller method:
/**
* Store the incoming blog post.
*
* @param StoreBlogPostRequest $request
* @return Response
*/
public function store(StoreBlogPostRequest $request)
{
// The incoming request is valid...
}
The incoming form request is validated before the controller method is called, meaning you do not need to clutter your controller with any validation logic. It has already been validated!
If validation fails, a redirect response will be generated to send the user back to their previous location. The errors will also be flashed to the session so they are available for display. If the request was an AJAX request, a HTTP response with a 422 status code will be returned to the user including a JSON representation of the validation errors.
Authorizing Form Requests
The form request class also contains an authorize
method. Within this method, you may check if the authenticated user actually has the authority to update a given resource. For example, if a user is attempting to update a blog post comment, do they actually own that comment? For example:
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
$commentId = $this->route('comment');
return Comment::where('id', $commentId)
->where('user_id', Auth::id())->exists();
}
Note the call to the route
method in the example above. This method grants you access to the URI parameters defined on the route being called, such as the {comment}
parameter in the example below:
Route::post('comment/{comment}');
If the authorize
method returns false
, a HTTP response with a 403 status code will automatically be returned and your controller method will not execute.
If you plan to have authorization logic in another part of your application, simply return true
from the authorize
method:
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
Customizing The Flashed Error Format
If you wish to customize the format of the validation errors that are flashed to the session when validation fails, override the formatValidationErrors
on your base request (App\Http\Requests\Request
). Don't forget to import the Illuminate\Validation\Validator
class at the top of the file:
/**
* {@inheritdoc}
*/
protected function formatErrors(Validator $validator)
{
return $validator->errors()->all();
}
Working With Error Messages
After calling the messages
method on a Validator
instance, you will receive a MessageBag
instance, which has a variety of convenient methods for working with error messages.
Retrieving The First Error Message For A Field
echo $messages->first('email');
Retrieving All Error Messages For A Field
foreach ($messages->get('email') as $message)
{
//
}
Retrieving All Error Messages For All Fields
foreach ($messages->all() as $message)
{
//
}
Determining If Messages Exist For A Field
if ($messages->has('email'))
{
//
}
Retrieving An Error Message With A Format
echo $messages->first('email', '
:message
');
Note: By default, messages are formatted using Bootstrap compatible syntax.
Retrieving All Error Messages With A Format
foreach ($messages->all('
:message
') as $message)
{
//
}
Error Messages & Views
Once you have performed validation, you will need an easy way to get the error messages back to your views. This is conveniently handled by Laravel. Consider the following routes as an example:
Route::get('register', function()
{
return View::make('user.register');
});
Route::post('register', function()
{
$rules = array(...);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails())
{
return redirect('register')->withErrors($validator);
}
});
Note that when validation fails, we pass the Validator
instance to the Redirect using the withErrors
method. This method will flash the error messages to the session so that they are available on the next request.
However, notice that we do not have to explicitly bind the error messages to the view in our GET route. This is because Laravel will always check for errors in the session data, and automatically bind them to the view if they are available. So, it is important to note that an $errors
variable will always be available in all of your views, on every request, allowing you to conveniently assume the $errors
variable is always defined and can be safely used. The $errors
variable will be an instance of MessageBag
.
So, after redirection, you may utilize the automatically bound $errors
variable in your view:
<?php echo $errors->first('email'); ?>
Named Error Bags
If you have multiple forms on a single page, you may wish to name the MessageBag
of errors. This will allow you to retrieve the error messages for a specific form. Simply pass a name as the second argument to withErrors
:
return redirect('register')->withErrors($validator, 'login');
You may then access the named MessageBag
instance from the $errors
variable:
<?php echo $errors->login->first('email'); ?>
Available Validation Rules
Below is a list of all available validation rules and their function:
- Accepted
- Active URL
- After (Date)
- Alpha
- Alpha Dash
- Alpha Numeric
- Array
- Before (Date)
- Between
- Boolean
- Confirmed
- Date
- Date Format
- Different
- Digits
- Digits Between
- Exists (Database)
- Image (File)
- In
- Integer
- IP Address
- Max
- MIME Types
- Min
- Not In
- Numeric
- Regular Expression
- Required
- Required If
- Required With
- Required With All
- Required Without
- Required Without All
- Same
- Size
- String
- Timezone
- Unique (Database)
- URL
accepted
The field under validation must be yes, on, or 1. This is useful for validating "Terms of Service" acceptance.
active_url
The field under validation must be a valid URL according to the checkdnsrr
PHP function.
after:date
The field under validation must be a value after a given date. The dates will be passed into the PHP strtotime
function.
alpha
The field under validation must be entirely alphabetic characters.
alpha_dash
The field under validation may have alpha-numeric characters, as well as dashes and underscores.
alpha_num
The field under validation must be entirely alpha-numeric characters.
array
The field under validation must be of type array.
before:date
The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime
function.
between:min,max
The field under validation must have a size between the given min and max. Strings, numerics, and files are evaluated in the same fashion as the size
rule.
boolean
The field under validation must be able to be cast as a boolean. Accepted input are true
, false
, 1
, 0
, "1"
and "0"
.
confirmed
The field under validation must have a matching field of foo_confirmation
. For example, if the field under validation is password
, a matching password_confirmation
field must be present in the input.
date
The field under validation must be a valid date according to the strtotime
PHP function.
date_format:format
The field under validation must match the format defined according to the date_parse_from_format
PHP function.
different:field
The given field must be different than the field under validation.
digits:value
The field under validation must be numeric and must have an exact length of value.
digits_between:min,max
The field under validation must have a length between the given min and max.
The field under validation must be formatted as an e-mail address.
exists:table,column
The field under validation must exist on a given database table.
Basic Usage Of Exists Rule
'state' => 'exists:states'
Specifying A Custom Column Name
'state' => 'exists:states,abbreviation'
You may also specify more conditions that will be added as "where" clauses to the query:
'email' => 'exists:staff,email,account_id,1'
Passing NULL
as a "where" clause value will add a check for a NULL
database value:
'email' => 'exists:staff,email,deleted_at,NULL'
image
The file under validation must be an image (jpeg, png, bmp, gif, or svg)
in:foo,bar,...
The field under validation must be included in the given list of values.
integer
The field under validation must have an integer value.
ip
The field under validation must be formatted as an IP address.
max:value
The field under validation must be less than or equal to a maximum value. Strings, numerics, and files are evaluated in the same fashion as the size
rule.
mimes:foo,bar,...
The file under validation must have a MIME type corresponding to one of the listed extensions.
Basic Usage Of MIME Rule
'photo' => 'mimes:jpeg,bmp,png'
min:value
The field under validation must have a minimum value. Strings, numerics, and files are evaluated in the same fashion as the size
rule.
not_in:foo,bar,...
The field under validation must not be included in the given list of values.
numeric
The field under validation must have a numeric value.
regex:pattern
The field under validation must match the given regular expression.
Note: When using the regex
pattern, it may be necessary to specify rules in an array instead of using pipe delimiters, especially if the regular expression contains a pipe character.
required
The field under validation must be present in the input data.
required_if:field,value,...
The field under validation must be present if the field field is equal to any value.
required_with:foo,bar,...
The field under validation must be present only if any of the other specified fields are present.
required_with_all:foo,bar,...
The field under validation must be present only if all of the other specified fields are present.
required_without:foo,bar,...
The field under validation must be present only when any of the other specified fields are not present.
required_without_all:foo,bar,...
The field under validation must be present only when all of the other specified fields are not present.
same:field
The given field must match the field under validation.
size:value
The field under validation must have a size matching the given value. For string data, value corresponds to the number of characters. For numeric data, value corresponds to a given integer value. For files, size corresponds to the file size in kilobytes.
string:value
The field under validation must be a string type.
timezone
The field under validation must be a valid timezone identifier according to the timezone_identifiers_list
PHP function.
unique:table,column,except,idColumn
The field under validation must be unique on a given database table. If the column
option is not specified, the field name will be used.
Basic Usage Of Unique Rule
'email' => 'unique:users'
Specifying A Custom Column Name
'email' => 'unique:users,email_address'
Forcing A Unique Rule To Ignore A Given ID
'email' => 'unique:users,email_address,10'
Adding Additional Where Clauses
You may also specify more conditions that will be added as "where" clauses to the query:
'email' => 'unique:users,email_address,NULL,id,account_id,1'
In the rule above, only rows with an account_id
of 1
would be included in the unique check.
url
The field under validation must be formatted as an URL.
Note: This function uses PHP's
filter_var
method.
Conditionally Adding Rules
In some situations, you may wish to run validation checks against a field only if that field is present in the input array. To quickly accomplish this, add the sometimes
rule to your rule list:
$v = Validator::make($data, array(
'email' => 'sometimes|required|email',
));
In the example above, the email
field will only be validated if it is present in the $data
array.
Complex Conditional Validation
Sometimes you may wish to require a given field only if another field has a greater value than 100. Or you may need two fields to have a given value only when another field is present. Adding these validation rules doesn't have to be a pain. First, create a Validator
instance with your static rules that never change:
$v = Validator::make($data, array(
'email' => 'required|email',
'games' => 'required|numeric',
));
Let's assume our web application is for game collectors. If a game collector registers with our application and they own more than 100 games, we want them to explain why they own so many games. For example, perhaps they run a game re-sell shop, or maybe they just enjoy collecting. To conditionally add this requirement, we can use the sometimes
method on the Validator
instance.
$v->sometimes('reason', 'required|max:500', function($input)
{
return $input->games >= 100;
});
The first argument passed to the sometimes
method is the name of the field we are conditionally validating. The second argument is the rules we want to add. If the Closure
passed as the third argument returns true
, the rules will be added. This method makes it a breeze to build complex conditional validations. You may even add conditional validations for several fields at once:
$v->sometimes(array('reason', 'cost'), 'required', function($input)
{
return $input->games >= 100;
});
Note: The
$input
parameter passed to yourClosure
will be an instance ofIlluminate\Support\Fluent
and may be used as an object to access your input and files.
Custom Error Messages
If needed, you may use custom error messages for validation instead of the defaults. There are several ways to specify custom messages.
Passing Custom Messages Into Validator
$messages = array(
'required' => 'The :attribute field is required.',
);
$validator = Validator::make($input, $rules, $messages);
Note: The
:attribute
place-holder will be replaced by the actual name of the field under validation. You may also utilize other place-holders in validation messages.
Other Validation Place-Holders
$messages = array(
'same' => 'The :attribute and :other must match.',
'size' => 'The :attribute must be exactly :size.',
'between' => 'The :attribute must be between :min - :max.',
'in' => 'The :attribute must be one of the following types: :values',
);
Specifying A Custom Message For A Given Attribute
Sometimes you may wish to specify a custom error messages only for a specific field:
$messages = array(
'email.required' => 'We need to know your e-mail address!',
);
Specifying Custom Messages In Language Files
In some cases, you may wish to specify your custom messages in a language file instead of passing them directly to the Validator
. To do so, add your messages to custom
array in the resources/lang/xx/validation.php
language file.
'custom' => array(
'email' => array(
'required' => 'We need to know your e-mail address!',
),
),
Custom Validation Rules
Registering A Custom Validation Rule
Laravel provides a variety of helpful validation rules; however, you may wish to specify some of your own. One method of registering custom validation rules is using the Validator::extend
method:
Validator::extend('foo', function($attribute, $value, $parameters)
{
return $value == 'foo';
});
The custom validator Closure receives three arguments: the name of the $attribute
being validated, the $value
of the attribute, and an array of $parameters
passed to the rule.
You may also pass a class and method to the extend
method instead of a Closure:
Validator::extend('foo', 'FooValidator@validate');
Note that you will also need to define an error message for your custom rules. You can do so either using an inline custom message array or by adding an entry in the validation language file.
Extending The Validator Class
Instead of using Closure callbacks to extend the Validator, you may also extend the Validator class itself. To do so, write a Validator class that extends Illuminate\Validation\Validator
. You may add validation methods to the class by prefixing them with validate
:
<?php
class CustomValidator extends Illuminate\Validation\Validator {
public function validateFoo($attribute, $value, $parameters)
{
return $value == 'foo';
}
}
Registering A Custom Validator Resolver
Next, you need to register your custom Validator extension:
Validator::resolver(function($translator, $data, $rules, $messages)
{
return new CustomValidator($translator, $data, $rules, $messages);
});
When creating a custom validation rule, you may sometimes need to define custom place-holder replacements for error messages. You may do so by creating a custom Validator as described above, and adding a replaceXXX
function to the validator.
protected function replaceFoo($message, $attribute, $rule, $parameters)
{
return str_replace(':foo', $parameters[0], $message);
}
If you would like to add a custom message "replacer" without extending the Validator
class, you may use the Validator::replacer
method:
Validator::replacer('rule', function($message, $attribute, $rule, $parameters)
{
//
});


Instructions for the Apache FOP extension
Introduction
This page describes how to generate barcodes within an XSL-FO document with that is processed with Apache FOP.
Setting up the barcode extension with Apache FOP 0.93 or later
To setup the barcode extension, do the following:
- Add barcode4j.jar and barcode4j-fop-ext.jar to the classpath.
- Alternatively, you can use the combined JAR: barcode4j-fop-ext-complete.jar which combines both Barcode4J and the FOP extension.
Setting up the barcode extension with Apache FOP 0.20.5
To setup the barcode extension, do the following:
- Add barcode4j.jar and barcode4j-fop-ext-0.20.5.jar to the classpath.
- Alternatively, you can use the combined JAR: barcode4j-fop-ext-0.20.5-complete.jar which combines both Barcode4J and the FOP extension.
- Important: When you use FOP 0.20.5 together with Barcode4J, make sure you use the version of Avalon Framework that comes with Barcode4J (or the latest release of Avalon Framework). The version from FOP 0.20.5 is slightly out-of-date.
Using the barcode extension for Apache FOP
This package contains an extension for Apache FOP for generating barcodes.
The barcode extension is tied to the follwing namespace: http://barcode4j.krysalis.org/ns
To create a barcode the Barcode XML can be used within fo:instream-foreign-object elements.
Here's an example (XSL-FO snippet):
<fo:block> <fo:instream-foreign-object> <barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns" message="my message" orientation="90"> <barcode:code128> <barcode:height>8mm</barcode:height> </barcode:code128> </barcode:barcode> </fo:instream-foreign-object> </fo:block>
The attribute "orientation" specifies the orientation of the barcode in degrees. The attribute is optional and if set must be one of the following values: 0, 90, -90, 180, -180, 270, -270.
Some characters like RS (record separator) and GS (group separator) are sometimes required for certain applications but these characters are not valid XML characters and cannot be encoded. You can escape them by using Java's Unicode escaping syntax. To escape RS, you can write "\u001E". GS would be encoded as "\u001D" and so forth. If for some reason, you need to encode a string containing "\u" in your message, you will have to escape that using "\\u", i.e. the double backslash will be converted to a single backslash and the subsequent "u" is treated as a normal message character. It is an error to specify an incomplete escape sequence, i.e. "00\u012xsomething" will result in an error.
Including FOP's page-number in Barcode Output
FOP's page-number can be incorporated into barcode output. To incorporate the page-number into the barcode, insert #page-number# into your barcode message. For example, to insert a page number between 12345- and -6789 do the following:
<barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns" message="12345-#page-number#-6789"> <code39/> </barcode:barcode>
You can also use #page-number:{number-format}# where "{number-format}" is the number format pattern supported by Java's java.text.DecimalFormat. This allows you to format page "3" as "0003" if you need a constant number of characters in the barcode message. For this example, you would use "#page-number:0000#" in the message.
Using FOP from the command-line
If you use FOP from the command-line (by calling fop.bat on Windows) it may not be enough to simply add the JAR files mentioned above to FOP's lib directory. On Unix all JAR files are automatically added to the classpath through the fop.sh script, so you only have to make sure that you don't have two different avalon-framework.jar files the the lib directory. On Windows, you will have to edit fop.bat and manually edit the entries there.
Some technical background
If you wonder how the FOP extension is found by FOP just by adding it to the classpath and by using the right namespace, open the extension JAR in a ZIP Viewer and look at the file in the directory META-INF\services\. FOP will look for this file at startup and will recognize the ElementMapping class.
The normal FOP extension described above internally creates the barcode in SVG format. The generated SVG image is then converted by Batik to the target format (PDF, PostScript or whatever).
The latest FOP versions even allow Barcode4J to generate the barcode in the native output format.For example, when PostScript output is selected in FOP, Barcode4J creates the barcode as an EPS graphic which is generally much faster than taking a detour via SVG.
by Jeremias Märki


Versions are incremented according to semver.
You can use the CloudFlare powered cdnjs.com on your website.
bootstrap-datepicker on cdnjs
Please note: It might take a few hours until a new version is available on cdnjs.
Once you cloned the repo, you'll need to install grunt and the development dependencies using a package manager:
$ [sudo] yarn global add grunt-cli
$ yarn install
$ [sudo] npm install --global grunt-cli
$ npm install


web basics
Computers request over internet information from servers, which is then transmitted through HTML protocol and displayed in a web browser. There are multiple different web browsers available, not always compatible between each other.HTML stands for Hypertext Mark-up language. Unlike text editor (e.g Word or Pages) HTML belongs to the category - what you see is not what you get. The website has to be coded first, in order for the web browser to display it.
key concepts:
tags, inline elements, block elements, void tags, container elements (span/div),links:
01 GitHub https://github.com/02 CodePen http://codepen.io/
03 Scratchpad http://scratchpad.io/
04 Codepen examples http://learn-2-code.appspot.com/code_pen_examples/#azYrBM
05 difference between elements and tags: https://www.udacity.com/course/viewer#!/c-ud721/l-3508959201/m-48723444
06 video on how the web works https://www.udacity.com/course/viewer#!/c-ud721/l-3508959201/e-48329854/m-48480496
html basics
An HTML documents needs to follow a certain structure for it to work (to be correctly interpreted by web browsers):- document type tag
- html tag / top level tag
- head tag:
- link tag (to .css style file)
- title tag
- body tag
- opening / closing tags can be either text or another element
- DOM - document object model, refer to the tree-like structure of a webpage
- DOM - document object model, refer to the tree-like structure of a webpage
Front-end development means translating graphical form or design into HTML page - e.g. implementing/translating graphical design into a webpage.
HTML controls the structure of a website, while CSS controls its style (how the webpage looks).
boxes
Websites follow box design, simple, yet important concept. When building websites, we may think of giving them box-like structure, starting with/from big to small. Sketching this with pencil and paper usually helps with first stages of website building.Boxes are defined with div tags, a block element, which can enclose multiple echelons of indented div-boxes in itself. By boxyfying website content, we can group the content in classes. This allows us to specify how particular classes should look like - this can be done with CSS. E.g. we can design how headers in each particular level look like, without having to do that every time in HTML code.
Hints for structuring a website:
- structure of the page, get it by boxyfying it, look for natural boxes
- size of the boxes, repeated styles of semantic
- where to position them on the page
- write the HTML
- apply styles (from BIGGEST to smallest)
- fix things/
key concepts:
DOM, HTML structure, box, Developer Toolslinks:
01 HTML tutorial: http://www.w3schools.com/02 The W3C Markup Validation Service http://validator.w3.org/#validate_by_input


EastEnders fans fear Chantelle is in danger after standing up to abusive husband Gray
Viewers have seen Gray hit his wife on multiple occasions
by Charlotte RodriguesFans of EastEnders fear that Chantelle Atkins is in danger after she stood up to her abusive husband Gray.
Over the past few months, viewers have seen Chantelle being physically abused by Gray, but he promised to get therapy for his anger after finding out Chantelle was pregnant with their third child.
However, a couple of weeks ago Chantelle had a miscarriage, but kept it secret from her husband.
Last week, Karen accidentally told Gray Chantelle had lost the baby, assuming he already knew.
In last night's episode of the soap (November 19 2019), Chantelle found out from Jack that Gray's fight in the club resulted in the other man having a broken nose and missing teeth.
Furious that he lied, Chantelle confronted her husband but when he started to grab her shoulders and shake her, she told him she was scared of him.
Later Gray took his wife to his therapy session, but she was soon disappointed when the therapist asked if he had ever been violent and he only admitted to the incident in the club, and not to the fact he regularly beat Chantelle.
Back at home, Chantelle made it clear she wasn't happy with Gray and stood up for herself.
She told Gray that until he sorted himself out, there's no way they would be having another baby together.
Chantelle then proceeded to leave the house as she went to meet Whitney for a drink.

Emmerdale airs weeknights at 7pm on ITV, with an extra episode at 8pm on Thursdays.
Leave us a comment on our Facebook page @EntertainmentDailyFix and let us know what you think!


WikiLeaks<EMAIL_ADDRESS>leaked emails, 2009 mail archive
This message is part of a particular mailbox provided at WikiLeaks
and it should be discussed here.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Worship team Operations
Greetings Pastor Jon/Senior Pastor-- We got this off the web with respect to
crafting an A/N Worship team. I used to be a Full Gospel Church of San Diego
Song Leader. With respect to operations, we will run this within the
framework of the AZ-CA Joint Staff agreement......
Respectfully,
Bob,Facilitator
Church of Jesus Christ Christian ,
Arizona Worship Team
Worship Team Definition
The Worship Team consists of those persons involved in leading the people in
corporate worship. Although we generally only think of the Worship Leader
and musicians as making up the Worship Team, it in fact consists of at least
the following individuals:
Musicians;
Hand signers;
Singers;
Overhead projectionists;
Mixing board operators;
Home Group Attendance
We believe that at New Wine, Home Care Groups are our life blood (until God
tells us otherwise). Our vision is to build New Wine upon relationships
rather than on talents and gifts, and the Home Care Groups serve as the
primary centres for building these relationships. It is in the Home Care
Groups and through the relationships developed there, that our vision of the
church is imparted to new members of New Wine.
It is not out of a desire to see prospective Worship Team members perform
that attendance is required. Rather, it has been our experience that until
new members of New Wine become committed to a Home Care Group they do not
integrate fully into the life of the church. Therefore, we require that
until one is committed to a Home Care Group he will not be considered for
membership on a Worship Team.
A Worshipper First
The Father seeks true worshippers: those who worship in Spirit and in truth.
Also, in the body of Christ we lead through service. Therefore, as it is the
purpose of the Worship Team to lead the people in worship, it is a necessity
that Worship Team members be able to worship; regardless of their place in
the church, or the surrounding circumstances. If an individual cannot
worship then he will be unable to lead others in worship.
A Servant Second
In the body of Christ we lead by serving. Unless a Worship Team member is
willing to give himself to service, he will be unable to lead others in
worship. While not everyone has service as a primary motivational gift,
everyone can develop a servant's heart. All Christians should be seeking
this heart attitude, in any case.
A Team Member Third
Worship Team members are just that: Members of a team. Unless they are able
to submit themselves to the Team leadership, and integrate and work with the
other members of the Worship Team, they will hinder rather than help lead
the people in worship. We do not expect that conflict will never exist. But,
team members need to be able to allow iron to sharpen iron by dying to self.
Crucifying the flesh doesn't mean nailing your brother to the cross!
Whether a prospective Worship Team member fits in can only be determined as
relationships are built between existing and prospective Worship Team
members. While New Wine presently has a single Worship Team, we may
eventually have more than one. And, we recognize that a prospective team
member may fit better into one group than another.
A Musician/Technician Fourth
Excellence, not perfection is demanded of Worship Team members. Team members
must be proficient enough with their instruments and equipment to perform
the duties required. Whether a member is proficient enough will be
determined on a individual basis.
As always, attitude is as important as aptitude. As Christians we are called
to do everything as unto the Lord. In other words, we are to perform our
duties "in excellence." From a performance perspective, excellence is
different for someone with a year's experience than for a ten year veteran.
However, there shouldn't be any difference in attitude between two such
individuals.
Must Be Teachable
No matter how long we perform a task, there is always room for improvement.
Members of the Worship Team must always remain teachable that we may
continually hone our skills. God is always doing something new, and unless
we remain soft and flexible we will not be able to move with Him.
It is also expected that team members will individually pursue further
training, where it is appropriate. For seasoned musicians this may take the
form of refresher courses in technique, or further theory; while for
technicians it would probably involve something else.
Common Vision
A prospective Worship Team member must share the vision we have for worship;
or he must be willing to buy into New Wine's vision. Unless all team members
share a common vision, there will be unnecessary tension within the team.
For example, if one team member wants a C&W sound, and another a Rock sound,
there will always be friction. Any such friction will hinder the teams
effectiveness in ministry.
_________________________________________________________________
Stay in touch with old friends and meet new ones with Windows Live Spaces
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
Entry for this page on WikiLeaks |
Discussion page on WikiLeaks |
wikileaks.org
Date Index |
Thread Index |
Author Index


This is the Main Headline
First paragraph
Sub-Heading 1
Second paragraph
Sub-Heading 2
Third Paragraph
Sub-Sub-Heading
Fourth Paragraph


The purpose of this test is to measure bandwidth for several combinations read/write, such as rd, rdwr, cp, frd, fcp, bzero, bcopy
This test outputs how the lmbench function is called followed by the data:
The first data is the size of the block moved in MB. The second is the data rate in MB/s.
This test is setup to move 1MB of data between ARM and DDR in various ways:
From the command line: bw_mem 1M [rd | rdwr | cp | frd | fcp | bzero | bcopy]
rd - measures the time to read data into the processor. It computes the sum of an array of integer values. It accesses every fourth word.
rdwr - measures the time to read data into memory and then write data to the same memory location. For each element in an array it adds the current value to a running sum before assigning a new (constant) value to the element. It accesses every fourth word.
cp - measures the time to copy data from one location to another. It does an array copy: dest[i] = source[i]. It accesses every fourth word.
frd - measures the time to read data into the processor. It computes the sum of an array of integer values.
fcp - measures the time to copy data from one location to another. It does an array copy: dest[i] = source[i].
bzero - measures how fast the system can bzero memory.
bcopy - measures how fast the system can bcopy data.


I love salads because they are a delicious healthy meal. There is truly a salad combo for everyone to love!! You don’t have to be super culinary. Just take out the chopping board and pick your ingredients. Quantities can vary. It’s a perfect way to use up the various fruits and veggies you have on hand. I like to make seasonal salads, choosing to add berries in the Summer and apples in the Fall.
Pictured above is the fall-harvest-salad-with-apple-cider-vinaigrette. Click here for this recipe. Salads


Saxon runs all the XQuery Use Cases with the exception of the STRONG use case, which is designed to exercise schema-aware query processors.
The relevant queries (some of which have been corrected from those published by W3C) are included
in the Saxon distribution (folder use-cases
) together with a batch script for running them.
A few additional use cases have been added to show features that would otherwise not be exercised.
Also included in the distribution is a query samples\query\tour.xq
. This is a query that
generates a knight's tour of the chessboard. It is written as a demonstration of recursive functional
programming in XQuery. It requires no input document. You need to supply a parameter on the command
line indicating the square where the knight should start, for example start=h8
. The output
is an HTML document.


Today's special Offers !
Contact Us
Checkout
SL No.
Product
Quality
Product Name
Price
Remove
1
Fortune Sunflower Oil
$290.00
2
Basmati Rise (5 Kg)
$250.00
3
Pepsi Soft Drink (2 Ltr)
$15.00
CONTINUE TO BASKET
Product1 -
Product2 -
$25.00
Product3 -
$29.00
Total Service Charges -
Total -
$84.00


{{text}}
Anyone who uses arithmetic methods to produce random numbers is in a state of sin. --- John von Neumann
Anyone who uses arithmetic methods to produce random numbers is in a state of sin.


| Infi-Invest/Infinnovation as of 05/10/16 |
- INR 10, 00,000 will be given as the virtual capital.
- Credit facility will be provided @6% on the principal value.
- Trade commission fees will be charged @INR 10 per transaction.
- The regulation and speculation of stock prices will be done through this app.(It represents simulated stock exchange and does not reflect the values of a real stock market).
- The prices of the securities invested in will be provided in the app itself.
- The prices of the securities will be based on the general trend of the company.
- The fluctuations on the event day will be regulated by the panel with respect to an imaginary economic situation.
- The participants must have a minimum of 75% of their account balances invested in securities before the onstage event begins.
- The updates provided on stage will affect the prices of the stocks held by the participants. The updates will be provided by the panel sector wise, after which the school with the highest portfolio wins.
|


---
layout: post
title: mach-ii and form validation
tags: []
status: draft
type: post
published: false
meta: {}
---
I have just completed my 4th mach-ii application at work and once and for all I wanted to jot down, how I implemented the validation of submitted form data.
For starters you need the validateFormObject filter which you can find here and extract it to your applications filter folder.
You'll need to add/register this Filter with your mach-ii.xml file as follows (bearing in mind that the type is the full qualified path to validateFormObject.cfc):
[code][/code]
OK so here is how it works a user submits the form, a new event is announced, in this example doAdd, and this event looks a little as follows in my mach-ii.xml.
[code]
[/code]
So the even is announced and populates a bean using the <event-bean> declaration. This beans has getters and setters for all of the fields passed in, i.e. udvalue,udfvlst,uddesc. It also has a couple of getter and setter methods for a structure of errors and also a validate method. Below is a shortened snapshot of the bean in question.
[code]
variables.instance = structNew();
setUDValue(arguments.udvalue);
setUdfvlst(arguments.udfvlst);
setUddesc(arguments.uddesc);
variables.myErrors = structNew();
... more getter and setters ...
[/code]
The validate method is the one that validateFormObject will call. Inside this method you can then do whatever type of validation you need. I know that the above could have been done by using another built-in filter (namely RequiredFieldsFilter), but this is just an example of using this filter. Here we carry out our validation and populate a structure with our errors (using setErrors()). The filter itself expects to receive a boolean value so if any errors were encountered we set the isValid flag to false (by default it is set to true) and return that, which causes the event queue to be cleared and a new event to be announced: formHasInvalidValues.
[code]
[/code]
That event simply spits out the errors that were generated to a page.
Sorry the form you just submitted contained the following errors:
tmpyStruct = request.event.getArg('udvBean').getErrors();
WriteOutput("
");
for (idx in tmpyStruct) {
WriteOutput("
- "&tmpyStruct[idx]&"
");
}
WriteOutput("
");
Click here to return to previous page.
[/code]
If on the other hand no error were encountered, true is returned and processing continues by requesting the addItem method from our listener.


For May, at the top of the rankings, everything stayed pretty much the same as it was in April. Remote hiring is still very popular, with 75% of postings including it. On the techonology front, React is still the only tech term in the top 5, with about 26% of postings including it.
There is one new entrant in the Top 20. Terraform, the popular Infrastructure as code (IaC) tool from HashiCorp, had a strong month and makes its debut in the Top 20. AI is back in the in the Top #20 after briefly dropping lower in previous months.
Of note for technology on the way down or out, Hadoop logged 0 mentions in May, the second time in 3 months. The platform that was on the forefront of Big Data a decade ago, has fallen out of favor.
May has been a tumultous month in the software hiring market. With layoffs and hiring freezes at several companies, the near-term future faces uncertainty. May's Ask HN: Who is Hiring? did see a slight bump with total postings up 4% over April. But, with the bulk of the postings coming earlier in the month of May, that growth may well have dried up in the weeks since. With the June thread kicking off in a couple days, we'll see soon enough how the overall hiring market is impacting this specific niche.
TypeScript is the Top Programming Language for the second month in a row, having dethroned Python in April. Python and Go remain in strong positions at #2 and #3 respectively. Kotlin is back in the Top 10 this month, knocking out C#.
Compare Top 10 Programming Languages
Compare node.js, Rails, PHP and Django
Compare React, Angular, Vue, and Ember
Compare Postgresql, MySQL and SQL Server
Compare Mongodb, Elasticsearch, Cassandra and DynamoDB
Compare Terraform, Chef, Puppet, Ansible and CloudFormation
Compare Docker, Kubernetes, Mesos and Terraform
Compare API, REST, GraphQL, and gRPC
| Tech | Rank | Last Month | Change | Last Year | Change |
|---|---|---|---|---|---|
| Remote | 1 | 1 | 0 | 1 | 0 |
| Senior | 2 | 2 | 0 | 2 | 0 |
| React | 3 | 3 | 0 | 4 | +1 |
| Back End | 4 | 4 | 0 | 3 | -1 |
| Front End | 5 | 5 | 0 | 5 | 0 |
| TypeScript | 6 | 6 | 0 | 10 | +4 |
| Python | 7 | 7 | 0 | 8 | +1 |
| Full Stack | 8 | 10 | +2 | 7 | -1 |
| Postgresql | 9 | 8 | -1 | 9 | 0 |
| AWS | 10 | 9 | -1 | 6 | -4 |
| golang | 11 | 11 | 0 | 12 | +1 |
| DevOps | 12 | 13 | +1 | 16 | +4 |
| Machine Learning | 13 | 14 | +1 | 19 | +6 |
| node.js | 14 | 12 | -2 | 11 | -3 |
| Kubernetes | 15 | 17 | +2 | 18 | +3 |
| JavaScript | 16 | 16 | 0 | 14 | -2 |
| Rails | 17 | 15 | -2 | 13 | -4 |
| AI | 18 | 22 | +4 | 26 | +8 |
| Ruby | 19 | 20 | +1 | 15 | -4 |
| Terraform | 20 | 26 | +6 | 31 | +11 |
| Tech | Mentions | Rank | Last Year Mentions | Last Year Rank | Change |
|---|---|---|---|---|---|
| FastAPI | 7 | 85 | 1 | 193 | +108 |
| WebRTC | 5 | 102 | 1 | 189 | +87 |
| ClickHouse | 9 | 76 | 3 | 137 | +61 |
| F# | 7 | 84 | 3 | 142 | +58 |
| web3 | 10 | 72 | 4 | 128 | +56 |
| PyTorch | 10 | 69 | 4 | 121 | +52 |
| SQL Server | 5 | 100 | 3 | 144 | +44 |
| Bitcoin | 6 | 94 | 3 | 138 | +44 |
| Ember | 6 | 97 | 3 | 136 | +39 |
| Robotics | 18 | 56 | 7 | 94 | +38 |


This is a demo of the e-comments self-hosted comment server.
The code was initially developed to provide comments for a 100% static site (http://tweaked.io : server optimization.)
Comments will appear below this area, once loaded via a cross-domain JSONP request. A second demo shows a customized reply-form.


Hulu in December: Here's Everything Coming and Going
From Season 6 of “Younger” to Season 3 of “Marvel’s Runaways”
by Margeaux SippellHulu is out with its monthly list of everything coming and going. This December, new additions include Season 6 of “Younger,” two new episodes of “Into the Dark,” and Season 3 of “Marvel’s Runaways.”
According to Hulu’s description, here’s what’s going on in the the new season of “Younger”: “After Liza lands her dream job by posing as a millennial, she realizes that the truth is much better than fiction.” That’s out Dec. 3.
Season 3 of “Marvel’s Runaways,” in which the Runaways search for their captured friends, is out Dec. 13.
Also Read:
On Dec. 6, “Into The Dark: A Nasty Piece of Work” finds a mid-level employee at a big company faced with a challenge: in order to climb the corporate ladder, he must beat his co-worker in a violent competition.
On Dec. 27 comes “Into The Dark: Midnight Kiss,” which Hulu describes like this: “A group of longtime gay best friends and their resident fruit fly head to a beautiful desert home to celebrate New Year’s Eve. One of their annual traditions is to play Midnight Kiss, a sexy but ultimately dangerous challenge to find that special someone to help you ring in the New Year. As friendships have grown strained with secrets, jealousy and resentment, the group faces another challenge when a sadistic killer wants in. Relationships are put to the test and truths are revealed as the night turns into a fight for survival.”
Season 2 of “Killing Eve,” described by AMC as the story of “two women bound by a mutual obsession and one brutal act,” lands on Hulu on Dec. 18, and Season 1 of a Hulu original called “Reprisal,” described as a “hyper-noir story that follows a relentless femme fatale,” is out Dec. 6.
Also Read:
Leaving the site after Dec. 31 are “American Beauty,” “Fatal Attraction,” “Requiem For a Dream” and “Saturday Night Fever,” among other films.
Here’s the complete list of everything coming and going on Hulu in December:
December 1
Unikitty: Complete Season 2A (Cartoon Network)
Gintama: Complete Season 1 (SUB & DUB) (TV Tokyo)
2 Fast 2 Furious (2003)
28 Weeks Later (2007)
A Better Life (2011)
A Fairly Odd Movie: Grow Up, Timmy Turner! (2011)
Airheads (1994)
Almost Famous (2000)
The Aviator (2004)
Behind Enemy Lines (2001)
Bug (1975)
Ca$h (2010)
Cheri (2009)
Downhill Racer (1969)
Escape from Mr. Lemoncello’s Library (2017)
The Fast and the Furious (2001)
The Fast and the Furious: Tokyo Drift (2006)
Footloose (1984)
Half-Shell Heroes: Blast to the Past (2015)
Hamlet (1990)
Havana Motor Club (2015)
Heartbreakers (2001)
Hellboy II: The Golden Army (2008)
In Secret (2014)
Just Married (2003)
Kill Bill: Volume 1 (2003)
Kill Bill: Volume 2 (2004)
Legend of the Drunken Master (1994)
LOL (2012)
The Massively Mixed-Up Middle School Mystery (2015)
Meet Joe Black (1998)
Nobody’s Fool (1995)
Out of Time (2003)
The Pawnbroker (1964)
Phase IV (1974)
Prancer (1989)
Rags (2012)
Road House (1989)
Secretary (2002)
Set Up (2011)
Some Kind of Wonderful (1987)
Sorority Row (2009)
The Spirit (2008)
Splitting Adam (2015)
Swindle (2013)
Transporter 2 (2005)
Wall Street (1987)
The Winning Season (2010)
December 2
This One’s For the Ladies (2019)
December 3
Making It: Season 2 Premiere (NBC)
The Great Christmas Light Fight: Season 7 Premiere (ABC)
Vanderpump Rules: Complete Season 7 (Bravo)
Younger: Complete Season 6 (TV Land)
My Boss’s Daughter (2003)
Also Read:
December 4
Brad Paisley Thinks He’s Special: Special (ABC)
CMA Country Christmas: Special (ABC)
Fruits Basket: Complete Season 1 (Funimation)
December 5
The Moody’s: Series Premiere (FOX)
How to Train Your Dragon: Homecoming (2019)
How to Train Your Dragon: Snoggletog Log (2019)
Killers Anonymous (2019)
December 6
Burden of Truth: Complete Season 2 (eOne)
Into The Dark: A Nasty Piece of Work: Episode Premiere (Hulu Original)
Reprisal: Complete Season 1 Premiere (Hulu Original)
Top Chef: Complete Season 16 (Bravo)
The Push (2019)
December 8
From Paris with Love (2010)
December 9
Miss Universe 2019: Special (FOX)
December 11
Ellen’s Greatest Night of Giveaways: Series Premiere (NBC)
Sherman’s Showcase: Complete Season 1 (IFC)
Fast Color (2019)
December 12
Blackfish (2013)
December 13
Marvel’s Runaways: Complete Season 3 Premiere (Hulu Original)
The Great American Baking Show: Season 5 Premiere (ABC)
Bumblebee (2018)
Depraved (2019)
The Sounds of Silence (2019)
Also Read:
December 16
American Gangster (2007)
Fast & Furious (2009)
Wild Rose (2019)
December 17
Holidays with the Houghs: Special (NBC)
Mighty Magisworlds: Complete Season 2B (Cartoon Network)
December 18
Killing Eve: Complete Season 2 (BBCA)
Live in Front of a Studio Audience: All in the Family and Good Times: Special (ABC)
The Kid (2019)
December 19
Mix: Complete Season 1 (Funimation)
Cold Case Hammarskjold (2019)
December 20
Miss America Pageant: Special (NBC)
Loro (2019)
December 23
Pawn Sacrifice (2014)
December 24
Black Jesus: Complete Season 3 (Adult Swim)
December 27
Into The Dark: Midnight Kiss: Episode Premiere (Hulu Original)
The Day Shall Come (2019)
December 28
Better Things: Complete Season 3 (FX)
December 29
Preacher: Complete Season 4 (AMC)
December 30
Flirty Dancing: Series Premiere (FOX)
OK K.O., Let’s Be Heroes! Complete Season 2B (Cartoon Network)
The Orville: Complete Season 2 (FOX)
Anesthesia (2016)
Running with the Devil (2019)
Transformers: Dark of the Moon (2011)
What Men Want (2019)
Wonder Park (2018)
Also Read:
Leaving Hulu in December:
December 31
A Simple Plan (1998)
A View to Kill (1985)
American Beauty (1999)
Basic Instinct (1992)
Be Cool (2005)
Beautiful Creatures (2013)
Big Top Pee-Wee (1988)
Birthright: A War Story (2017)
Blown Away (1993)
Boyz N’ The Hood (1991)
Brooklyn’s Finest (2010)
Cadillac Man (1990)
Children of the Corn (1984)
Chinatown (1974)
Cloverfield (2008)
Crash (2005)
Curse of the Zodiac (2007)
Days of Thunder (1990)
Dead Heat (2002)
Demolition Man (1993)
Destiny Turns on the Radio (1995)
Double Jeopardy (1999)
Election (1999)
Escape from Alcatraz (1979)
Event Horizon (1997)
Far from Home (1989)
Fatal Attraction (1987)
Fire with Fire (2012)
Firstborn (1984)
Flight 7500 (2014)
Forces of Nature (1999)
Free to Run (2016)
Get Shorty (1995)
Ghost World (2001)
Girls Just Want to Have Fun (1985)
Heathers (1989)
High Noon (1952)
Hot Tub Time Machine (2010)
Imposter (2002)
Interview with the Vampire (1994)
Kalifornia (1993)
Kingpin (1996)
Love Crimes (1992)
Magic Mike (2012)
Mousehunt (1997)
Much Ado About Nothing (2013)
Never Back Down (2008)
No Holds Barred (1989)
Patriot Games (1992)
Permanent Midnight (1998)
Pieces of April (2003)
Platoon (1986)
Project Nim (2011)
Rent (2005)
Requiem for a Dream (2000)
Sacred Ground (1983)
Saturday Night Fever (1977)
School Times (1992)
Split Decisions (1988)
Stand Up Guys (2012)
Sucker Punch (2008)
Tales from the Darkside: The Movie (1990)
Terminator 3: Rise of the Machines (2003)
Terminator Salvation (2009)
Top of the Food Chain (2000)
Total Recall (1990)
Trading Moms (1994)
True Colors (1991)
True Grit (1969)
Universal Soldier (1992)
Vampire in Brooklyn (1995)
Varsity Blues (1999)
Witness (1985)
Will Elizabeth Banks’ “Charlie’s Angels” reboot soon join this list of films with female directors (or co-directors)?
View In Gallery


Classes and Modules
- CLASS AdWords::V200909::CampaignService::AdGroupBids
- CLASS AdWords::V200909::CampaignService::AdServingOptimizationStatus
- CLASS AdWords::V200909::CampaignService::ApiError
- CLASS AdWords::V200909::CampaignService::ApiException
- CLASS AdWords::V200909::CampaignService::ApplicationException
- CLASS AdWords::V200909::CampaignService::AuthenticationError
- CLASS AdWords::V200909::CampaignService::AuthenticationErrorReason
- CLASS AdWords::V200909::CampaignService::AuthorizationError
- CLASS AdWords::V200909::CampaignService::AuthorizationErrorReason
- CLASS AdWords::V200909::CampaignService::AutoKeywordMatchingStatus
- CLASS AdWords::V200909::CampaignService::Bid
- CLASS AdWords::V200909::CampaignService::BiddingError
- CLASS AdWords::V200909::CampaignService::BiddingErrorReason
- CLASS AdWords::V200909::CampaignService::BiddingStrategy
- CLASS AdWords::V200909::CampaignService::BiddingTransition
- CLASS AdWords::V200909::CampaignService::BiddingTransitionError
- CLASS AdWords::V200909::CampaignService::BiddingTransitionErrorReason
- CLASS AdWords::V200909::CampaignService::Budget
- CLASS AdWords::V200909::CampaignService::BudgetBudgetDeliveryMethod
- CLASS AdWords::V200909::CampaignService::BudgetBudgetPeriod
- CLASS AdWords::V200909::CampaignService::BudgetError
- CLASS AdWords::V200909::CampaignService::BudgetErrorReason
- CLASS AdWords::V200909::CampaignService::BudgetOptimizer
- CLASS AdWords::V200909::CampaignService::BudgetOptimizerAdGroupBids
- CLASS AdWords::V200909::CampaignService::C_RangeError
- CLASS AdWords::V200909::CampaignService::Campaign
- CLASS AdWords::V200909::CampaignService::CampaignError
- CLASS AdWords::V200909::CampaignService::CampaignErrorReason
- CLASS AdWords::V200909::CampaignService::CampaignOperation
- CLASS AdWords::V200909::CampaignService::CampaignPage
- CLASS AdWords::V200909::CampaignService::CampaignReturnValue
- CLASS AdWords::V200909::CampaignService::CampaignSelector
- CLASS AdWords::V200909::CampaignService::CampaignServiceWrapper
- CLASS AdWords::V200909::CampaignService::CampaignStatus
- CLASS AdWords::V200909::CampaignService::ClientTermsError
- CLASS AdWords::V200909::CampaignService::ClientTermsErrorReason
- CLASS AdWords::V200909::CampaignService::ComparableValue
- CLASS AdWords::V200909::CampaignService::ConversionOptimizer
- CLASS AdWords::V200909::CampaignService::ConversionOptimizerAdGroupBids
- CLASS AdWords::V200909::CampaignService::ConversionOptimizerBiddingTransition
- CLASS AdWords::V200909::CampaignService::DatabaseError
- CLASS AdWords::V200909::CampaignService::DatabaseErrorReason
- CLASS AdWords::V200909::CampaignService::DateError
- CLASS AdWords::V200909::CampaignService::DateErrorReason
- CLASS AdWords::V200909::CampaignService::DateRange
- CLASS AdWords::V200909::CampaignService::DistinctError
- CLASS AdWords::V200909::CampaignService::DistinctErrorReason
- CLASS AdWords::V200909::CampaignService::DoubleValue
- CLASS AdWords::V200909::CampaignService::EntityNotFound
- CLASS AdWords::V200909::CampaignService::EntityNotFoundReason
- CLASS AdWords::V200909::CampaignService::FrequencyCap
- CLASS AdWords::V200909::CampaignService::Get
- CLASS AdWords::V200909::CampaignService::GetResponse
- CLASS AdWords::V200909::CampaignService::InternalApiError
- CLASS AdWords::V200909::CampaignService::InternalApiErrorReason
- CLASS AdWords::V200909::CampaignService::Level
- CLASS AdWords::V200909::CampaignService::ListReturnValue
- CLASS AdWords::V200909::CampaignService::LongValue
- CLASS AdWords::V200909::CampaignService::ManualCPC
- CLASS AdWords::V200909::CampaignService::ManualCPCAdGroupBids
- CLASS AdWords::V200909::CampaignService::ManualCPM
- CLASS AdWords::V200909::CampaignService::ManualCPMAdGroupBids
- CLASS AdWords::V200909::CampaignService::Money
- CLASS AdWords::V200909::CampaignService::Mutate
- CLASS AdWords::V200909::CampaignService::MutateResponse
- CLASS AdWords::V200909::CampaignService::NewEntityCreationError
- CLASS AdWords::V200909::CampaignService::NewEntityCreationErrorReason
- CLASS AdWords::V200909::CampaignService::NotEmptyError
- CLASS AdWords::V200909::CampaignService::NotEmptyErrorReason
- CLASS AdWords::V200909::CampaignService::NotWhitelistedError
- CLASS AdWords::V200909::CampaignService::NotWhitelistedErrorReason
- CLASS AdWords::V200909::CampaignService::NullError
- CLASS AdWords::V200909::CampaignService::NullErrorReason
- CLASS AdWords::V200909::CampaignService::NumberValue
- CLASS AdWords::V200909::CampaignService::Operation
- CLASS AdWords::V200909::CampaignService::OperationAccessDenied
- CLASS AdWords::V200909::CampaignService::OperationAccessDeniedReason
- CLASS AdWords::V200909::CampaignService::Operator
- CLASS AdWords::V200909::CampaignService::OperatorError
- CLASS AdWords::V200909::CampaignService::OperatorErrorReason
- CLASS AdWords::V200909::CampaignService::Page
- CLASS AdWords::V200909::CampaignService::Paging
- CLASS AdWords::V200909::CampaignService::PricingModel
- CLASS AdWords::V200909::CampaignService::QuotaCheckError
- CLASS AdWords::V200909::CampaignService::QuotaCheckErrorReason
- CLASS AdWords::V200909::CampaignService::QuotaError
- CLASS AdWords::V200909::CampaignService::QuotaErrorReason
- CLASS AdWords::V200909::CampaignService::QuotaExceededError
- CLASS AdWords::V200909::CampaignService::QuotaExceededErrorReason
- CLASS AdWords::V200909::CampaignService::RangeErrorReason
- CLASS AdWords::V200909::CampaignService::ReadOnlyError
- CLASS AdWords::V200909::CampaignService::ReadOnlyErrorReason
- CLASS AdWords::V200909::CampaignService::RequiredError
- CLASS AdWords::V200909::CampaignService::RequiredErrorReason
- CLASS AdWords::V200909::CampaignService::ServingStatus
- CLASS AdWords::V200909::CampaignService::SizeLimitError
- CLASS AdWords::V200909::CampaignService::SizeLimitErrorReason
- CLASS AdWords::V200909::CampaignService::SoapHeader
- CLASS AdWords::V200909::CampaignService::SoapResponseHeader
- CLASS AdWords::V200909::CampaignService::Stats
- CLASS AdWords::V200909::CampaignService::StatsNetwork
- CLASS AdWords::V200909::CampaignService::StatsQueryError
- CLASS AdWords::V200909::CampaignService::StatsQueryErrorReason
- CLASS AdWords::V200909::CampaignService::StatsSelector
- CLASS AdWords::V200909::CampaignService::StringLengthError
- CLASS AdWords::V200909::CampaignService::StringLengthErrorReason
- CLASS AdWords::V200909::CampaignService::TimeUnit


[gecode-users] buggy parallel search
Denys Duchier
denys.duchier at univ-orleans.fr
Fri Feb 5 15:01:34 CET 2010
"Christian Schulte" <cschulte at kth.se> writes:
> Alas, it looks as if there is a bug. Which engine? Which problem? How many
> cores? Aaargh...
engine : bab with 2 threads
problem: don't know how to answer that question. it's an NLP application
that we have developed
cores : Core 2 Duo
I was actually chasing another bug in parallel search where gecode
segfaults when deleting a space in a worker. I recompiled with
--enable-debug. It often takes several tries under gdb to observe the
problem. This time I got a different problem, which is the one I
reported.
Cheers,
--Denys
More information about the users
mailing list


Some of my skills percentage in different categories like...
Programming Languages
Web Development
Scripting Languages
Something that describes me !
To do a work which will allow to utilize coding, web development and machine learning skills and increase willingness to learn new things. And also have to tack skills even further beyond then their levels.
https://www.freecodecamp.org/certification/rony_20/responsive-web-design
https://www.freecodecamp.org/certification/rony_20/javascript-algorithms-and-data-structures
In : Elluminati Inc.
On : Web Designing
At : Rajkot(Gujrat)
During : 03/06/2018 to 23/03/2018
Below is some of my educational details.
Year : 3rd B.Tech(CP)
CPI: 8.08
College: B.V.M. Engineering College
Percentage : 91.66%
School : Imperial Science School-Dhoraji
Year of passing : 2016
Percentage : 90.00%
School : Noble High School-Junagadh
Year of passing : 2014
Guys, you can contact me here.


Userguide
Should we do that here or link to the Wiki? Anyway, here's the proposed structure so far ...
- Basics
- UserAdmin Service
- UserAdmin Extender
- UserAdmin Providers
- Bundles
- UserAdmin Service
- Purpose
- Bundle Info
- Configuration
- Ldap Provider
- Preferences Provider
- References


Hack SC Junior will be be held Saturday, March 25th. Check in will be from 10:30am to 11:00am in front of Taper Hall of Humanities at USC. The students will be grouped into teams of 2-4 of similar age and each team will have a USC student volunteer. The day will consist of mostly coding, with small breaks which will include brain teasers, outdoor games, and lunch.
We will be hosting a Facebook engineer who will give a talk explaining a day in the life a software engineer. Additionally, there will be other workshops held throughout the day including an Oculus demo.
The theme of this Hack SC Jr. is “Life Hacks,” and we hope the students can code an innovative application that could improve an everyday device or how something is done. The students can use Scratch, Java, or Web development to create their projects.
Prizes will be rewarded to most creative and technically challenging projects per age group. Judging will start around 5:00pm and prizes will be awarded around 6:00pm. Parents should plan to come from 6:00pm to see the prize ceremony and to pick up your students.
Hack SC Jr.'s 2017 Life Hacks has already occured!
If you are interested in any future Hack SC Jr. hack please email<EMAIL_ADDRESS>Feel free to contact us with any questions or if you'd like to sponsor us.


DNA test confirms McGregor did not father love child
A DNA test has confirmed that Conor McGregor is not the father of a love child.
The baby's mother claimed that they met in Liverpool in 2017, and had sex twice after which she fell pregnant.
Thirty-one-year-old MMA star Conor McGregor has been at the centre of accusations that he was the father of the baby girl, who will be two in January.
The girl's 26-year-old mother claims that she and McGregor met when he was in Liverpool for the Aintree Grand National Festival in 2017.
She claimed the alleged affair took place just four weeks before McGregor's first child was born.
McGregor had denied the claims and he took a DNA test.
The results show that that there are no biological markers present that would prove he is the father.
READ MORE
Conor McGregor avoids jail for assault, conviction could put US fighting career in jeopardy


An interface for specifying how devices with buttons should behave. More...
Public Member Functions | |
| bool | IsButtonDown (ButtonIDType button) |
| Implementers should return true when a button is first depressed. More... | |
| bool | IsButtonPressed (ButtonIDType button) |
| Implementers should return true while the button is depressed. More... | |
| bool | IsButtonUp (ButtonIDType button) |
| Implementers should return true when the button is first released. More... | |
Properties | |
| bool | IsConnected [get] |
| Implementers should use this to indicate the connection status of the controller. More... | |
| bool | AnyButtonPressed [get] |
| Implementers should return true when any button on the controller has been depressed. More... | |
An interface for specifying how devices with buttons should behave.
| ButtonIDType | An enumeration type for the native button field for the device. |
| ButtonIDType | : | struct |
Definition at line 7 of file IPointerButtons.cs.
| bool Juniper.Input.Pointers.IPointerButtons< ButtonIDType >.IsButtonDown | ( | ButtonIDType | button | ) |
Implementers should return true when a button is first depressed.
| button |
Implemented in Juniper.Input.Pointers.AbstractPointerDevice< ButtonIDType, ConfigType, HapticType >.
| bool Juniper.Input.Pointers.IPointerButtons< ButtonIDType >.IsButtonPressed | ( | ButtonIDType | button | ) |
Implementers should return true while the button is depressed.
| button |
Implemented in Juniper.Input.Pointers.AbstractPointerDevice< ButtonIDType, ConfigType, HapticType >.
| bool Juniper.Input.Pointers.IPointerButtons< ButtonIDType >.IsButtonUp | ( | ButtonIDType | button | ) |
Implementers should return true when the button is first released.
| button |
Implemented in Juniper.Input.Pointers.AbstractPointerDevice< ButtonIDType, ConfigType, HapticType >.
|
get |
Implementers should return true when any button on the controller has been depressed.
Definition at line 22 of file IPointerButtons.cs.
|
get |
Implementers should use this to indicate the connection status of the controller.
Definition at line 14 of file IPointerButtons.cs.


Improvements for best result on each iteration of the experiment
Statistical distribution for all and average results on each configuration in the experiment
Compare average results and measurements repeats with deviation for experiments.
The standard deviation is the square root of the average of the squared deviations from the mean.


available sources
The rooms of Hotel Cellai are extremely comfortable, equipped with warm and precious materials and personalized with authentic antiques expertly chosen one by one in the many markets of Tuscany.
This passion for detail contributes to the intimate, tranquil atmosphere which transforms each room into a pleasant refuge within the bustling city of Florence, in a place where guests can relax after a day spent touring and admiring the many beautiful artistic and architectural sites in the city which cradled the Renaissance.
Each bedroom at Cellai Hotel has been individually designed in a fresh concept mixing tradition, precious fabrics, period furnitures, italian vintage design, original photos, prints and paintings.
Rooms are light and comfortable and well appointed with a writing desk, wireless internet access and flat screen TV's. Rooms overlooking the front have double soundproof windows.


This article is part of a series of articles about three.js. The first article is three.js fundamentals. If you haven't read that yet and you're new to three.js you might want to consider starting there. The previous article was about cameras which is important to have read before you read this article as well as the article before that one about lights.
Shadows on computers can be a complicated topic. There are various solutions and all of them have tradeoffs including the solutions available in three.js.
Three.js by default uses shadow maps. The way a shadow map works is, for every light that casts shadows all objects marked to cast shadows are rendered from the point of view of the light. READ THAT AGAIN! and let it sink in.
In other words, if you have 20 objects, and 5 lights, and all 20 objects are casting shadows and all 5 lights are casting shadows then your entire scene will be drawn 6 times. All 20 objects will be drawn for light #1, then all 20 objects will be drawn for light #2, then #3, etc and finally the actual scene will be drawn using data from the first 5 renders.
It gets worse, if you have a point light casting shadows the scene has to be drawn 6 times just for that light!
For these reasons it's common to find other solutions than to have a bunch of lights all generating shadows. One common solution is to have multiple lights but only one directional light generating shadows.
Yet another solution is to use lightmaps and or ambient occlusion maps to pre-compute the effects of lighting offline. This results in static lighting or static lighting hints but at least it's fast. We'll cover both of those in another article.
Another solution is to use fake shadows. Make a plane, put a grayscale texture in the plane that approximates a shadow, draw it above the ground below your object.
For example let's use this texture as a fake shadow
We'll use some of the code from the previous article.
Let's set the background color to white.
const scene = new THREE.Scene(); +scene.background = new THREE.Color('white');
Then we'll setup the same checkerboard ground but this time it's using
a MeshBasicMaterial
as we don't need lighting for the ground.
+const loader = new THREE.TextureLoader(); { const planeSize = 40; - const loader = new THREE.TextureLoader(); const texture = loader.load('resources/images/checker.png'); texture.wrapS = THREE.RepeatWrapping; texture.wrapT = THREE.RepeatWrapping; texture.magFilter = THREE.NearestFilter; const repeats = planeSize / 2; texture.repeat.set(repeats, repeats); const planeGeo = new THREE.PlaneGeometry(planeSize, planeSize); const planeMat = new THREE.MeshBasicMaterial({ map: texture, side: THREE.DoubleSide, }); + planeMat.color.setRGB(1.5, 1.5, 1.5); const mesh = new THREE.Mesh(planeGeo, planeMat); mesh.rotation.x = Math.PI * -.5; scene.add(mesh); }
Note we're setting the color to 1.5, 1.5, 1.5
. This will multiply the checkerboard
texture's colors by 1.5, 1.5, 1.5. Since the texture's colors are 0x808080 and 0xC0C0C0
which is medium gray and light gray, multiplying them by 1.5 will give us a white and
light grey checkerboard.
Let's load the shadow texture
const shadowTexture = loader.load('resources/images/roundshadow.png');
and make an array to remember each sphere and associated objects.
const sphereShadowBases = [];
Then we'll make a sphere geometry
const sphereRadius = 1; const sphereWidthDivisions = 32; const sphereHeightDivisions = 16; const sphereGeo = new THREE.SphereGeometry(sphereRadius, sphereWidthDivisions, sphereHeightDivisions);
And a plane geometry for the fake shadow
const planeSize = 1; const shadowGeo = new THREE.PlaneGeometry(planeSize, planeSize);
Now we'll make a bunch of spheres. For each sphere we'll create a base
THREE.Object3D
and we'll make both the shadow plane mesh and the sphere mesh
children of the base. That way if we move the base both the sphere and the shadow
will move. We need to put the shadow slightly above the ground to prevent z-fighting.
We also set depthWrite
to false so that the shadows don't mess each other up.
We'll go over both of these issues in another article.
The shadow is a MeshBasicMaterial
because it doesn't need lighting.
We make each sphere a different hue and then save off the base, the sphere mesh, the shadow mesh and the initial y position of each sphere.
const numSpheres = 15; for (let i = 0; i < numSpheres; ++i) { // make a base for the shadow and the sphere // so they move together. const base = new THREE.Object3D(); scene.add(base); // add the shadow to the base // note: we make a new material for each sphere // so we can set that sphere's material transparency // separately. const shadowMat = new THREE.MeshBasicMaterial({ map: shadowTexture, transparent: true, // so we can see the ground depthWrite: false, // so we don't have to sort }); const shadowMesh = new THREE.Mesh(shadowGeo, shadowMat); shadowMesh.position.y = 0.001; // so we're above the ground slightly shadowMesh.rotation.x = Math.PI * -.5; const shadowSize = sphereRadius * 4; shadowMesh.scale.set(shadowSize, shadowSize, shadowSize); base.add(shadowMesh); // add the sphere to the base const u = i / numSpheres; // goes from 0 to 1 as we iterate the spheres. const sphereMat = new THREE.MeshPhongMaterial(); sphereMat.color.setHSL(u, 1, .75); const sphereMesh = new THREE.Mesh(sphereGeo, sphereMat); sphereMesh.position.set(0, sphereRadius + 2, 0); base.add(sphereMesh); // remember all 3 plus the y position sphereShadowBases.push({base, sphereMesh, shadowMesh, y: sphereMesh.position.y}); }
We setup 2 lights. One is a HemisphereLight
with the intensity set to 2 to really
brighten things up.
{ const skyColor = 0xB1E1FF; // light blue const groundColor = 0xB97A20; // brownish orange const intensity = 2; const light = new THREE.HemisphereLight(skyColor, groundColor, intensity); scene.add(light); }
The other is a DirectionalLight
so the spheres get some definition
{ const color = 0xFFFFFF; const intensity = 1; const light = new THREE.DirectionalLight(color, intensity); light.position.set(0, 10, 5); light.target.position.set(-5, 0, 0); scene.add(light); scene.add(light.target); }
It would render as is but let's animate there spheres.
For each sphere, shadow, base set we move the base in the xz plane, we
move the sphere up and down using Math.abs(Math.sin(time))
which gives us a bouncy animation. And, we also set the shadow material's
opacity so that as each sphere goes higher its shadow fades out.
function render(time) { time *= 0.001; // convert to seconds ... sphereShadowBases.forEach((sphereShadowBase, ndx) => { const {base, sphereMesh, shadowMesh, y} = sphereShadowBase; // u is a value that goes from 0 to 1 as we iterate the spheres const u = ndx / sphereShadowBases.length; // compute a position for the base. This will move // both the sphere and its shadow const speed = time * .2; const angle = speed + u * Math.PI * 2 * (ndx % 1 ? 1 : -1); const radius = Math.sin(speed - ndx) * 10; base.position.set(Math.cos(angle) * radius, 0, Math.sin(angle) * radius); // yOff is a value that goes from 0 to 1 const yOff = Math.abs(Math.sin(time * 2 + ndx)); // move the sphere up and down sphereMesh.position.y = y + THREE.MathUtils.lerp(-2, 2, yOff); // fade the shadow as the sphere goes up shadowMesh.material.opacity = THREE.MathUtils.lerp(1, .25, yOff); }); ...
And here's 15 kind of bouncing balls.
In some apps it's common to use a round or oval shadow for everything but of course you could also use different shaped shadow textures. You might also give the shadow a harder edge. A good example of using this type of shadow is Animal Crossing Pocket Camp where you can see each character has a simple round shadow. It's effective and cheap. Monument Valley appears to also use this kind of shadow for the main character.
So, moving on to shadow maps, there are 3 lights which can cast shadows. The DirectionalLight
,
the PointLight
, and the SpotLight
.
Let's start with the DirectionalLight
with the helper example from the lights article.
The first thing we need to do is turn on shadows in the renderer.
const renderer = new THREE.WebGLRenderer({antialias: true, canvas}); +renderer.shadowMap.enabled = true;
Then we also need to tell the light to cast a shadow
const light = new THREE.DirectionalLight(color, intensity); +light.castShadow = true;
We also need to go to each mesh in the scene and decide if it should both cast shadows and/or receive shadows.
Let's make the plane (the ground) only receive shadows since we don't really care what happens underneath.
const mesh = new THREE.Mesh(planeGeo, planeMat); mesh.receiveShadow = true;
For the cube and the sphere let's have them both receive and cast shadows
const mesh = new THREE.Mesh(cubeGeo, cubeMat); mesh.castShadow = true; mesh.receiveShadow = true; ... const mesh = new THREE.Mesh(sphereGeo, sphereMat); mesh.castShadow = true; mesh.receiveShadow = true;
And then we run it.
What happened? Why are parts of the shadows missing?
The reason is shadow maps are created by rendering the scene from the point
of view of the light. In this case there is a camera at the DirectionalLight
that is looking at its target. Just like the camera's we previously covered
the light's shadow camera defines an area inside of which
the shadows get rendered. In the example above that area is too small.
In order to visualize that area we can get the light's shadow camera and add
a CameraHelper
to the scene.
const cameraHelper = new THREE.CameraHelper(light.shadow.camera); scene.add(cameraHelper);
And now you can see the area for which shadows are cast and received.
Adjust the target x value back and forth and it should be pretty clear that only what's inside the light's shadow camera box is where shadows are drawn.
We can adjust the size of that box by adjusting the light's shadow camera.
Let's add some GUI setting to adjust the light's shadow camera box. Since a
DirectionalLight
represents light all going in a parallel direction, the
DirectionalLight
uses an OrthographicCamera
for its shadow camera.
We went over how an OrthographicCamera
works in the previous article about cameras.
Recall an OrthographicCamera
defines
its box or view frustum by its left
, right
, top
, bottom
, near
, far
,
and zoom
properties.
Again let's make a helper class for the lil-gui. We'll make a DimensionGUIHelper
that we'll pass an object and 2 properties. It will present one property that lil-gui
can adjust and in response will set the two properties one positive and one negative.
We can use this to set left
and right
as width
and up
and down
as height
.
class DimensionGUIHelper { constructor(obj, minProp, maxProp) { this.obj = obj; this.minProp = minProp; this.maxProp = maxProp; } get value() { return this.obj[this.maxProp] * 2; } set value(v) { this.obj[this.maxProp] = v / 2; this.obj[this.minProp] = v / -2; } }
We'll also use the MinMaxGUIHelper
we created in the camera article
to adjust near
and far
.
const gui = new GUI(); gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color'); gui.add(light, 'intensity', 0, 2, 0.01); +{ + const folder = gui.addFolder('Shadow Camera'); + folder.open(); + folder.add(new DimensionGUIHelper(light.shadow.camera, 'left', 'right'), 'value', 1, 100) + .name('width') + .onChange(updateCamera); + folder.add(new DimensionGUIHelper(light.shadow.camera, 'bottom', 'top'), 'value', 1, 100) + .name('height') + .onChange(updateCamera); + const minMaxGUIHelper = new MinMaxGUIHelper(light.shadow.camera, 'near', 'far', 0.1); + folder.add(minMaxGUIHelper, 'min', 0.1, 50, 0.1).name('near').onChange(updateCamera); + folder.add(minMaxGUIHelper, 'max', 0.1, 50, 0.1).name('far').onChange(updateCamera); + folder.add(light.shadow.camera, 'zoom', 0.01, 1.5, 0.01).onChange(updateCamera); +}
We tell the GUI to call our updateCamera
function anytime anything changes.
Let's write that function to update the light, the helper for the light, the
light's shadow camera, and the helper showing the light's shadow camera.
function updateCamera() { // update the light target's matrixWorld because it's needed by the helper light.target.updateMatrixWorld(); helper.update(); // update the light's shadow camera's projection matrix light.shadow.camera.updateProjectionMatrix(); // and now update the camera helper we're using to show the light's shadow camera cameraHelper.update(); } updateCamera();
And now that we've given the light's shadow camera a GUI we can play with the values.
Set the width
and height
to about 30 and you can see the shadows are correct
and the areas that need to be in shadow for this scene are entirely covered.
But this brings up the question, why not just set width
and height
to some
giant numbers to just cover everything? Set the width
and height
to 100
and you might see something like this
What's going on with these low-res shadows?!
This issue is yet another shadow related setting to be aware of. Shadow maps are textures the shadows get drawn into. Those textures have a size. The shadow camera's area we set above is stretched across that size. That means the larger area you set, the more blocky your shadows will be.
You can set the resolution of the shadow map's texture by setting light.shadow.mapSize.width
and light.shadow.mapSize.height
. They default to 512x512.
The larger you make them the more memory they take and the slower they are to compute so you want
to set them as small as you can and still make your scene work. The same is true with the
light's shadow camera area. Smaller means better looking shadows so make the area as small as you
can and still cover your scene. Be aware that each user's machine has a maximum texture size
allowed which is available on the renderer as renderer.capabilities.maxTextureSize
.
Switching to the SpotLight
the light's shadow camera becomes a PerspectiveCamera
. Unlike the DirectionalLight
's shadow camera
where we could manually set most its settings, SpotLight
's shadow camera is controlled by the SpotLight
itself. The fov
for the shadow
camera is directly connected to the SpotLight
's angle
setting.
The aspect
is set automatically based on the size of the shadow map.
-const light = new THREE.DirectionalLight(color, intensity); +const light = new THREE.SpotLight(color, intensity);
and we added back in the penumbra
and angle
settings
from our article about lights.
And finally there's shadows with a PointLight
. Since a PointLight
shines in all directions the only relevant settings are near
and far
.
Otherwise the PointLight
shadow is effectively 6 SpotLight
shadows
each one pointing to the face of a cube around the light. This means
PointLight
shadows are much slower since the entire scene must be
drawn 6 times, one for each direction.
Let's put a box around our scene so we can see shadows on the walls
and ceiling. We'll set the material's side
property to THREE.BackSide
so we render the inside of the box instead of the outside. Like the floor
we'll set it only to receive shadows. Also we'll set the position of the
box so its bottom is slightly below the floor so the floor and the bottom
of the box don't z-fight.
{ const cubeSize = 30; const cubeGeo = new THREE.BoxGeometry(cubeSize, cubeSize, cubeSize); const cubeMat = new THREE.MeshPhongMaterial({ color: '#CCC', side: THREE.BackSide, }); const mesh = new THREE.Mesh(cubeGeo, cubeMat); mesh.receiveShadow = true; mesh.position.set(0, cubeSize / 2 - 0.1, 0); scene.add(mesh); }
And of course we need to switch the light to a PointLight
.
-const light = new THREE.SpotLight(color, intensity); +const light = new THREE.PointLight(color, intensity); .... // so we can easily see where the point light is +const helper = new THREE.PointLightHelper(light); +scene.add(helper);
Use the position
GUI settings to move the light around
and you'll see the shadows fall on all the walls. You can
also adjust near
and far
settings and see just like
the other shadows when things are closer than near
they
no longer receive a shadow and they are further than far
they are always in shadow.


#5"What lies behind us and what lies ahead of us are tiny matters compared to what lies within us."Sprint 2. Cultural blog
#7"The most venerable, clearly understood, enlightened, and reliable constant in the world is not only that we want to be happy, but that we want only to be so. Our very nature requires it of us."Sprint 3. Cultural blog
#9"You can make more friends in two months by becoming really interested in other people than you can in two years by trying to get other people interested in you. Which is just another way of saying that the way to make a friend is to be one."Sprint 4. Cultural blog
#10"Try and penetrate with our limited means the secrets of nature and you will find that, behind all the discernible laws and connections, there remains something subtle, intangible and inexplicable."Sprint 5. Technical blog
#11"If you haven't found something strange during the day, it hasn't been much of a day."Sprint 5. Cultural blog
#15"Wisdom is knowing what to do next; Skill is knowing how ot do it, and Virtue is doing it."Sprint 8. Technical blog
#16“Those who are unaware they are walking in darkness will never seek the light.”Sprint 8. Cultural blog
#17“Four steps to achievement: Plan purposefully. Prepare prayerfully. Proceed positively. Pursue persistently.”Sprint 9. Cultural blog


{% extends "base.html" %} {% block title %}
Thank you for contacting us. We will respond as soon as possible.
Return to the home page»
The flow of federal spending reporting can get complicated. We've tried to simplify it for you with a step-by-step visualization.
How did we conduct our analysis and what assumptions did we make? What limitations exist with the comparison data we're using? We measured the data across three categories:
See our methodology for more information.