The SWI Prolog Language Server is designed to enable embedding SWI Prolog into just about any programming language (Python, Go, C#, etc) in a straightforward way. It is designed for scenarios that need to use SWI Prolog as a local implementation detail of another language. Think of it as running SWI Prolog "like a library". It can support any programming language that can launch processes, read their STDOUT pipe, and send and receive JSON over TCP/IP. A Python 3 library is included as a part of SWI Prolog, see .
Key features of the server:
The server can be used in two different modes:
Note that the language server is related to the pengines library, but where the pengines library is focused on a client/server, multi-tenet, sandboxed environment, the language server is local, single tenet and unconstrained. Thus, when the requirement is to embed Prolog within another programming language "like a library", it can be a good solution for exposing the full power of Prolog with low integration overhead.
A Python 3.x library that integrates Python with SWI Prolog using the language server is included with in the libs
directory of the SWI Prolog installation. It is also available using pip install swiplserver
. See the Python swiplserver library documentation for more information on how to use and install it from either location.
In general, to use the language server with any programming language:
?- language_server([]).
If it can't find it, see below for how to install it.swipl
executable from that installation.If your SWI Prolog version doesn't yet include the language server:
language_server.pl
file from the GitHub repository.language_server.pl
.sudo
as in `sudo swipl -s ...`.swipl -s language_server.pl -g "language_server:install_to_library('language_server.pl')" -t halt
The language server is designed to act like using the "top level" prompt of SWI Prolog itself (i.e. the "?-" prompt). If you've built the Prolog part of your application by loading code, running it and debugging it using the normal SWI Prolog top level, integrating it with your native language should be straightforward: simply run the commands you'd normally run on the top level, but now run them using the query APIs provided by the library built for your target language. Those APIs will allow you to send the exact same text to Prolog and they should execute the same way. Here's an example using the Python swiplserver
library:
% Prolog Top Level ?- member(X, [first, second, third]). X = first ; X = second ; X = third.
# Python using the swiplserver library from swiplserver import PrologServer, PrologThread with PrologServer() as server: with server.create_thread() as prolog_thread: result = prolog_thread.query("member(X, [first, second, third]).") print(result) first second third
While the query functionality of the language server does run on a thread, it will always be the same thread, and, if you use a single connection, it will only allow queries to be run one at a time, just like the top level. Of course, the queries you send can launch threads, just like the top level, so you are not limited to a single threaded application. There are a few differences from the top level, however:
The basic rule to remember is: any predicates designed to interact with or change the default behavior of the top level itself probably won't have any effect.
The most common way to use the language server is to find a library that wraps and exposes it as a native part of another programming language such as the Python swiplserver
library. This section describes how to build one if there isn't yet a library for your language. To do this, you'll need to familiarize yourself with the server protocol as described in the language_server/1 documentation. However, to give an idea of the scope of work required, below is a typical interaction done (invisibly to the user) in the implementation of any programming language library:
swipl --quiet -g language_server -t halt -- --write_connection_values=true
. To work, the swipl
Prolog executable will need to be on the path or specified in the command. This launches the server and writes the chosen port and password to STDOUT. This way of launching invokes the language_server/0 predicate that turns off the int
(i.e. Interrupt/SIGINT) signal to Prolog. This is because some languages (such as Python) use that signal during debugging and it would be otherwise passed to the client Prolog process and switch it into the debugger. See the language_server/0 predicate for more information on other command line options.$ swipl --quiet -g language_server -t halt -- --write_connection_values=true 54501<PHONE_NUMBER>88147744015809740744888120144
Now the server is started. To create a connection:
<stringByteLength>.\n<stringBytes>.\n
where stringByteLength
includes the .\n
from the string. For example: 7.\nhello.\n
More information on the message format is below.true([[threads(Comm_Thread_ID, Goal_Thread_ID)]])
(which will be in JSON form) indicating successful creation of the connection. Comm_Thread_ID and Goal_Thread_ID are the internal Prolog IDs of the two threads that are used for the connection. They are sent solely for monitoring and debugging purposes.
We can try all of this using the Unix tool netcat
(also available for Windows) to interactively connect to the server. In netcat
hitting enter
sends \n
which is what the message format requires. The server responses are show indented inline.
We'll use the port and password that were sent to STDOUT above:
$ nc <IP_ADDRESS> 54501 41.<PHONE_NUMBER>88147744015809740744888120144. 173. { "args": [ [ [ { "args": ["language_server1_conn2_comm", "language_server1_conn2_goal" ], "functor":"threads" } ] ] ], "functor":"true" }
Now the connection is established. To run queries and shutdown:
run(atom(a), -1)
to run the synchronous query atom(a)
with no timeout and wait for the response message. It will be true([[]])
(in JSON form).close
, waiting for the response message of true([[]])
(in JSON form), and then closing the socket using the socket API of the language. If the socket is closed (or fails) before the close
message is sent, the default behavior of the server is to exit the SWI Prolog process to avoid leaving the process around. This is to support scenarios where the user is running and halting their language debugger without cleanly exiting.quit
message and waiting for the response message of true([[]])
(in JSON form). This will cause an orderly shutdown and exit of the process.
Continuing with the netcat
session (the quit
message isn't shown since the close
message closes the connection):
18. run(atom(a), -1). 39. {"args": [ [ [] ] ], "functor":"true"} 7. close. 39. {"args": [ [ [] ] ], "functor":"true"}
Note that Unix Domain Sockets can be used instead of a TCP/IP port. How to do this is described in the language server Options documentation.
Here's the same example running in the R language. Note that this is not an example of how to use the language server from R, it just shows the first code a developer would write as they begin to build a nice library to connect R to Prolog using the language server:
# Server run with: swipl language_server.pl --port=40001 --password=123 # R Source print("# Establish connection") sck = make.socket('localhost', 40001) print("# Send password") write.socket(sck, '5.\n') # message length write.socket(sck, '123.\n') # password print(read.socket(sck)) print("# Run query") query = 'run(member(X, [1, 2, 3]), -1).\n' write.socket(sck, paste(nchar(query), '.\n', sep='')) # message length write.socket(sck, query) # query print(read.socket(sck)) print("# Close session") close.socket(sck)
And here's the output:
[1] "# Establish connection" [1] "# Send password" [1] "172.\n{\n "args": [\n [\n [\n\t{\n\t "args": ["language_server1_conn1_comm", "language_server1_conn1_goal" ],\n\t "functor":"threads"\n\t}\n ]\n ]\n ],\n "functor":"true"\n}" [1] "# Run query" [1] "188.\n{\n "args": [\n [\n [ {"args": ["X", 1 ], "functor":"="} ],\n [ {"args": ["X", 2 ], "functor":"="} ],\n [ {"args": ["X", 3 ], "functor":"="} ]\n ]\n ],\n "functor":"true"\n}" [1] "# Close session"
Other notes about creating a new library to communicate with the language server:
When using the language server from another language, debugging the Prolog code itself can often be done by viewing traces from the Prolog native writeln/1 or debug/3 predicates. Their output will be shown in the debugger of the native language used. Sometimes an issue surfaces deep in an application and a way to run the application in the native language while setting breakpoints and viewing traces in Prolog itself is the best approach. Standalone mode is designed for this scenario.
As the language server is a multithreaded application, debugging the running code requires using the multithreaded debugging features of SWI Prolog as described in the section on "Debugging Threads" in the SWI Prolog documentation. A typical flow for Standalone Mode is:
tdebug, language_server([port(4242), password(debugnow)])
.In Python this would look like:
% From the SWI Prolog top level ?- tdebug, language_server([port(4242), password(debugnow)]). % The graphical front-end will be used for subsequent tracing true.
# Python using the swiplserver library from swiplserver import PrologServer, PrologThread with PrologServer(4242, "debugnow") as server: with server.create_thread() as prolog_thread: # Your code to be debugged here
At this point, all of the multi-threaded debugging tools in SWI Prolog are available for debugging the problem. If the issue is an unexpected exception, the exception debugging features of SWI Prolog can be used to break on the exception and examine the state of the application. If it is a logic error, breakpoints can be set to halt at the point where the problem appears, etc.
Note that, while using a library to access Prolog will normally end and restart the process between runs of the code, running the server standalone doesn't clear state between launches of the application. You'll either need to relaunch between runs or build your application so that it does the initialization at startup.


Go to parent directory with ../
-
mseiwald
Hi,
it would be really nice, if one could go to the upper directory by entering ../ when in Command-T mode.
Best regards,
Michael
-
Greg Hurrell
Just to clarify what you mean by "go to" there, do you mean that if you began your search query with
../
then Command-T would search for files in the parent directory, without actually changing Vim's current working directory? -
mseiwald
Yes, I meant exactly that.
-
Greg Hurrell
I personally always use Command-T from within the project root of the whatever I'm working on, and Command-T itself is optimized to work in a very project-centric fashion, so I never need to open things from higher levels in the filesystem.
So this isn't something that I personally would use, but if you or somebody else wants to have a go at coming up with a patch then feel free to go for it.
-
anonymous
is there a better solution to the problem listed in this link
http://stackoverflow.com/questions/5585199/using-vims-command-t-within-rails-projects
thanks Jayan
-
Taverius
Necro, but the lack of this is the one thing that keeps me from using Command-T.
Reply
This topic is now closed.


Finished the "Worst" Day of the Year ride. Two gnarly hills, but no elbow pain. Hurray! http://cycling.robotlikes.com/rides/249
2/12/2012, 3:24:27 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Finished the "Worst" Day of the Year ride. Two gnarly hills, but no elbow pain. Hurray! http://cycling.robotlikes.com/rides/249
2/12/2012, 3:24:27 PM
Favs: 0
Retweets: 0
link


API Reference¶
pyifx.hsl
|
Takes image(s) and brightens them. |
|
Takes image(s) and darkens them. |
|
Takes image(s) and applies a specified color over it/them. |
|
Takes image(s) and saturates them. |
|
Takes image(s) and desaturates them. |
|
Takes image(s) and converts them to grayscale. |
pyifx.graphics
|
Takes images(s) and blurs them using a gaussian kernel based on a given radius. |
|
Takes images(s) and blurs them using a mean kernel based on a given radius. |
|
Takes image(s) and pixelates them based on a given factor. |
|
Takes image(s) and creates new images focusing on edges. |
|
Takes image(s) and creates new images that are convoluted over using a given kernel. |
pyifx.comp
|
Takes image(s) and converts them to a given size. |
|
Takes image(s) and converts them to a given file type. |
|
Takes image(s) and writes them to an output destination based on their properties. |
pyifx.misc
|
A class used to create packages of images & their properties created for use with the Pyifx library. |
|
A class used to import images from a directory into Python, creating a list of PyifxImage instances. |
|
Combines the data of two PyifxImages, ImageVolumes, or ImageLists to form new PyifxImages. |


Numeros, the Artist, had two lists $A$ and $B$, such that $B$ was a permutation of $A$. Numeros was very proud of these lists. Unfortunately, while transporting them from one exhibition to another, some numbers were left out of $A$. Can you find the missing numbers?
Notes
Input Format
There will be four lines of input:
$n$ - the size of the first list
This is followed by $n$ space-separated integers that make up the first list.
$m$ - the size of the second list
This is followed by $m$ space-separated integers that make up the second list.
Output Format
Output the missing numbers in ascending order.
Constraints
$1 \le n, m \le 1000010$
$1 \le x \le 10000, x ∈ B$
$Xmax - Xmin \lt 101$
Sample Input
10 203 204 205 206 207 208 203 204 205 206 13 203 204 204 205 206 207 205 208 203 206 205 206 204
Sample Output
204 205 206
Explanation
204 is present in both arrays. Its frequency in A is 2, while its frequency in B is 3. Similarly, 205 and 206 occur twice in A, but thrice in B. So, these three numbers are our output. The rest of the numbers have thesame frequency in both lists.


Cursing in chat; Value 1 Strike; It is very unprofessional as a Staff Member to cuss in the global chat
Insulting a player; Value 1 or 2 Strikes; Insulting a player is an essential server rule, it's more than unprofessional it's disrespectful to a player that could not ever come back on the server just because of that, we will not tolerate it.
Banning, temp banning, muting, kicking without a GOOD reason or a 'joke' reason such as ''ey guys join play.ugottrolledby.Me''; As a staff member, we expect you to understand jokes. Value 1 Strike
Arguing with a staff member higher or lower grade in the global chat; Value 2 strikes; Again, very unprofessional.
Advertising in ANY form will result in 3 Strikes (Instant demotion)
Messing around (Tping to players, tp players to you, put blocks on their base, etc) ; Value 1 Strike ; I understand you want to have fun, But you cannot tp to players, unless they tell you to tp, and if they do, I'd ask you to go in vanish first (will be added for every staff members) and then tp, to be sure they are not in any other player's base, so player doesn't get confused and start being mean to you, etc.
GIVING stuff to players result in 2 Strikes, should be well known for staff.


Free GPUs
All GPUs
Statistics
Collecting statistics since {{ stats_time }}
We are using a conversion factor of 0.30675kgCO2e/kWh (source) to convert energy to CO2 emissions. Further, we are assuming that a tree can offset about 10 kg CO2 per year (source).


A website should be designed for the people who will use it, so that's exactly what I do. User focused design should be the primary goal of any website.
The user interface of an application, weather it's mobile or desktop, can make or brake a business. Getting the interface right and most important of all making it easy to navigate are the keys to a great website.
experiance with post and get request and connecting to mySQL, mongoDB, and firebase
Graduate from UC Berkeley Full stack Developer program. I'm a person who has always been interested in technology and strives everyday to build better code. I enjoy working with others and learning from my peers also open to learning new languages. I have plenty of experiance with both front and backend development currently looking for new oppertunities.;


subject = 'Message from ' {{ origin }} == Hi {{ owner }}, Good news! User {{ name }} ({{ email }}) just send a message from contact form. {{ content }} This message was sent using no formatting (plain text) ==
Hi {{ owner }},
User {{ name }} ({{ email }}) just send a message from {{ origin }}.
This email was sent using formatting (HTML)


Distributions¶
The predict
method of Golem requires to specify the type of input uncertainty via a list of probability
distributions:
golem.predict(X=X, distributions=[Normal(std=0.1), Uniform(urange=0.5)])
Below are the distributions implemented and available in Golem. Note that, in addition to the distributions below, the Delta function can be used to indicate variables with no uncertainty:
golem.predict(X=X, distributions=[Delta(), Uniform(urange=0.5)])
Continuous Distributions¶
Discrete and Categorical Distributions¶
Frozen Distributions¶
These are distributions that do not change location depending on the input sample. Contrary to the above classes, in the “frozen” distributions the location is fixed when instantiating the class. This may be useful when the input uncertainty is not due to a control factor one can influence, but it is caused by an environmental factor causing uncertainty in the conditions.
Custom Distributions¶
If you would like to model input uncertainty using a distribution not available in Golem, you can provide any user-defined distribution as shown in the Custom Distributions example.


|
Vagina DentataImagine the soft, glistening folds that open into the female vagina. Indeed, if you are male you probably imagine them quite often -- the wet, inviting warmth, the luscious sensuous sensations as you glide into your lover.    And of course the answer would be Sigmund Freud -- the same fellow who told us that every woman secretly wants to take the knife to the hot parts of her honey, separating him irrevocably from his out-thrusting manhood. Makes you kinda wonder what life was like between Freud and the Mrs., doesn't it? Over the intervening decades since its popularization by the good doctor, vagina dentata has been invoked by countless individuals seeking to explain how "society" came up with this image of the castrating twat armed with deadly teeth. Oddly enough few have noted that the real question is, "How did Freud come up with this idea which he then projected onto the unconscious of his patients, society at large, and even the mythologies of other cultures?" Instead his assertion that the vagina dentata was a universal fear, lurking in the unconscious of every man, went relatively unchallenged. Why? Freud was the father of psychoanalysis, credited with drawing his conclusions after years of careful listening to the fantasies, dreams, and phobias of countless patients. Furthermore, he was a Great Man, and of course Great Men know more than the rest of us schmucks. That's what makes them Great Men, right? But over the years, more and more scholars have begun to notice a disturbing fact -- that Freud's interpretations of his patients' dreams and obsessions contained a very unscientific "fudge factor". Not only did it appear that he had blatantly projected his own bias onto the data (by interpreting his patients dreams to mean just what he wanted them to mean), but he had possibly even fabricated some of the data itself! That is, a few of the "case histories" or stories from patients were made up by Freud himself -- there was no patient. Therefore, where he used these same dreams and stories to demonstrate or "prove" his theories (that penis envy, vagina dentata, the Oedipus complex and etc.) were archetypal human fears and longings, he was not proving anything at all. Except how skilled he was at finding justification for his preconceived ideas in literature and in life situations. This tendency to interpret texts and events to fit preconceived theories would later be copied by psychology majors and lit crit students ad nauseum, as they found vagina dentatas, envied penises, and other Freud derived symbology hidden within the words and imagery of countless books, movies, songs, plays, speeches, and ancient myths. Gleefully they plucked forth their Freudian plums and crowed, "What a good scholar am I!" Eventually this over zealous symbol detection led to the opposing cry, "Sometimes a cigar is just a cigar!" This same approach to collecting "evidence" may have frequently led the great man himself to steam roll over the real meaning (and value for healing) in his patients' confessions.  Never mind that countless other fears and neuroses could be equally symbolized by decapitation. Never mind the value of exploring what decapitation meant to the patient himself. Freud was looking for castration -- and so castration was what he found. Of course, it may not be entirely fair to look back over the great man's notes and second-guess his interpretations. After all, a good therapist follows also his intuition, as to what the patient's real issue is and what he or she needs to confront in order to heal. Maybe all those patients really were hung up on castration. Maybe. But Freud's assertion that "probably no male human being is spared the terrifying shock of threatened castration at the sight of female genitals", just doesn't ring true for most of us today.  And clearly the response it creates is not terror, but gleefully horny desire! Sticky pages indicate an entirely different reaction to the vagina than that pointed to by Freud. Which is not to say that there aren't plenty of people out there who are afraid of the female genitalia. Two million cases a year of genital mutilation or Female Circumcision would indicate otherwise. It is simply that it is important to view Freud (and others with vagina angst) as a person of a certain time and place. He was a Victorian. And as the anthropologist Margaret Mead pointed out, the Victorians raised children in complete ignorance of many of the facts of life that children in earthier cultures took for granted. As a consequence, while children in Samoa, for example, were able to take in stride the death of a grandparent, the birth of a sibling, the bickering of parents or their routines of making love, the Victorians and their children could be deeply traumatized by any and all of these same events.  Therefore, afraid to mention the "unmentionable", they were left to their own mental devices, attempting to concoct understandings that would help them make sense of the life situations encountered. Essentially they were left to reinvent the wheel, as it were -- while their peers in other cultures (like Samoa) had only to call on first hand knowledge all around them in daily life -- or to ask their aunty or uncle. Not surprisingly, this information gap created a lot of shame, guilt, trauma, and neurosis. Imagine the qualms of the properly brought up Victorian male, never having seen or discussed a twat before in his life, not knowing what to expect of it, what to do with it (other than mount it -- if he was a farm lad he had an advantage), and then suddenly, there it is! Pretty scary stuff. Interestingly, his angst becomes even more understandable when you consider the fact that the Victorian woman, subdued by society, somewhat enslaved to her husband, was herself a thing of mystery. Repressed, hemmed in, prone to strange fits of temper, anxiety, and hysteria -- who knew what she was hiding inside! And so in dreams, her hidden regions came armed with teeth. That place where she was supposed to "submit" to her husband, that place where he was to take his pleasure (and she receive frustration and another chance to get knocked up), that place might have some hidden monster waiting within, waiting to wreak its revenge. So goes the workings of the unconscious. But the angst that Freud identified was specific and local -- the uneasiness of the Victorian male at putting his member, for the first time, in a female's cunt was his own -- not Humankind's.   Little wonder then that some men in such cultures fear those teeth will one day crop up "down there" and wreak their revenge. But despite the anxiety many a virgin male in (less mysogynist) cultures has felt at his first encounter (Will I be able to get it up? Will I last long?  To claim otherwise is ridiculous and unsuported by the evidence. (Unless you stick with the tactic of ignoring evidence that says otherwise.) For example, the average modern American male, might fear getting laughed at, getting dumped -- but devoured? Well... maybe. At least if supplied with the right visual suggestion! But the fact that there have been numerous cultures with fears about the vagina, does not prove that every man, everywhere, and in all times inevitably fears being devoured by it. It merely proves that some men, sometimes, have harbored this belief. And it shows that the study of the relationship between culture and mythology provides us with interesting insight into the nature of gender relations -- especially into the unconscious components of gender relations. And in fact, we might even be able to conclude that being the "dominant" gender in an uptight society is not without its psychological perils! Related Trivia
|


Far far away, behind the word mountains, Description for the item, Description for the item. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. Description for the item, Description for the item, Description for the item. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life.
We know our food is kind of messed up, But ocassionally we do make the following awsome food,.
Kadalai mixed with spices blah blah, kuppai konjam pottu seitha loosu curry.
Obviously made of paneer, what you can't immediately guess is it contains more than 70% water. yes you are paying for the water mostly
Star item of the day, Made by our lovely cook 'Queen', yaa thats right, cook and the underground station, both are queen*...
Made by humans for our fellow human customers. It is edible
Made from potatos, yes we kinda upgraded your potato stew by adding some coconut milk and curry powder.
As the title says, I am out of words now.
Fruits coz I have no idea what to put here.
Again no idea.
Find me some idea please.
Does your mama sell egg and meat ????.
Description for the item, Deepavali varuthu.
Description for the item, Description for the item, Description for the item.


LJ028-0349: who were each required to send so large a number to Babylon, that in all there were collected no fewer than fifty thousand.
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ002-0260: Yet the public opinion of the whole body seems to have checked dissipation.
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ031-0014: the Presidential limousine arrived at the emergency entrance of the Parkland Hospital at about twelve:thirty-five p.m.
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ046-0191: it had established periodic regular review of the status of four hundred individuals;
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ002-0253: were governed by rules which they themselves had framed, and under which subscriptions were levied
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ008-0121: After the construction and action of the machine had been explained, the doctor asked the governor what kind of men he had commanded at Goree,
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ028-0145: And here I may not omit to tell the use to which the mould dug out of the great moat was turned, nor the manner wherein the wall was wrought.
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ015-0194: and behaved so as to justify a belief that he had been a jail-bird all his life.
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ023-0016: In nineteen thirty-three you and I knew that we must never let our economic system get completely out of joint again
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
LJ011-0141: There were at the moment in Newgate six convicts sentenced to death for forging wills.
| Ground truth | WaveGlow | Tacotron2 | Glow-TTS | BVAE-TTS | BVAE-TTS w/o jittering |
|---|---|---|---|---|---|
Transcript: Hello My Friends
| Block | Sample1 | Sample2 | Sample3 |
|---|---|---|---|
| Block 1 | |||
| Block 2 | |||
| Block 3 | |||
| Block 4 |
Transcript: One Two Three
| Block | Sample1 | Sample2 | Sample3 |
|---|---|---|---|
| Block 1 | |||
| Block 2 | |||
| Block 3 | |||
| Block 4 |
Transcript: Trick Or Treat
| Block | Sample1 | Sample2 | Sample3 |
|---|---|---|---|
| Block 1 | |||
| Block 2 | |||
| Block 3 | |||
| Block 4 |
Transcript: One Two Three
| Emphasis on One | Emphasis on Two | Emphasis on Three | Concatenated |
|---|---|---|---|


2009 Employee Sales by Department
food
auto
household
furniture
kitchen
bath
Mary
190
0
40
120
30
-70
Tom
-3
40
30
45
35
49
Brad
10
180
10
85
25
79
Kate
40
80
90
25
15
119


What is Samshuddhi? Samshuddhi is a word from Sanskrit origin, which means Purity or Cleanliness.
What is project Samshuddhi? Samshuddhi is a project by Relief Call which aims to provide financial help to underprivileged CKD patients who are on Haemodialysis, through subsidized dialysis after a thorough background check.
Why project Samshuddhi is started? Kidney failure or CKD is one such disease where the treatment is really not affordable, one has to ideally get dialysed thrice a week which counts up to 12 dialysis per month. We realized that there are so many out there who really can’t afford a prescribed number of dialysis per week due to financial problems, then a toddler called ‘Relief Call’ came into existence
Benefits of Samshuddhi.
Beneficiaries of Samshuddhi


General
-
Why is parseRequest() returning no items?
-
This most commonly happens when the request has already been parsed, or
processed in some other way. Since the input stream has aleady been
consumed by that earlier process, it is no longer available for parsing
by Commons FileUpload.
[top]
-
Why am I getting "Read timed out" exceptions while parsing?
-
The most common cause of these exceptions is when FileUpload is being
used on a site that is using the Tomcat ISAPI redirector. There was a
bug in earlier versions of that component that caused problems with
multipart requests. The bug was fixed some time ago, so you probably
just need to pick up a newer version. See the
Tomcat bug report
for full details.
[top]
-
Why is NoClassDefFoundError being thrown?
-
There are two common causes for this error.
Firstly, it might simply mean that you do not have the Commons IO
jar in your classpath. FileUpload depends on IO (see
dependencies) - you can tell if
this is the case if the missing class is within the
org.apache.commons.io package.
Secondly this happens when attempting to rely on a shared copy of
the Commons FileUpload jar file provided by your web container. The
solution is to include the FileUpload jar file as part of your own
web application, instead of relying on the container. The same may
hold for FileUpload's IO dependency.
[top]
-
Why does FileItem.getName() return the whole path, and not just the file name?
-
Internet Explorer provides the entire path to the uploaded file and not
just the base file name. Since FileUpload provides exactly what was
supplied by the client (browser), you may want to remove this path
information in your application. You can do that using the following
method from Commons IO (which you already have, since it is used by
FileUpload).
String fileName = item.getName();
if (fileName != null) {
filename = FilenameUtils.getName(filename);
}
[top]
FileUpload and Struts 1
-
I'm using FileUpload in an Action, but it's not working. Why?
-
Struts 1 recognises multipart requests, and parses them automatically,
presenting the request parameters to your code in the same manner as
if they were regular request parameters. Since Struts has already
processed the request, and made it available in your form bean, the
input stream is no longer available for parsing, so attempting to do
so with FileUpload will fail.
[top]
-
But I need to parse the request myself. How can I do that?
-
Struts 1 parses multipart a request as a part of the process of populating
your form bean from that request. If, for some reason, you need to have
full control over the multipart parsing, you can do so by configuring
your action mapping without an associated form bean. (A better way of
doing this, however, is to replace the default multipart handler with
your own. See the Struts 1 documentation for details.)
[top]
FileUpload and Flash
-
I'm using FileUpload to receive an upload from flash, but
FileUpload will always throw an Exception "Stream ended unexpectedly".
What can I do?
-
At least as of version 8, Flash contains a known bug: The multipart
stream it produces is broken, because the final boundary doesn't
contain the suffix "--", which ought to indicate, that no more
items are following. Consequently, FileUpload waits for the next
item (which it doesn't get) and throws an exception.
The problems details and a possible workaround are outlined in
Bug 143
. The workaround suggests to use the streaming API
and catch the exception. The resulting code could look like
this:
final List<FileItem> items = new ArrayList<FileItem>();
HttpServletRequest servletRequest = [...];
RequestContext ctx = new ServletRequestContext(servletRequest);
FileItemFactory fileItemFactory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload();
FileItemIterator iter = upload.getItemIterator(ctx);
try {
while (iter.hasNext()) {
FileItemStream item = iter.next();
FileItem fileItem = fileItemFactory.createItem(item.getFieldName(),
item.getContentType(),
item.isFormField(),
item.getName());
Streams.copy(item.openStream(), fileItem.getOutputStream(), true);
items.add(fileItem);
}
} catch (MalformedStreamException e) {
// Ignore this
}
[top]
FileUpload and Flash
- I have read, that there is a security problem in Commons FileUpload, because there is a class called
DiskFileItem, which can be used for malicious attacks.
-
It is true, that this class exists, and can be serialized/deserialized in FileUpload versions, up to, and
including 1.3.2. It is also true, that a malicious attacker can abuse this possibility to create abitraryly
located files (assuming the required permissions) with arbitrary contents, if he gets the opportunity to
provide specially crafted data, which is being deserialized by a Java application, which has either of the
above versions of Commons FileUpload in the classpath, and which puts no limitations on the classes being
deserialized.
That being said, we (the Apache Commons team) hold the view, that the actual problem is not the DiskFileItem
class, but the "if" in the previous sentence. A Java application should carefully consider, which classes
can be deserialized. A typical approach would be, for example, to provide a blacklist, or whitelist of
packages, and/or classes, which may, or may not be deserialized.
On the other hand, we acknowledge, that the likelyhood of application container vendors taking such a
simple security measure is extremely low. So, in order to support the Commons Fileupload users, we have
decided to choose a different approach:
Beginning with 1.3.3, the class DiskFileItem is still implementing the interface java.io.Serializable.
In other words, it still declares itself as serializable, and deserializable to the JVM. In practice,
however, an attempt to deserialize an instance of DiskFileItem will trigger an Exception. In the unlikely
case, that your application depends on the deserialization of DiskFileItems, you can revert to the
previous behaviour by setting the system property "org.apache.commons.fileupload.disk.DiskFileItem.serializable"
to "true".
[top]
|


Help us Activate Good.
We're conducting a brief survey to help ensure
the content on our platform is relevant and helpful.
Text
RESEARCH
to
51555
to be a part of our special research group, and
earn
$10
after completing the simple survey!


TL;DR: We finalized our name and launched our website!
The InMōshn Website
We've developed a website to showcase our team and our work progress. The website will includes a blog (not yet actually, but soon™) that will be updated weekly with what InMōshn's team has been up to that includes what work had been done over the past week and what is currently a work in progress.
For developing the website, I found a really good looking template online and built off of it. The template I used is called Agency that is built with Bootstrap. The website is completely static and is hosted on Github Pages. The website is complete but there is still a lot of code from the template that is unused and will remain unused that needs to be removed.
Whats your Name?
Cooking up a name for your company/product isn't an easy task. It takes time to come up with a creative name that sounds good and isn't boring. The name is ideally short, easy to remember, available on all social networks (@InMoshn on Twitter, I'm looking at you! 😡), not cringey, etcetc. Our process for coming up with names started at: Do we want to name our company or our product?
"Company. Lets name our company", said Darshak in November in my imagination as I was writing this blogpost. We spent a lot of idle time thinking of names and tossing at each other during the months of November and December. Then struck January: We hit and found InMōshn. It was great! It fit what we're doing, it sounded nice, it's spelled in a way you would expect a new small company to spell their own name, it was a great name! And so, we settled.*
* TBH, I randomly came up with this name while making this website and we thought, “ya thats fine…lets stick to it!”.
That's all for this week! I'll leave you with my favourite video/gif/picture of the week at the end of each blog post as a thank you for reading the blogposts 😄
Hilarious ad for an animal shelter! My favourite part: The homemade wacky waving arm inflatable tube mangirl at the beginning.


| DOSE: |
10 bowls |
smoked |
Opium |
(tar / resin) |
This may seem curiously similar to a previously written story, but it's unrelated although reading the other story and seeing that there were only 11 entries in the opium category did inspire me.
We flew into Vientiane and stayed the night at a low end hostel off the big square (forgive me but I don't remember the names and I don't have a LP handy). Rented a Suzuki Samurai-style thing the next day and made our way out.
The place we stayed was quite nice, if rustic. Comfortable at any rate.
The basic drill was to smoke in the evening and wake up late. Our primary morning activity was joint rolling. The first night we were lucky enough to share in a special meal prepared in honor of some friends of the proprietor. A few hours after we had retired to our cabin the proprietor and an older gentleman came to our cabin. They brought a long pipe, perhaps 36' long, made of bamboo. A ceramic bulb capped one end of the pipe. The ceramic bulb had one hole about 1/8' in diameter.
I went first. Although I would have preferred to sit up, I was instructed to lie down. I did. The older gentleman motioned for me to turn onto my side. Once I had done so he placed a candle on the bed. Then he kind of curled up on the bed a few feet from me, just past the candle. He pulled a cellophane packet of opium from his vest and a metal poker 8' long and 1/16' in diameter from his pants pocket. He heated the poker in the candle's flame. Then he pushed the poker into the opium, pulling a chunk away with the poker. He heated the opium-laden poker, molding the opium into a cone with his fingers. He finished by pushing the poker through the hole in the bulb, leaving a cone on the outside of the buld with a nice hole in its center.
With the opium nicely formed on the pipe the old man indicated that I should take the straight end in my mouth. He held the bulbous end over the candle and the opium started to bubble. Smoke visibly poured over the edges of the cone. The smoke tasted deliciously sweet. I felt no rush or high.
As the opium burned it became molten and began to drip into the hole. In order to prevent its blocking the hole, the old man used the poker to push the molten opium through the hole, into the bulb. [The contents of the bulb, are, as attested to elsewhere, the spoils of the old man. He smokes for free (and makes money on the opium itself - 40/bowl at the time - hey, everybody's got to have some kind of gig). Please don't think that detracted, detracts, or will detract, for me, from the pleasure of the experience.] It takes a minute or two to smoke a bowl. The ritualistic aspect is cool in and of itself. I admit that having the pipe tended by someone my own age lost a certain thrill.
I smoked 10 bowls in a row over 20-30 minutes. It was my first time. After I finished I moved and my buddy got up on the bed (it was his bed - I had my own) I tried to read inside the cabin but the light was too dim, so I went to the porch. I had a little trouble focusing so I got my glasses (which I don't typically wear for reading), but they didn't help much. I went and laid down on my bed. I felt the opium.
My buddy was finishing up his hits. Our friends took off to the next cabin and we put on some Groove Armada. We had a crappy speaker set for our walkman, but the music complemented the mood. We drifted in and out, talking occasionally for the first hour or so and then silent for a couple more hours before just going out completely.
Smoking opium is like orally imbibing lethargy and goodwill. The warmth is immeasurable. The dreams are wonderful. Practically zero hangover.
We smoked three days in a row, the last day twice, once in a bamboo hut. It's cool to look down and see sloping dirt below the house. This ain't no park.
We ate a couple of balls that a second old man had cooked up for us with the remainder of a lump we'd bought through a local connection (he'd just heated the stuff and rolled it into balls, actually, but we didn't realize that when we were told that we should do it). We ate them back in Vientiane. The night market was better in slo-mo. Kind of like pot & valium in a shopping mall, it just takes the edge off.
The context contributes to the experience but opium's worth trying regardless.
Pardon my paranoia, but I haven't given many details about location as I don't want to endanger any nice places. I've even changed the country and city. Suffice to say that it was very pleasant. With great weather.
I understand that the stuff's quite addictive, so take it easy. But try it.
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.


Run Sql
Run Sql is used to execute any valid SQL on specified Database.
Run Sql does not have any port on it.
The Run Sql component can be easily distinguished in the component palette.
An enlarged version of the same is depicted when dragged on the canvas.
For further reference click on the links below:


The function model file is structured as a sequence of one or more functionSet elements.
The functionSet element represents the set of native functions declared within or included
from a C++ header file.
- Header File Name
- Contains the name of the header file that declares the C++ functions or
includes other header files that declare them.
- CPP Namespace Name (Optional)
- The second (optional) element is named cppNamespacename, which gives the
C++ namespace for the functions. If the cppNamespacename element is not present, the SPL namespace,
with "." converted to "::" is used.
- Functions
- A sequence of one or more function elements, each representing a native function signature in SPL format.
- Description
- A description of the function
- Prototype
- The prototype of the native function. Native function prototypes are declared with SPL syntax,
which is described in the IBMStreams Processing Language Specification.
- CPP Name (Optional)
- Specifies the C++ name of the function. If not present, the SPL function name is used.
- Dependencies (Optional)
- A sequence of one or more library elements, each representing a library dependency.
The library element format is exactly the same as the one used for operator models.
- Description (Optional)
- A description of the library
- Managed Library
- Specifies the details of the individual library artifacts. The paths can
contain environment variables embedded between @ signs (for example: @FOO_FFT_HOME@/lib),
which will be fully resolved by the SPL compiler at compile time.
- lib (Optional)
- Specifies a name to be passed to C++ compiler's -l argument
(such as fft which will be translated into -lfft when passed to the linker)
- libPath (Optional)
- Specifies a path to be passed to C++ compiler's -L argument.
- includePath (Optional)
- Specifies a path to be passed to C++ compiler's -I argument.
- command (Optional)
- A path to a program that will be executed to retrieve includePath, libPath, and lib
information. If the path to the program is relative, it is assumed to be rooted at the directory of the
operator model. The program is executed three times, each time with a different argument, namely lib,
libPath, and includePath. 1 The standard output from these executions will be read and each line
(trimmed of white spaces) will be added to one of the lib, libPath, and includePath elements, depending
on the type of the execution. A line that begins with # will be ignored. Relative paths are assumed to
be rooted at the directory where the operator model XML document resides.
Example
<functionModel
xmlns="http://www.ibm.com/xmlns/prod/streams/spl/function"
xmlns:cmn="http://www.ibm.com/xmlns/prod/streams/spl/common"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/xmlns/prod/streams/spl/function functionModel.xsd">
<functionSet>
<!-- header file to include from within C++ code -->
<headerFileName>Sample.h</headerFileName>
<!-- functions lists the SPL prototypes of the functions implemented in this library -->
<functions>
<!-- use of CDATA allows easy use of < in the prototypyes -->
<function>
<description>Increment all list elements by a given amount</description>
<prototype cppName="increment_by"><![CDATA[ void incrementBy(mutable list<int32> l, int32 incr) ]]></prototype>
</function>
<function>
<description>Join two lists</description>
<prototype><![CDATA[ list<int32> joinLists(list<int32> a, list<int32> b) ]]></prototype>
</function>
</functions>
<dependencies>
<!-- This library can have several dependencies. We only use one here -->
<library>
<!-- A description for this library -->
<cmn:description>Sample-Functions</cmn:description>
<cmn:managedLibrary>
<!-- the name of the library for linking. Will be used as -lSample -->
<cmn:lib>Sample</cmn:lib>
<!-- Where to find the library. Relative to the current directory.
Will be used as -L<dir>/lib -->
<cmn:libPath>lib</cmn:libPath>
<!-- Where to find the include file. Relative to the current directory.
Will be used as -I<dir> -->
<cmn:includePath>./</cmn:includePath>
</cmn:managedLibrary>
</library>
</dependencies>
</functionSet>
</functionModel>


From Textarea
When you create the Rich Text Editor from a textarea it automatically initializes the editor with the data in textarea and sends the content back to textarea when it is changed.Textarea is never removed from the DOM, it is hidden. Therefore, if textarea is part of the form that you submit, the data in the textarea will be submitted to the server along with the rest of form data.


When I was a lass on the Emerald Isle
I heard many stories both lovely and wild
About the great dragons and monsters that be
That swallow the ships when they sail on the sea
Though I was an artist with canvas and paints I sailed
with St. Brendan and his jolly saints
We told the good people good-bye for a while
(Chorus)
We sailed for St. Brendan's Fair Isle, Fair Isle We
sailed for St. Brendan's Fair Isle
We'd been on the ocean for ninety four days
We came to a spot where the sea was ablaze
Those demons from Hades were dancing with glee
And burning the sailors alive on the sea
Then St. Brendan walked on the blistering waves
He threw all the demons right back to their caves
And all of the saints wore a heavenly smile
(Chorus)
One night while the brethren were lying asleep
A great dragon came up from under the deep
He thundered and lightened and made a great din He
awakened St. Brendan and all of his men
The dragon came up with his mouth opened wide
We threw in a cross and the dragon died
We skinned him and cooked and feasted awhile
(Chorus)
We sailed for St. Brendan's Fair Isle, Fair Isle We
sailed for St. Brendan's Fair Isle
At last we came unto a beautiful land
We all went ashore and we walked on the sand
We took our long bows and killed a Zebu
We roasted it up and had hot barbecue
And after awhile we were singing a song
We noticed the island was moving along
We ate and we drank and we rode in high style
(Chorus)
Now Brendan said crew it is much to my wish
We ride on the back of the world's biggest fish
Hold fast to the rope that is pulling the ship
We'll need it someday if this fish take a dip
We sailed every ocean we sailed every sea
We sailed every spot that a sailor could be
In forty four days we sailed ten million miles
(Chorus)
We sailed for St. Brendan's Fair Isle, Fair Isle We
sailed for St. Brendan's Fair Isle,
We sailed for St. Brendan's Fair Isle, Fair Isle
We sailed for St. Brendan's Fair Isle,


Unaligned Collision Avoidance is one of the approaches to avoid moving objects (for example other agents).
In this simulation, other vehicles are a cause of collisions.
To prevent this, their predicted positions are compared with the vehicle's position.
The result tells if avoidance has to be performed.
To avoid a collision the vehicle accelerates or decelerates and seekes the opposite direction.
The orange vector sticking out of the center of the vehicle is a visualization of the desired velocity and the violet one shows the current velocity of the agent. The white vector connecting two vehicles occurs when they are on a collision path. The red vector is the predicted velocity and the green represents the avoiding force. The average of the occurring collisions per step 0
The orange vector sticking out of the center of the vehicle is a visualization of the desired velocity and the violet one shows the current velocity of the agent. The white vector connecting two vehicles occurs when they are on a collision path. The red vector is the predicted velocity and the green represents the avoiding force. The average of the occurring collisions per step 0


--- layout: post status: publish published: true title: Leaving... author: Leask author_login: leask author_email<EMAIL_ADDRESS>author_url: https://leaskh.com wordpress_id: 303 wordpress_url: http://leaskh.wordpress.com/2008/02/22/leaving date: '2008-02-22 03:18:26 +0800' date_gmt: '2008-02-22 03:18:26 +0800' categories: tags: [] comments: [] ---


president doc
Moderator
Registered: Oct 2001
Location: London.

The fact its been noticed is testament to this....but, im not that worried about it, just hope he doesnt turn into that land of light fellow by the end of season six
__________________
God, Ive become such a fatty
Report this post to a moderator | ? + *
|


Enter your {{ vm.config.idpName }} username or email below and we will send you an email with instructions to reset your password.
In order to ensure you are a human, please check the box below:


NLS_CHARSET_NAME
returns the name corresponding to a specified character set number.
VARCHAR2
NLS_CHARSET_NAME (charset_id)
charset_id
is a valid character set number or one of these keywords:
CHAR_CS
represents the database character set.
NCHAR_CS
represents the national character set. The national character set for the database can be either UTF-8 or AL16UTF16 (default). However, the national character set for analytic workspaces is always UTF-8.
If the number does not correspond to a character set, then the function returns NULL.
NLS_CHARSET_NAME(2000)
returns the value AL16UTF16
.


To get started using the libirary install from npm
{{ installCmd }}
This will give you access to the module and components available in the library.
After installing the library to get access to the features you need to add it to your AppModule.
{{ moduleCode }}
This package requires a peer dependency of prismJs this can be installed with the command:
{{ prismInstall }}
Once PrismJs is installed you need to update your projects angular.json to include one of the prism themes:
{{ prismStyles }}
NOTE: Any style can be used but we've tailed tabs content background and stuff to the tomorrow theme. Click to find more about PrismJs.
The inside of you app.component.html you can use the box component directve like so:
{{ boxUse }}
It is possible to setup multiple tabs by passing multiple `ngx-codetab` into a `ngx-codetab-collection` component like displayed below.
{{ templateCode }}
The general idea of the properties passed to `ngx-codebox` and `ngx-codetab` match the interface:
{{ interfaceCode }}
In the interface above the title property is optional. The reason for this is to allow for custom titles or tabs based on the components used. If no title is provided the language property is used to label the box or tab.


Data
Provide multiple ways to use data within your HTML.
How it works
The <n-data> element extends the functionality of other elements by introducing a data-provider system along with an expression-resolution system for using data in a simple, declarative way.
Once enabled, data can be injected in HTML using tokens:
{{source:key}}
Token Expressions
Learn more about expressions and predicates.
Content Repeat Example
Assuming a list of URLs visited are stored within the browser's built-in storage, you can render that list in your HTML by enabling the <n-data> system and installing the <n-data-storage> provider.
The <n-content-repeat> element can then reference the list using the expression:
{{storage:visits}}
Results:
- {{data:item}}
Supporting Components
Learn more about how data can be used in supporting elements.
Extended Data Functionality
Data Providers
Custom Provider
You can also register your own data provider through the n-data element.


[all packages]
[package ]
[class hierarchy]
[index]
public abstract class Printable
(source file: Printable.java)
java.lang.Object
|
+----Printable
The pure class interface.
public abstract class Printable
-
A class of printable terms.
- Author:
- Alan Jeffrey
- Version: v1.0 1998/06/02
- Printable()
-
- debug()
-
Print out debugging information.
- print(Printer)
-
How to print this term
- printA(Printer)
-
Print the term as an atom (bracketed by default).
- printB(Printer)
-
Print the term with brackets round it.
- toString()
-
Convert the term to a string.
Printable
public Printable();
print
public abstract void print(Printer p);
-
How to print this term. This is the only method which needs to be
defined, all the others have default implementations.
- Parameters:
- p - where to print to.
debug
public void debug();
-
Print out debugging information.
printA
public void printA(Printer p);
-
Print the term as an atom (bracketed by default).
- Parameters:
- p - where to print to.
printB
public void printB(Printer p);
-
Print the term with brackets round it.
- Parameters:
- p - where to print to.
toString
public String toString();
-
Convert the term to a string.
- Returns:
- the result of printing the term into a string buffer,
then converting the string buffer back to a string.
- Overrides:
- toString in class Object
[all packages]
[package ]
[class hierarchy]
[index]
Printable.html


A fast, simple yet powerful blog framework
$ pip install crotal
--- layout: post title: "Hello World!" date: 2012-01-1 00:00 slug: hello-world categories: welcome tags: Hello, World description: Welcome to Crotal, This is the first post, modify or remove it, and start your own site! --- Welcome to Crotal, This is the first post, modify or remove it, and start your own site!
All you need to do is writing your article in your favorite editor.
Find out more


Loading...
teamHealth
Team
teammanager
Engine
teamName
Team
teams
TeamManager
texture
Animation::texture()
explosionEntry::texture()
mapEntry::texture()
texturemanager
Engine
threshold
Physics
timeBetweenEachFiring
Team
timerId
Animation
transparent
TextureManager
type
wep
Searching...
No Matches


"x" "1" "HOLLOWAY,TC AND BALL,LM, SYNTHESIS AND MUTAGENICITY OF A SERIES OFNITRATED CARBAZOLES AND HYDROXYCARBAZOLES, MUTAGENESIS 8(4):321-327,1993"


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.bag.AbstractMapBag
public abstract class AbstractMapBag
Abstract implementation of the Bag
interface to simplify the creation
of subclass implementations.
Subclasses specify a Map implementation to use as the internal storage. The map will be used to map bag elements to a number; the number represents the number of occurrences of that element in the bag.
| Nested Class Summary | |
|---|---|
protected static class |
AbstractMapBag.MutableInteger
Mutable integer class for storing the data. |
| Constructor Summary | |
|---|---|
protected |
AbstractMapBag()
Constructor needed for subclass serialisation. |
protected |
AbstractMapBag(java.util.Map map)
Constructor that assigns the specified Map as the backing store. |
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object object)
Adds a new element to the bag, incrementing its count in the underlying map. |
boolean |
add(java.lang.Object object,
int nCopies)
Adds a new element to the bag, incrementing its count in the map. |
boolean |
addAll(java.util.Collection coll)
Invokes add(Object) for each element in the given collection. |
void |
clear()
Clears the bag by clearing the underlying map. |
boolean |
contains(java.lang.Object object)
Determines if the bag contains the given element by checking if the underlying map contains the element as a key. |
boolean |
containsAll(java.util.Collection coll)
Determines if the bag contains the given elements. |
protected void |
doReadObject(java.util.Map map,
java.io.ObjectInputStream in)
Read the map in using a custom routine. |
protected void |
doWriteObject(java.io.ObjectOutputStream out)
Write the map out using a custom routine. |
boolean |
equals(java.lang.Object object)
Compares this Bag to another. |
int |
getCount(java.lang.Object object)
Returns the number of occurrence of the given element in this bag by looking up its count in the underlying map. |
protected java.util.Map |
getMap()
Utility method for implementations to access the map that backs this bag. |
int |
hashCode()
Gets a hash code for the Bag compatible with the definition of equals. |
boolean |
isEmpty()
Returns true if the underlying map is empty. |
java.util.Iterator |
iterator()
Gets an iterator over the bag elements. |
boolean |
remove(java.lang.Object object)
Removes all copies of the specified object from the bag. |
boolean |
remove(java.lang.Object object,
int nCopies)
Removes a specified number of copies of an object from the bag. |
boolean |
removeAll(java.util.Collection coll)
Removes objects from the bag according to their count in the specified collection. |
boolean |
retainAll(java.util.Collection coll)
Remove any members of the bag that are not in the given bag, respecting cardinality. |
int |
size()
Returns the number of elements in this bag. |
java.lang.Object[] |
toArray()
Returns an array of all of this bag's elements. |
java.lang.Object[] |
toArray(java.lang.Object[] array)
Returns an array of all of this bag's elements. |
java.lang.String |
toString()
Implement a toString() method suitable for debugging. |
java.util.Set |
uniqueSet()
Returns an unmodifiable view of the underlying map's key set. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractMapBag()
protected AbstractMapBag(java.util.Map map)
map
- the map to assign| Method Detail |
|---|
protected java.util.Map getMap()
public int size()
size
in interface java.util.Collection
size
in interface Bag
public boolean isEmpty()
isEmpty
in interface java.util.Collection
public int getCount(java.lang.Object object)
getCount
in interface Bag
object
- the object to search for
public boolean contains(java.lang.Object object)
contains
in interface java.util.Collection
object
- the object to search for
public boolean containsAll(java.util.Collection coll)
containsAll
in interface java.util.Collection
containsAll
in interface Bag
coll
- the collection to check against
true
if the Bag contains all the collectionpublic java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface Bag
public boolean add(java.lang.Object object)
add
in interface java.util.Collection
add
in interface Bag
object
- the object to add
true
if the object was not already in the uniqueSet
public boolean add(java.lang.Object object, int nCopies)
add
in interface Bag
object
- the object to search fornCopies
- the number of copies to add
true
if the object was not already in the uniqueSet
public boolean addAll(java.util.Collection coll)
add(Object)
for each element in the given collection.
addAll
in interface java.util.Collection
coll
- the collection to add
true
if this call changed the bagpublic void clear()
clear
in interface java.util.Collection
public boolean remove(java.lang.Object object)
remove
in interface java.util.Collection
remove
in interface Bag
object
- the object to remove
public boolean remove(java.lang.Object object, int nCopies)
remove
in interface Bag
object
- the object to removenCopies
- the number of copies to remove
public boolean removeAll(java.util.Collection coll)
removeAll
in interface java.util.Collection
removeAll
in interface Bag
coll
- the collection to use
public boolean retainAll(java.util.Collection coll)
retainAll
in interface java.util.Collection
retainAll
in interface Bag
coll
- the collection to retain
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] array)
toArray
in interface java.util.Collection
array
- the array to populate
public java.util.Set uniqueSet()
uniqueSet
in interface Bag
protected void doWriteObject(java.io.ObjectOutputStream out) throws java.io.IOException
out
- the output stream
java.io.IOException
protected void doReadObject(java.util.Map map, java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
map
- the map to usein
- the input stream
java.io.IOException
java.lang.ClassNotFoundException
public boolean equals(java.lang.Object object)
equals
in interface java.util.Collection
equals
in class java.lang.Object
object
- the Bag to compare to
public int hashCode()
(e==null ? 0 : e.hashCode()) ^ noOccurances)
.
This hash code is compatible with the Set interface.
hashCode
in interface java.util.Collection
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


"ARMENIA "high land, occurs only in Authorized Version, 2 Kings 19:37; in Revised Version, “Ararat,” which is the Hebrew word. A country in western Asia lying between the Caspian and the Black Sea. Here the ark of Noah rested after the Deluge (Genesis 8:4). It is for the most part high table-land, and is watered by the Aras, the Kur, the Euphrates, and the Tigris. Ararat was properly the name of a part of ancient Armenia. Three provinces of Armenia are mentioned in Jeremiah 51:27, Ararat, Minni, and Ashchenaz. Some, however, think Minni a contraction for Armenia. (See ARARAT.)
"ARMENIA "high land, occurs only in Authorized Version, 2 Kings 19:37; in Revised Version, “Ararat,” which is the Hebrew word. A country in western Asia lying between the Caspian and the Black Sea. Here the ark of Noah rested after the Deluge (Genesis 8:4). It is for the most part high table-land, and is watered by the Aras, the Kur, the Euphrates, and the Tigris. Ararat was properly the name of a part of ancient Armenia. Three provinces of Armenia are mentioned in Jeremiah 51:27, Ararat, Minni, and Ashchenaz. Some, however, think Minni a contraction for Armenia. (See ARARAT.)


Display API documentation.
REFERENCE
The doc command displays documentation for a given API or topic.
Topics are stored in a tree, where each topic may have sub-topics. A
"reference", similar to a file path, can refer to a topic, or a section within a
topic. The presence of a :
separator causes the reference to
begin drilling into the sections of the topic to the left of the separator. The
topic portion of a reference is case-insensitive, while the section portion is
case-sensitive.
For example,
rbxmk doc types/Instance:Methods/FindFirstChild
This reference will start at the top-level "types" topic, then drill into the "Instance" sub-topic, then drill into the "Method" section, then the "FindFirstChild" sub-section. The doc command will then display the content of this sub-section only.
If the referred topic has no content, but has sub-topics, then these
sub-topics are listed instead (see --list
). If no reference is
specified, then all top-level topics are listed.
Ensure that content is formatted for output, rather than for display in the terminal. Applies to the "terminal" format.
Sets the output format of the produced fragment. Available formats are "terminal", "html".
Returns a list of sub-topics and sub-sections for the given reference. If no reference is specified, then all top-level topics are listed.
Each item in the list is a reference relative to the given reference. The top-level sections of a topic will be prefixed with ":". Sub-topics and sub-sections of sections will be prefixed with "/". In effect, the whole name of a listed item, including the prefix, can be appended to the current reference to query that item.
List references recursively. Implies --list.
When possible, render formatted fragments with the given width, wrapping text around. If 0, then no wrapping is applied. If less than 0, then the width is based on the current context (for example, the "terminal" format renders with the current width of the terminal).


No, do not cancel my ride
Yes, cancel my ride
Clear All
{{ formattedDate }}
Sorry, there are no rides available for this date.
{{ time.formattedTime }}
Select a Car


This is the home page. This is the home page. This is the home page. This is the home page. This is the home page. This is the home page. This is the home page. This is the home page. This is the home page. This is the home page. This is the home page.


"It is important to point out that we are not expecting anything on the scale of the last two spells of unusually cold weather which brought significant and disruptive snowfall," said chief meteorologist Frank Saunders.


New
Import
Stream Processor Studio
Recently opened
ProcessingEventsNew
TrafficAnalizer
TestExecutionPlan
SmartHomePlan
TrafficAnalizer
ProcessingEventsNew
TrafficAnalizer
TestExecutionPlan
SmartHomePlan
TrafficAnalizer
ProcessingEventsNew
TrafficAnalizer
Try out samples
ProcessingEventsNew
Receiving and Publishing Events via Kafka Transport
XmlDefaultSample
Receiving Events in Default XML Format
LoginAnalysisPlan
Receiving JSON Events via the TCP Transport
SmartHomePlan
Receiving and Publishing Events via Kafka Transport
XmlCustomSample
Receiving Events in Custom XML Format
RoundRobinPlan
Receiving and Publishing Events with TCP Transport
LoginAnalysisPlan
Storing Events with a Primary Key and an Index
XmlCustomSample
Storing Events in a RDBMS Table
SmartHomePlan
Receiving Events in Default XML Format
RoundRobinPlan
Publishing Events to Multiple Destinations Using the Round Robin Strategy
JsonMapperSample
Receiving JSON Events via the TCP Transport
XmlCustomSample
Receiving and Publishing Events via Kafka Transport
Quick links
Quick Start Guide
Siddhi Grammar
Q&A
Tutorials
Sample Docs
Support


The longpower package contains functions for computing power and sample size for linear models of longitudinal data based on the formula due to Liu and Liang (1997) and Diggle et al (2002). Either formula is expressed in terms of marginal model or Generalized Estimating Equations (GEE) parameters. This package contains functions which translate pilot mixed effect model parameters (e.g. random intercept and/or slope) into marginal model parameters so that the formulas of Diggle et al or Liu and Liang formula can be applied to produce sample size calculations for two sample longitudinal designs assuming known variance.
| Version: | 1.0-16.1 |
| Depends: | R (≥ 3.0.0), lme4 (≥ 1.0), nlme |
| Suggests: | knitr, gee, testthat, methods |
| Published: | 2018-09-11 |
| Author: | Michael C. Donohue, Anthony C. Gamst, Steven D. Edland |
| Maintainer: | Michael C. Donohue <mdonohue at usc.edu> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| URL: | https://bitbucket.org/mdonohue/longpower |
| NeedsCompilation: | no |
| Citation: | longpower citation info |
| In views: | ClinicalTrials |
| CRAN checks: | longpower results |
| Reference manual: | longpower.pdf |
| Vignettes: |
Power calculations for longitudinal data |
| Package source: | longpower_1.0-16.1.tar.gz |
| Windows binaries: | r-devel: longpower_1.0-16.1.zip, r-release: longpower_1.0-16.1.zip, r-oldrel: longpower_1.0-16.1.zip |
| OS X binaries: | r-release: longpower_1.0-16.1.tgz, r-oldrel: longpower_1.0-16.1.tgz |
| Old sources: | longpower archive |
Please use the canonical form https://CRAN.R-project.org/package=longpower to link to this page.


Minecraft Coordinates
About
Log minecraft coordinates, save them to dropbox and then view them in
The Ink & Parchment Map
.
Edit
×
Edit
-
Edit Map Settings
Map Range
Origin
Show Scale
Show Coordinates
Hide Above
Show Below
Dropbox
Dropbox
Cancel
Save
Add New Coordinate
Dropbox
Cancel
Add


{% load static %}
“I’ve learned that home isn’t a place, it’s a feeling.” – Cecelia Ahearn
REGISTER WITH US
{{message}} !
Already an user LOGIN !


I graduated with high honors from Lehigh University in 2021 with a B.S. in the Integrated Degree in Engineering, Arts & Sciences honors program with concentrations in electrical engineering and cognitive science and a minor in aerospace engineering. While at Lehigh, I was electronics team lead for the Formula SAE team, president of Eta Kappa Nu , vice president of women’s club basketball, a resident assistant, and an electrical engineering tutor. Additionally, I received the 611 Challenge Award in recognition of strong leadership, service to others, and commitment to academics. During my summers, I interned at Sikorsky Aircraft, analyzing data and creating manufacturing plans for helicopters. I am currently a test and integration engineer on the Dragon capsule at SpaceX.
Electrical Engineering and Cognitive Science, minor in Aerospace Engineering
GPA: 3.7/4.0
Relevant Coursework: Spacecraft Systems Engineering, Automatic Control of Aerospace Vehicles, Programming Languages, Aerodynamics, Control Systems, Introduction to Aerospace Engineering, Design of Linear Electronic Circuits, Circuits and Systems, Thermodynamics I, Introduction to Electromagnetics, Signals and Systems, Programming & Data Structures, Fluid Mechanics, Electronic Circuits, Electronic Circuits Laboratory, Fundamentals of Programming, Cognitive Neuroscience, Linear Methods, Introductory Physics II, Introductory Physics Lab II, Principles of Electrical Engineering, Introductory Physics I, Introductory Physics Lab I, Elementary Engineering Mechanics, Applied Engineering Computer Methods, Calculus I, II, & III
GPA: 3.8/4.0


Small
Medium
Large
unchecked
unchecked
unchecked
hover
hover
hover
focus
focus
focus
valid
valid
valid
invalid
invalid
invalid
required
required
required
disabled
disabled
disabled
checked
checked
checked
indeterminate
indeterminate
indeterminate


--- layout: index ---
Hey there! I'm a multidisciplinary technologist based in New York City.
writing projects


Select a colour and create an Automaton.
You can see how it evolves over time, every time you create a new Automaton the results will be different; you can even compare multiple Automata concurrently and simultaneously.
Not satisfied with how Evolution is going?
You can add more seeds to disrupt the Evolution process and see its results.
The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves. It is Turing complete and can simulate a universal constructor or any other Turing machine.
The universe of the Game of Life is a two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:
No ads, no subscriptions, no In-App purchases. This is a universal app, so purchasing it once enables you to play on macOS and iOS..
Lambda: Game of Life does NOT track your activity in any way, not Analytics nor any other event or behaviour metrics. Whatever you do with this app is up to you and we don't want to know about it.


--- layout: post status: publish published: true title: Mobile Free (Partial Solution - Calendar Edition) author: display_name: Geoff Lane login: admin email<EMAIL_ADDRESS>url: http://www.zorched.net author_login: admin author_email<EMAIL_ADDRESS>author_url: http://www.zorched.net date: '2008-08-01 20:39:14 -0400' date_gmt: '2008-08-02 02:39:14 -0400' categories: - Mac OS X - WebDAV tags: - iphone - sync - WebDAV - ics comments: [] ---
The holy grail is to have a computer at home, a computer at work and a computer (or a phone) in your pocket. Those things have calendars and contacts and email on them. You might use them at different times, but in the end, you want to know what you need to do tomorrow while you're sitting on the couch surfing the web on your MacBook Pro. And you want to know if you have plans tonight while your at work figuring out if you have time to start one more thing.
MobileMe seemed like a promising service that would do all of this, allowing you to sync all of your computers with the data on your iPhone. It happened over-the-air and gave all of the systems the same, unified view. And it works. Sort of. As long as you're just using a Mac and an iPhone. Usually.
Outlook support seems to be incredibly hit and miss. To the point where it's just not worth the hassle. You can read the forums about all the trouble people are having syncing with Outlook. Some people blame it on having Outlook hooked up to Exchange. Hello? That's like saying your browser won't work hooked up to the web? Who uses Outlook willingly without Exchange involved?
DavLockDB /var/www/var/DavLock
DocumentRoot /var/www/dav
Dav On
ErrorLog /var/log/apache2/dav_error.log
# Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn
CustomLog /var/log/apache2/dav_access.log combined ServerSignature On
[caption id="attachment_135" align="aligncenter" width="300" caption="Publish Outlook Calendar to WebDAV"][/caption]
Enter in a path to an existing directory on the WebDAV server. This copies an ics file out to your WebDAV server and will periodically update it out on the server.
[caption id="attachment_145" align="alignnone" width="300" caption="Publish your home calendar from Apple iCal"][/caption]
This will push the calendar out to the server so that you can subscribe to it from Outlook.
[caption id="attachment_136" align="aligncenter" width="300" caption="Subscribe to a WebDAV calendar in Outlook"][/caption]
Enter in the full path to the shared ics file on the WebDAV server.
This is not MobileMe though. There is no over-the-air syncing. Each of the calendars is still only editable from its origin. (You can only edit the Work calendar from Outlook and the Home calendar from iCal.) But it works.


Rogoznica is a small island lying in a deep sheltered bay, about 20NM from Sibenik to the north and 30NM from Split to the south. It is covered by thick pinewoods that come right down to the shore. The island is connected to the mainland by a causeway. It is known for its fresh fish, especially the fish soup prepared à la Rogoznica.
Position 43°31.7'N, 15°58.3'E.
Frapa Marina : ©www.croatiasailigexperience.com
The harbour is deep and well protected. The marina here has been built on the mainland shore just to the west of the village.
Berth in the marina as directed or to the quay on the west side of the island. Avoid the fishing berths.
There are several options for anchoring in the bay, but take care to avoid the rocky patches. Uvala Soline, Uvala Stupin and Uvala Saline are all possible anchorages.
Last updated February 2014.


Colorado rancher Patrick Frazee convicted in brutal murder of fiancee Kelsey Berreth, sentenced to life in prison
by Frank MilesColorado rancher Patrick Frazee was convicted of murder Monday in the killing of 29-year-old fiancee Kelsey Berreth, after prosecutors said he beat her to death with a baseball bat while their 1-year-old daughter was in a nearby room, and then burned her body.
He was found guilty on a total of six counts: two counts of first-degree murder, one count of tampering with a body, and three counts of solicitation to commit murder, as KDVR reported.
A judge later sentenced him to life in prison without the possibility of parole. Prosecutors didn’t seek the death penalty.
The victim’s body hasn’t been found, and Frazee was convicted with little physical evidence.
Berreth, a 29-year-old flight instructor, was last seen shopping with the couple’s daughter last Thanksgiving.
Before the punishment was formally handed down, Berreth's family and others impacted by her death told Judge Scott Sells how her death had affected them.
FRESNO BACKYARD SHOOTING WAS 'TARGETED ACT OF VIOLENCE,' POLICE SAY
Joseph Moore, who said he considered Frazee to be like a stepson, testified that when he asked Frazee how Berreth was doing in April 2018, he told him that he had figured out a way to kill her and get away with it.
Moore said Frazee said, “No body, no crime.”
He said Frazee would repeat that phrase to him several times over the summer and fall in 2018.
Moore said Frazee was shocked after Berreth’s disappearance garnered attention in media around the country.
“He’s like, ‘Man, if I had known it was going to blow up this big, I never would have ...’ And he stopped. He did not finish that sentence,” Moore testified.
Frazee’s on-again-off-again girlfriend, Krystal Lee, testified that her lover asked her to help clean up the murder scene.
“He went from being someone who I loved and cared for and is one of my best friends,” she said in court in early November, as the Denver Post reported. “He said his little girl was being abused. I know it was wrong, but I didn’t know what to do and I didn’t make the right decisions.”
Frazee declined to testify, and his lawyers didn’t call any witnesses of their own.
CLICK HERE TO GET THE FOX NEWS APP
Berreth’s parents argued in a wrongful-death lawsuit that they believed Frazee wanted full custody of the couple’s daughter. She now lives with them.
The Associated Press contributed to this report.


Watch a 1940's Milk Truck Show Off its Hot Rod Status
One car enthusiast turned a 1940's milk truck into a rusty hot rod sensation.
by Donna FuscaldocKLrUao9i9oA 1948 Dodge milk truck got a new life, with a car enthusiast transforming it into a hot rod of sorts, in this new video from Urban Hillbilly Videos.
The rusty Ford milk truck hails from Holland, Indiana and is equipped with 34-inch Chevy front fingers and Ford rear fingers. It's cut 21 inches off the bottom, chopped on the top front by 9.5 inches and has a grill shell made out of pointy dodge front doors. The milk truck is powered by a Chevy motor.
The owner had the truck for about three years, not really sure what to do with it. He told Urban Hillbilly Videos he had a vision in his head and when he was asked to compete in a car build in Arkansas this is what he did. "It's totally different. 'Aint another one out there," the owner said.
Want to see for yourself this milk truck hotrod in action?


7. Ensemble Learning¶
ensemble learning: combine multiple weak leaners to form a strong learner.
bagging is one approach of ensemble learning.
it uses some randomness, e.g sampling at random, then generate a bunch of different base learner.
when we say sampling at random, we mean sampling with replacement.
we usually select \(m\) samples with replacement from m samples.
when predicting:
if classification, use vote.
if regression, use mean.
7.1. voting¶
"""make moons dataset"""
from sklearn.datasets import make_moons
from sklearn.model_selection import train_test_split
X, y = make_moons(n_samples=500, noise=0.30, random_state=42)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42) # default test_size = 0.25
"""create ensemble learning"""
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import VotingClassifier
log_clf = LogisticRegression()
rnd_clf = RandomForestClassifier()
svm_clf = SVC()
voting_clf = VotingClassifier(estimators=[('lr', log_clf), ('rf', rnd_clf), ('svc', svm_clf)], voting="hard")
"""training and testing"""
from sklearn.metrics import accuracy_score
for clf in (log_clf, rnd_clf, svm_clf, voting_clf):
clf.fit(X_train, y_train)
y_pred = clf.predict(X_test)
print(clf.__class__.__name__, accuracy_score(y_test, y_pred))
LogisticRegression 0.864
RandomForestClassifier 0.888
SVC 0.896
VotingClassifier 0.904
7.2. BaggingClassifier¶
from sklearn.ensemble import BaggingClassifier
from sklearn.tree import DecisionTreeClassifier
bag_clf = BaggingClassifier(DecisionTreeClassifier(), n_estimators=500,
max_samples=100, bootstrap=True, n_jobs=-1, random_state=42)
bag_clf.fit(X_train, y_train)
y_pred = bag_clf.predict(X_test)
accuracy_score(y_test, y_pred)
0.904
"""set oob_score=True, so each sample can be evalute on estimators whose bag does not include that sample"""
bag_oob_clf = BaggingClassifier(DecisionTreeClassifier(), n_estimators=500,
max_samples=100, bootstrap=True, n_jobs=-1, random_state=42, oob_score=True)
bag_oob_clf.fit(X_train, y_train)
bag_oob_clf.oob_score_
0.9253333333333333
import numpy as np
y_oob_pred = bag_oob_clf.predict(X_test)
np.all(y_oob_pred == y_pred)
True
7.3. random foreset¶
random foreset is one implementation of bagging with decision tree as base learner.
besides sampling at random, random foreset added some random when split.
rather than using all \(d\) features when split, we randomly select it’s \(k\) features subset, and select from this subset.
often, we set \(k = log_{2}d\).
in one word:
random foreset \(=\) decision tree \(+\) bagging \(+\) use random subset when split.
from sklearn.ensemble import RandomForestClassifier
rnd_clf = RandomForestClassifier(n_estimators=500, max_leaf_nodes=16, n_jobs=-1)
rnd_clf.fit(X_train, y_train)
y_pred_rf = rnd_clf.predict(X_test)
accuracy_score(y_test, y_pred_rf)
0.896
"""roughly equivalent"""
bag_clf = BaggingClassifier(DecisionTreeClassifier(splitter="random", max_leaf_nodes=16), n_estimators=500,
max_samples=1.0, bootstrap=True, n_jobs=-1)
"""RandomForest automaticly measures feature importance = weighted average of node's impurity reduce"""
from sklearn.datasets import load_iris
iris = load_iris()
rnd_clf = RandomForestClassifier(n_estimators=500, n_jobs=-1)
rnd_clf.fit(iris["data"], iris["target"])
for name, score in zip(iris["feature_names"], rnd_clf.feature_importances_):
print(name, score)
sepal length (cm) 0.09013185374203067
sepal width (cm) 0.026726952210725616
petal length (cm) 0.44408543008015466
petal width (cm) 0.439055763967089
7.4. boosting¶
boosting is another approach of ensemble learning.
boosting first train a base learner which is rather weak, then adjust that leaner with the knowledge of current prediction to make it stronger.
for example, adjust the traing set distribution, focus on samples that previous predict wrong.
7.5. adaboost¶
suppose a binary classification problem, dataset is \(\left\{(x_{1}, y_{1}),...,({x_{N},y_{N}})\right\}\), \(y_{i} \in \left\{-1, 1\right\}\), total \(N\) samples.
initial sample distribution is \(D_{1} = (\frac{1}{N},...,\frac{1}{N}) = (w_{1,1},...,w_{1,N})\)
for \(m=1,...,M\):
train \(G_{m}: \mathcal{X} \rightarrow \left\{-1, 1\right\}\) based on \(D_{m} = (w_{m,1},...,w_{m,N})\)
compute misclassify error: $\(e_{m} = \sum_{i=1}^{N}P(G_{m}(x_{i}) \ne y_{i}) = \sum_{i=1}^{N}w_{m,i}I(G_{m}(x_{i} \ne y_{i}))\)$
update distribution \(D_{m}\) to \(D_{m+1}\): $\( w_{m+1, i} = \begin{cases} \frac{w_{m,i}}{Z_{m}} \\ {\frac{1 - e_{m}}{e_{m}}}\frac{w_{m,i}}{Z_{m}} \end{cases} \)\( where \)Z_{m}\( is the normalization factor that makes \)D_{m+1}\( a proper distribution.<br> this step simply enlarge the previous wrong predicted sample's distribution by a factor \)\frac{1 - e_{m}}{e_{m}}$.
then construct a linear combination of \(G_{m}\):
finally the resulting classifier:
from sklearn.ensemble import AdaBoostClassifier
ada_clf = AdaBoostClassifier(DecisionTreeClassifier(max_depth=1), n_estimators=100, algorithm="SAMME.R", learning_rate=0.5)
ada_clf.fit(X_train, y_train)
AdaBoostClassifier(base_estimator=DecisionTreeClassifier(max_depth=1),
learning_rate=0.5, n_estimators=100)
7.6. forward stage wise algorithm¶
consider addictive model:
here \(b\) is the base model, \(\gamma_{m}\) is it’s paramter.
given loss function \(L\), we try to solve the following optimization problem:
this is usually very complex.
foward stage wise algorithm simplify it by going only one stage at a time:
init \(f_{0}(x) = 0\).
for \(m=1,...,M\):
do the following one step optimization: $\((\beta_{m}, \gamma_{m}) = \underset{\beta,\gamma}{argmin}\sum_{i=1}^{N}L(y_{i}, f_{m-1}(x_{i}) + \beta{b(x_{i},\gamma)})\)$
update: $\(f_{m}(x) = f_{m-1}(x) + \beta_{m}b(x;\gamma_{m})\)$
finally the resulting addictive model:
adaboost \(\Leftrightarrow\) foward stage wise algorithm when \(L(y, f(x)) = exp(-yf(x))\), t.b.c.
7.7. boosting tree¶
boosting tree model:
where \(T(x; \theta_{m})\) is a decision tree.
boosting tree use the forward stage wise algorithm.
for binary classification boosting tree, we use \(L(y, f(x)) = exp(-yf(x))\), so equivalent to adaboost where base model is decision tree.
for regression problem, we use \(L(y, f(x)) = (y - f(x))^2\), i.e square error.
then the forward stage wise algorithm:
here \(r = y - f_{m-1}(x)\) is the residual.
so for regression tree, we just need to fit the residual!
7.8. GBDT-gradient boosting decision tree¶
while we can easily proceed in forward stage wise algorithm if loss function is square or exponential, for generic loss, this is not easy.
we use the gradient of the loss function to proceed in generic case, that is GBDT.
GBDT for regression:
input: training set \(T = \left\{(x_{1},y_{1}),...,(x_{N},y_{N})\right\}\), \(x_{i} \in \mathcal{X} \in \mathbb{R}^{n}\), \(y_{i} \in \mathcal{Y} \in \mathbb{R}\), loss function \(L(y, f(x))\).
output: regression tree \(\hat{f}(x)\).
init $\(f_{0}(x) = \underset{c}{argmin}\sum_{i=1}^{N}L(y_{i}, c)\)$
for \(m=1,...,M\).
for \(i=1,...,N\), compute $\(r_{mi} = -\left[\frac{\partial{L(y_{i}, f(x_{i}))}}{\partial f(x_{i})}\right]_{f = f_{m-1}}\)$
generate a tree that fits \(r_{mi}\), denote it’s leaf nodes areas as \(R_{mi},j=1,...,J\).
for \(c=1,...,J\), compute $\(c_{mj} = \underset{c}{argmin}\sum_{x_{i} \in R_{mj}}L(y_{i}, f_{m-1}(x_{i}) + c)\)$
update \(f_{m}(x) = f_{m-1}(x) + \sum_{j=1}^{J}c_{mj}I(x \in R_{mj})\).
finally the resulting regression tree:
in one word, while we want to minimize \(L(y_{i}, f_{m-1}(x_{i}) + c)\), we just pick it’s negative gradient like gradient descent:
np.random.seed(42)
X = np.random.rand(100, 1) - 0.5
y = 3*X[:, 0]**2 + 0.05 * np.random.randn(100)
from sklearn.tree import DecisionTreeRegressor
tree_reg1 = DecisionTreeRegressor(max_depth=2, random_state=42)
tree_reg1.fit(X, y)
DecisionTreeRegressor(max_depth=2, random_state=42)
y2 = y - tree_reg1.predict(X)
tree_reg2 = DecisionTreeRegressor(max_depth=2, random_state=42)
tree_reg2.fit(X, y2)
DecisionTreeRegressor(max_depth=2, random_state=42)
y3 = y2 - tree_reg2.predict(X)
tree_reg3 = DecisionTreeRegressor(max_depth=2, random_state=42)
tree_reg3.fit(X, y3)
DecisionTreeRegressor(max_depth=2, random_state=42)
X_new = np.array([[0.8]])
y_pred = sum(tree.predict(X_new) for tree in (tree_reg1, tree_reg2, tree_reg3))
y_pred
array([0.75026781])
"""basic gbrt"""
from sklearn.ensemble import GradientBoostingRegressor
gbrt = GradientBoostingRegressor(max_depth=2, n_estimators=3, learning_rate=1.0, random_state=42)
gbrt.fit(X, y)
gbrt.predict(X_new)
array([0.75026781])
7.8.1. early stopping¶
"""use staged_predict to find the best n_estimators"""
from sklearn.metrics import mean_squared_error
X_train, X_val, y_train, y_val = train_test_split(X, y, random_state=42)
gbrt = GradientBoostingRegressor(max_depth=2, n_estimators=120, random_state=42)
gbrt.fit(X_train, y_train)
errors = [mean_squared_error(y_val, y_pred)
for y_pred in gbrt.staged_predict(X_val)]
bst_n_estimators = np.argmin(errors) + 1
gbrt_best = GradientBoostingRegressor(max_depth=2, n_estimators=bst_n_estimators, random_state=42)
gbrt_best.fit(X_train, y_train)
GradientBoostingRegressor(max_depth=2, n_estimators=118, random_state=42)
"""use warm_start to learn incrementally, stop while error does not improve for 5 iters"""
gbrt = GradientBoostingRegressor(max_depth=2, warm_start=True, random_state=42)
min_val_error = float("inf")
error_going_up = 0
for n_estimators in range(1, 120):
gbrt.n_estimators = n_estimators
gbrt.fit(X_train, y_train)
y_pred = gbrt.predict(X_val)
val_error = mean_squared_error(y_val, y_pred)
if val_error < min_val_error:
min_val_error = val_error
error_going_up = 0
else:
error_going_up += 1
if error_going_up == 5:
break # early stopping
7.9. Exercise¶
from sklearn.datasets import fetch_openml
mnist = fetch_openml('mnist_784', version=1, as_frame=False)
mnist.target = mnist.target.astype(np.uint8)
X_train_val, X_test, y_train_val, y_test = train_test_split(
mnist.data, mnist.target, test_size=10000, random_state=42)
X_train, X_val, y_train, y_val = train_test_split(
X_train_val, y_train_val, test_size=10000, random_state=42)
from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier
from sklearn.svm import LinearSVC
from sklearn.neural_network import MLPClassifier
random_forest_clf = RandomForestClassifier(n_estimators=100, random_state=42)
extra_trees_clf = ExtraTreesClassifier(n_estimators=100, random_state=42)
svm_clf = LinearSVC(max_iter=100, tol=20, random_state=42)
mlp_clf = MLPClassifier(random_state=42)
estimators = [random_forest_clf, extra_trees_clf, svm_clf, mlp_clf]
for estimator in estimators:
print("Training the", estimator)
estimator.fit(X_train, y_train)
Training the RandomForestClassifier(random_state=42)
Training the ExtraTreesClassifier(random_state=42)
[estimator.score(X_val, y_val) for estimator in estimators]
[0.9692, 0.9715, 0.859, 0.9635]
voting_clf = VotingClassifier([
("random_forest_clf", random_forest_clf),
("extra_trees_clf", extra_trees_clf),
("svm_clf", svm_clf),
("mlp_clf", mlp_clf),
])
voting_clf.fit(X_train, y_train)
voting_clf.score(X_val, y_val)
0.9709
voting_soft_clf = VotingClassifier([
("random_forest_clf", random_forest_clf),
("extra_trees_clf", extra_trees_clf),
("mlp_clf", mlp_clf),
], voting="soft")
voting_soft_clf.fit(X_train, y_train)
voting_soft_clf.score(X_val, y_val)
0.9697
7.9.1. stacking¶
X_val_predictions = np.empty((len(X_val), len(estimators)), dtype=np.float32)
for index, estimator in enumerate(estimators):
X_val_predictions[:, index] = estimator.predict(X_val)
rnd_forest_blender = RandomForestClassifier(n_estimators=200, oob_score=True, random_state=42)
rnd_forest_blender.fit(X_val_predictions, y_val)
RandomForestClassifier(n_estimators=200, oob_score=True, random_state=42)
X_test_predictions = np.empty((len(X_test), len(estimators)), dtype=np.float32)
for index, estimator in enumerate(estimators):
X_test_predictions[:, index] = estimator.predict(X_test)
y_pred = rnd_forest_blender.predict(X_test_predictions)
accuracy_score(y_test, y_pred)
0.9681


Service Activity List
this is tab1
this is tab2
this is tab3
this is tab4
this is tab5
List SA
Notification
Check CPF
Software Versio
Logout


The purpose of this blog is to keep record of the modernization process going on at my company. This first post, post zero, is to provide background and context to the remainder of this blog
Background
Here is some information on my scenario: * Technology company that has been around for 3 decades * Flagship product is a Desktop program that has been in use for 2 decades * Small company, limited in resources
Layout
The layout of this blog will follow along with the style of agile project management. I will post after each completed sprint all the things I have learned and how we have progressed from the previous sprint. Sprints will probably last about 3 to 4 weeks.


Answer these questions to find out!
Which animal do you prefer? Pick one.
Do you prefer the color red or blue? Pick one.
Do you prefer beer or wine?
Surfing or Skiing?
Chocolate or Vanilla?
Name
Animal
Color
Drink
Hobby
Flavor
Ruby
Javascript
Python


Hello everyone! My name is Peter Luna and I am an Army veteran, and an enthusiast for anything technology! I am blessed with a wife and four amazing children. I am currently enrolled at Code Fellows in their fullstack Javascript program. Please, enjoy the quiz about me and have fun learning more about me!


Now it's time to complete your profile! Fill in your preferred playstyle, you availability and your preferred map pool.
If this is your account, you need to change the privacy level of your account, so we can access game stats from Steam.
To do this go to Steam Profile --> Edit Profile --> Privacy Settings --> Set: 'My profile: Public' and 'Game details: public'


A ninja (忍者?) or shinobi (忍び?) was a covert agent or mercenary in feudal Japan. The functions of the ninja included espionage, sabotage, infiltration, assassination and guerrilla warfare.[1] Their covert methods of waging irregular warfare were deemed "dishonorable" and "beneath" the samurai-caste, who observed strict rules about honor and combat.[2] The shinobi proper, a specially trained group of spies and mercenaries, appeared in the Sengoku or "warring states" period, in the 15th century,[3] but antecedents may have existed in the 14th century,[4] and possibly in the 12th century (Heian or early Kamakura era).[5][6]-wikipedia