Craft on Heroku is not logging. How can I make it start?

Question: I don't have any logs appearing in craft/storage/runtime/logs (in fact I don't have anything at all in craft/storage/runtime.  I'm running Craft on Heroku.  I've tried setting post-install scripts in the composer.json file to run
chmod -R 774 craft/storage

but it doesn't change the permissions (they remain at 700).  We run Papertrail to collect logs from the dynos, but these only seem to include web requests - no application logging.  I've tried enabling devMode, but it makes no difference.
I'm trying to debug some issues we have with the application occasionally falling over, but without access to logs it's impossible - is there any way to make Craft start logging?  Just logging to stdout would be fine, as Papertrail would collect the logs. I can't find any configuration options, maybe I've missed them?
Answer: There is a plugin that redirects all of Craft log output to stderr that works on Heroku and Fortrabbit.
https://github.com/ostark/craft-stderr-logger


Does the Oort cloud have any large holes in it and if not does this mean nothing large has entered the solar system for a long time?

Question: Would holes in the Oort cloud be a record of what has passed through it?
Comment: You should be aware that nobody has ever observed anything in the Oort cloud.  It's existence is infered from long period comets. But anything about the detailed distribution of objects is hypothetical.  Remember also that objects in the cloud are not fixed, they move in orbits around the sun.
Comment: So the answers to your questions are "nobody knows" and "probably not"
Comment: A buddy asked me for documentaries on either the Oort Cloud or the Kuiper Belt. There's like one and a half of them, all of which are speculation and neither of them were very good.
Comment: Recently asked: https://astronomy.stackexchange.com/questions/55039/whats-the-reason-for-the-hollow-region-in-oort-cloud
Comment: Note that Oort cloud entities are prone to perturbations and so they can gravitate/accumulate to bodies with bigger mass. Have a read: https://articles.adsabs.harvard.edu//full/1992MNRAS.259...37C/0000037.000.html
Comment: @Nilay Gosh That reference is a very interesting read. Stars passing the Oort Cloud reduce the angular momenta of comets so they head in towards the planets. Also the cloud density oscillates and the cloud may gradually disappear as planetisimals get pulled out of it.
Comment: ""Space is big. You just won't believe how vastly, hugely, mind-bogglingly big it is..."  Douglas Adams
Answer: The Oort Cloud has not been directly observed.
The Oort cloud is still theoretical. We're pretty sure it's there, but we don't have direct evidence. The objects that make it up are too small, too dark, and too far away to observe. We only see comets when they get close enough to the sun for the surface ice to start to burn off and produce a tail of dust behind it. In the "freezer" of the theorized Oort cloud, it would be like trying to see a lump of coal on a moonless night.
The question of whether there are holes in the Oort cloud presupposes we have a good map of the area, which we don't.
If an object made a big hole in the cloud, it would vanish over time.
The Oort cloud (assuming it exists) is made up of many small objects in orbits in a wide range of orientation, distance, and eccentricity. What that means is the orbital period of any given two objects are almost certain to be wildly different, and their paths crisscross throughout the cloud.
If you were to, say, fire a massive laser into the cloud, burning away every object in a huge area (this is not recommended), the hole would vanish over time. It might be possible for a while to detect a "thinness" in one direction over another, but it would probably be impossible to spot after a few thousand years (if you could even see oort objects). Removing those objects would end up just thinning out the oort cloud in general, but not with any directionality.
Comment: Although we don't know exactly how many object are in the OOrt cloud, they are certainly pretty spaced out (it's not like a cloud on earth, nor like a starwars asteroid field) There's enough gaps to let light and cosmic rays through.
Comment: Doubtful. As I said, the chaotic orbits of oort objects are probably going to mean any disruptions smooth out across the whole cloud in a (astronomically) short time.
Comment: @Adrdav22 We are pretty sure that a star passed through the Oort cloud 70,000 years ago.  This is Scholz's star. We know its trajectory and we can see that it came well within the supposed oort cloud.  Gl710 will do so in the not-so-distant future too. We don't know about any "holes"
Comment: There would be more high energy cosmic rays coming through holes perhaps.
Comment: Long period comets come from an Oort cloud. There is AFAIK no alternative credible model.
Comment: @ProfRob Like I said, we're pretty sure it exists, but we haven't mapped it.
Comment: @James K We can at least rule out the likelihood that a large star or black hole has passed through the solar system. There are a billion comets estimated and these would have scattered all over the place and perhaps have struck Earth. Of course a star passing more closely to Earth could have disrupted all planet orbits.
Comment: We're able to detect variations in the CMB that were created when the universe was in its infancy. Once we're able to observe the Oort Cloud, maybe we'll be able to see the remnants of holes.
Answer: Maybe, but not likely.
Let's look at something similar - the Asteroid Belt.
The Asteroid Belt between Mars and Jupiter (not really "between" since some of it extends past Jupiter, and depending on your definition, some is inside Mars' orbit, all the way close to the sun).
The Belt has several gaps and clusters. This is Not even close to scale. Most of those dots are as small as 300 feet.

The Belt's total mass is quite tiny, about the total mass of Pluto. We've tracked many objects there and have a good idea of the total mass.
The Oort cloud's total mass is estimated to be somewhere between the mass of Earth and the mass of Saturn. Saturn isn't really a "large" object astronomically. The Oort cloud is estimated to be 1 to even 3 light-years thick. Scattering the mass of Saturn across even one light year would basically be dust. The distance between objects, even tiny ones, could be multiple AU.
If we go with 3 ly, then the area of the cloud in 2 dimensions is about 27ly squared. It's in 3 dimensions, and lets say it is 1 ly thick. That's 27 cubic light years of volume to fit the planet Saturn.
It is much less dense than the Belt.
As a side note, when NASA sends out a probe past the Belt, they track some of the larger objects and plot a course to not hit them, and ignore everything else since the distance between asteroids is mind-bogglingly-huge.
Thus, since we don't track anything through the Belt this way, it would work even less for the cloud.
But, we have to define "large" in your question. If you mean like a black hole,  or Betelgeuse, then probably not in a billion years. Its gravity would have totally wrecked the whole system, since its size is about the orbit of Jupiter. (Not the size of Jupiter, its diameter is the orbit of Jupiter. It is extra-large.)
Since we are estimating the size of the cloud, and Pluto's orbit is about 5 light-hours vs a few light-years of the cloud, Pluto's orbit gets rounded out.
It is a very interesting theory, and if we could measure the objects in the Cloud, closely, and in real-time, if it exists, then we might could track something planet or star-sized that moved through it.
Comment: @Adrdav22 If I'm not mistaking that is the average density in between galaxies, and considering how much empty space there is that is still a mind boggling large amount of matter.
Comment: "The Oort cloud is estimated to be 1 to even 3 light-years thick...." Interesting: _if_ Alpha Centauri has its own Oort cloud, the gap between clouds should be of the same order as an average Oort cloud.
Comment: @Adrdav22, A=pi r ^2. If r is ~3, then A ~ 27.
Since all these are speculation/hypothesis, it very well could be wrong.
Comment: @MikeP is the "three LY thick" counting the radius (i.e. distance from sun or us to the outer "edge") or the diameter?
Comment: @Michael I got my calculation wrong. It should have been the mass of Saturn 10^26 kg in 27 light years cubed (10^48 m^3) This is 10^ -22 kgm^3  one billion times larger than my first calculation.


Smooth Zooming?

Question: I just got a Logitech G502 Proteus Core mouse (yay!). It has a mode where you can set the scroll wheel to be smooth instead of having "clicks" like usual scroll wheels. However, when it is set to smooth mode, blender still pretends as if there are "clicks" when I am zooming in. Is there any way to fix this?
Comment: Related: http://blender.stackexchange.com/a/19757/599
Comment: It's actualy the other way around. Blender doesn't pretend there are clicks, because there really are clicks. Smooth scrolling is a software trick and the mouse is just pretending there are no clicks. Off-topic: also you should have gotten Roccat Tyon, had both and the roccat is better for almost same money.
Comment: @Jerryno Thanks, I get it now. Also, the roccat tyon is not better. I considered it, but: the sensor is significantly worse, I've heard some of the buttons are very hard to reach comfortably, and it does not have the smooth scrolling feature. Additionally, the tyon is not available at Best Buy, and I had a few gift cards for Best Buy.
Comment: Yes, the sensor is worse but on a pad which I consider a must there is no difference. Some buttons are hard to reach true, but that takes just getting used to and I use many of them instead some shortcuts in blender. I don't like the smooth scrolling, and roccat has the best clicking scroll wheel I had. I see you did your research and made an informed decision. Still love the Tyon but the G502 is hell of a mouse too.
Answer: As a side note, you can hold "Ctrl" + "MiddleMouseBtn" and drag in the viewport for smooth zoom.
Search for zoom in shortcut preferences.

Smooth Zooming?


LevelHelper / SpriteHelper / Coding Images

Question: I have currently built my sprites in SpriteHelper and levels in LevelHelper. I have included most of my sprites in the Level but i want to also add some separately in the code. This is so i can spawn at different rates and times based on the users progress and collections of other objects.
Can someone help me or point me in the right direction on how to include a sprite from SpriteHelper (with physics) into my code. Do i need to generate the SpriteHelper code and include it in, even though i have already included the LevelHelper generated code?
Thanks
Answer: you can create lhsprite using levelehelperloader object manually at run time. see the link below http://www.gamedevhelper.com/documentation/documentation.html#top
In levelhelper documentation search for createsprite you will get enough information to create new sprite.


Does the set of natural numbers contain infinity?

Question: Let $N=\{1,2....\}$ be the set of naturals numbers. Is $\infty \in N$, as the list is never ending  ?
Comment: What is $\infty$?
Comment: Is this some kind of trend? ;-) Almost the same question was asked earlier today: http://math.stackexchange.com/questions/1482450/is-aleph-0-a-natural-number
Comment: @BLAZE You can think of it this way. It doesn't make sense to speak about "John" in general, because there are many people called John. But you can consider a particular person called John, and say "From now on when I say John I mean this person." If you want you can even take someone called "Amy" for that, but people will look at you funny. It's similar here: there are many different objects in math that some people like to call "$\infty$", and so if you don't say which one you're talking about it's meaningless. If I ask "Is John in the room right now", it's meaningless, it could be any John.
Comment: Short answer: No. $\infty\notin\Bbb N$.
Comment: @BLAZE: Yes, of course. But why would the pedal curve of the hyperbola.be in $N$?
(I was asking that because asking if $\infty$ is in the set of natural numbers suggests one wonders if $\infty$ is a natural number)
Comment: @BLAZE I completely disagree. "$\infty$" is not a well-defined entity. Different people mean completely different things in different contexts using the symbol "$\infty$". What is your *definition* of "$\infty$"?
Comment: @BLAZE This is *one* infinity. As I said, there are many things that can be denoted "$\infty$". Do you think it's the same $\infty$ as in $\lim_{x \to \infty} 1/x = 0$?
Answer: One property about the set $\Bbb N$ of natural numbers is that it does not have a largest element, so if you defined $\infty$ as some element which is larger than every natural number, it wouldn't be in $\Bbb N$ anyway because of this property.
Having said that, I recommend you look up the ordinal numbers and what it means for a set to be well-ordered (it means every subset has a least element).  We could add an element into the set $\{1,2,3, \dots \}$ which we define to be larger than every element in $\{1,2,3,\dots \}$.  Usually, instead of $\infty$, we call the element $\omega$.  But the set $\{1,2,3,\dots, \omega \}$ is a different set than $\Bbb N$ (it contains $\Bbb N$ as a proper subset).  $\omega$ is the largest element in this set, and you could think about $\omega$ as "infinity" in some sense.
But then we can add an element defined to be larger than every element in this set.  Let's call this element $\omega + 1$.  So $\{1, 2, 3, \dots, \omega, \omega + 1 \}$ is the set where $\omega$ is larger than every natural number, and $\omega + 1$ is larger than every natural number and larger than $\omega$.  So, it's not useful to call $\omega$ "$\infty$" because there is something larger than it.  (Although, Georg Cantor proved that, as far as set cardinalities/sizes go, there are infinitely many distinct infinites...).
Comment: @holroy Sort of. In set theory, everything is a set, and $\aleph_0=\omega=\Bbb N=\{0,1,2,\dots\}$. However, since _everything_ is a set, we have weird things like $2=\{0,1\}=\{\{\},\{\{\}\}\}$ in set theory. Outside of set theory, $\aleph_0$ refers to the amount (cardinality) of elements in $\Bbb N$, and $\omega$ refers to their order type (sort of), and there's no reason to think of these as sets.
Comment: @holroy A big difference between $\aleph_0$ and $\omega$ is that $\omega+1\ne\omega$, but $\aleph_0+1=\aleph_0$. In set theory, where $\omega$ and $\aleph_0$ refer to the same set, they just say that the symbol $+$ means different things in those two equations (the former being _ordinal addition_, the latter being _cardinal addition_.) Fun fact: ordinal addition isn't commutative! It's defined in such a way that $\omega=1+\omega\ne\omega+1$.
Comment: Is $\omega$ the same as "aleph_0", which we were told was the highest countable number?
Comment: @holroy The _ordinals_ have the property that, for any set $S$ of ordinals, there is a smallest ordinal bigger than anything in $S$. The ordinals include $0$, $1$, $2$, etc. (No negatives of fractions, though.) By the above property, there is a smallest ordinal bigger than anything in $\{0,1,2,\dots\}$, and it's called $\omega$. ($\omega-1$ is not an ordinal.)
Answer: No, if $\infty \in N$, then the list would have an end, namely $\infty$. Of course, you would still need to go infinitely far up from $1$ (or indeed any other number) to get to $\infty$.
Comment: To add to this answer, you can define the extended Natural numbers to be the union of the Natural numbers AND infinity.
Answer: Infinity is not well-defined as it has different meanings depending on the context so placing it in a set that is well-defined (the set of natural numbers $\mathbb{N}$ for instance) is clearly meaningless.
Comment: @Ranc Really? What your definition of "$\infty$"? There are many things that can conceivably be called "$\infty$". One compactification of $\mathbb{R}$ is $S^1$, another one is $[-\infty,+\infty]$, etc. And this is a completely different beast than, say the ordinal $\omega$ mentioned in another answer.
Comment: Sure. This is an example of the general idea of "Compactification" which is studied in topology. Though the $\overline{\mathbb C}$ is a *very* elegant and intuitive example, as it is a sterographic projection of Riemann sphere.
Comment: @NajibIdrissi I agree. The definition (or somewhat - aspect) of infinity is context-wise. That being said: it is always (as in mathematics) well-defined.
I was only referring to the "definability" issue, and attempted to show more aspects of the term (infinity).


How can I add a recepticle to this junction box full of push splices?

Question:
This is a picture of the junction box with all the wires. I've just never seen a junction box with this many wires. I'm brand new at DIYing electrical stuff but I'm fixing my attic up into a bedroom and there's a light in the middle of the ceiling but absolutely no electrical outlets — just the light and then the junction box has the light running out of it.
Answer: Good news and bad news.
The good news is, this is very strightforward.  This box is being used solely for distribution.  There are no switches involved here, so you have the good luck that the wire colors happen to match up to wire function.
All these wires aren't just sitting here waiting for you.  They all are already doing a job.  One cable (black/white pair) supplies power and the other ones take power onward to places where it is being used.  If you separate them, those other places will no longer have power.  To add a load here, you'll need to add its black, white and bare wires to each group, and keep the others still together.  That means putting 5 or more wires together.
Stab connectors
The wires are going into jab/stab connectors, which are full. You cant add wires, and they can't be used twice anyway.
To remove each wire, grip the stab connector firmly and pull the wire out firmly while twisting slightly (45-90 degrees).  If the connector has a release tab, that may help.   Start with the longest wires until you get the hang of it; don't twist the wires exscessively as you don't want metal fatigue.  Do not simply cut the wires, because wire length is precious.
The stab connectors are single-use and there is no saving them.  Into the trash they go.  They make "lever operated" connectors that are far more reliable, and they can be reused.  For novices, I recommend connection styles made for re-use.
However, stab junction blocks have one merit, they can take as many as 8 wires.
Box fill
The bad news is the box is getting pretty full.  We calculate box fill based on cubic inches.   This 4x4" deep box has 30.3 cubic inches.   You are working in 12 AWG wires (do not use 14 AWG wires here!), and those take 2.25 (2-1/4) cubic inches per wire.
All grounds count as 1 wire.  All cable clamps count as 1 wire. That accounts for 4.5 cubic inches, leaving 25.8 cubic inches.  That is enough for 11 black and white wires.  You have 8 already, so you can add one more cable here before "cubing out".

You can get yourself more cubic inches by adding a "domed box cover" (4-10 cubic inches)  or a "junction box extender" (21 cubic inches).
Another option is to add a receptacle here.  They make 10.2 cubic inch domed covers with a cutout for a receptacle.  A receptacle or switch costs you 2 wires' worth (4.5 cubic inches), but when added to the box, you have just enough room for 14 wires.  (7 cables).

Further, certain receptacles allow "screw-to-clamp" wire attachments (back wiring under the screws, tighten to clamp). These take 4 wires per side, so you can use this type of receptacle to splice 4 cables into each other also.
if you need more than 4 connections, you can "pigtail", run a short wire  between one splice group and the other.   Pigtails count for 0 cubic inches.
Comment: @RossMillikan True, but a dome or extension is an easy fix.
Comment: It looks like OP has access to replace the box with a larger one, if desired, to solve the box fill problem.
Answer: After reading your question and Harper's comment, it looks like it might be safer to run a new line to your panel to add some plugs.  There are times when it's best to pay to have a professional come in and do it to make sure you and your family are safe, and this might be one of those times.  Adding plugs to lines that might have already reached their maximum number of fixtures can be bit risky.
Comment: The NEC has no limit on outlets on a given circuit, at least not in residential work
Comment: In my area they do. Depending on the locality it's either 9 or 12.  They count switches and plugs.
Comment: Are you in Canada perchance?
Comment: There's also the issue of how many appliances are already on the circuits and how close they are to maxing the load capacity. It's one thing to run 35 outlets if you're only using two of them at a time for your laptop and phone charger. It's different if you're already running a couple heavy appliances off the circuit and just *need* to plug in that new 2000 watt bass amp for "practice" sessions.
Comment: Ya Southern Ontario.  I didn't know it was different south of the boarder.  Just thought the number of fixtures would vary.
Comment: I'm about 8 outlets on each circuit and so far we're not heading that I'm only trying to add three in my attic and already have three downstairs all together in my son's room and the bathroom and those are the only rooms that run on that circuit


Filament moving around and not sticking to bed

Question: I have only just set up my Anet A6 today. I am trying to print a calibration box, but the print is moving around the bed while trying to print. Any ideas how to fix this? The documentation is very vague.
Basically I am very new to 3D printing. I purchased an Anet A6 and have set it up stock. I am trying to just print the box directly from the demo models on the SD card. I'm using the standard filament that comes with the printer. I'm not sure what type it is.
All settings are default.
Comment: Welcome to 3dPrinting.SE! More than likely you don't have the bed leveled correctly, or you don't have the bed hot enough. You really don't give us any information as to what exactly you're doing. Please edit your question and include what type of filament you're using (PLA, ABS, etc), the heat settings (bed/extruder), and what slicer you've used to make your monstrosity. This will help us be able to help you.
Comment: Hi @Andrew Hawkins bed adhesion is a pretty common type of question. That said I would need photos etc to see exactly what is happening. That said this might be related https://3dprinting.stackexchange.com/questions/4774/prusa-i3-first-layer-does-not-stick-and-looks-jagged
Answer: If the printed material moves with the nozzle, you might have several problems at hand, e.g.:

adhesion,
nozzle to bed distance and
overall level.

Nozzle to bed distance needs to be the thickness of a plain A4 or Letter paper. This needs to be at the same distance (when pulling the sheet of paper you need to feel a little drag) at the complete area of the bed. This is sometimes difficult as not all beds are perfectly flat from itself. Finally, you need to pull some tricks out of your sleeve to get the filament to adhere to the bed. Many example can be found, popular ones are using blue tape, glass bed, glue stick, PVA based spray (e.g. strong hairspray or dedicated spray cans like 3DLAC or Dimafix, etc.), or a combination of these. You just need to experiment some more what works best for you, but it is good to start with a correctly levelled bed with the proper nozzle gap. Sometimes, increasing the bed and filament temperature with 5 °C for the first layer also helps.
Comment: When i try to get it this low, it seems to scrape the bottom of the bed. Im sure my bed isnt level, as i can get it spot on on both sides, but then when i move the head across there is a gap in the middle
Comment: [Video of the attempted print of sample box](https://sendvid.com/dpibrbpx)
Comment: @AndrewHawkins Then it would be a great time to invest in automatic bed levelling. But from the video can be seen that you do not have enough adhesion also.
Comment: Thanks, do you think thats the key issue then , the adhesion? if i try hairspray as reccomended by @dcoll, do i just spray it on the bed and rub it around?
Comment: @AndrewHawkins Yes I recommended you to use hairspray if you don't have a specific product for bed adhesion. Glue-stick will also work, that is basically PVA, wood glue should also work. Please experiment, but if the bed has a too big of a dent it will not work. However, in your video you don't start in the middle with printing which let me believe that the bed adhesion in not optimal. You can also increase the bed temperature by 5 °C. Please [edit] your question and insert print temperature and bed temperature.
Answer: Also check your speed settings.
1st layer should always be printed 50% of the normal speed, if not less. (my choice is 20mm/s)
If your overall printing speed is really fast, collision with already printed lines may be the issue. You can try either slow down movement/print or avoid/retract over peripherals.
Any hairspray containing neodecanoate copolymer is a great adhesion, and very cheap :)
Answer: Chances are, you're not levelled close enough. try levelling your bed when it's heated around 60C (or as high as you can get if your machine's FW won't let it go that high) with a piece of standard printer paper. you should get a bit of resistance, and play around with the paper for a bit, find a happy medium. Try spreading glue stick on your bed, or spray it with hairspray. If you have BuildTak or some form of PEI, wipe it with some 99% rubbing alcohol. Lastly, find a fairly simple model on thingiverse.com or myminifactory.com, and slice it using either Raft or Skirt as build plate adhesion. I prefer a skirt because you can actively be checking how your bed levelling is, and adjust it. And make sure your first layer flow or extrusion multiplier is slightly higher is about 110-120%. This can get you good sticking almost every time.
Comment: Please troubleshoot based on the information given, which states "anet A6, as it comes shipped". Look up the specs on Gearbest if you need - half the information you give here is just not applicable to this machine.


Manage displayed content on external data based on data available in SFMC or Pardot

Question: I'm looking for a solution that will allow to manage displayed content on external website, displayed content should be dependent on data from SFMC or Pardot and be easily configured preferably by drag-n-drop (something similar to content builder Dynamic Content Block - like for user with gender=male show content A).
Is there a possibility to achieve something like that with Predictive Content in SFMC? Or are there any external apps easily integrated with SFMC/Pardot that will allow for that?
Answer: With Pardot you use Advanced Dynamic Content. See explanation here in Pardot Help section.
With Marketing Cloud there is no easy way to achieve this. Dynamic Content Blocks are used for email and Predictive Web (part of Personalization Builder) is used for content distribution based on past prospect behaviour.


Remember something like a snake bite

Question: In my native language, there is this expression - to remember something (an unpleasant, bitter experience of the past) like a snake bite. Are there expressions in English with the similar meaning?
Comment: Got it. Do you want to use this expression in something you're writing? If so, "I remember it like a snake bite" would be a beautiful way to express that in English.
Comment: @gotube It could be the day when you lost your job or the day when had a nasty car accident or the day when parted with your girlfriend. It could be anything that made that particular day memorable for you in a negative way. The past experience someone had was so unpleasant that it is compared to a snake bite.
Comment: I can't think of any good match. Natural ways of expressing this without using an idiomatic expression include, "*not remember it fondly*", "*have bad memories of it*". These might help you find expressions with that meaning, if there are any. Also, please consider adding an example or two of situations where it's used in your language. This could help people remember an equivalent English expression
Comment: @gotube No, I don`t. I usually try find idioms or colloquial expressions in English that will match the ones in my native language.
Answer: It left a bad taste in my mouth is close, but it only applies to things that people normally remember fondly, but because it didn't go the way they're supposed to, you can't remember it fondly.
For example, you're invited to a friend's house for a party, but when people start going home, your friend asks everyone to pay their share of the costs of hosting.
Something like that would pretty much ruin your memory of that event.
This expression is not about anything that goes wrong, like a picnic getting rained out. It's about situations where someone makes people uncomfortable by handling it wrong, especially by violating social expectations.
Comment: it is close but no cigar.
Answer: Maybe once bitten, twice shy - it means something like "a person who has had a bad experience of something will avoid it in the future".
Comment: yes, it means that a person has had a bad experience but it does not necessarily imply that he will avoid it in the future. This expression solely focuses on the fact that something happened in the past that a person is recalling the day it happened.
Answer: As if it were yesterday
When hearing people people recount accounts of their lives, I often hear this expression.

I remember that as if it were yesterday
Comment: But there is no negative connotation here (except, maybe, that memory plays tricks on us :).
Answer: There's the idiom be stamped on your memory or be stamped on your mind, which Macmillan defines as "to be impossible to forget, although you would like to".
They give the example: "His face was stamped on Maria's memory."
It suggests that something has left a permanent imprint in your memory, as with a stamp or brand, and you are permanently marked.
Answer: I would go for the idiom etched on one's memory:

if something is etched on your mind or memory, you can still remember it very clearly, sometimes when you would prefer to forget it (macmillan)

It can be used for both positive and negative memories, depending on context. The stress falls on the vividness of the effect of those particular events.
The verb etch does have the connotation of a sharp, cutting or stinging effect if you want. It means:

to cut a pattern, picture, etc. into a smooth surface, especially on metal or glass, using acid or a sharp instrument:

He etched his name on a piece of glass. (Cambridge)

Some even use the expression with skin:

I remember it as if it were etched into my skin.

Consider

And I had to work with him, all while my heart was breaking from the inside out over and over and over again, the shattered pieces of glass fading into sand, etching its memories into my skin and into my soul. (Etched in Honor, by Carrie Ann Ryan)
Answer: There is an proverb that says

a burnt child dreads the fire
Quoting the Farlex Dictionary of Idioms, FreeDictionary says:

Someone who has experienced some kind of negative situation or consequence will try to avoid making the same mistake or experiencing the same situation again.

So the stress here falls rather on learning from bad experiences because you remember it like a burn.
Answer: If someone is telling you something and say they don't remember much about it, it is common in English to react to this by saying:

I'd remember that! [that=the experience]
OR
We also often tend to end the sentence with the type of experience or situation:

I'd remember if I got kicked out of class!

I'd remember my mother falling and hitting her head!

I'd remember a snake bite!

I'd remember winning the lottery!

So, to answer the question, we don't have a specific idiom for this but we do have a usual ending to express surprise at a situation.

Remember something like a snake bite


What to say when my request is declined

Question: I asked something about my assignment to my professor by email and she declined it because it is not fair to give more chances only to one person.
How can I respond to this email politely and show her that I get what she said and I'm totally okay with it?
Is there any better way (more polite and sincere) than " Okay, thank you" ?
Answer: You can indicate that you have listened to and accept what the other person says by saying something like:

Put like that, it seems reasonable.
When you put it like that, I understand your position.
I'm sorry, I hadn't considered it from that point of view.
Answer: Thank you for your prompt reply to my request. I had not considered that the request would give me an unfair advantage. So most of all thank you for trying to maintain a fair environment for the all the students in the class.

What to say when my request is declined


What are the Naruto hand seals based on?

Question: There are a number of hand seals in Naruto that are used to perform jutsus. I know that the seals themselves have different zodiac signs. Is there any lore or historical basis for these seals, or was it invented by the creators of Naruto?
Comment: just out of curiosity, I'd say that he is Obito, but which jutsu is he performing?
Comment: Since he is an Uchiha and his last sign is Tiger I think it's safe to assume it's a Fireball technique. I'm not sure if we have ever seen Obito perform Earth-style jutsus. http://naruto.wikia.com/wiki/Hand_Signs#Basic_Hand_Seals
Answer: The hand seals in Naruto are based in Mudra, which are symbolic/ritual gestures associated to Hinduism and Buddhism. Mudra are used in everyday life, from religious practices to dances, going through martial arts as well. The most well-known Mudra is probably Añjali Mudrā, which often accompanies the greeting Namaste.
In the French version of the Mudra Wikipedia page, they do indeed link directly to Naruto's hand seals page, unlike what happens in the English page. However, they don't add much info other than the fact that they are called Mudra, and that they're based on the Chinese Zodiac.
From Wikipedia's page on Mudra, on its use on Martial Arts (highlight by me):

One of the more curious things that I encountered in my martial arts training was the use of mudra in combative arts. Mudra (Japanese: in), for those who aren't familiar with them, are these weird hand gestures that are derived from esoteric Buddhism (mikkyo), particularly the Tendai and Shingon sects. These gestures are supposed to generate spiritual focus and power which then are manifested in some way externally.

However, as far as I know (and also according to this page) the use of Mudra in Ninjutsu is made up by Kishimoto (once again, highlights by me):

Although the use of hand seals in ninjutsu is entirely made up by Kishimoto, seals are used as ways to focus energy during Buddhist meditation. Also, special hand signs, called mudras, are used to convey a certain concept into the user. For example, a right hand raised with palm facing outwards means "no fear", and grants the user that concept's blessing through their meditation. The seals in Naruto are from the oriental zodiac, the 12 animals which name the years (I was born in the year of the snake, for instance), the properties of each seal representing what that animal's qualities are - Eg, Tora/Tiger seal is fire.

Basically, in real life hand seals are used in meditative practice, and are supposed to help the user get into a certain state of mind.
In the Naruto universe, Kishimoto decided to use these ancient signs in a different way (associated to Ninjutsu), but their purpose is basically the same. The user performs hand seals in order to gather/mold chakra, which means that he is entering a certain state of mind when he does so. Also, when a user masters a jutsu he needs to perform less/no signs before he can do it, which means that the meditation phase before the use of the jutsu can be skipped/sped up. Similarly, the more one meditates, the easier it gets for him to get into a state of meditation.
So they are basically based in an existing concept, but used in a different context (in Ninjutsu), with basically the same function.
For more info in Mudra, also see this page.
Answer: Naruto hand signs or seals are based on something called Mudra. Mudra originated from Yogic Philosophy because they would use Mudra for meditation or other symbolic reasons.
Mudra were used to help yogis and Monks to become spiritually enlightened by using mudra to channel the life force energy of a person within a certain way.
Later on, the information on mudra spread to different parts of China via Daoism and overall Buddhist teachings.
Mudra were used by people in Mikkyo Buddhism aka Esoteric Buddhism. Samurai and Ninjas would use these techniques almost like a battle meditation they'd use before missions.
In my opinion, most of these mudra are somewhat modified or based on Daoist/Buddhist hand seals that exist.
Heres a link to mudra that look similar to the Naruto Mudras!: http://www1.plala.or.jp/eiji/sub6.htm
I forgot to add the kuji kiri/ or kuji in part too. kuji are hand gestures and mantra people used to invoke a high level of concentration within a person.
Answer: They are based on kuji-in. Similar to, but not mudras.
Mudras are learned around peace and happiness while kuji-in are developed to handle danger and battle. "Mudras is to qigong" as "kuji-in is to budo taijutsu or karate".
Comment: Welcome to [anime.se]! This seems a good starting point for an answer. However, you can still [edit] to improve this answer further, perhaps by explaining some of the history of it, and the relation with *Naruto* (e.g. is it a common technique used by ninja, or actually unrelated?)
Answer: They are from Taoism.
The author has said they come from Taoism. No one knows and everyone says they are Hindu or Buddhism. If you just compare the patterns of the movements, you can see the similarity. In Naruto, they are modified a bit from the original but see a similarity much more than mudra.
Comment: Welcome to Anime.SE! You say that Kishimoto himself said that the hand seals come from Taoism; can you provide a source for that? If you can, I think that would make it definitive.


Can octonions be used to rotate 7-dimensional vectors?

Question: A friend told me that, the same way you can represent a 3-vector as an imaginary quaternion then conjugate it by a unit quaternion with real part $\cos(\frac{\theta}{2})$ to rotate it by $\theta$ around the axis of the imaginary part, you can do the same thing to a 7-vector and a unit octonion. Can't find anything verifying this-if its true a source for the derivation for the formula would be appreciated (as would one for the quaternion formula).
Comment: Remember that octonions are also non-associative, so it may not be possible to compose rotations using octonions in the same way that standard rotations are composed.
Comment: See the [seven dimensional cross product](https://en.wikipedia.org/wiki/Seven-dimensional_cross_product)
Comment: I thought that one could come up with an analog to the [Rodriguez rotation formula](https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula) using this cross-product, but that doesn't look to be as promising as it did.  In particular, this cross-product isn't connected to the Lie algebra of $SO(7)$ in the way that the 3D cross-product is connected to $SO(3)$. You could generate *some* of the rotations using cross-products, though.
Comment: The *unit* quaternions cover $SO(3)$ by parameterizing $SU(2)$. The latter happens because there's Lie group isomorphism which maps the quaternion ball to $SU(2)$ by sending the roots of $-1$ to the Pauli matrices. I don't actually know if $SO(7)$ has an $SU(6)$ universal covering, but this is evidently irrelevant because the Octinions are non-associative, thus shouldn't be isomorphic to $SU(6)$.
Comment: @Omnomnomnom I actually skimmed that article before posting the question-as interesting as it is I'm interested in writing programs that simulate higher dimensional rotations, so unless the cross-product has a relevance to rotation that I've forgotten
Comment: [these slides](http://people.oregonstate.edu/~drayt/talks/PSUpub.pdf) look promising
Comment: @ALB The generalization of unit quaternions covering $SO(3)$ would be unit octonions covering $SO(7)$. Unfortunately, unit octonions do not form a group (they form a nonassociative loop), however the conjugation-by-unit-octonion operators presumably *generate* $SO(7)$, and indeed left (or right) multiplication by unit *pure* imaginary octonions is enough to generate $SO(8)$. I've posted an answer.
Answer: First off, some facts. Every isometry fixing the origin is an orthogonal linear transformation of space, the group of all such linear operators is called $O(V)$. The ones which preserve the orientation of space (equivalently, are path-connected to the identity map) form a subgroup called the special orthogonal group $SO(V)$, which has index two.
A hyperplane is a codimension one subspace, or equivalently the orthogonal complement of a 1D line, and a reflection is an isometry which acts as negative one on a line and as the identity on its orthogonal complement (a hyperplane). Reflections are in $O(V)$ but not $SO(V)$, and every isometry is a composition of reflections. In particular, a composition of reflections across the complements of lines $\ell_1$ and $\ell_2$ will be a rotation in the 2D plane $\mathrm{span}(\ell_1,\ell_2)$ by an angle twice that of the angle between $\ell_1$ and $\ell_2$.
A plane rotation is a map which acts as a usual rotation on a 2D subspace and acts as the identity map on the plane's orthogonal complement. Plane rotations are elements of $SO(V)$. Two plane rotations with respect to orthogonal planes will commute with each other. Every rotation, i.e. every element of $SO(V)$, is a product of plane rotations with respect to a collection of pairwise orthogonal 2D planes. If $R$ is a plane rotation with respect to the (oriented) plane $\Pi$ by an angle of $\theta$, and $S$ is any other isometry, then $SRS^{-1}$ will be a plane rotation with respect to the oriented plane $S\Pi$ by an angle of $\theta$.
In a normed division algebra $\mathbb{K}$, there is a multiplicative norm $|\cdot|$ (i.e. it satisfies $|xy|=|x||y|$), and it induces an inner product $\langle-,-\rangle$ satisfying $|x|^2=\langle x,y\rangle$. The imaginary elements are those that are perpendicular to $1$ with respect to this inner product. If $u,v$ are orthogonal imaginaries, then they anticommute, i.e. $uv=-vu$
More generally, for any imaginaries $u$ and $v$, there is a formula $uv=-\langle u,v\rangle+u\times v$. For quaternions, $u\times v$ is the usual cross product, but for octonions it is a much less symmetrical seven-dimensional cross product (which has symmetry group $G_2\subset SO(7)$).
The division algebra $\mathbb{K}$ will also be alternative. This means every pair of elements generates an associative subalgebra, even if $\mathbb{K}$ itself isn't associative. Concretely this means the algebraic expressions $aab$, $aba$ and $baa$ are unambiguous without parenthesization for all $a,b$.
The square roots of negative one are precisely the unit pure imaginaries $u$. Since $\mathbb{K}$ is alternative, $u(ux)=(uu)x=-x$ makes sense, and thus $\mathbb{O}$ becomes a left and right four-dimensional complex vector space over $\mathbb{R}[u]$ with scalar multiplication from the left and right. The two sides don't necessarily match: multiplying anything in $\mathrm{span}(1,u)$ on either side does the same thing, but $uv=-vu$ for all $v$ in the orthogonal complement of $\mathrm{span}(1,u)$.
In the quaternions $\mathbb{H}$, given any unit imaginary $u$ we can form an oriented orthonormal basis $1,u,v,w$ (satisfying the same relations as $1,i,j,k$). Then multiplying by $e^{\theta u}=\cos(\theta)+\sin(\theta)u$ on the left will rotate $\mathrm{span}(1,u)$ and $\mathrm{span}(v,w)$ each by $\theta$, whereas right multiplication will rotate $\mathrm{span}(1,u)$ and $\mathrm{span}(v,w)$ by $\theta$ and $-\theta$ respectively. If we combine the two actions using a half angle, we find that $x\mapsto e^{(\theta/2)u}xe^{-(\theta/2)u}$ acts as the identity on $\mathrm{span}(1,u)$ and a rotation by $\theta$ on $\mathrm{span}(v,w)$. If we restrict this conjugation action to the 3D subspace of imaginary quaternions, this is rotation around the oriented axis $\mathbb{R}u$ by an angle of $\theta$.
The unit quaternions are closed under multiplication and form a group called $\mathrm{Sp}(1)$ or $S^3$ (some abusively call it $\mathrm{SU}(2)$ which I dislike). Using this conjugation action, we get a group homomorphism $\mathrm{Sp}(1)\to\mathrm{SO}(3)$ with kernel $\pm1$.
The same thing happens in $\mathbb{O}$, except now $e^{(\theta/2)u}xe^{-(\theta/2)u}$ will be a rotation in three different planes within the 7D space of imaginary octonions. I don't see any obvious description of which three planes (indeed, the three planes are not an invariant - one could use different sets of three planes to describe the same rotation, such is the ambiguity of isoclinic rotations). I assume they generate $SO(7)$ but it's not clear to me how. One could presumably check using some calculation with lie algebras but that doesn't sound fun or enlightening.
For $\mathbb{O}$ we could also do the following. The effect of $x\mapsto e^{(\theta/2)u}xe^{(\theta/2)u}$ is the plane rotation by $\theta$ with respect to the 2D plane $\mathrm{span}(1,u)$. We can conjugate two of these plane rotations to get an arbitrary plane rotation of $\mathbb{O}$, which generates all of them in $SO(8)$.
Alternatively, note that $x\mapsto -\overline{x}$ (where $\overline{x}$ is conjugation - it negates the imaginary part while preserve the real part) is a reflection across the hyperplane orthogonal to the real axis, i.e. across the subspace of imaginary elements. If we conjugate this reflection by a rotation from $1$ to $q$ (e.g. left multiplication by $q$, where $q$ is a unit quaternion), we get $x\mapsto q(-\overline{qx})=-q\overline{x}q^{-1}$ which is reflection across the hyperplane orthogonal to $q$. If we do this for both $p$ and $q$, we get that $x\mapsto p(qxq^{-1})p^{-1}$ is some plane rotation.
This gives another way to see that multiplication on the left and right by unit octonions generates $SO(8)$. For quaternions, in fact we have a $2$-to-$1$ group homomorphism $\mathrm{Sp}(1)\times\mathrm{Sp}(1)\to SO(4)$.
Far less obviously, since $u^2=-|u|^2$ for imaginary octonions, we get a left action of the Clifford algebra $\mathrm{Cliff}(7)$ on $\mathbb{O}\cong\mathbb{R}^8$. From the classification of Clifford algebras, we know $\mathrm{Cliff}(7)\cong M_8(\mathbb{R})\oplus M_8(\mathbb{R})$. Since the algebra representation $\mathrm{Cliff}(7)\to\mathrm{End}_{\mathbb{R}}(\mathbb{O})$ is nontrivial, by checking dimensions and using the fact the only ideals are the two summands we see the map is surjective. Therefore, every rotation of $\mathbb{O}$ can be attained simply by left multiplying by enough pure imaginary octonions. (The same works on the right side as well.)
Comment: What's wrong with the group of unit quaternions being referred to as SU(2)? Do you just dislike implicitly speaking up to isomorphism?
Comment: @EbenCowley I am comfortable speaking up to isomorphisms in many contexts. Not a hundred percent sure why I don't like it for $SU(2)$ and $Sp(1)$. Partly because I consider the isomorphism between them in some sense nontrivial, partly because they have different explanations for their double covers of $SO(3)$. It's kind of like referring to the group of unit complex numbers as $SO(2)$, or the additive group of reals as $SO^+(1,1)$.


How do ideal quotients behave with respect to localization?

Question: Suppose $R$ is commutative ring with unity. For ideals $I$, $J \subseteq R$, the ideal quotient $(J:I)$ is $$(J:I) := \{x\in R \, : \, xI \subseteq J\}$$ Let $S\subset R$ be a multiplicative set. When does localization at $S$ commute with taking quotients, i.e. when does the equality $$(S^{-1} J : S^{-1} I) = S^{-1} (J:I)$$ hold? More generally, when is it true that $$S^{-1} \text{Ann}_{R} (M) = \text{Ann}_{S^{-1} R} (S^{-1} M)$$ for an $R$-module $M$?
Answer: Going off user26857's comment, we provide a counterexample for Proposition 3.14 in the case that $M$ is not finitely generated. Hopefully you can use this to construct a counterexample for Corollary 3.15 as well.
Take $A = \mathbb{Z}$, and let $M$ be the direct sum of $\mathbb{Z}/k\mathbb{Z}$ as $k$ ranges through $\mathbb{N}$. This is not finitely generated as a $\mathbb{Z}$-module (there are infinitely many nonzero summands). Now, what is the annihilator of this module? Well, it is just $0$, since for any integer $n$ different from $0$, $n$ does not act by $0$ on the $\mathbb{Z}/(n+1)\mathbb{Z}$ factor, so $n$ does not act by $0$ on $M$. (If $n$ is negative, look at $\mathbb{Z}/(1-n)\mathbb{Z}$. Strictly, this is not necessary since any ideal of $\mathbb{Z}$ is generated by a positive number, but oh well.)
Now, let us localize at $S = \mathbb{Z} \setminus \{0\}$, so $S^{-1}A = \mathbb{Q}$ and $S^{-1}\text{Ann}(M) = S^{-1}0 = 0$.
But what is $S^{-1}M$? We claim that it is $0$. This is not hard to show. Let $e_k$ be the generator of the copy of $\mathbb{Z}/k\mathbb{Z}$ in $M$. Then the set $\{e_k\}$ is a $\mathbb{Z}$-generating set for $M$ in the  sense that every element of $M$ is a finite linear combination of the elements $e_k$ with coefficients in $\mathbb{Z}$, so $\{e_k/1\}$ is a $\mathbb{Q}$-generating set for $S^{-1}M$ (in this same sense).
But for each $k$, we have $k \cdot e_k = 0$ in $M$, which shows that $e_k/1 = 0$ in $S^{-1}M$. To be a little more explicit, we want to show that $e_k/1 = 0/1$ in $S^{-1}M$. By definition, this happens if and only if there is some $s \in S$ such that $s(1 \cdot e_k - 0 \cdot 1) = 0$. Now take $s = k$.
So now, we have that $\{0\}$ is a $\mathbb{Q}$-generating set for $S^{-1}M$. Thus, $S^{-1}M = 0$, so $\text{Ann}(S^{-1}M) = \mathbb{Q}$, which is different from $S^{-1}\text{Ann}(M) = 0$. (Here, we need the crucial fact that there exist nonzero rational numbers, i.e., that $\mathbb{Q}$ is not equal to $0$.)
Comment: Perfect answer, Kevin: bravo!
Comment: @GeorgesElencwajg Why is this a perfect answer? It doesn't answer the first question.
Comment: @Brozovic Take $\mathbb{a} =0$. Then, $(\mathbb{a}:\mathbb{b}) = Ann(\mathbb{b})$. So, it is enough.
Comment: Can you kindly give an argument or at least an example for the ideal quotient part?
Answer: Atiyah-Macdonald 's famous book; 3.14 and 3.15:
Comment: A complete answer should add some counterexamples for the case when the ideal/module is not finitely generated.


Get Page Access Token from FQL?

Question: I'm having difficulty finding a way to get a page access_token from FQL.
http://developers.facebook.com/tools/explorer?method=GET&path=me%2Faccounts
- This is the graph call with the page access_tokens included.  The trouble is that I need the access tokens for a multiquery call and would love to not have to make a separate call just for the access tokens then call the same info for my multiquery.
http://developers.facebook.com/docs/reference/fql/page_admin/
- This doesn't contain the access token, although it mentions contains the same data as the /user/accounts graph api call.
http://developers.facebook.com/docs/reference/fql/page/
- This also doesn't seem to include the page access token.
Has anyone had luck or found a way to get that token through FQL?
Thanks for your help!
Answer: It is possible!
SELECT access_token FROM page WHERE page_id={id}
Answer: It's not possible to get the access token from FQL, you can only do it via Graph API calls.
FQL is for queries from tables.
Graph API is for GET, POST and DELETE requests

Get Page Access Token from FQL?


UK Lottery Odds Calculation Error

Question: I found the probability topic in stats and mechanics to be very interesting, and I attempted to try using it to calculate the odds of winning the UK National Lottery, but failed. My calculation was (1/59*1/58*1/57*1/56*1/55*1/54). The reason was that in the NL there are 6 balls dropped, and the possible outcomes range from 1 to 59. I reasoned that since all 6 need to match, I could assume that each outcome could be treated as an isolated selection, and that my first ball match odds were 1/59 as a result, then if the first ball matches (which it must), the next is 1/58 and so on. The odds I calculated were orders of magnitude less likely than the correct value. What is wrong with my attempt, and why is the correct formula quoted as "59!/(6!*(59-6)!)"?
Comment: First ball odds are 6/59, not 1/59.
Comment: Your numbers can come up in $6!$ different orders. "It could be you!" but probably it won't be.
Comment: For example, if you chose numbers 10, 13, 14, 23, 47, 50, the balls could drop in the sequence 13, 50, 47, 10, 24, 14, or 14, 47, 50, 10, 13, 22, or any of several other sequences, and you would still win. Every single one of those sequences has a certain probability of occurring, and that probability is what your calculation finds: the first drop must be a _particular_ ball (not any of the other 5 you selected), and so forth.
Answer: Firstly, note the answer you obtained is $\frac{53!}{59!}$, while the probability you should have obtained is $\frac{53!6!}{59!}$ (you've stated this fraction upside down, where it gives the number of possible outcomes). The reason you're wrong by a factor of $6!$ is because the order in which the numbers fall is irrelevant. This is the combinations-permutations distinction; in technical terms, $\frac{59!}{53!6!}={}^{59}C_6$ while $\frac{59!}{53!}={}^{59}P_6$.

UK Lottery Odds Calculation Error


Can't Login to Wordpress, No Data Received Error

Question: I can't login to my Wordpress dashboard. When I go to example.com/wp-admin and enter my info, it returns a page that says "No Data Received: Unable to load this page because the server sent no data." I've looked on the Wordpress forums and Google and here, but I haven't found any answers as to why this is happening. Some things I read suggested that it might be an issue with my host, so I contacted GoDaddy, but they are insisting it is a Wordpress issue. Does anyone know how I can fix this? I'm at a loss.
Comment: Are you using any sort of "theme my login" type plugin? Perhaps try backing up your plugin folder (simply rename it), then try to login.
Comment: No, it's just the standard WP login...
Comment: I've been reading a lot about this, and I know this doesn't really help, but this is most likely a server issue. Most of the reports I've seen are folks hosting with GoDaddy.

I know their support are insisting it's a WP issue, but this probably isn't the truly the case. That's not a WP error. It's a browser error when you can't communicate with the server.

I'd probably "insist" back that they look into the problem. As they say, the squeaky wheel gets the grease. If it's not a GoDaddy issue, I suppose it could be an ISP issue.
Comment: I'll try to get on them about it. In the meantime, if anyone has any suggestions, I welcome them.
Answer: Look at your .htaccess file in your public_html folder for your WordPress installation.
It seems that when with GoDaddy hosted on the windows package, you need the following inheritance set for rewrite in your .htaccess file:
RewriteOptions inherit
RewriteEngine on

That solved my problem on index.php.


How to type Hindi in open office?

Question: i m using ubuntu 10.10. please tell me how to type in hindi fonts in open office word. please help
Answer: Type the following in terminal.
sudo apt-get install ibus ibus-m17n m17n-db m17n-contrib ibus-gtk
Now Goto System>>Preferences>>Keyboard Input Methods Or Type ibus-setup in terminal to start the daemon.After starting the daemon IBUS Preferences will be opened.

Select the Input Method tab and from the drop down Add Hindi language and click close.Now open open office word and you can start typing in Hindi by pressing Ctrl+Space if you press Ctrl+Space again you can start typing in English.
Typing in Open Office Word:

You can toggle between both the languages by pressing CTRL+SPACE.
Comment: as usual, nice answer :) just one unrelated question, what theme is that?
Comment: @Kaustubh that's tropical theme.
Answer: You have to enable SCIM input method for this.
Here is an article in Ubuntu India site: http://www.ubuntu-in.info/wiki/IndicLangWithScim
Hope this will help.
Comment: Dead link. Please update the answer.

How to type Hindi in open office?


How can I loosen a tight sink handle?

Question: I recently replaced the pivot rod in my bathroom sink drain. Over the course of the 3 days it took me to finally come to a resolution for it, the cold water handle has gotten tight. The hot water handle moves fluidly as it used to, but now, all of a sudden, the cold water handle is hard to turn. I don't remember tightening any of the nuts or bolts under the sink. How can I fix this problem?
Comment: A photo and make/model of the faucets (if known) would help.  I don't think the 2 issues are related.  There may be an adjustment from above, such as a packing nut.  Newer faucets have replaceable cartridges.
Answer: Assuming this is a faucet that fits variable widths, each tap has screws underneath the sink which allow you to adjust the height of the tap relative to the sink.  The exact technique used to adjust the height varies, but generally in my experience you have to:

Loosen the locking screws/nuts - these lock the larger nut in
place (if you have any)
Adjust the height of the faucet with the large nut under the sink
Tighten the locking screws/nuts again

As for why this could happen - changes in ambient temperature could have caused a slight adjustment in the height of the faucet above the sink - so the bottom of the tap could be turning against the sink where it didn't before.  (This happened to me with both my hot and cold taps at different times.)
Here's an example of what they look like - these are my own faucets.  Each tap has a brass ring holding it in place right under the sink, and two locking screws that lock the brass ring in place.  The height of the tap is set by turning the brass ring.

How can I loosen a tight sink handle?


Is it possible to make a beer worthy of a competition with malt extract?

Question: I was wondering if it's possible to make a beer worthy of entering a competition that stands a chance of doing well.  I'm still pretty new to brewing but wanted to know if I need to make the jump to all-grain before making a beer that's competition worthy.
Comment: Not the same question as yours, but some of the answers address the same issue: http://homebrew.stackexchange.com/questions/2211/can-extract-brewing-achieve-professional-results
Answer: I have judged in comps where an extract beer has taken best of show.  It's a challenge, but there are certain styles that can be made well with extract and if you choose one of those and exercise great technique, you can definitely make an award winning beer with extract.
Comment: Any advice on which styles work best, Denny?
Comment: Things like wheat beers work well with extract.  Both of the BOS extract beers I judged were dunkelweizens.
Answer: Most of what makes a great beer great is fermentation, not necessarily where the wort came from.  Todays extracts are very high quality.  And many extracts are becoming available to make wort you could only get as an all grainer.  For example 100% Munich or Pilsner or English extracts.
Focus on a great fermentation and you will make great beer.  Then if you move to all grain someday with a mastery of fermentation...man you'll be making unbelievable beer then!
Comment: I would add that controlling the temperature of fermentation is perhaps more important than all-grain brewing.  From _Yeast_ by Chris White and Jamil Zainasheff: "One of the greatest things a brewer can do to improve his beer is manage the fermentation temperature. This is far more important than using fancy fermentors or even all-grain brewing."
Comment: A great fermentation is more than just temp control.  Its wort oxygenation and pitching rate.  I just left my answer to be, fermenation period.
Comment: Great. So I've got more equipment to buy? :)
Answer: Sure, you can make a great tasting beer with malt extract alone... but you will be unable to make that beer stand out in competition, as it will lack originality and complexity.  If you don't want to make the jump to all-grain just yet, you could try a couple partial mash batches.  This will give you greater control over the final product, without going all out on all grain equipment.
Comment: Disagree about the complexity and originality.  You lose a little control over the mash properties of the base malt, but not all control.  But the total recipe can most certainly be original and complex.  Downvoted.
Comment: @brewchez I completely agree.


How to drive an IGBT with an optocoupler?

Question: What's the proper schematic for driving the IGBT (IRG4BC20UD) from a microcontroller (MSP430-g2553) pin through the optocoupler (FOD3184)? I am going to design a full bridge inverter to drive 9W CFLs (220V/50Hz)? PLEASE HELP!
Comment: I have no idea, why don't you start first?
Comment: The [internet is so silent](http://forum.allaboutcircuits.com/threads/how-to-drive-an-igbt-with-an-optocoupler.105858/) when you ask questions in certain way. Leaving the finger shaking aside, what you seem to want is something [like this](http://www.irf.com/pressroom/articles/631pet1005.pdf), albeit not using the exact same chips.
Answer: There are many possible schematics. IGBTs are best driven with high voltage high-pulsed-current-drive 15V/-5V drive and of course you want isolation or you wouldn't be asking for an opto. You may be able to get away with +15/0V drive in some circumstances.
Here is one chip that will do the opto part and the driver part, and is similar to the one you are wanting to use. You still have to deal with giving it +15/-5 or at least +15V/0 relative to the emitter on the high side driver.
Probably for such a low power level a bootstrap diode would be an appropriate approach (limited to +V drive only). So, something like a UF4007 connected to a low voltage supply on the mains side. Ask if you don't know what a bootstrap is, or see most any of the IR application notes on half-bridge drivers.
The LED drive circuit most recommended is the shunt circuit (have your micro drive a transistor to shunt the LED, with a series resistor or resistors to the supplies).
Comment: We can't see your actual schematic - if we could I'd we'd be able to at least offer suggestions
Comment: Hello, Thanks a lot for the response. Actually I am trying to develop a full bridge inverter. For the inverter, I need replicate the below circuit for each IGBT. But, my circuit is giving me no output, I believe there is something or everything wrong with the connections. Please help me with your expert opinion. https://drive.google.com/file/d/0B1sBN0KtrWmMN2RnWVFQWjc5Njg/view?usp=sharing
Comment: I hope you can see the schematic now in the above comment?
Comment: Did you have a chance to see my schematic? I am looking forward to your response. Thanks.
Answer: Have a look at the opto-isolation used in the attached link
http://www.freescale.com/files/microcontrollers/doc/ref_manual/DRM039.pdf
Comment: Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.
Comment: Hi, my test circuit is working properly, thanks a lot.


Dynamic obstacles avoidance in navigation mesh system

Question: I've built my path finding system with unreal engine, somehow the path finding part works just fine while i can't find a proper way to solve dynamic obstacles avoidance problem. My characters are walking allover the map and collide with each other while they moving. I try to steering them when collision occurs, but this doesn't work well. For example, two characters block on the road while the third one's path is right in the middle of them and he'll get stuck. Can someone tell me the most popular way of doing dynamic avoidance? Thanks a lot.
Comment: You might get more answers on gamedev.stackexchange.com
Answer: I think that the best way of doing this is to use dynamic NavMesh obstacle.
You have to instantiate a dynamic obstacle for your character and update its location with the character one each frame.
You'll find out how on the CreatingADynamicNavMeshObstacle page.


Difference between WhatsApp audio and WhatsApp voice notes

Question:
What is the difference between WhatsApp audio and WhatsApp voice notes?
If I record a voice conversation, where is it going to be stored? Is it in WhatsApp audio folder or in WhatsApp voice notes?
In which folder  all of my received voice notes get saved?
Answer: The folder WhatsApp/Media/WhatsApp Audio/ contains the downloaded audio files that you received as an attachement from a contact. The file names usually start with AUD-.
The folder WhatsApp/Media/WhatsApp Voice Notes/ contains the voice files that you recorded using your Whatsapp. They usually start with filenames containing PTT- and stored under corresponding folders with date of the recording.
Answer: With reference to Whatsapp Document
Choose Audio to record a message or send an existing audio from your phone.
But
WhatsApp voice notes - To send a voice message.
Folder WhatsApp/Media/WhatsApp Voice Notes/
Folder WhatsApp/Media/WhatsApp Audio/


Will 30" appliances fit through the opening for a 32" door?

Question: Planning to add a new spice kitchen with 30" range and refrigerator. Will a 32" door be good enough to take those appliances in?
Comment: Make sure your fingers are not between the door and appliance.  That hurts when they squeeze.  It will be a tight fit and might want to remove the door stops to give an extra 1/2 inch and the door also if it does not swing far enough.
Comment: Measure the door space in question and check "actual" product dimensions.
Answer: Most US standard appliances are 24" in one dimension - i.e., counter-depth. Sometimes plus a couple of inches for handles, though often the handles are removable specifically to make installation easier. So 32" should be more than enough for just about any oven, dishwasher, range, etc.
The big exception is refrigerators. Many US refrigerators - in fact, the default sizes - are not counter depth but rather much deeper than the standard 24" counter. However, assuming the width is actually 30" then there should not be a problem with a 32" door - 2" to spare - even if the other dimension is larger.
Note that with many appliances doors can be removed. That is not as easy (if possible at all) as it used to be with refrigerators, as it is no longer just "remove the screws from the hinges" because of various connections for water, ice maker, video displays, etc. The best thing to do is to check the dimensions of your specific model to make sure one of the dimensions is less than 32".
It is also quite common to remove a house door to move an appliance. That won't get you more than 32", but it might make the difference between only having 30" (due to the way the door swings) and a full 32".
Answer: 30" appliances aren't necessarily exactly 30", but they are designed to fit into a 30" opening between cabinets, so they should fit through any opening that has at least 30" of clearance.
While a 30" doorway would be a problem because the stops on the door frame would make the actual opening less than 30", a 32" doorway shouldn't be a problem.
The real question though is whether the door itself will be a problem.
If the door doesn't open widely enough the thickness of the door will extend into the opening and reduce its useful width.
In that case you would need to remove the hinge pins so you can temporarily move the door out of the way.
There's also the obvious problem of obstacles, either within or without the room, that would require the appliance to be rotated while passing through the doorway.
I don't know of any easy solution to that problem.


Is a private key that is created with an additional passphrase included in the existing 24 worded private key basket?

Question: We know that there are finite number of private keys out there that are derived from 24 words. If I create a wallet with an additional 25th word passphrase (which is not in the existing 2048 seed words), is that private key included in the existing private keys that are derived from 24 words or is it an entire new private key which is out of the existing 24 worded private key basket?
Answer: tl;dr: Every key is in every basket, given enough time.
I believe the following to be true:

Sequences of keys generated from seeds are indistinguishable from random sequences (except at extremely large scales).
Seeds with the tiniest difference produce completely different sequences.
The sequences are infinite in length.
The elements of the sequences are members of a finite set.

The consequences should be clear.
A longer, meandering and unsatisfyingly-unquantified answer might be:
If you add (or omit) a passphrase, does it generate the same private key sometime?
The most popular definition for 24-word seed phrases, which are also called recovery phrases sometimes, is BIP-39
This allows for an optional additional passphrase to be used together with the seed phrase when calculating the private keys. The passphrase adds an extra layer of security and different passphrases will cause different private keys to be generated.
This system is invariably used with BIP-32 Hierarchical Deterministic (HD) wallets. These wallets generate, not just one, but a whole series of private keys from the seed data.
The consequence is, if you lose your wallet and forget your passphrase, you can't recover control over your money only using the seed phrase.

Note that some wallets also use a password or passphrase to encrypt some or all of their wallet data. This is a different passphrase from the one used with the seed phrase when creating a new wallet or recovering a lost wallet. It is easy to get confused by this. Don't get them mixed up.

Addendum
Lets say you create wallet A and wallet B as follows

Wallet
seed phrase
pass phrase

A
boss rural month arm exit elegant eight grain palace biology pistol control outside album slab top boil absorb tree mean street giggle head frozen
Alex

B
boss rural month arm exit elegant eight grain palace biology pistol control outside album slab top boil absorb tree mean street giggle head frozen
Axle

Because Alex is not Axle, Wallets A and B will each generate a different sequence of private keys. Lets call these sequences baskets A and B.
Lets say you are a very busy person, perhaps you buy Amazon, eBay and Alibaba and make every transaction worldwide, pay to a new private key in one of your wallets, alternating them.
In the very short term (the first million years say), Perhaps baskets A and B will be disjoint sets.
However
Every key is in every basket, given enough time.
Every key is in every basket an infinite number of times, given infinite time.
See Bitcoin collider
Of course, the Earth will be be swallowed by the Sun in the forseeable future, so there may not be enough time. You'd have to ask a statistician and base an estimate on a prediction of future computing power and how that may be bounded by the amount of matter in the accessible universe and various other physical constraints.
Comment: Maybe I did not ask it clearly. Lets say that I have a private key generated from a 24 seed word(wallet_1). This wallet_1 belongs to a pile of all private keys which can be generated from those 2048 words(all_wallets_generated_from2048words). When I add a 25th word(a passphrase) to that, it creates a whole different private key, hence a different wallet(wallet_2). Does that wallet_2 belong to that all_wallets_generated_from2048words pile or not? Can that same private key which is generated with a passphrase be populated with different 24 words without a passphrase?
Comment: See addendum above.
Comment: With 24 words and without a passphrase we will have 2048²³ different wallets/private keys(24th word is checksum). If I create a wallet with any passphrase, does that belong to those 2048²³ ?
Comment: With any 24 words, you will eventually have all private keys. with or without passphrase. AFAIK, using 24 words instead of, say, 12 doesn't increase the used entropy because of the data types used for seed numbers etc generated from those words.
Comment: So if my wallet's seed words are ABCDEFGHIJKLMNOP + passphrase. That means that someone still -in theory- guess the "actual" word combinations without the passphrase, let's say AHGKDHSNCOM and reach to the funds. Am I correct?
Comment: They don't need to guess anything. They just put in any words they like and wait.
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/147670/discussion-between-efe-and-redgrittybrick).


Is it right to say 'Share the love you have'

Question: If I want to say to someone: 'Just share the love that you have', can I say it without 'that'? - 'Just share the love you have'?
Comment: I bet you can. What else? :) (either this is a duplicate, or the answerers will elaborate)
Comment: Thank you so much for the answer!
And one more question))
If I want to say that the relationship has no future, can I say: We don't have a chance for tomorrow?
Comment: @Tatyana - Please ask that as a seperate question. It has nothing to do with this question.
Comment: By "just", do you mean "just share" or "just the love you have"? The first means that all she needs to do is share (not do anything else); the second means that even if she doesn't have much love that she can share, she can share, for now, "just" what little she has, and maybe it will grow.
Answer: Yes, that's a construct where the that is purely optional:

Just eat the pizza [that] you bought.
  This is the car [that] she's always wanted.
  This is the parade [that] Harold told us about.

In those three sentences, you can omit the that, or leave it in; the meaning will be the same.
However, this isn't the case when the that is followed by a verb instead of a noun:

Eat the food that was put in front of you.
  That new hotel is a place that will open in just ten days.
  This is the issue that started the argument.

In those cases, the that cannot be removed, and must stay in place.
Since your example has that followed by a noun (you) instead of a verb, you can leave it in, or take it out.
Answer: One problem with either of these is that "[your] love" can mean "your sweetheart/beloved".  I'm not sure you'd want to share him with someone else.
Also, there is the theory that your own love is not "had", it can only be given. This is why "the love you have" sounds not quite right, which allows the reader's mind to wander to the earlier-mentioned misapprehension.
I suggest "Just share your love."
That doesn't give the reader much time to wander or misinterpret. (although devious minds could pretend to construe this as "spread your love around" —e.g. by sleeping with as many partners as possible")
Comment: Thank you for your answers!))
With this sentence I mean - all that you should do - just share the love that you have - and then you will feel the harmony inside you)))
I wrote a song, that's why I needed this construction - 'Just share the love you have')))
Thank you very much again for all your answers! :))


Install a GCC ARM Embedded toolchain

Question: I would like to load a very simple, hello world program, on an Embedded ARM processor. For this, I would like to install a toolchain in order to cross compile my code. I am currently working on a 64-bit Linux OS. Does anyone know of a GCC ARM embedded toolchain that I can download? I've downloaded a pre-built version of Linaro GCC but it only runs on a 32-bit Linux machine and I can't install the ia32-libs package because my Linux machine has no internet connection.
Answer: The gcc-arm toolchain I'm using for ARM Cortex-M processors can be found here-
https://launchpad.net/gcc-arm-embedded
It also builds for Cortex-A targets, which should cover the majority of embedded ARM systems.
You can download standalone distributions for many operating systems, including linux.
Comment: Question, 4 Years later - Is this still current (i.e. the standard way to do this)? And does the toolchain support ARM NEON (arm_neon.h) ... I would like to know.
Answer: There are also 64bit builds of Linaro toolchain here. Just download the x86_64 and not the i686 version.

Install a GCC ARM Embedded toolchain


How to solve the word problem below?

Question:
Can anyone guide me through this problem? I know how to solve the equation of the circle (the Earth) below but I don't know how to solve the equation of the orbit.
Comment: Hi, welcome to MSE. Since you are new here I wanted to let you know/tell you a few things. Please do not use pictures for critical parts of your post. Pictures are inaccesable to screen-readers and cannot be searched. Also, try to make your title more informative. In general, [this post](http://meta.math.stackexchange.com/q/9959/145141) can be quite useful to newcommers.
Answer: You can write the formula for the circumference of the Earth as
$$(x-a)^2+(y-b)^2=r^2,$$
which is the formula for the circle of radius $r$ centered at the point $(a,b)$. Assuming that the orbit of the satellite is not at an angle with respect to the map, all you need to do is increase the radius.
Answer: The radius of orbit is 0.6 units more than radius of earth and centre is same as that of earth
Answer: The radius of the circle is $64$. We may as well move its center to $(0,0)$. The orbit of the satellite then appears as an ellipse with mayor semiaxis $a:=64.6$ and minor semiaxis $b\leq a$. We are not told the direction of these axes. Therefore we shall assume the major axis in direction ${\bf u}:=(\cos\alpha,\sin\alpha)$ and the minor axis in direction ${\bf v}:=(-\sin\alpha,\cos\alpha)$. A parametric representation of the elllipse is then given by
$${\bf z}(t):=a \cos t\>{\bf u}+ b\sin t\>{\bf v}\qquad(0\leq t\leq2\pi)\ ,$$
or in coordinates:
$$x(t)=a\cos\alpha\cos t-b\sin\alpha\sin t,\quad y(t)=a\sin\alpha\cos t +b\cos\alpha\sin t\ .$$

How to solve the word problem below?


Can't import photos from iPhone 6 to Mac

Question: I have taken a lot of photos on my iPhone. But when I connect it to my Mac, the photos do not show up in Preview. I can see the photos on the iPhone, but they are simply not recognised when I plug the iPhone to the Mac - any ideas?
Comment: What versions of iOS and macOS are you running?
Answer: The photos on iPhone doesn't directly show up in Preview.app on your Mac after connecting. You will need to copy (via import or sync) them to your Mac to be able to see them in Preview.app.
After connecting your iPhone to your Mac, launch Image Capture.app. You can find the app in Other folder in Launchpad, or simply search for it via Spotlight.
Once the app is launched, your iPhone is unlocked and both the iPhone and Mac have trusted each other, you should be able to see all the photos and videos in the Image Capture.app window.
Simply select, drag and drop the photos from within Image Capture app onto a folder in Finder to copy them to your Mac.
Answer: Ensure updates on both the phone and mac are compatible. I keep having a similar problem every time I update the mac, as for some reason, even though the phone appears to be on automatic updates, this does not happen, and no update notifications appear on the phone.
Comment: This doesn't seem to bear any relevance to the question asked.


Stack vs Heap C++

Question: I just had a quick question about how stack variables versus heap variables work. As I understand it, stack variables are variables that after functions return will be deleted, and heap variables are persistent. But what I'm really confused about is how to allocate heap variables inside functions:
int MyObject::addObject(const char* a){
    MyObject newObject(a);
    return 0;
}

Say that I have a constructor for MyObject that is newObject(const char * a). Then in this function when it is called, after the return does the newly constructed newObject get deleted? If yes, how can you allocate to the heap within a function then? If not, how do you cleanup your memory later?
Furthermore, what exactly is the role of a destructor and when is it called?
Comment: You shouldn't even be thinking about "stack" and "heap". When you drive a car, you don't typically about cylinder cycle patters, do you? The things to understand in C++ are **storage classes** and **object lifetime**: automatic (scoped), dynamic (manual), static (global).
Comment: @Kerrek When new to C or C++, would you disagree that it's good to know the difference between the two?  I think that's what OP is getting at here.
Comment: @MGZero: I'd say it's distracting and misleading to even *consider* the two. Those are an implementation detail that you can ponder on a rainy Sunday over coffee, but for the purpose of understanding C++ they're unnecessary clutter and noise... *especially* when you're new and have *so much more* important stuff to learn :-)
Comment: @Kerrek SB, strongly disagree. Do you know that the default stack size on 32-bit Windows is 1MB? If the novice doesn't know this, (s)he may think, cool, I'll use stack all the time — but you really shouldn't do this.
Comment: @KerrekSB: I too disagree. These are not implementation details, these are concepts that you have to understand, for the same reasons that Classes and Objects are concepts in an OOP language, and you should understand those as well. If you don't know where your objects are and the lifetime of those, you are not going to be able to write efficient c++ code. Not in the current state the language is at least. There is only so much you can get away by just scratching the surface.
Comment: What a coincidence, it is Sunday and it's raining.  Coffee is brewing.
Comment: @ivanzoid: I'd say that an algorithm which uses that much stack size may have other problems. Sure, there are situations where you just need a local chunk of memory (in which case you should drop-in replace a `std::unique_ptr`), but that should be a rare exception.
Comment: Have you considered using std::string instead of char* ?  Throwing C memory management into the mix tends to befuddle, your MyObject class now needs to do decide how owns the memory for the pointer and most likely needs to copy the string and a destructor to release it again.  Not doing this is a very likely path to failure.
Answer: A constructor for the class MyObject is MyObject(), not newObject(). In your example, newObject is the name of your variable, not the constructor.
To allocate on the heap inside a function, you need to call the new operator:
int MyObject::addObject(const char* a){
    MyObject* newObject = new MyObject(a);
    //newObject is allocated on the heap

    //... Some more code...

    delete newObject;
    //you have to explicitly delete heap-allocated variables
    //if not, you get memory leaks
    return 0;
}

Your code:
MyObject newObject(a);

creates an automatic storage (stack) MyObject called newObject that lives until the scope it was declared in ends - i.e. closing }.

Furthermore, what exactly is the role of a destructor and when is it called?

To clean up memory the class allocated with new or new[] (or malloc) and it owns. It is called either when the object goes out of scope for automatic objects, or when you explicitly call delete for dynamic objects.
Comment: So newObject is a pointer that points to a place in memory where some MyObject is stored. So without deallocating the MyObject using the pointer, the object wouldn't go away. If I understand this right, then  are you able to pass the newObject pointer to somewhere outside teh function or is that just deleted after function call?
Comment: pedantically, in the code above there is a stack variable of type MyObject*, which is a pointer, pointing to a heap region. the stack variable gets deallocated on return (but you can still return it, because it's returned by value), but the region it points to doesn't. nothing is ever automatically freed which was allocated with `new`
Comment: @Matt the object is not dealocatted unless you explicitly do it. You can of course return the pointer from the function and deallocate it outside, but that needs to be documented so people using the function know the responsabilty of the clean-up lies with them.
Answer: Stack memory is what you said, but to be more specific, it's memory local to the current scope.  Note that depending on what scope you're talking about, this memory could be global or it could be local to a function or class.  These are cleaned up once they've gone out of scope.
Heap memory in allocated via the new operator.
These will persist in memory even after all pointers pointing to the memory have gone out of scope.  You must explicitly release this memory yourself in C++ via delete.  Failing to do so will result in a memory leak unless smart pointers are used.
Another thing to note, take the following sample code:
void foo()
{
   int *bar = new int; //creates a pointer to an int on the stack, but initializes an int on the heap
   *bar = 3; //sets the int being pointed to to 3
   delete bar; //deletes the int
   bar = 0; //removes the now invalid reference
}

the pointer itself, bar, is created on the stack.  However, the data pointed to by bar. *bar -- yes, the asterisk does make a difference here.  It gets you the data pointed to by the pointer -- is on the heap.  When foo returns, bar will go out of scope.  Had I not called delete, I would have lost access to *bar and would have gotten a memory leak.
For the second question, the role of the dtor is to clean up the object you've constructed.  One is provided by default for you, but there are times when you need to write your own.  For example, if your class has raw pointers in it, you need to explicitly release them with delete in the dtor.  It's called when the object goes out of scope for stack memory and when delete is called for heap memory.
Comment: So is there any way to allocate pointers onto the heap so that one can reference them later to delete heap objects instead of them going out of scope on function returns?
Comment: Sure, you can return the pointer itself.  This will give you the memory address it's pointing to, which you can hang to in a pointer in a different scope.  And note you don't allocate pointers to the heap (well, you can, but in most cases you don't) you allocate memory for the pointer to point to on the heap.
Answer: int addObject(const char* a){
    MyObject newObject(a);
    return 0;
}

This code allocates newObject on the stack. It is constructed (MyObject constructor is called on a chunk of stack memory) when entering the function.  It's destructed (MyObject destructor called on that instance) when the function returns just before the chunk of memory is popped from the stack.
MyObject *foo =  new MyObject(a);

This code allocates an object on the heap. The constructor is called by the new operator after it's allocated some heap memory. The memory isn't freed and the destructor isn't called until you explicitly say you're done with it with the delete keyword.
delete foo;

This can be anywhere you want in your program.
Comment: That's another question entirely. foo can be managed any way you care to manage it. It's the value of foo that's important and must be preserved until deletion, not the location that it's stored in. You can pass it to functions, return it from functions, store it in a global or whatever.
Answer:
The stack is a an area that the is used in function and method calls. It is basically utilized to store parameters and function local data (among other things involved in the process of calling a function). The stack is a LIFO kind of data structure, meaning that the last thing you put in is the first you get from it.
The heap on the other hand is a free store, by that I mean you can get any values from the heap no matter the order it was put in there - this distinction is important.
In C++ , every time you call new the object is created on the Heap and a pointer to that object is returned to you, you can then use that pointer to access your object. That applies to both complex objects such as objects from classes you or someone else has created, and built in types, such as int, char, double etc... There is nothing magical with using new, at it's core it simply calls malloc, or some flavor of it depending on the platform, and then calls the constructor for the object. You have to remember to call delete (or delete []p_array_of_object_pointers) for every object created with new.
The destructor is nothing more than a function that the language calls on the object when you do a delete my_object_pointer in your code. The destructor gives you a chance of doing some clean up in your code. In languages such as C++, where you have to manage your own resources, you would usually use it to call delete or free on other objects you have allocated on the heap, or closing file handles you've created with fopen or such...
Both of this keywords work inside or outside a functions and methods, it does not matter where you call them from, they will always work with the heap. Anything you create without the use of new will end up in some other place, either the static area of the executable or the stack, depending on how and where it is being created.
Every time you create an object inside a method or function with the following syntax MyClassType myObject(contructor, arguments); and without the use of new, you are creating it on the stack (unless you declare it as static, which is when it ends up in that static area I mentioned above).

Hope this helps.
Answer: heap allocations are done with the new keyword
C++ has no garbage collection, heap allocations are never automatically freed
you can free them with the delete keyword
you need to keep a pointer for that, for example by returning it from the function, or by assigning it to a global variable
destructors are called on delete and are used to free resources, for example network sockets
so the code would be, for example return new MyObject("foo");
Comment: when the program is closed, will these mem leaks be free?
Answer: You allocate memory in stack in your example. It's automatic variable and it would be deleted then return happened.
If you use new keyword you must provide correct deallocation
MyObject* newObject = new MyObject(a);

Answer: Use dynamically allocated instances of objects when:
1) The actual type of object is not known at compile time
2) When the number of objects you want to create, is not known at compile time
3) When the (compiler generated) lifetime management of your objects does not meet your needs.
Every object created with new operator, should be freed with delete operator at some time. If you don't, you will have memory leaks, and if you depend on the side effects of the objects destructor, you won't get those side effects and your program may not do what it is desired to do.
When an object is created as a stack variable, the compiler will insert code to call the objects destructor when the object goes out of scope. How does the compiler know what destructor to call? The type of object is known at compile time, so there is only one posibility, only one destructor to call.
If you use 'delete'  to destroy an object, the compiler may not be able to tell which destructor to use. The object may be of type 'basic', then the destructor 'basic::~basic()' will be called.
    class basic;
    class derived : public basic
    {
           ....
           ~derived();
    }

    basic *l = new derived();
    ...
    delete l;

The compiler does not know the actual type of the object is not 'basic' but 'derived'. If however, you declare the destructor of 'basic' to be virtual, the compiler will insert code that consults the objects virtual method table, and the call is redirected to the right destructor (in this case the destructor that destructs on object of type 'derived').
If you are worried about this problem, and if you can, make the destructor 'virtual'.
Answer: How to allocate to heap: use new keyword
How to deallocate from heap: use delete keyword.
To avoid program crashing and memory leaks, each new must have its delete counterpart for the specified object and type.
Destructor is called when object gets deleted regardless of where it was stored(heap, stack, ...)
And here's more specific info about memory: What and where are the stack and heap?

Stack vs Heap C++


Can a wireless router get a virus?

Question: I have a friend who has a linksys wireless router and is having problems with getting internet. Is there any way a wireless router can get a virus?
Comment: I wouldn't have thought so. There are more likely reasons why there'll be connection problems.
Comment: Just wondering, what makes you suspect it is the router?  Why not suspect the PC first?
Comment: Because there are many different PCs that are being affected. I personally don't think its the router its just that they were assuming it was the router so I wanted to disprove that first
Comment: http://superuser.com/questions/446315/how-to-know-if-your-computer-is-hit-by-a-dnschanger-virus
Answer: While it's possible that a router can get a virus, it's very unlikely (in the realm of winning the lottery or falling off a donkey).
Your friend's router may need attention from a professional. Have the ISP check it out or see if you can get a replacement.
If you know what problems it's having, maybe we can help here. For that, we need a lot of information about the router and what you've tried.

EDIT: Resetting the router to factory defaults will eliminate any configuration issues or corruption (including alleged viruses), if you need to prove a point.
Comment: I will have you know that falling off a donkey is incredibly easy.
Comment: ok, thanks that was what I was thinking I am going to look into some more things first but if I can't make any headway I will add more info.
Comment: If you're trying to prove a point to your friend, do a hard reset and start from scratch. The reset will wipe it completely and eliminate any possible corruption of the firmware.
Comment: @Randolph ah... thanks, forgot about that option, I will definitely do that.
Comment: I agree with Randolph, just remember to backup the firmware before wiping it.  Good luck.
Comment: I've added my comment to the answer for factory reset.
Comment: Though I agree it's more likely config, it's a bit easier to get a malicious config than you lead on. The evil config may do dns poisoning, or mess with router tables, or ssl certs.  Luckily the factory reset will fix this too, so the common solution is Nuke From Orbit, it's the only way to be sure.
Answer: While not technically a virus, router poisoning could occur. If a malicious agent gains access to a router, it could change the default DNS to a malicious server that can then redirect your traffic however it sees fit.
But like Randolph has stated, Resetting to factory defaults should eliminate any issues.
Answer: We had that happen to our Linkseye wireless router yesterday when we went to hook up a friend's laptop to our router to look up problems they were having in linking to the internet.
It immediately affected all our connected devices and it would not allow us to get back online – only to the CISCO router site. The friend's laptop evidently reconfigured our router but we couldn't get it to go back to factory defaults. We tried to press reset and reinstall the CD but nothing would happen.
Talking to their tech support – it allowed online chat – they offered to correct it for a fee (because I had gone past their 90 day warranty) so we declined and went out and bought a different brand router and re-established internet connection.
I am currently trying to use Norton to clean anything which may have contaminated our devices – but how can this friend's laptop be cleaned? I will not try to hook it back up through our router system again.
Comment: Welcome to SU - please post this as a separate question instead of tagging on to an existing question. Questions that have already had an answer accepted generally don't get much attention.
Comment: Welcome to Super User! You've posted this as an **answer**, but it's **not** an attempt to answer the original poster's question, so it [may be removed soon](http://superuser.com/faq#deletion). If you have a **new** question, please ask it by clicking the [**Ask question**](http://superuser.com/questions/ask) button.

Can a wireless router get a virus?