glTranslate/rotate/scale vs Matrices in uniforms

Question: I'm working on a 3D game engine, and I've been using a shader with a mat4 uniform to send transformation info and camera info to the pipeline. I've seen examples online where people have been using only the glTranslatef(), glRotatef and stuff like that. Which method is the most accepted method?
Comment: Matrices in shader are not comparable with glTranslatef(),glRotatef() because these methods are just concept used in tranforming. and matrices in shader codes can be anything. In OpenGL, there are two pipelines fixed and programable first case is the fixed type and using shader is much more flexible.
Answer: You're better off using the uniforms in shaders going forward, as the functions like glTranslatef(), glRotatef(), etc. are part of what's known as the "fixed function pipeline". The fixed function pipeline is deprecated in modern OpenGL, meaning your code that uses it will not work with newer versions of OpenGL and OpenGL ES. There's a discussion of the implications here.
Answer: The above answer really is correct, and to be honest, I think the biggest drawback to using the old system is it's not flexible enough and you cannot do as many fun things with shaders. The new pipeline is all about allowing the programmer access to the shaders that control the data that is sent through the GPU, and as such, the new "standard" requires you to pretty much do all the hard stuff yourself. Besides actually rasterizing the vertices of course!


DirectX Font tutorial that doesn't use GDI

Question: Does anyone have any tutorials/info for creating and rendering fonts in native directx 9 that doesn't use GDI? (eg doesn't use ID3DXFont).
I'm reading that this isn't the best solution (due to accessing GDI) but what is the 'right' way to render fonts in dx?
Answer: Why this isn't a good solution?
Mixing GDI rendering and D3D rendering into the same window is a bad idea.
However, ID3DXFont does not use that. It uses GDI to rasterize the glyphs into a texture. And uses that texture to render the actual text.
About the only alternative would be using another library (e.g. FreeType) to rasterize glyphs into a texture, but I'm not sure if that would result in any substantial benefits.
Of course, for simple (e.g. non-Asian) fonts you could rasterize all glyphs into a texture beforehand, then use that texture to draw text at runtime. This way runtime does not need to use any font rendering library, it just draws quads using the texture. This approach does not scale well with large font sizes or fonts with lots of characters. Also would not handle complex typography very well (e.g. where letters have to be joined etc.)
Answer: ID3DXFont is a great thing for easy to use, early, debug output. However, it does use the GDI for font rasterization (not hardware accelerated) and there is a significant performance hit (try it, its actually very noticable). As of DirectX 11, though, fonts will be rendered with Direct2D and be hardware accelerated.
The fastest way to render text is using what's called "Bitmap Fonts". I would explain how to do this, except that there is a lot of different ways to do implement this technique, each differing in complexity and capability. It can be as simple as a system that loads a pre-created texture and draws the letters from that, or a system that silently registers a font with Windows and creates a texture in memory at load-time (The engine I developed with a friend did this, it was very slick). Either way, you should see a very noticable performance increase with bitmap fonts.
Answer: With DirectX, the correct way to render standard fonts is with GDI.
However, IF

You want to support cross platform font rendering
with proper support for internationalization - including far eastern languages where maintaining a glyph for every character in a font is impractical
and/or You want to distribute your own fonts and render them without "installing" them...

Then libfreetype might be what you are looking for. I don't claim its easy: Its a lot more complex than using the native font api.
Answer: Personally I think that ID3DXFont is the way to go.
If you really wanted to make your own font routines, I suggest you look at:
http://creators.xna.com/en-us/utilities/bitmapfontmaker
You can use this to create a bitmap with all the characters printed on it.  Then its just a matter or loading the texture and blitting the relevant chars onto the screen at the right place. (This is what XNA uses for its font drawing)
Its a lot more work, but you don't need the font to be installed on the target PC, and you have the advantage to being able to go into photoshop and edit the font appearance there.


How did "quantum" come to mean "smallest amount"?

Question: In Latin, it simply means "an amount", which can be of anything and of any size. In modern English, especially in physics, it means the smallest amount physically possible, i.e. a physically indivisible amount of something, especially pertaining to energy.
Comment: @StuartF: *Wikipedia* does not answer the OP's actual question. The answer is that Planck did not use *Quantum* for the *smallest* amount physically possible, he used *Elementarquantum*. Around two decades later, physicists started abbreviating *elementary quantum* by *quantum*.
Comment: Wikipedia has a good story for how Planck's paper came to be, and the name of the problem: [The Ultraviolet Catastrophe](https://en.wikipedia.org/wiki/Ultraviolet_catastrophe).
Comment: Have you done any research? Wikipedia has a lot to say in its article https://en.m.wikipedia.org/wiki/Quantum
Answer: If you look at Max Planck's 1900 paper (originally in German:  Zur Theorie des Gesetzes der Energieverteilung im Normalspectrum) where etymonline
claims he introduced the term, he didn't just use "quantum," he used "elementary quantum" (Elemantarquantum in German); that is, the most basic (i.e. smallest) quantity of electric charge.
And Max Planck wasn't even the one who introduced the term in German; I can find quite a few occurrences of Elementarquantum in the 1880s and 1890s, and a few before that.
Rather than using "elementary quantum" every time they wanted to refer to one of these things, physicists started abbreviating the term. Already in this 1905 paper of Einstein's (for which he got the Nobel Prize), he just uses the words Energiequant and Lichtquant (energy quantum and light quantum in English). And at some point in the early 1920s, nearly all physicists stopped using the term "elementary quantum" entirely and called these things  "quanta". You can see this happen in this Google Ngram.
Answer: The idea of a "small quantity" was introduced at the beginning of the 20th c. by German  physicist Max Planck:
Quantum:

The word was introduced in physics directly from Latin by Max Planck, 1900, on the notion of "minimum amount of a quantity which can exist;" reinforced by Einstein, 1905. Quantum theory is from 1912; quantum mechanics, 1922.

(Etymonline)


Ocean Protocol: Decentralized Big Data Sharing and Artificial Intelligence

Question: Ocean Protocol claims that it created a "decentralized data marketplace" using decentralization of data sharing by blockchain. They say that their platform can be used in Artificial Intelligence. However, the amount of data employed in Artificial Intelligence is hugely big in size. (Please have a look here, where it introduces this protocol.)
One of the serious questions is that where does data get stored, especially, when the sizes of data are huge? The Ocean protocol white paper answers this question as follows:

Ocean itself does not store the data. Instead, it links to data that
  is stored, and provides mechanisms for access control. The most
  sensitive data (e.g. medical data) should be behind firewalls,
  on-premise. Via its services framework, Ocean can bring the compute to
  the data, using on-premise compute. Other data may be on a centralized
  cloud (e.g. Amazon S3) or decentralized cloud (e.g. Filecoin). In both cases it should be encrypted. This means that
  the Ocean blockchain does not store data itself. This also means that
  we can remove the data, if it's not on a decentralized and immutable
  substrate.

So, Does not it mean that Ocean blockchain cannot provide immutability of shared data?
Answer: You are correct. Ocean itself does not store the data, so it has no control over whether the data is stored immutably (or not).


How to group Windows desktop icons like Android?

Question: I see this has been asked and answered before but I am more interested to see if there are Windows apps where we can group desktop icons like Android allow, rather than using a macOS Launchpad experience on Windows.
Comment: This question is inaccurate. You can group icons with just folders. Are you also asking for an app that shows a popup? Or what's the feature that's missing for you? Questions shouldbe self-contained.
Answer: Create a New Folder, drag and drop all the shortcuts you want into the folder. Optionally you can change the icon of the new folder to whichever icon you like.


Can one make a siyum on "shas bavli" if he did not also finish the masechtos mishnayos that do not have gemara bavli on them?

Question: I have heard that to make a siyum on shas bavli one must finish shisha sidrei mishna (and all bavli that there is). Is one required to learn the entire shisha sidrei mishna as well as all of the existing talmud bavli or can one say the hadran on shas bavli with the full daf yomi masechtos?
Comment: You are right - thank you- i guess that was part of the question effectively answered/explained by the post below.
Comment: What does "shas bavli" mean?
Comment: How about machetos ketanos?
Comment: I saw this question asked to Rav Chaim Kanievski. There are about a thousand sefarim that could be in, though.
Answer: From this site:
"This celebration is commonly referred to as the "Siyum HaShas," but technically speaking, this term is inaccurate. The word "Shas" is an acronym for the words, "Shisha Sedarim," referring to the six sections of the Mishna. The Daf Yomi program completes the entire Talmud Bavli, but the Talmud Bavli does not cover all six sections of the Mishna. For example, there is no tractate of Talmud Bavli on the section of Zera'im (with the exception of Masechet Berachot), or on most of the section of Taharot. Therefore, when reciting the "Hadran" text at the Siyum celebration, one should ensure to recite "Talmud Bavli," and not "Shas" or "Shisha Sedarim." "
Comment: It does cover all six _s'darim_. Not every _maseches_, though.

Can one make a siyum on “shas bavli” if he did not also finish the masechtos mishnayos that do not have gemara bavli on them?


"Hold Out Promise" vs "Make a Promise"

Question: Is "hold out a promise" the same meaning as "make a promise"?  Or did I misunderstand them?  I found definitions for "make a promise", but couldn't find definitions for "hold out a promise".
Answer: Jon is correct, and I am such a beginner that I hesitate to horn in here, and I do so only to make certain that the answer is absolutely clear. Please pardon the intrusion.
It's a bit confusing because there are two verbs used, but neither is used as they normally are. "Make" a promise? "Hold" out a promise?
To make a promise is a common expression meaning that you have vowed to another person that you will follow through on certain matters, such as your intent to marry her, or clean the front yard, or go grocery shopping. It is a direct declaration between two or more people.
On the other hand, to hold out a promise refers to a situation that appears to point to a particular conclusion, that a promise will end in a certain way. The three-week-old milk bottles held the promise of containing rotten milk, so we threw them away.
Comment: No intrusion; this adds more than was in the first two answers. It's also a good answer. +1
Comment: You're essentially right, but I'm not upvoting because your final example doesn't seem very good to me. In *X holds out the promise of Y*, it's almost universally the case that *Y* is something ***desirable***. If you edit for a better example, I'll happily upvote.
Answer: Something can "hold promise," meaning that it may offer the prospect of beneficial but not yet realized consequences. A person may "withhold a promise," meaning that the person declines to become duty-bound to perform something. And of course a person can "hold out X" in the sense of extending X in his or her hand. But the phrase "hold out a promise," I think, lies in a murky realm of its own, apart from those relatively clear alternatives.
The likeliest intended meaning of any contextless instance of "hold out a promise," in my opinion, is the meaning that I gave above for "hold promise." But it's at least possible that the speaker/writer intends the phrase in the sense of dangling the possibility of a future promise in front of someone, without committing to it in the present. Or again (as you suggest) the person could simply mean "make a promise." In any event, the wording as given is both inherently confusing and readily avoidable, which are two good reasons not to use it.

EDIT (2/16/13): To follow up on the "dangling a promise" meaning of "hold out a promise," I note that two of the first three unique Google results for "hold out a promise" are as follows:
From a sermon by Joshua Brooks in Essays on the Advent and Kingdom of Christ: And the Events Connected Therewith (1840):

My brethren, among ourselves at this present time there is a transaction going forward; a great transaction of business for eternity. Temptations abound. Fraud holds out a promise of gain. Unfaithfulness holds out a promise of ease. Vanity holds out a promise of distinction. Unbelief holds out a promise of impunity.

From a Denver Post story, "Getting a day of rest powerful for even the nonbelievers" (September 3, 2011):

Technology holds out a promise of unlimited accomplishment and efficiency, but experts say it's a false promise that's encouraging us to drive ourselves crazy.

In both instances, the author's focus on the dangling of the promise serves immediately afterward to underscore the falseness of the promise.
Comment: It's a common enough idiom, akin to *hold promise* but to a particular end; something can hold promise generally, but it will hold out a promise to a particular result.
Comment: As an example of particular promise, I was going to offer T.S. Eliot's lines in "Whispers of Immortality" about Grishkin, whose "friendly bust/Holds promise of pneumatic bliss"—but then I discovered that the phrase was "Gives promise"—so there went that example.
Comment: *Hold promise* can be general or specific, but *holds out a promise* I've only seen being specific. Nice examples, +1
Answer: I would have thought this was a general reference, but an attempt to find such a reference has failed, so I'll answer instead.
It's close to "make a promise", but "make a promise" generally means promise in the sense of a declaration that one will do (or refrain from doing) something. (The similar "hold [someone] to their promise" means to insist that that promise be kept).
"Hold out a promise" uses promise in the sense "a reason to expect something".
So if I said "the government made a promise that the tax changes would increase exports" that means that they actually said that exports would increase.
Whereas if I say "the tax changes hold out a promise of increasing exports," that means that I believe that exports will increase.
People make a promise. Anything, including people, but mostly conditions and events, hold out a promise.
Answer: It's not the same meaning. In make a promise, the meaning applicable is,

promise
noun
a declaration or assurance that one will do a particular thing or that a particular thing will happen:
what happened to all those firm promises of support?
[with clause]: he took my fax number with the promise that he would send me a drawing
[with infinitive]: I did not keep my promise to go home early

and in hold out a promise,

[ibid] the quality of potential excellence: he showed great promise even as a junior officer
[in singular] an indication that something specified is expected or likely to occur:
the promise of peace

Some citations:

Three open, trumpet-shaped flowers suddenly burst open on our plant, and a fourth was still tightly closed, but held promise. Vignettes of Life in Charleston, Sc p288
She argued that animal cloning held promise for medical research, including the development of new drugs and animal organs for transplantation, and she urged lawmakers not to restrict promising science when proscribing human cloning. From Dolly to Stem Cells p34
The lanky, razor-sharp 18-year-old Scottish tennis player Andrew Murray dropped out of Wimbledon after a valiant struggle yesterday, but - for the crowd that had massed to cheer its new hero - the finish held little sting: Murray's defeat was of the unusual kind that holds the tantalising promise of victories to come. Even bitter defeat held promise of victories to come

“Hold Out Promise” vs “Make a Promise”


Can a wave possess spin?

Question: Since a matter wave is associated with a particle in quantum mechanics, does the wave spins? I mean, can we visualize the spinning of wave or is it possible that the wave spins?
Comment: For a classical wave that has spin, read about [circularly polarized light](https://en.wikipedia.org/wiki/Circular_polarization).
Answer: Just some links..

The electron is comprised of two spherical scalar waves, one inward and one outward. A phase shift of the inward wave occurs in the wave-center region near where $\tau=0$, and spin appears as a required rotation of the inward wave in order to become the outward wave. This requirement is a property of 3D space termed spherical rotation. To transform the inward wave to an outward wave and obtain the out-wave with proper phase relations requires phase shifts of the in-wave at the center. These phase shifts produce a spin value of  in the entire wave structure. Because spin is the result of required wave phase shifts, a property of 3D space, spin has the same value for all charged particles independent of other particle properties.

Also,

It is shown how the spin of the electron and other charged particles arises out of the quantum wave structure of matter.  Spin is a result of spherical rotation in quantum space of the inward (advanced) spherical quantum wave of an electron at the electron center in order to become the outward (retarded) wave.  Wave rotation is required to maintain proper phase relations of the wave amplitudes.  The spherical rotation, a unique property of 3-D space, can be described using SU(2) group theory algebra.

The Physical Origin of Electron Spin
- using quantum wave particle structure
Mathematics of Electron Spin
Comment: Please note that it is a PROBABILITY wave that pertains to the quantum mechanical description of particles and systems of particles. The wavefunction has the wave properties described and its square gives the probability of finding the particle at (x,y,z) or measure it at specific spin. It is NOT a matter/energy wave.
Comment: Beware that the first link is from Milo Wolff, a crackpot and it's likely to be wrong.
Answer: At the level of particles, most people don't think of "spin" in terms of actual movement, but as something else entirely. Spin is often approached as a mathematical property only. This is because some things do not make a ton of sense if you think of electrons spinning about some axis.
If you interpret spin as an electron (or other particle) actually spinning about an axis, some things don't make a whole lot of sense, like spin 1/2 particles vs. particles with other half-spins. I suppose you could think of a particle with spin as a rotating wave, moving like circularly polarized light, but I'm not sure how helpful it is to think like that.
See the Meaning of Spin. It may clarify some things.
Answer: You can think of spin abstractly as in PipperChip's answer. A system's fundamental physics is not changed if we choose to rotate the co-ordinate system we use to describe Nature with. What this means is that, for an isolated system, you can describe its evolution by the minimisation of a Lagrangian which is unchanged if you transform co-ordinates by rotation. Noether's theorem then tells us there are three conserved quantities for the system: one for each of the "generators" of rotations - think of it as one for each vector component of the rotation axis's direction. These three components are what we call the vector components of angular momentum. So the spin of a lone electron described by the Pauli or Dirac equation in the electron's centre of mass frame or of a lone photon described by Maxwell's equations is simply the abstract quantity conserved by dint of "Nature not caring about how we rotate our description".
For a photon (whose physics is more wonted to me than that of an electron), you can visualise spin nicely through the Riemann-Silberstein decomposition of Maxwell's equations. The evolution of the quantum state of a lone photon is described precisely by Maxwell's equations: accordingly you can think of $\vec{E}$ and $\vec{B}$ field vectors spinning as they do for polarised light. One must be careful to understand, in the one photon case, that the $\vec{E}$ and $\vec{B}$ field vectors are not literal electric and magnetic fields, but components of the photon's quantum state. I say more about this in this answer here.
Answer: The only way I can physically imagine an EM rotating wave is like a passing photon whose path is bent by a black hole and brought into rotation.
If an EM light wave is rotating, then the planar wave front must be going faster at greater radii. That would required a modification to the postulate of constant speed of light. At lower radii it would be going slower than the speed of light and at greater radii it would be going faster than the speed of light. At a specific radius, the Rotating Wave would be going at the known speed of light which is related to its rest mass.
The electric field is perpendicular to the magnetic field and both are perpendicular to the wave's direction of motion. Thus, the wave fronts of a rotating wave must incline and effectively shorten the wavelength of the rotating wave (length contraction). It will take longer to rotate one cycle as it travels a longer path of rotation plus forward motion (time dilation).
Furthermore, interaction of rotating waves would dissipate energy, slow down time, and lead to curvature and expansion of space. I am currently working on reconciling RWA Rotating Wave Approximation with Rotating Wave of Electron.
For video: https://youtube.com/watch?v=cc0rY8kk831
or detailed math and graphics see my article http://jnsnet.info/journals/jns/Vol_5_No_1_June_2017/1.pdf
Comment: Hi Bill, welcome to physics.SE. It is important to note that, while it is perfectly OK to cite yourself, you have to be upfront about it. Ideally, you would use a phrase like "see *my* article [...]" rather than just point to it. Also, please note that the youtube link doesn't work for some reason. Thanks!

Can a wave possess spin?


Super Bowl locker room assignments

Question: I heard on the radio that in the Super Bowl, Kansas City is considered the "home" team, despite the game being played in Tampa, where the Bucs are the real home team.  So... does Tampa get to use their "home team" locker room or do they have to give it to Kansas City?  I can't find the answer anywhere on the internet.
Answer: Yes, the Bucs used their own locker rooms; see this quote from Head Coach Bruce Arians:

"It's really, really amazing to just be in our facility, be in our locker room, on the practice field, same drive to work every single day," Bucs coach Bruce Arians said. "Being able to stay in that routine has been critical, because normally you're jumping on a plane."

Also confirmed this via this article about their celebration:

With the game being held at Raymond James Stadium, the Buccaneers were able to celebrate in the confines of their home locker room.

However, your question is slightly wrong: the Bucs were the home team this year, and so it's moot unclear what would've happened had your question's assumption been accurate.  See this article for example:

There's nothing fancy about the home team determination for the Super Bowl. It alternates each year from the AFC representative to the NFC representative and back again.
A year ago, the Chiefs were the home team as they won Super Bowl 54. For Super Bowl 55, that means the Buccaneers are the home team while the Chiefs are the away team. It's purely coincidental that the designations align with the game being played in Tampa Bay's home stadium.
It would've been interesting to see what happened with locker rooms if the Buccaneers were deemed the visitors. Would they have had to let the Chiefs use the home locker room while they dressed in the away locker room? Alas, the timing didn't work out for such a discovery in 2021.

Super Bowl locker room assignments


Using EM (Expectation Maximization) algorithm for Training Logistic Regression

Question: Is it possible to learn the weights for a logistic regression classifier using EM (Expectation Maximization)algorithm? Is there any instance reference?
Answer: Use Algorithm 1 from this paper. The rest of paper is more about the analysis of algorithm and theoretical background which is very nice but not necessary for your purpose. Implementation of the algorithm in Python or R is pretty straightforward.
Hope it helps :)


Are Catholics more likely to accept Platonism's idea of the Forms?

Question: No faith seems to directly accept the Forms, although I wondered if Catholics are more likely to agree with the idea of things in this World ( including thoughts) echoing a perfect and pleasurable version of themselves in Heaven? Just checking I'm in the right church! (I'm a Protestant Platonist)
Comment: possible duplicate of [Does Platonism have a denomination/group/following within Christianity?](http://christianity.stackexchange.com/questions/24527/does-platonism-have-a-denomination-group-following-within-christianity)
Comment: More likely than whom?  More likely than what?  This question could use a little more explanation about what you are asking.  A concise summary of Platonic forms would aid since that application of that philosophical approach needs to be scoped to this question.
Answer: It's not entirely clear that Catholics ought to favor the doctrine of forms to a greater extent than Protestants. The Cambridge Platonists, influential in mid seventeenth century English thought, were largely Protestants of the newly emerging, Anglican sort, or Latitudinarians. Take a look at Henry More. Certainly the Cambridge Platonists did follow a doctrine of forms, but how close that was to Plato's has often been disputed.
They raise the question, therefore, of which doctrine of forms you want to talk about. The doctrine of forms is pre-Christian, of course, although it became a major part of the early Catholic church's teaching. Remember, also, that it figured heavily in Arabic thought, and it was the cultures of Islam that largely inherited the knowledge of 5thC BC Athens, which were released into Western European hands in part as a result of the Spanish reconquista and the fall of Cordoba. The adoption of trans-mediterian standards of philosophical reasoning by the Catholic church (yes, noticeably Thomas Aquinas' grand work on integrating Aristotlelianism with Catholicism) may have helped the church speak to intelligent non-Chirstians. For an example, we need only look at the most famous Bishop of Hippo. There have been many different versions of this philosophical doctrine down the ages, and some would say the it carries right on to the Idealists, but each permutation is different, and often they live in different geographical locations.
I see, in general, no reason why Catholics should be more pre-disposed to the belief that conceptual unities are the foundation of physical phenomena (rather than vice versa), than Protestants. The great benefit of being a protestant, I suppose, is that if the Archbishop of your church disagrees with the doctrine of forms, you can find a different kind of protestant Archbishop. However, the last time I know of there being more than one Pope was when Barbarossa was storming Italy.
Comment: Welcome to this site and thank you for this answer! If you haven't already taken a look, please be aware of our [site tour](http://christianity.stackexchange.com/tour) and [help center](http://christianity.stackexchange.com/help). I hope you will stay to ask and answer many more questions!
Answer: I'm probably not smart enough to answer this, but have you checked with St. Thomas Aquinas? I think that he (and the Church) teaches that incorruptible things are in and of themselves perfect and therefore not something that exists in perfection in Heaven.
Whatever it is that we see "through a mirror darkly" isn't the image of a perfect toaster or the perfect piece of cheese, but it might be a perfect soul.
So, no, I don't think you'd find yourself finding that particular doctrine accepted in Catholicism, although it sounds like a lot of fun to think about.


How do you obtain melons in Minecraft Xbox Edition?

Question: I've played minecraft xbox edition for quite a while now, and I have not found ANY melons. I'm wondering if I have to find it in a chest, or if they spawn with the map?
Comment: well in the older versions of minecraft, the only way to get melons was to find the seeds in Dungeons or Abandoned Mines. I am going to assume that is how you will be able to get them.
Comment: Ok, but is that the only way, I don't feel like searching a whole buttload of cave systems to try and find a Dungeon. Try to make it easier for me =).
Comment: They are found in jungle biomes
Answer: You can find them in a old mines.  There are miner's chests with melon seed, ores, and bread.
Answer: The following top answer doesn't work, due to the fact the player's on Xbox. To find melons, go to Jungles. You can find melons near some of the Jungle trees. You can also find them as loot too in chests.
Answer: You should be able to find melons in the same places as normal. However, if you want the block form in your inventory (as I don't remember if you can craft the block), you'd probably need Silk Touch, as it normally drops some of the item form of it.
Answer: You have to build a nether reactor with a nether reactor with diamonds and gold. Then activate it. You will have to build it in a non used area. You have to be quick to collect the things you can get but you will get a few things.
Comment: This doesn't answer the question. The asker is asking about the Xbox 360, not  Pocket.


how to invalidate a users session

Question: I work on an enterprise weblogic portal environment. Lets say the portal is on a.whereiwork.com and has many wsrp portlets as well as several iframed portlets that point to pages in another subdomain, b.whereiwork.com (legacy app we also own the codebase for). We have a current issue where users log out of the portal but when they log back in their session on b.whereiwork.com is persisted and we have some issues getting the JSESSION ID cleared on that subdomain.
This represents a major security issue as the next person to login on that computer might not be the same user (for instance someone logs in then out and his wife logs in and sees data from his session).
One thing we thought to try is add an iframe to the subdomain on the logout page which invalidates the session on the subdomain. Security is a little different on the other subdomain an its more complicated than I can really go into here. Take my word for it - it wont work.
The best idea we currently have is to add a top level servlet filter on b.whereiwork.com that checks to see if the security cookie has changed and then call session.invalidate(). This way if the user logs out we can leave their session as is unless they try to log back in. We can detect that it is a different login because the login is tracked in a separate cookie.
So my question is. Is there any issue calling session.invalidate() in a top level filter. Assume that other filters in the filter chain will need to create objects in the session. Im guessing after calling invalidate on the session that the page would return a different JSESSIONID?
Any other suggestions that might be cleaner would be appreciated.
Answer: Ive decided to use jsonp to send a crossdomain message to the other domain to clear the session. Seems to be working.
Comment: How would you handle issues like session timeout on the main domain or restarting of the main domain server.
Answer: The best approach will be to have the same security token across different servers. But as you said that is not possible. The next solution can be to use HTTPSessionListener to clear the session when the user logs out of main domain or when the session times out. That will ensure that the sessions across domains are in sync.

how to invalidate a users session


Why does the speed of a wave travelling in shallow water increase in deep water?

Question: Exactly as the title says.
Why does the speed of a wave travelling in shallow water increase in deep water ?
Comment: Does this help? https://en.wikipedia.org/wiki/Waves_and_shallow_water
Comment: How much math do you allow?
Comment: @Luc J. Bourhis enough to make it clear
Answer: Irrotational inviscid linear surface gravity waves have the following phase velocity:
$$c=\sqrt{\frac{g}{k}\tanh kh}, $$
where $c$ is the phase velocity, $g$ the acceleration due to gravity, $k$ the wavenumber and $h$ the water depth.
For fixed $k$ then we note that $\tanh hk$ monotonically increases, hence the speed is greater for larger $h$.
Note, this is missing some of what's going on, as the wavelength changes as waves change water depth (but the frequency in the absence of breaking, forcing, wave current interactions or nonlinear interactions is conserved). Perhaps a more interesting limit is what happens when waves have very large wavelengths (like tsunamis) so that $k$ is small and $\tanh kh \approx kh$ and the phase velocity goes as $\sqrt{gh}$ (i.e. shallow water waves are non dispersive - the phase velocity does not depend on the wavelength). In the middle of the ocean the water depth is large, so these waves can travel at speeds of around 500 mph.
More details can be found, for instance, here: What determines the speed of waves in water?
Answer: Simpler answer. Assuming no energy loss, conservation of energy. Wave height stores the energy as potential energy. As a wave enters deeper water the height and potential energy decrease. Therefore the speed of the wave must increase. Potential energy converted to kinetic energy.
Answer: A great answer was given regarding the phase velocity of the wave so I'm not going to delve more into that part.
I think though, that due to the nature of the waves we should take into account friction inside the body of water. Specifically, I believe that small water depth plays the role of a water breaker, slowing down significantly the speed of the waves. The effects of that are present at larger water depths as well but are minuscule, and do not make a difference on the wave speed at the surface.
Answer: Here is a rather simple answer that requires basic relations only.
$$c=\frac{\lambda}{T}$$
where $c$ is the speed of the wave, $\lambda$ is the wavelength of the wave, and T the wave period.
We also have $$\frac{\lambda^2}{gh}=T^2$$
where $g$ is the gravitational constant, and $h$ the height of the wave.  In deep water, $h$ is greater, so $T$ is lower, and this would mean $c$ in the previous is higher.
Answer: I think it is related with pressure. With increasing depth (deep water), pressure increases, so the force  with which it moves must increase as pressure is directly proportional to force. Here force is the velocity. According to equation,  velocity is equal to frequency multiplied with the wavelength. Therefore its wavelength increases, with increased velocity. Conversly is shallow water, the pressure decreases due to less depth, velocity decreases, hence its wavelength decreases.


Can I cross Amaryllis Belladonna and Hippeastrum?

Question: After searching on the web, I realized that Commenters often use "Amaryllis" and "Hippeastrum" interchangeably, and it's inconclusive whether they meant Amaryllis or Hippeastrum because of the historic confusion.
So here is the deal: Hippeastrums can be forced to flower in fall, the same season Amaryllis Belladonna flowers. I currently have none being forced. My Amaryllis is sending its flowering shoot already and even if I buy a "forced" Hippeastrum, I would still miss the timing. Still, no time is lost if I manage to "freeze" some pollen till spring. In my country, Hippeastrums "left on their own" are grown as evergreens and they flower in spring. Imports and local bulbs are sold while dormant and some may have even been forced to flower before reaching the retail store.
Would the kitchen's freezer provide a low enough temperature to preserve the pollen?
Would the cross-offspring need a summer dormancy like Amaryllis, or will it remain evergreen like the Hippeastrum?
A note of caution, though: Modern hybrids may be triploids, as I noticed they are sterile and cannot be pollinated. I don't know if all hybrids are like this. I have few bulbs I bought in 2002 which produce seeds consistently, without any artificial pollination. I have failed to pollinate the modern hybrids I have.
Answer: I have a Hippeastrum striatum (Barbados Lily, orange flower yellow center) that I crossed with a standard amaryllis (red flower, white center). This produced viable seed which I planted in April 2022. The plants are doing well but won't flower for at least another year.


Can creatinine levels be lowered in dogs?

Question: My 21-month-old Cane Corso has been diagnosed with elevated creatinine levels, they are currently at 2.2.  I have purchased a kidney function supplement, but am curious about what my success will be long term.
Answer: I apologise in advance if I get anything wrong, because I have experience with a kidney cat, not dog, but I'll try to stick to things that should be universal.
First, about your last question. The long term effects of any treatment would depend on what your dog was diagnosed with. Elevated creatinine levels are not a diagnosis, they're a symptom. The question is: a symptom of what? Consult your vet about that. The most common things from the top of my head would be:

Too much protein in your dog's diet

This one is simple enough. Simple diet rebalancing will do the trick.

Too fast muscle growth and/or too much exercise and/or recent muscle damage

Self-explanatory, I think.

Acute kidney infection
Chronic kidney infection
Acute kidney failure
Chronic kidney failure

But it could be a lot of other things, really. Talk to your vet.
If it's something acute, your dog's creatinine levels will fall gradually by themselves when you deal with the cause of the problem. If it's a chronic problem though... you'll have to work with your vet closely for a long time. You'll still have to deal with the cause (how -- depends on what that is), and you'll have to deal with the toxic waste products in your dog's body that are generated when certain foods are processed and don't flush properly (that's what chronically high crea levels are about, although crea itself is not toxic). Your vet is your guide, but you can consider certain probiotics that help flush waste products through the gut, prebiotics to feed the probiotics, and certain oral adsorbents that bind with the toxins and flush together with them.


Why only the outboard ("low speed") aileron drops when there is no hydraulic pressure on the 747-8?

Question: As the title says, why only the outboard ("low speed") aileron drops when there is no hydraulic pressure on the 748?

(Full resolution)
Comment: Please could you be a bit more precise in your question, what phase? Are you considering the aileron DROOP function that is the flaperon  Function of ailerons? What do you mean no hydraulic? Just for this aileron or more than that. However many servo controls become floating in absence of pressure. On ground it drops by its weight. In flight not to twist the wing, it will float.
Comment: @user40476 On the ground, without hydraulic pressure, only the outboard aileron drops due to its weight. I don't talk about the droop function. I think the answer lies in the fact that the inboard aileron is actually a flaperon
Comment: Interestingly, it's [the opposite](https://i.stack.imgur.com/SRYz9.png) on the 777 :D And it's easier to explain on the 777, with the slow-speed ones having a lock-out mechanism (although I haven't checked if that *is* really the reason).
Comment: At high speed flaps up a 28 volts signal locks out the outer ailerons only, may be what happens on ground, hydraulic off is just a consequence of the servo control design.
Comment: If the servo control has an idle circuit they will droop unpressurized.  If no idle circuit they are hydraulically locked when there is no movement of the servo control out of null and they will stay rigid while unpressurized.
Comment: @John K , it looks to be locked it needs the 28 volts signal, the absence of this signal is probably the reason of the droop
Answer: The Boeing 747-8 (unlike the 777) is not a full fly-by-wire aircraft, but some fly-by-wire controls have been added to the original 747 design. The inboard ailerons are mechanically connected to the flight controls, while the outboard ailerons are not. This allows them to droop without hydraulic power.
From the Boeing 747-8 FCOM (9.20.6 Flight Controls - System Description):

Roll Control
Inboard ailerons are mechanically controlled and hydraulically powered. Outboard ailerons and all spoilers are electronically controlled and hydraulically powered.
Aileron and Spoiler Roll Control
Rotating either control wheel positions ailerons and spoilers. Above approximately 258 knots/.53 Mach, the outboard ailerons are commanded to the neutral position to prevent overcontrolling. The outboard ailerons become operational at lower airspeeds. Inboard aileron deflection is limited when flaps are extended beyond 10.
To improve takeoff performance and reduce noise, the outboard aileron is deflected down for flap detent positions 10 and 20. The downward deflection is removed if the angle of attack is above stick shaker. The inboard aileron is deflected down when the flaps are selected to 10 or greater.
All spoiler panels operate with the ailerons. Spoiler panels are deflected up or down based on Speedbrake lever and control wheel inputs.

The following image from modernairliners.com shows all new features of the 747-8 wing including the Aileron droop.


In a right-angled triangle of equal opposite and adjacent sides, why is the intersection of the median lines one third of the triangles height?

Question: In a right-angled triangle of equal opposite and adjacent lengths, I was told that when you drew a line from the median of the hypotenuse to its opposite vertex, and then drew another line from one other side to its respective opposite vertex, the point of intersection of the lines was one third the height of the triangle. Is this true? And if so, why?
Answer: I believe the picture speaks for itself.
Answer: The simple answer is that in an isosceles right triangle the median to the hypotenuse is also an altitude. But in for a penny, in for a pound.
Let $\bigtriangleup$ABC be an isosceles right triangle with C the vertex opposite the hypotenuse. Let D be the midpoint of the hypotenuse AB, E the midpoint of BC and F the point of intersection of the segments CD and AE. We want to show that CD is an altitude and that CD = 3FD.
AC = BC, AD = BD and $\angle$ ABC = $\angle$ CAB, so $\bigtriangleup$ BCD is congruent to $\bigtriangleup$ ACD. So $\angle$ ADC = $\angle$ BDC. $\angle$ ADC and $\angle$ BDC are supplementary and equal so they are right angles. CD is therefore an altitude.
Construct an auxiliary segment DE.
$\bigtriangleup$ DBE and $\bigtriangleup$ ABC share $\angle$ DBE. BA = 2BD. BC=2BE. So $\bigtriangleup$ DBE and $\bigtriangleup$ ABC are similar.
That means AC = 2DE and $\angle$ BED = $\angle$ BCA, which in turn means DE is parallel to AC. So $\angle$ ACF = $\angle$ EDF. $\angle$ CAF = $\angle$ DEF. So $\bigtriangleup$ ACF is similar to $\bigtriangleup$ DEF and CF = 2FD.
Therefore, CD = 3FD and we're done.


Uploading many images to Facebook

Question: Facebook has a limit of about 60 200 pictures per album. Is there a way to take a few hundred pictures, and upload them to a series of albums (e.g. "Foo part 1/5", "Foo part 2/5", ...) ?
Comment: Maybe I am looking at something else but is it not 200/album?
Comment: Hmm, I remembered a lower limit, haven't tried it recently though. The question is still valid though.
Answer: Depending on your OS, there's iPhoto, Picasa, and Windows Live Photo Gallery.
The preferred method (which I like a lot) is to use Picasa (download link) and upload them.
If you're going to use iPhoto, you'll need to select all the photos you want to upload, goto Share and then Facebook.
For Windows Live Photo Gallery (download link), get this addon for facebook (download link) and look at their screenshots for specific instructions.
This is the quickest way I've been able to upload more than a few photos at a time.

Uploading many images to Facebook


What is "average life" in terms of nuclear physics?

Question: I am having a doubt after reading on so many sites. I am not able to understand the clear meaning of average life. Whether it is 36.18 or something else.
Comment: Do you mean half life?
Comment: @OfekGillon Half-life is not the same as the average lifetime.
Comment: I know, but average life isn't common Jargon. Second, they are the same up to a constant factor (if he does mean what I think he means)
Comment: @Ofek "Average life" isn't common jargon, but "mean lifetime" is. There's a simple mathematical relationship between the mean lifetime and the half-life, see https://en.wikipedia.org/wiki/Exponential_decay
Answer: Each unstable nucleus, in a given sample of radioactive matter consisting of nuclei of the same type, decays after a certain period of time.
If you add up all those times and then divide the sum by the number of unstable nuclei in the beginning you obtain the average time for an unstable nucleus to decay.
This average time is often called the (average) lifetime of the decay and can be shown to equal the reciprocal of the decay constant of the decay.
Answer: Considering a radioactive nucleus, let the initial number of nuclei be $N_o$ with its disintegration constant $\lambda$.
From it's first order decay/radioactive decay law, $N(t)=N_o e^{-\lambda t}$( let this be equation $\boxed{1}$) is the number of nuclei left at a general time t.
The lifetime of each $dN$ nuclei which decays at a given instant is NOT the same here. For example, at t=0 the lifetime of dN nuclei which decays is 0, whereas at t=10s(say) the lifetime of dN nuclei which has just decayed is 10s.
So we it makes sense to only talk about average lifetime of all the nuclei.
Average lifetime of all the nuclei
$$ =\frac{\int tdN}{\int dN} $$(by definition)
$$ =\frac{\int_{0}^{\infty} tNo(-\lambda)e^{-\lambda t}dt}{No}$$. (from equation $\boxed {1}$)
$$=\frac{1}{\lambda}$$ after doing the simple math.
Comment: BTW, you can number equations using the tagging system. See https://math.meta.stackexchange.com/a/11491/676335
Answer: mean lifetime (sometimes called just the lifetime) $\tau$, which is defined as the average time that a nucleus is likely to survive before it decays. The number that survive to time $t$ is just $N(t)$, and the number that decay between $t$ and $t+dt$ is $\left |\frac{dN}{dt}  \right |dt$ . The mean lifetime is then [1]:
$$\tau=\frac{\int_{0}^{\infty}t\left |\frac{dN}{dt}  \right |dt}{\int_{0}^{\infty}\left |\frac{dN}{dt}  \right |dt}$$
let's try to evaluate this integral, we start by using the decay constant relation (the probability per unit time for the decay of an atom):
$$\lambda =\frac{1}{N}\left |\frac{dN}{dt}  \right |$$
and the exponential law of radioactive decay (which is its solution):
$$N=N_{0}e^{-\lambda t}\\$$
then:
$$\left |\frac{dN}{dt}  \right |=N_{0}e^{-\lambda t}\lambda$$
substituting in $\tau$:
$$\tau=\frac{\int_{0}^{\infty}tN_{0}e^{-\lambda t}\lambda dt}{\int_{0}^{\infty}N_{0}e^{-\lambda t}\lambda dt}\\$$
$$\tau=\frac{\int_{0}^{\infty}te^{-\lambda t}dt}{\int_{0}^{\infty}e^{-\lambda t} dt}\\$$
the integral in the nominator is equal to (integration by parts):
$$\int_{0}^{\infty}te^{-\lambda t}dt=\frac{1}{\lambda^{2}}$$
the integral in the denominator is equal to:
$$\int_{0}^{\infty}e^{-\lambda t} dt=\frac{1}{\lambda}$$
then:
$$\tau=\frac{\frac{1}{\lambda^{2}}}{\frac{1}{\lambda}}=\frac{1}{\lambda}$$
Thus the mean lifetime is simply the inverse of the decay constant.
[1] introductory to nuclear physics by krane


Registration form rules

Question: I read somewhere that a registration form has to have some sort of notification about the storing of their info, is this true? If so, where can I find those rules?
Comment: @Lord I requested that it be deleted on meta and the migration cleared here; apparently only the second half happened
Comment: Don't punish me! I dind't re-open it.
Answer: If this is in the general case you may be referring to your countries equivalent of the Data Protection Act (which we have in the UK). It depends on the type of information you are holding and your jurisdiction. It generally only applies to details such as medical or financial ones. I don't know of any jurisdiction where email addresses, names and the like must be given the same protections.
If you're working in the Netherlands have a look at this.
Answer: amitywebsolutions.co.uk has a summary covering "Legal Requirements for Your Website" (UK/EU regulations)

Company Information
Web Accessibility and the Disability Discrimination Act
The Data Protection Act
Consumer Protection (Distance Selling) Regulations
Electronic Commerce Regulations (EC Directive)
PCI DSS
The EU Anti Spam Laws

... and for the UK, the Information Commissioner's Office have published further guidance.

Registration form rules


Sick Scheffelera 40 years old

Question: The state of my 40 years old scheffelera is: The bark is withering. When I scratch the bark it is black underneath. One trunk dead one living. Both share a common singular piece of trunk to the roots. My concern is that the side that is living is looking stressed. Can I save it without cutting the dead 'wet' half of the lower trunk?
Comment: Are you able to provide photos please? Of the entire plant and a close up of the damage? If there is any viable material on the plant, your best bet might be to attempt to take and strike cuttings.
Comment: Site says photos are too large? Working on re sizing them? Thank you!
Comment: Welcome margo! It's great to meet you! Our photo system can be tricky, as you saw, with a size limit of 2MB. If you're unable to re-size for any reason, if you can post it to something online, like a Google or Imgur album, put the link in your question. (Press on the gray "edit" and the question will open up for you to add to it.) People will be able to see it, and someone may even come along and download it into the question. Don't give up!!
Answer: Just throwing this out there, but a potential option is to do an air layer on the good trunk and then lop it off and repot it. We had a very big one at my work and I hesitated to mess with it, because it had been here as long as the business. It had been in the presidents office and was starved for light. Then thing was almost 6' tall, but leaned at a 45deg angle toward the window. It had a stick in the pot holding it up. I moved it to the break room and it got a lot more light. I fertilized it after a repot (which showed a baseball sized root mass by the way) and I'd let it dry out well so the roots would grow out seeking water. When it put on several new leaves and got stronger, I did an air layer. I let it stay on for about a month, then held my breath and cut it off below the air layer. There was one new growth further down the trunk. I planted the air layer. It took it a month to show new growth on the top, but I planted it up straight and it looks great now.
The bottom recovered much quicker. It's put out 5 new growths, soon to be trunks, and is basically a bush that needs to be whacked back.
Just to further take the stress of you, I had a 12" stump from below the air layer to the first growth. I lopped it off about and 1" above that first growth and after coating both ends in cinnamon and allowing to callous, (I did that with all cut ends) I put it in a 4" jar of water. After 2 months, it had a jar full of roots and 2 leafed growths, and 3 nubs of growth starting. I just had a coworker take it home and plant it.
These are really bullet proof and I would try something like this as opposed to loosing the plant. Good luck.
Edit: There are lots of videos of airlayering on youtube.com, but the basic concept is you create soil like conditions around the trunk of the plant. The plant sprouts and grows roots there. The part in the soil continues to feed the upper plant. Then you cut the trunk below the air layer and pot up the top portion. You now have two plants. I think I did it the hard way. I bought saran wrap and cheap sphagnum mosss from home depot. I made a mess and didn't get enough sphag in the plastic. An easier way I heard about and am fixing to try is to take a ziplock bag, fill it with moistened sphagnum moss, and zip the top. When you're ready to apply, cut a slip in the middle of the bag, exposing the damp moss. Press the bag around the trunk, sinking it into the moss. Wrap with tape to secure in place.
After a short time, you'll see roots. I wait till there are several visible before cutting and potting. If your moss starts to dry out, which it probably won't, cut a small hole in the top of the bag and use a dollar store funnel to add some. The moss will wick moisture through the bag evenly, so add a little and wait to see how far it goes. If you flood the bag, just poke a hole in the bottom to drain. Also, it may or may not be necessary, but I buy a container of cinnamon from the dollar store to coat the cut ends. It's supposed to help with bacteria.
If you watch videos on air layering, you'll see them scoring or removing bark. I've done this process on small and large schefflera and dracaena. I have found you don't need to do that on these plants as they readily root. If you look on the woody portion of the plant, you'll see a ton of little bumps. These are potential roots or potential new growths. Your new roots will easily sprout form these.
Last tip is don't try to separate the sphagnum moss from the roots. Cut away the bag and bury it in potting soil with the moss. Then keep the potting soil damp, but not soaking. You don't want to rot the roots and you do want them to grow out seeking water. I start cutting back the water and lightly stressing them as soon as it puts out new growths. Also, don't over pot. The reason is that if you over pot, the plant can't suck all that moisture up and it can rot the roots. It's better to pot tight and repot as necessary. I did have to pot too big and one of the things I did to help compensate is to that the pothos that grows like a weed in our office, cut it into sections, and push it into the soil. It fills out the pot and helps suck up the excess water.
Comment: I am not familiar with air layering. Can you explain it for me? I did remove the plant from the wet soil to allow it to dry out. I covered the root tips this morning with fresh soil.
Comment: @margo I edited my response to explain air layering.
Comment: What a wealth of information from @Dalton. I am gathering needed supplies for my first air layering!
Comment: That sounds great. The best advice I can give anyone is to get a few plants and experiment with them. I know it's 40 years old, but you'll have to make a decision, like you did, to do something drastic or loose it all together. My brother wanted to get his first plant years ago and I told him to get (3) that way you can experiment and it's not as depressing if you loose one. Just keep in mind that when doing an air layer on this plant, do it several inches above the rot. That way, when you remove it, you are only cutting clean tissue and not taking any rot that may have traveled upwards.
Comment: I am sorry to report that my scheflelera died. I tried both air layering and to root a cutting. The rot continued in both situations.

Sick Scheffelera 40 years old


How to continue field output on a second page?

Question: I have generated a PDF from a template.  The PDF has a field in the middle of it that is of variable length.  I am trying to work it so that if the field's content overflows, then the program will use a second instance template as a second page and continue in the same field there.  Is this possible?
Comment: You mention a field. Is it an actual dynamic form field (xfa or acroform) or is it merely something looking like a form field?
Comment: Apologies mkl, I didn't see your comment.  Its an actual acroform field.
Comment: You cannot split a single Acroform field over multiple pages. An AcroForm field may have multiple visualization on multiple pages, so you can have the same field on both pages, but each of these visualizations would carry the whole content. Instead you can either flatten the field as proposed in Brunos answer or split the content into *different* fields. This would mean, though, that the person or program eventually processing the filled-in form needs to know about this new overflow field and explicitly join the contents of the fields.
Answer: This will only work if you flatten the form. I've written a proof of concept where I have a PDF form src that has a field named "body":
public void manipulatePdf(String src, String dest) throws DocumentException, IOException {
    PdfReader reader = new PdfReader(src);
    Rectangle pagesize = reader.getPageSize(1);
    PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
    Paragraph p = new Paragraph();
    p.add(new Chunk("Hello "));
    p.add(new Chunk("World", new Font(FontFamily.HELVETICA, 12, Font.BOLD)));
    AcroFields form = stamper.getAcroFields();
    Rectangle rect = form.getFieldPositions("body").get(0).position;
    int status;
    PdfImportedPage newPage = null;
    ColumnText column = new ColumnText(stamper.getOverContent(1));
    column.setSimpleColumn(rect);
    int pagecount = 1;
    for (int i = 0; i < 100; ) {
        i++;
        column.addElement(new Paragraph("Hello " + i));
        column.addElement(p);
        status = column.go();
        if (ColumnText.hasMoreText(status)) {
            newPage = loadPage(newPage, reader, stamper);
            triggerNewPage(stamper, pagesize, newPage, column, rect, ++pagecount);
        }
    }
    stamper.setFormFlattening(true);
    stamper.close();
    reader.close();
}

public PdfImportedPage loadPage(PdfImportedPage page, PdfReader reader, PdfStamper stamper) {
    if (page == null) {
        return stamper.getImportedPage(reader, 1);
    }
    return page;
}

public void triggerNewPage(PdfStamper stamper, Rectangle pagesize, PdfImportedPage page, ColumnText column, Rectangle rect, int pagecount) throws DocumentException {
    stamper.insertPage(pagecount, pagesize);
    PdfContentByte canvas = stamper.getOverContent(pagecount);
    canvas.addTemplate(page, 0, 0);
    column.setCanvas(canvas);
    column.setSimpleColumn(rect);
    column.go();
}

As you can see, we create a PdfImportedPage instance and we insert a new page with this page as background. We add the content at the position defined by the field using ColumnText.
Comment: @BrunoLowagie *There is no such thing as iText 4.1.6* - I think the OP is talking about iTextSharp, at least that's how the question is tagged. As far as I remember iTextSharp 4.1.6 was an official release more or less equivalent to iText 2.1.6. Carlos, this in turn means that **A** you have to do some translation from Bruno's Java sample anyways and **B** you search a solution for an *ancient* iTextSharp version, not a current one, a fact you should have mentioned in your question to start with.
Comment: Bruno, how would you do this in version 4.1.6?  Rectangle rect = form.getFieldPositions("body").get(0).position;  Its giving me an error
Comment: There is no such thing as iText 4.1.6. If there is, it is not an official version. The code could contain anything. We (the official iText company) are not responsible for any version other than the ones we officially distribute. Hence we can not comment on the version you are using.
Comment: When the form is flattened, it doesn't recognize the field name. `form.getFieldPositions("body").get(0)` would give a null pointer because `form.getFieldPositions("body")` is empty. The field names are no more there when the form is flattened


Are reviewers required to check for originality?

Question: Suppose a person writes a research paper without doing a complete literature survey, and sends it to a peer-reviewed journal. Assume that the results in question have been obtained before by someone else.  Is it mandatory for journal editors to check the novelty? If not and if the editors also don't know about the pre-existence of this research, then who is liable for the aftermath?
Comment: Depends on whether the authors deliberately stole someone else's ideas.  In mathematics, concepts are rediscovered many years later.  This doesn't mean the authors stole the ideas.  They just didn't know that another author had the same ideas before.  For example, it's written in a different language.  You can also ask a similar question: if the ideas existed in a different language, and you didn't know about it because you can't read said language, who is liable if you publish the ideas?
Comment: There are examples of people in application fields "discovering" and publishing (in highly-regarded journals) well-known mathematical techniques, decades or centuries after the original mathematical publication.  As far as I know there is no real "aftermath" to these publications.
Comment: It happens in engineering as well. Nobody reads 50-year-old books on engineering for *insight*, and of course they don't include any computer-based methods (and they probably aren't on the internet either). So people write papers about this wonderful "new" insight they just discovered...
Comment: Who is liable for the aftermath?  The author, and only the author.
Comment: Bear in mind that almost no literature survey is "complete" in the sense of having read all previously published works which might have introduced a concept or idea. While access has been increasing for the past few centuries, so has the number of papers which would need to be read.
Answer: As I see it, the reviewers and editors don't have an obligation to redo the literature search.  However, the reviewer should be someone who is sufficiently familiar with the topic that they would be reasonably likely to know about relevant prior work, and should be able to identify serious omissions in the literature search. A reviewer who doesn't have that level of expertise should not be assigned, and if assigned should probably decline to review the paper.
Of course, if the reviewer does know about prior work that duplicates the paper under review, then they should require the authors to cite it, and evaluate the paper based on its novel contributions only, if any (or as an independent simultaneous discovery, if the timing makes that a possibility).
Final responsibility for the content of the paper always rests with the authors alone.  However, if the paper is accepted and later found to be a rediscovery, a common course of action is to print an "acknowledgement of priority", a short note citing the previous paper and acknowledging that it was first.  Typically it wouldn't be retracted.  (Of course this only applies if the editors believe the paper is really an honest independent rediscovery; if it is plagiarism then it should be retracted.)
Comment: +1, with emphasis on the fact that "duplicate" work can imply parallel work and not necessarily plagiarism. The works need not actually "seem" to be alike to duplicate results. Good reviewers know the field, but aren't infallible.
Answer: I would like to start with your assumption.
It is possible but not very likely that a submitted paper is more or less a duplicate from existing published research. But if it is, a duplication would be a fair reason to advise reject.
It is more likely that authors have missed relevant research. In that case a constructive reviewer will suggest the authors to include that research. However, be prepared that the authors did not miss that specific research but have good reasons for not including it.
Another common situation is that a reviewer judges the work against his/her knowlegde base and is just not able to comprehend a different perspective on a similar problem (confirmation bias). Then the reviewer will easily perceive the work as a (wrong) duplicate while it is not.
Then your specific questions:
If the editor did not perform a desk rejection, the editor perceives the work as potentially publishable. In my view, editors are qualified professionals who assess the interest of the submission for the journal's audience. Although editors are not specialists in every field, the experienced ones will most likely notice real duplicates.
Who is liable if it goes wrong? The authors have the biggest problem because their reputation is at stake. The editor can decide to withdraw (retract) the published paper (not good for the journal's reputation). The reviewers stay anonymous. But in my view all stakeholder share responsibility.
Comment: An inadvertent lack of originality is sufficient reason to reject a paper, but not to retract it (which I think is what you meant by "withdraw") once it's been published. It's a bit of an embarrassment for everyone involved (including, potentially, the author of the previous paper), but not really a huge problem. The biggest fallout, I think, is that future authors end up having to be *really careful* how they word things when referring to the two sources in their literature reviews. ;-)
Comment: @Sneftel Thank you. I added retract. And thanks for your viewpoint.
Answer: There are around 20,000 papers added to Pubmed each week. Even my narrow field adds 230 a week. Being able to know all the relevant literature for a paper is impossible. Thus it is not a question of whether the current work missed anything from the literature review, but how important are the things that are almost certainly missing.
Part of the job of a reviewer is to be familier with a field and to know whether there are any glaring omissions in the review. Anything in any of the interdisciplinary journals or the fields top in-house journals. They might do a quick search to see if anything blindingly obvious jumps out that the happened not to know about. But no one can be certain that something important hasn't been missed.


Network issues in certain hours every day

Question: Apologize if I am not very technical, but networking is not my field of expertise. I work at a positioning system service. We collect data from GPS satellites via GPS antennas in the field, get the data from the antennas, calculate X,Y,Z coordinates in our servers, and distribute accurate coordinates to GPS users in the field via the mobile GPRS network.
We have 5 servers here. Three collect data from the antennas, and the other (NTRIP server) distributes them to the users.
Now, we are having network interruptions during certain hours of the day (8 AM to 18 PM approximately, Monday to Friday). In the evening and during the night, everything works fine.
Our internet provider confirmed that everything is fine on their end. It seems there is a problem with the communication among our servers.
If you try to ping one server from the other through the CMD, we would get a request time out for every 20 successful replies. The timeouts are random.
The servers are inside the Active Directory. Windows Server 2008 R2 is installed in all the servers.
We have had some IT specialists have a look at our system, but they haven't been able to get the reason why this is happening. So, I desperately came to ask here. Please feel free to edit my question.
Any tip would be great.
Edits: I myself tried restarting the servers, the switch, the modem and the router, but nothing changed. I am providing the network topology here:

The active directory domain is located at Control Center server. The Datastorage, Network are used to calculate the coordinates collected from 16 GPS reference stations. The coordinates are stored in the Datastorage server. The RTCD-Admin holds the Microsoft SQL database. Ignore the the RINEX, and the Transformation server from the topology. They don't have any role anymore. The NTRIP server gets the data from the Datastorage server and distrubutes it to the users. We give the users the public IP of the NTRIP server, the port, the username and the password. They enter these data in their GPS receivers and get real time coordinates via GPRS internet.
This installation was an existing one, and we don't understand why the problem appeared. The user traffic has not increased. Indeed, we have very few users we distribute data to.
Updates following the suggestions, I isolated the problem. It came out that when the router was disconnected from the switch, the communication between the servers was normailzed (no request timed out anymore).
Now, I am trying to understand whether that is a problem with the router or the modem, and wheather the problem is physical or it has to do with the configurations.
Comment: Please consider adding [more details](http://meta.networkengineering.stackexchange.com/questions/292/network-engineering-question-checklist)
Comment: If you can reproduce the issue at will, get a simultaneous packet capture on every device, reproduce the issue and you'll see where the packets are dropped.
Comment: 18am?  Also consider scheduled tasks like backups, configuration syncs, etc.
Comment: Ok, I tried to isolate the problem, and I updated my question with the results.
Comment: Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: You have to try and isolate the problem as much as possible. Need to work out exactly which communication stream drops out. Do this by testing connections between all isolated parts of the network, that is computer one - > computer two, computer three - >computer four. Once you have narrowed down the problem it will be a lot easier to fix.


Red lines in dope sheet?

Question: I've had no luck googling for it, yet. What do the red lines in the dope sheet mean?
Answer: Both the dopesheet and the graph editor show a red line when the data path for the fcurve cannot be found. While most times the fcurve stays connected to the correct item, there can be times when this doesn't happen, most often when the item is renamed or deleted in an external file from the one containing the animation. You will also notice that the shown data path is the complete raw path when it is broken, rather than the more user friendly abbreviation.
If an item has been renamed, we can correct the data path in the fcurves properties panel in the graph editor. If the item was deleted then you can just delete each fcurve, you can do that by selecting it in the list and pressing X or ⌦ Delete.

For a large number of items, it may be easier to make a script that will correct the data paths.
Answer: For anyone that needs to rename these for a relatively small number of animations (AKA Actions) and a small number of bones, you can do the following for each messed up animation:
Make sure you're in Pose Mode for that armature or have the Outliner open to select the bone
1) Select each messed up animation in the Dope Sheet (in Action Editor mode)
2) Rename the bone that should be referenced in that key (the thing with the dropdown arrow) to the name that it still has stored (See example below)
3) Then rename the bone back to the desired name (while the same action is selected)

Here, I have the messed up action selected and I would rename "Gun.R" back to "Gun" so it matches up with the messed up animation. Then, I would rename the bone back to "Gun.R" and the animation key will be renamed correctly and the red lines will go away.
It's not a practical solution for many messed up animations and bones, but it works for few..
Answer: use this script
import bpy
# Get the active action in the Action Editor
action = bpy.context.object.animation_data.action

# Create a list to store the channels to remove
channels_to_remove = []

# Iterate over each F-Curve in the action
for fcurve in action.fcurves:
    # Check if the RNA data path contains "pose.bones"
    if "pose.bones" in fcurve.data_path:
        # Extract the bone name from the RNA data path
        bone_name = fcurve.data_path.split('"')[1]

        # Check if the bone exists in the armature
        if bone_name not in bpy.context.object.pose.bones:
            channels_to_remove.append(fcurve)

# Remove the channels with missing pose bones
for fcurve in channels_to_remove:
    action.fcurves.remove(fcurve)

Answer: I think those are error keys getting generated by default when we animate..usually i just delete them to reduce the load on the file. This error gets generated every now and then.
Comment: Error keys getting generated by default? Why?

Red lines in dope sheet?


Boost windows 10 dell laptop speakers volume

Question: Any good software or in built feature in windows 10 (Dell laptop) for boosting volume?
Answer: I recommend Letasoft Sound Booster, but I don't know exactly if it works for dell laptops. It works fine on my Win 10 PC. However, it's a trial version. So you'll have to purchase it in the end. You can also try Boom3D, DeskFX Audio Enhancer Software.
Answer: Go with FxSound! :'D
It was a paid, for-profit software,
but changed to a donation-funded software.
So, it's free!
Very good, I tell ya :'p
https://www.fxsound.com/changelog
(I'm on Windows 10 Pro)


Add animation at certain frame

Question: I got this animation:

And I'd like to add another animation +- at frame 300, but it starts at the beginning. How can I do it?
Comment: "but it starts at the beginning", what do you mean? What you show is the Timeline, it's not the window where you create animations, to do that you need to open the Dopesheet window
Comment: When I start filming, that movement begins as well
Comment: perhaps what you need is to use the NLA editor, you should check some tutos about it, it will allows you to create an animation in the Dopesheet (Action Editor mode), then move it wherever you want along the time
Comment: I don't know... What I'm trying to say is: I want to start an animation at frame 200 instead of 0... Maybe drag the key? I don't know, I'm beginner on blender
Comment: if you mean you want the cursor to start playing at frame 300, you can put your cursor at 300, press alt A, and then esc to go back and stop at 300. Or you can put your cursor at frame 300 and press S (for start, and E for end) to change the whole animation length. If you mean you want to create an animation that will only begin at 300 you can either create it from frame 300, or crate it from frame 1 and move it in the Dopesheet window, or create it from frame 1 and move its strip on the NLA editor.
Answer: I don't exactly know what you're going to say, just type "300" on the third text field (in the photo, the one with "1")

Add animation at certain frame


Include folder with py2exe

Question: I use python-pptx package for my script.
This package has a subfolder like that
pptx/
     templates/
               default.pptx
     py files

I use py2exe to generate a windows executable, but when I execute it I get this error which explains that the 'templates' directory is not put in the generated library.zip :
pptx.exc.PackageNotFoundError: Package not found at 'C:\Documents and Settings\rke99878\Mes documents\pptx_fusion\dist\library.zip\pptx\templates\default.pptx'

python files for this package are well taken, but not this folder, I tried to add package={'pptx/*'} in py2exe options, but same issue.
If I add manually this folder in library.zip, I get same error.
How can I tell to py2exe to take this folder ?
Answer: Solved the problem.
Copy the folder \pptx\templates\default.pptx in your project, and when you create the pptx use this form:
prs = Presentation(r'C:\Documents and Settings\rke99878\Mes documents\pptx_fusion\dist\pptx\templates\default.pptx')

Include folder with py2exe


Rock climbing around Seattle area

Question: I recently moved to Seattle from the bay area. Does anyone have any recommendations on climbing areas close to Seattle. I know of Index, but I have heard it's pretty hard. I am more of a beginner.
Answer: Yes, Agree with that, Index is the place be for high-quality trad on this side of the mountain. There is some trad in north bend, not with the best quality but yes exist. There are a couple of moderate lines at Exit 32 and also at Exit 38.
Some from Exit 32 -  Repo Climbing wall,
and in Exit 38 - Peannacle Climbing Wall, Shangri La Climbing
Answer: You will find this blog useful.
https://www.miyaradventures.com/blog/guide-to-seattle-rock-climbing-and-courses/
It has a list of the rock climbing areas close to Seattle along with some general info/guidebooks.
Comment: Hi Mark, and welcome to TGO. To improve your answer consider adding a summary of some of the key points from the blog post you link. This way your answer is self-contained. Who knows what will happen to the blog down the road, so it is always good to have the relevant answer immortalized on TGO directly.
Comment: Thank you, Mark. That link is indeed very helpful. I went to exit 38  today and found some good climbs. Rock is very slippery though.

Rock climbing around Seattle area


A special "dead" position

Question: Construct a position which forcibly leads to White or Black being stalemated (and both events are actually possible), meaning that the position is already dead. Further (or it would be too easy) all possible lines (which you thus of course can't actually play in a game!) contain a check of White as well as of Black.
Answer: I am not sure if this is exactly what you are asking for, but here is a try.
<code>[FEN "8/8/8/2p1p1p1/2P1PkP1/4Q1RB/3PPpPp/3n1Kbr b - - 0 1"]
[startflipped ""]

1... Nxe3+ 2.dxe3+ {2.Rxe3} Kxe4 {2...Kxg3} 3.Rf3
</code>
Black to move has only one legal move: 1...Nxe3 check.
Now:

2.Rxe3 immediately stalemates Black.

2.dxe3 Kxe4 3.Rf3 stalemates Black after checking Black.

2.dxe3 Kxg3 stalemates White after checking Black.
Answer: Since Evergalo asked, I also post a solution, where neither side is in check at the start. Problem chess etiquette says that everything that the composer does not rule out explicitly isn't cheating - for example, I used a promoted bishop, since bPh7 makes the pawn structure illegal - but ingenuity. Thus I immediately accepted the answer, especially as the "forking" into both sides' stalemate isn't as trivial as mine.
<code>[FEN "6b1/p4p1b/4pPkr/4P2p/4Pp1P/4pR2/P3PpP1/5K1n b KQkq - 0 1"]
[startflipped ""]

1... Ng3+ 2.Rxg3+ fxg3 etc.
</code>
EDIT: This is still no solution with neither side in check, since after 1...a5 the position is alive. My best try is
<code>[FEN "Bk6/1P5p/1P6/8/7p/4p2P/4PpP1/5KBn w KQkq - 0 1"]
</code>
dead after 1.Bh2+. (Two checks still follow after that in the "proof" variants, but the position is dead only after the initial check. Kudos to the first giving a "quiet" initial position!)
EDIT1: Very illegal, but working. Bg5+ and Bxb4+ are "neutral" and can be played anywhen. I did not manage a legal position with two prepended bishop checks.
<code>[FEN "BRRK1k2/1PPP1Pp1/6Pb/pp1p3p/bn3p1P/Bp3P1P/1P1P4/8 w KQkq - 0 1"]
</code>
EDIT2: A clever way (1...Ng3+) to fork into White (2.hxg3) and Black (2.Bxg3) stalemate, but the black king stands so stupid that I couldn't prepend a check. (And otherwise I need tons of pawns again.)
<code>[FEN "8/8/6p1/6P1/3p2pB/3P1kPp/3P1p1P/5K1n w KQkq - 0 1"]
</code>
Answer: Example showing why the checking condition is needed to make this an interesting puzzle:
<code>[FEN "k7/Pp4p1/1P6/8/8/6p1/1P4Pp/7K w KQkq - 0 1"]
</code>
Whoever moves, the game soon ends in stalemate,
and either side may be stalemated thanks to the double-move option.
Answer: I think I have found a position meeting all the requirements, where White, on move, is not in check. Moreover, White can play a non-checking move.
Legal position, 13 units, no promoted pieces.
White: Kh5, Rh6, Pe6,f5,g4,g6 / Black: Kg8, Rh8, Bf8, Pe7,f6,g7,g5
Black's last move was ...Rh7-h8 (possibly capturing a knight) or ...f7-f6. Before that, White might have played a pawn.

Possible lines are:

A. 1.Rxh8+ Kxh8 stalemate,
B. 1.Rh7 Rxh7+ 2.gh7+ (both kings have been checked) 2...Kh8 3.Kg6 stalemating Black
C. 1.Rh7 Rxh7+ 2.gh7+ (both kings have been checked) 2...Kxh7 stalemating White.

If it bothers you that Black doesn't check White in line A, then the solution to your construction problem is the position after 1.Rh7, Black to move: no side is in check right now but both kings will be checked before either one is stalemated. But aesthetically I prefer the longer version !
Another version : wRh6 -> wPh6 ; 1.h7+ is the only legal move and play will then follow lines B and C.
Comment: Very clever and economical!
Answer: For Hauke, here is a "quiet" position as was challenged. :)
<code>[FEN "5kBK/5P1P/5P2/4nP2/5p1N/5Pp1/6P1/8 w - - 0 1"]

1. Ng6+ Nxg6+ 2. fxg6
</code>
Comment: but this has only one variation, so only one side can get stalemated.
Comment: Half kudos thus :-) (Because it answers if it is far easier only with one side being stalemated; myself I didn't have a position up to now.)

A special "dead" position


Running asp.net app that accesses sharepoint web services on same server - getting 401 Unauthorized

Question: I have an asp.net appliation that makes use of sharepoint web services that is running on the same server as my sharepoint installation. I was using computername:portnumber to access the site, but assigned a 'friendly' URL on my DNS server for users to use. This 'broke' my asp.net app that accesses web services. I am now getting 401-Unauthorized. Anyone have any ideas as to why this is happening because of a URL change?
Answer: Try http://support.microsoft.com/kb/896861 this is a common "gotcha" with any fqdn on the same server.


How do i find low security systems from map?

Question: So I have a massive bounty that needs paying off, and to do that I need to find one of those low security systems to talk to one of those dudes that can pay it off (not specific I know, but that's not important). but no matter how long I look I can't find one. I know there used to be a way that you could see low security systems (or any security system) in the galaxy map, but I can't find it. Did they remove it or am I just not finding it? I's appreciate your feedback. Thanks!
Answer: It's still there.

Go to Galaxy map
Then the fourth tab in the left sidebar (the one with five stars)
Pick map
And then pick "Security" in the first "Map view configuration" dropdown. You'll have to scroll down in the dropdown, it's easy to miss you can do that. :)

Don't forget you can check which services a station provides in the system map, so you don't have to visit every station checking if the dudes are there.
Comment: Note that there is actually a filter for "Interstellar Factors" now, but I think it only shows up after you go to that system.


java.lang.IllegalArgumentException: Not a valid class name: ANDROID NDK javah

Question: Im learning to code Android in NDK on WINDOWS Eclipse.... been following a Tutorial Book by Sylvain Ratabouil. So im in  Run  |  External Tools |  External Tools Configurations…
creating a new program configuration.
Name:  MyProject javah
Location : ${env_var:JAVA_HOME}\bin\javah.exe
Working directory: ${workspace_loc:/MyProject/bin}
The problem comes In arguments...
when i try
Arguments:  –d ${workspace_loc:/MyProject/jni} com.myproject.MyActivity
as it says in the book
i get when i click run
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: –d

when i try ${workspace_loc:/MyProject/jni} com.myproject.MyActivity}
i get
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: C:\Paul\Workspace\MyProject\jni

UPDATE:
i put -classpath first and it's running but can not find the class file for com.myproject
Comment: Funny, this don't worked for me. I'm in mac.
This solved http://stackoverflow.com/questions/9200373/ndk-build-eclipse-argument-not-find-class
Answer: after further research....
i did it.
i set arguments to
-d ${workspace_loc:/MyProject/jni} -classpath C:\Paul\android-sdk-windows\platforms\android-17\android.jar;${workspace_loc:/MyProject/bin/classes} com.myproject.MainActivity
Answer: I also spend some long time on this problem when working with the the mentioned book about Android NDK.
Please note the following:
The java classname is NOT written in { }, just write something like com.myproject.MyActivity
The -classpath parameter can receive several paths devided by semicolon.
In my case this parameters worked:
Location:
${env_var:JAVA_HOME}\bin\javah.exe

Working Directory:
${workspace_loc:/myproject/bin}

Arguments:
-d ${workspace_loc:/myproject/jni} -classpath ${workspace_loc:/myproject/bin/classes};"C:\Eclipse\sdk\platforms\android-18\android.jar" com.myproject.MyActivity

(BTW.: The correct Adroid.jar file is referenced inside the Eclipse project.)
Answer: Me also facing the same problem tonight, i found a less tedious way as following...

as "Location" set the javah from your system
as "Working directory" set the project's bin/classes directory (${workspace_loc:/HelloWorld/bin/classes})
as "Argument" set the jni folder as the output directory and point out the class on which you want to run the javah (-d "${workspace_loc:/HelloWorld/jni}" com.example.helloworld.MainActivity)

NB :: Dont forget the double qoute (") around the output in the third step ("${workspace_loc:/HelloWorld/jni}")
A full picture is also attached following
Answer: well in case ...
1-> Goto ( cd C:\Program Files\Java\jdk1.7.0_60\bin)
2-> C:\Program Files\Java\jdk1.7.0_60\bin>javah -jni -classpath
F:\Android_OpenGLES\FibonacciNative\bin\classes
-d F:\Android_OpenGLES\FibonacciNative\jni\ com.example.fibonaccinative.FibLib
without creating/using environment variable ...
Answer: YES THAT'S CORRECT
more abstract would be
-d ${workspace_loc:/MyProject/jni} -classpath ${env_var:ANDROID_SDK_HOME}\platforms\android-16\android.jar;${workspace_loc:/MyProject/bin/classes} com.myproject.MyActivity

Answer: Following I tried successfully
javah com.sense.kios.Calculation

Note: Include package name.
In case if javah not found as an command and you getting
The program 'javah' can be found in the following packages:
 * gcj-4.6-jdk
 * gcj-4.7-jdk
 * openjdk-7-jdk
 * openjdk-6-jdk
Try: sudo apt-get install <selected package>

use direct path of jdk path, in my case it's /usr/lib/jvm/jdk1.8.0/bin/javah.


Apex: Getting the number of milliseconds in a date field

Question: Is there any way to get the number of milliseconds in a date field as either  a String or Integer? So I pass 1000000000 into the date field, I dont want the date that represents, I want that number.
Comment: Ignoring the fact that a `Date` itself contains no meaningful time information...this sounds like an X-Y problem to me. Can you elaborate on why you think you need to convert a `Date` to a number of milliseconds? Also, milliseconds from what? the unix epoch?
Comment: Yeah the case is pretty weird. Basically I am making a template creation UI. So when you create a template and you have a date field I cant have the user put in an actual date. They need to put in the number of days in the future. So in this case say it is 60. But when the object is sent back to Apex it is a date field with 60 in it so it is just setting the field to Jan 1, 1970. I was hoping there was a way I can get the actual value, in milliseconds, returned to the field
Comment: Yeah, you're definitely going about this the hard way. Do you have a controller or controller extension (in apex) that you're using to back up your UI? If so, can you edit your question to include that code?
Comment: Well its the controller Im working on. Right now im trying to figure it how (or if) I can get the value I send back in that date field. If not Im gonna have to go back to the drawing board. I am looking at alternative ways to send across the object data
Answer: I assume you are talking about a Datetime field, as the timestamp representation of a date isn't very meaningful. If you want to get the timestamp representation and the data type Long is also suitable for you, you can use the getTime-method of the Datetime-class, which is described here: Datetime getTime

getTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this DateTime object.
Signature
public Long getTime()
Return Value
Type: Long

DateTime dt = DateTime.newInstance(2007, 6, 23, 3, 3, 3);
Long gettime = dt.getTime();
Long expected = 1182592983000L;
System.assertEquals(expected, gettime);

Edit: If it is a Date-field, you could also convert it an use a fixed time of the day for this conversion. This can be achieved using the newInstance(date, time)-method of the Datetime-class.
Answer: If you want to get the date a certain number of days in the future, you need two Date methods: today and addDays.
Date target = Date.today().addDays(60);

Answer: If you truly can't allow your users to input a future date using the standard date picker that you'd get when using a Date field in an <apex:inputField>, then Adrian's answer explaining how to use Date.addDays() is the right way to go about this. The rest is simply a shift in your UI perspective.
If you're asking your users 'how many days in the future do you want this thing to be?', then your UI shouldn't be asking for a date, it should be asking for an integer.
If the sObject that you're working with has a Number field that you can use, then most of the work is simply updating your visualforce page to take the input, and store it in your chosen field.
If you don't have such a field available, or aren't working with an sObject, then you'll need to add an attribute/property to your controller like so
public class MyController{
    // We need to specify both a getter and a setter for this to work.
    // This is the simplest way to define a getter & setter.
    public Integer numDays {get; set;}

    // other controller stuff, like a constructor
}

The unfortunate bit about using something other than an sObject field is that you won't get an automatic label for the input field in your visualforce page. You'll have to make the field label yourself. Otherwise, using a controller property in <apex:input> is very similar to referencing a field in an <apex:inputField>
<apex:form>
    <apex:input value="{!numDays}" type="Number" label="Delay x Days" />
</apex:form>

The final bit (in both cases) is using this data to calculate your target date. To do this, you'll most likely want to override the save() method from the standard controller in your extension.
public class MyController{
    // We need to specify both a getter and a setter for this to work.
    // This is the simplest way to define a getter & setter.
    public Integer numDays {get; set;}

    // other controller stuff, like a constructor

    // This is how you override the save method.
    // When you click the 'save' button, this method will be called instead
    //   of the standard controller's save method
    public pageReference save(){
        // Salesforce hides the details, but inside this method, you'll
        //   have access to the number that your user put into the page via
        //   'numDays'

        // And here we see the usage of addDays that Adrian suggests (with
        //   one small change)
        // I assume that your controller extension has a `myObject` attribute,
        //   that it is a reference to an sObject, and that it has a 'target_Date__c'
        //   field
        myObject.target_Date__c = Date.Today().addDays(this.numDays);

       // Assuming your controller extension is storing the standard controller
       //   instance, you can let the standard controller's save() method take care of the rest
       return this.standardController.save();
    }
}


How to get a particular y value on a graph from Excel

Question: Here below is my Graph:

Let's say I have a reading of 1.02 ml (the x-value from the graph) from my buret, how do I find the corresponding y-value?
Comment: I would like to post the image, but posting images require 10 reputation... Could someone please help me?
Answer: When you hover over a data point in an Excel chart, a tool tip comes up with the data point's values. When you hover on the line between two data points, you'll get the value of the closest data point, not an interpolation of the value for the current position. Excel is not built to deliver that.
The sample chart you show does not seem to be a function, but arbitrary data. You'd need to use a worksheet formula to calculate the desired result, for example
Answer: I broke down the graph into smaller graphs, only graphing 0-10 ml and then displaying the equation on chart, then graphing only 10-20ml, and 20-30ml is just a straight line so any buret reading between the range of 20-30ml will always have a correction value of -0.01ml.
Then using the equations provided by Excel, I obtained the y-value for a certain range of readings by plugging in the x-value.
Thank you for the help (@fixer1234) and answers!
Answer: There isn't an actual Y value for that X value, so you have to interpolate based on the actual points on either side of the value you're looking for.  teylyn's example will work for the first leg of your graph, but let me give you a more general solution that will work for any point.
It looks like the data is roughly:
<code>    A     B
   ===   ===
1   X     Y
2   0   0
3  10   0.01
4  20  -0.01
5  30  -0.01
6  40  -0.02
7  50  -0.06
</code>
Since these are straight lines, you can calculate the value from the equation for a line: Y=mX+b, where m is the slope and b is the intercept (the Y value when X is zero).  The simple ratio in teylyn's example works because in that leg, the intercept is zero.  To calculate any point, you can use Excel's built-in functions for slope and intercept.
Say you have your X value of 1.02 in cell D2.  The formula in E2 for the corresponding Y value would be:
<code>=SLOPE(B2:B3,A2:A3)*D2+INTERCEPT(B2:B3,A2:A3)
</code>
The SLOPE and INTERCEPT functions specify the range of Y values, then the range of X values.  Since the value you want to interpolate lies between the first and second data points, those are the values used on the formula.  For any other X value, use the data points it falls between.


How to calculate resistance, inductance, capacitor value for dc-dc buck-boost converter

Question: How to calculate resistance, inductance, capacitor value for dc-dc buck-boost converter when using  with Solar panel? I am working on a project. Charging battery with solar panel with/ without  MPPT. I am doing this simulation on MATLAB with Simscape Power Systems and Electronic Library. Which allows me to choose Solar panel (I am using SolarWorld SW220 mono Pmax=220w, Vmax= 29.3V, Imax=7.51A) and Battery( lead acid 24V, 16Ah). Also, I need to calculate the efficiency of each case. However, I don't know how to monitor battery charging in MATLAB.
I tried to reach tutors online but could find anyone who had knowledge on this subject. If anyone can suggest equation, tutor,website, please, comment!
Comment: Read the datasheet for your chosen buck-boost device?
Comment: didn't choose buck-boost device, it is simulation so I need to create myself (give values).
Comment: So how are you boosting (or dropping) the voltage then? There must be some active component in your circuit to do it - what is it?
Comment: Right now it sounds like you are asking about calculating fuel consumption for a car by specifying the fuel octane and the tyre pressure without even knowing what the engine is.
Answer: Join TI's Webench: http://www.ti.com/lsds/ti/analog/webench/overview.page
The WEBENCH Power Designer will show you various components to use, allow you to set all the parameters and even show costs involved. While obviously they use TI active components, you will learn enough to be able to translate to any components you might select. By looking at their design in Webench and then reading the datasheets you can learn a lot.
Comment: Webbench has to be one of the most useful engineering tools ever created. I use it all the time.


Delete iPhone MMS Messages Only

Question: I'm running out of space on my little 16GB iPhone 4S. I have noticed that a very large chunk of the space is taken up by the Messages app. I believe this is due to the tons of MMS messages I've sent and received over the years. I would like to easily delete all MMS messages (pictures/videos) without deleting any conversations and without having to manually find and delete each one. Is this possible?
Comment: When I faced the same problem recently, I thought about if, and how much I look back through the entire threads - meaning, "are they worth keeping around". I concluded that it was (a) too time intensive to just clear out media out of conversations, (b) I really don't look back through those conversations. I typically view the media, and then reply/move on. I still haven't missed that history. Just something to consider.
Answer: On iOS 7, in the conversation window, if you hold on a message balloon you get the context menu with two options: Copy and More.
When you tap More, you will get into the edit screen where you can select and delete individual messages.
Comment: Thanks for the reply, but it would take me hours and hours to go through every conversation and every message in each to manually search for only MMS messages. Is there a way to find and delete all MMS messages automatically?
Answer: go to settings, then messages, then scroll down to mms messaging and turn off.
Comment: This does not delete current messages, only prevents *sending* of MMS messages.

Delete iPhone MMS Messages Only