How can I export chrome passwords?

Question: I want to be able to export passwords from Chrome browser so that I can make a printed copy.
Comment: The functionality appears to be built into chrome://settings/passwords now. See my answer, or, if it gets updated, ccpizza's.
Comment: Related: [How to download/export own passwords stored at Google Passwords?](https://webapps.stackexchange.com/q/81133/22759)
Comment: Related: [Chrome Password Manager: How to add password manually?](https://stackoverflow.com/questions/56917140/chrome-password-manager-how-to-add-password-manually/57141176#57141176)
Answer: There are several solutions listed below, not all of them might  work with the latest versions of Chrome. The 'official' Google Chrome/Canary solution is the only one which is currently reliable. Other, potentially outdated solutions include a JS-based one for any OS, an OSX-only solution, and a Linux-only solution (confirmed to work in Chrome 68).
Official Chrome Import/Export buttons

Required: Install latest Google Chrome (if latest stable google chrome does not work for you then try with the Chrome Canary).
Log in with your google account, set up synching, and wait some minutes until all passwords are synched.
Open Chrome Flags by typing chrome://flags in the address bar.
Locate and enable the options Password import and  Password export, and restart Chrome Canary.
Now open chrome://settings/passwords where you should see a three dot icon. Clicking it will show the IMPORT and EXPORT options:

Update: in more recent Canary versions instead of the Import/Export buttons there is a single three dot button that contains an Export option.

Javascript-based solution

 Note: As of chrome v60+ the method described below does not work anymore.

An OS-independent way to extract the Chrome passwords to a human/spreadsheet readable format is via the Chrome Javascript API, as described on this page:

Open chrome://settings-frame/passwords in your browser (also accessible from Chrome Settings > Show Advanced Settings... > Chrome Passwords).
Open DevTools by right-clicking on the page > Inspect (or Ctr+Shift+I or ⌘+⌥+I).
Click the Console tab.
Click the dropdown that reads top (or <top frame>) and select the password frame: settings (password), as shown in the screeenshot (WARNING: Skipping this step will result in the error PasswordManager is not defined):

Next, paste the following code in the Console pane and press Enter (based on code from https://github.com/megmage/chrome-export-passwords which was cleaned up and made to work on Chrome v50+):

var out = [];
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
console.log(model);
var pl = pm.savedPasswordsList_;
for (var i = 0; i < model.length; i++) {
    PasswordManager.requestShowPassword(i);
}
alert('After you press Ok results should appear in ~5 seconds.\n' +
    "If password fields are empty, try increasing the timeout in the last line," +
    " i.e. set to 10000 for 10 seconds");
setTimeout(
    function () {
        out.push('# Generated by Password Exporter; Export format 1.1; Encrypted: false');
        out.push('"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"');
        for (var i = 0; i < model.length; i++) {
            var record = model.array_[i];
            var user = record.username;
            var item = pl.getListItemByIndex(i);
            var pass = item.querySelector('div.password input').value;
            var proto = record.url.split('://')[0];
            var line = `"${proto}://${record.shownOrigin}", "${user}", "${pass}", "${record.url}", ," "," "," "`;
            out.push(line);
            console.log(line);
        }
        document.body.innerText = out.join('\n');
    }, 5000);

IMPORTANT: This code is for versions of Chrome starting with v50. For earlier versions use the code linked in the original github page.
The passwords should appear on the same page in CSV format. Select and copy the output to a text file with .CSV extension — it can be opened in Excel/Libreoffice Calc. The format is compatible with Firefox Password Exporter, and can be used to import the passwords into Firefox.
Note to OSX users
Recent versions of Google Chrome/Chromium for OSX store passwords in the system keychain, which means that Chrome uses the OSX built-in credential storage mechanism (this is already outdated info).
On OSX you can export the passwords by running this in the terminal:
sudo security dump-keychain -d login.keychain > keychain.txt

And yes, you'll need to click Allow All as many times as you have domains in your login keychain, unless you use an autoclicker script. The link also points to a ruby script for converting the generated password file to CSV. The Ruby script worked for me after I removed the line containing proto.gsub!('htps', 'https');.
Alternatively you can use the native OSX app Keychain Access (type the name in Spotlight).
NOTE: As indicated by oarfish, Chrome stopped using the OSX Keychain as of v.45.
Linux-only solution to export passwords

This solution still works in current versions of chrome (v68)

The recipe below is a Linux-only solution and was taken from this blog post I created a while ago.
To export your passwords to a CSV spreadsheet that can be opened in LibreOffice or Excel:

If not already synced in Chrome, then connect to your Google Account in Chrome Settings so that your passwords are synced with the Google cloud storage. Make sure that you have ticked Passwords in Advanced Sync Settings.
Wait for a while until the data is synched, and then close all the Chrome windows.
Start Chrome/Chromium using one of the command line below. This will launch Chrome with a custom profile folder without affecting your current chrome profile.
## for Chrome:
google-chrome --user-data-dir=/tmp/chrome-tmp --password-store=basic

## for Chromium:
chromium --user-data-dir=/tmp/chrome-tmp --password-store=basic

Setup Google Synching for the new temporary profile and wait until everything is synced from the cloud, i.e. your bookmarks appear, extensions show up, the theme is applied, etc. Verify that the passwords are restored from the Google cloud by looking under Settings → Personal Stuff → Manage Saved Passwords. If they do not appear, then wait a couple of minutes more. Note: To access the stored passwords page open settings and password in the Search box in the top right, the the Manage passwords will appear at the bottom of the page. You can also use the direct link chrome://settings/passwords.
Exit Chrome.
Next, open a terminal and cd to the newly created Chrome profile:
cd /tmp/chrome-tmp/Default

Now, open the Login Data database file using the sqlite3 command line utility and dump the logins table. For this to work, you need to have sqlite3 installed on your system (in most Linuces comes pre-installed or is available in the repos).
sqlite3 'Login Data'

Next, at the SQLite prompt enter the commands below. For help on available commands type .help at the prompt.
.mode csv               # other options are `html', `tabs', etc.
.headers on
.separator ","
.output chrome_passwords.csv
select * from logins;
.exit

Now you should have a file named chrome_passwords.csv containing all your Chrome passwords. To open it with LibreOffice, type:
    libreoffice --calc chrome_passwords.csv

The Login Data file can be opened directly with a SQLite GUI app, such sqlitebrowser, sqliteman or sqlitestudio, of which the first two are normally available in Linux repos.
Comment: Just exported everything using this post https://productforums.google.com/d/msg/chrome/99KZmH2DRrA/5l37AibyAwAJ Worked like a charm, only there is no export button: find the three vertical dots next to the 'Saved Password' heading, then you will find 'export' @ccpizza: perhaps update the answer?
Comment: @m_gol: On OSX Chrome stores passwords in the keychain, and the `--password-store=...` arg has no effect. `Login Data` is still used but only for the metadata that does not fit into the keychain. So, if you want to see your passwords, type *Keychain Access* in spotlight. To migrate your passwords to another OSX system you'll need to copy both `~/Library/Keychains/login.keychain` *and* your chrome profile `~/Library/Application Support/Google/Chrome/<__YOUR_PROFILE_FOLDER__>`. If you only have a single chrome profile then the profile folder will be called `Default`.
Comment: @confiq: the steps do work in version 47 on Ubuntu, and I would assume that it works in earlier versions too.
Comment: Note: As of 45, Chrome does not use the Keychain anymore.
https://bugs.chromium.org/p/chromium/issues/detail?id=466638
Comment: @ccpizza, there is a new JS solution that works with Chrome 63+: https://gist.github.com/ryanpcmcquen/cee082bff514f8849a29c409fe3571ff
Comment: Doesn't work for me on OS X with Chrome 34. I get empty passwords in the resulting file.
Comment: this does not work on version 38+
Comment: @ccpizza: guess --password-store is useded to prevent passwords be encrypt but stiil it doesn't work. Ok. Can you be more specific about Keychain Access. What is it? Is there a way to not copy all data across computers and just export passes?
Comment: Sorry it doesn't work in windows version
Comment: @VladimirShmidt: If you are on OSX type `Keychain Access` in the spotlight search - it is built-in OSX app.
Comment: You've save my day @ccpizza. It works in Freya 0.3.1 :* (nohomo)
Comment: On Windows, it appears the Canary functionality is now live on the main builds. I don't believe any chrome://flags are required for this. Update your answer (I'd have done it, but it'd be a pretty big change, and I haven't tested Linux and don't own a Mac) and I'll delete mine.
Answer: ChromePass looks like the tool you want. There are options to save out to HTML and plaintext, both of which are very easy to print.
Comment: "I haven't seen any changes made to my system." that doesn't mean anything! Most programs (all?) do changes you don't notice, and many do things you never notice.
Comment: Chrome gives a warning when trying to download the *.exe. Is this download okay?
Comment: It seems solid. I tried it and although Windows Defender thought it was malware, I haven't seen any changes made to my system.
Answer: Found the easiest solution here: https://www.axllent.org/docs/view/export-chrome-passwords/
As of July/August 2016 Google introduced a hidden feature that allows you to import & export your passwords. All you currently need to do is turn on the hidden feature in the chrome://flags settings and restart your browser, after which you'll have the required functionality.
Instructions

In your Google Chrome (or Chromium, whichever you use), type the following in your URL bar: chrome://flags/#password-import-export, and then enable the feature.
Restart your browser.
Go to your passwords chrome://settings/passwords (you may have to wait a little while for your passwords to sync), then scroll down to below your passwords and you'll see two new buttons, Import & Export.
Click Export, making sure you select the correct format (CSV).
Comment: Running Chromium version 73.0.3683.75 on Ubuntu 16.04 (64 bits), I confirm that the #password-import-export feature is not there any longer, there seems to only be an Import feature left: chrome://flags/#PasswordImport (which is not what we want here). This page https://productforums.google.com/forum/#!topic/chrome/99KZmH2DRrA confirms the option disapeared, but indicates "In chrome://settings/passwords, click the 3-dot menu icon to choose Import and Export." (I don't seem to have a  3-dot menu icon though... But maybe because I don't have any passwords saved in Chromium anymore?) FWIW...
Comment: So simple.. I'm surprised this isn't the most popular answer.
Comment: Even with the flag, I don't see an import / export button as described. This might have been removed altogether now that passwords are accessible at http://passwords.google.com .. though that page doesn't have the options either.
Comment: Currently running Chromium 59.0.3071.109 on Ubuntu 16.04, I still have the option available.
Comment: This no longer works as of the latest version of Chrome (Feb '19).
Answer: The other password export methods are fairly involved; for this reason, I wrote a simple javascript snippet to take care of the job.
simple script to export chrome passwords, run when the password manager is open from the chrome console (hit f12 to access the console) in frame settings( passwords )

out="";out2="";dat=document.getElementsByClassName("password");

for(i=0;i<dat.length;i++){x=dat[i].parentNode;

out+="\n"+x.childNodes[0].innerText+"|"+x.childNodes[1].innerText+"|"+x.childNodes[2].childNodes[0].value;

out2+="br/>"+x.childNodes[0].innerText+"|"+x.childNodes[1].innerText+"|"+x.childNodes[2].childNodes[0].value;};console.log(out);

document.write(out2)

Comment: This does NOT work as of Chrome 37. Looks like any sort of dom element getting api returns null on that page :(
Comment: @EdOrsi You need to select the right frame (as alog already mentions in his answer)
Comment: @alog Thank you very much this answer really helped me!
Comment: @alog Thanks a lot. Where's the output exactly?
Answer: As at the end of ccpizza's answer,

Go to chrome://settings/passwords.
Click the three dots to the far right of Saved Passwords.
Click the Export menu item that appears.

It seems the Chrome Canary functionality that ccpizza mentions is now live on normal Chrome. (I'm currently at Version 72, on Windows.)
Answer: Working from alog's answer i found that the most recent versions of chrome will only output url and username due to the requirement to enter your windows password to view a password. you can still use the snippet but only after clicking and entering your windows password for every entry in the list.
so i created a jquery snippet for more recent versions of chrome to get around this.
As before enter developer mode  (f12) whilst viewing your password manager in chrome. Make sure the frame is set to settings( password ) , usually on the top left of the console view.
Go Here - Jquery 2.1.4 and copy/paste the jquery code into console, press enter.
Now you can paste the code below into the console and it will list your passwords there. You can then paste into excel and use the text to columns (first result on google)  delimiter function. (dont forget to set your delimiter in the code & match in excel.)
var out = '', delim = "|";
$.each($('.password input'), function(){
    if($(this).hasClass('inactive-password')) $(this).next('button').click();

    var C = $(this).closest('div[role=listitem]'),
        D = C.find('.url').text(),
        U = C.find('.name').text(),
        P = $(this).val();
    out += D + delim + U + delim + P +"\n";
});
console.log(out);

You will still need to enter your windows password but it should only be once. Also remember to check that all the passwords have turned to passwords as some can be missed.If it fails first time please try rerunning the code (arrow up then enter) as jquery may pull the value before chrome enters the password into the input.
Hope it helps someone, Apologies for the jQuery - was purely for my own convenience.
And of course if you lose your passwords because of this script (not that this should) then ... your own actions ... not intended ... blah etc
UPDATE
as ccpizza states the above code has stopped working so here is an update for those who still wish to do theirs simply:
var out = '', delim = "|";
$.each($('.password input'), function(){
    if($(this).attr('type') == 'password' ) $(this).next('button').click();

    var C = $(this).closest('div[role=listitem]'),
        D = C.find('.url a').attr('href'),
        U = C.find('.name input').val(),
        P = $(this).val();

    out += D + delim + U + delim + P +"\n";
});
console.log(out);

UPDATE 2
also should mention if you are accessing the settings frame by chrome://settings/passwords you will need to select the frame first. Alternatively you can use: chrome://settings-frame/passwords which should allow direct access.
Comment: this doesn't work in latest chrome versions, e.g.  51.0.2704.84 — only login names are listed.
Answer:
Go to chrome://flags/#password-import-export page (paste into address bar).
Enable Password import and export and restart web browser.
Go to chrome://settings/passwords, you should see the Export button.
Alternatively run this script in DevTools Console (JS):
chrome.passwordsPrivate.exportPasswords();

Export into CSV and verify the content of it.
Note: If CSV file is empty, check this Issue 808233.

See also
Related: Google Chrome: Import/Export Passwords?
Projects: megmage/chrome-export-passwords, ChromePass.
Gists: Grogs/step4.js, codekoala/export_chrome_passwords.js.
Answer: Install Dashlane (a password manager app) where you can automatically import all Google-stored passwords (it should ask on startup), then using the application you can export them into archive file (such as CSV or Excel format).

How can I export chrome passwords?


How can I Stake NFTs In Cardano?

Question: I am new to Cardano, I want some guidance from you guyz about this. Can someone please guide me that how can we stake NFTs in non custodial way in Cardano. I want to stake NFTs like the official staking mechanism of staking in Cardano. Like taking the snapshots of wallet assets, identify staked NFT and calculating and releasing rewards. Also how can i interact that all staking mechanism with my front end.
Your guidance will be very helpful for me. Thanks in Advance.
Answer: I am not aware of any staking being available for NFTs on Cardano.
Staking ADA on the Cardano network serves a purpose, it helps secure the Proof-of-Stake network. What purpose would staking NFTs serve?
Comment: But again, what would be the purpose of staking NFTs?
Comment: Its purpose is Just like the staking of ADA tokens. Users can stake their NFTs in a non-custodial way and their awards will have to be calculated according to the duration it has been locked. Also locking would be handled by snapshots.
Comment: To get rewards by staking NFT
Answer: Like Erik mentions, Proof-of-Stake is a consensus algorithm designed to secure the network.
The concept of "staking NFT's" is something that NFT projects use to hype/promote/give usecase to their NFT's, but this is not done on a protocol level; meaning that not every NFT will have this "feature" and IF they have it, it still depends on how they implemented it.
Comment: So if i make it clear, do u mean to say that it cannot be implemented or there is no way to do that? Just because each NFT has its own implementation etc. But we will only need the fingerprint of that nft then why we are concerning about NFT's implementation. I'm sorry if it sounds silly question. I'm new to cardano, kindly explain its limitations, it will be very helpful for me. Thanks alot
Answer: You can implement a passive earn feature for holding an NFT, in common tongue this is called "staking" but this will never be part of the consensus. Maybe you can have a look at farming options like what DEX's are offering, like Wingriders or Minswap.

deposit an NFT (or FT) in a smart contract
based on the duration you'll earn X amount of Token Y
Comment: But what if , i want to stake it in non custodial way. Like i cant lock NFT in a script but have to take snapshot and calculate reward. Also i am not getting about why and how NFT cant be used in staking side of cardano. And if it is possible then what can be the best solution for it? Your suggesstions will be highly appreciated as i have to make the possibe non custodial scenerio.
Comment: Q1. You can lock NFT's in scripts.. but that seems overly complex. You can just write a script that scans which wallets hold your NFT's and assign them a value of your COIN and have them withdraw that amount of COIN from a faucet.

Q2. It's not possible to use NFT's in Cardano's staking. Proof of Stake is a consensus to secure the network. Anyone can make an NFT, it doesn't actually mean that it has any value, so how would you secure the network with that? That's what I meant with the difference between the "hype term" STAKING and actual Proof of Stake.

My answer to Q1 would be best imo.
Answer:
I want to stake NFTs like the official staking mechanism of staking in Cardano.

Short answer: You will have to build this functionality yourself(or hire a team to do so).

How can I Stake NFTs In Cardano?


Why does Microsoft Office 2011 open automatically upon start up?

Question: Why do Microsoft Office Word, Excel, et cetera open automatically upon login although I've disabled the 'Open at login' feature?
Comment: When you say you've disabled the open at login feature, what are you talking about exactly? Do they appear in your Login Items within the Users & Groups preferences?
Comment: I think he means that he unchecked the box at shutdown, but it's easy to miss and in my Lion the box would have to be unchecked every time. In my ML it defaults to off. I think my answer matches you comment a bit, sorry.
Answer: It sounds like you had these apps open at last shutdown or logout. If you don't clear the check mark in the popup that states "Reopen windows when logging back in" all of your previously running apps will restart. I say this because in Lion sometimes that checkmark would not "stick" and default to on, and you would have to check it off at every shutdown/login, and you might have missed it.
Investigate this as well: Go to the "Users and Groups" System Preference pane. Click your account on the left (should already be highlighted and on top as current user). Make sure that under the tab "login items" that no Office apps reside there and are checked.
There are some other things to try but I believe these answers will cast light on your issue.
Answer: ok, This is a different answer to the problem, but I am using Yosemite. This worked on OS 10.7 as well
When I start the mac up, word 2011 with start with it's dialogue window. When I close this, it automatically brings up a blank document.
Now my solution to this was so simple that doing everything that has been suggested before is a waste of time.
Now before I get started, this is what I did to try to stop it from launching:
1) on the word icon, right clicking it --> options --> and unchecking the "open at login"
No effect
2) went into system preferences --> general --> unchecked the "Reopen windows at login"
No Effect
3) Tried the Login Items in user preferences
No Effect
4) Made sure the box "Reopen window when logging back in" was unchecked when shutting down.
No effect
What I did was:
When the dialogue window eventually showed up upon start up, there was a handy little box down the bottom that said: Don't show this when opening word" Checked this little box and now the program opens but no blank documents or dialogue box.
SIMPLES!


How does transpiration help in sucking water up?

Question: How can transpiration help in sucking water up as the amount of water that is sucked up by the evaporation of water equals to the amount of water evaporated. (Correct me if I am wrong). Then how it helps?
Answer: The benefit is not in taking up more water but in transporting the things that water contains.
Plants rely on bulk transport in water flowing though specialized tissue (xylem), somewhat analogous to blood flow in an animal. Water flows through the xylem using capillary action; when water is lost at the top, capillary action pulls water into the vacated space and the flow continues down the entire height of the plant. Water removed for other uses like photosynthesis also contributes, but transpiration is important for many plants to increase the flow rate.


"The process cannot access ..." when using MSBuild

Question: I am so close to getting my TeamCity setup complete, but am stumped by this error:
<code>(12/22/2011 2:30:15 PM) An error occurred when the request was processed on the remote computer.
An error was encountered when processing 'Web.zip'.
The error code was 0x80070020.
The process cannot access 'C:\Inetpub\wwwroot\Deneb\Website\obj\Deploy\Package\Web.zip' because it is being used by another process.
</code>
I tried deleting that file myself, and didn't have any problems. I am able to deploy this site from another server, also without any problems. I set the Team City build agent service to run as administrator, and restarted the service.
Any help would be greatly appreciated - thanks!
Answer: Realized that the checkout directory shouldn't be set the same as the web directory


well separated points on sphere

Question: Is there a way to generate k points on a n-sphere, say, $x_1,\dots,x_k$ such that $\min_{ i \neq j } \| x_i - x_j \| $ is as large as possible? Approximate solutions are also OK, I just need well separated points on a sphere.
Comment: One of lhf's links leads to [a page of results on spherical packings](http://www2.research.att.com/~njas/packings/), which is precisely to maximize the minimum distance between a specified number of points on a 2-sphere.  Little is known about the problem beyond dimension 5 or so.  I looked into that about half a year ago for someone in a newsgroup.
Comment: Possible duplicate: http://math.stackexchange.com/questions/9846/which-tessellation-of-the-sphere-yields-a-constant-density-of-vertices/  See my answer there for links.
Comment: Thanks, I have marked this question as a duplicate.  [Update] Actually this question appears a little bit different, anyway...
Comment: @hardmath: I disagree with "little is known about the problem beyond dimension 5 or so". Conway & Sloane's "Sphere Packings, Lattices and Groups" is quite a voluminous compendium, and quite a bit of it is about sphere packings in higher dimensions. You can see the table of contents here: http://www.gbv.de/dms/goettingen/245890696.pdf
Comment: @joriki: I should have framed it as a comparative.  That's Sloane's page linked above.  It may be outdated; the link to his book "Sphere Packings, Lattices, and Groups" with Conway (3ed., 1998, same as your PDF) seems to be broken.  Coverage of dimensions > 5 there is sparse and unsystematic, amounting to only a couple of dozen packings, and while the he writes the packings for dimensions 3,4,5 listed in part 1 are "putatively optimal", the higher dimensional packings are only said to be "nice", "good", or "interesting".
Comment: @hardmath: I guess you meant "there's little systematic knowledge" -- "Sphere Packings, ..." takes more of a butterfly collecting approach to the problem :-)
Answer: Here's a sci.math thread, "putting points on a unit sphere?", from July 2010, that provides some additional links to the literature.
For the classic $2$-sphere, Dave Rusin's excellent collection of links and notes in Mathematical Atlas has disappeared from the Web, but see:

The most regular placements of points on a
  sphere correspond to the vertices of Platonic solids (Wikipedia)
However only five such configurations exist, for n = 4,6,8,12,20 vertices.

There is an updated collection of links at Anton Sherwood's page on sphere distribution problems.
Around the middle of the sci.math thread I point out the three regular polytopes that exist in each dimension $N \geq 5$, namely the N-simplex (with N+1 vertices), the N-cube (with $2^N$ vertices), and the dual of the latter, the N-orthoplex (with 2N vertices).  If the number of points k happens to match up with one of these, then you are in luck!
For more general numbers of points on a hyper-sphere, I suggested an approximate solution that inducts on the dimension.  That is, the N-1 sphere (sitting in N dimensions) has longitudinal sections that are N-2 spheres, e.g. the equator.  A crude lower bound on the maximum number of points with a given distance (equiv., central angular) separation can be obtained by longitudinally stratifying the N-1 sphere into these N-2 spheres appropriately far apart, then doing the packing in the reduced dimensions (using when sufficiently low dimensions are reached Sloane's library of known configurations).
One can also get an equally crude upper bound on number of points with given separation R by dividing the "surface" measure of the N-1 sphere (sitting in N dimensions) by the measure of "spherical caps" having the given distance or angular "radius" R/2.
I applied these ideas to a separation of 30 degrees on the 2-sphere, and got a lower bound (constructive) of 44 points and an upper bound of 59 points.  Sloane's library gives the optimum count for this separation as 48.  It seems inevitable that as the dimension increases, such approximations will become less and less accurate.  Still, if one needs a design for an arbitrary number of points, that's how I'd tackle it.  If the number of points were happily close to one of those special regular polytopes, then I'd try perturbing the coordinates to add (or lose) a few points.
Answer: I suspect you might get reasonable results by starting with k randomly chosen points and optimizing locally (find the closest pair, and move one of them to a point that's a local max of the minimum distance from all other points, then repeat...).
Answer: There are lots of papers for nearly uniform distribution of points on 2-sphere, however, the question is for general n-sphere, for which the only systematic way I have seen is Fisher's 1986 PVQ: pyramid vector quantizer, used in data compressors e.g. OPUS audio codec.
It starts with uniform point distribution on l1 sphere ("pyramid"): set of integer points of fixed sum of absolute values. Then projects these points to l2 sphere. To get more uniform point distribution we can use some deformation like power before the projection.

well separated points on sphere


Polyhedral cone as conic hull of a finite set

Question: I am reading notes on optimization and it was claimed that all polyhedral cones in $K\subseteq \mathbb{R}^n$ can be written Cone(R) where $R\subseteq \mathbb{R}^n$ is a finite set.  That is, if K is a polyhedral cone, then $K=\{\sum_{i=1}^k a_i h_i: a_i\geq 0 \}$ for some finite set $R:=\{h_1,...,h_k\}\subseteq \mathbb{R}^n$.
I would like to convince myself this is true.  It seems intuitively obvious, but I don't know how to go about showing it.  I already know that all bounded, polyhedral sets can be expressed as the convex hull of a finite # of pts.  One direction I am considering is how to use that result here.
Answer: The polyhedral cone $K$ is defined as an intersection of a finite number of half-spaces, i.e. $K=\{x\in\mathbb{R}^n\colon Ax\ge 0\}$, where $A\in\mathbb{R}^{m\times n}$. Since $\text{Im}\,A$ is a subspace, it can be represented as a kernel of some matrix $M$, that is $\ker M=\text{Im} A$. Hence, we have
$$
y=Ax,\ x\in K\qquad\Leftrightarrow\qquad y\in Y=\{y\in\mathbb{R}^m\colon\ My=0,\ y\ge 0\}.\tag1
$$
Introduce the set
$$
P=\{z\in Y\colon\ (\matrix{1 & 1 & \ldots & 1})z=1\}.
$$
It is a bounded polyhedral set, thus, finitely generated (according to what you know)
$$
\exists z_1,z_2,\ldots,z_N\in P\colon\ P=\text{conv}\{z_1,z_2,\ldots,z_N\}.
$$
Therefore, even $Y$ is a finitely generated (positive) cone
$$
Y=\text{cone}\{z_1,z_2,\ldots,z_N\}
$$
since any $y\in Y$ is a non-negative scaling of some $z\in P$.
Now by $(1)$ we can pick $x_k\in K$ such that $z_k=Ax_k$, and we are almost done finding a finite generating set for $K$. The minor trouble left is $\ker A$. Actually, it is quite easy to see that
$$
K=\ker A+\text{cone}\{x_1,x_2,\ldots,x_N\}.
$$
I leave it as an exercise (together with the fact that $\ker A$ is a finitely generated cone).
Comment: There must be something wrong here, consider following example: $A=\left[\begin{smallmatrix}1&2\\2&1\end{smallmatrix}\right]$. $\text{Im}A=\mathbb R^2$, thus $M=0$ suffices $\ker M=\text{Im}A$, so we have $Y=\mathbb R_+^2$ and $P=\left\{z_1, z_2\right\}$ with $z_1=\left[\begin{smallmatrix}1\\0\end{smallmatrix}\right]$ and $z_2=\left[\begin{smallmatrix}0\\1\end{smallmatrix}\right]$. For $z_1$ the linear system $z_k=Ax_k$ yields $x_1=\left[\begin{smallmatrix}-1/3\\2/3\end{smallmatrix}\right]$, but $x_1 \not\in K$ (which it should be since $\ker A=\left\{0\right\}$).
Comment: @theV0ID $K$ is defined as $Ax\ge 0$. Since $Ax_1=z_1=\left[\begin{smallmatrix}1\\0\end{smallmatrix}\right]\ge 0$ it follows that $x_1\in K$. Did you expect $x_1\ge 0$? (This is no how $K$ is defined.)
Comment: @theV0ID The cone $K$ in your example looks like [this](https://www.geogebra.org/graphing/p344yrcx) (blue area). The vector $3x_1=\left[\begin{smallmatrix}-1\\2\end{smallmatrix}\right]$ is one of the extreme directions of the cone (the left top one on the picture).
Comment: You are right, thanks for the clarification (seems I lost focus at the end of a long day). However, your geogebra link does not work, it says "failed to open file".
Comment: Any idea on how to determine $z_1, \dots, z_N$ algorithmically?
Comment: @A.Γ.: Could you give me some help on this question: https://math.stackexchange.com/questions/3039036/how-to-show-polyhedral-cone-of-nonnegative-vectors-contains-finitely-generated-c


How can I display Color Profile of every jpeg in a folder?

Question: I need to find the color profile of every jpeg in a folder so that I can determine which ones I want to edit. Can I batch list them? I do not have Photoshop.
Comment: I am curious as to why the color profile of a photo is the determining factor in whether or not you want to edit the photo.
Comment: I have scraped thousands of images from the web. I am using them for Artificial Intelligence classification. But the program crashes on some of them; I suspect the CMYK ones or some other profile.
Answer: Using exiftool you should be able to extract the ICC profile name using:
exiftool -icc_profile:ProfileDescription some_file.jpg

You can write a loop in a command line script to do this for a set of images.
If you are interested in other parameters of the ICC profile you can use a different tag name (found on the ICC_profile manual page linked earlier) instead of ProfileDescription.
You can write -icc_profile:* if you want to see all tags.
Comment: Thank you for the reply. I installed and ran the exiftool, deleting the (-k). I also used the download for the Windows installer. I run the command line as indicated referring to a specific jpg but I see no output. This will take some time to learn to use this tool.
Comment: I think (not sure) it's possible that your jpg has no embedded icc profile. In that case exiftool will have nothing to show you and you will see no output.


Completion of a Noetherian ring R at the ideal $ (a_1,\ldots,a_n)$

Question: How can we prove that if $R$ is a commutative Noetherian ring, $\mathfrak{m} = (a_1,\ldots,a_n)$ is an ideal, then the completion of $R$ at $\mathfrak{m}$ is isomorphic to $R[[x_1,\ldots,x_n]]/(x_1-a_1,\ldots,x_n-a_n)$?
Comment: You don't lose anything from having your entire question in the title.  Not having a clear indication of what the question is about just makes it less likely that the people who might be able to help you will take a look.
Comment: (It never hurts to make explicit the fact that your rings are commutative!)
Answer: Use the fact that completing is the same thing as tensoring with the completed ring, and that the completed ring is flat over the original ring.
(All this is true in view of your hypothesis, of course!)
Comment: I can't see the direction you say Mariano. Can you give me some other hint?
Answer: Here is an argument (maybe the same as the one that Mariano sketched, but with a little more detail):
Let $S = R[[x_1,\ldots,x_n]]$, and let $T = R[[x_1,\ldots,x_n]]/(x_1-a_1,\ldots,x_n-a_n).$  The ring $S$ is Noetherian (since $R$ is), and is complete with respect to the ideal $(x_1,\ldots,x_n)$.  By Artin--Rees (for example) the finitely generated $S$-module $T$ is also complete with respect to this ideal.
Thus $T=\varprojlim T/(x_1,\ldots,x_n)^i = \varprojlim R/(a_1,\ldots,a_n)^i.$
Thus $T$ is the completion of $R$ with respect to $(a_1,\ldots,a_n)$, as claimed.
Comment: Is the 'Noetherian' assumption necessary? If $R$ is commutative and $\mathfrak{a}=(a_1,\ldots,a_n)$, can $\widehat{R}_\mathfrak{a}\ncong R[[x_1,\ldots,x_n]]/(x_1-a_1,\ldots,x_n-a_n)$ happen?


Modern Warfare 3: Viewing stats online

Question: Is there anyway to view Modern Warfare 3 stats (such as KD, level, etc) online (via a browser, not using the in game options)? I'm particularly interested in something for Xbox 360.
Comment: I don't have an answer, but I remember huge talks about a premium subscription mode for *CoD*, and this is the most basic of features I'd expect if I paid a subscription. (not that I would).
Answer: From the Call of Duty Elite page, on which you can sign up for free and get the following:

PERSONAL Call of Duty® CAREER PROFILE
Track thousands of gameplay stats, personal bests, & trends across Call of Duty® Black Ops, MW3 & all future enabled Call of Duty® games.

Career Stats
Recent Match Summaries
Performance Tracking
Create Custom Leaderboards
Showcase Trophies & Winnings
Spec Ops Stats
Private Match Data
News Feed
Notifications / Activity
Facebook Friend Import

You can find videos and screenshots of the Call of Duty Elite service.  For example, a screenshot from the beta provides the data you're looking for:
Answer: The only way I've found is to compare with another player. Search for a player by name, then on the top right, click Compare.

Modern Warfare 3: Viewing stats online


Is there a way to do bitwise-shift operations in AGAL?

Question: If I encode all colors into one single float value (RGB) as:
<code>//Each Channels are from 0 - 255
red << 16 | green << 8 | blue;
</code>
How can I retrieve those color channels back in AGAL? There doesn't seem to be any bitwise operators.
Answer: You should not need to do this. Use BYTES_4 input in a vertex stream and your packed color will be unpacked for you automatically! Textures do the same thing. Constant registers are 4 float all the time anyway. You should start to think of colors as 4 vectors with 4 values in the [0..1] range.
That said, remember that a bit shift is just a division and truncation. x>>1 is the same as trunc(x/2.0). AGAL does not have truncation but fractional part, and trunc(x) is the same as x-frac(x) for positive x.
Answer: Here's a described case where I found bitwise operations in AGAL useful when unpacking stuff from RGB color channels. It assumes you already know the arithmetic equivalents to bit-wise operations tho:
http://forum.alternativaplatform.com/posts/list/10343.page#78542
A modulus can be done in AGAL where a%b = frc(a/b)*b . Since, for example, bitmask &1, &3 oeprations are simply modulus operations for 2 and 4 respectively (ie. &(modDivisor-1) ), you can use those. Shifting left/right is simply multiplication/division by power of 2 (2^n), where n is the number of bits shifted. Or '|' operations is simply addition, after shifting left yr digits, of course..


strtok not going through all tokens

Question: I'm trying to implement a shell as part of a school assignment, and I'm stuck on the file input/output redirection part.
More specifically, I've come up with a function which allows me to detect whether or not the command entered in specifies a '>' or '<' or even a '|'.
Ideally, if I enter ls -a > ls.tx', then the tokens ls -a and ls.txt should be returned.
My code doesn't do this, it only returns ls -a then stops.
My code is below:
/*commandLine is a char* taken in from the user, and is a null-terminated string */
int counter = 0;
parsedLine = strtok(commandLine, ">");
while (parsedLine != NULL)
{
    if (counter == 0)
    {
        strncpy(parsedCpy, parsedLine, strlen(parsedLine));
        parseCommand(parsedCpy, commands);
        counter++;
    }
    else
    {
        redirect->re_stdout = parsedLine;
    }
    parsedLine = strtok(NULL, ">");
}

I've tried it in another test file just to see if there was something wrong, but this test file (code below) returns the expected result (that is, ls -a and ls.txt)
    char myString[] = "ls -a > ls.txt";
char* parsed;

parsed = strtok(myString, ">");
while (parsed != NULL)
{
    printf("%s\n", parsed);
    parsed = strtok(NULL, ">");
}

Is there something that I'm just not understanding? I don't really see where I'm going wrong, since the code itself is nearly the same in both cases.
Comment: Note that `strncpy` won't zero terminate a string unless the zero termination is part of the source being copied. See `man strncpy`. It says: *Warning: If there is no null byte among the first n bytes of src, the string placed in  dest  will  not  be null-terminated.* That could be horsing something else up depending upon what `parseCommand` does.
Comment: Your problem lies elsewhere. Here's a modified version that works just fine: http://ideone.com/WLfQER
Comment: You should just do a `strcpy`. A `strncpy` doesn't really do anything for you if you're giving it the length of the source string, unless you're intentionally trying to avoid copying the null terminator. `strcpy(parsedCpy, parsedLine);`
Comment: @mbratch - Your comments are worthy of an answer.
Answer: Note that strncpy won't zero terminate a string unless the zero termination is part of the source being copied. See man strncpy. It says:

Warning: If there is no null byte among the first n bytes of src, the string placed in dest will not be null-terminated.

That could be horsing something else up depending upon what parseCommand does.
In this case, you should just do a strcpy. A strncpy doesn't really do anything for you if you're giving it the length of the source string, unless you're intentionally trying to avoid copying the null terminator. So you should use, strcpy(parsedCpy, parsedLine);.
Comment: Thanks a lot!

That turned out to be the answer that I was looking for! The non-null erminated string was doing some crazy things after it was passed onto parseCommand
Answer: I cannot see how  parsedLine is declared, but it needs to be handled explicitly and carefully.  i.e. make sure the pointer to that value is not changed except by strtok(), and make sure that it remains null terminated.  One thing I do when using strtok() for multiple calls, is to use an intermediate value to collect results, helping to keep the target buffer pure and unchanged except by strtok()
A small code snippet to illustrate:
char a[] = {"ls -a > ls.tx"};
char *buff;
char keep[80];

buff = strtok(a, ">");
    strcpy(keep, buff);
buff = strtok(NULL, ">");
    strcat(keep, buff);

This usage of strtok() is clean, i.e. it does not allow buff to be affected except by another call to strtok()
By comparison, this section of your code is a little scary because I do not know the output of the strncpy() which depends so heavily on the third argument, and can corrupt (place unexpected results into) parseCommand :
if (counter == 0)
{
    strncpy(parsedCpy, parsedLine, strlen(parsedLine));
    parseCommand(parsedCpy, commands);
    counter++;
}
else
{
    redirect->re_stdout = parsedLine;
}
parsedLine = strtok(NULL, ">");

Along the lines of keeping the target buffer pure, (even though it does not appear to be an issue here), strtok() is not thread safe.  If a function using strtok() is used in a multi threaded process, the target buffer is subject to any number of calls, resulting in unexpected, and perhaps even undefined behavior.    In this case using strtok_r() is a better option

strtok not going through all tokens


How to add left side padding for windows cmd?

Question: Is there any way to add left padding for windows cmd (Windows 10)? The output comes right after the windows border and sometimes it is hard to see the output clearly.
Comment: No answer here to your question, but some workarounds: Option 1) Place the CMD window on top of a MS Paint window with a black background.  You still get the border, but the overall color contrast may be easier on the eyes.  Option number 2) Press Alt-Space.  Choose Properties.  Look for options to change the font.  (See if you can adjust the font, the font size, and any option about making a font bold.)  Those are the easy options.  Option 3) Try other software, like PuTTY and/or SyncTerm, along with a server (running locally, listening on localhost's address(es))
Comment: A program could manually do padding (print a space before each line, for example) but I don't know of any way in `conhost.exe` (the terminal emulator program that hosts all command-line programs, of which `cmd.exe` is merely one such).
Comment: It would be easier to read if you change your colour scheme ...
Comment: Thanks, I have changed the color and font, but I would have been great if windows have an option for this in the cmd properties. Conemu is great and i use it now, but sadly it is not supported by the IDE geany that generates cmd output.
Comment: If you still haven't found any solution, use windows terminal application. In that, by default you have some left padding and it looks neat.
Answer: I believe you can do even more than that! since I cannot test it now..
Profile settings in Windows Terminal
Try to read this info text settings>Padding and set the profile for Windows Terminal.
Answer: I don't know if this particularly warrants an answer, this might get relegated to a comment, but for me I think @RaJ's comment on the original post is a good one. I had no idea this application existed, but Windows now has a program called "Terminal". Not cmd.exe or conhost.exe, but a separate application...I find it quite good. It houses command-line programs, has a few different abilities included tabbed sessions, and..... (drum-roll) for me it solves this "text squished up against the left edge" issue, as there seems to be a slight left-edge buffer for any and all (so far as I've used it) console output.
Example...

If you kinda look at it, you can see that where I did > echo hello in both the standard cmd.exe (foreground) and the Terminal application, "hello" in cmd is smushed right up against the edge...(hence why some of the previous output in the program I was working on has 1 space right before each line)...but in Terminal there's a bit of a gap between "hello" and the left edge.
In fact, there's a small gap even between the prompt and the edge. (Presumably/hopefully, all output and the edge.)
This Terminal application may be what I start using.
https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701


How do I get Content Types from my Authoring Site into my Publishing Site?

Question: I have a Page Library in my Authoring Site. The Pages are from the Content-Type myArticlePage. (I have filled all Custom SiteColumns of this ContentType in a view Pages with valid values, made a Index-Reset and a Full-Crawl [several times]). Also published this Page Library as Catalog. Next thing i tried to do is to make a publishing site. At this site i did insert a content by search webpart which i configured to populate all pages. I wanted to limit this by content type MyArticlePage but it does not show up in the list. How do I get this Content Type form my Authoring Site into my Publishing Site?
Answer: Solution: Provide the contenttype "myArticlePage" with a feature made in Visual Studio and activate the feature on the publishing site. This way, you can be sure that the SiteCollumns are the same and you can then use it as expected.
Answer: You should use a Result Source based on your Catalog to limit the scope of items returned by the Content Search Web Part. The result source is created automatically when you enable a list or library as a Catalog. For more information, see this page: https://docs.microsoft.com/en-us/sharepoint/administration/stage-9-configure-the-query-in-a-content-search-web-part-on-a-category-page#BKMK_AboutTheQueryConfiguration
If you want to make a Content Type available to multiple sites in a single site collection, define the Content Type at the Root Site Collection using Site Columns. Content Types created this way are available to all child sites in the same collection.
If you want to publish a Content Type from one Site Collection to another, you should enable Content Type Syndication on the source Site Collection. Here is an article about how to do that: https://support.office.com/en-us/article/publish-a-content-type-from-a-content-publishing-hub-58081155-118d-4e7a-9cc5-d43b5dbb7d02


Magento - 1 x SKU covering multiple SKU's - How to?

Question: I'm struggling a bit on how to sell a product that is sold individually, but also in a package including more products. Let me illustrate it as a real example:
Sample pack e-liquid (including 1x orange, 1x strawberry, 1x apple)
Customer can choose: strength: 0, 6, 12, 18, 24 (meaning that each flavor has 5 SKU's)
I can't figure out how to make this right - the problem is that the inventory should adjust itself accordingly whether the customer buys a product alone or in combination with other products (as in the case illustrated above - the Sample Pack)
Lets say we sell Orange with SKU: N1 individually it will automatically reduce the stock-level - no problem. BUT this should also happen when the same product is sold in a Sample pack. How can this be done right?
Hope anyone can help! I really tried to study several tutorials, but can't find any example helping me solve this problem.
If my explanation is not clear enough, please fire me additional questions. Thanks!
PS. If you want to see a real example, please check this link: http://din-ecigaret.dk/lille-rygestopspakke
This is a starterkit including including 3 different liquids (that customer can choose) The strength is predefined (16mg) as we at this given time, we can not mess up our inventory control by letting customers chose between several strengths - but it would be very convenient if for the customer if this could be possible. Again, that refers back to the question I'm asking - how can we do this right without messing up our inventory completely?
Answer: You could achieve this using bundle and configurable products.
Create configurable product for your first flavor:

create "orange" configurable product with "strength" attribute as configurable attribute
create children products for each strength (0, 6, 12, 18, 24) using "Quick Create" form

Then repeat this for each of your flavors.
Finally create "sample pack" bundle product and create "orange" as first bundle product option. Add all "orange" configurable product children (strengths) as its selections. You need to specifically add all children as Magento doesn't support adding configurable product as direct children of bundle product. Then repeat this for all products you want include in sample pack.
Now when customer buys bundle or configurable product, stock for children should be reduced.


What is UserPreferenceChangedEventHandler in C# winform applications?

Question: I found some of my winform application controls, such as DataGridView and ToolStrips, are referred to by UserPreferenceChangedEventHandlers. I have no idea what setting of the controls will generate such references and why such references keep my control alive in memory. How can I remove such references from that event? Thanks.
Answer: It is the delegate type for the SystemEvents.UserPreferenceChanged event.  This event fires when Windows broadcasts the WM_SETTINGCHANGE message.  Which typically happens when the user uses a control panel applet and changes a system setting.
Several controls register an event handler for this event, DataGridView, DateTimePicker, MonthCalendar, ProgressBar, PropertyGrid, RichTextBox, ToolStrip, NumericUpDown.  They typically are interested in font or cue changes and anything that would affect the layout.
SystemEvents.UserPreferenceChanged is a static event.  Registering a handler and forgetting to unregister it causes a memory leak, it prevents the control from being garbage collected.  The listed controls ensure this doesn't happen, they unregister the event handler in either the OnHandleDestroyed() or the Dispose() method.
You'll get in trouble when neither of those two methods run.  That will happen when you remove the control from the container's Controls collection and forget to Dispose() it.  While forgetting to call Dispose() is not normally a problem, it is a hard requirement for controls.  It is easy to forget too, controls are normally automatically disposed by the Form.  But that only happens for controls in the Controls collection.
Also be sure to call Dispose() on forms that you display with the ShowDialog() method, after you obtained the dialog results.  The using statement is the best way to handle that.

One more excruciating detail is important about the UserPreferenceChanged event, it is often the one that deadlocks your app when you create controls on a worker thread.  Typically when the workstation is locked (press Win+L).  Which cannot come to a good end when you use the controls I listed, the SystemEvents class tries to raise the event on the UI thread but of course cannot do this correctly when more than one thread has created them.
Also the kind of bug that can have a lasting effect, a splash screen for example can get the SystemEvents class to guess wrong about which thread is your UI thread.  After which it then permanently raises the event on the wrong thread.  Very ugly to diagnose, the deadlock is well hidden.
Comment: Thank you for the suggestion. I checked the code and it seems the problematic control was added to to control list of a panel and the panel was added to the control list of another panel and finally the root panel was added to the form's control list. From the memory profiler I can also see that the control's dispose method was called but the UserPreferenceChangedEventHandler still hangs. This is the part that I don't understand. Is there any other things that I missed?
Comment: Nice answer BUT as Steve mentions, sometimes even though you'll dispose the control, you still have this issue. There are several Connect entries about this problem such as: http://connect.microsoft.com/VisualStudio/feedback/details/469277/toolstrip-statusstrip-toolstriptextbox-visibility-and-userpreferencechangedeventhandler.


What is the IRQ out in I2C?

Question: On this MPR121 capacitive keypad (link), what is the purpose of the IRQ out?
Comment: You find that out by reading the datasheet for the IC which that board is built around.
Answer:
What is the IRQ out in I2C?

I'll give a slightly different focus from some other answers.
Remember that I2C Slaves cannot initiate an I2C bus transaction. Therefore if you have an I2C keypad or touch screen controller (or other HMI) how would the I2C Master know when to request data from the I2C keypad controller, to ask whether or not there had been a touch or release?
Three possibilities include:

I2C Master sometimes polls the I2C keypad controller, but not as a high priority.
Problem - Potential delay between the touch/release and the I2C Master polling the I2C keypad controller, leads to poor user experience, due to perceived "lag" (delay) between a touch/release and the machine's response.

or

I2C Master spends lots of time polling the I2C keypad controller, to minimise any lag between a touch/release and the I2C Master actually detecting that this has occurred.
Problem - I2C Master has fewer CPU cycles for doing anything else, since it is spending so much of its time polling the I2C keypad controller. The I2C bus also has reduced bandwidth for bus transactions to any other I2C devices, due to so many polls to the I2C keypad controller.

or

I2C Slave has an extra "interrupt" signal connected to the I2C Master (not part of the I2C specification, but this was introduced in SMBus). This allows the I2C Slave to alert the I2C Master and effectively say "poll me now!".
Problem - Requires an extra signal line between the I2C  Master and the I2C Slave.

As you see, your I2C keypad controller chose the last option (some I2C touch screen controllers do the same thing.) This is an example of the poll vs. interrupt choice, which occurs in computer science and elsewhere in life e.g. you could stay awake and continuously check the clock to see when to get up in the morning (polling), or you could set an alarm and let that wake you (interrupt).
Comment: Sam - thanks for link edits re Zoebel / Zobel paper. As a result of your input I found the full original paper. [My updated answer](https://electronics.stackexchange.com/a/108026/3288)
Answer: From the datasheet:

The MPR121 is an Inter-Integrated Circuit (I2C) compliant device with an additional interrupt that is triggered any time a touch or
  release of a button is detected.

Therefore the nIRQ output changes state whenever a touch or release of a button is detected.
Answer: Per the part used on that board's data sheet here, "This pin is triggered any time a touch
or release is detected."
Answer: Although the I2C is a multi-master bus which would in theory allow a device like a keypad to send data to the main controller any time a key was hit and the bus is idle, life for an I2C master is much easier if it is the only master on the bus.  Unless the (every) bus master is prepared for the possibility of another device requesting attention at arbitrary times, there won't be any way for a device like a keyboard to let anyone know when something happens, unless it is continuously and repeatedly asked.  If power consumption isn't an issue, a system could simply ask such devices about their state any time there isn't anything better to do.  Such an approach, however, would consume power continuously even when nothing of interest is happening.
In many cases, the simplest way to deal with this is to have such devices include a separate "interrupt request" pin which essentially means "I have something interesting to say--ask me about it and I'll tell you".  If multiple devices share the same output pin, the master will be able to go to sleep when nobody has anything interesting to say (and nothing interesting is happening anywhere else).  As soon as anything interesting happens, someone will assert the /IRQ pin, whereupon the master can start asking devices what they have to say.
It would be possible for the master to use a separate /IRQ input for each device, and then use those to determine which device it should talk to, but in many cases that isn't really needed.  If a device has nothing to say, asking it won't generally take very long.  What's important is recognizing the times where nobody has anything interesting to say, and minimizing power consumption during those times.

What is the IRQ out in I2C?


What is the energy functional for $\nu=5/2$ Moore-Read state?

Question: I am trying to do some Monte Carlo simulations for Pfaffian state from Fractional Quantum Hall effect. I am wondering what is the energy functional for $\nu=5/2$ Moore-Read state?
Comment: What do you mean by the "energy functional"? The energy as a function of the fermionic fields? Also, how do you do Monte Carlo for a Pfaffian system? Genuinely curious, because Pfaffian fermions have a horror of a sign problem--- if you could elaborate, perhaps somebody would know the answer.
Answer: You know an explicit expression for the unnormalized Moore-Read wavefunction in (complex) position representation
\begin{equation}
 \psi_{\mathbf{MR}}(\{z_i\})= \mathbf{Pf}\left( \frac1{z_i-z_j} \right) \prod_{i<j} (z_i-z_j)^2 e^{-\sum_k |z_k|^2/4}\quad .
\end{equation}
The energy of a wavefunction is given by the corresponding average value of the Hamiltonian.
\begin{equation}
E_\psi=\langle H \rangle = \mathcal{N} \int dz_1\dots dz_n \left|\psi_{\mathbf{MR}}(\{z_i\})\right|^2 H(\{z_i\})
\end{equation}
with the normalization constant
\begin{equation}
\mathcal{N}= \left( \int dz_1\dots dz_n \left|\psi_{\mathbf{MR}}(\{z_i\})\right|^2 \right)^{-1} \quad .
\end{equation}
In your case I guess the Hamiltonian only consists in a Coulomb term, thus its matrix elements in position space are
\begin{equation}
H(\{z_i\})=\frac{e^2}{4\pi\epsilon} \sum_{i<j} \frac{1}{|z_i-z_j|}
\end{equation}
since $||r_i-r_j||=|z_i-z_j|$.
The two integrals involved are computationally costly, but you can benefit from the Metropolis sampling method (http://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm), the most commonly used sampling method in Monte-Carlo algorithms I guess. It is very simple. In the latter you:

randomly choose an initial configuration $\{z_i\}$ (i.e. set of position). Its probability is $\pi_0=|\psi\{z_i\}|^2$.
generate a new configuration from the first one by randomly moving one of the particles. I note the new configuration probability  $\pi_1$.
the new configuration is accepted with probability 1 if it has a higher probability than the first one, and with probability $\pi_1$ otherwise.
continue until the desired accuracy is reached or maximum number of attempt have be tried out.

Every accepted move contributes to the integral with weight 1/"number of sample configurations used". Explicitly if $I$ is the quantity I want to compute, $N$ the number of configurations $i$ I keep, and $f_i$ the value of the integrand for configuration $i$,
\begin{equation}
I=\frac1N\sum_{i=1}^N f_i \quad .
\end{equation}
Good luck.


Did a 21 year old girl spontaneously change sex?

Question: Taipei Times
This paper reports that a girl in Myanmar spontaneously changed from female to male. Is that even possible?
Comment: Read up on [intersex](http://en.wikipedia.org/wiki/Intersex).
Answer: Spontaneous sex change does not occur in humans.
External genitalia are often ambiguous, the degree depending mainly on the amount of testosterone produced by the testicular tissue between 9 and 13 weeks of gestation. However, there are multiple classifications of hermaphroditism including simultaneous and sequential. Simultaneous hermaphroditism is when an adult organism has both male and female sexual organs at the same time. Sequential hermaphroditism, as described in the Taipei Times article, is when the individual is born one sex and changes sex at some point in their life. Protogynous hermaphrodites (as opposed to protandrous hermaphrodites) refer to organisms that are born female and at some point in their lifespan change sex to male. As the animal ages, based on internal or external triggers, it shifts sex to become a male animal. It is generally triggered based on mating opportunities related to reproductive success. It is observed in fish, almost exclusively.
Sequential hermaphroditism, especially of the kind described in this article, cannot occur in humans because the genitalia are formed in utero between 9 to 13 weeks gestation. The kind of sequential hermaphroditism described in the article has never been observed in humans. This condition can be found among a few species of vertebrates, mostly fish; and some species of crustaceans, including barnacles and shrimps.
Answer: Wartickler's answer sums up why a sudden over night sex change can't happen. I want to address a possible explanation to the event.
The only evince we have that the change has happened is that Than Sein's (the person in question) birth certificate states he was born a female. This can be easily attributed to him being an intersex1 person, as the article implies:

People privately concede Than Sein is a hermaphrodite. Several medical experts have examined him, and he awaits test results from the central women's hospital.

In some cases intersex people have ambiguous genitalia, even as adults, so a "mix up" on the birth certificate of an intersex person,  especially one written in Myanmar 21 years ago, is very plausible. The same happened for example with Sir Ewan Forbes, who was registered at birth as a female, but later formally re-registered his birth as male and married.
1: I realize that the issue of how to call people with sexual anatomy that doesn't seem to fit the typical definitions of female or male, is still going on, to the best of my knowledge "intersex" is the most appropriate and accepted term.
Comment: Isn't this really a comment, not an answer? And, anyways, this is no evidence. If the person had the anatomy all along (as is the only possibility) then are they really saying that the person didn't have an erection in the penis portion of their anatomy until 21 years of age? Implausible, at best.


Is Myopia Reversible/Curable?

Question: Myopia, meaning short sightedness is said to develop when eyes are exposed to excessive strain. But what I've failed to understand properly is whether myopia can be reversed or cured in any manner? When I was diagnosed with myopia in my childhood, my doctor told me that if I were to stare at far away objects for long periods, it would help cure my eyes. I'm not sure if what he said was to keep me off my computer, or whether it had some scientific background. Thus my question, is myopia reversible, naturally or through medication?
Answer: Myopia, or nearsightedness, occurs when the eye grows too long from front to back. According to the American Optometric Association,

Myopia occurs if the eyeball is too long or the cornea (the clear front cover of the eye) is too curved. As a result, the light entering the eye isn't focused correctly, and distant objects look blurred.

Instead of focusing images on the retina, the lens of the eye focuses the image in front of the retina. In a normal eye, the light focuses on the retina. However, in individuals with myopia, the eyeball is too long and focuses light in front of the retina.
Although genetics plays a major role in the development of myopia, it's development may also be affected by how an individual uses their eyes. For example, individuals who spend a considerable amount of time doing near-work such as reading, writing, and working on a computer have an increased risk of developing myopia. Although it primarily presents in school-aged children, adults may also develop the condition as a result of visual stress or as a complication of another health condition such as diabetes.
Can myopia reversible, naturally or through medication?
Although a cure for nearsightedness has yet to be discovered, several studies suggest it may be possible to at least control myopia by slowing its progression.
An article published by the American Academy of Ophthalmology: 'Eye Drops That Can Slow Down Nearsightedness in Children' references a clinical trial on atropine which was conducted to compare the safety and efficacy of different concentrations of atropine eye drops for the control of myopia progression. Results of the five-year trial indicate that a low concentration of atropine drops could potentially be an effective treatment for myopia.

In a five-year clinical trial, investigators there showed that 0.01 percent atropine drops safely slowed down the progression of myopia by about 50 percent with almost no side effects.

'The Safety of Orthokeratology - A Systematic Review' evaluates the ocular safety of orthokeratology (also known as Ortho-K or OK) for the treatment of myopia.

There is sufficient evidence to suggest that OrthoK is a safe option for myopia correction and retardation. Long-term success of OrthoK treatment requires a combination of proper lens fitting, rigorous compliance to lens care regimen, good adherence to routine follow-ups, and timely treatment of complications.

Another study analyzes the efficacy of atropine eye drops and orthokeratology lenses in controlling myopia progression and elongation of axial length. 'Overnight orthokeratology is comparable with atropine controlling myopia,' a retrospective study, included 105 patients (210 eyes) who wore OK lenses and 105 patients (210 eyes) who applied 0.125% atropine every night during the 3 following period.

The change in axial length per year was 0.28 ± 0.08 mm, 0.30 ± 0.09 mm, and 0.27 ± 0.10 mm in the OK lens group, and 0.38 ± 0.09 mm, 0.37 ± 0.12 mm, and 0.36 ± 0.08 mm in the atropine group for years 1, 2, and 3, respectively. Linear regression analysis revealed an increase in myopia of 0.28 D and 0.34 D per year, and an increase in axial length of 0.28 mm and 0.37 mm per year in the OK lens and atropine groups, respectively. Repeated measure ANOVA showed significant differences in myopia (p = 0.001) and axial length (p < 0.001) between the atropine and OK lens groups; in astigmatism, there was no significant difference in these parameters (p = 0.320).

Comparison of increases in axial length in relation to baseline myopia showed significant correlations both in the OK lens group and atropine group.

High myopia patients benefited more from both OK lenses and atropine than did low myopia patients. The correlation of baseline myopia and myopia progression was stronger in the OK lens group than in the atropine group.

Results of the study reveal that the OK lens is a useful method for controlling myopia progression even in high myopia patients.
In conclusion, although myopia cannot be reversed (yet), several studies concur that it is possible to control or slow the progression of nearsightedness.
Comment: I have been researching eyesight for a LONG time, and I have never seen a mention of orthok before, wow.
Answer: There appear to be both genetic and environmental factors for the development of myopia. The results from the Sydney Myopia study found that

RESULTS: Children who became myopic spent less time outdoors compared with children who remained nonmyopic (younger cohort, 16.3 vs. 21.0 hours, respectively, P<0.0001; older cohort, 17.2 vs. 19.6 hours, respectively, P=0.001). Children who became myopic performed significantly more near work (19.4 vs. 17.6 hours; P=0.02) in the younger cohort, but not in the older cohort (P=0.06). Children with 1 or 2 parents who were myopic had greater odds of incident myopia (1 parent: odds ratio [OR], 3.2, 95% confidence interval [CI], 1.9-5.2; both parents: OR, 3.3, 95% CI, 1.6-6.8) in the younger but not the older cohort. Children of East Asian ethnicity had a higher incidence of myopia compared with children of European Caucasian ethnicity (both P<0.0001) and spent less time outdoors (both P<0.0001). A less hyperopic refraction at baseline was the most significant predictor of incident myopia. The addition of time outdoors, near work, parental myopia, and ethnicity to the model significantly improved the predictive power (P<0.0001) in the younger cohort but had little effect in the older cohort.

In adults refractive surgery can ameliorate myopia but I'm not aware of any drugs that can do this in the adult.
It would seem prudent, especially in at risk populations such as east Asian, and if one has a parent with myopia, to spend adequate hours outside in sunlight to help prevent the development or progression of myopia.
https://www.ncbi.nlm.nih.gov/m/pubmed/23672971/

Is Myopia Reversible/Curable?


Why do several of my outlets not have power after replacing a GFCI?

Question: When using the microwave and a electric grill, I lost all power along two walls. I put a new GFCI outlet in, but it was not the problem. I checked the power and it shows real low voltage and the little light on the GFCI is on but normal appliances won't work. I took and tested another outlet and when I touch the tester to the wires the light on the GFCI would go off and on when I touch the wires. I shut off breaker and put tester on turn breaker on and seem to have plenty off power there.  Just lost now
Comment: A lot of breakers don't appear tripped. When the trip, they don't turn off like when you switch them off. Check all your breakers again turn all of them all the way off and then back on again. See if that fixes it.
Comment: Tried it but nothing . I can tell power gets to outlet because light on GFCI is on when breaker is on but it's very low voltage.  But thanks
Comment: You put the new GFCI in wrong.  Why did you do that before diagnosing the root problem?
Answer: How can you tell it's low voltage? What are your points of reference for measuring voltage:  hot to ground or hot to neutral? If hot to neutral, then the low voltage difference could indicate that the hot and neutral both have high voltage on them (e.g. 119.8V between hot and ground and 119.2V between neutral and ground which would show a low voltage difference between hot and neutral of only 0.6V). If the neutral has high voltage, this would most likely indicate an open neutral (i.e. a disconnect somewhere on the neutral leg of the circuit).
If all the other outlets on the circuit are working normally, I would check the ones closest by for a loose white (neutral) wire as they most likely daisy chained to feed the outlet you are currently having issues with. If so, I would guess the issue was probably due to plugging/unplugging something on these outlets that jostled an old "stab-in-back" receptacle connection loose. That said, without seeing your homes wiring diagram, it could potentially be anywhere on the circuit so my suggestion may just be a starting point toward finding the open neutral.
Comment: Thanks for your help ! But I think it's to much for me . I think I'll stick to building roads and bridges and leave the electricity  to the  electritons
Comment: @Rob  That is one of the smartest comments I've seen on DIY.SE . Far too many people try to take on electrical or plumbing or similar specialties without proper training, and bad things happen.
Comment: I tested other outlets in the house with a tester and it made the needle on the meter jump to halfway  but when I tested the outlets on the breaker that I'm having problems with it just barely moves . They do have 4 outlets plus the outlet with a built in breaker  they are all piggy backed to one another.
Answer: This is not as hard as many make it sound. With several outlets going out with a load it is most likely a failure of 1 connection because of a daisy chained circuit. The first outlet with no power or last one with power are the 2 locations to check if the circuit breaker is good. The problem can be on the black hot wire or the white neutral. figure out the location of the first non working breaker turn the power off and pull it out from the box you are looking for back stabbed connections that are loose (wires pushed into the back of the outlet) most common cause. a broken wire is also a possibility or one that has pulled loose from a wire nut. If all the connections are solid go to the first working outlet and do the same check. I have suggested this to folks that pulled the outlets and now everything works because the wire in the back stab made a connection (this outlet needs to be replaced) I only use back and side outlets that have a clamp and think back stabs should be outlawed this is the #1 electrical failure I have found over many years. A wire that was nicked at install can break at the nick but that is rare compared to the failure of back stabs. Give it a try you can save your self enough to go out to a nice dinner and now you know how to do it if other outlets fail in the future.


Should we do a mass migration of Data Sciency questions on AI that remain unanswered?

Question: My personal position is we should indeed take basic questions on any aspect of AI, so I'm not suggesting we end our experiment accepting implementation questions, but, where these questions haven't attracted an answer on AI, should we migrate to SE:Data Science or SE:Cross Validated?
Answer: No.
If a question is on topic, then it should stay here. Migrating is for high-quality, but off topic questions. This is why migrating a question involves closing as "off-topic". In this case, they're not off topic - they just haven't gotten an answer.
Now, why don't they have an answer? Probably because there's nobody on the site who knows how to answer it... or the right person just hasn't seen it. If nobody on the site knows how to answer a question, then the best thing to do would be to attract users who do know how to answer the questions, namely, "experts".
How do these "experts" find the site, though? Usually through content already on the site - it'll come up in a Google search or something. So to attract the experts, you need content, and if you send all the content away, then AI.SE won't get new users and the site will stagnate.
There's nothing wrong with having some unanswered questions around, as long as not all questions are unanswered. And if that happens, the site's got a big problem.
See also Meta.SE guidance on migrations.
Comment: A few of us in my lab are interested in reading your perspective on the AI SE outfacing description at https://ai.meta.stackexchange.com/questions/1430/what-should-the-ai-se-site-description-be.
Answer: Questions older than 60 days cannot be migrated, even by moderators. I don't think we can expect questions to always be answered in two months — from my experience on Super User, it's not at all unusual for months to pass before the right expert stumbles upon the question and solves it. We therefore have a bit of a catch-22 here. Even if we could ship out old unanswered questions, that's probably less than ideal for site growth; see Mithrandir's answer for more on that.


Keep track of intializations done in a function

Question: There is an initialization function in my app that does multiple inits. What is a good way to keep a track of inits done so that if init n fails all inits done before it must be cleaned up/de-init before exiting. Is there a good way this is usually handled?
Answer:
Is there a good way this is usually handled?

Yes. It's called RAII.

Resource Acquisition Is Initialization or RAII can be summarized as follows:

encapsulate each resource into a class, where

the constructor acquires the resource and establishes all class invariants or throws an exception if that cannot be done,
the destructor releases the resource and never throws exceptions;

always use the resource via an instance of a RAII-class that either

has automatic storage duration or temporary lifetime itself, or
has lifetime that is bounded by the lifetime of an automatic or temporary object

cppreference.com - raii

This is the customary C++ technique to handle this issue.
Comment: @candied_orange: by "already allocated resources" I meant nothing but what the OP wrote  in *"all inits done before (which) must be cleaned up/de-init"*. Thinking twice, I guess  my first comment was wrong, using smart pointers can probably handle all the cases I had in mind in an RAII style. It may, however, not fully obvious from the consise description you cited how to do this and how this counts as "RAII style" as well. This [SO post](https://stackoverflow.com/questions/395123/raii-and-smart-pointers-in-c) contains some examples which might be helpful for the OP.
Comment: Worth noting that it has been so since the 90s, and nowadays the standard library provides _a lot_ of facilities that implement RAII, such as the [smart pointers](https://stackoverflow.com/q/29372976/3258851).
Comment: @DocBrown I learned to follow RAII when manually creating initialization functions for member variables. I'm not sure what case I'm missing.
Comment: @DocBrown I'll admit my use of smart pointers hasn't been extensive but I thought the point of them was to alleviate the need for naked pointers to a resource precisely so that a destructor will still be called when it goes out of scope, thus still following RAII.
Comment: @candied_orange: well, I guess it is better to delete my comments, they seem to be too nitty. There are probably cases where one has to think about a way for keeping track of the already allocated resources in a constructor, but I guess those case are the rare cases where one needs to implement a destructor manually. In modern C+, the needs for this are rare, indeed.
Comment: @DocBrown I'd like to understand what your getting at even if it is nitty. I hate resource leeks. What do you mean by "already allocated" precisely?


PostgreSQL table for storing automation test results

Question: I am building an automation test suite which is running on multiple machines, all reporting their status to a postgresql database.  We will run a number of automated tests for which we will store the following information:

test ID (a GUID)
test name
test description
status (running, done, waiting to be run)
progress (%)
start time of test
end time of test
test result
latest screenshot of the running test (updated every 30 seconds)

The number of tests isn't huge (say a few thousands) and each machine (say, 50 of them) have a service which checks the database and figures out if it's time to start a new automated test on that machine.
How should I organize my SQL table to store all the information?  Is a single table with a column per attribute the way to go?
If in the future I need to add attributes but want to keep compatibility with old database format (ie I may not want to delete and create a new table with more columns), how should I proceed?  Should the new attributes just be in a different table?
I'm also thinking of replicating the database.  In case of failure, I don't mind if the latest screenshots aren't backed up on the slave database.  Should I just store the screenshots in its own table to simplify the replication?
Answer: If you specify the columns in the insert list like
INSERT INTO TABLE (Col1, Col2,..) VALUES (1, 2, ...)

it will be fine if you add columns later. The only problem might be if you start removing columns.
UPDATES should be fine, as you already specify the columns.
Ultimately you could start with an attributes table, but then you loose the explicit column types, and selecting from the table will be a maintinance and performance hassle.
So create the table as you have it, and then when inserting, make sure you specify the column names, then when you do change the table structure (adding new columns) this should not be an issue, unless they are set to be not null, in which case you might have to specify a default value.
Answer: A single table will be fine.
If you have a set of redundant data (like, say, test status, etc.) you might want to break those out in to little tables of their own (so you store 1 or 2 instead of "Passed" "Failed",  and can join to a status table).
If you add columns, no big deal. To ensure backward compatibility, make sure you always qualify with column names:
select cola, colb, colc from table...

insert into table(cola, colb, colc) values ('x', 'y', 'z')

Make sure you allow nulls, of course, in the new columns.
Few thousand rows is nothing to postgres.


Less noisy cell buttons on a table

Question: I have table where almost all of its cells are a button that works independently. When I add a 3D button-like design to each cell, the table becomes a large chunk filled with buttons and looks a little noisy. Is there a way to make the table less noisy while making it clearly recognizable that the cells are buttons? Some cells are not buttons, so there has to be some difference among the cells that are buttons and those that are not.
Comment: Are you sure it needs to be a table ? I would help if you gave an example.
Comment: Use hyper links instead of buttons
Comment: you could go the windows 8 route with flat square buttons
Comment: Please share your design so that we have a better idea of what you are referring to.
Answer: Tables are already very heavy visually so you can add some sort of icon next to the text to indicate that it is a link. i.e.

The advantages of doing this are:
- The user can quickly identify which cells have buttons
- The essence of the table remains
- The visual weight will look balanced
Comment: I would add the marker before the text in the cell, since in this view it 'looks' like it is point at the adjacent cell.
Answer: If the buttons take up the entire cell, you will reduce noise.  Granted, they will look less like buttons, but if you apply a gradient and different text alignment, it should be clear enough.  You could experiment with different fonts and font sizes too, but I'm not fond of the design results.
Here is a rough mockup of what I'm referring to:

I would still question whether there isn't a solution better than a table for this, but if it had to be a table, this is what I would test first.

Less noisy cell buttons on a table


No response after initial phone interview

Question: I had a phone interview with a startup company last week, I was speaking to the CTO. Towards the end of the interview he said next stage is a face to face interview and he will email me the details of it. The day of the interview comes and I still have not received any email regarding a location. I sent an email and no response. Any advice on how should I proceed?
Comment: And advice is to move on with another application.
Comment: Yes.  No follow-up means you've not been successful.  It's a bit of a shame that interviewers like to imply there's a further step and then not go ahead with their words.  It's usually because it's easier to say nothing than explain why they're retracting something they said in the interview.
Comment: Check your spam folder.  It's not likely, but it happens.
Comment: It's a bit of a downer but reality is a lot of folks rather not be placed in a spot where there might be potential confrontations. So they rather just say something uplifting, leave on a good note, and then simply ignore any future interactions to avoid explaining anything. It's a sad reality of job hunting but once you reach the "ignore" stages, then it is your cue to move on to other things.
Answer: Like a few of the comments have said, it's probably just best to move on. No contact before or on the day of a supposed interview is not a great sign. Most likely, as it is, the company did not want to proceed further with your interview process. Don't take that in a bad way, either; it happens, and it's a normal part of the job process.
Besides those points, if the company is that flaky about proper communication, it doesn't sound like the kind of place you would want to work anyway.
Comment: To be honest I didn't expect too much as the company was very new they only came into existence a few months ago, having worked in a startup environment before I have an idea of how hectic it can be at times. As you said if they can't communicate properly not a good indication of a ideal work environment.
Comment: Exactly. You don't want to work for a boss who tells you Yes because he doesn't want to tell you No.


Find command associated with configuration file

Question: Let's say I didn't know what ~/.bashrc is for. Is there a command that would tell me what the file is/does? Other than googling for an answer. The man pages have a files section, maybe there is a way to tell man: give me the man page for the command that has this file in its man page FILES section. Does something like this exist?
Comment: `man -K bashrc` does something like a full text search (I don't know the details). See for example http://unix.stackexchange.com/q/8982. Also http://askubuntu.com/q/116112. You can also just google for "full text search man pages".
Answer: If you have a package manager, you can query, which package owns a given file.
On Arch Linux, you can use
pacman -Qo FILENAME

On Ubuntu, Debian and other distributions with apt, you can use
apt-file FILENAME

To search man files, you can use zgrep
cd /usr/share/man
find -name *.gz | \        # List all *.gz files
while read line; do        # For each file:
  zgrep bashrc "$line" &&  # call zgrep with pattern and filename
  echo "--- $line ---";    # print filename if zgrep found something (&&)
done                       #

Comment: That won't work for most configuration files in the user's home directory, because they don't come in any package. `.bashrc` is one of the few for which this might work, because many distributions package an `/etc/skel/.bashrc`.
Comment: I'm marking this as correct, because it's probably what you should try first in this situation. If the package manager yielded no results, then move on to `grep` or `man -K` as Gilles answer suggests.
Comment: Also, `apt-file` is not installed by default (at least on mint). `dpkg -S .bashrc` can be used without installing anything.
Answer: Google is often the quickest way. However, if you want to search man pages, you can use the following to list (-w) all man pages of user commands (section 1) containing the text .bashrc anywhere:
man -w -s 1 -K .bashrc

For a file like .bashrc, this will turn up a few false positives in the form of man pages that suggest adding an alias or other setting to .bashrc. This command is for the man-db implementation of man, which is popular under Linux. There are other man implementations that don't have an option for full-text search; you can use grep instead after finding out where the man pages are located, e.g.
grep -F .bashrc /usr/man/man1/*.1

If you want to find which program accesses that configuration file, you can set up a monitoring system. You can use LoggedFS to monitor all accesses in a directory tree. Monitoring your whole home directory is likely to be extremely verbose, and LoggedFS can only monitor a directory tree, not a regular file by itself, so to monitor a specific file, move it to a directory of its own and create a symbolic link.
mkdir ~/monitored
mv ~/.bashrc ~/monitored
ln -s monitored/.bashrc ~
loggedfs -l ~/monitored.log ~/monitored

Watch the log file to see when a process accesses it. By default, the process name is included in the log.
Answer: I recommend @akrafs answer, but if that is not detailed enough; you can set up auditd to log which file accessed the configuration file.
More details in : http://www.la-samhna.de/library/audit.html
Comment: Inotify only lets you know when a file is accessed, not which program accessed it.
Comment: Thnx, you are right; inotify does not tell you the name of the process that accessed the file.


SharePoint online SCA for all sites in the tenant

Question: Is it possible to be a SCA for all sites in a tenant? Right now we are running into an issue of our SCA's having to be added to each individual site collection. We have the user accounts assigned to a role of SharePoint admin, do they need to be a global admin?
Answer: Unlike SharePoint on-prem, it is not possible to automatically apply at a higher level full control to all sites (i.e. a Web Application policy). With SharePoint Online, you will need to assign SCA on an individual site basis.
That can be automated, for example via a Site Design that calls a Flow which calls Azure Automate which runs the cmdlet Set-SPOUser -site $url -LoginName firstname.lastname@example.com -IsSiteCollectionAdmin $true. You can change the default site design to automatically do this.


How to install Gnome 3.4 (not 3.6) in Ubuntu 12.10?

Question: Whenever I install Gnome from software center I get Gnome version 3.6 but I want to install gnome 3.4 as all my extensions and themes work on it. How to do it? Would I get Gnome 3.4 if I install from software center in Ubuntu 12.04?
Answer: Try this http://www.noobslab.com/2012/04/install-gnome-shell-34-and-extensions.html , I think this is what you're looking for (if not, be more explicit)


How can I transfer the Product backlogs, EPICs, features etc.. from one organisation to another in Azure DevOps?

Question: I have one Org structure created in my Azure DevOps for Eg: Org ABC, under that I have lots of backlog items (epics, features, PB's etc..)
Now I have created a new Org Structure for which I am the owner for Eg: ORG XYZ.
I want to move some of the pending backlog items from previous Org ABC into my new Org XYZ. Can I do that or I need to create those backlog items from scratch in my new Org ? Please help and advise.
Answer: There's not a push-button solution to this, although it has been a long-standing customer request.
For the work items, you can use the export / import feature.

Export to CSV
Import work items

You may need to do the same with your cusom process if you didn't use one of the out-of-the box process templates in Azure DevOps. You can use the process migrator tool or the REST API to do this, so it's more involved than the work items.


Finding function name of caller function

Question: Function "Bob" calls function "Janice". Currently, I'm at an address in function "Janice" and can easily do idc.GetFunctionName(ea) to get the name Janice. However, I also want to get the caller function Bob's name. How would I go about doing this efficiently considering I'm currently within function Janice? Thanks.
Comment: Is it a debugging session or you trying to analyze the binary statically ?
Comment: And what architecture you are working with ? If it is ARM, you have an LR register which will show the return address in most cases.
Comment: Analyzing the binary statically was my goal and your answer covered it for me. Thanks
Answer: janice could have been called by bob or it could be a mob of other zillion prospective callers
you have to check each xrefto a sample showing the first xrefto below
note you may need to demangle in some cases
auto ip,fname,fxref,fxrefname,fxrefdname;
ip = ScreenEA();
fname = GetFunctionName(ip);
fxref = RfirstB0(ip);
fxrefname = GetFunctionName(fxref);
Message("ScreenEa is in function %s and it is called first by  %s\n" , fname , fxrefname);
fxrefdname = Demangle(fxrefname,GetLongPrm(INF_LONG_DN));
Message("ScreenEa is in function %s and it is called first by  %s\n" , fname , fxrefdname);

result as screenshot (see the actual code xref and the message window)
Answer: Generally speaking this question as it asked is a bit ambiguous.
The answer can be divided by 2 general parts, getting a caller in the debug session and determining the potential caller list during static analysis.
Getting a potential caller list during static analysis
As @blabb wrote in most cases it is possible and can be done with IDA scripting capabilities.
Here is IDAPython example which will print all references to the callee (which is equivalent to press x on the callee name in IDA) assuming that your cursor is within the "Janice" function:
    import idautils
    import idc
    print "Code references"
    for ref in idautils.CodeRefsTo(idc.GetFunctionAttr(idc.ScreenEA(), idc.FUNCATTR_START), 1):
           print ref
    print "Data references"
    for ref in idautils.DataRefsTo(idc.GetFunctionAttr(idc.ScreenEA(), idc.FUNCATTR_START)):
           print ref

Of course demangling should be applied to get a more human-readable name as @blabb wrote if needed.
It should be taken in account that this script (exactly as the pressing x on the callee) does not solve the indirect call issue, but shows all references to the function which may help to trace the indirect call.
Getting a specific caller during a debug session
This is a bit trickier and much more architecture dependent (for example in ARM you have LR register with return address which will help you in most cases if you stopped at the start of "Janice" function and it is not contaminated yet), you'll need to

Stop in the "Janice" function on the breakpoint
Determine the placement of return address
Conclude the specific caller from it

The script which will do it is a bit more complex and unfortunately I have no time to debug it for now,
so I'll just list the IDAPython APIs which will probably help you to solve the problem:
idaapi.get_func(ea) # get the function object of func_t type
idaapi.get_frame(pfn) #gets the function frame structure of struc_t type
idaapi.frame_off_retaddr(pfn) # AFAIK gets the offset of return address of the structure


What is the difference between a procedure-oriented and a problem-oriented programming language?

Question: This is one of the questions given to us an assignment and I've tried to search for this on the internet but didn't get the required answers. Would be great if examples are provided too :)
Answer: You might want to begin your search with domain specific languages:

A domain-specific language (DSL) is a type of programming language or specification language in software development and domain engineering dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique.

I've never heard of a problem-oriented programming language, but a DSL sounds similar to what I imagine a problem-oriented programming language might be.
Answer: Procedure oriented programming language describes the procedure of the program. The importance is given to the procedure. These type of language are difficult to learn. These languages uses files for storing and retrieving data. In comparison to problem oriented language, the codes are difficult to understand and to debug.
Example : C.
In similar way, in case of problem oriented language the importance is given to data. These language uses database to store and retrieve data. The codes are in natural language so its easy to understand. These programming language just describes what to do. Moreover, the system knows what to do.
I tried my best to make this easier to understand :)