cookies or cache? my own site won't load in FF without a restarting FF

Question: Over the last few days, I've noticed that (occasionally) when testing my own site in FF, it loads the first time that FF has been opened, but it seems to hang on subsequent loads (windows only - i haven't noticed this behaviour on mac, but i don't use my mac as much).
The url is http://HearWhere.com
Of course, my concern is that sometimes people will try to get to the site and not be able to (and based on what I can see, that is a distinct possibility, as i've seen a significant drop in stats over the last few days, so I suspect that might be happening).
Any idea why? I can't seem to figure this one out.
I view source on the page that hasn't loaded, and it appears that all the source is there.
The one thing I can think of that might be causing the problem is that in my head and footer, i have a bit of PHP which attaches the correct API key based on the visiting domain (this is so I don't have to hard-code the api key into the page and change it from dev to prod).
i use a fairly simple

$domain=$_SERVER['SERVER_NAME'];
if($domain=='dev'){
    $apiKey='apikey';
}else {
    $apiKey='apikey2';
}

but when viewing the source, it appears that show without issue.
I do a similar bit of code at the bottom of the page so I only include tracking codes when the domain is not dev.
Any ideas?
UPDATE --------------------------------------------------------------------
After checking it out in Firebug (not sure why i didn't check that before), the following two google scripts are failing, and everything stops there.
The site is map/location centric, so there i need the google stuff. Any idea why it would fail?
these are the failing scripts
http://gg.google.com/csiv=2&s=mapsapi&action=jsloaderjslinker&rt=jsload.69,jseval.103,jsdone.105
http://gg.google.com/csi?v=2&s=mapsapi&action=apiboot&rt=d.2,e.316,ab1.336
Comment: Hmm strange. Filing under 'works for me'.
Comment: yeah, that's what i was afraid of. i've noticed it MANY times, but not consistently. And closing and re-opening firefox means it works perfectly. Even if i try to reload the page 4 or 5 times (while it isn't loading), it won't load. restart firefox and all is good. I was hoping a problem in my code.
Answer: Have you tried Firebug plugin for Firefox? It could help you debug some script/network/html issues.
You can monitor script, images and other ressources load time.
Good luck.
Comment: Just checked in firebug (sorry),  204 No Content from http://gg.google.com/csiv=2&s=mapsapi&action=jsloaderjslinker&rt=jsload.69,jseval.103,jsdone.105, and http://gg.google.com/csi?v=2&s=mapsapi&action=apiboot&rt=d.2,e.316,ab1.336.
now..why?
Answer: It appears this was/is an error with Firebug. Disabling firebug resolves the issue, so it shouldn't affect too many visitors.
Thanks for the help,
Pete


determining size of batch, time of sending and memory in to send from scala to ML section

Question: I have a time series (sampling time: 66.66 micro second, number of samples/sampling time=151), I would like to determine some anomalies in them,  the inputs are made by scala customer message bus.
would like to know how I can determine size of batch, time of sending and memory in Scala customer or ML/AL?
Answer: It seems very complex to me to give you a correct size of batch, time of sending and memory, because very high frequency problems depends on every small operation in the algorithm you use to detect anomalies.
In addition to that, I don't know if the anomaly could be detected on a single or a multiple set of values (or both), and the minimum range of values to detect an anomaly. But you can easily define those limits by starting by quite simple anomaly detection algorithms that doesn't require lot of calculations, like autoregressive models, ideally autoregressive integrated moving average models (ARIMA).
Those algorithms would help you defining the right parameters and the best batch size based on their prediction quality.


A question regarding absorptivity and emissivity of black body

Question: A perfectly black body absorbs all incident radiation on it at any temperature and emits all radiations at any temperature,and thus at equilibrium absorption=emission.Say the black body is kept in a colder room, the rate of emission must be higher so it can attain thermal equilibrium but since it absorbs all radiations at any temperature and emits all radiation at any temperature, shouldn't its temperature be the same as what it was before?
Comment: sam as what it was before
Comment: Absorption doesn't = emission
Answer: The definition of a blackbody does not include it "emits all radiation at any temperature". I'm not even sure what that could mean.
The definition is that it absorbs all radiation.
If a blackbody is put in a colder room, then it will emit more radiation than it absorbs. Roughly speaking, it might emit blackbody radiation at its higher temperature, while absorbing blackbody radiation at the lower temperature of the cold room. Ultimately, its temperature will reduce to match the temperature of the room.
Answer: Here is a the spectrum of emission of a blackbody

As you can see, the blackbody emits radiation in all wavelengths, but how much it emits for each wavelength depends on the temperature.
For example, in the case of the sun, with a surface temperature of about 6000 K, the peak of its emission is found to be in the visible spectrum.
The same occurs for the absorption, a theoretical blackbody absorbs radiation of every wavelength, however how much it absorbs for a given wavelength varies and it is temperature dependent.
Answer: Absorption equals emission on thermal equilibrium, right. If the black body temperature is higher than the temperature of the environment, emission is higher than absorption, and vice-versa, right again.
In any case, temperature will tend to equilibrium with time, the rate equation being a first order differential equation with $dT / dt$ and fourth powers $T^4$ (see here).
Your source of confusion comes from "it absorbs all radiations at any temperature and emits all radiation at any temperature". You got the temperature dependence wrong. A black body has a radiation pattern as shown in the other answer, alright, we say that it emits radiation at all wavelenghts, with zero-power at $\lambda$ equals zero and infinty, and it has a peak power at $\lambda_{peak}$.
What changes with temperature is the peak, according to Wien's law,
$$\lambda_{peak} = b/T,$$
where $b$ is a constant (Wien's displacement constant). So the higher the temperature the lower the peak emission wavelength. But, overall speaking, it will emit more than absorb while its temperature is higher, and absorb more than emit while its temperature is lower.


How to identify/handle text file newlines in Java?

Question: I get files in different formats coming from different systems that I need to import into our database. Part of the import process it to check the line length to make sure the format is correct.
We seem to be having issues with files coming from UNIX systems where one character is added. I suspect this is due to the return carriage being encoded differently on UNIX and windows platform.
Is there a way to detect on which file system a file was created, other than checking the last character on the line? Or maybe a way of reading the files as text and not binary which I suspect is the issue?
Thanks Guys !
Comment: Some characters such as the UK pound sign £ are two bytes in UTF8. How are you measuring the length? What is the target character set in the DB?
Comment: Title and tag (filesystems) are misleading.
Answer: Unix systems use \n line endings while windows uses \r\n and mac uses \r.
You cannot detect the file system since it doesn't matter at all. I can use \n on windows if my editor supports it for example. It's just the standard on those OS, not a requirement.
The proper way - assuming you don't have a function which properly tokenizes no matter what line ending the file uses - is to search for a \n OR a \r and then end the current line and strip all chars from the remaining data which are either \r or \n before you begin the next line.
However, this will cause issues if you have blank lines and need to keep them. In this case you have to look at linebreaks more carefully:

when reading a \n, end the current line and start the next line
when reading a \r, end the current line and, if the next char is \n, skip it, and start the next line, otherwise start the new line immediately.
Comment: Classic Mac OS used \r for its line terminator. Current versions of Mac OS (basically anything released in the last 10 years) uses \n
Answer: Most of the time Java will handle differing types of line endings automatically, silently parsing \n (unix) \r\n (windows) and \r (mac) without bothering you (as long as you're using a character stream).  See the docs for java.io.FileReader and friends.  Using a character stream will also handle all of the possible Unicode encoding schemes.
If you want to read the line separators explicitly, you'll need to read the file as a byte stream.  See the docs for java.io.DataInputStream and friends.
Answer:
Is there a way to detect on which file system a file was created, other than checking the last character on the line?

No.  And even checking the line termination sequence is only a hint.  We can easily create files with DOS line termination on UNIX, and vice versa.

Or maybe a way of reading the files as text and not binary which I suspect is the issue?

Yes.  Open the file using a file reader, wrap it in a buffered reader, and use the readLine() method to read the file a line at a time.  This method recognizes a "\n", "\r" or "\r\n" as a line separator, and hence works for DOS, UNIX and Mac files.
Here's some typical code:
    Reader r = new FileReader("somefile");
    try {
        BufferedReader br = new BufferedReader(r);
        String line;
        while ((line = r.readLine()) != null) {
            // process line
        }
    } finally {
        r.close();
    }


Interaction in stepwise regression analysis

Question: I did a stepwise regrssion analysis to predict energy expenditure using the variables, height, weight, age, gender and energy intake. The final model contains the variables gender and weight. Now does this final model take into account gender by weight interaction? Or do I have to construct a new equation from this final model, that will accomodate interaction?
Answer: Stepwise regression has a number of bad qualities (just look e.g. here or here and this is one of them. With only 5 variables (plus one interaction), unless your sample size is small you can include all the IVs. Why would you do this?
1) It is clear, even to a non-expert, that all your potential IVs are included for strong theoretical reasons. Finding that one of them was not related to energy expenditure would be remarkable. In fact, it would be more remarkable than finding that all of them were related.
2) Even if a variable is not significant and even if its coefficient is small, it might affect the relationship between the DV and other IVs.
Comment: What I would do, in your situation, supposing that there was no issue with overfitting, is run one multiple regression with all 5 IVs and one interaction, which seems to be what you  hypothesized.
Comment: Thank you for your reply. I used step wise regression to prove the argument that weight predicts most of the variance in total energy expenditure. So are you saying that a simple multiple regression would do? If so, what about the interaction factor?


Rational/meromorphic functions on curves

Question: Let, say, $E(\mathbb{C})$ be the set of affine points on an elliptic curve $y^2 = x^3 + ax + b$. Then $E(\mathbb{C})$, together with an additional point $\mathcal{O}$, can be viewed as a compact Riemann surface $X$. Let one call a meromorphic function $f : X \rightarrow \mathbb{C}$ rational if any point $P \in X$ has a (punctured) neighbourhood, on which $f$ can be expressed as a rational function of the coordinates $x, y$. Are all meromorphic functions on $X$ rational?
Answer: Any meromorphic function can be viewed in local charts as
$$\frac{P}{Q}=\sum^{\infty}_{i=-k}a_{i}z^{i}$$where $P,Q$ are polynomial functions. However on an elliptic curve any meromorphic function can be expressed as rational functions of the Weistrauss $p$-function. Then you have a simpler description this way. I do not think $f=\frac{P}{Q}$ holds globally as this would force holomorphic $P,Q$ to be constants.
If I recall correectly, the reference on this is Neal Koblitz's book on elliptic curves and modular forms. This should be in Chapter $1$ or $2$.
Comment: Thank you. I am aware of the fact the Weierstrass function and its derivative generate the field of meromorphic functions on $E(\mathbb{C})$. What I do not see is why, for instance, the Weierstrass function (or any other meromorphic function) can locally be written as a rational function of the coordinates $x, y$ (and I don't find the latter in Koblitz's book).
Comment: @Albertas: I think a meromorphic function over any Riemann Surface given by $f(z,w)=0$ can be turned into this form. But I do not recall the details (I think you need the correct local coordinates like $z$ or $z^{-1}$, then construct a meromorphic function locally as $f(z)$, etc). I think what you do is to map the elliptic curve into a torus using the Weistrauss function(see the wikiarticle http://en.wikipedia.org/wiki/Elliptic_curve). Then you have local coordinates in $z$ you can work with.


How could fixed-point be implemented?

Question: Fixed point is essentially storing a number of units of a certain size instead of storing a significand and an exponent. However, if the units could be of any size, how big would the fixed-point units be in a typical fixed type of a programming language? C does not have fixed-point, so to use this one just stores an integer and divides by the number of units in a 1 to get the value, for example, one could store an angle as a uint16_t x; representing 65536ths of a turn, and call sinpif(x*0x1p-15F). However, if a language were to implement proper fixed-point semantics, how could this be done? What would be a typical range and precision of the varying fixed-point types?
Answer: Fixed-point is an integer with a statically-known decimal (or more generally, statically-known divisor). You can represent a fixed-point datatype as an "representation" integer type and "divisor" integer (kind of like a fixed-sized array, which is an "element" type and statically-known "length" integer). At runtime, the value is simply an integer, but the compiler uses the statically-known divisor to do proper conversion (e.g. to floating-point or string).
For example, imagine a language with this syntax
type Currency = FixedPoint<u32, 100>

let currency1: Currency = 50.34  # represented as 5034
let currency2: Currency = 123.9  # represented as 12390
let currency3: Currency = currency1 + currency2  # represented as 17424
print(currency3)  # prints 174.24

Note that there isn't one "fixed-point" type, since different types may opt for different fixed points. The key difference between these types and a floating-point type, is that all instances of a particular fixed point type have the same "decimal" or divisor (whereas floating-points the decimal can be at different points at runtime).

I actually don't know any real-world languages which implement this feature, though. The closest may be F#, which has measurement types. For your specific example, you could declare a [<Measure>] type angle, and then ensure that int16<angle> n is treated as n 2*pi/65536 radians like so:
[<Measure>] type angle

let toRadians (x: int16<angle>) = x * 2 * pi / 65536<angle>

Then you can't use int16<angle> wherever a unit type is expected, you must apply toRadians first.
Comment: For real-world uses of fixed-point arithmetic, a good place to look is probably assembly languages for digital signal processing chips. Fixed point numbers are used a lot in DSP.
Comment: COBOL has fixed-point arithmetic. The reason some programmers care about fixed-point arithmetic is that it's used in the real world!
Answer: Make precision part of the type
I'm not familiar with any general-purpose languages that use fixed point at all, but this is what PostgreSQL does. If you want to indicate that a column stores 15 digits, of which two are to the right of the decimal point, type it as NUMERIC(15, 2). This way, each user can choose a reasonable scale for their application, instead of the language forcing one on them.
Answer: Have a default precision, and allow changing it
Lisp has several different types of floats. One is long-float, with arbritrary precision. For example:
(SETF (EXT:LONG-FLOAT-DIGITS) 3322)

This sets the "long float" precision to 3322 binary digits (approximately 1000 decimal digits). By default, it's 64 binary digits.
After this, you can print out a long float to see that it works: Try it online!
Answer: GCC Fixed-Point Types
GCC has fixed point types as an extension. The types are _Fract and _Accum (A new language would designate them as just fract and accum) and could be combined with long short etc to specify precision, and unsigned to specify signedness.
fract
A fract would store a normalized value between [0, 1). The increments would be 1/2^bits where bits is bits of precision. If signed, one of the bits would be a sign bit so the increments would be twice as big.
accum
An accum would store half the bits as integer bits and half as fraction bits. The range would be [0, 2^(bits/2)) but in increments of 1/2^(bits/2).
Answer: Ada has fixed-point numbers: https://www.adaic.org/resources/add_content/standards/05rm/html/RM-3-5-9.html
The given examples are
type Volt is delta 0.125 range 0.0 .. 255.0;

  -- A pure fraction which requires all the available
  -- space in a word can be declared as the type Fraction:
type Fraction is delta System.Fine_Delta range -1.0 .. 1.0;
  -- Fraction'Last = 1.0 – System.Fine_Delta

type Money is delta 0.01 digits 15;  -- decimal fixed point
subtype Salary is Money digits 10;
  -- Money'Last = 10.0**13 – 0.01, Salary'Last = 10.0**8 – 0.01

There's two alternatives; a normal fixed-point type uses a power of two as its delta, and a decimal fixed-point type uses a power of ten.
Comment: The question is not what languages have fixed point but how you might implement it for your own language
Comment: @mousetail This shows the same details as the Lisp and SQL examples above. They're all examples of how the syntax could work, and certainly for binary fixed-point, the implementations pretty trivial; shift everything by the appropriate power of two on literals and conversions, don't worry about add and subtract, and do the obvious modifications on multiply and divide.

How could fixed-point be implemented?


column header for multicols

Question: I would like to add a fixed content (produced by e.g. \parbox) at the top of every column of a multicols* environment. How can I do this? The optional argument of multicols* is only added on the first page and covers all columns - I need it on every page and every column. Using a table package like longtable could be a solution but I haven't found a multipage tabular package that works well with multicol.
Comment: You can't use longtable in combination with `multicol`. `multicol` saves the content inside a save box and split them. `longtable` works well with `twocolumn` mode so you have the first method. (Note: `\twocolumn` always starts a new page). What to you want to have? Do you want to break at special points?
Comment: you can redefine the header of pagestyle francy} via the optional argument of `multicols`. With a \vbox of 0pt you can set the multicols header deeper than the default header.
Comment: @Herbert: That's my current solution (put the fixed content into the page header). But it looks bad if there is only one column on the last page (I use `multicols*`).
Answer: You don't provide a minimal example, so I hope to get away by reminding you on this:
multicolumn long table or enumeration
As far as I understand your question, you could use \tablehead of supertabular to print your »fixed content«.
Comment: Yes, that seems to to the trick. I'll wait till the end of the bounty period, though.

column header for multicols


What exactly he wanted to make by killing girls or he wants to store the smell of that girl (first girl he killed)?

Question: In the movie Perfume: The Story of a Murderer it's like he liked the first girl's fragrance so much so he just tried to smell her closely, but why does he keep on killing other girls? Was he getting attracted by other girls' fragrance, too? And what did he achieve by killing girls?
Comment: It's been a while since I've watched it, so I may be wrong, but I think he was after The Perfect Smell, which he achieves with the last murder. With that smell he enchants the crowds at the end.
Comment: @VedranŠego  That is my understanding as well.
Comment: Having not seen the movie, there was an episode of [Criminal Minds](http://www.imdb.com/title/tt0452046/?ref_=nv_sr_1) which follows a serial killer doing the same basic thing, taking a woman's essence down to their smell and refining it to not a perfume, but something they can hold in a tube and smell as they desire. Just bringing up the correlation of the two.
Answer: short answer:
The movie uses scent as a symbol of love. The main character was robbed of love at birth when his mother was killed, and therefore spends his entire life searching for love, and hurting other people along the way. Unfortunately, being deprived of his mother's love meant he never learned to love himself, and therefore is incapable of loving anyone else. In the end he finally realizes his tragic condition, leading him to take his own life.
long answer:
The movie opens with the main character losing his mother immediately after he was born. He then grows up without a scent of his own, but with a relentless nose for other people's scents -- a peculiarity which drives other people away from him. As he ages, his obsession with other people's scents causes him to kill several women in an effort to capture each of their scents as he searches for the perfect scent.
The interpretation is that the main character keeps searching for the perfect scent just like some men keep searching for the perfect woman, or like addicts keep searching for the escape of getting high. Each time the main character is able to capture a woman's scent, he finds himself unsatisfied and kills the woman -- just like real-life "Don Juans" are unable to find long-term happiness in a committed relationship, or like real-life addicts are unable to avoid the inevitability of coming down. Each woman the main character kills represents a sexual conquest that ends in the woman's heartbreak, or a bender that ends in the inevitable painful hangover.
Overall, the main character is driven by his fractured childhood relationship with his mother, which left him with no scent of his own -- just like real-life Don Juans and other addicts are thought to be driven by "mommy issues" that leave them unable to love themselves. The main character's suicide at the end symbolizes the two most common outcomes for the main character's real-life counterparts: either self-destruction or a life-saving relinquishment of their self-destructive ways.
Comment: I disagree with this interpretation on several reasons (also see my own answer): 1) *spends his entire life searching for love* – I see no indication for this whatsoever. He never strives for a token or gesture of love from anybody. 2) *his fractured childhood relationship with his mother, which left him with no scent of his own* – There is no indication in the movie that Grenouille not having a smell of his own is caused by this.
Comment: 3) *Each time the main character is able to capture a woman's scent, he finds himself unsatisfied and kills the woman* – He never shows dissatisfaction with his victims' smells. In particular when he kills the prostitute, it's clearly because she refuses to participate in his procedure rather than being dissatisfied with her smell. Moreover, his methodical hunting of women and arranging their scents of in a 3×4+1 scheme is evidence of a long-term plan rather than some search for love.
Answer:
but why does he keep on killing other girls? Was he getting attracted by other girls' fragrance, too?

Short answer: Grenouille is a clear psychopath who only cares about preserving women's smells in a perfume.
The key scene to understand Grenouille's motivation is when he accidentally kills the plum girl.
He cares only about her smell, not about the person.
He doesn't even notice that he killed her until he releases her, and even then he is merely surprised, not shocked or griefed.
Only when her smell fades, Grenouille becomes upset, because something beautiful to him turned out to be ephemeral.
He then becomes obsessed with preserving smell, clearly to apply it to smells such as the plum girl's.
On his quest for preserving smells, he learns about formal perfume composition (3×4+1 ingredients) and encounters a new smell of his desire (Laure Richis).
This slightly modifies his goal to that of creating a perfume of preserved women's smells with Laure being the centre piece.
So, yes, other women's fragrances are still attractive to him.

And what did he achieve by killing girls?

Short answer: He achieved that he could perform his procedure on them without hassle.
Grenouille's procedure could technically be performed on a living woman:
She would just have to let him smear her with fat and completely shave her.
In his first attempt with the prostitute, he probably did not plan to kill her until she became grossed out by the procedure and refused to participate.
On the other hand, given that he does not care about the person behind the smell at all, his only reason to keep her alive was to avoid her smell fading, which then turned out not to be necessary.
Since finding women who would willingly undergo his procedure (alive) was practically impossible for him, he resorted to just killing them.


Download Link in a Form?

Question: I tried to search and locate information on this topic and was unsuccessful. I would like to add a link to my form that allows a user to download a CSV file for completion of required data. How do I do this in Cognito?
Answer: I'm a developer with Cognito Forms.
We do not offer a way to upload files to a Cognito Form, that the end user could then download. You can include links to files that you would like to have your end user download. The file would need to be hosted in your website and the link could then be included in your Cognito Form.

Download Link in a Form?


HAProxy/Keepalived and DNS

Question: We have some HAProxy/keepalived clusters on CentOS7 and found that the virtual IPs managed with keepalived have registered in DNS.  Does anyone know of a way to block dns registration for address registered with keepalived or to block DNS registration for an interface (while leaving DHCP on)?
Answer: Probably your CentOS servers are sending the hostname to the DHCP server and this is updating the DNS. One way to disable it is using nmcli (use ipv6.dhcp-send-hosname if you are using IPv6):
nmcli c m "System eth0" ipv4.dhcp-send-hostname no

You must set that configuration for all the connections (you can list them with nmcli c s -a).
I believe that should solve your issue but if you are still having the problem, could you please provide more information about the DHCP server?
Comment: This did not work but I did confirm it works with NM on.  I did find a bug report stating that with NM disabled this option also needs to be set, testing it now.  DHCP_HOSTNAME=hostname
Comment: Thanks, this is what I'm looking for but do you know how to disable this if not using NetworkManager?
Comment: NetworkManager adds the `DHCP_SEND_HOSTNAME=no` setting to the /etc/sysconfig/network-scripts/ifcfg-ethX configuration file. I'm not sure if it will work with the network scripts, I haven't found any reference to that variable inside the scripts but you could try.

If that does not work you could a) start using NetworkManager b) see if you can disable setting the hostname in the DHCP server c) maybe use iptables to block it? (just a crazy idea)
Comment: Will try the DHCP_SEND_HOSTNAME=no and see.  Using NM is definitely an option is that doesnt work, thanks.

HAProxy/Keepalived and DNS


Windows installer for Ubuntu Desktop on WIndows 8 64 bit

Question: I installed Ubuntu 12.04 LTS on my Windows 8 64 bit laptop, and I am wondering if when I start Ubuntu does it at all use Windows 8 to run?  I am new to linux and an looking for an alternative to Win 8.  Even though the warning states that installing Ubuntu via the windows installer is not supported in Win 8, it does work.  I have had some issues installing Google Chrome, but aside from that no issue.
Thank you in advance for the assistance.
BTW - Since my work uses Win 7, I feel I will always be a slave to it, but if it works great, then I am thinking of reformatting my HDD and giving the lion share of my SSD to Ubuntu.
Comment: Please clarify: Did you install Ubuntu using WUBI.EXE from within Windows 8?
Comment: See http://askubuntu.com/questions/213516/making-ubuntu-my-only-os-using-wubi
Answer: The WUBI runs from inside Windows. It creates a virtual partition in a big file inside Windows partition (such as C:).
GRUB bootloader is tricked to look inside the Windows partition for the Ubuntu partition that is actually a file.
So, wubi will use windows8 then when you are trying to access Ubuntu then in the back-end you are using or relying on windows partition.
Now, if you just want to use Ubuntu without depending on windows you have to format your hard disk.


What's the similarity and the difference between time series regression and "regular" linear regression?

Question: Time series regression function looks very similar to the "regular" linear regression. But they're different. TS regression has auto correlation issues, but regular linear regression assume no auto correlation. My question is, what's the relationship between these two regressions? What's the similarity and the difference?
Answer: Your question contains much of the answer! Time series regression is the study of autocorrelations (correlations between the "past" and the "future" of your time series).. Linear regression assumes all your observations are independent from each other.
In other words, let's say you have a sample with the following target values:
A: $3,1,3,1,3,1,3,1$
B: $1,1,1,1,3,3,3,3$
Linear regression will treat both datasets as the same. However, if you fit a time series model instead, the results will be way different.
Also, in linear regression we study how other predictors ("regressors") influence our target value. While this can be the case in time series analysis ("external regressors") it is possible fo study a time series working only on the values of the series itself


deep learning for operations researchers

Question: I have some basic knowledge about deep learning methods (fully connected and convolutional NNs). I would like to expand my knowledge of deep learning which could be beneficial for an operations researcher. What resource/book would you suggest for reading?
Answer: This is the book that I used for my class at VT:
https://www.deeplearningbook.org/
This is another book that was recommended there:
https://d2l.ai/
This book on online learning is also useful:
https://www.cs.huji.ac.il/~shais/papers/OLsurvey.pdf
"Online Learning and Online Convex Optimization" by Shai Shalev-Shwartz.
Some papers I found helpful from Van Hentenryck:
"Fast Approximations for Job Shop Scheduling: A Lagrangian Dual Deep Learning Method",
"Predicting AC Optimal Power Flows: Combining Deep Learning and Lagrangian Dual Methods".
Also, this paper is helpful: https://arxiv.org/pdf/1705.03341.pdf "Stable Architectures for Deep Neural Networks"
If you have a graph background: https://web.njit.edu/~ym329/dlg_book/
Comment: Thanks for sharing this. The 4th mentioned references are very interesting.


Is there a simple way of classifying images of size differing from the input of existing image classifiers?

Question: Most image classifiers like Inception-v3 accept images of about size 299 x 299 x 3 as input. In this particular case, I cannot resize the image and lose resolution. Is there an easy solution of dealing with this rather than retraining the model? (Particularly in tensorflow)
Answer: My guess:
If you add a few CNN layers before the input of the given model and train only those layers while keeping the given model's parameters frozen, you might get better result.
Essentially these few extra layers would "transform" your input image into the appropriate shape, but with more accuracy since its trained and not hard coded.
Answer: My suggestion is to transfom the resolution of all images equal proportion.
You can use this python code:
<code>from PIL import Image
import os
import argparse

def rescale_images(directory, size):
    for img in os.listdir(directory):
        im = Image.open(directory + img)
        im_resized = im.resize(size, Image.ANTIALIAS)
        im_resized.save(directory + img)

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Rescale images")
    parser.add_argument('-d', '--directory', type=str, required=True, help='Directory containing the images')
    parser.add_argument('-s', '--size', type=int, nargs=2, required=True, metavar=('width', 'height'),
                        help='Image size')
    args = parser.parse_args()
    rescale_images(args.directory, args.size)

# save this python code as transform_image_resoluthion.py
# run this with cmd with the below command
# python transform_image_resolution.py -d images/ -s 800 600
</code>


How to display two blog categories as separate sections on one page?

Question: I have two blog categories that I want to display separately on the same page. In other words, one section will contain category 1 and the second section with contain category 2. Does anyone know how I can achieve this?
Answer: To achieve this I would recommend using the WP_Query class.
When using this approach, you are able to specify the parameters to search for posts (or categories) by.
For your particular question you should look at the Category Parameters. To target the categories you are looking for, you could do so by using their ID or their slug with the appropriate parameter label.
For example:
<code>// WP_Query arguments
$args = array(
    'category_name'          => 'category-1',
);

// The Query
$query = new WP_Query( $args );

// The Loop
if ( $query->have_posts() ) {
    while ( $query->have_posts() ) {
        $query->the_post();
        // do something
    }
} else {
    // no posts found
}
</code>
In the section where '// do something'' appears, is where you define what should be printed to the page.
There are useful websites you can use that generate this code for you - one such is GenerateWP.


Import HTML files, display options and special characters

Question:
I can import html files into SharePoint that I have created over time.  When I try to import any file with an underscore in the filename or a hyphen in the filename, I get the message that the file has been blocked by the administrator.  The administrator has no idea why this is happening.
Any file I uploaded to a SharePoint folder and try to preview it in the browser (either by clicking preview in browser or typing the URL directly into the browser) the browser wants to download the file instead of just displaying it.  These are html files.
I try to create a page by using the choice "Pick a preinstalled look", then select a template and click "Try it out" where the next page shows "This is a preview of your site".  The box where the preview is shows "the webpage cannot be found".
Comment: you ask too many questions in single question, which is hard for everybody to answer as well as hard for you mark it as answer. i would recommend split your question in multiple questions.
Answer:
SharePoint does not like the special charaters in file name.here are the list of special character <code>~, #, %, & , *, {, }, \, :, <, >, ?, /, |, "</code> Check this one http://blog.jasonsamuels.net/post/22390717928/avoid-special-characters-in-your-sharepoint-file  or Which special Characters are not Allowed in SharePoint 2013 Files\Folders?
what are your Web app general setting for browser file handling, if it is strict then change to permissive. http://thesharepointproject.com/2012/03/31/setting-browser-file-handling-permissions-on-sharepoint-libraries/
Comment: I will have my administrator check for the permissive setting.  I have seen the page on special characters, but underscore and hyphen isn't listed as a problem.
Comment: check this one: http://support.microsoft.com/en-us/kb/905231/en-us explain about the _
Comment: The underscores and hyphens are in the middle of the filename, like add_comment.html or add-comment.html
Comment: How you importing the files? what browser you are using? did you try different browser?
Comment: I decided to rename all the files with underscore and hyphen and all is well.  Just have some code to tweak.  Just more work, but I've had enough of trying to figure how to make it work.


Can the basement membrane of blood capillaries expand?

Question: I have been doing some rudimentary research into the basement membrane and found the it contains collagen fibers which are known for their elasticity.  Does this mean that the basement membrane can expand in capillaries?
Answer: It's a good question.
Though there is hardly some evidence to answer your question.
However I will share what all I found.
So in capillary basement membrane, mostly collagen type 1 and 4 are  present.
Now collagen type 4 aids in elongation of the new capillaries-

in the ex vivo rat aortic model of angiogenesis using a type I collagen matrix, type IV collagen promoted new vessel elongation and survival in a dose-dependent manner compared with controls (no type IV collagen), which grew until day 9 and then regressed during the second and third week of culture (treatment with 3, 30, 300 g/ml of type IV collagen in 43, 57, 119% increase in microvascular length) [139]. In all then, type IV collagen seems important for stability of blood vessel formation.

The collagen in capillary basement membrane impart mechanical stability to the vessel.
Also elastin is a component of the basement membrane. Reference
Now though I couldn't find that it's the elastin of basement membrane only, but-

Comprising 50% of the dry weight of major arteries, elastin is the most prominent ECM protein in arteries [43]. In vessels, elastic lamina alternate with rings of smooth muscle forming a strong, flexible part of the arterial wall [43, 44].

Here is the article


Using Opamp as rectifier

Question: Schematic below is a current sensing circuit, Rs is 35u sensing resistor and current I1 is bi-directional. I am confused on why diode D2 makes this circuit a full rectifier.
Schematic:

Simulation results on Rs and output D2 (N_HALF):
Comment: since Rs has value of u(H)? , on fluctuative load, the sensing part will resonate, and will be amplified U1. D2 will do the job to eliminate the AC signal, input for amplifier U2.
Answer: Look at what happens at the peaks and valleys.
When the inverting input of your opamp is high, it will try to sink current, but it cannot because of diode D2.  That voltage will go across R4 and make N_HALF high.
When the inverting input is low, the opamp will now source current through D2, also making N_HALF high.  The current through R4 will be reversed.

Using Opamp as rectifier


MagicalRecord iCloud backup

Question: I use MagicalRecord for data store (CoreData).I want use for data backup iCloud but I don't know how to read and write data to iCloud with using MagicalRecord. Anybody know how to use iCloud backup with using MagicalRecord? Any help will be useful. Thanks.
Answer: I found this blog series very helpful to figure out how to set up a project for iCloud with Core Data:
http://mentalfaculty.tumblr.com/post/23163747823/under-the-sheets-with-icloud-and-core-data-the-basics
Then, you set up MagicalRecord to use an iCloud Core Data store with this line in your AppDelegate's didFinishLaunchingWithOptions:
<code>[MagicalRecord setupCoreDataStackWithiCloudContainer:@"xxxxxxxxxx.com.companyname.appname" localStoreNamed:@"local_data_store_name"];
</code>
Replacing xxxxxxxx with the App ID from iTunes Connect, companyname with your iTunes Connect Company name, and appname with the name of your app. The local_data_store_name can be whatever you want.
Also, make sure you download and install the new Profile you will be creating to match your App ID. Xcode for me did not do it automatically. I also had to update my device to the current latest OS update, for iCloud to work correctly for testing.

MagicalRecord iCloud backup


Can I leave the Toronto airport during an 11 hour layover?

Question: I'm Portuguese and am going to Lima on AIR Canada. On my way back home I have a layover of 11 hours in Toronto. Can I leave the airport to visit the city? What happens to my luggage? Do I have to pass through immigration?
Comment: Portuguese can enter Canada without a visa.
Comment: Obviously to leave the airport you'll need to go through immigration and customs. You will also need an eTA. Not sure if you would need one in transit anyway?
Answer: You will have to pass through customs and immigration. Your checked luggage should be checked through to Portugal. It appears you will have an eTA anyway, since you are transiting through Canada and not to the USA.
Assuming it's AC1947 arriving at 11:40am Toronto time, you can take the UP Express to connect to the subway system, and you should have a reasonable number of hours to poke around downtown.
Answer: You'll have to go through  Canada Border Services Agency (CBSA) and security anyway, Canada has no real concept of international transfer. If it's all on Air Canada on a single ticket, your bags should be checked through. See https://www.torontopearson.com/Connecting.aspx# for details.
Since you need to go through immigration and security anyway, there is almost no time penalty in leaving the airport and 11 hours is plenty for a trip to town and back.
This assumes you are connecting at YYZ (Pearson airport) and not at YTZ (Billy Bishop airport). From YTZ, even an hour is enough to walk into town, have a beer (or two) and walk back to the airport :-)
Comment: I have a very similar situation. Can I return and enter the airport at any moment or will I only be allowed a certain number of hours before the flight?
Comment: You can enter the public part of the airport anytime. You can pass through security and go to your gate if you have a valid boarding pass for the "same day".
Comment: I will be arriving one day, around 4 PM and leaving the next, 6 AM. I would like to go to the city and then return to the airport, most likely, before midnight.
Comment: Check the opening times of the airport, Some security check points do close over night, so you may not be able to get into the secure area before 4am or so.


What do you call a person who takes up a new hobby and then gives it up?

Question: What do you call a person who takes up a hobby, feels very passionate about it, but then loses the passion, and takes up another hobby? For example, a person learns to sew a little, starts making dresses, skirts, etc., but then somehow loses interest and starts knitting instead, then loses interest, starts running etc. Sort of an inconsistent person, but in hobbies.
Update: Ideally, it could be used by a person to describe themselves.
Comment: Still not right but perhaps helpful - a person of short-lived interests.
Comment: It isn't the noun you're looking for but '[s/he blows hot and cold](https://www.collinsdictionary.com/dictionary/english/to-blow-hot-and-cold)' describes such a person.
Answer: There are several different terms that might apply. In English we can also express our feelings about someone who is doing this.

A Jack of All Trades is someone who can do many things and do them well enough to be considered proficient at doing them.  This is generally a positive reference.  It was traditionally used to describe men and typically male pursuits (i.e. plumbing, carpentry, etc.) but it is more frequently being used to describe women.
A Dabbler is someone who likes to a little of everything without professing to be good at anything.  This is generally a neutral reference although it can be used disparagingly.
A Dilettante is someone who professes or behaves as if they are proficient at something but only possesses an elementary knowledge of the subject.  This is generally a negative reference.

You can check the synonyms of these words to find other words that might work.
Comment: I disagree with these - they all describe someone who does a little bit of everything at once, not someone who does one thing for a short time, then moves on to something else.
Comment: jack of all trades is about one's work, not hobbies, :) But I think dabbler might work pretty well.
Comment: Thank you for your answer, but I also believe that all these are closer in meaning to 'an amateur'. A jack of all trades means a person skillful at many things. The expression I'm looking for is closer to 'flighty', someone trying to do many things and not sticking for long.
Answer: There is no term specific to hobbies, but you might say such a person is fickle, or flighty, meaning they are frequently changing their minds, not stable. Less common, but meaning the same is capricious. A person that gives up on something easily might be called a quitter.
All these are negative terms, most likely used to describe someone else who doesn't stick at a single thing. People tend to be more positive about themselves. A person who flits between hobbies or interests might say "I have varied interests", or "I like to try new things".
Another answer did suggest the idiom "a Jack of all trades", which doesn't describe someone who quits one thing for another, but someone who will turn their hand to anything, often badly. The full idiom is "a Jack of all trades, but a master of none".
Comment: Can a person say about themselves - I'm a quitter? What I'm aiming for is something neutral, a person could use to describe themselves (I didn't specify it in the question, sorry).
Comment: @rita not really - they mostly have a negative connotation. People tend to have a more positive view of themselves. I'll edit my answer.


Executing test on remote agent fails with "Target machine actively refused it"

Question: I am attempting to run tests on a remote agent by using a test controller that is on the same remote machine. I have set up my TestSettings file as follows:
<code><RemoteController name="MachineName" />
<Execution location="Remote">
    <AgentRule name="AllAgentsDefaultRole">
    </AgentRule>
</code>
When I tell MSTest to execute a selected test in release or debug mode, it successfully builds the project and then returns "Failed to queue test run 'run name': No connection could be made because the target machine actively refused it." Visual Studio 2013 has been installed on the controller/agent machine, and the agent, controller, and client can all communicate successfully. Default ports are being used for communication (6901 and 6910), and telnet is able to connect. How do I get the test executing successfully?
Answer: Found the answer.  Agents cannot debug remotely, and while the build I was executing against in the above post was "release" (in one instance), I was still attempting to debug.  If I select the test and click "Run" instead, it executes successfully on the remote agent.


How to select the best model on the basis of log likelihood?

Question: When we use AIC to select the best model, we choose the one with the lowest AIC. What is the rule in case of log likelihood?
Answer: Likelihood will tend to be better for larger models (ones with more degrees of freedom to fit the data). In particular, for nested models with continuous parameters over the whole of the reals, adding parameters must almost surely improve the likelihood.
AIC can be seen as an attempt to adjust the bias in the expected likelihood for the fact that we maximized it over a set of parameters. As such you can regard it quite directly as an approach to comparing likelihood across models of different sizes.
Answer: Your question is not clear. You cannot use the log likelihood to select between models because you will always get a better value of the log likelihood for bigger models. The rule is to use a penalized log likelihood: for example AIC or BIC.


How to provide required privilege for www-data user in php

Question: I am trying to execute a shell script which will copy certain folders and files from one location to another.
But I am struggling with a very basic problem - ie; I cannot copy folders or files when I call this script from php. Whereas the same script works perfect from terminal. Is it because that, from terminal when I execute this script, the user has has enough privileges to copy/create files/folders , where as when the script is called from php, the user does not have enough privileges?
For php, shell_exec('whoami'); says the user is www-data
What should I do, in order that, I have enough privileges to do the create and copy operations from php user www-data
Any help is much appreciated.
Answer: Add this:
username ALL=NOPASSWD: /path/to/script

in your sudoers file, In /etc/sudoers, you can also use visudo command to edit that file.


I can't install CrowdRender or any other add on in Blender

Question: For some reason I can't install any add-on on Blender 2.81. I tried to install it directly from the zip file, I also unzipped it and put it on Scripts/Addon in blender program...nothing works. I tried to install the whole the thing, I tried only the py file. What's happening? Why it doesn't get installed? What am I doing wrong. Thank you for the help.
Comment: What exactly goes wrong? Is there an error message, can't you activate the add-on or is it missing from the list of add-ons in the preferences?
Comment: It didn't show up at all in Add-ons in Blender. No error message, actually it was saying installed but not showing up. I closed the prog reopen it ultimately I had to go in Users/App Data/Blender/Scritps and install it from zip in that file in order to show up. Now it's in but very weird route to make it show. After all the trouble it's not worth it. Indeed it renders from still and animation but it uses only the CPU from both computers no matter what settings or combination you make in crowdrender settings. No GPU render at all with only CUDA checked off in both computers. Unchecked in Pref
Answer: G'day Daniel, The install function in blender just copies the addon files to your scripts/addons folder for the version of Blender that you install the addons from. So there are somethings we'd like to check.
1st is the addon actually installed into the correct directory? You will need to check your addons folder for the version of blender you are using. This location depends on your settings, but usually it will be on a path in your user directory. Mine is
~/Library/Application Support/Blender/2.81/scripts/addons/crowdrender - for mac
~/AppData/Blender Foundation/Blender/2.81/scripts/addons/crowdrender - for win
~/.config/blender/2.81/scripts/addons/crowdrender - for linux.
Check that you have a folder in addons called 'crowdrender'
If you do and it still doesn't work, can you try opening a console and running blender from it. When you try to list your addons, or enable or install the addon, any errors will be printed to the console, you can post them in response to this answer as comments.
Alternatively, you can actually post in our forum and ask for help there since we support the crowd render addon. Asking here on stack exchange will take longer since I don't really come here that often!
Forum is at www.crowd-render.com/forum-1
All the best and look forward to hearing from you soon :)


Evolution slow down over time EWS

Question: Not sure if anyone has run into this issue.  I use evolution 3.12 on Ubuntu 14.10.  After the initial install every thing worked great but over time Evolution started slowing down and responding very slow on deletes and move of the emails to folders.  on opening new emails it consistently showed a blank screen which I had to close the email and open it back up.  On sending emails it would leave a draft email in the draft folder even I confirmed that the email was sent.
After a lot of research I found the solution and wanted to share just in case someone else is having the same problems.
Shut down evolution
Go to home folder and do a "ctrl H" to show the hidden folders.  Navigate to /home/.cache/evolution.  (make a tar file of all the directories in that folder just in case)  Delete all the files and directories under evolution.
restart evolution and let it sync all the folders
That fixes the problem.
Keep in mind that it might delete your local address book so make sure you have a back up so you can import it back in.
Answer: To clear only the mail cache (which is responsible for slowing down) it is recommended to delete only the mail cache after the evolution is shutted down:
<code>rm -rf ~/.cache/evolution/mail/
</code>
So everything except your mail cache will be safe.

Evolution slow down over time EWS


questions about data/encryption of a linux directory

Question: i have a directory full of sensitive data and want to encrypt this directory
to protect against outside attackers. i still want to be able to read from the directory
and display this data onto a webpage in it's original form.  will data encryption tools, such as, eCryptFs, allow for this?  if it does, how does it work exactly if the data is mounted/unmounted? does auto-mounting come into play here?
Answer: The only benefit you'll get by encrypting the directory that way is that if someone physically steals your server and attempts to read the hard drive, they will not be able to do so without knowing the encryption passphrase. If you must be able to constantly read data from that directory, then you gain very little by encrypting the files in it, as attackers are more likely to try to gain access to it remotely than by stealing your server or your hard drive. Furthermore, you will have to manually enter the decryption passphrase every time you reboot that system, which will add to the complexity of your setup.
If you must satisfy some data at rest requirement, then you are better off investing into one of those self encrypting hard drives, as long as your system bios supports it.
Comment: @milesmiles55 The question you need to ask yourself is, what am I protecting myself from by encrypting the drive? When you ask, "is it enough?" you need to define what your goal is. mricon's first sentence is key for you: it will only protect against physical threats, not remote ones.
Comment: i should preface this by saying that both the application/sensitive data and web servers are on the same local network behind a tough firewall. so i would think that filesystem encryption should be enough in this case? i would be particularly leery only if the servers were in remote locations outside of the network.  in order to gain access, the outsider would need to enter multiple login credentials as well as have access to a PIV card and pin. <-if any of this is the case, there is a bigger problem.


Nothing can travel faster than the speed of light. In what frame of reference?

Question: Since frames of reference are arbitrary, I can define a frame of reference that moves backwards with a speed greater than $c$, then any static object in that frame of reference is already traveling forwards faster than $c$!
So what does "nothing can travel faster than light" exactly mean, and where does it apply?
Comment: What does your frame of reference move relative to?
Comment: Really I am asking, not arguing! I can't answer your question, but say it's moving relative to earth, then?
Comment: Nothing can travel faster than light in the frame of reference of any particle traveling along a timelike worldline.
Comment: @WillO: modulo acceleration/gravity (but instantaneous proper speed will of course remain $c$)
Comment: @WillO: Can you explain in simple terms what a timelike worldline is?
Comment: Essentially a duplicate of http://physics.stackexchange.com/q/7446/2451 , http://physics.stackexchange.com/q/79331/2451 and links therein.
Comment: Mohsin:  A timelike worldline is the worldline of a particle traveling slower than the speed of light.
Comment: Also roughly duplicated by http://physics.stackexchange.com/q/91233/ and indeed by every $xc + xc | x > 0.5c$ question out there (of which we have several).
Comment: This question appears to be off-topic because it completely ignores what Special Relativity is all about, yet boasts a knowledge of Special Relativity based completely on popular-science programs.
Answer: You have to measure everything from the same frame of reference. Your own frame of reference obviously has a velocity of 0, relative to you. The other object moving toward you, or away from you, will never move faster than the speed of light as seen from your frame of reference.
A third observer can see two objects, each moving at the speed of light. Toward each other, or away from each other - it does not matter.
Their distance can decrease or increase faster than the speed of light, as observed from the third observer, but no object will move faster than the speed of light with respect to the third observers frame of reference. Each of the two objects can calculate the other objects' velocity, and they will always get a number less than the speed of light. This is because time is relative, and when you measure somebody elses velocity, you use your own time.
An interesting side note:
You can travel faster than the speed of light, if you measure distance in one frame of reference, then travel in another frame of reference. Nothing else can, unless it travels with you.
The short reason for this is:

As your velocity increases, passage of time slows down for you.

If you were traveling to for example the Alpha Centauri, about 4.5 light years away. You could perform this journey in 8 of your months.

People on earth will have aged 5 years and 2 months.
You will have aged 8 months.
People on Alpha Centauri will have aged 9 years and 8 months, compared to the image you saw when you left earth.
People on Alpha Centauri will actually have aged 5 years and 2 months, taking into account that the image from them you saw when you started traveling was 4.5 years old.

To conclude:

Everybody else will have aged 5 years and two months, unless they also maintained a high velocity until they met you again.
You will have aged 8 months.
Your speed will appear to have been $2×10^9\text{ m/s}$, much faster than the speed of light.
Others will have seen your speed as approximately $260300\text{ km/s}$.

Calculations: Can the apparent velocity of an approaching spacecraft be faster than light?
Answer: I'm going to take a slightly different approach to explaining this, in analogy with a great answer about the ontological nature of Newton's Laws.
First, let's posit the existence of an inertial reference frame. It doesn't matter which one, but there has to be one. This is an important point, and one that's often overlooked. In it, nothing is moving faster than the speed of light.
Now given one reference frame, we can ask about all others. But what are all others? In Newtonian physics, they consist of anything we get by offsetting our coordinates and/or adding a constant velocity to everything. That is, anything reachable from our original frame by a Galilean transformation. One can easily prove that any two such frames can be transformed into one another via such transformations.
In special relativity, on the other hand, the transformation law to respect is that of Lorentz. Valid frames consist solely of those that are reached via Lorentz transformations, which are defined to have boosts of speeds less than $c$. Again, one can show that any two such frames are a single appropriate transformation apart.
You might be tempted to define "a frame moving with speed $10c$ in the $x$-direction relative to this one," but that definition isn't allowed in relativity.
In summary, nothing will ever travel faster than $c$ in any frame obtained by a valid Lorentz transformation for which this was already true.


Keyboards plugged to one computer have different failing rows of keys, but work perfectly fine on any other computer

Question: I have a PS2 and an USB keyboard. Recently, a column of keys on my PS2 keyboard failed, so I swapped it for an USB keyboard, but that one turned out to have another different failing column of keys. Both keyboards work fine when I plug them on another machine. What's wrong with my computer?
Comment: When you say "column of keys", what are the actual sets of keys that fail in each case?  In what way do they fail (e.g., no response? wrong output?)?  Does any keyboard work correctly?
Answer: now this is hard. i think it has got to be the software/drivers on your computer. plug in one of your keyboards, then right click my computer (or This PC) and choose 'manage' you will need administrator privileges. on the left collumn, click on 'device manager'. then on the right, right click 'keyboard and choose 'scan for hardware changes'. if nothing shows up (except for the plug and play window that pops up and then disappear after it finishes), expand 'keyboard' . look for the keyboard you are having issues with. then right click it and choose 'properties'. in the 'drivers' tab of the new window, look for 'roll back driver'. press it and wait for windows to roll back to a previous version of the driver. you might have to restart your computer. if the 'roll back driver' box is greyed out, it means that your computer doesn't have a previous version of the keyboard's driver to roll back to. in that case (or if rolling back driver didn't help you), click on 'update driver' you might not need to restart your computer but i am not sure. see if that helps you. try doing this for both keyboards. if you don't know which driver is your keyboard's, or encounter any problem, or that what i told didn't help you, take a screenshot (how to take screenshot: https://www.java.com/en/download/faq/screenshot.xml   if you are on a laptop, you will need to hold the fn key while pressing 'prt sc'-print screen or home) and post it in the comment to this reply.


Why are naturals < modulus equal if congruent? [uniqueness of remainder in a consecutive residue system]

Question: Let $a$, $b$, and $n$ be integers with $0 \le a,b \lt n$. If $\,a \equiv b \pmod n,\,$ i.e. $\,a-b = pk\,$ for an integer $k,\,$ then  $a=b$. Why does this congruence imply the equality?
Answer: It is not enough that $a,b$ are nonnegative, it is also necessary that $a,b$ are less than $n$.  With both of these conditions, then $a\equiv b$ implies that $a=b$.  The reason is that $a\equiv b$ means that $a-b$ is an integer multiple of $n$.  However, this integer multiple cannot be $n$ or greater (else $a\ge b+n$, impossible), nor $-n$ or smaller (else $a+n\le b$, also impossible).  Hence the only integer multiple of $n$ available is $0n$.
Comment: You might want to specify that it is impossible because $a \ge b+n > b$ and also $a \le b-n < 0$, violating the conditions.
Answer: Hint: their $\rm\color{#c00}{difference}$ is a natural smaller than $\,n\,$ and divisible by $\,n\,$ so it must be $\,0,\,$ i.e.
w.l.o.g. $\ 0 \le b\le a < n\,\overset{\rm subtract\ b}\Longrightarrow\, 0\le \color{#c00}{a\!-\!b <} n\!-\!b\le\color{#0a0} n \ $ so $\ \color{#0a0}n\mid \color{#c00}{a\!-\!b}\iff a\!-\!b = 0$
Remark $ $ This shows the uniqueness part of the fact that $\,0,1,2,\ldots,n\!-\!1\,$ form a complete system of representatives for equivalence classes of $\,\Bbb Z_n = $ integers $\!\bmod n,\,$ or, equivalently, the uniqueness of the remainder in the (standard) division algorithm. The same proof works for any sequence of $n$ consecutive integers since - as above - any two elements differ by less than the extreme elements, so less than $n,\,$ so their difference is divisible by $n$ only if they are equal. An example of an alternative sequence of remainders is those having least magnitude, e.g. $\,0,\pm1, \pm2\pmod{\!5}$. The argument easily generalizes to any arithmetic progression whose step-size is coprime to the modulus.
Corollary $\ A\equiv B\pmod{\!n}\iff \underbrace{A\bmod n = B\bmod n}_{\textstyle \color{#c00}{a = b}}$
Comment: @man An $n$-multiple $\,kn\neq 0\,$ has *greater* magnitude $\,|kn| = |k||n|\ge |n|\,$ by $|k|\ge 1\,$ by $\,k\neq 0\ \ $
Comment: @man That $m=0$ is the only multiple $m$ of $n$ with $\,0\le \color{#c00}m <\color{#0a0} n\,$ since all other multiples $>0\,$ are $\ge n.\ $ Explicitly: the natural multiples of $n$ are $\,0,n,2n,3n,\ldots$ and there are $\rm\color{#c00}{none}$ strictly between $0$ and $n.\ $ Said more informally, an integer divides a smaller integer only when the smaller $= 0\ $
Comment: **Unique remainder** $\Rightarrow$ **unique quotient** by $\,qn+r=q′n+r\Rightarrow qn=q′n\overset{n\neq 0}\Rightarrow q=q′\ $
Comment: How can we show that if $a-b\leq n$ and $n\mid a-b$ then $a-b=0$? That part struggles me :/
Comment: Sorry I do not understand what can you conclude from there. If $k\neq0$ and $kn\neq0$ then $n=0$?
Answer: The key trick here is the interplay between magnitude and divisibility — every nonzero multiple of $n$ must have a magnitude at least as large as $n$.
Symbolically, if $k \neq 0$, then $|kn| \geq |n|$.
Since integers in the same congruence class are separated by multiples of $n$, this puts a limit on how close they can be. We have
If $a \equiv b \bmod n$ and $a \neq b$, then $|a-b| \geq |n|$
The premise of the problem constrains both $a$ and $b$ to a narrow interval: they are both contained in the set $\{ 0, 1, \ldots, n-1 \}$. The largest possible difference between any two elements of this set has magnitude $n-1$. That is, for any two elements $x,y$ of this set, we have $|x-y| \leq n-1$.
So by the previous observation, the fact that $a \equiv b \bmod n$ implies that one of the following is true:

$a = b$
$|a-b| \geq n$

and we can rule out the second possibility because $|a-b| \leq n-1$.


How to stabilize training in multi-objective reinforcement learning?

Question: I am trying to train an agent to maximize multi-objectives. If I just add up rewards from different objectives, my problem is that the agent maximizes the 'easy' objective, at the expense of the hard one. How can I adaptively penalize the easiness with which the agent realize an objective?
Answer: If the reward from each objective $1... k$ is $r_1, r_2, ... r_k$ set the goal to be maximization of $R = \min_i r_i$ instead of $R = \sum_i r_i$. By maximizing the minimum reward across all goals, the agent will be forced to learn all objectives in order to perform better.
A possibly better behaved alternative would be to set $R = -|\text{softmax}(-\vec r)|_{L_1}$ (this sets the reward to be the negative softmax of the cost). This should accomplish about the same thing while being a bit smoother.
Answer: The simplest approach would be to maximise a weighted sum of the objectives. By giving a larger weight to the harder-to-achieve objectives you encourage the agent to place more emphasis on them. Finding the correct weights to give the desired trade-off between can be difficult though, and sometimes may not be possible as there may be no weights which actually result in certain solutions being obtained.
The alternative is to use a non-linear scalarisation of the objectives as suggested in shimao's answer. However that may cause convergence problems for reinforcement learning methods like Q-learning which are based on the Bellman equation.
I co-authored a survey paper a few years ago which provides a detailed discussion of these issues, which you may find useful: https://arxiv.org/abs/1402.0590
Comment: This paper lacks practical examples of scalarisations, although the theory is interesting


Find finite spanning sets

Question:
I need help starting with the following questions:
Let P3 be the vector space of real valued polynomials of degree ≤ 3. Find finite spanning
  sets for the following subspaces of P3.
(a) T = {p ∈ P3 | (0) = 0}
(b) U = {p ∈ P3 | p'(0) = 0}
(c) V = {p ∈ P3 | p(1) = p(2)}
I do understand how to tell if a vector spans but how do I find the spanning sets?
Comment: Basically to choose spanning sets, you just need to pick "enough" elements from given subspace so that they span the entire subspace.
Answer: I'll tackle the third case:
A generic element of $P_3$ is $p(x)=ax^3+bx^2+cx+d$
If $p(1)=p(2)$ then $a+b+c+d=8a+4b+2c+d$
With this condition we can eliminate one of the variables by solving for it. I choose to solve for $c$.
$c=-7a-3b$
As long as this condition is met, we will have a third degree polynomial satisfying the property that $p(1)=p(2)$.
Substituting back into the original polynomial gives a function of the form:
$p(x)=ax^3+bx^2+(-7a-3b)x+d$
We can then group the $a$'s $b$'s and $d$'s together to get our spanning set:
$p(x) = a(x^3-7x) +b(x^2-3x)+d=span \left[ x^3-7x,x^2-3x,1\right] $
In general, if you want to find a particular basis for a subspace of any given vector space, you can follow this procedure:

Write out a generic vector in the larger space.
Substitute in the defining property or properties of the subspace you are dealing with to eliminate parameters.
Group the terms of the result in terms of the remaining parameters, and the result will be a linear combination of your basis vectors.
Answer: Well a general polynomial in $P_3$ takes the form $f(x) = ax^2 + bx + c$. Now let's solve (a), we want to have a more explicit description of $P$. If $f \in T$ then
$$ f(x) = 0 \iff c = 0 $$
Therefore
$$ P = \{ax^2 + bx : a, b \in \mathbb R \} $$
Then by observation a spanning set for this is $\{x, x^2\}$. (b) and (c) can be solved similarly, by finding what the spaces $U$ and $V$ actually look like.

Find finite spanning sets


How to add a ceiling light to existing ceiling light in same room that has two wall switches?

Question: Our hallway has one small ceiling light that is controlled by either of two wall switches at opposite ends of the hallway. I want to add an additional light fixture toward the other end of the hall & have both switches control both lights. Thanks.
Answer: There will be a pair of conductors coming into the light box, one of which is the switched hot. You can tie into those to add another light either in the light box or in the switch box at the other end of that cable.
Be sure you have an understanding of box-fill regulations, connection techniques, etc. before you make any changes. For further assistance, show a diagram of the current situation.
Answer: If you have access to the attic above you can just add a fixture box where you want and wire it to the existing lights wires. The switches will now power both lights.
If you don't/can't get into the ceiling they make external conduit systems like the one below, but on the ceiling with light fixture boxes instead if outlets.
http://www.familyhandyman.com/electrical/wiring-outlets/how-to-add-outlets-easily-with-surface-wiring/step-by-step


Filezilla not being able to access my FTP files

Question: Hi so filezilla has randomly stopped being able to access my files and i am unsure why, this is what it returns when i connect
Status: Connecting to 220.127.116.11:21...
Status: Connection established, waiting for welcome message...
Status: Initializing TLS...
Status: Verifying certificate...
Status: TLS connection established.
Status: Logged in
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is the current directory.
Command:    TYPE I
Response:   200 Type set to: Binary.
Command:    PASV
Response:   227 Entering passive mode (167,114,186,68,131,6).
Command:    MLSD
Response:   150 File status okay. About to open data connection.
Response:   425 Rejected data connection from foreign address 18.104.22.168:26132.
Error:  Failed to retrieve directory listing
Answer: Aren't you using some mobile connection?
The most probable explanation for your problem is that your local IP address keeps changing.
And the FTP server won't accept data connections from different IP address than the one that originally opened the FTP connection.
There's nothing you can do about it, except for fixing the IP address.


My LG is indicating low storage space

Question: My LG is indicating low storage space. I cannot install new applications. I still have more than 7G free space. Please what can i do?
Comment: Here is the salvation: http://android.stackexchange.com/tags/insufficient-memory/info. Also, give us the output (screenshots) of [Diskinfo](https://play.google.com/store/apps/details?id=me.kuder.diskinfo) and [DiskUsage](https://play.google.com/store/apps/details?id=com.google.android.diskusage). You may have to delete an app or an app's data  to get some space for the said apps' installation.
Answer: Its a good tactic to reboot the phone clear up useless apps and move your pics or whatever to another place(may be sd card?).you should check the storage options in settings and that will tell you whats causing the error.
Answer: I think it is becasue of cache files go in settings>storages>cache data and clear them....and some of google apps like gmail and google now saves alot of data on your device be sure to clear that and go in storage and apps section and it ll show you the list of apps sorted on basis of their size(large to small)....clear their data...
Answer: you mentioned 7G free space,but in sd card or in internal memory?
all apps and app data may be stored in your internal storage.
Move your data to SD card and try installing new apps.
hope this will be helpful.

My LG is indicating low storage space


What are the available non-academic careers to a newly-minted PhD in theoretical condensed matter physics?

Question: Prior to completing my PhD degree, I used to hear, rather very often, that working in finance is the most non-academic viable career option for newly-minted PhDs in theoretical physics. But, now that I am actively searching for such jobs (any job, to be precise), it appears that employers in finance expect qualifications that practically all newly graduates like me lack. I might be wrong on this, but I don't know of anyone using SAS or R in their PhD research in theoretical physics. So, I was wondering what else is out there available to a newly graduated PhD with mostly a pen-and-paper background in theoretical condensed matter physics.
Comment: Although basically true there has been an exponential rise in specialist quant finance Masters and PhDs in recent years. Someone with just a PhD and little computing experience may struggle. You could consider doing a Masters in Financial Engineering or Quantitative Finance but only if you can get into a good program. There's a lot of pressure for jobs and the quality of the school is more important than anything else. The website www.wilmott.com is a popular forum for quant finance. You can search for similar questions there.
Answer: Regarding Finance, perhaps you should instead look for Quantitative/Mathematical Finance (quant) jobs. I think non-mathematical finance jobs do require different skills (though I don't imagine them being more difficult than QF jobs).
Many physicists become quants. You may want to try looking up Emanuel Derman to see his books if you might be interested in reading them and the Wiki pages on mathematical finance to see what kind of math is involved.
I am a grad student of QF now and we are learning SAS, R, Brownian motion and Feynman-Kac theorem. (at least the latter 2 are) Basic for you (theoretical) Physics people, I presume?
Edit: Regarding the mathemagician's comment, I've read some job openings for quants. There's no specific mention of having a degree in QF. They are just looking for master's/PhD's in quantitative disciplines. I recall one mentioning master's in Math, Physics or Engineering as a prerequisite.
Finance is relatively easy to learn. You don't need a QF degree to be a quant. Try checking out Hull's Options, Futures and Other Derivatives or Bjork's Arbitrage Theory in Continuous Time, but please be patient with the cute math you may see.
Other sites to check out are the quant stackexchange (save it from beta please) and quantstart.com
Edit 1: Regarding guest's answer, why don't you work a technology company or something?
Edit 2: teaching highschool/secondary school?
My knowledge of Physics is only up to Vector Calculus (or Partial Differential Equations if you want) and basic Analytical Physics so that's all I got haha
Answer: Two options I am aware of:

The electronics industry.  Sometimes they hire condensed matter theorists who can help them design better products.  I know one theorist at Segate who works on better hard drive designs.
Finance.  Most, but not all, jobs will require programming experience.  If you have not gotten any programming experience in a theory PhD I would consider your research strategy highly unusual.  Theorists probably lack experience with R and statistics, but if you understand basic computer science concepts it should not be hard to learn these things on your own.

Finally, consider academic/education positions.
Comment: Suggested edit: Change Finance to Mathematical Finance
Comment: what's an example of a 'basic computer science' concept here please? i don't recall i encountered any computer science in mathematical finance though maybe you're including computational finance.......which would explain why you did not agree with my suggested edit
Comment: btw re the last line...education is not necessarily academic right? sooo...yeah OP never said no education...


Powering 1.8v GPS with Arduino

Question: I want to purchase this new GPS on sparkfun, but I have no idea how to get the correct supply voltage (1.8vdc) for it from the Arduino.

48 Channel GP-2106 SiRF IV GPS Receiver
Datasheet
Comment: Time to make yourself familiar with the datasheet of the lm317 or a similar linear voltage regulator. Look in last section of the datasheet, there are in most cases circuits for the most common applications.
Answer: That module requires 65 mA max.  A linear regulator from the 5V supply would only dissipate 210 mW.  That's low enough that no heat sink is required.  While there are more efficient and fancy ways, if you have to ask here this is probably the better solution since it's simple.
If the Arduino has a 3.3V supply that can spare a extra 65 mA, even better.  That would mean the 1.8V regulator would only drop 1.5V, for a dissipation of 100 mW.  Make sure you put a 1 µF or so ceramic cap immediately in front of and after the regulator.
If you are stuck with 5V in, then you can use a dropping resistor on the input of the regulator to split up the dissipation between the regulator and the resistor.  Let's say whatever LDO you get should have at least 1V headroom.  That means you need 1.8V + 1.0V = 2.8V after the resistor, and the resistor can drop up to 5.0V - 2.8V = 2.2V.  From Ohm's law, 2.2V / 65mA = 34Ω, so the standard value of 33Ω in series with the regulator will work fine.  Again, don't forget the ceramic caps on the input and output of the regulator.  The input cap is especially important with the dropping resistor.
Added:
Here is the circuit I was talking about:

At the maximum current of 65 mA, the resistor drops 33Ω x 65mA = 2.1V and will dissipate 140 mW.  The regulator will drop the remaining voltage of 1.1V and will dissipate 70 mW.  140 mW dissipation in the resistor is enough that you need at least a 1206, although check the specs.  A "1/4 W" thru hole resistor will work fine for this.

Comment: On the Arduinos that use the FTDI chip you only get 50mA of 3.3v as it's  the FTDI chip that regulates that voltage.  (stupid idea if you ask me).  The later ones that use the Atmel U2 chip give you a stonking 150mA IIRC (still peanuts) so regulating from the 5V is probably best.
Comment: ![enter image description here][1]
Comment: @AndrewFerrara - Images and reference-style Markdown (the `![alt text][1]` notation) don't work in comments.  You'll have to use mini-markdown links.  The format for these links is in the help text: `[alt-text](http://example.com/image.png)`.  For example, `[MCP1700 reference schematic](http://i.stack.imgur.com/utQRq.gif)` -> [MCP1700 reference schematic](http://i.stack.imgur.com/utQRq.gif)  or just the plain link: ex. http://i.stack.imgur.com/utQRq.gif for us to follow your link to an image.
Answer: You would need a voltage regulator.  They are typically simple 3 terminal devices that take a higher supply voltage as an input and outputs a lower voltage for supply to other components. They come in a few varieties, the main two categories are linear and switching regulators, and then underneath those, fixed and adjustable regulators.
Adjustable regulators can be configured to output a voltage within a range using a resistor configuration.  Fixed voltage regulators only output one voltage level that they were designed to output.
For your case, a simple fixed, linear regulator like so would work well: http://search.digikey.com/us/en/products/MCP1700-1802E%2FTO/MCP1700-1802E%2FTO-ND/652675
Take a look at the datasheet on how to hook it up, they usually need smoothing capacitors in the micro-farad range on their input and outputs.  Some caveats: be aware of the maximum current draw that they can handle (they will start to drop in voltage if you draw too much) and the minimum input voltage required to get a stable output voltage.
If you can't find a fixed 1.8V voltage regulator conveniently, a variably adjusted one can be adjusted for 1.8V output (given that you get one that has 1.8V in its range).

Powering 1.8v GPS with Arduino


Pointing out someone in a photograph

Question: How should I refer to someone in a photograph with language? I know expressions like "the second girl on the right", but what should I say about "the first girl to the right"? Does "rightmost" sound natural?
Comment: The first girl on the right *or* The girl at far right
Comment: "Rightmost" is definitely acceptable and sounds natural to me but it sounds more like something an educated person would use. Using it in conversation with someone uneducated or unintelligent may make you sound pretentious.
Answer: Does "rightmost" sound natural?  It can, but rightmost wouldn't usually be heard in casual conversation.
StoneyB is correct: most people would say, "The girl on the right."  I've never heard, "The rightmost girl," although it does make sense.
Answer: Let's say you have 5 people in a row:

Person 1 - Person 2 - Person 3 - Person 4 - Person 5

Then I would say it this way:

Person 1 is the person on the left.
  Person 2 is the second person from the left.
  Person 3 is the third person from the left (or right).
  Person 4 is the second person from the right.
  Person 5 is the person on the right.
Answer: Some people would also say "The girl on the very right" to emphasize, especially if there are many people in the photo. This means roughly the same thing as rightmost and could also be used if you wanted to say something like "I was on the very edge of the cliff" to say that you were especially close to the edge.

Pointing out someone in a photograph


Cuda-memcheck and JOCL, can a java executable make use of it? (OpenCL)

Question: I love JOCL, Java bindings for OpenCL. I would like to run Cuda-memcheck on an executable from Java, but whenever I make Java applications, they are always just JAR files that point to a Main-Class. Is there a way to create a .exe file like C++ does and feed that to Cuda-memcheck?
Answer: This link could be useful: http://jsmooth.sourceforge.net/index.php
You could probably also the jvm executable directly and provide all the arguments necessary to run your java application. If you normally run your java applications through an IDE, check the console output to see what command the IDE uses to launch your app. This command should resemble something like: <path-to-java-exe> [JVM arguments] main_class [application arguments].
Answer: You might try looking into one of the Windows ports of the gcc toolchain.  I know that gcc has the capability to turn java code into compiled binary, which is what Cuda-memcheck is looking for.  If you aren't afraid of a lot of unnecessary output, attaching Cuda-memcheck to the call to the JVM should also work.


Why do we use Modem and Router together or Router and Switch together?

Question: I know that modem provides internet access owing to modulation-demodulation. Router provides connection between networks as a gateway.(e.g. between LAN and ISP) Switch provides a local area network(LAN). Router and switch can share internet by means of modem. But why do we use router and switch together? Both of them can distribute the internet to devices in LAN in home usage. That is, they do same thing in home usage. What is the reason of using these devices together? In home usage, Are either router or switch redundant? The second thing I wonder is that many ISP companies give us single device which is 2 in 1. This device contains modem and router. Why do we need router to access internet? I know that router cannot go to internet without modem. So we need just modem to access internet. Why do they give both of them as a single device. I want to understand all of these. If anyone help me, I will be grateful. Thanks in advance.
Comment: My understanding is that a "switch" can isolate traffic based in destination MAC address, where as a router can target based on IP address.  In other words, the router works on a higher level.
Comment: Yes, I know that, but in home usage, are either router or switch redundant? Because, both of them share internet to the devices in local area network. That is, both of them do same thing.
Comment: My guess is that you're not really getting a "router" for home usage, that its really a switch+modem.
Comment: i doubt that this question and platform doesnt resembles
Answer:
Are either router or switch redundant?

The kind of router you use at home has some consumer-friendly features that make it a little different from a "true" enterprise router, and I think that may be the cause of your confusion. If you look at the back of your home router, you will probably see four ports labeled "LAN" where you can connect your devices via Ethernet cable. Those four "LAN" ports, technically speaking, are a switch built right into the router. In other words, home routers are not really just routers, but a router and switch put together. This makes things more consumer friendly because if you have only four wired devices to connect, then you don't need to purchase a switch. In this case, it is true that purchasing a switch would be redundant.
In an enterprise router, however, there is a good chance the router will NOT have a built-in switch, so it may have only two ports: one for your internet connection, and one for your LAN. In that case, you would have to connect a separate switch to the LAN port.

The second thing I wonder is that many ISP companies give us single
  device which is 2 in 1. This device contains modem and router. Why do
  we need router to access internet? I know that router cannot go to
  internet without modem. So we need just modem to access internet.

You are correct: All you really need is a modem to access the Internet. In fact, you could go to the store and purchase just a modem right now, plug it in, activate the modem with your ISP, connect a computer straight to the modem, and browse the Internet just fine without a router at all. In fact, this was the norm about a decade ago.
However, there are some problems with this setup. First, most internet service providers these days only give one public IP address to each customer, so you can only connect one computer to the modem. Consumer routers perform a function known as NAT (Network Address Translation), so that multiple devices can share a single public IP address.
Also, when you directly connect a computer to the modem, you no longer have a private LAN - instead, you are connected directly to the LAN of your Internet service provider which is connected to the Internet. This directly exposes your computer to all the hackers, port scanners, vulnerability-scanning bots, and other not-so-nice stuff on the Internet, with only Windows Firewall to protect you. Consumer routers typically have built-in firewalls which will block almost all incoming connections, so that your computer doesn't have to deal with the bulk of the malicious traffic out there. For these reasons, it is very rare to not use a router.
Comment: Well, can we share the internet with just "modem" and "hub"? I learned from you that ISP gives us just one public IP, and I can connect only one computer to the modem. But this combination looks like perfect for accessing the internet. Is this combination possible?
Comment: @Hasan In a true modem, you cannot just connect a switch or hub to the modem to share the Internet connection. This is because your ISP's router is probably programmed to give you only one IP address, and if you connect multiple computers via a switch, all of them will try to request an IP address (which your ISP will not allow). A router, on the other hand, will take the one IP address you are provided and use it to make requests *on behalf of* the computers behind it. This is something a modem+switch combo is not capable of doing.
Comment: That said, these days many hardware makers are putting router software into their modems, effectively turning the modem into a basic router so that you *can* connect a switch to a modem to share the Internet connection. Again, it's to make things more consumer-friendly. However, a true, "pure" modem will not allow you to do this.
Comment: I understand. Thank you so much for your explanation.
Answer: You want a router at home that you can configure to your own preferences.  With a router you can provide internal DHCP leasing, assign IP addresses, create a wireless network with a strong password, filter traffic, and other things.  I've never had a "2 in 1" device that provides routing and a modem (I have a modem only at home, with my own router behind it).  If I did have one, I would make sure that it's set up the way I want it set up, not doing what the ISP wants it to do - I wouldn't trust them to necessarily be trying to protect your network (as noted above, it could be just a modem + switch, not really a modem + router).  Also,you probably do not need any switches in a home network unless you have a wired network with a lot of pcs and need more ethernet ports to plug into.
In short, I think of a router as a line of defense between my network and a direct connection to the internet -- one of the main things it will do is only forward traffic into your network that is meant to go there.  A switch will do this too, but less intelligently.


How do I install Minecraft mods for Xbox 360

Question: I was just wondering how I would get the skin packs and different mods for Xbox 360.
Comment: -1. This question shows no research or attempt to resolve the question.
Comment: You can get skin packs from Minecraft store but you cannot make your own
Answer: It's not possible. There is no legal way to mod your Xbox 360. There used to be a way, but it was illegal. The only add-ons you can get on the Xbox 360 and other consoles are:
on Consoles(like xbox360, etc):

Skin Packs [Used to change the look of your character.]
Texture Packs [Worlds will have different looks due to textures.]
Mash Up Packs [Themed world with a different texture.]
Theme [Backgrounds in the Xbox 360 Dashboard.]
Gamerpics [Used as a profile image.]
Avatar Items [Minecraft stuff you can put on your Xbox Avatar.]

on PC:

Skins
Mods
Texture Packs
Maps
Resource Packs


Breaking effort on both Weak and Strong collision resistance hash values

Question: I know the fact that the effort of brute force attack to break weak collision resistance hash value takes $2^n$ while in the strong collision resistance takes $2^{n/2}$. Can someone explain why strong collision resistance takes less effort?
Answer: Basically strong collision resistance means you can't find any pair $(x,x')$ for which $h(x)=h(x')$ holds.
Weak collision resistance means that you can't find any $x'$ for all given $x$ such that $h(x)=h(x')$ holds.

To break strong collision resistance an obvious strategy is to just list a large chunk of hashes and see for any matches among them.
For weak collision resistance the obvious strategy is to take your $x$ and iterate through other potential candidates until you hit a new $x'$ which is a collision.
Obviously the former approach will lead to results before the latter.

Another illustration (which is less definition or attack-centric) is the classic one of birthdays.
Weak collision resistance essentially corresponds to finding somebody who has the exact same birthday as you have. For this you probably need to find around 200 people before chances are that you'll get a match.
Strong collision resistance on the other hand means that you meet people until any of two of them have a matching birthday. You expect this to happen with $>50\%$ probability after around 23 people.
Answer: It might be easier to consider the birthday problem first. Consider the following problems:
Problem 1: What is the number of people needed to find someone with the same birthday as you with probability > 0.5?
Problem 2: What is the number of people needed to find any two persons that have the same birthday with probability > 0.5?
These two are very well-known problems. The answer to the first is 253 persons, while the answer to the second is 23 persons. Two important questions to ask here are: 1) How many comparisons do you need to find a match to you in the first case, and 2) how many comparisons do you need to find a pair of people with the same birthday in the second case. Let us take them one by one:
1) To find a match to you, you need to compare yourself with the other 253 persons, which means you need to make 253 comparisons.
2) To find a pair with the same birthday, you need to compare pairs from the 23 persons. Therefore you need to make (23 choose 2) = (23 x 22)/2 = 253 comparisons too.
You can see that the same number of comparisons is needed in both cases. In the first case, more persons are needed because you are comparing to one reference (yourself). However, in the second case, a fewer number of people is needed to produce the same number of comparisons because you are comparing all possible pairs.
When talking about hash functions, the effort of comparison is negligible when compared to the effort of computing a hash. So what matters here is not the number of comparisons you make (which is the same in both cases), but the number of values you need to compare. This number is much smaller ($2^{N/2}$ values) if you are looking for pairs (in strong collision resistance) rather than comparing to a known reference value (in weak collision resistance which needs $2^N$ values).