Why is the link function a function of the mean and not the linear predictor?

Question: Generalized linear models are formulated so that the link function $g$ of the mean $\mu$ of a random variable $Y$ is equal to the linear predictor $\eta=x'\beta$, i.e.
\begin{align}
g(\mu)=\eta.
\end{align}
My question is, why don't we call $h=g^{-1}$ the link function and write $\mu=h(\eta)$. That way, if $h$ is not one-to-one, there is still a distribution on the response variables but the $\beta$ are not identifiable. Isn't it problematic that for certain $g$, there is no well-defined model? It also is more intuitive to think of the mean as a function of the parameters, rather than the reverse. Is there a conceptual advantage to defining $g$ in this way? Is it mathematically necessary for some reason I'm not seeing?
Comment: Because someone has written it like this and we use it as so for historical reasons... moreover different people find different things to be "intuitive".
Comment: @Tim So it is just historical. Hmm, it just seems a little strange to me
Comment: http://stats.stackexchange.com/questions/41306/why-are-probability-distributions-denoted-with-a-tilde/41332
Answer: First of all, the notation is not used consistently. For example, Nelder and  Wedderburn (1972) write about linear predictor $Y$ and a linking function "$\theta = f(Y)$ connecting the parameter $\theta$ of the distribution of $z$ with the $Y$'s of the linear model" (p. 372). On another hand, McCullaugh and Nelder (1983) use the link function $\eta_i = g(\mu_i)$ (p. 27). So both notations were used in the classical literature on GLM's.
Basically it doesn't matter if you use $f = g^{-1}$ since what you need is a one-to-one mapping that works in both direction (through it's inverse). All the common link functions have this property. Nobody said that $g$ can be any function...
As about "intuitiveness", notice that if you waned to use linear regression for a count data, then you would usually transform the outcome using a log transformation and then fit a linear regression to it, so in some cases transforming the outcome is also "intuitive".
Moreover, I don't find anything more intuitive in considering transformed mean as a function of linear predictor vs mean as a function of transformed linear predictor, they are the same.

Nelder, J. and Wedderburn, R. (1972). Generalized Linear Models.
  Journal of the Royal Statistical Society. Series A (General).
  Blackwell Publishing. 135 (3): 370–384.
McCullagh, P. and Nelder, J. (1989). Generalized Linear Models, Second
  Edition. Boca Raton: Chapman and Hall/CRC.
Comment: Fair enough. But even though it's pointless, maybe there's something elegant about being *able* to  use a constant link function. Eg, if $\mu=h(\eta)$ is constant, then you still have response distribution for the data, but if $\eta=g(\mu)$ is constant, then there is no well-defined response distribution
Comment: Thanks for your detailed response. It does seem sort of trivial and maybe "intuitive" was the wrong word. But to me, it seems like if you define it as $g(\mu)=\eta$ then you should mention that $g$ has to be 1-1. For example, wikipedia's page on GLMs makes no mention of this, although they do imply it by using $g^{-1}$. It's a minor point, but I still feel it's slightly confusing to an unfamiliar person looking for a concise description of what is allowed by "generalized linear model." Moreover, it seems like by defining it as $\mu=h(\eta)$ you could allow for $h$ that are not 1-1...
Comment: ...which might have some use in the way that linear models are often not identifiable without constraints, (but I don't know if that would actually be useful because I don't know anything about GLMs).
Comment: @51413 well, it needs to be a function that makes sense in this context. E.g. neither of the sources says that it cannot be a constant function, but obviously using constant function as a link function would be absolutely pointless...


Accessing our web app on the stock Android 4.1 and 4.2 browser

Question: So I am currently having this problem of trying to open up our web app on the official stock Android browser for Jelly Bean. I don't know how well I can elaborate this problem, but I will try my best.
For devices that run ICS or older, on any browser (stock, firefox, chrome) we can type in the URL for our web app, get taken to the login page, login, and view everything fine.
For devices that run Jelly Bean (4.1 and 4.2), if we type in the url into the stock browser, we get the following:

However, if we use Chrome or Firefox, its fine.
It's odd that we get this error because I am already authenticated on our network, and I only try to access the login screen so no other authentication would be required.
Our web app grabs information from a server, and it doesn't seem to be a problem on the server side.
So it seems like the culprit is the stock browser in Jelly Bean, and I tried looking up if there were any changes to the stock web browser from ICS to Jelly Bean, but I couldn't find anything yet.
Has anybody come up with an issue like this, or is aware of any big changes (maybe related to security?) that were made to the stock android browser on Jelly Bean?
EDIT: This web app is not available externally. Currently we have only tested internally where you would have to be connected to our internal network.
EDIT2: Just checked with Dolphin Browser and the same thing happened... so I'm really lost now as I am even less sure that it has something to do with the 4.1+ stock browsers. Also, something else that makes me feel even more lost is that, I just checked on the galaxy SIII's stock browser on 4.1.2 and the page loads fine...
EDIT3: Good news, further investigation has been done by our devs and apparently this is the problem:

the default browser adds an extra header to the request that makes our server think it is an ajax request and rejects it because the rest of the request is not actually an ajax request... This bug is caused because the default browser in Android 4.1+ has added a new header to all requests "X-Requested-With: com.android.browser".

So I'm guessing the Dolphin HD browser does this as well... further investigation is being done so will get back to this and put up an answer
Comment: Can you paste your html code of the html page which is giving this error?
Comment: How can I check the source on the browser?
Comment: Not on the browser. Don't you have the html code of the page which you are trying to load ?
Comment: Sorry, I'm not sure if I'm allowed to paste that up where anyone can see. It's a product that's already being used by our customers...
Answer: According to our devs who did some research:

the default browser adds an extra header to the request that makes our
server think it is an ajax request and rejects it because the rest of
the request is not actually an ajax request...
This bug is caused
because the default browser in Android 4.1+ has added a new header to
all requests "X-Requested-With: com.android.browser".

At the moment we can't afford to spend more time trying to find good work around through code for this problem... so we decided to document this as a known issue and suggest people to use Chrome if they have a 4.1+ device


How are sharps and flats written in the Nashville Number System?

Question: How are sharps and flats written in the Nashville Number System?  5♯ or 5♭?
Answer: Sharps and flats should be written as you guessed, after the number and using ♯/♭ notation. However, in common usage, some musicians use the flat symbol before the note rather than after it while still using the sharp symbol afterwards, e.g. ♭5 and 4♯.
Answer: According to Wikipedia:

Accidentals modifying a scale degree are usually written to the left of the number. ♭7 ("flat 7") represents a B♭ major chord in the key of C, or an A♭ major chord in the key of B♭, or an F major chord in the key of G.

Music Theory for Musicians also indicates the accidental comes before the number, though giving only the example of b7.
All other sources consulted, if they addressed accidentals at all, only addressed b7.


Does Xur's engram decode the same for each character that I purchase it with in a given weekend?

Question: Xur has an engram for sale this weekend.  I bought it with my hunter and it was a hunter helm.  If I buy it with my Titan, will it be the same hunter helm, or is the engram different each decode?
Given a visit to Xur in the same weekend and enough motes of light to purchase the engram from Xur.
I understand I am not gauranteed to receive armor for the character that I bought it with (e.g. I could have received a titan helm).
Comment: I bought 5 of these when the expansion came out. He was selling head engrams. I got 4 unique exotics.
Answer: The engram will decrypt into another exotic item, not the same item. However, you may get an item for the hunter. There is only a very small chance that it will be the same item that you received from decrypting the exotic engram you already bought.
Answer: It is random which item an engram decodes into. This means that two engrams on the same character may be something different. Two engrams on different characters may be different.
Of course being random there is always the possibility that it will turn into the same item. This is just down to the way random works though.


Is there a shortcut to invert colors using the magnifier in Windows 7?

Question: I prefer to read documents with color inversion (my eyes don't like white backgrounds). But I found it annoying to click the magnifier and check/uncheck the option. Can I do this with a shortcut?
Comment: [Invert display colors](https://superuser.com/q/358316/241386)
Answer: When Magnifier is turned on (it can be minimized), then Ctrl + Alt + I toggles color inversion. Quite handy.
Comment: it's unfortunate that Magnifier needs to be running for this keyboard shortcut to work.
Answer: Yup.
It's Left_Alt + Left_Shift + Print_Screen.
Have fun.
*This command does not invert all colors, it turns on "high contrast" settings, which inverts the colors of some parts of the screen, but not at all, only the main text parts of Microsoft made applications.
Magnifier allows you to invert all colors on the screen like a mac does, but there is no shortcut for that when the Magnifier program is not open.
Comment: When the confirmation box shows up, you are given a link to the configuration page. Take it. There you can disable the confirmation dialog box for good.
Answer: If you need a 1 key toggle to flip for viewing images do this:

Download AutoHotKey - free.
Alter the script file in the app to shortcut the windows shortcut to being the context menu button.
Put this code in the script file and put a white sticker over the button. Great for minor visual problems.:
AppsKey::Send ^!{i}

Has saved big hassle fiddling for three keys. If you can spare a button go for it.
All it means is when I press the Appskey, to virtually press Ctrl+Alt+I. Look at documentation to change the key you assign.
Answer: Update. Windows7. you can pin it to the task bar and minimize it so it does not have an open window and than shift+alt+I works just like Mac. It doesn't use up a lot of memory so it is always open on mine.


Is there an open database with characteristics of tree species?

Question: I am looking for a downloadable/queryable database which lists tree species with their characteristics (e.g. average height, preferred temperature, etc.), I am specifically interested in flowering times. There are some websites where one can look up a specific species like worldagroforestry.org or feis-crs.org, but I would like to be able to query it (e.g. list all trees that blossom in July).
Has anyone came across such a database or service?
Comment: you may want to ask this on open science, which didn't made it out of beta, but is up and alive on a university's server
Answer: The National Phenology Network has data for flowering dates (and other phenological characteristics) for trees in the United States.
Using their download tool, you can specify a season of interest (if you select "Other" under Year Options, you can narrow it down to specific dates) and a range of species (selecting all the broadleaf and conifer Functional Types will give you most trees and shrubs) to download. Checking "Flowers" under the Phenophase Categories will return only the data pertaining to flowering.
Even their summary data are more detailed than simply a list of species matching the criteria, so you will need to do some additional analysis/interpretation to answer your question. The parts of interest to you will be the First_Yes_* and Last_Yes_* describing the dates of the flowering events.
Also, as you will no doubt notice, the flowering date of a particular species will vary by latitude and elevation (as well as other factors correlated to temperature), so the answer to the question of "all trees that blossom in July" will depend on where those trees are located.
Good Luck!
Comment: Thanks a lot! It is a great dataset! can you tell me what is the difference between End bloom/End of flowering?
Answer: For generalized attributes for a broad range of species you could also try the Encyclopedia of Life. For example, their data page for Pinus taeda has general attributes for height (base and mature), as well as some phenology traits (but not as granular as a specialized phenology database). The EOL traitbank can be queried by API, and it's also possible to query their neo4j database via Cypher, see this page for details.


Is it possible to create fields using Apex code?

Question: I need to create all the fields available in a specific Standard object to a custom object using Apex code. Is this possible?
Comment: Also consider that in a live org you will have to modify profiles/permission sets and layouts too.
Answer: You could use Metadata API for this.
However, I would strongly advice against doing that.
To create a field on production means to alter metadata, which required deployment. Deployment requires code coverage.
If you need to deploy some fields to Production, you should better use Changesets or ANT Migration Tool.
Answer: You will have to use Metadata API for that. This API provides function to work with Salesforce Metadata including create, edit, delete of fields.
You can check it out here: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_intro.htm
There is a Github code which provides Apex methods to use the Metadata API. This is developed by Andrew Fawcett and you can find it here: https://github.com/financialforcedev/apex-mdapi
Happy Coding!
Answer: As a technical evolution, Salesforce has made very easy to create the field from apex by using tooling api...
For example-
<code>String objectapiname = 'Content_Item__c';//replace with your object name
String fieldapiname = 'GCP_Country_Name';//replace with your field name
String fieldlabel = 'GCP_Country_Name';//replace with your field label
String fielddescription = 'GCP Country Name';//replace with your field label
HttpRequest requestinside = createHttpRequest(, 'POST');
requestinside.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
requestinside.setHeader('Content-Type', 'application/json');
requestinside.setEndpoint(URL.getSalesforceBaseUrl().toExternalForm()+'/services/data/v41.0/tooling/sobjects/CustomField/');
requestinside.setMethod('POST');
String fieldDef = '{"Metadata" : ';
String metadef = '"type" : "Text","description" : "'+fielddescription+'", "inlineHelpText" : "","precision" : null,"label" : "'+fieldlabel+'","length" : 255,"required" : false'
fieldDef += '{'+metadef+'},';
fieldDef += '"FullName" : "'+objectapiname+'.'+fieldapiname+'__c"}';
system.debug(fieldDef);
requestinside.setBody(fieldDef);

HTTPResponse res = http.send(requestinside);
System.debug(res.getBody());
</code>


In server 2008 R2, if I run an app in administrator's mode, will child process still be in the same mode?

Question: In server 2008 R2,  if I run an app in administrator's mode, will the child process still be in the same mode?
I raise this question because I suspect the child process from the app is not running in administrator's mode.
Comment: Without knowing what type of "app" you're running and the way it launches child processes, I don't think we're going to be able to help you further
Answer: Yes, child processes inherit the access token of the parent process (from UAC Process and Interactions on TechNet):

Each application that requires the administrator access token must prompt the administrator for consent. The one exception is the relationship that exists between parent and child processes. Child processes inherit the user access token from the parent process. Both the parent and child processes, however, must have the same integrity level.

Somewhat related bonus info:
The runas utility has two poorly documented switch called /showtrustlevels and /trustlevel that seemingly allows you to launch (from an elevated process) a new process with a standard user token rather than your admin token, without lowering the integrity level of the child process:
runas /trustlevel:0x20000 cmd.exe

You'll find that the Window title contains (running as [username] with restricted privileges), and whoami will show a restricted privilege and group list, compared to the elevated prompt:
Answer: Yes, it will execute with Administrator privileges.
Simple test:
You can test this by opening the app as an Administrator and opening notepad.exe from the app. Try saving a blank text file to C:\Windows. If it does not throw a permissions error, then you know the child process (Notepad) is running with elevated privileges.
Answer: Yes, the child will be in admin mode.
This is why running cmd.exe as admin allows you to start other programs in admin mode.


Converting dates to appropriate form to train machine learning model

Question: I am trying apply linear regression on a dataset where the independent variable is a date formatted like '2-jan-08'. How should I convert the date so it can be used for model fitting?
Comment: Current question is too broad to be answered correctly. Post a part of your data or dummy data having a similar structure, to let others help you better.
Answer: It depends on whether the date is the single source of features data X or if the date is a feature of X, along with other features.
If the date is the only independent variable you have time-series models, such as the autoregressive (AR), integrated (I) or moving average (MA) models. Their combination results in the ARMA or in the ARIMA models. Check this tutorial on using ARIMA with Python
If the date is a feature among others, you can convert the original date into multiple date features. Check this thread for feature engineering with time data.


scroll bar not working in the google chrome when running Ruby on Rails application?

Question: I have three devise_form

devise_for :authorize
devise_for :employe
devise_for :hr

when i signed_in as a authorize or  hr
The scrolldown in google crome works perfectly in every page
but as soon as i signed_in as aemployee working of scrolldown doesnt works on any on any page
here are the images with scrolldown and without scrolldown

Now without scrolldown

I HAVE ALSO TRIED
body {
overflow : scroll ;
}

Answer: What fixed the issue in my case was , I had the version of code that did not have devise incorporated in it. I worked on it and did a fresh addition of devise into it. Strange as it may sound, that fixed the issue.
Seems to be some tiny mistake made in the configuration of devise.
If you have stumbled upon any other solution, please share it in this thread. Will turn out to be useful for someone.


Can't forward port 63639 on local network

Question: I am  developing a windows service application that listens on port 63639
and can get messages an retrive messages
When I do this in the cmd
  telnet 127.0.0.1 63639

it get inside and get back the welcome message
but I want to communicate with this application from another computer on the local area network
I have 3 computers on the network with a d-link dsl-2650u router.
My ip address is 10.0.0.3
When I try the cmd:
 telnet 10.0.0.3 63639

from another computer I receive "could not open connection to the host, on port 63639"
Then if I try:
 telnet 10.0.0.3 80

I am able to get access. I also tried port 135 and that is able to get access also.
That leads me to think the blocking is from my router because I have win 7 and I looked in the firewall logs and I can see the logs for ports 80 and 135 but not for port 63639.
I am very sure that is the router. I also set the router for NAT/DMZ for 10.0.0.3 and it still does not work and I am not able get any log. I also tried defining NAT/Virtual Servers.
Thanks guys, I am going crazy since I have been trying to get it to work for over 6 hours
Comment: What address are you binding to in your service?
Answer: If you bind to 127.0.0.1, you'll only be able to connect from 127.0.0.1; if you bind to 10.0.0.3, you'll only be able to connect from devices on that network interface. If you bind to 0.0.0.0 you'll able to connect from interface the computer has.


Any way to run python TK scripts on web page?

Question: Is there any way to run a python script that utilizes TKinter on a web page such that a user could run the script and interact with the TK windows without having to download the script or have the appropriate python interpreter?
Answer: No. There is no way to do this.
Answer: The only approach I can think of, is to use some virtual screen protocol such as VNC, run your Tkinter script on a server for that protocol (e.g., a VNC server), and use a viewer browser plug-in for that protocol in the user's browser (e.g., maybe this one -- haven't tried it myself, though).  A similar approach could use the NX protocol (e.g., cfr here).
Note that such solutions will most likely not scale well: they're mostly meant to let one user connect to "their desktop" from a browser.  Performance, robustness and scalability of web-native approaches will all run rapid circles around any such "compatibility hack"!


Transfer steam games locally

Question: I am sharing my dad's steam account on my computer. He bought/downloaded/installed a game on his user, but I have to reinstall it on my user. How can I get it on my user without re-downloading it, like internally transferring it?
Extra info: My computer is a Mac running Mavericks
Comment: [Maybe not a dupe, but definitely helpful](http://gaming.stackexchange.com/questions/96370/how-can-i-move-an-installed-game-from-one-steam-library-folder-to-another)
Comment: Are you sure the game isn't available under your user? It would be under the same circumstances on Windows.
Comment: Yes, it says "install" where it should say play off I owned the games.
Comment: Sounds like those games are not using SteamPipe so they're installed in a user directory, not the `common` directory.
Comment: How can I change the directory? Is that a preference in steam? If so, will the games already installed move to that directory?
Answer: Regarding the comment on your question, you can change your install directory, but that's more for pushing things onto a different hard drives if your computer has them.
The files you'll need will probably be sitting around in your steamapps directory. Since you're running a Mac, this should be ~/Library/Application Support/Steam/steamapps. For completeness - on a Windows computer, this is usually C:/Program Files/Steam/steamapps or C:/Program Files (x86)/Steam/steamapps, and on my Ubuntu laptop, this is ~/.steam/steam/SteamApps/, though your exact Linux setup may vary. The steamapps directory should contain a few subdirectories. Find the ones named after yours your dad's Steam accounts and open them both up.
Stop here, open up Steam, and set the download off for the game you want to install. Leave it for a couple of seconds, then exit Steam. This will drop a directory in your steamapps folder named after the game you're trying to install. Find the corresponding folder in your dad's steamapps directory, then just copy-paste everything across. Restart Steam, and resume the download. Steam should check to see what files are already around and what files are needed, note that all the files are already there, and then let you play your game.
If your dad has a bunch of saved games or some clever keybinds set up, those might be transferred across to you, too. Check everything is in order before you start playing.
This is far from the most efficient way of accomplishing this goal, since you'll effectively end up with two separate installs of the same game. If you're familiar with symbolic links and don't mind turning your filesystem into some kind of Cretan labyrinth then you could probably achieve the same effect with those and without making a double-install. This, however, is a little more complex.
Again, for completeness, I'll outline the steps. Rather than copying the install directory across, drop a symbolic link to the install directory in your own steamapps directory. The tricky part, however, comes when the game's install directory also stores saved games and similar items, since you probably don't want your dad to accidentally beat a bunch of the game for you. To solve this, you'd need to have a complete path to your own saved games directory. Every other file and directory in the game's install directory can be replaced with a symlink back to your dad's directory.
Comment: For completeness you might include steps or a link for the more complex option.
Comment: FYI, I'm on a mac and just tried to install Rocket League your way. What worked for me : copy the folder "rocketleague" and its content (just a .app) into the "common" folder of "steamapps", and then launch the install. Only then was it able to verify what was already downloaded/installed.

Transfer steam games locally


Export With Transparency / Set Page Background

Question: I am new to InDesign. I have been supplied a file with a number of pages consisting of tiff images. I was told that the tiffs have transparent backgrounds, but when I export to png, the entire page is filled with white with no transparency. How can I export or set a transparent background for each page please?
Answer: Tiff files MAY have transparency. But traditionally they do not.
Adobe added the ability to save transparency in tiffs a few years ago, but that does not mean everyone uses that feature.
If the tiffs have background, you'll have to remove them just as you would from any other image via brushes, selections, and masks in Photoshop or some other raster editing application. Indesign will not auto-generate transparency where none exists.
Note Tiffs CAN contain transparency and be placed in Indesign....
(Magenta box is a shape created in Indesign. Text and yellow box are part of a tiff, simply placed into Indesign.)
Answer: Unfortunately InDesign does not use transparency information stored in a TIFF file. It always fills transparent pixels with white color.
However, InDesign does use the transparency of placed PSD files. So I would recommend opening all of your TIFFs in Photoshop and resaving them as PSDs.
Edit: the answer above is proved to be incorrect - I've always tried to place a layered TIFF file containing a single layer with transparent pixels which is NOT the same as a TIFF file properly saved with transparency.
Comment: **This is incorrect.** Indesign supports transparency within Tiff files just fine, provided the tiff actually contains transparency.
Comment: And I can place a transparent tiff in Indesign CS4, CS5, or CS6 with no issue. **Your answer is incorrect.** Either you failed to save a tiff with transparency, or you've added a white background in Indesign.
Comment: You are right, my answer is incorrect. What I never realized was that a layered TIFF file containing a single layer with transparent pixels is NOT the same as a TIFF file saved with transparency.
Comment: Before posting this answer I've checked whether it's true (I tend to sometimes misassociate my experience). And I couldn't place a transparent TIFF I've just created into InDesign retaining the transparency. I've also checked available Import Options. What InDesign does support from TIFF files, is Clipping Paths stored within a file but this it not actually a form of transparency...


Should the cold water supply be constantly open for hot water heating system?

Question: I just flushed out my baseboard heating system and refilled it with new water. I am wondering, should the cold water supply to the system stay open or should it be a closed loop until flushed again at another date?
Answer: Closed.
Two reasons - main one, you need to know if it's leaking. A properly functioning system should not need "make up water" on a regular basis.
The other, related reason - if the system is leaking and constantly taking in new water, it's also taking in new dissolved oxygen in that water - and 99.9% of hot water heating systems are built with a mixture of copper and iron parts (or all iron parts) that will rust terribly if continuously supplied with oxygen. A non-leaking system rusts out what oxygen is in the water, and then stops rusting. Every time you add new water it rusts more; so the less you add new water, the less the interior of the system rusts.
Comment: With the fill valve open, and there is not a backflow preventer installed (more common than you think) you could contaminate your drinking water if the incoming water pressure were to drop.
Comment: Not to mention the build up of scale from new calcium in the make-up water, if it's hard...
Comment: I've already answered this but if you have a backflow preventer along with a 12-15 PSI regulator installed, would it make sense to leave it on in that case?
Comment: No. Read the answer again. The answer does not assume that you are missing either of those devices.


Mac as wi-fi hotspot: how many devices can connect?

Question: Is there a theoretical or practical limit to the number of devices that can be connected to a Macbook Pro sharing its internet connection as a wi-fi hotspot?
Answer: On OSX Yosemite (beta 10.10.3), on MacBook Pro (13-inch, Mid 2012), today (2015-04-28), I've connected 15 different devices (Android, iOS, Win, OSX) via WiFi hotspot (sharing internet via Ethernet), and reported very low decline in internet bandwith with each new device connected.
Answer: It can connect at max 7 devices, I have tried to connect more but wasn't able to.
Comment: At least as of today, May 15, 2014 and OS X Mavericks I have connected around 15 Android tablets to my MBP. Personally, I don't know what the limit is.
Comment: My data was based on the MBP Early 2011 model.
Answer: I regularly try connecting 27 Wi-Fi modules (ESP-12F) and find that typically around three or four don't connect. It's slightly different every time, so the limit is probably 24.
In my case I'm using a Mac Mini 2009 model to share the internet.
Answer: I don't know about limit but I'm using 5 devices (3 mobiles and 1 macbook air and 1 windows 8 laptop) without any issue. data transfer ratio is also good.


Why do some satellites fall to Earth?

Question: In another question  How does Newtonian mechanics explain why orbiting objects do not fall to the object they are orbiting?, one can read an affirmative answer.  They how do you explain satellites falling to Earth?  (Here, falling means colliding with the Earth surface or burning out before reaching the surface.  For example, fragments of Sky Lab fell on Australia in 1979.)
Answer: First of all, even if satellites that orbit the Earth do follow, on a good approach, the newtonian physics, they are also subject of several other interactions like moon's influence, non-eshpericity of the Earth, gravity anomalies, spacial dust, etc. All those interactions cannot be predicted for long enough times, most of the time because those interactions can lead to chaotic behavior.
That said, most of the satellites have some mechanism to re-adjust its orbit, like some active feedback trusters. As you might have already understood by now, sometimes these mechanisms fail, causing the satellite to crash into the Earth.
Comment: All press, TV and Inernet was full this days when Rosat and another satellite came down. Including reason for this! And now this question, and  this "answer"!
Comment: @Georg: Isn't this a place to ask a question?  If you know the answer, please provide the answer.
Comment: Sorry Georg, but I was not being specific about TV and or internet. The question seemed more general than the de-orbiting of satellites, so I answered in a physical way: how can a body leave its constant energy's orbit considering the question of the other post? And the answer is by other interactions. You were not very constructive in your comment though.
Answer: Usually this is done on purpose when the satellite is no longer useful, in order to prevent it from becoming a hazard to other satellites and/or spacecraft.  This was, for example, the case with Skylab.
Satellites in lower orbits can also be slown down by atmospheric drag.  If the satellite is for any reason no longer able to compensate for this, it will slowly drop into a lower and lower orbit, eventually reaching the point where the atmosphere is thick enough to burn it up or (on rare occasions) hit the Earth.
Answer: In the question  you posted the link of, the mathematics is given by the chosen answer.
In the second answer there, the importance of conservation of angular momentum is stressed. In general, when considering gravitational solutions one has to think of conservation laws.
As an answer here stressed, friction in the remnants of atmosphere reduces the kinetic energy and also angular momentum of the satellites and they may eventually fall to the earth. ( conservation of energy).
It is instructive to examine another instability, when angular momentum is changed, which happens with the tides in the earth/moon system. The effect of the gravitational  interaction is to increase the energy of the moon, which  goes into a higher orbit; i.e. the complex gravitational interaction  transfers kinetic energy to the moon. If you read the article you will see that this angular momentum change due to tides induced on the earth can also dominate the path of artificial satellites.
The moral of the story is that interactions determine the stability of orbits in gravitational systems, which change following conservation laws.

Why do some satellites fall to Earth?


Is it reasonable to write the major part of my statement of purpose on machine learning for masters in data science?

Question: I am an aspirant for masters in data science and I have mentioned in  major chunk of my Statement of purpose about machine learning and my past experience with it. Is it okay or not ?
Answer: Actually, the SOP should look to your future, not the past. Your CV tells what you have already done, so you don't need to repeat that. But if you want to talk about machine learning, talk about how that background applies to your future in data science. If you intend, for example to work at the intersection of the two fields, talk about that.
But in general, you want to convince the admissions people that you have realistic goals and are well suited to achieve them. The main focus should be forward looking, not backward.


What is a necessary condition to form a set of basis?

Question: A collection of vectors is said to span the space if every vector can be written as a linear combination of the members of this set. A set of linearly independent vectors that span the space is called basis
How can a set of linearly independent vectors span the space if necessary condition of spanning is that every vector can be written as the linear combination of the members which makes it linearly dependent??
Comment: This is not a contradiction, it only means that the unique way to write an element $b$ of the basis is to write it as $b=b$.
Answer: Who said that in a linear combination of vectors of a set of vectors, all vectors in the set are actually  involved?
It is even necessary that all vectors of a spanning set do not appear in the linear combination in the case of an infinite dimensional vector space, such as the ring of polynomials $K[X]$ over a field $K$.
What the notion of basis adds to the notion of spanning set (or set of generators) is simply the fact that the linear combination that decomposes a given vector is unique.
Answer: The vectors from the basis are linearly independent. None of them is a linear combination of the other vectors from the basis.
The vectors from the basis span the whole space. Every other vector in the vector space is a linear combination of the vectors in the basis.
I don't see any contradiction here.
Comment: so, that means a set of linearly independent vectors **can** span the space??
Comment: Yes, they certainly can. I would also like to show you an example, but not sure which vector space is the closest to your mind. Take, for example, the vectors in geometry, in a plane. Pick any two non-zero and non-collinear vectors $v $ and $w $. They would make a basis. None of them is a linear combination of the other one, and every vector $u $ in the plane can be written as $u=\alpha v+\beta w $ for some $\alpha,\beta\in\mathbb R $.
Comment: okay, got it .thanks
Answer: A set of $n$ vectors are a basis for a space or a subspace with dimension $n$ if and only if they are linearly independent.
Conversely if in a space or a subspace you can find at most $n$ vectors linearly independent we define $n$ the dimension of the space.


BJT Common Emiiter RF-Design Simulation

Question: I'm trying to learn about RF amplifier design and build a common emitter stage with an BFR92P.
And now I'm struggeling with the simulation in LTspice, or maybe with reality.
As you can see attached is a simple common emitter testcircuit, that I have tried to optimize . .asc -file: https://drive.google.com/file/d/1T7y4zdWiqA7fs3u-jYscfxaS7kk1qGwp/view?usp=sharing
Stepping Re from 200 to 800 ohm there is a sudden change in amplification. 350ohm is maximum an 400ohm is completely broke down.
I can't see this from DC characteristics (also attached) or I don't unstand something fundamental
The spice model is from infineon.
Maybe someone can help me to understand what's happening and how get a maximum voltage amplification.
Many thanks
Comment: The two things that stick out to me most are 1) Re is in the emitter AND being used on the collector. 2) For RF, you usually want an inductor on the collector instead of a resistor. google for "class A rf amplifier circuit" and you'll find lots of examples of the topology.
Answer: If you increase the value of RL, the bias point of the collector voltage drops. If it gets too low, the BJT goes into saturation operation rather than forward active. In saturation, the \$h_{fe}\$ parameter of the BJT drops dramatically so the gain of your circuit also drops.
If you're really going to use this in an RF context, you should include the load impedance in your model. It won't affect the bias because you've AC-coupled the output. But it will likely reduce the RF gain of your circuit substantially.
If you don't consider the load impedance, you're likely to choose the wrong value of RL for optimizing the circuit's gain in the final application.
Comment: Many thanks! Increasing Re to 150ohm makes it much better to handle and it doesn't drop that fast.

BJT Common Emiiter RF-Design Simulation


Sometimes when I boot up my Toshiba Satellite L875D lap top running Ubuntu 12.04 LTS it does not detect my keyboard

Question: I have the follow issue. I am using Ubuntu 12.04 LTS on Toshiba Satellite L875D and sometimes when I boot up my machine it reaches the log in session where I am supposed to type my password but my keyboard does not work. So I am forced to restart my lap top using my mouse and then I face the same problem again right after the first restart at least once or twice until I am finally able to use my keyboard. The weirdest part is that when I restart my lap top to try to make my keyboard working Ubuntu doesn't boot up and it just stays on a black screen without doing anything so I have to use my turn off button to restart it, after that everything is fine. This trouble occurs from time to time but it is still very annoying I have googled my trouble issue trying to find similar topics or someone who has experienced the same problem but I couldn't. I will greatly appreciate any help from you guys. Thank you in Advance.
Answer: Confirmed (dual boot Ububntu 12.04 LTS on Toshiba Satellite C875D): on boot I lose my keyboard everytime if any combination of the following occurs after boot manager and before the password request screen loads:
press any key
touch the touchpad
click either button
have a USB pointer device plugged in.

Confirm the black screen of death after keyboard loss on attempted restart. Only hard power off restarts the machine.
Failure to resolve: Universal access sticky keys on or off
Failure to resolve: Enable or disable USB before or after boot
Failure to resolve: Enable or disable Bluetooth before or after boot
Failure to resolve: Updating kernal and drivers
Possibly related: Backlit keyboard does not light

Work around:
Do not touch any key nor button nor touchpad during boot.
Plug in USB pointer device AFTER login.
Hope that, when selecting Ubuntu at boot manager, the enter key did not bounce.
Always have Onboard running.

Comment: This is a Ubuntu site, but this problem also happens for me on my Satellite in openSUSE 13.2.
Answer: I had success appending a couple of parameters to my kernel boot string:
 i8042.reset i8042.nomux=1

Apparently, these laptops use an internal PS/2 port for the mouse and keyboard.


Should I use the GD library in PHP to draw CAPTCHA images?

Question: Is PHP's GD library suitable for drawing images from scratch? Or would I be better off just importing an image and altering it...
Answer: Not sure it'll be possible to know how many people use one solution, or the other ;-)
But the most reasonnable answer would be, in your case, that choosing one solution over the other depends on your situation :

If you have a base-image and just need to add a small portion of information, loading an existing image will probably be the simplest solution
If you need to generate an image that's customized a lot, different for each one of your pages, going with a full-generation from scratch might be easier.
Answer: No, you defiantly should not write your own captcha.   Please use re-capthca it is by far the most secure capthca ever made,  and its free.  If this doesn't work use one of the many (vulnerable) Capthca libraries that use gdlib.
Answer: If you're not limited to GD, you may also want to look at the ImageMagick extension. This has a comparison :)


Correlation of multivariate distributions without "slope"

Question: Wikipedia has this image showing different correlations:

It says:

The correlation reflects the noisiness and direction of a linear relationship (top row), but not the slope of that relationship (middle) … the figure in the center has a slope of 0 but in that case the correlation coefficient is undefined because the variance of Y is zero.

But if the variance of Y is not zero, but still different from that of X, such as in this image:

Does it still have the same value of correlation that it would have if rotated?  It seems not, since the covariance goes to zero and that's the numerator of the correlation formula?  (Since there are just as many positive $\operatorname{E}[X⋅Y]$ terms as there are negative.)
I'm confused about this paper which talks about the "correlation" of multivariate normal distributions, and says things like this:

To facilitate the large number of simulations involved, in each case
rotation to principal axes was employed to diagonalize the correlation
matrix (Morrison, 1976, ch. 8). This permits Monte Carlo generation of
independent normal variates with variances equal to the eigenvalues of
the correlation matrix.
…
(The correlation for this scatter plot is .5; the distribution has been
rotated to principal axes.)
…
The correlation matrices used to produce this table assume that all off-diagonal
correlations are the same (either all 0 or all .5).

Would it be possible to measure the correlation of such a distribution?
Similarly, this paper generates distributions like this:

All
voters are represented by their ideal points in a
four-dimensional space, that is, by a four-tuple
of real numbers. The four numbers are generated in the following way: voter i's position
on the first dimension, Y1i, is chosen from a
standard Gaussian (normal) distribution (mean
zero, standard deviation 1.0). The voter's position on the second dimension Y2i, is generated
from the first dimension position by perturbing
it with Gaussian noise of mean zero and
standard deviation 1.4. The third position is
produced from the second with fresh noise of
similar character, and the fourth is generated
from the third in the same fashion.

But wouldn't this process create distributions shaped like above, with no slope and therefore no measurable correlation?  Yet they show a correlation matrix where all the values are between 0 and 1:

They also say

The values
on all dimensions are then normalized to have
unit variance.

Which I would think would make the distribution completely symmetrical in every dimension and no longer even have this type of no-slope "correlation".
I'm confused.
Answer: The correlation coefficient is not invariant under rotations. You can always rotate your random variables to make them uncorrelated. The middle row of plots from Wikipedia is indeed a bit misleading in that regard, because it suggests that the correlation coefficient does not change under rotation. But this only happens when the distribution is degenerate - If you would produce the same plot with a non-degenerate distribution, you will see that the correlation coefficient gradually reduces to zero.
The converse of the above is that you can take a vector of independent (and therefore uncorrelated) random variables and rotate them such that the rotated variables are correlated - this is the procedure the quote from the first paper refers to.
As for the second paper, note that the second variable $y_2$ "is generated from the first dimension position by perturbing it with Gaussian noise", namely
$$y_2 = y_1 + \varepsilon_2$$
which means that $E[y_2|y_1] = y_1$, so the joint distribution lies around the line $y_2=y_1$ or has a "slope" of $45^\circ$.
Comment: OK, the caption says it, too "The correlation reflects the … direction of a linear relationship … but not the slope of that relationship".  So "rotation to principal axes" *creates* the correlation from a distribution like the uncorrelated one I've shown?  I misinterpreted and thought it was the other way around. Googling "principal axis" doesn't seem to talk about distributions at all.
Comment: "y2=y1+ε2" Oh, so it's [y1, y1+ε2, y1+ε2+ε3, ...] not [y1, ε2, ε3, …]


Phone stuck at boot animation after Andriod 6.0 Update

Question: The four dot animation is endlessly running after Android 6 update in Nexus 5.
Answer: I had this same problem on my Nexus 6 when I 'upgraded' to Android 5.0 and there was unfortunately nothing that could be done by the technicians I sent it to so they replaced it for me, free of charge.
What I would suggest you try first is doing a hard reset of your phone (Instructions to do so here) and see if that works.  Failing that, talk to someone at Google (who'll probably tell you to do the same thing) and then, failing that, take it to a phone repair place and ask them to take a look at it for you.


Protecting my message without encryption

Question: I am studying Information Security, and I am wondering if I can send a message to my friend X and keep the message confidential without using encryption?
Comment: Sure, just use a confidential communication channel?
Answer: I think this is a question that comes down to understanding the basic Alice, Bob and Eve diagram from cryptography textbooks, like this one from Wikimedia that I've chosen because of its license and no other reason:

Alice and Bob are communicating over a channel, depicted as the green line, and Eve is eavesdropping on that channel, metaphorically depicted as if there was a blue cable that plugs into the channel and carries its signal to Eve.  The reason Alice and Bob use encryption is because they're worried that the diagrammed situation might occur, and the goal of encryption is to make it so that, in that situation, Eve cannot learn much about their communication.
So it's hard to answer your question how to protect your messages without encryption other than by saying this: prevent any situation like the one described by that diagram from ever arising.  But that's not a concrete or actionable recommendation—it depends on the physical details of whatever scenario you're considering.  But to give one concrete example, the United States government uses something called a Sensitive Compartmented Information Facility (SCIF) to physically protect officials using sensitive information from being eavesdropped on.  Example passage from the article:

Because SCIFs are supposed to distance sensitive information from the
  rest of the world, the Directive begins with architectural
  details—like adding a vestibule and extra interstitial reception
  spaces as "padding" between the SCIF and the outside. If the SCIF is a
  building (rather than a tent), it has to be reinforced concrete or
  lined with solid steel. Everything from the depth of the drywall to
  the thickness of the insulation is mandated by the document, too.
The first—and most traditional—surveillance threat is sound, so SCIFs
  are lined with thick acoustic piling. In most cases, noise-masking
  devices like transducers are installed to garble what's going on
  inside, too. According to the BBC, another type of wave-emitting
  device creates a ring of electronic signals around the space, blocking
  other types of electronic surveillance, while a lining of special,
  foil-like material also blocks more traditional audio surveillance
  (similar to an average Faraday Cage).

That's an extreme example, of course, but (a) without details it's basically impossible to make concrete recommendations and (b) specific recommendations would likely be off-topic here.
Comment: Not sure why this was downvoted: A secure communications channel is technically a viable alternative to using encryption and is basically a more in depth explanation of this [up-voted answer](https://crypto.stackexchange.com/a/58684/29554). Whether or not it's a *practical* possibility (for non-state actors) is a different question, and the answer does disclaim that it's an extreme solution. The question asks about possibility, not convenience.
Answer: Only if your communication channel is undoubtedly secure, so that nobody could dublicate the message, fetch the message during transmission, or read the message with any other methods which could be used.
Answer: You could use steganography or covert channel for digital messages.
In the end any secure communication channel could suffice. Even just a POTS phone call can be secure enough because it could be impossible to filter all the phone calls by an adversary (which may not be a governmental organization).
To see if it is secure enough you need to create a use case (or just goal), find out who your adversaries are and then create a threat model and analyze your system, just like you would do for a system that does apply cryptography.
The big problem is that you probably cannot put in a number on how secure the system is. That said, this is probably true for any real-life systems, including those that do apply cryptography.
Comment: I've put POTS here because GSM's for instance do use crypto (at least for the point to point connections), even if the schemes and providers can usually not be trusted enough to provide protection against larger organizations.
Comment: My reaction to the suggestion that one could try steganography *instead* of encryption is that they're orthogonal: you could use steganography to convey an encrypted message, so at first glance an argument in favor of steganography doesn't count against using encryption. And I suspect the fact that ciphertexts are supposed to be indistinguishable from random strings could actually *help* steganographic concealment; I understand some spread-spectrum radio systems achieve low probability of detection by using pseudorandom frequency hopping.
Comment: I didn't say that you couldn't use steganography with encryption or that it would not be beneficial to combine the two (it certainly is beneficial to do so). It is just that steganography could be used without encryption, and establishing a secure communication channel without encryption was the question.
Comment: @MaartenBodewes: You didn't say that, no, but I just think that you'll be implicitly understood as such in this context, given that the question is asking for *alternatives* to encryption.


turn.js Swipe and Pinch on iPad

Question: I want to use turn.js to create online catalog, dedicated for ipad. I want to keep ability to zoom (i left user-scalable attribute with its default value). Swipe gesture to turn pages would be also useful, like on http://www.turnjs.com/ but when you try to zoom, even on official website, pages will turn after pinch gesture.
I suppose it happens because start of pinch gesture works the same way like swipe - I mean one finger slide. There is condition to turn the page only when touchmove event is made by only one finger (e.originalEvent.touches.length == 1) but I guess before swipe (one finger) becomes pinch (two fingers touches the screen) browser sees first event swipe, next event pinch separately. Same way when somebody take fingers off the screen (it never happens in exactly the same time).
I tried to change e.originalEvent.touches to e.originalEvent.changedTouches to get count of fingers that were used in event, but it also doesn't work like i want it to.
Any simple idea how to fix it?
Answer: Multitouch gestures can be added by jGestures.
More information for the usage with turn.js: GitHub-Issue

turn.js Swipe and Pinch on iPad


Incorporate calldata inside smart contract

Question: I'm currently trying to use the 1inch API documented here: https://docs.1inch.io/api/nodejs-web3-example
I would be interested in using the 1inch pathfinder api from a solidity smart contract to make swaps programmatically. The problem is that the way the api works is that you call the HTTP api and you get the transaction calldata already compiled that only needs to be signed and sent to the network. So basically there is no smart contract to invoke from solidity (like with other dexes).
What I was wondering was if it would be possible to use the api to get the calldata for a given swap and then, providing this calldata to a smart contract, integrate this swap as an operation made by the smart contract.
I'm not an expert in solidity and I don't know if what I'm asking is even possible, but anyway thanks to anybody that will answer.
Note: I know originally the 1split protocol was a smart contract deployed on the blockchain but that has been deprecated and is not available on the bsc chain, where I also want to operate, so it isn't a viable option.
Answer: A minimal example showing how to integrate 1inch in your smart contract using Brownie
https://github.com/smye/1inch-swap
this may help you


Layover in Shenzhen and Guangzhou

Question: I just booked a return ticket from Melbourne to Hanoi with a 22-hour layover (overnight) in Shenzhen and a 5-hour layover in Guangzhou on the return leg. I was just wondering if I need to apply for a transit visa and how much will it cost? I've read $30 in one place and ~$100 in others. Where do I apply (I've checked and the Consulate in Melbourne do not accept visa application and it has to go through a commercial service, visaforchina.org). I hold a Vietnamese passport. Thank you!
Answer: As stated in Timatic, the database used by airlines:

Transit without visa (TWOV) is not possible at Fuzhou
     (FOC), Mudanjiang (MDG), Shenzhen (SZX) and Yanji (YNJ).

So yes, you absolutely need a transit visa
Comment: Hi! Thank you, I've read that but no info on Chinese gov website so I've planned to apply already. I understand that the visa requirement also applies to cases when travellers would not leave the sterile area? Thanks!
Comment: @Jill Shenzhen doesn't have a transit corridor in the first place - everyone has to clear immigration
Comment: Why the downvotes? 144-hour "transit" is only in force at Shanghai, Nanjing and Hangzhou at the moment, although it will be introduced in Guangdong

Layover in Shenzhen and Guangzhou


Have any Force-sensitives ever produced "non-Force-sensitive" offspring?

Question: Canon or EU question — Have any Force-sensitives ever produced "non-Force-sensitive" offspring?
Comment: Are the "non-force-sensitive" offspring truly non-force-sensitive or is it just that their force sensitivity is so low that for all intents and purposes it's considered to be non-existent?
Answer: In Canon, Jacen Syndulla, son of Jedi Knight Kanan Jarrus and non-Force-sensitive Hera Syndulla may not be a Force-sensitive; sufficient information is not available but no evidence for him being Force-sensitive has come forth as of yet.
In Legends, there are several examples of children of Force-sensitives who have no ability to use the Force, including:

Fionah Ti, daughter of two Jedi.
Vaner Shan, son of two Jedi.
Theron Shan, brother of Vaner and likewise the son of two Jedi.

In Legends, one or more Force-sensitive parents producing non-sensitive offspring seems to be the exception to the rule, as most such relationships appear to produce Force-sensitive children.


How to express singing a song rather than singing about something

Question: If I'm understanding correctly, άείδω is used with the accusative, and it means to sing about something. In English the object of the verb would be the song, not the thing being sung about. In Greek how would we express the notion of singing a certain song?
Answer: Generally, in Greek there is no difference between "he is singing" and "he is singing a song." Both phrases would be represented with ἄειδε. If it wasn't a song before the singing, it becomes one by the act of singing it.
That said, there are examples of "sing a song", i.e. the verb with a cognate accusative.
Aeschylus Agamemnon 1191-1192:

ὑμνοῦσι δ᾽ ὕμνον δώμασιν προσήμεναι / πρώταρχον ἄτην.
Seated in their home they sing a song about the original crime.

Aeschylus uses two accusatives. The first, ὕμνον, is the cognate accusative, and ἄτην is the direct object.
Heraclitus 15:

ὕμνεον ᾆσμα αἰδοίοισιν.
They were singing a song to the genitals.

Here ᾆσμα is the cognate accusative and the addressee of the song is put in the dative.
You also get νόμον ὑμνεῖν in in Plato Laws 871a.
Comment: Thanks, that's helpful. So the answer seems to be that you either use two accusatives or an accusative for the thing being sung and a dative for the topic. I don't think the first paragraph adds anything.
Comment: @BenCrowell I think the dative αἰδοίοισιν in Heraclitus expresses addressee rather than topic (they're singing "to" the phallus in a Dionysian revel). // For completeness the more specific θρηνέω "sing mournfully" could be added, with an accusative as e.g. ᾠδὰς θρηνέω "sing songs of lamentation".


iOS white screen

Question: So I started building an iOS app in XCode 4.0. I followed the steps to create a Navigation based application.
It gave me a main.m, MainWindow.xib, MyAppAppDelegate.(m|h|xib) and MyAppViewController(m|h|xib).
I made MyAppViewController into a title screen of sorts with buttons using the interface editor.
I added a new view controller and was able to get MyAppViewController to display that view
using <code>[self presentModalViewController:otherViewController animated:YES];</code>. I was able to get this functionality to work exactly how I wanted.
I then wanted to add a new view controller when the user clicks a separate button on the title screen (MyAppViewController). I used New -> UIViewController subclass. For this one, I set the parent class as UINavigationController. As soon as I added that controller, my app stopped worked completely. When I launch it, I just get a whitescreen. I've removed that class completely and my app still just shows a whitescreen.
How do I get my app back to launching the MyAppViewController?
I feel most of my problem is due to not understand how my "main view" is loaded. Is there any /good/ documentation explaining how/why this works in MyAppAppDelegate.m? Where is self.viewController created/initialized?
<code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.window.rootViewController = self.viewController;
  [self.window makeKeyAndVisible];
  return YES;
}
</code>
Answer: Look at the MainWindow.xib if you connected all outlets properly...

iOS white screen


Steering wheel won't align straight after turning - 2007 Honda Jazz

Question: My friend bought a 10-y.o. Honda Jazz recently (Honda Fit in the U.S. AFAIK). Normally, after turning, the wheels should "align themselves" straight thanks to suspension geometry - in his car, you have to manually turn the wheel back for the last 15-20°. Is it possible that it was like this from factory, or is there something wrong with the front suspension?
Answer: No, it should not be like that and it came straight from the factory. Take it to the alignment shop. It's one of the things they do when they align the front end is to ensure the wheel is straight when they are done (or at least they should do that). Tell them when you take it in to have it done what's going on. Also, considering it's off as much as it is, it probably needs an alignment anyway.
Comment: I didn't mean, that the wheel was not straight. What I meant, was that after a corner, the wheels and the steering wheel should (to some degree) return to a straight position by itself thanks to positive caster alignment in the front suspension geometry.
Comment: Again, an alignment should fix the issue. If it doesn't, there's problems with the suspension which need to be addressed. Good alignment shops will tell you if there are issues with the car which would require attention.


Do multiple user accounts on the Wii U all share the same save data for games?

Question: My little brother disgustingly hogs my Wii U so much and some games I like to do myself, like Splatoon, I can't because he played the ever living life out of it. If I make another Wii U Mii profile and picking it, would it treat the Splatoon save file as exclusive to the main Wii U Mii profile?
Answer: It seems that Splatoon can have separate accounts on the same WiiU.

What are the benefits/tradeoffs for each user having their own account versus all the users sharing a single account? What would you
  recommend?
The benefits of multiple accounts are having their own saves (for most
  games, not all) and having their own save states and restore points
  for VC titles. You also get to lay out the menu how you like, if you
  care about that sort of thing.
Source
  Reddit

Will each Wii U user be able to have its own file? Or will it be like Smash where everything is shared between users? Any confirmation
  regarding this?
I think gamexplain's QA video says it's a file per user.
How many save files does Splatoon have?
Just the one per account.
Source Gamefaqs
  here and
  here
Answer: think you can have separate accounts on WiiU with separate game saved data files, so you can start afresh on a new account.


Are the joist repairs in my home safe and correct?

Question: As the title says, I recently bought a home and am in the early stages of finishing the basement. However, after tearing down the old ceiling tile, I found that my floor had experienced water damage and that for some reason, the joists were cut and sistered using very short lengths (as seen in pics) My question is: how soon do I need to get this fixed and what kind of damage to my wallet can I expect?
Comment: It's really difficult to tell what's going on here but it looks like the original joists have been cut short of the supporting wall and then extensions screwed or nailed to the ends.  This repair does not appear to be sound to me since these are not "sistered" but just added on and are going to be significantly weaker than the original joist.
Comment: There looks to be no movement in the joists.   I myself would put a large simpson tie on these with 10-15 nails a piece before closing it up.   As long as the area won't have a piano, treadmill or something really heavy it is really of little concern.
Comment: I only see one patched joist. Are there more?
Comment: @isherwood There is one other that looks similar.
Comment: @jwh20 From what I can tell is that there was some water damage beneath the square piece nailed to the floor to cover it up. Based on that, I'm assuming that the joists had experienced similar damage to the point of someone wanting to cut them off and "sister" them.
Comment: What is above this?
Comment: @DMoore, sliding door between the living room and the back deck
Answer: I tend to answer in practical terms, and not in strictly code-compliant or legal terms. In cases like this, code doesn't really apply since it's old work and you're making improvements. We're only talking two joists, right? That's not so terrible.

No, this repair was not done well. Short joist patches only work if they're fastened really well. These aren't.
No, your floor won't immediately collapse (unless you store grand pianos or stacks of aquariums above).
Yes, I would seek to fix the situation. Full-length sistering isn't normally too difficult. I'd do that, and take precautions such as temporary posts if you're removing lumber to fit new. The sting in your wallet will only be due to the crazy price of lumber at the moment.
Comment: I'm a little bit nervous about strictly repairing the floor joists because it looks like the header joists have experienced water damage as well (behind that particular joist is a ledger board that is holding up a badly designed deck, so I'm wondering if water somehow got behind the ledger to the header.)
Comment: Is that a question or a request for more information? What's a "header joist"?
Comment: Header joist aka rim joist. Mmm, no it is not a question or a request for anything, just a layman's observation. But I would certainly welcome any responses.
Answer: Edited to add additional comments.
I agree with Isherwood answer to your questions.  The extension is weak because it does not overlap the original cutoff joist enough and only 5 nails to connect the extension to the old joist.
Those short 2 x 6 on the inside are only to support the plywood platform to support the boards above.  Most likely the ends of the boards were cut off because of the rot.
I would look into what caused the original water damage, as the second photo shows a watermark after the repair.   Your comment about water damage on the joist rim maybe because their is still a leak.
Comment: Agreed, my plan was to remove the platform supporting the subfloor to see if there is rot again, and to possibly find the source of it. Behind the water marks of the second picture is a ledger board for a very old and worn out deck. I'm expecting an unsealed gap in the ledger to be the source of this leak.


Is it possible to hook up an external mic to a Nikon D90 to get better sound for video?

Question: I'm getting bad sound quality on video taken with my NIKON D90. I think the mic is bad so I need to know if it is possible to plug a microphone into it some how?
Comment: Cant you get a usb attachment for male end on a mic
Answer: Nope, it sure doesn't.  On that camera, its only got an internal mic.  Your options are:

Record sound otherwise and then sync up in post.
Buy a new camera like a D7000 that will take an external mic.
Use an actual video camera that takes an external mic.
Possibly tape some material to mimic a windscreen over the existing D90 mic, to help a little in some situations.
Live with the limitation.
Answer: No, you cannot plug in a microphone into the D90. There really isn't.
I would recommend you to buy a Zoom H1 which is a separate sound recording device that records sound onto SD cards. It is rather cheap, but has much, much better sound quality than the D90's built in microphone. Actually it' much better than the D7000's build in microphone as well. It is very easy to synchronize the video with the separately recorded sound. This is the way the professionals do it. Check out YouTube on how to synchronize video and sound in any program of your choice.
Answer: Unfortunately it can't.
If you can't afford buying another camera as suggested...getting an iSK CM-20 Super condenser mic and recording sound externally with it will give you a great sound plus it's an affordable solution. You will have to sync up the sound on post production.
Answer: Try using the Mini USB port available on D90. Use a Mini USB to 3.5 audio connector and plug in the external mic to it.
Should work. Give it a try.


does my zte model n817 have a built in IR blaster so I can use it as a tv remote for my Sony tv

Question: I have a ZTE model N817 android smart phone.  Does it have a built in IR blaster? If not, what do I need to do so that I can use my phone as a remote for my Sony flat screen TV.
Comment: check your phone's specifications online, because, each region may vary with some specifications.
Answer: According to the spec sheet at http://mobilespecs.net/phone/ZTE/ZTE_Quest_N817.html, it says IrDA = no which means it doesn't have an IR blaster.
As for using it as a tv remote, you can always get an 'ir blaster dongle' - there are various types, if you don't use the headphone port there are convenient ones that will go into the 3.5mm headphone port and not hang around as wires etc. (easier to carry in pocket).
However, you should check the TV as well; if its a newer tv with bluetooth remote then you just need a bluetooth remote control app.


Does hashing a PRNG by a cryptographically secure hashing algorithm result in a CSPRNG?

Question: Or specifically, does ChaCha20 hashing of the xoroshiro128+ random number generator result in a cryptographically secure random number generator?
Comment: Why just not using a chacha20 based prng  ?
Comment: but in this way you loose the speed advantage of xoroshiro128+ as ChaCha20 becomes the performance bottleneck. So why keeping it ?
Comment: I use xoroshiro128+ in a microcontroller because of its speed, but it is not cryptographically secure. I hash this stream afterwards using ChaCha20.
Comment: Note that ChaCha20 is not a hash, so although you can XOR the random stream with the key stream generated using ChaCha20, that's still not called hashing. What are you planning to use as key? Note that the key should be random as well, and that you'd require a unique IV if you decide to reuse the key.
Comment: This is all a bit vague.  What's the chip exactly?  If it has an internal temperature sensor , I'm pretty sure it can run AES/ ChaCha.
Answer: A hash function is a "public" function. If some bad guy knows what the input might be then they are able to evaluating the hash function themselves and get the same output the good guys do. The only way that won't be a problem is if the input has really high entropy.
Insecure PRNGs only appear random to the human eye, but their output might follow enough of a pattern to make brute-force guessing of hash input possible. (Their output definitely has low entropy if their state space is low or if they're seeded with a 32 or 64-bit number.)
You can address the fact that hash functions are public by using a PRF (pseudo-random function) instead. PRFs can be built from hash functions. See the HMAC and SHAKE (SHA-3) algorithms. If the input to your PRF is non-repeating and your secret-key is not predictable then this is a secure PRNG based on the definition of a PRF.
If you do something like outputBlock = PRF(secretKey, rng.getRandom32Bits()) then the construction is not secure. Even if rng allowed you to sample from an ideal uniform random variable, this method would start repeating outputBlock(s) after around $2^{16}$ samples. (Due to the birthday problem, but even if that weren't a problem you would get repeats within $2^{32}$ blocks.
The improbable occurrence of repeated long outputBlock(s) would be a problem for meeting the requirements of a secure RNG. It might also be possible to perform a stronger attack (full state recovery) with knowledge of the insecure RNG's patterns by observing the pattern of repetitions.
However it is really easy to avoid the problem of repetition. Just use a $n$-bit counter for input and use less than $2^n$ blocks of output. A PRF, by definition, must produce output (on non-repeating input) indistinguishable from random (Even if input doesn't look random!) and, by definition, doesn't permit key recovery attacks no matter what the input is.
That gets you a secure RNG (potentially using just hash functions). But you then don't need the weak RNG.
Of course there are many faster secure PRNG algorithms out there. (Like using ChaCha20 key-stream output or the output produced by repeatedly encrypting a counter with a block cipher.) If you can use a hash and a few extra bytes of executable is acceptable then I don't see why you wouldn't want to base an RNG off of ChaCha. Hash functions implemented in software (compared to a dedicated CSPRNG algorithm) are going to be slow, require a large executable size, or both.
Large executable size meaning large for embedded systems. On a PC with GB of RAM it's neglible.
Comment: Thank you for your comprehensive answer.
By implementing a (by itself unsecure) PRNG on the microcontroller and
optionally ChaCha20 on the pc I leave the possibility to just use the microcontroller when cryptographically secure numbers are not needed.   When needed, switch the CSPRNG on.

I periodically reseed the PRNG on the microcontroller using two seeds that are generated with an internal temperature sensor (von Neumann unbiased).
Does that make a difference?

However your suggestion using a PRF is interesting, I will look into it.
Comment: @PietjePuk Reseeding doesn't solve the problems. Insecure RNGs can be cracked after very little output has been used. Your hardware randomness source isn't great. And turning an entropy source into something useful for crypto is something that requires you to have a lot of prerequisite knowledge. Microcontroller security is a really complex subject as well. Lots of stuff off topic to the question.
Comment: You are right, I will study crypto first as it is also very interesting. Thank you.


Mac Pro (mid 2010) grinds to a halt when display is rotated to portrait

Question: I have a Mac Pro Mid 2010 with two ATI Radion 5770's driving 6 Dell U2412M's. Problem is, when even just one of these displays is rotated to portrait, the entire system grinds to a halt. CPU usage spikes to about 85%, I have 12gb of RAM installed and when this happens, about 512mb is free. And graphics performance is all but completely dead. At first I thought this may be because I am driving six monitors at once. But this is illogical be cause for one, it only just started occurring since I upgraded to 10.8(which as a power user, I absolutely hate). And two because this also happens with just one monitor hooked up. Any ideas?
Comment: Check the "Graphics/Displays" section of System Information.  For a given display, does the "Rotation" line say "Supported"?  I feel your pain about 10.8...
Comment: I assume the monitor gives the on/off/on flash to black then back to normal again? this is not ideal, but a good test might be to turn a monitor off, unplug the display cable, make sure 10.8 knows it's gone, then rotate the display, and plug the monitor back in again. Of course Thorgrim's suggestion is the first step.
Comment: ok. just checked mine, MBP2012nR->U2211H->No longer auto-recognizes rotation. Must go sys prefs>displays>display(tab)>rotation(menu)>90-degress. Then, only 1080x1920 shows correctly (not clipped, or horribly stretched) (on ML). I tried with built-in display both on and lid shut (off). very different from <10.8! 1600x900 works fine in landscape, but is clipped on the left side so that I miss the apple menu and the application menu for long application names (my menu starts at 'references', as in System Preferences). Horrible!
Comment: Have you considered filing a bug since this might just be that… https://developer.apple.com/bugreporter/
Answer: This is the sort of thing a well documented bug would let an engineer fix the code to avoid crippling a powerful Mac with a video change.

https://developer.apple.com/bugreporter/
Once you have the machine blocked, type sudo sysdiagnose in terminal and send that output in with the bug report as an attachment.
Usually, you never hear back, but sometimes you'll get an email requesting more details to help engineering isolate the behavior you are seeing.


Value vs Growth: are start-ups value companies or growth companies?

Question: I'm a bit confused about the definitions of value and growth. I heard that companies that have high P/E ratios are growth companies. Are start-ups (think Silicon Valley start-ups, most of which fail very quickly) value companies or growth companies? I think start-ups don't make a lot of money at first so they have high P/E ratios, but they seem to be very risky. How would you classify start-ups into value vs growth?
Comment: Consider how you'd compute a P/E if the E is negative or zero.
Comment: This is my question as well. I'd calculate the PV of all the future earnings. However, the discount rate is tricky. When it comes to start-ups, how would you decide whether they're growth or value?
Comment: most start-ups aren't public so not sure how you would begin to look at their books/financial.  Value is a stock who has a P/E that is lower RELATIVE TO IT'S PEERS.  They also tend to pay out earnings and are established companies. Growth stocks you usually have to use a different metric besides P/E as they might invest heavily in the future earnings and have no current earnings.
Answer: Neither. Why would you have to classify startups as value or growth?
A startup is its own category.  You can find startups at "classic" valuations (price/book...  Etc) that would make investors' eyes water...
But that happens because many startups are early stage and so revenue or book value or other classic valuations don't quite suit.
Answer: In most cases, startups are growth companies. That's because they are founded with an idea and a little money. Outside investors are paying for a piece of the founders' "idea," and the hope that the idea will make a little money grow into a lot of money.
There are exceptions. Startups in hard assets companies such as real estate and oil and gas are value investments. That is, they take "ideas" that are solidly proven, so you are getting a lot of "house" or oil drilling equipment for your money. Unlike the standard startup, you're not paying for the "idea."
Answer: Other metrics like Price/Book Value or Price/Sales can be used to determine if a company has above average valuations and would be classified as growth or below average valuations and be classified as value. Fama and French's 3 Factor model would be one example that was studied a great deal using an inverse of Price/Book I believe.


What's the best way to set the x,y coordinate of UILabel but let it auto width/height on the iPhone?

Question: I know exactly where I want to position my UILabel in a UIView, but I don't necessarily know what height/width I want it to have at compile time, so setting a width/height in initWithFrame is useless. I want to be able to just init its x,y point, and then use something like [myLabel sizeToFit] so it can automagically set the width/height based on my break mode and content.
The solution I'm looking for is how to set the UILabel's point of origin while setting it's width/height to a dynamic number based on the text set to the label.
Answer: Size the label first, then set its origin or center:
[myLabel sizeToFit];
CGRect frame = myLabel.frame;
frame.origin = CGPointMake(x, y);
myLabel.frame = frame;

or
[myLabel sizeToFit];
myLabel.center = CGPointMake(x, y);

Answer: If you already have the frame with dynamic size but want to change the origin:
CGRect myFrame = myLabel.frame;
myFrame.origin = aCGPoint;
myLabel.frame = myFrame;

If you need to calculate the size:
CGSize suggestedSize = [myString sizeWithFont:myLabel.font constrainedToSize:CGSizeMake(FLT_MAX, FLT_MAX) lineBreakMode:UILineBreakModeWordWrap];

Of course, you can change the FLT_MAX to constrain to a specific width or heigh.
EDIT: I didn't realize you wanted to programatically calculate the size. Added a better explanation above.


What's does IMetadataExchange endpoint actually do?

Question: I'm working on a web service that uses ASP.NET security model (i.e. with AspNetCompatibilityRequirements set to allowed). Like many others, I got an error saying the Anonymous access is required because the mexHttpBinding requires it and the only way to get around it is to remove the mex endpoint from each service as described here:
WCF - Windows authentication - Security settings require Anonymous
I thought by removing mex endpoint I will no longer able to generate WSDL or add a reference to the service from Visual Studio but to my surprise everything still works. I quickly googled the "mex binding" but most web sites just say it's for "Metadata Exchange" without going into too much detail on what it actually does.
Can anyone tell me what's the side effect of removing the mex binding?
Answer: If your WCF service does not expose service metadata, you cannot add a service reference to it, neither from within Visual Studio (Add Service Reference), nor will another client be able to interrogate your service for its methods and the data it needs.
Removing Metadata Exchange (mex) basically renders the service "invisible", almost - a potential caller must find out some other way (e.g. by being supplied with a WSDL file, or by getting a class library assembly with a client he can use) about what the service can do, and how.
This might be okay for high risk environment, but most of the time, being able to interrogate the service and have it describe itself via metadata is something you want to have enabled. That's really one of the main advantages of a SOAP based service - by virtue of metadata, it can describe itself, its operations, all the data structures needed. That feature is used to make it really easy to call that service - you just point to the mex endpoint, and you can find out all you need to know about that service.
Answer: Without the metadata exchange, you won't be able to use svcutil.exe to automatically generate the proxy classes.


Iphone 4 is acting glitchy.Should I update it?

Question: I've had my IPhone 4 since October 30th. Yesterday, it started acting funny.  I can't receive text messages and when I do receive calls they go straight to  voicemail. I'll get the voice mail several hours later. I can send texts AND make calls. I have reset everything on my phone and nothing has worked. I haven't updated anything on my  phone because it is jail broken and I do not want to lose my games. Is it possible that because I have not updated it's acting up? I know it isn't my account. Could there be anything else wrong with it?
Answer: I don't think having a slight outdated OS or Jailbroken device would cause those glitches to occur.  On my iPhone 4 it once acted funny in a different way by not responding to my finger taps correctly.  Try this, it helped me:

Hold the sleep/wake button on top and the home button at the same time.  When the "slide to power off" slider appears keep holding the two buttons.
When it appears to be off keep holding the two buttons still.
Finally, when the boot apple logo appears you can release the two buttons.

This isn't a jailbreak technique that turns the phone into DFU or Recovery Mode.  It's like a soft reboot that clears any lingering data on its RAM that might be causing your problems.
Comment: I think it might be a problem with the network. Ill have to get the account password and talk to AT&T. I've tried the reboot as well. Talking to AT&T is my last hope...next to taking it to the Apple Store. Thank you for the reply.
Comment: Since it is a jailbroke phone, go to the SBSettings and tap on More.  Under Mobile Substrate Addons turn off any cydia apps you are running (careful not to turn off something you don't recognize, they may actually brick your phone if turned off.).  Then Respring.  If the problem goes away then it is a cydia app that is causing the problem.  @mattsnow had a similar problem using a tethering jailbreak app.  Let me know how it went.
If you don't have SBSettings, its easy to find it on Cydia.
Answer: Back when I had a 3G I had this exact problem. it was related to tethering being enabled via the http://help.benm.at/ hack.
Reverted and things started working fine.


Mongoose: How to Store Duration and Time?

Question: In Mongoose, how does a person save duration in the Mongo Database? I'm trying to make a tennis application, and am stuck on database design, specifically with time.
For example, I want to add a Rally event (just hitting the tennis ball back and forth with another player) for X amount of time. So I'd like to store duration.
Another example, when playing a game of tennis with someone else, I'd like to store the total duration of the game.
I'm thinking to compute the difference between end time and start time, but can you do math in Mongo?
const MatchSchema = new mongoose.Schema({
  startTime: {
        type: Date,
        default: Date.now
    },
    endTime: {
        type: Date
    },
    duration: {
        type : Date
    },
    player: {
        type: String,
        trim: true,
        require: [true, 'Please add a player name']
    },
    opponent: {
        type: String,
        trim: true
    },
    date: {
        type: Date,
        default: Date.now
    },
    score: {
        playerOneScore: {
            type: Number
        },
        playerTwoScore: {
            type: Number
        }
    },
    category: {
        //array of strings
        type: [String],
        required: true,
        enum: [
            'Rally',
            'Set',
            'Match',
            'Practice'
       ]
    }
});

module.exports = mongoose.model('Match', MatchSchema);

Answer: (1) Date math is possible in MongoDB. See Aggregation Operators for Date.
(2) You can also store duration as a field of type number (an integer or long), but it will be something as you want in your application - in seconds or minutes. Name the field as duration_in_seconds, for example.
Another possibility is to store duration as:
duration: {
    hours: number,
    minutes: number,
    seconds: number
}

Answer: Within mongoose you have access to Middleware (also called pre and post hooks) which allows to define some action which can be perform during different lifecycle of a query You can check the Post hook which allow you to perform certain action after the model have been saved to the database.
Here is how it's define
MatchSchema.post('save', function(doc, next) {
  // here you have access to the document which have been save to the database
});

As Schema are define in javascript and you have access to model which have been saved in the argument doc of the callback passed to the .post function you can perform whatever math calculation which are possible using javascript and make some changes to other attribute on the same document and save the update made to the database.


Reaction of sulfate ion in copper sulfate electrolysis

Question: I am planning to try copper plating a piece of metal by performing electrolysis on an aqueous solution of copper sulfate. I plan run an electrical current with the metal I want to plate as the cathode and a platinum anode. I understand that the copper ions will become reduced when they plate the metal, but I am curious what will happen to the sulfate ions. Will it oxidize to form sulfur trioxide with the produced oxygen from the electrolysis?
Comment: [Related post](http://chemistry.stackexchange.com/questions/31320/is-there-an-electrolyte-that-will-halt-the-production-of-hydrogen-in-water-elect): check the standard reduction potentials.
Answer: A typical solution for copper plating contains about $0.5\ \mathrm{mol\ l^{-1}}$ $\ce{CuSO4}$ and $0.5\ \mathrm{mol\ l^{-1}}$ $\ce{H2SO4}$:
$$\begin{align}
c(\ce{Cu^2+})&=0.5\ \mathrm{mol\ l^{-1}}\\
c(\ce{H+})&=1\ \mathrm{mol\ l^{-1}}\\
c(\ce{SO4^2-})&=1\ \mathrm{mol\ l^{-1}}\\
\end{align}$$
The positive ions $\ce{Cu^2+}$ and $\ce{H3O+}$ are attracted to the cathode. The redox potentials $E$ for $\mathrm{pH} = 0$ show that cathodic reduction of $\ce{Cu^2+}$ to $\ce{Cu}$ is preferred over reduction of $\ce{H+}$ to $\ce{H2}$:
$$\begin{alignat}{2}
\ce{Cu^2+ + 2e- \;&<=> Cu}\quad\quad &&E^\circ = +0.340\ \mathrm{V}\quad\quad &&&E=E^\circ+\frac{0.059\ \mathrm{V}}{2}\log 0.5 = 0.331\ \mathrm{V}\\
\ce{2H+ + 2e- \;&<=> H2}\quad\quad &&E^\circ = +0.000
\end{alignat}$$
At the anode, the redox potentials $E$ imply that oxidation of $\ce{H2O}$ to $\ce{O2}$ is preferred over oxidation of $\ce{SO4^2-}$:
$$\begin{alignat}{3}
\ce{O2 + 4H+ + 4e- \;&<=> 2H2O}\quad\quad &&E^\circ = +1.229\ \mathrm{V}\\
\ce{S2O8^2- + 2e- \;&<=> 2SO4^2-}\quad\quad &&E^\circ = +2.01\ \mathrm{V}
\end{alignat}$$
Nevertheless, $\ce{SO4^2-}$ actually is oxidised at the anode:
$$\ce{SO4^2- -> SO4- + e-}$$
The reason for this reaction is that negative ions are attracted to the anode. Under neutral conditions, $\ce{OH-}$ ions would migrate to the anode where they would be oxidised to $\ce{O2}$. However, under the given acidic conditions, the concentration of $\ce{OH-}$ is very low. The predominant negative ions are $\ce{SO4^2-}$, which migrate to the anode.
Since the produced concentration of $\ce{SO4-}$ is low, the $\ce{SO4-}$ ions do not combine to $\ce{S2O8^2-}$. Instead $\ce{SO4-}$ reacts with water:
$$\ce{4SO4- + 2H2O -> 4SO4^2- + O2 + 4H+}$$
Therefore, the net reaction is the above-mentioned oxidation of $\ce{H2O}$ to $\ce{O2}$. The $\ce{SO4-}$ ions act as catalyst:
$$\begin{align}
\ce{4SO4^2- &-> 4SO4- + 4e-}\\
\ce{4SO4- + 2H2O &-> 4SO4^2- + O2 + 4H+}\\
\hline\ce{2H2O &-> O2 + 4H+ + 4e-}
\end{align}
$$
Comment: Hmmm... I thought the hydrogen sulfate ion is not a strong acid and will not ionise completely. So is it safe to assume c(H+) = 1 M?
Comment: I have never seen this mechanism proposed for the catalysis of the oxidation of water using sulfate as the catalyst. Any references to support?


MariaDB/MySQL IO limit in test environment

Question: I have a test environment (all Linux) where we start our server application with MariaDB (which runs in docker in the case if it matters), run some tests, save the test results and drop the DB.
I want to limit the MariaDB disk usage (IOPS), because we really use the storage (with another systems) and I try to save some resources. I've realized, MariaDB shouldn't even write to the disk, as it is a test environment and I don't really need persistence. (If the node dies, the test anyway fails and we run it from scratch somewhere else.) As a side effect the test would be even faster (but it's not important).
What I've found is the Memory storage engine, what is not useful for me, because I don't want to change anything on SQL level as the same SQL scripts used on live systems (where a by mistaken left behind "ENGINE = MEMORY" would make a disaster).
I also could use a RAM disk as a filesystem and MariaDB wouldn't even realize the change. That's sound good, but in this case I have to maintain a right size of RAM disk and also waste of RAM as the data is (most likely) already in the RAM and we put it there again (on a RAM disk).
So I am looking for a solution which doesn't require changes on the DB level (SQL), but in the MariaDB config to reduce or completely eliminate the disk usage (IOPS) regardless of data durability.
Answer: InnoDB only processes in "RAM" -- specifically its "buffer_pool".  InnoDB will persist things to "disk".  So InnoDB will be doing a lot of ram-to-ram copies if you use a RAM-disk.  However, you could save some RAM by decreasing innodb_buffer_pool_size and various other settings.  Caution:  don't lower them too much, or there can be failures.


How do professional editors cut a portion of image precisely and paste it in another image

Question: So, I'm not a graphics designer but I need some help with my science project on image tampering. so basically I want to know how do expert graphics software users actually crop a part precisely in an image, because as far as I know there is not definite boundary around the corners. So how do you remove those extra outside the boundary colors? So do you like compromise with the shape of the cropping part itself or what ?
Comment: If you search this site for "Remove Background" You will find several varying techniques.
Comment: The cropping doesn't need to be precise, it only needs to look good... which may mean "good enough to defeat image forensics" but this still doesn't require accuracy, only plausibility.
Comment: The boundary doesn't need to be sharp. Guessing the right amount of transparent overlap is a question of experience.
Comment: @usr2564301 or math
Comment: Most of these, irrespectively to their quality, are very easy to detect with some [noise analysis](https://29a.ch/photo-forensics/#noise-analysis)
Answer: Interesting question.
Some terms need to be defined. The main one is Anti-aliasing.
A digital image is made by little squares. If the resolution of the device is not high enough we can see them. This is known as saw border, especially on diagonal lines.

One way we use to smooth diagonal lines is anti-aliasing, which consists in using pixels of an intermediate color between those adjacent colors.

Every digital photography on the planet and the majority of raster-based images have some level of anti-aliasing or blurriness in them.
So to cut an image there are some approaches.
This is defined by the threshold of the selection tool. If it is near zero, it will choose only some specific colors.

But adjusting it, and turning on an anti-alias option it starts selecting intermediate colors.
The first option of this selections is making them semi-transparent. (This example images actually are transparent so you can use them to see the effects on other backgrounds)This is what most software will do.

A more advanced algorithm could also remove the contamination of the adjacent color, it could take the values of the near color you actually want to see and transform those semitransparent pixels.

This is how that zone looks without the transparency. The borders are actually harsh again because the aliasing is given by the transparency, not the color.

This last type of anti-aliasing by transparency is more common when the image is generated directly as transparent, like using a 2D vector program or a 3D render one.

But in real life, there is a compromise between this perfect transparent anti-aliasing and "just enough". This is why it is preferable to work with high-resolution images, so these defects are tiny, and hopefully will not show in the finished product.

One common mistake some people do is taking still images with a green background thinking that this will be easier to remove in post.
If you are taking a photo that needs to be cut to remove the background, is a lot easier to choose a flat background of the similar tone of the final result, with enough difference from the main object.

For video is a bit different. If you are shooting video, the green screen is one good option. Some video compositing programs handle this color very well.
Comment: Its not actually hard to defringe the green color, and get the same result as the white one. Keying just one of those things that video post processors do better than photoshop.
Comment: Heck, and I always thought that the jagged lines were aliased and the "smoother" lines (with intermediate colours) were [anti-aliased](https://en.wikipedia.org/wiki/Spatial_anti-aliasing). Have I always been wrong?
Comment: So, for normal camera images or the ones which are not of high resolution, can we say that these errors are inevitable ?


UML Activity Diagram: show work results

Question: I would like to visualize input to and results of activities in UML activity diagrams, e.g. documents or files or information entities. How do I do that?
Answer: Activity Diagrams support Object Flows which should do the job.  See e.g. here.
Answer: You can add a listener on your objects model .
If I remember well one of customers ask me to highlight the name of component if this element was changed. The trick I did was to parse the model xml/xmi and detect changes.
This integration was possible and easy because the model of the UML tool that my customer was using was live synchronized with diagrams and saved as xmi format on the hard disk.

UML Activity Diagram: show work results


Running C++11 library with older libc

Question: I have written a shared library using C++11 features, compiled with gcc 4.8, libc 2.18, which needs to be run on a client's CentOS 6 machine, which has gcc 4.4.7, libc 2.12. There are some symbols in this library which are not found in libc 2.12, so how can I use this library on CentOS 6. I have flexibility in how, where, which machine the library can be compiled, but eventually it should be usable on client CentOS 6, where packages can not be touched.
Is it fine to compile it with DevTools-2 on CentOS 6 or there can be any ABI related issues.
Please let me know if there are any other suggestions. Thanks in advance.
Answer: Compile on the same system as the one running it. You might need to recompile for a version jump of the distribution (e.g. 7 to 8) and sometimes in berween.
If you use different compiler versions you might run into incompatibilities between the shared helper libraries for the compiler, base C or C++ (most likely) libraries, or assorted external dependencies. Not a mess I'd like to have to debug.
Answer:

C++11 features, compiled with gcc 4.8

? Why not g++ 4.8 ?
Suggest : Compile your library statically with libstdc++.a → I think the C++11 functions are in *libstdc++-devel, not glibc.
The devtoolset-2-libstdc++-devel-4.8.2 comes with static libraries :
/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.2/{ libstdc++.a, libstdc++_nonshared.a }

Running C++11 library with older libc