5 Centimeters Per Second: What does the ending mean?

Question: In 5 Centimeters Per Second, a boy and a girl get separated, and then try to meet with each other.
In the ending, when they are grown up

 The boy sees the girl as they are crossing the train tracks. They are interrupted by trains. The boy waits for the girl, but when the trains pass, she is gone.

Why is that?
Comment: It means they almost got hit by that train. The railroad crossing gates normally close at least 1 minute before any train passes by. lol
Answer: I attribute this to what would best be called a "Fleeting moment and feeling". His desire to see the girl again caused him to envision her being there for a moment which is personified by the passing train (another symbol that life moves on). But when it passes, so does his desire and like the train, he decides to move forward with his life.
Comment: That's an interesting theory. How can we be sure he imagined her? The girl was getting married, so maybe she just walked away because she was no longer interested in him? I'm not saying you are wrong, I'm just wondering if there are any hints in the anime as to what happened...
Comment: I think she was actually going to be moving further away for the better job IIRC. - Not sure but that is one way I look at it.
Answer: In an interview of Makoto Shinkai found here, he answers a question regarding the plant at the beginning of Episode 2. Personally, I believed that it was a throwback to Voices of a Distant Star, but it--in a way--answers your question indirectly. To quote:

Takaki, the male character, had dreams of this girl he liked who was
  very far away. In the image they're both on a distant planet that is
  far away, so he's dreaming that he's with her even though she's in a
  far away place.

When viewing Makoto Shinkai's works, distance always plays a large factor. He treats it with a vague touch. However, Makoto Shinkai always injects the notion that distance(space) and time are intertwined (VoaDS is a perfect example) and that there are events that span them.
At the ending of 5 Centimeters per Second, the girl was obviously a vision, as the distance between them cannot be closed physically anymore and the time lost cannot be reclaimed. The act of forgetting his lost love is a slow process for Takaki (the male protagonist), which is what the title is actually alluding to. The movie is not only one about distance and time, but of the events and the memories associated with them.
Now, the way I relate them all together:
Cherry blossoms are almost only beautiful when they are on trees (when the relationship is intact), and are almost equally as beautiful when they're falling (because memories are almost equally as beautiful as the real thing). However, while memories themselves live on, the reality they used to be gradually differ from how the memories are, much like how falling blossoms slowly become a fragment of the beauty of where they used to be.
The title tells us that each time lost is more distance apart physically and emotionally, and that at the final moment where the cherry blossom cannot cover any distance anymore per unit of time is the moment where the memory is--not actually lost--but stays just that: a memory. In a nutshell, the vision by the railroad is the final moment of their cherry blossom, Takaki's living dream of the girl in the faraway place, before it finally stops moving and reminding him of the relationship that once was.
Answer: Just saw this twice and watched the ending carefully and listened to the song, since the last 5 or so minutes of the movie mirrors the lyrics of the song.
Basically here is the lyrics:

I'm always searching for you, searching for your figure.
In the City, at dawn. At Sakuragi-Cho.
Even though I know you can't be there.
If my wish were to come true, I would be at your side.
There would be nothing I couldn't do.
I would risk everything to embrace you.
I'm always searching for you, always searching for even a fragment of you.
At the shop I'm going to, in the corner of a newspaper.
Even though I know you can't be there.
If miracles do happen, I want to show you right now the new dawn, who I'll be from now on,
And the words, "I love you" that I never said.
I always end up looking somewhere for your smile.
At the railroad crossing, waiting for the express to pass. Even though I know you can't be there.

So if you really read it through the lyrics and the fragment of clips and images.
The boy never saw the girl again but was just seeing a hope that maybe he did see her.
If you think about it, they never contact each other for a long time, so the girl didn't even know where the boy could be.
So the boy simply smiled since he didn't see her and finally came to terms with it.
If he did see her there though, he would do everything and tell her everything he never said or did before when they were still together.
Answer: This may be a little late but Akari was at the railway crossing. The manga shows a picture of of a girl from behind then a close up of her left hand with a ring on it. After the trains are gone so is she, Takaki smiles and walks off. The next picture is of Akari but the young Akari standing on the other side, she smiles and waves good bye to Takaki who is already further down the road.
Comment: Without spoilers, does the manga say much else? The movie left me a bit... unsatasified.
Comment: @VaughanHilts : no unfortunately it doesn't expand on the movie ending a lot. You get a lot more detail along the main story line, and some helpful subplots (helpful insofar that they clarify the direction of the movie), but the ending is pretty much as open as in the movie
Comment: @Sonny +1 for this answer, would you tell me where did you read the manga of this movie please :) or is there a site where we can still read it
Answer: The ending scene can be taken both ways, maybe she was there, or maybe not. For me, I believe she really was there. This may be subtle, but as they passed by each other, both of them (even the girl) seemed to notice each other. However, when they look back, as the gods of love like to interfere, a train appeared.
As the train is passing by, Akari went ahead. I think it symbolizes that she had already moved on for a long time. However, the main character clearly still had lingering feelings for her, as seen in episode 2 and 3. He did not only look back, but he also waited for the train to pass. He even turned around and took his hands out of his pocket. However, when the train passed by, the woman was nowhere to be found. He took it as a sign to finally moved on, and as he was smiling, he turned away. If I remember correctly, he was sad in episode 2, and even more depressed in episode 3: he even tried to slept with other woman, and he even quit his job to forget the girl.
We don't know for sure who first stopped writing letter, but I think it was the boy. This can be seen in the scenes where they exchanged letters, though I don't think it means that the boy stopped liking her — as seen in the ending, he truly loves her. Maybe it was due to some other reason, like change of address, undelivered letter, or something we would never know. But we can see that even though they don't receive letters from each other, they still looked at the mailbox - both of them. Even when the girl was walking with another guy, she still looked at the mailbox.
Anyways, no matter how anyone views it. The movie was a masterpiece.
By the way, I remember reading an interview with the writer/director of the movie where he said that the theme for 5cm/sec was "reality" - it isn't always a happy ending in real life, most of the time love fails. (Sorry, but I don't have a source for this).
Comment: might be he could no longer bare the pain of separation and so he stopped writing to avoid being reminded of it
Answer: The song if translated say that he sees a figment of his imagination and This is show as he is riding his scooter and he sees Akari. But at the railway he sees her for real and I believe that, that is what they promised each other all those years ago; they promised each other to see the cherry blossoms fall and as it just so happens the cherry blossoms where falling which to takaki was the only way to finally detach.even in the manga he sees a ring which can only be there if she was real. Also after that when the younger version of Akari waves back I believe it was what he saw when she wasn't there otherwise he would have ran after her.
Answer: As Tohno (male character) contacted Akari through email and mail stuffs, they hadn't felt the true meaning of love. So the title "5 Centimeters Per Second" tells that their love was growing apart with time. So Akari gave up on their relationship and found a new guy. But Tohno's life got ruined by her beauty and he still loves her and this kinda relates to the ending song.
Answer: I believe that he really saw Akari because (after checking the movie over 3 times but i might of missed something) he had not seen Akari in years so how could he possibly know what she looked like all that time later without even seeing a picture of her. So he must of recognized her as he stopped and turned around but since she had gotten over their relationship over time she didn't wait to see if it was Tohno so she kept walking. Also they had promised each other to see the cherry blossoms fall again and as they walk by each other you can see the blossoms falling so it was a way of concluding their relationship and Tohno moving on with his life.
Answer: This may be too late to change your ending view, but in the manga you can see that in the ending the girl shouts from the other side of the train when passing. Also, there is another chapter (volume 2, chapter 11) after that, it is Kanae's story part. The anime only ended on volume 2, chapter 10 of the manga.
Comment: Can you please expand a  little? What does she shout, is she a real person, how the manga ends? Dont assume we have read the manga
Comment: @ShantnuTiwari Ok, when the train already passing, this is what the girls shouted.. "takaki kun, you'll be just fine from now on, I'm sure of it",  then takaki said, "what about you", but no answer, and akari is not there anymore, he smile and continue to his life, and at the and akari was waving her hand.. there is another chapter after this you should read too.


Which adjective does 'pills', 'powder' and 'liquid' belong to?

Question: My native language is Spanish and today I was wondering how do you say 'presentación' referring to the type of presentation the medicine come from. For example, if you go to the drug store to buy a medicine you can ask if you have it in injectable form or in pills. How can you ask in which presentations the medicine came from? It is ok to say 'presentation' as a literal translation from the Spanish or it have a different word to refer to it?
Answer: The word used for this in English is form. "Presentation" is a false cognate.
The Wikipedia page on the concept here used the longer term "dosage form," but in practice we wouldn't use such a specific phrase unless we had to disambiguate with other meanings of the word.
Comment: "Form" is the correct term, but non-professionals would probably use "type" instead in British English, even though "type" has a different official meaning For example different "types" of blood pressure medication are diuretics, beta blockers, ACE inhibitors, etc, not pills, oral liquids, injectable liquids, etc.
Comment: @alephzero the technical term for the different "types" of blood pressure medication is **classes**. Type would only be used by lay people for this. https://www.heart.org/en/health-topics/high-blood-pressure/changes-you-can-make-to-manage-high-blood-pressure/types-of-blood-pressure-medications
Comment: Thank you so much, this was exactly what I was looking for
Comment: Amoxicilin - British National Formulary - **Medicinal forms** -
There can be variation in the licensing of different medicines containing the same drug.

Capsule, Oral suspension, Powder for solution for injection, Powder
Comment: Probably second best, but you could also use "Type", e.g. "What type of medicine is it? A pill, injection or oral?"


SRAM Red 1098 Cassette "teeth"

Question: I noticed on the largest sprocket of my SRAM Red cassette, after every 8th tooth, the tooth is missing.  I looked at one on line and noticed the same thing.  What is the purpose of not including these three teeth on the sprocket?
Comment: I can't find a SRAM Red 1098 cassette on google, but things like this are normally there to [improve shifting](http://www.sheldonbrown.com/k7.html).
Comment: I edited the picture from ebay in, @PaulK. Feel free to revert or to use a different photo if you want.
Comment: Can you add a photo -- either of your actual sprocket or a stock photo from SRAM's site?
Comment: RoboKaren....I added a picture.  I hope it got uploaded correctly.  There is also a pic of one at    http://www.ebay.com/itm/Sram-Red-Og1090-11-26-10-Speed-Cassette-4333-21-/192097015635?hash=item2cb9dfd753:g:95oAAOSwTglYlzrv
Comment: Batman - that makes sense, especially when going to a larger sprocket.  It does not look too common, however.
Answer: In general, when you see oddly shaped teeth or variations on a cassette/chainring, its there to facilitate shifting (such as Shimano Hyperglide, and ramps/pins you see on chainrings/cassettes; see this link for some examples).
In this case, SRAM calls it their "Open Glide" technology. To quote them:
"OpenGlide tooth ramping allows for faster chain transition between cog postions. We employ OG on the radical OG1090 cassette for sure and higher shift speeds."
And here is a figure SRAM provides:

The marketing blurb from Art's Cyclery says:
"SRAM's open glide technology refers to the shift gates created by removing teeth at key spots on the cogs to facilitate fast, effortless shifting going up or down or under power."
Whether it actually shifts better or not is a matter of debate, but a quick search says that generally not. I'd guess SRAM also found that to be the case, because they don't do this on cassettes in their current product line.
Comment: I have this "feature" on a SRAM force cassette as well.  Never found it to work better/worse.  I wonder if there are any chain wear effects?
Comment: I'd guess that it might wear a bit less, but not enough to be significant in any way -- it would depend on the period of the links being caught on a tooth, and that would also depend on the GCD of your chainring size and teeth on the cogs.

SRAM Red 1098 Cassette "teeth"


Is it a G flat or a G natural?

Question: I've got a doubt here. Do I play G flat or G natural??
The accidental doesn't come in till the 3rd beat while the key signature does not have G flat, while the lyric has an accidental but at the second quaver beat, so that means even if the lyric counts for the instrument part, the note still stays with a G flat, while the chord above says it's a G Flat chord.
Here's a photo:
Comment: This looks like a typo in the score. As written, it's a G, but all other information in the score suggests it should be a G-flat. What's the piece?
Comment: Which note are you referring to?
Comment: @Richard "This looks like a typo in the score" an *accidental accidental*, then?
Comment: Street Life - The Crusaders feat. Randy Crawford.
Comment: It would be interesting to see some more of that chart.
Answer: For starters, it's no G♭ chord. As it states, it's D♭m7, with a G♭ bass note.
Which means, assuming you're asking about the G in the bass clef (note on beat 2), it must be G♭, which means it's a typo.
EDIT: just checked another sheet music, and the D♭m7 is beat 1, then beat 2 is G♭9. so it would appear - a. it's not a slash chord. b. the second chord is G♭9, and the bass note is in fact G♭. A simple (common) ii>V>I just in that bar.
Comment: The Randy Crawford recording clearly has a Gb in the bass, not a G. Based on that, the style of the song, chord symbols and harmonic function it is definitely a Gb. Typos can appear anywhere, even in published music.
Comment: A typo is a typing error. Here, the flat sign has been missed out, by mistake I guess. But that bass note will be Gb, not the G that's printed. It is worth looking at other copies of the same song, I'm sure the accidental would be in some of them - unless they'rve all copied from the same mistake!
Comment: @JohnBelzaguy - good move, listening to the track.Didn't get that far.
Comment: Sorry, my bad. So, does that mean that I play G flat or natural??  I don't think it is a typo... This is an exam-piece for Trinity Rock & Pop Grade 6, not saying that they cannot make a mistake, but this book has been in the syllabus since last 3 years and this is the latest publication, don't think they would make such a mistake... So what to do?? Still I appreciate your help. Thank you .
Comment: May be this is not a "typo" but a test to see if you are able to identify a typo. ;)
Comment: @AlbrechtHügli in that case we all passed! :)
Comment: You remind me of my friend. Whenever he wouldn't get or understand anything, he would say it's a test for the student to go through it. I'm not saying you're wrong and I think this IS a typo. But it was just that I went back in time reading this  I appreciate all of your help. Thank you everyone.
Comment: @Ishan.J - are you sure it's grade 6? Trinity says it's 7...I've emailed them, and await the response.
Comment: Yes, it's Grade 6. I've been preparing for the exam since last 2 months. Here's a source - In the contents you can see the exam songs https://shop.trinitycollege.com/shop/prod/Various-Trinity-Rock-Pop-2018-Keyboards-Grade-6/2301980
Comment: Ah, the grade VII is the high *vocal*  version!
Answer: Dbm7-Gb7-Cb = iim7-V7-I in Cb: this makes sense as progression. And the chord sign Dbm7/Gb says the 2nd beat is still Dbm7 but above Gb. I agree with Tim.

Is it a G flat or a G natural?


Is there any food a nomad in a carriage-like transport can easily live on?

Question: Let's say there are 2-3 people in a carriage (or van,boat, or anything with a similar size), constantly on the move, unable to hunt (because of reasons) and of course unable to stay in one place and have a farm.
What food would be better for them to get the most nutrition they could carry (and grow the food for it, if the food they use isn't grass that's on the road) and how many calories really can they expect, without having to consider literally tons in "luggage"?
I though perhaps land snails, or quails, but neither seems really feasible.
Thanks in advance.
Comment: most advanced nomads are often pastoralists, living off livestock.
Comment: Is there a time limit between possible refuges/replenishment/oases? You can survive off about 0.5 kg (dry foods) per person per day, if water is available on the go, so 600kg could last 3 people about a year,
Comment: What is with all the irrelevant top answers? Unless I am reading it wrong OP is asking for food choices, not the means to get them
Comment: @Layman I think it's because you generally need to either make regular stops or you can get more food on the go ^^. Cars and horses fall in the first category, while boats fall in the second. The longest sustenance would be then to take food onboard + hunt/harvest for some more.
Answer: HERDS:

The obvious choice is to herd animals. This wouldn't work in the boat scenario, but even people who can't hunt can still bring goats along with them. Goats (or insert herd animal here) walk on their own with a little prodding, and produce milk directly and can be slaughtered for meat. Most wagons travel over rough enough terrain that they don't outpace a traveling herd. Yaks can be your transport animals, live off grass, produce milk, and can be slaughtered (but are limited in climate).
In your boat scenario, fishing and netting isn't exactly hunting, but may violate the preconditions. Tossing a net in the water and dragging it behind to catch fish is fairly passive, and can produce quite a bit of food. Based on all this great feedback, I'm adding that trained animals could be used to drive fish into nets to increase the harvest. The big take could be shared out with the animals as their cut -  either as domesticated animals or as a symbiosis between species.
In both of these scenarios, it isn't a perfect diet, but it can produce extra that can be sold/traded for whatever else you need. Herding is a sustainable lifestyle all on it's own.
Comment: Dolphins are surprisingly friendly to small boats. While not themselves herd animals - more pack - they may help herd other animals toward your nets, like sheepdogs on land.
Comment: @DWKraus Dolphins do [help people catch fish](https://www.livescience.com/20027-dolphins-work-fishermen.html) in some places.
Comment: @Brian Drummond Cool idea, I've never actually heard of people doing it, but if it worked, it would be an interesting symbiosis. River otters are used like this in India.
Comment: OK I've never heard of it as such either, but this is fiction, right?  Not fiction : Chinese river fishermen employ cormorants - raised from chicks and trained to fish.
Answer: If they are unable to farm and hunt then they are left with trading for food: they can pay with money or barter some of their goods with food provided from the locals they meet during their wanderings.
It doesn't really matter what food it is, and it depends on the place they are at the moment. It can be cereals or legumes if they are crossing a farming area, it can be dried meat or fish if they find themselves in a more hunting/fishing region.
They won't be carrying with them more than a few days of stocks, and they can get info from the locals on the routes to prefer/avoid.
Comment: Beat me to it. The only reasonable answer here is that they are buying or trading for sustenance.
Comment: They will probably be able to gather some of it but that's heavily dependent on seasons and knowledge
Answer: Foraging
It have been done by whole armies during ages. You don't have enough food for your army? well, just take what you need on local area. Wild animals runs, crops don't.
It can be devastating when a whole army does it, but if it's only 2-3 people, it can go more or less unnoticed. It can make you get troubles with local folk if you get caught though, but, well, you are nomad so reputation is not a big issue.
Comment: There's a reason why the Gypsies/Romani were historically widely hated across Europe, and this sort of behavior is a big part of it.
Answer: Pemmican.
http://scoresurvival.com/pemmican-native-american-super-survival-food/
This is dried, preserved half fat, half meat with some dry fruit.  It will keep a long time if dry.  The linked article quotes 300 kcal / 62 grams which compares favorably to butter (my favorite high calorie density food) at 350 kcal / 50 grams and you wont get scurvy eating only pemmican.  So if I eat 2100 kcal a day of pemmican (it is hard work, riding in the van!) that is about 500 gram or 1.1 lbs.  Having 6 25kg bags of this stuff in the back of the van is not outrageous and that, and the love, and the beer will sustain me and my driver for half a year.
You could make this much pemmican with a couple of buffalo.  Or if I were a farmer and I were on a nomad route I would make a bunch of pemmican when I slaughtered some animals and then sell it to the nomads when they showed up.
Comment: @Michael some pemmican recipes include dried fruits.
Comment: @Michael - apparently it depends on the fruit.  In this old study sun dried peaches did just as well as fresh as regards preventing scurvy.  https://ajph.aphapublications.org/doi/pdf/10.2105/AJPH.25.3.328.   Or if you were specifically interested in preventing scurvy with your pemmican you could include scurvy grass or sorrel which I think is even better than fruit.
Comment: Why would Pemmican prevent scurvy? Meat doesn't contain Vitamin C.
Comment: @Ryan_L: Are vitamins really that long-term stable? At least for vegetables I thought they rapidly lost vitamins as soon as they are picked? According to this paper unsulfured dried fruit basically loses all its vitamins: https://ajph.aphapublications.org/doi/pdf/10.2105/AJPH.25.3.328
Comment: If it is processed in a way involving cooking, pulping, exposing to air for drying etc. most of vitamin C won't survive. Which is why citrus was the staple fruit on ocean-going ships since it comes with durable packaging that keeps things fresh in it. That being said it is also abundant enough on land - some occasional berry picking, occasional greens and veggies, or animal products like eggs and liver will be enough to not even realize scurvy exists
Answer: For a single family constantly on the move, you want nonperishable and energy-dense food. If they get to keep a herd, it is the best option since a living animal is as nonperishable as it gets. Otherwise, you want energy-dense low-moisture foods for your family. This means mainly fatty foods.
Your second best option is to render fatty meats to get rid of the moisture which would leave you with a good staple that can last for weeks to months if kept cool. Steppe nomads were known for storing meat like this as their winter staple.
Nuts are also a good option in the same niche although likely to be less abundant - high fat, good source of protein and micronutrients, low moisture especially if roasted and salted. Same goes for legumes if you can somehow forage for them.
As an alternative, you can carry around some flour to and trade for it time to time. At worst you can easily make hardtack with it or mix it with water for some porridge, make flatbread etc. It is nutrient, can be stored long enough and carbs are good to stay energetic if your nomads are active. It has been the human staple for millenia for a reason.
For lean meats that do not come with enough fat to fully cover it once rendered and cooled, which is the majority of what you will have if you do not have herd animals since small mammals, fish and poultry all fall under this, salt is your option. Salted and dried meat is also durable and a good staple.
Dairy products are also something your nomads can look into. Hard cheese is perfect but can end up possible to acquire only through trade, since takes quite a bit of effort to make. Same for butter you can render etc. You can make yogurt which can make any milk you find last for a few days longer than the hours it normally would without refrigeration. All you need is some tall flower or grass off the fields you know to be harmless for the bacteria on it.
Following these is dried fruit. You can easily forage or trade for it since it is abundant especially in the form of berries. Perfect for instant energy, calorie and micronutrient dense, although lacks in proteins and not really suitable to be a staple. Also if you are not an experienced forager some berries can be nasty.
Alcohol is the final thing to look into here. It can be a good byproduct from fruit juice you would get if you are drying fruit as pulp or even milk. If you are making it, you can trade it. If not, trading for some liquor time to time might be a good investment to keep the spirits high, not to mention some niche uses like as a disinfectant.
Comment: Actually fat is more energy dense than alcohol (ethanol). It has 7kcal per gram while fat has 9kcal per gram. I agree with the rest of your food suggestions, the only major problem I can see is lack of vitamin C. I can't think of any solution, except obtaining and eating (citrus) fruits in large quantities whenever possible.
Comment: Thanks for the correction. Citrus is the best bet but any vegetables or berries, even eggs, liver etc. should be also sufficient to add some in a diet. Scurvy would be a bigger problem with absolute zero access to plants and nothing but hardtack and fish like on a ship as opposed to land
Answer: Potatoes
Potatoes might be a good food for your nomads: they are nutrient-dense and contain lots of starch, they don't need a lot of space to produce a lot of energy, they are easily sustainable, and they could be planted in a carriage.
That last point may seem odd, but home growers sometimes plant potato tubers in tall, tied off bags of soil to keep from having to do a lot of digging at harvest. Your nomads could hang bags of potatoes off the back of the wagon once they have enough leaves to photosynthesize, and start the plants from saved seed eyes in planter boxes inside the vehicle.
Health-wise, potatoes are starchy, so they are filling and good for keeping you going. You can only expect to get about 110 Calories from a single medium potato and it doesn't fulfill all your dietary needs, so it would need to be supplemented by something else, but foraging or another answer would do that for your nomads.
On the other hand, you do have to cook them and make sure they don't go green while you store them. That could be done by leaving them in the soil until you need to eat them. Another downside is that potatoes need soil that is rich in nutrients. But, if you have animals anywhere near the nomads, you have the beginnings of good fertilizer.
All in all, potatoes would be an excellent choice for the nomads to consider.
Sources:

11 most nutrient dense foods on the planet, healthline.com
Wikipedia on potatoes
Livescience.com on potato nutrition facts
Answer: milk or dairy product mostly like butter, yogurt, cheese, milk candy/milk cake, and milk wine (ayrag or kumis and kefir, they are considered as alcohol upon googling it) outside of meat from domestic animal (since you eliminate hunting)  such as horse,cow or yak,goat,sheep they can move as a pack with your nomad, depend on the climate or weather you can make dried or jerky meat, you can also drink the blood or make blood sausage.
for boat, fish, squid or octopus, or shrimp if you catch it during night, though base of my knowledge its far faster using harpoon or spear to catch fish rather than fishing rod (assuming the water is clear enough), assuming this is small boat unable to carry big catch using net, or go landing or sail near the shore to take nearby plant such as fruit or coconut for hydration and food, or finding clam near the shore.
if they cant even have the chance to land or come near shore they need to eat their fish, squid, octopus, shrimp RAW since you cant cook in the boat, unless this is modern boat which i has no knowledge about, but im more worried about water since you will depend on rain for that and you need to boil it to make sure you dont get sick.
as far as i know, two or three medium size fish is enough for a single person to keep going.
Comment: What is milk candy? Like milk chocolate?
Comment: @william like [this](https://www.khovsgoldairyproject.org/wp-content/uploads/2015/05/img_1521.jpg) and [this](https://img.alicdn.com/imgextra/i4/2828877592/TB2E9x9exPI8KJjSspfXXcCFXXa_!!2828877592.jpg) to make it clearer, most of them is soft and chewy but some is hard like aaruul and [this one](https://ae01.alicdn.com/kf/HTB1mF.DKXXXXXcDXpXXq6xXFXXXx/Mongolia-bright-candy-snack-specialty-Inner-Mongolia-dairy-Packed-Mongolia-peanut-nougat-180g.jpg) though some considered it as cheese.
Answer: Nomadic societies sustained themselves on mobile animals for millennia. Not for meat alone. Milk (and cheese, butter, yogurt), fur for warmth and meat upon euthanizing older ones.
Fish, dried and salted lasted for months.
Answer: In situations where you are on the go for long periods of time you need food that will keep most importantly. A good option for nutrition would be reduced soup as it can be eaten a bit like jerky and can be prepared as a way to keep stews made on the go when resources are available. keep in mind however they will still need water, both to make soup and to drink. now storing water on long voyages is tricky because it can become contaminated easy and so a viable option is to of course make grog, in other words bleach the water with enough alcohol that bacteria cant survive in it, and contrary to popular belief it doesn't have to be potent enough that they are drunk all the time. You can also just boil and recollect water to sterilize or keep in a hot metal container for long enough.
some other good foods include:
hard tack
basically flour + water
problem is it is low in nutrition and can become prone to weevils but will keep longer than traditional bread
salted meats/jerky
hard to make especially on the go with limited resources but basically the same as reduced soup in nutrition and keep-ability
dried fruits and herbs
this is less often used as a whole meal but some stuff to keep in mind especially because more can be gathered on the go
and don't forget you can always have a combination of the various foods for endeavoring!
Comment: https://youtu.be/2fE5KzvOZRk pocket soup
Answer: Piracy, pillage and plunder
They attack homesteads and small villages when it's dark, then grab what they can and gallop off into the night.
Also of course they can steal non-violently and surreptitiously.
Comment: How does this answer the question?


Why did cryptokitties congest ethereum network when it has resizable block size?

Question: So I am wondering how come eth network got congested when block size is resizable and it can take more trx if needed? I am reading some info that it can do that but miners don't want to do it as it causes them to basically earn less. Also I see in this post Why don't Ethereum increase the block gas limit?
that miners can even mine empty block to get advantage, how come this is possible and not banned in consensus mechanism?
Answer: Most of the miner usually want to maximize their rewards. The whole consensus protocol is based on that assumption.
If a miner mines an empty block he gains the block reward. But he doesn't get the gas fees from transactions. Therefore he is incentivized to include as many transactions in his block as possible to get the biggest reward - including and executing the transactions doesn't cost almost anything for the miner compared to the effort of solving the Proof of Work "puzzle".
As for why not increase block size a good answer is already provided in your link.


Is there a way for a wizard to gain cure spells on his spell list at first level?

Question: Aside from the Samsaran Mystic Past Life racial trait is there any way for a first level wizard to gain cure spells as spells known at first level?
Answer: Nope.
After looking into adding spells to caster lists extensively when building a pathfinder character, I found a few methods to do so, but none that worked at level 1 other than Mystic Past Life.
To my knowledge, which is extensive if not absolute, there is no way to add spells to a list as a first level wizard beyond that ability.
There may be a way to do whatever it is you want cure spells for, but to gain specifically arcane cure spells at first level without just taking a level in one of the classes that gets arcane cure spells, the only way I know of is Mystic Past Life.
Comment: You missed Two-World Knowledge, but it doesn't apply to cure spells anyways (only level 0 spells can be added). And magic items of course.
Answer: I don't believe so.
The Life subschool of Necromancy offers some healing abilities but not specifically the "Cure" spells. The Necromancy school overall focuses more on abilities affecting undead anyway.
I know the White Mage Arcanist archetype can, however.
If this is a pre-character-building question, the White Mage may be something to look at. If this is an in-campaign question, I fear you may be out of luck. Short of finding scrolls or a wand and having a good Use Magic Device skill bonus, I don't think there's a way to actually put the Cure spells on your spell list.


How do I convert KECCAK-256 to FLOPS? (Ethereum)

Question: I wanted to know how much one Ethereum KECCAK-256(hash) is in FLOPS. I know bitcoin is 12,697 flops per hash.
Comment: keccak and bitcoin do not use algorithms based on floating point math, they use integer math
Comment: FLOPS is floating point operations _per second_, so it makes no sense to ask how many FLOPS a hash is. And as @RichieFrame says, these hashes operate on integers and not floating point values.
Comment: I have a hardware that performs 32 bit FLOPS, I wanted to calculate the hash power or what the equivalent mega hash would be. If I worded it right. @RichieFrame So what would be the math equivalent compute number? lets say if I had 1 Teraflop compute power.
Comment: If your question is specifically about the cost of one Keccak-256 evaluation on the EVM (or something like that), you may want to ask on [ethereum.se] instead.
Answer:
I wanted to know how much one Ethereum KECCAK-256(hash) is in FLOPS

This question question makes no sense, for multiple reasons:

FLOPS means Floating Operations Per Second, so first we have a missmatch of units, one or mutliple operation(s) can't be compared to operations per second.
Second Cryptography (almost) always uses integer arithmetic for its computations and not floating point operations and so the measure of floating operations per second doesn't relate at all to the computation cost of (most) cryptographic algorithms.
If however you were to ask how many integer operations / instructions one needs, then (sometimes) cryptographers use Million Instructions Per Second (MIPS) to express the power of a particular CPU. Then you could measure how many MIPS a CPU provides and then measure the time it takes for a particular crypto algorithm to execute and then multiply these numbers to get a rough estimate for the number of instructions a given operation requires.
Finally, usually cryptographers these days tend to measure in cycles per byte (cpb), that is, for a given CPU architecture and a given input length $l$, how many CPU cycles did it take to finish the computation of eg $H(1^l)$ and then divide this time by $l$. Examples of this style of measurements can be found here.
If you have your own runtime environment (eg the Ethereum VM?), then the best approach to get the cost of a particular function evaluation is either to a) look it up in some documentation or on some website where somebody has already done the math b) try to count instructions and add them together with the appropriate weights or c) just measure it.
Comment: Okay, in that case. What would be the MIPS for KECCAK-256 algorithm?


Cartoon Network show. Monster hunting. Dark theme. Monsters looked to be done by CGI

Question: Okay so I remember almost nothing of this show. The only thing I know is that I used to watch this show on Cartoon Network and it had a hero who used a sword to fight monsters and a girl who used bow and arrows. Also, the monsters kind of looked like computer generated and there was a book and stones which were somewhat related to the story?
Comment: see also https://scifi.stackexchange.com/questions/192661/book-about-three-companions-forced-to-solve-puzzles-to-find-gems (about the books on which the anime is based)
Answer: Could this be the anime version of the Deltora Quest books?

Directed by Mitsuru Hongo (World Trigger, Outlaw Star, Spirit of Wonder), DELTORA QUEST is based on the first Deltora Quest series written by Australian author Emily Rodda. Deltora Quest follows the journeys of Lief, the son of a humble blacksmith, who sets out to fulfill his father's quest to restore the Belt of Deltora.
In this epic quest to save Deltora from the evil grips of the Shadow Lord, Lief is joined by ex-palace guard Barda and Jasmine, a wild girl from the Forests of Silence. Their quest is to find the seven gems of the Belt of Deltora: the topaz, ruby, opal, lapis lazuli, emerald, amethyst, and the diamond. Each gem has a special power hidden in ominous locations around Deltora, and in order to find these gems, the three friends must face numerous obstacles and perils.
Their adventure is no easy task — the trio must form crucial allies; slay monsters; and tackle obstacles filled with twists, betrayal, and word games in order to survive. Once the Belt is complete and the proper descendant of the first King of Deltora, Adin, wears the belt, the evil tyranny of the Shadow Lord will be forced back to the Shadowlands. For a children's literature series, this is a true fantasy series complete with demons, magic and dragons, and it is (without a doubt) one of the best children's fantasy series out there.

There's a guy with a sword, a girl with a bow, magic gems that are part of the plot, and some of the monsters were rendered with CGI.

Here are the opening credits, which also feature a book:

I found it by searching for cartoon network monster hunters sword book stones


Blocked websites on Safari

Question: I was using a public WiFi spot at the airport and noticed that certain websites on Safari were being blocked. I was able to go to these websites when I used my own data, but I have limited data so is there a way to bypass this?
Answer: Public WiFi hotspots, especially free ones, tend to block certain sites just to limit bandwidth usage or potential liability issues. Workaround number one you have already found: use your own cellular data, which is not always an ideal situation.

VPN software is sometimes a good solution to this depending on if the public WiFi allows VPN connections. If it does you can get one that supports iOS (I use TorGuard but there are hundreds of others) and use that to bypass the limitations of some public WiFi hotspots.

Note: depending on what you are trying to do online that WiFi hotspot might see you sending and receiving large amounts of data (Netflix, YouTube, etc.) and block your MAC address and you are, again locked out of that particular WiFi hotspot.
Answer: The best way is to use a vpn. Because, this is due to the rules of the wifi firewall.
Comment: Thank you for your answer. :) Unfortunately, short answers such as this don't really provide enough detail or context to help many users. If possible, it'd be good if you could add some more info, such as what a VPN is and how they may go about using one? Also, you may want to read [How to Answer](http://apple.stackexchange.com/questions/how-to-answer) for tips on providing answers here.
Comment: Thank you for your remark but it's complicated to make it clear how to use it, because I don't know if it's on Mac or iPhone.
Also, the usage will depend on the service he will buy or not. If it supports openVPN or only the VPN application. Yes, I could have given details about what is a VPN, but I didn't want to get out of the area of the question. Who's how to bypass the limitation of wifi
Comment: @The33Coder You can use comments to ask clarifying questions so your answer will be more complete and accurate.  Once you have sufficient [reputation](http://apple.stackexchange.com/help/whats-reputation) you'll be able to add [comments](http://apple.stackexchange.com/help/privileges/comment) and ask follow-up questions. To gain reputation, [answer questions that are clear and concise](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead).

Blocked websites on Safari


Where to insert chapter breaks

Question: I've recently written something about the length of in-between a short story and a novel. I've had a bunch of friends edit it, and all of them say that I should insert chapter breaks. I wrote the story in a one block of regular and then a flashback explaining the history of the characters and shining light on the plot format, so I'm not sure where to put chapters. I tried to end each little section on a cliffhanger. If I have my story written in this format, then where should I put chapter breaks? Every other, or every two, or every three were all suggestions that I've received.
Comment: Related, might be a dupe: http://writers.stackexchange.com/questions/1806/when-should-a-chapter-end
Answer: Placing chapter breaks is very subjective. There's no real rules, except perhaps to make them all approximately the same length in terms of word count. This is a guideline, however, and should be taken that way. It's mostly there to keep any chapter from feeling like it's rushed, or dragging.
Every scene should push the reader to the next scene, and each chapter to the next. It's often said a writer's goal is to keep the reader up long into the night because they can't find a place to stop reading.
I've also heard it's a good idea to end each scene on a minor cliff hanger, to propel the reader to the next scene, and end each chapter with a larger cliff hanger to keep the reader going into the next chapter, which is where most people will want to stop.
But again, it's largely subjective. Take a look at your story and see if you can find a similar number of the "little sections" you referred to, and if one of them ends on a more powerful cliff hanger. That would be a natural place for a chapter break. Grouping your sections this way should help you figure this out.
I hope that helps some!
Comment: This is an excellent way to break it down with the 'minor' and 'major' cliffhangers.
Comment: I also remember, in *New Moon*, Stephanie Meyer stylistically chose to have several pages with just the month name as a chapter heading to show the passage of time as a fog of "unawareness" on Bella's part. There isn't a single word in any of those "chapters", but they show up in the TOC. That probably takes the cake.
Comment: WRT approximately equal word count, even that's a very rarely-observed rule. As one simple example. see *How to Eat Fried Worms*; there are "chapters" that depending on print format are only one or two pages.
Comment: @KeithS, that's very true, and I've read books with a single sentence as a chapter. I think Joe Hill's "Heart Shaped Box" used this technique, IIRC. Not an uncommon one; ref. Fell's answer on pacing.
Comment: James Patterson routinely has (functionally) 1 page chapters routinely and he is a best selling author.
Answer: Given your description of the story, it sounds like your readers could use breaks in the action. Everything @Josh said in his answer applies, so I'll just talk a bit about pacing.
There is a rhythm to every story. It's created by the prose, by the dialogue, and by breaks in the action. You know the pulse of your story better than anyone, so use breaks to give the readers a chance to catch their breath. A chapter break or a typographical divider (like an asterisk) can also give them a chance to pause and think about what just happened. You can have as many "sections" within a chapter as you need.
On a side note, I'm doing much the same thing right now with this answer. When I've suspected that a paragraph has done its work, I move on to the next one. This is more a courtesy to the reader than a rule.
Two pitfalls when breaking up a story:

Too few breaks, and the reader won't know if they can pause their reading to use the bathroom or mow the lawn
Too many breaks, and the story begins to feel frenetic

For an curious look at how an author broke up a story in an interesting and highly intentional fashion, check out Zeroville by Steve Erickson. His "chapters" are numbered from 1–250, then back down from 250–0. And some of them are only one word long.
Comment: Oh, nicely stated, @Fell! Great job there

Where to insert chapter breaks


Nvidia drivers with GeForce 680M problem

Question:
Possible Duplicate:
There's an issue with an Alpha/Beta Release of Ubuntu, what should I do?

I have a new Alienware M17x which I have installed 64-bit Ubuntu 12.10 (dual boot). I have tried various ways to install the Nvidia drivers for the GeForce GTX 680M (which they claim they are compatible with):

from Ubuntu Software Centre (though Additional Drivers fails to detect the card.)
using sudo apt-get install nvidia-current
downloading the drivers from nvidia and manually installing them (ctrl + alt + F6, sudo service lightdm stop, sudo ./NVIDIA*, sudo reboot)

(each with a clean install of Ubuntu) but in all cases, when I reboot after installing nvidia-setings claims that I am not using the driver and should sudo nvidia-xconfig from the terminal, which I do but this has no effect and I am stuck in crappy resolution until I rm /etc/X11/xorg.conf and reboot.
The xorg.conf that nvidia-xconfig generates is:
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Comment: I have the same problem with 640M LE
Answer: The way I solved this problem, was to install Bumblebee to enable optimus.
For some reason the default video card seen in Ubuntu is the integrated Intel card and installing the Nvidia drivers without bumblebee causes a mess. The installation is pretty painless.  To run your software with the Nvidia chip, you need to open terminal (Ctrl+alt+T) then type optirun in front of whatever you want to run.
An added benefit is you will get better battery life as the Nvidia graphic card will be turned off when not in use.


Win 10 and Ubuntu - cannot create dual boot

Question: I'm pretty sure I did everything - turned off the fast start up, ensured first boot is cd and everything is UEFI.
First install I got Ubuntu 14.04 working ok - though I did have two boxes to select o/s, I got error messages and had to select extra things before it would load Ubuntu, selecting windows worked fine.
Second install I tried Gnome Ubuntu 16.04 - could never get the option to boot into Ubuntu, windows just loaded. Tried the chroot thing to change the grub/reload the grub, no good.
Third Install - back to Ubuntu 14.04 - now that doesn't come up at all - straight to windows.
I'm thinking there must be a fundamental thing I'm missing here?
New laptop, HP AMD quad core.
Any ideas? thanks
Comment: Reading further, I'm thinking when I have attempted to repair or reload the grub2, I may have entered its location incorrectly - I see there is a drive letter and partition number ie sda6. I think 6 is where my Ubuntu install is. Should I have loaded the grub into a special little partition where the UEFI boot loader is?
Comment: Please run the [Boot Info Script](https://sourceforge.net/projects/bootinfoscript/). This will generate a file called `RESULTS.txt`. Post that file to [a pastebin site](http://paste.ubuntu.com) and post the URL to your document here. This will give us more details about your configuration, which is required to base an answer on more than guesswork.
Comment: Thank you for your help. I've done all that here.....http://paste.ubuntu.com/16168447/
Comment: You have to install Windows first then Ubuntu. And make sure both are installed in the same bios mode UEFI or legacy. And no need for manual recovering..
Answer: Your Boot Info Script output was generated from a BIOS-mode boot of an emergency disk, but all your OS installations seem to be in EFI mode. This suggests that your Compatibility Support Module (CSM) is active, which can wreak havoc with booting EFI-mode OSes, as described on this page of mine. Thus, I strongly recommend that you disable the CSM. This will require entering your firmware setup utility and finding an option to do this. It may be called "CSM" (or its expansion), "legacy mode boot," or something else; unfortunately, there's no standardization on how this option is named or where it may be located in your firmware setup utility.
Disabling the CSM may not be the end of your problems, though; it could be that your NVRAM settings are corrupted or some other issue may be getting in the way. If you continue to have problems, boot a Linux live disk again, type sudo efibootmgr -v, and edit your question to include the output, adding four spaces to the start of each line. (If the system complains that efibootmgr is not installed, install it. In Ubuntu, you'd do this by typing sudo apt-get install efibootmgr.) There may be redundant entries that you could delete with efibootmgr, or resetting all the firmware options to the defaults may be required -- but the second of these actions will require re-creating an NVRAM boot entry.
Answer: First make sure if your Windows installation is either Legacy Bios or UEFI.
If it's UEFI, then boot your Ubuntu installation media DVD/USB in UEFI as well.
Continue with installation.
Once the installation completes, log into newly installed Ubuntu, then
sudo os-prober
sudo update-grub
reboot

Comment: Workaround: I have found that all I need to do is hit f9 on startup each time and after just a few seconds get a basic looking menu with either windoes uefi, ubuntuu uefi or efi. Select ubuntu, job done.


User without licence to access community website?

Question: My org is planning for a low budget app. So can we have only one salesforce user and setup a rest api. Then all the user we need to access is added to contacts. Then can we use those users to login and others on community through rest api query?
Comment: For communities there are separate licences which are used to create users linked to the contact records, these are cheaper than full SF licences and can login to the community to use some Salesforce functionality (what they can see or do varies by licence type).
Comment: Are you asking if you can use a rest API and use a single user account for all of the community users. If so that is not how SF communities is designed to work. Please clarify that in your question and see [ask] for guidance on how to ask a question.
Comment: @DaveHumm  _Are you asking if you can use a rest API and use a single user account for all of the community users_ This is what am asking here. Can I get some valid reasons why we cnt achieve this. Since we have 15000 api hits per day for an org .Also do you think concurrency hit affect this?
Answer: You cannot have only one Community User setup and allow other "Contacts" to be able to login to the Community using REST API.
Every Community User is associated to a Contact record and in turn an Account and have their own credentials whenever they are setup as Users (see more on Create Communities Users). While accessing any REST API, you first authenticate the User and then get access to the resources. So if you setup only One User, and use only that User to authenticate the API, every time you are necessarily logging in as the same User and getting access to the resources which the User is authorized to, and not as any other User.
If you are looking to expose data which is not too sensitive without investing much into licenses, then you should look into Guest Profiles and enabling Public access to your Community.


what is the maximum heap size and stack size supported by iphone os?

Question: Could anyone tell me what is the maximum application size supported by iphone? Also what is the maximum heap size and stack size supported? Application goes 'out of memory' very soon...
Answer: Any numbers you may get are

Subject to change (even if they're correct now, they may very well be wrong at some point), and
Useless.

What, specifically, are you doing to do with either of these numbers? Track how much memory you allocate? And what will you do when you run out? iOS sends you a message telling you to free up some memory when that happens; what will you do differently?
Don't worry about enforcing limits on yourself. Just be as efficient as you can be.

Application goes 'out of memory' very soon...

Then you are not being efficient with your memory. Profile your app using Instruments's ObjectAlloc and Leaks instruments, and find out where your inefficiencies lie. Once you fix them, your app will not be constantly running out of memory anymore.
You should also read the Memory Management Programming Guide, if you haven't already. It's possible that you're simply not releasing things that you need to release. If that's the case, you'll see a lot of leaks with the Leaks instrument.
Answer: If you have infinite (non-tail-)recursion, you get dropped into the debugger with around 20k stack frames. I'm not sure how many bytes this corresponds to, but it's enough for anything sensible.
There's no set maximum apart from the usual address space limit (probably around 3GB); your app is getting killed because the device has run out of physical RAM and there are no more background apps to kill.
If you're getting killed do to low memory, you're either doing something very silly or there's a memory leak.


My daugher has Nightmares but can't remember them

Question: My five year old daughter is having nightmares, but she cannot remember them. When we ask what they were about (both at the time she wakes us up or the next day) she says she can't remember then tells us a story that really doesn't have anything scary in it (her words not mine.) We are at a loss of how to help her with these nightmares if we don't know what is causing them.
Comment: Not remembering dreams (including nightmares) isn't uncommon.  That said, I remember as a kid having a dream repeatedly that wasn't scary when I'd retell it (if anything, it was just weird), but for whatever reason it freaked the heck out of me in the dream.  It happens.
Comment: Same here I'm 14. Can remember having a dream when I was 8 or 9, it was so terrifying yet I have no idea why. I've had the same dream over 6 times. One of them just now, I still can't remember it. Every time I have the dream I remember a little bit more maybe when I'm 64 ill remember it all.
Comment: I'm having this kind of nightmare since I was 5, now I am 17 years old. It's really so scary and sadly my mother doesn't believe me and I have nobody to help me. That's why you should help her.
Comment: @Maya, there's a thing called therapy and counselors for this, don't you think you should get help?
Answer: You may not actually be dealing with nightmares. You may be dealing with night terrors. From the NIH website (linked), night terrors are disturbed sleep, usually waking up in a terrified state. They are common from ages 3-7, usually in boys, but not uncommon in girls. The cause is unknown, but the site indicates that stress, emotional tension, fever, or lack of sleep may play a role.
According to an informational article in a Canadian family physician journal, night terrors are not harmful to the children having them. They often don't remember why they were so terrified. The article also attempts to reassure parents, indicating that they will pass over time. If these problems are occurring early on, only about 1-2 hours in to bedtime, this is most likely a good indicator you are dealing with night terrors. Night terrors aren't dreams, so they don't occur during REM sleep.
If you think you could be dealing with this, try to observe when she has the nightmare. If she wakes up but it is still not all there, it is probably a night terror. If she wakes up and she is completely alert and talking to you, it is most likely a nightmare.
If you are sure it is a nightmare and she is able to write, keep a notebook and a pen beside her bed. Ask her to write down what she was feeling, seeing, or dreaming immediately before she woke up. We often forget vivid details of dreams as we progress throughout the day so if a dream needs to be studied, dream journals come in handy. Try this with your daughter. Perhaps you can isolate the details of the nightmare and figure out 1, what they are about and 2, why they are occurring. Once you understand those two things, you can move on to conquering and eliminating that fear.
Feferman, I. (1988). Night terrors in children. Canadian Family Physician Médecin De Famille Canadien, 34 2685-2686.
Answer: There are two schools of thought on nightmares. One is to talk through them to help calm the child, which you are trying to do, but the other is to avoid pushing her to remember them and instead work on the more holistic view - calming the child or removing the uncertainties/stresses/pressure that may be causing her to have nightmares in the first place.
Sometimes just altering the bedtime can help, or you can look at night lights, the sounds that she will hear while going to sleep etc.
Are you in an area where external noise may disturb her (trains or trucks, for example)?
And as Christopher pointed out, if she is not bothered by them at all, don't worry about them - you may just have to learn to ignore them until they stop.


How do I do enterprise iPad recovery?

Question: Occasionally we have employees supplied with company equipment that leave on less than favorable terms.  Some of those devices the employees have locked to their own Apple accounts somehow, which leaves us unable to reset them the normal way.  Is there a procedure somewhere that we can restore these to factory (I assume that it would require some kind of vetting process with Apple to confirm the iPad not stolen of course).  So, what's the procedure for this type of enterprise iPad equipment recovery (if any, perhaps they're just bricks now)?
Answer: I use three avenues to prevent hurt feelings all around.

First the policy for employee use of equipment spells out that it's their responsibility to turn in their company equipment and assets. For iOS devices, that means that they remove iCloud activation lock and return the hardware in working order. The financial consequence of failing to do both is explained when the hardware is issued. HR can then choose to deduct that amount from any final pay check as appropriate should the employee choose not to return company property.
Apple is very helpful in unlocking equipment that was bought through their channel or that you have a purchase receipt with serial numbers included proving original ownership. Any genius bar or web/phone Apple epmployee can get you started with unlocking one or several devices should you have them but not control of them.
MDM solutions such as JAMF casper suite or Configuration profiles to enable remote wipe and/or iOS policies that prevent iCloud usage in the first place if desired and/or allow wiping them to a known original configuration.
Comment: @BrianKnoblauch The MDM solutions are so poor in general, I almost left them out. The locking down of iCloud has big downsides, so we rarely exercise it except for in educational and uniform imaging situations like labs or when the iPads are really interchangeable as opposed to personal and locked down.
Comment: We'll dig out the paperwork and contact our local Apple store.  We do have an MDM solution, but apparently a couple devices (bought for early adopters) were missed.
Comment: Update:  The Apple Geniuses said it's impossible to unlock the equipment, even with all our paperwork in order.  So far, we've eventually (sometimes taking months) been able to get the ex-employees to supply the codes.
Comment: @BrianKnoblauch Bummer - Yours is the first I've heard of Apple denying an unlock to someone with (potentially) original purchase receipts showing the serial number. I'm curious, did you purchase these from Apple or a reseller and what was the deficiency in the process? The rejections I have heard of are where the serial numbers and/or identity of the original purchaser could not be documented.
Answer: I believe you have to contact apple and submit the device serial numbers so that apple can unlock the devices. I would start by calling applecare and i'm sure they can point you in the right direction.

How do I do enterprise iPad recovery?


Flex: Custom Menu Functionality

Question: Does anyone know of a way to keep a menu open after clicking one of its menu items?  I have a custom menu (extended the menu object) it contains a bunch of 'check' type menu items, the requirement I am trying to fulfill is to allow the user to click multiple menu items without the menu closing, and then have the menu close when it loses focus, is this possible? If it is can someone please explain how it can be done (pref. with a small example).
Thanks in advance for any help
Answer: You should listen to the itemClick event and call preventDefault() on your menu handler.
<code>private function menuItemClick(evt:MenuEvent):void
{
    // set your checks
    evt.preventDefault();
}
</code>

Flex: Custom Menu Functionality


Linux Redhat Update to Java 7

Question: I'm trying to update to java 7, via command line but having no luck, can someone help me out please? I've done some searching, but haven't come up with anything that works so far.
Answer: Have you tried http://java.com/en/download/help/linux_install.xml
Your going to want the RPM package if your on redhat
http://javadl.sun.com/webapps/download/AutoDL?BundleId=64144

Linux Redhat Update to Java 7


Software to recognize TV show video?

Question: I have a lot of recorded videos. I know the show name, but don't have the episode name. Is there software to recognize episode name by video?
Comment: Don't know of any software like that, but if reverse image search services like Google Images or Tineye are able to recognize random frames from the video, then you could write a script that extracts a random frame and uploads it to one of those services
Comment: Are these digital recordings?  Depending on what format you used the closed captioning text **might** be embedded in the video.  Many formats don't but a few do.
Comment: Yes but no cc available
Answer: Yes, apparently Shazam can do this, not through video but through the video's audio.

Software to recognize TV show video?


Connect to mysql / oracle database with ssh

Question: I want to connect to my database with the tool SquirreL in ssh.
Is it possible?
Sadly I have no other options for this server, so I ll have to change of tool if it is not working.
Comment: Graphical SQL clients such as SquirreL (and HeidiSQL, and MySQL Workbench) connect directly to the SQL server without an intermediate connection. Why does this standard method not work? Is the machine not accessible remotely? Is the port the server is running on blocked on either your side or the server's side?
Comment: the machine is only accessible with ssh connexion sadly, it is blocked on server side. Or I can still use phpmyadmin... ( sic)
Comment: If phpmyadmin is installed, that's probably the best way to interact with the server since it has sql dumping, query execution, table structure and data browsing, and all that usual stuff. If not, you can probably install it since you have SSH access.
Comment: An application like `phpMyAdmin` is a potential attack vector. Fine for a development server, but anyone using `ssh` may actually have a remote server that shouldn't have any extra holes punched in it.
Answer: There's no way to do it directly through Squirrel, but it's ridiculously easy (when you know how) to set up the ssh tunnel that Squirrel can use.
I'd forgotten how, and came here looking for something to refresh my memory... but I had no luck on StackOverflow, so I did the research and I'm leaving the solution here for future-me... and hopefully it'll help someone else, too.

Create the ssh tunnel:
$ ssh -v -N -L3307:localhost:3306 remotehostname
I chose to use port 3307, since I also have MySQL running locally on port 3306.
Details (or you can just skip to step 2):
3307 is the port you want to use locally to refer to the remote system.
I believe that localhost here is referring to the remote system, from its own point of view, so localhost:3306 references the the standard MySQL port on the remote system.
-v is optional; it just makes ssh's output more verbose, which can help with troubleshooting. You're not going to be using the window running ssh for anything else, so might as well let it be chatty.
-N says you're not interested in actually opening a shell on the remote host. We're here for a database connection only.
If you have the verbose option turned on, you should see a message like this:
debug1: Local connections to LOCALHOST:3307 forwarded to remote address localhost:3306
If you don't have verbose output turned on, you'll only see something like Authenticated to 10.0.1.234 (via proxy).
Set up an "alias" in Squirrel that looks something like this:

Click Test and then Connect to test your connection.
If you ran ssh with the -v option, you can watch the window while you attempt to connect via Squirrel. You should see something like this for a successful connection:
debug1: Connection to port 3307 forwarding to localhost port 3306 requested.
debug1: channel 2: new [direct-tcpip]
debug1: channel 2: free: direct-tcpip: listening port 3307 for localhost port 3306, connect from 127.0.0.1 port 54536 to 127.0.0.1 port 3307, nchannels 3
When you're done with the database, just hit CtrlC in the ssh window to kill the tunnel (if you left off the -N option, I guess you'd have to hit CtrlD to close the shell).
Comment: And by the way, once you have this set up, the JDBC connection string can probably be used with any JDBC client, including IntelliJ IDEA (it has its own ssh tunnelling support, but it won't work with jump hosts).
Answer: Sadly squirrelSQL does not support ssh tunneling. Fortunately, MySQL Workbench does support ssh tunneling so I would recommend using that instead if you are connecting to a MySQL database.
An alternative to using a different tool is to use ssh port forwarding. Essentially you can forward port 3306 (or whatever port your MySQL DB uses) from the remote box to your local box. There are a number of guides on the web on how to do this. Once the tunnel with port forwarding is established you can use a local connection string like 'localhost:3306'. to connect to the remote db. It's good idea to put the ssh connection string in a .sh or .bat file because you'll have to run when you need to connect to the DB for the first time.
Comment: yeah that was what i did, but it is still fastidious and not really user friendly / effective compared to some other tools


Glow shader limited by the texture area

Question: I'm working on a glow shader (for 2D engine Futile relying on Unity). It works OK but the effect is limited by the texture area. Except from adding a lot of empty pixels around the textures (which would result in un-optimized/too big texture atlases), is there a better solution to cope with this problem? I'm quite new with shaders so maybe this is a classic problem with some well known solutions, maybe I'm not searching with the right keywords.
Comment: My understanding of the question is this: How can you make a shader work on the area outside a texture?
Answer: You don't outline directly on the object itself, but do the outline in a post process step.

Draw the scene, as if there was no outline.
Draw the object(s) you want outlined to a new screensized texture.
Apply the outline shader you already use to combine the images.

You may want to change the shader, so it draw the outline to the screen, without drawing the object itself; since you can draw the object in step 1, the outline will show up nicely anyway.
This has the benefit that if the object is obscured the outline will show the entire object. For example when the wizard is behind a tree, the tree will show but the outline shows the entire wizard. This is often used in games where hilighted objects may be hidden depending on the camera orientation.

Glow shader limited by the texture area


How do we measure thermal energy?

Question: My textbook says "The amount of thermal energy is found by measuring the temperature of the substance." However, how is this true? Temperature measures only the average kinetic energy of the particles in an object, not how many particles there are. So, for example, imagine a couple of particles in a jar have a super high velocity; thus, the temperature of inside the jar would be very high, but there would not be too much thermal energy because there are only a few particles. The ocean, on the other hand, has many, many particles, but its temperature is lower. However, the ocean has more thermal energy! If this is the case, then obviously temperature cannot measure thermal energy. Why does my textbook say so?
Comment: Your textbook is sort of wrong if we take the phrase out of context (so it could be right if we read it in context). The amount of thermal energy is measured by heating the substance with a known amount of energy and measuring the temperature change.
Answer: Thermal energy is exactly the average (with respect to the time interval of your measure) of the overall translational kinetic energy of all the particles of your system. This, in turn, can be related to the temperature of your system in case the Hamiltonian is separable into the coordinates of each one of your particles (the equipartition theorem). In particular, the overall thermal energy is proportional to both the number $N$ of particles and their kinetic energies (most of the times it is nothing but the product thereof, after averaging over all the degrees of freedom).
In your example two particles at high velocity may still contribute to the total thermal energy, likewise a system of many more particles where each one of them shares instead very low velocity contributions. You may want to have a look at the wikipedia page which expands what I have stated above in a nutshell.
EDIT
As pointed out below, there may be additional non-translational and potential contributions to also take into account when averaging for the total thermal energy, rather than only the kinetic terms.
Comment: *"Thermal energy is exactly the average ([...]) of the overall translational kinetic energy of all the particles of your system."* Is treating a rather special case as if it defined the general meaning. In general there are non-translational modes and more-over some of the energy in those modes can be potential rather than kinetic.
Comment: @dmckee You're right. I have edited my answer to include your suggestion, thank you!

How do we measure thermal energy?


Why is Spin Less Classical than Position?

Question: It is often repeated that "the spin observable is purely quantum and has no classical counterpart".
What is actually meant by that? I see no principle difference between the set of spin observables and the set of position-momentum observables in that respect (of being purely quantum): both sets have non-commuting observables.
The only interesting difference I see is that spin, having a discrete spectrum, can nonetheless transform continously in time between two orthogonally spin states thanks to the principle of superposition, whereas a classical coordinate (of phase space) must have a continuum of possible values for the value to evolve continously in time (So in this respect spin cannot be classical but position-momentum could ; but I don't think this is the answer since also energy is discrete for bound systems)
Answer: Spin is not less classical than position. It shows up in any relativistic field theory, whether it's quantized or not.

The accepted answer by Adam says

because [spin] can't be larger than a given number of the order of $s\hbar$, where $s$ is typically smaller than two, there is no way you can construct a classical limit out of the spin: it is a purely quantum quantity, always of the order of $\hbar$.

That makes no more sense than saying that energy is a purely quantum property of waves because $E=\hbar ω$, so $E\to 0$ in the $\hbar\to 0$ limit.
The energy of an electromagnetic wave is $n\hbar ω$, not $\hbar ω$. There is no upper limit on the energy; only the spacing of adjacent energy levels is constrained. That constraint disappears classically, so no relation like $E=n\hbar ω$ is needed, but energy still exists.
Likewise, the quantum restriction $|S|\le n\hbar s$ (where $|S|$ is the magnitude of a component of the spin) doesn't impose any maximum on the spin angular momentum of the field, and spin angular momentum survives in the classical limit, just without the quantization.
Spin angular momentum is not completely unconstrained in the classical case, because by substituting $n\hbar=E/ω$ into $|S|\le n\hbar s$ you get $|S|/E \le s/ω$, a constraint that is independent of the particle count and $\hbar$. And that constraint is obeyed by Maxwell's equations. This answer calculates the angular momentum of a plane wave and finds it to be $$S=\frac{1}{\omega}\int \left(|\mathbf{F}_+|^2-|\mathbf{F}_-|^2\right)d^{3}\mathbf{r}$$ where $\mathbf{F}_\pm$ are the right/left chiral parts of the field. The energy is $$E=\int \left(|\mathbf{F}_+|^2+|\mathbf{F}_-|^2\right)d^{3}\mathbf{r}$$ from which you can see that $|S|/E \le 1/ω$, with the extreme being attained when $\mathbf{F}_+$ or $\mathbf{F}_-$ is zero, i.e., when the wave is circularly polarized.
A similar calculation in linearized general relativity will give you $|S|/E \le 2/ω$. GR is a spin-2 classical field theory.
Dirac's equation is a spin-½ classical field equation. It has nothing that would justify calling it quantum: no quantization of particle number, no fermionic statistics, no violation of Bell's inequality. Dirac intended it to replace Schrödinger's equation, but that didn't happen. Instead, the modern home of the Dirac field is in the QFT Lagrangian, alongside the Maxwell field, and quantization is introduced separately through the path integral.
Dirac put a factor of $\hbar$ in the equation to make it look more like Schrödinger's equation, but it has no physical significance. You can eliminate it along with $m$ by substituting $mc^2/\hbar=ω$. You can also eliminate the factor of $i$ (which he probably also added to mimic Schrödinger's equation) by absorbing it into the $γ$ matrices, but there's really no need to do that, since there's nothing wrong with using complex numbers in classical wave mechanics.
There are no fields in nature for which the Dirac field is a useful classical limit, because there is no classical limit of fermionic statistics (as far as I know), but it is a classical field that has the mathematical property of being spin-½.
The Klein-Gordon equation is a spin-0 classical field equation. You can eliminate the factor of $\hbar^2$ by the same substitution. It may have practical uses in condensed-matter physics (I don't know).

People sometimes point to the discrete-valuedness of spin (e.g. the Stern–Gerlach experiment) as evidence that spin is nonclassical, but that argument is nonsensical since orbital angular momentum is also quantized in that way, and is obviously not purely quantum.
Spin is not discrete even in quantum mechanics. An electron's spin can lie anywhere on the Bloch sphere, and all points on the Bloch sphere are equivalent under $SO(3)$ spatial symmetry: there are no distinguished polar points of which other directions are mere superpositions.
What is discrete is quantum measurement. You can't just measure a system, you have to measure with respect to some orthogonal Hilbert-space basis, and if the system has finitely many degrees of freedom then you will get one of the finitely many basis directions as a result.
So the only relevant discreteness of spin is that there are only finitely many spin degrees of freedom (at a point). There's nothing quantum about that. The classical electromagnetic and gravitational fields have finitely many degrees of freedom at a point, but they are in all respects completely continuous fields. The degrees of freedom are just the components in some basis of a continuously varying geometrical quantity.
Answer: It is a problem of definition: what does one mean when one says that something is classical. One could say: is classical something that is not an operator, and therefore an Ising spin is classical, thus spins are as classical as momentum. This is a fine thing in statistical physics, but that is not what people were thinking as classical in the early days of quantum mechanics.
What people usually mean by classical, is that there exists a well defined classical limit. For example, states such that position and momentum are well defined (i.e. $\langle\hat X\hat P\rangle\simeq\langle\hat P\hat X\rangle$). For orbital angular momentum this would correspond to $\langle \hat L\rangle\gg \hbar$, or at least that the precision you have on the measurement of $\langle \hat L\rangle$ cannot differentiate between $0$ and $\hbar$.
And now you see that you have a problem with the spin: because it can't be larger than a given number of the order of $s\hbar$, where $s$ is typically smaller than two, there is no way you can construct a classical limit out of the spin: it is a purely quantum quantity, always of the order of $\hbar$.
Comment: OK, that might be it, although I always thought that what they mean with "no classical counterpart" has something to do with the spinor nature of spin, and not with a classical limit.
Comment: @Lior: I could agree with that: it is important that we think of the classical limit as that of a corpuscul (that is, a classical point like object, which is different from a "quantum particle") and not a wave (as for photon, where the two spin orientation are still classical). This has to do with the peculiarities of the classical limit of fermions (that become corpuscul), where spin does not have a classical counterpart.
Comment: so if *s* were large enough for a certain particle, then it would have a classical counterpart? what would it be and why is the large *s* limit needed?
Comment: @Lior: Even for composite particles (large nucleus for example), $s$ is still quite small (people talk about large spins for $s=9/2$, which is still a very small angular momentum), so I don't think that this is a limit worth considering.
Answer: Spin and angular momentum

The spin observable is purely quantum and has no classical counterpart

What would be a classical counterpart of the spin ? We know that the spin is an angular momentum, a quantity associated to a system that rotates :
$$
\mathbf{\mathcal L} = \mathbf r \times m\mathbf v
$$
where $\mathbf r$ denotes the position of the particle, $\mathbf v$ its velocity and $m$ its mass.
An attempt to find a classical counterpart
I propose this classical definition of spin :

An electron is a small sphere that carries mass and rotates around itself at a certain velocity. This rotation thus creates an angular momentum called spin.

Let's consider one electron of radius $R$ and mass $m_e$. Classical physics and measurements gives us an order of magnitude for the mass of the electron, which is $m_e \approx 10^{-31}\mathrm{kg}$. The order of magnitude for the spin is the Planck's constant $\hbar \approx 10^{-34} \mathrm{J.s}$.
I suppose there is $\alpha$ such as $R \approx 10^{-\alpha} \mathrm{m}$, I don't know $\alpha$ yet, we are going to find it's value. An electron is necessarily smaller than any atom, so we know that $\alpha >10$.
With the definition of angular momentum we can link the order of magnitude of the velocity (at which the electron rotates) with $\alpha$ :
$$
v \approx \frac{\hbar}{R m_e} \approx 10^{\alpha-3}
$$
with $\alpha >10$ we have then $v > 10^7 \mathrm{m/s}$.
Of course $R= 10^{-10} \mathrm m$ is a crazy value for the radius of an electron and any smaller value for $R$ would lead to the associated rotation velocity to be greater than the speed of light $c = 3.10^8 \mathrm{m/s}$. Thus the definition I earlier gave for the spin of an electron is utterly false (you have to accept that the velocity of light is the greatest one, but that's another story).
Conclusion
This is a way to understand that spin doesn't have a classical counterpart. It is impossible to think of spin as the angular momentum of something rotating at a given velocity, since it leads to velocities greater than $c$. Whereas position for example has obvious classical counterparts.
One way to think properly of spin is to see it as an internal degree of freedom of the particle, it is a new quantum number and it is needed to completely define the state of the particle.
Many other things make spin purely quantum. The fact there is only two values for the spin projection is hard to picture in classical physics even if it can transform continuously thanks to the superposition principle. I also think of spin and angular momenta additions. Quantum angular momenta don't add like classical ones.
Comment: I can also say that classically spin is an internal degree of freedom, which means that the argument above is irrelevant.
Comment: I don't see why I can't add a spin degree of freedom and remain classical. instead of using 6 numbers for the state, use 9 (where I added 3 spins). I mean, this will be the suitable classical counterpart of spin. It might be needless and unhelpful (although in Ising models it is used) , but it is not less classical than position, I think.
Comment: @Lior I agree with rob. You can decide to add any internal degree of freedom you want but if it can be expressed with the others DOF then it is not a degree of freedom. Adding it doesn't give additional information about the system and it is thus irrelevant.
Comment: I define a system (a particle) with 9 *independent* degrees of freedom, three of which are spin, and I define a Hamiltonian (or Lagrangian or whatever) to depend on these extra three degrees of freedom. Thus I get a classical particle with spin as an internal degree of freedom.
Comment: a classical electron, maybe? its spin would dictate the trajectory in the elctromagnetic field, for example, which is a better theory than a spinless electron in an electromagnetic field. It's not a perfect theory, of course, as it is classical and not quantum, but that can be said also regarding position and momentum.
Comment: What I am trying to understand is whether there is something "quantum" in the behavior of spin which is not present in position and momentum.
Comment: @Lior One don't need spin in classical physics.
Comment: But in classical physics any particle has at most 3 degree of freedom. I can describe the state of any particle with 6 numbers (3 for position and 3 for momentum), the classical description doesn't need this additional degree of freedom (the spin).
Comment: @Lior What is another example of a classical system with an irreducible internal degree of freedom?
Comment: @Lior Ok, you might define that kind of system for a particle. Now what *real* particle is described by such physics ?
Answer: There is a description of spin in classical mechanics, see the answer here. However as explained in that answer this description cannot arise from motion of particles in real space, constrained or not. If you believe that classical mechanics should deal only with positions and momenta of particles, this classical spin is excluded. However in the quantum theory, even if you believe that the wavefunction in space is a complete description, the linear structure of quantum mechanics and Wigner's theorem mean that you are not allowed to exclude spin. Of course one could imagine a universe where all particles are spin 0. I don't know of a theoretical reason to exclude this, but it's certainly not the universe we live in.
Comment: could you please give a reference to the statement "the linear structure of quantum mechanics [...] mean that you are not allowed to exclude spin"?
Comment: Wigner's theorem says that Lorentz invariance (special relativity) has to be implemented by a linear operator on states. You can enumerate all such implementations (representations of the Lorentz group). Most of them have non-zero spin, and there's nothing that excludes them.
Answer: I think the most important difference is that the components of spin do not commute with each other. This is the key feature that makes spin weirder than position. The components of the position operator, $X$,$Y$,$Z$ commute with each other.
$$\left[X_i,X_j\right]=0$$
This means that the position of a particle can be localized to an arbitrarily small volume. A huge momentum uncertainty comes along with doing so, but it is at least possible in principle.
Different components of spin have a nonzero commutator.
$$\left[S_i,S_j\right]=i\hbar\epsilon_{ijk}S_k$$
This means that it is not possible to specify multiple components of spin at once. This leads to non-classical effects. The Stern-Gerlach experiment is a good demonstration of what makes spin inherently quantum.
Comment: But orbital angular momentum *does* have a classical analogue, and also has non-commuting components.  This was addressed in the question.


PowerPC disassembly with libopcodes

Question: I want to disassemble Wii game executable binaries in C, which use the broadway microprocessor and unfortunately the only disassembler I am aware that I can use is libopcodes.
I am following this respository https://github.com/antonblanchard/qtrace-tools/blob/3a83cc095de6fb6726c7c969ba8bbeaec75b62c9/qtdis/qtdis.c#L221 as a reference, which uses Ubuntu's binutils-multiarch-dev package. However, my calls to disassembler always returns a NULL pointer (even when using exactly the same arguments he uses). I only get a valid disassembler with disassembler(bfd_arch_i386, false, bfd_mach_x86_64, NULL).
Here's a minimum failing example (test.c):
#include <stdio.h>

// including BFD stuff requires this stuff apparently...
// https://stackoverflow.com/questions/11748035/binutils-bfd-h-wants-config-h-now
#define PACKAGE "pkg-name"
#define PACKAGE_VERSION "1.0.0"
#include <dis-asm.h>

int main(int argc, char const *argv[]) {
  disassembler_ftype disasm = disassembler(bfd_arch_powerpc, true, bfd_mach_ppc_750, NULL);

  if (!disasm) {
    printf("wth no disasm\n");
  } else {
    printf("ok disasm\n");
  }

  return 0;
}

Install binutils multiarch sudo apt-get install binutils-multiarch-dev.
Build with gcc -o test test.c -lopcodes-multiarch and run ./test
It seems that my libopcodes does not support any PowerPC architectures I tried. I would try to build from source but binutils' README https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/README;h=42f494800c0b93b1188857bdeaa6ae48843aca24;hb=cd919f5533cc8aa495acd75a6f059e5fcf2e6af9 only mentions flags for supporting specific binary formats, not architectures/machines. Any suggestions?
Answer: I solved my issue. I had to install binutils-multiarch-dev to support bfd_arch_powerpc and bfd_mach_ppc_750. In my case, I also had to remove my custom installation of binutils because the custom build with no flags apparently does not support PowerPC and dis-asm.h from /usr/local/include was taking priority over the one in /usr/include.

PowerPC disassembly with libopcodes


Access DLL PE file by PEB dllbase address

Question: I got the dllbase address from PEB InMemoryOrderModuleListItem list and I am trying to access the PE dos header file of a DLL. I am new to reverse engineering and in the past, I accessed the dos header by converting the handle of the DLL to the PIMAGE_DOS_HEADER and continue from there. How can I get the dos header by the dllbase address?
I tried to convert the DLL base address to the PIMAGE_DOS_HEADER but in the debugger, I get an error of unable to read memory.
Answer: The DLL base address is the address of the IMAGE_DOS_HEADER struct. If you don't find 'MZ' at the DLL base address, you probably have the wrong address.
Comment: I tried ```PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)(inMemoryOrderModuleListItem.DllBase);``` the inMemoryOrderModuleListItem data type is LDR_DATA_TABLE_ENTRY. In the visual studio debugger is saying unable to read memory.
Comment: @fusu this is still the correct answer. The VS debugger could be complaining about this for various reasons. Are you perhaps attempting to parse the loaded PE file? Because `IMAGE_DOS_HEADER` is trivial, the headaches only start once you reach the first item where file vs. section alignment causes a divergence between on-disk and in-memory layout.
Answer: I'm not quite sure what you're asking, but I'll take a stab at it either way. You can use the following apis: CreateFile, CreateFileMapping, and MapViewOfFile to be able to get what you're looking for. Something like this will work for you:
HANDLE hFile = CreateFile(dll, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
HANDLE hFileMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
LPVOID lpFileBase = MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0);
PIMAGE_DOS_HEADER DosHeader = static_cast<PIMAGE_DOS_HEADER>(lpFileBase);

There is no error checking in this code block so make sure to implement it, but lpFileBase will give you the base address of the dll you are looking for and then you can start parsing the DosHeader. Keep in mind you will only be able to read only. Change the flags if you need more than that.
Hope this helps!
Comment: This doesn't even address the question. For a given PE file loaded (or on-disk) the `IMAGE_DOS_HEADER` starts right at the base address. So here this is all about type coercion.