Word stress and sentence stress questions

Question: Are sentence stress and word stress analyzed seperately? Or are they analyzed all at once? For example "I need to sell my car". Do I find the sentence stress and word stresses seperately or do I analyze them all at once? If I analyze them all at once, Does one affect the other? Can sentence stress turn a secondary stressed syllable in to a primary stressed syllable? Or can it turn a non stressed syllable in to a primary or secondary stressed syllable through sentence stress? I'm asking these questions only referring to English.
Comment: I am not a trained linguist, but understand "word stress" to mean what syllable is stressed in a word.  Your example only includes monosyllables and so word stress is not an issue.  I understand "sentence stress" to mean "prosodic stress as a part of intonation.  If you want to combines the two in your question, you may need an example that includes multisyllabic words.
Comment: @Vegawatcher its not that I want to combine the two, its that I wonder whether the two are analyzed toguether or not. How about the following example: I wanted to sell my car.
Comment: A few final questions for clarification, since your question has potentially a huge scope.  By analysis, are you asking (1) about how to predict the surface stress accents taking into account both word and sentence stress, (2) about how a linguist would analyze the surface stress phonetically, or (3) about how a linguist would analyze the surface stress phonologically?  The first focuses on the rules; the second focuses on how the stresses sound; and the third focuses on what the stresses do in the language.
Comment: @Vegawatcher I'd say both 1 and 3.
Answer: As far as I am aware, English has phonemic stress on at least three levels: word stress, compound stress, and sentence stress.  In all three cases, the stress manifests as a differentiated syllable or two within a single word.  To analyze why a syllable is stressed in a stream of words, you have to examine all three levels.
English is a stress-timed language, which means that normal speech rhythm tries to space each stress with the same time interval, while adjusting the rate at which unstressed syllables are said to accomplish this.
The stress functions phonemically to give prominence to one or more syllables within a word and typically contains multiple phonetic components, including an increase in the syllable's loudness, a higher pitch, full vowel articulation, length, and perhaps a reallocation of the phonological feet within a word.
Every word spoken in isolation, even if monosyllabic, must have at least one stress.  In fact, the only utterance I can think of that has no stress is the hesitation sound--often spelled "uh"--,because it is meant to signal something else to be said that would carry a stress.
Some of the components of stress may be deleted because of other phonological processes, but some type of syllabic prominence is normally retained even in "extreme" phonological environments, such as singing or utterances attempting to contrast unstressed syllables in similar words.  For example, with yes-no question intonation, a sentence generally has rising intonation, therefore causing a final unstressed syllable to be articulated at a higher pitch than previous stressed ones.  Such a change does not affect the perception of what syllable is stressed, because of the other feature of stress that will remain.
For word stress, I believe linguists generally recognize up to three potential levels that can occur in one English word: one syllable with primary stress, one syllable with secondary stress, and an unlimited number of unstressed syllables.  Every word must have at least one stress; however, normally stressed syllables are routinely de-stressed by other processes, frequently leaving words without a stressed syllable when not used in isolation.
Word stress often causes vowel reduction and centralization.  There are certain vowels that are exempt, and others that can vary from speaker to speaker or even utterance to utterance.
The word stress is a suprasegmental feature that helps differentiate words.
Over at least the last two millennia, there has been a strong tendency to move the stress to the first syllable, especially in nouns, causing many minimial pairs in which a noun is stressed on the first syllable, but a corresponding verb is not--e.g, " a setup" vs "set up something"; "progress report" vs. "progress with the report"; and "a record performance" vs. "record a performance."
Compound stress takes word stress as an input and creates a new phonological word.  English has at least two patterns of intonation used in compounds, one of which leaves the stress on the modifier and removes the stress on the modified part.  Examples are "townhouse," "dog house," and "White House," in all of which the component "house" is not stressed.  This pattern contrasts with the stresses in "town hall," "a dog's house," and "a white house," in which hall/house would usually retain a stress.
The type of compound stress used in "townhouse" differentiates this type of compounds from other compounds.  I am unsure of the precise semantic value, but I think it creates a subcategory of the modified noun, whereas the other stress pattern (i.e., the one used in "town hall") seems to have the semantics of a reduced noun phrase without creating a new subcategory.
Sentence stress takes word stress and compound stress as an input and uses this stress to signal information value.  The stress is removed from any element that is already part of the discourse, easily inferable, or otherwise of low information value.  New or salient information retains stress or even receives additional stress.  This process greatly affects the rhythm of the syllables to allow roughly equal spacing between each stressed syllable.
The fact that sentence stress signals information value explains why it can cancel the other functions of stress to differentiate words and compound types.  The lack of stress indicates that these differentiating functions are no longer needed in the specific utterance.
The operation to remove stress is part of the pragmatics of an utterance.  Even though some aspect of it is mandatory in normal speech, the pragmatics are mostly under the spontaneous control of the speaker.  The tension between what is mandatory and what is under spontaneous control of the speaker emerges when reading the words of others, especially poetry, where the reader's spontaneous assessment of the pragmatics may differ from the assessment of the original author and result in mistakenly reading in a stress pattern that clashes with the pragmatics of words later in the speech stream or with the meter of poetry.  To avoid such clashes, good readers must read with attention to the overall pragmatic flow of an utterance to anticipate what is needed or even prepare a reading in advance so as not to be surprised by an unexpected intonation or rhythm.
A reader that produces a phrase with malformed stresses will often feel obligated to reread the mistaken part to produce an acceptable utterance.  Good prose writing tends to avoid relying on stress patterns not easily predictable from the speech stream.
Answer: English stress is analyzed extensively in The sound pattern of English, and a number of rules are required to generate the patterns which they observe (a system of numeric stress degrees). "Stress" is treated as a unified phonetically-defined thing, thus it makes sense to talk about "word stress" and "sentence stress". There are many rules involved in generating word-internal patterns versus phrasak patterns. It is a basic architectural feature of the system (due to cyclicity) that first you generate word stresses, and that output determines how sentence stresses are computed.
Subsequent developments in the theory, for a while, changed the representational basis for "stress" but maintained the view that word stress and phrasal stress are the same kind of think. However, over the past few decades the dominant view is that word-level stress representation is much simpler: stressed vs. non-stressed, with the option of a distinction "primary" vs. "secondary". Then, at the level of phonetic implementation, particular tonal objects are aligned to prominent syllables within words – the "stuff" that constitutes sentence-level stress (tone melodies of sort) is entirely different from word-level stress (prominence). Prominence within the word comes in two flavors. First (topmost) is foot prominence – syllables are grouped together into rhythmic groups of two or three syllables, and some foot is the prominent one within the word. Then within the foot, one syllable is marked as the prominent one.
In something like "I need to sell my car", every word is monosyllabic, so word-internal stress is irrelevant, you just have to analyze the pitch patterns at the sentence level. This introduces one of the main complications of phrasal "stress" i.e. intonation: any of those words can be focused (except "to"). Whatever the general tone pattern of the utterance is, its realization is partially dependent on whether some word is focused, hence "I need to sell my car; I need to sell my car...".
There is a (former?) claim that stressed shift around inside the word, at the sentence level. Example: "sixteen; sixteen children". This phenomenon of "rhythm" has been analyzed as a transfer of stress within a word from syllable-to-syllable; but it has also been analyzed as the suppression of prominence in certain phrasal positions. See this paper for some discussion. IMO the argument for phonological sentential stress-swapping is weak.


Learning C for Objective-C

Question: I am relatively proficient in Objective-C but I have been looking around some frameworks and libraries I might use in the future and I am increasingly seeing the use of C. So far the only applications I have written contain only Objective-C. I know Objective-C is a superset of C, but what I mean when I say that I have only written in Objective-C is that I have only used Objective-C methods and the syntax of Objective-C that is distinctly different from C syntax. I've been going through questions related to the relationship between C and Objective-C (see links below) and I want to start learning C, but apparently there are three types of C (K&R, C89, and C99), and I am wondering which type I should learn to help me with Objective-C. I know from learning Objective-C I unknowingly learned C too, but I want to understand the ins and outs of C more and become familiar with its functions, syntax, features, etc. Also, is Objective-C based off of any one of the three types of C?
Comment: As I mentioned in my answer below, Objective-C in its current form is based on C99 (minus floating point pragmas, actually).
Comment: I'm not asking for books. I'm asking for which type of C (K&R, C89, C99) to learn.
Comment: No problem... Added some more info...
Answer: I suggest you look at some introductory texts on C, and learn whatever C dialect the text teaches.  This will likely be C89 or C99.
K&R C is missing modern features such as "prototypes" (declaring the number and types of arguments to your functions).  C89 adds all that stuff in.
C99 has, mostly, small incremental features that are useful in specific domains.  The bulk of the stuff you need to learn should be identical across C89 and C99.  Fun fact: Microsoft never bothered to implement C99.
Actually, I will suggest a specific introductory text: use the Second Edition of K&R.  This basically updates K&R to C89.  K&R is an outstanding book, and a great choice for learning the C language.
https://stackoverflow.com/questions/1646667/kr-1st-edition-vs-2nd-edition
Comment: @0xC0000022L: Even C++11 still doesn't have some of the more useful features of C99; C++ is in no way a replacement for current C support.
Comment: I am very surprised to see you defending Microsoft on this point.  Many of the new features of C99 were already implemented by Microsoft, using their own proprietary versions, by the time C99 was standardized, so many of the C99 features are just a #ifdef away.  And sure they added one-line comments.  But the fact remains that there is a lot of cool stuff that they didn't implement, and those of us who still work in C would like them.  The one that I really care about is designated initializers for unions (NOT available in C++ either): http://stackoverflow.com/a/856026/166949
Comment: Fun fact: there's no good reason to implement C99 fully when the respective C++ standard (C++98 IIRC) implements most of the desperately wanted features of C99 and adds extra type safety while only leaving out the minor stuff that is not compatible between C and C++ ... ;) ... Microsoft saw it this way and I agree. Besides, single-line comments are implemented even in MSVC, aren't they? Well they aren't in C89 ... what now? Still +1
Comment: @Stephen Canon: please name some. Also, I wasn't discussing C++11 vs. C99. I reckon more people should read the Stroustrup article "Sibling Rivalry" and think and work toward a richer and harmonized C/C++ "biosphere". Bashing single vendors won't help. Even some of the GCC limitations/extensions aren't exactly helpful when you have to use five different compilers on more than a dozen platform/architecture pairs in various incarnations (i.e. different compiler versions). SunC freaks me out with lacking support for anonymous unions, for example ... so what? I'm a developer. I work around issues.
Answer: There are even more types of C. In the meantime C0X and C11 were defined... They all make only small evolutionary steps from their predecessors, so you shouldn't worry much about it. Objective-C is based on C99 (minus floating point pragmas, actually), so for now that would probably be the best fit.
It's not entirely clear from your question, but you do notice that those variations of C are just evolving specifications from different years? K&R from ca. 1978, C89 from 1989, C99 from 1999 etc... Objective-C was designed to be a strict superset of C, so you can probably expect Objective-C to incorporate C11 features some day.
(NB: several edits to include information from the comments)
Comment: Since Apple currently is the driving force behind Objective-C, only they can tell for sure. Objective-C was designed to be a strict superset of C, so I assume they will want to stay up to date.
Comment: C0x was the provisional name for what became C11.
Comment: MSVC for example has a mix between a few C99 features and C89/C90. Other compilers require you to enable explicitly C99 support, so I'd recommend C89 as the common denominator that is virtually supported everywhere.
Comment: So will Objective-C update periodically to incorporate the latest version of C?

Learning C for Objective-C


Quest rewards with a full inventory

Question: I've ended (cashed-in) quests with item/weapon rewards while I had a full inventory, and I couldn't tell what happened to the items. I don't think they made it to my inventory, but they weren't on the floor and there wasn't an option to close-out the quest again. Were the items liquidated into money, held on the side somewhere, or did they just disappear? What happens in this case?
Comment: Item drop in this game = throwing your item across the room.   Did you check 20+ feet in front of you? Or did it fall down a ledge ?
Comment: I would look for a minute or two near the quest bulletin boards before giving up each time. There's nowhere for them to be thrown. I'm thinking they're liquidated, but I wanted to confirm.
Answer: When you have a full inventory, any quest rewards you get should still end up in your backpack. For example, if you have 15/15 backpack slots full and you get a SMG from a quest, your gun will be in your inventory and your backpack should display 16/15 capacity now.
Comment: Also, when you have a 29/27 inventory, you can put 2 items from your inventory into bank even if the bank is full.

Quest rewards with a full inventory


Plotting some kind of convex hull

Question: I have a set of points $x_i \in \mathbb{R}^2$ and want to plot its convex hull with an additional condition. What I want to plot exactly is:
\begin{align}
\left\{\sum\limits_i \alpha_i x_i\middle| \sum\limits_i \alpha_i = 1, \ 0 \leq \alpha_i \leq \mu \right\}
\end{align}
How can I do that? I think it is not possible (in an easy way) in mathematica.
I just need some pictures, so it is ok for me if I can only take a very small set.
Answer: Let $x_i = (u_i,v_i)$.  The desired set of points is the set of the $(u,v) \in \mathbb{R}^2$ that satisfy
$$\begin{align}
u &= \sum_i \alpha_i u_i \\
v &= \sum_i \alpha_i v_i \\
1 &= \sum_i \alpha_i \\
0 &\leq \alpha_i \leq \mu \enspace.
\end{align}$$
Splitting each equality into two inequalities, we get a set of inequalities in $u$, $v$, and the $\alpha_i$'s.  If we eliminate the $\alpha_i$'s with, say, Fourier-Motzkin elimination, we obtain constraints on $u$ and $v$ that describe the desired set.
As an example, suppose we are given
$$ x_0 = (0,0), x_1 = (1,0), x_2 = (0,1), x_3 = (1,1) \enspace,$$
and $\mu=0.5$.  Noting that we can do without $\alpha_0$ if we replace $\sum_i \alpha_i = 1$ with $\alpha_1 + \alpha_2 + \alpha_3 \leq 1$, the initial inequalities are:
$$\begin{align}
u &\leq \alpha_1 + \alpha_3 \\
u &\geq \alpha_1 + \alpha_3 \\
v &\leq \alpha_2 + \alpha_3 \\
v &\geq \alpha_2 + \alpha_3 \\
1 &\geq \alpha_1 + \alpha_2 + \alpha_3 \\
0 &\leq \alpha_1 \leq \mu \\
0 &\leq \alpha_2 \leq \mu \\
0 &\leq \alpha_3 \leq \mu
\end{align}$$
For $\mu=0.5$, elimination produces
$$\begin{align}
0 \leq u &\leq 1 \\
0 \leq v &\leq 1 \\
u - v &\leq 0.5 \\
v - u &\leq 0.5 \\
u + v &\leq 1.5 \enspace.
\end{align}$$
These inequalities delimit a pentagon, which is easily seen to be the desired set.  As expected, the pentagon is entirely contained in the convex hull of $x_0,x_1,x_2,x_3$.

Plotting some kind of convex hull


What does "4m[terminated]" mean after restarting CentOS?

Question: After installing CentOS 7 and restart it, it always promptd "4m[terminated]". After googling, I can't find the meaning of this phrase. What does this prompt mean? Will it affect normal OS functions?
Comment: I don't have a centos 7 image to try this at the moment, so I'll leave a comment for now. Terminated is printed by a shell when one of the processes created by it have been killed with the TERM signal, and the `4m[` may be an attempt by a shell script (that thinks it is running on a console window) to colorize that word. Clicking on the restart button will, sooner or later, run the `shutdown` or  `reboot` command, which sends a TERM signal to each running process. It shouldn't be anything to be concerned about.
Comment: You mean it shows up in a shell prompt?
Comment: @MarkPlotnick: No, when fininishing installation, and click `reboot` button, it will prompts "4m[terminated]". Then restarted and run OK, But I can't figure out what is the meaning of this word
Answer: This is a sigterm kill initiated by a CentOS 7 reboot command after a fresh install. It is obviously a issue that needs to be patched as the image is supposed to reboot not halt. Probably has something to do with the reboot or shutdown command that is not interpreted correctly. Basically the machine halts in stead of shutting down and rebooting, something similar to 'reboot -h 0'. Seems to be related to CentOS 7 only from what I can tell.
For now best to just ignore methinks.
To answer your question: no a sigterm 'information only' aka 'FYI' error at shutdown/reboot will not harm your OS or data in any way.


Align axis to object normals

Question: I have an object rotated around X axis but its own axis pointing in different directions because it was rotated manually for practicing purposes. How do I align the axis with the normals of the object now considering that I can't do it manually. Also how do I align the 3D cursor to the normals of the rotated object in case I don't know the exact rotation angle in order to do it manually in View Panel  (N) Another dilemma with the 3D cursor is that even if we rotate the thing it has no effect on snapping or adding new objects raported to its orientation. They are still subjected to Global axis no matter what transformation mode we are in or orientation of 3D cursor.
Answer: Assuming you're using post-2.8 versions, click the Show Gizmo button at the top of the screen, select the Move, Rotate and/or Scale, and set it to Local instead of Normal

Align axis to object normals


Where can I view a map with buildings/businesses that were present sometimes in the past?

Question: From time to time, businesses (e.g., restaurants) close or buildings are destructed. Where can I view a map with buildings/businesses that were present in a given point in the past? (e.g., "show me map of Seattle in 2010"). I'm trying to recall the name of some place I went to when traveling, which has closed since then.
Answer: Google Maps Street View has a timeline.
Answer: There is also Land Viewer | EOS website you can use. You can choose the area of interest from the map and have a timeline of satellite imageries from the same area.
For example, I looked at Seattle:

Of course it has some cons. For example, it sometimes has a great cloud coverage, which makes it a good tool for meteoroligsts. Also, when zoomed in, the quality of the picture decreases. And also, it's not really free of charge if you want to see more than 10 pictures a day. Yet another con: it's boring to go through dates to reach the desired date. And also, sometimes it doesn't show the name of buildings.
Also, there is World History Maps & Timelines | GeaCron website if you are interested to see the world map with the territories of old kingdoms and empires. Fortunately, this part is free of charge. But if you want to see more than it (i.e. historical military campaigns, etc) you have to pay.
Comment: Very cool, thanks!
Comment: You're welcome :)


Does activepivot support distribution?

Question: Suppose that I have too much historical data (data from 2012 and 2011) to be put on one single computer using an activepivot.
Can I split the data among the two computers (one with 2011 data and another with 2012 data) and still have a global view (i.e. the total number of facts in 2011 and 2012)?
Answer: The answer is yes! ActivePivot can split data by row (horizontal distribution as you suggest) or also by column (Polymorphic distribution), which could be sales column on one machine and price column on another.
http://quartetfs.com/en/activepivot-distributed-architecture
http://quartetfs.com/products/activepivot/in-memory-computing - "Horizontally Scalable. ActivePivot is scalable as it grows with your business and allows you to benefit from insights on both real-time and historical data. ActivePivot can be deployed on distributed architectures such as clusters and wide area networks."

Does activepivot support distribution?


AD Existing Forests Best Practices Setup

Question: My company was acquired by another company. Both companies have existing AD forests and domains. The company that acquired us ,also has international sites.What would be the best practice/solution to get both AD forest and domains working together?
Comment: Define `working together`.
Comment: there are lots of answers here, cross forest trusts, adfs, or merge the forests. You need to choose a specific problem
Comment: @JimB I'm not sure I agree.  ADFS is for separate organization, and probably doesn't apply here, merging the forests isn't making them work together; it combines them into one... so that really just leaves a cross-forest trust as the only valid answer I see.  Of course, this *is* a very high-level answer to a very high-level question, and a more detailed answer would require a more specific problem, or realistically, a consultant.
Comment: Adfs is for claims based authentication (not sure where you got the separate org piece from) and if both orgs have their priority apps set up for claims, its far simpler, faster and more secure than doing a cross forest trust.  Cross forest trusts are usually used when you trust the partner org, a dubious position and irresponsible position (potentially) in a merger, and could require infrastructure changes.  The Cadillac route is a forest merge with ADFS to make app migration faster as well as have an agreed upon directory set, but like a Cadillac, isn't the cheapest.
Answer: Creating a cross-forest trust.
This can be complex, and I would recommend bringing in an Active Directory expert.  Here's some basic reading on Active Directory trusts.
Comment: @Konrads Right, clearly someone who doesn't even know what a cross forest trust is should be in charge of integrating two companies' forests.
Comment: This is a really poor answer (ad hominem): "you have to ask, though, indicates you're not the guy to do it"
Answer: Back up everything! AD is one complex and picky beast. You don't want to be responsible for bringing down a whole domain.
If your using exchange the first step is usually too change the mail domain for all of the users of the company which was purchased to the head companies domain. You will have to set up shared address space SMTP and Mail routing for this to work.
Afterward you will want to create a trust between both forests to allow users to interact between forests. There are a lot of options here to determine how the trust operates and every organization does this a bit differently. I suggest reading up on it a lot before you attempt it.
Technically speaking that's all you have to do to make it work, but it's not very clean. I would probably use a tool like ADMT to actually merge the forests after I had everything working. But keep in mind that there are lots of small things that can break this. Namely SID checking and a few other small bits. This is where a real AD expert would be handy. I understand that's not always possible, the only reason I learned to do this was because I found myself in your same position and the higher ups looked to me to make it happen.


16.04 updates after new installation

Question: Muon offers over 400 updates! They all all pre-selected. How can I remove
selections and just mark some that I want? (I'm just starting Kubuntu)
Answer: It is always better to keep your system up-to-date. If you didn't add any ppa's, all updates you have recived are necessary. You can do this in terminal:
<code>sudo apt update && sudo apt upgrade && sudo apt dist-upgrade
</code>
It is absolutely normal, that you will get some updates 4-5 times in week.

16.04 updates after new installation


Why does disabling the TCP/IP NetBIOS Helper service lock me out of GPO?

Question: I disabled TCP/IP NetBIOS Helper and started getting EventIDs 1030 and 1058.  This thread said that I'd need to have it enabled.  Indeed, when I started it up, the problem immediately went away.  My question is, why?  I thought NetBIOS wasn't needed unless you had Win98 clients on your network?
Answer: The TCP/IP NetBIOS Helper Service is what allows NetBIOS to work over TCP/IP and SMB. In the specific case of Group Policy, this particular service allows your workstation to resolve the AD Domain (italy.addom.example.com) in a way that it can access the SYSVOL and pull the Group Policies themselves. Turn it off and it won't be able to resolve the AD DNS domain into something it can use to fetch policies. It seems backwards, but it's quite provable.
Back in September I had the exact problem you're having right now. One of our desktop images had that particular service disabled, and was not getting GPOs. Turning that service fixed it completely.
Comment: I had forgotten about NetBEUI, but I think I still meant NetBIOS.  But then there's http://serverfault.com/questions/119253/netbios-free-network and http://www.petri.co.il/disable_netbios_in_w2k_xp_2003.htm (particular the early paragraph beginning with 'Although...'.)
Comment: Okay, thanks for the explanation (+1)...but I thought NetBIOS slowed down your network traffic and should only be enabled if it's really needed?  So, it's *always* really needed?  Or am I confusing two different uses of NetBIOS?
Comment: You might be conflating NetBEUI and NetBIOS, which are different.


Comparison between timsort and quicksort

Question: Why is it that I mostly hear about Quicksort being the fastest overall sorting algorithm when, according to Wikipedia, Timsort seems to perform much better?
Comment: Because people choose to ignore that quicksort is O(n^2) worst case.
Comment: One possible answer would be: You speak to the wrong persons. But as an other answer already implied: qsort is much older, so its used in far more libraries - and you know: Never touch a running system. If the average running time (meaning: in the use cases of the people using it) is not much worse than the run time of a different algorithm (like timsort) the people are too lazy (or have better things to do) than to change something, that does the same in the same time. And in some applications (it seems e.g. python) timsort is already default.
Comment: @MartinThoma Sorted lists only produce the worst-case result for a really bad implementation of Quicksort. Random or median-of-three partition selection implementations avoid worst-case for sorted or nearly sorted lists. But they still don't achieve the O(n) behavior of Timsort. Timsort's stability is also a key property that people overlook. It is very useful in a lot of situations, and in particular for multi-key sorts.
Comment: @Patrick87: The truth is much different.  You are ignoring the O(n) best case.  It's not about worst cases that basically never happen, it's about best cases that actually do.  timsort does a good job when it encounters a sorted range.
Comment: @RobNeuhaus: I think the worst case of (a simple implementation of) Quicksort actually happens quite often.
Just sort a list that is (almost) sorted already.
Comment: With a little more thought and some references, this could be a good question.
Comment: @rrenaud worst cases "basically" never happen, but they do "actually" happen, sometimes.  It is an important consideration, especially when hitting a worst case O(n2) means bad things happen.
Comment: I cannot use standard java sort in codeforces programming competitions, because java uses double pivot quicksort for integer and double arrays, and so there exist arrays which require O(n^2) time to run. And some test data is often composed with these arrays, so program takes too long time and fails. So I have to switch to my own mergeSort instead. It cannot happen with timsort algorithm.
Comment: There's more to just "fast". Quicksort is still better in practice because it is in-place, requires O(1) space, and only swap values. Its O(n^2) can be easily prevented. It is also old and has been researched and reimplemented many many times. For sorting just numbers where you do not need stability, definitely Quicksort.

Timsort is just a hybrid of natural mergesort + insertion sort. Scientifically and academically, it's nothing new. A lot of the complexities in Timsort is just impelementation details.
Answer: TimSort is a highly optimized mergesort, it is stable and faster than old mergesort.
when comparing with quicksort, it has two advantages:

It is unbelievably fast for nearly sorted data sequence (including reverse sorted data);
The worst case is still O(N*LOG(N)).

To be honest, I don't think #1 is a advantage, but it did impress me.
Here are QuickSort's advantages

QuickSort is very very simple, even a highly tuned implementation, we can write down its pseduo codes within 20 lines;
QuickSort is fastest in most cases;
The memory consumption is LOG(N).

Currently, Java 7 SDK implements timsort and a new quicksort variant: i.e. Dual Pivot QuickSort.
If you need stable sort, try timsort, otherwise start with quicksort.
Comment: @EricDuminil Binary search is fast, but insertions in the middle of an array aren't. There are many applications where the simplest (and often most efficient) solution is to re-sort a mostly sorted list when you need it to be sorted, but to let it get unsorted otherwise. Or cases where you read in data that is mostly sorted, and then need to sort it. I'm not suggesting this is *always* the best solution, but that sometimes it is. And it is one reason why sorts that perform well on mostly sorted lists are preferable, particularly for standard libraries.
Comment: #1 *can* be a huge advantage. If you maintain a list of data that you must re-sort frequently (because items are inserted, appended, or modified), having an algorithm that allows you to very cheaply re-order that data is extremely useful. Whether it is useful depends on the situation, for sure, but it is huge in some cases and also feels obvious: nearly sorted lists shouldn't be hard to sort.
Comment: @JeremyWest: If you know that data is already sorted, you should use binary search to insert new values. Don't sort it again and again.
Comment: @JeremyWest: Thanks for the insightful answer.
Comment: @Jeremy: if it's mostly sorted, timsort is the algorithm of choice. But binary search + insertion is still O(N + logN), which should beat O(N logN).
Comment: @Groo Yes, if you are only inserting a single item into an already sorted list. That's not the only application I mentioned. Obviously, your mileage will vary depending on the problem you are solving.
Comment: If doing insertions for n items, binary search + insertion is O(N^2 + N logN) = O(N^2) while insert all and sort once is O(N + N logN) = O(N logN).
Answer: More or less, it has to do with the fact that Timsort is a hybrid sorting algorithm.  This means that while the two underlying sorts it uses (Mergesort and Insertion sort) are both worse than Quicksort for many kinds of data, Timsort only uses them when it is advantageous to do so.
On a slightly deeper level, as Patrick87 states, quicksort is a worst-case O(n2) algorithm.  Choosing a good pivot isn't hard, but guaranteeing an O(n log n) quicksort comes at the cost of generally slower sorting on average.
For more detail on Timsort, see this answer, and the linked blog post.  It basically assumes that most data is already partially sorted, and constructs "runs" of sorted data that allow for efficient merges using mergesort.
Answer: Generally speaking quicksort is best algorithm for primitive array. This is due to memory locality and cache.
JDK7 uses TimSort for Object array. Object array only holds object reference. The object itself is stored in Heap. To compare object, we need to read object from heap. This is like reading from one part of the heap for one object, then randomly reading object from another part of heap. There will be a lot of cache miss. I guess for this reason memory locality is not important any more. This is may be why JDK only uses TimSort for Object array instead if primitive array.
This is only my guess.
Comment: I assume that is one of the reasons why Timsort is Python's standard sorting algorithm, as everything is an object in Python.
Answer: Tim Sort is great if you need an order-preserving sort, or if you are sorting a complex array (comparing heap-based objects) rather than a primitive array. As mentioned by others, quicksort benefits significantly from the locality of data and processor caching for primitive arrays.
The fact that the worst case of quicksort is O(n^2) was raised.  Fortunately, you can achieve O(n log n) time worst-case with quicksort. The quicksort worst-case occurs when the pivot point is either the smallest or largest value such as when the pivot is the first or last element of an already sorted array.
We can achieve O(n log n) worst-case quicksort by setting the pivot at the median value.  Since finding the median value can be done in linear time O(n).  Since O(n) + O(n log n) = O(n log n), that becomes the worst-case time complexity.
In practice, however, most implementations find that a random pivot is sufficient so do not search for the median value.
Answer: Here are benchmark numbers from my machine (i7-6700 CPU, 3.4GHz, Ubuntu 16.04, gcc 5.4.0, parameters: SIZE=100000 and RUNS=3):
$ ./demo
Running tests
stdlib qsort time:                 12246.33 us per iteration
##quick sort time:                  5822.00 us per iteration
merge sort time:                    8244.33 us per iteration
...
##tim sort time:                    7695.33 us per iteration
in-place merge sort time:           6788.00 us per iteration
sqrt sort time:                     7289.33 us per iteration
...
grail sort dyn buffer sort time:    7856.67 us per iteration

The benchmark comes from Swenson's sort project in which he as implemented several sorting algorithms in C. Presumably, his implementations are good enough to be representative, but I haven't investigated them.
So you really can't tell. Benchmark numbers only stay relevant for at most two years and then you have to repeat them. Possibly, timsort beat qsort waaay back in 2011 when the question was asked, but the times have changed. Or qsort was always the fastest, but timsort beat it on non-random data. Or Swenson's code isn't so good and a better programmer would turn the tide in timsort's favor. Or perhaps I suck and didn't use the right CFLAGS when compiling the code. Or... You get the point.
Comment: I would add that the purpose of Timsort was never to beat Quicksort, but rather to be a fast [stable sort](https://en.wikipedia.org/wiki/Category:Stable_sorts) (Quicksort is not stable) that minimizes comparisons (which are slow in Python). It should, however, beat Quicksort when the data is sorted, or almost sorted. ([see also](https://hg.python.org/cpython/file/tip/Objects/listsort.txt))
Comment: Timsort's performance is  dependent on the kind of data being sorted: it is slowest on random data and fastest on sorted data. Strange, then, that this answer and the project readme say nothing about the nature of the data. So I looked at the code and noticed that the data is random. (Quicksort by contrast has consistent speed in most cases, except in specially-crafted adversarial cases and in cases where the quicksort algorithm is implemented badly - e.g. always taking the first or last element as the pivot is a big no-no).
Comment: @Qwertie: TimSort's handling of already (partially) sorted data was also important given that Python does not have an obvious way to merge sorted data, and the non-obvious way (`heapq.merge`) isn't all that efficient (large parts of it are implemented in Python, not C). So the common way to merge already sorted data, or add unsorted data to sorted data is to just do: `sortedlist += newdata; sortedlist.sort()` (or one-lined, `sortedlist = sorted(sortedlist + newdata)`). This would be really inefficient if TimSort didn't use the existing ordering.
Comment: Do you know of any benchmarks in which Timsort is the fastest? I'm opposed to all claims of performance that does not come with benchmark numbers. :) Good point on the Swenson benchmark using randomized data -- I didn't check it very closely.
Answer: Timsort is a popular hybrid sorting algorithm designed in 2002 by Tim Peters. It is a combination of insertion sort and merge sort. It is developed to perform well on various kinds of real world data sets. It is a fast, stable and adaptive sorting technique with average and worst-case performance of O(n log n).
How Timsort works

First of all, the input array is split into sub-arrays/blocks known as Run.
A simple Insertion Sort is used to sort each Run.
Merge Sort is used to merge the sorted Runs into a single array.

Advantages of Timsort

It performs better on nearly ordered data.
It is well-suited to dealing with real-world data.

Quicksort is a highly useful and efficient sorting algorithm that divides a large array of data into smaller ones and it is based on the concept of Divide and Conquer. Tony Hoare designed this sorting algorithm in 1959 with average performance of O(n log n).
How Quicksort works

Pick any element as the pivot.
Divide the array into partitions based on pivots.
Recursively apply quick sort to the left partition.
Recursively apply quick sort to the right partition.

Advantages of Quicksort

It performs better on random data as compared to Timsort.
It is useful when there is limited space availability.
It is the better suited for large data sets.


IP management throug Airport Extreme

Question: When I am traveling I need to be able to connect me to the office and get the same IP address as I have in the office. Would it be possible to configure this with an Airport Extreme and if so how?
I understand that Airport Extreme can not act as a VPN server. If that's what I need - is there some recommendation on a simple VPN server that is reliable?
Regards
Oscar
Answer: The Airport Extreme (or Express or Time Capsule) don't have any VPN functionalities. I mean, apart from opening a port to let you access a VPN in your home network.
So, you will need some sort of server inside your home network. Mac OS has a VPN server but it doesn't have the most friendly interface (if it has an interface at all). Once upon a time I used iVPN (http://macserve.org.uk) to help me configure it. Otherwise, Apple Server also has a graphical interface. Todd Olthoff has a great series of videos on how to set up your VPN (and Apple Server): https://www.youtube.com/watch?v=GjrcmsMHwPI

IP management throug Airport Extreme


How to customize the layout of login page in joomla

Question: Just want change the layout of the login page same as other pages, I want to remove the left sidebar bar and show the main menu, few images and text. You can see the current layout.
Visit http://www.egovtsolutions.net/index.php/component/users/?view=login
Answer: You can make the menu module display on all pages rather than on selected pages...then the menu will be displayed on all pages.
Answer: You have to choose display option from that module. If you want to enable some modules in that position just check the menus names from that module.
If you don't want any module in login page just unselect all modules from that page. Then only you have better look for login prompt as your wish.
Try this....
Answer: I dont know which version of joomla are you working on. But this link covers from joomla 1.5 to 1.7.
You should try to give the "extra2" or "position-29" to your log in module.
The key is just the position you are assigning.


How do you delete individual texts from a message conversation in iOS 8?

Question: I have downloaded ios8 and I am struggling to delete individual texts from a message conversation. When I open a message and highlight a text bubble, "more" still appears, but when I tick the box, the trash can to delete is missing. The only option given is to click "Delete All". It seems that you have to delete the whole conversation, rather than have the option to select the texts you want to keep/delete within it. Am I missing something? Please advise.
Comment: As soon as you tap More, that bottom bar should be replaced by the trash & share buttons. Have you tried restarting the phone?
Comment: Bottom left of screen, for me. Delete All is top left.
Comment: There is nothing in the bottom left of my screen other than the camera icon....the bottom line shows camera, message box and send button. Top line is delete all and cancel. The screen will not swipe up, down , left or right.....
Answer: Press and hold the message to delete, a menu will pop-up with the options "Copy" and "More". Tap "More".

The message you selected is marked with a checkmark on the left. You can check more or delete all by tapping "Delete All" on the top left.

Tap the trash after selecting the message to be deleted. A confirmation will appear. Press "Delete Message".

The message is gone. Just blurry messages are left.
Answer: "As soon as you tap More, that bottom bar should be replaced by the trash & share buttons."
If this doesn't appear, you can attempt pressing the home button twice to get to the task manager which will let you kill the Messages app, reopen the app, go to the message you want to nuke, press more and the trash button should now appear at the bottom
Alternatively, try restarting.


How to write good alt text for images to help screen reader and blind user to understand what is picture about?

Question: How to write good alt text for images to help screen reader and blind user to understand what is picture about ? and if we are using Alt text then what should be in a Title="text" if we are using both in special cases like menu images etc
Comment: This might be a handy article: https://www.sitelint.com/blog/best-practices-for-writing-good-alt-text/
Answer: I'm a screen reader user and will use Stack Overflow as an example of both the good and bad.
Alt tags should be brief and descriptive. For example, Stack Overflow's alt tags for the vote up and vote down options are nice since they don't take long to read and get to the point quickly. Examples of bad alt tags are the make this question a favorite and accept this answer. Neither of the tags are descriptive, the favorite tag is just "*" and the accept the answer tag is "check" The only way for me to tell what they are is to read the source or have someone sighted let me know what they are for.
As far as title attributes go I don't really have much advice. My screen reader doesn't read them by default so I don't normally use them. An example of something that could be useful is additional information. For example the reason my accepted answer rate is so low is because I have no way of telling whether I have accepted an answer on a question. It would be nice if the title attribute on the accept this answer graphic would say something like "click to accept this answer" if the answer wasn't accepted and "Click to remove this answer as the accepted answer" if it is the accepted answer.
Answer: You should not make the visually impaired user understand what the image is all about. For the blind, the image effectively doesn't exist, all that there is is the text.
The alt text should work as a single sentence/paragraph that can be replaced for the image, convey the same content and still make sense in the context of the adjacent content.
If the image is something that is part of the GUI, then the alt text should convey an action (a verb), line upvote, answer this or log out.
You should visit your site with links and try to understand your site. If there is for example a pie chart, its alt text should be a small summary of the percentages. If you just have a pretty flower next to a blog post, don't give it an innane alt text like flower image companion of blogpost #324 or even worse flower.jpg.
If the image is important to the navigation or to get information, try to give it an alt text that makes the site work without the image. If the image is only presentational, give it an empty alt text.
title, as far as I know, should only displayed when hovered, so they should give extra information to the image, so useless duplication of information should be avoided. For screen readers, this is a bit trickier, as support and configuration can be very different between users.
Some empirical data shows title as useless:

Most users of screen reading software do not change their default settings to access the TITLE attribute information on links.
Most screen reading software can access TITLE attribute content on form controls by default.
Some screen reading software cannot access TITLE attribute information.
Users of screen magnifiers can read TITLE attribute text at lower magnification levels.
Users of screen magnifiers cannot read TITLE attribute text, that contains more than 1 or 2 words, at higher magnification levels.

Here's good piece of advice, better put than I could

Use this to provide additional information that is not essential. Most visual browsers display title text as a tool tip when the element is hovered over, however it is up to the browser manufacturer to decide how the title text is rendered. Some will display the text in the status bar instead. Early versions of Safari did this, for instance.
One good use of the title attribute is to add descriptive text to links, especially if the link text itself doesn't clearly describe the link's destination. This way you can help visitors know where the link will take them, possible saving them from loading a page only to find out it wasn't anything they're interested in. Another potential use is to provide additional information for an image, like maybe a date or other information that is likely not essential.

Remember that the longdesc attribute is supposed to be a link to further information, not text as some people missuse it.
Comment: If there is alt text the immage does exist. FOr example I can vote up and down on stackoverflow even though it's an immage not a link.
Comment: @Jared: I'm trying to say that you should feel like the page was made with text only, and not that you are missing out anything with such things as `` or `` that don't give you anything more than more text to hear.
Answer: I think the best practise is to put same content in alt and title attributes.
Regarding 'what to write' - just simple, in few words what is on the picture.
Check this article where alt attributes are described pretty well: http://www.cs.tut.fi/~jkorpela/html/alt.html
Comment: First thing alt and title are attributes not Tag, second, If we will put same content in alt and title then screen reader will repeat same content twice. which makes no sense
Comment: Fair point, attribute, not tag.
Depends on the screen reader you use you can set which attribute to read anyway.


Get link to a comment

Question: Today, I was trying to share a comment posted on a question in the chat. But, there was no option for that. Hopefully, by a workaround I got the link to the comment. But, it would be nice if there is dedicated option for that.
Answer: You can acquire a link to a comment on a question or answer by clicking on the time/date of the comment.
For example here is a link to a comment on this question that I have acquired by right clicking on the "1 minute ago":
Link to a comment
Comment: @Santa it is slightly surprising behaviour,  although I can't really think of annother place to put it
Comment: Never knew time/date are clickable
Comment: Yes, No one can suppose date/time can be used for this purpose

Get link to a comment


Is it possible to use Greasemonkey to hack a website?

Question: Yesterday my WordPress website got hacked. I thought I had done all necessary things to make it secure. One of my colleagues said that with Greasemonkey we can easily hack sites. Is it true? How can I protect my site secure against it?
Answer: GreaseMonkey (or Tampermonkey for Chrome) is a browser addon that allows you to inject custom JavaScript code in the browser on the client side. You have little to no control over it.
The good news is that none of these changes will affect the contents on the server side, or the contents for other users. So if you rely on the server for your validation/verification/signing in/e.t.c., then you have nothing to worry about. If, however, you rely on the client-side code to provide input validation and other kinds of restrictions, then you have deeper problems than GreaseMonkey. Almost all modern browsers contain features to allow the modification of client-side contents, they're mostly called Developer Tools.
My advice to you is to get a competent individual to assess the security situation of your website, and to help you protect it from future attacks.
Answer: Reading your question and the related description, I can only say that I disagree with your colleagues "Greasemonkey" theory. Greasemonkey only allows client-side javascripts to be run (to modify the client-side behavior of websites or to automate some things). Yet, client-side javascript can't corrupt your server-side directly. The only thing I could think of what Greasemonkey could be usefull for, is brute-forcing login forms. That's about it.
Potential Attack Vectors

What most probably is the origin of your "was hacked" problem, is the use of insecure passwords and - what can be even worse - the use of the login-name "admin", because that leaves only one guess open for a hacker... the password. If the hacker needs to guess both the name AND the password, he'll lose time and resources and most probably also interest in trying to hack your site.
Therefore a tip you should embrace: good login-names and login-passwords are at least 8 characters long, and should include a combination of letters, numbers, and punctuation characters (like dots, brackets, dashes, etc.).
In case you missed the news: most recently there was a wide-spread brute-force attack on wordpress-based websites which targetted the wp_login.php file (your login form). Many sites got hacked that way and I can imagine your webiste was one of them (although I can not be sure without taking a look at the server access logs).
The issue was so wide-spread that it even got a dedicated page at the wordpress website ([http://codex.wordpress.org/Brute_Force_Attacks][1]) where they posted some potential fixes to the problem. You might want to check that page for further information.
If it wasn't your login form, check your wordpress plugins.
It wouldn't be the first time that a wordpress plugin introduces a major
security hole that enables even the dumbest script-kid to compromise
your wordpress install. Just remember (or search for) that
"timthumb" security disaster that made the wordpress community run
in circles a good while ago. Yet, I personally suspect that you've become a victim of the recent brute-force attack mentioned in #1.

Last but not least, let me echo the advice given by @Adnan:

My advice to you is to get a competent individual to assess the security situation of your website, and to help you protect it from future attacks.

If you don't know "what" happened, you can't prevent it from happening again. In case you don't know everything about securing a website and server, time has now come to hire a professional...
Answer: There's a few things to consider. With Greasemonkey (GM), users (client-side) need to accept the installation of a GM script or write a GM script themselves. Since, the client user has full access to any page the server can download (with that user's authorizations and authentication), the GM script can modify this content or use the content in combination with other pages from the same server or other unrelated servers to present the web page data in any way desired. An example would be a real estate site (RES) that has sale homes' details and pictures on different pages. The RES pages can be acquired with a GM script and put together as one page. Furthermore, the square footage (or square meters) or tax information can be pulled from the Assessor's website and mashed together as one page with the RES info. Alone, this is not sinister. However, if you've blocked right click or have block protected content on your page, a clever script writer may be able to bypass the protections (as is possible by simply adjusting the elements in the HTML via developer tools).
Here's where there can be some more issues. A lot of websites do not protect their assets and APIs very well. By leaving permissions open to more assets, the script writer may be able to reverse engineer the page's scripts and pull more assets. With the APIs, this is another story. By not restricting APIs on the site, a GM script can make extra requests to the APIs. For example, say the username was part of an API. The script could change the hard-coded username and put another username in the script that would pull the info of someone else. Maybe the site sells some sort of service for searching and the user can only do a search by geographical locations or interests but not both. If the API is not properly locked down, this search can be extended to both with a GM script.
As for brute force attacks, one browser alone is probably not a great army. If the desire is to make attacks or even hit the site many times to try passwords, there are many other tools that are suitable for attacking.
So is Greasemonkey a cracker's tool? Yes, but it only allows the client to see what is already there due to bad website security. If there is a GM script installed without a current user's knowledge, the script can spy on current user's actions by trapping passwords or other information from pages that are familiar to the script.
Again, the advice given by @Adnan:

My advice to you is to get a competent individual to assess the
  security situation of your website, and to help you protect it from
  future attacks.
Comment: It's important to note that none of these threats (for the scenarios you've presented that even qualify as threats in the first place) are specific to GreaseMonkey.
Comment: Duly noted. Except ... Greasemonkey can be used to expose  poorly designed APIs to get at protected data ... a server weakness. GM script are available to bypass blocks on content saving. If these scenarios do not qualify, perhaps the definition of security is tighter than I think. I refer to the original question, can GM be used to hack sites? The answer is still yes. There are lots of tools that are better for other sorts of attacks, but at least GM provides some nice help with thinks like cookies and avoiding cross site scripting. Comments were informational not for debate or discredit.
Comment: Per the book XSS Attacks: Cross Site Scripting and Attacks - http://x3n0n.com/wp-content/uploads/2014/02/cross_site_scripting_attacks_xss_exploits_and_defense_tqw__darksiderg.pdf it's stated: GreaseMonkey is so powerful that you can write exploits as user scripts and call them when needed. Let's have a look on the following example, which detects Wordpress 2.0.6 blogs and asks you to run the
wp-trackback.php SQL Injection exploit against them ... In previous sections of this book we discussed how to use GreaseMonkey as an attack tool.


how to do 3rd party endorsement

Question: I have received a check from the US department of treasury and I'd like to endorse it over to my daughter.  On the back of the check where I endorse it above it has pretyped message from department.  How and where do I need to endorse this check over to her so that she can deposit it?
Thank you.
Comment: There may be an answer here: https://money.stackexchange.com/questions/48399/are-there-special-endorsement-requirements-for-us-government-checks-to-two-parti
Comment: I don't know all the ins and outs of US checks, but it _may_ depend on what the pre-typed message says. Perhaps [edit] the question to include it (blanking any personal info, if present).
Comment: A google search for "3rd party endorsement of tax refund" turns up some hits of varying quality.

A search on Money.SE also seems to have some more info - https://money.stackexchange.com/search?q=%5Bcheck%5D+%5Bunited-states%5D+endorsement

I hope this helps. I do not have an exact answer though.
Comment: My answer below ignores the "pretyped message" you mention. If you can edit your question and tell us what that message is, I will edit my answer if there is any substantial change.
Answer: The standard method for a third party endorsement is to write three lines in the endorsement area as follows:

Pay to the order of:
Jane Doe
Steve Eisenberg

Where Jane is the name of the person you want to sign the check over to, and Steve is your signature, matching the way your name is spelled on the front of the check as usual.
The rules governing endorsement of treasury checks do not explicitly mention third party endorsements. That said, there is an important caveat to keep in mind - as with any check, the bank that Jane tries to deposit the check at is essentially given the latitude to decide whether or not they will accept the check, and whether or not there are any special requirements or procedures for accepting the check. For instance, some institutions will require Steve and Jane to both be present when the check is handed over, and to make the third party endorsement live, in the presence of bank staff. They may also want to see Steve's ID as part of the process, especially if he does not have any account or relationship with this particular bank (and hence they don't have a sample of his signature to compare the endorsement to). Other institutions will just happily take the check without batting an eyelid, and others still may simply tell you they won't accept it if it's been endorsed as you intend to. So, to get the literal answer to your question, you'll need to ask at the institution Jane intends to cash or deposit it at.
And on that note, many institutions pay extra attention to Treasury checks, and may be nervous about taking a third party endorsed Treasury check or any other Treasury check that seems suspicious. This is thanks in part to the above-mentioned rules governing Treasury checks - while the Fed has specific and fairly restrictive requirements for issuing banks being allowed to return (reject) checks, the rules that apply to Treasury-issued checks are much more lenient in terms of allowing the Treasury to decide they're not going to accept a check. This means the bank you try to cash or deposit the check at takes on more risk for a Treasury check compared to a check issued by any other bank, so they may be more careful with Treasury checks compared to others.

how to do 3rd party endorsement


Why Binary language is used as a first language for the Computer Systems not a high level Language?

Question: --> why computers not used high level language as a first Language what are the main reasons?
Answer: In (very) short : Because basically a computer is composed of multiple electronic devices that consistently switch between two states (see transistors). For a human, this can be idealized by a state 0 or a state 1 from which the binary is derived. This is the core language, close to processor instructions, only then appears low-level languages and high level languages that provide more abstraction level.


Jenkins plugins installation giving SHA-256 mismatch error

Question: I started a fresh container from jenkinsci/blueocean docker image in my Ubuntu 16.04 LTS server. Container started fine and I am able to see Jenkins console perfectly. When I am trying to install any plugin which isnt bundled with this image it is giving SHA-256 mismatch error like below:-
java.io.IOException: Downloaded file /var/jenkins_home/plugins/build-pipeline-plugin.jpi.tmp does not match expected SHA-256, expected 'Ci0bq1rxqEDWF1RklJvBZANp75727gH13+5cFr5HDbs=', actual 'c0qvGjbwCXYFueMfd77NFvIfRPG21Dxt4OxbZ+Gc/7c='
at hudson.model.UpdateCenter.throwVerificationFailure(UpdateCenter.java:1902)
at hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:1934)
at hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:2104)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1237)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1755)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2015)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1726)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:112)
at java.lang.Thread.run(Thread.java:748)

This is happening with all the plugins I am trying to install or update. I googled about it but couldn't get anything constructive.
I also installed Jenkins as standalone in the server but I am getting the same error again, which seems that it could be related to my server itself.
I was thinking to install plugins as well while the container is built through the Blue Ocean or Jenkins official image to make everything go as a code, but it seems I'll end up with the same issue.
Can someone help me to resolve it or find an alternative way to install plugins?
Comment: Same error. Solved by restarting docker container.
Comment: anyone got the solution? I am stuck with this error too. please share your workaround.
Answer: Go to the JenkinsHome\plugins\ delete the problem file along side the plugin itself, in your case build-pipeline-plugin then reinstall the plugin either via upload (jenkins UI -> manage -> pluginManager ->advanced -> Deploy Plugin -> deploy) or via normal search and install on the UI.


How to remove Windows Sticky Notes from start up with boot

Question: I want to prevent windows sticky notes from starting with Windows. I don't use those anymore, but couldn't find where to remove them from boot.
Comment: Did you find any solution? Please post.
Answer: I struggled hard to uninstall it, couldn't, but then, hey! it's maybe  not necessary to do so.  StickyNotes will always start if it is pinned to the taskbar even if you disabled it in msconfig Startup and MS will not let you uninstall it.  I left it on the taskbar because I actually use it, I just don't want it starting and filling the desktop with unnecessary stuff every morning.  After all that angst I just unpinned it from taskbar, disabled it in configsys Startup list and, because I actually need those notes sometimes I placed a shortcut on the desktop (NOT in the task bar).  Now it does not start on start-up and it is still there when it's needed.  Please MS, put a "Run on start-up" option on it and all will be fine.
Answer: You can delete this entry from the registry:
<code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
RESTART_STICKY_NOTES
</code>
Or, try to delete this file C:\Windows\system32\StikyNot.exe (make a backup first).
Another option would be to disable the sidebar (Windows Gadget Platform). See a tutorial here: http://www.howtogeek.com/howto/3255/disable-sidebar-desktop-gadgets-on-windows-7/
Comment: I don't want to disable the sidebar since I still use other gadgets, but I'll try the registry option. Thanks!
Comment: Strange, my system doen't have that Key, it has one related to the sidebar though. I'm on Windows 7 Professional, does it make a difference?
Comment: I don't think so, it shouldn't.
Comment: too bad, all I see on that path is a key related to the sidebar itself.
Answer: Perhaps rather than remove, you would prefer instead to reduce the desktop-space taken by the sticky notes.
The freeware Sticky Notes Taskbar Hider does :

Sticky Notes Taskbar Hider allows you
  to recover that lost taskbar space
  used by the awesome Windows 7 Sticky
  Notes feature.
With complete functionality like
  launching on system startup, hotkeys,
  along with the super easy usability
  Sticky Notes Taskbar Hider can make
  your use of Sticky Notes a hell of a
  lot easier.
Sticky Notes Taskbar Hider allows you
  to easily from hotkeys, or via the
  system tray icon, show or hide the
  Sticky Notes item from the taskbar.
  Other hotkeys allow you to launch
  Sticky Notes and also bring Sticky
  Notes to focus.
Comment: so... you add a new icon on the taskbar that all it does is remove another program? How does that recover any space on the taskbar?
Comment: anyway, I was interested in removing the sticky notes from the boot process, since I don't use it anyway.
Answer: I have found a very easy fix for this problem. Simply "x" out Sticky Notes from the task bar at the bottom of the screen. It will now NOT load on start-up. You DID NOT delete your data. When you want to access your notes again, simply click on the Start button on the lower left of your screen and type in "sticky notes". Click on the icon when it appears and... voila!  Your notes are back and the icon is back at the bottom in the task bar. While in that task bar, it will load on start-up, just like before. When I am finish using the sticky notes I simply "x" them out again from the task bar and life is good again.
Answer: On Windows 10, every time I tried to use the control panel to remove the program I got an error message saying I could not remove the Stickynote program because it was running (even though I had closed all of the start up windows and all of the note pages). Then I discovered on the bottom right hand corner the little Stickynote in my task bar, I right clicked it and I used the EXIT option and that icon disappeared, I then went back into the control panel to remove it and it  successfully removed the program. I also did a restart to make sure it was completely gone.
To briefly explain:
1. Quit any instances of the program
2. Uninstall it via the control panel


new-WindowsImage stalls with 0x8007007E, can't load unattend.dll

Question: I'm trying to convert capture a .VHDX as a .WIM file. The file in question is a syspreped Windows 7 generalized image.

I'm working on Windows 8.1 and I have the Windows ADK installed.
In powershell I issue the command. New-WindowsImafe -capturepath e:\ -name Windows7Image -ImagePath d:\wim\windows7.wim -description "Windows 7 Image"
The process begins to run but it ends with the following error:

new-windowsimage : Unable to load DLL 'unattend.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
At line:1 char:1
+ new-windowsimage -capturepath e:\ -name windws7Image -ImagePath D:\wim\windows7. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : NotSpecified: (:) [New-WindowsImage], DllNotFoundException
   + FullyQualifiedErrorId : System.DllNotFoundException,Microsoft.Dism.Commands.NewWindowsImageCommand

When I go to the image path I can confirm that the process has started. Not sure why it's trying to load unattend.dll. I am assuming it's not needed for this operation.
Comment: A workaround is here, using imagex: http://serverfault.com/questions/607398/how-do-i-convert-a-vhd-to-a-wim-file
Answer: Of course, 30 minutes after trying a bounty for the first time, I realized what we were both doing wrong. This is the message you get if you run from Powershell (x86) on a 64-bit windows. It works fine from the non-x86 Powershell. For good measure, you need to run as admin as well.


Where did my followers go in Fable 3?

Question: After I beat the darkness, I noticed that the only people that are left are me and the citizens of Bowerstone. What happened to all of my followers like Paige and the others?
Answer: Problem is, once the story is over, the game is pretty much over. All that's left is open world roaming. So basically; they're gone. Disappeared like they never were.
Comment: But the didn't just disappear because the were there during Walters funeral
Comment: that's technically still part of the story
Comment: Oh, well that stinks... Anyway thanks for the answer
Comment: Glad I could help, sorry it wasn't what you were looking for

Where did my followers go in Fable 3?


Uniqueness of curve of minimal length in a closed $X\subset \mathbb R^2$

Question: Suppose $X$ is a simply connected closed subset of $\mathbb R^2$. Let $a,b$ belong to $X$. Is it true that there is at most one curve inside $X$ from $a$ to $b$ such that the length of the curve is minimal?
Comment: @M.B.: It's required for existence. Let $X$ be the plane with the non-negative $x$-axis removed and consider the points $(0,1)$ and $(0,-1)$. You can get arbitrarily close to length 2 by deforming the line segment joining these to the left of the origin.
Comment: @XipanXiao And then? (The question assumes a closed region, btw.  And it is not asked for existence but for uniqueness in case of existence).
Comment: Sorry didn't notice it is "closed".
Comment: Can someone show me why closed is essential here?
Comment: @M.B. Might be it is not essential. The closedness might have something to do with the existence of curve of minimal length, not the uniqueness.
Comment: Sure, but the problem states "at most one".
Comment: The results of googling [ergodic curves](http://www.google.com/search?q=%22ergodic+curves%22) might be useful.
Comment: @M.B. If the curve is not a straight line in the neighbourhood of a given point, it will touch the boundary in points where it is not. If the region is not bounded this is not possible (existence is assumed to hold).
Comment: @M.B. (I meant if the region is not closed)
Comment: @Thomas: OK, but I cannot see why that it implies that the result is not true for open sets.
Comment: @MB It is, but it is rather easy to prove then -- you just have to prove the statement I just made, then you know each point is an interior point of $X$ and then you can easily see it must be a straight line.
Comment: @Thomas: OK, thanks. I agree.
Answer: The answer is yes. The idea is outlined in a previous answer. The rigorous proof is worked out  now.
Assume the contrary that there are two points $a, b\in X$ and two curves $\gamma_i :[0,1] \to X$ joining $a$ and $b$. Let $\gamma_i :[0,1] \to X$.
Claim one: We can WLOG assume that the two curves do not intersect.
Proof: Consider the set
$$ \gamma_1^{-1} \big( \gamma_2[0,1]\big)  \subset [0,1]\ .$$
This is a closed set in $[0,1]$. We assume that this set is not the whole $[0,1]$ (or the image of $\gamma_1$ lies completely in $\gamma_2$). Thus the complement is open and contains an open interval $(t_1, t_2)$. We restrict $\gamma_1$ to $[t_1, t_2]$, (and also restrict the domain of $\gamma_2$ to the portion that connects $\gamma_1(t_1)$ and $\gamma_1(t_2)$).
Call both restrictions $\alpha_1$ and $\alpha_2$ and renaming $a = \gamma_1(t_1)$ and $b = \gamma_1(t_2)$. Note that this two curves are still length minimizing (If not, then there is a shorter paths joining these two points, which means that the original curves $\gamma_i$ are also not length minimizing).
As a result, we come up with two points $a, b\in X$ connected by two non-intersecting length minimizing curves. Thus claim one is proved.
Now the circle $C$ formed by first going along $\gamma_1$ and then $\gamma_2$ is a simple closed curve. Thus the Jordan curve theorem states that $\gamma_1 \cup \gamma_2$ bounds a bounded open set $\Omega$ such that $\partial \Omega = \gamma_1 \cup \gamma_2$.
Claim two: $\Omega \subset X$.
Proof: Assume the contrary that there is a point $x\in \Omega$ such that $x\notin X$. By translation we assume $x=0$ Consider the inclusion map
$$\iota : X \to \mathbb R^2 \setminus \{0\}$$
Now as $0 \in \Omega$ and $\Omega$ is bounded by $C$. So any ray starting at $0$ will hit some points in $C$. This implies that $\iota_*[C]$ represents a nontrivial element in $\pi_1(\mathbb R^2 \setminus \{0\})$. But this is impossible as $X$ is simply connected, $\iota_*[C]=0$. This contradiction implies that $x\in X$. Thus $\Omega \subset X$.
Now what remains is elementary geometry.
First, by some rotation assume that $a, b$ are in the $y$-axis. Let $L$ be a line parallel to the $y$-axis which touches $\bar \Omega$ at $c$ and not at $a, b$ (Such a $c$ can be found: Let $L$ comes from the left from $-\infty$, if it touches at $a, b$, then instead let $L$ comes from the right to find $c$) WLOG assume $c$ is in $\gamma_1$.
Let $B$ be a small closed ball around $c$ which does not contain $\gamma_2$. Moves the line $L$ towards $\Omega$ a little bit to form the line $L'$. Consider a conneced component
$$J \subset L' \cap \bar\Omega \cap B$$
$J$ is a line segment in $\Omega$ such that the boundary points are in $\gamma_1$ (as $B$ does not contains $\gamma_2$). Thus $\gamma_1$ cannot be length minimizing, as the line segment $J$ is length minimizing. This contradictions implies that there cannot be more than one length minimizing curves joining two points.
Just to note that even for a path connected closed subset in $\mathbb R^2$ there might not be any curve with finite length joining two points.
Comment: This looks fine to me. While there is one fine point I'd do a bit differently, the approach does give the desired result. Nice.


Backing out after expressing initial interest in a reading course

Question: I am a first year math PhD student in the US. I was initially interested in the work of a professor and I contacted him to ask for the possibility of a reading course. We didn't make any concrete arrangements because he was on sabbatical for the spring (and summer) semester and he simply asked me to follow up closer to the fall semester. In the meantime, I had a reading course with another (math) professor in a different and not closely related field and my interest shifted. I think I would prefer to spend more time exploring that field instead. Is it bad etiquette to back out now and tell the first professor that I would prefer not to proceed with the reading course with him?
Answer: This is fine etiquette, particularly letting them know as soon as you're certain just in case they were thinking of pulling together materials. If you're worried about being particularly polite, you can avoid mentioned that your interests have shifted and simply say that something else innocuous as long as it is true, e.g. that after the last semester you've reassessed your work load and don't think that a reading course fits any more.


Opencv divide a contour in two sections

Question: I have a contour in Opencv with a convexity defect (the one in red) and I want to cut that contour in two parts, horizontally traversing that point, is there anyway to do it, so I just get the contour marked in yellow?
Image describing the problem
Comment: Does your image always have exactly one convex region? Can you show other examples?
Comment: Draw black line just as on your right image and find contours again.
Comment: @Miki It has more convex regions, it is actually a hand, what I just want is to remove the fingers, it doesn't have to be perfect, so picking the convex with the biggest Y Coordinate and the right depth will give me the point I'm interested in.
Comment: @AndreySmorodov Interesting observation, I will try that.
Comment: Have a look at [this answer](http://stackoverflow.com/a/35252058/5008845). Once you remove convexity defects, you should have your result
Answer: That's an interesting question. There are some solutions based on how the concavity points are distributed in your image.
1) If such points does not occur at the bottom of the contour (like your simple example). Then here is a pseudo-code.

Find convex hull C of the image I.
Subtract I from C, that will give you the concavity areas (like the black triangle between two white triangles in your example).
The point with the minimum y value in that area gives you the horizontal line to cut.

2) If such points can occur anywhere, you need a more intelligent algorithm which has cut lines that are not constrained by only being horizontal (because the min-y point of that difference will be the min-y of the image). You can find the "inner-most" corner points, and connect them to each other. You can recursively cut the remainder in y-,x+,y+,x- directions. It really depends on the specs of your input.

Opencv divide a contour in two sections


Getting output in flat file using oracle on UNIX

Question: How to get the output of a query into a flat file using Oracle on UNIX?
For example:
I have a TEST table; I want to get the content of the TEST table into a flat file and then store the output in some other folder in .txt format.
Answer: See Creating a Flat File in the SQL*Plus User's Guide and Reference.
Comment: +1 (I might add that LINESIZE may need to be set to a larger value to avoid line wrap, with TRIMSPOOL on trailing blanks will be removed from each line, i sometimes use column formatting directives)
Answer: in the oracle SQLplus terminal you could type
spool ;
run your query
spool off;
Now the  would contain the results of the query.
In fact it would contain all the output to the terminal since the execution of the spool command till spool off.
Answer: If you have access to directories on the database server, and authority to create "Directory" objects in Oracle, then you have lots of options.
For example, you can use the UTL_FILE package (part of the PL/SQL built-ins) to read or write files at the operating system level.
Or use the "external table" functionality to define objects that look like single tables to Oracle but are actually flat files at the OS level. Well documented in the Oracle docs.
Also, for one-time tasks, most of the tools for working SQL and PL/SQL provide facilities for moving data to and from the database. In the Windows environment, Toad's good at that. So is Oracle's free SQLDeveloper, which runs on many platforms. You wouldn't want to use those for a process that runs every day, but they're fine for single moves. I've generally found these easier to use than SQL*Plus spooling, but that's a primitive version of the same functionality.


ArcGIS Android Offline Map Tiles - User Credentials

Question: I'm developing an app using the ArcGIS Runtime SDK for Android.  I'm accessing tiled basemaps from arcgis.com using the following code which works fine.
UserCredentials creds = new UserCredentials();
creds.setUserToken("token", "referer");
String mapUrlUsaTopo = "https://services.arcgisonline.com/arcgis/rest/services/USA_Topo_Maps/MapServer";
mBasemapLayer = new ArcGISTiledMapServiceLayer(mapUrlUsaTopo, creds);

But... when I attempt to download the map tiles for offline use I get the following error:

com.esri.core.io.EsriSecurityException: Message: Unable to generate token. Details: 'username' must be specified., 'password' must be specified.

Here's the download code:
String tileUrlUsaTopo = "https://tiledbasemaps.arcgis.com/arcgis/rest/services/USA_Topo_Maps/MapServer";
final ExportTileCacheTask exportTileCacheTask = new ExportTileCacheTask(tileUrlUsaTopo, creds);

Is the only option hard coding the username and password?
Answer: Andrew from Esri support was very helpful.  To do "application" authentication (without a user name and password) using your app id and secret key you need something like the code below.  However, there is a bug (BUG-000092420) in the android sdk and the code below does not work at the present time.  I'm being told that the fix may make in into the Quartz final release.
private class AppLoginTask extends AsyncTask<Void, Void, Void> {
    @Override
    protected Void doInBackground(Void... params) {
        Log.d("MyApp", "AppLoginTask");
        Portal p = new Portal("https://www.arcgis.com", null);

        try {
            p.doOAuthAppAuthenticate(APP_SECRET, APP_ID, new CallbackListener<Portal>() {
                @Override
                public void onCallback(Portal portal) {
                    Log.d("MyApp", "login callback");
                    //mCreds = new UserCredentials();
                    mCreds = portal.getCredentials();
                    setMapDataMode(MapDataMode.ONLINE);
                }
                @Override
                public void onError(Throwable throwable) {
                    Log.e("MyApp", "login error");
                }

            });
        } catch (Exception e) {
            Log.d("MyApp", "login exception");
            e.printStackTrace();
        }
        return null;
    }

    @Override
    protected void onPostExecute(Void results) {
        Log.d("MyApp", "login post execute");
        //setMapDataMode(MapDataMode.ONLINE);
    }

}


Formulae created in Excel not working in OpenOffice

Question: I am trying to open some Microsoft Office files in which there are formulae which are apparently copy pasted and therefore can be separated from the written rest. The problem is, these formulae don't seem to exist with OpenOffice, any suggestions?
Comment: Which functions are you having problems with?
Answer: I had the same problem. Specifically, my issues were due to sum.product not being supported (or well supported) by openoffice. Please note this was Spanish version, but I guess it might happen in some others, too... I changed to LibreOffice and everything is going fine now.


I have trouble understanding why two different capacitors should have the same amount of charge on each side of a circuit

Question: There is a rhombus with four different capacitors. There's a voltage between the point $a$ and the point $b$, but there is no voltage between the point $c$ and the point $d$. Apparently, assuming that there is no excess of charges in the circuit, the capacitors on the left side have the same charge, and the same holds for the right side. I have trouble understanding why the charges should be equal on each side.
Answer: It is true, only if the capacitors have capacitance values that are symmetric ( $C_1 = C_2$ and $C_3 = C_4$ ). Else is not true. You can do the computation using the formula of a series of capacitors $1/C_{tot} = 1/C_1 + 1/C_2 +...+ 1/C_n$ (here $n = 2$). You can compute the charge by the well known relationship $Q = C \times V$.
Answer: You should have trouble with it. It isn't true. For example, suppose
$$C_3 = 2C_1$$
$$C_2 = 10C_1$$
$$C_4 = 20 C_1$$
You will find that
$$V_{ac} = V_{ad}$$
But
$$Q_{right} = 10 Q_{left}$$
Answer: In the above circuit $C_1$ and $C_3$ are in series and also parallel to series capacitors: $C_3$ and $C_4$. There is a voltage potential between $a$ and $b$, but none between $c$ and $d$. Capacitors in series have the same charge, and the charge on the left and right sides is the same.
For the series capacitors:
$$left \ hand \ side \ \ \frac{1}{C_{s1}} = \frac{1}{C_1} + \frac{1}{C_3} = \frac{C_3 + C_1}{C_1 C_3}$$
$$right \ hand \ side \ \ \frac{1}{C_{s2}} = \frac{1}{C_2} + \frac{1}{C_4} = \frac{C_4 + C_2}{C_2 C_4}$$
We add the capacitance on left and right sides that are in parallel. I.e. capacitance is added, because the charges are added but the voltage is the same:
$$C_p = C_{s1} + C_{s2}$$
Therefore, for the whole system:
$$Q_{tot} = C \times V = (C_{s1} + C_{s2}) \times V $$
But the charges on the left and right hand sides are the same, therefore, $C_{s1}$ and $C_{s2}$ must be the same. So, $C_1 = C_2$ and $C_3 = C_4$, or even, $C_1 = C_2 = C_3 = C_4$.
I.e. $Q_{rightside} = C_{s1} V = Q_{leftside} = C_{s2} V $


Storing documents using Ruby On Rails

Question: I would like users of my ruby on rails app to be able to upload documents (Word Documents, Spreadsheets, PDFs, etc). What is the best way of doing this?
Answer: I've used file_column, attachment_fu, and paperclip.  I've also had to dive into the source on all three plugins.
Without a doubt, I recommend paperclip above the others.  The source is easier to read and understand.  Its easier to extend.  It doesn't do extraneous file copies.
Go with paperclip and let us know if you have any questions.
Answer: "Best" depends on your exact needs, but have a look at PaperClip. It's a pretty easy way to integrate files with ActiveRecord.
Answer: I agree that Paperclip is the best solution currently available.
If you decide to use Paperclip, you might want to take a look at this question which discusses how to display thumbnails for non-image types (.doc, .xls etc).
Set path for original images using paperclip in Rails?

Storing documents using Ruby On Rails


Recommended time for global entry interview on arrival?

Question: Is there a minimum time that should be planned to allow a global entry interview on arrival?  I'm arriving in IAH, but I have a domestic connection 1h50m after scheduled arrival time that goes to my final destination.  I can't find any real guidance as to what is recommended.  It's also a little hard for me to get out to the airport for an interview in general, so I'm also a little leery of paying the $100 and not being able to complete the process for several months.
Comment: When is your trip? You can't do enrollment on arrival until you're conditionally approved, and it can take quite a while to get to that point these days, though it seems to vary person-to-person. If you're counting on doing the interview on arrival after you arrive in IAH and haven't applied yet, that could be an issue unless your trip is far enough in the future.
Comment: @ZachLipton for purposes of this question, lets pretend I'm already conditionally approved and my (scheduled) interview is in 4 months.  I realize there are other steps that need to be passed before one is eligible to do interview on arrival, but I'm just looking for one particular point about which I can't seem to find almost any information about...
Comment: Perfect. I just didn't want you to spend the $100 counting on the timing to work if you weren't aware of the wait.
Comment: @ZachLipton for those playing the home game, my time from payment to conditional approval was approximately 2 business hours.  I will update this question next month when I return from the trip.
Comment: Wow. Mine just took months, and that was a renewal. Awesome!
Answer: Actual data point. Off the jet bridge at 2:20, in line for global entry interview at 2:27, finished with interview at 2:40. There was one person in the middle of their interview when I arrived at the special interview booth, which for my particular arrival I guess was on the other "side" of the arrivals hall. I guess every airport has a different layout. This is probably highly variable, but it probably helps to hustle off the plane, etc.
Answer: When I arrived in New York JFK and wanted to do the interview on arrival, the officer told me the wait time would be around 1 hour, until another officer would be available who could do the interview. This was in February 2019, right after the end of the shutdown. So with barely 2 hours connection time, I would ask them how long it would take, but I would prepare for not being able to complete the interview in such a time window.
But another point that sounds strange to me: usually the EoA counters are in the section where international flights arrive. So you need to complete the regular immigration process anyway.
Answer: Luckily IAH is on of the airports that have Global Entry On Arrival (https://www.fly2houston.com/newsroom/articles/cbp-launches-global-entry-enrollment-arrival/ ) You would do your immigration checkin and global entry interview at the same time. No appointment is needed.
Just find the signs for Global Entry Upon Arrival near the manned immigration stations.
Otherwise, I've found that at the regular Global Entry Offices if you have a tight schedule, you can tell the officer when you checkin and they try their best to accommodate you.


How do I stop a Genymotion virtual device?

Question: This seems like a strange question to ask, so maybe it is a bug, (and I have no problem starting these virtual devices), but then I notice for each new start of an Android project in Eclipse, I have to recreate these Genymotion VDs. So I end up having duplicates in my Device Manager. I go to try to delete them in the VD Manager and it says, "stop the device before deleting it".. which is weird because there is no stop button. And nothing in settings. Anyone know how to stop it? Thanks.
Answer: Do it from the VirtualBox manager:
Comment: Is there some setting to have that happen whenever the X at the top right hand corner is pushed?
Comment: This helped me but I didn't close the emulator cause it was not running, apparently! So I had to remove it from the VM Box and recreate in Genymotion.
Comment: your answer helped me after 5 years :)
Comment: How to automate this process?
Comment: @ÁlvaroAgüero If you were able to turn off sleepingMode on VB that would solve the problem dramatically
Answer: Since the virtualbox monitor does not always offer a shutdown option, you could also log in into the android device and type halt.
adb shell
then type halt at the prompt.
Comment: This is safer than going to VirtualBox and "hard" shutting down. You can also use `adb reboot` to reboot the device instead.
Answer: Try Looking in task manager and ending the "Adb" processes if they exist
Comment: Thanks, that might have worked, but now it mysteriously is stopping the emulator when I close it. Even though it didn't do that before. >_< This emulator has so many bugs, I might not be able to really use it.
Comment: Thats odd, i have not got the slightest idea
Answer: if you are connected to an android vm with the genymotion frontend, try to press the power-down button (right low corner) and keep pressing it until the shutdown menu appears.
It appears that the genymotiond frontend (player.exe) does not close automaticly after shutdown. Just close it when it's displayed image freezes.... (this is not valid if started directly from virtual box, since genymotions device control buttons are not available then)
Answer: I ran into a similar issue where the Virtual Device would crash, and I wouldn't be able to start the device from the summary Genymotion Device Manager (which I accessed from Intellij).
I had to start the main device manager, which wouldn't let me delete or access settings, and warned that I needed to quit the virtual device. I just double clicked to start the device again and it seemed to fix whatever was hung up, and I was able to use the virtual device again, or close it if need be.
Answer:
@me.yay: It appears that the genymotiond frontend (player.exe) does not close automaticly after shutdown. Just close it when it's displayed image freezes

Realize this is an old thread, but I just had this issue tonight.  Been using Genymotion for a couple years, so don't know why this is happening now.  The emulator works fine, but when I stop the device via long hold on Power button (thanks me.yay), the VM stops (as seen in VirtualBox manager) but Genymotion hangs on "Power Off Shutting down..." After I close the emulator, I then get a popup from Windows saying "application terminated in an unusual way" from Microsoft C runtime.
Genymotion 3.0.2.


Nodeman not refreshing with Docker

Question: I'm trying to figure why Nodemon is not restarting from within docker when passing in an environment variable.  It worked previously when I was not trying pass in an env variable and instead in my Dockerfile the final command was CMD ["npm", "run", "devNoClient"]
I can see Nodemon launching in the terminal but doesn't restart the server when I update a file.
Makefile

node_dev:
    echo 'Starting Node dev server in Docker Container'
    docker build -t node_dev .
    docker run -it --env-file variables.env -p 8080:8080 node_dev

Dockerfile

WORKDIR /chord-app
# copy package.json into the container
COPY package.json /chord-app/
# install dependencies
RUN npm install
# Copy the current directory contents into the container at /chord-app
COPY . /chord-app/
# Make port 8080 available to the world outside this container
EXPOSE 8080
# Env is required to persist variable into built image.
# Docker run can now accept variable and it will be assigned here.
# default is run in dev mode
ENV run_mode_env=devNoClient
# Run the app when the container launches
# Due to variable, CMD syntax must change for this to work https://stackoverflow.com/a/40454758
CMD npm run $run_mode_env

package.json
"scripts": {
  "devNoClient": "nodemon --exec babel-node src/server/start.js",
},

Answer: I realized it was not working because I don't have any binding volumes to my local machine when starting my docker image.  So the container does not what files on my machine to watch for saves so it can restart the server with nodemon.

Nodeman not refreshing with Docker


No Back/Forward Button with JQuery ScrollTo

Question: I've made a nice page with links that scroll the window to a specific section.  I really like this feature, but it creates an annoyance if you click the links too many times - the back button is clogged with all of the hashtag changes.  I was wondering if it's possible to scroll the page without creating a url for the browser 'back' button to hook on to.
Answer: Afaik if you just use   $("#id").scrollTo(); it does not cause url changes.
Assuming you are using the scrollTo plugin....