Statistical test to tell whether two samples are pulled from the same population?

Question: Let's say I have two samples. If I want to tell whether they are pulled from different populations, I can run a t-test. But let's say I want to test whether the samples are from the same population. How does one do this? That is, how do I calculate the statistical probability that these two samples were pulled from the same population?
Comment: ctd ... Similarly, tests can't even tell you that the distributions are identical, since they can differ in trivial ways. You may want to search on 'equivalence test' or 'equivalence testing', on which you should get quite a few hits here, or on google.
Comment: Please explain--as quantitatively as possible--what you mean by "same."  It would help to clarify what you mean by "condition," too.
Comment: A test like a two-sample Kolmogorov-Smirnov (not the only possibility; with the usual assumptions, the t-test is testing the same thing, as you note) can test whether the population *distributions* are different (but failure to reject doesn't mean they're actually the same). However, no test can tell you whether two distributions that are not too dissimilar are actually from the same *population*, rather than two different populations with similar distributions.  That would have to come either from assumptions or other investigation. ...ctd
Answer: The tests that compare distributions are rule-out tests.  They start with the null hypothesis that the 2 populations are identical, then try to reject that hypothesis.  We can never prove the null to be true, just reject it, so these tests cannot really be used to show that 2 samples come from the same population (or identical populations).
This is because there could be minor differences in the distributions (meaning they are not identical), but so small that tests cannot really find the difference.
Consider 2 distributions, the first is uniform from 0 to 1, the second is a mixture of 2 uniforms, so it is 1 between 0 and 0.999, and also 1 between 9.999 and 10 (0 elsewhere).  So clearly these distributions are different (whether the difference is meaningful is another question), but if you take a sample size of 50 from each (total 100) there is over a 90% chance that you will only see values between 0 and 0.999 and be unable to see any real difference.
There are ways to do what is called equivalence testing where you ask if the 2 distributions/populations are equivalent, but you need to define what you consider to be equivalent.  It is usually that some measure of difference is within a given range, i.e. the difference in the 2 means is less than 5% of the average of the 2 means, or the KS statistic is below a given cut-off, etc.  If you can then calculate a confidence interval for the difference statistic (difference of means could just be the t confidence interval, bootstrapping, simulation, or other methods may be needed for other statistics).  If the entire confidence interval falls in the "equivalence region" then we consider the 2 populations/distributions to be "equivalent".
The hard part is figuring out what the equivalence region should be.
Comment: A null hypothesis test can never provide evidence for the null hypothesis, true. Model selection, either Bayesian or based on some "criterion" (AIC, BIC) could however indicate that a null model (identical distributions) is a better description of the data than an alternative model (different distribution). All that under a bunch of assumptions of course.
Answer: http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test
Assuming your sample values come from continuous distributions, I would suggest the Kolmogorov-Smirnov test.  It can be used to test whether two samples come from different distributions (this is how I am interpreting your usage of population) based on their associated empirical distributions.
Directly from Wikipedia:

The null distribution of this statistic is calculated under the null hypothesis that the samples are drawn from the same distribution (in the two-sample case)

The ks.test function in R can be used for this test.
While it is true the kstest does not test for homogeneity, I would argue that if you fail to reject with a large enough sample size (a high powered test), you can claim the differences are not practically significant. You could infer that if differences do exist, they are likely not meaningful (again, assuming large sample size). You cannot conclude they are from the same population as others have correctly stated. All this being said, typically I would just graphically examine the two samples for similarity.
Comment: I doubt that KS test can be used to show distributional equivalence.
Comment: @MichaelMayer that's exactly right. OP is interested in a test of homogeneity... which has many underlying methodological issues. KS for heterogeneity also has its issues: practically, it *will* reject in large samples regardless of whether populations are practically identical in all aspects. It just goes to show that testing, and consequently p-values, are better conceived of as measures of sample size than statistical significance.
Comment: @qwr that is not true.  There is a two-sample KS test, defined on wikipedia.
Comment: @AdamO Yes, but if you have large samples and you fail to reject, I would be confident that the populations are practically identical.  As far as I know, there is no theory to back this up, but from experience, knowing that the KS for heterogeneity can detect minute differences with large sample size can allow you to use a failed large sample test as a de facto statement of practically identical populations. Does my response answer the question "calculate the statistical probability that these two samples were pulled from the same population"? Certainly not.
Comment: What can I do if my points are *two-dimensional*? That is, I have two samples of two-dimensional points, and I want to know if they come from distinct distributions.
Comment: The KS test only works against a pre-defined distribution, not from a distribution with parameters estimated from data.
Answer: You can use a 'shift function' which checks whether the 2 distributions differ at at each decile. While its technically a test of whether they are from different populations rather than the same, if the distributions don't differ on any of the deciles then you can be reasonably sure they are from the same population, especially if the group sizes are large.
I would also visualize the 2 groups: overlay their distributions and see if they resemble each other, or better yet draw a couple of thousand bootstrap samples from each group and plot those, as this would give you an idea of whether they come from the same population particularly if the population in question isnt normally distributed for you given variable.
Comment: Why not bootstrap samples and compute the mean or median, then do a statistical test to see if these are the same (e.g. t-test)?
Answer: I recently had to do something similar (although in my case I needed to know if two distributions were significantly different).
Our samples were very large (several hundred to tens of thousands) so KS test said everything was different (even for distributions that appeared nearly identical upon inspection of their histograms).
As AdamO mentions, this is a potential shortcoming of the KS test.
Essentially, the KS test examines the maximum difference between the cumulative distributions of each sample...
So if we have 2 distributions, A, and B, one valid question we could ask, is whether the difference between the cdf of A and the cdf of B is large compared with the cdf of a random sample taken from A compared to the cdf for the rest of A or the cdf of a random sample taken from B compared to the cdf for the rest of B.
So the solution I came up with was to take bootstraps of $A$ and $B$ ($A^*$ and $B^*$).
I then constructed an approximation of the null distribution by taking the KS statistic (D statistic, which is the maximum difference in cdf's) of $A^*$ vs $A$ and $B^*$ vs $B$, denoted $KS(A^*,A)$ and $KS(B^*,B)$ respectively. This gives an idea of the range of D values that would be expected if you compared additional samples from either distribution to itself.
Next I got the width of $KS(A^*,A)$ and $KS(B^*,B)$ by subtracting value of the 1st and 99th percentile and dividing by two to yield $sA^*$ and $sB^*$ respectively. Eg. $sA^* = (quantile(KS(A^*,A),.99)-quantile(KS(A^*,A),.01))/2 $
By adding $sA^*$ + $sB^*$ to the the maximum of $<KS(A^*,A)>$ (the expected value of the distribution of $KS(A^*,A)$) and $<KS(B^*,B)>$. I constructed a cutoff threshold for determining whether $KS(A,B)$ was significant. I.e. $Dcut=sA^*+sB^*+max(<KS(A^*,A)>,<KS(B^*,B)>)$
I then computed a confidence interval for the alternative by computing $KS(A^*,B)$ and $KS(B^*,A)$ and used the inner 99% of the resulting D values as a confidence interval for the alternative $KS(A,B)$. I.e. $$CI(KS(A,B)) \sim [quantile(KS(A^*,B) \cup KS(B^*,A),.01),quantile(KS(A^*,B) \cup KS(B^*,A),.99)]$$
Finally, if the confidence interval for the alternative lied above the threshold from the null, $A$ and $B$ were determined to be significantly different (with 99% confidence).
Answer: This question came up as the top related result when I was searching for a similar topic, namely, how to compare whether the means of two distributions had the same mean. My question is slightly different because two distributions could be different in ways other than mean (e.g. variance or skew or kurtosis or other "shape measures") but still have nearly equivalent means.
@GregSnow's comment got me on the right track - the term for this is an Equivalence Test.
Another key concept is that you actually cannot compare if two sample distributions are probably the same or not - only if they are close within a bound that you have to pick a priori.
In my case, the Two One-Sided T-Test (TOST) is a recommended procedure and what I used. Once you grok it, it makes sense. It relies on the standard t-test methodology, but uses a trick to make the null hypothesis that the distribution are different (rather than the usual null hypothesis that the distributions are the same).
For my situation, KS was inappropriate because KS DOES test for shape measures, not just means, and I was only interested in means.
Here is the link I used to understand how to implement TOST.
https://www.real-statistics.com/students-t-distribution/equivalence-testing-tost/


Can I damage a PSU if I test it without applying it a load?

Question: I'd like to test a PSU using the paper clip method connecting the green wire with one of the black ones, but I wonder if I can power it on, without applying a load, or if this could damage it.
Comment: Beware of false positive results if you test your PC's PSU without a load.  If the expected voltage is not present, then there is probably a fault.  If the expected voltage is present, then you have to do another test with a load on the line.  Voltages present without a load do not prove that a PSU is OK.
Answer: Its pretty common to convert desktop PC power supplies to desktop lab power supplies, and they recommend adding a 10 ohm, 10 watt load between the 5v and ground connectors to ensure proper operation. You're unlikely to damage it from a quick test, but you could always connect an old HDD or CD rom drive to provide a load (and to check if it actually works).
Its also apparently a good idea to connect the orange 3.3 volt wire to the brown sense wire to enable the PSU to sense what voltage its giving out to self adjust.
Considering I've not seen warnings about running a laptop type PSU without a laptop attached to it, I guess those would be safe.
Answer: A properly-functioning consumer PC power supply should not be damaged by turning it on without a load.  It should regulate the voltages on the various outputs to the proper levels (so you could measure them with a meter) but there won't be any current.
Comment: This may only be true for PC power supplies, since these are bought by uninformed customers.  This is not a correct answer for power supplies in general, since switch-mode power supplies typically specify a minimum load.  Even if there is no damage, an unloaded PSU will typically have a voltage that is out of spec (e.g. too high), and is no guarantee that the voltage will hold when a load is applied.  So it is not a meaningful test.
Comment: Researching, I agree that you're right and wondering if I should delete my answer.  A switching supply does typically need a minimum load and some can be damaged if operated no load.  For this reason, switching supplies sometimes have a minimum internal load.
Comment: Power "bricks" and the wall "wart" style of PSUs are examples that can be operated without a load.  No need to delete (I didn't bother down voting it), but instead of posing as a general purpose answer, make it specific to the instance of the OP's situation, i.e. PC power supplies.
Comment: I think the original question implicitly states that its a ATX-style PSU.
Comment: I've taken your suggestion but invite you to edit my answer to improve it.
Comment: @journeymanGeek - True, and a well-written answer should incorporate those implied conditions.  The original answer was too broad, she agreed, and made the appropriate edit.
Answer: Not that I know.  I've powered up several PSUs manually (shorting the green lead to any black lead) without any issues.  For one thing, most larger AC adapters, such as those for laptops, are switched-mode power supplies and never have any problems with no-load scenarios.
Answer: Just a word of caution: I just made some thick white (and stinky) magic smoke by paperclipping an old ATX power supply, with a sound effect clearly intended to illustrate runaway loops...

This item was marked "OK" by a previous test (unfortunately, I didn't make a record if that test was loaded or unloaded).
It has sit on a shelf unused for at least 3 years, after that test.
It's an embarrassingly old (2001) & rather weak (250W) Chinese model ("Mercury").

So, what does this mean?
If this was a medical test, with the control test "what if there was some load?" being impossible to perform, the medical staff would certainly warn the other patients in similar condition, but still alive, not to do this. It may not have been directly linked to "no load", but you know the drill: avoid getting the flu if you're 90.
Answer: Power supplies are power supplies.  I've operated and built everything from linear phase to switching to class a...  The load is not going to affect the psu itself in a negative way unless the voltage or current going to a specific compontent such as a capacitor grossly exceeds the spec for the component. The most problematic time this will occur is during the period when the psu is initially powered. This is called inrush current and can be quite high and quite damaging down stream of a toroid. Since all CSA approved apparatus are designed to handle this inrush spike you will have no issues running it without load...unless you have built this yourself and didn't build a buffer into the design.
The only time you may have trouble is (especially with switching psu's) is if you have a low power device connected alone-there is a chance that the voltage at the terminals may be too high,  and may damage the attached device.  Use a voltmeter to ensure that your 12V rails don't exceed about 14.4VDC


WoW addon for making binding spells/macros to mouse easy?

Question: I just bought a Razer Deathadder mouse. Since I use the Bartender add-on, I'm having a difficult time mapping spells/macros to my new mouse. I want to be able to add modifiers such as shift/alt/ctrl-clicking, etc. I have no way of telling what keyboard button my spells are with all of the stuff Bartender adds. What's the easiest way to do this?
Comment: As mentioned by @WerkkreW, the easiest way to do this is use Bartender's Keybinding mode. You just hover over a key and then hit the key or mouse button combination you'd like (so ctrl-MB5, etc).
Answer: I actually use bartender for this purpose.  While I am unsure as to exactly what you mean by:

I have no way of telling what keyboard button my spells are with all
  of the stuff bartender adds.

I will try to describe how I do it with my mouse and my Nostromo.
First of all, Bartender can easily work with modifier keys, you simply enter key binding mode and press the combination (Alt-F) for example, and it will be bound.
I lay out my bars in whatever way I want them to look, put spells on the bars, and enter keybinding mode, hover over the button you want to bind, and press what you want - pretty simple.
Beyond that, you can do other things like hide the bars, or via the Razer configs map the mouse buttons to more standard keyboard buttons.
Comment: I Believe that he is in trouble trying to (ALT + left click) to use a macro or skill. Because the Key binder of Bartender is not recognizing that he pressed ALT together the left click, and only take the left click (or the ALT) to the Key bind.
Comment: Except that's not how the keybinding mode of Bartender works. You can't use chording keys (Alt/Shift/Ctrl) by themselves as a keybind, they only work as a chord of something else (including a mouse click).
Answer: I don't know anything about WoW, but if you have a program that operates your mouse, such as Microsoft Intellipoint (or iPoint), then you can use that to map the Keyboard commands themselves to the mouse instead. For example, you could change Mouse Button 4 to be Ctrl+5.
Answer: By default Windows only recognizes 5 mouse buttons.  You have to download and install the Razer driver to fix that.
With the firmware, Windows recognizes the buttons, but WoW only looks for the first five. So the next step is to use the Razer driver to assign keys to the extra buttons.   Choose keys that are far away so you won't press them by accident, like <code>[];"'./=-</code>.
Once you have translated the buttons to keys, you can then assign them to an ability using Bartender.
And file a ticket so Blizzard and Razer can sit down together and improve this. :)


How to Implement Closures Using SpiderMonkey API?

Question: I've been working with the SpiderMonkey C API and would like to implement a closure in C using their API. The one I would like to implement is fairly complex, but I can't even figure out how to do a simple one such as:
function x() {
   var i = 0;
   return function() { i++; print(i); };

}

var y = x();
y(); //1
y(); //2
y(); //3

I was wondering if anyone knows how I might do this. I found the JS_NewFunction method, but I don't actually know if that is a step in the right direction. Any help will be appreciated, thanks!
Answer: I don't know if there's a pure C way of doing closures or not. I would reccomend though, if you can, to just implement the functionality you need in javascript, and simply evaluate the javascript text in JSAPI. From there, use JSAPI to grab whatever handles/variables you need to implement your host functionality. It's really onerous to do javascripty things using JSAPI, avoid it if you can.
Answer: Narrated as if you're probably still interested, a year later.
Knitting my brows furiously at the documentation for JS_GetParent, I see

For some functions, it is used to implement lexical scoping (but this is an implementation detail).

and then, along with a list of API functions that create functions,

Some of these functions allow the application to specify a parent object. If the JSAPI function creating the object has a parent parameter, and the application passes a non-null value to it, then that object becomes the new object's parent. Otherwise, if the context is running any scripts or functions, a default parent object is selected based on those.

I might experiment with this later, but it seems that you might be able to do this either by (merely) creating the function in the API during the execution of the function that you want it to have the scope of.
Otherwise, you might be able to set the lexical scope of a function to some object manually using JS_SetParent, but the documentation keeps ominously calling that use of parents 'internal'.
</necro>


Data access layer design

Question: I have a web app and a console application accessing a db. The db has 2 tables (A, B) one of which  (A) is specific to the web app. When writing a data access layer, what is the best way to do it? Technically data access layer should provide access to all the data accessible. In doing so, methods to interact with A are exposed to the console application if we have single access layer. Does creating 2 access layers to 2 table in the same database makes any sense? What is a good way to do it?
Answer: I would personally have the data access layer seperate in a class and 1 (or as many intermediate classes) to hold the business entities which would talk/get populated by the data access layer. The Console and Web application then talks to the business entity layer.
For instance:
Data Access Layer
Holds ALL connection information regarding the database, methods to execute stored procedures, functions and queries.  This class would talk to Table A and Table B
Console 1 Entities
This would hold methods/properties that use the data access layer instance to retrieve the appropriate information.  I.e.
public List<string> GetTableAContents() {
   var retVal = Data.RunStoredProcedure("sp_Table1Contents);
   return retVal;
}

Console Application
Console1Entity ce = new ConsoleEntity();
var contents = ce.GetTableAContents();

You would then make a new WebApplication entities class based upon what is relevant to that application. This would provide a three tier architecture.

Data access layer design


Hook when adding or editing a specific custom post type?

Question: I'd like to insert a script and if possible some PHP for a custom post type. I'm looking for a hook to do this on the add new or edit screens. Any idea what I'd use for this? I tried "edit_post" but that didn't seem to work.
Comment: possible duplicate of [Load a script just to custom post type in admin](http://wordpress.stackexchange.com/questions/34894/load-a-script-just-to-custom-post-type-in-admin)
Comment: That's helpful but it's not just scripts I want to load, but PHP as well if possible.
Comment: I did the same mistake as @Howdy_McGee with his duplicate suggestion with my answer. You probably should specify your question, but reading beforehand [How do I ask a good question?](http://wordpress.stackexchange.com/help/how-to-ask) won't hurt.
Comment: There are numerous hooks that will allow you to add PHP to a page, but without knowing where exactly you want to add the code your question can't really be answered with any specificity.
Answer: There is admin_enqueue_scripts():

admin_enqueue_scripts is the first action hooked into the admin scripts actions. This hook provides a single parameter, the $hook_suffix for the current admin page. And it's an action it can only be used to callback a specified function.

Usage like:
add_action( 'admin_enqueue_scripts', 'function_name' );

The codex page provides even an example on how to target a specific admin page:
function wpse162680_enqueue_script( $hook ) {
    $screen = get_current_screen();
    if ( $hook == 'post.php' && $screen->post_type != 'your-custom-posttype' ) {
        return;
    }
    wp_enqueue_script( 'my_custom_script', plugin_dir_url( __FILE__ ) . 'myscript.js' );
}
add_action( 'admin_enqueue_scripts', 'wpse162680_enqueue_script' );

Read Admin Screen Reference on how to target the right screen.

Note: About the other part of your question, maybe Post Status Transitions will help to there, but actually I'm not sure what you want to achieve.
Comment: You can test the current screen id against the post type slug, e.g. `if ( 'post_type_slug' == get_current_screen()->id ) { ... }`
Comment: Actually, I'm also updating the [Code Reference article](https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/), which the Codex article will soon redirect to :)
Comment: This might work, is there a way to target a specific post type?
Comment: I adapted my answer to help you out, but note this is only for scripts too.
Comment: Or as @DrewAPicture said, btw DrewAPicture you're right about your edit, this means the codex page is wrong ;) Do you want to update the codex or should I?
Comment: Going over there I've seen you did it already :) @DrewAPicture
Comment: Great, even better! I really like the new [Code Reference](https://developer.wordpress.org/reference/). @DrewAPicture


How to sharp blurry text on product labels

Question: I am struggling with blurry text on product labels. My image is just on focus but I am not getting the labels to sharpen. What camera settings or lens do I need for?
Comment: Can you please upload 1-2 sample images that show the issue? That really makes it easier for people to give you a suitable answer. Additionally, could you describe what process you use to take the photos? I.e.: what settings did you use, do you use a tri-pod, what lighting do you use?
Answer: It is difficult to say without seeing your images.
First, see if the labels are actually well printed. Sometimes they have a print error where two colors making the text are not aligned.
From there see if:

You have enough resolution
It is not noise due to high ISO
The aperture is not too wide, try using F8 - F11.
You do not have motion blur, due to slow shutter speed, camera shake, lens stabilization.
If your lens is simply not capable of making sharp images.

And last you can apply some sharpening in post.
Answer: If you keep the aperture narrow in your camera setting when you are taking a photo of the product, you will be able to keep the entire object in focus.  Along with this you can also use wide angle lens.


can a brand new car battery cause my alternator to fail?

Question: My battery cavity filled with rain water due to a leak in my tail light of my 328i bmw wagon, and when my mechanic replaced the battery he said the new one was putting out too may amps and then fried the alternator. Is this really a thing?
Comment: Hi James and welcome. Worded like that, no. Batteries don't force amps through an alternator.
Comment: That sounds like "technical Bu**sh1t" to baffle customers... Find a garage or place with a decent auto-electrician and get a proper test done.
Comment: the battery put out too many amps for the alternator and it blew the alternator? LOL. its the other way around if anything.
Comment: What year is it and was the battery coded to the PCM when it was installed if it had to be?
Answer: The alternator puts amps into the battery, not the other way around... Unless he is talking about the voltage regulator, I guess you could blow that up but not really sure how likely that is in any shorting situation. Might have been a bad hookup attempt.
Is the alternator not working at all or is it just really really weak?
Its possible that having a dead battery caused your already worn out alternator to work harder full-time (a running car can continue to operate on just the alternator and no battery, although not electrically recommended) so that may have worn out the alternator during the (short) time you were running it like that.
If that happened, then more than likely you can just have the alternator rebuilt for much cheaper than buying another unit.
If the voltage regulator is blown, then depending on the car/alternator you can either replace just the regulator on the alternator, or you might have to replace the whole alternator, or you might have to replace the ECU.
Comment: The alternator fuse should blowout if the battery and the other loads draw too much current


Proprietary cards

Question: I was recently reading about automotive fare collection systems and came across loyalty card systems. In these systems, if I understood correctly, each passenger has a card in which a value, not money, is stored. Whenever the passenger uses his card a reader decreases the stored value in the card, and the system administrator rewards the passenger according to his policy.
I was wondering if each of those devices that participate in the AFC, readers/cards etc, must conform to specific security standards and I do not mean the crypto algorithms.
To be more specific, I would like to know if, for example, I develop a Mifare NFC reader in order to sell it, does it need to have a security certification or something like that? Does anything have to do that if the transaction values are used instead of money?
Any info will help.
Comment: I think this is too broad. If the card represents a value, there are almost certainly requirements on the readers, but which ones they are will depend on the company that makes the card and the local law.
Comment: If you try to sell software (they won't care for hardware as its standard across all contactless cards) that interacts with such cards, expect to get a lawsuit against you pretty fast since their "security" only relies on security by obscurity and you essentially broke that "security" by making your third party software. If you want to release such software, you better do so anonymously.
Comment: @Daniel. No, I dont intend to release sw. I am simply wondering about the certifications/standards that the devices must fulfil. If I buy such a device, how could i know if it is secure?
Comment: @Herc11 all a card reader does is relay data packets from the computer to the card and the other way around; there is no encryption nor security involved (if there is, then the encryption happens between the card and computer and the reader just relays whatever data there is without taking part in that encryption), so you should only be concerned about the security of the software, the computer connected to the reader.
Comment: Basically, unlike POS "card readers" which are complete computers capable of storing, processing and making transactions using credit card data, USB or serial card readers that you connect to a computer only relay whatever the card transmits to the computer and the other way around, but it isn't capable of storing nor making transactions by itself, that's why there is no particular security requirements for such a card reader, as no sensitive data is ever stored on it.
Comment: @ Daniel. I think that they usually use SAMs which in them all the crypto keys are stored. But, I was thinking that the device has to be tamperproof or something like that.
Comment: @Herc11 well if you do need to store crypto keys then yes you may need an HSM (make a custom one that connects via USB to the computer or maybe reuse its TPM if it has one) but the actual reader is just a dumb device that translates NFC (RFID) to USB and shouldn't store any sensitive data by itself.
Answer: If you want to build and sell a product similar to this loyalty card item, there is strictly no legal need for a certification of any kind.
However, if you want to sell it, you need a buyer, and a good buyer will compare different sellers before actually buying. And if:

On one hand, the buyer encounters a seller telling him that his product has been officially certified by some well known independent organism guarantying that his own "loyal" customers will have no easy way to fraudulently add some credit to their card,
On the other hand you come and say that your card has not been certified, but it is cheaper or any other advantage you may think about.

Then you should understand that certification quickly becomes merely a marketing issue than an actual security or legal one. Certification requirement will therefore depend on the market and usage you target for your card.

Proprietary cards


How should I find an average for data that randomly fluctuates?

Question: I have data for the temperature of a flame at a given height above the burner. The temperature fluctuates quite a bit (see figure), but there is definitely an "average" value that it tends to fluctuate around. Is there a good way to find this value? I'm using excel for data analysis.
Comment: Which column contains the temperature data? (A, B, C,...)
Comment: If you have the raw data you could simply just average in the time period where the fluctuations occur no?
Answer: If that's your data, well, then that is it. Dont try to manipulate your data or methods to get what you want to see. Just take the average of each burner.
One other thing you could do is to look for the possible sources of variability on your measurements and try to reduce that variability to the minimum. Or you could just take measurements for a longer time, so you got more points to average, it should look less random.
Comment: The reason I collected this data was to design a thermal device, but I'm hoping to have a relatively stable number that I can begin my design with. For example, if I want to design a fin to operate at burner level 2, I'd like to know what the average temperature is (it looks like it's close to ~650 degrees C in the graph but I don't know how to mathematically prove this). Thanks for your tips so far!


PyMC structure learning

Question: Is it possible to learn the structure of a Bayesian network using PyMC? I have ~100 examples and all features are discrete. Here is an example of causal modeling, but the structure is already known. In my case, I know the priors of just one variable, the root.
Answer: I think the short answer is no.  Pymc is not really designed for Bayesian networks but for Bayesian data analysis, which are not the same thing.  There is some overlap in that both use a DAG structure for inference, but there are no structure learning algorithms like PC available in the API.  With continuous random variables, you cannot simply switch the inferential direction and easily calculate the likelihood of the data.

PyMC structure learning


Greensock library, which is the best option, TweenLite, TweenNano, TweenMax, TimelineMax?

Question: i am new in flash development, i heard that Greensock lib is the best one. But when am trying to download  its really confusing. there are a lot of names like
* TweenNano
* TweenLite
* TweenMax
* TimelineLite
* TimelineMax
* Tweening Platform v11

Which is the best or full featured lib.. where do i get the download link for the complete package or. Please guide me if am wrong. :(
Answer: I would suggest using TweenLite, it is the basic tweening package. TweenMax has some more features but I only ever rarely need them. I've not used TweenNano as it seems to be missing some key functionality.
The other packages are for more specific types of tweening, like the timeline packages.
This is from the website:
Why are TweenLite and TweenMax split into 2 classes instead of building all the functionality into one class?

File size. The majority of tweening doesn't require the extra features in TweenMax like setDestination(), timeScale, repeat, repeatDelay, etc. so TweenLite is perfectly sufficient. TweenLite prioritizes efficiency and small file size whereas TweenMax prioritizes a rich feature set.
Speed. TweenLite is slightly faster than TweenMax because it requires less code, although you'd probably never notice any difference unless you're tweening multiple thousands of instances. See the speed test.

TweenNano can do everything TweenLite can do with the following exceptions:
No Plugins - One of the great things about TweenLite is that you can activate plugins in order to add features (like autoAlpha, tint, blurFilter, etc.). TweenNano, however, doesn't work with plugins.
Incompatible with TimelineLite and TimelineMax - Complex sequencing and management of groups of tweens can be much easier with TimelineLite and TimelineMax, but TweenNano instances cannot be inserted into TimelineLite or TimelineMax instances.
Slight speed decrease - Under very heavy loads, TweenNano won't perform quite as well as TweenLite, but it is extremely unlikely that you'd notice unless you're tweening thousands of objects simultaneously.
Fewer overwrite modes - You can either overwrite all or none of the existing tweens of the same object (overwrite:true or overwrite:false) in TweenNano. TweenLite, however, can use OverwriteManager to expand its capabilities and use modes like AUTO, CONCURRENT, PREEXISTING, and ALL_ONSTART (see this link for details).
Compared to TweenLite, TweenNano is missing the following methods/properties:
pause()
play()
resume()
restart()
reverse()
invalidate()
onStart
defaultEase
easeParams
currentTime
startTime
totalTime
paused
reversed
totalDuration

Answer:
TweenNano is for the most basic tweening (start a tween and knows when finish)
TweenLite is the base of all. Have the complete functionality (to create, pause/play, restart an reverse a tween and a lot of plugins)
TweenMax adds very useful things to TweenLite activating some plugins by default. Also adds the progress property that lets you move the tween time line where you want; event listeners and the special parameters: yoyo and loop (that makes a yo-yo-kind tweening and a loop a tween  as many times you want)
TimelineLite and TimelineMax are not Tweening engines, they are just TweenLite/TweenMax managers.
Tweening Platform v11 is just the collection of TweenNano, TweenLite, TweenMax, TimelineLite and TimelineMax (is just a name for their products, like "Adobe Creative Suite")

Here you can download the complete Tweening Platform (to test the differences between TweenNano, TweenLite and TweenMax) or you can choose to download one of the features.
PS: Sorry for my poor English.
Answer: I would definitly recomend the original Tweener. Has everything you need, and not much that you don't. It's also been ported to every other language you can think of.
Comment: I would never recommend Tweener, as it's performance is really not anymore on the same league as TweenLite/TweenMax. Check the speed test: http://blog.greensock.com/tweening-speed-test/
Answer: Note that if you're using Greensock for commercial use, you are supposed to pay a license. If you're working for a client rather than for yourself you have a responsibility to point that out!
I was using TweenMax up until the moment I realised that, then wholesale changed to Tweensy; it's still in incubation, but has a friendly license. The conversion wasn't pain-free, but I've yet to do anything in TweenMax that I couldn't do with Tweensy.
Comment: I don't think this is correct. You only have to pay for Greensock if the end-user pays, not if a client pays you to develop their flash app. Whoops.. way old topic. Sorry about that.
Answer: Start with TweenLite - it is the foundation of the whole tweening platform, and includes 90% of everything you will ever need.   If for some reason you get a ways down the road and you realize you need some more advanced features like tween progress events, its trivial to swap out for tween max.    Tween nano is only used in places where extremely minimal filesize is paramount - such as making a awesome banner in 15k.   But again, these are very interchangeable and upgradeable.
As far as the timeline classes, stay away from them while you are just starting out.  Once you get familiar with tweening with one of the aformentioned teqniques, you will encouter instances during some complex tween where you really want to use sequence, as in control nested groups of tweens, but agian, better to save that till you get up to speed with the general stuff, the timelinelite & max are icing on the cake and not really needed, but very usefull to a skilled tweener.
Good luck!


As a developer, what if I don't support iOS 3.1?

Question: I am currently developing an iOS application. I'm considering not supporting anything less than iOS 3.1. I was wondering, can I expect a huge backlash from customers that buy this application and try to use it on devices that haven't been updated in years?
Comment: This is off-topic, and probably would have been better answered over at Programmers. But since an answer has already been accepted and votes in place, there is little point in migrating so I will leave it open. (To that point, why do people only wait an hour to see what comes in? It seems like the question is being short-changed). Other mods or the community may disagree. *C'est la vie.*
Comment: I think this one is quite fit for programmers.se.com
Comment: Sorry officer. I will do better next time.
Comment: Don't be scared. It's a cruel world.
Comment: I'm going to delete my earlier comment on fit due to popular opinion :-) (so much for being quiet)
Answer: You can find Marco Arment's stats on iOS version he collected from his Instapaper app (as CanuckSkier say in the comment, Instapaper is generally used by tech-savvy people, so "real"-people usage might be slightly less).
Here's a graph:

As you can see, at least 98% of users are already on iOS 4.0 and 96% on 4.2. So I guess you can safely stop supporting iOS 3.x.
Comment: It's worth noting that those stats are *only* from Instapaper customers, so not necessarily representative of the iOS market as a whole. In my observation Instapaper tends to be more popular among the nerd set, who tend to upgrade more often. Of course, how much that impacts the data is unclear. These numbers are a great starting point, it's just something to keep in mind.

That said, by supporting ≥4.2.1, you only lose original iPhone and 1st generation iPod Touch users, which is probably a safe bet.
Comment: Right, I updated my answer to tone down a bit the stats.
Comment: Thanks Loic Woiff! I do share CanuckSkier's opinion. I had read Marco's blog post. It's a good read. This post of his gave me some cause to ignore IOS 3.1,, some. However, my market is focused on parents with small children. And, in my small little circle of friends that have agreed to beta test the application, it seems that 10% of them are running with 1st gen iPodTouches that have never been updated. Now, had I have been Marco doing the same test with friends, I would imagine that percentage to be much less. Thanks to you both.
Comment: I love the _thinking_ behind marco's handling of this dilemma that all developers face.
Comment: Agreed. He seems to think things through pretty thoroughly and seems to be pretty smart. If you're interested in more details on this and other iOS dev topics (plus a bunch more general nerdery), definitely check out his podcast on [5by5](http://5by5.tv), [Build & Analyze](http://5by5.tv/buildanalyze) if you don't already listen. He talks about this issue specifically in episode #29 I think.
Comment: I'm confused. How is it possible to have 100% of the users on iPhone/touch using 3.1?
Comment: It's **at least**. That means he's 100% sure that its users are at least on 3.1.
Answer: Just to add to the good data already available, here's some June 2011 data from a free, "who buys the next round" app, which may be a bit more representative than Instapaper:

While not quite as high as the percentage of Instapaper users, more than 95% on iOS 4 suggests you won't be missing out on a big number of users.
Answer: You can check for yourself.  Look in the iTunes app store for popular apps which cater to the same customer demographic as yours, and which only run on later OS versions (3.2, or 4.1 or later).  Check the reviews for those apps, and see the proportion of negative comments they get for not supporting such-and-such.
Usually the amount is tiny, as users of older devices, and people who don't update their OS, don't buy as many apps as people who have the latest devices and/or upgrade their OS.  Many popular and highly rated apps are only compatible with very recent OS versions.
So, no huge backlash.
Comment: Ehh, don't you have to buy an app in order to review/rate it nowadays? I wouldn't expect any negative comments in this case...
Comment: @panix : Maybe not so surprisingly, given human nature, the number is non-zero, as some people buy apps apparently without reading the app's description or device requirements.
Answer: This is more of an opinion answer, but I suspect that the number of people with old iOS versions will decrease as time goes on, whereas the number of people with up-to-date iOS versions will increase a lot, both as more people buy iOS devices and as iCloud makes software updates easier (no iTunes required) and faster (delta updates).
Time spent supporting even 3.1 is worth less as time goes on, whereas time spent focusing on the new features in later versions pays off now, and keeps paying off.


why CO2 is not organic

Question: this might be very childish question but i am comfused because they say that organic molecules are those that contain H and C if that is so how can you call carbontetrachloride organic, even it hasn't any H atoms
Comment: Don't listen to them. I would say $CO_2$, $CH_4$, $CCl_4$ are all organic. This type of classification has no real use anyway.
Comment: Related: [Is carbon dioxide organic or inorganic?](http://chemistry.stackexchange.com/q/22195/7951)
Answer: Carbon dioxide
"is" neither organic nor inorganic, it's just carbon dioxide.
This distinction is nothing but a convention to separate things
between the textbooks and professors.
Carbon dioxide forms carbonic acid in water and the usual salts.
This was/is reason to think of it as inorganic.
On the other hand, urea, the diamide of carbonic acid was thought
to be organic when Wöhler synthesized urea for the first time
in lab, today it is categorized as inorganic.
Answer: An organic compound
1) must be a (stoichiometric) compound.  Graphite, diamond, buckyballs, polycarbyne, etc. are not compounds.
2) must contain reduced carbon, at least one C-C or C-H bond.  Carbon tet is inorganic, chloroform is organic.  Urea, guanidine, cyanuric acid, isocyanic acid, melamine are inorganic.
Carbon monoxide, carbon dioxide, phosgene, carbonic acid are inorganic.  Ethylene carbonate, vinylene carbonate, oxalic acid, formic acid, dichloroacetylene are organic.  Aluminum carbide, $\ce{Al4C3}$, is inorganic (hydrolyzes to methane).  Calcium carbide, $\ce{CaC2}$ is organic (hydrolyzes to acetylene).
Comment: Buckyballs aren't compounds? Are you sure about that?
Answer: The C-H bond has a lower bond energy than
the carbon-oxygen bond in carbon dioxide,
making carbon dioxide more stable/less
reactive than the typical organic compound.
So, when you're determining whether a carbon
compound is organic or not, look to see
whether it contains hydrogen in addition to
carbon and whether the carbon is bonded to
the hydrogen.
Comment: According to this definition, hexachlorobenzene and tetrafluorethen are not organic.

why CO2 is not organic


Battery meter shows 6 minutes left immediately after unplugging power, and hibernates sometimes

Question: I have a Lenovo y400. Whenever I unplug the laptop, the battery meter shows 0:06 or less and the Laptop battery critically low message pops up. It hibernates once in a while, the rest of the time it increases gradually and shows the correct time after about a minute. How can I fix this?
Answer: Maybe you can try a power saving app like TLP. I've been using it since some days and it has been really efficient for my battery usage.
You can find a great configuration help for that here:
Is there a power saving application similar to Jupiter?
Comment: My problem isn't battery usage. It's that the amount of charge/time left on battery is read wrong initially, hence the hibernating.


Is there a trick to defeat red helmets?

Question: I am kind of struggling with defeating red helmets in unepic. Although I managed to get 5 of them down one by one for the quest to get frost magic I am having a hard time solving the quest where I should rescue some frost/water monster which is located in a room with like 10 of these nasty little creatures. So any tricks or a bullet proof strategies out there?
Answer: There seems to be a way to kill them much faster than with arrows.
SPOILERS BELOW, move MOUSE over to show:
spoiler 1/4:

 They are elemental.

spoiler 2/4:

 They are related to the fire element (you noticed that they throw fireballs).

spoiler 3/4:

 Their weakness is in the opposite element.

spoiler 4/4:

 Their weakness is to ice. With wand of ice, I kill them in 2 hits.
Answer: I think there are three crucial parts of getting them down:

Aim

The first task is to get the aim on one of the helmets without getting shot.
Sometimes one might simply get into aiming distance without activating the helmets.
Often on has to run forward, aim and immediately run back.

Shoot:

Once your little hero aims at the helmets you can shoot them by running into shooting distance, shooting, running back.
This is very much about timing but should work pretty well.

Weak points

All helmets belong to a certain category that defines their resistance as well as their weaknesses.
While it makes no sense to attack fire with fire. Ice bolts should bring down fire helmets down pretty fast.
Those pets following you might help their as well.

Is there a trick to defeat red helmets?


Java 2D tile map and rendering it

Question: Please help me! I am thinking of generating different terrains environment every time the game loads again. But i am thinking of loading or drawing a image containing all the units like river, land and tree. Then the checking of obstacles against the units like boat, car and plane. I have done lots of research but i am struck on how to do it. Please help me.
Comment: What you've described could be literally anything in a game. What exactly are you asking?
Comment: Check out the [FAQ] for some discussion oriented sites. Where to get started questions should be asked there.
Answer: The question is a bit general so here's a general answer. http://code.google.com/p/libgdx/wiki/TiledMaps gives a tutorial on using a tilemap (http://www.mapeditor.org/) within your game. You can dynamically change tiles, etc. Each tile may have properties, such as which objects are stored within it, or whether it is water (in which case you'd only let a player swim or use a boat, but not drive a car) or whether it's a tree (in which case you can't walk through it) etc. If you want a more specific answer you'll have to provide a more specific question.

Java 2D tile map and rendering it


Profiling Azure Worker Role

Question: I am looking for something to do for Azure Worker Roles what New Relic and AppDynamics can do for Azure Web Roles.  I have tried both solutions for my background workers with little success.  Am I missing something in configuration for either of these services or is there another service out there that can do what I need?  I am open to hosting my own service if there is an option I run "locally".
What I'm looking for:

See hot paths (Which methods are taking up the most CPU)
See bottle necks (Methods that are stalling, and the callers would be nice)
Near real-time CPU/Memory/Disk/Network usage
Web Interface to view all of these stats

Nice to have:

Pull windows and azure event logs from the server
Answer: You should try Compuware's dynaTrace
Comment: Thanks, I'm looking into this.  Will report back.

Profiling Azure Worker Role


My MacBook was stolen: can the thief access my files without my account password?

Question: My computer is set up to require a login after its been put to sleep and it has a fairly complex password, so I'm not worried about anyone guessing it. The MacBook was stolen, and I'm wondering if there's a way for that person to access my files, or will they just have to wipe the drive (hopefully).
Comment: If there is an answer that helped you, feel free to mark it as the accepted answer by clicking the check mark.
Answer: I'm sorry your MacBook was stolen.  That really sucks.
Sadly, there are numerous ways to read the data ranging from removing the drive or placing the Mac in target mode. Your password only protects things when the mac is booted into your unmodified OS.
To answer your question, Physical access is total access.
It would be trivial for someone to boot using a Linux LiveCD and mount your drive, thus accessing your files.  All they'd have to do to get past your sleep/password would be to hard power down the system.
Additionally, from the link above:

Mac OS X: Single User Mode

To boot a Mac into "Single User mode", simply boot the computer and press Apple + S when blue first
   shows up on the screen. Next, mount the harddrive, and either dump the
   password and crack it with a tool like John the Ripper, or simply
   overwrite the root password:
<code># /sbin/mount -wu /
# /sbin/SystemStarter
To dump the existing root password:
# nidump passwd
To create a new root password:
# passwd root
</code>
Comment: thanks; it happens. it was a break-in so many things were taken. the most critical stuff was on an encrypted disk image so I think that's safe but at least I know I should consider everything else compromised.
Comment: I'm so sorry...
Comment: @Sed My apologies as well, that's really terrible. Now obviously there's a risk that the thief's will be able to gain access to your files, but more likely than not, they lack the knowledge to do so and your computer will probably end up being wiped clean without anyone even attempting to peak around.
Answer: As Kalamane's answer points out, unfortunately the thief can access your data very easily, as it sits on your disk unencrypted. It is unfortunately trivial to bypass OS X passwords by booting into single user mode.
It won't help now, but for the future, here are two tips that can help in case of laptop theft.
First of all, if you're like me and carry your laptop almost everywhere (so the likelihood of it getting stolen/lost is relatively high), seriously consider Apple's FileVault 2. FileVault 2 encrypts your entire hard-drive, seamlessly. This means that you can still use your computer as normal (you won't even notice that FileVault is on), but in case it gets stolen, the attacker won't be able to read anything from the hard-drive without knowing your password.
Secondly, enable the "Find My Mac" feature available in OS X Lion (go to Preferences - iCloud - Find My Mac). In case your laptop gets stolen, you will then be able to login to icloud.com from any computer, and see the last location where your MacBook has been on a map. You will also get the following interface, which you can use to remotely display a message on your Mac, wipe the Mac completely, or lock it:


Mom died. The family photos are on her Google account. I would like them released

Question: Dad didn't spend much time on the computer, so mum stored the family photos under her account.
I have provided ID and death certificate to Google, but now they want a California Court Order for them to release the photos to me.
This gets awkward, since mum was, and I am, Swedish citizens, and none of us are US citizens.
Does anyone have a solution?
Comment: Does Google know you are Swedish citizens? Google has to abide by the laws of any country they operate in and you may be provided additional protections under Swedish law. Additionally I'm not sure what is awkward about this situation. Follow Google's process, or please detail why you can't. Good luck! :)
Comment: Google's [Inactive Account Manager](https://www.google.com/settings/account/inactive) lets people control what will happen to their data. Sorry, @MariaBenzin, that option is too late for your mum, but you and your dad can still prepare for the future.
Comment: I don't even know how to get a court order in California :) Where do I turn? Who do I ask?
Comment: Hope you've found some way to recover the photos already. If not, you could try recovering the Google Account password assuming you have access to to the phone number with which the account was registered.
Answer: From Submit a request regarding a deceased user's account

People expect Google to keep their information safe, even in the event
  of their death.
Make plans for your account
Inactive Account Manager is the best way for you to let us know who
  should have access to your information, and whether you want your
  account to be deleted. Set up Inactive Account Manager for your
  account.
Make a request for a deceased person's account
We recognize that many people pass away without leaving clear
  instructions about how to manage their online accounts. We can work
  with immediate family members and representatives to close the account
  of a deceased person where appropriate. In certain circumstances we
  may provide content from a deceased user's account. In all of these
  cases, our primary responsibility is to keep people's information
  secure, safe, and private. We cannot provide passwords or other login
  details. Any decision to satisfy a request about a deceased user will
  be made only after a careful review.

Below the above content there is a questionnaire. Check it out learn above the alternatives and information that Google requires regarding accounts / content of deceased people.
Comment: I clicked the link for "obtain data from a deceased person's account, and the first statement is:

Before you start this form, please review the information below and check to confirm that you agree.

I understand that, if my request to get information from a deceased person's account is approved, I will need to get a court order issued in the United States. I also understand that Google will provide me with the necessary language for the court order. *

So I need to find a lawyer in US to help me with that...
Answer: Did your mom have a phone number linked to her google account? If so you could use her phone to try to re-set her google password, possibly. Once you can get into her email you might be able to access her photos.


How can I get OSX split screen to work?

Question: OSX on Mac now allows two apps to split the screen.
https://support.apple.com/en-us/HT204948
Doesn't seem to work in Mathematica, even though the full-screen button displays an icon suggesting that it should.
Answer: Update: Mathematica 12.0 now supports this.

You can't.  This feature only works with certain programs and as of version 10.4 Mathematica is not one of them.  Maybe the coming Mac front end improvement mentioned in this presentation will fix that, but this is purely a guess on my part.
As a workaround you can use window control software such as Spectacle, which makes it easy to arrange notebooks in a similar way to how the split-screen feature would.
Comment: I would recommend [BetterTouchTool](https://www.boastr.net/) for a similar functionality. It is a paid app since version 1.55, but older versions were free if you can find them somewhere.
Comment: Depending in the version, iirc if you start the spilt screen with a different app first, you can then choose MMA...which may be helpful for reading anf programming. However you cant start a split screen with two mma windows regardless of version natively in osx below version 12
Comment: @morbo That doesn't work for me ... The FE was only ported to Cocoa for M12.0.

How can I get OSX split screen to work?


Development system with MAMP won't run after MAMP upgrade?

Question: I have a development system with MAMP and gulp and my localhost version of my website was running fine.  I upgraded MAMP from 3.5.2 to 4.4.1.  When I restarted MAMP it said it needed to upgrade the database, which I let it do.  Now when I try to start the website, it just spins at the localhost:6002 (for example) website address and the site will never launch.
Any thoughts on how to chase down this problem.
Answer: The ports were changed to 7888 and 8888 and I needed to set them back to what I was currently using.


List all of the possible goals in Maven 2?

Question: I'm new to Maven, coming from the Ant world.
Is it possible to list all of the possible goals (including, say, all the plugins) that you can run?
I can see that there used to be a -g flag in Maven 1, but this isn't available in version 2.
Comment: It drives me nuts that maven can't answer this question without pages of xml!  Good stuff!
Comment: Possible duplicate of [How to display a list of available goals?](http://stackoverflow.com/questions/1674524/how-to-display-a-list-of-available-goals)
Answer: The goal you indicate in the command line is linked to the lifecycle of Maven. For example, the build lifecycle (you also have the clean and site lifecycles which are different) is composed of the following phases:

validate: validate the project is correct and all necessary information is available.
compile: compile the source code of the project.
test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.
package: take the compiled code and package it in its distributable format, such as a JAR.
integration-test: process and deploy the package if necessary into an environment where integration tests can be run.
verify: run any checks to verify the package is valid and meets quality criteria
install: install the package into the local repository, for use as a dependency in other projects locally.
deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

You can find the list of "core" plugins here, but there are plenty of others plugins, such as the codehaus ones, here.
Comment: have a look at the Lifecycle Reference. All lifecycle parts are listed there.
Answer:
Is it possible to list all of the possible goals (including, say, all the plugins) that it is possible to run?

Maven doesn't have anything built-in for that, although the list of phases is finite (the list of plugin goals isn't since the list of plugins isn't).
But you can make things easier and leverage the power of  bash completion (using cygwin if you're under Windows) as described in the Guide to Maven 2.x auto completion using BASH (but before to choose the script from this guide, read further).
To get things working, first follow this guide to setup bash completion on your computer. Then, it's time to get a script for Maven2 and:

While you could use the one from the mini guide
While you use an improved version attached to MNG-3928
While you could use a random scripts found around the net (see the resources if you're curious)
I personally use the Bash Completion script from Ludovic Claude's PPA (which is   bundled into the packaged version of maven in Ubuntu) that you can download from the HEAD. It's simply the best one.

Below, here is what I get just to illustrate the result:

$ mvn [tab][tab]
Display all 377 possibilities? (y or n)
ant:ant
ant:clean
ant:help
antrun:help
antrun:run
archetype:crawl
archetype:create
archetype:create-from-project
archetype:generate
archetype:help
assembly:assembly
assembly:directory
assembly:directory-single
assembly:help
assembly:single
...

Of course, I never browse the 377 possibilities, I use completion. But this gives you an idea about the size of "a" list :)
Resources

Guide to Maven 2.x auto completion using BASH
Fixing Maven 2.x BASH auto completion on CYGWIN
Maven bash completion
maven2 bash completion complete
Maven Tab Auto Completion in Bash
Advanced Bash completion script for Maven 2
Comment: Didn't had a look at it yet, but does the new `Maven Shell` tool provide a auto completion, that could be usefull here?
Comment: @romain No, `mvnsh` doesn't provide completion (at least not in the version I have on my machine). I checked before answering :)
Answer: Strange nobody listed an actual command to do it:
mvn help:describe -e -Dplugin=site

If you want to list all goals of the site plugin. Output:

Name: Apache Maven Site Plugin Description: The Maven Site Plugin is a
plugin that generates a site for the   current project. Group Id:
org.apache.maven.plugins Artifact Id: maven-site-plugin Version: 3.7.1
Goal Prefix: site
This plugin has 9 goals:
site:attach-descriptor   Description: Adds the site descriptor
(site.xml) to the list of files to be
installed/deployed.
For Maven-2.x this is enabled by default only when the project has pom
packaging since it will be used by modules inheriting, but this can be
enabled for other projects packaging if needed.
This default execution has been removed from the built-in lifecycle of
Maven 3.x for pom-projects. Users that actually use those projects to
provide a common site descriptor for sub modules will need to explicitly
define this goal execution to restore the intended behavior.
site:deploy   Description: Deploys the generated site using wagon
supported protocols to
the site URL specified in the  section of the POM.
For scp protocol, the website files are packaged by wagon into zip archive,
then the archive is transfered to the remote host, next it is un-archived
which is much faster than making a file by file copy.
site:effective-site   Description: Displays the effective site
descriptor as an XML for this
build, after inheritance and interpolation of site.xml, for the first
locale.
site:help   Description: Display help information on
maven-site-plugin.
Call mvn site:help -Ddetail=true -Dgoal= to display parameter
details.
site:jar   Description: Bundles the site output into a JAR so that it
can be deployed
to a repository.
site:run   Description: Starts the site up, rendering documents as
requested for
faster editing. It uses Jetty as the web server.
site:site   Description: Generates the site for a single project.
Note that links between module sites in a multi module build will not work,
since local build directory structure doesn't match deployed site.
site:stage   Description: Deploys the generated site to a local
staging or mock
directory based on the site URL specified in the
section of the POM.
It can be used to test that links between module sites in a multi-module
build work.
This goal requires the site to already have been generated using the site
goal, such as by calling mvn site.
site:stage-deploy   Description: Deploys the generated site to a
staging or mock URL to the
site URL specified in the  section of the POM,
using wagon supported protocols
For more information, run 'mvn help:describe [...] -Ddetail'

More details on https://mkyong.com/maven/how-to-display-maven-plugin-goals-and-parameters/
Comment: e.g for spring boot:
mvn help:describe -e -Dplugin=spring-boot
Answer: If you use IntelliJ IDEA you can browse all maven goals/tasks (including plugins) in Maven Projects tab:
Comment: I would like to do this via some command. How IntelliJ IDEA does it?
Answer: A Build Lifecycle is Made Up of Phases
Each of these build lifecycles is defined by a different list of build phases, wherein a build phase represents a stage in the lifecycle.
For example, the default lifecycle comprises of the following phases (for a complete list of the lifecycle phases, refer to the Lifecycle Reference):

validate - validate the project is correct and all necessary information is available
compile - compile the source code of the project
test - test the compiled source code using a suitable unit
testing framework. These tests should not require the code be
packaged or deployed
package - take the compiled code and package it
in its distributable format, such as a JAR. verify - run any checks
on results of integration tests to ensure quality criteria are met
install - install the package into the local repository, for use as a
dependency in other projects locally
deploy - done in the build environment, copies the final package to the remote repository for
sharing with other developers and projects.

These lifecycle phases (plus the other lifecycle phases not shown here) are executed sequentially to complete the default lifecycle. Given the lifecycle phases above, this means that when the default lifecycle is used, Maven will first validate the project, then will try to compile the sources, run those against the tests, package the binaries (e.g. jar), run integration tests against that package, verify the integration tests, install the verified package to the local repository, then deploy the installed package to a remote repository.
Source: https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
Answer: Lets make it very simple:
Maven Lifecycles:
1. Clean
2. Default (build)
3. Site
Maven Phases of the Default Lifecycle:
1. Validate
2. Compile
3. Test
4. Package
5. Verify
6. Install
7. Deploy
Note:
Don't mix or get confused with maven goals with maven lifecycle.
See Maven Build Lifecycle Basics1


how do I debug a Drush bootstrap issue?

Question: Apologies for the length of this post.  I have a Drupal install where the drupal files (and all content) is on one server, and the database is on another.  The site itself is working fine, and all admin tasks are possible from the admin UI.
However, when I try to execute any commands using Drush, I get output similar to the below.
command used:  drush up --debug
Output:
Starting Drush preflight. [0.04 sec, 4.13 MB]                        [preflight]
Cache HIT cid: 7.0.0-commandfiles-0-7b327cc676585aaed226364ef9373982     [debug]
[0.07 sec, 4.22 MB]
Bootstrap to phase 0. [0.34 sec, 10.28 MB]                           [bootstrap]
Bootstrap to phase 6. [0.34 sec, 10.29 MB]                           [bootstrap]
Drush bootstrap phase : bootstrap_drupal_root() [0.35 sec, 10.86 MB] [bootstrap]
Initialized Drupal 7.34 root directory at                               [notice]
/users/castaff/dfitzpat/public_html [0.37 sec, 10.86 MB]
Find command files for phase 1 (max=6) [0.37 sec, 8.49 MB]               [debug]
Cache HIT cid: 7.0.0-commandfiles-1-3ca83829a6f5d5a7b3d70d3f4652b7de     [debug]
[0.37 sec, 8.5 MB]
Drush bootstrap phase : bootstrap_drupal_site() [0.38 sec, 8.51 MB]  [bootstrap]
Initialized Drupal site default at sites/default [0.38 sec, 8.51 MB]    [notice]
Find command files for phase 2 (max=6) [0.39 sec, 8.51 MB]               [debug]
Cache HIT cid: 7.0.0-commandfiles-2-f17fc6bdab2f74278df75194ca483893     [debug]
[0.39 sec, 8.51 MB]
Drush bootstrap phase : bootstrap_drupal_configuration() [0.4 sec,   [bootstrap]
8.58 MB]
Find command files for phase 3 (max=6) [0.4 sec, 8.59 MB]                [debug]
PDO support is required. [0.41 sec, 8.75 MB]                         [bootstrap]
Bootstrap to phase 5. [0.41 sec, 8.75 MB]                            [bootstrap]
Command pm-update needs a higher bootstrap level to run - you will   [error]
need to invoke drush from a more functional Drupal environment to run
this command. [0.41 sec, 8.75 MB]
The drush command 'up' could not be executed. [0.41 sec, 8.75 MB]    [error]
Drush was not able to start (bootstrap) the Drupal database.         [error]
Hint: This may occur when Drush is trying to:
 * bootstrap a site that has not been installed or does not have a
configured database. In this case you can select another site with a
working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for
details.
 * connect the database through a socket. The socket file may be
wrong or the php-cli may have no access to it in a jailed shell. See
http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:
 Drupal version         :  7.34
 Site URI               :  http://default
 Database driver        :  mysql
 Database hostname      :  localhost
 Database port          :
 Database username      :  db_user
 Database name          :  [db_name]
 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php5/cli/php.ini
 PHP OS                 :  Linux
 Drush script           :  /users/castaff/dfitzpat/.composer/vendor
                           /drush/drush/drush.php
 Drush version          :  7.0.0
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :
 Drupal root            :  /users/castaff/dfitzpat/public_html
 Site path              :  sites/default

 [0.57 sec, 11.43 MB]

Intrestingly, the command:
drush sql-cli
connects fine.
If anyone can shed light I'd be most grateful.  I've tried:

replacing localhost with 127.0.0.1;
Replacing with the exact ip of the server on which the database is located.

I'd like to find out where this is failing and then (obviously) how to fix it.
Many thanks.
Answer: Best solution for me is using Xdebug.
Here is a great article for configuring it with PHPstorm
https://www.lullabot.com/blog/article/debugging-drush-commands-xdebug-and-phpstorm

how do I debug a Drush bootstrap issue?


Preventing Ubuntu theme from changing the appearance of Firefox

Question: How do I prevent the themes that I've installed into Ubuntu from affecting how Firefox looks? Changing the way the window looks is okay, but it's changing the way my tabs, menus and text box areas are looking.
Comment: "Destroying"? How about "changing the appearance of"?
Answer: I'm afraid that isn't possible unless there was a feature implemented specifically to do this, since Firefox uses native widgets. For example, an OK button on a dialog will look the same as an OK button in Firefox options. The goal is to make a general look and feel applied for all native apps. You can use themes though to change Firefox's look a little more to your liking.
Comment: Actually there is a way, at least now:

https://unix.stackexchange.com/a/185115

As I mentioned in my answer, clashes between the user's environment, the application, the user's profile *in* that application, and finally the web developer's stylesheets are basically inevitable. In my case every radio button and check box was invisible and I was stuck with constantly tweaking a global stylesheet with lots of `!important`s to fix all the edge cases until I found this solution.
Answer: There is a way! I'm so happy to have found this - my GTK theme works great for menus and most applications, but makes color choosers in Tilda and many input types in Firefox (check boxes, radio buttons, some textareas, etc.) invisible, I'm guessing because of incorrect assumptions on both parties about how style inheritance should work. My apologies if you aren't actually talking about GTK themes, I don't know much about others.
Anyway, you can set the GTK_THEME variable as a prefix to graphical applications, from the terminal, desktop entry, or launcher. In testing, Thunar did not honor the theme, but Gedit and Firefox did.
Run from the terminal:

GTK_THEME=<theme> <application>

Modify desktop launchers:

Exec=env GTK_THEME=<theme> <application> %U

See https://unix.stackexchange.com/a/185115.
Of course you can still apply Firefox themes - in fact you will get much more reliable results, since you're free to tamper with your environment and Firefox themes independently. This also means you can validate an application's theme/skin with different native themes (even in batches!) without changing your own configuration. To that end I would recommend creating a new Firefox profile with just a browser theme installed to test it.
There are some caveats; first, many applications have a thin wrapper that checks environment variables to prepare the invocation of the core program, and if they miss this variable, inadvertently clobber it, or deliberately override it, all bets are off. Second, the graphical application with or without a wrapper must also be willing and able to read these settings. For QT I have found the following:

QApplication::setDesktopSettingsAware
Sets whether Qt should use the system's standard colors, fonts, etc., to on. By default, this is true.

http://pyqt.sourceforge.net/Docs/PyQt4/qapplication.html#setDesktopSettingsAware
So toolkits may provide interfaces for inheriting themes in general, but there's almost always a way around it. For comparison, what if you want to use GTK for native elements in QT? Apparently there are several red herring methods and a lesser-known method that doesn't work for everyone.
https://stackoverflow.com/questions/40455844/make-qt-application-use-gtk-theme
My UI nightmare with Firefox is over, and hopefully yours is too. If you have issues like this in the future, try testing in a chroot, VM, or new user profile to see what variables are at play. That's about the best I can offer.
Answer: You can edit the default profiles userContent.css:
 ~/.mozilla/firefox/abc123abc.default/chrome/userContent.css

For example if using a dark theme and an  text is unreadable:
userContent.css:
input {
   border: 2px inset white;
   background-color: white;
   color: black;
   -moz-appearance: none !important;
}


Linseed oil application to the inside of a steel frame

Question: Is the application of linseed oil to the inside of a steel frame still recognized as a good way to prevent the formation of rust on the inside of the frame?
Comment: Certainly it's a good idea to do something, especially in the bottom-bracket area.  One needs to be a *little* careful with linseed oil, though, due to the spontaneous combustion hazard of discarded rags, etc, with linseed oil on them.
Answer: The preferred way to do this is to use something like JP Weigle Framesaver. This is an aerosol so you're more likely to get the product in more places which should be protected. And it will dry much quicker (though it has been known to make seat posts somewhat prone to slipping).
However, companies like Surly still state boiled linseed oil and motor fogging oil are  acceptable ways to protect the inside of the frame from rusting. John Allen also discusses a product called Boeshield T9.
You're only saving about 5 bucks probably by using boiled linseed oil, so I don't see the point in preferring it unless you already have it / have some problems with aerosols.
Comment: Aerosols are very difficult if not impossible to obtain internationally, so simpler maybe less effective but more readily available alternative is interesting.
Comment: I'm sure comparable products are available around the world.
Comment: Sure. It just that it would be nice to know about them.
Answer: I have used boiled linseed oil on two steel bikes, one of which I ride daily through the slushy winters and flooded springs of lower Michigan. The linseed lays down a gel like coating that does a pretty good job of preventing rust.
I had a can of linseed oil from a woodworking project, and decided to give it a try on my frames.
JP Weigle Framesaver is easier to apply, so linseed oil has only three advantages: its cheaper, it smells great, and it is pretty classy. It may or may not be more environmentally friendly.
To apply, strip your bike down to its frame. The only part I left on the frame was the headset. You will want to remove the fork and its bearings, and protect the headset cups and races with masking tape.
Pour the linseed into the frame and slowly rotate the frame to ensure all of the tubes are coated. I usually rotate for about 5 minutes, and then place the frame on its side. I usually do two or three applications before reassembling the bike.
Be sure to clean off any oil on the exterior of the frame before it starts to cure, but it can be cleaned off with a degreasing agent.
Comment: Can you explain why "pretty classy" is an advantage?
Comment: @kmm If you have to ask, you'll never know.


Can't import two p12/pfx client certificates into Chrome or Firefox

Question: I have a website I want to use client authentication certificates with. This is just a personal website for myself and a handful of family/friends, so I created a CA to sign some certificates that I can distribute to them so they can sign on without a password.
The problem is, I created two client certificates in p12 format, but I can't load both into Chrome OR firefox.  But I CAN load each individually, but I get 'unknown errors' when I try to load the second.
So if I load my cert first into chrome or firefox, it loads fine.  Then If I add my wife's, I get an error.  If I delete mine and add only my wife's cert, it adds fine.  But then when I try to import my cert, it gives an error.
This is how I created everything.
#1 Make CA and Cert
openssl genrsa -aes256 -out projects_ca.key 4096
openssl req -new -x509 -days 365 -key projects_ca.key -out projects_ca.crt

#2 Make Server Key
openssl genrsa -aes256 -out projects_server.key 4096
openssl req -new -key projects_server.key -out projects_server.csr

#3 Self Sign Server Key
openssl x509 -req -days 365 -in projects_server.csr -CA projects_ca.crt -CAkey projects_ca.key -set_serial 001 -out projects_server.crt

#4 Make Client Key
openssl genrsa -aes256 -out husband_client.key 4096
openssl req -new -key husband_client.key -out husband_client.csr

#5 Sign Client Key
openssl x509 -req -days 365 -in husband_client.csr -CA projects_ca.crt -CAkey projects_ca.key -set_serial 001 -out husband_client.crt

#6 Converet Client Key to p12
openssl pkcs12 -export -out husband_client.p12 -inkey husband_client.key -in husband_client.crt -certfile projects_ca.crt

Then I repeat steps 4-5 for 'wife_client'.
But I can NOT import BOTH wife_client.p12 AND husband_client.p12 into Chrome.
Specifcally, in Chrome when I import the 2nd key. It asks for the p12 password, which I enter.  But then it gives this error:
"Unknown Error"
In Firefox, I import the 2nd key, it also asks for the password which I enter, then I get this error:
"The PKCS #12 operation failed for unknown reasons."
Chrome is actually Chromium 53.0.2785.143
Firefox is 52.0.2 on Linux
How do I import two .p12 keys? They work individually, and I can sign into my website when I have just one installed. How can I get two installed?
Answer: For other people who end up here doing this with Google Chrome and getting Unknown error - I was doing testing with a backend API so my domain was localhost:3000. Google Chrome takes pk12 certs with domain 127.0.0.1 certs fine but chokes on localhost:3000. Firefox accepts them without issue.
This appears to be a bug in Chrome to me.


Isomorphism of group actions

Question: Let $G$ be a group acting on a set $X$, and let $H$ be a group acting on a set $Y$. I'm wondering if there is standard terminology or notation to express the following condition: there exist an isomorphism $\varphi:G\rightarrow H$ and a bijection $\sigma:X\rightarrow Y$ such that $$\sigma(gx)=\varphi(g)\sigma(x)$$
for all $g\in G$ and all $x\in X$. Basically, I want to say that not only are $G$ and $H$ isomorphic as abstract groups, but that they act in the same way on the corresponding sets.
Comment: Such a map $\sigma$ is sometimes called a $\varphi$-equivariant isomorphism even when $\varphi$ is not an isomorphism.
Answer: Let $X$ and $Y$ be a left $G$-set and a left $H$-set, respectively.  Then, a homomorphism of group actions is a pair $(\varphi,\sigma)$, with $\varphi:G\to H$ being a group homomorphism and $\sigma:X\to Y$ being a function compatible with the group actions in the sense that $$\sigma(g\cdot x)=\varphi(g)\cdot\sigma(x)$$ for all $g\in G$ and $x\in X$.  See for example Definition 2.1 on Page 115 of Groups and Computation II by L. Finkelstein and W. M. Kantor.  What you have is just an isomorphism of group actions.
If $G=H$ and $\varphi=\text{id}_G$, then $\sigma:X\to Y$ satisfying $$\sigma(g\cdot x)=g\cdot \sigma(x)$$ for all $g\in G$ and $x\in X$ is usually called a homomorphism of (left) $G$-sets.  In other words, if $\sigma:X\to Y$ is a $G$-set homomorphism, then $\left(\text{id}_G,\sigma\right)$ is an example of a homomorphism of group actions from $(G,X)$ to $(G,Y)$.
Comment: I do wonder if we have a homomorphism $(\varphi,\sigma)$ from $(G,X)$ to $(G,Y)$, where $G$ is a group homomorphism from $G$ to $G$, then is it possible to get a homomorphism  $(id_G,\sigma^\prime)$ from $(G,X)$ to $(G,Y)$?
Answer: An action of $G$ on $X$ is given by a group homomorphism $G \to Sym(X)$.
Therefore, the action of $G$ on $X$ is isomorphic to the action of $H$ on $Y$ exactly when the diagram below commutes:
$$
\begin{array}{ccc}
G & \to & Sym(X) \\
\downarrow & & \downarrow \\
H & \to & Sym(Y)
\end{array}$$
The horizontal arrows are induced by the actions, the vertical arrow on the left is $\varphi$, and the vertical arrow on the right is induced by $\sigma$.
The diagram can be used to define morphisms of group actions, not just isomorphisms.
Comment: @samerivertwice, see https://en.wikipedia.org/wiki/Commutative_diagram
Comment: What does it mean for a diagram to commute?

Isomorphism of group actions


How do I revert an unpublished deletion of a workflow?

Question: I have opened a production SPO site in SPD. The site is part of Office 365 and is a Project Online site. I deleted a site workflow in the editor, but have not saved the change, nor published it. Assuming I understand how publishing works, that should mean that the change only exists locally on my computer and that the sharepoint.com site is not changed.
However, even after closing SPD and reopening it, and using F5 to refresh the program, I cannot see the deleted workflow (which I did not want to delete). I have looked in the recycle bin and it is not there either.
I have tried to find the answer to this myself, but every search I try returns results where published changes are not reflected on the live site, which is quite possibly the exact opposite of my problem (I don't know how to tell for sure, but the workflow no longer appears in the dropdown when editing or creating project types, though all project types currently associated with it still appear to be so).
My question is how can I restore the workflow so that I can edit it in SPD, and is the change somehow propagated to sharepoint.com even though I never published the project after deleting the workflow? The restoration of the workflow would also, ideally, allow all existing projects using it to continue to use it at their current stage.
Answer: Your only hope is if it's in the site recycle bin. If not, then unfortunately there is no way to restore it besides manually rebuilding it.
Comment: If I manually rebuild it, how do I go about re-linking the existing projects to it, or do I need to? Also, I have a dev version that is mostly the same, how can I copy that and use it as a starting point? Google provides some results, but they seem to all apply to SP 2010 and utilize Visual Studio - it seems that in the intervening years (and versions) they would have made it easier, or at least I'm hoping so...


How many voices (lines) can a fugue realistically have?

Question: My friend and I were having this discussion and it brought upon an interesting question. My friend believes that a fugue can, in a theoretical sense, have n number of voices - which is true of course. But I wonder how many voices it would take before the fugue turns into a hot mess with no rhythmic identity. Do you have any examples of fugues that were written for more than 6 voices?
Answer: Giving a fugue some "rhythmic identity" is (like most issues in writing counterpoint) just a matter of knowing the right standard tricks to use. Make the notes of the subject either longer or shorter than the rest of the counterpoint and they won't get "lost in the mix". That's all there is to it.
Bach knew that sort of trick very well. Take the triple fugue in 5 parts, WTC book 1 in C# minor. The first subject only uses whole and half notes, the second is almost all 8th-notes, and the third is mostly quarter notes. Simples!
The practical limit is about 8 parts, simply because with a single subject the exposition becomes over long. For a double fugue in 8 parts, the exposition is no longer than a 4 part fugue.
Many fugues for solo keyboard instruments are in three parts because of the practical performance issues, especially with a fast tempo. But Bach wrote a few 5-part fugues, and there are a few examples with more - for example Sorabji's colossal fugue in the Second Organ Symphony, which gradually builds up to 7 parts over a total duration of two hours. (The first subject on its own is more than a minute long, and the exposition is longer than most complete fugues by Bach.)
The Cherubini example isn't really "extreme". That book was the standard counterpoint textbook for the Paris Conservatoire (where Cherubini just happened to be employed as the professor of counterpoint!) and any student would have been expected to construct that sort of fugue in an examination room. (The word "construct", rather than "compose" is a deliberate choice. As I already implied, this is about learning the right basic moves and how to string them together, not about "being inspired" as a composer).
Eight part fugues were a "normal" feature of works with double (i.e. eight-part) choirs.
A 19th-century composer called Pietro Raimondi (who ended up as maestro di cappella at St Peter's Rome, so he wasn't a complete weirdo oddball) wrote things like sets of three four-part fugues, each in a different key, which could be performed separately or simultaneously as a single 12-part piece. There are a few of his compositions on IMSLP, but they are only published in separate parts so you will have to put the score together yourself.
In fact those were just experiments - he went on the compose things like three complete oratorios (each for chorus, soloists, and orchestra) on different subjects, which could be (and actually were) performed either independently or simultaneously.
So the best answer to "what is the theoretical limit to the number of voices" is probably "nobody has discovered it yet" :)
Comment: Actually "compose" is a great word telling what a composer does. Compose means to put things together, so the word does indicate that a composition is some kind of construction.
Answer: The Credo in Bach's B Minor Mass has a 7-voice fugue for 5 voices and 2 violins, plus basso continuo.
Bach's motet "Komm, Jesu, komm" BWV 229 has a brief 8-voice fugato on the text "der saure Weg wird mir zu schwer,"
roughly, "this blasted way is getting too hard for me."  That may be the master reporting a practical limit.
As for a theoretical limit,
Pietro Raimondi, mentioned in guest's answer, seems to have composed a
64-voice fugue for 16 4-part choirs, now lost.  Grove's Dictionary is too polite to call it a hot mess, instead calling it utter futility.
Answer: First the example...
A Treatise on Counterpoint and Fugue
By Luigi Cherubini

...but that seems an extreme example.
In Bach's Well Tempered Clavier most of the fugues are 3 or 4 parts. I think it's worth noting that during episodic passages the texture often lightens with a voice dropping out.


Validity of Maxwell's laws

Question: I know Lorentz's force changes, according to Wikipedia, when the charges are moving nearly light speed but what about Maxwell's laws? Are they still valid when particles move at light speed?
I ask this because, according to Halliday et al., it is said that the Coulomb's law is valid to describe interactions between electrons and protons within an atom or molecular interactions but when particles move nearly light speed (e.g. within a particles accelerator), one must use Maxwell's laws. So the question is the following: can they change at light speed or not?
Answer: Maxwell's equations describe the electric and magnetic fields of a charge moving at any velocity, so long as you account for the fact that a moving charge acts like a current, and that changing electric & magnetic fields also can act like a source of magnetic and electric fields (through the $\partial \bf{B}/\partial t$ and $\partial \bf{E}/\partial t$ terms in Faraday's and Ampere's Laws, respectively.)
Actually solving these equations in general for a charge moving with arbitrary motion is usually reserved for upper-level undergraduate and/or graduate-level courses in electrodynamics.  The "easiest" route is via what are called the Lienard-Wiechert potentials, which are written in terms of the scalar potential $\phi$ and the vector potential $\vec{A}$.
However, if you take relativity as a given, you can actually make relatively simple arguments about the electric and magnetic fields for a charge moving at constant velocity.  I can't do justice to this argument in this space;  if you want to see these arguments, I highly recommend Purcell & Morin's Electricity and Magnetism for a discussion at the introductory level.
The net result of these arguments, though, is that the electric field of a moving charge is not uniform in all directions (as predicted by Coulomb's Law), but is instead stronger in the directions perpendicular to the direction of motion.  It is often said that the field lines of a moving charge are "compressed" along the direction of motion, since closer-spaced field lines correspond to a stronger electric field.  In addition, there is a magnetic field that circulates around the line of travel of the charge, and this magnetic field is proportional to the electric field (i.e., stronger at points perpendicular to the direction of motion.)
As far as the Lorentz force goes, it turns out that it remains superficially the same: $d \mathbf{p}/dt = q (\mathbf{E} + \mathbf{v} \times \mathbf{B})$, regardless of the magnitude of $\bf{v}$.  One does, however, have to be careful of what one means by $\mathbf{p}$ here;  it has to be defined as the relativistic momentum $\mathbf{p} = \gamma m \mathbf{v}$ for this equation to hold.
Comment: What about the Lorentz's force? Does it change nearly light speed?
Comment: @AngeloGiannuzzi:  See my edit.
Answer: Maxwell's Equations in their 19th C form are Lorentz covariant, which means they are valid after being boosted into a new frame of any boost-able velocity when transformed by a Lorentz transformation. (Note: $v=c$ is not a boostable speed).
It does take some effort to show they are unchanged, unless you put them in their "manifestly covariant" form. So for instance, you make a 4-vector potential:
$$ A^{\mu} = (\phi/c, \vec A)$$
from the usual electric potential and magnetic vector potential. The electric and magnetic fields are contained in an antisymmetric 4-tensor:
$$ F_{\mu\nu} = \partial_{\mu}A_{\nu} - \partial_{\nu}A_{\mu} $$
(It's a good exercise to work out the derivates to just how nicely electric and magnetism are related in relativity).
The current 4-vector comprises charge and 3-current via:
$$ J^{\mu} = (c\rho, \vec j)$$
With that, Maxwell's Equation (with sources) can be written in a manifestly covariant way:
$$\partial_{\mu}F^{\mu\nu} = \mu_0J^{\nu}$$
$$ \partial_{\mu}\epsilon^{\mu\nu\sigma\lambda}F_{\sigma\lambda} = 0$$
These equations are guaranteed to be valid after a Lorentz transformation.

Validity of Maxwell's laws