Armature and field mmf axes in synchronous machines

Question: In the book "Electrical Machines and Technology" by J.Hindmarsh, in the chapter about synchronous machines, it stated that for the machine to develop a uniform torque, the armature and field mmf axes should be stationary with respect to each other, my question here is why? Why should they be stationary with respect to each other and what would happen if one was faster than the other?
Answer: All electric motors work by having a rotor magnetic field and a stator magnetic field that are attracted to each other and thus a force is generated in a direction that will move the rotor magnetic field to be aligned with the stator magnetic field. Torque is produced by the vector component of that force that is in the proper direction to turn the rotor. Moving one magnetic field so that it is always ahead of the other causes a constant torque.
Refer to the diagram below. If the magnetic of fields of opposite poles become aligned, the attraction force would work to pull the rotor poles away from the rotor rather than to turn the rotor, so the torque would be zero. If like poles become aligned, the repulsion force would work to drive the rotor pole toward the shaft. If the stator and rotor poles are aligned to the space between each other, the torque component of the force is maximized. In that position, the angle between the poles, delta in the diagram, is 90 degrees. If you go through the mathematics of the vector forces, you will find that torque is proportion to sin delta.
If delta changes, the torque changes. Delta can change, and the torque can change as the motor accelerates the load inertia or if the friction of the load changes. However, during normal, constant-speed, steady-state operation, delta is constant and the torque is constant.
Note that the armature current also proportional to torque and changes when the torque changes. That tends to return delta to the normal steady-position.
Answer: The mean torque would be zero. In affect the rotor may just rotate back and forth but the effective rotation would be zero. If the field were fast as in our consideration(the synchronous speed) I think that there wouldn't even be an oscillation. Plus, there's also the high inertia of the motor, which also has to be taken into account.


self.variable and variable difference

Question: What is the difference between self.myVariable = obj; and myVariable = obj;, when I use @propery/@synthesize to create `myVariable?
Answer: It's important to note that dot-syntax is converted to a simple objc_msgSend call by the compiler: that is to say that underneath it acts exactly like a message send to the accessor for that variable. As such, all three of the following are equivalent:
self.myVariable = obj;

[self setMyVariable:obj];

objc_msgSend(self, @selector(setMyVariable:), obj);

Of course, this means that using dot-syntax actually results in a full message send, meaning calling a new function and all the overhead that is associated with it. In contrast, using simple assignment (myVariable = obj;) incurs none of this overhead, but of course it can only be used within the instance methods of the class in question.
Answer: The @synthesize directive tells the compiler to generate accessors for your member variables, according to the specifications given in the @property directive in your .h file. (I.e., if you specify retain, the setter will retain the variable, and if you specify copy, it will copy it.)
The accessors will (unless you specify otherwise) be named propertyName and setPropertyName.
Using the . notation (note, not the self syntax as stated above) is saying that you want to use the accessors (a good thing if you are setting strings, and want to ensure the retain count is correct, for example).
So, within your class implementation:

self.bill = fred will call the
accessor setBill.
bill = fred will set bill to fred
directly, without going through the
accessor.
Answer: One of the differences I found out when starting Cocoa development is if I set variable to use a @Property/@Synthesize syntax and I didn't use self.myVariable = obj or [self setMyVariable:obj] but instead  myVariable = obj, the object is not retained if obj is released later. (Assuming @Property was set up to use retain.)
The reason is the retain count is not set when using myVariable = obj and when the obj is released the count is now zero. (Unless you retain it yourself)  But by using the accessor it will do the retain count for you. (Again assuming you set it up to use retain when it was declared).
Answer: Shyne
If I can add one important note to this. The answer above are all awesome, so I won't add to the technical side. But just this:
If you create a synthesized property
@synthesize myProp;

Always use the self.myProp pattern to set it.
self.myProp = newVal;

This seems really obvious, but it's important. It's true that there is simply no reason to do this, but until you really understand how the synthesized setters are created you just want to assume you HAVE to use the self. pattern to set the value.
Honest: this will save you a lot of late night debug sessions. Non-retained memory access violations are simply the worst to debug.
Answer: The self syntax uses the accessor method, the other syntax does not. This might be a big difference if the accessor does something more than simply assign the new value. See the Declared Properties part of the Objective-C tutorial.
Answer: The other answers are correct, the difference is that the dot notation causes the ivar to be changed through the accessory rather than directly.
Until you know what you're doing, I recommend you use the dot notation (i.e. self.propertyName = ...). Cocoa/Obj-C does a lot with key-value coding, and while the phone SDK doesn't take full advantage of that (with things like bindings), eventually it will. Getting used to using the accessors now will save you a lot of headaches in the future.
Using the accessor methods also give you the opportunity to override them and provide more functionality should you need to. By simply changing the value of the ivar, you rob yourself of this capability.

self.variable and variable difference


What problems do invasive species cause ?

Question: Why do we value species?  What is so bad about invasive species?  Why value biodiversity?
Comment: [Here](http://biology.stackexchange.com/questions/15477/why-is-homo-sapiens-not-categorized-as-an-invasive-species) is a post that might interest you as well.
Comment: This is far to vague and broad, and all subquestions are large and opinion-based.
Answer: Here is an attempt at a partial answer.

What is so bad about invasive species ?

Invasive species have been introduced to a new habitat by humans (or by natural means).
They usually do not have a predator in a new area nor are the pathogens in the area very adept at infecting them. So, they may proliferate rapidly and compete with the native species. They may also be ferocious predators as their preys do not have defenses against them.
Comment: But isn't this just how evolution and ecosystems work?  Things change.  Some are more virulent and they might monopolize a system for a while.  It's the nature of well, nature, to be in balance - but that balance is always changing and won't always be what it was before humans got there.
Answer: Biodiversity=ecosystem
system= more than one species
Advanced creatures such as us cannot live without other creatures, like plants and bacteria to support us. (yet)
If you want to see what invasive species can do watch this video, http://www.youtube.com/watch?v=Bk-9ndL3ykM it has some descriptions on what the invasive species homo sapiens and their domesticated cows do to their planet earth. Wasting resources basically. Displacing other animals and plants, monopolizing the earth. Monopoly or monoculture is not good. For if the monoculture fails all is lost. If you have diversity if one harvest goes bad it's not over yet. It's basically all about stability and sustainability. Without either advanced lifeforms cannot exist.
Comment: What do you mean by "non-natural"?  Human introduced?  Why does this make them bad?  Is this because we are responsible for the affects of our actions?  I've just never heard a teacher/proff/textbook set this logic out satisfactorily.  It seems like invasive species are, when it comes down to it, defined by what species cause economic damage - because there is no objective sense of bad.  So humans move fast... So??? What's so bad about upsetting the balance that was there before industrial- agricultural humans arrived?
Comment: It's not bad. Just inconvenient. That's all. If inconvenient = bad is up to you. ;) Balance = safe. No balance = unsafe. If unsafe is bad is again up to you.
Answer: I don't know much about the field of conservation but I'm giving a try...
In the following, when I say conservation I mean: "Human decisions and actions in order to protect the ecosystems". It has not to be confused with the science of conservation biology.
I think that the question you're raising shows the paradox of conservation. The maintenance of Biodiversity occurs through a dynamic process of speciations and extinctions allowed thanks to mutations, selection, population structure and movements. Standard ideas of conservation is not to preserve these processes but to prevent extinctions.
Quite a lot of many in conservation is aimed to save some big and representative species. Species for which we, as humans, feel some tenderness, love and pity for their fate. I am not saying it is bad to protect this kind of species I just want to emphasize that if we conserve it is not only for economic issues (or for the survival of our species) but also because we have ethics,  because we feel compassion  and guiltiness with nature of with some species such as the panda, the deers, the lynx, the wolves or because we feel compassion.
I also think that our categorization of living things into species (which is quite an subjective categorization) might bring us to take some decisions that do not fit economic issues.
For those who speak french well enough, here is a serie of podcasts (follow: "La biodiversité - plus qu'une simple question de conservation/") that might interest you. Especially the one given by Pierre-Henry Gouyon, which pretty much explain (much better than I did) most of the ideas of the last two paragraphs.
The question of invasive species is particularly interesting I think because there are especially a lot of invasive species today, first because ecosystems of changing (mostly because of human's activities) but also because human means of transport allow species to travel very far and become invasive. I assume (although I have no reference!) that the current number of invasive species is particularly high and just like any other disturbance in ecosystem, we can hardly predict what will the consequences. So shouldn't we make sure to keep this number of invasive species to a level which is closer to what would be found in nature in absence of human?
Comment: I'm learning french so I will definitely attempt to listen to those, merci :)  I appreciate your attempt to answer these questions, especially because this answer seems - to me - more aware of the assumptions and contradictions inherent in the arbitrary definitions such as species, or invasive, and the need to pair words such as "Biodiversity" with the utility we plan for them.  Thanks!


Does adding twist to wing always decrease induced drag and what are its effect on parasite drag?

Question: I am doing an assignment and one question was the effect of twist on drag. The first two options are increased induced drag and decreased induced drag respectively. The third option is increased parasite drag. I am confused b/w option 2 and 3.
Comment: I think what is missing from the question is the frame of reference for what part is fixed, and what part is twisted.  In other words, given an untwisted wing at a given AoA, twisting either the root up or the tip down will have opposite effects.  (*You might get brownie points for understanding from your professor if you ask for this clarification*)
Answer: If you do a bad job twisting a wing, you can certainly make induced drag worse.
Twisting a wing should not have a significant effect on parasite drag.  If you have a very detailed parasite drag model, you might be able to calculate some difference, but to first order, no change.
Twist is also useful for manipulating the stall distribution -- inboard or outboard.  This is essential for handling qualities.
It also shifts the load distribution which can have a significant structural effect.


Cleaning up essential oil from wood

Question: A badly closed bottle of essential oil spilled out on my wooden wine shelf and soaked through, dissolving the paint from anything it touched. No amount of washing with dish washing liquid helps. It's still there all sticky and smelling very intensely. I would like to repaint the shelf, but I'm worried the paint won't stick to the wood unless I somehow clean up the spill. What can I use to remove it?
click to embiggen
Comment: Scraping and sanding down to clean wood probably to remove oil.  Adding more chemicals to remove oil probably won't work well.
Answer:
Blot with alcohol on a clean rag (repeatedly) to draw as much as possible out of the wood.

Wash with trisodium phosphate. (commonly sold in paint stores for painting prep, since it's gone out of more general use due to water pollution issues with excess phosphates in wastewater streams.)

Prime with a shellac-based primer to contain bleed-through.
Comment: Would you recommend sanding before blotting to strip the paint first? When I tried blotting with alcohol soaked rags it was mostly paint coming off and a bit of essential oil. And would sanding + some other compound work as well as trisodium phosphate for cleaning? It's a bit hard getting a hold of trisodium phosphate, but if nothing is as good I'll try to get my hands on some. Thanks!
Comment: You can certainly try other things. Washing soda or baking soda (sodium carbonate or sodium bicarbonate) are possible options, mixed with a little water to make a paste. Not sure that removing paint that has not already been removed by the oil is going to help much, but you can if you like, of course.

Cleaning up essential oil from wood


Have the current polar ice caps receded further than those that existed before the beginning of the last Ice Age?

Question: Has science been able to determine from the geologic record how our current ice caps compare to those that existed before before the beginning of the last Ice Age? If so, how do they match up? (I tried to ask this on Physics.SE, but it was suggested it was more of a history question)
Comment: This is a geology question, not history. History is not simply "things that occurred in the past"; it is a discipline, and one whose methodologies cannot answer this question.
Comment: No, Earth's history is not history, nor is it archaeology. It is paleontology, and this already loosey-goosey site doesn't need any more expansions of scope.
Comment: Perhaps "Are there historical records to establish the size/extent of the polar icecaps?
Comment: Would be good if you shared with us when this last ice age began and ended and a little bit about the extent of the glaciers at the time your talking about.
Comment: So. You're saying Earth's history isn't history? Archaeologists will be crushed.
Comment: We're actually still in an ice age; just a nice interglacial part of one, but still an ice age nonetheless.
Comment: @mh01 no, we're in an interglacial, which is a period between two ice ages by definition :) On a geological timescale, we're near the end of one, which historically means unpredictable and rapid swings in climate conditions.
Answer: Perhaps this is what you are looking for. In particular, look at the bottom graph in red, which is an estimate of global ice volume. The data was taken from oxygen measurements in Antarctic ice cores.

Assuming they have their data and estimates close to right, it looks like our current worldwide volume of ice is not a record low for the Pleistocene. However, its pretty close to it. The end of the Oxygen (green) graph looks a bit wierd too. Still, there's nothing on the end of that ice graph that draws the eye to say, "something different is going on here".
Yet.
Comment: It might be worth noting that with the x-axis scale in tens of thousands of years, the last few decades don't really show up on this graph. I don't know what the motivation is behind this question, but if it's specifically about man-made global warming, and not about natural cycles, then this graph doesn't really provide the relevant level of detail.
Comment: Yet? There IS nothing weird going on, we're just in an interglacial (and nearing the end of it), which means climate patterns are inherently unstable and prone to large variations over relatively short time periods (decades).
Comment: @mcv it shows enough detail to see that on a geological timescale we're right where you'd expect us to be, and a few degrees higher or lower temperatures over a scale of centuries are well within normal margins (and the AGW movement predicts just that, a few degrees over a timescale of centuries).
Comment: Eureeka! That is exactly what I was hoping to learn. :)
Comment: @jwenting - Its quite possible you are right. Even if you aren't, I've heard it argued that HCGW is putting off the onset of the next Glacial cycle (IOW: A Good Thing). The truth is we really don't know yet. (There's that word again).
Answer: WHICH icecaps? If you mean glaciers, WHICH glaciers? Some no doubt extend further, some less far, some didn't exist before the last ice age, for example.
As to the polar icecaps, the northern one sits entirely on top of water, if floats, so there's no way to know if it was larger or smaller in the past beyond where we have photographic record
The southern one covers pretty much the entire Antarctic continent, so has the same issue. If it were larger in the past, it would have been over open water and no historical record is left. If it were smaller, the evidence is hidden under miles of ice and rather hard to reach.
Most likely it will be the same with the polar caps as it is with the glaciers: in some places they extend further, in others they extend less, than in the past. But no worry, with the predicted global cooling (announced last week by the British Met Office through the BBC) it'll sopon get a lot larger :) (of course that was in part sarcasm (they did indeed announce "global cooling", just as they did in the 1970s, right before they announced "global warming" and no are making an about face once again), I believe in global cooling as much as I do in global warming, such things are cyclical and nothing we can influence anyway so why worry about them?).

And no, it's not a history question so much as a geology one. Doesn't belong under physics indeed, but afaik there's no geology SE you could ask.
Comment: How would anyone think CO2 would cause cooling? The greenhouse effect has been understood for ages. It matters little now; the warming is evident, and any cooling effects at best slow down the warming a bit.
Comment: All those different feedback mechanisms is what makes this so hard to predict accurately. Yes, it is definitely possible that changes in climate could cause a new ice age, but that's largely speculation. Meanwhile, we do know that CO2 causes warming, which causes climate change. The fact that it's hard to predict where climate is eventually going to end up, only emphasizes that we'd better reduce our unintentional impact on it.
Comment: Zero scientific credibility? Are you kidding me? IPCC reports on very real scientific research. Even really stubborn global warming deniers who set out to prove that the IPCC reports were crap, ended up confirming that the scientific aspects were sound (though they tried to spin it differently by focusing on the political aspects). So far, the only people I've seen who deny the IPCC's credibility are people who lack any such credibility themselves. They ignore the science and listen just to the oil-funded propaganda.
Comment: To match their agenda? Their agenda is to report on the existing science of the field. Yes, there have been some minor mistakes in the report (and it'd be odd if their hadn't, for a report that size), but nothing that even remotely undermines the conclusions. The science itself is sound. The only people denying that are oil industry shills and the people who rather believe them than science.
Comment: I thought global cooling was something from the last 15 years. 15 years ago, global-warming skeptics predicted that the temperature rise of the 80s and 90s would be undone by a cooling cycle in the 2000s. Didn't happen of course; seems like the cooling effect of that cycle and the warming effect of the greenhouse effect cancelled each other out. So once the current cooling cycle is over, we'll probably see another rapid warming period.
Comment: @mcv yes and no. There has been cooling for the last 17 years now. But that's not the first time there has been a cooling trend. And in the 1970s, while there was a warming trend, people like Jim Hansen were predicting that by the early 1980s the world would be plunged into a new ice age "because of CO2 emissions causing global cooling". The same people now preaching "global warming" because of those very same CO2 emissions.
Comment: @mcv the idea was that the warming that had been going on would drive cloud generation which would cause more sunlight to be reflected into space which would cause cooling at a rate higher than the warming the CO2 generated which would cause the icecaps to grow which would cause more sunlight to be reflected. Effectively the same positive feedback nonsense they're now predicting to happen, but now they're claiming that it's going to have the reverse effect, more clouds causing more warming causing less clouds causing even more warming.
Comment: @mcv no, we don't know that either... And we know even less about whether the amount we contribute has any effect above and beyond natural variation. All the hot air (and there's a lot of it) coming out of the IPCC and other political pressure groups is just that, hot air. It has zero scientific credibility. Any report (and the IPCC report is full of it) that says you must "believe" them is just religious mumbo jumbo.
Comment: @mcv they don't have any valid review process in place, and blatantly corrupt what they get in to match their agenda. There's volumes of data about that.


Export ArcGis Time Visualization

Question: How come when I try and export my time series in ArcMap it compresses the video to 3 seconds? My time change visualization is at least 10. What can I do to make my exported video longer?
Answer: I have found exporting video either from Time or Animation to be rather buggy; I routinely get different results with the same inputs, if I get results at all.  Depending on the export and codec options you choose, as well as the player used, you may also get varied results on playback time.  More information about exactly what settings you are using could be helpful - particularly which version of ArcMap you're using.
However, I also recall running into the exact same problem you describe.  It's been a while, but I believe the solution was on the Time Slider bar go into Options and the Playback tab.  There, change from using the playback speed bar to a specified playback duration in seconds.  Any exported video should run the specified length.
Alternatively, if playback works as you want it within Arc, you could investigate a screen capture/recording utility and use that to record Arc doing the playback rather than relying on an export.

Export ArcGis Time Visualization


How do I send a "test message" with a Garmin InReach Mini 2?

Question: I have successfully done a device test on my Garmin InReach Mini 2, but my plan on Garmin Explore states I have sent 0 out of 5 test messages in my plan.  How do I send one of those?  I couldn't find this information in the manual.

Screenshot of Garmin Explore website.  Source: Garmin.
Answer: You can read how to test all their devices on their website.
For your Mini 2 specifically:

Power on the inReach.
Press OK.
Select Service Plan.
Select Test Service.
Press OK.
Press OK again to begin the test.

Wait while the device sends a test message. When you receive a confirmation message, your device is ready to use.

It is also on page 6 of the manual you linked under "Testing the Device"
After sending a test message and receiving an automated response you should see it show up on the monthly usage.
Comment: My answer is exactly what you asked for. This is sending a test message (It even says test message in the quoted text). When I send one on my InReach it counts as one of my 5. Perhaps your billing cycle just rolled over between you sending the test and you checking usage? Or maybe your test message didn't fully send. Did you get the automated response? There might also be a 2nd problem you are also facing, but this is definitely how to send a test message.
Comment: I have explicitly stated in the question (first line) that this is **not** what I'm looking for.  I've already done a device test, but in my plan I still have used 0 out of 5 **test messages**.


Related to the architecture, new layer on top of Substrate

Question: In the context of Substrate, is it feasible to introduce a layer on top, such as Kafka, to improve request processing times? Could this architecture enable Substrate to be utilized solely for blockchain verification purposes, with the supplementary layer facilitating accelerated request handling by only requesting substrate when changes occur?
Comment: @dadzerlaze thank you for your answer, but can you give me some example, is it possible to send event outside substrate node and catch it for a microservices ?
how do you proceed for a custom gossip ? any help at this well be more than welcome
Comment: can you please elaborate more on requesting substrate when changes occur
Comment: for an example when an update is occur on a specific entry, these is a question related to an academic research, i introduce substrate to build a specific blockchain, but i'm asking if i can add a new layer on top of substrate
Comment: i dont think there is any barrier towards optimising substrate by building layers on top of it, we are runing a custom gossip network on top of it and substrate basically act as backend for all our services
Answer: Yes you can introduce a new layer or component into Substrate. You need to think at what level you want to do this i.e. on the runtime level, client level, off-chain level. I recommend you start by reading all of these.

Could this architecture enable Substrate to be utilized solely for blockchain verification purposes, with the supplementary layer facilitating accelerated request handling by only requesting substrate when changes occur?

If you can build a nice solution around this, the community would be grateful.
Comment: i'm doing a Phd on Blockchain, really i want to build something nice, but sometimes i dont know were to start, maybe need some help
Comment: @Isroudi you can always ask another question when it's related to substrate here :)
Answer: I suggest you do all the tutorials in substrate docs to understand more what you can do, it wont take long to finish all of them (around 3 days, which is worth it), after you finish the tutorials you will understand that substrate just a bunch of tools and libraries that you can combine however you want to build whatever you want, the only limitation is your imagination (and maybe your project requirements).
Let me give you an example to answer your question in your comment,currently we are working on a project(basically to do exactly what you are describing, scaling request processing) to validate a stream of events so most of our work was basically done offchain, we are runing a grpc server on each validator and gossiping some events using libp2p gossipsub and submitting transactions finally to substrate to be included in a block and listening for finalized blocks and returning responses to clients, all of this is done mostly in outer-node.
You can think of substrate as a state machine, and you can do whatever you want with state machines :)
Comment: thank you a lot


What is the difference between WM_QUIT, WM_CLOSE, and WM_DESTROY in a windows program?

Question: I was wondering what the difference between the WM_QUIT, WM_CLOSE, and WM_DESTROY messages in a windows program, essentially: when are they sent, and do they have any automatic effects besides what's defined by the program?
Comment: very good quest
Answer: They are totally different.
WM_CLOSE is sent to the window when it is being closed - when its "X" button is clicked, or "Close" is chosen from the window's menu, or Alt-F4 is pressed while the window has focus, etc. If you catch this message, this is your decision how to treat it - ignore it, or really close the window. By default, WM_CLOSE passed to DefWindowProc() causes the window to be destroyed.
WM_DESTROY is sent to the window when it starts to be destroyed. In this stage, in opposition to WM_CLOSE, you cannot stop the process, you can only make any necessary cleanup. When you catch WM_DESTROY, none of its child windows have been destroyed yet.
WM_NCDESTROY is sent to the window when it is finishing being destroyed. All of its child windows have been destroyed by this time.
WM_QUIT is not related to any window (the hwnd got from GetMessage() is NULL, and no window procedure is called). This message indicates that the message loop should be stopped and the application should exit. When GetMessage() reads WM_QUIT, it returns 0 to indicate that. Take a look at a typical message loop snippet - the loop is continued while GetMessage() returns non-zero.
WM_QUIT can be sent by the PostQuitMessage() function. This function is usually called when the main window receives WM_DESTROY (see a typical window procedure snippet).
Comment: @ad88 would be great to add what happens when User Logout / `WM_ENDSESSION` arrives. Does this automatically trigger WM_CLOSE / QUIT / DESTROY ?
Comment: When a session ends, any remaining windows that still exist are simply destroyed by the OS, there are no `WM_CLOSE`/`WM_DESTROY` messages sent to them. They have their last chance to cleanup by handling `WM_(QUERY)ENDSESSION`. After all, all bets are off. See [Windows doesn't close windows when a user logs off; that's your call](https://devblogs.microsoft.com/oldnewthing/20080421-00/?p=22663)
Answer: First of all, the WM_CLOSE and WM_DESTROY messages are associated with particular windows whereas the WM_QUIT message is applicable to the whole application (well thread) and the message is never received through a window procedure (WndProc routine), but only through the GetMessage or PeekMessage functions.
In your WndProc routine the DefWindowProc function takes care of the default behavoir of these messages. The WM_CLOSE messages requests that the application should close and the default behavoir for this is to call the DestroyWindow function. Its when this DestroyWindow function is called that the WM_DESTROY message is sent. Notice that the WM_CLOSE is only a message requesting that you close (like WM_QUIT) - you don't actually have to exit/quit. But the WM_DESTROY message tells you that your window IS being closed and destroyed so you must cleanup any resources, handles etc.
Comment: Not to the whole application, but to a particular message loop. Each thread may have its own message loop, so an application can have several message loops.
Answer: Just so it doesn't get lost in the comments... don't forget about WM_CANCEL. When you click the close (x) button on an MFC dialog, it will certainly send WM_CLOSE. The default OnClose() function will then call the default (base class) OnCancel() function.
However, if you simply type the ESC key, this will lead to the closure of the dialog, but (as far as I can tell) without generating the WM_CLOSE event - it goes directly to the WM_CANCEL/OnCancel() mechanism.
I hereby invite the community to elaborate on this... or edit that elaboration into the accepted answer.
Answer: I know this is old, but just trying to provide a clearer answer for anyone.
// What causes each message?
WM_CLOSE:       // Pressed Close Button (X) / Alt+F4 / "Close" in context menu
WM_DESTROY:     // Called DestroyWindow(hwnd)
WM_QUIT:        // Called PostQuitMessage(exit)

// What do they do by default?
case WM_CLOSE: DestroyWindow(hwnd); return 0; // pressed close? destroy window.
case WM_DESTROY: PostQuitMessage(0); return 0; // destroyed window? quit message loop.
// WM_QUIT isn't associated with a window, so isn't sent to the window procedure

So WM_CLOSE is just so we can request to destroy the window. However you might want it to show a popup in your game asking if you're sure. (and if you want to save first)
And WM_DESTROY doesn't actually post the quit message by default, since you could have multiple windows. That's just the usual event we quit after. You could have WM_CLOSE call PostQuitMessage(exit) and destroy your window(s) after the message loop if you wanted.
If you wanted a custom close button in your game, it should do what WM_CLOSE does.
Also there is the function CloseWindow(hwnd), however it simply minimizes the window.
Hope this helps anyone.
Answer: At first let's discuss WM_QUIT - the difference from another messages that  this is not associated with window. It is used by application. For example this can be handled by non-visible standalone OLE server (.exe, but not in-proc as .dll)
WM_CLOSE - per msdn: "An application can prompt the user for confirmation, prior to destroying a window" - it is used as notification about intention to close (you can reject this intention).
WM_DESTROY - is a fact that window is closing and all resources must(!) be deallocated.
Comment: @atzz yes, you are right. Talking in general this message notifies event loop to stop handling at all, regardless application-wide or standalone thread.


What are good candidates for creating indexes on beside pk and unique columns?

Question: I'm always asking myself should I create an index or not in my Oracle tables, what criteria in a table makes the index worth creating? And is it also a criteria in the query? And are there (with respect to Oracle) different kinds of indexes you can create based on some factor(s)?
Answer: It's all about what queries are going to run against the table, how fast they're going to be, how fast you need them to be and how often they're going to be run.  If you need to be able to find records quickly based on it, index it.
Comment: +1: Don't create random indexes -- indexes have a significant cost.  Create indexes based on actual use cases.
Comment: My numbers said that missing a needed single-column index has the same cost as creating a single-column index on every non-bit column.
Answer: Your queries.
You must look or better yet profile your client app code to see what fields are being used most often and /or have performance issues. If your app is not yet built, think about how the data is going to be used. For instance; If it is a table that will be used heavily for reports, and you have a datetime field, you most likely need an index (compound or not) on that field.
Answer: Oracle automatically creates a unique index on a column (or set of columns) when a UNIQUE constraint is created.  The index is used in the enforcement of the constraint.
Oracle also automatically creates a unique index on a column (or set of columns) when a PRIMARY KEY constraint is created.  This index is used to enforce the constraint as well.  There is little, but some, difference between a PRIMARY KEY constraint and a UNIQUE constraint.
Also, when a column (or set of columns) is frequently used to join a pair of tables, there should be a foreign key relationship specified.  For this to be done, the referenced column(s) must be the the primary key on the referenced table, which in turn means there will be a unique (primary key) index on that referenced table.
Further, when a particular column (or set of columns) is frequently used in WHERE clauses, it makes sense to create an index, unique or otherwise.  Columns with particularly low cardinality (low number of unique values relative to total row count), BITMAP indexes may be advantageous.  Pros and cons of BITMAP indexes could be a long discussion.
The order of the columns in multi-column indexes should be considered carefully.  First, a multi-column index does not work at all like individual single-column indexes on the same columns, but Oracle rarely (if at all, especially without any hints) uses more than one index on a single query (BITMAP indexes are a possible exception).  If you typically have columns A, B, and C in your WHERE clause, you may want an index on A, B, and C.  However, if you also often use A and C in a WHERE clause, without B, then you would probably want to order the columns in your index as A, C, B.  Such an index can also be used when only A is in your WHERE clause.  Put simply, Oracle can use a subset of the columns in an index only by using a prefix of the index, not a random assortment of the columns in the index.
It's also important to note that the more indexes you have on a table, the slower the writes to that table will be.  Just consider all the work Oracle has to do to update the table and all of the indexes associated with it.  BITMAP indexes can be even more of an impact.
As a final note, EXPLAIN PLAN is your friend.  If you find commonly-run queries doing full table scans on large tables, an index may be in order.
Answer: A rule of thumb is to create indexes on foreign keys (PKs often have indexes created automatically), fields involved in joins, where clauses or ordering.  Indexes havea a cost to inserts, so don't create them willy-nilly on everything. Chose the stuff used most frequently and the queries that have the longest running times to see where you might need to index. Check you query execution plans (different databases call this something differnt but all havea way to see how the query is going to use indexes)to see if the indexes are being used once you create them. An index that nothing is using is just adding to insert and delte time with no correcponding imporvement in select time.
Answer: Totally depends on what queries you run against the table.
Likely candidates include:

Fields involved in a join
Fields that are part of a WHERE clause
Fields part of an ORDER BY

Please don't take this to mean you should create a whole bunch of indexes on a table, each on a single field. I see this a lot, and its almost always the wrong answer. A few additional considerations:

Consider compound indexes, or especially covering indexes.
Consider the selectivity of a field when deciding if it should be indexed at all, or what order to place it inside an index.
Answer: Some good ideas here. Pay particular attention to queries with performance issues, and try to create indexes with high selectivity.
As an aside, it's not a bad idea to monitor your index usage:
ALTER INDEX <index> MONITORING USAGE;

Periodically you can check the value of v$object_usage.used to see if the index has ever been accessed since you turned on monitoring:
SELECT i.table_name, i.index_name, i.tablespace_name, bytes/1000000 mb, u.used
  FROM dba_indexes i JOIN dba_segments ON (i.index_name = segment_name)
          LEFT OUTER JOIN v$object_usage u ON (i.index_name = u.index_name)
 WHERE i.owner = <schema>
   AND NVL(USED,'NO') = 'NO'
   AND i.table_name =

 ORDER BY bytes DESC;

I've been able to prune several indexes with the information this provides.


Can I safely delete .download files to reclaim space?

Question: My message says my disk is full on my MacBook Air.  One of the largest files is 1.3 GB file from last operating system download. Can I safely delete this file?
macOSUpd10.15.1.dmg.download
Answer: The fact that it still has the .download extension means it was never completely downloaded, so yes, it's safe to delete.
Answer: If that file still has the .download extension, either it is still downloading or ran out of space while downloading.
You could open Finder and click on the Size column to sort. If the folders don't show numbers, click Show View Options under Finder's View menu and check "Calculate all sizes". This may take a bit of time, so be patient if you don't see numbers appear right away. I've noticed in some folders the option was unchecked even though I checked it earlier. Command-J gets you to the option quicker.
If space is being used in hidden files or directories, you can view those with Finder's Shift-Command-period shortcut. It's a toggle.
Folders to check would be your Desktop, Downloads and tmp. If you download lots of Music or Videos you could check those folders as well.
Move what you want to the Trash, and then Empty the trash, otherwise you haven't saved space yet.


Initialize video.js after page/content loaded via ajax

Question: I'm currently in the process of setting up infinite scroll on one of my wordpress sites which loads the next set of posts via ajax once you've scrolled to the bottom of the page. Because of this, I have been unable to get videojs working properly (readas: at all); so am hoping someone can help me with this.
First and foremost, I'm using videojs code directly in my theme, which pulls data from a posts custom fields, and adds the post id to the video tags id attribute. Here's a sample of the template code:
<video id="video_<?php echo get_the_id(); ?>" class="video-js vjs-default-skin"
  controls preload="auto" width="640" height="264"
  poster="<?php echo $poster; ?>">
 <source src="<?php echo $mp4vid; ?>" type='video/mp4' />
</video>

(To note, I'll add ogg/webm later)
I've seen the docs page that says to add the following block:
_V_("example_video_1", {}, function(){
  // Player (this) is initialized and ready.
});

but no matter where I add it (with the necessary attributes added), the player does not work. I mean, with the above I get standard html5 video player, but has none of the benefits of videojs.
Anyone have a working solution for something like this?
Answer: referencing the correct ID might do the trick...

<video id="video_<?php echo get_the_id(); ?>" class="video-js vjs-default-skin"
  controls preload="auto" width="640" height="264"
  poster="<?php echo $poster; ?>">
 <source src="<?php echo $mp4vid; ?>" type='video/mp4' />
</video>


Kernels that run fast on Multicores but relatively slow on GPU

Question: Can someone suggest list of algorithms in which Multicores give superior performance compared to GPUs? I know that hybrid approach will still be faster, but what I am really looking for is to understand areas in which GPU still lag behind multicores.
Answer: In order of suitability from least suitable to most suitable:

GPUs can only accelerate SIMD type workloads, so they are no good for task-parallel operations (like make -jN).
GPUs don't have much cache and their atomic ops are relatively slow compared to CPUs; so they are nowhere near as good as CPUs with pointer-based structures such as trees.
Workloads such as image processing or computer vision are in a gray area where the GPU advantages (texture mapping hardware, more cores) may be offset by the CPU advantages (better SIMD integer support, much higher clock rate).  If the actual processing is done in floating point, it's probably a wash or slight advantage to the GPU; if the processing is done in integer and can be mapped onto SSE2 instructions, the CPU will crush the GPU.

GPUs excel at data-parallel workloads that use a lot of single-precision floating-point.
Any workload getting offloaded to the GPU also incurs data transfer costs.
Comment: Yes, I know pointer chasing algorithms have problem of spatial locality and that GPUs have smaller caches. But GPU's can hide long memory latencies through hardware multi-threading. In terms of floating point performance GPU's are superior and integer based computations are superior on Multi-cores. Can we then say that pointer chasing algorithms based on integer computations have higher chances of running slow on GPUs than Multicores ?
Comment: I wouldn't even group them - I would say that GPUs are worse at computations that rely on narrow integer support (e.g. median computations, which are just scads of element-wise min/max calculations on corresponding integers), and also are worse at pointer-chasing.

They also are well-nigh incapable of general-purpose, task-parallel computing (like parallel make).  The segregated cores of the CPU are well-suited to tasks where the different cores are doing totally different things that happen to be parallelizable.
Answer: Some guys at Intel did some research, where they compared scientific computations on modern multi-core CPUs and GPUs. Maybe you find that interesting. Figure 1 on page 5 shows the results.
Lee et al, "Debunking the 100X GPU vs. CPU Myth: An Evaluation of Throughput Computing on CPU and GPU":
http://www.hwsw.hu/kepek/hirek/2010/06/p451-lee.pdf


remove " " after

Question: On every content page of my drupal site, there is always a line with empty quotes " " after

.
This happens only with the content page and not in any view page.
Can someone guide me how to delete this empty quotes?
Answer: Have you checked this is present in the output HTML, and not added by the browser or some JS library? A suitable way to test would be to retrieve the content page using curl or wget -
curl http://example.org/node/123 | grep 'div class="content'

If the empty quotes are not present in the original HTML (as displayed by the above command), then you should check if the quotes are present in all browsers, or only one browser. It may relate to a JS library you're including, or to a browser plugin, or even just to your browser's means of displaying your sourcecode.
If the empty quotes are present in the output from this command, then you can look towards some theme or module on your site. You could do this by switching themes first (to see if it's the current theme), then by disabling modules in turn (to see which specific module is causing it).

This is really just general debugging advice - you may need either to give more detail (eg the URL of your site), or investigate debugging techniques to trace the issue.
Comment: Thanks
The code didn't return me any html, so I'll try finding out if any module or js is causing this problem
Comment: You need to swap in a URL of your own in the above command. I've modified it to match 'div class="content clearfix some-other-class"' above, also. If possible, providing the URL of your affected site would probably help someone spot the issue.

remove " " after


Kali installation on vm´s

Question: the question is directed more towards the installation options in virtual machines, I would like to know if I can install kali but inside the virtual machine, that is, download it already within the virtual machine created with a Linux operating system, do everything from there... I would also like to know if when downloading kali either through the option of wsl, uSB, hyper v even directly on my computer my security could be more vulnerable....?????
Comment: The thing is: If you're asking this question then Kali definitely ISN'T for you something the answer below subtly suggests.
Answer: Kali is usually run as a Virtual Machine or from a pendrive for security and convenience. Ready-made VMs are available for VMWare and VirtuaBox on Windows environment, and KVM/QEMU on Linux. Kali has extensive documentation which explains all the installation options, and otherwise how to run it without problems. Worth reading, as Kali's very different from your average desktop distro.

Kali installation on vm´s


How can I create the input of raw transaction through the previous UTXO hash and the unspent index in bitcoinj?

Question: I want to create a raw transaction's input and output, and sign it then broadcast to testnet. Now I know how to create the output, but I want to refer the transaction that I can input the UTXO hash and the unspent index, then add the input to this raw transaction.
Answer: here's how to create an unsigned raw transaction in typescript with one input and one output.
<code>import * as bitcoin from 'bitcoinjs-lib'

const reverseHexBytes = (hex: string) => {
  const buff = Buffer.from(hex, 'hex')
  return buff.reverse().toString('hex')
}

const fixedPoint = (num: number): number => {
  return parseFloat(num.toFixed(8))
}

const outputAmount = 100
const inputTxHash = 'tx-hash-goes-here'
const index = 5
const fee = 0.001
const numOutputs = 1
const outputAddress = 'address-to-send-to-goes-here'

// input
const txInputs = '01'
const txHash = reverseHexBytes(inputTxHash)
const outputIndex = '0' + txIndex.toString() + '000000'
const script = ''
const sequence = 'ffffffff'
let tx = txVersion + txInputs + txHash + outputIndex + script + sequence
// output
const countHex = numOutputs.toString(16)
const countByte = (countHex.length === 1) ? '0' + countHex : countHex
tx += countByte
const amount = fixedPoint(outputAmount - fee)
const outputAmount = Math.floor(amount * (10**8))
let outputAmountHex = outputAmount.toString(16)
while (outputAmountHex.length < 16) {
  outputAmountHex = '0' + outputAmountHex
}
const outputAmountBytes = reverseHexBytes(outputAmountHex)
tx += outputAmountBytes
const pubkey = bitcoin.address.fromBase58Check(outputAddress).hash.toString('hex')
tx += '1976a914' + pubkey + '88ac'
// lock time
tx += '00000000'
</code>
check out the protocol documentation for more specific information: https://en.bitcoin.it/wiki/Protocol_documentation#tx
note: i copied and edited from something i've implemented previously, so if there's a mistake just let me know and i'll update it.
Comment: @j4ys0n Java and Javascript are completely different programming language, you can't just "switch" parts the code
Comment: Thank u very much for this answer,but I would like to implement it in bitcoinj instead of bitcoinjs.
Comment: there's only one line that uses bitcoinjs, everything else is vanilla code. you should be able to switch that out fairly easily, or look up how to decode a base58 encoded address to hex. the transaction composition part will be the same.
Comment: @IgorArtamonov i realize that, which is why i clarified the language used. i assumed outlining the steps according to the bitcoin protocol documentation would be at least somewhat helpful.
Comment: I mean it's really different languages, so it only adds more confusion. With this example, to translate it you'd need to know TypeScript, JavaScript, bitcoinjs-lib and and how the latter use can be translated to BitcoinJ calls (which has almost no intersection in class names and methods). I would suggest to rewrite it to English, it will be easier to understand and apply to Java + BitcoinJ

How can I create the input of raw transaction through the previous UTXO hash and the unspent index in bitcoinj？


MacBook Pro (Retina, 13-inch) El Capitan

Question: I have a Macbook Pro Retina 13 inch.
I have recently lost my notifications in the notification centre. The "
today" tab functions but my "notifications" bar has nothing. The banners from notifications pop up but they are not saved in the "notifications" tab. I have attempted killing and restarting the notifications centre through Terminal but to no avail. Please help! TIA
Answer: Check in your System settings >> Notifications on the left side on the Panel if Do to disturbed is in any way activated. Also check from which app you need Notifications and activate it.
Also you should look in the settings of Security >> Privacy if Notifications from your apps are disabled.


Racemization at stereogenic centre

Question: I am getting a bit confused about why the configuration at the optical centre changes from d to l after enolization?

Any stereogenic centre next to a carbonyl group will be destroyed by enolization. Such compounds racemize quickly.
Answer: Forming an enol causes the carbon attached to the methyl group to essentially form a trigonal planar structure. This means that in the eventual conversion back to a ketone, there are two sides the hydrogen can attach to, often referred to as the re and si faces (see prochirality).
Therefore, the 'optically pure' d-isomer would actually exist in equilibrium with the l-isomer as the acetoacetic ester, which forms especially stable enols, will basically force prochirality on the carbon attached to the Me group.
Comment: @HiyaJandial The picture doesn't say a pure optical isomer if formed: it shows a reaction path where the two pure isomers are in equilibrium.
Comment: In the figure, it is mentioned that optically pure l isomer is formed, but instead it will be more like a racemic mixture?
Answer:
[OP in comments] In the figure, it is mentioned that optically pure l isomer is formed, but instead it will be more like a racemic mixture?

For equilibrium reactions, the chemical equation does not tell you what the net direction of reactions will be. When you reach equilibrium, you will have some of each of the two enantiomers, and some of the enol. If there is not special circumstance (chiral cosolvent, etc.), the two enantiomers will be present in equal amounts.

I am getting a bit confused about why the configuration at the optical centre changes from d to l after enolization?

What is confusing is that the molecules are labeled "optically pure isomer". This does not make much sense in this context. It is true that no matter whether you start with optically pure d or l enantiomer, you will end up with a racemic mixture.
Molecular formulas do not indicate pure or mixture, they just denote a given molecule, so labeling them "pure" is a bit strange.
Taking a snapshot at equilibrium, some centers will have changed from d to l, and some will not have changed. Also, some centers are in the process changing from planar to d or l, and some d or l centers are in the process of changing to non-chiral. This is what we call dynamical equilibrium.

Racemization at stereogenic centre


Linux - Find out the current working directory of a process?

Question: If i have a process PID X, how can I find out what directory it was running in? I can see with ps aux | grep X the full command line that it was invoked with. However in this case it's ./script.sh, and I want to see which script.sh it's running.
Answer: The problem with /proc/PID/exe is that, for shell scripts, it shows the location of the shell. The problem with /proc/PID/cwd is that is shows the current working directory of the process. If the process changes directories, that is reflected in the target of that symlink.
This will show what the $PWD was at the time the script was started (substitute the process ID you're interested in where you see "PID"):
procdir=$(grep -az "\bPWD" /proc/PID/environ); echo $procdir

or simply:
grep -az "\bPWD" /proc/PID/environ

This will show the command that started it so you can see if a relative or absolute directory was used:
proccmd=$(grep -az PROC_NAME /proc/PID/cmdline); echo $proccmd

or simply:
grep -az PROC_NAME /proc/PID/cmdline

Together, these should show you which script is being run. For one started with ./ all you need is procdir.
Comment: pwdx is better than this.
Answer: There's a simpler answer, and that's to use pwdx, as detailed here
Comment: This is the better answer.


UITableView in edit mode doesn't show checkmarks on iPad

Question: I have a universal app, that has a UITableView that allows standard editing where the cells indent to the right, there's empty circles for unselected rows and the filled in circle with a checkmark for selected rows. This works fine on iPhone (first photo), but the checkmarks don't appear when run on an iPad (second photo). Does anyone have any idea why this might be?

Thanks in advance...
Comment: Check autolayout constraints as well as checkmark image for ipad device.
Answer: The first thing I'd double check is your Autolayout constraints. Try making sure there are no missing constraints for the checkmark. Because the resolution on the iPad is obviously different than on iPhone, make sure there aren't any fixed distances where it isn't necessary. One way I use to find out if it's an Autolayout issue is by trying different orientations. Hope it helps.


Can the term Nakamoto Consensus (NC) be used interchangeably with Proof of Work (PoW)?

Question: Can the term Nakamoto Consensus (NC) be used interchangeably with Proof of Work (PoW)? Which term would the community prefer to use?
Answer:
Algorithms for achieving consensus with arbitrary faults generally require some form of voting among a known set of participants. Two general approaches have been proposed.
The first, often referred to as "Nakamoto consensus", elects a leader through some form of "lottery". The leader then proposes a block that can be added to a chain of previously committed blocks. In Bitcoin, the first participant to successfully solve a cryptographic puzzle wins the leader-election lottery. The elected leader broadcasts the new block to the rest of the participants who implicitly vote to accept the block by adding the block to a chain of accepted blocks and proposing subsequent transaction blocks that build on that chain.
The second approach is based on traditional Byzantine Fault Tolerance (BFT) algorithms and uses multiple rounds of explicit votes to achieve consensus. Ripple and Stellar developed consensus protocols that extend traditional BFT for open participation.

Source https://sawtooth.hyperledger.org/docs/core/nightly/0-8/introduction.html
So, Nakamoto consensus is in my opinion a synonym for Proof of Work, as it involves some kind of randomness in finding a valid hash, which is meant by "lottery" in the description above.
Nevertheless, I personally would stick to Proof of Work as it does not confuse people, who maybe do not know, that it was Satoshi Nakamoto who introduced Proof of Work as a consensus mechanism.
Answer: They are not interchangeable but often are used interchangeably incorrectly as they are very similar.
A consensus protocol is actually a combination of at least 2 rules:

A block author rule
A chain selection rule

ETH 1 and BTC use Proof-of-Work combined with the Longest Chain rule to reach whats called Nakamoto Consensus. Proof-of-Work is often incorrectly referred to as the entire consensus mechanism.
<code>Nakamoto Consensus = PoW + Longest Chain
PoW = Block author selection mechanism based on them mining the block
Longest Chain = True chain selection mechanism based on the "longest" chain
</code>


Nucleophilicity vs Basicity

Question: Can something be both a nucleophile and a brønsted base?
Also , I'm actually quite confused about the difference between these two terms.
Answer: by definition a nucleophile, is a lone pair donor. phile meaning 'loving'. i.e its attracted to species which are electron deficient. the term is used to describe a species in an organic mechanism.a  bronsted base, is a proton accepter. Mostly in organic chemistry, you draw curly arrows, going from the nucleophile to electrophiles,most usually a electron deficient carbon. so it acts more as a Lewis base. which is a lone pair donor. however there are protons floating around in most organic reactions, also very electronegative atoms such the halogens(leaving groups). which pick up protons so i guess by defintion you could say they act as bonsted bases as well as nucleophiles. However the term nucleophile is mostly reserved for the species acting on the electrophile in an organic mechanism.

Nucleophilicity vs Basicity


Which Mobile Suits from the anime were designed by Hajime Katoki?

Question: I love the look of the "Ver. Ka" Master Grade model kits. I know he was the lead designer for V and Endless Waltz. He also worked on 0083, Wing, and G among others.  I would like to know which specific Mobile Suits he designed from the Gundam anime franchises.
Comment: Are you referring to just gunpla or Gundam mech design in general?
Comment: @Krazer Specifically from the anime.  It's pretty easy to tell which gunpla models where redone by him from the "ver. KA" they tend to stick on the box.
Answer: Assume you're looking for original designs and no redesigns.
He worked on the Gundam 0083 OVA series, where he designed the famous RX-78 GP03 Dendrobium Orchis mobile weapon.
He also did a lot of work in V Gundam, where he was the main mechanical designer, creating the main mobile suits:

Victory Gundam
V2 Gundam
V2 Assault Buster Gundam

After that, he worked on G Gundam, designing the evil mobile suits.
He also worked on Gundam Wing, doing some some minor mobile suits, but his mostnotable contrtibution is to Gundam Wing Endless Waltz, where he designed all of the mobile suits, and re-designed the Gundams in a more fantastic style, the most famous of which is the XXXG-00W0 Wing Gundam Zero Custom
Answer: Hajime Katoki done a boat load of Mecha design's for a ton of different series. You should check out his wiki page Hajime Katoki where I believe all of his credited works are listed, and the series for which he made them.
Just to list a few he worked on

Master Grade

RX-78-2 Gundam Ver.Ka
XXXG-01W Wing Gundam Ver.Ka
RB-79 Ball Ver.Ka
XM-X1 Crossbone Gundam X-1 Ver.Ka
RX-0 Unicorn Gundam Ver.Ka
MSN-06S Sinanju Ver. Ka
LM312V04 Victory Gundam Ver. Ka
RX-93 Nu Gundam Ver. Ka

Born in 1963, Katoki created designs for the graphic novel Gundam Sentinel. He then worked in the OVA series Gundam 0083, where he designed the RX-78 GP03 Dendrobium Orchis mobile weaponHis next big work was V Gundam, where he was the main mechanical designercreating the main mobile suits Victory Gundam, V2 Gundam and the V2 Assault Buster Gundam. After that, he worked in G Gundam, now in design of the evil mobile suits. He then worked in Gundam Wing on some minor mobile suits, but in Gundam Wing Endless Waltz he designed all of the mobile suits, and re-designed the Gundams with a more fantastic style, creating the XXXG-00W0 Wing Gundam Zero Custom. To correspond with these new designs, he also redesigned the 5 original Gundams from Gundam Wing.
Comment: The op is asking for anime mecha designs, instead of gunpla models, which is extra-canonical to their respective series.


Star Trek edge of the galaxy?

Question: In Star Trek, the Standard Model seems to be the accepted physical model. Dark matter is detected and even dark matter life forms are encountered in some episodes. In the episode "Where No Man Has Gone Before" they say the Enterprise reached the 'edge' of the galaxy, but, according to my understanding, a huge halo of dark matter is also considered part of our galaxy.  If Star Trek accepts this theory, what is considered the edge of the galaxy?
Comment: It's hard to tell exactly what you're asking.  I've given an answer based on what I think is the question, so I hope it's on target.
Comment: The out-of-universe answer is that the writers didn't have any inkling about dark matter at the time, because the observation that galaxies were rotating in a way that suggested extra mass wasn't published [until 1970](http://home.physics.ucla.edu/~cwp/articles/rubindm/rubindm.html).
Answer: The edge of the galaxy in Star Trek is considered to be the same as what we consider the edge of the galaxy now.  Of course, this can be as tricky to define as the edge of our solar system, since some once considered that Pluto's orbit, others consider it to be the outer edge of the Oort cloud, and others consider it to be when the heliosphere tapers off a given amount.  In other words, "edge" can be tricky to define.  But, in general, the edge of the galaxy, in Trek, is considered to be the line beyond which there are no stars or perhaps only a few stars remaining before the vast gulf that separates our galaxy from others.
So the physical edge of the galaxy would be the same as what we consider it to be.
But if you want more on the barrier, which some would say is the edge, since it surrounds the Milky Way, here it is:
The Galactic Barrier.  Essentially the entire galaxy is surrounded by a "negative energy" barrier.  The composition of the barrier is not really clear.  Originally it's said to be unknown (in Where No Man Has Gone Before), but in By Any Other Name it's said to be made up of "negative energy."  The only other time it is actually encountered in canon is in Is There in Truth No Beauty, and it could be argued that what they encounter is not the barrier.  (It looks like it, but they don't use that term.)  It is never referred to as dark matter.  Very little information is given about the barrier and it seems that most writers prefer to avoid the subject, since, in canon, it is only encountered in Star Trek (The Original Series).
The best way to think of the barrier might be that it is like a giant bubble or balloon that surrounds the galaxy.  The entire Milky Way is within it.
In non-canon works, specifically Greg Cox's Q Continuum novel series, the Galactic Barrier is explained as a shield put in place by the Q after an encounter with the entity "0" (Zero).  0 is a powerful entity who destroyed the Tkon Empire.  The Q put the barrier in place to keep 0 out after 0 had already destroyed the Tkon.  The reason the barrier effects people with ESP is because it contains psychic energy from the Q, who created it.
So the galaxy has a physical edge, beyond which there are no or few stars, and outside this edge is the Galactic Barrier, which is like a bubble, that surrounds the galaxy.
(Note: Memory Alpha says the Galactic Barrier joins with the Great Barrier the Enterprise crossed in Star Trek: The Final Frontier, but I've left that out for simplification.)
Comment: @Aramis, I don't see how you can make that claim.  I addressed canon completely, then included non-canon, since there is no explanation ever given in canon to explain why the barrier is there, so I didn't marginalize it, I just included it as extra information.
Comment: Links and extra articles always help! ;)
Comment: -1 for marginalizing the actual canon description in favor of non-canonical sources.
Answer: In By Any Other Name, Spock states, "The barrier we must traverse is negative energy." And, later, "Sensors indicate density negative, radiation negative, energy negative. (Kirk starts chewing his nails with indecision) All instruments off the dials, Captain. We are in contact with the barrier."
So, no, it can't be Dark Matter as the term is understood, tho' it might be Dark Energy.
Nitpicking Notes
It's also worth noting that, even at the speeds mentioned in  By Any Other Name, even at the 10,000 x C needed to hit Andromeda in under 300 years, it is still 34 weeks to the barrier... the only viable positions for that barrier are either above or below the disk, not the outer edge of the disk, since it's only a couple days before they are approaching it. The episode's first time reference is 4657.5, during prep, and the barrier is hit at Stardate 4658.9, 1.4 stardates later. Per the writer's guide, that's 1.5 days later; 10648 x C (WF22 per the TOS Writers' Guide), they'd only have crossed some 41 light years... not even enough to hit the upper or lower extents of the disk. Perhaps the barrier is between the sub-arms, but even then, 41 light years isn't much.
Transcript: By Any Other Name
Answer: It seems possible that the Galactic Barrier may be the dark matter halo you're talking about.
In-universe they didn't know the Galactic Barrier existed until they (literally) ran into it in TOS.
Remember, at the moment dark matter is just a theory used to explain why gravity seems to be too strong on the outer edge of the galaxy.  There are also other unformed theories about "flexi-gravity" where it actually is stronger in that part of the galaxy for some reason.  A Galactic Barrier could just be strong enough to hold the galaxy together as a side effect...
Comment: I know we don't know for sure sure that dark matter exists, but as I stated in the op, Star Trek is full of canonical references and encounters with dark matter. I think it's safe to say that dark matter is part of whatever physical model Star Trek follows.
Comment: @user912 I meant it more as a "hmm, I wonder if a Galactic Barrier-type thing could exist in reallife" comment  ;)
Comment: If there really was a Galactic Barrier, wouldn't it bend the light coming from other galaxies a huge amount? If it's gravitational pull is strong enough to hold our galaxy together, it should probably be strong enough to pull the light coming from other galaxies directly to the center of our own, therefore we would never see anything from outside the barrier.
Answer: By that means then we know more than all the series put together, and Whilst I am a huge fan of the series. I am quite certain that they knew about the edge of the galaxy when TOS was made. Even if not TNG and Voyager say it will take so many hundreds of years to reach said edge at max warp. Therefore I just don't think that TOS can go oh yeah we reached the end of what we can scan even with all of our tech. And then to another edge in yet another episode. So they just rush across at warp 5 from one edge to another? Warp back then must have been 100X what Warp 5 really is
Comment: Is this intended to be a comment to one of the other answers?

Star Trek edge of the galaxy?


How to disable previous date in a calendar in sharepoint

Question: We have a field called need by date, So how to prevent user to select past dates from current date . or How to disable past dates in calendar from current date.
Comment: Do you need to prevent user from adding dates from past days in list's new/edit item form?
Answer: You can use column validation formula from list settings on your date time field, where you can restrict user from adding dates greater than or equal to tomorrow using below formula:
<code>=StartDate>=TODAY()
</code>
Here, StartDate is column name.
You will have to add this formula in column settings. Please below screenshot for the same:
Answer: You can create a validation rule on that date column setting, but this validation rule will work on new item add but when you edit the item, it will not allow us to save because of the validation rule, in which we would have mentioned your date field value should be greater than today. So better option is to have JavaScript code on date picker control and restrict the past dates. Use the below code,
Add the below code in your new/edit form
<code><script type="text/javascript">
    var getSPDayDiff = function (date) {
        return Math.round(Math.abs((new Date(1601, 0, 1).getTime() - date.getTime()) / (24 * 60 * 60 * 1000)));
    }
    $(function () {

        var minDay = getSPDayDiff(new Date());
        //DT is your datetime field
        var datePicker = $("img[id^='DT']").parent();
        var onclickStr = datePicker.attr("onclick");
        onclickStr = onclickStr.replace("minjday=109207", "minjday=" + minDay);
        datePicker.attr("onclick", onclickStr);
    });
</script>
</code>


How could a shapeshifter change forms realistically and what limitations should there be?

Question: I have a shapeshifter character whose power-set is relatively grounded. They can only change into other human forms. They can basically impersonate anyone they want, so they use their powers primarily for spying purposes. But I'm struggling to imagine how exactly they'd be able to change their height/size. And I'm also unsure as to what limitations there should be. Should they be able to grow beyond 50 feet tall or should there be a limit? Should they be able to impersonate people of different genders? If so, how would they shift around their sexual organs? Should they be able to impersonate people of different ages? Even a newborn? I know that shapeshifting is fictional, but surely there are ways to make it plausible in theory. I am aware that variations of this question have already been asked on here, but I didn't fully understand a lot of the answers given, as they were very technical.
Comment: If they're not undergoing mass-change (thus limiting them to shapeshifting to those similar in size/volume), then we need something radically different underneath their skin. Instead of smooth muscle for each hair follicle, we'll have a layer of (probably) striated muscle thick enough to flex and expand features. In the face and to a lesser extent upper body. Chromatophores to change skin ton, etc. Perhaps even an unfused skull.
Comment: It is important to note that molecules can't be destroyed or created. So the shapeshifter will have to use the molecules of their body to change. They may not be able to become a baby but they can change their age appearance.
Comment: Too many questions. This is too open ended.  Since the closest we've got to a shape shifter is chameleonic color changing, it's pretty difficult to answer this "science based."
Comment: Is it a biological creature or artificially made?
Comment: @KrišjānisLiepiņš It's a human being who fell into some plasm that makes their skin and bones malleable like clay
Answer: You can't change their mass, unless they can quickly absorb or eliminate water.
I'd treat the shapeshifter much like an Octopus; which has no skeleton. The only hard part is the beak; much like a bird's beak. But no skull, the body has an outer layer of muscle.
So it can change color, contort itself into crazy shapes, etc. Maybe it could even simulate hair, if the control is fine enough, or maybe it can extrude hair and re-absorb it.
It could appear to be fat, but it would just be inflating itself.
The same thing for genitals, and breasts. It would be able to simulate either male or female (or it could be "smooth around the bend").
I would guess it cannot be a baby, maybe the size of a 12 year old, and no reason it couldn't be 7 feet tall, fat or thin or (in appearance) muscular.
Octopi have incredible ability for mimicry in their appearance, they can literally make themselves virtually invisible by making their body look like the background; even a rough and non-uniform background. They can make themselves look like sand, like rocks, like plants, like a rough surface, like smooth one. Colors and texture can both be copied.
I don't think it is a stretch for your shapeshifter to look exactly like somebody they want to look like, and if they have the fingerprints, to copy them also.
They may also be able to look like a trashcan, or a section of a brick wall. Perhaps some medium sized item in a store or office, like a desk.
I think your size limitations are a good idea. They cannot impersonate an aircraft, for example. And I would not give them any powers like flight, or impersonating a working machine like a car or a blender or even a bicycle. Just the appearances of them. But they might impersonate a living lion or panther, or a gorilla. Not an elephant or blue whale, not a sparrow, but animals reasonably within the weight range of say 80 pounds to 500 pounds (remembering the shapeshifter would just be hollow when impersonating something large).
I'd go with the ability to extrude and reabsorb "hair". It may be a stretch, but I don't think it is a deal breaker at all.
Comment: @Katy have you looked at any video footage of an octopus camoflaging itself? there are times when you can watch the octopus making the transition and still not be able to obviously see that it is an octopus afterwards. The trick is remarkably effective.
Comment: I personally disagree with them being able to impersonate non-human objects. Though they could lean against a wall and flatten themselves (and thus blend in somewhat, from a distant observer in a dark alley), they wouldn't be able to shape themselves like a desk, at least not one that'd pass a precursory glance. They'd have a vaguely human shape (head, 2 arm tentacles, 2 leg tentacles), and different parts can change size but they couldn't disguise themselves as anything except a human. Though, if they need to they could disguise as a large dog, at least on a dark night from a distance.
Comment: @StarfishPrime Exactly so. In the lab they can look like a checkerboard, or patterned wallpaper. Moving along the sea floor they can look damn near transparent, and seemingly disappear when they stop. They can look like undersea plants. It is the closest real-life thing on Earth to a cloak of invisibility.
Comment: @StarfishPrime the limited amount I've seen is pretty good, but I thought that in many human environments it may not look passable- a brick pattern would look off on a 3D creature. Though, Amadeus says otherwise- octopi blending in with checkerboards is pretty close to somebody blending in on a brick wall!

**However**, I stand by the shapeshifter being unable to appear like a desk or such. They'd be limited in exactly what shape they can have just by biology, and I'd say "resolution" (AKA, how detailed their disguised skin looks) would also be a limiting factor. So, no IRL gMod prophunt.
Comment: @Katy a comparison might be drawn to modern soldiers and urban camoflage techniques. Neither the soldiers nor the camoflage patterns are necessarily square, but the ability to break up outlines and look less like a person remains surprisingly effective. Biomimicry of brick patterns may not withstand close inspection, but most people _aren't closely inspecting mortar spacing and coloration_. If you don't, you may allow the changer to escape or ambush you. If you do, you may waste time and they can escape you whilst you're prodding each floor tile in turn with a stick in a huge open office, etc.
Comment: Also add the limitation that comes with land dwelling. The shapeshifter needs to have a regular skeleton to be able to survive and not die of exhaustion. Maintaining a shape underwater is easy, but on land gravity has to be fought constantly. The skeleton might have provisions to change limb length or movable facial bones to mimic different skull structures.
Comment: @MennovanLavieren Not necessarily. This is *fiction*, let the shapeshifter form and dissolve stiff structures to serve as "bones" at will. I make (for my dog) chicken jerky snacks of chicken meat alone (its cheaper and keto) but I cook it to a pretty stiff hard stick (get your mind out of the gutter!). That is mostly just expelling water from the meat, and obviously it is easily digestible, I've sampled it myself several times. I don't see why a shapeshifter couldn't do something quite similar to act as structural reinforcement, like "bones". They wouldn't normally be tested or inspected.
Comment: @StarfishPrime that is a good point. I still think that somebody moving past would notice (depth perception noticing inconsistencies) but yeah you probably could do a good job at hiding from even 5 metres away from someone!
Answer: I said this in a comment but have decided to actually answer. There is the law known as the Conservation of Matter. If you want a realistic shapeshifter then they need to rule this law. When shapeshifting they cannot add or remove atoms from their body. So, they cannot become the size of a baby unless they want to die(That is my idea, they will probably just die from losing a lot of body mass). If all you want your character to do is change their appearance then you don't need to do anything. For a shapeshifter to change into another form, like a bull, then they would be a smaller bull. If it is a dog, then a bigger dog(though dogs can get massive).
Comment: becoming bigger might not be that much of a problem, up to a certain pont. The shapeshifter could form pockets of air inside its body to compensate for the missing volume. So it could become the size of "the mountain" from GoT but still be only the weight of a normal person, or whatever its weight is
Comment: @datacube They could make themselves bouncy and float around.
Comment: floating: no, since the pockets would be filled with air, they could never get lighter than air. But depending on the constraints the author sets on a "minimum thickness" he could get really big and therefore have a really high air resistance.
bouncy would be for the author to decide, but i'd tend to: "a bit"
Comment: You're right. It would need to be a lighter than air gas to allow the shapeshifter to float.
Answer: The other answers by @Amadeus and @Martamo have detailed how through conservation of matter, the shapeshifter wouldn't be able to grow super large or super small, nor would they be able to change their age, only changing how they appear. Therefore, I won't go into detail about similar topics. However, part of your question is how a person could shapeshift and to what extent they could, for instance whether they could change their sex organs or not.
If shapeshifters were possible in real life, they would probably implement the use of stem cells. If a person or other organism could change all their cells into stem cells, rearrange them, and then convert the stem cells back to regular cells, then the person would be able to change face details to look like someone else, including color of eyes and hair, as well as changing their reproductive organs. The person would still be working within the limitations of their number of cells, and of course it is impossible in reality for humans to convert all their cells to stem cells at will, but stem cells would be an important part of shapeshifting in a hypothetical situation.
So while a shapeshifter wouldn't be able to grow 50 feet tall or change into a newborn, they could implement stem cells to change organs and features.
Comment: Wouldn't this take a while though? It takes nine months for the stem cells of a human embryo to make a little person. If they want to change their eye color, wouldn't they also need to change their DNA? Because most facial and bodily features are determined by the DNA.
Comment: @Martamo you make a fair point. However, assuming shapeshifting is biologically possible, which is isn't, stem cells make the most sense for how it could be done. Yes, in reality it takes a while for stem cells to form new structures, but if it could be done instantaneously and a person could have control over what they shapeshifting into, it would be the best scientific explanation. As for DNA, I think that shapeshifting in general would require changing or overriding DNA. After all, your changing what you look like in many capacities. If you can't control DNA, you can't change shape at all.


Distance sensors with accuracy of 0.1 mm?

Question: I am looking for a sensor with 0.1 mm accuracy and a sensing distance of 1-10 cm for an industrial machine. The machine is used to ensure product quality following the assembly process. It will be operated via a PLC. Any suggestions on the type of sensor that would best suit these requirements?
Comment: @Transistor i editted it. better now? thanks for the advice. do you think using a laser sensor with PLC a good idea?
Comment: You would need to specify things like contact or contactless, etc. Because as worded, nothing is stopping me from just moving a touch probe mounted on a encoder-monitored rail right up to the workpiece to measure it. Also, you mention product quality...this doesn't sound like a DISTANCE sensor. This sounds like a dimension measuring tool and you will get different results.
Comment: Your question is foul of the [on-topic] guidelines. (Shopping questions aren't allowed.) In any case, you haven't specified a sensing distance, etc. Most of the industrial sensors companies will have laser sensors which might do the job.
Comment: What type of sensor depends a lot on particulars of your system, i mean you could use a time of flight laser,  a infrared distance meter, a lvdt, optical interuption sensor, a camera with a telecentric lens, hell even just a camera with calibration, a optical encoder, a magnetic encoder etc etc.  0.1 mm is nothingin terms of accuracy.
Comment: optical/laser triangulation type distance sensor is another one, more basic / economical than laser TOF or laser interferometer. Don't know if it is good to 100um ... inspection systems using "structured light" and camera sensor are also quite impressive, and fantastic resolution, though not sure if can do absolute distance like TOF or triangulation can and maybe still too $$$
Answer: All of the big boys, Keyence, Sick, Omron, ifm, Turck, etc. do a vast range of sensors.
You have the option of using a sensor with digital (on/off) output which you would teach with go / no-go samples. This might be fine if the production value never changes.
The alternative is a sensor with an analog output or one with something like IO-Link which will pass the analog value back in digital form without the intervening analog conversion. This would allow easy pass-band adjustment for various product configurations and also allow you to collect statistics such as mean, standard deviation, etc., which the process controls and quality engineering guys should love.
Call the sales reps and they'll be all over you.