AutoCAD drawing (DWG) to map tiles

Question: Rendering large DWG files as such has shown performance degradation to large extent. Planning to use the concept of map tiles using leaflet. Need some pointers/information on how to convert DWG files to map tiles.
Answer: After too many hours, searching everywhere for a solution to convert DWG/DXF files using any automated command line tool, finally I found QCAD.org.
And that works even on Windows, MacOS and Linux.
After a quick look in documentation, I found the section for command line tools.
They are:
dwg2bmp, dwg2png, dwg2jpeg, dwg2tiff, dxf2png, dxf2jpeg, dxf2tiff

and the awesome:
dwg2maptiles and dxf2maptiles

Using this tool, they came up with a beautiful sample using leaflet.js:
http://qcad.org/res/map/

The project is OpenSource, but this scripts are only avaliable at QCAD Professional edition.
  You can use the free open source QCAD Community Edition by downloading the trial version for your platform (Win, Mac, Linux) and then remove the QCAD Professional add-on running in trial mode. Alternatively, you may compile your own package from sources.

PS: I'm very happy to support the project buying a professional copy.
Answer: The easiest approach may be to save your DWG files as PDF and use MapTiler to create the raster tiles and leaflet viewer for you.
You can render such PDF by drag&drop into MapTiler while choosing the "raster" profile - just follow the video tutorial: https://youtu.be/9iYKmRsGoxg?list=PLGHe6Moaz52PiQd1mO-S9QrCjqSn1v-ay
If you need to assign coordinates for later on placing markers or polygons on specified position over the DWG tiles - it is possible with advanced tiles.
If you need help with using MapTiler - write details and provide sample file you need to process to https://www.maptiler.com/support/community/.
If you data are sensitive or you need a guarantee on the answering of your request you seek directly the support from us, the authors of MapTiler.

AutoCAD drawing (DWG) to map tiles


Looking for language and framework for data munging/wrangling

Question: I have an extensive series of projects that require importing data from many different types of different sources (websites, web apis, sensors, legacy text files, etc). Is there a good framework (preferably open source) that has been built bottom up to tackle this type of problem? Preferably one leveraging an appropriate language (python, most likely) and already having an extensive plugin database.
Comment: I don't think there is such a wide-ranging framework, at least not on the data-connecting side, but most languages will have libraries supporting the data sources you suggest. You need to define "appropriate language" - probably best to simply state which languages you would accept, or at least what specific qualities count as "appropriate". You might instead try http://softwarerecs.stackexchange.com/ (but do read their help, and do fix the vague parts of your question first - such as which data sources are actually important to you, and which OS/language to support).
Comment: Or are you looking for the middle-ware here for co-ordinating data movement, something like Microsoft's SQL Server Integration Services (was called Data Translation Services)?
Comment: It's for IoT / Data Science project.  The sources of data are specified as web scraping, web apis (rest request replying with json, blue tooth sensor data, and legacy text files).   It's likely there will be more, but they haven't been nailed down yet.   Language would probably be python.   The assumption of the team is that this has happened many times before and that some framework would already exist.   We don't mind writing one and open sourcing it, but it'd be a shame to re-invent the wheel unnecessarily.
Comment: I think you need to define better what this imagined framework would do. Pretty much *all* software that handles data will "wrangle" or "munge" it, so you have not given enough information. For instance, is the goal to get all the data into a format suitable for specific ML algorithms (usually a matrix or sparse matrix)? Do you need support for data sets larger than RAM allocation for a single algorithm?
Comment: Well, we don't want to get too specific as it will eliminate potential solutions.  As long as the data can be processed into some internal format that is fine.  We can deal with it from there.
Comment: I think you are being too generic, and need to get into specifics. The problem IMO, is your request matches most if not all open-source computer languages (including their libraries), but no frameworks would be so general-purpose. But perhaps someone else will agree with you and suggest an answer . . .
Answer: If you are interested in a very high-level (enterprise architecture) framework, I suggest you to take a look at the MIKE2.0 Methodology. Being an information management framework, MIKE2.0 has, certainly, much wider coverage than the domain of your interest, but it is a solid, interesting and open (licensed under the Creative Commons Attribution License) framework. A better fit for your focus is the Extract, transform, load (ETL) framework, which is extremely popular in contexts of Business Intelligence and Data Warehousing. On a more practical note, you might want to check my answer on Quora on open source master data management (MDM) solutions. Pay attention to the Talend solutions (disclaimer: I am not affiliated with this or any company), which cover a wide spectrum of MDM, ETL and data integration domains as open source and commercial offerings.
Answer: All of the scientific computing development going on around Python is a good option. Continuum's Anaconda is very easy to get up and running. Also well supported in distributed environments.

Numpy for fast matrix operations
Pandas for dataframes, munging, analytics, visualization
Statsmodels and Scikit for models, metrics, ML algs and so on
...


SRB ejection methods

Question: While an empty GEM-60 is just under 2 tons, it occurred to me that additional thrust could be generated by jettisoning the empty boosters (or a large portion of them)  BEHIND the Delta IV rather than pushing them off to the side. Is there a reason we don't configure rockets this way?
Comment: @Hobbes: The main difference is that with a lower stage as reaction mass, you're not running at risk of crashing into it.  Strap-on SRBs create a big risk of collision.
Comment: The accepted answer on that one includes " or any other large part of the vehicle as reaction mass" so I agree it's a duplicate.
Answer:
Because the extra thrust would be puny comparing to the rest. You'd gain 1-2m/s if you're really lucky...
Because you really, really don't want the booster to crash into the rocket, the bell nozzle, or anything else, and it's subjected to massive aerodynamic forces that could easily do this if you don't push it away strongly enough.

Any seasoned Kerbal Space Program player will tell you a dozen stories of boosters on their rockets destroying the rocket, or the engine, or ripping the fins off, or misbehaving in similar manner, because separation didn't throw them away hard enough, or other tricks, like fins angled away from the rocket, spinning for centrifugal force to eject the boosters, separator SRBs or similar methods failed. And actual rocket scientists will just nod their heads. These boosters are heavy, and they can really mess things up if you don't make absolutely sure they won't.
Never mind the mass of such propulsion mechanism would likely be greater than mass of equivalent amount of fuel you could pack up and use at superior efficiency in your rocket engine.
Comment: Can confirm, Booster-separation collision was my primary failure-mode for a very long time before I got a handle on it.
Comment: I actually started including monoprop and the small monoprop engine at the tip of the rocket synchronized to the decoupling to rotate it away forcibly because I got sick of this happening  on "no-revert" mode. Really crappy way to lose $100,000, even in fake money.

SRB ejection methods


Why trade futures if you have options?

Question: This article explains the difference between futures and options. It seems a futures contract is an obligation, while an option is a right (not an obligation). If this is true, why would anybody ever deal with futures? An obligation is always less desirable than an option, right?
Comment: That article is pretty thin. I mean, it goes into little detail for either product. Joe's answer below is a good explanation, but I'd recommend a deeper read on both topics to better understand futures and options.
Answer: Yes, from the point-of-view to the end speculator/investor in stocks, it is ludicrous to take on liabilities when you don't have to.  That's why single-stock options are far more liquid than single-stock futures.
However, if you are a farmer with a huge mortgage depending upon the chaos of agricultural markets which are extremely volatile, a different structure might appeal to you.  You could long your inputs while shorting your outputs, locking in a profit.  That profit is probably lower than what one could expect over the long run without hedging, but it will surely be less volatile.
Here's where the advantage of futures come in for that kind of structure: the margin on the longs and shorts can offset each other, forcing the farmer to have to put up much less of one's own money to hedge.  With options, this is not the case.
Also, the gross margin between the inputs rarely fluctuate to an unmanageable degree, so if your shorts rise faster than your longs, you'll only have to post margin in the amount of the change in the net of the longs and shorts.
This is why while options on commodities exist to satisfy speculators, futures are the most liquid.
Answer: That question makes assumptions that don't hold in general

Only European options behave somewhat like futures in that you have to wait until maturity to exercise.
If you're writing the option then the counterparty has the right and you have the obligation.

As to why to deal with futures:  Well, there's just one contract per maturity date, not a whole chain of contracts (options come at different strike prices).  That in turn means that all the liquidity is in that one contract and not scattered across the chain.
Then, moreover, it depends what underlying contracts you're talking about.  Often, especially when dealing with commodities, there is no option chain on the spot product but only options on the futures contracts.
In summary, the question is somewhat bogus.  Options and futures evolved historically and independently, and were not meant to be substitutable by one another.  So their rights and obligations are just a historical by-product and not their defining feature.  I suggest you refine it to a specific asset class.
Answer: With options you pay for a premium which relates to the expected (so-called "implied" volatility). With futures, there is no assumption about the volatility of an underlying stock. In general, when trading options you trade the direction and future expected volatility of an underlying while futures are directional trades only.
Answer: I read the article.  I'm not really sure of the purpose of that article.  The article while somewhat accurate only describes some of how options work.  I personally would pretend you never read it because it compares two things for no good (teaching) reason.  It mixes options and futures and IMO that is a mistake and confusing to anyone new to options and futures.
Option contracts are NOT just rights, they are also are obligations. See https://www.investopedia.com/ask/answers/032515/what-difference-between-right-and-obligation-call-option.asp.   You can BUY a CALL option and you have the RIGHT to do something, but if you SELL a call option you have an obligation.
So forget about futures and just stick to options and say why would you want an OBLIGATION if you could have a RIGHT?
The simple answer is that there are different trading strategies that use each of these approaches.  I was going to give examples but any example would require you to have a good understanding of how options work so the example would likely not make sense.
Why would you want to trade futures over options?  Not really your question but the answer is that futures are open more hours than the options market so you have the ability to trade during the night time hours.  See http://www.cmegroup.com/trading-hours.html for the different futures products and the hours of trading.
I hope that helps some.  The question is difficult to answer because the source material you read is unfortunately comparing things that should not be compared in the way they are doing so.

Why trade futures if you have options?


How can I remove very old paint from my hardwood floor?

Question: We bought a house built in 1857. It has beautiful hardwood floors. The family room was carpeted some time along the way. We pulled up the carpet, revealing the floors.  About 3 ft into the room along every edge, someone painted the floor dark brown. How can we remove that paint? We don't know what type of paint it is.
Comment: The other thing you should check for if the paint contains lead. Get it tested, if you have lead, you'll need to be super careful about ventilation (like LOTS OF IT) and a true respirator, not just a cloth / material mask. Containment from the rest of the house will also be critical.
Comment: That used to be the fashion. Carpets were never fully-fitted back then, they were plonked in the middle with a space round the edges… which got painted if if got past its best.
Answer: Generally old hardwood floors are resurfaced by sanding with a floor sander.
You may be able to remove the paint with a stripper product but usually you will not be able to get the color of the stripped floor matched with the unpainted surface that adjoins it.
Floor sanders and supplies are available for rent at most tool rental shops:
Comment: If the paint is lead-based, and there's a non-zero chance it is based on the way and area in which it was applied, a chemical stripper would likely be the best way to get rid of the paint, followed by a sanding to even out the whole floor prior to refinishing.


What is the best C++ Mail library used to read EML file / Outlook MSG file?

Question: We have to develop an in-house mail app. Please let me know what the best CPP library used to read EML file and Outlook MSG file?
Answer: This seems to be a suitable tool for conversion. Propriety formats (regardless from what vendor) are a pest. RCF822 Multi-Part MIME (which is what you find usually in EML files) rulez!
Answer: EML is basically the same as MHT; it's a plain text format which you can parse yourself, and I believe the WebBrowser control can also display the contents of an EML/MHT.
MSG is a binary MAPI format. You can use the MAPI libraries to deal with these (Windows only). For more information on how to deal with that, see this page.


Can I use a photo of a product on my portfolio page without permission?

Question: I would like to show my skills when taking photos of products. In this case I will use "Curology" skincare. I don't have permission to use their products. Will I get in copy right trouble if I put it on my personal portfolio website? (I live in the US).
Comment: Maybe will be better to ask your questions here: https://law.stackexchange.com/
Comment: Why the downvote to the question? Any suggestions for the new user to improve any deficiencies would be helpful.
Comment: The Mickey Mouse laws in the US are insane, but a copyright violation it's not if it's a photograph you took yourself; the copyright is yours. There may be other statutes you need to be aware of, depending on your jurisdiction.
Comment: You need to research on trademark law and if it applies in your case. It might be an alternative to use generic items with a self-designed fantasy product label to avoid potential hassle.
Comment: IMHO you should have several brands so you can better argue that the use of a specific brand was incidental. Plus if one of them sues you can start a Twitter campaign denouncing them as a bunch of *ssh*les because the other brands didn't complain.
Comment: Show your Photoshop skills by removing the logo in post.
Answer: The standard "I am not a lawyer; don't rely on legal advice from strangers on the internet" disclaimer applies.
Generally, you are legally allowed to photograph products and their logos in the U.S., and publish those photos on your website.
Avoid things that imply: endorsement by the company or the trademark owner; commissioning of your photo by the company; or really, any relationship whatsoever. Also avoid somehow showing the products or the marks that can be construed as maliciously false or damaging to them, etc. Anything like that would expose you to tort claims.
Of course, the company is not prevented from filing suit against you, even if the suit has little or no merit – SLAPP (strategic lawsuits against public participation) suits are an example of this type of action (although usually, it's to silence criticism of the company, and are less often about photographs). Often times, the artist/photographer/writer settles such suits, even though they are not in violation of any laws; the cost of responding to and fighting such suits is more than the creator is willing to spend. (In those cases, often "settlement" is just agreeing to a cease-and-desist, i.e., removal/unpublication of the photo(s).) So the suits are effective in achieving their goal, even though they are never heard in court.
Comment: @osullic, in the U.S. you can sue anybody for anything without merit. It is commonly done in corporate America to cause financial grief. If you are sued, you need to respond. A lawyer is generally needed.
Comment: @osullic Well, sure, but in those cases, the company probably isn't suing you in small claims court, in your own jurisdiction. So you're going to the jurisdiction most favorable to them (sometimes, those are filed in certain _notoriously_ pro-corporate federal circuits). And for anything more than petty small claims court, it's inadvisable to appear without an attorney ("a person acting as their own attorney has a fool for a client..."). So just the cost of travel, and minimal defense attorney costs, can be enough to push most people to settle.
Comment: To the anon downvoter, why the downvote to the answer? Anything I can do to improve it? Is my answer completely off-base? Just wondering. Thanks.
Comment: I'm curious... why does it cost _anything_ if someone files a lawsuit against you when you are not in violation of any laws? Can't you just simply ignore it? If you are issued with a court summons, well, attend the court – you didn't do anything wrong. I don't see where you have to pay anything.
Answer: Legal concerns can only be addressed by a lawyer. All of the small particulars of what is being done, who is doing it, and who might be interested matter.
Even if what you do is clearly fair use, the right's holder may choose to sue. That will likely create stress. It might involve paying a lawyer. It might involve your site being taken down by your hosting provider.
If it really matters, hire a lawyer.
But legality is less a potential minefield than how people viewing your work will interpret it.
Solely thinking about "professional" as meaning someone who is paid to make pictures (and including nothing about competence or ethics), the image might shout a lack of professional experience. Because it is clearly not client work.
Even worse, it is something you have to explain to potential clients. What makes it bad is that it is a conversation about "your problem" rather than the client's problem that they want to give you money to solve.
There is a whole world full of alternatives that will showcase your talent without generating issues to think about. Without the potential to learn lessons on copyright the hard way. Talk to local merchants and restaurants. Tell them you are trying to learn and ask to photograph their products for your portfolio not for free. Some will say no. But someone will say yes so long as you are thoughtful in planning and considerate in expectations.
Even better, you will have conversations with potential clients. Maybe they won't be clients this year or next but five or ten years down the road. And you will have experience in client relations that will serve you well as your career grows and advances.


How to remove debug statements from production code in Java

Question: Is it possible for the compiler to remove statements used for debugging purposes (such as logging) from production code? The debug statements would need to be marked somehow, maybe using annotations.
It's easy to set a property (debug = true) and check it at each debug statement, but this can reduce performance. It would be nice if the compiler would simply make the debug statements vanish.
Answer: Two recommendations.
First:
for real logging, use a modern logging package like log4j or java's own built in logging. Don't worry about performance so much, the logging level check is on the order of nanoseconds. (it's an integer comparison).
And if you have more than a single log statement, guard the whole block:
(log4j, for example:)
if (logger.isDebugEnabled()) {

  // perform expensive operations
  // build string to log

  logger.debug("....");
}

This gives you the added ability control logging at runtime. Having to restart and run a debug build can be very inconvenient.
Second:
You may find assertions are more what you need. An assertion is a statement which evaluates to a boolean result, with an optional message:
 assert (sky.state != FALLING) : "The sky is falling!";

Whenever the assertion results in a false, the assertion fails and an AssertionError is thrown containing your message (this is an unchecked exception, intended to exit the application).
The neat thing is, these are treated special by the JVM and can toggled at runtime down to the class level, using a VM parameter (no recompile needed). If not enabled, there is zero overhead.
Comment: Here's how to enable assertions in Eclipse: [link](http://www.coderanch.com/t/416987/vc/enable-Assertions-eclipse)
Comment: This isn't an answert. It does not explain how to make the statements 'vanish' for the compiler (thus not visible in the class file). Do you have some information on that ?
Answer: public abstract class Config
{
    public static final boolean ENABLELOGGING = true;
}

import static Config.*;

public class MyClass
{
    public myMethod()
    {
        System.out.println("Hello, non-logging world");

        if (ENABLELOGGING)
        {
            log("Hello, logging world.");
        }
    }
}

The compiler will remove the code block with "Hello, logging world." in it if ENABLE_LOGGING is set to true because it's a static final value. If you use an obfuscator such as proguard, then the Config class will vanish too.
An obfuscator would also allow things like this instead:
public class MyClass
{
    public myMethod()
    {
        System.out.println("Hello, non-logging world");

        Log.log("Hello, logging world.");
    }
}

import static Config.*;

public abstract class Log
{
    public static void log(String s)
    {
        if (ENABLELOGGING)
        {
            log(s);
        }
    }
}

The method Log#log would reduce to nothing in the compiler, and be removed by the obfuscator, along with any calls to that method and eventually even the Log class would itself be removed.
Answer: Another possibility is to put the if statement within your logging function, you get less code this way, but at the expense of some extra function calls.
I'm also not a big fan of completely removing the debug code. Once you're in production, you'll probably need access to debug messages if something goes wrong. If you remove all of your code level debugging, than this isn't a possibility.
Answer: This "trick" seems to make your debug statements vanished
public static final boolean DEBUG = false;

if (DEBUG) { //disapeared on compilation }

The post said that javac is smart enough to check the static final boolean and exclude the debug statements. (I did not personally try it)
For logging, I personally donot like to see code like:
if (logger.isDebugEnabled()) {
    logger.debug("....");
}
realImportantWork();

The logging things distracts me from the realImportantWork(). The right way for me is:
logger.debug("....");
realImportantWork()

plus the config which excludes all debug messages on Production.
I mean that the logger.isDebugEnabled() control should be the job of the logging framework, not my job. Most logging framework support concepts like "logger", "LogLevel".. which can do the trick.
Answer: Use Java Preprocessor?  (google foo low but this is a link to the old Joel forums discussing it)
Answer: Java contains some sort of preprocessor of its own. It's called APT. It processes and generates code. At the moment I'm not sure how this should work (I haven't tried it). But it seems to be used for these kind of things.
Answer: I would also highly recommend using a logging framework.
The logger.IsDebugEnabled() is not mandatory, it is just that it can be faster to check whether the system is in the debug level before logging.
Using a logging framework means you can configure logging levels on the fly without restarting the application.
You could have logging like:
logger.error("Something bad happened")
logger.debug("Something bad happend with loads more detail")

Answer: To directly answer your question: I don't know.
But here is another solution to your problem:
In my mind, there are two statements that collide with each other here: "debug statements" and "production code".
What is the purpose of debug statements? Help to get rid of bugs while (unit) testing. If a piece of software is properly tested and works according to the requirements, debug statements are nothing else but OBSOLETE.
I strongly disagree with leaving any debug statements in production code. I bet nobody bothers testing side-effects of debug code in production code. The code probably does what it's supposed to do, but does it do more than that? Do all your #defines work correctly and really take ALL of the debug code out? Who analyzes 100000 lines of pre-processed code to see if all the debug stuff is gone?
Unless we have a different definition of production code, you should consider taking out the debug statements after the code is tested and be done with it.
Comment: Debugging statements in production code can be a lifesaver if you have to debug a production system (no debugger). And software is never "properly tested and works", you just get closer and closer...
Comment: You want to erase possibly hundreds of debug statements? And then add them back when you continue development? Sorry but this is why #DEFINE has been invented in the first place. Also this is Java, not C.
Why answer a question if you don't know?


Inference from a sometimes-random time-series

Question: Let's say we have two cointegrated time-series, $Y_{1}$ and $Y_{2}$, and I want to assess the causal impact of $Y_{1}$ on $Y_{2}$. There is good reason to think that both variables are influenced by a variety of outside factors.
$Y_{1}$ contains some observations equal to 0 (in my case, about 12 from a total 100) that are generated completely independently from the rest of the data (which are never equal to 0). That is, sometimes $Y_1$ is turned off in a quasi-experimental way.
What would be the best way of narrowing down the range of possible impacts of $Y_1$ on $Y_2$?
Context
I am helping a non-profit assess the impact of their advertising spend, $Y_1$ on $Y_2$, their website hits. Both series ramp up exponentially towards the campaign's deadline, so the residuals of $\ln(Y_{1, t}) = \beta_{0} + \beta_{1}\ln(Y_{2, t}) + \epsilon_t$ are stationary. Both series have significant autocorrelation also.
At several stages during the campaign the NFP renegotiated contracts with their media buyer, resulting in exogenous advertising black-out periods.
I'd be very comfortable drawing inference in a cross-section; my experience with economic time-series is that 'causal' parameters are often poorly identified, using bodgy instruments or sign restrictions. But I don't know much about doing quasi-experimental inference in time-series. Any guidance would be greatly appreciated.
Answer: This can be handled by making an indicator variable for the periods when $Y_1=0$
Comment: Also, check out the koyck distributed lag. It was used a lot for advertsiing -revenue analysis in the 70's and 80's. It's a special case of an ARDL model in econometrics.


Why do Bodhisattvas postpone enlightenment?

Question: I've read that one understanding of Bodhisattvas is that they postpone their enlightenment until all sentient beings have entered Nirvana? That's always struck me as odd. Why would this be necessary? Surely the Buddha was enlightened and he worked for the benefit of all beings too. Or is that an incorrect understanding of what a Bodhisattva is?
Comment: Is this a duplicate of "[Does Mahayana Buddhism discourage attaining enlightenment under the Gautama Buddha Sasana?](http://buddhism.stackexchange.com/q/2341/254)"?
Comment: added mahayana tag as this question is in such a context.
Answer: This question (more or less) was asked a year ago. I recently gave a fairly fully answer to it.


How to set Facebook uploaded videos to play as "HD" by default?

Question: When I upload a video to Facebook (not from Youtube, an actual video file), the Facebook player has a setting to play it back in "HD" via a button in the lower right hand corner of the player. Is it possible to get this "HD" setting to be the default when people click on the video? I was not able to find anything online regarding this, except this which doesn't even work (for me at least, I'm using Chrome if that makes any difference).
Comment: Settings > Videos > Video Default Quality > HD if available

You're welcome!
Comment: Wellll...I think that's only for viewing videos for yourself on your own account. This still doesn't solve how to set how it shows for others who watch a video I uploaded. The reason still being gronostaj's answer cited below.
Answer: It's not possible. Also note that not everybody has a network connection that allows to watch HD videos comfortably.
Comment: It is definitely possible all the videos uploaded on GoPro facebook page play in HD by default. I just don't know how to do that.
Comment: I realize this answer is old. I was waiting to see if anyone had alternatives. Thank you for the info.


how to create wallet for tokens

Question: trying to find out but still didnt got how all this work ? How to create a wallet for the token you created on ERC20 contract ? what all things need to know and the flow of over all process can anyone ?
Answer: Any Ethereum wallet address can hold any ERC20 token because the contract simply maps your address to an integer balance. Therefore, you can use the same wallet you already use for Ether.
Comment: so basically you are saying that the ethereum address is used to transfer ERC20 tokens ? Is it possible to create another wallet other then the one we use for Ethereum and if the same address will use then how the address will specify which one is ethereum and which one is the token created ?
Comment: also how to create a wallet for the tokens made in ERC20 ?
Comment: @macrichard your follow up question does not make any sense
Comment: @macrichard I suggest doing a bit more research into how ERC20 tokens work. ERC20 is just a special type of smart contract, which you call using a standard Ethereum wallet address. You can create as many Ethereum wallets as you want. Any of them can "hold" your ERC20 token, and any of them can hold ETH.

how to create wallet for tokens


Principal opens of spectrum of a ring are (quasi-)compact

Question: I am doing exercise 17 in Atiyah-MacDonald, in particular I am not confident with my solution for part vi):

[Let $A$ be a ring.] For each $f \in A$, let $X_f$ denote the complement of $V(f) [= \{\text{prime ideals containing }f\}]$ in $\mathrm{Spec}(A)$. The sets $X_f$ are open. Show that they form a basis for the Zariski topology, and that

[...]
v) $X[=\mathrm{Spec}(A)]$ is quasi-compact (that is, every open covering of $X$ has a finite subcovering).
vi) More generally, each $X_f$ is quasi-compact.
[...]

My solution for (v) (to give context)
I've proven (v) as follows.
It suffices to consider open covers with principal open sets.
Let $(X_{f_i})_{i \in I}$ be one such cover.
Then for any ideal $\mathfrak{a} \triangleleft A$, if $\mathfrak{a}$ is proper then we can extend it to a prime (maximal) ideal $\mathfrak{p}$ and then, due to the open cover there is an $i \in I$ such that $f_i \notin \mathfrak{p} \supseteq \mathfrak{a}$, so $f_i \notin \mathfrak{a}$.
Taking the contrapositive, any ideal containing all of the $f_i$ will be the whole ring $A$.
Therefore the ideal generated by all the $f_i$ is $(1)$, so there is a finitely supported $A$-linear combination of the $f_i$ that equals $1$:
$$ \sum_{i \in J} g_i f_i = 1 \qquad J \subseteq I,\ J\text{ is finite}$$
Therefore, a prime ideal cannot contain $f_{i}$ for all $i \in J$, as otherwise it would contain 1.
Hence we obtain the finite subcover $(X_{f_i})_{i \in J}$.
First (failed) attempt for (vi)
For part (vi), first I noticed that any open set $V$ in $X_f$ with the subspace topology can be written as $X_f \cap U$ where $U$ is open in $X$, which in turn can be written as a union of principal open sets $U = \bigcup_{i \in I} X_{f_i}$; so we can write
$$V = X_f \cap U = X_f \cap \bigcup_{i \in I} X_{f_i} = \bigcup_{i \in I} X_f \cap X_{f_i} = \bigcup_{i \in I} X_{f \cdot f_i}$$
So I tried using the same reasoning as before.
The claim I was trying to prove is that if an ideal does not contain $f$ then it does not contain all of the $f \cdot f_i$, but this is not necessarily true as when we extend an arbitrary proper ideal to a prime ideal, we might be adding $f$ in the process.
Second attempt for (vi)
So I tried this other approach.
I claim that $X_f$ with the subspace topology is homeomorphic to $\mathrm{Spec}(A_f)$ with the Zariski topology, where $A_f = S^{-1}A$ denotes the localization of $A$ at $S = \{f^n\}_{n \ge 0}$.
If this claim is true, then I can use part v) to argue that $\mathrm{Spec}(A_f)$ is compact, hence so is $X_f$.
To prove the claim, I argue that localization gives us a bijection $\mathfrak{p} \mapsto S^{-1}\mathfrak{p}$ between the prime ideals of $A$ that do not meet $S$ and the prime ideals of $S^{-1}A$; but the prime ideals of $A$ that do not meet $S$ (i.e. that do not contain any power of $f$) are, by primality, the prime ideals that do not contain $f$ itself; so this is a bijection $X_f \to \mathrm{Spec}(A_f)$.
Moreover, both this map and its inverse are continuous because the image of a closed set $X_f \cap V(E)$ is $V(i(E))$ (which is closed) and the preimage of a closed set $V(F)$ is $X_f \cap V(i^{-1}(F))$ (which is closed), where $i \colon A \to A_f$ is the natural map, because extension and contraction of ideals preserves inclusions and $V(E)$ is defined as the set of prime ideals containing the set $E \subseteq A$.
I am not very confident about the continuity argument when showing that this bijection is a homeomorphism. Is it correct?
Alternatively, can the first, more elementary approach also be continued?
Answer: Let $\{X_{f_i}\}_{i\in I}$ be a cover of $X_f$, i.e., $X_f\subset\bigcup_{i\in I}X_{f_i}$. Taking the compliment, we have $$V(f)\supset \bigcap_{i\in I}V(f_i)=V\big((f_i)_{i\in I}\big),$$
i.e.,
$(f^m)\subset (f_i)_{i\in I}$ for some $m\ge1$. Thus, $f^m=\sum_{i\in J}a_if_i$ for some finite subset $J\subset I$ and $a_i\in A$. Now $X_f\subset \bigcup_{i\in J}X_{f_i}$.
Comment: How can we deduce $(f) \subseteq (f_i)_{i \in I}$ from $V(f) \supseteq V((f_i)_{i \in i})$? The latter inclusion tells us that every prime ideal containing all of the $f_i$ also contains $f$. This just tells us that $(f) \subseteq \sqrt{(f)} \subseteq \sqrt{(f_i)_{i \in I}}$, since the radical of an ideal is the intersection of all prime ideals that contain it. But the ideal generated by the $f_i$ could be non-radical.
Comment: @Anakhand Sorry yes you are correct, I have fixed the claim.


Hyperscale Vs Strong-scale HPC

Question: NVIDIA's Tesla GPUs for Servers includes market segments called "Hyperscale HPC" and "Strong-Scale HPC". How different is "Strong-Scale"ing  from  "Hyperscale"ing ?
Answer: Those are both marketing words. Either ask NVIDIA what they mean by them, or ignore them. NVIDIA appears to be using them to classify different product lines, at either different cost levels or different levels of parallelism. You can almost certainly ignore these marketing terms safely. They have no definite meaning to me.
Comment: I agree, one would want to look at your requirements vs hardware capabilities and ignore buzz words. I first saw the new buzz word "hyperscale" used by the trade press, not NVIDIA, in connection with cloud computing. The way I interpret it, using Seymour Cray's famous analogy: Strong-scaling: two strong oxen, hyper-scaling: 1024 chickens.

Hyperscale Vs Strong-scale HPC


"Deutzer Freiheit"

Question: When I was in Köln I found myself on the street called "Deutzer Freiheit." I was curious, what does the term "Freiheit" mean in this case. I know that it translates to English as "freedom", but why would a street have this name? It is unlike other German terms denoting streets (i.e. -straße, -gasse, -weg, -allee, etc.)
Answer: In general, many streets do have some word for "street" or similar in their name, "-straße", "-gasse", "-weg", "-allee" as you noted. But there's also no small number of street names that don't follow this pattern. To name just one example of many, in Langen in Hesse there's a street simply called "Außerhalb".
Regarding your specific example, to understand that we have to take a birds-eye look at the organisation of communities in the Middle Ages. A central element was the Lehnswesen, a system of fiefs. The king owned the country, and he gave parts of it to members of the nobility. Those nobles in return had to pledge allegiance to the king and support him in war and politically. They also had to deliver specified kinds of tributes, like tithes, in money and/or in goods. Those nobles often gave shares of their fief to lesser ranking nobles after the same basic principle. At the end of the chain, the local population had to deliver "Abgaben" (tributes) to their respective "Landesherr" (local territorial ruler).
In those days, the word "Freiheit" often referred to being free of those obligations. For example, a "Freie Stadt" or "Freistadt" had the privilege to govern itself, and didn't have to deliver tributes to a a Landesherr.
Over centuries, Deutz was a community separate from Köln (it only got "eingemeindet" in 1888), and the two cities often competed. At some point, Köln successfully advocated to put down the fortifications of Deutz. That meant that Deutz became an unfortified community - and that meant that Deutz didn't have to pay tributes to the Archbishop of Cologne any more. The street name of "Deutzer Freiheit", "freedom of Deutz", refers to this freedom to this day.
Comment: A reason why exactly this street was named as such might be its function: Up to 1859 this was the street leading to the sole connection between Deutz and Köln, the [ferry](https://de.wikipedia.org/wiki/Deutzer_Gierponte) or since 1822 the pontoon bridge. Leaving Deutz unfortified meant merchants could _freely_ approach the river crossing without first paying taxes for entering Deutz. – In exchange, the ferry itself was licensed to a guild from Deutz.
Answer: Henning Kockerbeck has explained the case of Deutz already, but there are more cities where the name "Freiheit" for a street is meant to indicate the street was free of certain taxations or commercial regulations:

Freiheit in Meißen is a street leading up to the Albrechtsburg. The courts at the street were direct fiefs of the Count, not part of the city and thus were not obliged to pay city taxes.

Große und Kleine Freiheit in Hamburg were streets with a privilege by the city of Altona to open businesses outside of the otherwise obligatory guilds. This was installed in the 18th century as a special support for the Mennonite community of Altona.

There are also several Danziger Freiheit, but those names were part of the NS propaganda to denounce the injustice of the Versailles treaty, and were all named after 1933. Most of these names were dropped after 1945 or re-interpreted like the Stadtfreiheit in Erfurt and the Münchner Freiheit. The Fürther Freiheit equally is a politically motivated name choosen after the liberation in 1946. Finally, there are two Berliner Freiheit in Bremen and Bonn, named in protest against the division of the former German capital.
Comment: The linked article concerning *Münchner Freiheit* contradicts the NS propaganda claim and attributes it to a resistance group, i. e. quite the contrary. There is also [Fürther Freiheit](https://www.fuerthwiki.de/wiki/index.php/Fürther_Freiheit) where the name resulted after some other names were dropped due to relation to NS.
Comment: @guidot Ah. Between 1933 and 1945, the name was also Danziger Freiheit. Thanks for the hint.
Comment: Excellent answer! Another example is a street called "Freiheit" in Spandau (part of Berlin since 1920). The "Freiheitswiesen" used to be a taxation-free common green. https://berlin.kauperts.de/Strassen/Freiheit-13597-Berlin
Answer: For place names that would have developed centuries ago, it makes sense to look up the term in old dictionaries. Grimm's Wörterbuch has the following definition of "Freiheit":

freiheit, ein ort, eine stätte, immunitas. ein schutzort, asyl hiesz freiheit (s. freiort):in den geräumgen hallen,wo Junos freiheit ist.
Schiller 37a.

theile einer stadt, einzelne räume, ganze flecken führen den namen freiheit, so wurde in Cassel neben der altstadt eine freiheit erbaut und bildete eine gesonderte gemeinde, zu Friedberg in der Wetterau heiszt der breite platz vor der burg die freiheit. in Naumburg der domplatz die domfreiheit, vgl. schloszfreiheit, burgfreiheit.

Your confusion might partially stem from the ambiguous meaning of "frei" - It may translate to "free" (as in "liberty"), but also to "open" (like in "open sky") and "unoccupied". For place names, the latter meanings are more obvious, for parts of a settlement that have been placed "in the open", in "formerly unoccupied places" or even simply "just outside the city walls".
Answer: To understand what "Freiheit" here means (basically a place which is unoccupied - free [from buildings]) we need to look at german suffixes. "-heit" is a suffix added to the Adjektiv "frei" (free, unoccupied).
"-heit" is usually the German equivalent to the English "-ness", meaning a state of having the property the adjective to which it is affixed describes. For instance:

healthy - healthyness
gesund - Gesundheit

Analogous with "Freiheit". In most cases this can be translated with "freedom", but that is only a derived meaning. The most literal meaning is "freeness", meaning the state of being free - not being occupied or - as @ccprog explained in his answer - being exempt (free) from some regulations. This is what is meant here.

"Deutzer Freiheit"


Apache web serving serving incomplete pages

Question: I have an Apache web server which several sites are connecting to.
From most sites it is accessible and serves content properly (sites being remote and connected via Cisco VPNs), but there is one site, where the server will serve an incomplete page when requested for the login page of the application we are running.
It does not matter what this application is I guess since it is working fine on 10 other sites, just not on this one.
I am getting exactly 907 bytes of the page (the last 907 bytes out of 4000 bytes).
Wireshark reports that the server response is not the first packet and that there is a packet missing before the capture started. Needless to say I waited minutes to start the browser after the capture started so there is no way a packet really was lost because of Wireshark still trying to start up.
Any idea where I look to resolve this?
As it works everywhere it seems to indicate something goes wrong on the network. Where would I look for such an awkward behaviour where 3000 bytes of a web server response get swallowed?
Comment: The first thing to check is the Apache logs. Do they provide any clues?
Answer: There is no indication on the Apache logs that anything special has occured on the failed pages.


White-list file types for media upload

Question: I'd like to attach files that aren't on the list of supported file types. In this case I'd like to upload files from the media manager that have the .RWP extension (which is used to package files in the Train Simulator 2012 game).
Answer: You can hook the upload_mimes filter to accomplish this:
<code>add_filter('upload_mimes', 'wpse_43657_upload_mimes');
function wpse_43657_upload_mimes($mime_types){
     $mime_types['rwp'] = 'application/octet-stream';
     return $mime_types;
}
</code>
Comment: Just place this in your functions.php file in your theme. :)
Comment: For someone who is still learning to use Wordpress (from a administrators point of view), how would I go about implementing this?

White-list file types for media upload


Acting up for Daddy

Question: My partner's 4 year old daughter lives with us. I look after her more than my partner. She is generally well behaved, polite little girl and we have lots of fun. As soon as Daddy comes home she turns into this demanding whiny little brat. I can not stand it! I think it is because Daddy is much softer than I am so she knows she can be more demanding and play him up. Is this learned behavior? Why is she so well behaved for me?
Comment: Same thing here with my 3 year old.  Usually good for me, but will whine/cry much more for mommy, since she knows mommy is more likely to give her what she wants.
Answer: Children have a very sophisticated sense of what works to get what they want.  Your partner's daughter isn't a whiny brat around you, because you don't respond well to that behavior, but apparently your partner gives in easily to that kind of behavior.
My own daughter has two personalities she puts on for me and my wife.  For me, she is sweet and sugary, because she knows I can be charmed, but refuse to give into whining.  For my wife, she is whiny, because my wife can't be charmed, but gets worn down by whining.
The upshot is the behavior won't change unless your partner commits to not giving into it.
Answer: Yup, agreeing with everyone else, your kid whines for Daddy, because she has empirically learned that it gets her what she wants from him, not from you.  Your way is better, you are doing more child care, he needs to get on board, and not give in.  He needs to be saying "I know you are disappointed, (acknowledging the child's feelings, helping the child to name her own feelings is really helpful) but I'm not giving in".
Answer: I have worked in childcare for many years, and it is my experience that kids will behave much better for caretakers other than their parents (this is true with young elementary school kids as well). It is possible that since "daddy" is a biological parent and (I assume) you came into the picture sometime after she was born, she views you in this way.
I also could be completely wrong, seeing as I don't know your situation. I recognize how you might take offense to this and I assure you I mean none.

Acting up for Daddy


Remove tax from grand total

Question: I need to remove tax from grand total in Magento.
Means I want only show Tax but not add grand total
Answer: you can managed this settign from admin
Go to admin>System>Configuration>Sales>Tax>Shopping Cart Display Settings
make Display Subtotal=Excluding Tax
enter image description here
you can managed tax display setting on cart page,from here :
admin>System>Configuration>Sales>Tax>Shopping Cart Display Setting
===================================================================
How to do this (programatically)....
Under {magento_base}/app/design/frontend/base/default/template/tax/checkout/
Edit file grandtotal.phtml
(I suggest you make a backup of the file just in case).
Find the line:
<?php if ($this->includeTax() && $this->getTotalExclTax()>=0):?>

Delete the subsequent lines:

    <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
        <?php echo $this->helper('tax')->__('Grand Total Excl. Tax')?>

    <td style="<?php echo $this->getStyle() ?>" class="a-right">
        <?php echo $this->helper('checkout')->formatPrice($this->getTotalExclTax()) ?>

This change means it will now only show the tax inclusive line in the cart review.
Comment: I have already setup above setting but not working.
Comment: My quetion is "Remove tax from grant total"
Comment: Kindly look attach image.I need "Grant total = $599"
Comment: I need Grant total show $599 according above image.also it goes same in checkout page means payment section otherwise it gives error.
Comment: than remove tax completely. no tax than no calculation.
Comment: I want only show calculation but not include in anywhere.
Answer: You change your settings under System > Configuration > Sales > Tax
Calculation Settings: Catalog Prices - Including Tax
Price Display Settings:  Display Product Prices In Catalog - Including Tax
Shopping Cart Display Settings:  Include Tax In Grand Total -  Yes
Orders, Invoices, Credit Memos Display Settings:  Display Prices - Including Tax
keep other settings defaults.

Remove tax from grand total


2*2 repeated measures ANOVA with an unbalanced number of observations

Question: Sorry for this very basic question. I've trawled through previous pages and cannot quite find a case that corresponds to our situation. 320 individuals rated two types of films. The rating was provided on a 1-11 scale.There are many films of each type. In short the DV is a continuous variable. 20 individuals have a particular disease that we now consider of interest. We would like to examine the effect of the disease on the rating. We conducted a 2-way repeated measures ANOVA, using 'situation type' as a within-subject factor, and 'disease status' as a between-subject factor, using SPSS. The design is obviously unbalanced with more observations in the healthy group. The data appeared to be normally distributed. Levine test suggested equality of variance. Does that mean it is appropriate to use ANOVA for this analysis?
Answer: Keep in mind that ANOVA is just a particular form of linear regression. So ask yourself whether having different numbers of observations between 2 groups would invalidate a linear regression. It wouldn't.
Having different numbers in your 2 groups would affect the precision of associated regression-coefficient estimates. With only 20 individuals in your disease group you thus might not have enough power to detect a difference unless it's large.
If the underlying assumptions of linear regression/ANOVA are met, as they seem to be in your case, then there is no inherent problem in having different numbers of cases in your groups. I don't use SPSS, but I suspect that it handles this situation correctly.
One final warning: the above assumes that your choice to analyze disease status was made without having seen a disease-associated difference in the results first. If you base analyses on results of peeking at the data, then  you are violating assumptions underlying statistical testing.


Why does the infield arc have a radius of 95 feet?

Question: The dirt on a baseball infield extends out to an arc centered on the lip of the pitching rubber (60' 6" from home) and has a radius of 95'. This makes the distance from home to the very edge of the arc 155' 6" and the distance to the edge of the dirt along the foul lines about 127'7".  Why was this value of 95' chosen? Why not, say, round it up to 100'? Or make it 90' to be consistent with the basepaths? Or perhaps shrink it to about 70', which is about the minimum size needed to fit all the bases inside? 95' just seems like such an oddly specific number that there must be a reason for it. But searching the internet just gives results explaining what the dimensions are and how to construct a field; I can't find a source that explains why a radius of 95' was chosen.
Comment: Good question - I can't find the answer either.  I suspect it was, like with all of the rest of the sport, a trial and error thing; but I also don't think it was finalized as early as the rest of the dimensions - look at [Ebbets Field](https://ballparks.com/baseball/national/ebbets.htm), it has a different shape (and, no dirt).  Most of the other dimensions were finalized by around 1900.
Answer: Like @Joe said in the comments, I could not find the answer, but I believe that the infield arc has a radius of 95 ft. because it makes sense with the timing of the runner so that fielders can make good plays, but it is also a short enough distance (90 ft. base paths) that the runner can still beat out an infield hit. If it was longer, say 100+ feet as you mentioned, then it would be like having to gun a runner at third from the outfield whenever the third baseman had to throw to the first baseman. Also, if the radius was larger, then the base paths would be longer and it would be harder to get hits and XBHs. However, if they were a lot shorter, say the radius was 70 ft. as mentioned in the question, the distance between the bases would be a lot shorter, and routine ground balls would become infield hits for the faster runners. Also, I think that they (the people who created baseball) made the infield arc 95 ft. because they wanted it to be a diamond and not some other random quadrilateral. I believe that the infield arc was also made this distance for base stealers; the catcher could gun them down, but they could still be safe at least (for most) 2/3s of the time.
Comment: This doesn't really address the question. You can change the radius of the arc without changing the dimensions of the infield. To a casual fan (me), the arc seems like it's arbitrarily sized _relative to the infield_.
Comment: Agree. I honestly have no idea as to why they made the ark radius 95 ft
Comment: The length of the base paths is fixed at 90ft in Section 2 of MLB rules, while the arc is simply a recommended measurement based on common usage. The arc size, if anything, is influenced by the infield, not the other way around.


How to record Sounds from Trains without being spotted?

Question: there i am recording for like 2 years my train rides. Sometimes people look at me weird because i record audio/Video. Are there any tricks how not to be spotted?
Answer: Sometimes you just have to have the gumption to get what you need. As a Sound designer for independent films I've had to do all sorts from pub ambience and once I needed the sound of school children in a class room (that was I nightmare). Most recently I needed the sound of a child's swing in a play ground (the public Park type ones with chains) for a horror film. A women with a child must of thought I was totally weird pushing this empty swing. But needs must.
You can get small recorders that are discreet. But the smaller they are the poorer the quality. I use to use an Olympus LS11 about the size of a cell phone. But my Marantz 661 is far better quality but it's the size of a brick.
I just go out and record if people ask you to leave because your on private property etc then do so, as long as you get what you need. But don't let them try and take your gear off you! Tell them to go **** themselves.
Answer: Privacy in our times is shrinking at a faster rate than Iceland and the North Pole. You might want to take it into account that it matters more for some people than others and some can feel awkward or under surveilance when big microphones or cameras are pointed their ways.
Other than that if you want to capture strictly train mechanical sounds it's obviously better to be in place with as little chatter as possible.
Comment: In my train there are mostly no chats, just sometimes when another train doesnt arive, because some sort of "accident on railswitches"(yes i had this , and the train was filled with people :-)


Why is the law of the excluded middle not a exclusive disjunction?

Question: So the law of the excluded middle, as I have read in every logic textbook that I have read, has been

(
ϕ
∨
¬
ϕ
)

, but this seems somewhat unintuitive, since I was under the impression that the intuition was that only one could be true, i.e.
(
ϕ
⊕
¬
ϕ
)
. Now I understand that the latter is derivable from the former using the law of non-contradiction, but my question is why we don't refer specifically to the latter form when we talk about the law of the excluded middle.
Comment: It is because it is helpful to distinguish the law of excluded middle from the law of non-contradiction. By using an exclusive or, you are effectively stating both at once. Some logics have one but not the other, so we need to be able to state them separately.
Comment: Because "standard" modern symbolic logic formalizes arguments using "inclusive or" as primitive and "exclusive or" as a derived one.
Comment: We can use XOR to express LEM, and Reichenbach even advocated such per wiki [ref](https://en.wikipedia.org/wiki/Law_of_excluded_middle#Reichenbach): *It is correct, at least for bivalent logic—i.e. it can be seen with a Karnaugh map—that this law removes "the middle" of the inclusive-or used in his law. And this is the point of Reichenbach's demonstration that some believe the exclusive-or should take the place of the inclusive-or.* In fact combining XOR with conjunction produce a field which can represent any logic obtainable with usual Boolean lattice formed by conjunction and disjunction...
Comment: I think that the "shift" from exclusive to inclusive or occurred in [The Algebra of Logic Tradition](https://plato.stanford.edu/entries/algebra-logic-tradition/#a184BegModVerAlgLog): John Venn (1881) seems exclusive while Peirce (1885) is inclusive: the motivation seems to be to validate De Morgan's laws. Peano (1889) explicitly call it *vel* (Latin inclusive or, compared to *aut*).
Comment: In parallel, there is Frege (1879)'s approach: "Of the two ways in which the expression "A or B" is used, the first, which does not exclude the coexistence of A and B, is the more important, and we shall use the word "or" in this sense."
Answer: It's one of TWO principles. One principle is that out of S and (not S), at least one must be true. Another, separate principle is that S and (not S) cannot both be true. The first principle gives us completeness, the second gives us freedom from contradictions.
Obviously if you combine both then exactly one of S and (not S) must be true.
Answer: It depends on which language of logic is being used; there's one answer for classical disjunction, and another for linear disjunctions.
In classical fragments, there is only one disjunction. Note that "ϕ ⊕ Ψ" can be defined as (isomorphic to) the definition "(ϕ ∨ Ψ) ∧ ¬(ϕ ∧ Ψ)". Substituting for the special case of LEM, we are therefore asking for "(ϕ ∨ ¬ϕ) ∧ ¬(ϕ ∧ ¬ϕ)". But note that "ϕ ∧ ¬ϕ" is always false (via proof by truth tables), so our right-hand side of our topmost conjunction is always true, and may be removed; as a result, "ϕ ⊕ ¬ϕ" reduces to "ϕ ∨ ¬ϕ". This also holds intuitionistically. (This reduction is actually an equivalence!)
For linear logic, which has two disjunctions, the details are different. Quoting SEP on linear logic (and fixing their connectors for readability):

For example, the law of excluded middle (A ∨ ¬A) is considered valid in the classical world and absurd in the intuitionistic one. But in linear logic, this law has two readings: the additive version (A ⊕ ¬A) is not provable and corresponds to the intuitionistic reading of disjunction; the multiplicative version (A ⅋ ¬A) is trivially provable and simply corresponds to the tautology (A ⊸ A) that is perfectly acceptable in intuitionistic logic too.

Interpreted via the common vending-machine semantics for linear logic, "ϕ ⊕ ¬ϕ" asserts LEM for ϕ, or that ϕ is decidable; it says that we may either have ϕ or ¬ϕ, but we don't choose which.
Answer:
So the law of the excluded middle, as I have read in every logic textbook that I have read, has been ( ϕ ∨ ¬ ϕ ) , but this seems somewhat unintuitive, since I was under the impression that the intuition was that only one could be true, i.e. ( ϕ ⊕ ¬ ϕ ) . Now I understand that the latter is derivable from the former using the law of non-contradiction, but my question is why we don't refer specifically to the latter form when we talk about the law of the excluded middle.

Yes, you are absolutely correct. The standard formulation which says "ϕ ∨ ¬ϕ" does not preclude ϕ being both true and false, and this would be in effect a third alternative between true and false, which is precisely what the Law of Excluded Middle (LEM) wants to precludes.
The LEM is as the label says the law which excludes a "middle" alternative between ϕ and ¬ϕ. This just means that ϕ is either true or false, and so not possibly both, as ϕ ∨ ¬ϕ suggests.
The problem comes with mathematical logic. Philosophers and mathematicians working on a mathematical model of logic starting with George Boole in the 19th century have come to redact very nearly all the definitions of the key terminology of formal logic, including the word "logic" itself, which is routinely presented as nothing but a formal discipline.
Another example of this is the pseudo "law of non-contradiction", which in effect falsely says that there are no contradictions. The correct formulation is "Law of Contradiction", written ¬(ϕ ∧ ¬ϕ), which just says, correctly, that contradictions exist and that they are false.


Should I take the bet?

Question: If I win the bet I get 200 dollars and my winning probability is 0.1 and if I lose I give 20 dollars. Should I take the bet?
Comment: It depends entirely on how you value the outcomes, which relates to how you value money and risk.
Comment: I wouldn't. Winning \$200 won't change my life, nor will losing \$20. So why waste my time on this?
Answer: It depends on many factors. First - are you taking the bet once or as long as you want?

If you take it just once then the answer is no, as there is much higher probability of losing money then winning(even though the expected value is positive)
If you can take this bet for as long as you want, it is a good  bet, as with expected value of income equal to 2, we could expect that if we play long enough - we will gain more and more money

In general the problem here is weighting the expected outcome (expected value) and the risk (variance) of the process. In "real life", where all resources are limited, the risk factor may be much bigger then the one coming from expected outcome (which is just a theoretical entity). As such there is no good answer for "real world" bet, only for theoretical betting games, where there exists infinity
Comment: This answer is incorrect for two reasons.  First, the expected income is $200*0.1-20*0.9=2$, so this is a positive expectation bet.  Second, if it were not a positive expectation bet, then it would not be a good idea to take it even if you could do it as many times as you want.  Yes, you would eventually end up with a positive amount of money, but the expected value of the amount of time until this happens is infinite.  Moreover, if you have a finite bankroll, and you play long enough, then with probability $1$ you will eventually go broke.
Comment: If you plan to do this only once then it is not so easy. It depends on what is your "aim", as there is still bigger chance of losing some money, no matter how big is a possible prize. Consider something like this: you have 0.00000000000000000001 chance of winning power of becoming a god, and 0.99999999999999999999 that you will lose your arm. Even though becoming a god should have nearly infinite "reward", and so expected value of this bet is positive it does not mean that a rational person would go for it, as with enormous chance you will lose an arm
Comment: Thanks, and if suppose I had to give 10 dollars, then I should take it right? This means that if probability of me winning some lottery is 0.00001 but I get 1 million for it, and the lottery ticket is 5 dolars, then I should buy the lottery?
Comment: In case of a lottery: if you can but as much tickets as you want (you have enough money), the lottery is fair (random) and only you can win (there is no top-winners splitting policy) then once the expected value is bigger then zero, you should buy ALL possible tickets (in case of some number guessing lottery) and you can rest assured that you will win. In more randomized lotteries it is still statistically better to buy as much as you only can (if above conditions hold and that there is true randomization in bought tickets) but with just a probabilistic "guarantees".
Comment: Am I completely off or isn't the expected income 2? $0.1 \cdot 200 + 0.9 \cdot -20 = 2$. Then I'll think it is a quite good bet, though, depending on the factors Glen_b mentions.

Should I take the bet?


Is it necessary to normalize data for XGBoost?

Question: MinMaxScaler() in scikit-learn is used for data normalization (a.k.a feature scaling). Data normalization is not necessary for decision trees. Since XGBoost is based on decision trees, is it necessary to do data normalization using MinMaxScaler() for data to be fed to XGBoost machine learning models?
Answer: Your rationale is indeed correct: decision trees do not require normalization of their inputs; and since XGBoost is essentially an ensemble algorithm comprised of decision trees, it does not require normalization for the inputs either.
For corroboration, see also the thread Is Normalization necessary? at the XGBoost Github repo, where the answer by the lead XGBoost developer is a clear:

no you do not have to normalize the features
Comment: doesn't reg_alpha and reg_lambda, the coefficients of regularization on weights, mean that weights should be on the same scale? Or does this happen naturally in XGBoost?
Comment: @ItamarMushkin not sure I'm following; maybe better to open a new question with the details? And weights are *not* data.
Answer: While decision trees have a natural resistance to outliers, boosted trees are susceptible, since new trees are built off the residual. Normalization, or even just a log transform, will give you better protection from outliers.
For an XGB model that is planned to go into production, I recommend doing it.  It's not like one can interpret the output anyway. I think of XGBoost as being on the black box side.
Comment: Normalization is not about removing outliers, which will be present anyway [even after normalization](https://stackoverflow.com/questions/51841506/data-standardization-vs-normalization-vs-robust-scaler); and the residuals have to do with the output, not with the features, which the question is about.
Answer: It's not a bad idea so much as it's unnecessary. So, if you don't do it, you leave your features on the scale they are already and thus in prediction of new data, you don't have to worry about scaling said data exactly the same.
It's unnecessary since the base learners are trees, and any monotonic function of any feature variable will have no effect on how the trees are formed.


grant application review request

Question: If reviewers get requests for reviewing grant applications from people they know personally, what should they do if they don't know how to comment, as the proposals are good, but don't want to quit either?
Comment: It is not quite clear what you are asking. Could you clarify, maybe by using more than one run-on sentence?
Comment: What does "but don't want to quit either" mean?
Comment: The question seems pretty clear to me.
Comment: Not clear what you mean. Also people I know personally ranges from relatives to barely met at a conference people. I imagine that in some cases there could a positive bias but that should be mainly a concern for the funding agency. What do you exactly are asking for?
Comment: We cannot answer this question because the correct answer depends on exactly how you know the person.  Ask yourself if you can write a fair review.  Only review if the answer is yes.
Answer: Once you've been in a field for long enough, essentially every proposal and paper is from someone who you know personally to some degree. That's unavoidable and knowing someone does not, in itself, constitute a conflict of interest.
The question that the funding agency will want to know about is whether you feel conflicted in writing an honest and fair review -- or, maybe more importantly, whether an external observer might wonder whether you might be conflicted in writing an honest and fair review. In other words, do you (or might someone think that you do) stand to gain something by writing a good or bad review?
If you conclude that you might be biased, or that someone else might think that you're biased, then you should decline to review. Otherwise, there is no reason to decline a review just because you know the author.
Answer: If you believe that you can treat this review as you would any other, honestly and fairly, then there is no obstacle. Otherwise don't do it. Don't review for your spouse or for your worst enemy.
However, the person or organization that requested the review should first be notified that you know the person. If you have any personal relationship with them, beyond superficial knowledge, then reveal that.  You don't want charges of bias to later be made, so defer the decision to the person who asked.

grant application review request


Can I say "Sam offered to minute take"?

Question: Is it correct to say "Sam offered to minute take" regarding meetings, it sounds wrong & clumsy to me? If incorrect, what would the correct form be?
Comment: I've heard of "offered to take the minutes (of a meeting)", but not "offered to minute-take". I'm AmE, so I'm wondering whether "minute-take" is mostly a BrE thing?
Comment: Temperature-take the room? Temperature-take the patient?
Comment: it would work if it was hyphenated, "Sam offered to minute-take" That would remove the confusion. .."to take the minutes" would perhaps be more comfortable, but hyphenated wouldn't bother me greatly.
Comment: What @Tetsujin said. I also don't have any real problem with **minute take** as a sort of "limited-scope phrasal verb" - which is to say it's okay as an **infinitive**, but I wouldn't be so keen on conjugated forms such as *"She **minute took** the meeting"*, or *"The meeting **was minute taken** by Sam"*. The hyphen makes the usage more obvious (and thus more acceptable) in the *written* form - but that's not really important, since you can't *hear* it in the spoken form (i.e. - in "real" language).
Comment: It strikes me as non-standard (US English), and I couldn't immediately figure out what was meant. I'm used to *offered to take minutes.*
Comment: Why the confusion of American English speakers? We don't *minute-take* in the USA. We *take minutes* of a meeting. Or we might need to *take a minute* to prepare for a meeting, even if that *minute* turns into twenty or more minutes.
Answer: Poppy, if you are going to standard English, the correct phrase is, "Sam offered to take the minutes." Of all the meetings in which I've participated (I lead and also take minutes depending on the group), I've never heard minutes used in the singular. Not that it is technically incorrect, but were I to hear someone say that, I would suspect that English was not their first language. Minutes are always (except perhaps in academia, where rules trump existence) referred to in the plural.

"I took the meeting minutes."
"Can you send the minutes of the meeting."
"Who's taking the minutes?"
Comment: Good answer.  I also commonly see this as "Sam offered to take minutes." without an article at all, but, as you said, minutes is always plural.  Googling around, it looks like the etymology of the phrase has more to do with the details (minutiae) of the meeting than the time elapsed, so the plural would be appropriate.
Comment: Jason, I agree the article is optional. I've heard, "Can you take minutes," almost as much as, "Can you take the minutes." Though, I want to say I've heard and used it with an article more than not.

Can I say "Sam offered to minute take"?


Announcements feature on SE

Question: I think it would be nice to have an Announcements feature on the SE sites. An announcement would work different then a question in the form that some relevant information to the community as a whole is pushed rather then asked for. Before an announcement goes into the general announcements pool, it would need to be peer reviewed. Then it will be visible to the rest of the community and voted on. I imagine this working similar to a hybrid of the review system for users retaining a certain rep and the definition to commit system on area51. A feature like this would be very valuable. For example, recently I found a great free online course this summer for people interested in Machine Learning. An announcement like this would be applicable to a community like Cross Validated but I was unable to push this announcement to the community because there were no particular questions pertaining to the subject at the time or if there was, the questions were long forgotten.
Comment: So, like the per-site Meta? Or maybe the [per-site blog](http://blogoverflow.com/)?
Comment: yes, I suppose - good point. More like the per-site blog rather then the meta. I would like to see this more widely available to users. Looks like you have to jump through a bunch of hoops to make a simple announcement. I'm suggesting this take more of the Q/A format for brevity.
Comment: Right, the Q&A format is what you'd find on Meta, easily accessible for all users. Note that site moderators can add the `[featured]` tag to make a question more prominent and even appear as a link on the homepage. Use your flags to request that they do so.
Comment: yeah but how many people are actually doing this on meta? As far as I know Meta is all about questions concerning the main site itself. In any case, I guess this is good enough.
Comment: I don't know how many people are doing it on their per-site metas right now, but there's certainly nothing *wrong* with doing it. I've done it once or twice on the Philosophy site, but it's still extremely small. The meta site is there for all the community members to use as they see fit, though. It *is* for discussions about the site, but it's for *any* discussions related to the site. The rules are intentionally much less strict there to allow for things like this. (Note for clarity, I mean the *per-site* metas, not this one. For example, http://meta.gaming.stackexchange.com/)
Comment: Right, well cool - if that's within the rules then Meta would be applicable to what I'm suggesting. It still feels like a well we have **Meta** and we have **Community Promotion Ads** and as an edge case what your suggesting is applicable here kind of answer.
Comment: Well, maybe. I kind of have a bias against new features when there's a simple enough way of doing it within the existing design and features that are available. The whole point of meta is kind of "do whatever you want, within reason, as long as it's somehow related to the site".
Answer: I think the right way to do this is through a community promotion ad:

This is a method for the community to control what gets promoted to visitors on the site. For example, you might promote the following things:

cool site-related open source apps
the site's twitter account
scripts packs or power tools
cool events or conferences
anything else your community would genuinely be interested in

The last one seems to fit your purpose. If the ad gets enough votes (6, currently) it will show up periodically in the right panel
Comment: @egfx So you're referring to the question *about* promotion ads? Michael links to the one for CV, and there should be one for all non-beta sites, so you shouldn't have to wait on anyone in order to post a suggested ad.  You will have to wait for it to get upvotes, but that's exactly the same as waiting for the peer review you suggest in your question!  Finally, when you add an answer the question gets bumped in the "Active" list, which is the default display for StackExchange sites, so people *should* see it; the age of the question won't prevent it from being visible.
Comment: I agree, this isn't bad. But it doesn't exactly line up with the same purpose. What if there is some trending information that would be applicable? Would I need to wait for a question before I can push something to the community promotion pool. And what if this applicable question is old and hardly visible?
Comment: @egfx I'm confused as to why you're talking about questions.  Michael's answer is about sidebar ads.  Ads aren't attached to particular questions.
Comment: @Matthew Read , from the suggestion in the link - `put images and links in the answers. If they get voted up enough, they will appear on the main site as community promotion ads.`
Comment: I think I understand this link now. What your saying is that this particular question is considered a `special question` and answers with enough upvotes to this question get a chance to appear as the community ad. It's very ambiguous and I had to read it three times to understand what was going on, but maybe it's just me. I think a simpler, less ambiguous, more direct feature would be better. I don't think many users know about this promotion ads system. And further **They're not about to spend time creating an image for a link that isn't theirs but they want to let the community know about**.
Comment: @egfx That last sentence sounds like the real problem to me
Comment: yep, but I guess in my case, I didn't know about this feature and I consider myself _fairly_ active.
Answer: I think a community ad, as suggested by Micheal, is the best solution, but the site's blog (if you have one) is another viable venue for this sort of thing.
Your example, Cross Validated, has a community blog. If you want to contribute to it, check out the info on the about page on how to get an account.
The benefit of using the blog is that since it isn't a Q/A, you don't have to wait for somebody to ask a relevant question. It is also automatically announced to the whole site when there is a new blog post, via a red new link in the site's header.
Comment: The blog posts being pushed to the whole site is much closer to what I'm talking about. But, in the time I've participated. I've only seen a few special site announcements like the first birthday of the Apple site and what not. These are about the sites mainly and are not really repositories of community reviewed announcements.

Announcements feature on SE


What makes a movie a "cult classic"?

Question: As the title says, what actually defines a cult classic film? As an example, the Cube series (Cube, Cube 2 Hypbercube, and Cube Zero) are labeled as Cult Classics, but it does not seem like it is about a cult in any manner
Comment: http://en.wikipedia.org/wiki/Cult_film , http://en.wikipedia.org/wiki/Cult_following , and http://tvtropes.org/pmwiki/pmwiki.php/Main/CultClassic .
Comment: *Cube 2-4* cult classics? Ridiculous! (From this highly subjective comment you might see that there is probably a large degree of subjectivity involved in the actual definition of *"Cult Classic"*, it doesn't have anything to do with the plot involving a cult, though.)
Answer: A cult film has cult following, and a film will be said to have a cult following when it has a small but very passionate fan base. eg.- Fight Club, Memento, Rounders etc.
These movies were not commercial success, but their fan base is very passionate about them.
 Though it is not necessary for a cult movie to receive critical and commercial acclaim, sometimes a cult movie achieves it eg. - Pulp Fiction, the 1975 indian movie Sholay etc. These movies not only have a cult folllowing they also had commercial and critical success. This when a cult movie becomes a

Cult Classic
Comment: So basically, if it has a *dedicated* group of fans, it is a cult following, even if it also has *lots* of fans?
Comment: Thanks for reminding me of *Rounders*, seen it a long time ago and really enjoyed it (didn't know it's regarded a cult film, though). And nice answer by the way.
Comment: @Luke precisely
Comment: @ChristianRau yeah Rounders is a cult film. I read it on wikipedia and BTW it's one of my all time favorites :)

What makes a movie a "cult classic"?


Synchronizing 2 MCU's ADCs over WiFi

Question: I have 2 devices with analog signals. I want to acquire their signal with 2 MCU's (preferably ARM). fully synchronized with the same sampling frequencies, starting and ending simultaneously user controlled (for example by pressing a button).
I know that if I could connect them together via wires, I could use oscillator and triggers for this.
But is there any way to do this over WiFi?
Thanks
Comment: _"fully synchronized with the same sampling frequencies, starting and ending simultaneously"_ - define 'simultaneously'.
Answer: Synchronizing end points over a channel like WiFi requires some setup and a reference to a time signal to both devices. One way to envision this is:

Both devices have access to a GPS service to get time information from the GPS network.
Both devices synchronize their local RTCs to the GPS time. The RTC resolution needs to be as good as the maximum latency between ADC triggers in the devices.
The first device sends a test packet to the second device that contains the first device RTC time stamp.
Second device receives this timestamp and comparing it to its local RTC it knows how long the message transmission takes between devices.
Second device acknowledges the test message and sends back the latency time back to first device.
These steps to calibrate may need to be run multiple times to ensure consistent results or re-run periodically do to changing conditions.
First device becomes the master trigger source. It send a trigger message to the second device with the same packet size as the previous test messages. Second device triggers its ADC upon receipt of the message.
First device delays its ADC trigger by the amount of the message latency sent over from the second device during the calibration process.

Note that you will never get triggers at "exactly the same time" using a communications channel for the trigger sync but you can get as close as you can based upon your RTC resolutions and the packet handling variations on each end due to MCU instruction sync and possibly even other interrupt interference on each end.
Comment: Thanks, but WIFI transmission has some randomness and can't be sure by just trigger requests and feedback
Answer: Not an easy task. You can look for Ethercat master/slave device Ethercat.org. Ethercat uses a distributed clock for synchronising data. Similarly there is a Profinet, also an industrial protocol over ethernet, but it proprietary while the Ethercat is open source.
They are both used in industrial control, where synchronism is important, CNC machines, servo drives,... As far I know, there is no such hardware that supports synchronism through WiFi. Perhaps you could dig into Ethercat and find how these clocks are actually synchronised and implement something for your needs.
Ethercat distributed clocks description

Synchronizing 2 MCU's ADCs over WiFi


Nvidia drivers not functioning on kernel 4.15.0-33-generic

Question: After updating my system and rebooting, I tried to launch NVIDIA X Server Settings to see if my driver had updated properly. It did not show any Nvidia driver installed, and sudo lshw -c display outputted
 *-display
   description: VGA compatible controller
   product: GP104 [GeForce GTX 1080]
   vendor: NVIDIA Corporation
   physical id: 0
   bus info: pci@0000:28:00.0
   version: a1
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
   configuration: driver=nouveau latency=0
   resources: irq:62 memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:c000(size=128) memory:f7000000-f707ffff

I blacklisted nouveau in /etc/modprobe.d/blacklist.conf:
blacklist nouveau
blacklist lbm-nouveau
alias nouveau off
alias lbm-nouveau off

and updated initramfs but lshw still showed nouveau after rebooting. I also tried uninstalling xserver-xorg-video-nouveau but weirdly this did nothing. I also ran sudo ubuntu-drivers autoinstall but it did not install anything.
I was able to get the proprietary Nvidia drivers running only by booting into kernel 4.15.0-23-generic.  Is it possible to get proprietarry drivers to work on -33?
EDIT: X11 seems to restart when using nouveau and launching certain applications. Tilix, Firefox, Steam, Discord, Nautilus and System Monitor seem to work, but all (tested) settings applications seem to cause the restart. Will update after testing more apps
EDIT 2: More testing showed that only settigns applications seem to cause the restart. This includes Display Preferences, System Settings, Budgie Desktop Settings, but not NVIDIA X Server Settings. I should also add that the restart brings me back to the login menu, not to the desktop.
EDIT 3: I fixed it! I had to reinstall my kernel with sudo apt install --reinstall linux-image-4.15.0-33-generic and lshw shows the Nvidia driver in use.
Answer: I fixed it! I had to reinstall my kernel with sudo apt install --reinstall linux-image-4.15.0-33-generic and lshw shows the Nvidia driver is in use.
Comment: I am the author. I can't mark my question as "Answered" without an answer, and StackExchange requires me to wait 8 hours before accepting my own answer. Sorry for the confusion.


Minecraft pocket edition restoring skin problem

Question: I updated Minecraft PE so I can have custom skins. I clicked on 'restore skins' without selecting any particular skin, It is now stuck with a  message saying 'we're restoring your skins!' but it has been like that for 20 minutes. Is there a reason why it is like this?
Answer: I think the "Restore Skins" button is used if you have previously purchased skins but the app is showing that you still need to buy it. You don't need to press it if you just want to apply a skin.

To get out of the "We're restoring skins" message, close the app. Don't just press the home button, make sure it's actually closed.
Open the app again and tap the skin you want. The free ones don't have a padlock symbol next to them.
Press Back. Your skin should be applied.
You can check your skin by switching to third person or by tapping the armor icon inside your inventory.


Modulated input in cadence

Question: I am giving a 25MHz signal input to pll for simulation in cadence. But I also want to modulate its frequencies from 1Khz to 2Mhz. But how to do the frequency modulation of a signal in cadence?
Answer: I have found that it's good to use VPWL to create piece-wise-linear data, that I just smooth.  This is not as nice as using a frequency source, but it does have the advantage of being able to script something using python or matlab, and then feed that into Spectre.
Answer: Try looking for: -
<code>> VSFFM - Frequency Modulated Sinusoidal Voltage Source Model
</code>

Link: https://techdocs.altium.com/ru/display/AMSE/VSFFM+-+Frequency+Modulated+Sinusoidal+Voltage+Source+Model

Modulated input in cadence


runtime to a BFS flood-fill with multiple centres?

Question: If we have a flood fill algorithm which, given a number of centres reprenting pixels on an image, runs a BFS flood-fill on them, checking the pixels 4 neighbours, changing their colours and adding them onto the queue to have their own neighbours processed if they have not been. What is the runtime, It seems it would be O(n) where n is the number of pixels but some sources have said it should be O(4^n). And how would this runtime change if the number of centres were changed, such that it was a multiple or fraction of n.
Answer: Suppose there are n pixels on the screen.
We add the neighbours onto the queue only if they haven't yet been processed.
This way a pixel is added onto the colouring queue only if it hasn't been coloured yet.
Thus a pixel can be added onto the queue for a maximum of 1 time.
So if there are n pixels, then at most n additions would be done to the queue and thus n operations would be needed to colour the entire display.
It doesn't matter if number of centres are increased or decreased since each pixel would need to be added onto the queue at most once.
Thus the complexity would remain O(n) in both the cases.
Sources that claim the complexity to be O(4^n) are considering a brute force approach where we don't remember the pixels we have already coloured and end up colouring it over and over again.


Maximum number of variables in classes

Question: What is the max number? Will my program crash if it exceeds certain number? Is there a standard just like it is 5 for method parameters?
Comment: Its 37. After that your program plays backwards and you hear Led Zeppelin.
Comment: Where can I get a copy of this standard? The one that says you should use a maximum of 5 parameters in your methods.
Comment: @nate I thought it was "42" ...
Answer: An answer to such a question would depend on the language you are using, but generally speaking, there isn't any limit on the amount of variables or parameters of a method.
There is a cap on the amount of data you can handle, and that's the amount of memory available to your system, but that's a cap on the size of the actual data held by the variables.
Having a high number of variables or methods inside a class is not recommended because your code can become unmaintainable very quickly. That is due to the Single Responsibility Principle: your class should be responsible for one thing, and only one thing, and that one thing will rarely need that many variables to accurately represent it's state. In the event that it does, use Object Composition: identify the small structures which have emerged inside the class and break them up into smaller classes, then add references to objects of those classes to the original class, effectively creating a "has a" relationship between the original class and the smaller classes.
For example, a car has an engine:
<code>class Car {
    Engine engine;
};
</code>
Answer: Your code will become unreadable long before you reach any hard limits set by a programming language, both for variables and method parameters.
Answer: This is unlikely to be an issue. Although I would guess that it depends on the language you are talking about,
Answer: And why don't you try to code all your program in only one file, and with only one function ? :)
Because it's unreadable, and unmaintainable, so it's full of bugs, and so it will not work very well.
This is a kind of real limit to the number of member variables yes.
Answer: Although there is no hard limit, it is never recommended to use large number of variables in a class or method parameters. One can use composition design pattern or inheritance in some cases for reuse. The latter should used sparingly. I would rarely use more than 25  variables in a class or 5 in method parameters.

Maximum number of variables in classes


Remove select all from combobox WPF

Question: I have combobox in WPF application that when the user clicks on it, it selects all the text. How can I change the behavior of this to when the user clicks it just set the typing cursor like a normal textbox?
Answer: Try
<ComboBox IsEditable="True" />

Comment: I think he wants to have it editable, but he does not want the text in the `TextBox` (within the EditTemplate) to be selected when he clicks on it, but he wants the cursor to be positioned before/behind the character that he clicked.
Comment: Thanks gehho, this is what I need! Any idea!
Answer: According to Reflector, the ComboBox code contains this:
private static void OnGotFocus(object sender, RoutedEventArgs e)
{
    ComboBox box = (ComboBox) sender;
    if ((!e.Handled && box.IsEditable) && (box.EditableTextBoxSite != null))
    {
        if (e.OriginalSource == box)
        {
            box.EditableTextBoxSite.Focus();
            e.Handled = true;
        }
        else if (e.OriginalSource == box.EditableTextBoxSite)
        {
            box.EditableTextBoxSite.SelectAll(); // <==
        }
    }
}

This method is registered for the GotFocus event in the static constructor using the EventManager:
EventManager.RegisterClassHandler(typeof(ComboBox), UIElement.GotFocusEvent, new RoutedEventHandler(ComboBox.OnGotFocus));

So, I think you can only change that behavior by deriving a custom control from ComboBox and override this event registration by your own method which replaces the call to SelectAll() with another method which sets the caret to the correct position. However, I do not know how to set the caret to the click position. You might have to use Reflector on the TextBox to find that...
Answer: Seems that I had to solve similar issue.
It's quite tricky, but the way I solved is to set IsEditable to false/true from code, at the same time I set the focus on TextBox.
Not the pretties way but does the job.

Remove select all from combobox WPF


Non-Linearity of an S-Box

Question: This should be pretty simple question I presume. So let's say I have an 8x8 S-Box. I can easily treat it as 8 different boolean functions for each of the 8 input bits. Is the non-linearity the lowest linearity of each boolean function? Or is there something else that needs to considered with an S-Box? If it is different how does one go about calculating the linearity then?
Comment: Did you read Matsui's paper or [Hayes tutorial](http://www.cs.bc.edu/~straubin/crypto2017/heys.pdf)?
Answer: Not quite. The non-linearity needs to apply to any linear combination of input bits correlating with any linear combination of outputs bit. More mathematically, we'd like to know
$$\max_{\alpha,\beta\in\mathbb (F_2)^8}\left|\sum_{x\in(\mathbb F_2)^8}(-1)^{\alpha\cdot x\oplus\beta\cdot S(x)}\right|.$$
If only consider the individual output bits, this only maximises over values of $\beta$ with Hamming weight 1.
We could compute the above maximum by exhausting over $\beta$ and computing the linearity of each corresponding Boolean, but it can also be efficiently computed by treating the S-box as a 16-bit Boolean function which is 1 if the input is of the form $(x,S(x))$ and 0 otherwise and then computing a Walsh-Hadamard transform on this function.
Comment: Hi Daniel, this was answered previously as well: https://crypto.stackexchange.com/questions/37838/how-does-one-practically-calculate-the-non-linearity-of-a-multi-output-boolean-f?rq=1

Non-Linearity of an S-Box