Mysql checksum for master-slave replication returning different values, despite being identical

Question: I've set up a master slave replication in mysql and to make sure that I know if the data starts getting out of sync I created a script that:

Locks both databases on both servers.
Prints the checksums of all the tables to a text file.
Copy's the slave checksum text file to master.
Compares the both files to see if anything is different.

But on some tables I got different checksums. So I downloaded both those tables and created another script to find whats different on them. And Nothing is different! They're identical.
I only get the different checksums on tables that have float variables, so I suspect it has something to do with that.
I do have slightly different versions of mysql installed, could this be causing it?
+-------------------------+-----------------------------+
| Variable_name           | Value                       |
+-------------------------+-----------------------------+
| innodb_version          | 5.5.34                      |
| protocol_version        | 10                          |
| slave_type_conversions  |                             |
| version                 | 5.5.34-0ubuntu0.13.04.1-log |
| version_comment         | (Ubuntu)                    |
| version_compile_machine | x86_64                      |
| version_compile_os      | debian-linux-gnu            |
+-------------------------+-----------------------------+

+-------------------------+-----------------------------+
| Variable_name           | Value                       |
+-------------------------+-----------------------------+
| innodb_version          | 5.5.37                      |
| protocol_version        | 10                          |
| slave_type_conversions  |                             |
| version                 | 5.5.37-0ubuntu0.14.04.1-log |
| version_comment         | (Ubuntu)                    |
| version_compile_machine | x86_64                      |
| version_compile_os      | debian-linux-gnu            |
+-------------------------+-----------------------------+

Anyone of you know what could be causing this?
Answer: There is better way to check whether the master and it's slaves are in sync.
Run pt-table-checksum on the master.
Then if it shows some tables are different use this script to see where exactly the difference is. http://bazaar.launchpad.net/~akuzminsky/+junk/stats-scripts/view/head:/compare_tables.sh
./compare_tables.sh master_ip slave_ip database table

Answer: ANALYSIS
You might be suffering from issues, not so much with FLOAT, but with VARCHAR. Why ?
According to the MySQL Documentation on CHECKSUM TABLE:

The checksum value depends on the table row format. If the row format changes, the checksum also changes. For example, the storage format for VARCHAR changed between MySQL 4.1 and 5.0, so if a 4.1 table is upgraded to MySQL 5.0, the checksum value may change.
If the checksums for two tables are different, then it is almost
  certain that the tables are different in some way. However, because
  the hashing function used by CHECKSUM TABLE is not guaranteed to be
  collision-free, there is a slight chance that two tables which are not
  identical can produce the same checksum.

I have written posts about this phenomenon before

Mar 14, 2014 : Native checksum table says there's a difference, pt-table-checksum does not
Nov 16, 2012 : Maatkit shows the MySQL replication error in one table, but won't fix it
Jan 17, 2012 : How to check the consistency of tables in mysql

CAVEAT
Please note the For example, the storage format for VARCHAR changed between MySQL 4.1 and 5.0. This could possibly mean that there are other examples (scenarios) where FLOAT or some other data type may have issues with CHECKSUM TABLE. If your problem tables have FLOAT columns and no VARCHAR columns, then it is possible that FLOAT variables could be victimized by this issue.
CONCLUSION
You need to do the following

Run pt-table-checksum
Locate the problem tables
Run applied pt-table-sync to fix differences
Run pt-table-checksum again

If you get differences again, then the problem tables have data types with CHECKSUM TABLE issues. You will have to do one of two things

Test the integrity of the tables in other ways

row counts
brute force SQL to compare column values

Trust the physical/logical copy of the table you made

CAVEAT
There are those rare times (< 0.01%) that CHECKSUM TABLE does not produce consistent results. Therefore, due diligence may be necessary if syncing tables with tools. For all tables that are still not sync'd afterwards, you must resort to copying the data regardless of the CHECKSUM values after such copying of data.


Did Google simply beat Microsoft to market?

Question: If I recall correctly Android/droid got an exclusive contract with Verizon carrier.  This would have made it near impossible for Windows to enter the US market.
I understand Google's search engine for mobile was on the line because Windows Phone would have used an alternative search engine.

antitrust lawsuit vague references at 3 months between launch and finish.
verge came to market to late

I will keep searching to see if there is some sort of consensus.
Is there any other reason possibly for Android winning out over Windows Phone?
Did Google simply beat Microsoft to market and release a phone sooner?
Comment: "Is there any other reason..."  - There is almost never a single reason one product wins out over another.  Also, note that the Windows Phone was not [Microsoft's first attempt at the mobile market](https://en.wikipedia.org/wiki/Windows_Embedded_Compact).  Or even [the second](https://en.wikipedia.org/wiki/Zune).  Given the multiple failures, I don't think you can pin it on Android alone.
Comment: What research have you done? This seems like (a) it would have been extensively (exhaustively) covered in the tech press and (b) would be quite opinionated and subjective.
Comment: "Bill Gates says his 'greatest mistake ever' was failing to create Android at Microsoft" https://www.businessinsider.com/bill-gates-greatest-mistake-not-creating-android-microsoft-2019-6
Comment: There are people who, like me, simply wouldn't have even considered a Windows phone, so yes, highly opinionated :-)
Comment: Google's exclusive contract was for their own Google-branded "Pixel" cellphone, not for all cellphones on Verizon to be Android. Verizon is quite free to carry iPhones, or Blackberries, or whatever can be made to work on their network. Incidentally, that Pixel contract has probably [hurt Google more than its helped](https://www.cnet.com/news/pixel-3-phones-arent-selling-and-its-probably-verizons-fault-google/).
Comment: @T.E.D. The droid is when the exclusive contract would have start otherwise/but yes.
Comment: @jamesqf I've owned 4 Windows phones. The Windows 8 and 10 phones were the best phones I've ever owned (considering the user interface, ease of use, etc.), far nicer than any Android phone.
Comment: @jwenting: Tastes differ, of course.  While I've never used (or AFAIK even seen) a Windows phone, I have unfortunately been exposed to various versions of Windows since it was something that ran on top of DOS, and have never really been able to use it successfully, which would have made me reluctant to spend money on one of their phones.
Answer: Apple beat Google to that same market, and Android is still (by brute numbers) crushing IOS mobile as well. So its really more a question of what Google Android did right (that MS and to a lesser extent Apple did not).

Historically, for competing platforms, the more open platform nearly always wins.
Video Tape formats:

VHS: Licensed to anyone who wanted.
Betamax: Sony Exclusive (later licensed to 2 companies, but by then the fight was over)

Operating Systems:

Unix: Licensed upon request for free (thanks to anti-trust issues with Bell)
ZOS, MVS, MCP, VMS: vendor-specific.

Home computer platforms:

PC: Freely available to clone by anyone, thanks to the BIOS getting reverse-engineered and the hardware being standard components.
Amiga, Atari ST, MacOS: vendor-specific.

and now we come to Smartphone platforms:

Android: licenses free to device manufacturers
Apple IOS: single-vendor.
Windows Phone: licenses available for manufacturers, but $20-$30 per unit.

When a platform is more open, it is far easier to develop for it, and no extra costs have to be passed on to consumers, which makes the devices cheaper. This also lowers barriers to development, which means there's more competition among manufacturers. That also lowers prices. When, all other things equal, your device is cheaper than a competitors, your sales will be better.
For any somewhat open platform, cheaper hardware will set off a virtuous cycle where more consumers pick your platform, which attracts more developers, who have to compete with each other, making the resulting hardware even cheaper, software support better, and driving innovation harder, which attracts even more users to that platform, etc.
Apple has survived this by getting to the market first (so they already had a good established platform when Android was introduced), and making themselves a prestige brand so users are willing to foot the extra costs.
Windows Phone was open(ish), but more expensive, and there was no reasonable way it was going to establish its own virtuous cycle driven even harder than Android's when starting out with higher vendor development costs and a much smaller user and developer base.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/104436/discussion-on-answer-by-t-e-d-did-google-simply-beat-microsoft-to-market). Although some interesting points were raised in comments, the comments were no longer germane to the original question.
Answer: This started as a comment on T.E.D.'s answer, and has turned into some insights into the smart phone market and why Microsoft failed.
Full disclosure, I work on a Macs, game on Windows, and use Android phones. My first smartphone was a Nexus One I got for free(!) for attending a free Android Developer Tutorial hosted by Google back when Android was kinda crap. Never did write an Android app.

While raw numbers of devices shows Apple "losing" and Google "winning". The reality is they're both winning at their chosen games.
Alphabet (Google's parent company) doesn't sell phones. It doesn't sell software. Even most of its services are free. Alphabet sells its users. Alphabet makes its money on advertisements and selling its users behavior. Alphabet made $95 billion in advertisements last year, 86% of its total revenue. Android exists to funnel users to Alphabet's services so it can serve them ads and collect extensive data about their users to sell. It's in Alphabet's best interest for Android to be free and ubiquitous and on as many phones as possible.
In stark contrast, Apple is primarily a hardware company. Apple makes over half its revenue selling iPhones to the tune of $142 billion in sales last year. iPads made $21 billion. In comparison, Macs made $25 billion. iOS exists to sell iPhones and iPads.
Both companies make money from their app store taking anywhere from 15% to 30% of app sales as well as subscription fees. But this is small potatoes compared to their major earners: advertising (Alphabet) and hardware (Apple).
Clearly both are doing quite well.

What about Microsoft? Unlike Alphabet and Apple, Microsoft is scattered. Rather than a colossus, Microsoft is a conglomeration of divisions. Their revenue is evenly split between "Productivity and Business Processes", "Intelligent Cloud", and "More Personal Computing".
This includes their software such as Office, Skype, Exchange, SharePoint, Outlook, and Dynamics. These have consumer and enterprise versions, installed and cloud versions. They run Web sites like Linkedin, Github, and Bing. They do financial management, resource planning, and supply chain management. They have developer tools like SQL Server, Github, Visual Studio, and Azure. They sell the XBox, and develop and publish games. They sell tablets, keyboards, mice, and accessories. And, of course, they do Windows.
Android is a core part of Alphabet's strategy to serve ads. For Apple, the iPhone was developed as one of its small stable of hardware. But for Microsoft, Windows Phone was just one more product in a sea of products.
To put this in perspective, in 2010 when Windows Phone 7 came out, the revenue for Microsoft's entire Entertainment and Devices Division division which included XBox, Zune, PC Games, Mac software, PC hardware... and the Windows Phone was $8 billion. In 2010 Apple sold $25 billion in iPhones alone.
This lack of focus meant despite Microsoft's huge size, compared to iPhone and Android, Windows Phone was rushed and starved of resources.

Part of the reason behind a lack of upgrade path for applications, [Larry Lieberman, senior product manager for Microsoft's Mobile Developer Experience] added, was the timing required to push Windows Phone 7 Series to market. "This product was delivered in an incredibly accelerated timeframe," he said. "If we'd had more time and resources, we may have been able to do something in terms of backward compatibility."

Source
As a result, Windows Phone 7 broke backwards compatibility with Windows Mobile 6 wiping out their software library. Windows Phone 7 phones couldn't run Windows Phone 8 making upgrading expensive. Unlike Android's integration with Google's excellent services, Windows Phone was saddled with Bing services.
iOS and Android are dedicated smartphone and tablet operating systems allowed to do their own thing separate from their desktop counterparts. In contrast, Microsoft further complicated Windows Phone by attempting to unify their desktop, tablet, and phone operating systems. This extended to software, user interface, and branding. It might have been a major coup if they pulled it off, but they didn't. Instead this "one size fits all" approach lead to confusion and compromises for all.
Examples include their attempt at unifying the user interface with Metro. Small touch screens have very different needs from mouse and keyboard based monitors. The result was an interface that worked well enough on phones and tablets, had some interesting features for touch screen laptops, but was a jumbled mess on desktops harming Windows 8. In the end, touch screens did not become ubiquitous in the laptop and desktop space.
Windows RT promised to move applications seamlessly between desktops and tablets, but instead resulted in something between a crippled laptop and a very expensive phone further diluting the Windows Phone.
Microsoft learned the hard way what Apple knew: phones are not laptops nor desktops.
The Windows Phone was rushed, under-funded, and unfocused. It was saddled with second-tier services and a design compromised for other devices. Application developers were hamstrung by incompatibilities. Was it a smartphone or tiny laptop? It tried to be both on a budget for neither.
Sources

Apple's 2010 10-K
Apple's 2019 10-K
Alphabet's 2019 10-K
Microsoft's 2010 10-K
Microsoft's 2019 10-K
Comment: Having watched more than 20 years of Microsoft blunders in the small-screen department, I'm not convinced your next-to-last paragraph is correct.  I don't think Microsoft has yet realized that phones and desktops are different things.
Answer:
Did Google simply beat Microsoft to market?

No.

Microsoft have been producing phone operating systems since at least 2003

Windows Mobile 2003 for Pocket PC Phone Edition
Windows Mobile 2003 for Smartphone
Windows Mobile 2003 SE for Pocket PC Phone Edition
Windows Mobile 5.0 Pocket PC Phone Edition

Steve Jobs unveiled the Apple iPhone to the public on January 9, 2007.
According to Wikipedia: "Android was unveiled in 2007, with the first commercial Android device launched in September 2008."
Microsoft's "Windows Phone" operating system was released in November 2010. But this was just the latest of a long succession of phone operating systems from Microsoft.

There must be other, more significant, reasons why Microsoft failed in this market and wasn't able to leverage it's desktop monopoly or capitalise on it's existing long-standing product user base in the phone and mobile devices market.
Comment: The first Android device was available in September 2008 according to Wikipedia, but you're right about Windows Mobile predating it. Even if we limit ourselves to the more viable Windows Mobile 6, it beat Android to market by a year. We should also not forget that there was a whole ecosystem of potential competitors at the time, e.g. Nokia's in-house OSes, that slowly died out. @William, Windows *Phone* was newer, but that name was more or less just a branding change for the next version of Windows Mobile. (Funny enough, they reverted the change when they made Windows 10 Mobile.)
Comment: Windows phone did not beat android to market.
Comment: @William I got my first Windows based phone in 2007 when the company I worked for adopted them to replace their old Nokias.
Answer: The situation isn't quite as simple as just being late to market. Let's review the situation leading up to the release of Windows Mobile phones.
Microsoft had been after the portable device market for some time, beginning with Windows CE, first released in 1996.
This was followed up with the first versions of Windows Mobile in 2003, including a few early phones that were essentially a PDA with telephony grafted on. By the time these appeared, Blackberry was in full swing and had already commanded the lion's share of the enterprise computing market.
Both efforts struggled due to a weak user interface that attempted to mimic desktop Windows, and the generally anemic performance of portable devices prior to the mid 2000's. Ironically, the last versions of Windows Mobile had a vastly improved user interface, and introduced the concept of apps that ran as a large icon... an interesting idea that never caught on.
Microsoft had been working on a pad style computing device since the early 1990's, and publicizing that effort, but never could come up with a truly useable device. In fact, it was an inebriated Microsoft engineer bragging about this to Steve Jobs a party at Steve's house, that led to Jobs initiating the Apple pad project that led to the iPhone. Apparently, ticking Steve off wasn't a wise thing to do.
Apple began work on iOS around 2005 for a pad project (after the aforementioned party encounter) which was put on hold when they decided to build their own phone after a troublesome experience dealing with integrating iTunes with the Motorola Rokr phone. Since both multitouch and a portable OS had been developed for the pad project, the iPhone simply reduced the size of the device and built on the existing work. Apple's early success followed the iPod, which had revolutionized portable music players, and had established a substantial online retail presence with the iTunes Store... Microsoft had nothing like that, and couldn't create it overnight.
Keep in mind that the Apple of 2007 was not like the Apple of today. At that time, it was regarded to be the pinnacle of innovation after the success of the iPod, a major factor in the rapid adoption of the then radical iPhone in 2007... Apple had a reputation for producing substantial advancements to tech that worked very well. Sadly, after the death of Jobs, innovation at Apple ground to a halt, followed by the departure of most of the creative leaders.
Android began life in 2003, purchased by Google in 2005 (for $50 million). The initial version in 2006 used a Blackberry style keyboard and no touch capability, but when iOS debuted in 2007, Google postponed the release until multitouch and a virtual keyboard could be added. Android was based on open source, and Google allowed apps to be installed (albeit with warnings) from sources other than their store, to encourage a wider variety of apps.
Why didn't Windows Mobile succeed? A few factors come to mind:
By the time Windows Mobile had come out, Apple was in full swing with the App Store and externally developed apps, and Android had added the same feature. The independent developers had already committed to one or both of those platforms, so a third platform struggled to attract mobile developer mindshare, while existing Windows developers weren't really geared to this new market. Technically, this might qualify as 'late to market', but when combined with the previous lackluster MS efforts that had been going on for over a decade, may have made astute mobile users wary of a MS mobile product.
MS bet heavily on integration with Windows Desktop. As most mobile devices ended up being used with little or no integration with a desktop OS, this wasn't a compelling factor.
Microsoft's reputation had suffered in the years leading up to the mobile revolution. Windows, while a virtual monopoly, had been slow to improve the user interface and reliability (Blue Screen of Death), as MS rested on it's monopoly and raked in the cash. In a panic, MS released Windows 8, which grafted a mobile front end onto a desktop platform, a combination that did not work very well. That may have been a factor in resistance to adopting Windows Mobile phones.
The fact that MS had muddled about unsuccessfully with a pad project for over 15 years, when Apple got it right in around three, and Google appeared out of nowhere with an open source version in another three, wasn't lost on the computing community.
It helps to put this in the context of the time. In 2010, MS was still regarded to be the slow, plodding monopoly that you had to put up with on your desktop. Since that time, MS has been transformed into a much more responsive and quicker moving company. A major culture change, that is a story unto itself.
There appears to be an element of 'we've had enough of Microsoft' going on there.


'Team Forestress 2' won't delete?

Question: It takes up a lot of storage(20 GB), and I can't locate it in finder either. I can only see it in storage settings, where it won't delete. I also don't have steam anymore.
Answer: macOS apps like Steam try to keep files you're not supposed to interact with directly (like the resource files needed to run Team Fortress 2) tucked away in the normally-invisible "Library" folder. You can either reinstall Steam, and tell it to uninstall TF2, or you can manually remove the files it left behind. To manually remove it:

Start in the app, Finder
Open the Go menu
Hold option—you'll see a new item appear; Library
Click Library to open it (then release
option)
Open Application Support
Drag the Steam folder to the trash

Note that there may be files you care about, like non-cloud-syncing game saves or other Steam apps, in that Steam folder. Almost everything in Steam can just be re-downloaded later, but in doing the above you naturally assume the risk of damaging or losing anything stored there.
Having typed all that, naturally I just found the Steam Support article saying the same things.

'Team Forestress 2' won't delete?


Does ごめん really mean sorry?

Question: Normally ごめんなさい is translated as sorry or excuse me, but that seems like a translation for non-native speakers. In the same way, しつれいします can also be translated as excuse me or pardon me. But it really means "I'm being rude". So... what does ごめん really mean?
Comment: Perhaps not very helpful, but similarly すむ (as in すみません or すまなかった) could be translated as "to be at ease".. Interesting way of apologizing. I don't know if a listing of these words/"phrases" in a question would be a too open ended question, but it would be interesting.
Comment: Do you mean the "dictionary" meaning or the "sense" meaning? I think a good translation would be "sry" or "soz", like when we bump into people.
Answer: めん(免) in ごめん(御免) means 'forgiveness/to forgive', like in the verb '免ずる/免じる' (which I think is the literary or archaic form of '許す'). なさい makes it imperative, so ご免なさい literally means 'Please forgive (me)', like 免じてください/許してください.
Comment: I would just like to add that [adding ご in front of the word makes that word more formal](https://en.wikibooks.org/wiki/Japanese/Grammar/Honorific_prefixes) (similiar with the お in お名前, etc), So literally, ごめんなさい could mean: *I humbly ask for your forgiveness*
Comment: Actually, ご・お・御 in this case makes it honorific (so that it matches with なさる・なさい) to the referent, not humble (which would be with respect to yourself). So you are exalting the person because you're asking them to *do the forgiveness* action (as opposed to focusing on the forgiveness of _you_). Certainly, 御 often just makes something more formal (e.g. お茶), but it perhaps *more* often makes it *polite* (and of the polite forms, I think the honorific one is more apt to take 御 than the humble one).

Does ごめん really mean sorry?


Solving linear system, finding equilibrium and bifurcation points

Question: For homework, I have to solve the following problem: consider the system of ODE's
\begin{equation}
x'=-x^2+a \\ y'=-y
\end{equation}
where the parameter $a$ is a real number. I have to characterize the equilibrium points and draw a bifurcation diagram. I am asked to linearize the system first. I have missed a couple of classes and I am struggling to understand how I am supposed to work here.
If $a$ is positive, then there are two equilibrium points $(\sqrt{a},0)$ and $(-\sqrt{a},0)$, if $a$ is equal to zero, then there is one equilibrium point $ \left ( 0,0 \right )$ and finally  if $a$ is negative,  then no equilibrium points exist. The Jacobi matrix of the system is
\begin{pmatrix}
 - 2x & 0\\
0 & -1
\end{pmatrix}
which is diagonal, hence its eigenvalues are $-2x$ and $-1$. Then, I calculate this matrix at the equilibrium points:
If $a>0$, then the two Jacobi matrices are
\begin{pmatrix}
-2\sqrt{a}  & 0\\
0 & -1
\end{pmatrix}
which has two real and negative eigenvalues, so $(\sqrt{a},0)$ is a stable point and
\begin{pmatrix}
2\sqrt{a}  & 0\\
0 & -1
\end{pmatrix}
which has one negative and one positive eigenvalue, so  $(-\sqrt{a},0)$ is a saddle point.
If $a=0$ the Jacobi matrix is
\begin{pmatrix}
0 & 0\\
0 & -1
\end{pmatrix}
which has one zero eigenvalue so the linearization method does not provide any information about the stability of $\left ( 0,0 \right )$. As my notes suggest, for this point we find the eigenvectors of this matrix and the orbits of the solutions. But I do not understand why and what information we obtain from this. What can I say about the stability of $\left ( 0,0 \right )$ then? What about the saddle point, do I use a similar method? I understand that there is a bifurcation for $a=0$ but I don't know how am I supposed to draw the diagram without a computer. Another thing I find in the notes in another example is that we divide the equations and find a relationship between the solutions which does not involve time, for some reason.
Thanks in advance, any insight on this will be appreciated, right now I am lost.
Answer: Hint:
By integration, when $a=0$, either
$$x=0$$ or
$$\frac1x=t+C.$$
Comment: I know that the system can be solved, my problem is that I do not understand the reason for which we find eigenvalues. The orbits of the solutions tell me whether the solutions approach zero or they move away from it, I presume, right?


What sites exist for posting client proofs?

Question: As I'm doing more and more photo shoots, I'm looking for a site in which I can post proofs for clients to look at.  I would use Flickr, however the images can be downloaded and I obviously don't want proofs to be downloaded before they have been edited.  Can anyone recommend a site that I can use?
Answer: SmugMug.com for sure.  Tons of security features both to protect the photographer's work (right click protection, watermarking, image size limitations) and to protect privacy (password protected galleries, password protected sites, unlisted galleries).  Not to mention all the commerce features and other Pro oriented stuffs.
http://www.smugmug.com/help/private-search-island
NOTE: I am a SmugMug employee :D
Comment: Note - @Shizam is employed by them.
Comment: This post was about 1 year ago (why does it say Oct 2010 though??), I don't know what the state of that FAQ was back then and you'll note I updated the answer immediately after dpollitt pointed out this answer's state.
Comment: This is great....thanks very much for your recommendation!  I'll take a look at it later today.
Comment: I sure hope you started working at SmugMug *after* you provided this answer. ['...the community frowns on overt self-promotion and tends to vote it down and flag it...'](http://photo.stackexchange.com/faq#promotion)
Answer: Along with SmugMug, Zenfolio and PhotoShelter also has the same features, so compare them and find one that suits your needs.
Answer: Many options exist for this, and over time these company's seem to come and go but I'll note some of the recent ones that I am familiar with:

Zenfolio
Instaproofs
Smugmug
aPhotoFolio
ShowItFast
Photobiz
Photocart
ShootProof
Photoshelter
Livebooks
Redcart - Shopping Cart
Photography Orders
ProPhoto Blogs - Can be used for proofing but not technically what you asked for.
Answer: You can also try Pixoasis.com.
Answer: ACDSee Pro comes with an online feature (ACDSeeonline.com) that allows you to share selectively and you can choose whether to allow downloads of images, etc. Unlike the other sites you can manage your photos online from within the app.


Nets and filterbases and convergence

Question: I am not sure I understand the difference between nets and filterbases very clearly, esp since there convergence properties seem to coincide. Isn't a filterbase a kind of a net?
Answer: A net is a function whose domain is a directed set; a filter base is a particular kind of directed set. These are closely related notions, but they're clearly not quite the same animal.
Suppose that $\mathscr{B}$ is a filter base in a space $X$. If for each $B\in\mathscr{B}$ I pick a point $x_B\in X$, then the function $\nu:\mathscr{B}\to X:B\mapsto x_B$ is a net in $X$. Thus, from a filter base I can easily construct a net, and one that turns out to have similar convergence properties, but the net $\nu$ is not the filter base $\mathscr{B}$.
Conversely, if $\langle D,\le\rangle$ is a directed set, and $\nu:D\to X:d\mapsto\nu_d$ is a net in $X$, for each $d\in D$ let $B_d=\{\nu_e:d\le e\}$; then $\mathscr{B}=\{B_d:d\in D\}$ is a filter base in $X$. Again you'll find that $\nu$ and $\mathscr{B}$ have similar convergence properties, but they are not the same thing.
It's a bit like the relationship between equivalence relations and partitions: they're not the same thing, but they have a very close relationship that allows each be constructed from the other. The relationship between nets and filter bases isn't quite as close, however, because the two constructions that I gave above aren't actually inverses of each other.
Comment: "Suppose $\mathcal{B}$ is a filterbase in $X$. If for each $B \in \mathcal{B}$, we have $x_B \in X$, then
$\mathcal{x}: \mathcal{B} \rightarrow X$ such that $f(B)= x_B$ is a net in $X$."
 In order to prove the above statement would it be enough to prove the following: (i)$\mathcal{B}$ is a directed set. (ii) For every $\mathcal{B}$ in $X$ converging to $b$, $\mathcal{x}$ converges to $b$.(iii) For every $\mathcal{x}$ in $X$ converging to $x$, $\mathcal{B}$ converges to $x$.?
Comment: For the quoted statement (which you misquote: the function was called $\nu$, not $x$) we only have to prove (i), as by definition a net is just a function with domain a directed set. And $\mathcal{B}$ is directed by reverse inclusion (the directedness is then just a restatement of the fact that $\mathcal{B}$ is a filterbase. The convergence statements make no sense to me.
Answer: An addition to Brian's answer:
One nice property of filterbases: they're internal: families of subsets of the space itself. A net used any external index set we like, as long as it is directed, of course.
So there is a set of all filters / filterbases on a set $X$, while there is no set (it's a proper class) of all nets in $X$. Another nice property of filter(base)s: the notion of a finer filter(base) is natural, and corresponds to subsequences, essentially, while the notion of subnet is a bit more unnatural IMHO. You need some examples to see why it is chosen the way it is, and there are actually two different notions of subnet with some different properties.

Nets and filterbases and convergence


Causality and operationalism: from sets and functions to monads

Question: When working in a laboratory, the most basic behaviour is to turn a knob or dial and then see a transformation of some data output.  An example is increasing a magnetic field and seeing Zeeman splitting.   We normally use this behaviour to create a function, thinking of the system as being composed of a set of states.  I am interested in a program which borrows some of the assumptions of quantum gravity.  Namely, I am working towards a picture where states are not fundamental, but instead processes are.  This leads us to the following picture.  We take the turning of the knob as a morphism and the change in the data output as another morphism.  The experiment, then, is a map from an arrow to an arrow and this is just an endofunctor on the category of the apparatus. Can we then use this endofunctor to create a monad and subsequently an algebraic theory for the system under investigation?
Comment: "Of course, states don't exist, only processes do." - That's one hell of a statement. Perhaps we would be better sticking to physics than philosophy.
Comment: You haven't defined the category of the apparatus.  A definition seems to be necessary before looking for a monad structure.
Comment: Sounds me as a sohisticated rehearsal of the old debate of operator against wave function, or Heisenberg vs Schroedinger pictures.
Answer: (Disclaimer: I can't even attempt answering the stated question as such because I have too little command of the terminology of "categorizing". But I still like to think that even the stated premises themselves deserve more comment than fit in 600 characters, and more chance to perhaps form an answer of this in ... the process.)

When working in a laboratory, the most basic behaviour is to turn a knob or dial and then see a transformation of some data output.

"Turning the knob" seems to describe a certain "transfomation", too; perhaps of some "input setting". Accordingly, (taking part in) such "transformations" seems to be the most basic behavior ("when working in a laboratory").
But of course there may be plenty such basic "transformations" acquired "on a long day/night in the lab"; and (subsequently) they ought to be put into some relation to each other to eventually ... "have something to show for it".

An example is increasing a magnetic field and seeing Zeeman splitting.

There is a (proverbial) "world of difference" between "turning the knob" and asserting that a magnetic field had increased (within the particular lab region);
and no less between "seeing some data output" and asserting an instance of ... this (including references in there).
And no less either, at least in principle, between "touching the knob" and asserting that the knob had been turned, for instance.
The difference is (closely related to): Evaluation. You know (even better):
Given the (rather) basic data, $\psi$, and having designed and selected some particular way, $\hat{A}$, of carrying out the evaluation,
then going to work and (ideally) obtaining one value (that's "worth showing off"): $\lambda_a$.
This applies if the data "was (any) good" enough to carry out this evaluation; and it might be accordingly referenced as $\psi_a$. Or, if the data "wasn't (any) good (for that)", then not. In any case this data is retained for subsequent evaluations; be it in the same way, or in other particular ways, perhaps also involving supersets of this data, or subsets.

We normally [...] create a function

Sure: once we have obtained values we may map them to each other. But "working in the lab" apparently starts well before that.

[...]

( See disclaimer on top.)


What is the best way of graphical or visual representation of confusion matrix?

Question: I have classified the 15 classes dataset using machine learning algorithms. I don't want to put confusion matrix table since it is 15x15 matrix, instead, I want to represent it in a graphical way, which is more pleasant to visualize. Would you kindly recommend any technique? It would be better if it is using ggplot. Thank you so much. Waiting for your reply.
Comment: Correspondence analysis is a nice way to visualize relations in a contingency table, of which a confusion matrix is just a case
Comment: A Heat map would do the job https://tinyurl.com/yckdyq8f.
Answer: library('reshape2')
library('ggplot2')
mydata <- mtcars[, c(1,3,4,5,6,7)]
cormat <- round(cor(mydata),2)
melted_cormat <- melt(cormat)
ggplot(data = melted_cormat, aes(x=Var1, y=Var2, fill=value)) + geom_tile()

The above code calculates correlation between different features of the cars data. The correlation matrix is similar to confusion matrix both of them are square matrices.
Below is the visualisation of the correlation matrix.

If you have any doubts please comment below.
Comment: So your advice is simply to replace cell values (frequencies) by colouration or shade?
Comment: Thanks for the reply, it's working, but one problem, as I have already mentioned, that I have 15x15 matrix. After reshaping using melt function when I plot it, on the x-axis it is not continuous numbers, I mean, x-axis should vary from number 1,2,3...15. but its varying from 1,10,11,12,13,14,15,2,3,4,5,6,7,8,9. It is not in proper order, I don't know why its happening, would you kindly address it?  I hope you understand my problem. Thank you.
Comment: @MArjun sounds like you have the data in alphabetical order as would happen to **string** variables. Make sure the data is seen as **numerical** (a number instead).
Answer: If the number of classes is limited, the chord diagram may be useful.
A port from the d3 library is availaible in R (see the following github repo).

require(chorddiag)

m <- matrix(c(11975,  5871, 8916, 2868,
              1951, 10048, 2060, 6171,
              8010, 16145, 8090, 8045,
              1013,   990,  940, 6907),
            byrow = TRUE,
            nrow = 4, ncol = 4)
classNames <- c("Class A", "Class B", "Class C", "Class D")
dimnames(m) <- list(have = classNames,
                    prefer = classNames)

groupColors <- c("#000000", "#FFDD89", "#957244", "#F26223")
chorddiag(m, groupColors = groupColors, groupnamePadding = 20, showTicks = F )

Answer: To talk about the intuition behind visualizing the confusion matrix:

You essentially have a matrix of real continuous values
For every cell you need to get a sense of more or less

i.e. if your columns refer to predicted class names & row names refer to actual class names, for each cell you want a sense of whether more values were predicted in the class or less.
Considering the above two points, heatmap is the best visualization. (R code example)
Instead of default gradient in the example above, I suggest exploring RColorBrewer palette Spectral to create a slightly more visually descriptive color scheme.


View to show node titles only when a new comment has been posted?

Question: I am trying to create a view that will show the titles of all nodes only when these nodes have new comments. I need a filter like "Content has new comments" but there isn't any.
Can somebody help?
Comment: Depends what you mean by "new". Can you elaborate?
Comment: I mean comments that are not viewed yet. My view will be a list of node titles with new comments. When clicking on a node title the user will be directed to the full node page where all comments are attached (via an EVA field). The new comment will be the first comment of the entire comment list. Ideally i would like this comment to have a "new" mark which will disappear when the user leaves that node page. But this specifically is a different problem i haven't thought about yet.
Answer: You can add a relation in views "comments of the node" and add filter criteria by comment post date. As I know there is no status "new" in comments that's why you can limit them by date.
Or you can add custom field with status but you will need a logic how to add and remove that status.


Tax implications of dividend vs salary

Question: I'm recently self employed. My accountant advised the total amount of tax I'll pay (combined business and personal) is the same whether I pay myself 100% dividend or 100% salary and the only deciding factor should be if I want to build RRSP contribution room. Is this accurate? What other factors should I consider?
Comment: In the UK the tax implications would be hugely different. And a company can pay up to £25,000 a year into a director's pension tax free.
Answer: Income taxes aside, Canada Pension Plan contributions can be a significant factor in considering salary vs. dividends. You'd need to pay into CPP based on salary received (considered "pensionable earnings" and so subject to CPP), but not for dividends.
Contributing more to CPP over your career generally results in additional pension income for you in retirement, so CPP contributions are not technically a tax — but some people see it that way.
What I think is key, though, even if you don't see CPP contributions as a tax, is the general drop-out provision used in calculating the CPP retirement benefit. The drop out provision has 17% of the lowest years of pensionable earnings excluded from the retirement benefit calculation in order to potentially increase benefits (which are derived from the average of the pensionable earnings periods not dropped out). I believe the idea is that some stretches of un/under-employment would not count against you.
So, if you are late in your career and have no or few low pensionable earnings years on record with CPP (e.g. somebody who, say, has mostly maxed out CPP contributions since age 18), then adding a handful such no/low pensionable earnings years may not actually decrease your benefits significantly — but you could save on the avoided contributions: for 2019, those are 5.1% employee contribution plus 5.1% employer contribution (and as self employed, you pay both) on pensionable earnings between $3500 and $57,400 ... i.e. about $5500 maximum for the year.

Tax implications of dividend vs salary


Windows 10 console stops running if I click in the console window

Question: I have a PHP script which runs via Windows Task Scheduler. When it starts it automatically opens a console window where the script writes status messages. If I click on this window it stops the script running. The window is still opened but it seems the script does not work. The window does not disappear. I don't understand why it happens. How can I see any errors from the script or what it is doing.
Answer: The Windows 10 command prompt pauses when you click so that you can copy and paste text without that text changing or moving. You can escape this copy mode by simply right clicking in the console window.
Whether or not this will pause the commands running in the command prompt depends on the commands you're running. Generally it seems that commands writing output to the console will pause, whereas commands writing output to a log file will not.
To stop the command prompt from pausing:

Right click on the title bar at the top of the console window.
Click Properties.

Click the Options tab.
Uncheck Quick Edit Mode.

Once you've made this change, you can no longer easily copy from the console. In order to copy you will need to:

Right click on the title bar at the top of the console window.
Highlight Edit.
Click Mark.

Highlight your selection.
Right click to copy.
Comment: Thanks. But what does the script doing while console is in copy mode? Is it continuing or it is stopped at all?
Comment: It seems to depend on what you're running. `ping` and `robocopy` both pause if the output is going to the console, but continue if the output is piped to a log file. I'm not sure if that applies to PHP scripts since I don't have it available on this computer to test.
Comment: It depends on script and things. If print operation is blocking - script stops. You may check that trying to print timestamps sequentially
Comment: While the user is interacting with the console's output in the UI any code that tries to write to the console's output stream will be blocked.


Mirror Structure

Question: I studied in my physics textbook that a plane mirror is basically a glass plate a few millimetres thick. The upper surface of the glass plate is highly polished and smooth while the lower surface is painted with silver.
It struck me that we could have just simply utilized an opaque surface painted with silver at the top. Why do we need an upper smooth, transparent surface?
Answer: You are right. And that is how high quality mirrors for telescopes are made.
But putting the mirror coating on the top surface leaves it exposed and easy to damage. You ouldn't want your bathroom mirror to be like that.
It is cheap and easy to make flat, smooth glass. It is easy to deposit silver on the back and protect it with a coating.
If you have a top surface, you need it to be flat and smooth so it won't distort the image.
Answer: The mirrors we use in everyday life put the metallic coating at the back to protect it from getting scratched or abraded. So it has nothing to do with optical performance and everything to do with practical considerations. The top surface of the glass has to be smooth because if it was rough it would scatter light and make the mirror look dull.
High performance mirrors do indeed put the metallic coating on the surface as you suggest. For example the mirror used in the Hubble space telescope has a glass base with a layer of aluminium on the top. This works fine because in space there is nothing to corrode the aluminium and of course the mirror is never going to be touched so it can't be scratched or abraded.
Comment: a mirror with the reflective coating on top is called a front-surface mirror.  its optical performance is superior to that of a back-surface mirror because the back surface mirror exhibits a slight amount of reflection at the front surface as well as the main reflection off the back, causing the resulting reflection to contain two images that do not line up perfectly.  Since the most common mirror metallization is aluminum and since it is subject to slow chemical degradation, the front-surface mirrors used in big telescopes must be resurfaced with fresh aluminum every few years.

Mirror Structure


Where do discontinuities in the electromagnetic field occur?

Question: At a superconductor is what I know of, but what are some other cases?
Comment: Do you mean like textbook discontinuities in EM field?
Comment: A superconductor doesn't cause a discontinuity in an em field.
Answer: The Maxwell equations,
\begin{align}
\nabla \cdot \mathbf{E}& = \frac {\rho} {\varepsilon_0}
&
\nabla \cdot \mathbf{B}& = 0
\\
\nabla \times \mathbf{E}& = -\frac{\partial \mathbf{B}} {\partial t}
&
\nabla \times \mathbf{B}& = \mu_0\left(\mathbf{J} + \varepsilon_0 \frac{\partial \mathbf{E}} {\partial t} \right)
\end{align}
define the derivatives of the fields. A discontinuity in a function corresponds to a point where its rate of change is infinite. So you can have field discontinuities where the right-hand sides of Maxwell's equations are infinite. The classic examples are when the charge density $\rho$ or the current density $\mathbf J$ represent a nonzero charge or current confined to zero volume, such as at a point charge, at a line charge or line current, or at a surface charge or a surface current. Your favorite textbook will discuss the conditions the fields must obey across such a boundary.


Should I get the PICKit 2 or 3?

Question: Okay, having decided to pitch myself at the PIC family (including dsPIC), I now have a question about programmers. I've been hearing a lot of bad things about the new PICKit 3, and am wondering if I should get that or the apparently more venerable PICKit 2? If I want to be able to use the newest PICs, I think I might need to buy the latest, but I'm not so sure. Thank you!
Answer: I think the main reason behind PK3 hate is from this review by D.L. Jones.  If you read (watch?) between the lines, D.L. Jones is upset because, well, the PK3 isn't the PK2.  My response:  It's a PIC chip programmer for hobby use, not for production work!  Yes the physical UI is different between the two, but hey, your'e getting a OEM-supplied programmer for very little money that programs just about everything in their lineup (PK2 doesn't), so I wouldn't complain.  Take what they give you!  In the not-too-distant past, programmers were waay more expensive.
At work, we use ICD2 and ICD3 "hockey pucks" and the main reason we don't use PK2 is because the PK2 didn't support a particular micro we wanted to use in the past (the PK3 supports it now), so they had to upgrade.  All of my coworkers said PK3 is probably a good way to start, since the part support problem seems to be resolved.
Comment: How's that for a coincidence, both of us linking to the same review within a minute of each other.
Comment: I have used the PK3 and love it. I think it is the only way to go. The full USB makes programming large hex files fast!
Answer: I had to make the same decision a while ago when I broke my old PICKit2.
Finally I decided to buy the PICKit2 again.
Why?
- it supports most Microchip devices
-you can even program AVR MCUs with it see here http://pickit2.isgreat.org
-you can use the PICKit2 as a USB to serial converter (see link above)
-has its own PC programming software and the pk2cmd command line tool (Linux support too)
-PK3 is not mature yet
Its not like buying a house.. if you dont like it, buy the other one.
Answer: I have had a PK2 for nearly 4 years now and I'm pretty happy with it. It works for low end PICs as well as the 18F usb series which are all I have at my disposal.
The UART and logic analyzer are really useful tools, but I have yet to use the PK2-to-go option.
I think these are all the tools any starting PIC hobbyist will need and because it's an older model than PK3 I guess you might be able to get hold of them cheaper.
Answer: You need the PK3 if you are going to use the latest chips, as the PK2 software isn't being updated. You can see if the chips you want to use are supported by either unit by checking from within MPLAB. The main thing that people don't like about the PK3 is that the useful applications for the PK2 that configure it as a simple logic analyser and serial I/F haven't been ported to it. The ICD 3 I use is another option. It works with all Microchip devices and is a lot faster than the PK2/PK3, but costs a lot more. It's also replaced free if it ever develops a fault, even if I do something silly to it.
Answer: There's a video podcast here where David L Jones an Australian Electronics Design Engineer compares the PICkit2 and PICkit3 (he prefers the PICkit2 and rants uncontrollably about how Microchip have stuffed up with the PICkit3). He has a tendency to rant in many of his podcasts but is very funny in the process (he swears a lot as well so be warned).
I have a PICkit2 and am very happy with it.
Answer: Like Leon I also use an ICD3, but I want to try a PK2. The PK2 has a PK2-to-go option that allows you to download a hex file to the programmer and then program a microcontroller without a PC. This is an important feature for my company since we sometimes want to do firmware updates in the field. I think the PK3 has the same feature, but I have not been able to confirm that from just looking at the microchip website. Is there anyone out there who has tried both the PK2/PK3?
Just tried the PK2. It's good, but there are a few things that don't exactly meet my expectations:

PK2-to-go option limited in supported
hex file size < 100kb
PK2-to-go option still requires power via USB

Haven't tried the PK3 yet.
Answer: Get the PK3. Microchip has responded to the rants with some rollbacks and improvements. Also you get a safer system with less zapping of target boards and better future compatibility.
Comment: Thanks for the tip. I think I'll just go with the PK3 and get on with the fun stuff.

Should I get the PICKit 2 or 3?


Arp and flooding

Question: it is my understanding that nodes are not aware of the mac address of other nodes they want to communicate with, when a frame is created to communicate node A with node B, the destination mac address field would be empty, to avoid that, ARP comes into play, Ethernet can "peek" into the ip packet in the payload to look at the IP address of node B and ask "who has this IP address" as a broadcast in the LAN, if node B is in the lan, it will be reply and the mac address will then be know as well as the interface to which node B is connected (Mac address and ARP tables updated). If there is no response, the frame will be addressed to the mac address of the gateway to start its journey to the final destination in another network. When re-reading the CCNA book, it indicates that unknow unicasts are flooded to all interfaces and when one replies then the switch knows the interface to which that mac address is connected, which makes sense if I know the mac address of a destination and the entry is not yet in the mac address table of the switch. While I understand that "flooding" process, it conflicts with the statement that nodes know the IP address of other nodes but not their mac address. Are there circumstances in which nodes know mac addresses of other nodes or is ARP always needed to gather that info inthe ARP table?
Comment: You are mixing routing + ARP (L3) and switching + CAM/MAC tables (L2). There are posts here describing both processes very clearly.
Comment: Has any answer solved your question? Then please accept it or your question will keep popping up here forever. Please also consider voting for useful answers.
Answer: Not exactly.
Before the IP stack passes the packet to the NIC for transport, it needs to learn the next-hop's MAC address by using ARP (IPv4) or NDP (IPv6). Once it knows the address it can pass the packet as payload to the NIC along with the destination's MAC and have it encapsulated and transmitted.
The NIC (Ethernet's data link and physical layer) doesn't care what payload it transports and it certainly doesn't need to peek anywhere. It's the upper network layer's responsibility to provide that destination MAC along with the payload data. (This isn't really true for modern NICs any more that often support offloading functions, but let's ignore that for now.)
Flooding an unknown MAC is an entirely different process in a switch that is used to mimic a repeater/bus when the destination MAC is unknown to the switch. Of course, using ARP also populates any switch's MAC table, so you might say there's some relation.

Are there circumstances in which nodes know mac addresses of other nodes or is ARP always needed to gather that info in the ARP table?

MAC addresses are only learned through ARP or NDP. Of course, a previously used address stays in the ARP cache for a short period.
Comment: That means that layer 3 uses a layer 2 broadcast to learn that mac address or is it wrong to think in terms of layers here?
Comment: That's exactly correct for IPv4 ARP. IPv6 NDP uses multicast - there's no broadcast in v6.

Arp and flooding


How can I access C:\ProgramData in cmd

Question: I installed Chocolatey using the NuGet Console in Visual Studio which reported it was successfully installed in C:\ProgramData and I could use it in cmd or Powershell.  I tried 'choco install git' which also completed successfully, it created a folder in C:\ProgramData but it has no binaries, just a config file. Also choco isn't included in the path and neither is git after installation.
Comment: chocolatey creates a shim in bin folder to enable that program to be in the path but in my case it is not doing that.
Answer: Turns out there was an extra character(") in my Path because of which C:\ProgramData\chocolatey\bin was not included.

How can I access C:\ProgramData in cmd


Do I need a new EIN since I am hiring employees for my LLC?

Question: I have an LLC that I set up but at the time it was created, the business did not have any employees (this is for consulting work I am doing).  So I now have an EIN for this LLC but during the IRS interview I specifically said there would not be any employees for this company.  Now I am planning on hiring my wife as an employee (so that my business qualifies for small group health insurance).  Do I need to get a new EIN for my LLC because I now am hiring employees?  Or how do I tell the IRS that the old EIN will now have employees?
Comment: p.s. While business administration is generally off-topic, there is a *personal* angle here which, IMHO, keeps this question (marginally) on-topic.  Refer also to http://meta.money.stackexchange.com/questions/15/are-small-business-questions-on-topic
Answer: I called the IRS (click here for IRS contact info) and they said I do not need to get a new EIN.  I could have just filed the appropriate employer federal tax return (940/941) and then the filing requirements would have been updated.  But while I was on the phone, they just updated the filing requirements for my LLC so I am all good now (I still need to file the correct form and make the correct payments, etc. but I can use this same EIN going forward).
Disclaimer: Don't trust me (or this answer) for tax advice (your situation may be different).  The IRS person on the phone was very helpful so I recommend calling them if you are in a similar situation.  FYI, I have found calling the IRS to always be very helpful.


What is the typical use for operator()

Question:
Possible Duplicate:
How can overloading operator "function call" in C++ be useful?

I see often where the parenthesis operator, operator(), is overloaded on a class or struct. I have never run into such a need myself, and wonder what is the typical use/need of this operator?
For instance, overloading operator== is accepted as returning true or false based on some equality made with the argument provided. This has a certain accepted and anticipated behavior.
Answer: It's used a lot for the hashes, sets and algorithms component of STL to construct things called 'functors'.  For example:
using stl::map ;

map<string, string> myMap ;

but if you look at the specification for map it also includes a 'Compare' entry which defaults to less.  The Compare is the 'functor' you want map to use when comparing two keys.  It looks something like this:
template<class Key>
class less<Key> {
public:
  boolean operator()(const Key& a, const Key& b) { return a < b ;}
} ;

so what you have is:
 map<string, string, less<string> > myMap ;

and evertime you put something in the map or try to find something in the map it will use the less::operator() to do the comparisons.
You can use this to acchieve other effects such as when using 'sort' you can get sort to yield items in reverse order by using a different functor.
Comment: +1 for the example, that is a very helpful means of understanding the use, thanks
Answer: You can use operator(), also known as the 'function call operator', to make an object behave like (and be usable as) a function.
These objects are often referred to as 'functors', but that shouldn't be confused with the same term from mathematics. I believe a more proper term is 'function object'.
Imagine you have a function that takes a callback. But suppose you need to store some state in that callback.
[note: I haven't compiled this code, but you get the idea]
void DoStuffAndCallBack(MyCallbackType Callback)
{
    ...
    Callback(args)
    ...
}

In C, or in 'C-with-classes'-style C++, you would pass a static callback function to this method, and store results in some global or class-static variable.
But in C++, the function could be written like so:
template<CallbackType>
void DoStuffAndCallBack(CallbackType Callback)
{
    ...
    Callback(args)
    ...
}

Now you can define a functor object that overloads operator() and pass an instance of that object to the function. That instance will get the callback, and any intermediate results you want to store can be stored in that instance.
In other words, it's a nice way to avoid globals (:
I'm sure there are other uses, but that's one good one, IMO.
Answer: The canonical example is for a smart pointer class returning whether or not it is null, so you can do things like:
SmartPointer p = someOtherThing;
if (p)
{
// do something
}

In this case, the return type of the () operator should be bool, and the code will work as written. It creates a functor that allows the instance of the class to be called like a function.
Comment: Huh?  You didn't even use `operator()` here.
Comment: Testing an object with "if (obj)" does not use operator().
Comment: `operator()` is the function call operator. I think you're confusing it with the cast operator

What is the typical use for operator()


Sammy.js External Navigation

Question: I have built a SharePoint 2010 web part that is a single page app using knockout and Sammy to navigate between views of the SPA. Everything works fine within the SPA web part, but if I try to navigate to another page in SharePoint, the Sammy.js routing kicks in and just reloads my SPA home view. Is there a way to "override" the Sammy.js navigation when clicking a link outside the SPA web part?
Answer: Unlikely. Instead I would remove Sammy and make the navigation work using templates in knockout dependent on the current view.
Optionally wire it into Sammy so it could run stand-alone with proper URL routing, or simply nested inside the dom somewhere not using Sammy.

Sammy.js External Navigation


Python urlparse, correct or incorrect?

Question: Python's urlparse function parses an url into six components (scheme, netloc, path and others stuff)
Now I've found that parsing "example.com/path/file.ext" return no netloc but a path "example.com/path/file.ext".
Should't it be netloc = "example.com" and path = "/path/file.ext"?
Do we really need a "://" to determine wether or not a netloc exists?
Python's ticket: http://bugs.python.org/issue8284
Answer: Without the scheme://, there's no guarantee that example.com is a domain. You could have a directory called example.com. Similarly, you could have a url 'omfgroflmao/path/file.ext', how would you know if 'omfgroflmao' is a machine on the local network (i.e. a netloc) or whether it's meant to be a path component?
I can't see that the Python code is actually wrong, but perhaps the documentation needs to spell out explicitly the behaviour in such ambiguous circumstances (I haven't checked).
Answer: example.com/path/file.ext is not URL. It's just some string. For example if you put  into HTML page, it will not link to http://example.com/path/file.ext. It's just a shortcut provided by web browsers that you do not have to prepend the http://. You can not even use such URL as parameter for urllib2.urlopen() and similar functions.
Comment: but then you could have something like this  and then something like example would be correct

Python urlparse, correct or incorrect?


XAML usage question

Question: As far as I know, XAML is only used in WPF and Silverlight, isn't it?
Thanks.
Answer: No, it is also used in Windows Workflow Foundation:
Using Workflow Markup
Answer: XAML is also the basis for XPS.
Answer: It is also used in Office 2007+ *x formats
Answer: There is a huge mistake I often see people make when they say, "XAML is UI markup." It's not. You can have XAML with no UI whatsoever. XAML is, in essence, an XML object graph. It is markup for creating classes. It provides the parser with instructions on how to generate instances of types and set properties on those types. This is extremely useful for creating UI in WPF and Silverlight but can also extend to sample data, view models, and other constructs. As mentioned here, it is also used in Workflow and other areas.
Comment: Thanks. I know exactly what XAML is. But I didn't know it was used in other technologies like WorkFlow.
Answer: You can use it for whatever you like (beginning with .NET 4.0 if I'm not mistaken, didn't try it in 3.5).
However, if you do so, please also use the other good things .NET has to offer, such as "INotifyPropertyChanged" and dependency properties. Otherwise whatever you create will be a less - than - optimal solution.

XAML usage question


Is there still a legless phantom crew member on ISS?

Question: The Phantom Torso was designed to gather data on ISS crew Radiation exposure. What was its fate?
Comment: @OrganicMarble ... what, and used a hockey goalie mask?
Comment: They could have left off that creepy smile.
Comment: I was an ISS payloads Operation Controller from 2016-2019. In all my dealings with HRF (Human Research Facility), I never heard anything about a phantom torso payload. So the answer is it's probably not still on board.
Answer:
Is there still a legless phantom crew member on ISS?

As far as I can tell, no.
For that particular torso, no, it was returned.
The torso was launched on Expedition 2 with STS-102 from Cape Canaveral and landed with STS-105.
But then the legless phantom split into several paths:

1998 an original legless phantom was sent up on a STS mission.
2001 FRED went up on STS-102, and then was dissasembled for its return
The Russians built their own version for the Shuttle-MIR missions
Joint ESA, ROSCOSMOS and JAXA versions went on to do several missions on the ISS through to 2011 (last on Kibo; overall 7 years inside and outside the space station)
Modern versions, including female parts, flew on the Orion missions.

This is from the wayback machine:

Operations
Operational Requirements
The crew was only required to transfer and activate the Torso and equipment, check its status every 7 to 10-days, download data (using the Human Research Facility - 1 laptop) every 7 to-10 days, and to change the battery every 20-days. At the completion of the experiment, the crew disassembled the Torso for its return on STS-105.
Operational Protocols
The crew set up the Torso in the U.S. Destiny Laboratory and activated all the associated hardware. Once activated, the Torso, CPDS, and TEPC collected data continuously, without crew intervention. Data downloads were sent to the Telescience Center at Johnson Space Center for distribution to the investigators.
https://web.archive.org/web/20090531061500/http://www.nasa.gov/mission_pages/station/science/experiments/Torso.html
The Organ Dose Measurement Using the Phantom Torso (Torso) employed a model human head and torso (Rando phantom), imbedded with over 350 detectors (thermo-luminescent detectors) and five silicon diode detectors, over five depths to measure absorbed dose to specific organs during shuttle flight. A tissue equivalent proportional detector and a charged particle directional spectrometer were placed within 1.5-feet of the torso during these ISS measurements.
Results/More Information
Organ Dose Measurement Using the Phantom Torso (Torso) results were combined with results from various experiments on previous missions to validate NASA's organ dose database for astronauts. Preliminary results suggest that organ dose and dose equivalent can be projected to a +/- 25 percent accuracy using a combination of dosimetry and radiation transport models. This accuracy envelope is greatly improved relative to the current accuracy of organ specific cancer risk projections, estimated at +/- 500 percent. Further analyses and incorporation of these radiation results into operational planning for exploration is ongoing.
Overall, the dose rates measured in Torso were in good general agreement with other measured values and with the models used to predict these values. The largest differences observed between measured data and the simulations were 15 percent. In addition, a model which considers orbital altitude, attitude, and solar cycle emissions agreed within 25 percent of the measured data. It was determined that the majority of radiation energy deposited in human tissues (about 80 percent) was due to galactic cosmic radiation. This is due to spacecraft material providing effective attenuation of the protons trapped in the Earth's magnetic field. The data indicated an average radiation quality factor (a measurement of how damaging a type of radiation is to tissue) of 2.6 and that the quality factors do not appreciably change with depth in the body. Finally, this experiment indicated that the contribution to both skin and organ doses from secondary neutrons is not negligible (Expedition 2 Postflight Report).
Organ Dose Measurement Using the Phantom Torso (Torso)02.06.09
Brief Summary
Organ Dose Measurement Using the Phantom Torso (Torso) measured the amount of radiation that a human received during an extended space flight. The measurements were taken using an anatomical model of a male head and torso that contains different types of radiation sensors. This experiment is important for future human long-duration space exploration.

http://www.spacefacts.de/iss/english/exp_2.htm
The Phantom Torso experiment is the first to also measure the effects of radiation on organs inside the body, especially blood-forming organs. The Torso is a "phantom" because it is not human, but so close to being human that scientists cannot tell the difference between a human X-ray and an X-ray of the Phantom.
The Phantom Torso is similar to torsos used to train radiologists on Earth, and is equivalent in height and weight to an average adult male. Covered with a Nomex "skin", the interior is horizontally sliced into 34 sections 1-inch (2.3 centimeters) thick. Each slice is embedded with two kinds of detectors: passive detectors, which use no power and will be read after the torso returns to Earth; and active detectors that will measure real-time radiation doses on the brain, thyroid, heart and lung area, stomach and colon. Data collected from the active detectors is transmitted by the crew on board the International Space Station to scientists on Earth every 10 days. Passive detectors on the Nomex will be used for comparison. Radiation measurements on the ISS exterior will be taken. Data will be downlinked every 10 days.

2009 The Phantom Torso returns:

https://phys.org/news/2009-05-phantom-torso.html
The Phantom Torso is back, and he has quite a story to tell. He's an armless, legless, human-shaped torso, a mannequin that looks like he's wrapped in a mummy's bandages. Scientists at the European Space Agency call him Matroshka, and like his NASA counterpart Fred, this mannequin is an intrepid space traveler. Now that he's spent four months on the International Space Station, scientists are learning about the space radiation that Matroshka endured.

similar question asked:
http://www.collectspace.com/ubb/Forum30/HTML/000129.html

https://www.abc.net.au/science/articles/2001/05/09/291697.htm
Fred the 'phantom torso', is a dummy in space. Made from human bones, plastic organs and artificial skin, Fred's mission is to measure the amount of radiation to which astronauts are exposed.
Fred is spending the next four months on board the International Space Station with the astronauts. Although no astronaut has ever been diagnosed with space radiation sickness, excessive exposure could lead to health problems.

Further info:
Matroshka experiments on ISS (post-FRED):

Four MATROSHKA exposures have been performed outside (MTR1) in the PIRS module
(MTR 2A in 2006), in the Zvezda module (MTR 2B from 2007 - 2009) and inside the
Japanese Experimental Module (MTR-KIBO from 2010-2011).

Matroshka outside the ISS, 2004-2005:

EM1:

Matroshka AstroRad Radiation Experiment (MARE) on Exploration Mission 1

Other FRED links:
https://www.medscape.org/viewarticle/569962
https://itwire.com/science-news/space/cosmic-radiation-bombards-fred-the-phantom-torso-ouch.html

https://bloodlesscadavers.weebly.com/technology-after-death.html
WHAT HAPPENS WHEN YOU DONATE YOUR BODY TO SCIENCE?
NASA has always used cadavers in their research for safer capacities for the crew
This torso is used to document radiation exposure during long term space flight.  Recently, they made limited use of cadavers in testing during the development of the Orion spacecraft.

Twitter link:
https://twitter.com/Pile_of_Things/status/1648844666627067906

1998 Phantom torso:

NASA expanded space radiation research in the late 1990s, by designing a human
torso phantom (nickname FRED), which was exposed to space radiation in the year 1998
aboard the Shuttle-MIR space flight
FRED is the first fully
instrumented Alderson RANDO phantom torso (with head) in a flight inside the single
module SpaceHab during STS-91 Shuttle-MIR mission.  The phantom was composed of
a human male skeleton and tissue-equivalent polyurethane resin.  The soft tissue
comprised of 8.8% hydrogen, 66.8% carbon, 3.1% nitrogen and 21.1% oxygen, with a
density of 1.0 g/cm3; and the lung is composed of 5.7% hydrogen, 74.0% carbon, 2.0%
nitrogen, and 18.1% oxygen with a density of 0.320 g/cm3.
The phantom body was sectioned into
34 equal slices (2.5cm thick) from the head to the thigh.  A total of 59 detector cases were
placed into critical organ/tissue positions and were designed to provide measurements
for: the brain, thyroid, bone surface, esophagus, heart, lung, stomach, liver, spinal cord,
bone marrow, descending colon, bladder and gonad
The phantom was fixed onto
a rack at the starboard side in the SpaceHab module onboard the Space Shuttle.  The shuttle Discovery was launched on June 2, 1998, and landed on June 12, 1998, for total
flight duration of 9.8 days
The Institute for Biomedical Problems in Moscow  developed a water filled spherical phantom with a 35cm diameter.  This phantom
was placed at three different locations onboard the space station MIR in the years 1997 –
1999. The phantom is rather simple, having only four detector channels, positioned in right
angle in one plane inside the phantom.
(more advanced spherical phantom (MATROSHKA-R) flown in 2004)  The MATROSHKA-R (MTR-R) phantom is a multi-user unit for studies of the
depth dose distribution of the onboard radiation field inside the compartments of the ISS.
most comprehensive phantom experiment is the
MATROSHKA human phantom experiment; headed by ESA and with cooperation from
16 international research organizations.
The objectives of the MATROSHKA
experiment is to determine the empirical relations between measurable absorbed doses
and the tissue absorbed doses in a realistic human phantom exposed to the radiation field
in orbits of the ISS; particularly the depth dose distribution at different organs of
astronauts during an extravehicular activity.
The MATROSHKA facility consists of a RANDO human phantom, a base
structure and a container.  The phantom body consists of natural bones embedded in
tissue-equivalent polyurethane resin, with different density for tissue, lungs and organs.  The phantom body is made up of 33
slices, each with 25mm thickness, stacked together over a mandrel to stabilize the whole
body. The phantom was covered in a poncho and
hood with sewn on polyethylene stripes and detectors to measure the skin dose and for
thermal protection.  The
phantom was enclosed inside a carbon fiber reinforced plastic container, with a mean
mass thickness similar to the astronauts spacesuit during EVA, and to protect the
phantom against space vacuum, debris, and material off-gassing. The phantom was launched to the ISS in 2005
and was transferred into the Russian module Zvezda of the ISS.  The MATROSHKA
phantom facility was installed outside the Zvezda module, simulating measurement of an
astronaut during EVA.  The MATROSHKA experiment spent 616 days in orbit, both
inside and outside the Russian module.

http://wsn.spaceflight.esa.int/docs/Factsheets/19%20Matroshka%20LR.pdf
https://en.wikipedia.org/wiki/Matroshka_experiments
2005 ESA:
https://www.esa.int/Science_Exploration/Human_and_Robotic_Exploration/International_Space_Station/News_from_a_space_phantom_The_continuation_of_the_Matroshka_experiment
Last Matroshka experiment:

https://iss.jaxa.jp/en/kiboexp/news/matryoshka20110322.html
Space radiation measurement of the Kibo module using the Matryoshka facility, which has jointly been performed by Russia, ESA and JAXA since May 2010, was completed on March 11, 2011.
Comment: There are photos of the versions that flew on Orion here https://en.wikipedia.org/wiki/StemRad#StemRad_MD which are less colourful than the the rendered images but equally uncanny.
Comment: I'm surprised that that got official funding, remembering the popular objection to the nude images on the Pioneer plaque.
Comment: I'm wondering how much of a coincidence it **isn't** that the two names I most commonly use for phantom card players (eg: a "player" who just turns over the next card without looking at it in Hearts, Spades, or Cards Against Humanity) are "Fred" and "Rando".


I need to know if they have an ENTERPRISE or COMMUNITY MYSQL edition

Question: I'm doing some MYSQL work for a company, and I need to know if they have an ENTERPRISE or COMMUNITY edition. I researched this, and according to the mysql reference pages, I should be able to use the "status" command. According to that reference, the "Server Version" should say "Community", or "enterprise". Ours says neither (figures, right?), just "5.0.77 Source Distribution". Is there another way to tell?
Comment: Why does this matter? The versions are exactly the same. The additional things enterprise have are support related.
Comment: Have you tried asking them?
Comment: them *them* you refer to are long gone (the ones who created the server). The only people left aren't mysql- or OS-savvy..
Comment: Now I feel like *I'm* the one doing the research.
Comment: Boy the saltiness in these comments! :/ This was 4 years ago, I hope people reviewed the community guidelines since then. ^_^
Answer: tl;dr
Try this:
mysql> SHOW VARIABLES LIKE "%version%";

Normal answer

Using a command client (mysql), the server version of the MySQL server to which you are connected is shown once you are connected. The server version information includes community or enterprise accordingly.
For example, here is the output from a MySQL Community Server edition installed on Linux:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.27-standard MySQL Community Edition - Standard (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

This is an example of the output from MySQL Enterprise Server on Windows:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.28-enterprise-gpl-nt MySQL Enterprise Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

You may also determine the version information using the version variables. Both the version and version_comment variables contain version information for the server to which you are connected. Use the SHOW VARIABLES statement to obtain the information you want, as shown in this example:

mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+------------------------------------------+
| Variable_name           | Value                                    |
+-------------------------+------------------------------------------+
| protocol_version        | 10                                       |
| version                 | 5.0.27-standard                          |
| version_comment         | MySQL Community Edition - Standard (GPL) |
| version_compile_machine | i686                                     |
| version_compile_os      | pc-linux-gnu                             |
+-------------------------+------------------------------------------+
5 rows in set (0.04 sec)

Straight from the documentation.
But, of course, so is STATUS;

The STATUS command displays the version as well as version comment information. For example:

mysql> STATUS;
--------------
./client/mysql  Ver 14.12 Distrib 5.0.29, for pc-linux-gnu (i686) using     readline 5.0

Connection id:          8
Current database:
Current user:           mc@localhost
SSL:                    Not in use
Current pager:          /usr/bin/less
Using outfile:          ''
Using delimiter:        ;
Server version:         5.0.27-standard MySQL Community Edition - Standard     (GPL)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:            /tmp/mysql.sock
Uptime:                 1 day 3 hours 58 min 43 sec

Threads: 2  Questions: 17  Slow queries: 0  Opens: 11  Flush tables: 1  Open     tables: 6  Queries per second avg: 0.000
--------------

So I wonder whether you're actually just looking at the first line provided or whether you're checking below for the "Server version" line.
If nothing works for you then feel free to edit your question with a complete dump of what you get.
Edit
As you found out it appears that they do not disquisition between the releases since it's a specific edition release, in this case a Community Edition. Thus the answer generally only works if you can't be certain by looking up the version.
Comment: so was "status", straight from the documentation (which I guess you're implying I didn't read....). and like the status command this ALSO tells me nothing version_comment =  "Source distribution"
Comment: @user3250422 " Ours says neither (figures, right?), just "5.0.77 Source Distribution"." you need to give us the complete output to figure out what's wrong.
Comment: here what I got (sorry about the formatting...)`code`mysql> status
--------------
mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i386) using readline 5.1

Connection id:          5476
Current database:
Current user:

@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.0.77 Source distribution
Protocol version:       10
Connection:             Localhost via UNIX
Comment: @user3250422 It's weird, really. What happens when you try the `SHOW VARIABLES LIKE "%version%";` command ?
Comment: Jonas I did that - I just get a table of the same (sub set of) info in the status command, formatted differently. I did some more analysis and found on the MYSQL release notes pages, that 5.0.77 was ONLY a (2009) Community release. So although that's a heck of a strange way to have to determine ENT or COMMUNITY, I think that's closest I can get to an answer. Which is fine - I'm going to tell them I need to move these aps to another server which I KNOW is enterprise (because it has enterprise plug-ins) and decommision this relic! Thanks...
Comment: @user3250422 I'm glad you found your answer, looking up the version online should, of course, be the first thing in mind but of course we tend to find the more general solution. I edited the answer anyway.
Comment: the strange thing about this escapade is, MYSQL had ENT and COMMUNITY releases LONG before 5.0.77. So you'd THINK that since ENT release #1, they'd have aq way to tell the difference, since to a developer, that could be an important thing to know? Things that make you go "HUH"...


Analogous to hall effect, does electric field applied perpendicular to the current direction through a semiconductor bar create magnetic field?

Question: Hall effect says, when a magnetic field is applied perpendicular to current direction in a semiconductor bar, an electric field (and hence Hall voltage) will be created across the side which is mutually perpendicular to both current direction and applied magnetic field direction. However I have a doubt that if instead of applying magnetic field, if we apply electric field, will a magnetic field be created?
Answer: A perpendicular electric field applied to a current carrying conductor (or semi-conductor) Would cause the fee electron density (and current) to shift toward one side of the conductor. Any current associated with this shift would be at the edges of the electric field, and the changes in the  magnetic field would probably be minimal.
Comment: A Hall voltage is very small (generally much less than 1 volt). Applied sideways across a current carrying conductor, it would cause very little displacement of the existing current.
Comment: Hi I did not understand clearly how the changes in magnetic field be minimal?  according to hall effect, hall voltage induced will be proportional to the applied magnetic field. So if we manually apply that much electric field, why don't we get a magnetic field similar to the initial case? Please help me if you have enough time. Sorry, but I am really confused with this.


Explain Turbulence

Question: I'm a high school student. I still don't understand what turbulence is. Please can you explain what it really is? This is what I think it is: rotating motion of water when a particle travels at a velocity of $V$.
Comment: Are you referring to the layman term "turbulence" like you would encounter in an aircraft or the actual turbulence that is studied in fluid dynamics (which are related but the first is actually answerable here while the second is too broad to answer -- there's countless books dedicated to only turbulence)
Comment: A little search could be usefull: http://en.m.wikipedia.org/wiki/Turbulence
Comment: It is too complicated for me to understand! Please summarise! :/
Comment: Any flow which is not laminar is turbulent (if you ignore the transition phase)
Answer: Turbulence isn't only about water, it is about fluids in general.Flow can be divided into three types : laminar, transitional and turbulent.The turbulent flow  occurs when the fluid is flowing fast and the laminar when it is flowing slowly.
In laminar flow the motion of the particles of fluid is very orderly with all particles moving in straight lines parallel to the pipe walls. In turbulent flow the particles move in a rotating motion. Actualy, velocity itself is just one of the factors that affect the flow of a fluid, for that a relation between the factors (density, diameter of the pipe and velocity.) is summed up by a the Reynolds number: if it is less than 2300 the flow would be laminar, if it is greater than 4000 the flow would be turbulent and if it is in between the flow is transitional. And here is a simple guide with diagrams: http://www.efm.leeds.ac.uk/CIVE/CIVE1400/Section4/laminar_turbulent.htm
Comment: Riemann number? Surely you mean *Reynolds* number
Comment: Why the downvote?
Comment: Yes you are right!
Answer: To give a definition of turbulence is hard, and every aspect of turbulence is controversial, but there are some essential elements:
Turbulence requires the presence of vorticity.
Turbulent flow has a very complex structure, involving a broad range of space and time scales.
Turbulent flow fields exhibit a high degree of apparent randomness and disorder. However, close inspection often reveals the presence of embedded coherent flow structures.
Turbulence is chaotic.
Answer: Well for a very elementary definition I would have to say that when the flow of a liquid starts to become unsteady, it is referred to as turbulent flow.
As @tpg2114 says in his comment, it is pretty difficult to explain turbulence here as it is a vast topic. Well i would advice you to study about it further on wikipedia first and then some dedicated books/texts.
Still, to summarise in short, consider the flow of water from a tap, first you open it so less that only drops come out, precisely increase the flow a little more untill a very thin stream of water flows, this is streamline flow, in this flow every droplet of water falls behind another and has same velocity as that one at that point, imagine a marching army. But when you get in frenzy and turn the tap all way open, a strong rush of water flows out in a hurry, imagine rush hour at a very heavily crowded street and as soon as the green lighg goes and everyone starts walking, someone may even fall down, no order, a chaotic flow and an unsteady flow of water is referred to as turbulent flow
Wasn't that short after all, huh !
Comment: The problem here (and with the answer below) is that unsteadiness (and rotation) are only a few of the characteristics that are required to describe turbulence. There are a few more than any into to turbulence book will include in the introduction chapter. You can have rotation in laminar flow and you can have unsteadiness in laminar (and potential) flow so those two alone (and even together) are insufficient descriptions...
Comment: I believe the analogy of rush hour at any crossroad is appropriate ! Also I do not talk about rotation, but about chaotic nature, unsteadiness is also present in laminar butnis essential to turbulence and chaotic flow is unique for turbulence, so I suppose for a layman it is sufficient.

Explain Turbulence


Do we still need a Remember Me button on websites? Or can we rely on modern browsers to handle this?

Question: I recently had a discussion at work about whether to include a "Remember Me" option on our website. Altough I was initially in favour of the idea, I later realised that most browsers already provide such functionality. So I was wondering if it's still necessary to include this option in 2018. What do you think?
Comment: It depends on user privacy in the site. Better not to ask in payment sites. I have checked remember me in Facebook and Twitter and LinkedIn so that I don't have to login Everytime.
Answer: Browsers can remember your details, yes. However the Remember Me option caters for the opposite situation - users on shared machines. A website will be configured to intentionally not remember the users details, unless they choose the 'Remember Me' option.
That way, people checking their Facebook in a public library won't have to clear their browser cache when their session finishes (because most people won't do that).
So, is it necessary to include a 'Remember Me' option? That depends on your application. Is it only ever going to be used on private users machines (such as a work application) or is it something likely to be used on shared, public machines (library, home computer etc).
Comment: I wonder whether providing the opposite action ("Automatically log me out after this session" or some such) would be a better design?
Answer: Browsers do not provide this functionality. A browser may store credentials, but you have to manually press "login" each time.
The advantage of a remember me button is, that a user does not need to login every time he closes the browser. For example, in Gmail, Facebook, Netflix, Twitter, LinkedIn etc. one does not need to login each time one open the page (if one uses the remember me button). If would drive me crazy, if I had to login on each of these pages.
On the other hand, on my local outdated library website I have to click each time the "Login" butten. When I close the browser I am logged out again. I hate this additional click, a remember me button is not offered:

So in my opinion, a remember-me button is absolutely necessary.


How do I unset all functions in zsh?

Question: I know that I can use unset -f $FUNCTION_NAME to unset a single function in bash / zsh, but how do I unset all functions?
Answer: In the zsh shell, you may disable all functions using
disable -f -m '*'

(literally, "disable each function whose name matches *").
You may then enable them again with the analogous enable call.
You may also use unset in a similar way to remove the functions completely from the current environment:
unset -f -m '*'

Comment: @TeddyC My answer uses `*` as a globbing pattern that matches all function names. You could use `disable -f -m '[!_]*'` to disable all functions that does not start with an underscore. This could not be used for disabling the functions defined in a file unless their names follow a specific pattern. If by "defined" you mean that their names are simply listed, one per line, in a file, you could use `disable -f $(<thefile)`
Comment: Is there a way to disable all functions whose names don't start with `_`, or only disable functions defined in a file? Thanks!
Comment: By "defined" I mean that what the functions do are defined in the file - what about this case then? Thanks!
Comment: @TeddyC This is quite a different problem then. You may want to ask about this in a separate question.
Answer: The associative array functions contains all the defined functions (including autoloading stubs), so ${(k)functions} expands to the list of names of defined functions.
unset -f ${(k)functions}

How do I unset all functions in zsh?


How to edit archive page's content inside wordpress dashboard?

Question: So basically, I have a page that is a custom archive showing a list of posts on it. The only issue is, the client wants to be able to edit the actual archive page content itself (image and title), not just the content of the posts. All of this needs to be able to be done inside the dashboard so that its easy for the client.
Is there any way i can make is so that the archive page's custom template will show up in the "pages" tab? Or is editable via the dasbhoard at all?
Thanks!
Answer: Making it a taxonomy and allowing the client to edit the term title & description would be an option I'd consider.
The theme may or may not be using a custom template-file to control the cpt-archive's front-end.
Using a page-template would be ill-advised because by loading the post-type and the page at the same url, problems can arise.
Using theme-options would be a good way. Having a theme option in combination with a custom archive-template for the post-type archive could do it.
For how to create theme-options, See this example: https://codex.wordpress.org/Creating_Options_Pages#Example_.232
& for custom-page templates, this has you covered: https://developer.wordpress.org/themes/basics/template-hierarchy/#visual-overview
Answer: Depending on the set-up there are multiple ways to handle this.  I'm assuming the most likely scenario is that you're using a third-party theme, meaning you can't edit any of the theme files yourself (you definitely shouldn't do it as updates will erase your changes).  This limits your options a bit and the easiest route would be, as other answers have suggested, to simply populate the Category content under the 'Posts' menu in the dashboard.  There are plugins that will allow you to add more content, like a featured image: Category Featured Image
You could also build your own plugin allowing for greater control as to what you're adding to the categories.  Here is a segment of code I've used to add a colour picker and a checkbox option to a custom taxonomy.  You could of course apply it to an existing taxonomy.
function yourplugin_taxonomy_custom_fields( $tag ) {
    $t_id = $tag->term_id;
    $term_meta = get_option( 'taxonomy_term_'.$t_id );
    $level_public = $term_meta['level_public'];
    if ( $level_public == 'true' ) {
        $checked = ' checked="checked"';
    } else {
        $checked = '';
    }
?>

        <?php _e('Player Level Colour'); ?>

        <input type="text" name="term_meta[level_colour]" id="term_meta[level_colour]" class="ifs-pp-colour-picker" value="<?php echo $term_meta['level_colour'] ? $term_meta['level_colour'] : ''; ?>">

<?php _e('Select the label colour for this Player Level.'); ?>

        <?php _e('Player Level Visibility'); ?>

        <input type="checkbox" name="term_meta[level_public]" id="term_meta[level_public]" value="true"<?php echo $checked; ?>>Level is Visible to users when viewing frontend Player Profiles.

<?php _e('Please indicate if this Player Level should be visible on the player profile page or not. This is useful for providing context for some of the ratings or not.  It may be helpful, in some instances, for users to understand that the ratings a player has recieved are relative to their category or level of play.'); ?>

<?php }
add_action( 'yourplugin_player_levels_edit_form_fields', 'yourplugin_taxonomy_custom_fields', 10, 2 );

function save_yourplugin_custom_fields( $term_id ) {
    if ( isset( $_POST['term_meta'] ) ) {
        $t_id = $term_id;
        $term_meta = get_option( 'taxonomy_term_'.$t_id );
        $cat_keys = array_keys( $_POST['term_meta'] );
        foreach ( $cat_keys as $key ){
            if ( isset( $_POST['term_meta'][$key] ) ){
                $term_meta[$key] = $_POST['term_meta'][$key];
            }
        }
        update_option( 'taxonomy_term_'.$t_id, $term_meta );
    } else {
        delete_option( 'taxonomy_term_'.$t_id, $term_meta );
    }
}
add_action( 'edited_yourplugin_player_levels', 'save_yourplugin_custom_fields', 10, 2 );

If you want to add the colour picker you'll have to do the proper script inclusion, etc.  (This should cover the process.)
Please note that with this option, you still need to be able to edit the archive-cpt.php file so that you can utilize these new options you've just added.  Depending on the theme you're using, you may be able to edit it yourself or perhaps your third-party theme has some hooks your plugin can utilize.
However, if you're using a custom child theme or a custom theme, you actually have a great deal more flexibility and can set up archive templates - you can then control what content is fed into it.  You can manipulate content by adding theme options which are covered in @admcfajn's answer, or you use the category options I've covered above.
Comment: It was because I was using a third-party theme.  Wasted a lot of time figuring that out thanks.
Answer: Sure it can be done. For taxonomies (category, tag, any custom tax - i assume this is what you're after) it's easy, they each have their own page in the dashboard - see under posts -> category/tag -> edit category. There's a custom field called description but you can add more (photo, whatever) via functions.php or some plugin.
Of course, you'd have to edit the templates yourself first, so they fetch the contents of the wanted fields.
Answer: In your archive-cpt.php file make sure to give it a Template Name
 //Template Name: Archive Template Your CTP
Then when creating a new Page your archive template will be available in the Page Attributes > Template dropdown


Where to find a bike to hire / buy / borrow in Southern Spain

Question: I am doing a bike trip in Southern Spain near Lorca- it is relatively short and I don't want to take a bike on the plane for it- I was hoping to hire locally. What are the chances of me finding a mountain bike or hiring one around there (or anywhere in Southern Spain Andalucia region).
Comment: Have you tried Google Translate (bicycle hire --> alquiler de bicicletas). Not sure of my Spanish geography but putting this term into Google Maps and centering on Malaga seems to yield some results.
Answer: I rented mountain bikes from www.bikeiberia.com in Spain! They send the bikes to you and you just send them back when you are done. The service and the bikes were excellent.