What are the minimum permissions to show the Craft debug toolbar?

Question: To help validate a process is in place, we would like to allow a tester to login and view the Craft debug toolbar to see the logs.  Currently, we have given the tester Admin, but we would like to only provide the minimum permissions to view the toolbar.  Is this possible?
Answer: The debug toolbar is available to Admin users only, see https://craftcms.com/features/all#debug-toolbar
There's no way of customising this, the line of code that enforces it can be seen at https://github.com/craftcms/cms/blob/a859f09df6d90bfa92ca1818418eab508c0e82df/src/web/Application.php#L405


Normalisation of quantum states: why?

Question: We all learn that quantum states need to be normalized, as they are associated to probabilities which needs to sum up to one. However, I would like to know whether you have other valid reasons to motivate this normalisation. Do you have examples in which non-normalized states give rise to paradoxical situations, except for probabilities larger than one? One scenario could be the case of nonlinear Schrödinger equations (e.g. Gross-Pitaevskii equation) non-normalized wave functions clearly give rise to different results.
Comment: My understanding of this is that since measurement projects onto a subspace, the magnitude of the vector before projection is irrelevant. The normalisation to 1 is I think just a convention.
Answer: There is no particular reason to normalize a quantum state if you just define, say an expectation value of some observable $A$, as
$$ \langle A \rangle := \frac{\left\langle \psi | A \psi \right\rangle}{\left\langle \psi | \psi \right\rangle}. $$
This is actually often done. It is just a simplification and therefore a sensible convention to set $\langle \psi | \psi \rangle = 1$.
Also, the Schrödinger equation is linear in the variable $\psi$, so if we take as initial value $c \times \psi$, with $c \in \mathbb{C}$, the solution will also just be multiplied by $c$ and nothing physical changes.
To say something about non-linear equations like the Gross-Pitaevskii equation, it is correct that you would have to correct the interaction term in this equation by a factor of $1/c$ to care for the different normalization.
Answer:
Do you have examples in which non-normalized states give rise to paradoxical situations, except for probabilities larger than one?

I don't, but perhaps the following will help.
If $\psi$ is not normalized but is normalizable, there is actually no issue - all functionals of $\psi$ can be modified to account for the lack of normalization - just normalize in the functional formula.
However, if $\psi$ is not normalizable for some region $\Omega$, it means one cannot use the Born rule
$$
\frac{\int_{x\in \omega} |\psi(x) |^2 dx}{\int_{x\in\Omega} |\psi(x)|^2dx} = \text{probability particle is in }\omega,
$$
because the denominator integral does not exist or is infinite, so one either has to adopt some different meaning for $\psi$, or one decides such $\psi$ is not admissible as far as the Born meaning is used. For example, if $\Omega$ is the whole infinite space,
$$
\psi(x) = e^{ipx/\hbar}
$$
is not normalizable, so it is not applicable as a Bornian description of the system in that space. However, if we choose $\Omega$ to be a finite volume, say a box, the above psi function becomes normalizable and is admissible. So the normalizability depends just as much on the configuration space region as on the function itself.
On the other hand, if we have something like the Dirac delta distribution
$$
\psi(x) = \delta(x-x_0)
$$
this is not normalizable in the sense of the Born rule at all. It can be used as initial condition for the Schr. equation, but the resulting solution $G(x,t)$ is not a realistic psi function for the whole infinite space. It has other uses - it is the Green function of the Schr. equation for the whole infinite space.
Answer: Consider a classical scattering problem: you project, say, N particles per second at a target and you count the number of particles scattered in a solid angle $d\Omega$: $dN\propto N$ so the ratio $dN/N$ is always smaller than 1. Reported to one particle, it is its probability to be scattered into $d\Omega$.
Now, in QM one observes superpositions of states of scattered particles. It implies linearity of their equation, kind of a wave equation. The wave equation solution must be normalized in order to obtain the value of calculated $dN$ without ambiguity. The rest is similar to the classical case: for one particle you have the corresponding probability, but the equation of motion must admit superposition of amplitudes (solutions).
The third thing is that we always need many particles to have a reliable statistics and certain judgments, so in reality we count the number of particles (per second or the total number, whatever). Thus the probability is only a part of the whole picture, which implies many-many particles involved in order to cover all corners of the wavy picture. Neither in classical nor in quantum physics one-particle "experiment" is sufficient.

Normalisation of quantum states: why?


Can an individual invest in stocks outside his country?

Question: Can I can invest in New York Stock Exchange from Pakistan? What are the pros and cons?
Comment: As a canadian, I once bought Nintendo actions (in Japan). I had to deal with a broker who had a licence in Japan to be able to buy and sell there. Cons : It will cost you bigger brokers fees since they charge you for being in another country. Pro : If you believe in the company you're investing in, (like I did with Nintendo), then it may be worth.
Comment: This would really be a question for the Law site, since it depends on the laws of individual countries.  For US citizens, it's easy (trivially, just buy international stock mutual funds); for North Koreans (who are not part of the ruling junta) probably impossible.
Answer: This question is best answered by your brokerage firm. Institutional investors do overseas investing all the time. However, for individuals restrictions and additional taxes may apply. First and foremost, your brokerage firm should have some agreement worked out with New York Stock Exhchange and both the governments involved.
Hence, some brokers will allow while others not.


What's the use of Lucid Memory Artifacts in Tyranny of King Washington?

Question: I've found a (my first) memory artifact in Assassin's Creed 3 Tyranny of King George (episode 1). I've pressed the "interact" button and a picture appeared; nothing else. The symbol did not disappear from the map. Is that supposed to happen? Can I collect all 3 of them in this episode (The Infamy)?
Answer: Collecting all three is required to achieve 100% synchronization in the Frontier. There are three in the first episode, and they only appear on your map once you get close to them. As well, once you collect all three, a new red assassin icon appears on your map clear off to the Southeast of the Frontier.
I can only imagine that all this will lead up to something with other lucid memories in the future episodes of The Tyranny of King Washington. So I guess you'll just have to wait and see what the big surprise is.
Comment: I've found all three of them. The red icon just shows you a short video of Corner and Washington.
Comment: @JasperdeVries: Like I said,I assume there will be more in the other episodes that will pull it all together. :)
Comment: Spoiler alert!

>! Resumed playing it after a while. Got them all now and nothing extra happens.


How to add Shrink-wrap bone constraint to a child bone?

Question:
As you can see in the image, I added the constraint to the child bone and that should prevent it from going below the plane. But it seems that the parent bone overrides the constraint and moving it may put the child bone under the plane. How can I solve this?
Comment: What behavior do you expect? The ShrinkWrap bone constraint locks the bone to the surface. So the child should push up or rotates its parent? What is the purpose?
Comment: @Blunder Yes, it should push up, rotate, or at least limit the animation (movements) of its parent so that the child doesn't go below the plane. The purpose is to prevent the feet from going below the ground in case of a character animation or similar applications.
Answer: There's more than one potential reason for this, but here's what I suspect, because it's probably the most frequent reason.  I can't tell you with more certainty than that without a file to look at.
Here, we've got a bone, with a shrinkwrap constraint, but it's not shrinkwrapping:

Why?  Look at the other properties viewport, on the bone tab, in the relations subsection.  It's grayed out here, because it's uneditable while in pose mode, but this bone has the "connected" property enabled.  This basically anchors the head of the bone to the tail of the bone-- the constrained bone cannot shrinkwrap, because it cannot move, and so the constraint does nothing.
How to fix?  Enter edit mode, select the constrained bone, and alt p -> disconnnect bone.  (Or, uncheck that "connected" box in properties/bone/relations.)  Now the bone can leave its parent's tail to shrinkwrap to our plane:


JSON for corpora

Question: Do you know any cases of corpus linguistics tools or corpora, using JSON to "mark" or delimited linguistics units in morphology, syntax,semantics? It seems all marking systems use some kind of XML or derivative to mark text. I would like to know if there is an initiative using JSON instead.
Answer: I have seen a lot of corpora and corpus tools, but none using JSON. The only alternative to an XML based format is plain text coming in two flavours

vertical format: One token per line with annotations separated by TABs
inline format: plain text with annotations appended to each token like this: plain/ADJ text/NOUN with/PREP ... (the seperating character may vary, and there can be more than one layer of annotation)
Comment: There is also the [text-fabric](https://github.com/DANS-Labs/text-fabric/) format, which is similar to the vertical format but uses separate files for each column, which makes it easier to combine different data sets.
Answer: There are several promising new developments where JSON is being used to provide improved modern data formats for computational linguistics, NLP, and corpus research.
There is an extensive project under way to create a JSON framework for linguistic fieldwork resources, including lexicon, texts, etc:
Hieber, Daniel W. (2018). Data Format for Digital Linguistics.
Check it out at https://format.digitallinguistics.io/
Or see the project on GitHub: https://github.com/digitallinguistics
Another useful source for JSON for syntax and semantics representations is:
Forbes, Angus G., Lee, Kristine, Hahn-Powell, Gus, Valenzuela-Escárcega, Marco A. & Surdeanu, Mihai (2018). Text Annotation Graphs: Annotating complex natural language phenomena. In Goggi, S. & Mazo, H. (Eds.), Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018). Miyazaki, Japan: European Language Resources Association (ELRA). https://www.aclweb.org/anthology/L18-1169
Information about this JSON approach is available from Angus Forbes' Creative Coding Lab on GitHub:
https://github.com/CreativeCodingLab/TextAnnotationGraphs
Ines Montani of Spacy makes an interesting proposal for a new approach to JSON formatting for linguistic data/NLP:
https://github.com/explosion/spaCy/issues/2928
Basic documentation for Spacy's (existing) JSON NLP format is here:
Spacy (2018). JSON input format for training.
https://spacy.io/api/annotation#json-input
Stanford NLP describes a JSON formatter:    https://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/pipeline/JSONOutputter.html
Finally, at the Rezonator project (https://github.com/johnwdubois/rezonator) we are working to create a JSON format for the 2nd edition of the Santa Barbara Corpus of Spoken American English (SBCSAE). This is work in progress; stay tuned.
Comment: Very interesting information. Thanks!!
Comment: I would love to hear your thoughts on any of these initiatives, based on how they meet (or not) your needs.

JSON for corpora


Checking user lifetime

Question: I want to add some data, when user just login and remove this data, when he logout by himself or by the end of lifetime.
Where is the script of checking lifetime situating?
Joomla 3.8
Comment: I'd suggest creating a plugin and using the `onUserAfterLogin` and `onUserLogout` events.
Comment: @Lodder I create new content plugin, add `onUserAfterLogin` method, but can't understand how it call and when. Never used plugins before. Maybe you can explain please?
Answer: Content plug-in does not have events for the user the events onUserAfterLogin you want to use can only be used in user, authentication or system plug-in try changing your plug-in to one of these types.
Each different type of plug-in are used for different situations like system plug-in can be used for all events, but as you are performing some task on user events I will suggest you use User plug-in. Also, go through the different types of plug-in and events related to them.
https://docs.joomla.org/Plugin/Events
Hope this helps.
Comment: I used native joomla authentification plugin. Thnx

Checking user lifetime


How to get current speaker output volume level in terminal?

Question: For example, I have an open browser with youtube or another program that plays audio and would like to get the current audio level as a number between 0-100%. To be more precise, I've seen answers with commands that showed the set audio level in the system, but I want to see the audio level that comes from applications that play audio.
Comment: Which audio system are you using? Alsa, pulse? If you don't know, telling us how you do set the volume might help find out how to read the current level.
Answer: If your system is using pulse audio, you can list the playing applications with pacmd
Here only firefox is playing, with a volume of 54%:
<code>hoov@hal:~$ pacmd list-sink-inputs
1 sink input(s) available.
    index: 4577
        driver: <protocol-native.c>
        flags: START_CORKED
        state: RUNNING
        sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
        volume: front-left: 35578 /  54% / -15,92 dB,   front-right: 35578 /  54% / -15,92 dB
                balance 0,00
        muted: no
        current latency: 89,62 ms
        requested latency: 75,00 ms
        sample spec: float32le 2ch 48000Hz
        channel map: front-left,front-right
                     Stereo
        resample method: speex-float-1
        module: 14
        client: 840 <Firefox>
        properties:
                media.name = "AudioStream"
                application.name = "Firefox"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "33"
                application.process.id = "11744"
                application.process.user = "gobuki"
                application.process.host = "morpheus"
                application.process.binary = "firefox"
                application.language = "en_US.UTF-8"
                window.x11.display = ":0"
                application.process.machine_id = "0f06bccf24c24ae5ba5d40c54b7d8f58"
                application.process.session_id = "2"
                application.icon_name = "firefox"
                module-stream-restore.id = "sink-input-by-application-name:Firefox"
</code>


Predicting a baseline response using ARIMA forecasts

Question: I have a modelling dilemma. I am creating a model that attempts to predict demand (leads not sales) based upon the correlation to advertising spend. We know that without advertising spend, demand is driven by seasonality. So our models include seasonal factors like month of the year and even day of the week.
If I were building a regular linear regression model, I would fit a linear regression model to a training dataset, to get estimates of the coefficients of the seasonal factors and advertising spend to demand. In order to get an estimate of future baseline demand, I would forecast demand using all the coefficients from the model and then I would estimate a baseline by setting adspend equal to zero.
For ARIMA models, there are additional factors such as AR and MA terms. Would I estimate my baseline the same way by just setting the coefficient on advertising spend equal to zero?
Thanks for any thoughts.
Answer: No. you have to deal with an issue called endogeneity. the problem is that your ad spend may depend on sales or leads. It's totally plausible to assume that when sales/leads were lower the ad spend next month was increased by your marketing folks. This is a nasty issue, and it can ruin your model. You have to figure out what to do with it before running any models of the sorts you described.
Answer: If you were forecasting where adv spends = 0 then as you suggested you would specify the future values as zero. Care should be taken when estimating coefficients that unusual values or level shifts be detected and remedies be incorporated otherwise you run the serious risk of having coefficients that are incorrect.


Printing up a line in java console (reverse of '\n')

Question: Foreword
I've seen some questions related to this in other languages and done quite some research on this. First, before we begin going down the rabbit hole, I must describe why I'm doing this. I'm pretty printing a binary tree and I found a way to do it that I don't think anyone else has found (can't find it anywhere on the web I've searched forever). It solves a lot of the problems related to spacing and conflicts and I'll probably provide it as an answer to prettyprint Btree questions later. Anyways, an essential part of doing the above is to be able to move the line feed (the cursor) one line up. I will also settle for moving the carriage return one line up.
I have made three EDITs to this question named "Edit 1-3" near the bottom.
My specific Windows version (might be relevant): Windows 10 v1607
OS build: 14393.2035
The problem??
The problem is that this is easily done with ANSI escape characters
ANSI escape codes: https://en.wikipedia.org/wiki/ANSI_escape_code
With "\033[A" being the specific code I want to implement (got it from a question about moving one line up in python).
The problem
So problem solved right? Oh no, not even close. The problem is, apparently windows had this """wonderful""" update that may have broke everything ANSI/console related. The below links to a question about this but with different ANSI requirements however the root problem is the same.
How to print color in console using System.out.println?
tl:dr It doesn't work for windows for some reason, you need a big library to do this or something else.
Sooo then I tried doing some in-depth research on the update itself and why this happens to be windows specific (of course) and I was led to this.
the root cause of windows problem: https://github.com/Microsoft/WSL/issues/1173
tl;dr:
Basically, the update changed a default setting for cmd.exe which is the default console that java uses. What changed was how the console setting for ANSI codes are processed for 'child applications' AKA java (stuff that uses the console but isn't console itself). The default Before the update was that child applications inherited the default of console which was to have ANSI enabled. NOW (because apparently, the previous default broke things) they changed it so that child applications DO NOT inherit the default settings from the console. This means java has to effectively set this console mode itself if java wants to have ANSI enabled. There are obviously a plethora of libraries for the java command to do that but of the good available ones, there are some issues. Firstly they require maven and I don't want maven, also I don't like NEEDING a million extra libraries to do something very simple and it adds to the number of things my code relies on (which is bad). So I'm trying to avoid simple solutions like "just use JANSI" to setConsoleMode for ANSI.
What I've tried after this
after I was done reading/understanding that I tried going into my Registry Editor and trying to change the default setting of the console (cmd.exe) to always enable ANSI even for child applications (AKA java). It had been suggested in the GitHub discussion but to my surprise the specific setting wasn't even there for me. (it was supposed to be in Computer -> HKEY_CUURENT_USER -> Console between "TrimLeadingZeros" and "WindowAlpha").
Try 2
Since I couldn't edit the console setting without big libraries full of things I don't want, I tried thinking outside the box and I messed around in java settings. I discovered where exactly java sets it's console and discovered that I could change that setting to use a different console in java. I had recently installed git and known that git bash was available so I tried that using the below question (and google in general) as a starting point.
https://superuser.com/questions/1196463/start-sh-exe-bash-with-given-path
Third time is the charm?
I couldn't get the darn thing to work. It didn't return any errors or do anything new, like at all. It was even set 'for the current project' so it should've done something different when I ran my project no? I believe part of the problem is that my root git folder is screwy (not in program files). This is probably because the computer I'm using is a work computer and maybe some setting there affects where git was installed, I don't know but what I do know is that when I changed consoles I tried this path:
C:\Users\abbotts1\AppData\Local\Programs\Git\bin\bash.exe
I also tried:
C:\Users\abbotts1\AppData\Local\Programs\Git\bash.exe
and
C:\Users\abbotts1\AppData\Local\Programs\Git\bin\sh.exe
and
"C:\Users\abbotts1\AppData\Local\Programs\Git\bin\sh.exe" --login -i
And after each change of console I tried this code:
public class ExpressionEvaluator {

    public static void main(String[] args) {
        System.out.println("1");
        System.out.println("\033[A");
        System.out.println("2");
    }
}

And I always got:

1
Extra Line here
2

As the output. If I removed the 'move cursor up' ANSI println statement attempt I got:

1
2

What I wanted was:

2
1

(the whole point being, I'm able to move up a line freely)
I've also tried making them print statements and that didn't work either.
So I'm now at wits end
So here is what I want, an answer something like:

A nonintrusive way to change the setting for cmd.exe to allow child applications like java to use ANSI BY DEFAULT when ran
OR a nonintrusive library that doesn't require maven and a million other things to enable ANSI so I can run the ANSI in java in the console and get my desired output
OR a programmatic workaround that allows me to effectively print one line up without this whole ANSI thing
OR help to configure IntelliJ console so that I can actually use a different console and use ANSI to print one line up

To address the obvious concerns
Since 1 and 4 are superuser questions and 2 is 'I need a library' and offtopic I'm more talking about point 3 here. If there is no workaround for this and the answer is one of the offtopic ones just tell me there is no workaround. I don't know how else to ask this question since it is a 'programming specific problem' it just has many solutions some of which are not 'on the topic' because they aren't programming solutions. If the only answer is 'the solution isn't on topic here' then I'll go ask in the appropriate place. Let me know if I should delete this question when I go to ask it somewhere else.
What I think might work for on topic part of this
Since 3 is on topic here I'll discuss what I'm thinking:
Maybe I could make some sort of system to print only to certain arrays instead of moving up and down lines (i.e. have an array to represent the lines, traverse the tree and instead of moving up and down lines, just switching the array to print to). I don't see this as very efficient and Its kind of a waste of arrays and processing power but if its a solution I'm willing to hear it. That's all I can 'think of' but most of what I've tried is trying to get ANSI to work.
For future reference:
what is the appropriate way to ask these questions with multiple off-topic solutions/ solution questions? Is it better just not to ask them at all? Do solutions that involve questions constitute a chameleon question? I don't feel like bringing the meta effect upon myself.
Edit 1: where I'm at so far:
I've tried the whole git bash thing again and boy was it a process. The actual git bash path in the terminal needs to be in quotes with the --login -I arguments coming afterward. Ex:

C:\Git\bin\sh.exe --login -i

This setting is for the java terminal. THEN you have to set a windows environment variable named PATH to your java JDK. Go to your path environment variables (there are a million and one youtube videos for that) and set a new variable named PATH to your JDK. Ex:

C:\Program Files\Java\jdk-10.0.1\bin

This question:
How can i make gitbash find the javac command?
Goes through that process extensively
Tl;dr You have to set a windows path variable this in order for git bash to recognize the javac and java commands.
Once that's done you need to actually run your java and javac commands like you would in any terminal. BTW be careful because paths in git bash require a two '\' notation instead of the normal '\' so your source directory path might look like this:

C:\IdeaProjects\Calculator\src\

Then you just run:

javac ClassName.java
java ClassName

BUT THEN it doesn't actually print the ANSI output, it prints the raw escape characters. Also, I found out I was using the WRONG escape sequence (I had the wrong number to represent the 'esc' button since the 'esc' key is represented as some number, but I had the wrong hex number I was using like x330 or something). I also learned that the notation is like this:

'esc key hex number' + '[' + 'parameter hex values separated by commas'

so this might look like:

\x1B [ A

where the actual letters and numbers are hex value stuff (without the obvious 0x...) and the first escape hex value has an x in it (why?). Anyways, when running them in Java as strings you need to escape the escape character (duh right?) with an extra '\' so, for example, the code might look like:
System.out.println("\\\x1B [A");

I just noticed that stack overflow escapes these too so I
  actually have three '\' but for you guys, it only displays two '\',
  weird right? Anyways back to what I was saying

BUT STILL, the output doesn't actually work! This is where I'm at. I've done the above and I 99.9% know git bash is installed right and runs fine but when I run this:
public class ExpressionEvaluator {
    public static void main(String[] args) {
        System.out.println("1");
        System.out.println("\\x1B [A");
        System.out.println("2");
    }
}

I get this in java console (not git bash??):

1
\x1B [A
2

and this in git bash:

1
\x1B [A
2

What I actually want is:

2
1

Because the ANSI escape character is supposed to move my cursor/linefeed/whatever, one line upwards. The same thing happens if I run the above code but instead use the ANSI code: "\x1B [F". Only raw ANSI is output. I'm pretty sure git bash was supposed to be 'natively ANSI aware' and I've seen people say that on websites so I don't know why it isn't working.
And I still don't know for sure if those are two separate console outputs or the same console output. I really can't tell so if anyone wants to leave a comment saying 'yeah its the same dummy', I'd appreciate it because I can't find a definitive source out on the web that it is. I think it is but nothing other than the console setting in IntelliJ indicates that as true.
I've heard rumors of a TERM variable that needs to be set or otherwise manipulated on windows. I've checked myself what it is using:

echo $TERM

in git bash and I got back:

cygwin

So I don't exactly know if that's good or bad because I've literally gone through all the search terms you can think of and they all lead to the same basic page of results for 'git bash colors not working' and most of them involve windows 7 (don't have it) installing maven/jansi (don't want or shouldn't need it) or some other language that isn't Java and using some other IDE which isn't IntelliJ. Some pages that do have my specific requirements have said something about TERM supposed to be xterm or some other thing like xterm-256 or something for 'color' output, something like this. I am so unfamiliar with this stuff so I don't even know where to begin.
Too long give us a tl;dr
I need to know why git bash is printing raw ANSI instead of actually using the ANSI.
what I know
I'm using git bash with IntelliJ, 99.9% sure I have my path set correctly, I am able to run my java class from git bash, I have it set as the IntelliJ terminal and I currently have the windows TERM variable set to cygwin.
What I don't know
I don't know what TERM needs to be and can't find it on the web, I can't tell if the IntelliJ console that appears when I click the green arrow 'run' is the same as the git bash console, and I can't figure out if some other thing is preventing me from actually interpreting the ANSI.
What I need
I need a simple explanation, something straight out of r/ELI5 of what is wrong with git bash if anything and how to fix it. If it can't be explained simply or nothing is wrong then maybe I'll try another supposedly 'natively ANSI aware' terminal. I think Powershell was another option that was listed. My best bet is that the TERM variable needs to be something else, or git bash was never really natively ANSI aware and capable, to begin with. I've seen other questions with the same problem for colors but their fixes are for older versions/different languages and things or they don't actually work. I have yet to find a good page for 'git bash outputs raw ANSI in IntelliJ' and I've used variations of those exact words for hours now. All I can get is long GitHub discussions on the 'bugs' related to this and they confuse me, don't lead to solutions, and may be active or just don't contain any resolution.
Edit 2
After doing some more research I've learned that my previous escape code was correct:

\033[A
\x1B[A

should be similar.
I also learned that it isn't the console I'm using that's the problem, its Windows itself. I now know this because I've tried compiling and running on cmd.exe , git bash and powershell. To change the default setting talked about earlier (consoles not supporting ansi for child applications) you have to EXPLICITLY enable it via the program itself rather than rely on a console or something.
link to a question that explains this in Python here:
How to use the new support for ANSI escape sequences in the Windows 10 console?
tl;dr
The method that they use is something called getConsoleMode and setConsoleMode and VIRTUALTERMINALPROCESSING flags. Apparently you need to use these to actually set the console mode to support ANSI. I don't currently know if those are things that are in java hidden somewhere or (likely) something that needs to be added to the base java libraries. I'm going to try and figure out how they actually get the ctypes thing from that question (seems to be what they're importing to sue these methods) and get the methods I need. Once I do I'll post that as an answer unless one of you figures it out before I do and can explain it better.
Apparently, the escape sequences work fine if you only use them from the console but If you use a "child application" then they don't work. So at the very least we now for sure know the root cause of the problem.
Edit 3
Found this which is highly relevant especially the console virtual terminal sequences section (lefthand navbar):
https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
This which, near the bottom has a whole C-implementation of how to enable the console to read ANSI. Apparently, this doesn't need libraries at all but the process to actually change the console defaults to use code like this requires sysadmin privileges, intimate knowledge of the program files and a whole host of other things (at least if you're before the windows 10 update when color support was changed). Now it's still disabled by default but can be enabled. I don't yet know how to try ANSI from the console directly. I've tried multiple

echo \x1B[(insert ANSI code here)

but none of the commands seem to work in ANY terminal (cmd, git bash, powershell). They just return the raw code
\x1B[(whatever the ANSI code was)
I obviously am new to the console so I might be using the wrong command, if so feel free to enlighten me but the examples I've seen use echo. ANYWAYS, I thought that calling the ANSI directly from terminal was supposed to work since its supposedly enabled by default just not child applications (post windows 10 update) BUT maybe its not, maybe its disabled by default and even when enabled its still disabled for child applications (Java) unless explicitly changed in said child application (java). I'm going to try to see if it's possible to enable ANSI directly from the console, or if the linked C-code needs to be directly ported to Java or ran in the console just to work. The problem is I don't know how to get the imports/includes that the C-code uses and use it for code in java. I'd rather not just accept a coded 'solution' in C and try and use that alongside java code, I'd rather translate, understand it better and have my own code that does the same thing.
Another option I've been told is something called ANSICON which is like some sort of plugin that you install in the console with the -i flag and that's supposed to enable ANSI at least in-console. I found this
https://community.liferay.com/blogs/-/blogs/enable-ansi-colors-in-windows-command-prompt
the above explains that process in a little more detail.
My specific windows version and the version of the update
Another thing I learned was that the specific version of windows 10 that the 'update' that changed ANSI console behavior was like windows 10 v1151 or something, I'll try and find the webpage to source this directly but I currently have windows 10 v1607 so I think I should be good. Included in that was the actual OS build which I have 14393.2035 and I think that was identified as a particularly intermediate update to this process in one of my previous links (I believe its the one with the whole GitHub discussion about the update, you can find it here: https://github.com/Microsoft/WSL/issues/1173). I have a work computer so I can't really make system updates because I'm not an administrator and I doubt IT would let an intern go around updating work computers.
Anyways, I'll continue on trying to see if I can get the C-code to java, I'll test it and then try and post an answer. If ya'll are ahead of me let me know.
Comment: @Redacted Why not just a `RandomAccess` `List` of `String`s or `StringBuilder`s where the indices are the line numbers and you can append to the lines or insert new lines as needed? There's essentially no guarantee that consoles will obey whatever special command code you use, and even if they do now there's no guarantee they will in future updates. I think @daniu s suggestion of formatting in memory then outputting is probably the way to go and it will save you a lot of headache.
Comment: Why not construct your final output before output to the console, and then print it all in one go?
Comment: You say that good available libraries "require Maven" but Maven is never a must, it's just recommended: you can always pull all needed depedencies by hand.
Comment: See thats what I was thinking but I want to use ANSI because it would be so much easier than how I would have to construct the final output (i think). I could make a hashmap of Strings with line numbers but the solution is more elegant with ANSI enabled
Comment: If it turns out there is no easy way to enable ANSI though thats probably what I'll end up doing but first I'd like to explore my options.
Comment: I could go and make a hashmap of strings, have the line numbers be appended to as I traverse the tree but here is the thing, do I really want to create a whole new memory structure and process all those string operations and table lookups just to print a tree? Its alot easier to print a character to console, think of a Really Big Binary tree. I know it Seems absurd but this ANSI stuff was meant to be a standard in the first place, just cause microsoft doesn't understand that doesn't mean we should abandon ANSI characters. Before I give up I want to know I've got no other option.
Comment: You obviously address a human, not a computer and you try to do so on windows. This begs the question, why are you living in the 90's?
Comment: My Git Bash, launched from Windows 7 start menu, inherits the JAVA_HOME variable from the Windows enviroment and can compile/run your test class without any special cfg.  But In Win7 no ANSI even within Git Bash console.
Comment: You can use JNI to run compiled C code from java. But I think that the plan where you first render the screen in memory to a char[][] array and then print the lines you've rendered is actually quite sensible and much more platform independent.
Comment: You are mixing your goal with a platform-specific concern. Your real question is: "In Windows the default console does not interpret ANSI, how can I enable this from Java?". Since this can only be achieved with platform-specific code, my answer points to JNA: a single-jar solution for invoking native functions which can achieve what you want.
Answer: The python way you reference in "Edit 2" (https://stackoverflow.com/a/36760881/309816) simply invokes Windows-specific native code (kernel32, which is non-portable) to "fix" this.
I suppose you are OK with that and want to do the same in Java (i.e. invoke kernel32 when you detect Windows)...
A very lightweight library for achieving the same in Java is JNA which has out-of-the-box wrapper for kernel32 (see: https://java-native-access.github.io/jna/4.2.1/com/sun/jna/platform/win32/Kernel32.html)
You seem to be after this method: https://java-native-access.github.io/jna/4.2.1/com/sun/jna/platform/win32/Wincon.html#SetConsoleMode-com.sun.jna.platform.win32.WinNT.HANDLE-int-
Hope this works for you.
EDIT: technically, you only need jna.jar (see getting started here: https://github.com/java-native-access/jna/blob/master/www/GettingStarted.md), but I would suggest you also use jna-platform.jar so that you don't need write the code that generates the mappings for kernel32 at runtime yourself.
Home for JNA: https://github.com/java-native-access/jna
I think adding 1 (or 2 if you add jna-platform) jars that have a very specific scope (doing native calls without all the JNI preparation overhead) is lightweight enough. You don't need to generate any headers, or change anything in your compilation process. It will just work by adding those jars to your classpath.
You should also clarify in your question that this is about Windows. Maybe edit the title to: "Printing up a line in java console (reverse of '\n') on Windows" as this is really about a platform-specific concern that you want to address with Java.


disabling ssh session expiration

Question: I am installed Ubuntu on Virtual Box, and use xshell (a remote terminal application) to ssh to ubuntu. when I hibernate computer during night, after powering it on, the session is expired and I should to ssh to ubuntu again. Is there is way to configure ssh to nut expire during hibernation or after hours of ideal connection? I use Fedora to, if configs have differences please mention it.
I use Windows 7.
Answer: Try tmux. On the server side:
sudo apt-get install tmux

After logging in, start tmux.
tmux

If the connection breaks, log in again via ssh and reconnect the tmux session. To discover the session number:
tmux ls

The output might be something like this:
0: 1 windows (created Wed Jan 9 12:27:40 2013)
Connect to the tmux numbered session like this:
tmux attach -t 0

Then you are right back where you left it.
Comment: Or GNU `screen`. Either don't leave `ssh` connected and instead use some detachable middleware, or use something other than plain `ssh`.
Answer: No. ssh is a TCP-based protocol with no support for "hibernation" or even for "roaming" (IP address changes). You will need something else if terminating the ssh connection before hibernating and connecting again when you resume is not desirable.
Perhaps give mosh ("the mobile shell") a try.
But, for short, no. TCP connections are closed on timeout, and ssh does not include any strategy to deal with that.
Comment: No. That could work to a certain extent, if you are connecting from the same address after resuming, but it always has a time, and you need to have access to both client and server to change the timeout (it's of no use to have a large timeout on your side if the server still has the default value). `keepalive` is to send "keepalive" messages to avoid cases where the connection is dropped due to inactivity. A basic requirement of this is that you must be on and connected to send the keepalive messages... those won't help you *at all* with hibernation.
Comment: But ssh has parameters `ConnectionTimeout` and remote terminal apps has `keepalive message interval` parameters. Cannot these parameters be used for this purpose?

disabling ssh session expiration


magit-diff jumps to insertion/deletion in already opened window (no overlay)

Question: I have 2 windows open: One is the magit-diff of the current repo, the other is just source codes from that repo. In source codes (the right window), I have a file opened, say "sample.txt". In magit-diff (the left window), I can see all of the deletion and insertion that occur for "sample.txt". In other words, it looks like this:
    | magit-diff                    | "sample.txt  |
    | modified sample.txt           |              |
    | + text I added                |              |
    | - text I removed              |              |

Now, if I press enter on the line "+ text I removed", then I would be taken straight to "sample.txt" at the exact line where the insertion/deletion happens.  The only problem is that this would open another buffer that overlays the current magit-diff buffer.  The original window for "sample.txt" does not change. In other words:
    | "sample.txt"                                    | "sample.txt" |
    | cursor at line of inseration/deletion           |              |
    |                                                 |              |
    |                                                 |              |

I do not want this to happen.  What I want is once I press enter in magit-diff, I would like the other window (the right window with "sample.txt" already opened) to jump to the line of insertion/deletion. If "sample.txt" is not already opened yet, then just open the file in another window. In other words, after pressing enter:
    | magit-diff                    | "sample.txt"                                     |
    | modified sample.txt           |  cursor at line of insertion/deletion            |
    | + text I added                |                                                  |
    | - text I removed              |                                                  |

Is there a way to do this within emacs? Please let me know and thank you for your help.
Answer: The option magit-display-buffer allows you to control in great detail how buffers are displayed.


Would concentration of a compound in equilibrium increase even if it's not favored by a volume decrease?

Question: So say I have a reaction where there are x moles of gas on the reactant side, and y moles of gas on the product side, where x>y. The volume decreases, favoring the products side. The textbook I am using says that the equilibrium concentration of the reactants would decrease, but wouldn't it end up increasing due to the lowered volume?
Answer: Suppose you have the following generic reaction:
$\ce{xA_{(g)} <=> yB_{(g)}}$
With the condition, $x > y$. The reaction quotient, written in terms of concentration would be:
$Q = \frac{(\frac{n_B}{V})^y}{(\frac{n_A}{V})^x}$
Where $n_A$ and $n_B$ are moles of the respective species and $V$ is volume. With some algebraic manipulation, this can be rewritten as follows (note here I'm explicitly treating $Q$ as dimensionless, q.v., the relevant Wikipedia page on equilibrium constant units, which applies to the reaction quotient as well):
$Q = \frac{n_B^y}{n_A^x} \cdot V^{x-y}$
Written in that form, it should be apparent that, if $x > y$, then $x - y > 0$, and therefore $Q$, the ratio of products to reactants, varies directly with $V$. In other words, as volume grows, $Q$ grows, and as volume decreases, $Q$ decreases. Suppose that, prior to some volume change, the reaction is at equilibrium, i.e., $Q = K$. If volume instantaneously begins to increase, $Q$ becomes instantaneously greater than $K$, and therefore the rate of the reverse reaction becomes greater than the rate of the forward reaction, favoring generation of $A$ until equilibrium is reestablished. Conversely, if volume instantaneously begins to decrease, the opposite happens and production of $B$ is favored. This is precisely what one would expect based on an intuitive understanding of Le Chatelier's principle: if volume decreases, equilibrium shifts to favor production of fewer moles of gas to counteract the increasing pressure; if volume increases, equilibrium shifts to favor production of more moles of gas to counteract the decrease in pressure.
Edit: I misread part of your question initially. In short, if the volume decreases, generation of product $B$ becomes favored, so the concentration of reactant $A$ must decrease relative to $B$ (since $x$ moles of $A$ are consumed in the production of $y$ moles of $B$, and the reaction quotient approaches the equilibrium constant over time).
Just to clarify this further, it's true that, in an absolute sense, if volume decreases in an instantaneous fashion, then the concentrations of the reactant and product, considered separately, would both have to increase. However, in relative terms, the concentration of $B$ must increase relative to $A$ as the reaction proceeds. The ratio between the two must grow to compensate for the diminished volume, otherwise $Q$ will remain perpetually smaller than $K$, when in fact $Q$ always converges to $K$, for a given set of conditions, over time.
Comment: Yeah, I knew that relatively [A] would have to decrease with respect to [B], but I wasn't sure if absolutely they would both increase or not. My book only asks "Which of the following is increased by decreasing the volume of the reaction system", and then lists "Equilibrium concentration of reactants" as one of the options, so it reads as if it means absolutely, but the answer says that it meant relatively. I guess it's just a case of bad book writing (seeing as it's an SAT review book, I wouldn't expect the greatest quality though). Thank you for your response.


HTML Sanitizer for .NET

Question: I'm starting a project that will be public facing using asp.net mvc. I know there are about a billion php, python, and ruby html sanitizers out there, but does anyone have some pointers to anything good in .net? What are your experiences with what is out there? I know stackoverflow is a site done in asp.net that allows freeform HTML, what does it use?
Comment: Does this answer your question? [How to use C# to sanitize input on an html page?](https://stackoverflow.com/questions/188870/how-to-use-c-sharp-to-sanitize-input-on-an-html-page)
Answer: HtmlSanitizer
Source: https://github.com/mganss/HtmlSanitizer
A fairly robust sanitizer. It understands and can clean inline styles, but doesn't have a parser that can deal with

HTML Sanitizer for .NET


How to make WebStorm resolve modules which are functions?

Question: WebStorm does a very good job of resolving functions which are returned from CommonJS modules as methods (and reads JsDoc associated with them), like for instance:
// utils/valid.js
/**
 * Returns true no matter what.
 * @param {HTMLElement} element
 * @return {boolean}
 */
function isValid(element) {
    return true;
}
module.exports.isValid = isValid; // exports property

Such a function is then correctly provided in code completion and inline documentation mechanisms when such a module is required in another file.
// main.js
var isValid = require('./utils/isValid').isValid; // works well

However, this fails when the function is returned directly as module exports
// utils/valid.js
module.exports = isValid; // exports object is a function

So when such a module is required, WebStorm seems to not know what it is:
// main.js
var isValid = require('./utils/isValid'); // doesn't work

This is very common in our project and changing all module.exports to plain objects is not an option. Is there any way for fix this issue in WebStorm?
Comment: I added a few more lines in the samples, however how I actually use the module is not related to the issue - the main point is that eg. pressing Ctrl+Q should display inline documentation for the module regardless of the way which was used to define it https://www.jetbrains.com/webstorm/help/viewing-inline-documentation.html
Comment: how do you use it? Please provide the complete sample
Comment: I agree with Paul S, how he uses it isn't related to the issue. I too am having this problem, did you get any further with it Paul?
Comment: Unfortunately not. However, my opinion on this is that although the above is technically correct, it's architecturally defective. The split of modules is too fine-grained, but also regardless of granularity it's better to stick to the convention of returning a plain object with methods (even if it's just a single method).
Answer: Create a macro to switch between the two semantic forms:

References

Using Macros in the Editor - Help | WebStorm
Komodo Edit autocompletion JS object literal


Standard notation or name for the measure defined by an integral over a function

Question: Let $(\Omega,\mathcal{F},\mu)$ be a measure space. For a measurable function $f \geq 0$ one can define a measure $\nu$ by
$$
\nu(M) : = \int_M f d \mu = \int_{\Omega} f \mathbb{1}_{M} d \mu
$$
for $M \in \mathcal{F}$. Is there a standard notation/name for the measure $\nu$? I think I saw something like $f \odot \mu$ but I am not sure.
Comment: Universal notation: $$d\nu=f\cdot d\mu$$ (One can be surprised by the suggestions made in the answers below.)
Comment: I think it was induced measure, but I am not sure.
Comment: Ok, thank you for this comment.
Answer: The name given to a map from a function to some field (usually the reals) obtained by using that function in some sort of operator is a functional (or sometimes a functor).
The notation often uses square brackets, as in $\nu_M[f]$. The branch of math this often appears in is the calculus of variations.
Comment: I came across with this in the Radon–Nikodym theorem. So you suggest writing $\mu_M[f] = \int_M f d\mu$? Do you have a reference for this? I would prefer a measure-theory or probability-related book.
Answer: I have seen it used in the form $f\odot \mu$ in probability theory, of course for the measure that is absolutely continuous with respect to $\mu$ with Radon-Nikodym derivative $f$. But it is not a very nice notation, since it misses the right form $d\mu$.
It is common (without using your notation!) in calculus of variations (Young measures), ergodic theory (equilibrium measures), multifractal analysis (Gibbs measures), delay equations (bounded variation functions and Riemann-Stieltjes), etc. But I recall no notation being used that could be widely accepted.
Comment: I don't like $f \odot \mu$, since this reminds me more of a product than an integral.
Comment: I also don't. I would suggest simply $\mu_f$. Perhaps it is not common but it is the simplest possible! PS: I have seen it written (in Bowen's little book) as $f\mu$. Not nice either.
Comment: I like your suggestion $\mu_f$ most since it is short, simple and just indicates $\mu_f$ is a measure depending on $\mu$ and $f$. I think also $\mu(f) = \int_{X} f d\mu$ is quite common and with your suggested notation we would have $\mu(f) = \mu_f(X)$. Now that you mention it, I think I saw $f\mu$ to notate e.g. densities with respect to a measure. But again the notation is not the best.


use lodash to find substring from array of strings

Question: I'm learning lodash. Is it possible to use lodash to find a substring in an array of strings?
    var myArray = [
    'I like oranges and apples',
    'I hate banana and grapes',
    'I find mango ok',
    'another array item about fruit'
    ]

is it possible to confirm if the word 'oranges' is in my array?
I've tried _.includes, _.some, _.indexOf but they all failed as they look at the full string, not a substring
Comment: Could you join the array into a string and use indexOf?
Answer: You can easily construct an iteratee for some() using lodash's higher-order functions. For example:
_.some(myArray, _.unary(_.partialRight(_.includes, 'orange')));

The unary() function ensures that only one argument is passed to the callback. The partialRight() function is used to apply the 'orange' value as the second argument to includes(). The first argument is supplied with each iteration of some().
However, this approach won't work if case sensitivity matters. For example, 'Orange' will return false. Here's how you can handle case sensitivity:
_.some(myArray, _.method('match', /Orange/i));

The method() function creates a function that will call the given method of the first argument passed to it. Here, we're matching against a case-insensitive regular expression.
Or, if case-sensitivity doesn't matter and you simply prefer the method() approach, this works as well for ES2015:
_.some(myArray, _.method('includes', 'orange'));

Comment: Great explanation of several functions, thank you. I prefer these examples over Alexander Yatkevich's helpful implementation of _.curry, as _.method doesn't require the creation of a separate custom function.
Comment: I've noticed one small query with the case insensitive example. If the word 'Orange' was a variable (that could be any word), would we have to escape it before passing it in? i.e something like this (not tested)

`var myWord = 'Orange';
    _.some(myArray, _.method('match', new RegExp(_.escapeRegExp(myWord), "i")));`
Answer: Two quick ways to do it - neither uses lodash (sorry)
var found = myArray.filter(function(el){
  return el.indexOf('oranges') > -1;
}).length;

if (found) { // oranges was found }

or as I mentioned in the comment:
var found = myArray.join(',').indexOf('oranges') > -1;
if (found) { // oranges was found }

Comment: Thanks James. These works great. If no-one clarifies a lodash way I'll mark your answer as correct.
Comment: The last method is great for most cases, and it works even in old browsers. No need for `filter` or `some`.
Answer: You can do this using lodash, but it's also very doable using native javascript methods:
function stringArrayContains(array, str) {
  function contains(el) {
    return (el.indexOf(str) !== -1) ? true : false;
  }

  return array.some(contains);
}

Testing the above function:
var a = ['hello', 'there'];
var b = ['see', 'ya', 'later'];

stringArrayContains(a, 'ell') // true
stringArrayContains(a, 'what') // false
stringArrayContains(b, 'later') // true
stringArrayContains(b, 'hello') // false

Array.prototype.some applies a function you define to every element of an array. This function (named contains in our case) must return true or false. While iterating through the array elements, if any of the elements returns true, the some method returns true.
Personally, I think in general that if you can use native JS methods for simple functions, it's preferable to loading an library just to do the same thing. Lodash absolutely does have performance benefits, but they aren't necessarily realized unless you're processing large amounts of data. Just my two cents.
Cheers!
Answer: The best way is to define a function to check the inclusion of a substring.
var contains = _.curry(function (substring, source) {
    return source.indexOf(substring) !== -1;
});

I use _.curry here to get a curried function, which can be partially applied then.
_.some(myArray, contains('item'));

You can also find a substring in a joined string.
contains('item', _.join(myArray))

UPD:
I have not noticed that lodash already has a function to find value in a collection.
The function _.includes is quite the same to what I defined above. However, as everything in lodash, it uses the different order for arguments. In my example, I put a source as the latest argument for a curried function which makes my function useful for point-free style programming when lodash waits for the source as a first argument of the same function.
Check the Brian Lonsdorf's talk on this matter https://www.youtube.com/watch?v=m3svKOdZijA
Also take a chance to look into ramda. This library provides a better way for practical functional programming in JavaScript.
Comment: Thank you for the technique using _.curry, as I am trying to learn the  'lodash approach'
Answer: I ran into this Question / Answer thread while trying to figure out how to match a substring against each String in an Array and REMOVE any array item that contains that substring.
While the above answers put me on track, and while this doesn't specifically answer the original question, this thread DOES appear first in the google search when you are trying to figure out how to accomplish the above removal of an array item so I figured I would post an answer here.
I ended up finding a way to use Lodash's _.remove function to remove matching array strings as follows:
        // The String (SubString) we want to match against array (for dropping purposes)
        var searchSubString = "whatever"

        // Remove all array items that contain the text "whatever"
        _.remove(my_array, function(searchSubString) {
              return n.indexOf(searchSubString) !== -1;
            });

Basically indexOf is matching against the position of the substring within the string, if the substring is not found it will return -1, when indexOf returns a number other than -1 (the number is the SubString position in number of characters within the Array string).
Lodash removes that Array item via array mutation and the newly modified array can be accessed by the same name.
Answer: _.some(myArray, function(str){
    return _.includes(str, 'orange')
})

Answer: let str1 = 'la rivière et le lapin sont dans le près';
let str2 = 'product of cooking class';
let str3 = 'another sentence to /^[analyse]/i with weird!$" chars@';

_.some(_.map(['rabbit','champs'], w => str1.includes(w)), Boolean), // false
_.some(_.map(['cook'],            w => str2.includes(w)), Boolean), // true
_.some(_.map(['analyse'],         w => str3.includes(w)), Boolean), // true


How to disable the "/kill" command on Minecraft server

Question: Because everyone on our educational server won't stop using the <code>/kill</code> command, I want to make it so that they can't use this command, but are free to use the other ones. I only want to use command blocks, but if doing this on the server is better, what's the best way of doing this?
Comment: Either install a plugin, or don't let theme use commands
Comment: Is this the vanilla Minecraft server, or something like Bukkit? I can't remember if /kill is available in vanilla.
Comment: This is a vanilla Minecraft server I think. Unfortunately I'm not the one who created it, I'm only the one who is using it.
Comment: @Kimatuy I'm fairly sure that /kill isn't available in vanilla anymore, but it's been a while since I played, so they may have added it back. Anyway, you should probably just make it so that people can't use commands.
Answer: If your on a vannila sever there isn't much you can do, exept deoping everyone.
On Bukkit/Spigot servers you can use plugins like PermissionEx or GroupManager to allow or disallow commands for groups of players. Easier is to install plugins like DisableCommands the disallow commands for everyone.
Hope it helped :)


Does a Domain Controller only control users accounts and permissions

Question: I know this question will be very simple for most of you but as I am trying to wrap my head around it, I am still a little confused and haven't been able to find anything that flat out says what I'm looking for. After I have a Domain Controller set up, when I connect to that domain from a client PC, Is the only thing that the domain controller is doing is controlling my user account rights (when I say only thing, I know there is a lot more that a DC does but I'm only concerned about this small piece that it does). In regards to this question, when I log into the domain, am I still seeing all of the files and programs that are on the local client I am using, or is it similar to connecting remotely where I will see everything that is on the Domain Controller? I am wanting to be able to connect with remote desktop services from the clients to the server and be able to run all of the programs from the actual server so this question has been formed so that I know whether or not just connecting to the domain will achieve this for me or if I do in fact need to actually remote in every time.
Comment: I can't understand what you're asking. Can you boil this down into a single question?
Comment: Sorry, Say I have 5 programs on the server that's my domain controller. These 5 programs are not on the PC that I am connecting to the domain. When I log into the domain, will I have access to those 5 programs that are on the server or will I see the exact same files and programs that are on the local PC? Does that make sense
Comment: Basically I'm wondering if connecting to a domain acts like a remote connection
Comment: Have a look at: http://serverfault.com/a/18349/7200
Answer: (I'm going to take a stab even though I'm not sure what you mean.)
When you logon to a PC that's joined to a domain with a domain user account you're still just using that PC. You're not making a Remote Desktop connection to a Domain Controller (DC) by logging-in on a domain-joined PC with a domain user account. Any programs you open will still be executing on the CPU and in the RAM of the client PC you logged-on to.
Comment: Thanks, you did answer my question. So is the Domain Controller sort of just what is controlling all of the user accounts that can connect and their rights and privelages?
Comment: And thank you for being kind about these kinds of questions. I hardly know anything about servers yet but the questions that are so simple for you to answer are difficult for me to comprehend sometimes.


When is it ok to subdivide?

Question: I'm new to blender and I wonder what's the best way, with the least side effects, to add more detail to a model's face. It seems that the loop cut is the cleanest way of doing it but at the cost of adding unnecessary geometry. Subdivide seems like the obvious solution to a lot of problems but then you can't use a lot of features as it can create ngons. So when do you use it?
Comment: @someonewithpc this not an easy question as it might appear. I would currently subdivision only for use vertices for particle emission,duplication or landscapes. Sculpting requires retopo, loop-cuts only work well with decent meshes...
Comment: I remember when I was a beginner and I had a lot of questions of finding a best balance to get things efficient. The subdivision surface modifier divides every polygon into 4 and smooth out the objects shape. I suggest looking up for beginner tutorials (you have a lot to learn there) and you will start to see how things are going. Check out "blendtuts.com", "blenderguru.com" and many others.
Comment: The modifier converts ngons and triangles to quads (4 sided polygons), but they are not so efficent to use on a curved surface when using the modifier.
Comment: Just to be clear I am not talking about the subsurf modifier but about the subdivide tool and the ngons it can produce on adjacent faces. Are you saying that its always bad and you might have to find a case with the least harm done?
Comment: It depends on whether you really need the subdivision everywhere in the model, if you just want to create geometry for a window then knife cut would be the better choice. For sculpting you need more (dynamic) geometry. So the answer would be it depends.
Comment: @stacker _Then_ you get N-gons...
Comment: @someonewithpc When doing knife cuts, yes. I think the questions is unclear because it is not mentions which modifiers occur in the workflow. I'm afraid there is no single rule of thumb.
Comment: @stacker Loop cut is your best bet.
Comment: It really depends on what the model will be used for in the end. If the model is going to be animated/deformed, then clean topology is very important. Otherwise, maybe not as much.
Comment: Just to be clear.. Are we talking about the subsurf modifier or subdivisions in edit mode?
Comment: @stacker No modifiers at all.
Comment: @gandalf3 Just subdivide in edit mode.
Answer: When modelling something you would always add minimal geometry (eg. loop cuts) and work with it until the shape of the object cannot be further improved with the current geometry! This is very important, as if you start adding too much geometry initially, you will get lost and you make your task exponentially harder, because you will have to manually manipulate so much more verts.
Now, in most cases you should avoid subdividing altogether, before you are finished modelling, in a sense. Meaning that with your modelling you would have laid out the optimal topology of the model and would have made sure that every vertex and every face is absolutely necessary for describing the object and maintaining the topology! Only then you would subdivide, to get a smoother result (as your object would be approximated at a higher resolution).
Having said that, don't consider the subdivision taboo and absolutely neglect it. Usually it is good practice to check the topology of your mesh, every once in a while, by subdividing it and seeing if it flows and looks natural... this way you can also spot duplicate vertices or holes in the mesh.
I am not a pro modeler and maybe someone could argue this is not always the case, however those are some tips that help me.
Answer: Subdivision is OK when you need the geometry some examples could be:

Landscapes

Particle Systems (here used to emit buildings)

In general loop-cuts should be the way to go, they allow later refinement because they follow the mesh's topology (most important in organic modelling).
In a subdivided mesh you would have to adjust each and every vertex, instead of selecting a loop as shown here:
Answer: It depends, like architectural buildings and that kind of not so curving objects, no problem to use ngons and triangles, ngons help a lot when modeling those building. Flat shading is the key when rendering those objects.
Example: left side object has flat shadind and 24 vertices, including ngons, right side has smooth shading and 156 vertices, no ngons. When rendering  they looks identical.
People use many times smooth shading and add unnecessary loopcuts to objects what does not need smooth shading, its a habbit.

When is it ok to subdivide?


Fleck with auf vs. an, is there a more general rule?

Question: I noticed that it's common to use Fleck with auf rather than an. For example Es gibt einen Fleck auf Ihrem Hemd. ("There is a stain on your shirt.") My understanding is ''auf'' means "on top of" while ''an'' means "attached to", "leaning on", "hanging on/from". So it seems odd that auf rather than an would be the preferred preposition here. Is this just a random exception or is this part of a more general pattern? Apparently with Farbe the preferred preposition is an, as in Es gibt Farbe an der Wand. ("There is paint on the wall.") But there are exceptions with this: Es gibt Farbe auf der Palette. (There is paint on the palette.") I suppose it's because a palette can be held horizontally.
Comment: Note, that like in English "auf"/"on" can very well mean "on the surface of" instead of "on top of" - which is the case here.
Answer: I'm somehwat surprised, that DWDS does not offer a dedicated meaning for an as well as auf.
No, I don't think is has to do with the orientation of the stained surface. Neither  would I translate auf with on top of but rather prefer upon.
Numerous other examples exists:

Auf dem Bildschirm...
Auf dem Gemälde...
Auf dem Plakat...
Auf dem Foto...

I would mostly use auf, when the "carrier" is used as a reference and offers the surface exhibiting something.
Counter-examples using am exist, however, but I don't see a clear and easy rule here:

Ich habe einen blauen Fleck am Schienbein.
Am Kotflügel ist ein Kratzer.
Comment: Aam Kotflügel in sein Lack da is en Kratzer
Comment: Schienbein ist technisch ein Knochen, den kann man ja nicht sehen. Also *am* wie *in der Nähe*. Auch *am Fuß*,. . . na gut, ja, ist ein wichtiger Punkt. Vielleicht verkürzt aus *op'm*?
Comment: As I mentioned in another comment, I don't use "upon" and had to look up the difference between it and "on" in the dictionary. Maybe it's one of things that only people who learn English as a second language are taught. There does seem to be a general rule about using *auf* with images/carriers that's worth remembering. I'm not convinced it applies to *Palette* but it's certainly possible.
Comment: PS. I think it's interesting that German uses *blau* for bruises (*blauer Fleck*, *blaues Auge*) instead of "black" as in English. English has "black and blue", but neither can be taken literally.
Comment: @RDBury: "... not a trace to mark his fall, nor a stain upon the wall" is original English speech, well song ;-)
Comment: @a_donda: Yes, I'm sure there are native English speakers who use "upon", I'm just saying I'm not one of them. I'm not familiar with the song you quoted, but from the title and the tone, it's in the style of E.A. Poe, and Poe did use "upon" whenever possible. As much as I like Poe's work, by today's standards his style is very flowery and elevated; not something you'd see in modern work unless that's the effect the author is going for.
Comment: @RDBury: Phenomenal ! It was Alan Parsons Project who set into song short stories by Poe. Whatever, it just proves that these prepositions have no fixed rules and may even depend on personal use or lack thereof and there's no fixed for their use. They may be (hear, hear) idiomatic ... :-)
Answer: It is as it is :-)
Just like a stain is upon but a writing on the wall.
Ein Fleck ist auf, ein Knopf an der Bluse, eine Nudel ist im Gesicht.
But I would translate "auf" not only with "on top of", that'll be more like "über". I don't think there are general equivalents either way in both languages for these prepositions/adverbs/prefixes.
Comment: Yes, prepositions are certainly tricky for learners; just when you think you've learned a specific meaning which can be translated a certain way, you discover mysterious and apparently random exceptions. I think I would usually translate *über* as either "over" or "above"; only "on" if it's a topic: *Dies ist ein Buch über Deutsch.* -- "This is a book on German."
Comment: @RDBury yeah, but "Das ist ein Buch über deutsch" as awkward German, it is an incomplete sentence. "Das ist ein Deutschbuch", "... über deutsche Grammatik/Redensarten" would make it better. And a language is not a stain, so different idioms apply.
Answer: This follows straight from the progressive aspect, sich etwas über das Hemd schütten. Consequently, the stain is upon the chemise, so to speak, not onto.  (PS: this should be logical, that fluids come from above, because they generally flow down wards).
The preposition is occasionally allowable, per chance, if the stain is superficial, so you might have Ketchup an der Backe, but this has never been applicable with cotton wool to my knowledge. Further, we'd more likely say im Gesicht, not an, showing that it depends on the location and how it combines.
Imaginably, English has generalized this to on under inuence of French en, which I understand combines both n-prepositions, in turn under the influence of Frankish, though the severely reduced á might also have played a role.
Comment: Stains may very well be caused by non-fluids. I'd say that interpreting the shirt as carrier substance, as by guidot's answer, offers a much more natural explanation.
Comment: So, since the stain was theoretically some fluid that dropped onto the surface, it would be *auf*. That makes some sense and seems to apply to *Spritzer*. I might expect *Grasfleck* to work differently in that case; apparently it doesn't but I don't expect 100% logical consistency. I don't think I use "upon" and I feel it's rather dated, so to me *auf* and *an* are both either *on* or *onto*.
Comment: @Lykanion,I'm not super convinced by own answer, lol, but I did say it depends on the location and I won't *overthink*this beyond that


Which logs should I pay attention to?

Question: There are many logs in /var/log/  For a standard home installation, which ones should I be checking regularly?
Answer: Each log serves it's own purpose. It really depends on what you're trying to check for. Some common ones are outlined below:

/var/log/auth.log - Information pertaining to authentication - including sudo/su activity
/var/log/boot.log - All information during the booting process
/var/log/crond.log - Information from cron daemon
/var/log/messages - Typical dumping point for messages not regarding the system
/var/log/pm-suspend.log - Logged during the Power management suspend function
/var/log/user.log - Information from all userlevels
/var/log/syslog - This organizes output from different softwares and is a "general log"
/var/log/kern.log - Information being logged from the kernel

There are additional logs - like the apache2 folder, mysql.log/mysql.err, and others. These are all software specific - if you don't have apache2 installed, you won't have the log files for it. The only time you would want to check logs is when an issue arises - most of the time though it'll be okay to let them sit in the dark.
Comment: I have three logfiles (kern,messages and syslog) totally spammed by crazy "NVRM: os_raise_smp_barrier(), invalid context!" message. So I dont check it anymore....
Comment: `egrep -v 'os_raise_smp_barrier' /var/log/{kern.log,messages,syslog} | less`

And, track down that message - it's symptomatic of some problem that you should fix.
Comment: You could ask `rsyslogd` which files it logs to: `cat /etc/rsyslog.d/* | egrep -v '^#|^$'  | egrep -o '/[^ ]+'` on your system.
Answer: I would argue that for a standard home installation, there is no need for you to be checking any logs regularly. Though they may be helpful in diagnosing a problem or filing a bug report.
Comment: I concur: unless you're seriously concerned about security auditing - which is unlikely to be particularly useful for your home PC - the logs are there for figuring out what's gone wrong after something's gone wrong :)
Answer: Also, you can just use the command "dmesg" to see the kernel messages (same as /var/log/kern.log)
This usually tells me quickly what is (if anything) going wrong with the system
Answer: A trick that I find useful is:
touch /tmp/now

<...make the problem happen...>

sudo find /var/log -type f -newer /tmp/now | xargs sudo less

That shows me every file in and under /var/log that has had something written to it since the touch /tmp/now command.

Which logs should I pay attention to?


What is the difference between feature testing and functionality testing

Question: Recently I happened to be in an interview where I was asked to explain feature testing and functional testing. Even after looking up so many references I am unable to find a convincing explanation ‒ can anyone explain?
Comment: It could be also misunderstanding from interviewer or interviewee: "functional" vs "functionality". Which is also in your question: title mentions "functionality" but question body mentions functional. "functional" is often considered a synonym for "system" or "integration" testing.
Answer: There are lots of kinds of testing, and they vary by company and organization.  Different people use different terms.  There is no special value in any particular set of terms; you just need to know what the speaker means when they use them.
Frankly, I think it was a stupid question, or perhaps even a trick question to see how you deal with ambiguity. Whether a candidate happens to know how the interviewer happens to define a set of ambiguous terms has no bearing on job performance.  I hope the rest of the interview was better than that.
Comment: Yeah, I can't help but think this was a pointed question to try and see whether a candidate will then explain their understanding of the different types of testing which can be applied, and specifically when they would apply them. I'd have said "Well, I'm not sure how you define those here, but I've always gone by "
Comment: During an interview asking a stupid/trick question like this might be interesting even if the interviewer does not know the answer. A good answer can be "I don't know the exact difference, but I think it could mean ..... depending on the situation." As an interviewer I want to know how your train of thought is, not if you can explain definitions by head.
Comment: Exactly. My response would be mention two approaches to  tests: testing certain feature, and testing overall functionality. Then you may ask what terminology this company uses for each. To make names more distinctive and less misleading, it would help if name starts with different letter, not "F". But local customs vary :-)
Comment: Maybe real goal of the question was to find out if interviewee can investigate ambiguous question, ask probing questions to determine what customer has really in mind, test not knowledge but communication skills. If so, this question would be a masterstroke :-)
Answer: This is where good communication skills, alertness and good vocab comes in handy for a tester....
Looking at the meanings of the terms in question,
Feature: a distinctive attribute or aspect of something.
Functionality: the quality of being suited to serve a purpose well; practicality.
So with the knowledge of the meanings of these terms you can come up with a good enough explanation spontaneously. As it is there are many terminologies made by people in testing. And to different people and organizations a term may have a different meaning. So it is always better to give an appropriate explanation depending on the context.... :)
Answer: Feature Testing: Features are changes that add new functionality or modify existing functionality.
Functional Testing: Functional Testing is a testing technique that is used to test the functionality of the Software, should cover all the scenarios.
Click here to know more about functional testing
Edited as per the comments.
Comment: Ok, but don't mind your answer is not showing the differences?. But I honestly accept that I just posted the links.
Comment: Downvoted because the answer is just a bunch of links.
Comment: Agree sir. Thanks. If there is a then what is that difference and if there is no difference then the answer is there is not difference (Both are same).
Comment: Yup, I agree with you. The question heading is functionality and in description you can see functional.
Answer: Unlike for other Testing types, for the term Feature testing, you can find only a best match from well accepted testing types in Software QA domain.

Feature testing - I think it is the sanity test. In a mature build, particular feature could be newly added, or existing feature's
bug could be fixed. Then the testing has to be carried out focusing
the particular feature alone. The sanity test of a mature build is
also the same thing. However feature test (sanity test) alone would
not qualify application for sending live. The regression test has to
follow right after to make sure nothing in the whole system is broken
by new addition of feature or bug fix. The link here should give you more understanding on Sanity test

Functional Testing has 2 interesting meanings depending on the context of testing

As a sub type of System Testing Types

Functional Testing - Testing to look for missing functionalities which could be useful to the end users
This is not what the simple name suggest what it could be. It is one variation out of 7 main types of system testing. System testing is also called End to end testing. One major aspect of system testing is Functional testing where testers look for missing functionalities which could be useful to the end users. Idea is to improve the quality of application by new functionality suggestions after the test.
Please refer this link for more info on system testing

Main testing type that cover many other sub testing types

Functional Testing - Test how system functions conform to the functional requirements provided by the customer.
Composed of many testing sub types involving even developers in the team to contribute. Check this link for more information on this main test type.
Answer: Feature testing involves testing specific features or functionalities of a product to ensure that they are working as intended. This type of testing is often focused on user-facing features and involves testing things like buttons, links, forms, and other interactive elements of the product. The goal of feature testing is to ensure that each feature is functioning correctly and delivering the expected value to the user.
Functionality testing, on the other hand, involves testing the overall functionality of a product to ensure that it is meeting the requirements and specifications that have been defined for it. This type of testing is often more comprehensive and involves testing the product as a whole, rather than focusing on individual features. Functional testing may involve testing things like performance, security, compatibility, and other aspects of the product that are critical to its overall functionality.
So, in summary, feature testing is focused on testing individual features or functionalities of a product, while functionality testing is focused on testing the overall functionality of the product as a whole. Both approaches are important and can be used together to ensure the quality and reliability of a software product.
Comment: @JoeyRock yes, [check this out](https://katalon.com/resources-center/blog/functional-testing)
Comment: Source, please?
Comment: Please edit your answer to put the reference in the body of the answer rather than in the comments. This is a well-thought-out answer that makes a good addition to this very old question.
Answer: Feature Testing
           Testing enhanced things in already developed project is called feature testing.Whether its is useful for our project.Understanding the Feature,Build Test Scenarios,How it is Implemented,Deploy the Build Early are some of the things in feature testing.
Functional Tesing
           Functional testing means testing the application against business requirements. Functional testing is executed using the functional specifications given by the client or by the design specifications according to use cases given by the design team. Role of functional testing is to validating the behavior of an application.
Comment: So doesn't a new project have feature? Or only the next versions have features? Feature does not mean update!
Answer: Feature is something that the user perceives as a benefit. Something that can be called out in a brochure bullet point.
Function is something that gets done.
In general, features use one or more functions. For instance, "undo" is a feature. It is a cross-cutting concern, and is actually composed of many tens or hundreds of individual "undo" functions.
Answer: A function does something; features are characteristics or qualities of the function, or perhaps how it does what it does.
When assessing software, should buyers look at functions, features, or both? I would think that the focus would be on functions (what you're looking for the system to do for you), as these are fairly easy to identify. Features may vary from vendor to vendor, though functions may be almost universally available. And so, you might consider the features of one vendor versus another, as a way to decide which you prefer.
Answer: Function is like the basic thing of the product or of particular domain for example, on a job searching site job seeker can view job which is basic functionality of all job searching site, but in particular job searching site one can send mail to the recruiter as well is feature of the particular job searching site which belongs to a particular company.

It means functionality is the basic function of the product in a
  domain, but features can change depending on company to company
  product in the same domain.


What's the difference between "He dumped her" and "He walked out on her"?

Question: What's the difference between "He dumped her" and "He walked out on her"? Are there any different shades of meaning in these two phrases? Are they completely different?
Comment: There are, as you say, different *shades* of meaning.  Generally, though, the answers below attempt to make these "shades" black and white, which is impossible when one is dealing with romance between humans.
Comment: There is, of course, the alternate "He broke up with her", which is a typically less harsh way of saying that he ended a relationship (regardless of the length of said relationship).
Answer: To walk out on [someone/something]:

to suddenly end your relationship with someone or something

[TFD]
You can walk out on a person you are in a relationship with (usually a long-term one), or walk out on a contract you have. Typically the things you "walk out on" are more serious and binding things, and the act of "walking out" is often unexplained.
To dump:

To discard or reject unceremoniously

[TFD]
Dump is usually only used with short-term romantic relationships, though it can be used with personal relationships as well. In the act of dumping, the person getting dumped is typically left with a poor explanation for the end of the relationship.
Answer: A girlfriend is dumped, a wife is walked out on.
Comment: I don't think this is accurate at all. You can walk out on a girlfriend. The issue is whether you live with them or not.
Comment: @curiousdannii would you say a wife could be dumped?
Comment: +1 for a concise but accurate explanation.
Comment: @user662852 It would be understood, but not natural IMO (and in AusEng).
Comment: @Mari-LouA you can count on me for a reopen vote anytime. we should form a reopen voting pool to defeat the strict editorial standards here.
Comment: You could, if you wanted, cast your vote to reopen this question. Two more votes are needed. EDIT: Ha! Someone else has voted to reopen it. One more vote, and it's done.
Answer: Differences I can think of:

"walk out on" implies a committed relationship, usually living together, and possibly with kids. (You can't "dump" your wife and kids, but you can "walk out on them".)
"dump" in this sense is only used for romantic relationships, whereas you can "walk out on" a project, housemates, etc.
being "walked out on" (to me) implies some kind of traumatic experience for the victim with serious consequences, whereas being "dumped" suggests being upset, but without the suggestion of long term trauma. (But maybe that just follows logically from the first point.)
Comment: For your third bullet, "abandoned" is relevant.
Answer: Excellent threading everyone - thank you.  I've been walked out on, walked away from, got dumped, been kicked to the curb, abandoned, etc.  All or any of these terms could be generalized to any or all of my experiences...ah well, could not we all "count the ways...."
How-be-ever, speaker's goal and implied agency is the distinction for me:
To "dump" someone, as one would haul trash to the dump, implies an ascription of value (or an implied devaluing as mentioned above in "good riddance") whether it be a toxic relationship, a partner with baggage or with child (and depending on the dumper's perception perhaps child = baggage) or the value is ascribed to the action itself; to dump is to release something from one's possession (and to release oneself from the implied concomitant obligation, connection, affiliation, responsibility for, etc.)  BTW, I once got "dumped" via voicemail, so in my experience the face-to-face-less-ness of the act left me feeling very much "dumped" and not "walked out on". In the term "dump" there is an implied imbalance of power as the dumper not only gets to do the dumping, but also gets to ascribe "dump-worthiness" to the one getting dumped. "Dumping" someone in some sense can even imply robbing them of their personhood - not only objectifying them, but deeming them so unworthy as to take action to get rid of them. (I'm using gender-neutral singular here.)
To "walk out on" someone has to do with individual agency, bodily action, and human geography. First there is a turning away from, then a moving away from, and an implied staying away from, thus creating a separation from the one left and the one who did the leaving. To me there is less ascription of value to the actor, the action, and the one against whom the action is being taken, and more of an intentional omission of value; to "walk out" is a pragmatic divestment of sorts, requiring only the effort to take oneself out of a relationship.
That is to say, the person who "walks out" does so more as an action independent from the relationship (or as an act of independence) than the person who "dumps" in reaction to the relationship (an act that is responsive/reflexive and therefore its value has implied dependence on the relationship).
To the original questioner, the choice you make has to do with how you wish to portray the action and actor to whomever you are imparting this information - and how you wish to reveal or conceal your own thoughts or feelings about the circumstances.
"He broke up with her" explains who did what without qualifying what happened. "They broke up" is also neutral. "They chose conscious uncoupling" could also be neutral, depending on whether you're a Gwyneth Paltrow hater or not...
Hope that helps...
Answer: To me from a BrE perspective, "dump" implies permanency while "walk out" doesn't necessarily:

"He dumped her after the second date": there will never be another date (but also implies relative short-termness of the relationship)
"He walked out on her at the restaurant, but he apologised the next day": he left their meal abruptly (perhaps leaving her with the bill)

For the AmE sense of 'left permanently' I might use 'abandoned' or 'deserted' because 'walk out on' isn't clear enough.
Comment: @KeithHall - I think you are wrong.  While "walked out on" can be interpreted to mean "left the room", that is not now the idiom is used 99% of the time.  And love is fickle.  Many a couple has broken up, only to "reconnect" later, no matter how the break-up has been described.
Comment: I think this should be the accepted answer, because if someone said "He walked out on her" to me, I would assume they just meant that "he" just physically left the room she was in - i.e. one can infer nothing about the relationship ending.
Comment: @HotLicks, OP asked about different shades of meaning, so that 1% could be significant here - `dumped` is unambiguous, `walked out on` isn't :)
Answer: The words are very close, if not synonyms.  However, if one looks at shades of meaning, there are some differences.
Dumping has the feel of an "active" action.  You have to actively dump someone.  It typically means you must go face to face with them, and through some series of actions (typically a lot of brutal words), both parties walk away with a complete understanding that it is over.
Walking out on someone has less of the active feel.  If you walk out on somebody, you just walk.  It typically does not involve a face to face confrontation (although a heated face to face confrontation may preceed walking out).  After one person walks out on the other, the person who walks has a complete understanding that it is over, but the other person is left in the dark.  Is this a phase?  Is he coming back?  These questions echo in the mind of someone who was walked out on, but they are not questions that someone who is dumped deals with.  Walking out also implies that there was a level of obligation between the parties, and those obligations were ignored when one walked out.
Jlovegren gave a very nice succinct answer, but it doesn't come with much of an explanation:

A girlfriend is dumped, a wife is walked out on.

The most easy to explore part of this is "a wife is walked out on."  One cannot "dump" a wife just by telling her she's dumped.  There's a process for it, called divorce.  In practice, "divorcing" is such a singular action that one tends to use it rather than other words.  The one case where I can think of where you would use "dumped" would be in a very casual conversation between very masculine individuals where it's important to show indifference:

"Hey, what ever happened to your wife?"
  "Oh, her?  I dumped her years ago.  She took the house and half my pension.  Good riddance."

On the other hand, it's hard to walk out on a girlfriend because, in most typical boyfriend/girlfriend relationships, there's not enough shared obligations between the two parties to really use that phrase.  Walked out really implies you had something concrete to walk away from.  An out-of-wedlock pregnancy might create enough shared obligations to garner the phrase:

"I thought you were with... what was his name..."
  "I was.  We were doing well too.  But then I got pregnant, and when he heard the news, he just walked out on me."


How to apply a force vector to a position vector?

Question: A particle is present in the two dimensional space. It's position is given by the vector:
$$x = \begin{pmatrix} |x| \cos(\theta) \\ |x| \sin(\theta) \end{pmatrix}$$
It experiences a force of:
$$ F = \begin{pmatrix} |F| \cos(\theta) \\ |F| \sin(\theta) \end{pmatrix}$$
How can I calculate the position of the particle after applying this force?
Comment: BTW: It is recommended you typeset sines and cosines with `\sin` and `\cos`. The difference is $sin(x)$ vs. $\sin(x)$. I already edited your post.
Comment: Use $x=x_0+\dfrac{1}{2}at^2$ where $F=ma$.
Comment: You need to define velocity vector also. Acceleration  a=m/f in same direction as force. The position vector is simply double integral of a. The initial conditions are defined by initial velocity and position.
Comment: Are you sure the force is on the same direction as the position? Isn't the more general case $\vec{F} = ( F \cos \psi. F \sin \psi)$. Also the velocity of the particle needs to be specified in order to establish the final position.
Answer: First of all you have to consider that applying a force to a particle can make it move, it depends on the boundary conditions like the presence of friction.
According to the data you have provided you are in the very simple case of just the particle and the force acting on it so assuming it has mass $ m $ (this data is needed) hence the particle will move so it's future position will be a function of time.
The final position vector will then be
$$
x(t) = \begin{pmatrix}
\left ( |x| + \frac{|F| }{2m} t^{2} \right ) \cos(\theta)
\\
\left ( |x| + \frac{|F| }{2m} t^{2} \right ) \sin(\theta)
\end{pmatrix}
$$
Answer: Apply:
\begin{equation}
F = ma
\end{equation}
to your particle to get a pair of acceleration vectors. You can then use the acceleration to work out the particle position at a given time.
\begin{equation}
x = x1 + at^2/2
\end{equation}
If you meant impulse instead of force then the process is similar but you equate the impulse to the total change in momentum and then:
\begin{equation}
impulse = m\Delta v
\end{equation}
\begin{equation}
x = x1 + vt
\end{equation}
Answer: You start off by drawing a free body diagram, showing the x and y components of the force.  Then you write a force balance for the x direction and the y direction to get the accelerations in these directions.  Then you can determine the kinematics of the motion, once you know the acceleration components.
Answer:
How can I calculate the position of the particle after applying this force?

By using Newton's second law.
If the mass of the particle is $m$ and it is constant; then we have:
$$\vec F=F\cos \theta \;\vec i+F\sin \theta\;\vec j=m\vec a=m(a_x\;\vec i+a_y\;\vec j)$$
$$\Longrightarrow\;a_x=\frac{F\cos\theta}m\quad\textrm{and}\quad a_y=\frac{F\sin\theta}m$$
On the other hand, we have:
$$\frac{\mathrm d^2}{\mathrm dt^2}\vec r(t)=\frac{\mathrm d^2}{\mathrm dt^2}
(r\cos\theta\;\vec i+r\sin\theta\;\vec j)=\vec a(t)=a_x\;\vec i+a_y\;\vec j$$
So
$$a_x=\frac{\mathrm d^2}{\mathrm dt^2}(r\cos\theta)\quad\textrm{and}\quad a_y=\frac{\mathrm d^2}{\mathrm dt^2}(r\sin\theta)$$
Now, we can determine the position vector of the particle by integrating equations above.