How to disable arbitrary PHP 7 code in directory?

Question: Question at the bottom.
According to the official Mediawiki security guide, I have to
<Directory "/Library/MediaWiki/web/images">
   # Ignore .htaccess files
   AllowOverride None

   # Serve HTML as plaintext, don't execute SHTML
   AddType text/plain .html .htm .shtml .phtml .php .php3 .php4 .php5 .php7

   # Don't run arbitrary PHP code.
   php_admin_flag engine off

   # If you've other scripting languages, disable them too.
</Directory>

However with Apache 2.4.29 and PHP 7.1.15 I get
Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration

According to this post the solution is

You cannot use php_admin_value/php_admin_flag with PHP compiled as CGI
  (suPHP), because these options are only supported when PHP is compiled
  as a module of Apache. Feel free to use php.ini sections to change the
  settings (http://php.net/manual/en/ini.sections.php). Otherwise - just
  switch to mod_ruid2+mod_php and you'll be able to use php_admin_value
  in Apache configuration files.

Even when I have installed
dnf -y install httpd php php-mysqlnd php-gd php-xml php-mbstring mod_ruid2

I get the error, despite having mod_php and mod_ruid2.
Question
Can someone translate the above into what I actually need to do in my case in plain English?
Answer: For a single directory:
    <Directory "/Library/MediaWiki/web/images">
        php_admin_value engine Off
    </Directory>

For multiple directories under the same path:
    <DirectoryMatch ^/Library/MediaWiki/web/(images|other_folder|other_folder)>
        php_admin_value engine Off
    </DirectoryMatch>

There's also <LocationMatch "path"> - more directives here:
http://httpd.apache.org/docs/current/mod/core.html#locationmatch


reversing pyinstaller compiled exe

Question: i created some compiled binaries using different languages and tried to understand them using x64dbg, the compiled binaries produced by the c language/gcc compiler were pretty easy to understand, then i compiled a simple hello world program in python using pyinstaller, the output exe file was larger and was messier, i could not understand any of  the binary code in x64dbg, can anyone help me understand it? or provide some resources?, i am learning reverse engineering by compiling my own code and reversing it.
Comment: Welcome to RE.SE. There are numerous questions about the very same topic. Please also have a look [at them](https://reverseengineering.stackexchange.com/search?q=pyinstaller).
Answer: On macOS at least, the Python modules are prepended as zlib streams to the executable. I recommend you give a try at pyinstxtractor — using a recent version of Python — to attempt to decompress the zlib streams as .pyc files then a bytecode decompiler like pycdc.
Comment: i want to understand the binary/asm and what it does, not how to decompile it, thank you.
Comment: @Praveen the assembler/binary code is only the loader and python interpreter. your own code is stored the pyc stuff glued afterwards.
Comment: @masterX244 i cannot find the .pyc, i compiled it as a single exe
Comment: @Praveen those files are glued onto the exe, thats what the answer says where this comment is chained off
Comment: @masterX244 yea got that, but how do i know which is which?, like which part of the exe is the file?
Answer: PyInstaller binaries are basically self extracting archives that contain compiled Python code for the program and its dependencies.
The extraction code and also some of these libraries may be native binary files.
However, pure Python code does not compile into native assembly but into an IR that the Python runtime, which is included in the package, can run. As mentioned, these files have a .pyc extension.
This is marshalled code, in Python terms, and it can be un-marshalled into its IR representation using the builtin marshal module.
Loading a PyInstaller executable in a RE tool will only produce a generic archive-extraction code that is unrelated to the actual program code.

reversing pyinstaller compiled exe


If my connection to a website is unencrypted while using Tor is my IP visible?

Question: I suppose to those of you with technical expertise in this matter this question might seem obvious, so apologies as I am know nothing of this topic. Also what data would be possibly visible by someone potentially monitoring my connection to such a server?
Answer: No, your IP address will not be visible to the website, just the IP of the exit node.
The implication of the unencrypted connection is that your communications with the site can be monitored by the exit node. This could mean stealing credentials, or attempting to fingerprint you via other possibly identifying information (headers, screen resolution, font support, etc.).
They can also manipulate the traffic if they wish to, for example to deliver malware.
Comment: So speaking in tech dummy terms: this means that whoever is managing the exit node might decide to use my data for their purposes, but apart from the exist node no one else would be able to access the data right (of course assuming the exit node does not provide it to others)? So how large a security risk does this exactly constitute in your opinion? Hypothetically speaking while putting my imaginary tin foil hat on, does this make it possible for the government or other organizations to see your data specifically. I know a cliche question.
Comment: @Finviel Governments *do* run their own TOR exit nodes and could monitor unencrypted streams. That's why encryption is still very important when you use TOR. But, that's not what your main question asks. Your main question was about tracing the IP, which is a completely different topic.
Comment: any unencrypted data sent through TOR could be read
Comment: The intermediary Tor nodes can't view the unencrypted traffic because of the nested "onion" structure where one layer of encryption is removed after each hop. However, if the target site isn't using TLS then your data is visible to the exit node. Additionally, you really have no idea what the target site's data storage policies are, so if you're really paranoid, use end to end encryption with self-generated keys. Of course, that's only an option if your target is able to handle it.
Comment: Also the entire network connection from the exit node to the target server is susceptible to attack because SSL isn't being used.
Comment: @schroeder Well I hoped that my question was formulated in such a manner so as to imply upon the security implications of the entire matter, but it seems that I was not specific enough. Well, live and learn I guess.


The difference between absurd reasoning and contraposal reasoning

Question: What is the difference between absurd reasoning and contraposal reasoning?
To show that a language is not regular
Comment: What's the context in which you encountered these terms?  Can you tell us more?
Comment: I saw in different exercises, to shiw that a language is not regular we can use absurd reasoning or contraposal reasoning...
Comment: Ex for L=anbn.... People use absurd or contraposal... I want to know the difference with this two cases.
Answer: I've never heard those terms in the context of computer science.  When you mention "contraposal reasoning", I've never heard that term before, but I suspect that might be a reference to proving the contrapositive.  When you mention "absurd reasoning", I've never heard anyone use that specific phrase, but I suspect you might be referring to proof by contradiction, also known as reductio ab absurdum, which is Latin for reduction to absurdity.
These are general proof techniques. They're not specific to showing that a language is not regular.

General advice: I recommend that you try to avoid proof by contradiction.  It's a valid proof technique, but my experience is that it often leads beginners awry and causes them to make mistakes in the proof.  I recommend instead proving the contrapositive; it leads to more straightforward proofs where it is easier to avoid errors, and spot where you went wrong if you do make an error.
Comment: RAA in the form of "if $P$ holds then we can derive a contradiction, therefore $\not P$ holds" is fine. That's how you prove a negative statement like "$L$ is not a regular language". This case, however, is almost always conflated with "if $\not P$ holds then we can derive a contradiction, therefore $P$ holds", which is what "proof by contradiction" often refers to and I agree *this* form of reasoning should be avoided,. This applies to proofs that use $(\neg P\to\neg Q)\to(Q\to P)$ too (but not the converse). Many CS results are amenable to constructive proofs which are clearer.


Will a British MRes degree be beneficial for applying to US PhD programs

Question: I'm a BA(Hons) Sociology graduate with a 2:1 in my degree. I applied to some PhD programs in the US but was rejected with no reason provided but it was likely due to a lack of research experience outside of the BA degree, so I was wondering whether a taught MSc or an MRes would be more beneficial for my applications in the next PhD cycle in the US. I know US PhDs are more favourable for academic positions in the US but take longer due to completing masters in the process of obtaining the PhD. Will an MRes shorten the time for a PhD in the US or would it just provide me with the research experience I am lacking. My goal is to work over there after a PhD so completing a PhD in the US would be more beneficial for the future.
Comment: @Buffy I'd be careful about speaking outside your field. In my field, neuroscience, which for some people overlaps closely with clinical psychology, I'd bet every successful PhD applicant has undergraduate research experience. There are too many undergraduates *with* research experience to even bother starting to evaluate the ones that do not. This has changed substantially even in the last 20 years.
Comment: Actually it was probably not due to a lack of research experience. Few beginning doctoral students have any real research behind them due to the nature of the undergraduate program here.  A masters wouldn't be required for entry into a doctoral program. A masters would only shorten the time if it gives you the needed background for the (usually) required qualifying exams. See the canonical: https://academia.stackexchange.com/a/176909/75368
Comment: I was applying to clinical psychology and I'm guessing it's also due to the fact that the PhD programs are more difficult to get into than MD and law programs also didn't help my case
Comment: Note that letters are very important here. And medical programs may have very limited enrollments and a bias toward US citizens. (Not positive about all, but true of some, at least.)
Comment: Regarding LORs, I had a glowing letter from a professional at a private university in Ohio that I attended during a study abroad and 2 others from professors from my university, one being the head of department and another from a lecturer who is an expert within the field of substance use so I doubt it was for my letters but I could be wrong.
Comment: @BryanKrause, thanks. Live and learn.
Answer: Research experience is likely the most important thing holding you back; the title of a degree you enroll in or earn is not going to matter as much, the research experience you obtain will. If your goal is enrolling in a US PhD program, do whatever masters program will give you the best chance to be involved in research. You'll want to be able to talk about projects you've been involved in and your role. You do not necessarily need to have published papers, but you'll probably be behind if you don't have some at least at some stage of progress or with preliminary work that's been presented at conferences. You're in a fairly collaborative discipline, so it's okay if your projects are not yours alone. You'll be expected to work in a team but you should also get comfortable speaking on behalf of that team about your work from beginning to end, whether or not you're actually involved at all stages. I'd consider it a plus if you have experience with both the conduct and also design of research; it may be impossible to do both in your short time as a masters student but it's okay to participate in more than one project at different stages of development.
Completing an extra degree will likely not affect the duration of your PhD degree in the US in your field. Although people talk about US PhD degrees being a "masters plus PhD", it's not quite broken down that way. It's not as if you will spend exactly two years doing classes and then three+ years doing research, you'll start research right away and classes right away, and the classes will dwindle as you get towards the end. Having taken some similar classes before may let you skip some classes if your program approves, otherwise it'll just make those classes a little easier for you or let you take additional ones to broaden your base. Perhaps it'll make you marginally less likely to take longer than expected. You'll still be expected to spend a full 5-ish years on a research project.
All this is assuming you're aiming for a PhD program with a heavy research emphasis. Clinical psychology is a bit of an outlier as a PhD degree in that sometimes it is purely clinically focused on therapy and research is only an afterthought, more like a doctorate in medicine, pharmacy, dentistry, etc. I'm only vaguely familiar with the field so I can't offer much more than a suggestion to research programs and their expectations carefully before you apply.


Can you sniff packets from a router using wireshark?

Question: If you have a NIC that supports promiscuous mode is this possible? To my knowledge, I read that a switch uses a broadcast domain to broadcast packets, but if a router does not use this, is it still possible to sniff packets on your LAN?
Answer: Packets designated for the router will not propagate through the LAN network, at least not from the WAN side. All packets from inside the network will be available to other device as well, when put into promiscuous mode. A switch, which acts on MAC addresses, not on broadcast domains (thats a hub) can cause trouble indeed.
Comment: So if you have router with either two different LANS or 1 LAN and another VLAN, can a attacker sniff the packets if he's connected to LAN 1 on the VLAN? Or can he only inspect packets (in promiscuous mode" on LAN 1?
Answer: It is possible to sniff packets over LAN using a LAN Tap. These are passive devices that intercept traffic through the use of tools such as Wireshark.
However, these devices only capture traffic between two points, not always the entire network (as you may be used to with wireless packet sniffing). The devices uses three ports> Two of which, are passive and connect to the devices to the network, while the third port is for you to "tap" into the traffic between the two points.
Information on how these work can be found here and here.


Has a spend from a hybrid public key ever made it to the blockchain?

Question: If so, could you please give the TXID of a transaction that spends from a hybrid public key?
Answer: Surprisingly, there's a number of UTXO entries for the obscure hybrid key format. The transaction 657aecafe66d729d2e2f6f325fcc4acb8501d8f02512d1f5042a36dd1bbd21d1 makes a number of interesting P2PK outputs, two each of which are 0x06 and 0x07 respectively.
OP_PUSHBYTES_65 06da9be28d6e6266ddc0bc71b09032f3a810ffc917b5876e23a03c118f24f6a84dae4a9a5244fbf47860bc0760102d6bde6257bfcb7155d3dd66b97181119f98c5 OP_CHECKSIG

OP_PUSHBYTES_65 07d19ef6ba5b92b87078dba3a00df392efc16917defb2be08f22e41ce2873335705bff95fed463550f291d3b1fd559af11e432256a47e738572be3b74fc6f73ed0 OP_CHECKSIG

None are spent, but there's no technical reason for this, the outputs are valid.
Comment: Looks like a good way to waste btc on fees by adding more bytes to your transaction to me ;-)


Can a linear regression model without polynomial features overfit?

Question: I've read in some articles on the internet that linear regression can overfit. However is that possible when we are not using polynomial features? We are just plotting a line trough the data points when we have one feature or a plane when we have two features.
Comment: Hi Tim, in the examples you mention, 1 and 2 dimensions, overfitting via linear regression is not realistically an issue. If we're doing multiple regression, with, for instance, more dependent variables than we have data, then it can become an issue.
Answer: It sure can!
Throw in a bunch of predictors that have minimal or no predictive ability, and you'll get parameter estimates that make those work. However, when you try it out of sample, your predictions will be awful.
set.seed(2020)

# Define sample size
#
N <- 1000

# Define number of parameters
#
p <- 750

# Simulate data
#
X <- matrix(rnorm(N*p), N, p)

# Define the parameter vector to be 1, 0, 0, ..., 0, 0
#
B <- rep(0, p)#c(1, rep(0, p-1))

# Simulate the error term
#
epsilon <- rnorm(N, 0, 10)

# Define the response variable as XB + epsilon
#
y <- X %*% B + epsilon

# Fit to 80% of the data
#
L <- lm(y[1:800]~., data=data.frame(X[1:800,]))

# Predict on the remaining 20%
#
preds <- predict.lm(L, data.frame(X[801:1000, ]))

# Show the tiny in-sample MSE and the gigantic out-of-sample MSE
#
sum((predict(L) - y[1:800])^2)/800
sum((preds - y[801:1000,])^2)/200

I get an in-sample MSE of $7.410227$ and an out-of-sample MSE of $1912.764$.
It is possible to simulate this hundreds of times to show that this wasn't just a fluke.
set.seed(2020)

# Define sample size
#
N <- 1000

# Define number of parameters
#
p <- 750

# Define number of simulations to do
#
R <- 250

# Simulate data
#
X <- matrix(rnorm(N*p), N, p)

# Define the parameter vector to be 1, 0, 0, ..., 0, 0
#
B <- c(1, rep(0, p-1))

in_sample <- out_of_sample <- rep(NA, R)

for (i in 1:R){

  if (i %% 50 == 0){print(paste(i/R*100, "% done"))}

  # Simulate the error term
  #
  epsilon <- rnorm(N, 0, 10)

  # Define the response variable as XB + epsilon
  #
  y <- X %*% B + epsilon

  # Fit to 80% of the data
  #
  L <- lm(y[1:800]~., data=data.frame(X[1:800,]))

  # Predict on the remaining 20%
  #
  preds <- predict.lm(L, data.frame(X[801:1000, ]))

  # Calculate the tiny in-sample MSE and the gigantic out-of-sample MSE
  #
  in_sample[i] <- sum((predict(L) - y[1:800])^2)/800
  out_of_sample[i] <- sum((preds - y[801:1000,])^2)/200
}

# Summarize results
#
boxplot(in_sample, out_of_sample, names=c("in-sample", "out-of-sample"), main="MSE")
summary(in_sample)
summary(out_of_sample)
summary(out_of_sample/in_sample)

The model has overfit badly every time.
In-sample MSE summary
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  3.039   5.184   6.069   6.081   7.029   9.800

Out-of-sample MSE summary
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  947.8  1291.6  1511.6  1567.0  1790.0  3161.6

Paired Ratio Summary (always (!) much larget than 1)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  109.8   207.9   260.2   270.3   319.6   566.9

Comment: Thanks! This answered my question. The intuition why this happens is still lacking though, probably because I think about it in a geometrical way.
Comment: The geometrical intuition can be that you increase your dimensionality with more features.
Comment: Do not agree at all. If you generate data like that all you get is a nebula of points with no relationship among them. Run this `pairs(X[, 1:10], y)` and you'll see what I mean. So the first mistake You make is you're violating the underlying assumption of linear models - there's a linear relationship between X and Y. You build a model with no beforehand reasoning. Blindly generating random data and building a model just to illustrate the thesis - that's a big mistake.
Comment: @JakubMałecki That's the point. I blindly build a model that uses unrelated features and achieve excellent in-sample performance, yet, because the features are unrelated to the outcome, the out-of-sample performance is awful.
Comment: @Dave But it's not an issue with linear models. Any other ML algorithm would behave the same way since you estimate coefficients of a relationship when there's no relationship at all. So any algorithm you take will follow the training data and will find some estimations, and the estimations will be nothing more than a coincident. This is why you always get so awful results on the test set, no matter how many simulations you make. Shuffle your data, fit the model and you'll get a completely different values of coefficients. You're not modeling, that's my point.
Comment: @JakubMałecki The point is to show this happening for a linear model.
Answer: Ordinary Least Squares (OLS) is quite robust and under Gauss-Markov assumptions, it is a best linear unbiased estimator (BLU). So there is no overfitting as understood to be a problem, e.g. with neural nets. If you want to say so, there is just "fitting".
When you apply variations of OLS, including adding polynomials or applying additive models, there will of course be good and bad models.
With OLS you need to make sure to meet the basic assumptions since OLS can go wrong in case you violate important assumptions. However, many applications of OLS, e.g. causal models in econometrics, do not know overfitting as a problem per se. Models are often "tuned" by adding/removing variables and checking back on AIC, BIC or adjusted R-square.
Also note that OLS usually is not the best approach for predictive modeling. While OLS is rather robust, things like neural nets or boosting are often able to produce better predictions (smaller error) than OLS.
Edit: Of course you need to make sure that you estimate a meaningful model. This is why you should look at BIC, AIC, adjusted R-square when you choose a model (which variables to include). Models which are "too large" can be a problem as well as models which are "to small" (omitted variable bias). However, in my view this is not a problem of overfitting but a problem of model choice.
Comment: And that's because the measure of overfitting (AIC, BIC, out-of-sample MSE, etc) shows that model to be badly overfit.
Comment: Please refer to my simulation for an example of extreme overfitting by an OLS linear regression that satisfies the Gauss-Markov aassumptions.
Comment: @Dave: Well, good argument. I never saw this as a (genuine) aspect of overfitting as you would have it with e.g. neural nets. But of course model choice (variables to include) is instrumental. I was nudged by the question framing the problem in a one or two explanatory variable setting.
Comment: @Dave: Check the AIC, BIC for several variations of your model (which variables to include). I'm quite sure you will not pic the poor model described by you in this case.


Correcting canvas DPI in QGIS Windows

Question: I'd like my QGIS map canvas scale to be accurate, e.g. so if the scale is 1:10000, then 100m on the ground should show in 1 cm of screen.
My Windows laptop screen has 157 ppi (dpi) based on its physical dimensions and pixel resolution. That, of course, varies on the laptop and/or external screen.
QGIS however behaves as if the ppi is 96. This is if the overall system scaling (under Windows' Settings / Display / Scale) is 100%. If it is 125% (which improves font legibility), then QGIS uses a ppi of 120. 150% (fonts too large on all Windows applications) yields a QGIS canvas ppi of 144. These figures are confirmed by running iface.mapCanvas().mapSettings().outputDpi() from the Python console.
How can I adjust the canvas dpi? I've tried iface.mapCanvas().mapSettings().setOutputDpi(157.0) but that has no visible effect on the canvas, and .outputDpi() continues to return 120 (or 96).
Either a Python console solution or a startup.py solution would be fine. Or, some magic incantation in QGIS settings. Of course, something that magically identified the actual physical ppi (the 157 in my case) would be even better, but I doubt Windows supports that.
I've also tried fiddling with High-DPI compatibility settings in the Windows program options for the QGIS app. As expected, those affect the scaling of QGIS' UI fonts and icons, but don't change the canvas dpi.
This is not about changing the DPI of a print layout, which is easily customizable; it's about the canvas on-screen.
Editing to add: I've followed some breadcrumbs to https://stackoverflow.com/questions/16561879/what-is-the-difference-between-logicaldpix-and-physicaldpix-in-qt, and note in PyQGIS, iface.mainWindow().logicalDpiX() returns 120 while iface.mainWindow().physicalDpiX() is correctly 158. So I'm trying to find how to force the QGIS map canvas to set its DPI from .physicalDpi, or a custom figure, rather than from .logicalDpi. Ideally, it should keep UI font and icons scaled according to .logicalDpi (as is usual behaviour in all applications), and shouldn't force me to adjust .logicalDpi via operating system settings, which has side effects (on all open applications!) and allows only DPIs of 96,120,144,168 or 192.
Answer: After a lot of digging, I've figured out that as a workaround, one can run iface.mapCanvas().setMagnificationFactor(iface.mainWindow().physicalDpiX()/iface.mainWindow().logicalDpiX()) at the Python Console to set the magnification to compensate.
However, this appears to be a QGIS bug, or at least a design inconsistency. The on-screen scale should be accurate, and the necessary info is (usually) available through Qt. I have filed a bug report at https://github.com/qgis/QGIS/issues/41248, even though I expect it may be controversial.

Correcting canvas DPI in QGIS Windows


The meaning of the name of a movie

Question: I have watched a cool movie with the title 'The Houses October Built', but I cannot understand the name. What does houses October built mean?
Answer: It sounds like an odd and artsy title that personifies the month of October, referring to houses which were built by the month, I guess.
Answer: October is the month of Halloween, ghosts, scary things and haunted houses.
The Houses October Built - IMDB Description:

Five friends are stalked by a group of mysterious and disturbed individuals while on a road trip looking for the ultimate haunted house attraction.

People create haunted houses in October because of Halloween, and the rest of the year, those "houses" are turned back into normal spaces.
So you could say that October is responsible for why people build [haunted] houses.

The meaning of the name of a movie


Distro for low-RAM with most recent package versions

Question: Are there any distros that are designed to make a wide range of very recent (unstable) packages available on low-RAM systems?
Comment: Seriously, stop asking so many questions without accepting any answers. I ask you [again](http://unix.stackexchange.com/questions/92674/ocr-that-outputs-probability-data#comment140032_92674), please go through your old questions and accept those that solved your issue or answered your query. Otherwise all these questions remain open which is bad for the site.
Comment: How low is "low-RAM"?  If you mean 100 MB+, you can use any distro -- they will all offer the same opportunities to use or not use ram; the question in this case is more about how to configure the system.  Eg. no one thinks of ubuntu as "light" but an LTS server will run in <32 MB of RAM.  So to be clear: **They are all the same.  No one distro uses any more or less RAM than any other.**
Comment: Maybe you could also re-factor your older question: http://unix.stackexchange.com/questions/92524/low-ram-linux-distro-specifically-for-serving-static-sites
Answer: This kind of question gets asked a lot and it hinges on a fundamental confusion.
The amount of RAM you use is determined by the software you are running, not the distro you installed.  "But", you say, "Doesn't the distro I installed determine the software I am running?"
Yes, but in the sense that (for example), ubuntu uses a different init daemon than fedora.  I'm not sure which one of those uses the most RAM, but if you have a look at top -p 1 (the pid of the init daemon is always 1) you'll see why no one would care one way or the other.  You won't find a distro that manages to save on RAM by not using an init daemon.
Pretty much every general purpose distro will provide you with the exact same opportunities to run mem heavy or mem lite software and that software will be the exact same on ALL distros.  The distros do not write the software.  They just configure and package it.
Distros like Arch or Gentoo, which permit for much more customization during install, in a sense make it easier to install minimal systems which do not occupy much disk space.  However, it might be observed that since:

The custom install process with those distros is quite a bit more complex and time consuming than it is with distros that use a less flexible installer;
The process of removing components is relatively easy on all of them;

for most people, taking a fat (e.g.) Ubuntu install and paring it down to the point where it is equivalent to a minimal Arch install will probably take less time than just installing a minimal Arch.
This is not to knock Arch or Gentoo.  This is just to say that using them "because they are lighter" somehow is a misconception.  That's not why they exist and that's not a justification for choosing them over something else.
Further, running the same software stack on Ubuntu or Debian or CentOS or Arch or Whatever will result in the same memory usage.

If you want to minimize RAM usage, there are two scenarios to consider:

I don't want/need a GUI.
I do want/need a GUI.

If the scenario is #1, then you're set.  A full fledged linux system without X will fit in ~20-25 MB of RAM, whether it's ubuntu or fedora or arch or whatever.
Of course, if you are running services, those are additional -- but they will be the same addition regardless of distro.
If the scenario is #2, then you want to use a lightweight DE (desktop environment), or a stand-alone WM (window manager).  There are configurations with the latter which can run in <100 MB.
Answer: You don't want unstable on a server, at least on a production server. If you want recent and less heavy, try Debian unstable or Arch.
Comment: I think the "heaviness" you refer to here is disk usage and not ram usage -- there is nothing special about debian or arch in that respect.  Also, debian is usually not considered the most up-to-date distro around.
Comment: @goldilocks he said `unstable`.


applicationDidFinishLaunching not invoked

Question: In my appdelegate.m, the applicationDidFinishLaunching is not invoked.
I have read that this is due to the fact my "Application"'s delegate is not properly connected, but I don't know how to connect it. What I do is right-clicking on Application from the XIB file, and drag the delegate outlet somewhere... but don't know where.
Any help appreciated.
Thanks !
Answer: In your MainMenu.xib, make sure there's an instance of your AppDelegate class. To make one, drag a plain object (blue cube) into the list and set its class name to AppDelegate (or whatever your app delegate class name is).
Also in the MainMenu.xib, to connect it, drag a connection from the Application object to your AppDelegate instance (the blue cube) and connect it to the delegate outlet.
Done.
Comment: You saved me a lot of time, thanks ! In addition to that I had to link it to the File Owner.
Comment: In Xcode 6 (haven't tested earlier), it seems only the File Owner needs to be linked, not Application object.
Comment: File's Owner is indeed the Application in MainMenu.nib files.
Comment: The conceptual hurtle to leap is understanding a nib/xib is a collection of *instances* of freeze-dried objects. In a running app, there's usually only one of each of the major architectural elements like your NSApp instance and its delegate. Document controller/view assemblies are the obvious exception but even then, a separate "document" prototype xib contains one object representing the doc instance, a main window, etc. You don't, however, include a pre-baked instance of a model object in a xib (like a Person), since this is variable (there's usually no one Person). Key concepts. :-)
Comment: Thanks for this! I already spent a day trying to figure out why my login helper stopped working all the sudden. I accidentally deleted and later created a new MainMenu.xib
Answer: Here's something to try if you've updated to Swift 3:
Take a peek at your "AppDelegate.swift" and make sure the relevant line looks like this:
func applicationDidFinishLaunching(_ aNotification: Notification) {

as opposed to this:
func applicationDidFinishLaunching(_ aNotification: NSNotification) {

I just updated an app, and didn't think to check. The result was that my app launched, but the relevant method was never called. Obviously, you should then check for other functions you have that take Notification objects.
Comment: Thank you, this was what fixed my problem, coming from a Swift 2 app.
Comment: I found I also had to do a Product>Clean


Meaning of eigenvalues/eigenvectors of matrices

Question: I am supposed to find the geometric meaning of eigenvalues/eigenvectors of certain matrices such as reflections about x= y, rotaions, shears, etc. How would I go about this? The first question is a reflection about x = y. Would this just mean that the eigenvalues and vectors are switched? I am not really sure about how to go about this question.
Answer: Find the lines through the origin which are sent into themselves (not necessarily pointwise) by the operator $T$. Any nonzero vector on such a line is an eigenvector. Conversely, every eigenvector lies on a line which is sent to itself by $T$.
For example: for a reflection, there are two lines which are sent into themselves: the axis of reflection, which is mapped identically into itself by $T$ (eigenvalue $1$), and the axis perpendicular to it, which is mapped into itself by a reflection through the origin (eigenvalue $-1$).
Comment: Why are we talking about the axis perpendicular?


Best practices around creating LARGE poster image 24X36

Question: I need to create a large image (for print) at 24X36 inches.  It is a seating chart poster for a wedding.  What settings in Photoshop would I set for an image this size (DPI, etc.)?  I would need it to remain sharp when printing so suggesting some Export options would be great too.
Comment: Don't use Photoshop for this. Use InDesign or Illustrator. A 24x36 image at 300 dpi is going to be 200+ MB. InDesign and Illustrator will give you clean lines at any size when used properly.
Comment: Linked: http://graphicdesign.stackexchange.com/questions/487/what-dpi-should-a-large-format-artwork-for-print-be-done-at
Answer: It will be inkjet printed, so 300 ppi will give you plenty of quality. If the file size on disk gets excessive, 150 ppi would also be fine, but for a seating chart that's unlikely to be an issue.
Export to ("Save As...") PDF using "High Quality Print" as the preset, and you'll be fine for printing at your local FedEx/Kinko, etc., or on a desktop printer if you have one that will print 24" paper. Uncheck "Preserve Photoshop Editing Capabilities" to keep the file size down (but don't save over your PSD, just in case!).
If you're taking it to a digital print shop, ask them if they prefer the PDF in RGB or CMYK. If they say CMYK, use "PDF/X-1a:2001" as your PDF export preset. Otherwise use "High Quality Print."
Comment: For a seating chart, even with a beautiful background and so on, which I guess you're planning, the color mode can be RGB or CMYK so long as whoever will print it knows what they're doing (and you should ask which will reproduce better on their equipment). By "bitrate" I think you mean "bit depth." 8-bit is fine. You won't run into a printer that can reproduce 16-bit color, so it's not anything to be concerned about.
Comment: What about Color Mode and bitrate?


Mass-mismatch in the low-lying states of the bosonic string

Question: $\newcommand{\ket}[1]{\left|#1\right>}$I've recently been studying the quantisation of the bosonic string (using GSW as my main text). However, I have some issues which I believe should be pretty straightforward, but I can't seem to work out!
We derive the spectrum of states of (open, for example) strings. The masses of these states are given by the mass operator $M^2 = 2(N-a) = 2(N-1)$ setting $\ell = 1$, $\alpha' = \frac{1}{2}$, and with $N$ the 'level/number' operator. We act with this on the space of states generated by the sequential application of any of $\alpha^i_{-n}$ onto the ground state $\ket{0;k^\mu}$ (which we understand to exist from something to do with the Stone-Weierstrass theorem). This is the tachyonic ground state.
This implies that (in light-cone gauge):
$M^2\ket{0;k^\mu} = -2\ket{0;k^\mu}$
This means that $k^\mu k_\mu=2$! That would be fine - but now I apply $\alpha^i_{-1}$ to my (string) vacuum state and create a level $N=1$ massless photon-like particle. The momentum operator commutes with the above creation operator, and so the state still has the same 26-momentum. However, it should also now have mass $M^2=0$. I don't see how these two statements can be coherent. Is it simply that if one attempts to create a state with the incorrect 26-momentum for its mass, the result is unphysical and so decouples? I have found neither hide nor hair of such a result or argument in GSW, Tong, etc.
What am I missing? Thanks very much...
Answer: You've demonstrated that the creation operator $\alpha^i_{-1}$ can map a physical state to a non-physical one. There is no contradiction. If you've seen the BRST approach yet, a succinct way to phrase this is that the action of the oscillators does not preserve the subspace of BRST-cohomology classes (i.e. physical states).


Proving :$ \frac{\textrm{d}}{\textrm{d}x}\int^{g(x)}_{h(x)}f(t)\textrm{d}t =f(g(x))g'(x)-f(h(x))h'(x). $

Question: How to prove that :
$$ \frac{\textrm{d}}{\textrm{d}x}\int^{g(x)}_{h(x)}f(t)\textrm{d}t =f(g(x))g'(x)-f(h(x))h'(x). $$
Answer: Let us first assume that $f$ has a primitive, which we shall refer to as $F$. By the fundamental theorem of calculus, we have:
$$\int_{h(x)}^{g(x)}{f(t)\:dt}=F(g(x))-F(h(x))$$
By the chain rule, we have:
$$\frac{d}{dx}\left(f\circ g\right)=f'(g(x))g'(x)$$
As we know that $\frac{d}{dx}F(x)=f(x)$, we have:
$$\frac{d}{dx}\left(F(g(x))-F(h(x))\right)=F'(g(x))g'(x)-F'(h(x))h'(x)\\=f(g(x))g'(x)-f(h(x))h'(x)$$
Which means that:
$$\frac{d}{dt}\int_{h(x)}^{g(x)}f(t)\:dt=f'(g(x))g'(x)-f(h(x))h'(x)$$
Q.E.D.
Answer: Use the Fundamental Theorem of Calculus and the Chain Rule.
More informally, in order to find our definite integral, we find an antiderivative $F(t)$ of $f(t)$, and then "plug in." Our indefinite integral is equal to
$$F(g(x))-F(h(x)).$$
Differentiate. We get $g'(x)F'(g(x))-h'(x)F'(h(x))$. But $F'(t)=f(t)$.
Answer: To add some variety to these answers, I propose to split the integral into two, by taking advantage of the additivity over disjoint unions of interval. What I mean is:
$$\frac{d}{dx}\left(\int\limits_{h(x)}^{g(x)}f(t)dt\right)=\frac{d}{dx}\left(\int\limits_{h(x)}^{x_0}f(t)dt+\int\limits_{x_0}^{g(x)}f(t)dt\right)=\frac{d}{dx}\left(\int\limits_{h(x)}^{x_0}f(t)dt\right)+\frac{d}{dx}\left(\int\limits_{x_0}^{g(x)}f(t)dt\right).$$
Then we swap the extremes of integration in the second integral and get a minus. Now, I assume we know how to calculate those derivatives, and to prove they are $f(g(x))g'(x)$ and $f(h(x))h'(x)$, for which you can still use the other answers. SO this approach is building on a simpler case: the one with one extreme fixed and the other one moving with $x$.


Is goat cheese ravioli freezable?

Question: Can I freeze ravioli filled with goat cheese and caramelized onion, even when the package advises not to?
Comment: I've never frozen goat cheese, but if it undergoes syneresis (the liquid being squeezed out), it's possible that the cooked ravioli would be more like cottage cheese instead of nice and creamy.  I think that ones that are intended to be frozen use starch as a stabilizer
Comment: I'd like to see the label, or at least the exact warning & ingredients list. It seems people are not considering all the possibilities when answering this.
Answer: It's not going to make it dangerous if you're sensible.  The texture might suffer a bit, but it will still be edible - better than wasting it.  Defrost in the fridge before cooking, not at room temperature.  I have frozen similar products in the past, and honestly don't think they deteriorated at all - certainly less than overcooking.
Mostly when manufacturers say products aren't suitable for freezing, they're worried about 2 things:

trying to cook something (probably raw) from frozen that will seem done when it's not, and risking food poisoning.  Defrosting before cooking, under safe conditions, solves that.
the quality suffering, and customers complaining.  A few foods suffer badly, like cream, but most don't
Comment: @Hobbamok quite possibly, especially if the cheese is in one lump. Harder cheeses freeze better than soft, IME, and goat tends to be soft. I've frozen home made goats cheese varenyky (pierogi), which are similar (though of course a different dough) but I mixed the cheese with the other ingredients and found no issues on cooking. Anyway, just a texture/quality thing.
Comment: I feel that goat cheese does suffer a bit from being frozen. I doubt that it'll be anything major given it's already worked into a ravioli but that might be why it's on the package
Answer: Based on tons of experience with freezing premade ravioli from Costco, New Seasons and Lucca:
Most ravioli can be frozen.  It's pretty much the best way to keep them if you're not going to eat them within a few days.  The only exception would be ravioli that have an exceptionally wet filling, because those may burst -- but goat cheese and onion ravioli would not normally be that wet. If the ravioli have very thin pasta shells, that might also be a problem.
If you've frozen them, you should boil them directly from frozen when you cook them. Cook them for around 3 minutes longer than you would fresh.  Like usual, you can tell they're done because they're vigorously floating.
This means that you might want to repackage them before freezing if they're not well-separated or well-floured, just to make sure you can get them apart.  I recommend making layers with sheets of waxed paper or plastic wrap, and maybe dusting them with a little extra flour.  Some brands, like Costco, oil their ravioli before packaging and can therefore be thrown straight in the freezer.
You do not want to thaw them in the fridge.  On thawing, the ravioli will tend to become clammy, and may stick to the packaging and each other and be inseparable without tearing.
Comment: The problem is that pasta dough that's been frozen and thawed becomes both stickier and more fragile.
Comment: Of course the ones you get may be a little different to mine, but if I was going to cook them from frozen I'd *really* want to freeze them spread out rather than having one big lump, probably using one of the methods you suggest, or oiling them myself.  But cooking from frozen the pasta tends to overcook, IMO
Comment: Yes, but the alternative of overdone pasta so the filling is hot through,  seems worse to me
Comment: Has not been my experience.
Comment: @ChrisH you can finish it in the sauce, so the center has a chance to warm through.  I wouldn't use it for an uncooked meat filling, but it might be okay for less risky fillings
Comment: @Joe good plan if you're going for a proper sauce. With a tasty cheesy filling I sometimes just put a little olive oil over, with garlic, herbs, bkack pepper or similar

Is goat cheese ravioli freezable?


Calculating time based SLA

Question: I am attempting to create a workflow in SPD'13 that will track a SLA for a given task that if it takes longer than 2 days then prompt to send an EMAIL so that it notifies the team they are in breach.  Any thoughts or existing threads would be helpful.  Thank you, Jesse
Answer: If the process is a simple as described, then create a workflow that:

Starts when the item is created.
Waits 2 days. (Pause for Duration action)
Checks the value of the "Status" (or other) field. (If condition)
If status is not what it should be, send an email. (Send an Email action)
Exits.
Comment: I will give that a try, I like the simplicity of that.

Calculating time based SLA


I Got Rhythm changes

Question: Why are the changes in the tune "I Got Rhythm " considered so important in learning Jazz standards?
Comment: @Tim - I've seen several examples of contrafacts (same chord progression, new melody) of "I've Got Rhythm", including some from students who claim they had to make them for jazz class.
Comment: It's not the only one, by any means! Who said it is so important? Not denying that, though.
Comment: @Dekkadeci - that idea of re-tuning a set of chords is a good old idea. To a degree isn't that what every jazz band does between the first and last verses of just about every song?! And let's face it, it's happened thousands of times with a certain sequence which lasts just 12 bars!
Answer: First, "I Got Rhythm" is one of the most well known classic songs from the American Songbook which should be high on the list of tunes one should memorize. It is in a bright tempo, has a lot of harmonic movement in the A sections and a string of dominant chords going through part of the cycle of 5ths in the bridge. These elements challenge the player to develop advanced improvisational skills that will serve them well when playing other jazz and American Songbook standards.
Another reason is the harmonic structure has become a template for dozens of other songs such as Cottontail, Lester Leaps In, Anthropology and many more. By knowing this tune you will also know how to improvise over the many other tunes that are based on this harmony. When on a gig or at a jam session it is almost inevitable that this or one of its many spinoffs, or contrafacts (if you want a fancier term) will be played at some point.
Comment: Pretty well II V I changes. So why would it be more important than, say, Autumn Leaves, or All the Things You Are, to name two of many such? +1 by the way!
Comment: Well I wouldn't say MORE important but the mastery of the fast meter I vi ii V progression is an important skill for jazz players, as is the ability to cycle through dominant chords. Both Autumn Leaves and All the Things are very high on my list of must know tunes by the way. Autumn Leaves is there for its elegant transitions back and forth from relative major to minor. All the Things...do you have a few hours? A true masterpiece.
Comment: Perhaps potential jazzers need my two first (bit slower!) before the baptism by fire?
Comment: @Tim, I neglected to tag you on my previous comment, I assume you got a look at it. I like to think of them as different food groups in a balanced diet, they give you different nutrients but they each are important in their own way.
Answer: That tune, and those changes, contain two specific progressions that are common in all Western music.  To be fair those changes existed probably 100s of years before that tune and the popularity of the tune made them forever associated with it!
The two progressions are (1) the I --> vi --> ii --> V7, which is almost identical to I --> vi --> IV --> V and is the progression for Heart and Soul, and many rock ballads, and (2) III7 --> VI7 --> II7 --> V7, or the circle of 4ths.  This latter one can be found in 100-150 yo classical guitar pieces and standard work books so I doubt that I Got Rhythm is really the beginning of this pattern.
There is a third progression, v --> I7 --> IV --> iv --> I.  But IMO most of that is just  repeat of the first moved to the IV chord.  The resolution IV --> iv --> I is very nice and distinct from the V7 --> I.
Both of these progressions embody a standard movement found Western classical movement.  The first is a subset of a larger progression called circle progression which goes like...
I --> IV --> vii --> iii --> vi --> ii --> V --> I
This follows as closely as possible the circle of 4ths without leaving the key signature, the deviation being the jump from IV to vii, an aug 4th (dim 5th).  So I would really say that the importance or perceived importance of I Got Rhythm is a red herring.  The progressions are used every where and have been in use for a lot longer than that song is old.  Again, perhaps the popularity of it is what made it stick.
I would guess that about half of the tunes in the Real book (or more) have these changes.
But another equally important set is the 12 bar Blues, and other variations of the Blues (8 bar, 16 Bar, etc).
One could ask "Why are the changes to The Lemon Song by Led Zeppelin" so important in Rock.  Analysis would show that (1) the song is really an old Blues standard, (2) that those changes have been in use for a lot longer than Zep existed, and that many other artists before and after used them and probably never heard that song.
Answer: Two reasons:
Those chord changes have been adapted by jazz musicians as the harmonic basis for other songs.
The chord progressions are common in tonal music.
The basic patterns involve roots by descending fifth. ii7 V7 I in the first part and a chain of secondary dominants V7/vi V7/ii V7/V V7 in the second part. Both are common progressions in tonal music. In basic harmonic terms you can't tell from those symbols if you're dealing with Mozart or Gershwin!
Another interesting point about the song is the use of a French augmented sixth chord. This chord appears at the end of the second part (the "old man trouble..." part) in my copy of the tune from Girl Crazy. In classical style the augmented sixth chord resolves to a dominant chord. Labeling the song in the classical style it would be F: Fr+6 V7 | I. In jazz harmony that augmented sixth chord is called a tritone substitution and it's often seen between a ii and I chord as ii7 bIIalt7 | I6 or something similar where importantly the resolution is to a tonic rather than a dominant. Gershwin used the chord in the "classical' manner where it resolves to a dominant.
Lots of variations on basic rhythm changes exist and many use tritone substitutions, so it seems worth mentioning the connection to the augmented sixth chord appearing in the original song.
Of course I don't literally mean you couldn't tell the difference between Gershwin's harmony and Mozart's. Gershwin uses inversions, added ninths, sixth, chromatic embellishments, etc. that Mozart didn't. But the basic chord qualities and root progressions are the same.
So, rhythm changes are important because they are used in a lot of jazz songs. But they are also important, because on a basic level they are chord progressions ubiquitous in tonal music.

I Got Rhythm changes


In what container should I put lemon water for storage?

Question: I have a polypropylene water container and some large PET bottles. I don't know if it's OK to put lemon water in there. I read from somewhere that you shouldn't put lemon water in plastic or aluminum as acid in lemon can leach contaminants out of the container. What containers are safe for storing lemon water?
Answer: Both glass and stainless steel are non-reactive and should be fine.
Answer: From recipetips.com

Stainless steel, glass, enamel, and glazed ceramic are examples of
  non-reactive materials that are not affected when food items such as
  tomatoes with a high acid content come in contact with the surface of
  the utensils or equippment.
Answer: Are you talking about mixing lemon juice with water? Or are you talking about a commercial sports drink such as: True Citris Lemon Drink?
If you are talking about the mixed drink, the product's website indeed do warn the consumer against using a plastic water bottle for the mixed drink. However it actually recommonds using the lightweight aluminum water bottles.

Turns out we should have kept that metal container, because the one-time-use plastic bottles that water, soda and juice come in are proven to leach DEHP, a carcinogen, into the liquids. And old-style Nalgene bottles (those wide, smoked plastic ones that a lot of camping types love) are also no-no's. They leach BPA, a synthetic hormone that may cause cancer.

If we are talking about lemon juice (from the actual fruit) mixed with water, one should stay away from storing any type of acidic food in metal containers. There are of course some metals which are safer to use(less reactive to the acid) but as a rule of thumb you shouldn't. Aluminum is however reactive to the acid and so you should avoid using aluminum bottles.
To actually answer your question, check on the bottle's website to see if they say it is BPA free. If it is indeed BPA free, then you may use the bottle to store the lemon water. If not, then use a glass jar. This of course is impractical if you intend to carry that bottle with you on a jog or something. Another option is to take a look at this: BPA-free Nalgene bottles.
Comment: I have the exact same bottle as pictured above. What confuses me is that it is in between the do and don't store descriptions. Is this safe, or is it not? I don't know if this bottle is stainless steel or aluminum. There is no description beside this bottle and my daughter's lemon juice/orange juice is in it as we speak, ready for a long school road trip.
Comment: @Joselyn there is no way to tell what your bottle is made from. Many manufacturers use this shape, and they can use any metal they want, and if they use a reactive one, they can cover it on the inside with a non reactive layer.
Comment: Stainless steel is magnetic and aluminum is not. I'd say take a magnet to it to solve the riddle.


Pressure balance Am Stand hot and cold inlets are switched side to side. No cold water, only HOT. Remedy?

Question: Our shower was working fine for a couple years but started periodically only producing hot water ( single handle american standard /am 11. cartridge ) but no cold. All other fixtures in bathroom still have cold water. I replaced the cartridge but still have the same issue.
As a side note, the hot water comes into the valve body on the right side (not left as is usual). It has always been like this.
Answer: Possibly whoever originally installed the shower valve realized that the hot and cold supplies were switched and they installed the cartridge in the valve in the opposite orientation than normal. This made the control work in the usual way. When you replaced the cartridge you installed it in the correct orientation for hot on the left and so it no longer longer works
Comment: Am 11 is not reversible.
Comment: @Sean, then how would the valve have worked with the hot and cold reversed? Do you still have the cartridge that you took out? Is it possible that the original one was reversible and the new one is not? Or maybe a skilled and experienced plumber knew how to modify  the cartridge to make it work with reversed hot and cold?


Should I redo my house wrap that is under the sheathing?

Question: When my house was built, the builder put the Tyvek wrap on the frame of the house, then installed the sheathing and then installed the siding. I am about to have my siding replaced and one of the contractors wants to take down all the siding and sheathing and peel off the Tyvek, then put sheathing back on, then Tyvek wrap it and then install the siding. He claims if I don't do this it will void the warranty on the James Hardy siding.  I am aware that I may have some sheathing damage, but I don't see any reason to do all this as I can't believe it would void the Hardy siding warranty.  Another contractor wants to put another layer of Tyvek on the outside of the sheathing and leave the old Tyvek underneath the sheathing.  I am also not sure this would be a good idea since you could trap moisture on the sheathing that would now be in the middle and then I would have mold and mildew in there if moisture did penetrate.  I would take any information that someone might have about how to handle the situation.
Comment: I agree that it sounds a bit sketchy. I would suggest that you contact James Hardy yourself to ask them if it voids their warranty to not strip the wall back to studs. If they say it doesn't (and point you to a copy of the warranty info on their website that you can download & print), then tell your contractor to stuff it. If he's found _actual_ damage, then yes, replace that, otherwise, you've got it in writing that you'll be fine.
Comment: I would not want a second layer of house wrap.  I would think that would make more problems sandwiching the sheathing.
Comment: Tyvek is not acceptable for use with James Hardie siding.
Comment: What goes wrong when Tyvek is used under James Hardie planks or sheet?
Comment: @JimStewart not sure if its related, but theres a few huge court cases going through against James Hardy and faulty sidings here in NZ right now, and Hardys defence is "poor installation".  One was just settled for Hardy after the litigants financial backers pulled out, but there are another few cases about to go ahead.
Answer: I can't imagine that James Hardie will condone the installation of two exterior house wraps (James Hardie calls it : "Weather Barrier") sandwiching the existing wall sheathing.
The existing sheathing will have moisture in it and probably large amounts of dryrot.
However, you want to install their product, their way, in order to protect the warranty. That's why it's important that you have an on-site inspection performed by James Hardie. Make sure you get his report in writing.
https://www.jameshardiepros.com/products/hardiewrap-weather-barriers
Btw, I would not use "Tyvek" or some random caulk. I would use only James Hardie products installed exactly how they recommended. (This includes NOT caulking above windows. This drives every installer crazy, but is required by James Hardie.)


https://civicrm.org/extensions/areas causing error

Question: Upon installing the extension and then changing the settings so that 'Collapse this set on initial display' and 'Collapse this set in Advanced Search' are marked with yes, the follow warning of "Custom group 'Areas' already exists in Database' appears. How do I fix this error?  We're using Civi 5.0.0
Comment: what happens if  you just go back up a step  to the Custom Fields page, then click Edit on the Areas group of fields and try saving it? or is that what you already did?
Comment: I have got the same error. It is unclear to me why the error is there.
Answer: This sounds like a civicrm bug. I have tried locally and have the same error.
I found a work around: you can give the custom group a different title (the title Areas is also used for another group which is reserved).
I have created a bug report: https://lab.civicrm.org/dev/core/issues/141
Comment: Wouldn't it help avoid confusion downstream if you used different Titles for those two groups of fields?
Comment: Not really because one group is used at contact level and the other one at groups. The extension works fine with creating those custom groups with duplicate titles. But when you want to edit the custom group in the UI it fails because of duplicate titles.


Is cosine similarity a classification or a clustering technique?

Question: In document classification, is cosine similarity considered a classification or a clustering technique? But you need training data with the cosine similarity for creation of the centroid right?
Comment: In document clustering problems, cosine similarity sometimes gets better results. Check this paper: "concept decompositions for large sparse text data using clustering", Dhillon, Modha, 2000.
Answer: No.
Cosine similarity can be computed amongst arbitrary vectors. It is a similarity measure (which can be converted to a distance measure, and then be used in any distance based classifier, such as nearest neighbor classification.)
$$\cos \varphi = \frac{a\cdot b}{\|a\| \, \|b\|} $$
Where $a$ and $b$ are whatever vectors you want to compare.
If you want to do NN classification, you would use $a$ as your new document, and $b$ as your known sample documents, then classify the new document based on the most similar sample(s).
Alternatively, you could compute a centroid for a whole class, but that would assume that the class is very consistent in itself, and that the centroid is a reasonable estimator for the cosine distances (I'm not sure about this!). NN classification is much easier for you, and less dependent on your corpus to be very consistent in itself.
Say you have the topic "sports". Some documents will talk about Soccer, others about Basketball, others about American Football. The centroid will probably be quite meaningless. Keeping a number of good sample documents for NN classification will likely work much better.
This happens commonly when one class consists of multiple clusters. It's an often misunderstood thing, classes do not necessarily equal clusters. Multiple classes may be one big cluster when they are hard to discern in the data. And on the other hand a class may well have multiple clusters if it is not very uniform.
Clustering can work well for finding good sample documents from your training data, but there are other more appropriate methods. In a supervised context, supervised methods will always perform better than unsupervised.
Comment: It doesn't satisfy the triangle equality, so it is not a distance function. It also is not well-defined for the vector 0.
Comment: You could use a centroid, but if you are doing NN classification, you would just keep a number of relevant sample documents for each topic to compare it with.
Comment: If the cosine btw two vectors is 0, they are considered to be similar. Isn't cosine similarity a distance measure then?
Comment: you said No to "But you need training data with the cosine similarity for creation of the centroid right?"?. If so how do you create the centroid?
Comment: What do you need a centroid for?

Cosine similarity is defined on TWO VECTORS, with no centroids involved: https://en.wikipedia.org/wiki/Cosine_similarity
Comment: yes it is defined on two vectors. In my case since I want to determine how much a new document (vector) is relevant to the topic of my interest, for this I have to keep one vector (topic vector) constant all the time right? And that vector was what I referring to as the centroid. You initially need data (I referred as training data) in order to build that 'centroid' right? Am I referring a different approach here?
Comment: Problem is kNN can't handle unary class. I get an error in WEKA when I do this. Do you know of any other tools where I can do a one class classification?
Answer: I think you have not yet understood the difference between clustering and classification.
Document classification (or supervised learning) requires a set of documents and a class information for each document (example: the topic of the document). The goal of classification is to build a model which predicts the class for documents where the class (in this example the topic) is not known. When models are applied on documents where the class is known, they can be evaluated by comparing the predicted with the true class (hence supervised). The data used for training but not evaluating the model is called training data.
Document clustering (or unsupervised learning) requires a set of documents but not a class information. The goal is to find groups / clusters in the data, so that

documents which are similar according to a specified distance function are in one cluster. Example: Documents which roughly contains the same keywords.
documents which are not similar according to a specified distance function are in different clusters

The resulting clusters cannot be evaluated like a classification model, because the true clusters are not known (hence unsupervised). Hence there is no such thing as training data, you simply use all data to build the clusters.
See also: Classification vs clustering
Now the connection between both techniques, and imho the source of your confusion: By defining the clusters generated by document clustering as class, one can train a classification model on the data. Example: If you cluster documents by words, you may detect that the resulting clusters are indeed describing topics. Now you can build a classification model for that automatically derived class.
Finally, as put by Anony-Mousse et al., the cosine similarity can be used both for

clustering, by defining 1-cosine as distance function (which may not be a metric). Maybe you want use the loosely related Jaccard distance instead
classification, by using it in e.g. k-nearest-neighbor
Answer: A cosine similarity function returns the cosine between vectors. A cosine is a cosine, and should not depend upon the data. However, how we decide to represent an object, like a document, as a vector may well depend upon the data.
Often, we represent an document as a vector where each dimension corresponds to a word. If the word does not appear we assign a value of 0 to that dimension. If the word does appear the value corresponds to the number of times that word appears in the document normalized by the number of times that word appears in all the documents with our data. This is the general idea behind TF/IDF. Since different sets of documents will have a different distribution of words, the TF/IDF vector representations of documents depend upon the particular document set you are working with.
Many classification and clustering methods depend upon some measure of distance and similarity or distance between objects. If they do, then they can use cosine similarity.
Comment: Then why cosine similarity comes as a similarity measure for text document clustering?
Comment: Because documents are often represented as vectors. Cosine similarity is a measure of whether these vectors are pointing in the same direction. In practice, this often works as a measure of whether documents are about the same thing.
Comment: "A cosine is a cosine, and should not depend upon the data." !? If the data change, the cosine will change. Maybe you mean basis?
Answer: Similarity measures are not machine learning algorithm per se, but they play an integral part. After features are extracted from the raw data, the classes are selected or clusters defined implicitly by the properties of the similarity measure.
It might help to consider the Euclidean distance instead of cosine similarity. Is the Euclidean distance a learning algorithm? No, but you can use it to define one.
Comment: I'm doing some tests in document clustering in weka with Euclidean distance as the distance function. But my problem is even if I give a mix of unrelated (topically) and related instances during tests (even some empty instances), they all get clustered into the same group. What could be the reason for this?
Comment: You are not getting good separation in the feature space? Can you see the clusters with PCA or does it look like a jumble?
Comment: I'm using weka. I checked it but there is no option for that. Do you know of a different tool kit with those options? So if I test the model with same instances from the train set and empty instances shouldn't they get clustered into different groups?
Comment: [WEKA PCA example](http://laps.ufpa.br/aldebaro/weka/feature_selection.html)
Comment: Thanks for the link. I did a try but it was taking so long time when I stopped. I'm wondering if I have some empty instances in my test set shouldn't they get clustered into a different cluster?


What is Total War: Rome 2 Emperor Edition?

Question: I have just noticed that in my Steam library, the game Total War: Rome 2 is now called Total War: Rome 2 Emperor Edition. What is the reason behind the edit to the game name? Have they added anything to the game or is it purely just a name change?
Comment: Actually it is a good question so +1. The fact that already has 3 answered proves that you don't need to be a dev to answer it (unless rome developers have a habit of crawling Arcade for questions :P).
Comment: Sorry, freebol.  Only a developer can answer this question, and we don't allow questions that require developer knowledge to answer, I'm afraid.  That said, if you want to limit your question to just any changes they've made, that would be something we could probably answer.
Comment: I think it is a good question @freebol96.
Answer: There is a major difference between Total War: Rome 2 and Total War: Rome 2 Emperor Edition.
There is only one version of Total War: Rome 2 on steam, and it's the emperor edition. There is no regular version on steam any more, and according to the devs the emperor edition is a majorly revamped version, with loads of new features, and an expansion as well.
The emperor edition was given for free to all existing owners of the regular edition.
From Steam:

Big news! We've announced the Total War: ROME II Emperor Edition – the definitive edition of ROME II, FREE to all existing owners of the game, which comes complete with a large piece of new single player content. In Rally Point 21, we go into exclusive amounts of detail about what's included.
Answer: Based off this Steam announcement by the developers, it appears that Total War: Rome 2 Emperor Edition is an expansion to the original game. The reason you have it:

If you're an existing owner of ROME II and have automatic updates enabled, Steam will update the game to the Emperor Edition for free.

Among the many changes, the most prominent that I can see are:

An additional campaign - The Imperator Augustus Campaign
Armenia is now playable in the Grand Campaign

There are plenty of balance changes, fixes, and improvements as well. You can find all of the changes by looking at the patch notes, though there are too many changes to simply copy all of the notes into my answer.
Answer: The release of the Emperor edition coincided with the release of a new campaign, the Imperator Augustus campaign which follows Augustus Caesar's rise to power (if you choose to play it that way).
You can find more information on their site, or the games store page, or Google.


How do you search the web for programming related information?

Question: Could you share your frequently used tricks to search the web for programming related information?
Here is my toolbox:

To find a library or an application I use del.icio.us search  (ex. communication java python) or recently stackoverflow.
To check recent news about a project or library I use google and narrow my search results to month (ex. spellchecker.net)
To find examples for a library I use google code search  (ex. lang:C# log4net configure)
For general searches I use google custom search with stackoverflow.com added as preferred site. This gives my search emphasis on the computer programing so that searching for outlook selected text returns pages related to programming not outlook user guides :).
Answer: Just google it, but google it well.
Answer: I find that out-of-the-box* Google covers all my bases adequately. If I need documentation on something specific, I'll just add the source as part of the query, rather than going to the source itself to search there (e.g. "msdn" for BCL information)
*so to speak
Answer: In addition to typing a search term into Google..
I use Google Reader extensively. I subscribe via RSS to a large number of project blogs and programming web sites. I then allocate at least 30 mins each day to scanning through the feeds.
This helps me keep up to date and helps me when I want to find an answer.
Answer: When things get really difficult I sign in the library's mailing list.
Answer: Windows

MSDN

*nix

Man pages

General Programming

StackOverflow
SGI STL reference
Answer: If it's a question I have, depending on the project, and you're really stuck I often turn to the IRC channel.
However, there's the risk you're asking a question that has already been asked a hundred times. So you might encounter some unfriendliness sometimes.
Answer: Well, depends on what you mean by "web". If it means www. then I just google it. If it means the net as a whole, I prefer usenet. Kinda like stackoverflow on steroids.
Answer: Google Code Search is invaluable.
Answer: In all cases, beware of the fact that all of these sources include outdated information in addition to current information. Check the dates on articles - something from 2002 is much less likely to be relevant than something from 2007, even if it is clearly written and makes perfect sense - for 2002.
The example I constantly bring up is the number of articles on WSE that will come up in search results on MSDN for "web service security". I've had reports of people implementing WSE because it came up in search results, not knowing that WSE is obsolete.


accurate page view count in Django

Question: What is a good approach to keeping accurate counts of how many times a page has been viewed?
I'm using Django.  Specifically, I don't want refreshing the page to up the count.
Answer: As far as I'm aware, no browsers out there at the moment send any kind of message/header to the server saying whether the request was from a refresh or not.
The only way I can see to not count a user refreshing the page is to track the IPs and times that a user views a page, and then if the user last viewed the page less than 30 minutes ago, say, you would dismiss it as a refresh and not increment the page view count.
IMO most page refreshes should be counted as a page view anyway, as the only reason I have for refreshing is to see new data that might have been added, or the occasional accidental refresh/reloading after a browser crash (which the above method would dismiss).
Comment: Tracking the IPs is bad idea. Many networks give the same outer IP for its' users.
Comment: Yeah, some other method for tracking unique users would be better (cookies, IP+User Agent), but the idea is to dismiss page views that you think (as you can't reliably know) are from the user refreshing the page.
Answer: You could give each user cookie, that expires at the end of the day, containing a unique number. If he reloads a page you can check wether she has been counted already that day.
Answer: You could create a table with unique visitors of the pages, e.g. VisitorIP + X-Forwarded-For content, User-Agent string along with a PageID of some sorts. If the data itself is irrelevant, you can create a md5/sha1 hash from these values (besides the PageID of course). Be warned however that this table will grow really fast.
I'd advise against setting cookies for that purpose. They have a limited size and with many visited pages by the user, you could reach that limit and make the solution unreliable. Also it makes it harder to cache such page on client-side (see Cacheability), since it becomes interactive content.
Answer: You can write a django middleware and catch request.url, then setup a table with url / accesses columns. Beware of transactions for concurrent update.
If you have load problems, you can use memcached with incr or add function and periodicaly update the database table to avoid transaction locks.

accurate page view count in Django


Force in Special Relativity

Question: I have a question regarding how force on a body works in the framework of special relativity. As far as I am aware, the equation for force in special relativity is:
$$F=m\alpha$$
Where $\alpha$ is the proper acceleration. Would this imply that, if the proper acceleration is constant, the force on the body is always constant? For example, if the proper acceleration was a constant $\mathrm{1\ ms^{-2}}$ and the rest mass was 10 kg, the force would be a constant 10N, regardless of the velocity?
Answer: You're right, acceleration has to be redefined in special relativity. In Newtonian mechanics, the definitions $F=m\ddot{x}$ and $F=\dot{p}$ are equivalent, where $p$ is momentum. However, in special relativity, the quantity $m\dot{x}$ is not all that special, and instead what becomes important is $p=m\gamma\dot{x}$ (where here, $m$ is always taken to be the actual mass. The rest mass.)
So, once that redefinition of $p$ occurs, the above two definitions of force are no longer equivalent! The more important one turns out to be $F=\dot{p}$.
Now, with $x$ being a vector, you might ask, "wait a second, expanding $F=\dot{p}$ I get $F=m(\dot{\gamma}\dot{x}+\gamma \ddot{x})$, isn't that cumbersome? Especially, in certain problems, with the added complication of transforming $(ct,x)$ vectors between different reference frames?" You'd be absolutely right! My relatively uninformed opinion on this is that that is what tensors, proper time, and the development of intuition [by working lots of practice problems] is for. But, it's worthwhile; Most notably it leads to profound insights into magnetism.
Comment: Nice answer. I want to give you a +1, and I will if you add some words that directly answer the question "Would this imply that, if the proper acceleration is constant, the force on the body is always constant?"
Comment: As much as I appreciate the answer you gave, joshphysics is right in that your answer doesn't exactly address my question. Thank you though, certainly very enlightening.
Comment: The definition of force you're using is inconsistent with the one being used by the OP. In the notation of this WP article http://en.wikipedia.org/wiki/Four-force, your force is a component of the three-vector $\textbf{f}$, while the OP's is a spacelike component of the four-vector $\textbf{F}$. They differ by a factor of $\gamma$.
Answer: Force is not really a very useful concept in relativity, but anyway this WP article has a brief treatment. We have the force four-vector
$$ \textbf{F}=\frac{d\textbf{p}}{d\tau} \qquad ,$$
where the derivative is with respect to proper time. This is the same as the OP's $F=m\alpha$. The reason it has to be with respect to proper time is that if we want the result to be a four-vector, we have to divide the four-vector $d\textbf{p}$ by a Lorentz scalar.
Because the derivative is with respect to proper time, the spacelike part of this force four-vector is the force that would be measured by an inertial observer who was instantaneously comoving with the object being acted on. It's not the three-force $\textbf{f}=d\textbf{p}/dt$ that would be measured  by an observer in whatever frame we're using to describe all these vectors. The spacelike part of $\textbf{F}$ differs from $\textbf{f}$ by a factor of $\gamma$,
$$\textbf{F}=(\ldots,\gamma \textbf{f}) \qquad .$$
So say passenger Amy is in a spaceship that has a constant proper acceleration of $g$. She's standing on the deck. A second passenger Bob jumps off a table or something so he's inertial but instantaneously comoving with Amy. Because Bob is instantaneously comoving, his proper time is the same as Amy's, he sees no relativistic corrections, and he judges the force of the deckplates acting on Amy's feet to be just $F=mg$. It's constant for as long as the ship maintains constant proper acceleration.
However, observer Carl back on earth sees the ship moving at relativistic speeds. In his coordinates, $f=F/\gamma=mg/\gamma$ varies

Would this imply that, if the proper acceleration is constant, the force on the body is always constant?

So the answer depends on the frame of reference. In the comoving frame, the force is constant. In a fixed inertial frame, it's changing.

Force in Special Relativity


Payment device compliance of PCI v2 AND PCIv3

Question: Is there any known case of a pin pad device being compliant PCI v2 but by changing just a software component it becomes PCI v3 compliant?
Answer: I'm going to assume that when you say PCI v2 and PCI v3 you mean the PCI PTS POI standard - ie the one for physical devices that include pin entry or are secure card readers. I'd personally be very surprised if a software upgrade changed the appropriate version number, because the hardware security profile changed between v2 and v3. The easiest way to check is on the PCI SSC website. All PTS devices are listed here:
https://www.pcisecuritystandards.org/assessors_and_solutions/pin_transaction_devices
Comment: It looks like Prism Payment Technologies' TSM500i is the only thing on both the 2.x and 3.x lists. I have no idea how that works.
Comment: That's because it is a hardware security module (HSM), not a payment terminal. Confusingly they are listed in the same section of the SSC website but are tested to PTS HSM not PTS POI. The firmware is a different version between the v3 and v2 approvals.


Electric Current in Spinning Disk

Question: Consider an essentially flat conductive disk of radius $R$ spinning at angular speed $\omega$ with surface charge density $\sigma$ and total charge $Q$. I believe that based on the definition of current density, the surface current density should be $$ K = \sigma v=\frac{Q}{\pi R^2}v=\frac{Q}{\pi R^2}{\omega}r$$ The total current in the $I$ disk is then given by $$I=Q{\omega}R$$ However, my textbook gives $$I=Q{\omega}$$ Which formulation is correct in this instance?
Comment: $Q\omega R$ has units $\mathrm{A\cdot m}$ which doesn't match the unit of current $\mathrm{A}$
Comment: The relationship between velocity and angular velocity is $\mathbf v = \boldsymbol\omega \times\mathbf r$, not $\mathbf v=\boldsymbol\omega r$. The latter is obviously nonsensical - $\boldsymbol\omega$ points out of the plane and $\mathbf v$ stays within it.
Comment: That said: what do you mean by 'total current in the disk'? The surface current density? The total charge crossing a radius per unit time? If the latter, your book is off by a factor of $2\pi$ (since over one revolution, i.e. time $1/\nu=2\pi/\omega$, you know that charge $Q$ crosses the radius). As to how you got your result - no idea; you should clarify.
Comment: @EmilioPisanty I made the mistake of making the symbols bold as if they were vector quantities, since they usually are. I am dealing here only with scalar magnitudes. From reading your comment, I believe my answer is incorrect since I cannot associate a linear speed $\omega R$ with every point on the disk; I can only associate this with the outermost edge which is actually at radius $R$. The linear speed of other points on the disk will be dependent on their radii.
Comment: Your expression for $K$ is correct, but it's still not clear what you're defining $I$ to be and how you're calculating it.
Answer: Well, given a disk with a uniform surface charge density ${\sigma}$ rotating at angular speed ${\omega}$, its linear speed at a point {r} from the center is ${v=\omega r}$, so its surface current is
$$K=\sigma\omega r$$
   I think you're right.

Electric Current in Spinning Disk


How to speak English fluently?

Question: I have studied English grammar for a long time. And the problem is now that I do not read and speak English very well. I'm really worried about that! How can I learn to speak fluently?
Comment: Without speaking regularly with native speakers, it is practically impossible to learn to understand the language. One can learn to read by reading **a lot**, constantly; but it won't make sense until you can hear the voice in your mind. And that means hearing native speech. Movies are OK, but limited. And highly stylized, and recognizable.
Comment: John Lawler is right. There are sites like letsalive.com(http://letsalive.com) where you can talk with the people who also have the same interest.
Answer: Perhaps developing an ear by listening spoken English would be of tremendous help. I think key to speaking fluently is internalizing the "rhythm" of the dialect you would like to speak.
Of course you should imitate or in real life situations speak as much as you can as you are developing it.

How to speak English fluently?


What's the title of the anime that has a lead character with a white long-haired man spirit with him?

Question: My classmate and I talked about the old animes that we've watched, and we were reminiscing about the anime about a character that has a white haired man spirit. On his arm, there's something that's coming out of it. I remember that the ones that are coming out from his hand is his power. We forgot the title and the name of the lead character though.
Comment: How old is 'old' here?
Answer: It might be Shaman King. The anime ran from 2001-2002, which may qualify as old.
Asakura Yoh is a Shaman who uses the spirit of Amidamaru, a long dead samurai with white hair, during the Shaman Fights.

Sometimes, mostly early in the first season, Yoh and Amidamaru combine in such a way that their power comes out of Yoh's hands.
Comment: The "thing on his arm" could also be an Oracle Bell - [here's a clear image of one of the other shamans wearing his](http://img.photobucket.com/albums/v27/lunchy/Ren2_zps38b77907.jpg), and [a blurry one of Yoh with his orange Oracle Bell](http://s1.dmcdn.net/BOROS/1280x720-15o.jpg)
Comment: (The second image in the answer is actually from the episode where Yoh earns his Oracle Bell)


If the real part of $f$ is bounded above by $A$ in the unit disk, then $|f(z)| \leq {2A|z|}/({1-|z|})$

Question: Let $f$ be a holomorphic function on unit disk $\mathbb{D}$ such that $f(0)=0$ and there exists constant $A>0$ such that $\operatorname{Re}(f(z)) \leq A$,  for all $z \in \mathbb{D}.$ Could anyone advise me how to prove $|f(z)| \leq \dfrac{2A|z|}{1-|z|}, \forall z\in \mathbb{D \ ?}$  I tried using the theorem of Schwarz pick to no avail. Hints will suffice, thank you very much.
Comment: I see your point.
Answer: More generally: suppose $f:\mathbb D\to \Omega$ is a holomorphic map into a simply connected domain $\Omega$, and let $\phi:\mathbb D\to\Omega$ be a bijective holomorphic map such that $\phi(0)=f(0)$. By the Schwarz lemma applied to $\phi^{-1}\circ f$ we have $(\phi^{-1}\circ f)( \mathbb D_r)\subset  \mathbb D_r$ for $0<r<1$. Rewrite this as $f(\mathbb D_r)\subset \phi(\mathbb D_r)$, and it begins to look promising.
To find $\phi$ for your particular domain, think of fractional linear transformations.


How to include only some modules in f2py via setup.py

Question: I have a very long piece of fortran code, some parts of which I would like to expose to python. It works fine from the command line, with
f2py -m extrpsf -c extract_psf.f95 only: extract_psf psfmany :

I'm hoping to distribute this, so am trying to get it to work with numpy.distutils.core.  I thought the following should work:
from numpy.distutils.core import setup, Extension
setup(name="extrpsf",
ext_modules=[Extension(name='extrpsf', sources=['extract_psf.f95'],
                       f2py_options=['only: extract_psf psfmany :'])])

Unfortunately, this does not work. Any suggestions?
Sorry for not having given details about the error message before. I now did what I should have done before and simplified the problem.  So, assume I have the following fortran code add_test.f95
    subroutine add_axis2(in, n1, n2, out)
      integer, intent(in) :: n1, n2
      double precision, intent(in) :: in(n1, n2)
      double precision, intent(out) :: out(n2)
      integer :: i2
      do i2 = 1,n2
         out(i2) = sum(in(:,i2))
      enddo
      return
    end subroutine add_axis2
subroutine add_axis1(in, n1, n2, out)
  integer, intent(in) :: n1, n2
  double precision, intent(in) :: in(n1, n2)
  double precision, intent(out) :: out(n1)
  integer :: i1
  do i1 = 1,n1
     out(i1) = sum(in(i1,:))
  enddo
  return
end subroutine add_axis1

Then, if I run
f2py -m add_test -c add_test.f95 only: add_axis1 :

I get a add_test.so, which, if I import it, only has add_axis1. However, if I make a setup.py with
from numpy.distutils.core import setup, Extension
setup(name="add_test",
      ext_modules=[Extension(name='add_test', sources=['add_test.f95'],
                             f2py_options=['only: add_axis2 :'])])

and run
python setup.py build

the resulting add_test.so still has both subroutines. (This also explains the error message I get earlier; there are parts in my longer code that f2py chokes on, which in the manual f2py invocation simply get skipped). So, I guess my question has simplified to how I ensure in the setup.py that only some routines get made.
Looking in more detail at the output, I see that
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "add_test" sources
f2py options: ['only: add_axis2 :']
f2py:> build/src.linux-x86_64-2.7/add_testmodule.c
creating build
creating build/src.linux-x86_64-2.7
IOError: [Errno 2] No such file or directory: 'only: add_axis2 :'. Skipping file "only: add_axis2 :".

so the error is becoming clearer.
...
and indeed, with this some further googling gives the answer; from
http://cens.ioc.ee/pipermail/f2py-users/2005-July/001125.html
if I do instead
from numpy.distutils.core import setup, Extension
setup(name="add_test",
      ext_modules=[Extension(name='add_test', sources=['add_test.f95'],
                             f2py_options=['only:']+['add_axis2']+[':'])])

the simple example works, and with a similar change the more complicated one works too...
Comment: Why it didn't work? What was the error?
Comment: Triggered by your question, I did what I should have done in the first place: make a simpler example.  As shown in the edited example, this allowed me to troubleshoot and find the answer. Thanks nevertheless!
Answer: Great, the solution with using f2py_options works!
Extension(
    name='module.routine_ext',
    sources=['src/source_file.f'],
    f2py_options=['only:', 'subroutine_name', ':'],
    language='f77')


Editor between Davinci and Capcut?

Question: Would you say Davinci Resolve is too advanced for the editing of shorts? Are there any other high quality yet simplistic editors you'd suggest that provide a lot of resources without paying? I've heard capcut is pretty good, and I even tried it for a while, yet in the free version, (which is the only version I've used) I felt like more advanced edits weren't available to me. Basically I'm asking about a free editing service in a level between both of them.
Answer: I wouldn't say Davinci is too advanced for a YouTube short, but the workflows are more optimized for bigger projects. To simplify it, skip the media page and go straight to the edit page. Then, drag your footage into the media pool. Pretty much all you'll need is the edit page, the color page (for basic correction), and the deliver page for exporting. Once you get to know how to set up the project settings, it's pretty straightforward from there. You will just need to set your timeline resolution to a 9:16 aspect ratio or 1080x1920 (most are already presets in the dropdown menu). For other editors, I'm not sure what would be free, but I think that since Resolve is free, it might be worth learning when it could become a useful skill in the future if you ever end up doing some more complex projects. Hope this helps!
Answer:
Is Resolve too advanced, (vs. Capcut)?

No. I would say they are different types of editors. One "feature" of Capcut-like editors is the template library.
Resolve has some libraries, like different styles to add text lower thirds and credits. You can get third-party libraries but it does not offer one by itself.
So, if what you need are those kind of templates, probably Canva. (The same case, a free limited version)
One editor that I used to recommend (that was pretty good) actually changed the business model, from editor alone to be part of a library. Hit Film is now part of Artist. It has a basic free plan.

I felt like more advanced edits weren't available to me.

What features? You need to define your specific needs, probably the software has them and you have not found them.

But if you are asking about free alternative software, as software, not services (which would include templates, assets, and cloud storage) Yes, there are several (besides the already mentioned). Look for Open source projects, like ShotCut And OpenShot.
Another one that has a free version, and a bit of a different interface is VSDC.
But, personally, I would stick to DaVinci Resolve. You do not need an OP computer to run it. And it is one of the best.
One open-source software to check is Blender. You could explore it as a simple video editor, but as an entry point to explore it as the 3D suite that it is.

Editor between Davinci and Capcut?


Change file permissions - Windows Installer

Question: How do I add write and modify permissions to a text file that will be installed in the Application Folder in the File System on Target Machine?
Comment: What tool are you using to make your MSI file? WiX? Installshield? Advanced Installer? Etc... Some differences between the tools despite similarities.
Comment: No time to write this up right now, but here are two links to get you going: [How to deny folder permission to Users with wix installer](https://stackoverflow.com/questions/49543312/how-to-deny-folder-permission-to-users-with-wix-installer) and [Different WiX elements to set ACLs](https://stackoverflow.com/questions/49324552/is-wix-changing-the-permissions-on-my-notes-ini-file/49325684#49325684) (mid section).
Answer: Your post seems to indicate that you are using Visual Studio setup projects, the Installer add-on.
Two basic points:

There is no support for doing this in Visual Studio setup projects, so you would need to write custom action code that alters those permissions. The code to do that is about security APIs, so you probably won't get an explicit answer here.
The most common reason people do this is that the application needs to update the file, and it fails because updating ProgramFiles folder content requires administrator privilege. If this is the case then your application design should be improved by having the file in (say) the User's Application Data folder, which has that name for the obvious reason that's the preferred location for such data.


Biochem Book age and suggestions

Question: I'm taking chem classes, and am interested in learning a some biochem on the side, on my own. I've bee looking for a decent book, though I'm on a bit of a tight budget so not brand shiny new ones upwards of a hundred. Hopefully. Obviously I don't want something ancient just for reduced price, so two questions. How many years back is ok to use as a cutoff for publication date, and any suggestions?
Comment: Lehninger's book is really something to consider. We study it for our chemistry olympiad, so it's worth noting, isn't it?
Answer: I would suggest the Lehninger Principles of Biochemistry, which is one of the best in my opinion since it covers most of the key aspects in biochemistry.
It is quite expensive to buy as new, but since it is quite common you can maybe borrow it from a library. In this way you can get an impression about the book and eventually decide if it is worth buying it or not. If you are interested in having it I would buy a secondhand one and I would say it does not matter if it is not the last version, the previous one should be good as well.
Comment: That's actually one I was looking at myself. The last edition is pretty cheap too. Looking through the preview to get a bit of a look at it now.
Answer: I had to read biochemistry by berg. I think the 7th edition is the latest one, but you can't go wrong with the sixth either. This is a good text to get a general overview of biochemistry that you can later apply to research systems in the future.
Comment: I took the class biochemistry last year so both books are pretty new.
Answer: I know you are asking for a textbook, but if you want to do some casual learning here are a few pop-sci biochemistry-focused books that I recommend giving a try:

Oxygen by Nick Lane.  I like this book best but any of Nick Lane's books would be a good start.  This one focuses on the profound changes oxygen has had on life on Earth, from evolution to biochemistry.
Blondes in Venetian Paintings... by Konrad Bloch.  A series of essays on completely different topics, all recounting various aspects of the Nobel-winning career of a great biochemist.
The Chemicals of Life by Isaac Asimov(!).  Sure this one is very dated but by all accounts it's extremely well written.  (I haven't read this one yet myself but it's on my list.)
Comment: Cool, thanks. Can always use something a bit lighter/non text book to read while still sticking with science.

Biochem Book age and suggestions


Can we create record of Custom Setting if users doesn't have ' Customize Application' admin permission

Question: I have a custom profile having license Salesforce, I have created a Custom Setting with label 'User', I have added my custom setting to 'Enabled Custom Setting Definitions Access' of newly created profile but this user with that profile isn't able to create a record of that custom setting. The New button isn't available for record creation.
Also ' Customize Application' this permission isn't available for Platform User Profiles.
Answer: As the Grant Permissions on Custom Settings doc suggests,

Admins can grant API Read access through profiles and permission sets to users without the Customize Application permission.

When you add the custom setting to the "Enabled Custom Setting Definitions list" you can only provide read access to "manage" of custom settings for non-admin users.
Comment: So it means we cannot provide create access to Non-System Admin users, even if we want to do that then we need to give 'Customize Application' permission to that profile or permission set?