Is there a [non-comparative] sorting algorithm, sorting an array in $o(n \log n)$?

Question: We have shown that any comparative sorting algorithm has the worst-case complexity of $\Omega(\log (n!)) = \Omega(n \log n)$, as it has to cover all the ways a permutation can be, and according to the pigeonhole principle, there is a case where more than or equal to half of the currently unknown permutations would be unknown after each comparison; but that doesn't apply on non-comparative sorting algorithms. For example, counting sort can sort an array in $O(n + w)$, where $w$ is the maximum element of the array. But all these algorithms are based on at least one another parameter, that are independent of $n$, or at least $n$ doesn't force any upper-bound for those parameters to exist, and can be as large as anything. Is there a non-comparative one, that we can guarantee the worst-case complexity of $o(n \log n)?$
Comment: I think it's a long standing open problem if such an algorithm can exist. Which means there is no such algorithm known and no known proof that it can't exist.
Answer: Radix sort can sort an array in $O(n.w)$ where $w$ is the key length. As $w$ is $O(\log n)$, this means it can sort an array with the performance of $O(n \log n)$. In fact, every non-comparison sort in the form of $O(n.w)$ or $O(n.k/d)$ is $O(n \log n)$.
https://www.drdobbs.com/architecture-and-design/the-fastest-sorting-algorithm/184404062
Comment: @sbh I just realized that by $o(n \log n)$, you are asking for an algorithm faster than $n \log n$. If you allow for parallel processors, there is parallel merge sort with $\log n$ parallel processors, yielding $O(n)$. If you allow for randomness, there is a $O(n \log \log n)$ and $O(n \sqrt{\log \log n})$ for integers by Thorup, and in 2020 there is a $O(n \sqrt{\log n})$ algorithm for real numbers. If you don't intend to allow parallel processors or randomness, please edit the question, and it that case the comment by rus9384 might be true.
Comment: I asked for an algorithm running in $o(n \log n)$, not just $O(n \log n)$, meaning that the algorithm has the worst-case complexity of $O(n \log n)$, but not $\Omega(n \log n)$. All these algorithms are asymptotically lower-bounded by that.


Condition of acceleration when using $x=vt$

Question: So my teacher told me that since $v = \delta x/ \delta t$, $\delta x = v • \delta t$ (naturally), and that is equal to the "area under the velocity-time graph", or displacement. This all makes sense to me, except that he told me that I could only use $\delta x = v • \delta t$ when the acceleration is $0$. Shouldn't it be rather only when the acceleration is constant (so velocity is linear), not necessarily $0$?
Comment: Have you tried to work out an expression for $x$ (and $v$ ) with constant acceleration ?  Start there.
Answer: You have the expression for displacement as a function of time, $t$ -
$$
\mathbf{x}(t) = \mathbf{u}t + \dfrac{1}2 \mathbf{a}t^2
$$
Where $\mathbf{u}$ is the initial velocity, $\mathbf{a}$ is the acceleration of the particle.
Set $\mathbf{a} = 0$, and you have $\mathbf{x}(t) = \mathbf{u}t $. This is the case of uniform velocity, not acceleration. You are confusing the terms, as only when velocity, $\mathbf{v} = \text{Constant/Uniform} \implies \mathbf{a} = \dfrac{d\mathbf{v}}{dt} = 0$. So this condition wouldn't correspond to uniform acceleration.
Answer: Yes your teacher is right. In that small interval of time acceleration is taken zero. Although for a large interval you can find displacement by integrating your expression when there is either constant or variable acceleration.


Is there a service to find the best & least expensive term life insurance?

Question: How do I find the best and least expensive term life insurance? I'd love to see a listing for life insurance like BankRate.com does for savings accounts and mortgage lenders. Anything like this out there?
Comment: I don't have a site for comparisons, but do want to suggest that you include in your comparisons any term life insurance policies that might be available to you through your professional societies (e.g. IEEE, ACM, TIAA, ABA, etc).
Answer: {Not an endorsement}
I used SelectQuote.com for my wife and I last year.
This is precisely what they offer to do.
Comment: +1.  Not sure why this was downvoted--this is exactly what the question asked, and what they claim to offer.  I used them 3-4 years ago and had a good experience.  Also not an endorsement as YMMV and I have nothing to compare them to.
Comment: @PhilSandler - I have no idea, either: but thanks for the compensating vote :)
Answer: The best way to get the best deal is to deal with an insurance broker. Not an agent. In the US at least, an agent is a representative of an insurance company. Their job is to get you to buy the company's products, not to find the best product for you. (They will sometimes say that they are going to find the best product for you, but they mean the best product from among their company's offerings).
In other places the naming is different. Sometimes agents are referred to as 'tied brokers', and can call themselves brokers. Brokers who find the best product for you from among many companies are usually called 'independent brokers'. If in any doubt you should always ask explicitly whether the broker is selling products from only a few companies or can choose between many companies. You will probably have to pay a broker for this advice, but that's what you need to guarantee independent advice.
You can also go to various websites that allow you to simultaneously get quotes from many insurance companies. They will often do the job if your needs are fairly straightforward, and you are looking for normal kinds of insurance.
Comment: fwiw - there are many insurance agencies that represent many carriers, and will compare between them for you (eg the agency I used when I used to live in NY)
Comment: Things may be different in New York. My experience in Canada is that many who portrayed themselves as brokers were actually tied to an insurance company.
Comment: Don't know about Canada - only ever owned a vehicle in the US :)
Answer: Ask some insurance agents & brokers to provide you quotes of all the insurance companies, and then select the policy that best suits your needs.
Comment: If in the US, be aware that an insurance agent is a representative of an insurance company. They will not help you choose between companies.
Comment: Okay, but how do I choose a insurance agent or broker?  Don't they all work for or earn comissions from one company?


Menu selection for header

Question: I have created multiple menus. What I wish to accomplish is give viewers the ability to select which menu they want to use for the header. Closest ive gotten to is the conditional menu plugin but that is based on the page that is being viewed. I wish to enable the user to select a menu and have it apply all across the website for the whole session duration. Any ideas on how I would go around doing this or any simple plugin can already do this? Thanks in advance!
Answer: One way of doing this would be to set a cookie when the user selects which menu they want to view, and on all page visits, check the cookie to see which menu they chose, and display the menu that matches their selection.
A cookie can be set using JavaScript on the client side, while your PHP page template will look for the presence of the menu cookie in the $_COOKIE superglobal. An overly simplified example is below.
Client side:
// User selects Menu 1, which executes the following line
document.cookie = "menu_type=1";

Then in the appropriate place in your theme template PHP:
if ($_COOKIE['menu_type'] === '1') {
    // show menu 1 using the WP menu functions
} else {
    // show default menu
}

I didn't test this code so the syntax might not be right, but this will hopefully get you pointed in the right direction.

Menu selection for header


Op-amp exercise: Two stage inverter

Question: So I need help with the following exercise on op-amps (picture). I know how basic op-amps work but here I dont know how they got to the formula (circled in red). Do you need to use KVL or KCL ? I know that the gain on a normale inverting op-amp is V0=-Zf/Zi*Vi. Ok so now I applied KCL at the two nodes and this is what I got (picture 2). But after rewriting it and replacing Vs by its value, it still isn't the same equation as the answer given, what did I do wrong ?
Comment: The question is flawed with positive feedback and an output stage that will quickly integrate and Vo(t) will saturate the output to the supply rail because of this.   Complain to Prof , that it is unrealistic.
Answer: As Tony Stewart commented, the circuit as shown will not work. Vo will be saturated, and V1 will be 0.4 the level of V2, but with the opposite polarity. Two inverters in a row produce positive feedback, not negative.
As a starting point, let's say Vs is set at zero, and Vo is 1 volt. Then V1 will be be -.4, and Vo will integrate even higher. The process only stops when Vo saturates. This is classic positive feedback, and there will be no reliable response to an AC Vs.
In order to get the circuit to work, the + and - inputs of one of the op amps (preferably the second) must be swapped.
Answer: The op amps are ideal, and they have negative feedback ,so it is true, that the voltages of the inverting, and non-inverting inputs are the same. In this case, both inverting inputs are virtual ground (has zero potential).
Now you can write two KCL equation at these nodes (assuming no current flowing in the amplifier beacause an ideal amplifier has infinite resistence at the inputs). From these equations you should get the transfer function, and the answer.

Op-amp exercise: Two stage inverter


Can a short circuit in the output of a transformer be dangerous?

Question: Assume that I have a 220 to 12 volts transformer with a nominal output current of 3 A (marked  "12 V 3 A"). Now what does happen if I connect the two output wires to each other or to a load with very low impedance? Does the current exceed 3 A by a large margin? I don't think so. But is the secondary coil designed to withstand such currents? If the temperature gets too high, the insulation of the coil wires would be damaged, which is obviously dangerous.
Answer: If you short the output of a good/efficient transformer, the secondary current will be very high, and the transformer will likely overheat and be damaged.
However, there are intentionally lossy ("impedance protected") transformers that will limit the load current to a safe value to prevent damage to the transformer in case of short circuits or overloads (often used to power doorbells and similar applications).
Comment: 3Amps is the continious rating .This is for thermal reasons .The short circuit current could be 30 Amp or more
Comment: If the transformer is marked "12 V 3 A", it can safely deliver up to 3 Amps.  It may deliver somewhat more that 12 volts at lower currents.
Comment: Thanks. "12 V 3 A" is printed on the transformer's body. Does it mean that it can give 3 A at max? or that it's not safe to take more than 3 A?
Comment: The voltage should be 12V AT 3amps. More V at lower currents, less V at higher currents.
Answer: There's no upper limit to the current that will flow in that case.  The transformer will cheerfully draw, up to its impedance and inductive limits, until it melts the secondary down into copper slag.  Or, the thin primary wires will overheat and blow like a fuse.
We see it a lot where people think a component has built-in overcurrent protection because it'd be cool if it did.  No; only fuses and breakers do.  Most ratings are just the maximum safe load, and you are expected to design so your equipment cannot exceed it.  That is something UL will want to see before they agree to list your equipment.
You can put L-rated (75 mph) tires on your Ferrari and drive it 200 mph, and you can do it all day.  It's not a good idea, though.
Answer: You can set an upper bound on the current by measuring the DC resistance of the primary and secondary and then calculating:
Imax = 220 / (Rprimary + (220/Vout)^2 * Rsecondary)
(Vout here is the open circuit voltage as we are establishing the turns ratio N)
There is an efficient winding principle that tells you that the most efficient use of copper is when primary and secondary copper losses are equal. So this lets us estimate the secondary (as very low resistances can be hard to measure with the ohms range)
Imax = 220 / (2* Rprimary)
Why don't you try this, and report back to us. I suspect you will find Imax to be shockingly high.
Real current is lower due to leakage reactance, but this is useful because the current cannot be higher.
Comment: Toroidal transformers have much less leakage reactance, and are consequently much more interesting when shorted. They can come close to the copper limit above. Happy times.
Answer: An ideal transformer would give you infinite current and not heat up at all.  But unfortunately, you don't have one of those.  A real transformer has all kinds of parasitic effects that make it difficult to model with absolute accuracy, but the one that we're interested in now is the winding resistance.
Each winding has its own resistance that is simply the wire itself that it's made from.  So you can find it easily with an ohmmeter.  (not when it's plugged in, of course!)  Now take that resistance in series with an ideal transformer, and you get both a crude voltage/current profile and a crude estimate of how much it'll heat up with a given load.
For example, if your secondary winding resistance is 1 ohm*, then the turns ratio might be fudged to produce 15V open-circuit, 12V @ 3A, and 15A short-circuit.  The winding itself would dissipate 0W, 9W, and 225W, respectively.
* I'd be surprised if it was that high, but it makes the math easy.  We'll just go with it for now.

Of course, there are other losses as well:

The primary resistance heats up too.
The iron core gets "massaged" by the magnetic field which causes molecular/atomic friction.  So some of the energy heats the core instead of getting transferred.
The magnetic field doesn't completely couple to the secondary but "spills" some to the surrounding area.  So some of the energy couples into other circuitry that may be nearby, instead of getting transferred where it's supposed to.

For low-power devices, a wall-wart is a convenient way to avoid this.  Even large electronics, like analog audio mixers for example, may have an external power supply for exactly this reason.

Etc.

But you get the basic idea.


I keep getting HTTP Error 500 how do I fix

Question: When accessing some internet sites I keep getting HTTP Error 500 how do I fix?
Answer: HTTP error status 5xx are server errors. Unless you administer these systems, you shouldn't bother about fixing them. You may want to report them to the admins, though.
One exception is that if you've configured a proxy server, this may cause trouble as the proxy server will return 5xx error status codes when it runs into problems itself. Try to disable a proxy if you're using one.


Tuple, List> or a List>?

Question: Which is preferred and/or more efficient operation wise?
I ended up using a list of tuples, but am curious as to which one is preferred.
Opinions welcome but I would love a technical aspect I'm not finding via google.
Comment: The more relevant question is which is more appropriate for your particular need. A `Tuple,List>` does not imply a relationship between items at same indices within each list, it does not even imply the length of the lists will be the same. A `List>` clearly defines a relationship between the integer values. What is more appropriate for your program?
Answer: It depends on what the data means.
If it's two lists of numbers, a tuple of lists would be correct. If it's a list of number pairs, the a list of tuples would be correct.
For whatever the integers mean, does it make sense that the lists would be of different lengths? If so, then you've probably got two independent lists, and a tuple of lists would be correct.
If the integers only make sense if the lists are of equal length, then you've probably got one list of number pairs, so a list of tuples would be correct.
Answer: Tuple of two Lists involves 2 reference types/pointers (1 for each List) per item, List of 2-Tuples involves only one (1 for each Tuple), so you save 8? Bytes for each item (forgot how big the pointer + .net metainfo is).
Does such a Micro-Optimization make sense? I doubt so. I'd rather advise to use whatever makes most sense from a business-logic perspective.
Answer: Those options have fairly different semantics.
One implies two lists that only have a tenuous connection to each other, and that an element in position x in List A doesn't correspond to the same location in List B. The following would be perfectly valid:
{ [1, 2, 3, 4, 5, 6], [7] }

The other one is a list of paired elements. If you want to associate two numbers together, one from group A and one from group B, I'd suspect you want a List<Tuple<int, int>>. The above example would be invalid in this case, and you'll probably save yourself a lot of headaches double-checking things when you want to use the list.
As always, consider what you're trying to model and determine what data structure best maps to that. It's not worth sacrificing semantic integrity for a negligible performance improvement (at the very least, build it with the semantially correct version and hack it when a performance problem presents itself). I'm not sure if there even is a performance hissue here, but if anything, the second option should result in a lower memory footprint (since you have fewer lists allocated)
Answer: They are for two different things.  The first is if you want a tuple which contains two lists of integers that aren't really associated, but the two lists are somehow related as a whole.  The second is a list of tuples with two integers, so integer A is somehow linked to integer B in the tuple.
Blindly guessing, you probably want option B.  This means that each tuple has two integers that are somehow linked.  I could be wrong, but of the two options, that is what most people want.  It's kind of like a Key Value Pair.
Answer: It depends on what you want to achieve. I guess you want to have multiple pairs of int, then List<Tuple<int, int>> is the solution. There might be cases where the others are useful but I can't think of any from the top of my head.
Comment: Thanks for shedding some light, for some reason I was overlooking the aspect of relations in the data. I needed a one to one for a DateTime to a string and I suppose I subconsciously put it together to end up with an IEnumerable, now I can confidently close this class up!

Tuple, List> or a List>?


L2 Visa: applying EAD from india

Question: I am having L2 visa.
1. Can i apply for EAD from India.if yes then EAD application require I94 document which will show Departure record. so is there any chance of rejection because I am applying online from india
Answer: You cannot apply from India because you will not be in a status that allows EAD. To be in L2 status, you need to enter the US with a L2 visa (or change from a different status into L2), and be in the US.

L2 Visa: applying EAD from india


Determine the length of the tube

Question: I need to determine the size of the tube having the flow rate of the liquid (water) which is 5 ml/min and assuming the diameter of the tube is 4mm. How can i determine the size of the tube that takes approx one minute for 5ml water to flow along the tube?
Comment: There's a few ways to figure this out, depending on what exactly it is you care about. Is this a practical problem or a homework problem?
Answer: If the flow rate is 5ml/min, and you want to know how long a tube it will take 1 min to pass through, you're effectively asking how long a tube contains 5ml.
Volume of a cylinder is $\pi*r^2*h$.
5ml = 5000mm^3.
Pi*r^2 = Pi*2mm^2 = 4pi mm^2
Your length therefore is 5000/4pi or around 400mm.

Determine the length of the tube


How would you repair this concrete block step?

Question: I have a front porch/patio and back made out of pavers surround by large concrete blocks. Sometimes, the edge blocks come loose, especially here which is a very high traffic area. I think the lip probably acts as a little bit of a lever too. In the past I tried repairing another one with construction adhesive but that got a little flexible when it got warm and the block levered right out when I stood on it. For this step we tried mixing cement, cleaning it out and resetting the block (also kept it dry after repair, no walking on it for a few days). But after a little less than a year it's out again.
Comment: Not really sure what I'm looking at. How many problem areas do you have?
Comment: In the front step it's just this one block that keeps popping up.  In the back I have three
Answer: If the mortar or cement bed that was bonding the block in is too thin, the setting bed will dry out too fast and make for a very weak bond. Cementitious products need to cure slowly, by keeping the product damp, not wet. That is a delicate balance for some products, since even too much dampness can cause the cement or mortar bed to get too wet and creep back out, not filling the gap as it should.
My suggestion would be to use a modified thinset, it can go down real thin where needed and is quite sticky, so controlling the mess can be quite a task.
Make sure the area where it is applied is really clean, lots of water and wire brush, using a chisel and hammer to clean out lumps that may affect how the block goes back in, "Dry fit" the block first, insuring the block will go in lower than the surrounding area by 1/8"-1/4". If the block does project over another surface, it would be wise to add something under the projected end so it settles in at the proper height, and does not allow the thinset to run out, creating a void in the bond. The thinset, when it is mixed, needs to be the consistency of peanut butter, apply a thin layer to both the block and the pocket where it will go in. I seen the joints are really tight on the sides and back so gauge the layer accordingly on the back, the sides should scape off any excess as it goes in.
You may want to use duct tape to mask the areas where the ooze may occur, then again it may get under the tape in some cases anyway. You can use a sponge to clean it up, but you absolutely MUST use a sponge that is squeezed so hard it hurts doing so, there cannot be no more water added to the thinset, or it will run out of the joints like a river that cannot be stopped. Keeping the duct tape intact will aid in keeping added moisture down. Still use a nearly dry sponge, if needed step on it in an area away from the work space to allow other pavers away from the area to soak up more of the excess water.
The last requirement is use a thinset that is approved for exterior use, it should not be hard to find. Your choice of colors are either gray or white.
Comment: @bishop I had to look up TIL :)
Comment: TIL: "Cementitious".
Comment: Thanks for the detailed response!
Answer: Uh, I would use mortar rather than cement. Cement is used in concrete, grout, and mortar, but adding things to cement improves its abilities depending on the purpose. Grout goes between blocks, bricks, and tiles as a filler. Mortar on the other hand has lime which effects the bonding strength. There are a bunch of different types, and I've only worked with thinset and the stuff used with tuckpointing, but presuming there aren't structural issues at play, it might get you what you need. Here's an article talking about types of grout and mortar.
Answer: The second and third pictures clearly show that the block is cantilevered over the step below. That's the root of your problem, as far as I can see.
Solutions are various. You could take out more pavers (and add more large blocks) so that the large blocks turned 90 degrees to this arrangement are lengthwise to the step, with proportionally smaller overhang.
It appears from the pictures (but that might be a lie) that the distance to the step below is small, so you could fill in the entire space with mortar so that the step is solidly bedded all the way to the edge, rather than hanging over as a cantilever.
You could remove all the edge blocks, and form and pour concrete in place to replace them.


How can I update events

Question: How can I update events already set up? Please send me the steps to update the informationon the events page.I am unsure the steps for updating the page.
Answer: Welcome to CiviCRM SE. I think you should find all this in the docs at https://docs.civicrm.org/user/en/latest
But quick answer is, in the back end, select Manage Events in the Events menu. They select Configure for the event in question. Should be obvious from there...

How can I update events


ERROR: Could not build wheels for spacy, which is required to install pyproject.toml-based projects

Question:
Hi Guys, I am trying to install spacy model == 2.3.5 but I am getting this error, please help me!
Answer: Try using python 3.6-3.9 instead, where there are binary wheels for pip install to use instead of having to compile from source.
(This is a conflict with python 3.10 and some generated .cpp files in the source package. Python 3.10 wasn't released yet when this version was published.)
Comment: It's not working dude
Answer: I had the similar error while executing pip install -r requirements.txt but for aiohttp module:
socket.c -o build/temp.linux-armv8l-cpython-311/aiohttp/_websocket.o
aiohttp/_websocket.c:198:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"
          ^~~~~~~                        1 error generated.
error: command '/data/data/com.termux/files/usr/bin/arm-linux-androideabi-clang'
failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for aiohttp
Failed to build aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install
pyproject.toml-based projects

Just in case I will leave here solution to my error. This error is specific to Python 3.11 version. On Python with 3.10.6 version installation went fine.
To solve it I needed to update requirements.txt.
Not working versions of modules with Python 3.11:
aiohttp==3.8.1
yarl==1.4.2
frozenlist==1.3.0

Working versions:
aiohttp==3.8.2
yarl==1.8.1
frozenlist==1.3.1

Links to the corresponding issues with fixes:

https://github.com/aio-libs/aiohttp/issues/6600
https://github.com/aio-libs/yarl/issues/706
https://github.com/aio-libs/frozenlist/issues/305
Answer: Try using:
!pip install spacy==2.3.5
Do not give space between == and 2.3.5
If you give any space between equal sign and version, it may give error.
Comment: HI sorry, I don't gave any spaces inbetween, here typo - sorry
Comment: Ran the above command with macbook air Intel OS 10.13.1 High Sierra (I have reasons to stay with) python 3.6.4 it hicupped installing 2.3.5 using above command, a bunch of red compile messages but then said:     Downloading thinc-7.4.5-cp36-cp36m-macosx_10_9_x86_64.whl (987 kB) And now import spacy works. To clarify, pip install spacy without version would not complete. Latest spacy 3.7 dropped support for python 3.6.
Answer: I had a similar issue with this. In my case it was "nmslib". Along the way I also ran into CUDA problems, similar to this. Deleting my scispacy conda environment over and over again, I finally achieved a clean and fast install with this order:
# create new conda environment with Python 3.9 (to build wheels)
conda create -n scispacy python=3.9

# activate new environment
conda activate scispacy

# install other important packages (don't forget pytorch here! It is especially important as "pip install scispacy" would install it too, but then you would run into CUDA trouble)
conda install spyder numpy scipy pandas matplotlib sympy cython pytorch

# install scispacy
pip install scispacy

# .. and its models (the ones you want, obviously)`enter code here`
pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.3/en_core_sci_lg-0.5.3.tar.gz
pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.3/en_core_sci_scibert-0.5.3.tar.gz


Do Tier-1 grad schools have a GPA filter

Question: Is it true that Tier-1 schools in the US use an automated GPA filter before an application is even reviewed. Especially for international students?
If so, how does one go about getting past it and having their application reviewed?
Comment: In contrast to the two existing answers, at my tier-1 university the answer is *yes*.  Admission to **any** graduate program at my university requires [a GPA of at least 3.0/4.0 (or equivalent) for the last two years of undergraduate study](http://www.grad.illinois.edu/admissions/instructions/02a).  The requirement can be petitioned, but successful petitions are rare. (And yes, this means that I could be admitted to my own graduate program.)
Comment: @JeffE: Humm...my undergraduate GPA is 0.1 higher than yours, so ordinarily I doubt I'd be admitted (or even be considered), but maybe with a successful petition?
Answer: In my experience, no. The only automatic filter is for the university's minimum required TOEFL score; this requirement is imposed by the university and is not under the department's control.
Furthermore, for international students coming from academic systems that the committee is less familiar with, the GPA is less informative. If you weren't familiar with the Italian system, for example, it would be hard to know what a grade of 27 represents. So in these cases the admissions committee is likely to rely even more on the letters of recommendation. For a successful application at a "Tier-1 school", the letters likely need to come from someone knowledgeable about the reality of such a program (perhaps they received their PhD from a comparable department, or taught there in the past) and make a convincing case that you could be successful there. Even an extremely strong letter saying "This is the strongest student in Country X this year" might not be sufficient, if the committee doesn't have sufficient information to compare that with other applicants.
Source: I have served on grad admissions at a Tier-1 math department.
Comment: At the places where I've worked, we don't actually filter out the applications with low TOEFL scores, though there is a university-wide minimum.  It's also not impossible for us to admit someone whose TOEFL score is too low.  What would have to happen is that a faculty member would have to volunteer to interview the candidate and write a compelling memo about how their English is better than their TOEFL score suggests.  The university might or might not accept this argument (it depends on how much trust they have in the department and faculty member).  We rarely try this.
Comment: The TOEFL requirement is imposed by the university's interpretation of the U.S. government's visa laws (the visas require "demonstration of proficiency in English," and having applicants take the TOEFL or IELTS is by far the easiest way to do this.)
Comment: In our case, I believe the university is also seeking to assure the quality of the teaching done by graduate students, who sometimes serve as teaching assistants. (In particular, our minimum TOEFL score is higher than many other schools.)
Comment: @Andy: And of course, doing this also satisfies the visa laws.
Answer: I cannot speak for every graduate program; however, in my experience the answer is 'no.'  The candidate is regarded as a total person and the GPA defines only one part of them.
Regarding getting past it: if the filter does exist those who put it in place believes it adds value.  The only true way past it is to have a higher GPA than the filter.  Apart from that, you can reach out to the department that you're interested in to show that you are more than your GPA.
Comment: I did not downvote, but one reason might be that answering from your experience is not very useful if you do not include what that experience is.
Comment: I agree with @Tobias.  Moreover, I know that some tier 1 graduate programs have GPA filters and some do not, so without further scoping your answer is not especially helpful.
Comment: Interesting to receive down votes with no rationale.


Applying Group Policy to the Security Groups

Question: I'm using VBScript in my logon script to map network drives..
I know that a group policy should applied to individual user accounts and computer accounts by linking (GPOs) to Active Directory containers (OUs).
The thing that I do not know is how to apply group policy to an OU that has nothing but groups in it?
Comment: Thank to all for reply!

I follow the steps you have described, but still the policy not implemented to the group members!! I dont know why? And what is wrong?
Would you please explane more.
Answer: The proper way to add a GPO to a security group is:
Configure the group by adding the intended members on it (computer or user accounts)
Create your GPO and link it high enough so that it will apply on all intended objects
Remove "Authenticated users" from the Scope panel in GPMC and add the group that should apply it. You don't have to use the advanced security section to do this, and it is less dangerous like this (no chance to lock yourself out).
If you link the GPO on the top of the domain, ensure you set the filtering before you edit the GPO so it does not get applied everywhere.
If it's a computer policy, computers need to be rebooted once they are added to the group, else when the GPO refreshes the computer isn't authenticated in the new group yet and the GPO won't get applied.
Answer: You cannot apply GPOs to groups - like you said, you apply them to computer and user objects.
Both your computer and user objects are going to be somewhere in your Active Directory structure, so you should just apply the GPOs directly to the OUs where the objects live.
If all your user and computer objects are just in their default containers, it might be a good opportunity to add a bit of structure to your Active Directory with additional OUs.
If you want to do some sort of restriction on GPOs depending on what security groups a user/computer is a member of, you can edit the security properties of each GPO and add an appropriate group (i.e Can change screensaver) and set the Read permission to Deny.
Comment: Nothing personal, GPO filtering would be the way to go but your method/suggestion is counterintuitive. Simply add the group you want the GPO to apply to to the Security Filtering section on the Scope tab of the GPO and remove Authenticated Users, rather then manually setting permissions on the Delegation tab of the GPO.


Relativistic mass and imaginary mass

Question: The (relativistic) mass of an object measured by an observer in the $xyz$-frame is given by
$$m = \frac{m_{rest}}{\sqrt{1 - \left(\frac{v}{c}\right)^2}}.$$
Mathematically $v$ could be greater than the speed of light, but the mass $m$ would become imaginary. Physically we would have to get to the speed of light first i.e. $v = c$, which gives us an undefined value for $m$. So we believe that nothing moves faster than the speed of light because we do not like observables to be imaginary?
Comment: True, but this argument does not exclude particles that 'started off' moving faster than the speed of light.
Comment: The issue isn't that we don't want observables to be imaginary. What you get when you measure the weight or inertia of an object is its mass-energy, not its mass, and the mass-energy of a tachyon is real, not imaginary.
Comment: One simple answer is that there is not physical mechanism that will accelerate particle to velocities beyond the speed of light, because it would require an infinitely large amount of energy to accelerate particle arbitrarily close to the speed of light.
Comment: Why downvote? This is a perfectly valid question.
Comment: Related: http://physics.stackexchange.com/q/16227/2451
Answer: Physically, you math guys aren't allowed to cross near the boundary $c$ (speed of light). Special Relativity does that. SR says that it would be impossible for a particle to be accelerated to $c$ because the speed of light (maximum possible measured velocity) is constant in vacuum for all inertial observers (i.e.) Observers in all inertial frames would measure the same value for $c$. Not only the fact that infinite energies are required to accelerate objects to speed of light, (but) an observer would see things going crazy around the guy (or an object) traveling at $c$ such as length contraction (length would be contracted to zero), time dilation (time would freeze around him) & infinite mass. You can't enjoy anything when you travel at $c$. But, the stationary observer who's measuring your speed (relative to his frame) would definitely suffer..!
Note: But, there are some quantum mechanical solutions that allow negative masses like the expression for relativistic energy-momentum. Let's try not to make the subject more complicated.
$$E^2=p^2c^2+m^2c^4$$

There are hypothetical particles (having negative mass squared (or) imaginary mass) always traveling faster than the speed of light called Tachyon. This was assumed by Physicists in order to investigate the faster than light case. So When $v>c$, the denominator becomes a imaginary. But, Energy is an observable. It should be some integer. A consistent theory could be made if their mass is made to be imaginary and Energy to be negative. Using these data in the E-p relation, we would arrive at a point $p^2-E^2=m^2$, where $m$ is real. This makes Tachyons behave a kind of opposite to that of ordinary particles. When they gain energy, their momentum decreases (which strongly disproves all our assumptions).
The first reason that this investigation blown off is Cherenkov radiation where particles traveling faster than light emit this kind of radiation. As far as now, No such radiation has been observed in vacuum proving the existence of these..! It's like making a pencil to stand at its graphite tip. If it would stand, physicists would've to blow up their heads :-)
There are tougher stories on the topic when you Google it out...
Comment: Unless you can come up with an operational definition of "negative" or "imaginary" mass, then you are just doing maths, not physics. You need to define what such a negative mass would look like physically (e.g. repelling "positive mass" objects by gravity, a behaviour that has never been observed to my knowledge).
Comment: no worries, actually it was intended as a comment for glebovg, but I'm glad if it helped you sharpen up your answer :)
Comment: There are at least three different questions one could ask, which some of the comments and answers seem to be assuming incorrectly are the same question. (1) Does nothing move faster than light? (2) Do known forms of matter such as atoms never move faster than light? (3) Can we have observers and frames of reference that move faster than light? The OP asked about 1. Prathyush's comment relates to 2. Crazy Buddy's answer seems to be about 3. The simple answer to 2 is that rest mass is observed to be a fixed property of particles, and you can't [...]
Comment: [...] accelerate a particle past c without changing its rest mass. This is why we talk about tachyons as a separate type of particle. Question 3 has a somewhat technical answer; see V. Gorini, "Linear Kinematical Groups," Commun Math Phys 21 (1971) 150.
Comment: Suppose a particle starts traveling faster than light without getting to the speed of light first. Just because such beasts would cause strange things to happen does not mean it is impossible.
Comment: By the way, what is wrong with negative mass? To be honest, I have not seen any compelling arguments for excepting only positive mass. We know negative energies are possible, why not negative mass and imaginary mass?
Comment: @CrazyBuddy I believe Chernenkov radiation has less to do with the question than you make out- it's more of an electrodynamical oddity than a relativistic one- vacuum Chernenkov radiation would be completely different to non-vacuum.
Comment: @Alyosha: Hello Alyosha, Though it does addresses the topic only a little bit, it is also a factor which could be imagined to influence those in vacuum. Yes, you're right. There are other things to worry about. Moreover, I gave it only as an example. Maybe I shouldn't have mentioned it as *a first reason* :-)
Answer: Actually, a quick search on Wikipedia shows that you have misinterpreted this formula: imaginary-mass particles do not propagate faster than the speed of light when you take quantum mechanics into account. A much better reason not to believe in faster-than-light particles is that they have never been observed to exist. Furthermore, if they were to exist, I could in principle do rather confusing things like cause the death of my own grandmother before my mother was even born. Generally, if something does not appear to exist, and it would cause everyone a massive headache if that something did exist, it is easier to assume that it doesn't! Likewise, I do not believe that an enormous colony of pixies living on the dark side of the moon is planning a surprise birthday party for me next year. Of course, someone, somewhere probably does believe that :)
Comment: @glebovg Let me reiterate, or perhaps rephrase, my point. I said (or should have said) **if there is no evidence for something** then there is no reason to believe in it if it seems to disagree with other things you know. I apologise if you were confused by my flippant tone of voice: the comment about headaches was intended to amuse, not to be taken literally. Science is about drawing **rational conclusions** based on **evidence**. Quantum mechanics does not "make my head hurt", to carry on my (admittedly poor) analogy. On the contrary, it **explains** things I wouldn't understand otherwise.
Comment: Quantum mechanics is therefore more like paracetamol :) And just to ram the point home, I would contend that only a bad physicist believes in things just because they haven't been proved beyond all reasonable doubt. That doesn't mean you can't maintain an open mind, but ideally, we should be skeptical about everything for which there is not a significant body of evidence. Your suggestion seemed to be that we don't believe in tachyons because a certain equation gives unsavoury results. My point was that such an aesthetic consideration is never valid. Only evidence and logic matter.
Comment: @glebovg First of all, you are speaking for yourself there: I would not say I "strongly believe" in black holes. Second, this is not a very good example, since black holes are a natural prediction of general relativity. Other predictions of general relativity (gravitational lensing and time dilation) have been shown to be true, therefore it is perfectly reasonable to assume, in the absence of any better evidence, that other predictions of GR are correct.
Comment: On the other hand, the proposition that particles can travel faster than the speed of light is not based on either evidence **nor** logical deduction from existing theory (like black holes), there is no proposed mechanism for how this could happen, and it would not explain any as-yet unexplained phenomena. I think the difference is pretty clear.
Comment: If something has not been observed it does not mean it does not exist. Only a bad physicist can think this way! According to your argument, quantum mechanics is a complete nonsense and we should not believe in it because it makes your head hurt. Overall, a pointless answer.
Comment: OK, there is no evidence for the existence of black holes, yet we strongly believe in them. Instead of believing in them we should be skeptical?
Comment: Never mind. Trust me, there is no logical deduction in physics. Physics is mostly empirical, that is why we have to test everything experimentally. Take QM for example, it is based on equation which you cannot derive -- it is a clever guess. So why not postulate negative and imaginary mass and build some equipment that could detect it?
Comment: let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/6267/discussion-between-mark-mitchison-and-glebovg)
Answer: The use of relativistic mass is deprecated in modern physics, which means that we can explain why nothing moves faster than the speed of light (in the contest of special relativity) without even mentioning relativistic mass.
The special relativistic energy for a massive particle is $E^2=p^2c^2+m^2c^4$, where $m$ is mass [1]. Solving the Hamilton equation we obtain the velocity $v = pc^2/E$. It is evident that $v = c$ only when $E=|p|c$, which implies that $p$ has to be infinite: $\lim_{p \rightarrow \infty} (p^2c^2+m^2c^4) = p^2c^2$. Therefore you need infinite energy for accelerating a massive particle at the speed of light. The energy of all the observable universe is finite. You cannot break the c limit.
For a massless particle, special relativistic energy is $E^2=p^2c^2$. Solving the Hamilton equation we obtain the velocity $|v| = c$, which is a constant. Therefore no matter what energy you give to a massless particle, it will be always moving at the speed of light. Again you cannot break the c limit.
[1] This is standard notation but disagree with your notation. Relativistic mass is often denoted by $m_{rel}.$
Answer: according to sudarsan, when particeles travel with velocity greater than that of light, the mass becomes negative or imaginary. they are called Tachons. I have shown in an earlier article that the mass becomes imaginary or negative. According to the method used in quatum mechanics, by multiplying by a complex conjugate [that is chaning -i to +i] one gets a positive mass but slightly less than the orignal
Comment: I was wondering, what do you mean by slightly less? The modulus will still be the same... And the method is not used only in quantum mechanics. if you have any number fraction with complex number in the denominator, you can always multiply top and the bottom by a complex conjugate and then the complex part remains only in the numerator. This is, as far as I understand, some basic complex algebra.

Relativistic mass and imaginary mass


What does "by the first " mean?

Question: If someone owes you money and they say they will have it to you "by the first," doesn't that mean you will get it before the first of the month?
Comment: If it's not obvious, it would be wise to pin them down on what they mean "by the first". For example, someone might say, I'll have it to you by the end of June." You should ask, "What year?" :-) Also, if they say they'll have it to you "by the first," that doesn't equate to "before the first", "by the first" and "before the first" meaning different things. And someone saying they'll get it to you "by the first" doesn't mean "you will get it by the first." You'll get it by the first only if they do what they said they 'll do.
Answer: "By the first" is a fairly common idiom that has two general meanings, depending on the context. If the agreement is for a recurring payment, then payment will be rendered on the first day of each month or earlier. If the agreement is for a one time payment, then payment will be rendered on the first day of the next month or earlier. It's important to note that "by the first" includes the first day of the following month. In other words, if someone says "by the first," it usually means you will not get the money on the last day of the month. So, to directly answer your question:

doesn't that mean you will get it before the first of the month?

No. It does not mean that. You may receive the money on the first day of the month.
Answer: Welcome to ELU.
This depends on the context. If it's rent, say, and it's monthly, then perhaps. Just make sure they don't mean I'll have it to you by the first of next year.  It's also not uncommon to say things like the meeting is held the first Monday of each month or we have lunch every third Thursday.

What does "by the first " mean?


"for your information" or "for your notification"?

Question: Which one we should use when we're sending emails to customers to inform them about news or other information?
any other formal or informal suggestion?
Answer: As a native speaker, my preference is "for your information." The other feels stilted, and to me feels like a non-native construction. In fact, if I were reading your message, and I saw "For your notification," I would automatically assume the message was written by a non-native English speaker.
It's worth noting that the phrase "for your information" is sometimes used rhetorically as a defensive statement when one person is trying to respond to criticism, or trying to establish credibility in a defensive way. Consider, "For your information, I DO have a PHD in Warp Field Dynamics, and I have 21 years of experience working with star ship engines." When you hear this, you can tell the person is being defensive, but when you are reading a message, it is harder to tell intent.
So, if I were writing the message, and I wanted to use "For Your Information" as a heading, I think that is fine. If I were wanting to include it in a sentence, I would probably couch it in a less potentially-confrontational way like this: "We wanted to let you know about some changes that have happened..." or "We wanted to inform you about some changes...". This has a friendlier tone than "For your information, we are making changes...".
Answer: notification by definition implies a notice:

The act or an instance of notifying.
Something, such as a letter, by which notice is given.

For example, if you don't pay your electric bill, you will receive a notice/notification that the power will be turned off unless you pay.
Since you are providing information, use for your information.
However, notification might apply if the information affects the status of products or services already in-process or completed:

This notification was sent to advise you regarding a recall of the item you recently purchased.
Answer: The phrase

For your notification

is not used.  Usually when sending a message which requires immediate attention

Notice: something

is used.

For your information

is the general phrase used when sending information of interest and may be shortened to

FYI

in certain circumstances eg texting


What is tinkerpop?

Question: How the forum TinkerPop can be addressed? Is it going to specify a standard for the Graph DBs and the related technology Frameworks? In this effort TinkerPop is considered as an authority or pioneer in some sense? I was not able to understand these by going through TinkerPop homepage.Thanks.
Comment: Googling could not help much on this. And there is no such question so far. The homepage of TinkerPop does not explain so well. Hence asking this.
Comment: I agree, this is a very plausible question and I was wondering the very same thing myself, so thanks for being the pioneer. I am still kinda confused about the relation between Titan and TinkerPop.
Comment: @innuendo Titan implements TinkerPop's APIs and therefore gets access to all the features of TinkerPop, like the Gremlin query language, Gremlin Server, Spark integration, etc.
Answer: TinkerPop is just the name of the project that contains Blueprints and the other projects you see on the TinkerPop home page.  It is not on its own a project or library that you can use, rather just the name of the suite of tools for the graph technology space.
TinkerPop also refers to the collection of individuals (many of whom are representatives from different graph database vendors, such as Neo4j, Titan, OrientDB, Bitsy, etc.)  One might think of TinkerPop as a graph technology guild or fellowship.
TinkerPop is not a specification, mandate or standard for writing graph applications, nor does it aspire to be.  TinkerPop merely provides a set of interfaces that graph database vendors can implement (Blueprints) to get all the features of the rest of the TinkerPop stack (Pipes, Frames, Rexster, Furnace, and Gremlin) where each part of the stack provides a specific function in supporting graph-based application development.
UPDATE: As of version 3.x, TinkerPop is an Apache project - http://tinkerpop.apache.org/.  Under 3.x, TinkerPop no longer has individual separate projects such as Blueprints, Pipes, etc.  It is all a single project repository that has folded in all of those projects.
Comment: I've amended my answer a bit.  TinkerPop's primary objective is to provide open source tools for the graph technology space.  That's it.  I think that you should frame questions and look for answers more in the context of the individual projects of TinkerPop rather than TinkerPop itself.  For example, you reference TinkerPop as a triple store.  I would think of it as: Blueprints enables access to triplestores which would be traversed by Gremlin and could be exposed as a web server with Rexster.
Comment: What is the objective of TinkerPop? Is it going to serve as a set of specifications that are going to be implemented by many?
Comment: http://www.garshol.priv.no/blog/231.html compares as TinkerPop as a triplestore

What is tinkerpop?


In ASP.NET MVC3, what is the most simple way to bind a currency and percentage values to my model?

Question:
Possible Duplicate:
How to filter form data with custom model binder

The simple model below pre-populates fields as desired in an edit/create view (i.e., $250,000 & 75%). However, when posting back into the controller, the properties fail to bind properly.
What is the most simple way to get MVC to convert those strings from human friendly format back into decimal and float property values? Can I use some sort of ValueConverter attribute on my properties? Or do I have to implement a full up ModelBinder?
<code>public class MyModel
{
    [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:C0}")]
    [Required]
    [Display(Name = "My Money")]
    public decimal Moo { get; set; }

    [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:0%}")]
    [Required]
    [Display(Name = "Percentage of Awesomeness")]
    public float PercentAwesome { get; set; }
}
</code>
I had assumed incorrectly that the MVC Runtime would be able to handle it automagically by using the values in the DisplayFormat attribute.
Thanks in advance from an MVC newbie!
Answer: You'll need a custom model binder to do what you want.  See this question for guidance.
Comment: This one does though. [link](http://stackoverflow.com/questions/999791/decimal-values-with-thousand-separator-in-asp-net-mvc)
Comment: Oops. The solution pointed to by the link does not work for mvc3.
Comment: Nice blog about this issue/behavior. http://haacked.com/archive/2011/03/19/fixing-binding-to-decimals.aspx


What is the industry standard model for pricing Swaptions during this time of negative interest rates, normal model or shifted log-normal model?

Question: I have referred to the some of the well known papers but none of them has a clear answer for my question. I know that both of these models have some disadvantages but, what is the industry standard for pricing derivatives? I need this information for pricing CVA.
Comment: I found a reference stating the CVA approach suggested by the BASEL regulatory framework. Any one interested can refer to https://www.d-fine.com/fileadmin/user_upload/pdf/insights/whitepapers/d-fine_Impact_of_the_new_CVA_risk_capital_charge_2019.pdf
Answer: You may find this text helpful: Modern SABR Analytics : Formulas and Insights for Quants, Former Physicists and Mathematicians by Alexandre Antonov, Michael Konikov, Michael Spector.

Focusing on recent advances in option pricing under the SABR model, this book shows how to price options under this model in an arbitrage-free, theoretically consistent manner. It extends SABR to a negative rates environment, and shows how to generalize it to a similar model with additional degrees of freedom, allowing simultaneous model calibration to swaptions and CMSs.
Comment: Thank you for the reference. So, I assume SABR model is used the most to price swaptions in the industry? I thought it might be shifted log normal or normal model for the Black-76 model is widely adopted to price interest rate derivatives.


Tail server logs into XMPP?

Question: So I have two files, and if a new line appears on either of these files, I'd like to receive an IM (preferably jabber or gTalk) containing the contents of that line. Do you guys have any suggestions for a Linux daemon or something that could do that?
Answer: If you are logging trough syslog, Metalog has support to execute a command whenever a message matching some criterion gets logged. Otherwise, you can use tailf to watch for new lines in a log file.
sendxmpp is a small perl script to send XMPP messages (possibly already available as a package for your favorite distribution)
You could stitch those two together with a shell script without too much difficulty. For the metalog case, create a script like this one:
#!/bin/sh
echo $* |sendxmpp firstname.lastname@example.com

And add command = /path/to/script.sh to the relevant section of metalog.conf
For the tailf case, you could try something like this, run in a persistent way:
tailf /var/log/file-to-watch.log |(while true; do read M; echo $M | sendxmpp firstname.lastname@example.com; done)

sendxmpp needs a valid XMPP account, see the man page for how to configure the account to be used.
(from my experience, XMPP-delivered error messages tend to become quite annoying if they're too frequent...)
Comment: Hilarious. I just found sendxmpp and set something like this up. Hadn't heard of tailf though, thanks.
Comment: Side note:  In case of problems, check the buffering behavior of your pipe!  (If you're `grep`ing, you probably have to add `--line-buffered` to the incantation for messages to show up.)  I just spent a good hour trying to find out why messages appeared haphazardly or not at all.
Answer: I made that little python script. You can use it as a starting point
import xmpp, os, time

login     = 'Your.Login' # @gmail.com
pwd       = 'YourPassword'
recipient = 'firstname.lastname@example.com'
logfile   = "/home/myself/test.log"

def sendmsg(text):
  global login, pwd, recipient
  cnx = xmpp.Client('gmail.com')
  cnx.connect( server=('talk.google.com',5223) )
  cnx.auth(login,pwd, 'botty')
  cnx.send( xmpp.Message( recipient , text ) )

oldsize = newsize = os.path.getsize(logfile)
while True:
  newsize = os.path.getsize(logfile)
  if newsize != oldsize:
    f = open(logfile)
    f.seek(oldsize, os.SEEK_SET)
    s = f.read()
    if s[-1] == '\n':
      sendmsg(s)
      oldsize = f.tell()
    f.close()
  time.sleep(10)

I used information on that page for connecting xmpppy to Google Talk.
Comment: You have to install it from http://xmpppy.sourceforge.net/
Comment: Does this require any Python dependancies or is XMPP included with Base?

Tail server logs into XMPP?


Difference and relationship between the hibernate session and connection pool?

Question: I am confused about the hibernate session and connection pool, are they the same thing?
Answer: Hibernate is an ORM, it is a layer between a SQL database and your POJOs.
A connection pool provides a way to store and reuse java.sql.Connection instances for speed and robustness.
A hibernate Session is a wrapper around a Connection in order to allow you to save your POJOs without directly writing the SQL.
So a hibernate Session is a wrapper around a Connection. Connections are held in a connection pool.
When you call SessionFactory.openSession hibernate first takes a Connection from the supplied connection pool. It then creates a Session around that Connection and returns it.
Comment: Does it close the connection on closing the session?
Comment: @user_mda you should not be thinking about connections when using JPA. It can do what it wants under the hood. Practically speaking it would probably call `close` on the `Connection`, yes, but that's an implementation detail.
Comment: what is the difference between session.close() and session.flush()?
Comment: but HibernateUtil.getNewSession() does not create a new connection?


WebSphere Portal Page Passing Parameters On Page Link Click

Question: I am using WebSphere Portal 8 and I am facing one issue related to session clearing on Portal Page link click. I have a portal page with one single portlet (Search Portlet) and it is working fine. Then after some search I navigate to another unrelated page and again click on the link to Search Portlet. The problem is previously selected values are still present in UI.
I want to know is there any way I will know which Page Link is clicked so that I can clear session in Portlet Class. Or is there anyway to pass some parameters once a Page Link is clicked.
Thanks in Advance!
Pradeep
Answer: Portal maintains the state of the portlet, redirecting to page with clean URL will do the trick.


In views, how can you link "read more" to the webform submission?

Question: I have created a view from webform submissions but some of the answer in the submission are too long. I tried to add a "read more" link in the view to be able to view the rest of the answer but I'm not sure which path to give it. When I do node/[nid], as you would with a content type, it goes back to the blank webform.
Answer: I believe the link should be node/%nid/submission/%sid/view.
Where %sid is the webform submission id.


How do I report if linear regression and 2 way anova main interaction is providing me with different results for the same hypothesis?

Question: I am doing a study on locus of control and coping ability moderated by social support. For the subscale of locus of control - internal belief, it was found that there were no significant prediction on coping ability when using the linear regression statistical analysis. However, when the internal belief subscale was categorized into high and low levels and tested with a 2 way anova on coping ability, it can be seen that there was a significant main effect. So, how should i report this contrasting find in my research study? It is confusing and I am stuck in the discussion section because of this contrast in results obtained. Please help and advice.
Answer: These are actually two slightly different questions:
Regression: Is coping ability linearly related to locus of control-internal belief?
ANOVA: Are people who are high on internal belief different on coping ability than people who are low on internal belief?
Before reporting anything, I would examine plots of the two variables against each other. I'd also take a careful look at whether the assumptions of the models were violated.
Then I might use splines in the regression.
Comment: Well, those two statements contradict each other. You have to be careful that regression is only looking at linear relationships; there is probably a nonlinear relationship going on.  You are not ready to report yet.
Comment: thank you so much~ now i understand it clearer. :) anyway so to clarify, i can report that internal belief locus of control does not significantly predict coping ability but individuals with high and low levels of internal beliefs have significantly different coping ability levels?
Comment: oh alright. I will try to look it up on how to report this. :) thank you for your time and explanations


Can I losslessly increase the volume of an MP3 file?

Question: I want to increase the volume of some MP3 files that I have. Is there a way to do this in a lossless way (without re-compressing the MP3 file and hence decreasing its quality)?
Answer: Yes. You can do this. The technique is used by a number of programs and the levels are calculated by an algorithm called ReplayGain. Mp3 volume level data can be adjusted losslessly, just as a JPEG picture can be losslessly rotated.
There are two methods

Calculate the volume level of the file and add a new tag, letting compatible programs adjust volume on the fly
Calculate the volume level and adjust a multiplier level in the mp3 data.

From HydrogenAudio: Implementations:

In the metadata method, information on both types of ReplayGain (Track Gain and Album Gain) can be stored. The volume-change information can be very precise. If audio data was also changed, the metadata can contain "undo" info. Not all audio players/decoders know how to read and use ReplayGain information stored in metadata. And there's no standard for where and how ReplayGain info is stored; each implementation uses different formats and puts the info in different locations.
In the audio data method, the file's actual audio data is modified so that its natural/default playback volume is at the target level. In this scenario, only one type of ReplayGain (Track Gain or Album Gain) can be applied. If no "undo" info is saved somewhere, it may not be possible to restore the original audio data. Limitations of the audio file format may prevent precise (finely tuned) gain adjustments with this method. For example, MP3 and AAC files can only be losslessly modified in 1.5 dB steps. Depending on the audio file format, the process may also be lossy in the sense that it could irreversibly push a signal above the format's maximum amplitude (resulting in clipping) or below the minimum (resulting in silence).

The second method does alter your file, but because the underlying data is not modified it loses no quality, hence the adjustment can be done losslessly. It is not generally recommended for your main collection as it is modifying the files from their original state, but it can be very useful for portable media players.
A program called mp3gain can do the second option and reversibly adjust the volume of mp3s. It does absolutely no re-encoding and simply adjusts magnitude values in the mp3 file itself to change the volume. From HydrogenAudio: ReplayGain

If modifying the gain, it always modifies the global gain fields in the MP3 audio data. It can add somewhat precise metadata, including undo info

Due to the way mp3 files are encoded the adjustment is limited to 1.5dB steps, which is usually enough to get close.
Foobar2k also includes this functionality and can apply the changes to the files.
Comment: @kasperd that is quite interesting in that it shows that in rotation the actual encoded image *data* is 100% preserved, otherwise continuing to rotate would never result in the same file, but that there is a subsequent process in the image reconstruction that is sensitive to the data rotation. It's not entirely surprising given the computations involved, but your original compressed data is in fact unharmed by the process and can be recovered. Hence the rotation itself is not loosing any data and is therefore lossless. It is the decoder reacting differently to the rotated data in this case.
Comment: In the past I have tested one of the programs which claimed to do lossless rotation of a JPEG file. Decompressing a version which had been rotated by 90 degrees 4 times produced the same output as decompressing the original. However decompressing a version which had been rotated by 90 degrees only once did not produce the same result as decompressing the original and rotating by 90 degrees. So 90 degree rotation of a JPEG file was not entirely lossless, and the root cause turns out to be certain asymmetries in the JPEG specification itself.
Comment: (I *think* jpeg rotations are lossless only if the size of the image in either direction is a multiple of 8 pixels)
Comment: @Strawberry: The data for a JPG always has an integer number of tiles in both directions, but the file includes dimensions that need not be a multiple of that.  If one were to rotate the data in the tiles when the dimensions weren't a multiple of the time size, portions of tiles that hadn't been in view would become visible, and some portions that had been visible would be preserved but hidden.  Repeating the operation three more times would bring the hidden data back into view.
Comment: Interesting. Could you explain the first option? Are these special ID3 tags?
Comment: @LPChip Yes, they tend to be embedded as APE tags in the file which means that they do need support from the player itself.  Because of that fact not many players I've found actually support them, hence doing it the forcible way is best for portable media players. http://wiki.hydrogenaud.io/index.php?title=ReplayGain#MP3Gain
Comment: @Mokubai it might be worth to mention aacGain as well, it does both MP3 and AAC
Comment: I use mp3gain on every new audio-file / album I add to my collection and normalize them all to the same level. It is fast, lossless and you can listen to everything on your player without changing volume level...
Comment: @Strawberry for lossless rotation the image size must be a whole number of blocks in both directions. The effective block size can be 8x8 , 16x16 or 8x16 or 16x8 depending on chroma subsampling.
Answer: In my opinion, Replaygain is not an answer to this question. It is not increasing the volume of the content, just adding a tag to tell players (only players which support the tag) to do their own volume adjustment at playback time. In particular, it's not compatible with all players, and not suited for all uses of mp3s (such as concatenating them into a single stream, etc.).
On the other hand, in theory it's possible to scale all the DCT coefficients without decoding and reencoding (i.e. without reversing quantization and DCT then redoing them), only redoing the Huffman coding (which is lossless). Back when I worked on MPlayer I believe someone had a utility which did this, but I've lost track of the name.
Answer: Yes, it's called replay gain, the principle is very simple, and works rather well. Basically, software "listens" to your track, and determines how much it would need to be amplified as to sound "normal". The information is written in mp3tag, separate from the data.
Compatible player then uses that data to automatically amplify the volume as to make all the tracks be reproduced at the same loudness. I would suggest to try http://www.foobar2000.org/ for this exercise. By right-clicking the track you can scan it, and in the program settings you need to set to use replay-gain info.
Answer: After downloading Audacity (free app) https://sourceforge.net/projects/audacity/, choose File/Import/Audio, navigate to your mp3 file, click on it and choose open. You will see a two-channel wave form.
From the drop down at top click on Edit/Select/All.  While the file is selected choose Effects from the drop down list at top and choose Normalize.  Just click "ok" from the window that opens.  The defaults are usually sufficient.  Click the green play triangle from the visible radio buttons to test your edited file.  You can work with many other effects such as the Equalization, Amplify, Bass & Treble etc.  When satisfied with the results choose File/Export Audio and choose the "save as type" you prefer, usually .WAV or .MP3.
I've had to do this with many weak files I've received.


Connecting to .NET COM app from .NET COM client

Question: I'm having trouble with something that should be brain-dead simple.
I am writing a COM client in .NET that will eventually talk to an old-style C++ COM interface when the server code is written. In the meantime, I've written an unsigned WPF .NET application and implemented the same interface - same IID, different ProgID and CLSID - so I'll have a harness I can test with. In theory, all I will need to do is switch my reference from one namespace to another and change the concrete class on the new statement and everything else will remain the same. I'm envisioning that when I CoCreate the CLSID, it will bring up the application with its GUI and my client can do its calls OLE Automation-style from there and see the effects on the screen.
Only that's not what's happening. In Add References for my client application, I see the typelib for my test harness in the COM list, but it refuses to let me add the reference because it detects that it is a .NET type library and expects a .NET reference. If I reference it as a project or browse to it as an EXE, it apparently loads the EXE in-process as if it were a DLL and uses the COM classes without actually activating it out of process.
I figured anything I did with a .NET COM application would work similarly to a C++ COM application. I'm not sure what my options are at this point. Am I facing a hard limitation or are there [attributes] that affect this behavior? (It has admittedly been a couple of years since I did really seriously detailed COM interop and I have an uneasy feeling that this is something really simple that I've since forgotten.)
Lupestro
Answer: Sounds like what you need is out-of-proc COM object. You can create COM+ objects inplemented in .Net and then instantiate them out-of-proc. This article explains how to do that.


Wireless router with built-in VPN client?

Question: Is there such a Wifi router that also has a built-in L2TP/IPsec VPN client? I want to share a VPN connection from multiple wifi clients but without having to setup VPN on each and individual client.
Answer: What you want is a VPN router. DLink makes several like this one here. I'm certain Netgear and Linksys make them as well, they are often used by remote offices to connect to a larger corporate network.
Comment: I can understand the confusion as the VPN router has two modes - a client mode that achieves the goals you are discussing and a host mode that allows VPN connections to be made to your network.
From the feature list: PPTP/L2TP Server/Client
You can also download the manual [here](ftp://ftp.dlink.com/Gateway/dir330/Manual/dir330_manual_110.zip). Page 32 shows the settings you would need to change.
Comment: It was pointed out to me that I should just include the product search link for the full line of VPN routers: [http://www.dlink.com/search/?qry=vpn%20router](http://www.dlink.com/search/?qry=vpn%20router)
Comment: I cannot find information that suggests that, e.g. DIR 330, can connect to a remote L2TP/IPsec server and allow wireless clients to access internet via the remote VPN server
Comment: found out that DD-WRT can also do this (and some other "generic" router firmware products).
Answer: Alex, i am also in search of a router which does what you want. you will need to buy a router which has an openvpn client built in. Dlink DSR-500 does the job, but is available only in the US. Outside of the US you could consider lyconsys' Mini VPN Router as it has an openvpn client in it. However, lyconsys' routers are made in Germany and hence would be expensive. Hence if price is a constraint then you could consider buying a Cisco Linksys E3000 router (Cost around US$150/-approx.) then download the dd-wrt v2 firmware from www.dd-wrt.com and flash it on to the Linksys router. Please do your study on both the router and the dd-wrt firmware before flashing it as you could end up in have a nice looking brick and by simply trying to flash the firmware of the router you loose the manufacturer's warranty. I have requested for the Mini VPN Router for testing. Will post my findings here. All the best. - Ramesh


Civ 6: RnF emergency but where?

Question: In Civ 6 Rise and Fall, a religious emergency has been declared and I am game but where is the city...? I can't find it :/ is there a UI feature leading me?
Answer: The Emergencies should tell you the Target City within the card that appears. In the below image the Target is St Petersburg and the Members must prevent it from following the specified Religion for 16 turns.
There are essentially two scenarios that could need to be played out:

The city is currently following a different religion then the goal of the Emergency. Since this emergency will last for only 30 turns you need to change the religion within the city in at least 14 turns. Also if waiting for the last minute like that you must ensure that the religion does not swap back during the rest of the Emergency. Generally in this scenario the city has been flipped and you must flip it back.
The city is currently following the religion that is the goal of the Emergency. The strategy here is the opposite from above, the only goal is to keep the city following that religion for the first 16 turns, then the Emergency will have to end. Generally in this scenario a city has been flipped and you must prevent it from flipping back.

Note: I found this image during a Google search and I do not take credit for its creation.
Comment: Yeah, this is the definition of an emergency, thanks but my question was not that. Please read: "but where is the city...? I can't find it :/ is there a UI feature leading me?"
Comment: My apologies. Well there is no UI marker leading you to that city. However since the `Antarctic Late Summer Patch` a `Search` tool has been added to the game. So you could enter the city name within that tool and it should allow you to find the city that way.

I think this might be limited to tiles that you have seen at one point or another, but I would have to confirm that limitation through some tests. However you would not have had to see the city for sure, just the tile that is below it. I use the feature to find all of the uranium on the map after it is discovered.

Does this help?

Civ 6: RnF emergency but where?


Pepper Plant leaves Wilting, please help

Question: Recently bought a pepper plant and transplanted it into a pot. Mulched over the top since its been in the high 80s F recently and I didn't want the soil drying out. Its only been in the pot half a week and was hoping someone could tell me what's wrong with it. It has been in full sun.
Answer: Doesn't look like the leaves are wilting to me, looks more like sunburn... peppers are able to withstand full sun, but they need to be hardened off slowly if they are coming from a greenhouse environment...
The keys to look for are certain parts will be more effected, like all of the leaves facing a particular direction, tops of exposed stems, etc. Tender new growth, will often be most effected.
Keeping plants moist in clay pots in hot dry climates can be difficult also, but I don't think that is what is pictured.
There are lots of articles written, and videos made about "harden(ing) off" plants... too late for OP, but hopefully helpful to someone.
Answer: your plant is wilting and should probably be watered. This being said extreme wilting causing leaf dryness can increase chances of plant disease. It is hard to tell with just these pictures, but to the untrained eye it might be a disease or a potassium deficiency. To better assess the situation can you give me background info on your irrigation? Did you drop any water by accident on your leaves while irrigating?


Foundation of mathematical objects modulo isomorphism in ZFC

Question: Suppose we want to define a notion of graph modulo isomorphism. The first thought that comes to mind is to consider the set of all graphs and then quotient it with respect to the equivalence relation induced by the notion of graph isomorphism, i.e. two graphs are equivalent if and only if they are isomorphic. A graph modulo isomorphism would be defined as an element of the quotient set. However, there is a small problem with this approach: the "set of all graphs" is actually not a set but a proper class in ZFC. And yet it seems pretty natural to me to consider two graphs as the same if they only differ by the name of their vertices and/or edges. We have the same problem if we restrict ourselves to finite graphs and also when we consider other mathematical structures such as groups or partial orders. Is there a way to overcome this issue and define standard mathematical objects modulo isomorphism in ZFC?
Comment: Why do "We have the same problem if we restrict ourselves to finite graphs"?
Comment: @Daron Because, if the class of finite graphs were a set, then the subclass of trivial graphs consisting of a single vertex would be a set. This essentially amounts to claiming that the class of all singletons is a set, which is false because, if it were a set, then the union of the elements of that set would be the set of all sets.
Comment: Oh you're right.
Comment: Not a way to overcome this in ZFC, but... You should check out the structure identity principle in univalent foundations, and univalent foundations more generally. It takes to heart the idea that equivalent (isomorphic) structures are the same.
Answer: First, it should be noted that we rarely need isomorphism types to be treatable as individual objects. For example, "There are $17$ isomorphism types of fleem graphs" is shorthand for "There is a set $\mathcal{X}$ of fleem graphs such that $\vert\mathcal{X}\vert=17$ and every fleem graph is isomorphic to exactly one graph in $\mathcal{X}$." So this is usually not even something we want to do.
But what if you really want isomorphism types to be represented by sets somehow? Well, in fact there is a standard trick for handling this sort of issue: Scott's trick. Instead of the proper class sized "collection of all graphs isomorphic to $G$," we use the much smaller "collection of all graphs isomorphic to $G$ and of minimal rank." Precisely, say that the Scott isomorphism type of a graph $G$ is the unique set of the form $$S_G=\{H: H\cong G\mbox{ and }\forall\alpha<rk(H), \forall J\in V_\alpha(J\not\cong G)\}.$$ This is always a set. Here $rk(X)$ is the smallest ordinal $\beta$ such that $X\in V_\beta$.
Now this trick does not require the axiom of choice, but it does require the axiom of foundation (also called "regularity"). In the absence of foundation, if choice holds bof's alternate approach will work; if neither choice nor foundation hold, we're likely in trouble.
Comment: Can you point out, how $S_G$ ist not unrestricted comprehension?
Comment: @Damian Note that $S_G\subseteq V_\beta$ for some appropriate ordinal $\beta$ (namely, the smallest $\beta$ such that $V_\beta$ contains a graph isomorphic to $G$). So the existence of $S_G$ as a set follows from separation.
Answer: "Graphs modulo isomorphism" are called isomorphism types of graphs. Scott's trick is useful when the axiom of choice is unavailable. In ZFC (which includes the axiom of choice) every set is in bijection with some ordinal number, so you can simply define the isomorphism type of a graph $G$ to be the set of all graphs $H$, isomorphic to $G$, whose vertex set $V(H)$ is the least ordinal number in bijection with $V(G)$.
Comment: It's worth noting that this is not just an "if-you-have-choice" alternative to my answer. Scott's trick **does** crucially rely on the *axiom of foundation/regularity*, while this approach doesn't. Basically, if you have foundation *or* choice you're good to go via whichever of these two tricks works (and if you've got both, then dance happily). In their simultaneous absence, though, things are [wonky-badonky](https://math.stackexchange.com/a/313631/28111).
Answer: Fix a Vertex Set
Suppose you are only interested in isomorphism classes of graphs with exactly 5 vertices. Then rather than consider the class of all 5 element sets, it is enough to consider graphs with vertex set $\{1,2,3,4,5\}$.
If you only want to deal with isomorphism classes of graphs with at most $\alpha$ many vertices, it is enough to fix a set $V$ with $|V|=\alpha$ and only consider graphs whose vertex set is contained in $V$.
There are no foundational problems here since there are at most $|\mathcal P(\mathcal P(V))|$ many such graphs.


How can I apply blur filter in Phaser 2.7

Question: Hello guys can I somebody please tell me how can I apply filters in general and specifically blur filter in Phaser 2.7?
the approach I found on chatgpt is
<code>var blurYFilter = game.add.filter('BlurY');
blurYFilter.blur = 20; // Set the blur value to 20
sprite.filters = [blurYFilter];
</code>
but this is not working. Can you please tell me the correct way to apply filters?
I am getting this error:
c.Filter[a] is not a constructor
at c.GameObjectFactory.filter
Answer: Checkout this official example for details. But basically you need to load the javascript files, that implement the blur filter for phaser ce.
<code>    game.load.script('BlurX', 'BlurX.js');
    game.load.script('BlurY', 'BlurY.js');
</code>
the two files you need, can be found in the offical github repo here.


Domain name classification API

Question: I need to categorize domains into different categories that offer the best use of a domain name.
Like categorizing 'gamez.com' as a gaming portal.
Is there any service that offers classification of domain name like Sedo is doing?
Answer: All the systems that I am aware of manage a list, somewhat by hand.
Using a web-filtering proxies (e.g. WebSense) for inspiration, you could scan for keywords contained in the domain name, or in web content/meta tags at the specified location.  However, there are always items that seem to match more than one category, or no category, and these need deeper analysis.
Eventually you end up building your own fairly complex logic, maintaining a list by hand, or buying a list from someone else.
Comment: Thanks But Maintaining by hand is not possible as number is very huge.
Answer: SimilarWeb API does that.
It's really straight forward and returns a given domain's category from a URL.
Comment: First 200 hits are for free, then you need a subscription.
Answer: If these are new domains or not used domains. There isn't any information on the internet yet. You can make use of a mechanical turk, like: https://www.mturk.com/ .
You could post an task with your list and possible categories. The downside is this will cost you money.
If these are domains that are already in use you can use a bookmark service as xmarks or delicious. Retrieve all public bookmarks from that domain and count the number of tags. The most used tags will indicate a category of the domain.
Answer: I think https://tools.zvelo.com/ has pretty accurate categorization.
For example gamez.com comes back with Hobbies and Interests as IAB-TIER-1 and Video & Computer Games as IAB-TIER-2.
It also provides information if the domain is brand-safe, is it malicious or illegal content?
Comment: Welcome to SO! It feels like your answer is more suitable as a comment than an actual answer.

Domain name classification API


"Safely Remove Hardware" icon in Windows 8

Question: In Windows 8 the "Safely Remove Hardware" icon sits permanently in the System Tray even though no external drive is plugged into the computer. If you click on that icon the only clickable option is "Open Devices and Printers." Hiding this (or any other) icon causes the "Show Hidden Icons" icon to display in the System Tray. Can the "Safely Remove Hardware" icon be removed from the System Tray without hiding it? Thanks.
Answer: I had a similar problem with Windows 8. When I clicked on the icon in the system tray, it displayed "Open Devices and Printers" along with three dots, like "..." underneath. All of my USB cables and devices were disconnected from my computer except the USB mouse and USB keyboard. I selected "Open Devices and Printers" and removed a device called "USB 2.0 Reader". The icon immediately disappeared.
When I restarted my computer, the operating system started to automatically re install the "USB 2.0 Reader". The icon reappeared along with the three dots. Keep in mind, there is no USB reader attached to the computer.
Instead of removing the device (Windows would just re install it again), I decided to disable it.  I opened the Windows Device Manager and selected the "Disk Drives" and selected "Generic - Multi-Card USB Device". I right clicked it and selected "Disable". The icon immediately disappeared.
I restarted my computer and the icon did not reappear. The device still shows up in the Device Manager, but it is disabled. The keyboard and mouse continue to work and I can connect my Windows phone to my computer.
It isn't clear what the root cause is, but I was able to remove the icon, stop Windows from re installing it, and if there is a problem in the future, I can always enable the device again. Also, this allows other "actual" devices to be connected and display the icon in the system tray (the true intention of the notification icon).
Hope this helps!
Comment: It did help! For me this was caused by a memory card reader plugged into the ExpressCard slot. Unplugging it, or disabling the "USB Mass Storage" device corresponding to it, made the tray icon disappear. Would have been much nicer if the icon only appeared when there was a memory card inserted and mounted!
Answer: One way to remove it is to right-click the Notification area, and select Properties. Under the Notification area heading, click Customize.
Find the Safely Remove Hardware icon and select Always hide in the Behavior column next to it. (Press OK and Apply to back out.)
Comment: But does he really want this? I think he still wants to have the icon when something is plugged in.
Answer: If any of your virtual drives are open the icon seems to be open in systray. Open devices and select the virtual drives and remove them from the devices and the icon from systray will go off.
Answer: In my case I managed to solve it by disabling the virtual SCSI drive that Alcohol 52% has installed on my computer. For some reason Windows detects it as an external drive or something and then displays the "Safely Remove Hardware" icon with the three dots (...) in the context menu. When I disable it in the device management screen, the icon goes away.
So that's what solved it for me. I hope someone may find this of any use when they come across my answer. Good luck.
Answer: I just fixed the problem of "three dots" on Windows 10. I hope this can help with Windows 8. In the registry (command regedit) search for the key
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\storahci\Parameters\Device
and look at the value TreatAsInternalPort. When I installed the OS, My internal HDDs appeared in the "Safely Remove Hardware" icon. So I added the bus number of the HDDs in TreatAsInternalPort.
(You can find this number in "Device Manager → Properties of the device")
After that, the HDDs where no longer displayed in the icon, but the three dots appeared... To remove them, I justed added all the Bus Numbers (from 0 to 5 for me) in the registry.


Has anyone been suspended for flopping?

Question: The league fines players for flopping and flopping can also be grounds for a technical foul. While players have been fined for flopping in games throughout the past few years, I want to know if anyone's ever been suspended for repeated flopping offences?
Comment: They have to get to at least five offences (six if the warning is included) so I'm going to say it's very unlikely. Nothing in a good Google comes up either.
Comment: @Nij I'd say that is an answer, particularly if you add the reference indicating why you say 5 offences is required.
Comment: Various articles talking about the introduction of penalties, easy enough to find if anybody wants to write the partial answer, but until I can get hold of a decent database of suspensions with reason listed since then, I'm wary of starting an answer.
Answer: According to NBA.com, you must be charged with flopping 6 times or more to be suspended for flopping.

Players will get a warning the first time, then be fined $5,000 for a second violation. The fines increase to $10,000 for a third offense, $15,000 for a fourth and $30,000 the fifth time. Six or more could lead to a suspension.

According to this list of fines and suspensions, if I counted correctly, there have been 36 fines handed out for flopping, but no suspensions.

Has anyone been suspended for flopping?


How can I make Java works in browser on Ubuntu (64bit) in 2017?

Question: I need to run some old browser-based java applications. But when today I open my Firefox and try to open this app, I found that Java plugin not works. I searched Internet and find that new Firefox not longer supports Java plugin (Chrome and other browsers too). So how can I make this in-browser java application run?
I use Ubuntu 16.04 64-bit.
Comment: Some browser-based Java applications may be possible to launch using `appletviewer`
Answer: | Ubuntu 16.04 LTS 64-bit |

First, I have updated Java to have the latest version.
<code>sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
</code>
Then I download and unpack archive with 64-bit ESR Firefox (older version - v.45) from here
Then I close my 'standard' previously installed Firefox and run 'firefox' file from the extracted folder of the version 45 archive.

And after that I open my site and successfully run Java application from it.
Comment: Did work in Ubuntu 17.04. But downloaded firefox from this ftp: https://ftp.mozilla.org/pub/firefox/releases/45.9.0esr/ and disabled automatic updates in firefox option's advanced section


How to load test Server Sent Events?

Question: I have a small app that sends Server Sent Events. I would like to load test my app so I can benchmark the latency from the time a message is pushed to the time the message is received so I can know when/where the performance breaks down. What tools are available to be able to do this?
Answer: Since Server-Sent Events it is just HTTP you can use siege utility. Here is the example:
siege -b -t 1m -c45 http://127.0.0.1:9292/streaming

Where:

-b benchmark mode i.e. don't wait between connections
-t 1m benchmark for 1 minute
-c45 number of concurrent connections
http://127.0.0.1:9292 my dev server host and custom port
/streaming HTTP-endpoint which respond with Content-Type: text/event-stream

Output:
Lifting the server siege...      done.

Transactions:                 79 hits
Availability:             100.00 %
Elapsed time:              59.87 secs
Data transferred:           0.01 MB
Response time:             23.43 secs
Transaction rate:           1.32 trans/sec
Throughput:             0.00 MB/sec
Concurrency:               30.91
Successful transactions:          79
Failed transactions:               0
Longest transaction:           30.12
Shortest transaction:          10.04

Comment: i'm trying to use siege Server-Sent Events and when i run this command "siege -c2 -d10 -t30s http://streaming_end_point" i get the following, fundamentally everything returns 0 but actually the connections are made successfully, any idea?
Comment: `Lifting the server siege...
Transactions:             0 hits
Availability:          0.00 %
Elapsed time:         29.61 secs
Data transferred:         0.00 MB
Response time:          0.00 secs
Transaction rate:         0.00 trans/sec
Throughput:          0.00 MB/sec
Concurrency:          0.00
Successful transactions:           0
Failed transactions:            0
Longest transaction:         0.00
Shortest transaction:         0.00`
Comment: @Sai that is rather odd, could you please post development server log? Also passing `--verbose` option to `siege` could provide some info.
Comment: thank you for responding, i really appreciate it. I tried running the siege with --verbose but wasn't able to get any information on why it returns everything as 0. I verified the DEV logs and i was able to see the streaming end point being executed the number of times mentioned in the -c value, each request will be associated with a UUID and i was able to see the UUID in the logs but not getting any data back from siege. The siege version i use is SIEGE 4.0.2.
Comment: I have created a question http://stackoverflow.com/questions/40048289/how-to-loadtest-server-sent-events with little more details about the service and SSE. I was also analyzing the GATLING tool to perform load test for SSE and found a bit info here http://gatling.io/docs/2.2.2/http/sse.html. On the other hand when i use siege against a normal req/res then it works like a charm but for this particular streaming end point it does not return any value.
Answer: I took a simple path of creating a shell script that initiates N background jobs of cURL which connected to the SSE endpoint of my service.
To get the exact cURL syntax, open your Chrome web dev tools -> Network tab -> right click on the entry of the request to the SSE endpoint and choose from the context menu "Copy as cURL"
Then you paste that command in a shell script that roughly looks like:
#!/bin/bash

i=0;
while [ $i -lt 50 ] ;do
    [PASTE YOUR cURL COMMAND HERE] -s -o /dev/null &
    i=`expr $i + 1`;
done

This will add 50 background cURL jobs each time it's run. Notice that I added to Chrome's cURL command the params -s -o /dev/null. This is to run cURL in silent mode and to suppress any output.
In my case the service was implemented in NodeJs, so I used process.hrtime() for high precision timing to measure the delay of looping through the N connected clients to broadcast the data.
The results were ok: it served 1000+ active connections in ~0.02sec
Keep in mind that if you run server + cURL clients from the same machine, you'll probably hit OS limits of open files. To see open file limits on your linux box (common case is 1024) run:
$ ulimit -n

To avoid reaching the 1000+ active cURLs I got, you can:

start them from multiple machines
or increase this limit (see sysctl)

The problem I faced was that eventually node crushed with an ELIFECYCLE error and the log was not very helpful in diagnosing the problem. Any suggestions are welcome.

How to load test Server Sent Events?


Business activity monitoring and business analytics relation

Question: A simple question, yet I couldn't find much information on the subject. How is business activity monitoring related to business analytics? I always thought business analytics is a subsystem of the activity monitoring systems. But that's only my limited view so I was wondering. In that trail of thought, how are for instance WSO2 BAM and Google Analytics compared to each other?
Answer: Initially WSO2 BAM 2.x.x was just a data analytic framework that can process big data offline (as batch processes with Apache Hadoop) which can also receive data and visualize data.
But from BAM 2.4.0 it comprises WSO2 Complex Event Processing features (CEP) that can monitor events real-time, process them and visualize them in a relatively low latency according to [1].
In Google Analytics most analytics and dashboards are available out of the box but with WSO2 BAM you may need to write some hive queries and dashboards to come up with a great solution.
WSO2 BAM is open source (Apache Licences) and you can use it as you wish with great flexibility although it lacks some out of the box features compare to the Google Analytics.
From BAM 2.4.0 it comes with an inbuilt Activity Monitoring feature [2] that is based on the concept of an Activity ID. This can be used out of the box when your business process is properly configured for activity monitoring use case.
[1] https://docs.wso2.org/display/BAM240/Realtime+Analytics
[2] https://docs.wso2.org/display/BAM240/Activity+Monitoring+Dashboard