How is liberation achieved?

Question: If the path leads to liberation then liberation should be conditioned and impermanent. But nirvana is beyond extremes so the path cannot lead to nirvana. How does it work then?
Answer: The eightfold path is said to be conditioned, as follows:

To whatever extent there are phenomena that are conditioned, the noble eightfold path is declared the foremost among them. AN 4.34

Where as Nirvana is said to be unconditioned:

There is, bhikkhus, a not-born, a not-brought-to-being, a not-made, a not-conditioned. If, bhikkhus, there were no not-born, not-brought-to-being, not-made, not-conditioned, no escape would be discerned from what is born, brought-to-being, made, conditioned. But since there is a not-born, a not-brought-to-being, a not-made, a not-conditioned, therefore an escape is discerned from what is born, brought-to-being, made, conditioned. Ud 8.3

What is plainly obvious is the liberation of an arahant (from suffering) is permanent (until the ending of the life of the arahant).

Tassata sā vimutti sacce ṭhitā akuppā hoti.Tañhi, bhikkhu, musā yaṃ mosadhammaṃmosa taṃ saccaṃ yaṃ amosadhammaṃ nibbānaṃ
His release (liberation), being founded on truth, does not fluctuate, for whatever is deceptive is false; Nirvana — the undeceptive — is true. MN 140

Therefore, liberation (from suffering) must be unconditioned, just as Nirvana is unconditioned.
In summary, the eightfold path does not create or condition Nirvana. Instead, the eightfold only removes the obscurations to Nirvana (which was always there but unknown due to obscurations).

It is just as if a man, traveling along a wilderness track, were to see an ancient path, an ancient road, traveled by people of former times. He would follow it. Following it, he would see an ancient city, an ancient capital inhabited by people of former times, complete with parks, groves & ponds, walled, delightful.
In the same way I saw an ancient path, an ancient road, traveled by the Rightly Self-awakened Ones of former times. And what is that ancient path, that ancient road, traveled by the Rightly Self-awakened Ones of former times? Just this noble eightfold path: right view, right aspiration, right speech, right action, right livelihood, right effort, right mindfulness, right concentration.
I followed that path. Following it, I came to direct knowledge of... cessation...
Nagara Sutta: The City
Answer: I like the Brahmana Sutta (SN 51.15) which uses "going to a park" to illustrate it.
Incidentally (and I don't think this is the main point of the sutta) I think that "park" was the same word as used for "monastery", because in earliest times the monks were in parks rather than monasteries.
Answer: In much the same that water is wet regardless of whether you are swimming or standing on the beach, you still have to jump into the ocean to know for certain.
Answer: The meaning of nirvana being unconditioned is that nirvana does not arise due to causes and conditions. This is because nirvana is a negative phenomena, since it is the final true cessation.
However, we say that the achievement of nirvana is caused by path.
In the same way, the absence of John in the room is permanent and unconditioned. If John leaving the room caused the absence of John in the room, it would follow that John's absence would start a moment after John left, since a cause and its effect are not simultaneous.
Answer: Because we are in fact, in Nirvana, but we - don't know about it. Thus we are spending all our lives wandering around. The path is that finally one decided not to wander but taking a path one believed that's the right path to go home; going through this path from beginning to end we then be shown that in fact, we are actually all the time already in Nirvana. That's why the path should be abandoned at the end of the path; or sometimes the path is metaphorized as the boat ferrying one to the other side of the ocean. So... How does it work then? hmmmm... it's working like, a minus minus 1 will be a 1 {-(-1)=1}.
Or, following Tenzin Dorje's, it's like, "John is not home". However, to realize the fact for oneself, one must walk (The Path) from where he is back home, open the door, then, "Ooops, John is really not home!"
=====
§。Sequel。§
By sheer chance, this someone has the Mahayanist mind, thus the story continues:
He looks up the wall the portrait of John The Great staring back at him like Da Vinci's Mona Lisa the enigmatic smile. With disbelief slowing he turns to the mirror on the table, examining his face, "Goshhh... I'm John The Great!" He then once again reaches into his pocket re-took the key out, fondling it in his hand, musing, "Holy crap... all those years since I lost my mind I was wandering around in delusion, believing I'm John Lemon... "
§§§ 。。。balloons 。popcorns 。sob 。applause 。tears-snots-saliva 。 ...The End 。。。§§§
Answer: This Path is a process where the practitioner goes from the Conditioned to the Unconditioned. Stream Entry represents the point at which the gravitational pull of the 'Unconditioned' exerts a greater force than that of the 'Conditioned'. A Stream Entrant's practice is likely to be less affected by the conditions around them; this would depend upon an individual's propensities so, for example, someone who had a tendency to over-indulgence in food may become less bound by that desire even when delicious food is around, or someone who always became angry when contradicted may find it easier to hold their temper in check under that condition.
What follows after Stream Entry isn't merely the tidying up of a few loose ends, but rather undertaking the complete and radical overhaul of our ethical lives, of body, speech and mind, to the point of perfection. When viewed in this way, the attainment of Stream Entry begins to look like the beginning of the principal task of the spiritual life. The Once-Returner is no longer dominated by hatred or craving, that there are no longer any times in their lives when they are overwhelmed by such unskillful emotions. These emotions may arise occasionally in a weakened form, and only in the midst of awareness – they don't dominate.
When it comes to the next level, in addition to having broken the first three fetters and possessing an unshakeable faith in the Three Jewels, the Non-Returner has attained complete ethical purity. It's not that they don't conceal their unskilfulness, they just don't have any, whether of body, speech or mind. They are almost flawlessly motivated by generosity, love and wisdom.
The last five fetters remain of course, but these are exceptionally subtle in comparison to what has been broken in the fourth and fifth fetters. Also, because Non-Returners are not subject to any hindrances, the Eight Jhānas are readily accessible to them. There are examples of both monastic and lay Non-Returners in the Canon. There is the figure of Gatikāra the Potter, for example, who remains in the household life to care for his ageing parents, but he is an extraordinarily holy man.
Then there is the example in the householder Ugga of Vesālī (Anguttara Nikāya VIII,21) who had four young wives before he attained the state of Non-Returner, at which point he told them he could no longer remain their husband. So he asked them to choose between remaining in his house and "doing good deeds", returning to their former families, or marrying another man of their choice. When his first wife said she wished to take another husband he gave her to the man she indicated, reporting that on doing so he felt no change of composure in his heart. This seems to imply that, although he had attained ethical perfection and equanimity on becoming a Non-Returner, prior to that, as a Once-Returner, he had still experienced craving and thus fell short of the highest ethical standards. This shows that going from the Conditioned to the Unconditioned is a process.
Answer: The Noble Truths are conditioned because they require the experienced world to be empty of Essence (the Truths would not hold in a world where an independent Self was perceived and directly knowable in the here and now). The path is conditioned as it is an Eightfold Path, requiring right view, right though etc. Nibbana is unconditioned, but when brought within the confines of thought or language it will be conceived as conditioned, because language and thought are conditioned experiences.
A subject's direct knowledge of the cessation of the 'sphere of neither perception nor non-perception', and that there is no thing further beyond that, does not fit into language very well if you wish to use the verb 'to perceive' with regards to what the subject is experiencing! Because this is the point at which all mental fermentations cease (whether perception or non-perception), the mental state is beyond designation, if being reasonable. I would say it is fair to say that it is unconditioned in the here and now of that individual. The process of arrival to it however, must be conditioned on previous meditative states. And because the mind that experiences direct knowledge is still conditioned by the body, there will be an exit from the perception of cessation. So yes, the experience of Nibbana is impermanent (as any and all experiences must be), the knowledge of it however can carry through beyond the experience, and remain 'permanently' with the Arahant until their parinibbana. (That's my thought, but I am still thinking it through to be honest!)
In Majjhima Nikaya 1 it is stressed that conceiving any thing beyond the direct knowledge of that thing (going beyond impermanence, suffering and non-Self, or not 'treating this as this and that as that' in short) is effectively wrong view. The direct knowledge of Nibbana must therefore be unconditioned, because only conceptual construction brings it down into the forum of the conditioned, and otherwise its 'being' and its 'perception' would not equate, which would be delusion for the subject of the perception.
https://aeon.co/essays/the-logic-of-buddhist-philosophy-goes-beyond-simple-truth is a very interesting article on the logic within the catuskoti that may provide some clearer information too!
Comment: the key  unwholesome term in MN 1 appears to be 'maññati' ,which can be connected to conceit. MN 140 explicitly refers to maññati as 'conceiving self', as follows: "Asmī'ti, bhikkhu, maññitametaṃ". The tides of conceiving (maññassavā) do not sweep over one who stands upon these foundations. Bhikkhu, 'I am' is a conceiving; 'I am this' is a conceiving (maññita); 'I shall be' is a conceiving; MN 140. .  maññita pp. of maññati   https://suttacentral.net/define/ma%C3%B1%C3%B1ita
Comment: MN 1 seems to refer to conceiving things as 'self'.
Comment: Don't know if it entirely fits here, but I think it shows that an Ararant simply does not designate any aspect of their experience -  Nibbana is unconditioned but even the conditioned part of experience is only seen as impermanence and non-Self (as ignorance/stress has been abandoned with regards to all phenomena).. By the time you attain cessation, no aspect of your perception will be based on the extremes of attachment or aversion, so saying you are jumping from a conditioned experience to an unconditioned one is ignoring that the trainee is abandoning a reliance on conditions as a process.
Answer: "If the path leads to liberation then liberation should be conditioned and impermanent. But nirvana is beyond extremes so the path cannot lead to nirvana. How does it work then?"
This is the fundamental difference between Theravada Buddhism and Mahayana Buddhism.
As noted, that due to dependent origination, all changes are impermanent, hence there is no permanent cessation or attainments of any kind.
As the Heart Sutra stated:

There is no suffering, no accumulating, no extinction, no way, and  no
  understanding and no attaining.

Without it seeming like some kind of crazy wisdom what it is saying is:
Suffering is ultimately impermanent.
Accumulation is ultimately impermanent.
Cessation is ultimately impermanent.
The Noble Eightfold Path is ultimately impermanent.
Wisdom is ultimately impermanent.
Attainments are ultimately impermanent.
Nirvana as cessation is relative to existence of suffering. The end of suffering is itself Nirvana. Both of them are impermanent.
This is the clarity of the Prajna Paramita which will cut through any metaphysical claims of Nibanna being a magical unconditioned deathless dimension, a birthless state of no further fabrications etc.
If Nirvana is permanent, the Buddha and his Arahants would never have to meditate ever again. Yet in all the scriptures they are seen to practice constantly even after the attainment of Arahantships.
This is why during the Early Buddhist Schisms, a big point of debate was made over whether Arahants could regress. Yes theoretically they could certainly regress if they stop all their Dharma practice. However, knowing this, a real Arahant with Superior Right view would never stop practicing the Noble Eightfold Path. And hence can end suffering indefinitely (but not permanently).
This is also why Mahayana move away from the four discrete stages of Enlightenments (Stream Entry, Once Returner, Non Returner, Arahantship) to one of continuous practice - a Bodhisattva.
If you pay attention to the description of the four stages of enlightenment, you will realize they describe the Threefold factor of the Eightfold Noble Path, namely Ethics, Concentration and Wisdom. Hence a stream enterer is one who has attained Right View and Right Intention to practice the Noble Eightfold Path. A once returner is one who has cultivated his ethics. A non returner is one who is accomplished in meditative concentration able to hold off lustful cravings indefinitely. And an Arahant is one who attained Superior Right View and Superior Right Intention with understanding of the causes and conditionality that gave rise to the afflictions in the first place and end them, attaining the end of suffering Nirvana. You can see similar descriptions of the Ten Oxherding pictures.

And he passes far beyond all confused imagination and reaches Ultimate
  Nirvana.

Of course the catch is that every step along the way is conditional and indeed reversible. There is no sabhava or permanent nature to any of these states. Hence no one could truly be said to have attained anything. This is why things are said to be Non-Dual in Mahayana, it is not that ignorance and wisdom are the same, but that they are both impermanent and cannot be permanently separated from each other.

no  ignorance or ending of ignorance

So if everything is impermanent why practice Buddhism at all. Because it is useful! A person who does not practice will suffer indefinitely because of the cause and contions for mental afflictions are there. The Dharma is still a very useful medicine to treat your mental afflictions! A table is very much impermanent and having no essential 'table nature', but it is still very useful to put your things on.

How is liberation achieved?


Why does Ser Davos stare at the blood stain?

Question: In the Game of Thrones Season 6 Episode 1 "Red Woman", when the Night's Watch brothers take Jon Snow's body into a room, Davos paused to see the blood stain. It looks like he is observing something. So is there something to notice or I am just reading Davos body language too much?
Comment: I think you are reading into it. He's in shock at what has just happened.
Comment: As a guess, knowing what Ser Davos knows about the Red Woman, the powers of King's Blood from Roberts bastard, and how important Jon is to Stannis, his looking at the blood is the hamsters in his head turning the wheel. This is the moment where Davos starts to think, which results in planning to ask Melisandre to do something. It's a look of inspiration born of desperation. His king, and more importantly the princess, are first in his mind so Davos is going to do whatever he can. He doesn't yet know the full details of what happened in the Camp.
Comment: Maybe, he saw there for evidence but found only blood.
Comment: I paused at the frame, look for clues in the blood, was disappointed though imagined a lot of shapes and things! :P
Answer: Simplest answer is, he's in shock, head spinning, trying to make sense of what happened and his place in it. Don't forget that, despite not knowing Jon very well, Davos was with Stannis when he personally warned Jon about Alliser and his other enemies.
From the transcript for episode 3 of series 5:

Stannis: You have many enemies in Castle Black. Have you considered sending Alliser Thorne elsewhere? Give him command of Eastwach-by-the-Sea.
Jon: I heard it was best to keep your enemies close.
Stannis: Whoever said that didn't have many enemies.
[pause]
Davos: He [Stannis] sees something in you. Might not be apparent from his tone, but it's the truth. He believes in you.

As you can see, they practically laughed off the risk, and Jon didn't follow Davos's advice.
Suddenly, now, it just got very real.
There are some other reasons why what happened to Jon had personal resonance to Davos - more detail on them in my answer to Why does Davos care about Jon so much?

There are other little practical things he could be deducing, too, for example:

No evidence of a struggle or a fight - he can see that Jon wasn't able to defend himself
It's probably possible to tell from the blood being frozen that whatever happened was long enough ago that Jon's survival chances are almost zero
He'll also be aware that he needs to make a big decision about what he does next and who he sides with

It'd be out of character for him to be thinking in such a detached way, but he is observant and quick thinking, and thoughts like this would be buzzing around his head alongside everything else.
Can't blame him for taking a moment to try to make sense of it all.
Answer: It's probably more mundane than this, but personally I see a crude dragon. I've used even cruder paint skills to try illustrating this.

Likely? No. Possible foreshadowing? Sure, why not!?
Comment: Look more like a Direwolf to me. Or is it both? :p
Answer: Ser Davos believed in Jon Snow and his ability to lead the Night's Watch. That blood stain looks like a blurred crow (which is of course bloodstained) which symbolizes that Ser Davos thinks that the Night's Watch is about to collapse now that their only efficient leader has died (The crow is the symbol of the Night's Watch).
This is a piece of art and is really open to interpretation. This was my interpretation.


What roles are women allowed to play in LDS Sunday services?

Question: On a Sunday when a Latter-day Saints congregation meets, what roles are women allowed or not allowed to play in the service?
Answer: Well, so the big hidden question here is "what comprises an LDS sunday service?".  A related question covers some of this, so I'll just summarize.  In your average "Sacrament meeting", you'll typically have:

1 who presides at the meeting
1 who conducts the meeting (may be the same as the one presiding)
1 who leads the music
1 who plays the piano/organ
2+ who bless the Sacrament (Eucharist)
several who pass the Sacrament to the congregation
2 who say the opening and closing prayers
several who give short talks or sermons

Of these, the only thing women may not do is preside at the meeting, bless the Sacrament, or pass the Sacrament.  Those are duties of people who hold the Priesthood, and only men hold the Priesthood.
It would be very unusual to see a woman conduct the meeting, since that is usually done by the presiding person or one of his counselors.  However, there are some meetings of the Church where women conduct the meetings (for example, the General Relief Society Meeting).  There are also meetings where women preside (again, most meetings of the Relief Society), but that does not happen in a Sacrament meeting.
Comment: I don't think only a priesthood holder can preside over a *sacrament* meeting, right?
Answer: The LDS website gives a very succinct answer to this:

In weekly worship services and classes, women preach sermons, offer
  prayers in behalf of the congregation, and teach adults and children.
  They may also serve as missionaries and as presidents of the Relief
  Society, Young Women, and Primary organizations. Women participate in
  councils that oversee congregational activities throughout the world.
  They also perform a vital work in nurturing and teaching in the home.

The page linked to above contains many links to more information, but in short, women hold an important place and serve as teachers and role models, and are in authority in certain positions.
There are positions they cannot hold: most significantly, the priesthood.
From the BYU's wiki:

Particularly, they are not allowed to hold the position of Priesthood,
  which limits them from holding other positions within the Church that
  are only available to those in the Priesthood.Women and men, although
  equal in status, fulfill some separate and different roles in the work
  of the Church. To men is given the responsibility of holding the
  priesthood, with many prescribed duties. The role for women is less
  precisely defined, though no less real. According to Neal A. Maxwell
  of the Quorum of the Twelve: We know so little about the reasons for
  the division of duties between womanhood and manhood as well as
  between motherhood and priesthood. These were divinely determined in
  another time and another place. We are accustomed to focusing on the
  men of God because theirs is the priesthood and leadership line. But
  paralleling that authority line is a stream of righteous influence
  reflecting the remarkable women of God who have existed in all ages
  and dispensations, including our own [Maxwell, p. 94].

The duties of the Priesthood are covered here, which gives some insight, but not specifics of exactly what women are, and are not allowed to do.
Comment: It says I have to wait two more minutes before accepting an answer. Humph.
Comment: I'll be back with more.  And if Mason beats me to it, I'll end up deleting this anyway.
Comment: @Caleb - I think Dave DeLong's answer is better for your question than mine.  His covers exactly what you asked - in the Sunday service.  Mine is more generic.  As much as I hate to lose the points...  I think he got it better than I did.
Comment: Accept votes are mutable :) Still appreciate the official references here.


Find the link between these everyday words?

Question: You have to simply step forward and find the common link between these words:
age, date, drill, go, hole
The correct link works in the exact same way for each of the words.
Comment: "simply step forward" - Caesar shift maybe?
Comment: @randal'thor: Nope. Much simpler.
Answer: You can ...

 ... append each of these words to the word "man" to make new English words:

 manage, mandate, mandrill, mango, manhole
Comment: I like how "hole" retains its basic meaning but the others are *completely* different
Comment: @CodeNewbie: And drill and hole make a good red herring, as do age and date.
Comment: @EngineerToast: I had aimed to choose such words where the meaning changes to a great extent with the 'man' prefix. Even with manhole, it became too specific, so I let it stay in my series of words.
Answer: Could it be:

 things you lie/use as excuses?

I would think that

 people, especially children, would lie about all of the above to get out of something.
 i.e "I'm eighteen," "Sorry dude, I got a date," "Of course I finished my drills, Coach!", "Yeah, I went to the study session," and finally, "I didn't make that hole in the yard looking for dinosaurs! It was aliens!!"
Comment: +1, This answer is brilliant! I love your creative logic.
Answer: The common link between the words "age, date, drill, go, hole"
is, quite clearly,

", "
Answer: I am Not sure, but it's may be Archaeology
Age & Date : Archaeology is the study of the ancient and recent human past through material remains.
Drill & Hole : Drill & Hole for analysis of the material
Go : Visit Different Places.
Comment: Welcome to Puzzling.SE! I don't think this is the answer though, since the OP says "The correct link works in the exact same way for each of the words."
Answer: Another association:
This might be reference to your life (like the Riddle of the Sphinx):
Age you are born and from now on it is increasing continuously, you are getting older, you are aging
Date you have your first love, you date
Drill you are conscripted (in some countries) or go to work, you have some duties you have to follow
Go you leave your parents, or alternatively you get retired
Hole you die and are put in a hole in soil, on cemetery, you get buried
What might be wrong and does not match is that the last word is not a verb. However, this is not a verb intentionally, because this is the moment when you are not able to perform any action (see also the 3rd meaning on the Wiktionary).


Any good deobfuscators for java?

Question: So I've built an obfuscator for java source code, would anyone know if there is any good deobfuscators which i could test how well my obfuscator is?
I know there are many deobfuscators out there, however a lot of them just decompile java byte code back to source code, but don't actual target a lot obfuscation techniques such as opaque predicates, control flow obfuscation and other obfuscation techniques.
So im wondering if anyone could recommend any deobfuscators which may target techniques such as the ones I have mentioned above?
Comment: Most deobfuscators of the kind you're looking for are targeted at specific obfuscators. So I guess the answer would be not yet, but there will be if your obfuscator becomes popular. Anyway, if you provide your obfuscator or an obfuscated sample, I can take a look and tell you how good I think it is.
Comment: @Antimony  i haven't fully implemented my obfuscator right now, i have copy and pasted some obfuscated code with the original of two of the techniques i have implemented, if you could give me your view on it, i would be very happy
Comment: @Antimony http://chopapp.com/#bvwgh7fn here is the link, the first half is the original the second is the obfuscated
Comment: @Antimony also ill like to say some of the variables in the file are not obfuscated such as the method names, as I didn't pass it through the part of my obfuscator which scrambles names, the variables which have been obfuscated are new generated variables, which are made when doing the control flow obfuscation
Comment: Doesn't look too bad. I'd probably tackle it by converting the fields into local variables, writing a pass to simplify the algebraic identities, and then let normal constant propagation do the rest. I don't think any generic deobfuscators would handle this, but it's easy for a human to write a tool which undoes this. Maybe when you're done you should post an obfuscated sample as a challenge and I can try to deobfuscate it.
Comment: @Antimony thank you very much for your help :D, that sounds good thank you
Answer: Proguard's "optimisation" stage results in deobfuscating junk as I wrote up here - http://www.surrendercontrol.com/2016/03/using-proguard-to-deobfuscate-code.html.
Also, Caleb Fention's Simplify engine has a bunch of very nice ideas and implements them for Dalvik code, if not straight for JVM -  https://github.com/CalebFenton/simplify

Any good deobfuscators for java?


Do hail stone fall down just when it is created?

Question: Density of ice is much higher than air. Then how can hail stone remain in earth atmosphere before they fall down ?
Answer: In the moist air of the clouds, the water condenses on dust particles. At the altitude where this happens, it is usually below the freezing point of water, so it quickly freezes. If winds and updrafts keep these particles of ice in the moist air, they collect more water. Eventually, the weight of the ice particles overcome the updrafts and fall to the surface.
Edit:
The updrafts are always present, due to the nature of the storm clouds.
https://en.wikipedia.org/wiki/Hail#Formation
https://www.classzone.com/books/earth_science/terc/content/visualizations/es1805/es1805page01.cfm?chapter_no=visualization
Comment: Can you include details of updraft in your answer. ?
Comment: I wish I could see those forming and slowly strarting to  fall from clouds…
Answer: Hailstones - or anything like sleet, snow, etc - are formed by the freezing of water. Water droplets rise up, and as the temperature keeps decreasing, they freeze at a certain point into a stone, after which this stone would start falling.
Certain studies say that the stone after falling, can enter an area with differenct conditions - causing it to maybe melt and start rising again. This keeps on happening and the stone keeps going up and down, until it doesn't encounter any more of the 'uplifting' conditions.
Whether hailstones are formed, or sleet or simply snow - depends on a lot of weather conditions.
Comment: Weird. The first word of my answer's being cut out. I need to put in an extra word before the answer so that a necessary word isn't cut out :/
Answer: Density is not an issue.  Winds can lift planes, cars, houses, and other things much heavier.
Hailstones can grow to 15 centimetres (6 in) and weigh more than 0.5 kilograms (1.1 lb).  It forms in strong thunderstorm clouds, particularly those with intense updrafts, high liquid water content, great vertical extent, large water droplets, and where a good portion of the cloud layer is below freezing 0 °C (32 °F).  Updrafts and winds can reach 110 mph (180 kph).
Answer: It's all density. Gravity should start to immediately pull it down.  The density of the cloud nor atmosphere can hold it up.  More than up draft would be needed


Time delay without using delay() and millis()

Question: I am designing an industrial control panel using arduino. I have to use time delays as long as 10 seconds and since using delay() makes a halt in the controller I tried using millis(). But it is complicated and it will work only for 50 days. I want the system to work continuously without any maintenance and I need to control as many as 6 relays. So, I need a better solution (hardware or software based) to tackle this problem. How can I do this?
Comment: See [How can I handle the millis() rollover?](http://arduino.stackexchange.com/q/12587). In short: the correct way to handle the rollover is to write rollover-safe code, like in the standard example [Blink Without Delay](https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay).
Comment: I use double loops. The outer loop is your entire delay time, (say, 10 minutes = 10,000 ms divided by the duration of the inner loop delays) and the inner loop is how often you need to check for a condition that necessitates calling some function, (maybe every 1000 ms) - so your halt times are determined by the inner loop delay.   And the outer loop can be used to update a display on a less-periodic basis.  The 50 day thing is not relevant.
Comment: i would "upgrade" to relays to latching, or at least driven by a 1-bit state machine, like an "SR Latch" that the MCU can read and write. That way, an MCU crash won't affect the relays at all.
Answer: You misunderstand the 50 day thing. Yes it rolls over after 50 days but that doesn't mean it stops working. As long as you program your comparisons correctly (something people often don't do in online examples) then all it means is the maximum delay you can have is 50 days.
Comment: Well yes, but without writing your own code to extend it the maximum is 50 days. And anyway millis() is not that accurate, so anything more than an hour or two you really need to use an RTC.
Comment: > all it means is the maximum delay you can have is 50 days. it is pretty trivial to extend millis beyond 50 days. so yes, you can generate much longer delay sout of millis().
Answer: You may have to find a library that eases the use of what you're trying to do.
I made some timer library, called SeqTimer.
You can find it here: Link
or use the Arduino library manager, it's there too.
It's a simple library using millis(), without callback, so it's pretty straightforward.
If you need more advanced timer, search for 'timer' for example in the arduino library manager, there's a bunch of libs related to timers.
Yet, I'm not really sure what you mean by:

work only for 50 days
Comment: When you do "millis() - previousMillis" it will always return the difference between the two, even at the very moment millis() does a rollover. Both variables must be unsigned long to make it work. When only short delays or intervals are needed, it is allowed to use less bits of millis(), for example 16 unsigned bits. However, I think it is easier to always use 32-bit unsigned long when using millis().
Comment: The function millis () returns an unsigned long, which is the number of milliseconds since the processor was reset (until it overflows).

Example:

unsigned long startTime = millis ();

Since there are 2^32 bits in an unsigned long it can count from 0 to 4294967295.

Computing this in terms of days we have:

2^32 / 1000 / 60 / 60 / 24 = 49.710 days

So, the number returned will overflow (go back to zero) after around 49 days (almost 50 days, as the reference page says).
Comment: That's what I thought you meant. In fact, millis() will rollback to 0, so it shouldn't be a big problem. Anyways, SeqTimer or any other lib would work for you.
Comment: I'll probably change to 32b compare someday, yet I did tried the lib for a while with the simili rtc sketch with a serial spy displaying frames reception time, it kept working on the whole test, and derived in time just as it should, as not using a timer interrupt.
Comment: Might be a solution to the former question. Using a timer interrupt, with a correct prescaler, and maybe counting some to get 10s before launching action.
Answer:
it will work only for 50 days.

it overflows in 50 days but comparisons based on it can be good even if it overflows. you just need to recognize the overflow and program accordingly.
so millis() is perfectly fine for what you are trying to do. no need to reinvent the wheels.
Comment: You wrote: "_you just need to recognize the overflow and program accordingly_". If you really need to recognize the overflow, you are doing something wrong.


Could an atmosphere of neon, oxygen and carbon dioxide support life, and what kind of life could it support?

Question: Could a planet with an atmosphere composed mostly of neon, with oxygen and carbon dioxide making most of the rest, support life as we know it (specifically on a low gravity planet)? If so, what impact would it have on the biota of the world?
Answer: Different Nitrogen Cycle
The nitrogen cycle helps give plants (and the animals who eat those plants) the nitrogen they need to make all their compounds which help make their cells. With a decreased level of atmospheric nitrogen, how will these plants make the various amino acids they need? If you look at at the chemical composition of amino acids, you will quickly note that nitrogen is very common, and therefore very important, to life. Amino acids form the structures of proteins, which themselves are important to basic cellular functions and structure.
Life, if it is like life we know of, will need to develop some different techniques to even exist in this nitrogen poor atmosphere! Some bedrocks have nitrogen in them, and can serve as a source of nitrogen, this is not a property common to all bedrock. If nitrogen is too rare or uncommon, I do not know if life can even exist.
Different Atmosphere
Looking at a periodic table, you can see that Neon has an atomic number of 10, whereas Nitrogen is sitting at 7. Since Earth's atmosphere is made mostly of $N_2$, and Neon (as a noble gas) tends to exist as simple Ne, this means the atmosphere itself would be composed of lighter molecules.
This would result in less buoyant force for things which attempt to fly, as gaseous Neon is lighter and less dense than air. This will result in larger wingspans or more vigorous flapping for flying creatures in general.
It also means that creatures experience less drag, so I would expect larger creatures to be generally faster.
In Short: No Life
Nitrogen is a key element for all life. Although most forms of life rely on other forms of life to make atmospheric nitrogen available, removing those nitrogen fixers makes the nitrogen cycle crumble. No nitrogen cycle means no amino acids, and no amino acids means no life!
Comment: Agreed, IIRC, there are bacteria that can free nitrogen from molecules in dirt.  Analogous creatures could presumably do the same elsewhere, getting it from the dirt or liquid compounds.  Perhaps the plant analogues can do it themselves.  They just haven't had to as often on Earth...But this is one of the reasons carnivorous plants exist.  This world might have some aggressive plants!  But what I really want to know is, how cool would lightning look on a world with a neon atmosphere?!
Comment: Clearly, plants do not suck all the nitrogen out of the atmosphere. So, how high a percentage do they actually need?
Comment: I'd say that "no life" isn't an inevitability -- I wouldn't rule out an alternate nitrogen cycle that doesn't involve atmospheric N2.
Comment: So nitrogen is a necessity for traditional life; I can easily change the atmosphere to include it or create life forms that produce it. On a side note, could organisms use the neon atmosphere and biologically-produced electricity to create a light show?
Comment: @Shalvenay Read a little more closely, please. I said no nitrogen fixers would mean no life, not that these nitrogen fixers cannot get nitrogen from other sources. In fact, I even say bedrock has been used!
Comment: @MichaelVehrs The amount of nitrogen plants need depends on the plant in question. Carnivorous plants tend to live in low-nitrogen soils, and get their fix by eating what they need. Others simply have nitrogen-fixers attached to their roots.


Which is more formal/polite: 大いに or ずいぶん?

Question: I know とても is not very formal, but what about ずいぶん and 大いに? Are ずいぶん and 大いに interchangeable, and if so, which is more formal?
Comment: I can't explain why but 大いに sounds far less colloquial than ずいぶん to me... and one difference I can think of: 〇「大いに頑張ってくれ!」×「ずいぶん頑張ってくれ!」
Answer: What is formal in your mind?
Suppose the meeting room is a mess  and you want to have it clean. The following is the e-mail message from you to a person in the General Affairs Department.

"会議室がとても汚れています。11時までに、清掃をお願いします。" This is the best and most popular (and formal) expression on business.
"会議室がずいぶん汚れています。・・・" This one is also OK.
"会議室が大{おお}いに汚れています。・・・" This one is acceptable but "おおいに" is generally for the expression of an emotion. I wouldn't use it for this situation.
"会議室が非常{ひじょう}に汚れています。・・・" The word "非常に" is versatile. It's used widely. I can recommend the use of "非常に" for any situation without using set phrases.
"非常に" と言う言い方は、非常に広く使われます。

The common expressions,

Preceding sentence: "とてもご無沙汰しております" Long time no see. (I'm not sure but "とても" in English here can be "very"? Very long time no see.???)

"おおいに" is rather suitable for the expression of feeling.

"私は、その素晴らしい演奏に、大いに感動した" I was greatly moved by the performance.
Comment: 「とてもご無沙汰しております」って、言うんですか?
Answer: I don't feel that either one of them has a significantly formal (or casual) tone. (A good rule of thumb is that 漢語 tends to be stilted and formal, while pure-Japanese words are less so.)
One major factor that will affect the formality of those words is their nuance:

ずいぶん: implies that the degree is perhaps "too much".
大いに: implies that something was "wholeheartedly" so.

Here is a contrived example of what (I think) that might mean:

「彼はずいぶん意気込んでるね」: "He's...really into it, isn't he?"
「彼は大いに意気込んでる、ね?」: "He's really poured his heart into it, hasn't he?"

Finally, a good neutral semi-formal adjective that is less nuanced is 「非常に」.


Preserving Italian dialects

Question: Is there a website or book that writes down Italian dialect words or phrases so they are not lost over time? My family speaks dialect and I would like to add their dialect to a website (if it exists) or learn about other dialects and the similarities/differences with my family's. Grazie mille!
Comment: Welcome on ItalianSE!
Comment: There are several books, sites, scholars and so on, since there are several dialects and, say, a speaker or a scholar of a particular dialect of Lombardy might not be knowledgeable about a dialect of Sicily. Which dialect are you interested in?
Comment: Indeed for many "dialects" there are fully fledged grammars, dictionaries and linguistic studies. The major ones even have literatures :). I don't think there is a single website that collects them all.
Comment: Try with [this link: it contains few sentences in Naples language](http://www.vatrarberesh.it/biblioteca/ebooks/dettinapoletani.pdf).
Comment: I am interested in adding town-level dialects that are in the Campania and Molise regions, especially as I find that there are differences between the towns and the regional dialect. I have gone back to Italy recently and there are few people left in those towns that speak the dialect.
Answer: One thing you might try to do is to contact the Comitato per la Salvaguardia dei Patrimoni Linguistici (Committee for the safeguard of the linguistic heritages). This is an association whose goal is to preserve and promote the usage of the regional languages of Italy (i.e. the so-called "dialects").
Their resource page contains some courses and grammars for some of the regional languages of Italy which you might find interesting.
Their contact page can be found here. Unfortunately their website seems to be only in Italian, but hopefully they will respond to inquiries in English.
They also seem to have a Facebook page.

Preserving Italian dialects


What is this soldier's regiment?

Question: Could anyone please help me identify this soldier's regiment
Comment: Can you confirm if it is a British regiment as opposed to a Commonwealth regiment? Canada at least has its own Scottish regiments.
Comment: Well thank you for that Pieter, I did not think of that. I had relatives both in the UK and Canada who fought in The Boer Wars and WW1 and WW2 and this photo was in a family group of photos. My grandfather was in the Field Artillery but there were some of his family who went out to Canada and returned with the Expeditionary Force.
Answer: Based on the socks pattern and what I can make out of the hat pin, this appears to be the Argyll and Sutherland Highlanders of Canada (Princess Louise's), pictured here during the funeral for Corporal Nathan Cirillo:

Hi-Res Link:
The claim is made in the comments that the cap badge here is different than shown on Wikipedia. Wikipedia is clearly in error here (or out of date). Here is a photograph of Cpl. Nathan Cirillo, of the Argyll and Sutherland Highlanders of Canada (Princess Louise's) standing guard in Ottawa prior to his murder. Note the cap badge.
Comment: That was my impression too but cannot think of anyone who was in that Regiment. I will have to dig deeper and see if there was someone I am missing.
Comment: I think it's the Argyll and Sutherland Regiment from Scotland. The cap badge is huge and that regiment had the largest cap badge in the British military. The badge in the old photo doesn't look anything like the five pointed badge of the Canadian version.
Comment: @Daniel: It appears Wikipedia is incorrect. See edit with picture of Cpl. Nathan Cirillo.
Comment: @PieterGeerkens Check this [image](http://media.iwm.org.uk/ciim5/398/432/large_000000.jpg) please. It is an officer of the A&S from WWI. The cap badge shows the similarity to the one in the black and white photo here. Plus the canadian regiment of the same name has a hollow space in the middle of the badge which the old photo badge does not.
Comment: @Daniel: **Both images in this answer are of the *Argyll and Sutherland Highlanders of Canada (Princess Louise's)***. That is unequivocal. Both are from Canadian media - of Cpl. Nathan Cirillo standing guard at the Ottawa cenotaph, and of his regiment at his funeral in Hamilton ON. The socks for the British eponymous regiment are a simpler tartan, and with a much darker red. Check it out.
Comment: @PieterGeerkens Yes, and both images show a cap badge different to the one in the original photo. I wouldn't get hung up on the diced hose as the Scottish highland regiments were wearing the same pattern as the man in the original photo back in WWI which is white background with red stripes and black squares where the stripes intersect.

What is this soldier's regiment?


What are some tips for installing laminate wood flooring?

Question: I'm about to install laminate wood flooring in our family room. The floor is concrete. Having not done this before what tools and tips can you all offer before I get started?
Comment: It would be nice if someone made a blog post about this type of project -- Something like this: http://diy.blogoverflow.com/2012/09/installing-laminateengineered-wood-floating-floors/
Answer: Pick up a kit like this from your local hardware store, it will include every thing you need.
Make sure you measure the room and make sure the last row is not going to be a tiny sliver, it is better to start with a thinner first row than get to the end and realize you are going to have a really thin last row.
Also be very careful when tapping the boards together, if you go to far you will chip/crush the board you are butting up to.  When tapping the boards together be careful not to let the tapping block slip up, because that too will chip the plank.
Oh and don't forget to remove any baseboards before you start, and then measure again without the base boards.
When buying the underlay material make sure you get some that is made for concrete, you don't want moisture wicking up through the concrete into your new floor.
It's also a good idea to pick up an extra box or two of flooring, it could save you a trip to the store in the middle of the project if you underestimated or damage some of the planks during install.  You can always return any unopened boxes when your done.
A miter saw is also very handy.
EDIT:
Be careful when tapping the planks into place, if you don't have weight on the floor or you are not using spacers the whole floor could shift and become crooked (I learned this the hard way).  I was about halfway across the room when I realized the planks that I had previously installed were shifted, if I hadn't caught it I would have ended up with a very crooked floor.
Comment: +1 for a great answer, but also make sure your planks sit inside near where they're going to be installed for at least 24 hours so they acclimate to the temperature/humidity.  also make sure you leave 1/4" all the way around to accommodate the flooring expanding.
Comment: The miter saw is handy, but you're going to need to rip boards as you get along the walls, so I got more use out of a table saw with a rip fence, which I could also use for cutting the boards to length.  You may also need a scroll/jig saw if you have any odd obstructions you're going to need to cut around.
Comment: @joe:  A table saw is great, but can be a little expensive and can take up quite a bit of space.  But if you have the money and room for it, it will definitely make the job easier.  When I did it I made a jig  with a guide/fence that allowed me to slide the planks in, and use my circular saw to rip the planks to the proper width.  As for cutting the planks to length I found the miter saw to be quicker, since I didn't have to adjust anything.
Comment: You can get a decent small table saw (where you have to bolt it down to a table, it doesn't have a stand) for under $200, eg: http://www.amazon.com/Factory-Reconditioned-Skil-3305-01-RT-120-Volt-10-Inch/dp/B001V9K680/  ... or you can rent 'em.
Comment: I've found tapping with a hammer to be rather unnecessary -- Just keep the joints clean.  But, if you do need to tap, sacrifice one board by cutting off about 4" of the trailing end, and from this piece, get rid of the leading edge.  This piece now becomes your "Persuader".  Clip it into the board, and whack away.
Answer: Having done this a few times before, I'd like to stress the importance of crayons -- they come in lots of contrasting colors, so you can see them easily, and they buff off so no one sees the marks when you're done.
We found a 3-person crew was about right for working -- two people dealt with laying the full boards (one hammered while the other one made sure the board was pressed down to seat into the previous one, and to tell the hammering person how much further they had to go), and the third person was responsible for marking and cutting boards at the end of the run.
We tried one person marking, and one cutting, but I found that people mark differently.  (cut on the line?  a little over the line?  How much slop did you leave, etc?)  It was just easier to have the person marking being the same person cutting & laying that board, so they knew how to adjust their markings.
As you want to use the slot side for the block to hit against, at the end of the run you'll want a piece with a tab-end; to mark it, do the following:

Finish the run of boards until you can't fit another full board.
Place a full board on top of the gap, with the tab side towards the wall (ie, backwards from how you'll be installing it).
Mark with your crayon where the board overlaps the last board in the run.
Take the board to your saw, draw a line w/ a crayon and speed square, and cut.

After 1-2 boards, you'll figure out how much of a gap you're getting from drawing your lines; you basically want just enough to drop the board in, and get the little metal pulling bar in there. Once you pull the board into place, you'll have a good 1cm gap because of the space to get the bar in plus the length of the tab/slot joining up.
If you're reading with corners and more complex obstructions, I tended to go with the following order:

Rip the boards if it's part of the starting run.  (doing them all at once, so I set the rip fence once, and they'd all match up).
Cut the boards to length.
Ripe the board if it's going against the ending wall.  (our room wasn't square, so I had to taper the boards slightly)
Determine any other wall obstructions (eg, corners because I'm trying to get into an alcove), and cut to fit.
Mark & cut any other obstructions (pipes for sinks & radiators, in my case.)

As you work, you'll get tired, and start rushing, being more likely to hit the boards harder, or take shortcuts (like using the metal bar against a slotted side; if you really have to as you get up against the wall, put the plastic block down first, then use the metal bar on the plastic block; the metal bar should only be used on a cut end, and even then, you don't want to slam it very hard, or you will splinter the wood.)
We also had a few blemished boards in the pack, so as the two laying the full boards found 'em, they'd mark them with crayon, and I'd try to use them for where I needed cut boards.  (or the ones they mangled because John was rushing too much, and he'd mark which edge was damaged).
Comment: 3 people? i thought this was do-it-yourself :)
Comment: @dotjoe : if you want it to take so long that your knees go out and you can't walk anywhere for a week, sure.
Comment: Thank you Joe, I will have to dip into my daughter's crayon stash before getting started.
Answer: The biggest issue I have run into is laying the transition strips on a concrete floor.  The transition strips consist of a plastic or metal channel, that is attached to the floor, which the finishing piece snaps into.  For concrete floors, it is usually recommended on the package that you use construction adhesive to attach the channel to the floor.  I have found this to be quite unreliable, even when using adhesives meant for concrete.  (over time, without fail, the channels have separated from the adhesive, it may be that I had plastic channels instead of metal).
What worked for me is to use the adhesive, but also a hammer drill to install some small concrete screws to keep the channel attached to the floor.
Answer: I've done this myself in the past, and other than what's already been posted I can only offer three pieces of advice:

Measure carefully (and make sure that you remember to stagger the boards).
Leave an expansion gap around the edges.
Get a jigsaw and workbench if you don't have one.  I spent far too much time sawing!


What are the key features to look for in mobile device apps for hiking/camping?

Question: I've used one of the trail apps and was satisfied, but am looking for something better. What are the features I should focus on for selecting an app?  What bells and whistles are really useful on the trail?
Comment: These http://www.rei.com/category/40006518 and http://www.rei.com/category/4500525 are really useful on the trail.
Answer: In my opinion, the single best feature would be low battery consumption. You only really need a gps and map, so having a low consumption version of these would win for me, possibly with local maps rather than trying to download each section.
Comment: I agree.  Power is the scarcest resource once away from developed areas.
Answer: Battery consumption is determined by the software, too.  Some stuff polls for new data, some takes GPS readings more often then others, etc.
Honestly, I do not consider using a smartphone app for hiking or getting out into the backcountry.  For too many of them you need network connectivity, battery life is a real issue (compared to dedicated GPS devices), and they're fragile.  I do carry a GPS but I keep it switched off unless I need it (or to mark significant spots, after which it's turned off again).  Sometimes I carry a Spot, depending on what I'm doing and where I'm going.
Answer: As Rory says, low power consumption is vital, but that's likely not determined by the software, but rather by the hardware and - more importantly - how you use it.
The three key things for me in Smartphone GPS map systems are these.

Can download maps to the device, rather than stream. (And I wouldn't trust anything claiming to just 'cache' streamed maps, because there's no guarantee that it won't randomly decide to un-cache them again)
Can work with 'real' maps. In the UK this means Ordnance Survey or Harveys.
Display current coordinates in grid system of your choice. e.g. OS Grid, not Lat and Long.

(This may just a long-winded way of saying 'Anything except google maps!')
But really, it depends on how you plan to use it. I travel with map, compass and brain as my primary nav. tools, and keep phone as a backup. On longer hikes it's usually switched off in an Aloksak bag, but on day hikes I may keep it running and recording my track.
FWIW, I use ViewRanger on a Motorola Defy, and I'm very pleased with both. Viewranger on iPad3 looks stunning, but you wouldn't normally want to take one with you on a hike...
Comment: Update 2017: Google maps has been able to cache manually selected areas for a couple of years now. The cache still expires quite quickly but you can check that before you set off. That doesn't mean it's the best option though
Answer: I looked out for these things:

Battery life: Look for additional features like Low Power Consumption mode.
GPS Support (*Usually a common feature in all mobile phones) and accuracy with maps, with maximum support.
Compass
Build quality: Compact, sleek and rugged design, Consider weight and frame (Metal or plastic). Should be easy to handle.
IP Rating: For water resistant index
Camera (Can be an optional parameter to consider, if you already have a better digital/analog camera). And inbuilt image processing quality and camera features?
My personal observation: Pictures taken on 5 Megapixel camera of Nokia are way better than those taken on 5 Megapixel camera of Motorola (Test case: Nokia X vs Moto E 2nd generation).
Also, some of the mobiles have rare features like slow motion camera, which my mobile doesn't have.
Flashlight feature? (Again, almost common in all mobile phones these days)
Does the touchscreen have support for touch with gloves ON? My Lenovo has a mode which I can enable based on whether I am going to use it with gloves or without gloves.
Ability to configure gestures? I can flip my cell upside down to lock it. When I bought my mobile phone, I was considering a Windows phone as well, it didn't have that feature, so I went on to purchase my existing phone (Lenovo). This is one of those features that I use a lot.


How RGB images are formed

Question: I have a noob level question about RGB images-
Pixels in RGB images are in the range of (0-255), so technically each channel ranges from 0(black) to 1(white), then why we say that each image has a Red, Green, Blue channel component, although they are only Gray channel. In short, how the image is formed?
Comment: The red, green, and blue channels aren't grey. They are, respectively, black to red, black to green, and black to blue.
Hold a magnifying glass up to your (LCD) monitor and you'll see the individual channels.
Comment: Do you mean, given an RGB triple, {128, 35, 199}, which is a medium bright purple, why does the 128 affect red?  Because thats how the hardware is wired up.
Comment: Yes @SimonF, I meant that only.
Comment: okay, I have another doubt, maximum of each is represented as 255 then what mystery goes behind each channel that every 255 corresponds to a different color.
Comment: I don't understand your question.
Comment: The value of each channel ranges from 0-255, then what makes them map to each color channels or in other words why each channel's same value is different from each other
Answer: Each channel ranges not from black to white, but from off to full intensity. What colour is meant by full intensity is down to convention and the presentation technology.
For example, a given image file format might say there are three bytes, of which the first is the red channel, the second is the green channel, and the third is the blue channel. There are many different colours, so to be a real standard, it has to say exactly what that "red" means, usually by reference to a particular colour standard such as sRGB or CIELAB. These international standards provide an absolute way to describe colours.
After some processing, your red, green, and blue values find their way to your LCD monitor. There, the electronics uses them to control the intensity of three sub-pixels: one of which is a red filter, one a green filter, and one a blue filter. The 0-255 value in the red channel is turned into some voltage which controls the transparency of the liquid crystal behind the red filter, turning it from completely opaque at 0 to lets all light through at 255. Since this is attached to a red filter, it contributes black or red to the image.
The same idea is everywhere in computers. The only things inside a computer are numbers. They only mean what we say they mean because of conventions (all software interprets them the same way) and/or because they control some values inside some output hardware. e.g. one number means the red channel in a pixel on your screen, another number means a letter of the alphabet in an email, another number is a pressure sample in an audio file which will be sent to your sound card and control the voltage to a speaker, and so on.
Answer: CRT monitors are a thing of the past, but I think they are the best example to describe to you "how the image is formed".
Each pixel on the monitor is actually a group of 3 phosphors. A green phosphor, a red phosphor and a blue phosphor. These phosphors will glow at a certain intensity when they are charged. Inside the monitor there is an electron beam that charges these phosphors. The intensity of which, is determined by the number 0-255 of that channel. So a completely black pixel would not be hit at all, whereas a bright red pixel would only strike the red phosphor, and at a high intensity  (around 200-255). This is, of course, a simplification of the process, but it answers "how" the red channel relates to a red pixel.
Comment: *"bounced off a mirror"*?  IIRC there is no "mirror" in an CRT.   To control the direction of the beams there are charged plates at the back of the 'tube'.  A 'shadow mask' at the screen end stops electrons intended to illuminate, say, a red phosphor from iluminating the green or blue one.  see. e.g. https://image.slidesharecdn.com/rasterscandisplays-140118014413-phpapp02/95/raster-scan-and-raster-scan-displays-27-638.jpg?cb=1390009516

Please correct your post.
Comment: Please look up reflective vs refractive CRT and specifically the Schmidt optical system. Also Texas Instruments had a micro-mirror CRT that was released using mirrors rather than electrostatic deflection plates.
Either way, I don't feel this aspect of the discussion helps the original poster.
Comment: *"Texas Instruments had a micro-mirror CRT that was released using mirrors "*  Do you mean the DLP technology https://www.ti.com/dlp-chip/getting-started.html ? IIRC that wasn't a CRT - it was all optical.

How RGB images are formed


What is a trap function in the context of a genetic algorithm?

Question: What is a trap function in the context of a genetic algorithm? How is it related to the concepts of local and global optima?
Answer: "Trap" functions were introduced as a way to discuss how GAs behave on functions where sampling most of the search space would provide pressure for the algorithm to move in the wrong direction (wrong in the sense of away from the global optimum).
For example, consider a four-bit function f(x) such that
<code>f(0000) = 5
f(0001) = 1
f(0010) = 1
f(0011) = 2
f(0100) = 1
f(0101) = 2
f(0110) = 2
f(0111) = 3
f(1000) = 1
f(1001) = 2
f(1010) = 2
f(1011) = 3
f(1100) = 2
f(1101) = 3
f(1110) = 3
f(1111) = 4
</code>
That is, the fitness of a string is equal to the number of 1s in the string, except f(0000) is 5, the optimal solution. This function can be thought of as consisting of two disjoint pieces: one that contains the global optimum (0000) and another that contains the local optimum at its complement (1111). All points other than these have fitness values such that standard evolutionary algorithm dynamics would lead the algorithms to tend towards the local optimum at 1111 rather than the global optimum at 0000.
That's basically what is meant by a trap function. You can consider variations on this theme, but that's the gist of it.
Answer: This answer already gives the idea of what a trap function (sometimes known as deceptive function) is. However, given that the work on trap functions is not abundant in the literature (at least this topic is not covered extensively in one of my reference books, i.e. this one, on page 211, exercises 11.7, only mentions a specific deceptive function, but does not define what a trap function is), let me also provide you with a few references, in case you are looking for more details and formulations.

Sufficient conditions for deceptive and easy binary functions (1994, by Deb and Goldberg) provides a definition and formulation of a trap function in section 4.1, p. 397, but also many other specific definitions of deceptive functions.

Global Optimization of Multimodal Deceptive Functions (EvoCOP 2014, by Iclănzan), which defines $k$-trap functions in section 4, p. 150

The book Evolutionary Computation 1: Basic Algorithms and Operators also mentions deceptive functions and deceptive problems several times. Moreover, the Python package GA_kit includes a module to evaluate GAs with deceptive functions, in case you learn more by looking or playing with the code.


When Blender crashes during rendering

Question: After asking a good number of questions,
I felt it best that I come with some tips that I have discovered and learnt on my own.
One of the things I've heard is that there are people that have tried to render a video
and that Blender (or CUDA, GPU rendering) would crash and their video file would be corrupt.
This usually happens in Cycles. How does one avoid this?
Comment: Hello Edward thanks for the thorough answer. It is fully encouraged to answer your own question and post your findings on a certain matter for everyone's benefit. However to do so please use the answers section bellow this post, do not answer in the question post itself.
Comment: @DuarteFarrajotaRamos Thanks. I did see the link on "answer your own question" but it didn't explain or give examples on how to formulate the "question" in the question post before the "main article" in the answer section.
Comment: No problem. You can still edit your question and remove all the text pertaining to the answer and paste it below in an answer post. Probably elaborating a bit on your first paragraph to read more like a question is enough
Answer: After asking a good number of questions,
I felt it best that I come with some tips that I have discovered and learnt on my own.
One of the things I've heard is that there are people that have tried to render a video
and that Blender (or CUDA, GPU rendering) would crash and their video file would be corrupt.
This usually happens in Cycles.
How to avoid this?
What I'm about to tell you is no miracle worker.
There is still a chance it dies depending on how complicated your scene is
and how much memory your computer or video card has.
To begin with, set all your rendering options according to what you want.
Make a few still image renders here and there to make sure you are satisfied with the quality.
In Output set where you want the result to be saved to and give it a name and a period (.) but without setting an extension (png),
check File Extensions, but uncheck Overwrite, Placeholder and Cache Result.
Set the format to PNG, and Compression to 100%.
Yes, we are writing image sequences here. Even the most professional Blender Gurus
with the most powerful of computers do this. This is to ensure that no matter what happens,
be it that the OS decides it has had enough or power failure/outage,
what you have rendered so far is safe and sound and you can pick it up right where you left off.
Another option you can check in Performance to save on RAM is to check Save Buffers.
Now that all that is setup, Close Blender!
To ensure that there is enough memory to render our video
we do not want Blender's GUI to be using any of it, and if possible, not even the Desktop.
What we are going to do now is write a little script file that is going to render our video.
Linux Bash Script
#!/bin/bash
cd "/path/to/blender/"
for i in {1..250}
do
   foo=$(printf "%04d" $i)
   if [ ! -f "/absolute/path/to/project/imgseq/video.$foo.png" ]
   then
      ./blender -b "/absolute/path/to/project/project.blend" -f $i
   fi
done

Lets go through this step by step.

The first line #!/bin/bash is pretty much the header telling Linux this is a bash script
and should be interpreted as such.
Next we Change Directory to wherever you have Blender installed cd "/path/to/blender/".
Now we create a for loop in which we iterate over the number of frames your animation has,
in which i holds a number from 1 to 250. Don't forget the do right after that.
The command foo=$(printf "%04d" $i) creates a formatted string where the number i gets 4 leading zeros. Remember that Blender will name the file with 4 leading zeros.
Next we test if a file with your video name that you set in File Output plus the frame number and png does not exists.
The ! in front of the -f is a negation so one would read it as 'if not a-file "video.number.png", then...'
This will ensure that Blender will not be launched to render this frame if the frame already exists.
So if this frame has not been rendered, launch blender (./blender) in the background (-b) and render the blend file
("/absolute/path/to/project/project.blend") on frame i only (-f $i).
Finally, end the if block with fi and our for loop with done.

Save this file somewhere, maybe with your blend file, and call it something simple like render.sh.
Make sure it is executable by doing sudo chmod 755 render.sh.
When you are ready to leave your computer running for hours on end, open a terminal or drop to a tty
(Ctrl+Alt+F1 - F6),
navigate to this render.sh and run it (./render.sh).
How to stop it?
If you want to interrupt your rendering at that moment, hold Ctrl+C
until Blender isn't trying to restart itself anymore.
If you want Blender to finish off its current frame, open a new terminal or jump to a different tty,
type in ps -A |grep render.sh or whatever name you gave your script, make note of its number
and type in kill number, and wait until Blender is finished.
Windows Batch Script
echo off
C:
cd "C:\path\to\blender"
for /L %%i in (1,1,250) do (
  set 'foo=0000%%i'
  set 'foo=!foo:~-4!'
  if not exist 'C:\absolute\path\to\project\imgseq\video.!foo!.png' (
    blender.exe -b "C:\absolute\path\to\project\project.blend" -f %%i
  )
)

Pretty much the same principle as the shell script, but lets go through it anyways.

The first part is optional. This will ensure that the whole script is not printed on screen each time a frame is to be rendered.
After that, C: ensures that we are in the drive that Blender was installed to.
Next we change directory to wherever you have Blender installed with cd "C:\path\to\blender".
Now we create a for loop in which we iterate over the number of frames your animation has,
where /L tells for that we are looping through numbers, %%i shall hold these numbers,
within the range of (start, step, end). Don't forget do ( at the end of this.
We then set our zero padding to %%i using the two lines set 'foo=0000%%i' and set 'foo=!foo:~-4!'.
The first adds the zeros and the second makes sure there are only 4 digits in total. Remember that Blender will name the files with 4 leading zeros.
Next we test if a file with your video name that you set in File Output plus the frame number and png does not exists.
Notice the ! surrounding the foo which is our zero padded %%i.
Unlike the shell, batch uses not instead of ! to negate what we are testing for.
This will ensure that Blender will not be launched to render this frame if the frame already exists.
So if this frame has not been rendered, launch blender.exe in the background (-b) and render the blend file
("C:\absolute\path\to\project\project.blend") on frame i only (-f %%i).
Finally we end the if and for blocks with a ) each.

Save this file somewhere, maybe with your blend file, and call it something simple like render.bat.
If you want the console window to stay open, press the Window Key, type in cmd and enter,
navigate to where this render.bat file is and simply run it by typing in render.bat.
If you don't mind it closing when it's done, simply double-click render.bat.
How to stop it?
Pressing Ctrl+C, Y and Enter will stop the loop, but Blender will continue on its current frame.
To stop Blender itself one would go into Task Manager, find blender among the Processes and End Process.
To stop it all, simply close the terminal (x).
Mac OS
As far as I can tell, Mac uses the same bash script as Linux, but if I'm wrong do let me know.
Additional Thoughts
Some of you may be noticing that this method will close and re-open Blender for each frame rendered,
and you are probably wondering "Won't this put a strain on the computer?"
Not necessarily. I have noticed that if I were to run Blender in the background and include -a
to render the whole animation in one sitting, it won't clear the memory properly between frames
and one would run into memory problems.
By closing Blender after each frame it will clear all of the memory (if not 99%)
and leave plenty for Blender to take care of the next frame.
The only factor that may interfere with this is how well your OS manages memory.
"What if I just give my project to a Render Farm like Sheep-It?"
That is a possibility if you need to use your computer for other things in the mean time,
but there are a few factors to consider which would make this difficult.

In the case of Sheep-It you can only upload 500mb, so if your project has a lot of textures or cached dynamics
that exceed this limit, even compressed, this will not work.
If your project takes a long time to render you'll run out of points,
and based on that system your project will get less attention, and thereby take longer to complete.
You are part of a studio of some kind and doing this may violate any agreements you have with your boss.
You yourself want to keep this project a big secret and you do not want the slightest bit of exposure until it is done.
Your project contains questionable material that may violate the Render Farm's terms.
You want to render your project in a special or non-linear way.

Render Farms like Sheep-It pretty much does the same thing as the scripts above.
Get the project, check what frame hasn't been rendered, then tell Blender to render that one frame in the background, then close.
Although because there is a little shuffling involved, projects will be downloaded and deleted several times
as well as Blender being re-opened and closed.
"My Blender project contains audio. Can I render that in the background?"
As far as I can tell, you cannot. That would've been a handy command to add at the end.
Sadly, you'll have to open Blender and click the Audio button in the Render panel and wait.
So, now that your rendering is complete and you have a long list of PNG files,
you'd like to turn them into a complete video. There are a number of ways to do this.
The first and foremost way would be to put them into your video editing software
so that you can apply any extra visual effects or sounds that are needed.
If you want an mp4 as soon as it is all complete, you could add the following to the end of your script:
ffmpeg -r 24 -start_number 1 -i "/absolute/path/to/project/imgseq/video.%%04d.png" -f mp4 -crf 15 "/absolute/path/to/project/imgseq/video.mp4"

This will of course work if ffmpeg is installed and recognized as an internal command.
If not you'll have to Change Directory to where ffmpeg.exe is hiding just before this command.
The first part of this command -r 24 sets the frame rate. Be sure it is the same one you set in Blender.
The next part -start_number 1 tells ffmpeg that the image sequence starts at 1. If your video actually starts at frame 0, you can skip this part.
The -crf you can change to 0 if you want 100% lossless compression, but that would be a huge video.
For any other video format, feel free to look them up on your own.
Hope this helps you in rendering your massive projects.
If the CUDA still gives up half-way through a single frame then the only thing I can think of is that
there isn't enough VRAM or there is a Shader that your GFX card does not like.
You can experiment and see if CPU rendering works any better, even if it is slower.
/Edward
(blender 2.79)
EDIT It has come to my attention that sometimes the console in Linux (tty) can be a bit slow if it halts execution as it refreshes the screen for a new line. This can be a problem if your project has a lot of objects and textures, and printing out each line takes far too long. One way to speed things up is to add  | grep Remaining to the end of the ./blender line or after typing ./render.sh.

When Blender crashes during rendering


producing kefir grains from commercial kefir?

Question: I had previously been buying commercial kefir, and then started adding milk (actually half and half) when it ran low and leaving it out to produce more kefir with good results (at least compared to the commercial stuff)   I have some kefir grains coming in the mail so this is really just out of curiosity.  Can you leave kefir out longer than usual to produce kefir grains?  In other words using the technique described above but instead of refrigerating after 36 hours or so, continue to leave it out at room temperature,  will this produce kefir grains?  Or using home made kefir and doing the above, can you produce grains that way?
Answer: The dynamics of the Grain growth are not currently well understood, much less its formation. Some researchers attempted to create grains in laboratory, but failed.
There are over thirty or fourty strains of microbes in the kefir, and their ecological relationships are very complex. One could call the whole kefir culture an ecosystem of its own.
The grains grow either because the matrixes of existing grains entice the microbes to create more grain matrix, or because there are specialized microorganisms inside the grain that are responsible for creating more grain.
What is known is that the grains need Kefiran to grow, and Kefiran needs Alcohol in its synthesis. Commercial cultures of kefir often omit the alcohol-creating yeast for obvious reasons, so it too adds to the impossibility of getting Kefir grains from commercial kefir.
Either way, the fact is there grains do not come into being on their own. New grains are split from existing grains.
There is a small possibility that a kefir culture from grains that was strained could form new grains, but its not confirmed.
The commercial cultures are sold with around five to ten strains, much less than full blown kefir grains. They won't form grains, since the strains were hand-picked in lab by their function, and probably the grain-forming ones were left out.
Answer: Store bought kefir is made with a powder and thus will not produce grains.  When you are making kefir (milk or water) at home the product is quite different as you actually have to strain the grains out.  I've had much better experience with water kefir than milk kefir (with respect to grain reproduction).
Answer: I have successfully produced kefir grains from about a teaspoon of dried commercial kefir  from Ukraine. It was just dried on a cloth for a week or so of transit and then carefully rinsed out again with milk.  It took a few weeks of adding more milk and sieving off every couple of days to get there.
Over the last year though, my grains haven't expanded much so I'm not sure if I've figured out the optimum conditions for grain growth. The nature of the grains has become more yellow. When I first grew grains they were white.
One strain I have produces a thick cottage cheese consistency and cheesy taste kefir, especially if I tip off the whey and feed it with another batch of milk before straining it.
Comment: This is more of a new question than an answer. Suggest you ask a new question.
Comment: It sounds like this is both an answer and a new question. You should indeed ask about conditions for grain growth in [a new question](http://cooking.stackexchange.com/questions/ask) so people will be able to post answers.


If I were to convert a gas powered automobile to an electric car, would a difference in specs possibly damage the car?

Question: I would like to convert a Mazda Miata into an electric car, I plan to remove the engine and the gearbox, and have the car be a direct drive. The motor I intend to use has twice the torque of a standard Miata. If I were to use this motor, would the high torque damage the vehicle? Are there other issue I should be aware of, before going through with any conversion? Is there some way to avoid such issues?
Comment: DC or AC motor? What's the RPM limit on the motor? What's the tire size? What's the final drive (ring and pinion) ratio? What range and top speed do you want?
Comment: Is there a specific setup you're looking at that you could possibly link some specs? So we can have a better representation of what may or may not be included... Also, what year is the Miata?
Comment: I just ran into this question now.  Did you make any progress with this project?  I'd love to see a blog or some sort of write-up with results (or lack of?) achieved.
Answer: If you were to simply replace the existing petrol engine with an electric motor, then yes, it would ruin the gearbox very quickly, as it won't be able to handle that amount of torque.
However, even if the transmission would cope, that wouldn't be the best way of doing it - an electric motor has a very different torque curve to an internal combustion engine, so you would need to replace the gearbox anyway. The fundamental point of a car gearbox is to convert the very narrow torque curve of an IC engine into something usable over the full range of road speeds. In theory, a suitable electric motor wouldn't need a gearbox at all (those used in trains, for example, generally drive the axles either directly or through a fixed geartrain), as it;'ll have a much wider torque curve.
If I were converting an existing car to electric, I'd remove the existing engine and gearbox and attach a suitable motor to the differential input shaft, keeping the diff for the final stage so that only a single motor would be required, and to avoid adding to the unsprung mass. The motor should fit in the space previously occupied by the 'box, leaving the entire engine bay free for batteries...
Comment: Thanks for the great point, I should have clarified that i intend to make the conversion direct drive, by removing the engine and the gearbox. Once that's the case what recommendations would you share?
Answer: I can't see you having many issues with power handling once you have removed the transmission. The driveshaft, diff and axles should be able to handle just about any torque you throw at them unless you start really getting above 400-500 ftlbs or something like that.
I bet the biggest issues you would have with this project would be ECM related and getting the electronics to work without freaking out that there no longer is any oil/trans pressure, temperature, rpm, etc.
Also are you going to convert the vehicle to a mechanical steering rack or somehow run a power steering pump separate? Again same with heating/ac you would lose those or have to replace them with an electric equivalent. Basically anything belt driven has to be removed or replaced.
If the accelerator is cable operated you will have to convert that somehow to an electrical signal to go to your speed controller.
I bet trying to get regenerative braking to work would be very difficult and advanced.
Have lots of money in the bank before you start this project.


Is there a way to have Google Calendar scroll to normal hours by default?

Question: When I open up a day in day view for Google Calendar, it starts at 12AM, which means I can't see any of the real stuff in the day until I scroll down. Is there any way to make it auto scroll or just offset the day somehow so the normal "awake" hours are shown?
Comment: Actually it does not always jump to 12AM.
It jumps to the current time, which I think is a good behaviour.
Answer: Effective October 2011, there is a feature in Google Calendar Labs called "Hide morning and night" which lets you minimize the wee hours of the morning and the late hours of the evening if you never have much of anything in them.
Click on the "Settings" gear, then "Labs" and enable "Hide morning and night".  When you save it, you'll get additional options in your settings to specify what hours should be considered "night."
Answer: Nope, not according to Google Calendar settings.
There could be a way to manipulate the page through some Greasmonkey scripting, but as to the code for it, it would be better suited for Stack Overflow.
Comment: No if somebody could find this script :)


How can hotspots support more people than the number of IP's allowed in a typical IPv4 IP Range?

Question: What happens when there are 259 people active on a network? Will the hotspots just move to another local IP range? My original thought was it would just start kicking people off, but I see hotspots used in schooling environments all the time where there are 1000s of people accessing the network... If it just kicked people off would make the system virtually useless.
Comment: I don't think 'typical IPv4 IP range' means what you think it means...
Answer: It works depending on the netmask, by example:
By example, if the netmask is 255.255.253.0 you would be able to use IPs from 192.168.0.x to 192.168.2.x
Comment: Precisely. It depends on the subnet that you are willing to assign to your Wifi DHCP users and the number of access points/controllers you have in your infrastructure.
Comment: what? 3 upvotes for a wrong answer?? this is not a valid netmask! 192.168.0.0/23 will go up to 1.255 and with a /22 to 3.255.
Answer: First, though the theoretical limit of the 802.11 standards is what, 255 clients? In reality, you'll get nowhere near that. In large deployments that I've seen, anything over say 50 clients per AP and performance starts to degrade significantly.
Second, in large deployments, you will have a flock of APs that are managed by a single (or cluster of) wireless controllers. These controllers often have several subnets that they can assign clients to.


Can I get expired rebate checks reissued or deposited?

Question: There are a few Newegg rebate checks that I recently found, where I had forgotten to cash them and its been way past the usual validity printed on the check. I understand that honoring the 'valid until' signage is upto the issuing bank, but other than just taking my chances to deposit these, is there a better way to make sure I can get them deposited?
Answer: Your best bet would be to contact Newegg. A brief search on Google for "Can I cash an expired rebate check?" returned mixed results.
Some say that you can't. While others say they have been able to.
So your best bet is to contact Newegg - or just take them to your bank to deposit, the worst that can happen is the bank says they can't take it.
Answer: In general, for an old (expired) check, you should first try and contact the issuer (which may be a Rebate processing firm, not the retailer) to have them re-issue the check. If you can't find contact information for the rebate processor, the retailer can probably get you pointed in the right direction if they don't handle it themselves, though it wouldn't surprise me if you needed to get transferred around a bit to find somebody who can help you.
Another place to check, especially if it's been several years, is your state's Abandoned Property office. Most states require that abandoned property be turned over to them, and rebate checks in some circumstances qualify.


terminal on real android device from PC

Question: I want to run terminal on my device however the small screen is very inconvenient. I wondering if it is possible to run terminal on real android device from PC?
Comment: Yes, you can install a ssh server in the device. There is another thing called adbd for doing that, but that's a developers thing.
Comment: Could you please explain more, how can I use it?
Answer: You can use Android Debug Bridge (ADB) shell to issue basic Linux commands on your phone, just like you would in a terminal emulator app. To install you'll need to do the following:

On the phone go to Settings -> About phone, and tap on "Build number" seven times.  This enabled Developer tools.
Go back to the main Settings screen and you should now see Developer options under the "System" section.
Go to Developer options, enable "Android debugging" option, and then tap OK on the verification prompt.
On your PC download the Android SDK Tools from here. You can either download the whole SDK, or just the stuff necessary to connect to your phone, which is on the same page, under "Download for other platforms -> SDK Tools Only" section.
Install the tools you just downloaded.
Download and install the USB drivers for your phone (usually provided by the manufacturer.)
Re-connect your phone to the PC with a USB cable.
Open Command prompt (assuming Windows,) navigate to where you installed the SDK tools (e.g. "C:\android-sdk\platform-tools\") and type in the following: adb devices
If all of the above was done successfully, a prompt should pop up asking you to allow connections from this computer.  Accept the pairing request, and the prompt should show your phone's ID.  If this doesn't happen - it usually means that the drivers aren't installed correctly.
Back at Command prompt, type in adb shell and press Enter, and you should be connected to the phone's terminal.

This should get you started.  ADB commands are listed on Google's site here.  The shell provides some basic Linux commands like ls, cp, etc.  Be aware that most file and device management commands will require root (i.e. elevated privileges,) which is a separate topic.
Answer: Alternatively to the ADB variant described by Chahk (which requires at least a minal installation of ADB on your computer), you can install a SSH server app on your device (examples include, but are not restricted to, SSH Server, DigiSSHD, Servers Ultimate). Then you can use the ssh command on Linux/Mac, or a tool like PuTTY on Windows, to connect to your device and run shell commands, as if you were using a terminal app on the device itself.
Comment: Hi Izzy, I installed PuTTy and SSH Server and defined server name and port on the server. Then I connected the phone to the PC by USB, however connection fails: "host does not exist". What can I do?
Comment: Setting up the host (DNS) correctly? Without knowing the command you executed, I can only guess. First try with the device's IP (i.e. enter your Android's IP address in PuTTY) to see whether it works at all. How to make that work with DNS from your computer (so you can use an easy to remember name instead of the IP address), is a question better fitting on either [Super User](http://superuser.com/) or [Server Fault](http://serverfault.com/) (check their repective `help/on-topic` pages first where it fits best).
Comment: Sorry, I asked you wrong question. The proper one is how I could check IP address of the device?
Comment: It should be shown in *Settings→About device* (on my ICS device, in the *Status* sub-section as "IP address"). Apart from that, your router should show it on its management console. The hard way would be "pinging" your entire local network to check what responds, or doing a port-scan ;) There are also a bunch of device-info tools available (recommendation: [OS Monitor](http://www.appbrain.com/app/os-monitor/com.eolwral.osmonitor): it offers many useful helpers, apart from showing all IPs of your device {WiFi, mobile, local,...}).
Answer: You will need
Your Android phone ( Rooted and with Wi-Fi functionality )
SSHDroid (SSH server)
PuTTY.exe (SSH client)

Setup SSHDroid
    Install "SSHDroid" from android market to your phone this will turn your phone into a SSH server

    For the first time you need to set-up a password to log-in shell. Default password is admin which may you have to change on first time

Setup Putty
    Download PuTTY.exe for SSH Client on your windows PC, it comes in single executable file so you don't need to install that just double click on that and PuTTY will start.

    There is no need to setting up any thing in PuTTY.

Let's start
First step is to running Wi-Fi and connect your android phone to target PC, then run SSHDroid server into your mobile phone, but before that make sure under the SSHDroid's application window click Options -> "Require WiFi" is checked as seen on above pic screen 2. And then click "start" option.
Once SSH server is successfully started it will show IP address of your mobile phone in light sky color like this firstname.lastname@example.com as seen on screen 4.
Take the IP "192.168.43.129" and type it to your PuTTY program's (PC) host field and hit connect. Make sure port number is 22 as seen in second pic.
It will ask for certification click ok and then command line log-in window will appear, type "root" hit enter and then type the password for root user, default is "admin" as i mentioned before. After successful log-in you will be able to use Linux commands like ls, reboot -f, mkdir, find, etc.

if your phone is connected to internet you can also use network commands like ping, wget, telnet etc.
Source : - How to connect android phone to PC using SSH & putty

terminal on real android device from PC


Can/do representatives move between the senate and the house in US congress?

Question: Are there examples of individuals moving between the Senate and the House in the US government (specifically in the past 20 years)?
Comment: What are you looking for, specifically?  Senators who have become Representatives?  Representatives who became Senators?  Or physically traveling back and forth?
Comment: @Bobson I'm looking to get a sense of how common it is for senators to become representatives, and/or representatives to become senators - whether it is something which quite regularly occurs (possibly even normal career progression), or is highly unusual / rarely occurs
Comment: My understanding of it is that Representatives do sometimes run for Senator, but a Senator doesn't ever switch to being a Representative.  But I couldn't tell you how often it occurs.  Good question!
Answer: Yes, people serve in both the house and the senate. I can't find a list that only lists those that have served in both, but this list of congressmen and women that have served the longest shows plenty of examples of people that have served in both:
https://en.wikipedia.org/wiki/List_of_members_of_the_United_States_Congress_by_longevity_of_service
Just a few from the the list that are currently serving:

Ed Markey
Chuck Grassley
Thad Cochran
Answer: It would be highly unusual for a Senator to become a Representative.  Note that there are one hundred Senators and four hundred thirty-five Representatives.  So a Senator is about four times as influential in the Senate as a Representative is in the House.  Also, loss of seniority would be a problem.  The new Representative would start over in the House.  The two chambers are themselves comparable in influence, although there are some differences (e.g. tax bills need to originate in the House; only the Senate reviews presidential nominations and treaties).
Loss of seniority is also a problem when switching from the House to the Senate, but the increased influence of a Senator compensates.  You ask for recent examples.  There were eight new Senators who had been in the House in 2014:

Tim Scott
James Lankford
Tom Cotton
Cory Gardner
Bill Cassidy
Gary Peters
Steve Daines
Shelley Moore Capito

There were also six new Senators from other sources:  Mike Rounds; Thom Tillis; Ben Sasse; Joni Ernst; Dan Sullivan; and Brian Schatz.  That's a total of eleven new Senators in thirty-three regular elections plus the three mid-term replacements.  Anyway, over half of the new Senators were from the House.  That's consistent with the 2012 result, when seven of fourteen were from the House.
In 2010, there were three new Senators who had previously been in the House but weren't at the time of their Senate election:  Dan Coats; Rob Portman; and Pat Toomey.  Including those three, that would be eight of eighteen in 2010.  That's half in three elections.  But in 2008 and 2006, only three of ten were in each (six of twenty total).  One of those was 2016 Presidential candidate Bernie Sanders.
Comment: I know this is late, but another problem to add to your list would be that Senators stand for reelection every 6 years, while Representatives have to be reelected every 2.  So theoretically there's some level of job security in the Senate.
Answer: It is very common for Representatives to become Senators. It is so common that it would not be work giving examples.
It is uncommon, but not unknown for Senators to become Representatives. Claude Pepper was a Senator from Florida who was defeated and returned to Congress as a Representative. John Quincy Adams served as Senator, then President, then Representative. Henry Clay was a Senator, the speaker of the House, then Senator again. (This is not a complete list. There are some others I know of as well.).
This switch has not occurred recently.


How can I calculate how much RAM an object uses?

Question: I have a HashMap that contains 12 million entries. It maps String values to Long values. Each string is about ten characters long. Is it possible to calculate how much memory this map will need in RAM?
Comment: Do you need an accurate answer, or are you looking for a very approximate answer, possibly to decide whether or not to use a disk-based approach for this lookup?
Comment: You can try adding a bit less at first, like 1 Million, them make use of jmap -histo  (located in your JDK bin directory) to give you the memory usage of your HashMap, Strings and Longs.
Comment: [This question might help.](http://stackoverflow.com/questions/1425221/how-much-memory-does-a-hashtable-use)
Answer: You can guess, and you can make an educated guess by looking at the size of each item that goes into the map, but your best educated guess will be wrong.
JVMs have other structure used to track references and hold type information for the classes.  That will add a fixed, yet unknown amount of memory to an accurate (if you can come up with an accurate input estimate) estimate.
As only some of the memory is memory directly holding the data, and some of the memory is memory used as overhead to hold the data, you need to profile your memory consumption and based your estimates on projections of the memory "growth" when using smaller maps.
Note that profiling a JVM is a tricky task, as it is optimizing memory usage in a manner that will present varying results depending on how long the JVM is running, the activity of the Map, etc.  You need to do statistical sampling of the input in a variety of conditions; but, odds are good you will eventually be able to put your finger on a reasonable number.  More importantly, you will also be able to say "Well it might peak up at around this number temporarily, but should settle down to this on average".  Temporal changes to memory are often overlooked in static analysis.
Answer: The JVM would know because it has to allocate and manage memory but it doesn't tell you. So, short of going native, no, there is no way to know how much memory is actually used by your objects.
Answer: A profiler will tell you how much memory is being used by the program, and which objects are using what. You might be able to find your objects' memory usage.
VisualVM is included in Java6, and will give you this information.
It's worth mentioning, though, this is not necessarily going to give you a memory 'requirement', just a view of how much memory it is using at that point in time.