Pope Francis to visit Hiroshima, Nagasaki on anti-nuclear weapon mission
Sunday is set to be a marathon day with visits to Nagasaki and Hiroshima
Pope Francis, who years ago hoped to be a missionary in Japan, travels to the sites of the world's only atomic attacks this week seeking a ban on nuclear weapons.
The Argentine pontiff, 82, flies to Asia on Tuesday, where he will first visit Thailand and then Japan, including the two cities destroyed by devastating US nuclear attacks during the Second World War.
Despite both countries having less than 0.6 per cent Catholic populations, Francis is thirsty for interreligious dialogue with them.
He will arrive in Thailand on Wednesday before flying on to Japan on Saturday, where he will stay until November 26.
Sunday is set to be a marathon day with visits to Nagasaki and Hiroshima, where at least 74,000 people and 140,000 people respectively were killed by the atomic bombs attacks.
The August 6, 1945 bombing of Hiroshima and of Nagasaki three days later contributed to Japan's surrender and the end of the Second World War on August 15, months after Nazi Germany capitulated.
Father Yoshio Kajiyama, director of the Jesuit social centre in Tokyo, was born in Hiroshima shortly after the war and is eagerly awaiting the pope's anti-nuclear speech.
"My grandfather died the day of the bomb in Hiroshima, I never knew him. Four days later my aunt died when she was 15 years old," said the 64-year-old.
"If you grow up in Hiroshima, you can't forget the bomb."
No nukes message
The pope will make "as vigorous an appeal as possible in favour of concerted measures to completely eliminate nuclear weapons," the Vatican number two Cardinal Pietro Parolin told the United Nations in September.
"Using atomic energy to wage war is immoral," the head of the world's 1.3 billion Catholics told Japanese television in September.
A previous member of Japan's diplomatic mission to the Vatican, Shigeru Tokuyasu, said he hopes the visit will pull the world back from "the globalisation of indifference" over nuclear weapons.
But, said Tokuyasu, the pope should avoid discussing the politically sensitive issue of nuclear energy.
Francis is also set to meet victims of the devastating 2011 earthquake that struck northeastern Japan and the subsequent tsunami that between them killed 18,500 people and sparked the nuclear power catastrophe at Fukushima.
Fear of nuclear war
Francis is used to railing against countries that make money from weapons and has already voiced his fear of a nuclear war.
In January last year, he printed cards with a photo of a Nagasaki bomb victim, inscribing the words "the fruit of war" above his signature.
The 1945 photo, captured by American photographer Joe O'Donnell, showed a small boy standing ramrod straight carrying his dead younger brother on his back while waiting for his turn at a cremation site.
The late pope John Paul II visited Japan in 1981, where at Hiroshima's peace monument he pointed to war as "the work of man".
In August, the city of Hiroshima called on Japan to sign the U.N. treaty calling for a ban on nuclear weapons, something that all the world's nuclear powers have refused to do.
Japan, with its pacifist post-war constitution, adhered in 1967 to the principle of "not producing, possessing or allowing nuclear weapons on its territory," despite counting on the US nuclear umbrella for protection.
Multiethnic Thailand
Before arriving in Thailand on Wednesday, the pope praised the "multiethnic nation" which "has worked to promote harmony and peaceful coexistence, not only among its habitants but throughout Southeast Asia."
In a video message to the Thai people, the pope said he hoped to "strengthen ties of friendship" with Buddhists.
Since Francis' election six years ago, he has made two trips to Asia, visiting the Philippines and Sri Lanka in 2014, followed by Myanmar and Bangladesh in 2017.
On Thursday in Bangkok, the pontiff is to pay a visit to supreme patriarch Somdej Phra Maha Muneewong at a Buddhist temple.


UniWare
General
Device
Sensors
Settings
WiFi
MQTT
Device
Name
Save
Error!
Load device settings failed.
Reboot
Trying to reboot
Success!
Device settings saved.
Reboot?
Error!
Save device settings failed


Quickstart¶
Graphical interface¶
Since v0.0.2 it is available a simple graphical interface.
You still need to launch it from the terminal.
For the time being, just run python main.py
.
Terminal¶
Encrypt a file:
python manage.py encrypt data/egg.txt --public-key eccrypt_rsa.pub
Decrypt a file:
python manage.py decrypt data/egg.bin --private-key eccrypt_rsa


Know number names and the count sequence
Count to tell the number of objects Compare numbers
Books
Jimmy's 50 Favorite Things
Counting 1-20
How to Get from 1-10
More and Less
Games
Circus Juggling Act
Mirror Lake Fish Count
Egg Counter
Dinosaur Champ
Songs
Five Little Monkeys
Five Little Ducks
Art
Number Painting
Paint by Numbers (series)
Puzzle
Hundred Chart Jigsaw
Numbers and Their Names Cutout
More and Less Jigsaw (series)
flash_on
Operations & Algebraic Thinking
Understand addition
Understand subtraction
Books
Shopping with My DadShane Shares His SnacksNew Baby AnimalsHamster Ball Bowling
Games
Munch a Bunch
Ring It Up
Squawk Block: Addition
Squawk Block: Subtraction
Songs
Ten in a Bed
Art
Point by Addition (series)
Point by Subtraction (series)
Puzzles
How Many Oranges?
Shopping with My Dad Jigsaw (series)
Home for Puppies Jigsaw
flash_on
Number & Operations in Base Ten
Work with numbers 11-19 to gain foundations for place value
Books
Counting 1-20Peter the Pirate Finds Treasure by TensCounting Fingers and Toes
Games
Hundred Chart Light Up
Fun with 11-20 Memory Match
Plenty of Peanuts
Candy Counter
Mighty Dinosaur Chomp
Art
Paint by Addition (series)
Paint by Subtraction (series)
Puzzles
Farm Counting Jigsaws (series)
Features
Ticket Counter
flash_on
Measurement & Data
Describe and compare measureable attributes
Classify objects and count the number of objects in each category
Books
More and Less
My Dog Is Bigger Than That Dog
Games
Gem Finder
Can You Guess More or Less?
Art
More and Less Painting
Opposites Painting: Short and Tall
Puzzles
More and Less Jigsaw: Fish
Features
Animal facts in the Zoo, Farm, and Aquarium describe physical measurements in familiar terms
flash_on
Geometry
Identify and describe shapes
Analyze, compare, create, and compose shapes
Books
Shapes on the FarmCircles, Squares, and TrianglesTriangles EverywhereRectangles Everywhere
Games
Shapes Cookie Time
Ultimate Shapes Memory Match
Shapes Wheel
Songs
The Shapes Song
Art
Picture the Triangle: Trees
More Shapes Painting
Lots of Shapes Painting
Puzzles
More Shapes Jigsaw
settings
Literature
Key Ideas and Details
Craft and Structure
Integration of Knowledge and Ideas
Range of Reading and Level of Text Complexity
Books
Tilly the Turtle Finds a HomeGoldilocks and the Three BearsThe Tortoise and the Hare
Games
Big Pig and Little Pig Matching Cards
Dan and Jan Matching Cards
Puzzles
The Grasshopper and the Ants Jigsaw
Features
Students, teachers, and parents can access a large collection of traditional and original stories, with many examples of characters, settings, and story patterns including fairy tales and Aesop's fables
Many books have puzzles or games that support the key ideas and details in the text
settings
Informational Text
Key Ideas and Details Craft and Structure Integration of Knowledge and Ideas Range of Reading and Level of Text Complexity
Books
Environments: Tropical Rainforest
Search and Explore: The Grand Canyon
From Cow to Carton
Games
Zoo Animal Wheel
Planetarium Wheel
Art
I Get Dressed for My Day
Puzzles
How Plants Grow Cutout Puzzle
Weather Poetry Puzzle
Features
Informational books are designed to develop vocabulary through contextual support, explanations, and many photographs and illustrations
ABCmouse.com offers informational books on a wide range of topics that are of interest to children
group
Foundational Skills
Print Concepts
Phonological Awareness
Phonics and Word Recognition
Fluency
Books
Zoo Animals A-ZThe Three Sounds of the Letter XHam with Jam?The Very Special Letter (A,E,I,O,U) (series)Prekindergarten and Kindergarten Sight Words Books (series)
Games
Last Letter in Line
Picture Picker: The Very Special Letters
Shrimps in Sight
Songs and Animations
The a-b-c Chants
ABC Alphabet Song
The Letter Songs and Animations A-Z (series)
Puzzles
Word Family Jigsaws (series)
Rhyming Words Jigsaw
Features
Hundreds of phonemic awareness and phonics activities in the Basics area
mode_edit
Writing
Text Types and Purposes
Production and Distribution of Writing
Research to Build and Present Knowledge
Books
What Is a Word?Big and Small Zoo Letters
Games
Magic Rainbow Traceables
Refrigerator Word Jumble
Puzzles
Alphabet Sentence Puzzles (series)
Animals Sentence Puzzles (series)
Features
Email feature allows students to compose and send emails to family members
group
Speaking and Listening
Comprehension and Collaboration Presentation of Knowledge and Ideas
Books
All ABCmouse.com books are voiced to provide excellent oral language models
Games
Market Shop and Seek
Voiced instructions in all games encourage good listening skills
Songs and Animations
Hundreds of voiced poems, songs, and animations support development of listening skills
group
Language
Conventions of Standard English
Vocabulary Acquisition and Use
Books
The Opposites BooksOur WorldSearch and Explore (series)
Games
Online Letter Tracing
Rainbow Traceables
What Do You See?
Songs and Animations
The Letter Songs and Animations A-Z (series)
Where Do the Rainbows Go?
Features
ABCmouse.com books incorporate rich language to facilitate the acquisition and use of new vocabulary
The glossary provides child-friendly explanations of more than a thousand important vocabulary words


rdoc.info
::
Server Error
Something Bad Happened
We've been notified and we're working to fix it. Sorry for any inconvenience.


Hello, and welcome to The Iron Bears (Team 854) FIRST Robotics Robot Codebase for the 2018 FIRST Robotics Competition! The files contained in the "documentation and references" folder were created in order to help our programmers understand and develop for this codebase. Because our 2018 programming team looks to be especially strong, our code for this year is likely to stand out from previous years. I, as well as my peers and teachers, have seen a great amount of talent and dedication in this year's software team. We're trying to make our robot code very modular, reusable and reliable while also adding in as many advanced features as possible. I hope that you may make use of our code! - Robert C.
If you're reading this and are from the future, then you might find this code to be handy. In fact, I hope that future software divisions of Team 854 put this codebase to good use. I might even recommend using our codebase as a starting point for your own, as we have developed a great framework as well as a lot of useful functions for any FRC robot, no matter what the game is. Maybe I should give Mr. Gunby a golden memory stick with this codebase on it and have him force every next software division of our team to study 2018's codebase religously!
Don't get me wrong, Java is great.
However, during the 2017 season, Waseef and I wanted to use C++ for the 2018 competition. We had enough knowledge of the language
in order to be able to use it. After speaking about our potential plan, some mentors had told us that WPILib (necessary for FRC
Robots) does not work well with C++. Our only other options would be LabView (umm, no thanks) and Java (which we had also used
a lot).
For the 2018 season, a lot of great programmers had joined us. Some of them knew C++, but the majority of them have had some
sorts of Java experience. Considering that our school's Computer Science program teaches Java, it was the way to go.
I miss pointers, though.
I added this folder so that we might eventually find/develop a single style guide.


TSR MHoC ISideWith
Loading...
Strongly Agree
Agree
Neutral/Unsure
Disagree
Strongly Disagree
Back
Back


Project 1: A Visual Message for the Inhabitants of Other Celestial Bodies
Our universe makes up cells, molecules, bodies, and planets of a different somewhat bigger than our universe that we might not even be aware of. These cells, molecules, planets, organs, and bodies can be part of a universe of many other things. Each level is more complex than the one before it but at the same time can get even more complex from going to universe or cell.


in this trip we will get started in al aqaba city we will do some diving after that we will vist the old city
and the next day morning we will ride our hot air balon to Wadi Rum and we will start our adventure
we have multiple activity and u can pik as u like we have sky diving and rook climing and hiking
and for our lanch will be in badun style .
and we will spend the night in one of the camps with a buble viwe rom that will stun u in the night .
Total Price :150JD
Explore the classical relics of UNESCO-listed Jerash and Umm Qais in a day from Amman
with a guide to provide background you might miss independently.
This private full-day tour features a private, chauffeured air-conditioned vehicle and a guide both
as you travel and at the sites, so you get the full lowdown on the ruins and the scenery en route.
Lunch , aftar that head to wadi mujb and explore the nuture there
and for tha stay it will be in rengar camp in one of its wood House .
Total Price : 90 JD
in this trip we will be in the city and see roman ruins in amman and take a tour
in the old city
The Dead Sea is one of the most incredible places in the world.
It is known for the Biblical story of the destruction of Sodom and Gomorrah,
which were destroyed by fire and brimstone.
The Dead Sea speaks for itself: there are no living fish. It is by far one of Jordan's most impressive
and spectacular places to visit.
Its calm, shining water glowing from the scorching sun above,
is known for the concentration of salt and minerals which makes it a therapeutic
as well as a unique swimming experience not to be missed.
Total Price :120JD
Experience the desert in one day travelling by desert 4x4. Spend the day with us exploring hidden
canyons beneath dramatic mountains and visit ancient sites.
You will visit the main valley sites: Lawrence Spring, Red Sand Dune, Khazali Canyon
(to visit inscriptions) and the Small Arch.
Travelling out of the main valley you will visit Lawrence House and viewpoint,
Mushroom Rock, Um Fruth Rock Bridge and Abu Khashaba Canyon - a beautiful canyon walk.
Our guide prepares lunch for you in the desert during the tour. At the end of the day he will choose
a beautiful area to watch the sunset before returning back to the village.
Total Price :100JD
Depart to the south toward the Nabatean Red Rose City of Petra that is considered
one of the wonders of the world. A city 139 miles (225 kilometers) from Amman
that was carved in stone more than 2000 years ago in order to dominate
the trade routes of ancient Arabia. Visit its towns, damns,
and water channels and enjoy a walk along the narrow siq,
a path which is the main entrance to the city. The first thing you will see is the Khazneh,
which was believed to be a tomp for one of the Nabatean Kings.
You will also see other monuments such as The Monastery and the Altar of Sacrifice.
In the afternoon you will move towards Wadi Rum, called the valley of moon
, where the movie Lawrence of Arabia was filmed and lately The Martian.
Total Price :100JD
Want to go on an adventure but don't know where to go?
Click on the images that suits your feelings and enter the month to plan a trip that suits you!


/**
* An OutputTunnel defines an outgoing communication channel on which a component can send data.
* After creating the tunnel object, any component can use the tunnel to forward data to other side of the tunnel
*/
class OutputTunnel {
/**
* Creates a new OutputTunnel.
* @constructor
*/
constructor() {
}
/**
* Forward given data onto the OutputTunnel channel.
* @abstract
* @param {Object} data - The actual data to be sent onto the channel.
*/
emit(data) {
}
};
module.exports = OutputTunnel;


| PERLEMBED(1) | Perl Programmers Reference Guide | PERLEMBED(1) |
Also, every C program that uses Perl must link in the perl library. What's that, you ask? Perl is itself written in C; the perl library is the collection of compiled C programs that were used to create your perl executable (/usr/bin/perl or equivalent). (Corollary: you can't use Perl from your C program unless Perl has been compiled on your machine, or installed properly--that's why you shouldn't blithely copy Perl executables from machine to machine without also copying the lib directory.)
When you use Perl from C, your C program will--usually--allocate, "run", and deallocate a PerlInterpreter object, which is defined by the perl library.
If your copy of Perl is recent enough to contain this documentation (version 5.002 or later), then the perl library (and EXTERN.h and perl.h, which you'll also need) will reside in a directory that looks like this:
/usr/local/lib/perl5/your_architecture_here/CORE
or perhaps just
/usr/local/lib/perl5/CORE
or maybe something like
/usr/opt/perl5/CORE
Execute this statement for a hint about where to find CORE:
perl -MConfig -e 'print $Config{archlib}'
Here's how you'd compile the example in the next section, "Adding a Perl interpreter to your C program", on my Linux box:
% gcc -O2 -Dbool=char -DHAS_BOOL -I/usr/local/include -I/usr/local/lib/perl5/i586-linux/5.003/CORE -L/usr/local/lib/perl5/i586-linux/5.003/CORE -o interp interp.c -lperl -lm
(That's all one line.) On my DEC Alpha running old 5.003_05, the incantation is a bit different:
% cc -O2 -Olimit 2900 -I/usr/local/include -I/usr/local/lib/perl5/alpha-dec_osf/5.00305/CORE -L/usr/local/lib/perl5/alpha-dec_osf/5.00305/CORE -L/usr/local/lib -D__LANGUAGE_C__ -D_NO_PROTO -o interp interp.c -lperl -lm
How can you figure out what to add? Assuming your Perl is post-5.001, execute a "perl -V" command and pay special attention to the "cc" and "ccflags" information.
You'll have to choose the appropriate compiler (cc, gcc, et al.) for your machine: "perl -MConfig -e 'print $Config{cc}'" will tell you what to use.
You'll also have to choose the appropriate library directory (/usr/local/lib/...) for your machine. If your compiler complains that certain functions are undefined, or that it can't locate -lperl, then you need to change the path following the "-L". If it complains that it can't find EXTERN.h and perl.h, you need to change the path following the "-I".
You may have to add extra libraries as well. Which ones? Perhaps those printed by
perl -MConfig -e 'print $Config{libs}'
Provided your perl binary was properly configured and installed the ExtUtils::Embed module will determine all of this information for you:
% cc -o interp interp.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
If the ExtUtils::Embed module isn't part of your Perl distribution, you can retrieve it from <http://www.perl.com/perl/CPAN/modules/by-module/ExtUtils/> (If this documentation came from your Perl distribution, then you're running 5.004 or better and you already have it.)
The ExtUtils::Embed kit on CPAN also contains all source code for the examples in this document, tests, additional examples and other information you may find useful.
#include <EXTERN.h> /* from the Perl distribution */ #include <perl.h> /* from the Perl distribution */ static PerlInterpreter *my_perl; /*** The Perl interpreter ***/ int main(int argc, char **argv, char **env) { PERL_SYS_INIT3(&argc,&argv,&env); my_perl = perl_alloc(); perl_construct(my_perl); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; perl_parse(my_perl, NULL, argc, argv, (char **)NULL); perl_run(my_perl); perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); exit(EXIT_SUCCESS); }
Notice that we don't use the "env" pointer. Normally handed to "perl_parse" as its final argument, "env" here is replaced by "NULL", which means that the current environment will be used.
The macros PERL_SYS_INIT3() and PERL_SYS_TERM() provide system-specific tune up of the C runtime environment necessary to run Perl interpreters; they should only be called once regardless of how many interpreters you create or destroy.
Since PERL_SYS_INIT3() may change "env", it may be more appropriate to provide "env" as an argument to perl_parse().
Also notice that no matter what arguments you pass to perl_parse(), PERL_SYS_INIT3() must be invoked on the C main() argc, argv and env and only once.
Mind that argv[argc] must be NULL, same as those passed to a main function in C.
Now compile this program (I'll call it interp.c) into an executable:
% cc -o interp interp.c `perl -MExtUtils::Embed -e ccopts -e ldopts`
After a successful compilation, you'll be able to use interp just like perl itself:
% interp print "Pretty Good Perl \n"; print "10890 - 9801 is ", 10890 - 9801; <CTRL-D> Pretty Good Perl 10890 - 9801 is 1089
or
% interp -e 'printf("%x",<PHONE_NUMBER>)' deadbeef
You can also read and execute Perl statements from a file while in the midst of your C program, by placing the filename in argv[1] before calling perl_run.
That's shown below, in a program I'll call showtime.c.
#include <EXTERN.h> #include <perl.h> static PerlInterpreter *my_perl; int main(int argc, char **argv, char **env) { char *args[] = { NULL }; PERL_SYS_INIT3(&argc,&argv,&env); my_perl = perl_alloc(); perl_construct(my_perl); perl_parse(my_perl, NULL, argc, argv, NULL); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; /*** skipping perl_run() ***/ call_argv("showtime", G_DISCARD | G_NOARGS, args); perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); exit(EXIT_SUCCESS); }
where showtime is a Perl subroutine that takes no arguments (that's the G_NOARGS) and for which I'll ignore the return value (that's the G_DISCARD). Those flags, and others, are discussed in perlcall.
I'll define the showtime subroutine in a file called showtime.pl:
print "I shan't be printed."; sub showtime { print time; }
Simple enough. Now compile and run:
% cc -o showtime showtime.c \ `perl -MExtUtils::Embed -e ccopts -e ldopts` % showtime showtime.pl 818284590
yielding the number of seconds that elapsed between January 1, 1970 (the beginning of the Unix epoch), and the moment I began writing this sentence.
In this particular case we don't have to call perl_run, as we set the PL_exit_flag PERL_EXIT_DESTRUCT_END which executes END blocks in perl_destruct.
If you want to pass arguments to the Perl subroutine, you can add strings to the "NULL"-terminated "args" list passed to call_argv. For other data types, or to examine return values, you'll need to manipulate the Perl stack. That's demonstrated in "Fiddling with the Perl stack from your C program".
Arguably, these are the only routines you'll ever need to execute snippets of Perl code from within your C program. Your code can be as long as you wish; it can contain multiple statements; it can employ "use" in perlfunc, "require" in perlfunc, and "do" in perlfunc to include external Perl files.
eval_pv lets us evaluate individual Perl strings, and then extract variables for coercion into C types. The following program, string.c, executes three Perl strings, extracting an "int" from the first, a "float" from the second, and a "char *" from the third.
#include <EXTERN.h> #include <perl.h> static PerlInterpreter *my_perl; main (int argc, char **argv, char **env) { char *embedding[] = { "", "-e", "0", NULL }; PERL_SYS_INIT3(&argc,&argv,&env); my_perl = perl_alloc(); perl_construct( my_perl ); perl_parse(my_perl, NULL, 3, embedding, NULL); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; perl_run(my_perl); /** Treat $a as an integer **/ eval_pv("$a = 3; $a **= 2", TRUE); printf("a = %d\n", SvIV(get_sv("a", 0))); /** Treat $a as a float **/ eval_pv("$a = 3.14; $a **= 2", TRUE); printf("a = %f\n", SvNV(get_sv("a", 0))); /** Treat $a as a string **/ eval_pv( "$a = 'rekcaH lreP rehtonA tsuJ'; $a = reverse($a);", TRUE); printf("a = %s\n", SvPV_nolen(get_sv("a", 0))); perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); }
All of those strange functions with sv in their names help convert Perl scalars to C types. They're described in perlguts and perlapi.
If you compile and run string.c, you'll see the results of using SvIV() to create an "int", SvNV() to create a "float", and SvPV() to create a string:
a = 9 a = 9.859600 a = Just Another Perl Hacker
In the example above, we've created a global variable to temporarily store the computed value of our eval'ed expression. It is also possible and in most cases a better strategy to fetch the return value from eval_pv() instead. Example:
... SV *val = eval_pv("reverse 'rekcaH lreP rehtonA tsuJ'", TRUE); printf("%s\n", SvPV_nolen(val)); ...
This way, we avoid namespace pollution by not creating global variables and we've simplified our code as well.
I32 match(SV *string, char *pattern);
Given a string and a pattern (e.g., "m/clasp/" or "/\b\w*\b/", which in your C program might appear as "/\\b\\w*\\b/"), match() returns 1 if the string matches the pattern and 0 otherwise.
int substitute(SV **string, char *pattern);
Given a pointer to an "SV" and an "=~" operation (e.g., "s/bob/robert/g" or "tr[A-Z][a-z]"), substitute() modifies the string within the "SV" as according to the operation, returning the number of substitutions made.
SSize_t matches(SV *string, char *pattern, AV **matches);
Given an "SV", a pattern, and a pointer to an empty "AV", matches() evaluates "$string =~ $pattern" in a list context, and fills in matches with the array elements, returning the number of matches found.
Here's a sample program, match.c, that uses all three (long lines have been wrapped here):
#include <EXTERN.h> #include <perl.h> static PerlInterpreter *my_perl; /** my_eval_sv(code, error_check) ** kinda like eval_sv(), ** but we pop the return value off the stack **/ SV* my_eval_sv(SV *sv, I32 croak_on_error) { dSP; SV* retval; PUSHMARK(SP); eval_sv(sv, G_SCALAR); SPAGAIN; retval = POPs; PUTBACK; if (croak_on_error && SvTRUE(ERRSV)) croak_sv(ERRSV); return retval; } /** match(string, pattern) ** ** Used for matches in a scalar context. ** ** Returns 1 if the match was successful; 0 otherwise. **/ I32 match(SV *string, char *pattern) { SV *command = newSV(0), *retval; sv_setpvf(command, "my $string = '%s'; $string =~ %s", SvPV_nolen(string), pattern); retval = my_eval_sv(command, TRUE); SvREFCNT_dec(command); return SvIV(retval); } /** substitute(string, pattern) ** ** Used for =~ operations that ** modify their left-hand side (s/// and tr///) ** ** Returns the number of successful matches, and ** modifies the input string if there were any. **/ I32 substitute(SV **string, char *pattern) { SV *command = newSV(0), *retval; sv_setpvf(command, "$string = '%s'; ($string =~ %s)", SvPV_nolen(*string), pattern); retval = my_eval_sv(command, TRUE); SvREFCNT_dec(command); *string = get_sv("string", 0); return SvIV(retval); } /** matches(string, pattern, matches) ** ** Used for matches in a list context. ** ** Returns the number of matches, ** and fills in **matches with the matching substrings **/ SSize_t matches(SV *string, char *pattern, AV **match_list) { SV *command = newSV(0); SSize_t num_matches; sv_setpvf(command, "my $string = '%s'; @array = ($string =~ %s)", SvPV_nolen(string), pattern); my_eval_sv(command, TRUE); SvREFCNT_dec(command); *match_list = get_av("array", 0); num_matches = av_top_index(*match_list) + 1; return num_matches; } main (int argc, char **argv, char **env) { char *embedding[] = { "", "-e", "0", NULL }; AV *match_list; I32 num_matches, i; SV *text; PERL_SYS_INIT3(&argc,&argv,&env); my_perl = perl_alloc(); perl_construct(my_perl); perl_parse(my_perl, NULL, 3, embedding, NULL); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; text = newSV(0); sv_setpv(text, "When he is at a convenience store and the " "bill comes to some amount like 76 cents, Maynard is " "aware that there is something he *should* do, something " "that will enable him to get back a quarter, but he has " "no idea *what*. He fumbles through his red squeezey " "changepurse and gives the boy three extra pennies with " "his dollar, hoping that he might luck into the correct " "amount.  " "-RICHH"); if (match(text, "m/quarter/")) /** Does text contain 'quarter'? **/ printf("match: Text contains the word 'quarter'.\n\n"); else printf("match: Text doesn't contain the word 'quarter'.\n\n"); if (match(text, "m/eighth/")) /** Does text contain 'eighth'? **/ printf("match: Text contains the word 'eighth'.\n\n"); else printf("match: Text doesn't contain the word 'eighth'.\n\n"); /** Match all occurrences of /wi../ **/ num_matches = matches(text, "m/(wi..)/g", &match_list); printf("matches: m/(wi..)/g found %d matches...\n", num_matches); for (i = 0; i < num_matches; i++) printf("match: %s\n", SvPV_nolen(*av_fetch(match_list, i, FALSE))); printf("\n"); /** Remove all vowels from text **/ num_matches = substitute(&text, "s/[aeiou]//gi"); if (num_matches) { printf("substitute: s/[aeiou]//gi...%lu substitutions made.\n", (unsigned long)num_matches); printf("Now text is: %s\n\n", SvPV_nolen(text)); } /** Attempt a substitution **/ if (!substitute(&text, "s/Perl/C/")) { printf("substitute: s/Perl/C...No substitution made.\n\n"); } SvREFCNT_dec(text); PL_perl_destruct_level = 1; perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); }
which produces the output (again, long lines have been wrapped here)
match: Text contains the word 'quarter'. match: Text doesn't contain the word 'eighth'. matches: m/(wi..)/g found 2 matches... match: will match: with substitute: s/[aeiou]//gi...139 substitutions made. Now text is: Whn h s t cnvnnc str nd th bll cms t sm mnt lk 76 cnts, Mynrd s wr tht thr s smthng h *shld* d, smthng tht wll nbl hm t gt bck qrtr, bt h hs n d *wht*. H fmbls thrgh hs rd sqzy chngprs nd gvs th by thr xtr pnns wth hs dllr, hpng tht h mght lck nt th crrct mnt. Th by gvs hm bck tw f hs wn pnns nd thn th bg shny qrtr tht s hs prz. -RCHH substitute: s/Perl/C...No substitution made.
First you'll need to know how to convert between C types and Perl types, with newSViv() and sv_setnv() and newAV() and all their friends. They're described in perlguts and perlapi.
Then you'll need to know how to manipulate the Perl stack. That's described in perlcall.
Once you've understood those, embedding Perl in C is easy.
Because C has no builtin function for integer exponentiation, let's make Perl's ** operator available to it (this is less useful than it sounds, because Perl implements ** with C's pow() function). First I'll create a stub exponentiation function in power.pl:
sub expo { my ($a, $b) = @_; return $a ** $b; }
Now I'll create a C program, power.c, with a function PerlPower() that contains all the perlguts necessary to push the two arguments into expo() and to pop the return value out. Take a deep breath...
#include <EXTERN.h> #include <perl.h> static PerlInterpreter *my_perl; static void PerlPower(int a, int b) { dSP; /* initialize stack pointer */ ENTER; /* everything created after here */ SAVETMPS; /* ...is a temporary variable. */ PUSHMARK(SP); /* remember the stack pointer */ XPUSHs(sv_2mortal(newSViv(a))); /* push the base onto the stack */ XPUSHs(sv_2mortal(newSViv(b))); /* push the exponent onto stack */ PUTBACK; /* make local stack pointer global */ call_pv("expo", G_SCALAR); /* call the function */ SPAGAIN; /* refresh stack pointer */ /* pop the return value from stack */ printf ("%d to the %dth power is %d.\n", a, b, POPi); PUTBACK; FREETMPS; /* free that return value */ LEAVE; /* ...and the XPUSHed "mortal" args.*/ } int main (int argc, char **argv, char **env) { char *my_argv[] = { "", "power.pl", NULL }; PERL_SYS_INIT3(&argc,&argv,&env); my_perl = perl_alloc(); perl_construct( my_perl ); perl_parse(my_perl, NULL, 2, my_argv, (char **)NULL); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; perl_run(my_perl); PerlPower(3, 4); /*** Compute 3 ** 4 ***/ perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); exit(EXIT_SUCCESS); }
Compile and run:
% cc -o power power.c `perl -MExtUtils::Embed -e ccopts -e ldopts` % power 3 to the 4th power is 81.
However, you have to be more cautious with namespace and variable scoping when using a persistent interpreter. In previous examples we've been using global variables in the default package "main". We knew exactly what code would be run, and assumed we could avoid variable collisions and outrageous symbol table growth.
Let's say your application is a server that will occasionally run Perl code from some arbitrary file. Your server has no way of knowing what code it's going to run. Very dangerous.
If the file is pulled in by "perl_parse()", compiled into a newly constructed interpreter, and subsequently cleaned out with "perl_destruct()" afterwards, you're shielded from most namespace troubles.
One way to avoid namespace collisions in this scenario is to translate the filename into a guaranteed-unique package name, and then compile the code into that package using "eval" in perlfunc. In the example below, each file will only be compiled once. Or, the application might choose to clean out the symbol table associated with the file after it's no longer needed. Using "call_argv" in perlapi, We'll call the subroutine "Embed::Persistent::eval_file" which lives in the file "persistent.pl" and pass the filename and boolean cleanup/cache flag as arguments.
Note that the process will continue to grow for each file that it uses. In addition, there might be "AUTOLOAD"ed subroutines and other conditions that cause Perl's symbol table to grow. You might want to add some logic that keeps track of the process size, or restarts itself after a certain number of requests, to ensure that memory consumption is minimized. You'll also want to scope your variables with "my" in perlfunc whenever possible.
package Embed::Persistent; #persistent.pl use strict; our %Cache; use Symbol qw(delete_package); sub valid_package_name { my($string) = @_; $string =~ s/([^A-Za-z0-9\/])/sprintf("_%2x",unpack("C",$1))/eg; # second pass only for words starting with a digit $string =~ s|/(\d)|sprintf("/_%2x",unpack("C",$1))|eg; # Dress it up as a real package name $string =~ s|/|::|g; return "Embed" . $string; } sub eval_file { my($filename, $delete) = @_; my $package = valid_package_name($filename); my $mtime = -M $filename; if(defined $Cache{$package}{mtime} && $Cache{$package}{mtime} <= $mtime) { # we have compiled this subroutine already, # it has not been updated on disk, nothing left to do print STDERR "already compiled $package->handler\n"; } else { local *FH; open FH, $filename or die "open '$filename' $!"; local($/) = undef; my $sub = <FH>; close FH; #wrap the code into a subroutine inside our unique package my $eval = qq{package $package; sub handler { $sub; }}; { # hide our variables within this block my($filename,$mtime,$package,$sub); eval $eval; } die $@ if $@; #cache it unless we're cleaning out each time $Cache{$package}{mtime} = $mtime unless $delete; } eval {$package->handler;}; die $@ if $@; delete_package($package) if $delete; #take a look if you want #print Devel::Symdump->rnew($package)->as_string, $/; } 1; __END__ /* persistent.c */ #include <EXTERN.h> #include <perl.h> /* 1 = clean out filename's symbol table after each request, 0 = don't */ #ifndef DO_CLEAN #define DO_CLEAN 0 #endif #define BUFFER_SIZE 1024 static PerlInterpreter *my_perl = NULL; int main(int argc, char **argv, char **env) { char *embedding[] = { "", "persistent.pl", NULL }; char *args[] = { "", DO_CLEAN, NULL }; char filename[BUFFER_SIZE]; int failing, exitstatus; PERL_SYS_INIT3(&argc,&argv,&env); if((my_perl = perl_alloc()) == NULL) { fprintf(stderr, "no memory!"); exit(EXIT_FAILURE); } perl_construct(my_perl); PL_origalen = 1; /* don't let $0 assignment update the proctitle or embedding[0] */ failing = perl_parse(my_perl, NULL, 2, embedding, NULL); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; if(!failing) failing = perl_run(my_perl); if(!failing) { while(printf("Enter file name: ") && fgets(filename, BUFFER_SIZE, stdin)) { filename[strlen(filename)-1] = '\0'; /* strip \n */ /* call the subroutine, passing it the filename as an argument */ args[0] = filename; call_argv("Embed::Persistent::eval_file", G_DISCARD | G_EVAL, args); /* check $@ */ if(SvTRUE(ERRSV)) fprintf(stderr, "eval error: %s\n", SvPV_nolen(ERRSV)); } } PL_perl_destruct_level = 0; exitstatus = perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); exit(exitstatus); }
Now compile:
% cc -o persistent persistent.c \ `perl -MExtUtils::Embed -e ccopts -e ldopts`
Here's an example script file:
#test.pl my $string = "hello"; foo($string); sub foo { print "foo says: @_\n"; }
Now run:
% persistent Enter file name: test.pl foo says: hello Enter file name: test.pl already compiled Embed::test_2epl->handler foo says: hello Enter file name: ^C
The persistent.c example above is for instance likely to segfault when $0 is assigned to if the "PL_origalen = 1;" assignment is removed. This because perl will try to write to the read only memory of the "embedding[]" strings.
The program must take care to ensure that this takes place before the next interpreter is constructed. By default, when perl is not built with any special options, the global variable "PL_perl_destruct_level" is set to 0, since extra cleaning isn't usually needed when a program only ever creates a single interpreter in its entire lifetime.
Setting "PL_perl_destruct_level" to 1 makes everything squeaky clean:
while(1) { ... /* reset global variables here with PL_perl_destruct_level = 1 */ PL_perl_destruct_level = 1; perl_construct(my_perl); ... /* clean and reset _everything_ during perl_destruct */ PL_perl_destruct_level = 1; perl_destruct(my_perl); perl_free(my_perl); ... /* let's go do it again! */ }
When perl_destruct() is called, the interpreter's syntax parse tree and symbol tables are cleaned up, and global variables are reset. The second assignment to "PL_perl_destruct_level" is needed because perl_construct resets it to 0.
Now suppose we have more than one interpreter instance running at the same time. This is feasible, but only if you used the Configure option "-Dusemultiplicity" or the options "-Dusethreads -Duseithreads" when building perl. By default, enabling one of these Configure options sets the per-interpreter global variable "PL_perl_destruct_level" to 1, so that thorough cleaning is automatic and interpreter variables are initialized correctly. Even if you don't intend to run two or more interpreters at the same time, but to run them sequentially, like in the above example, it is recommended to build perl with the "-Dusemultiplicity" option otherwise some interpreter variables may not be initialized correctly between consecutive runs and your application may crash.
See also "Thread-aware system interfaces" in perlxs.
Using "-Dusethreads -Duseithreads" rather than "-Dusemultiplicity" is more appropriate if you intend to run multiple interpreters concurrently in different threads, because it enables support for linking in the thread libraries of your system with the interpreter.
Let's give it a try:
#include <EXTERN.h> #include <perl.h> /* we're going to embed two interpreters */ #define SAY_HELLO "-e", "print qq(Hi, I'm $^X\n)" int main(int argc, char **argv, char **env) { PerlInterpreter *one_perl, *two_perl; char *one_args[] = { "one_perl", SAY_HELLO, NULL }; char *two_args[] = { "two_perl", SAY_HELLO, NULL }; PERL_SYS_INIT3(&argc,&argv,&env); one_perl = perl_alloc(); two_perl = perl_alloc(); PERL_SET_CONTEXT(one_perl); perl_construct(one_perl); PERL_SET_CONTEXT(two_perl); perl_construct(two_perl); PERL_SET_CONTEXT(one_perl); perl_parse(one_perl, NULL, 3, one_args, (char **)NULL); PERL_SET_CONTEXT(two_perl); perl_parse(two_perl, NULL, 3, two_args, (char **)NULL); PERL_SET_CONTEXT(one_perl); perl_run(one_perl); PERL_SET_CONTEXT(two_perl); perl_run(two_perl); PERL_SET_CONTEXT(one_perl); perl_destruct(one_perl); PERL_SET_CONTEXT(two_perl); perl_destruct(two_perl); PERL_SET_CONTEXT(one_perl); perl_free(one_perl); PERL_SET_CONTEXT(two_perl); perl_free(two_perl); PERL_SYS_TERM(); exit(EXIT_SUCCESS); }
Note the calls to PERL_SET_CONTEXT(). These are necessary to initialize the global state that tracks which interpreter is the "current" one on the particular process or thread that may be running it. It should always be used if you have more than one interpreter and are making perl API calls on both interpreters in an interleaved fashion.
PERL_SET_CONTEXT(interp) should also be called whenever "interp" is used by a thread that did not create it (using either perl_alloc(), or the more esoteric perl_clone()).
Compile as usual:
% cc -o multiplicity multiplicity.c \ `perl -MExtUtils::Embed -e ccopts -e ldopts`
Run it, Run it:
% multiplicity Hi, I'm one_perl Hi, I'm two_perl
Can't load module Socket, dynamic loading not available in this perl. (You may need to build a new perl executable which either supports dynamic loading or has the Socket module statically linked into it.)
What's wrong?
Your interpreter doesn't know how to communicate with these extensions on its own. A little glue will help. Up until now you've been calling perl_parse(), handing it NULL for the second argument:
perl_parse(my_perl, NULL, argc, my_argv, NULL);
That's where the glue code can be inserted to create the initial contact between Perl and linked C/C++ routines. Let's take a look some pieces of perlmain.c to see how Perl does this:
static void xs_init (pTHX); EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); EXTERN_C void boot_Socket (pTHX_ CV* cv); EXTERN_C void xs_init(pTHX) { char *file = __FILE__; /* DynaLoader is a special case */ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); newXS("Socket::bootstrap", boot_Socket, file); }
Simply put: for each extension linked with your Perl executable (determined during its initial configuration on your computer or when adding a new extension), a Perl subroutine is created to incorporate the extension's routines. Normally, that subroutine is named Module::bootstrap() and is invoked when you say use Module. In turn, this hooks into an XSUB, boot_Module, which creates a Perl counterpart for each of the extension's XSUBs. Don't worry about this part; leave that to the xsubpp and extension authors. If your extension is dynamically loaded, DynaLoader creates Module::bootstrap() for you on the fly. In fact, if you have a working DynaLoader then there is rarely any need to link in any other extensions statically.
Once you have this code, slap it into the second argument of perl_parse():
perl_parse(my_perl, xs_init, argc, my_argv, NULL);
Then compile:
% cc -o interp interp.c `perl -MExtUtils::Embed -e ccopts -e ldopts` % interp use Socket; use SomeDynamicallyLoadedModule; print "Now I can use extensions!\n"'
ExtUtils::Embed can also automate writing the xs_init glue code.
% perl -MExtUtils::Embed -e xsinit -- -o perlxsi.c % cc -c perlxsi.c `perl -MExtUtils::Embed -e ccopts` % cc -c interp.c `perl -MExtUtils::Embed -e ccopts` % cc -o interp perlxsi.o interp.o `perl -MExtUtils::Embed -e ldopts`
Consult perlxs, perlguts, and perlapi for more details.
If your program is using the POSIX 2008 multi-thread locale functionality, you should switch into the global locale and set that up properly before starting the Perl interpreter. It will then properly switch back to using the thread-safe functions.
warn("%d bottles of beer on the wall", bottlecount);
you will have to write the explicit full form
Perl_warn(aTHX_ "%d bottles of beer on the wall", bottlecount);
(See "Background and PERL_IMPLICIT_CONTEXT" in perlguts for the explanation of the "aTHX_". ) Hiding the short forms is very useful for avoiding all sorts of nasty (C preprocessor or otherwise) conflicts with other software packages (Perl defines about 2400 APIs with these short names, take or leave few hundred, so there certainly is room for conflict.)
Doug MacEachern has an article on embedding in Volume 1, Issue 4 of The Perl Journal ( <http://www.tpj.com/> ). Doug is also the developer of the most widely-used Perl embedding: the mod_perl system (perl.apache.org), which embeds Perl in the Apache web server. Oracle, Binary Evolution, ActiveState, and Ben Sugars's nsapi_perl have used this model for Oracle, Netscape and Internet Information Server Perl plugins.
This document may be distributed under the same terms as Perl itself.
| 2019-10-21 | perl v5.30.3 |


Central Tour (5 Days)
Source of the River Nile & Murchinson Falls
Day 1: Arrival, transferred to Hotel, Afternoon have an optional visit to the Uganda wildlife Education Centre for an informative guided walk depending on the time of arrival. O/N Serena Lake Victoria Hotel/Imperial Botanical Beach Hotel/Central Inn HB Basis.
Day 2:Drive to Jinja upon the way experience the tea, sugar-cane plantations and Natural forests of Mabira then Source of the Nile and other waterfalls later on retire at the hotel in the evening. O/N Serena Lake Victoria Hotel/Imperial Botanical Beach Hotel/Central Inn HB Basis.
Day 3:After breakfast, drive west of Uganda to Murchison Falls National Park with a stopover at ziwa rhino sanctuary. In the evening, visit top of the falls. O/N Chobe/ Para Safari Lodge /Red chili HB Basis.
Day 4:Early morning game drive, return to the lodge for breakfast and lunch. Afternoon boat cruise upon the Nile launch trip with refreshing diversity of animal and bird species. Return to the lodge late in the evening. O/N Chobe/ Para Safari Lodge /Red chili HB Basis.
Day 5:After early morning breakfast, drive to Entebbe arriving in the afternoon. Visit Kabazaire project, an orphanage that the company supports then fly out.


Represents the remote Target instance for a sender or receiver link
More...
Inherited by Apache.Qpid.Proton.Client.Implementation.ClientRemoteTarget.
Represents the remote Target instance for a sender or receiver link
◆ Address
| string Apache.Qpid.Proton.Client.ITarget.Address |
|
get |
The address value of the remote target node.
◆ Capabilities
| IReadOnlyCollection<string> Apache.Qpid.Proton.Client.ITarget.Capabilities |
|
get |
The set of capabilities assigned on the remote target node.
◆ DurabilityMode
The durability mode assigned to the target source node.
◆ Dynamic
| bool Apache.Qpid.Proton.Client.ITarget.Dynamic |
|
get |
Indicates if the remote target node was created dynamically.
◆ DynamicNodeProperties
| IReadOnlyDictionary<string, object> Apache.Qpid.Proton.Client.ITarget.DynamicNodeProperties |
|
get |
The node properties assigned to a dynamically created target node.
◆ ExpiryPolicy
The expiry policy assigned to the remote target node.
◆ Timeout
| uint Apache.Qpid.Proton.Client.ITarget.Timeout |
|
get |
The expiry timeout assigned to the remote target node.
The documentation for this interface was generated from the following file:
- src/Proton.Client/Client/ITarget.cs


@* * Copyright 2017 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.play.views.html.helpers.form @import views.html.helpers.{backButtonWithProgress, input, errorSummary, hiddenField, textArea} @import models.investorDetails.PreviousShareHoldingDescriptionModel @import common.Constants @(companyOrIndividual: String, previousShareHoldingDescriptionForm: Form[PreviousShareHoldingDescriptionModel], backUrl: String, investorProcessingId: Int)(implicit request: Request[_], messages: Messages) @main_template(Messages("page.investors.previousShareHoldingDescription.title", companyOrIndividual.toLowerCase())) { @backButtonWithProgress(backUrl, Messages("common.section.progress.details.four")) @errorSummary(previousShareHoldingDescriptionForm, "previous-shareholding-description", "descriptionTextArea")
@Messages("page.investors.previousShareHoldingDescription.example.text")


Search
Main Page
My Library
Social
Settings
Help
MusiMap
MusiMap
My Library
My Artists
Iron Maiden
Judas Priest
Black Sabbath


Call for Tutorial Proposals
The K-CAP 2009 Program Committee invites proposals for Tutorials at K-CAP 2009. Workshops and Tutorials will be held on Tuesday, September 1st, the day before the regular conference technical sessions begin, at the conference hotel in Redondo Beach, CA, USA.
K-CAP tutorials are half-day and should aim to address a specific topic within the scope of conference or a topic which is of interest for the conference participants. It should provide either a introduction into the topic or a comprehensive overview of the topic addressed. The audience will mostly be the conference participants. The topic should be of sufficient relevance with respect to the state of the art. The course can be educational in nature or give a survey of state of the art techniques.
Important dates
| Proposal submission deadline: | April 1, 2009 |
| Notification of tutorial acceptance: | April 25, 2009 |
| Deadline for camera-ready tutorial materials: | July 3, 2009 |
| K-CAP 2009 tutorials: | September 1, 2009 |
Submitting a Proposal
Proposals for tutorials should be between two and five pages in length, and must include the following information:- Contact information of the proposed tutorial lecturer(s) (all names, department, university, telephone, fax and e-mail, short bio-sketch)
- Tutorial title
- Aims and learning objectives including the scope (general topic area)
- Relevance to K-CAP attendees
- Length of course and estimated attendance
- Tutorial abstract (1-2 paragraphs suitable for inclusion in conference registration materials)
- Full description (1-2 pages to be used for evaluation)
- Relevant publications of the proposer(s) with respect to the topic and tutorial history (if any)
- Will tutorial materials be provided to attendees? If so, are there any copyright issues?
Please send your proposals and any inquiries to:
Andreas Hotho, hothocs.uni-kassel.de


I recently began to experiment with hallucinogens. I have done LSD 7 times and mushrooms 3 times now. All of the experiences have been positive, although I wish I would have tried mushrooms before LSD. LSD is a much more hard drug than mushrooms and my shroom experiments seemed insignificant compared to my LSD trips. My doses for shrooms were from 2.5-7 grams and lsd from .5 of a hit to 1.5 hits. I have decided not to take large doses of LSD as my friends who do LSD, quickly increased their dose and now complain of tolerance. The next time I trip with a friend I will definitely increase my dose to 2 hits, but for now 1 has been fine. Tonight I'm planning on taking 1 hit, this being my first trip alone.
In the past month I have had 4 flashbacks. I had none prior to this, although the first time I did LSD was 4 months ago. My first flashback happened while sleeping. I remember thinking I had just awoke in my bed. Getting up, I noticed a huge design on my wall, a red viny square. The vines seemed to be moving around the square perimeter. At this time I felt as if I was on LSD and knew I was having a flashback. Not only was I hallucinating but the high was evident as well. This is all I can recall of my first flashback although I remember feeling as if I had awoken from the flashback, only to realize I was still sleeping and being swept into another flashback.  During the flashback I felt a little frightened, but upon waking up and thinking about what had just happened I felt fine.
My second flashback also happened while sleeping. I can't recall much of what happened during this experience, much like the first flashback. The same thing happened, I felt as if I was awake as the LSD high swept over me. All I remember was my lamp, which is actually in the opposite side of the room from where I was, was on my dresser and biting me. I then unplugged it to stop it from biting me but it continued. This flashback was a little more frightening but again, upon waking up I felt fine.
A few days ago me and a friend decided to pick up some bud. My school had recently been under investigation by a nark posing as a student and busted 9 drug dealers and scared most of the other dealers out of their jobs. Bud has been quite dry so I haven't smoked as much as usual lately. That was most definitely the reason I had gotten a lot higher than normal off of quite a normal dose of 1.5 gs to be shared between me and my friend. I also have learned it's much better to hold in your hits until the pipe comes back to you, definitley increasing my high as well. Once the weed was done we went to his a room, a room I have tripped on LSD before.
I started to notice his very colorful wall paper started to glow and I even noticed some colors that I had never even seen on his wall paper before were standing out. Everything seemed quite normal and I didn't think I would be having another flashback, until the colors on the wall seemed to be moving and blending together, as they had while tripping in his room.  I did not know that pupils became dilated during a flashback? During this flashback I did not feel frightened. Probably because I was awake and in more control. After a minute or two of moving colors, things gpt even more weird. When I looked at my friend, he looked exactly as he did when I looked at him on acid earlier. I can't explain the way he looked except that he looked small and he's 6'5'. His room looked very large, even though it's small and I felt tiny.
Two days later me and the same friend picked up 2 grams of some wonderful smelling blueberry bud. Again, we went into his room feeling quite high. I felt tired so layed down looking at his ceiling. Theres a water stain on his ceiling from rain and the stain started to take the shape of many worms crawling out the ceiling. My eyes dilated again and colors seemed brighter. I was half asleep during most of this flashback and noticed many closed eye patterns, much more intricate than the usual visuals anyone sober will see with closed eyes. As well during this flashback I remember seeing green and purple patterning over everything reminding me of shrooms. I have never heard of anyone having flachbacks due to shrooms, but these patterns were not acid-like and I had seen these exact patterns while on shrooms before.
All of my flashbacks have been positive experiences. While sleeping the flashbacks were much more intense, but more frightening. While awake the LSD high was not evident but it was evident of patterns and movement of colors. These experiences have not changed my thoughts on LSD, and I will continue to experiment with this wonderful drug.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


---
layout: post
title: the story of rauschenbergs erased de kooning
date: '2008-05-20T20:34:56+01:00'
tags: []
tumblr_url: http://backlog.robbevan.com/post/35467991/the-story-of-rauschenbergs-erased-de-kooning
---
The story of Rauschenberg’s Erased de Kooning Drawing - Boing Boing


If debugging errors, start with the first reported error, subsequent tests often rely on earlier ones.


{{error}}
{% endfor %} {% endif %}{{session.miningWallet}}
{% endif %}| Wallet ID | Balance |
| {{wallet.walletID}} | {{wallet.balance}} ctc |
{% if session.miningWalletSet %} {% else %} {% endif %}
This application serves as a way of getting to know the uses of a distributed blockchain. Written in python, the blockchain implements a custom peer-to-peer networking, cryptographic security measures, and the ability to send and recieve transactions. This blockchain allows users to serve as a mining node or a full node capable of generating transactions.
| Sending Wallet ID | Recieving Wallet ID | Timestamp | Amount |
| {{transaction.fromWalletID}} | {{transaction.toWalletID}} | {{transaction.timestamp}} | {{transaction.amount}} ctc |


P.E. - Projetos de Engenharia
A digital portfolio available for everyone is a very important mean of comunication for a company in order to exhibit its work, and that was a major need for PE - Projetos de Engenharia. Luís' work was essential to create our digital archive which final result exceeded our expectations, contributing for a better divulgation of our work, services and skills.


Money Play. How should Red play 44?
pips Red=144 White=151
(CorrectAnswer= 0/0, ErrorScore= 0)
Over the board I played 20/16(2), 13/9(2) which is reasonable but not the best play.
20/16(2), 9/5(2) is better as it makes the 5-pt.
However, the simple 13/5(2) is the best play. It makes a 5-pt prime which neither of the other two plays do. The trade-off is that Red may have some trouble escaping those rear checkers but the five-point prime outweighs that consideration, if only by a small margin.
20/16(2), 9/5(2) is better as it makes the 5-pt.
However, the simple 13/5(2) is the best play. It makes a 5-pt prime which neither of the other two plays do. The trade-off is that Red may have some trouble escaping those rear checkers but the five-point prime outweighs that consideration, if only by a small margin.
1. Cubeful 2-ply 13/5(2) Eq.: +0.702 0.694 0.111 0.002 - 0.306 0.046 0.002 2. Cubeful 2-ply 20/16(2) 13/9(2) Eq.: +0.657 (-0.045) 0.700 0.074 0.001 - 0.300 0.043 0.000 3. Cubeful 2-ply 20/16(2) 9/5(2) Eq.: +0.640 (-0.062) 0.693 0.078 0.001 - 0.307 0.045 0.000 4. Cubeful 2-ply 20/16(2) 6/2(2) Eq.: +0.553 (-0.148) 0.680 0.070 0.001 - 0.320 0.050 0.000 5. Cubeful 2-ply 20/16(2) 8/4(2) Eq.: +0.552 (-0.149) 0.676 0.072 0.001 - 0.324 0.047 0.000


I had high hopes for this one, but it sorta let me down.
I obtained 3 grams of Sinicuichi 25x extract resin. Not knowing exactly what to do with it, I spent quite a bit of time frustratingly trying to smoke the stuff. This proved difficult, and I think I inhaled more butane than I did the actual smoke.
So I tried a gravity bong. Smoked the hell out of it. I began to feel a slight enhancement of the senses. Or it could've been placebo. Who knows? Either way, I fell asleep, and when I woke up, all of my muscles were sore. I had read one report of this happening, and concluded that it was, in fact, due to the Sinicuichi I had smoked. I didn't understand how this could be, since I didn't feel tense at all beforehand.
Today, however, I decided to take the remainder I had (2 grams), and steep it into a tea. Broke the resin up into a powder, mixed it in with some hot water, steeped for about 5 minutes, and strained. This brought me some nice relaxing effects, coupled with a slight warmth, and marginal sensory enhancement. Extremely mild.
After a couple hours, I engaged in my daily meditation, and by the time I was through, every single muscle in my body was sore and tight and aching. Right now I feel like I just got done with a strenuous full-body workout. This still doesn't make any sense to me, because I felt no strange muscle activity during the experience. My only thought is that Sinicuichi must act on the muscle cells in some way - similar to the way Creatine acts.
A muscle relaxer would be good right about now.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Spring 2016 Lectures and Events
Pretalks begin an hour earlier in LC 303B (unless at a special time)
| Date | Room | Speaker | Title | Host |
| January 22 | Cancelled |
Jonas | ||
| January 29 3:30pm |
LC 303B | Sean Sather-Wagstaff Clemson University |
Counting semidualizing modules |
Adela Vraciu |
| February 1 2:55pm |
LC 312 | Sergey Galkin Higher School of Economics, Moscow |
Minuscule varieties and mirror symmetry |
Matthew Ballard |
| February 8 2:55pm |
LC 312 | Marco Aldi Virginia Commonwealth University |
Arithmetic of invertible polynomials and mirror symmetry |
Matthew Ballard |
| February 19 3:30pm |
LC 303B | Justin Sawon University of North Carolina |
On the topology of compact hyperkahler manifolds |
Matthew Ballard |
| February 26 3:30pm |
LC 303B | Sarah Trebat-Leder Emory University |
The 1729 K_3 surface |
Frank Thorne |
| March 4 3:30pm |
LC 303B | Hailong Dao University of Kansas |
Endomorphism rings and non-commutative resolution of singularities |
Adela Vraciu |
| March 11 | Spring Break |
|||
| March 12-16 |
Arizona Winter School |
Analytic Methods in Arithmetic Geometry |
University of Arizona | |
| March 18 3:30pm |
LC 303B | Yuecheng Zhu University of Pennsylvania |
Compactification of moduli space of polarized abelian varieties and mirror symmetry |
Jesse Kass |
| March 25 2:30pm |
LC 303B | Abbey Bourdon University of Georgia |
Torsion in odd degree |
Frank Thorne |
| March 25 3:30pm |
LC 303B | Paul Pollack University of Georgia |
Torsion of CM elliptic curves: analytic aspects |
Michael Filaseta |
| April 2-3 |
SERMON |
Southeast Regional Meeting on Numbers, Harrisonburg, VA |
James Madison University | |
| April 4 4:00pm |
LC 317R | Xiaoheng (Jerry) Wang Princeton University |
Density of polynomials with squarefree discriminant |
Frank Thorne |
| April 8 3:30pm |
LC 303B | Stony Brook University |
Matthew Ballard | |
| April 15 3:30pm |
LC 303B | Frank Moore Wake Forest University |
Twisted matrix factorizations |
Adela Vraciu |
| April 22 3:30pm |
LC 303B | Yusuf Mustopa Tufts University |
Castelnuovo-Mumford Regularity and Generic Vanishing on Irregular Surfaces |
Jesse Kass |
Abstracts
Sean Sather-Wagstaff - Semidualizing modules arise independently in various algebraic contexts, e.g., commutative algebra and representation theory. In spite of this, our understanding of these modules is quite limited. For instance, until recently, it was not know that a given local ring admits only finitely many semidualizing modules (up to isomorphism). We will discuss recent progress on our understanding of these modules, over arbitrary local rings and over special classes of local rings. We will also discuss some motivation for studying these modules, including Avramov and Foxby's composition question for ring homomorphisms of finite G-dimension and growth rates for Bass numbers of local rings. This is joint work with Avramov, Iyengar, and Singh.
Sergey Galkin - I will give a uniform construction of a polynomial that is mirror dual to minuscule homogeneous varieties (e.g. Grassmannians), that we developed with Alexey Bondal. The construction involves a symmetry breaking mechanism of minuscule descent, that I will also explain. Homological mirror symmetry in this case predicts that derived categories of coherent sheaves on these varieties admit full exceptional collections, and it is likely that a uniform construction similar to our mirror construction could produce them, but it have not been found yet. In the pre-talk I will give some background on interplay between projective geometry of homogeneous varieties, representation theory and combinatorics. In particular I'll define (co)minuscule varieties and representations, recall geometric classification of Lie groups (after Landsberg and Manivel), describe Schubert cells, and define Bruhat and Hasse partially ordered sets, and explain Gonciulea-Lakshmibai's toric degenerations to moduli spaces of quiver representations. Pre-talk will start at 2:00 in LC 317R.
Marco Aldi - Lev Borisov gave an elegant proof of Berglund Hübsch duality, a special form of mirror symmetry relating explicit pairs of Calabi-Yau hypersurfaces. In this talk we present an alternate approach to Borisov's proof based on D-module theoretic considerations. An advantage of our method is that when specialized to overconvergent p-adic D-modules it yields non-trivial Frobenius chain-maps which are intertwined by the duality. We conclude by describing the arithmetic information encoded by the eigenvalues of these Frobenius map. This is joint work with Andrija Perunicic. Pre-talk will start at 2:00 in LC 317R.
Justin Sawon -In this talk we will describe some results about Betti, Hodge, and characteristic numbers of compact hyperkahler manifolds. In (complex) dimension four one can find universal bounds for all of these invariants (Beauville, Guan); in higher dimensions it is still possible to find some bounds. We also describe how these bounds are related to the question: are there finitely many hyperkahler manifolds in each dimension, up to deformation?
Sarah Trebat-Leder - (Pretalk: Ranks of Elliptic Curves and a Theorem of Stewart and Top) The first part of the talk will be an overview of elliptic curves, geared towards BSD and the distribution of ranks, and the second part will explain a result of Stewart and Top about the number of cubic twists of x^3 + y^3 = 1 with rank at least 2 or 3.
(Research Talk:) We revisit the mathematics that Ramanujan developed in connection with the famous ``taxi-cab" number 1729. A study of his writings reveals that he had been studying Euler's diophantine equation a^3+b^3=c^3+d^3. It turns out that Ramanujan's work anticipated deep structures and phenomena which have become fundamental objects in arithmetic geometry and number theory. We find that he discovered a K3 surface with Picard number 18, one which can be used to obtain infinitely many cubic twists over Q with rank \geq 2.
Hailong Dao - Let R be a commutative Noetherian ring of finite Krull dimension. It is a classical result that R is regular if and only if it has finite global dimension. In recent years, certain non-commutative rings which are modules-finite over R and have finite global dimension have become objects of intense interests. They can serve as "non-commutative desingularizations" of Spec(R) and have come up in the three-dimensional solution of the Bondal-Orlov conjecture, higher Auslander-Reiten theory and non-commutative minimal model program. Despite all that attention, these objects remain rather mysterious, for example we do not know fully when they exist, or what global dimensions can occur. In this talk I will describe some very recent work on these questions. Some of the work are joined with E. Faber, C. Ingalls, O. Iyama, R. Takahashi, I. Shipman and C. Vial.
Yuecheng Zhu - Thanks to the progress of minimal model program, there is a canonical way of compactifying the moduli space of KSBA stable pairs. A stable pair is roughly a variety and a divisor with some stability conditions. For the moduli space of abelian varieties, the compactification problem thus boils down to how to choose ample divisors. Luckily, mirror symmetry provides a natural choice of ample divisors. Strictly speaking, the divisors provided by mirror symmetry is not unique. Mirror symmetry provides a set of divisors near each large complex limit. However, choose any divisor from the set, we always get the same compactification of the moduli space. I will introduce both KSBA compactification and mirror symmetry, and explain how these two things fit together and provide a canonical compactificaiton of moduli of polarized abelian varieties.
Abbey Bourdon - Let E be an elliptic curve defined over a number field F. It is a classical theorem of Mordell and Weil that the collection of points of E with coordinates in F form a finitely generated abelian group. We seek to understand the subgroup of points with finite order. In particular, given a positive integer d, we would like to know precisely which abelian groups arise as the torsion subgroup of an elliptic curve defined over a number field of degree d. I will discuss recent progress on this problem for the special class of elliptic curves with complex multiplication (CM). In particular, if d is odd, we now have a complete classification of the groups that arise as the torsion subgroup of a CM elliptic curve defined over a number field of degree d. This is joint work with Paul Pollack. Pretalk in LC 310 at 1:10-2:00 pm.
Paul Pollack - For each positive integer d, let T(d) denote the supremum of all orders of groups E(F)[tors] appearing for an elliptic curve E defined over a degree d number field F. A celebrated theorem of Merel asserts that T(d) < infinity for all d. However, the known quantitative results in this direction are far from the conjectured truth. Let T_{CM}(d) be defined the same way as T(d), but with the restriction to CM elliptic curves. I will discuss some recent statistical results concerning T_{CM}(d) and related functions. Perhaps surprisingly, the "anatomy of integers" (as pioneered by Paul Erdos) plays a key role in the proofs. Joint work with Abbey Bourdon and Pete L. Clark.
Jerry Wang - The problem of the density of squarefree discriminant polynomials is an old one, being considered by many people, and the density being conjectured by Lenstra. A proof has been out of question for a long time. The reason it was desired is that a squarefree discriminant polynomial f immediately gives the ring of integers of Q[x]/f(x) and its Galois group. In recent joint work with Manjul Bhargava and Arul Shankar, we counted the number of odd degree polynomials with squarefree discriminant and proved the conjecture of Lenstra. In this talk, I will explain the general strategy of the squarefree sieve and the specific strategy to deal with discriminants which in turn leads to counting integral orbits for a representation of a non-reductive group.
Pretalk at 2:00 in 317R.
Frank Moore - The notion of a matrix factorization was introduced by Eisenbud in the commutative case in his study of bounded (periodic) free resolutions over complete intersections. Since then, matrix factorizations have appeared in a number of applications. We extend the notion of (homogeneous) matrix factorizations to regular normal elements of connected graded algebras over a field. If time permits, examples using the NCAlgebra package for Macaulay2 will be given.
Yusuf Mustopa - The CM (Castelnuovo-Mumford) regularity of a coherent sheaf F on a polarized projective variety X gives a measure of the algebraic complexity of F. A sheaf with CM regularity 0 is globally generated, while a sheaf with CM regularity 1 may not have any global sections at all. In this talk I will discuss results showing that on many well-known polarized irregular surfaces, torsion-free sheaves with CM regularity 1 are generic vanishing sheaves.


Notification Relay
example-web
Displaying
users
Username
Presence
Routing Status
Last user data:
Last contact:


NOTIFY
Section: SQL Commands (7)Updated: 2012-08-14
Index Return to Main Contents
NAME
NOTIFY - generate a notificationSYNOPSIS
NOTIFY name
DESCRIPTION
The NOTIFY command sends a notification event to each client application that has previously executed LISTEN name for the specified notification name in the current database.
NOTIFY provides a simple form of signal or interprocess communication mechanism for a collection of processes accessing the same PostgreSQL database. Higher-level mechanisms can be built by using tables in the database to pass additional data (beyond a mere notification name) from notifier to listener(s).
The information passed to the client for a notification event includes the notification name and the notifying session's server process PID. It is up to the database designer to define the notification names that will be used in a given database and what each one means.
Commonly, the notification name is the same as the name of some table in the database, and the notify event essentially means, ``I changed this table, take a look at it to see what's new''. But no such association is enforced by the NOTIFY and LISTEN commands. For example, a database designer could use several different notification names to signal different sorts of changes to a single table.
When NOTIFY is used to signal the occurrence of changes to a particular table, a useful programming technique is to put the NOTIFY in a rule that is triggered by table updates. In this way, notification happens automatically when the table is changed, and the application programmer cannot accidentally forget to do it.
NOTIFY interacts with SQL transactions in some important ways. Firstly, if a NOTIFY is executed inside a transaction, the notify events are not delivered until and unless the transaction is committed. This is appropriate, since if the transaction is aborted, all the commands within it have had no effect, including NOTIFY. But it can be disconcerting if one is expecting the notification events to be delivered immediately. Secondly, if a listening session receives a notification signal while it is within a transaction, the notification event will not be delivered to its connected client until just after the transaction is completed (either committed or aborted). Again, the reasoning is that if a notification were delivered within a transaction that was later aborted, one would want the notification to be undone somehow --- but the server cannot ``take back'' a notification once it has sent it to the client. So notification events are only delivered between transactions. The upshot of this is that applications using NOTIFY for real-time signaling should try to keep their transactions short.
NOTIFY behaves like Unix signals in one important respect: if the same notification name is signaled multiple times in quick succession, recipients might get only one notification event for several executions of NOTIFY. So it is a bad idea to depend on the number of notifications received. Instead, use NOTIFY to wake up applications that need to pay attention to something, and use a database object (such as a sequence) to keep track of what happened or how many times it happened.
It is common for a client that executes NOTIFY to be listening on the same notification name itself. In that case it will get back a notification event, just like all the other listening sessions. Depending on the application logic, this could result in useless work, for example, reading a database table to find the same updates that that session just wrote out. It is possible to avoid such extra work by noticing whether the notifying session's server process PID (supplied in the notification event message) is the same as one's own session's PID (available from libpq). When they are the same, the notification event is one's own work bouncing back, and can be ignored. (Despite what was said in the preceding paragraph, this is a safe technique. PostgreSQL keeps self-notifications separate from notifications arriving from other sessions, so you cannot miss an outside notification by ignoring your own notifications.)
PARAMETERS
- name
- Name of the notification to be signaled (any identifier).
EXAMPLES
Configure and execute a listen/notify sequence from psql:
LISTEN virtual; NOTIFY virtual; Asynchronous notification "virtual" received from server process with PID 8448.
COMPATIBILITY
There is no NOTIFY statement in the SQL standard.
SEE ALSO
LISTEN [listen(7)], UNLISTEN [unlisten(7)]
Index
This document was created by man2html, using the manual pages.
Time: 05:34:15 GMT, December 24, 2015


{% extends "browse/base.html" %}{% load datastage_browse %} {% comment %} # Copyright (c) 2012 University of Oxford # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # {% endcomment %} {% block title %}Index of /{{ path }}{% endblock %} {% block content %}


Amara link creator
Generate Khan Academy Amara links from YouTube IDs
Send
Link to public Amara video (use only for videos outside of main KA channels!)
Create missing subtitle requests
YouTube IDs
Amara IDs
Amara links


"""
.. admonition:: Summary
- Demonstrates how to use an import hook that does an AST transformation
Fractional math (AST)
==========================
Consider the following standard Python code::
>>> x = 1/10
>>> for i in range(11):
... print(i * x)
...
0.0
0.1
0.2
0.30000000000000004
0.4
0.5
0.6000000000000001
0.7000000000000001
0.8
0.9
1.0
This is quite surprising for beginners, not familiar with the
limitations of representing floating point numbers.
However, we can "fix" this using an import hook that performs
and Abstract Syntax Tree (AST) transformation::
> python -m ideas -a fractions_ast
The following initializing code from ideas is included:
from fractions import Fraction
Ideas Console version 0.0.38. [Python version: 3.10.2]
ideas> x = 1/10
ideas> for i in range(11):
... print(i * x)
...
0
1/10
1/5
3/10
2/5
1/2
3/5
7/10
4/5
9/10
1
ideas> from ideas.session import config
ideas> config.show_changes = True
ideas> x = 1/10
new: x = Fraction(1, 10)
ideas>
"""
import ast
from ideas import import_hook
[docs]class FractionWrapper(ast.NodeTransformer):
"""Wrap all int divisions in a call to Fractions.
Adapted from https://github.com/diofant/diofant"""
def visit_BinOp(self, node):
def is_integer(x):
if isinstance(x, ast.Num) and isinstance(x.n, int):
return True
elif isinstance(x, ast.UnaryOp) and isinstance(x.op, (ast.USub, ast.UAdd)):
return is_integer(x.operand)
elif isinstance(x, ast.BinOp) and isinstance(
x.op, (ast.Add, ast.Sub, ast.Mult, ast.Pow)
):
return is_integer(x.left) and is_integer(x.right)
else:
return False
if isinstance(node.op, ast.Div) and all(
is_integer(_) for _ in [node.left, node.right]
):
return ast.Call(
func=ast.Name(id="Fraction", ctx=ast.Load()),
args=[node.left, node.right],
keywords=[],
starargs=None,
kwargs=None,
)
# IPython requires transformations that return a single node
# whereas ideas works with entire trees.
try:
get_python() # noqa
return node
except NameError:
return self.generic_visit(node)
[docs]def source_init():
"""Adds required import so that ``Fraction`` is a known object."""
import_fraction = "from fractions import Fraction\n"
return import_fraction
[docs]def add_hook(**_kwargs):
"""Creates and automatically adds the import hook in sys.meta_path"""
hook = import_hook.create_hook(
hook_name=__name__,
source_init=source_init,
transform_ast=transform_ast,
ipython_ast_node_transformer=FractionWrapper(),
)
return hook


Traffic Sign Recognition
Classifying Traffic signs using a CNN
In this post I have explained my implementation of a Traffic Sign Classifier using a Convolutional Neural Network trained to classify German Traffic Signs. This project was of a part of Udacity’s Self-Driving Car Nanodegree Program. The complete code for the project can be found here.
Data Set Summary & Exploration
I used the Numpy library to calculate summary statistics of the German traffic signs data set:
- The size of training set is 34799.
- The size of the validation set is 12630.
- The size of test set is 12630.
- The shape of a traffic sign image is (32, 32, 3).
- The number of unique classes/labels in the data set is 43.
Exploratory visualization of the dataset
Here is an exploratory visualization of the data set. It is a histogram showing how the data is distributed by the labels in the training set.
We can observe that some classes such as Class 1 and Class 2 have a lot of data samples (about 2000 each) while some classes such as Class 0 and Class 19 have relatively much fewer data samples (about 200 each). This difference in the number of samples in a particular class may lead to the neural network learning more from the data belonging to the class with more number of samples the class than other classes that have relatively lower number of data samples. This makes the network biased towards a few classes during testing.
We can also observe sample images form all the classes to get some familiarity with the data along with their corresponding labels.
Data preprocessing
As a first step, I converted the images to grayscale because grayscaling removes clutter from an image. Since the problem includes only only classifying images, grayscaling allows the feature maps to concentrate only on the subject under interest. Also, grayscaling converts a 3-channel RGB image to a single channel image which reduces the computation complexity. Grayscaling was achieved by using the OpenCV’s cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
.
import cv2
# Convert to grayscale
def grayscale(image):
gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
return np.reshape(gray, (32,32,1))
There were quite a few images that had low contrast and hence the signs were not clearly visible. This issue can be solved using histogram equalization which can be achieved using OpenCV’s cv2.equalizeHist(image)
. This basicaly enhances tthe contrast of the images and makes the traffic signs more clear. More information about histogram equalization can be found here. So, in the next step I applied histogram equalization on the grayscaled images.
# Histogram equalization to improve contrast
def histogram_equalize(image):
equ = cv2.equalizeHist(image)
return np.reshape(equ, (32,32,1))
In the last step, I normalized the image data using the formula: (image/255) - 0.5
. This step is necessary because normalization helps in making the neural network converge faster since the variation in data is restricted within a specific range (in this case between -0.5 and 0.5). An in-depth discussion on image data pre-processing techniques and their significance is provided in Stanford University’s CS231n course notes.
# Normalize images to improve convergence rate
def normalize(image):
norm = image/255. - 0.5
return np.reshape(norm, (32,32,1))
Model architecture and training
ConvNet architecture
I used a slightly modified version of the LeNet-5 architecture which is a simple 5 layer Convolutional Neural Network with 2 convolution layers, 2 fully connected layers, and a Softmax layer. The diagram below shows LeNet-5’s architecture.
I added a few dropout layers in between to reduce overfitting. My final model consisted of the following layers:
| Layer | Kernel Size | Number of filters | Stride | Description | Padding |
|---|---|---|---|---|---|
| Input | - | - | 32x32x1 pre-processed image | - | |
| Convolution | 5x5 | 6 | 1x1 | outputs 28x28x6 | Valid |
| RELU | - | - | - | Activation function | - |
| Max pooling | 2x2 | 6 | 2x2 | outputs 14x14x6 | Valid |
| Dropout | - | - | - | keep probability (0.7) | - |
| Convolution | 5x5 | 16 | 1x1 | outputs 10x10x16 | Valid |
| RELU | - | - | - | Activation function | - |
| Max pooling | 2x2 | 16 | 2x2 | outputs 5x5x16 | Valid |
| Dropout | - | - | - | keep probability (0.7) | - |
| Flattening | - | - | - | outputs 400 | - |
| Fully Connected | - | - | - | 400 input, 120 output | - |
| RELU | - | - | - | Activation function | - |
| Dropout | - | - | - | keep probability (0.7) | - |
| Fully Connected | - | - | - | 120 input, 84 output | - |
| RELU | - | - | - | Activation function | - |
| Dropout | - | - | - | keep probability (0.7) | - |
| Softmax | - | - | - | 84 input, 43 output | - |
Below is the code for building the network in TensorFlow:
import tensorflow as tf
from tensorflow.contrib.layers import flatten
def LeNet(x, keep_prob):
# Arguments used for tf.truncated_normal, randomly defines variables for the weights and biases for each layer
mu = 0
sigma = 0.1
# Layer 1: Convolutional. Input = 32x32x1. Output = 28x28x6.
conv1_W = tf.Variable(tf.truncated_normal(shape=(5, 5, 1, 6), mean = mu, stddev = sigma))
conv1_b = tf.Variable(tf.zeros(6))
conv1 = tf.nn.conv2d(x, conv1_W, strides=[1, 1, 1, 1], padding='VALID', name = 'conv1') + conv1_b
# Activation.
conv1 = tf.nn.relu(conv1)
# Pooling. Input = 28x28x6. Output = 14x14x6.
conv1 = tf.nn.max_pool(conv1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='VALID')
# Dropout
conv1 = tf.nn.dropout(conv1, keep_prob)
# Layer 2: Convolutional. Output = 10x10x16.
conv2_W = tf.Variable(tf.truncated_normal(shape=(5, 5, 6, 16), mean = mu, stddev = sigma))
conv2_b = tf.Variable(tf.zeros(16))
conv2 = tf.nn.conv2d(conv1, conv2_W, strides=[1, 1, 1, 1], padding='VALID', name = 'conv2') + conv2_b
# Activation.
conv2 = tf.nn.relu(conv2)
# Pooling. Input = 10x10x16. Output = 5x5x16.
conv2 = tf.nn.max_pool(conv2, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='VALID')
# Dropout
conv2 = tf.nn.dropout(conv2, keep_prob)
# Flatten. Input = 5x5x16. Output = 400.
fc0 = flatten(conv2)
# Layer 3: Fully Connected. Input = 400. Output = 120.
fc1_W = tf.Variable(tf.truncated_normal(shape=(400, 120), mean = mu, stddev = sigma))
fc1_b = tf.Variable(tf.zeros(120))
fc1 = tf.matmul(fc0, fc1_W) + fc1_b
# Activation.
fc1 = tf.nn.relu(fc1)
# Dropout
fc1 = tf.nn.dropout(fc1, keep_prob)
# Layer 4: Fully Connected. Input = 120. Output = 84.
fc2_W = tf.Variable(tf.truncated_normal(shape=(120, 84), mean = mu, stddev = sigma))
fc2_b = tf.Variable(tf.zeros(84))
fc2 = tf.matmul(fc1, fc2_W) + fc2_b
# Activation.
fc2 = tf.nn.relu(fc2)
# Dropout
fc2 = tf.nn.dropout(fc2, keep_prob)
# Layer 5: Fully Connected. Input = 84. Output = 10.
fc3_W = tf.Variable(tf.truncated_normal(shape=(84, 43), mean = mu, stddev = sigma))
fc3_b = tf.Variable(tf.zeros(43))
logits = tf.matmul(fc2, fc3_W) + fc3_b
return logits
Training and hyperparameters
To train the model, I used the following hyperparameters:
- optimizer: Adam
- batch size: 128
- number of epochs: 50
- learning rate: 0.001
- mean (for weight initialization): 0
- stddev (for weight initialization): 0.1
# One hot encoding of labels
x = tf.placeholder(tf.float32, (None, 32, 32, 1))
y = tf.placeholder(tf.int32, (None))
one_hot_y = tf.one_hot(y, 43)
# define a new tensor for keep-prob (Dropout)
keep_prob = tf.placeholder(tf.float32, [])
# Model hyperparameters
EPOCHS = 50
BATCH_SIZE = 128
rate = 0.001
logits = LeNet(x, keep_prob)
cross_entropy = tf.nn.softmax_cross_entropy_with_logits(labels=one_hot_y, logits=logits)
loss_operation = tf.reduce_mean(cross_entropy)
optimizer = tf.train.AdamOptimizer(learning_rate = rate)
training_operation = optimizer.minimize(loss_operation)
correct_prediction = tf.equal(tf.argmax(logits, 1), tf.argmax(one_hot_y, 1))
accuracy_operation = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
saver = tf.train.Saver()
def evaluate(X_data, y_data):
num_examples = len(X_data)
total_accuracy = 0
total_loss = 0
sess = tf.get_default_session()
for offset in range(0, num_examples, BATCH_SIZE):
batch_x, batch_y = X_data[offset:offset+BATCH_SIZE], y_data[offset:offset+BATCH_SIZE]
loss, accuracy = sess.run([loss_operation, accuracy_operation], feed_dict={x: batch_x, y: batch_y, keep_prob: 1.0})
total_accuracy += (accuracy * len(batch_x))
total_loss += (loss * len(batch_x))
return total_loss/num_examples, total_accuracy / num_examples
from sklearn.utils import shuffle
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
num_examples = len(X_train)
# initialize the training loss and training accuracy log arrays
training_loss_log = []
training_accuracy_log = []
# initialize the validation loss and validation accuracy log arrays
validation_loss_log = []
validation_accuracy_log = []
print("Training...")
print()
for i in range(EPOCHS):
X_train_norm, y_train = shuffle(X_train_norm, y_train)
for offset in range(0, num_examples, BATCH_SIZE):
end = offset + BATCH_SIZE
batch_x, batch_y = X_train_norm[offset:end], y_train[offset:end]
sess.run(training_operation, feed_dict={x: batch_x, y: batch_y, keep_prob: 0.7})
# training accuracy and loss
training_loss, training_accuracy = evaluate(X_train_norm, y_train)
training_loss_log.append(training_loss)
training_accuracy_log.append(training_accuracy)
# Validation accuracy and loss
validation_loss, validation_accuracy = evaluate(X_validation_norm, y_validation)
validation_loss_log.append(validation_loss)
validation_accuracy_log.append(validation_accuracy)
print("EPOCH {} ...".format(i+1))
print("Training Accuracy = {:.3f}".format(training_accuracy))
print("Validation Accuracy = {:.3f}".format(validation_accuracy))
print("Training Loss = {:.3f}".format(training_loss))
print("Validation Loss = {:.3f}".format(validation_loss))
print()
saver.save(sess, './lenet')
print("Model saved")
## Test accuracy
with tf.Session() as sess:
saver.restore(sess, tf.train.latest_checkpoint('.'))
test_loss, test_accuracy = evaluate(X_test_norm, y_test)
print("Test Accuracy = {:.3f}".format(test_accuracy))
Hyperparameter tuning
My final model results were:
- training set accuracy of 99.4%.
- validation set accuracy of 97.3%.
- test set accuracy of 94.5%.
The following are my model’s accuracy and loss curves:
I chose an iterative approach to modify the Le-Net architecture to get the results:
What was the first architecture that was tried and why was it chosen?
I chose the LeNet-5 architecture as a starting point since it works well on hand-written digits.
What were some problems with the initial architecture?
There was a lot of overfitting with the initial architecture after feeding the network with the pre-processed data. The training accuracy was about 98% and the validation set accuracy was about 93%.
How was the architecture adjusted and why was it adjusted?
To reduce overfitting, I used 2 dropout layers after the 2 fully connected layers. I also used dropout layers after the max-pooling layers after experimentation since it reduced overfitting further. I experimented with different values for the keep probability and 0.7 seemed to provide the best validation accuracy on my architecture. Due to time constraints, I couldn’t experiment with different dropout rates for different layers which would have led to a more finely tuned network.
Which parameters were tuned? How were they adjusted and why?
I increased the number of epochs because the images were not as simple as handwritten digits with 10 classes. The traffic sign dataset contained 43 classes and the complexity of the images was also higher. To encode the information in this training set into the CNN required more nuber of epochs of training. After 10 epochs the validation set accuracy obtained was 93%, after 15 epochs it increased to 95%, and after 50 epochs it increased to 97.3%. This shows that the more number of epochs we train, the better the network learns the training data.
What are some of the important design choices and why were they chosen? For example, why might a convolution layer work well with this problem? How might a dropout layer help with creating a successful model?
Convolution layers are useful if the data contains regional similarity i.e. the arrangement of data points gives us useful insight about the spatial information contained in the daata. Images particularly contain useful spatial information which is an important feature. Convolution layers help in extracting these features.
Dropout turns off or sets the activation in some of the neurons in a layer to 0 randomly. This helps the network learn only the most important features in the images ignoring very minute details which might be noise and may change from image to image even belonging to the same class. This prevents the network from overfitting to the training data. It increases the accuracy on the validation set and hence the testing set. So, the network performs better on new images.
Testing our Model on new images
In general the images acquired from the web have a higher resolution than the images in the training dataset. These images have a lot of objects apart from just traffic signs. Since, my model does not work on newly seen images, I manually cropped the images so that it only contained the traffic sign. Some of the images collected from the ineternet have watermarks embedded on them which distorts the image and adds unwanted noise to them. Furthermore, my model only accepts inputs with an aspect ratio of 1:1 and of size 32x32. Hence, I resized them in order to fit them into my model which lead to a loss of detail in the images. These were a few issues that I encountered during data pre-processing.
The first image should not be difficult for the model to classify because the characteristics (the number “30”) of the traffic sign are simple. But, it should also be kept in mind that there a lot of images in the training dataset that belong to the speed-limit class. So, the model might classify it incorrectly failing to distinguish it from other speed limit traffic signs.
The second image might be challenging for the model to classify because it contains details. But, at the same time it is also very different from the rest of the class of images.
The third image should be difficult for the model to classify because the original image has details such as the deer’s antlers and legs which might be lost while down-sampling to 32x32. This might make it look similar to the “Turn left ahead” trafiic sign.
The fourth image should be easy for the model to classify since the characteristics (the “STOP” letters) of the traffic sign are very distinct from other traffic signs.
The fifth image might be challenging for the model to classify because it contains details. But, at the same time it is also very different from the rest of the class of images.
Performance on new images
Here are the results of the prediction:
| Image | Prediction |
|---|---|
| Speed limit (30km/h) | Speed limit (30km/h) |
| Slippery road | Slippery road |
| Wild animals crossing | Dangerous curve to the left |
| Stop | Stop |
| Road work | Road work |
The model was able to correctly guess 4 of these 5 traffic signs, which gives an accuracy of 80%. I actually downloaded 20 images from the internet and got correct prediction on 16 images which gives an overall accuracy of 80%. Although it is far lower than the accuracy on the test set, I feel that the major reason for the lower accuracy than the actual testing accuracy is that the images downloaded from the internet were originally of higher overall quality (resolution) than the training and testing images. On resizing the images to 32x32x3, some important pixels in traffic signs with detail e.g. road work, slippery road, wild animals crossing etc. were lost which might have led to lower accuracty on the internet images.
But, I was pretty confused as to why sometimes the model was not very certain while identifying speed limit signs. Since, the LeNet-5 network used was primarily used for digit recognition, I hoped that it would perform very well on speed limit signs which was not the case.
Looking into the Softmax probabilities
For the first image, the model is very certain that this is a 30 km/h speed limit
sign (probability of 0.99), and the image does actually contain a 30 km/h speed limit
sign. The top five soft max probabilities were
For the second image, the model is relatively certain that this is a Slippery road
sign (probability of 0.89), and the image does contain a Slippery road
sign. I did not expect the model to be so certain about this sign as after squeezing the image to a size of 32x32x3 some crucial pixels belonging to the road and the car in the image were lost that I felt were important in identifying the sign. The top five soft max probabilities were
For the third image, the model is certain that this is a Dangerous curve to the right
sign (probability of 0.36), while the image actually contains a Wild animals crossing
sign. I did not expect the model to be certain about this sign as after squeezing the image to a size of 32x32x3 some pixels belonging to the antlers of the deer were missing that I felt are crucial in identifying the sign. In fact, after reducing the size of the image the sign looks very similar to the class i.e. Dangerous curve to the left. But, the correct class for the image is the 2nd most probable sign as predicted by the model which is as expected. The top five soft max probabilities were
For the fourth image, the model is very certain that this is a Stop
sign (probability of 0.99), and the image does actually contain a Stop
sign. The top five soft max probabilities were
For the fifth image, the model is relatively certain that this is a Road work
sign (probability of 0.77), and the image does contain a Road work
sign. I did not expect the model to be so certain about this sign as after squeezing the image to a size of 32x32x3 some pixels belonging to the spade that the person in the image is holding were missing that I felt were crucial in identifying the sign. The top five soft max probabilities were
Visualizing the Neural Network
Visual output of the Feature maps
I took an image from the test images downloaded from the internet and fed it to the network.
The feature maps obtained in convolution layer 1 are
It can be observed that the feature maps of the first convolution layer encode the shape of the traffic sign and the edges of the image details, in this example the edges around the letters.
The feature maps obtained in convolution layer 2 are
It seems that the feature maps of the second convolution layer encode more complex information and other minute details present in the traffic sign. It is difficult to comprehend what exactly the convolution filters are capturing in this layer.


Pictures
Home
Pictures
Videos
Trivium frontman Matt Heafy
Overkill frontman Bobby 'Blitz' Ellsworth
Sabaton frontman Joakim Broden
Ozzy and his band
Ozzy and his band