How can I pump items/liquids in Tekkit with IC2's EU without Forestry's Electrical Engine?

Question: I have loads of solar panels generating enough power to fill 5 MFEs and I use the energy link to power BC machines but I can't pump items. Well, I can use redstone engines but they're slow. Is there a better way without using Forestry - I want not to have to install new mods.
Comment: Is there a reason you don't want to use RedPower machines/conduits to move items? A transposer with a timer set to 0.200 can extract a lot of items rather quickly.
Comment: I'll try that if the others dont work.
Answer: Redstone engines certainly start slow but they increase significantly in speed the longer they are allowed to run. You can also use energy links to power steam engines and combustion engines - I did a quick test in creative, and even while still cooled down these will transfer a minimum of half a stack in one go. Warmed up they'll do a full stack at a time.
If you need speed more than volume you could add some gold pipe to your system. You can power gold pipe with a redstone torch and it will significantly increase the speed of the items that go through it for 16 blocks. In creative I tried a golden pipe after a transfer pipe powered by a steam engine, an energy link, and a a batbox; and I was really pleased with the results.
EDIT: the tekkit wiki says that the boost lasts twice as long if you use stone pipe as opposed to cobble.
UPDATE: Be cautious with the kind of power you supply an engine. It'll explode if you give it too much, and it'll overload if it runs too long. Redstone engines won't blow as long as something is running through the tube, so either be content with low volume and high speed, or increase the volume as discussed above but remember to shut your engines off every so often and let things cool.
Finally you could try using pneumatic tubes with accelerators and magtubes. I haven't ever done much with these as they use redpower's blutricity, and at this point I don't think there's a mod that will transfer IC2 or BC power to blutricity. I've been tempted to start messing with them though because these tubes will only send items if there's a vacant space to put them; therefore they don't spit overflow out into the world if the target chest or machine is full.
Comment: Redstone engines won't blow up if no items are passing; they only do if there's nowhere for their power to go. A single wooden pipe will happily absorb all the power any number of redstone engines can directly supply.
Answer: Plop an energy link next to a wooden pipe, add power.  Prepare for lag :D.  A high powered energy link will blow your mind as to how fast it moves items.  Great because it uses no stupid engines which are slow, explosive, and laggy.
Answer: Another option is dropping an electric engine on the wooden pipe, the higher the level of the engine the faster it will move items.  Another option is Redpower machinery, specifically the filter can send stacks of items out of chests and into pneumatic pipes.
Comment: The question specifically asks for alternatives to the Electrical Engine. It's not available in some versions of Tekkit due to conflicts between Forestry's dev and the Tekkit team.


Comparing two sequence objects?

Question: Using TraMineR, is it possible to compare two sequence objects to calculate the discrepancy between them? By this I mean not comparing two sequences but two sets of sequences. Is this possible? If so, how do I go about doing it?
Answer: This is possible as long as your sequence objects share a same alphabet.
You do it by merging the two sequence objects into a pooled object, and then using dissassoc with the indicator of the original set as group argument. To illustrate, I first create two separate objects of female and male from the mvad sequence object:
library(TraMineR)
data(mvad)
levels(mvad[,"male"]) <- c("female","male")

mvad.seq <- seqdef(mvad, 17:86)

male.seq <- mvad.seq[mvad$male=="male",]
    female.seq <- mvad.seq[mvad$male=="female",]

and merge the two objects into a single one
pooled.seq <- rbind(male.seq,female.seq)

We create an indicator of the originating set (that should comply with the order of the sequences in pooled.seq)
oset.male <- rep(1,nrow(male.seq))
oset.female <- rep(2,nrow(female.seq))
oset <- c(oset.male, oset.female)

Now, we compute pairwise dissimilarities from the pooled object and get the discrepancy analysis by means of dissassoc
lcs <- seqdist(pooled.seq, method="LCS")
dissassoc(lcs, group=oset)

Comment: @histelheim You are right, the two sequence objects should be created from a table with the same number of columns. If you have sequences of unequal length, just add enough missing values in the table to get the right number of columns before passing the table to seqdef.
Comment: Take the mean of the subset of pairwise dissimilarities between group 1 and 2: `mean.12 <- mean(lcs[oset==1,oset==2])`
Comment: Does this require the dimensions of the sequence objects to be the same (i.e. number of sequences and time periods)? `rbind()` seems to require matrices of the same dimensions.
Comment: Is it possible to calculate something like an average distance between the two groups of sequences? At the end of the day I want to get to a point where I can say that the sequence objects are
"X % similar".
Comment: You can compute the mean of the pairwise distances between sequences of one group and those of the other group if you want. However, you have to compare that average dissimilarity with a reference distance? Which reference? The Pseudo F and R2 statistics are the measures you need to assess that two groups are similar or not. If statistically significant, the measures tell you that the two groups differ to some extend, and if not, that the differences can be attributable to chance.
Comment: I understand. How would I compute the mean of the pairwise distances between sequences of one group and those of the other group? Can I get that info from `dissassoc`?

Comparing two sequence objects?


Why a strange discrepency between get_current_user_id() when using AJAX versus output of document.cookie?

Question: I'm developing a simple Ajax function as part of a plugin intended to be used from within the traditional WP Admin dashboard but am encountering a discrepancy regarding the login cookie state.
The problem, TL;DR version
The output of my Ajax calls always runs in the context of a logged-out user. Specifically, get_current_user_id() returns 0 for all Ajax-initiated calls, despite a PHP-side var_dump(get_current_user_id()) returning the correct logged-in user ID number on the output of the page itself.
Checking document.cookie seems to confirm the absence of a login cookie on the JS side, but a var_dump($_COOKIE) shows the correct login cookie's presence.
To add to the weirdness, Firefox's Network Pane shows the full cookie, along with the login value, being sent to WordPress from the Ajax call.
What gives?
Code & context
When a certain WP admin dashboard page is loaded, my JS simply polls the WP-API (v2) for comments on a given post. The polling method looks like this:
/**
 * Checks for any new comments.
 */
var pollForNewComments = function () {
    var url = api_base + '/comments&post=' + getPostId() + '&offset=' + getCommentCount();
    console.log(document.cookie);
    jQuery.get(url, function (response) {
        if (response.length) {
            appendComments(response);
            showNewCommentsNotice();
        }
    });
};

Note the call to console.log(document.cookie). When this method runs, the output of the console log shows this output:
wordpress_test_cookie=WP+Cookie+check; wp-settings-time-10=1456479389; popunder=yes; popundr=yes; setover18=1

Notice there is no login cookie.
However, for the same call, the Firefox Network Pane shows the login cookie does exist in the HTTP request headers:

To verify that the login cookie is being received by WordPress, I execute a trivial var_dump(get_current_user_id()); var_dump($_COOKIE); exit(); in my plugin code, and the output for the Ajax call confirms that, despite the login cookie's presence, WordPress thinks there is no logged in user:
int(0)
array(3) {
  ["wordpress_test_cookie"]=>
  string(15) "WP Cookie check"
  ["wordpress_logged_in_9416a7b43bd88dae58cf6c88b9f89f3f"]=>
  string(130) "athirduser|1456650402|a23GIhs43jJ651dKkCEKfX6EKjfnTCpT76k6Hgvznls|5da91c9c365cf214c486b0a32333a78fb6394385e5bcad619666511330322bda"
  ["wp-settings-time-10"]=>
  string(10) "1456479389"
}

The output of non-Ajax calls return correctly, showing both a login cookie
is present and the correct user ID returned.
Why the discrepancy between Ajax and non-Ajax calls here? Why the difference between console.log(document.cookie) and what Firefox shows in its Network Inspector?
This is a single-server setup, a local development environment, not a cross-domain request.
Thanks.
Comment: Can you show us how you registered your AJAX function?
Answer: I had to trace through WordPress core and the REST API plugin code to fix this, but finally did it. The solution is described here.
The TL;DR of the solution is that the WP-API will ignore the content of the login cookie and assume an unauthenticated (logged out) request unless the correct value is given in the _wpnonce HTTP GET parameter (in the query string) or the HTTP_X_WP_NONCE HTTP header. My JavaScript did not correctly include this. The corrected JavaScript method looks like this:
/**
 * Checks for any new comments.
 */
var pollForNewComments = function () {
    var url = api_base + '/comments&post=' + getPostId() + '&offset=' + getCommentCount()
        + '&_wpnonce=' + wpApiSettings.nonce;
    jQuery.get(url, function (response) {
        if (response.length) {
            appendComments(response);
            showNewCommentsNotice();
        }
    });
};

Note that adding the _wpnonce parameter in the query string with the wpApiSettings.nonce global JavaScript variable (which is added by the REST API plugin) fixes the issue for me.


How can I prevent mattress protectors from being removed in rented properties

Question: I have a holiday property which is rented out in the summer. I have mattress protectors but some tenants have removed them. They are similar to fitted sheets and I would like to make them difficult to remove. Any simple ideas please.
Comment: I'm assuming you're only interested in hacks providing *physical* security as opposed to financial methods like, say, having a credit card on file to cover incidentals **and theft?**
Comment: Mags, Can you clarify why tenants are removing the mattress covers? Their motivation might be relevant to the answers.
Comment: Are they thick protectors that don't breath?
Comment: Have you considered staples?
Answer: If people are removing them, consider the reason they do so. Some mattress protectors are annoying because they are not breathable and because they make noise as the slumberer moves.
Get a better quality protector, or cover the protector with a second fitted sheet to make it less noisy and more absorbent of perspiration.
Answer: For something like this you can use a curved needle to stitch the protector onto the bottom of the mattress. You additionally stitch something in that says removal of the mattress protector will affect the return of the tenants security deposit. You shouldn't need to stitch all the away around, just maybe around the corners and middle of the sides. This will effectively prevent removal. When you want to remove it, a few minutes with a seam ripper will make short work of it.


Does wireless traffic in a network still have to go through a switch?

Question: This may sound like a stupid question but it has been bugging me. Lets say I have 2 devices A and B, both connected wirelessly to the same WAP. If A were to talk to B, does the wireless traffic from A go directly to B using the MAC address it has gotten from ARP or does the traffic still have to go through the switch before forwarding it from the  switch to device B? In other words, if device A and B were side by side physically, will B be able to 'intercept' the radio waves sent out by A and therefore, read the packet contents?
Answer: Generally all the devices at the AP communicate through AP. There are technologies as Wi-Di and Wi-Fi Direct, but those are beyond the scope of this question. So devices can't communicate directly in common Wi-Fi network. Regarding traffic interception, you should take into consideration ciphering here. Though there are ways to intercept traffic and read it contents, with WPA2 those attacks are very complicated.
Comment: To be more precise, the AP acts as a wireless switch, forwarding traffic from one device to another.
Comment: ah so the switch is separate for ethernet and wireless?
Comment: It depends on your device and topology. There are routers with built-in switch and AP. Or you can have separate AP, router and switch.


Center of the universe

Question: Big bang is not an explosion, but an expansion of space and time. Universe had almost infinite density... wait a moment. If it had ALMOST infinite density, it had a certain volume, and thus, space already existed.
Am I commiting a mistake?
I had this question after reading this post.
Comment: Very high density does not imply a finite volume. Is that what you're asking about?
Comment: Yes. Well as far as I know, density = mass / volume. If density and mass are not infinite, volume must be different from zero
Comment: Yes, [the Big Bang did not happen at a point](https://physics.stackexchange.com/questions/136860/did-the-big-bang-happen-at-a-point).
Comment: Well thanks, now I see! If you could write your last comment as an answer I would accept it :) One last question: may it be (and it might be just speculative) that our universe is a subset of a higher dimensional space? Well I'm pretty sure I am not the first to think about it. Multiverse theory? Just wondering...
Comment: So let's rewind time a bit, say roughly 1 billion years ago every galaxies and stars must be very close to one another. This time let's rewind the clock all the way... I'll throw in some random number say 14 billion years ago there must be a location in the pre-spacetime that current spacetime is born... Of course pre-spacetime or whatever it is called cannot be detected or can it?
Answer: Krotanix : nobody really knows the answer to this. We have good evidence that the universe is expanding, and we extrapolate this back to the big bang. Then some people say the universe was once the size of a grapefruit. See for example this. Since WMAP evidence in 2013 suggested the universe is flat, some people have started saying the observable universe was once the size of a grapefruit. And that the universe was always infinite. But this is a non-sequitur, and a non-answer.
Yes,  it looks as if 13.8 billion years space had a much higher density and started expanding. And it may have had a certain volume, so space may have already existed. But nobody knows for sure.
Re your follow-on question, nobody has discovered hollowness or emptiness anywhere in the centre of the universe. The expansion is thought to be like that of a raisin cake rising in an oven. There's no big hole in the middle.
Answer: You're right; space did exist. In fact, the universe was infinite in size at the moment of the Big Bang, and it still is. This is because a common misconception is wrong: The Big Bang did not happen at a point. Thinking of it like an explosion isn't correct.
You asked in a comment about the multiverse. This is speculative, to say the least. There are some theories involving objects called branes that posit that we are on the surface of some object floating through a higher dimensional "bulk". However, these theories of so-called large extra dimensions have yet to be supported by experimental evidence.
Comment: Thanks, I'll solve it at some point of my life, If I find a moment to have a coffee and spend an afternoon thinking about it! XD
Comment: We do not know that _the universe was infinite in size at the moment of the Big Bang, and it still is_. This idea is not supported by experimental evidence.
Comment: @JohnDuffield The curvature of the universe is nearly zero, and the added assumption of homogeneity means that there can't really be an edge. Put the two together, and evidence shows that if we don't live in an infinite universe, it's certainly very big.
Comment: @HDE 226868 : it's an _assumption_ of homogeneity and isotropy. For all you know some guy 46 billion light years away is looking up at the clear night sky wondering why one half is black, or a mirror-version of the other, or something else. We just don't have any evidence for a universe that's a lot bigger than the observable universe, or an infinite universe.

Center of the universe


Protocol Analyzer in software?

Question: I'm looking for an easy solution to identify data formats, protocols. I have an outdoor temperature - humidity sensor which is connected to my HVAC system. I want to decode the data coming back from the sensor into another processor. I do not know the format - protocol and can not get any documentation from Honeywell. Short of buying a protocol analyzer are there any software solutions out there?  is an example of 40 deg. F with 53% humidity.
Comment: Can you give us the sensor part #? Perhaps someone here has already decoded it or the sensor datasheet might mention the protocol format.
Comment: It is the Honeywell DG115EZIAQ TrueIAQ control with sensor system.
Answer: Like jpc says, you have to know what the protocol is the use a protocol analyzer. Most protocol analyzers are rather generic, so it may be hard to find an analyzer that decodes a possibly proprietary protocol.
What I do in a case like this is have a look for specifics in the first screenshot you have. What I find striking is that there are a few very narrow pulses, which will probably 1 bit-time wide, but then most other pulses are several multiples of this, so that would be longer sequences of 1s or 0s. That's odd, but may be noteworthy.
Next step: make more measurements and compare them. Are there partial sequences which return every time? If yes, these could be preambles and postambles defining data frames.
When looking in a data frame it's time to guesstimate. Write down what bit sequence the data could represent, just guessing and using your imagination. If you have a measurement just slightly differing from the previous one, like 41° instead of 40°, that's a good opportunity to look where this shows in the pattern. If the leftmost part is the same, but at the right it looks different, then humidity will be sent first, and maybe also MSB first (Most Significant Bit).
From now on it very much depends on what kind of correlations you can find. I would look for the wide pulses, because I'm a bit puzzled by them. Do they really represent for instance 8 consecutive 1 bits like I presumed based on the narrowest bit? If yes, you would expect to see these pulses to be broken sometimes, having some 0s in them. If it never changes they may represent the highest order bits in a 16-bit word (or longer), which may only change if you're going beyond 100°.
That's all I can say without having more samples. I hope it's a start.
Comment: I guess there is no other options but the long way around. I was hoping for a software solution that would aid in waveform comparison at least. I have other samples, and yes there are Consistencies. Thanks for your ideas!
Answer: A protocol analyzer will not help if you do not know what protocol it is (and it may be proprietary).
Reverse engineering serial protocols is a little tedious but also offers lots of  fun and satisfaction (if you get it right).
If there are no more wires going between the devices then chances are that this is a standard asynchronous serial transmission (UART, RS232). Look out for the 9-bit variations which are sometimes popular in embedded systems.
A logic analyzer (like the Saleae Logic) may be better suited for this job then an oscilloscope but either way it ultimately is up to you to figure it out.
Comment: Yeah, I was hoping someone may have done this with software at some time. It is a simple two wire system that caries DC (24V) power with the data riding on it. However with the infinite possibilities of things like crc, parity, and so forth, I don't know that its going to be worth the effort.
Comment: +1 for the Logic. It's affordable, easy to use, and has built in analyzers for common protocols.

Protocol Analyzer in software?


Why is an increase in the amount of oxygen in the atmosphere favorable for life?

Question: I have followed the David Attenborough series on 'First life' and heard, that an increase in the amount of oxygen in the atmosphere, as it took place just before the Cambrium, is generally favorable for life and also enables the evolution of larger organisms.
Why is that so? Is it because aerobic respiration had a better conversion rate to energy?
Comment: I think you are right - O2 allows more energy to be released from fuels in less time, allowing warm-blooded animals to develop and thrive in colder climates. However, this was only possible through large-scale adaptations to eliminate oxygen radicals in the body. Oxygen is about the most reactive compound around and therefore potentially lethal. Hence 'generally favorable form life' seems to be an invalid statement. In fact, you could envision the abudance of plant life killing life instead of supporting it.
Comment: @AliceD Indeed, see https://en.wikipedia.org/wiki/Great_Oxygenation_Event.
Answer: Because it's favorable for the process of aerobic respiration which requires O2 to produce ATP, which is the little power storage unit.
With a bigger concentration of O2, it was possible to produce more ATP, should you evolve in that direction and you needed that constraint to be removed.


How did the colour belt ranking system originate?

Question: Many martial arts (karate, judo, jiujutsu, taekwondo, kung-fu, etc.) use some form of coloured belts to denote rank and level.   How did this come about?  Did the concept have common origin or did some styles create the idea independently?
Comment: I heard a story from my previous Sensei who taught karate : white represents seed below the snow in winter, green is a plant sprouting in spring, blue is the plant reaching for the sky and so on.  (till the bark hardness from brown to black)
Answer: Interesting question!
The first ranking system in Japanese arts was a merit system based on menkyo or licenses. Essentially, you trained until you learned enough to earn a license recognizing your ability in that set of techniques or lessons. You may have a menkyo for each section of the syllabus (mokuroku), or you might have menkyo shoden, menkyo chuden, etc. Ultimately, though, this culminated in a final license, menkyo kaiden (license of full transmission).
Kanō Jigorō (嘉納治五郎) was the first to incorporate a system of Kyu and Dan into martial arts, but this system actually originated in a chess-like game called Go (Igo in Japanese, Weiqi in Chinese). He split his students first into two ranks (Unranked, or mudansha; and ranked, or yudansha), and instituted a belt system to recognize the difference between them. These were later divided into levels of Kyu (white belt) and Dan (black belt) based on the rankings in Go.
The colored belts came after Judo began to be taught outside of Japan. Sensei Kawaishi Mikonosuke (川石酒造之助) introduced various colored belts in Europe in 1935 when he started to teach judo in Paris. The story goes that he felt that the Europeans he was teaching needed some sort of encouragement to continue training, and that a new belt at a new grade made the sport more appealing. This system was later adopted into various other martial arts taught throughout Europe, but was also adapted into Karate by Funakoshi Gichin (船越義珍) attempting to increase (Shotokan) Karate's appeal to the Japanese.
Answer: Jigoro Kano first came up with the kyu/dan ranks in 1883 for Judo.  The original belts were blue (6th kyu), white (5 and 4 kyu), brown (3, 2, and 1 kyu), and black for dan grades (10 ranks).  The idea behind the system was to promote a quick reward/progression system and a way to identify your opponent's average skill in randori.  After that, a myriad of colours were added.
In Aikido, Ueshiba determined that kyu grades should wear white, yudansha black and those with a Menkyo Kaiden (high level certificate) will be 8th dan.
Note that the black belt is not because either the belt gets died may times or as it getting dirtier and thus looks black.  Those are (stupid) myths.
Note as well that other arts such as Muay Thai have a ranking system with colour (in that case arm bands called Prajeat) but they have no common root with the kyu/dan rank system.
Comment: The belt getting dirty because of the long time of training is often perceived as a symbol that quite well visualizes the amount of time and effort needed to achieve such level of expertise. It doesn't have to be actually true to serve this purpose, and thus I don't find it "stupid". Beside that, nice answer!
Answer: This is an inspiring article about belt rankings.
http://www.minrec.org/wilson/pdfs/History%20of%20Belts%20and%20Ranks.pdf

Speculative tradition proposes that belt colors (as indicators of rank) originated in a
  peculiar habit of washing all of one's training clothes except the cloth belt. Thus as
  training progressed the initially white belt would first turn a dingy yellow, then a greenish yellow-brown, then a really dirty brown, and finally a repulsively filthy black.
Eventually, so they say, this progression was formalized as the white, yellow, green,
  brown and black belt ranks. Well, it's a nice story, but probably not true

I have heard that Judo had 3 belts by origin. White for beginners, Brown for intermediate and Black for advanced Judoka's and that they have added more stages in between for the impatient Europeans.
This youtube video shows the sky blue, white, brown and black as @Sardathrion said.

1882 - Kano invents judo
1883 - Kano hands out two black belts. (adopted from good swimmers who wear a black ribbon)
belts where different, tied around once instead of the current twice around your middle.
1906 - Judogi is introduced. (there was black belt and non-black belt)
x - Sky blue, white, brown and black came. after that came karate belts. white, brown, black. judo and karate had 6 kyu rankings. 3 white, 3 brown.
1930 ~ 1940 - european martial artist invented the 6 kyu rankings.
white, yellow, orange, green, blue (or purple), brown.
Comment: Lol! it was quoted from the linked pdf and even the author said it was fake, so why the -1?
Comment: -1.  The urban legend of never washing your belt is utter rubbish.
Comment: It is neither a "nice story" nor is it probably fake.  It is utter rubbish.
Answer: Traditional Kung Fu doesn't have colored sashes, as they traditionally had the sole purpose of holding up the pants. For the most part, colored sashes are a Japanification of the ranking systems. Rank in traditional Kung Fu also doesn't follow the same general pattern as Japanese arts either, as titles are familial based, not rank based (sidi = younger brother/sister, sihing = older brother, sigung = grandfather, sitaigung = greatgrandfather) If a student of a Sifu opens his own temple, the student gets title of Sifu and the Sifu get Sigung, etc). Many modern Kung Fu styles have sashes to help display rank and to give students the feeling of achievement.
Comment: Also, traditional Aikido has white and black belts.
Answer: Origin of Kyu/Dan grades in Judo
While the kyu/dan ranking itself stems from Go, it had already been in use in a number of other disciplines by the time Kano adopted it for martial arts:

The majority of people believe that Jigoro Kano was the founder the Kyu / Dan grade
  system, this is untrue. However, he is recognised as the first person to use this grading
  system within the Martial Arts. The idea of the Kyu / Dan grade system, or Dan-I,
  was in fact "borrowed" from other sources of Japanese culture.
The Kyu / Dan system was first introduced in the 17th century by Honinbo Dosaku, a
  grandmaster of the Japanese 2 player logical board game "Go". He introduced the
  system, as a method of handicapping the game. Honinbo itself, was the name of one
  of the four famous major schools of "Go" in Japan, the head of the school was given
  the schools title.

The Origins Of Judo's Kyu / Dan Grading System, Phil Morris (2005)

Origin of black belts to reflect grade
The use of a black belt to distinguish advanced students from beginners appears to have been inspired by the wearing of black ribbons by advanced athletes in public school competitions:

Later the Japanese public schools were using the Kyu / Dan system as a means to rank
  ability throughout the different athletic departments. These departments were using
  belts or ribbons to identify ranking ability, most notably within swimming, where
  advanced swimmers wore a black ribbon around their waist to separate them from
  beginners in swimming tournaments.
Many other areas of Japanese culture had also adopted this system, i.e. Chado (Tea
  Ceremony), Ikebana (Flower Arranging), Shogi (Japanese Chess), Renju (Connect
  Five), Calligraphy, to name just a few, etc, etc.

Spread of grades and belts from Judo to other martial arts
Shortly after Kano's adoptions in judo, the Tokyo Metropolitan Police Department instigated the use of kyu (and later dan) grades in Kendo:

dan-to-kyu
The system for indicating one's understanding of kendo and the level of one's skill. The dan was originally adopted in Kodo-kan Judo, with the first sho-dan (first dan) being issued in 1883 (Meiji 16). The kyu system was used in kendo mainly by the Tokyo Metropolitan Police Department and was systematized in 1885 (Meiji18). In kendo, the Tokyo Higher Normal School first used dan in 1908 (Meiji 41). The dan and kyu system was standardized throughout the country after the Dai-Nippon Butoku-kai adopted this system in 1917 (Taisho 6). at that time dan ranged from sho-dan (first dan) to ju-dan (tenth dan), and kyu ranged from 1 kyu (which is just below sho-dan) down to 6 kyu.

Japanese-English Kendo Dictionary, All Japan Kendo Federation

before being adopted generally by Japanese martial arts:

In 1895, the Japanese Government sanctioned the formation of the first Martial Arts
  association, The Dai Nippon Butokukai (Japan Great Martial Virtues Association).
  This was formed to oversee, standardise and promote the various Martial Arts
  traditions of Japan.
As a result, Kano's Judo Kyu / Dan system was given a mighty boost, as the
  committee set up to oversee the Dai Nippon Butokukai, adopted Kano's innovative
  grading system to grant Budo / Bujutsu martial rank certification (Budo / Bujutsu
  Menjo) and to grant teaching licences (Shihan Menjo).
The Butokukai, revolutionised the practice of Budo and Bujutsu in Japan and a
  common system of uniforms, ranking, belts and promotions was adopted. Even
  Jujutsu practice methods were to become standardised along the lines of Kano's Judo.
The Butokukai promoted the practice of Budo training to the nation and the teachings
  of Bushido (The Warriors Code Of Ethics). Judo and Kendo were promoted as sports.
  The Judo practice uniform, Judogi, and Kyu / Dan belt system eventually spread to
  many of the other modern Martial Arts, such as Aikido and Okinawa's Karate, which
  adapted them for their own purpose.

Further coloured belts
Kano later modified his belt system, adopting further divisions of colour:

Red-white and red belts for senior dan
Purple/brown belts for advanced junior/adult kyu
Purple belts were supposedly first introduced for more advanced juniors:

"The colour of the belt varies according to the rank of the person. 1st dan to 5th dan is black. 6th dan to 9th dan is red and white. 10th dan and higher is red. For all kyu grades, it is white. Children who have more than 3rd kyu may wear purple."

Jigoro Kano, 1931 (attrib.)

Before later adding brown belts for the same purpose in adult grades:

Beginning with a white belt, the pupil, on attaining what is called sankyu, or third class, dons a brown belt, which he retains up to ikkyu, or first class, only to change it for a black belt on promotion to  the lowest teaching dan or grade called shodan.

Mind and Body,  Vol. 32 (p.543) (1925)

Green belts for mid-level kyu, blue as alternative to brown

All beginners start as white belts. After showing some ability to execute a few basic throws both in form and in free play, after 6 months or one year the player is promoted to the next belt, which is green. This promotion, of course, depends on the club, as some will promote players to green after but a few months. The next promotion, again after about 6 months or a year, is to either a blue belt or the brown belt.

Modern Judo, Vol.1 (p.5), Charles Yerkow (1958)

Further colours outside of Japan
Several clubs experimented with the use of coloured belts in the 20's:

However Kawaishi cannot be granted the original idea of using coloured belts,
  information as to the actual individual does not seem to be known. However, the
  London Budokwai, formed in 1918, began using forms of coloured belts to
  distinguish Kyu levels as early as 1922. Again the Seattle Nisei Judo Club, the oldest Judo club in the west, began using forms of coloured belts in the late 1920's.

Judo's Kyu Grade System, The Introduction of Coloured Belts, Phil Morris (2005)

Becoming something of a standard by the 40's:

In Europe the clubs promote as follows: white, yellow, orange, green, blue, brown, black. In Hawaii the yellow and orange belts are eliminated. In some clubs there are either three or two classes in the brown belt, the Kodokan holding to three classes.

Modern Judo, Vol.1 (p.5), Charles Yerkow (1958)
Comment: Mifune's *Canon of Judo* (1956) lists coloured belts for Beginners (light blue), Juniors (white < 3-kyu, violet > 3-kyu), and Seniors (White 4/5-kyu, brown 3/2/1-kyu)
Answer: Just to add another data point, Capoeira did not initially have a belt system, especially since it was illegal to practice Capoeira for a fair amount of its early history, so they had no desire to advertise their knowledge with uniforms or belts. Mestre Bimba, creator of Regional Capoeira, issued four different silk scarfs, or lenços, for mastering different aspects of Capoeira (the scarfs were a callback to a tradition of people on the street wearing a silk scarf around their neck to ward off knife and razor attacks).
The blue lenço was for basic techniques. The red lenço was for learning more combative techniques, including protecting from surprise attacks. The yellow lenço was for learning how to defend against and use weapons. The white lenço was for music mastery. There was no indication of mastery (Bimba refused to designate anyone a mestre, as he believed that the community must decide who is suitable to teach, although he left a set of signed certificates to his students to be issued after his death).
The cordao (in English "cord" or "chord") system dates to around 1955 when Mestre Carlos Senna of the group Senavox introduced them, alongside a standardized uniform of the abadas (white canvas pants commonly worn by laborers) and rules for tournaments. I'm not certain if his justification is documented, but I've heard it said that uniforms and belts were basically introduced because Capoeira was being recognized as a sport by the Brazilian government, and Mestre Carlos was trying to legitimize the style by copying the practices of karate and jujitsu. The colors and order of the belts varies between schools (and many Angola schools don't use colored belts for rank) with there being two major spectrums, one based on the Brazilian flag, and one loosely based on traditional colors associated with the orixas.


MIPS Coding Assembly Language - Interrupts

Question: My code wouldn't work after attempting this. Can somebody show me how it's done?
Instructions -
Turn off branch and load delays for this program, if you wish. It will make it considerably simpler. Be sure to turn on memory-mapped I/O. Make sure you fully understand what the memory mapped I/O example program from my Web site does before you start designing or programming this. You will not be polling, but you need a clear understanding of memory-mapped I/O.
You may not use syscall for input or output, because the program would then block on the input. Instead, use an interrupt-driven I/O routine to handle all input and output. You must do ALL input and output through the interrupt-driven memory-mapped input/output services, NOT through syscall. You may NOT poll for I/O. The only syscall you may use for this program is a syscall with code 10 to end the program.
Write a program that starts with two arrays of characters (to hold .asciiz strings), of equal length (at least 60 characters in length), labeled 'source' and 'display'. Initially, make the source array contain a character string with a '\n' before the terminating NUL. Include upper- and lower-case letters and other characters (punctuation, digits, and spaces) in the string. Start your program by copying the source array into the display array. Use a subroutine to do this passing in the addresses of the two arrays on the stack. Use the "real-world" subroutine calling convention.
After copying the string, enable interrupts, and then loop, examining a variable (which may be changed by code inside the interrupt handler) until the user tells the program to quit. Whenever an output ready (transmitter) interrupt occurs, the interrupt handler will print the next single character from the display array, wrapping back to the beginning after it prints the '\n'. Whenever the input interrupt (receiver) interrupt occurs, you will extract the user's input (one character) and do one of the following tasks depending on the user's input:
's': sort the display array using any easy sort routine (bubble or ripple is fine). Do not sort the '\n'.
't': toggle the case of every alphabetic character (for example, 'T' becomes 't', 't' becomes 'T' and all non-alphabetic characters stay unchanged).
'a': replace the display array elements with the source elements once again.
'r': reverse the elements in the display array (again, excluding the '\n').
'q': quit -- terminate program execution.
Ignore any other character in input. Handle the commands from the user inside the interrupt handler, not inside the main program.
The 'q' command should just set the variable being queried (repeatedly) by the main program, which will cause the main program to then exit with a syscall with code 10. You MAY NOT use registers to send information between the program and the interrupt handler.
Note: an interrupt could happen in the middle of displaying the array, so the characters being displayed could change mid-line. This program is obviously designed to build on previous assignments, so you should reuse code wherever possible. The primary new feature is the interrupt-driven input and output. Instead of reading entire strings in one syscall, you will read and process each character as it arrives. Again, you MAY NOT use syscall for any I/O. This is about three or four pages of code in total.
This is my code but I can't get it to work -
<code>prompt: .asciiz "SPIM IO Test.\nOnly runs with -mapped_io flag.\nPlease type 6 input lines:\n"
nl:      .asciiz "\n"
      .text
      .globl main
main:
      li $v0 4
      la $a0 prompt
      syscall
# Register usage:
#            s0            loop counter
#            t0            address of recv_ctrl
#            t1            address of recv_buffer
#            t2            address of trans_ctrl
#            t3            address of trans_buffer
#            t4, t5            temporaries
#            t6            char read from input
#            t7            1 => char in t6
      li      $s0, 3            # loop counter
      li       $t0, 0xffff0000      # recv ctrl
      li      $t1, 0xffff0004      # recv buf
      li       $t2, 0xffff0008      # trans ctrl
      li       $t3, 0xffff000c      # trans buf
# First, read and echo 3 lines of input by polling the IO registers, not through
# interrupts:
      mtc0      $0, $12            # Clear IE bit in Status reg to disable interrupts
l1:
      lw      $t4, 0($t0)      # Wait for receiver ready
      and       $t4, $t4, 1
      beq      $t4, 0, l1
      lw      $t6, 0($t1)      # Read character
l2:
      lw      $t4, 0($t2)      # Wait for transmitter ready
      and      $t4, $t4, 1
      beq      $t4, 0, l2
      sw      $t6, 0($t3)      # Write character
      beq      $t6, 0xa, decr      # New line (nl)
      bne      $t6, 0xd, l1      # Carriage return (cr)
decr:
      add      $s0, $s0, -1      # Decrement line counter
      bne     $s0, 0, l1      # If not zero, get another line
# Second, read and echo 3 lines of input by through interrupts:
      mfc0      $t4, $13
      and      $t4, 0xffff00ff      # Clear IP bits in Cause register
      mtc0      $t4, $13
      li      $s0, 3            # loop counter
      li      $t4, 0x2      # Enable device interrupts
      sw      $t4, 0($t0)
      sw      $t4, 0($t2)
      mfc0      $t4, $12      # Enable interrupts and mask in Status reg
      ori      $t4, $t4, 0xff01
      mtc0      $t4, $12
l3:      b      l3            # Loop waiting for interrupts
# Trap handler. Replaces the standard SPIM handler.
      .ktext 0x80000180
      mfc0      $t4, $13      # Get ExcCode field from Cause reg
      srl      $t5, $t4, 2
      and      $t5, $t5, 0x1f      # ExcCode field
      bne      $t5, 0, exception
# An interrupt:
      and      $t5, $t4, 0x800      # Check for IP3 (HW 1)
      beq      $t5, 0, check_trans
# Receiver interrupt:
      lw      $t5, 0($t0)      # Check receiver ready
      and      $t5, $t5, 1
      beq      $t5, 0, no_recv_ready      # Error if receiver is not ready
      lw      $t6, 0($t1)      # Read character
      li      $t7, 1
      beq      $t6, 0xa, decr2      # New line (nl)
      bne      $t6, 0xd, next      # Carriage return (cr)
decr2:
      add      $s0, $s0, -1      # Decrement line counter
next:
      mfc0      $t4, $13      # Get Cause register
      and      $t4, 0xfffff7ff      # Clear IP3 bit
      mtc0      $t4, $13
check_trans:
      beq      $t7, 0, ret_handler      # No char to write yet
      and      $t5, $t4, 0x400      # Check for IP2 (HW 0)
      beq      $t5, 0, check_loop
# Transmitter interrupt:
      lw      $t5, 0($t2)      # Check transmitter ready
      and      $t5, $t5, 1
      beq      $t5, 0, no_trans_ready
      sw      $t6, 0($t3)      # Write character
      li      $t7, 0
      mfc0      $t4, $13      # Get Cause register
      and      $t4, 0xfffffbff      # Clear IP2 bit
      mtc0      $t4, $13
check_loop:
      bne      $s0, 0, ret_handler      # If line counter not zero, get another line
# Done echoing, so terminate program.
      li      $v0, 10
      syscall                  # syscall 10 (exit)
# Return from handler.
ret_handler:
      mfc0      $t4, $12      # Enable interrupts and mask in Status reg
      ori      $t4, $t4, 0xff01
      mtc0      $t4, $12
      eret                  # return to interrupted instruction
exception:
      li      $v0, 4            # Non-interrupt exception
      la      $a0, other_str      # Print message and ignore
      syscall
      b      ret_handler
no_recv_ready:
      li      $v0, 4            # Receiver was not ready after interrupt
      la      $a0, no_recv_str      # Print message and ignore
      syscall
      b      ret_handler
bad_int:
      li      $v0, 4            # Interrupt was not from recv or trans
      la      $a0, bad_int_str      # Print message and ignore
      syscall
      b      ret_handler
no_trans_ready:
      li      $v0, 4            # Transmitter was not ready after interrupt
      la      $a0, no_trans_str      # Print message and ignore
      syscall
      b      ret_handler
      .data
other_str:
      .asciiz "Non-interrupt exception\n"
no_recv_str:
      .asciiz "Receiver not ready\n"
no_trans_str:
      .asciiz "Transmitter not ready\n"
bad_int_str:
      .asciiz "Unknown interrupt\n"
</code>
Comment: Can you be more specific about how it doesn't work?
Comment: it gets stuck on the loop
Comment: Ok, what loop does it not finish?
Comment: line 53 where the instructions are lw $12, 0($8)
Answer: I am working on a very similar assignment and new to MIPS. Looking over the program I think the directive in the kernel code at the bottom of pgm (line 123) should be .kdata and not .data. Also .data directive above main: is missing in the post.


Why did Destiny need to wait a few hours between FTL?

Question: Was any in-universe explanation given as to why Destiny couldn't handle leaving and re-entering FTL quickly?  In Blockade they said the (minimum) delay was 3 hours, and Rush was concerned about jumping the gun by as little as 15 seconds.
Answer: Short Answer: The Destiny's FTL drive system had been compromised and one of its 16 drives had been damaged and unable to be replaced. Rush presumed that any use of the system without proper calibration and without allowing the 3 hour recovery time could endanger the systems causing permanent damage.
Longer Answer:
Destiny has an FTL drive system. Destiny was originally equipped with sixteen FTL drives but one was damaged and could not be replaced. There was a question of whether it was possible to engage the FTL with fewer than fifteen drives. The FTL drives also required the ship's shield system to have at least 5% power to protect the ship until the FTL drive is completely active.
The Stargate Wikia confirms:

The Destiny's FTL system must remain active for four hours after a
  jump and inactive for three hours when they are disengaged. Jumps made
  earlier than this can cause damage to the engine.
The Faster-Than-Light engine, or FTL engine, is a technology used
  on the Ancient ship Destiny and the Seed ships sent ahead of it. It is
  capable of faster-than-light travel without entering hyperspace.
  FTL has also become a Tau'ri expression for an engine capable of
  travel at speeds greater than that of light, whether it is through use
  of hyperspace or not.
Comment: Destiny does not have a hyperspace drive...
Answer: The explanation given was the drive would burn out/overload if it did not remain active for 4 hours after starting a jump and remain inactive 3 hours after completing an FTL jump.
I believe this occurred with one of the Ancient "Seed Ships" during a battle with the Drones.


Is there a group established to translate books into Esperanto

Question: I'm searching for a group that translates books into Esperanto and would like to volunteer some of my time to help in the endeavor of translating. Duolingo has an immersion feature that allows several people to translate articles in a group and I am wondering if something like that exists for translating books into Esperanto.
Comment: "Ne bezonante rigardadi, kion diras aŭ faras aliaj, ĉiu povas alporti sian ŝtonon por la kreskanta konstruo. Nenia ŝtono perdiĝos. Nenia laboranto tie ĉi dependas de la alia, ĉiu povas agadi aparte, en sia sfero, laŭ siaj fortoj, kaj ju pli da laborantoj estos, tiom pli rapide estos finita la granda konstruo."
-- L. L. Zamenhof
Answer: If the book is under a free license or in the public domain, you may translate it on Vikifontaro. The project aims to "provide an open online universal repository of free texts and primary sources, collaboratively curated by volunteer communities in all languages, integrated with Wikipedia, Wikimedia projects, and other sources, reusable by all".
Translation activities of this works from one Language to an other are also welcome. There is a community, and a huge infrastructure. Mediawiki, the software powering the website, do have extension to ease translation (you can use them on Wikipedia for example), but I don't have information about it's installation and support in the case of Wikisource. You can consult the more detailed information about translation inclusion on the project.
Answer: I have never heard of a group like this, and there are a few reasons why I wouldn't expect to.
As has been pointed out, translators often work alone. Roughly 10 years ago, I produced the Esperanto content for the DVD "Flying an Octopus" and in addition, I solicited help from others for different individuals to translate sections of the subtitles into various national languages. I received criticism from some professional translators who felt that this approach would result in a translation that was not stylistically consistent throughout, and that different technical terms for example might be used for the same thing in different sections of the translation.
Another group translation project that I am aware of was the translation of the first Harry Potter book. Much of the work ended up falling on a single individual anyway, and in the end they were unable to obtain permission to publish.
Finally, consider the state of "immersion" on Duolingo. Initially, this was the core of Duolingo's business model. They thought that they'd be able set up a crowdsourcing site for translation, and then make money off the translations. It's already been a few years since they've rolled out "immersion" to a new language, and it's clear that they're moving away from this and looking for a new model to make money. If Duolingo is moving away from it, I wouldn't expect other groups to move to it.
If you are a fluent Esperanto speaker with years of experience reading and writing good Esperanto, I would encourage you to translate and publish. If a whole book is a bigger project than you want, why not try something shorter?
Answer: No, I don't think so. I have been a publisher of Esperanto books for 30 years, but i never heard of such a group. Most translators work alone. They choose a title, ask for permission to translate, and then look for a publisher.
Answer: Eldonejo Mistera Sturno calls itself "...projekto por traduki majstrajn verkojn de scienca fikcio, fantasto kaj hororo."
Answer: Yes, I run an email discussion group called verotraduko: https://groups.google.com/forum/#!forum/verotradukado
It's meant for books, films, videos, etc to do with exposing the causes of the current wars.
Answer: Konkrete, vi povus akcepti la proponon traduki al via gepatra lingvo la Esperanto-tradukojn de la eroj de la ejo 'Epsilon-Teorio', kaj poste afiŝi ilin, kompreneble. Tiu ejo, fare de ne-Esperantistoj, pritraktas monajn kaj investajn aferojn de Usono. Jen estas la ligilo al la loko de la Esperanto-tradukoj:
https://ekonomiabultenopriusono.com/


Font size of text within image/graph for MS Thesis

Question: Can somebody suggest what should be the optimal font size of text like axis ticks, axis label, legend etc. ?
Comment: Your university probably has a style guide for theses. Follow it.
Comment: No info for text within images.
Comment: Ask your advisor or any other professor in your department who has had students that wrote a thesis.
Answer: Your institution's thesis template may specify this - some do and some don't.
If not then it's really up to you.  Typically, you want it to be smaller than your main text so that it doesn't stand out inappropriately much.  Beyond that, it's a  balance for efficacy of communication: larger sizes are more legible, but smaller sizes can help avoid visual clutter.  Remember also that many of your readers may be older or have imperfect vision and have a hard time with smaller fonts.
Answer: Try to use the same font as what you use for image captions. Then it should be easy to read and it does not stand out in comparison with the rest of the document.
For example, if your text is 12pt Times and image captions are 11pt Times, then all text in your images is 11pt Times. If both text and image captions are 12pt Times, then all text in your images is also 12pt Times.
(In exceptional cases you can try to save space by using a slightly smaller font.)


02 honda accord 2.3L, engine shaking and low stft

Question: When the vehicle turns on it will hang around 750 rpm for 1 sec then go to 1250 and stay there. Eventually a p1399 code will come up. I turn the car off then back on and it immediately goes down to 250 rpm and stays there for 10 sec then goes up to 1250 again and a cylinder 4 misfire occurs. If I rev the engine to 2500 and hold, once I release off the pedal it will stay at 250 and all cylinders will have misfires. If I erase all dtc's then it will restart the issue from the beginning. All while this is happening the stft is at -27.3 and the ltft stays at 0. I have replaced the egr, fuel pressure regulator, valve cover gasket and spark plug gaskets, plugs, plug wires, distributor, o2 sensor in the manifold, pcv valve, and done a valve adjustment. I'm lost as to what it could be.
Comment: What market are you in? In the US the 2.4 wasn't an option until 03 and all 2.4s were COP. Is the car drive by wire? Can we get some datalogs of the major pids?
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Comment: EGR ports might be clogged, replacing egr will not solve this, ports in both directions need to be cleaned out.
Answer: I think the misfire (P0304, P1399) is caused by being way too lean. The STFT seems pegged low.  Misfires usually INCREASE the fuel trims, due to the O2 sensor detecting so much extra oxygen from the misfired cylinders, and then compensating by adding more fuel.
Get more PIDS (like Ben suggested) and try and determine why the ECU wants it to be lean.  Check intake air temp and coolant temp sensors for plausibility.  Check operation of idle air control and timing (crank/camshaft sensors) for plausible values as well.
EGR gasses have no combustion value and would not affect O2 readings.
Check for vacuum leaks (un-metered air), because it's always a good start.  Although, vacuum leaks would cause a high STFT for the reasons I mentioned.


Is ScholarShare a legitimate entity for a 529 plan in California?

Question: I am researching a 529 plan for my kids.  We are in California.  It seems that a lot of links point to ScholarShare plan.  Yet, I can't tell whether it is legit or not, mostly because I haven't heard of it before.
So is this a legitimate entry?
Answer: To mhoran's point, yes, the company, TIAA-CREF is valid.
I'd focus on the expenses -

Their S&P fund (Index US Large Cap Equity Portfolio) shows a .11% total fee. You might choose this one, or others, but this number looks great to me. We are in an investment world where fees are still often over 1%, and we are conditioned to think anything less is a good fee. For me, the goal is less than .25% in your retirement fund, college savings, etc.
Answer: For a parent deciding on contributing to a 529 plan the first consideration is the plan run by the state government that will trigger a state income tax deduction. You do have to at least look at the annual fees for the program before jumping into the state program, but for many people the state program offers the best deal because of the state tax deduction.
Unfortunately for you California does not offer a state tax deduction for 529 plan contributions. Which means that you can pick another states program if the fees are more reasonable or if the investing options are better. You can even select a nationwide plan unaffiliated with a state.
Scholarshare is run by TIAA-CREF. TIAA-CREF is a large company that runs pension and 403(b) funds for many state and local governments. Many teacher unions use them.
They are legitimately authorized by the state of California:

The ScholarShare Investment Board sets investment policies and
  oversees all activities of ScholarShare, the state's 529 college
  investment plan. The program enables Californians to save for college
  by putting money in tax-advantaged investments. After-tax
  contributions allow earnings to grow tax-deferred, and disbursements,
  when used for tuition and other qualified expenses, are federal and
  state tax-free. The ScholarShare Plan is managed by TIAA-CREF Tuition
  Financing, Inc.
The ScholarShare Investment Board also oversees the Governor's
  Scholarship Programs and California Memorial Scholarship Program.

note: before picking a plan from another state make sure that they allow outside contributions.


Can Microsoft Project be used without Sharepoint Server?

Question: Is MS Sharepoint server required to use MS Project and what is the relation between them? I need only project server is it possible to use only MS Project server without Sharepoint server or can I manage it with sharepoint services?
Answer: Assuming Project Server 2010 (you didn't specify the version so I'll assume you meant the latest), no.
> Microsoft Project Server 2010 is built on Microsoft SharePoint Server 2010
Answer: The short answer is yes.  Project Server 2007 is built on SharePoint Services (WSS) and requires it but if the follow on question is: should you use your MOSS SharePoint farm (With other sharepoint apps) to support project the answer would be no.   Project 2010 is much more tightly integrated with MOSS 2010 and is more Dependant on it.    Here are the software requirements for Project Server 2010 link
Here is a link from a person who explains the issue of integrating Project server into a SharePoint farm with locally designed apps.  This is focused on Project server 2007 so YMMV in the 2010 space.   The main issue is that if you have SharePoint folks in your space, they will want to make changes and upgrade faster than the project server software LifeCycle.
So...you need SharePoint but it is recommended that you deploy a standalone instance for project server.
Answer: You can use MS Project stand alone, but you'll have to update the data manually.
With a link to something like Sharepoint where you track the actual time taken for tasks/work items then the data can be updated automatically and your project gets updated too.


How should I document a Python script?

Question: I have a couple of Python modules that are meant to be run as scripts. How should I write the docstrings at the module and function level to make it clear how to run and use the module?
Comment: Are these scripts run by users manually or automatically as part of some process? Who is the intended user?
Comment: One of the scripts is run as part of a cron job, but all of them have to be usable by users.
Answer: Personally I use the docstrings for other programmers/installers, there I document the purpose and any setup details that you need to look at rarely.  For user documentation, I use the argparse module so users can run: program --help
import argparse

# other stuff

parser = argparse.ArgumentParser(
    description='Path building utility.',
    epilog="""Default operation is to read a list of directory
           names from stdin and print a semi-colon delimited
           path list to stdout.  To terminate --add, --append,
           --prepend or --remove list, use -- as in: {}
           --remove *foo* *bar* -- input.file
           """.format(os.path.basename(sys.argv[0])))
parser.add_argument('--add', '--prepend',
    help='add specified directories to the front of the path',
    dest='front', type=str, nargs='+', metavar='DIR', action='append')

# etc.

Comment: This looks like a good idea, but at the moment my scripts have few enough options that it would probably add some unnecessary complexity.
Answer: I'd mimick a man(1) page
NAME
      this command does things
SYNOPSIS
      command do-things nice
DESCRIPTION
      things are nice when this command does them

Answer: In addition to ZJR's suggestion of mimicking a man page, you can also provide a usage statement, return codes, and in-code documentation.
I would consider providing a usage statement that explains how to invoke the application in a clear, concise manner. This would simply provide a list of the arguments, what the arguments represent, if a given argument is optional, and any other relevant information. This would be convenient to users who invoke your scripts from the command-line.
For automated applications that call your scripts, I would consider using various return codes to document errors or other non-standard execution considerations. These can be easily parsed and would shift handling of exceptional cases (especially those that you simply can't handle in your script) as well as logging of the event into the calling application.
Using docstrings might be overkill, depending on the complexity of the script, but some form of in-code documentation is needed for future developers (including youself in the future). I would include a high-level overview of what the script does as the very first thing in the file. Self-documenting code would always help, as well, so make sure you've got good variable names. If there's any complex logic, make sure it's clear what's going on and why you made the design decisions that you did with comments.

How should I document a Python script?


Hardcode model data into geometry shader

Question: I have this idea for creating a point cloud and passing an integer into geometry shader to determine which model to draw, each model has the same amount of vertices etc and it would be hardcoded into shader, this would function somewhat like instancing but models have to have the same data size and you can draw multiple meshes in one call. What do you think about it?
Comment: It definitely is a plan. Have you tried profiling it?
Answer: All theory here.
Thoughts come to mind is, compress all your models into a single structured unoredered access buffer, not a vertex buffer.
In your Vertex Shader, do not attach a vertex buffer for your geometry, but attach a structured buffer as a resource would Unordered access buffers.
Now the bit im not sure of.  Create an instance buffer, attach this as a buffer (slot 1 - when you get to this, you will understand).  your instance buffer holds thigns such as the model offset, and colours etc.
Instead, call the draw call without (See reference -> Using Input Assembler without buffers ).  Using the SV_VertexID, plus instance buffer offset, reference into the structured buffer.
All theory, but what i would try first.
To be honest, I think its no benefit.  I would firstly compress your models into 1 buffer, but draw call itself has low overheads are close to 0 (it's queued, and will be dependent on the complexity of the geometry).  I would just call the draw calls with the relevant offset.  I would get your mind around instance buffering and DrawindexInstanced as I have been able to draw thousands of different items very quickly.  Reference my game to see lots of trees rendered quickly and effectively -> Game link
With the instance call, you can actually tell to render all instances in the buffer to render with a certain vertex or index offset.


How to convert DB2 9.5 to DB2 10.5 online (Linux)

Question: How to convert DB2 9.5 to DB2 10.5 online (Linux) ? This can be done with IBM InfoSphere Data Replication? Has anyone done this or have any idea how to do?
Comment: Are saying that you need to perform a version upgrade but can't take an outage (which is required) to do it, so you're looking for other options?
Answer: You cannot migrate the database online.
You can use InfoSphere DR or any other replication software for migration with minimal downtime, however, if your application itself does not support transparent connection failover you will still experience a brief outage.
The process in brief would look like so:

Install DB2 10.5.
Create a new database in a DB2 10.5 instance, using db2look.
Install and configure replication software.
Perform a full refresh from the old (V9.5) database to the new one.
Continue mirroring until the new database catches up to the old one.
Initiate application failover.
Stop replication once the application has fully failed over.


Did Loki and Thor arrive at Asgard right after the Avengers?

Question: So, the reason why I ask this is because in Thor: The Dark World you can clearly see that Loki's hair did grow but how can they grow so fast if he and Thor just teleported themselves straight to Asgard? Or does this take really long? Because when Loki went to his Father in Thor: The Dark World it looked like they saw each other for the first time since what happened in New York. I am so confused.
I hope you guys can help me!
Comment: ....God of Illusion / Mischief?
Comment: It's not *certain* that Loki just arrived back in Asgard...he could have been in the dungeons for a while before being sentenced.
Answer: Based on the timeline provided on the MCU wikia, the Battle of New York happened on May 1, 2012, with Thor returning to Asgard with Loki on May 5. The timeline puts Loki's sentencing on the same day. The date of Loki's sentencing is from Thor: The Dark World Prelude, a comic book that covers time the time around The Avengers. It should be assumed that those are the same scene, because it would be bizarre if Odin sentenced Loki twice.
As for how Loki's hair grew, the Doylist explanation is that they weren't paying attention to his hair length and/or didn't think anyone would notice. Watsonian explanations include that Loki is a shapeshifter and decided to change his hair or that it's an illusion.
Comment: I find it amusing to imagine that Loki deliberately changes his hair length just for the heck of it every once in a while while keeping the rest of his appearance the same.


How to use "by" and "until" in these specific contexts?

Question:
I've watched 10 movies until now.
He should have been here by now
I think in the first sentence, "by" doesn't work and using it will not be idiomatic. This applies to the using "until" in later sentence too. For me using "until" will not be be a correct usage. Instead the "until" in the first sentence and "by" in the second sentence fit the best.
Am I right?
Answer: The difference is that 'by' refers to an event that happens at a moment in time, whereas 'until' refers to an event that happens for a period of time.  They can't usually be used as alternatives of each other - except perhaps when used with negation.
Using your second example, to say "He should have been here by now" means that at some point in time, prior to this moment, he should have come here.  To say "He should have been here until now" would mean that from some earlier time, continuing to this moment, the person should have stayed here.
To reply to your 3rd comment to whatever's answer, no, you cannot substitute by for until in all those examples.  As mentioned, it doesn't mean the same thing, but in those cases it makes nonsensical sentences.
In the examples of:  She won't be back (by) 5 o'clock. - She won't be back (until) five o'clock, they almost mean the same and can be substituted.  This is the negation I was referring to.  Technically, "She won't be back (until) five o'clock" could mean that she will turn up at five o'clock on the dot, whereas "She won't be back (by) 5 o'clock" means that time she will come back will be after 5 o'clock.
Edit for comments:

...whenever we have a negative sentence (negation conditions), (always) "by" and "until" work and mean the same?

Not always, and they're not exactly the same.

...She won't be back (until) five o'clock

This means she won't be back before 5:00.  Generally this means she will get back at 5:00 or some short time after.

I've watched 3 movies (until) now vs  I've watched 3 movies (by) now

Either of these will work depending on context, but neither are really natural.  If you were discussing the total number of movies you've ever seen, you might say: 'I'm going to a 5-movie marathon tonight.  I've only watched 3 movies until now.'  Alternatively, if you were explaining how long something took by comparison you could use the second example:  Where has taken you so long?  You were only supposed to be going to the snackbar for popcorn. I've watched 3 movies by now.'  But in the first instance you are more likely to say 'I've only ever watched 3 movies' and in the second instance 'I've watched 3 movie since then'.
With 4) the inconsistency you see is because of the negation.  "She won't be back by 5.00".  At that point in time she won't be here.  But after that point in time, for a continuous period she will be here.  Similarly, "she won't be back until 5.00" says for the period of time from now til 5.00 she won't be here.  After 5.00 (i.e., from that point in time) there is a likelihood that she will be here.
I think the negation trick is the only way to use them as alternatives to each other.  I can best show this by example.  Given the situation of a boss asking two employees about their previous workday. Firstly, positive:
"I was there by 5.00pm and I worked til midnight."
    vs
"I was on the day shift and I was there until 5.00."
Then negative:
"I wasn't there by 5.00 because my bus didn't show up on time.  But I was only a few minutes late."
    vs
"I wasn't there until 5.00, because that's when my shift starts."
Now, there's no way the two sentences in the first example can mean the same thing.  The two employees might have met in the staff room as one clocked off and the other clocked on, but they were doing two clearly different shifts.
The second example has a similar outcome, i.e., that at some time after five o'clock, both employees were at work, but the circumstances are somewhat different. In the first case '... was not there by...' means 'was there later than', in the second, '... was not there until ...' , means 'was there at'.
I hope this clears it up.
Comment: Thank you very much Mcalex.
But first, do you mean that whenever we have a negative sentence (negation conditions), (always) "by" and "until" work and mean the same?
Second, does "She won't be back (until) five o'clock" mean "she will turn up (at) five o'clock sharp" only or it can mean "she will turn up (before) five o'clock" too?
Comment: Third, according to what you mentioned ("'by' refers to an event that happens at a moment in time, whereas 'until' refers to an event that happens for a period of time."), using "by" in my following example is incorrect and only "until" will work in this sentence:
• I've watched 3 movies (until) now.
Because we are referring to a period of time, while "by" is used for a specific dot in time.
Am I right?
Comment: (4) You had mentioned: ("Technically, "She won't be back (until) five o'clock" could mean that she will turn up ((at five o'clock on the dot)), whereas "She won't be back (by) 5 o'clock" means that time she will come back will be ((after 5 o'clock.))").
I think this is inconsistent with what you had mentioned formerly:
("'by' refers to an event that happens at ((a)) moment in time, whereas 'until' refers to an event that happens for a ((period of time.))").
How do you justify them Mcalex? :-/
Comment: 5) I need to know whether only in negative form of the sentences we can interpret sentences in the way you mentioned above or in positive sentences we can interpret sentences in that way too? The problem is that if we can interpret them in that way in positive form of the sentences, we should believe that in all of my examples above (1-6) they both can work, but just using each one changes the meaning of its sentence.
While I was thinking that in all positive (not negation condition) we are able to use only one of these two and therefor we have to choose the proper one based on the context.
Answer: You're right. It sounds natural and is grammatically correct.
Just the explanations are wrong. By and until are idiomatic for both sentences but require different tenses and/or continuous/simple form.
Comment: Thanks whatever, but I wonder if you could explain a little bit more. I mean why it's like that?
Comment: The second one for sure is right, because "He should have been here until now." is absolutely wrong (wrong tense). The first one, however, I have placed in a context which can be changed, so it could be "I've watched 10 movies by now." With 'by', the first sentence means - My whole life (or in context specified time) I've watched only 10 movies. With 'until', the first sentence means - I've watched 10 movies all the way until now. Or more clearly (and more commonly) - I've BEEN watching 10 movies until now. So, I've been watching whole day these 10 movies, until now.
Comment: Do you mean using "until now" is more idiomatic, when it is used in Perfect Continuous tense and though it is not grammatically correct to use it in Perfect tense, but it is not a natural way to use it?
Comment: So I won't be able to use "by" in even one of the following sentences as a substitution for "until":
- I have been watching these 10 movies until now.
- He's been living in that apartment until today.
- I had been working in that building until last week.
Am I right?
Comment: Hi there
Could you please be kind enough to answer my questions bellow:
--------------------
1) In the following example of mine, is it possible to substitute "until" for "by" or not? - You must be home by7 o'clock. I guess until doesn't work here.
-----------------------------------------
2) Do the following examples mean the same thing? Are they all grammatically correct?
Why you (hadn't) come (until) 12 o'clock?
Why you (hadn't) come (by) 12 o'clock?
Why you (didn't) come (until) 12 o'clock?
Why you (didn't) come (by) 12 o'clock?
Comment: ((3)) What do you think of my following interpretations?
a) I have lunch (by) one o'clock: to me, this means you will have finished your lunch before or at 1 o'clock.
b) I have lunch (until) one o'clock: I think here we are referring to an interval, for example now it's 12 and when we say this sentence, it means: I am/will have my lunch from now up to 1 o'clock and when it got 1 o'clock I will stop having the lunch.
But in the first sentence we mean: whether now or 20 minutes later etc., I will start having the lunch, but I will finish my lunch before or maximum at 1 o'clock.
Comment: ((4))
- She will be back (by) five o'clock.  This sentence means she will be back before five o'clock or at 5 o'clock.
- She will be back (until) five o'clock  She will be back in the duration of the time while it's not 5 o'clock yet. Supposing that its 3 p.m. now, she will be back sometime from 3 p.m. to 5 p.m.
-----------------------------------------
((5))
What do the following sentences imply:
- She won't be back (by) 5 o'clock.
- She won't be back (until) five o'clock.
Comment: ((6))
What do the following sentences imply?
- If I tell you "I will stay there (until) the 27th of January.
- I will stay there (by) the 27th of January.


How to stitch up filled fish?

Question: I would like to fill a medium sized fish (rockfish) with a pesto like marinade and broil it. Could I use very slim chicken wire to wrap a couple coils around the fish to keep the filling in or should I use something else? Toothpicks won't do because the skin at the edges isn't firm to hold. Any downside to using wire?
Answer: I would not expect chicken wire to be food-safe.

According to the FDA, to be considered food-safe, a material must meet several conditions:
It must not allow the migration of "deleterious substances or impart colors, odors, or tastes" to food
Be "durable, corrosion-resistant, and nonabsorbent"
Possess sufficient "weight and thickness to withstand repeated warewashing"
Be "finished to have a smooth, easily cleanable surface"
Have resistance to "pitting chipping crazing, scratching, scoring, distortion, and decomposition"

-marlinwire.com
Now a lot of that might not be much a concern if you only plan to use it once, but still, I'd recommend spending a few extra pennies for stainless steel or aluminum wire, which you should be able to find in any large hardware or home improvement store.  The link above goes on to say specifically that grade 304 and 316 stainless steel and aluminum are food safe.
Another option that might work for you is a grilling basket.
Comment: Why not kitchen twine?
Comment: If you can use straight wire and twist it shut (as this answer implies) you could use cheese wire.
Comment: @Jefromi - yeah, it's possible you could either stitch it shut with kitchen twine, or just tie it shut, wrapping around the outside, like you would a roast, avoiding the need for needle or surgery skills.
Answer: You could use food grade Transglutaminase (aka Meat Glue). It's an powdered enzyme that binds proteins together. I believe it's sold under the ActiveRM brand in the US.
I use it for attaching skin to chicken roulade etc. (e.g. https://www.chefsteps.com/activities/chicken-roulade)

How to stitch up filled fish?


Someone claimed patent Infringment but didn't have a patent?

Question: I run a startup company. I thought i came up with a great product and everything was great. Then one day i received an email of someone claiming to have a PPA of that same product and to cease selling it or provide some form of royalties. I tried to work with them but this was there ultimatum. I was getting ready to sign a contract with them but i later found out they didn't even have a PPA for the product. It was one big deception in order to get me to pay royalties. I lost business because of this and want to know what are my option to deal with this legally?
Comment: If they don't have an actual patent or pending patent application, then I think this is likely better asked on the Law SE site since I think it is about pursuing a civil law suit.
Comment: How you know they don't even have a PPA if PPA are not made public ?
Answer: Well, that business could be an exclusive licensee of the patent in question and have the right to sue or ask for royalties (sub license etc)
So, I think you need to ask for proofs that that company has those rights, in case they have you then should proceed to analyze if the patent apply to your case (check for a patent attorney)
ADDITION:
But seen again your question, they only claim to have a Provisional Patent Application, if that is the case, you have to check the 35 U.S. Code § 154 (d) that covers the rights to collect royalties once the patent is issued for the time since the Publication of the Patent (not the issuing)

(...a patent shall include the right to obtain a reasonable royalty from any person who, during the period beginning on the date of publication of the application for such patent ....)

, but if that is the case, they need also to notify you about the patent:

(B)had actual notice of the published patent application and, in a case in which the right arising under this paragraph is based upon an international application designating the United States that is published in a language other than English, had a translation of the international application into the English language.

Even if the Provisional Patent Application exist, they need to wait until the publication of the patent to notify you of the existence of it, not before the publication date and then they need to wait until the issuing of the patent to collect those royalties.
But even if those events finally happens, the claims that the pending patent had on the publication date have to be identical to the claims of the finally issued patent:

(2)Right based on substantially identical inventions.—
The right under paragraph (1) to obtain a reasonable royalty shall not be available under this subsection unless the invention as claimed in the patent is substantially identical to the invention as claimed in the published patent application.

So, they could be miss using the 35 U.S. Code § 154 (d) to get some money ahead of time. That could be the reason you did not find the provisional patent as it is not published yet (if it really exist at all)
Source:
https://www.law.cornell.edu/uscode/text/35/154
Comment: Per the question, there is no "patent in question".
Comment: Yes, you are right, there is no patent in question, there is just a provisional patent application. I will add more information on this
Comment: In fact there isn't apparently even a provisional. This is why it is more a question about whether the OP has grounds to sue for lost income rather that anything patent related. Better fit for Law SE I think.
Comment: Yes, better for Law SE, but I will add some content about the provisional rights under 35 U.S. Code § 154 that could be the case, that they are notifying him before the publication date of the patent, by mistake


Get notified when power goes off at remote location

Question: I am running a small office of upto 10 computers with normal UPS for each system. Power cut is casual in my area I stay and I could not afford to inverters or generators. Some computers(linux & windows) will be running all time along with server in my office which are accessed directly or remotely. The systems are abruptly shut down automatically after having discharged the ups power during power cut and I am wondering if I could have some kind of software or something where by I get notified by SMS or mail when power goes off in my office so that I can shut them down remotely. Anybody has any idea, please?
Answer: Your best bet is to use a UPS that has a USB connection and can warn the attached computer when it's running on batteries and how much time is left.  Modern OSes all have the ability to shut down safely when battery power is detected/low.  look for it under "power" options in your OSes control panel/settings.  Many also have the ability to run arbitrary scripts or send email... Just make sure your networking gear is also on UPS or the email will get nowhere.
Answer: To add to what @Chris Nava says, I would have a larger UPS on the serevr and protect  the switches/router with the same UPS.  Most will have software that not only shuts down gracefully and manages startup but can also send e-mail and other messages.  Most APC SmartUPS come with PowerChute that will manage 5 systems.  You can configure the messages in many ways and you would then know as soon as power is off.


What does this white lego piece go to?

Question: I was building a lego van and saw this on one of my pieces. What does it go to or what set does it come from?
Answer: This is Tile 1 x 2 with Groove with 'FOLLOW ME PACE CAR' Pattern from set 8121.
Comment: Please stop soliciting for accepted answer votes.
Comment: @PhilB. Yeah, I should stop, but I'm just hungry for rep... and accepting correct answers is a necessary feature at SE. Hopefully I won't have to be asked again.

What does this white lego piece go to?


2.91 fluid sim, renders w/o fluid

Question: I have a fluid sim that is baked and looks good when I play it, my water flows nicely.  When I attempt to render it to png as a series for future image sequence, the water does not even show up.  This must be a simple problem on my part.  None of the fluid sim videos seems to have any issues like this.  I reviewed and reviewed and searched, to no avail.  Help is appreciated!
Comment: the best help you will get if you provide your blend file. Normally this happens if you didn't setup your material in the right way.
Answer: Maybe you turn off the render in the outliner tab?

2.91 fluid sim, renders w/o fluid


07 Dodge Caravan with 3.3 cylinders 3 and 6 misfire

Question: I have a 2007 dodge caravan with a 3.3 with a misfire on cylinders 3 and 6 ( no spark coming from coil to plugs on cylinders). I have changed the plugs the wires. The coil twice and the crank sen. I have check the wires under the top intake and none are broke burnt or cut. I an stumpped on what the problem is. I was hopping someone could help me out with what it may be. I heard it could be the computer? Any help would be appreciated. I should also add that the other 4 cylinders have a strong spark.
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Comment: Did you use Mopar parts?
Answer: Since there is no spark on 2 cylinders that share the same coil, 3 and 6, it is time to check for signal from the pcm, coil driver circuit at the coil.
If it is there, inspect the connector pins for connection integrity.  If it isn't there, then check for signal again at the PCM. If it's at the PCM, find the open in that circuit or run a new wire.  If it isn't, the coil driver inside the PCM has gone bad.
While it is possible that you have replaced the coil 2 times with defective parts, it is unlikely the culprit, and testing for the driver signal (pulsating ground) should verify this.