Task Manager for Firefox (like in Chrome?)

Question: I was looking over Chrome and the task manager feature and really wishing something like this was in Firefox (as i have lots of addons [probably too many] and lots of tabs open). I looked for an addon or something but perhaps I have missed something? Anyone know of something like Chrome's task manager but for FF?
Comment: Type this into your address bar in Firefox: "about:performance" (without quotes).
Comment: I need that to clear the RAM. Tab unloaders do not work. Chrome task manager is *highly useful,* so Firefox just needs it.
Comment: For Firefox 75 they have this option built-in to the menu. https://support.mozilla.org/en-US/kb/task-manager-tabs-or-extensions-are-slowing-firefox
Answer: There's a couple things you can do to see what kind of overhead you've imposed on Firefox.
The about:addons-memory Extension will give you a nice looking page showing how much memory each of your extensions is using.  You can use that information to decide if the overhead imposed is worth the functionality it provides, or if you should look for a more lightweight extension that has similar functionality.
Also, the about:memory page will give you a very technical view of how Firefox is using the memory that's been allocated.
Be careful though, both views give fairly technical information and can be easily misleading if you don't truly understand what you're looking at, how memory allocation in Firefox works, and how your OS manages memory.
As far as I know Firefox doesn't have any built-in way to show the other details that Chrome's Task Manager does, like CPU and Network usage.  As @RobK alluded to, Firefox's current architecture may not make providing such statistics easy (or even possible).
Comment: about:addons-memory is currently broken for me(firefox 47). It hasn't been updated since 2014
Comment: Unfortunately, I can  not unload tabs. And the tab unloading add-ons are all bogus.
Answer: Firefox does not have a task manager. Unfortunately, due to Firefox's architecture it would be difficult to monitor per-tab.
Comment: What about Quantum? (I do not like Quantum. But it works similarly to Chrome: seperate processes).
Answer: There will not be any task manager in Firefox in the foreseeable future. Firefox now feature the Firefox Health Report.
Comment: Health report? Does that solve the problem? (no personal offence, but Health Report has nothing to do with task manager. I have still upvoted +1, because -1 stinks like armpit sweat). Still thanks for the answer. Maybe, things will change).
Comment: Also read [Firefox uses too many CPU resources - How to fix](https://support.mozilla.org/en-US/kb/firefox-uses-too-many-cpu-resources-how-fix) and [Firefox is slow - How to make it faster](https://support.mozilla.org/en-US/kb/firefox-slow-how-make-it-faster)


Liszt's Eglogue - the first few bars

Question: Liszt's Églogue, from the first part of Anées de Pèlerinage, contains several instances of a theme, first occurring between bars 3 and 6, in which a melody is played over a (much lower) bass note. The chords are arpeggiated, but how would one go about sustaining the bass note while not affecting the melody? I have tried using the sostenuto pedal, but it is very hard to catch the bass note while also keeping a light texture. Any suggestions?
Answer: If you can stretch a tenth, you can sustain all the notes with your fingers if you really want to. Play the Db in bar 3 with your right hand, etc.
Otherwise, just use the sustain pedal (possibly with a half-pedal half way through each bar) and don't fuss too much over it. If the piece as a whole sounds convincing, nobody will care if the notes literally sustain for exactly the written durations.
The sostenuto pedal was first exhibited in public in 1844, but not patented until 1874, in both France and the USA. Steinway in the USA was the most "enthusiastic" early adopter.  Anées de Pèlerinage were composed in 1848-55. Liszt may have seen the device, but on his virtuoso tours around Europe it's unlikely that he played many (or even any) instruments with one.
If you want to use the sostenuto pedal, you just have to make the first "arpeggio" slow enough to use it. They are often somewhat temperamental and lethargic animals. The bass notes have the same pitch for 4 bars, so you only have to "fire" it once.

Liszt's Eglogue - the first few bars


$wpdb->insert not working

Question: Evening all,
I have been creating my own wordpress plugin but I can't get my plugins options page within the admin section to save any of the plugin settings I input to the plugin table I created.
When I input settings in the options page and submit my changes it all looks to be working but when I query the table it is empty and now rows have been inserted.
Any help to fix this issue would be much appreciated.
Thanks in advance,
Xander
My code is listed below.
I have a class which creates a table using this code:
function createGalleryTable() {
        $sql = "CREATE TABLE IF NOT EXISTS `wp_pgp_gallery` (
        `gallery_id` mediumint(6) NOT NULL auto_increment,
        `name` varchar(20) NOT NULL,
        `default_gallery` tinyint(1) NOT NULL default '0',
        `published` tinyint(1) NOT NULL default '0',
        `gallery_desc` varchar(255),
        `display_style` varchar(10) NOT NULL default 'Info',
        PRIMARY KEY  (`gallery_id`),
        KEY `name` (`name`)
        );";
        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
        dbDelta($sql);
    }

I have another class which is called by the form submit action which passes a string parameter to be inserted to my table:
function addgallery($pgp_galleryname) {
        global $wpdb;

        $wpdb->insert('wp_pgp_gallery', array(
                            'gallery_id' => NULL,
                            'name' => $pgp_galleryname,
                            'default_gallery' => '0',
                            'published' => '0',
                            'gallery_desc' => NULL,
                            'display_style' => 'Info'
                        )
                    );
        $lastid = $wpdb->insert_id;
    }

Answer: Do no pass gallery_id on insert as it is an auto increment field.

$wpdb->insert not working


Can repeated game sustain a discounted average payoff that is not individually rational?

Question: Look at the following payoff matrix, there are two stage Nash equlibria, and we consider a infinitely repeated game with discount factor $\delta\in(0,1)$, can players sustain an average payoff of (2,2) under any strategy? (I am confused because the individually rational(i.e. minmax) payoff is (3,3)) If not, why?
Comment: @Acccumulation: In the repeated games literature, it's customary to define the set of individually rational payoffs as $\{(u_1,\dots,u_n): u_i\ge\min_{a_{-i}}\max_{a_i}u_i(a_i,a_{-i})\,\forall i\}$. In this case, $(3,3)$ is the minimum of this set.
Comment: How is the mimax payoff (3,3)? The minimum for H is 0. The minimum for L is 3. Which means that if both player play minimax, they both choose L, and the payoff is (5,5).
Answer: I'm inclined to say $(2,2)$ is not sustainable, though I don't have a formal proof at the moment.
To achieve an average payoff of $(2,2)$, the players must play $(H,H)$ in some stages. But then a player can deviate to playing $L$ and avoid any subsequent punishments by ensuring that he can always get at least $3$, which is better than $2$.
Answer: I think the result you are looking for is Lemma 2 (p.7) of these lecture notes by Johannes Hörner. Also see the papers he references in the end.
There is a formal proof, but the idea is exactly what Herr K. wrote in his post.
In your repeated game, all players must have an average payoff of at least 3 in Nash equilibrium.
Comment: Wonderful! thanks! Just wondering how to convert this "obvious" idea into a formal proof.


Is it possible to tell if a unjailbroken phone has been jailbroken in the past?

Question: I heard that a phone can be jailbroken and then "un-jailbroken." Is it possible to tell if an "un-jailbroken" phone has been jailbroken in the past?
Answer: If the device has been restored(how you "unjailbreak" a device), there is no way to find out if the device has been jailbroken in the past.
Comment: @lamanon Yes, except it is usually done through iTunes(https://www.macworld.co.uk/how-to/iphone/unjailbreak-your-iphone-3601679/).
Comment: When you say restored, do you mean a factory restore? Like on an iPhone, you would go to Settings, and there's some option called "Restore all settings and iPhone"


What does the word "mortarboard" mean, as it relates to an SE badge?

Question: I like the creative names on SE badges, but a couple of them went over my head.  What is "mortarboard"?
Comment: @kzh: I had considered that, but my question has more to do with how the word "mortarboard" relates to the badge than the badge itself.  That is an English question.  The name of the badge is more in English territory, and the workings of the badge, what it does, etc, is more into meta territory.
Comment: For the record, I think this should have stayed on the main site. The question asks, "What is a mortarboard?" and uses the badge as an example of use. This, as far as I know, has nothing to do with Meta.
Comment: @MrHen The question, as originally stated, had an overbearing focus on SE. Assume that the question had had such a focus on another site—in that case, I would have had to have closed it as "too localized" or "off topic". If the question had merely asked what a mortarboard was in more general terms, it would be "general reference". And I couldn't just leave it be because it was flagged, so I did my best to rescue the question. (By the way, this follows from a general policy at MSO).
Comment: You are absolutely right.
Comment: @kzh: Thanks for conceding; I wasn't going to fight about it!
Comment: @kiamlaluno: I did say "where did the name come from".
Comment: Yes, but the question title is about a badge, while the question is about the word _mortarboard_. In other words, you are asking "what does _mortarboard_, used to name a badge in SE sites, mean?"
Comment: @waiwai: Fair enough. I guess I more think it _doesn't_ belong here than I think it belonged on the main site. As in, I am not sure it belongs anywhere but I get the feeling it doesn't belong here.
Comment: @waiwai, @MrHen: You're both right.  I could have looked it up and applied the metaphor, to an extent, myself.  The answer here is helpful, though.
Answer: A mortarboard is the name of the cap worn by someone graduating (e.g., from high school or college).
From thefreedictionary (definition 2), a mortarboard is:

An academic cap topped by a flat square.

Presumably it was chosen for the particular badge of, "Earned at least 200 reputation in a single day" to symbolize a degree of academic merit.
Comment: Not exactly; it's less about "graduation" and more about recognizing academic merit. It takes some effort to hit the reputation cap on most SE sites; you're either answering a lot of questions or posting a few really good answers which garner a lot of upvotes in one day. The mortarboard cap worn in academic ceremonies is a similar symbol of academic achievement, so the term was used for the badge.
Comment: In the UK, where we do not have the concept of "graduating" at the high school level (only at University), the mortarboard is much more strongly associated with schoolteachers than students. Although teachers have not worn them in my time (55 years), they still do so in the pages of comics like "The Beano" (http://www.beano.com/characters/bash-street-kids). So to me, "mortarboard" means "teacher", not "excellent student"
Comment: @Colin, a mortarboard means a *graduating* student, not an *excellent* one. (If statistics are to be believed, most graduates these days are not, in fact, excellent students.) But the image is still academics, which is what the badge name is trying to convey. I think.
Comment: @CesarGon: I don't know how this is any more or less insensitive than _most_ metaphors. I'm hard-pressed to come up with any metaphor that translates well across all cultures.
Comment: @Ben Hocking: You don't need to be explicitly culturally-senstive; you just need to be culturally-neutral, and "mortarboard" is not. Some examples: we devour a book of raw facts, try to digest them, stew over them, let them simmer, regurgitate them in discussions, cook up explanations, hoping they do not seem half-baked. We establish a foundation for our theories, support them with strong arguments, buttressing them with facts, hoping they will stand.
Comment: Oh, so it's a type of graduation.  Thanks!
Comment: @Martha, or a _graduated_ student, which is why professors _also_ often wear mortarboards to graduating ceremonies (at least when they sit up on stage). Not that this changes anything, though. (A _graduating_ student wears her tassel on the right, and a _graduated_ student wears her tassel on the left.)
Comment: Excellent example of a metaphor that is totally insensitive to cultural diversity.
Comment: @Ben Hocking: http://www.amazon.com/Metaphors-We-Live-George-Lakoff/dp/0226468011
Comment: @CesarGon: It sounds interesting, but can you give me an example of a metaphor that is culturally sensitive in a way that this mortarboard metaphor is not? I'm not disbelieving that you can think of one, but I can't think of one, at least not right now.
Comment: @CesarGon - I find all your cooking metaphors deeply offensive to raw food vegans
Comment: @Martin Beckett: Well, yeah, and I find the fact that you tell me this on a digital medium deeply offensive to luddites and the anti-technology movement. Let's keep it sane, please.
Answer: One of these:

The shape comes from the board used to hold mortar in bricklaying or pastering

It's used as a hat at university graduation to remind you how much more you would have made if you had a trade.
Comment: lol. I taste a hint of sour grapes here...
Comment: @T.E.D ironically plastering is the one skill I haven't picked up in a career as an experimental physicist. Plumbing, shop class, glass blowing, scaffolding, concrete mixing etc all part of big science!


Absolute vs relative URLs

Question: I would like to know the differences between these two types of URLs: relative URLs (for pictures, CSS files, JavaScript files, etc.) and absolute URLs.
In addition, which one is better to use?
Comment: https://www.seoclarity.net/resources/knowledgebase/difference-relative-absolute-url-15325/
Answer: Should I use absolute or relative URLs?
If by absolute URLs you mean URLs including scheme (e.g. HTTP / HTTPS) and the hostname (e.g. yourdomain.example) don't ever do that (for local resources) because it will be terrible to maintain and debug.
Let's say you have used absolute URL everywhere in your code like . Now what will happen when you are going to:

switch to another scheme (e.g. HTTP -> HTTPS)
switch domain names (test.yourdomain.example -> yourdomain.example)

In the first example what will happen is that you will get warnings about unsafe content being requested on the page. Because all your URLs are hard coded to use http(://yourdomain.example/images/example.png). And when running your pages over HTTPS the browser expects all resources to be loaded over HTTPS to prevent leaking of information.
In the second example, when putting your site live from the test environment, it would mean all resources are still pointing to your test domain instead of your live domain.
So to answer your question about whether to use absolute or relative URLs: always use relative URLs (for local resources).
What are the differences between the different URLs?
First lets have a look at the different types of URLs that we can use:

http://yourdomain.example/images/example.png
//yourdomain.example/images/example.png
/images/example.png
images/example.png

What resources do these URLs try to access on the server?
In the examples below I assume the website is running from the following location on the server /var/www/mywebsite.
http://yourdomain.example/images/example.png
The above (absolute) URL tries to access the resource /var/www/website/images/example.png. This type of URL is something you would always want to avoid for requesting resources from your own website for reason outlined above. However it does have its place. For example if you have a website http://yourdomain.example and you want to request a resource from an external domain over HTTPS you should use this. E.g., https://externalsite.example/path/to/image.png.
//yourdomain.example/images/example.png
This URL is relative based on the current scheme used and should almost always be used when including external resources (images, JavaScript files, etc.).
This type of URL uses the current scheme of the page it is on. This means that you are on the page http://yourdomain.example and on that page is an image tag , the URL of the image would resolve in http://yourdomain.example/images/example.png.
When you would have been on the page https://yourdomain.example and on that page is an image tag  the URL of the image would resolve in https://yourdomain.example/images/example.png.
This prevents loading resources over HTTPS when it is not needed and automatically makes sure the resource is requested over HTTPS when it is needed.
The above URL resolves in the same manner on the server side as the previous URL:

The above (absolute) URL tries to access the resource /var/www/website/images/example.png.

/images/example.png
For local resources this is the preferred way of referencing them. This is a relative URL based on the document root (/var/www/mywebsite) of your website. This means when you have  it will always resolve to /var/www/mywebsite/images/example.png.
If at some point you decide to switch domain it will still work because it is relative.
images/example.png
This is also a relative URL although a bit different than the previous one. This URL is relative to the current path. What this means is that it will resolve to different paths depending on where you are in the site.
For example, when you are on the page http://yourdomain.example and you use  it would resolve on the server to /var/www/mywebsite/images/example.png as expected, however when your are on the page http://yourdomain.example/some/path and you use the exact same image tag it suddenly will resolve to /var/www/mywebsite/some/path/images/example.png.
When should I use what?
When requesting external resources, you most likely want to use an URL relative to the scheme (unless you want to force a different scheme) and when dealing with local resources you want to use relative URLs based on the document root.
An example document:
<!DOCTYPE html>

        <title>Example</title>
        <link href='//fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700' rel='stylesheet' type='text/css'>
        <link href="/style/style.css" rel="stylesheet" type="text/css" media="screen"></style>

Some (kind of) duplicates

Safe way to write URLs that transfer across environments
what is the correct way to link image in website?
Comment: This answer assumes that absolute URLs aren't being generated dynamically which solves each issue mentioned.
Comment: An example of including Google Jquery as protocolless:
Comment: Does using absolute URLs load the page faster, than compared to using relative URLs? (Any time spent on resolving the relative path?)
Comment: Any difference possible would be so little it is not something you should worry about if it is measurable at all.
Comment: J.Money is correct. Modern web frameworks have the notion of "reverse routing" to allow you to create URLS from one of your pages to another one of your pages (it has to be to another page in your same website). These allow you to give a name to a URL and then use this name instead of the URL. That way, if you ever want to change the URL, you can change the URL in one place, since everywhere else you only ever refer to that URL by its name.
Comment: You say "when you want to request a resource from an external domain over http you should use \[http:// style\]", then in the next paragraph you say protocol-relative links should "almost always be used when including external resources". Both paragraphs use images as examples. What's the difference?
Comment: what about `../path/to/image.png`?  Is this root-relative?
Comment: Yes that is relative to the current path @ReeceDodds. Say you are on `https://foobar.com/my/awesome/subdir` that URI points to `https://foobar.com/my/awesome/path//to/image.png`. It goes one level up from `/my/awesome/subdir` (`..`) and into `/path/to/image.png`.
Comment: Great answer, thanks a lot! For the sake of clarity, shouldn't you replace `//yourdomain.com/images/example.png` by `//externaldomain.com/images/example.png` ?
Comment: one thing that I have only just realized is that a relative url is not the same the same as a relative path on a filesystem, i.e url starting with single slash is considered relative but not affected by current path, so i considered this absolute, thanks for the clarification
Comment: nice answer! Curious if the same rules would also apply to the "action" attribute of html form? I did make some experiments and it looks like so, but couldn't find any source doc that specify this behavior. Can anyone confirm?
Comment: When you said "however when your are on the page `http://yourdomain.example/some/path` and you use the exact same image tag it suddenly will resolve to `/var/www/mywebsite/some/path/images/example.png`" you actually mean that it will resolve to `/var/www/mywebsite/some/images/example.png`, without `/path` section, right?
Answer: In general, it is considered best-practice to use relative URLs, so that your website will not be bound to the base URL of where it is currently deployed. For example, it will be able to work on localhost, as well as on your public domain, without modifications.
Comment: For maintenance purposes it can be easier to use [root-relative](http://www.motive.co.nz/glossary/linking.php?ref#root) URLs, without the domain name. i.e. On StackOverflow use the root-relative URL '/questions/2005079/absolute-vs-relative-urls' to link to this question. The '/' on the front makes the URL root-relative. This approach pays off when you go to move your files around or change the directory structure of your project.
Comment: @Baumr But can you do that? I'm definitely a fan/proponent of using that method, but get into a bigger framework and large refactorings are a notoriously daunting/terrifying task. While you thought you may have switched them all, even in a smart IDE, often times they can be missed if they're coded into strings or dynamically created. The worst part of that is that usually those missed references aren't caught until after your solution goes back into production... :(
Comment: +1 I agree. There might be (a few) times when absolute urls are better, for instance when using a CDN, or if you need to change the content website. Searching for a domain name is a lot easier than searching for relative urls IMHO.
Comment: I had the case that I used absolute URL's started with `/` so moving to another server should be possible, but then I deployed my app in `www.mydomain.com/apps/` and now i can't find any resources ofc. Thats why I agree that relative URL's are safer - still they can messup when you reuse serverside templates in different routes, but there you can easily use header-redirects to send the user to the correct path before rendering.
Comment: Can a URL even be relative? Isn't the presence of the protocol what makes a URI and URL?
Comment: an old but revelating answer on the terminology: https://stackoverflow.com/a/904066/501765 (_relative path, absolute path, relative URL, absolute URL_)
Comment: The localhost argument is a good one, but when moving a site from one domain to another, a simple 'find & replace' action in TextMate, Coda or your favorite editor will solve it
Comment: This is the absolute best answer to the question, relative to the other answers :)

Furthermore I would point out that a number of SEO experts warn that absolute URLs are somehow better and that digital marketing executives should argue with developers and ask them to switch all URLs from relative to absolute. This one factor convinces me that relative URLs are in fact the way to go.
Comment: can you provide any sources?  I've only read ever that absolute url's are a better idea.  Also, you need to have some kind of system to make absolute urls anyways if you have an RSS feed.
Comment: I know this answer is relatively old, but it still actual. If you can, please tell your opinion about this article, as it's opposite to you answer: http://yoast.com/relative-urls-issues/
Comment: @Baumr 'find & replace' is no solution at all if your product is a deployed website which is shipped to customers
Comment: To use absolute links may try `<a href="<?php echo $_SERVER['REQUEST_SCHEME'];?>://rest-of-url"`
Comment: I'm really struggling to do it on both it will be able to work on localhost, as well as on your public domain, without modifications. I'm able to get it to my website domain and local computer but not Github can anyone help me please?
Answer: See Example URIs (Wikipedia).
foo://username:email@example.com:8042/over/there/index.dtb;type=animal?name=ferret#nose
\ /   \________________/\_________/ \__/            \___/ \_/ \_________/ \_________/ \__/
 |           |               |       |                |    |       |           |       |
 |       userinfo         hostname  port              |    |       parameter query  fragment
 |    \_______________________________/ \_____________|____|____________/
scheme                |                               | |  |
 |                authority                           |path|
 |                                                    |    |
 |            path                       interpretable as filename
 |   ___________|____________                              |
/ \ /                        \                             |
urn:example:animal:ferret:nose               interpretable as extension

An absolute URL includes the parts before the "path" part - in other words, it includes the scheme (the http in http://foo/bar/baz) and the hostname (the foo in http://foo/bar/baz) (and optionally port, userinfo and port).
Relative URLs start with a path.
Absolute URLs are, well, absolute: the location of the resource can be resolved looking only at the URL itself. A relative URL is in a sense incomplete: to resolve it, you need the scheme and hostname, and these are typically taken from the current context. For example, in a web page at
http://myhost/mypath/myresource1.html

you could put a link like so
click me

In the href attribute of the link, a relative URLs used, and if it is clicked, it has to be resolved in order to follow it. In this case, the current context is
http://myhost/mypath/myresource1.html

so the schema, hostname, and leading path of these are taken and prepended to pages/page1, yielding
http://myhost/mypath/pages/page1

If the link would have been:
click me

(note the / appearing at the start of the URL) then it would have been resolved as
http://myhost/pages/page1

because the leading / indicates the root of the host.
In a web application, I would advise to use relative URLs for all resources that belong to your app. That way, if you change the location of the pages, everything will continue to work. Any external resources (could be pages completely outside your application, but also static content that you deliver through a content delivery network) should always be pointed to using absolute URLs: if you don't there simply is no way to locate them, because they reside on a different server.
Comment: Relative URLs do *not* need to start with the URL path. `//example.com/…`, `?foobar` and `#foobar` are also relative URLs and do not start with the URL path (well ok, for `?foobar` you can say it does start with an *empty* path).
Comment: @törzsmókus In [terms of RFC 2396](http://tools.ietf.org/html/rfc2396#section-3.1): "Relative URI references are distinguished from absolute URI in that they do not begin with a scheme name."
Comment: @Gumbo, are `//example.com/…`-type URLs called relative? that's new to me.
Answer: Assume we are creating a subsite whose files are in the folder http://site.ru/shop.
1. Absolute URL
Link to home page
href="http://sites.ru/shop/"

Link to the product page
href="http://sites.ru/shop/t-shirts/t-shirt-life-is-good/"

2. Relative URL
Link from home page to product page
href="t-shirts/t-shirt-life-is-good/"

Link from product page to home page
href="../../"

Although relative URL look shorter than absolute one, but the absolute URLs are more preferable, since a link can be used unchanged on any page of site.
Intermediate cases
We have considered two extreme cases: "absolutely" absolute and "absolutely" relative URLs. But everything is relative in this world. This also applies to URLs. Every time you say about absolute URL, you should always specify relative to what.
3. Protocol-relative URL
Link to home page
href="//sites.ru/shop/"

Link to product page
href="//sites.ru/shop/t-shirts/t-shirt-life-is-good/"

Google recommends such URL. Now, however, it is generally considered that http:// and https:// are different sites.
4. Root-relative URL
I.e. relative to the root folder of the domain.
Link to home page
href="/shop/"

Link to product page
href="/shop/t-shirts/t-shirt-life-is-good/"

It is a good choice if all pages are within the same domain. When you move your site to another domain, you don't have to do a mass replacements of the domain name in the URLs.
5. Base-relative URL (home-page-relative)
The tag <base> specifies the base URL, which is automatically added to all relative links and anchors. The base tag does not affect absolute links. As a base URL we'll specify the home page: <base href="http://sites.ru/shop/">.
Link to home page
href=""

Link to product page
href="t-shirts/t-shirt-life-is-good/"

Now you can move your site not only to any domain, but in any subfolder. Just keep in mind that, although URLs look like relative, in fact they are absolute.
Especially pay attention to anchors. To navigate within the current page we have to write href="t-shirts/t-shirt-life-is-good/#comments" not href="#comments". The latter will throw on home page.
Conclusion
For internal links I use base-relative URLs (5). For external links and newsletters I use absolute URLs (1).
Comment: great answer. too bad it lingers too low on the page for people to see it. answers a lot of the comments on other answers.
Answer: There are really three types that should be discussed explicitly. In practice though URLs have been abstracted to be handled at a lower level and I would go as far as to say that developers could go through their entire lives without writing a single URL by hand.
Absolute
Absolute URLs tie your code to the protocol and domain. This can be overcome with dynamic URLs.
https://dev.example.com/a.html?q=

Absolute Pros:

Control - The subdomain and protocol can be controlled. People that enter through an obscure subdomain will be funneled into the proper subdomain. You can hop back and forth between secure and non-secure as appropriate.
Configurable - Developers love things to be absolute. You can design neat algorithms when using absolute URLs. URLs can be made configurable so that a URL can be updated site-wide with a single change in a single configuration file.
Clairvoyance - You can search for the people scraping your site or maybe pick up some extra external links.

Root Relative
Root Relative URLs tie your code to the base url. This can be overcome with dynamic URLs and/or base tags.
.example.com/index.php?q=

Root Relative Pros:

Configurable - The base tag makes them relative to any root you choose making switching domains and implementing templates easy.

Relative
Relative URLs tie your code to the directory structure. There is no way to overcome this. Relative URLs are only useful in file systems for traversing directories or as a shortcut for a menial task.
index.php?q=
<link src="../.././../css/default.css" />

Relative Cons:

CONFUSING - How many dots is that? how many folders is that? Where is the file? Why isn't it working?
MAINTENANCE - If a file is accidentally moved resources quit loading, links send the user to the wrong pages, form data might be sent to the incorrect page. If a file NEEDS to be moved all the resources that are going to quit loading and all the links that are going to be incorrect need to be updated.
DOES NOT SCALE - When webpages become more complex and views start getting reused across multiple pages the relative links will be relative to the file that they were included into. If you have a navigation snippet of HTML that is going to be on every page then relative will be relative to a lot of different places. The first thing people realize when they start creating a template is that they need a way to manage the URLs.
COMPUTED - They are implemented by your browser (hopefully according to RFC). See chapter 5 in RFC3986.
OOPS! - Errors or typos can result in spider traps.

The Evolution of Routes
Developers have stopped writing URLs in the sense being discussed here. All requests are for a website's index file and contain a query string, aka a route. The route can be thought of as a mini URL that tells your application the content to be generated.
<a href="<?=Route::url('named_url', array('first' => 'my', 'last' => 'whacky'))?>">
    http://dev.example.com/index.php/my:whacky:url

Routes Pros:

All the advantages of absolute urls.
Use of any character in URL.
More control (Good for SEO).
Ability to algorithmically generate URLs. This allows the URLs to be configurable. Altering the URL is a single change in a single file.
No need for 404 not founds. Fallback routes can display a site map or error page.
Convenient security of indirect access to application files. Guard statements can make sure that everybody is arriving through the proper channels.
Practicality in MVC approach.

My Take
Most people will make use of all three forms in their projects in some way or another. The key is to understand them and to choose the one best suited for the task.
Comment: @Lovethenakedgun If people copy code or even point their domain at your server's IP, relative URLs will keep users on the fake site while absolute URLs will lead users back to the real site. Absolute URLs are an attribution to the source. Search engines can be used to find careless scrapers or fraudsters that are stealing content or duplicating entire sites, such as for phishing.
Comment: You're missing protocol-relative URLs, which are strictly better than completely absolute URLs. Absolute URLs are troublesome when upgrading the scheme (to HTTPS, mostly), relative URLs fix this.
Comment: @Tobu Just serve everything over HTTPS.
Comment: Side note: it looks like you used typographical quotes in most of your codes examples above. You might want to fix that.
Comment: And what type of url is the one with the dot first? E.g. "./index.html"
Comment: Could you elaborate a bit on *Clairvoyance*? If you were using "Root Relative" URLs, why wouldn't you be able to see people scraping your site?
Answer: I'm going to have to disagree with the majority here.
I think the relative URL scheme is "fine" when you want to quickly get something up and running and not think outside the box, particularly if your project is small with few developers (or just yourself).
However, once you start working on big, fatty systems where you switch domains and protocols all the time, I believe that a more elegant approach is in order.
When you compare absolute and relative URLs in essence, absolute wins. Why? Because it won't ever break. Ever. An absolute URL is exactly what it says it is. The catch is when you have to maintain your absolute URLs.
The weak approach to absolute URL linking is actually hard coding the entire URL. It is not a great idea and is probably the culprit of why people see them as dangerous, evil, and annoying to maintain. A better approach is to write yourself an easy-to-use URL generator. These are easy to write, and can be incredibly powerful—automatically detecting your protocol, easy-to-configuration (literally set the URL once for the whole application), etc., and it injects your domain all by itself. The nice thing about that: You go on coding using relative URLs, and at run time the application inserts your URLs as full absolutes on the fly. Awesome.
Seeing as how practically all modern sites use some sort of dynamic back-end, it's in the best interest of said site to do it that way. Absolute URLs do more than just make you certain of where they point to—they also can improve SEO performance.
I might add that the argument that absolute URLs is somehow going to change the load time of the page is a myth. If your domain weighs more than a few bytes and you're on a dialup modem in the 1980s, sure. But that's just not the case anymore. https://stackoverflow.com/ is 25 bytes, whereas the "topbar-sprite.png" file that they use for the nav area of the site weighs in at more than 9 KB. That means that the additional URL data is 0.2% of the loaded data in comparison to the sprite file, and that file is not even considered a big performance hit.
That big, unoptimized, full-page background image is much more likely to slow your load times.
An interesting post about why relative URLs shouldn't be used is here:
Why relative URLs should be forbidden for web developers
An issue that can arise with relatives, for instance, is that sometimes server mappings (mind you on big, messed up projects) don't line up with file names and the developer may make an assumption about a relative URL that just isn't true. I just saw that today on a project that I'm on and it brought an entire page down.
Or perhaps a developer forgot to switch a pointer and all of a sudden google indexed your entire test environment. Whoops- duplicate content (bad for SEO!).
Absolutes can be dangerous, but when used properly and in a way that can't break your build they are proven to be more reliable. Look at the article above which gives a bunch of reasons why the WordPress URL generator is super awesome.
:)
Comment: When you say absolute URL do you mean the full url or using `/` to link to the base path? ie `/products/wallets/thing.html` as opposed to `thing.html` as opposed to `http://www.myshop.com/products/wallets/thing.html`
Comment: Prepending with a "/" will always be relative to the domain root, I believe. So if your domain is "www.example.com", any references coded as "/image1.jpg" would be interpreted as "www.example.com/image1.jpg". Items without the leading slash are interpreted as relative to the request root. When I say "absolute URL" I mean the fully qualified url. I cringe to send MSDN links through the internet but this is actually a pretty good breakdown:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms676525(v=vs.85).aspx
Comment: This is the current best practice although many people haven't realized it yet. I love Routes, such as in Kohana where you can use `echo Route::url('route_name')` to build an absolute URL using the site URL and route information with the option to make it over HTTPS.
Comment: I feel the need to point out that dialup modems weren't left back in the 80's.  There are plenty of people now who have no choices other than dialup or super overpriced very limited satellite internet... and if you're poor, what could be better than free dialup?  It really bothers me to see developers that believe that dialup doesn't exist anymore.  It can take 5-10 minutes(!!!) to login to my bank's website on dialup... Paypal, Amazon and Ebay aren't much better. Egg Cave (a virtual pet site) and Facebook just plain don't work on dialup. That affects a lot of people who live in rural areas.
Comment: Okay, yes, while there are some people on dialup, the vast (vast) majority of users are *not* on dialup. It also has a lot to do with demographic. If you're shooting for mega-huge ultra-performant results, then start clipping your domain off your URL. But the main point of that comment was to underscore that performance is usually found in other areas - you could gain *all* of the transfer time that you lost in url bytes by optimizing a single image.
but, if 20% or more of your users are on dialup, I guess thats important. In 2015, and for all practical purposes, that's just not the case.
Comment: I might add, that ebay and most bank websites are not very well optimized. In fact, they suck entirely. But, they are also coming out of enormous frameworks run by hundreds or thousands of people, the management of which would be impossible without a considerable level of complexity.
Not to justify the fact that the current version of the Microsoft.com homepage, which has merely a few blades on it, has 384kb of source code to it (that's just ridiculous), but it's not always quite so black-and-white, either.
So yes, you're right, strive for performance, but keep best practices in mind, too.
Comment: Generated or not is orthogonal to the type of URL. You're arguing for generated, but user agents don't care whether the generated urls are absolute.
Comment: I'm not arguing for generated for any reason other than the fact that automation makes life easier. I'm certainly not saying that a UA would ever know the difference.
Comment: It seems to me that the linked article and most part of your answer say "relative URLs are bad because of **SEO**". To me, from a technical point of view, I don't see anything wrong with them, however. More than that, I don't see a merit in having to rely on a tool or CMS mechanism in order to be able to maintain my URLs -- especially not if mainly for the sake of SEO. Simplicity always wins for me, and that means relative URLs win over absolute URLs any day.
Answer: If it is for use within your website, it's better practice to use relative URLs like this. If you need to move the website to another domain name or just debug locally, you can.
Take a look at what's Stack Overflow is doing (Ctrl + U in Firefox):
 // Link to an internal element

In some cases they use absolute URLs:
<link rel="stylesheet" href="http://sstatic.net/so/all.css?v=5934">

... but this is only it's a best practice to improve speed. In your case, it doesn't look like you're doing anything like that so I wouldn't worry about it.
Answer: In most instances relative URLs are the way to go, they are portable by nature, which means if you wanted to lift your site and put it someone where else it would work instantly, reducing possibly hours of debugging.
There is a pretty decent article on absolute vs relative URLs, check it out.
Answer: A URL that starts with the URL scheme and scheme specific part (http://, https://, ftp://, etc.) is an absolute URL.
Any other URL is a relative URL and needs a base URL the relative URL is resolved from (and thus depend on) that is the URL of the resource the reference is used in if not declared otherwise.
Take a look at RFC 2396 – Appendix C for examples of resolving relative URLs.
Answer: Let's say you have a site www.yourserver.example. In the root directory for web documents you have an images sub-directoy and in that you have myimage.jpg.
An absolute URL defines the exact location of the document, for example:
http://www.yourserver.example/images/myimage.jpg

A relative URL defines the location relative to the current directory, for example, given you are in the root web directory your image is in:
images/myimage.jpg

(relative to that root directory)
You should always use relative URLs where possible. If you move the site to www.anotherserver.com you would have to update all the absolute URLs that were pointing at www.yourserver.example, relative ones will just keep working as is.
Answer: For every system that support relative URI resolution, both relative and absolute URIs do serve the same goal: referencing. And they can be used interchangeably. So you could decide in each case differently. Technically, they provide the same referencing.
To be precise, with each relative URI there already is an absolute URI. And that's the base-URI that relative URI is resolved against. So a relative URI is actually a feature on top of absolute URIs.
And that's also why with relative URIs you can do more as with an absolute URI alone - this is especially important for static websites which otherwise couldn't be as flexible to maintain as compared to absolute URIs.
These positive effects of relative URI resolution can be exploited for dynamic web-application development as well. The inflexibility absolute URIs do introduce are also easier to cope up with, in a dynamic environment, so for some developers that are unsure about URI resolution and how to properly implement and manage it (not that it's always easy) do often opt into using absolute URIs in a dynamic part of a website as they can introduce other dynamic features (e.g. configuration variable containing the URI prefix) so to work around the inflexibility.
So what is the benefit then in using absolute URIs? Technically there ain't, but one I'd say: Relative URIs are more complex because they need to be resolved against the so called absolute base-URI. Even the resolution is strictly define since years, you might run over a client that has a mistake in URI resolution. As absolute URIs do not need any resolution, using absolute URIs have no risk to run into faulty client behaviour with relative URI resolution. So how high is that risk actually? Well, it's very rare. I only know about one Internet browser that had an issue with relative URI resolution. And that was not generally but only in a very (obscure) case.
Next to the HTTP client (browser) it's perhaps more complex for an author of hypertext documents or code as well. Here the absolute URI has the benefit that it is easier to test, as you can just enter it as-is into your browsers address bar. However, if it's not just your one-hour job, it's most often of more benefit to you to actually understand absolute and relative URI handling so that you can actually exploit the benefits of relative linking.
Answer: I would heartily recommend relative URLs for pointing bits of the same site to other bits of the same site.
Don't forget that a change to HTTPS - even if in the same site - is going to need an absolute URL.

Absolute vs relative URLs


Why doesn't source affect sound's speed in doppler's effect?

Question: In the derivation of the doppler's effect formula
$$f_{app} = f\frac{v ± v_{observer}}{v ± v_{source}}$$
It is assumed that the speed of sound is unaffected by its source's speed (i.e it's the same relative to the ground whether the source's speed is 0, 5m/s, ...) (the source only affects its 'release point'.)
How is this true? isn't this similar to elementary relative motion questions like a bullet being shot from a moving police car at a thief (The speed at which the thief gets shot is the muzzle speed + car speed). Isn't the bullet in this example analogous to the sound produced by the source in doppler's effect?
Also, consider 2 people sitting a meter apart in a plane that is going at the speed of sound and one person decides to play a song from his phone, with this logic wouldn't the other person not hear the sound as it will have the same velocity and therefore 0 relative velocity with respect to the other person?
My hypothesis is that when we say 'speed of sound' in a medium, we mean its speed relative to the medium(In this case air) that is carrying the sound. In the airplane example, the air inside the plane is 'moving with' everything else in the plane so sound will go at its normal speed relative to THAT air(since that's the air that's carrying it) and therefore it will reach the other person, but in the doppler's effect, the sound is travelling through the 'surrounding/open' air which is at rest with respect to the ground and travels with respect to THAT air and therefore has the same speed regardless of the source's speed. Is this right?
Comment: This seams reasonable to me (though it is just a guess). Maybe someone else can answer in more detail.
Comment: Yep, and that's why there's a shock wave when the aircraft goes supersonic.
Answer: Yes your hypothesis is correct that the speed of sound is with respect to the medium it's transversing, in this case the air. You correctly identified that this is the reason why it's independent of source speed and it would behave in a plane like you say as well.  This is part of newtonian relativity in that there are no privileged inertial frames. I.e. in a plane cockpit going the speed of sound is the same as two people standing in the ground assuming no part is accelerating.


xcode 6 object library is empty (no matches)

Question: I am trying to follow instruction to create "Hello World" but I don't seem to have anything in my object library?  It just says "No Matches" in the dialog.  what am i missing here?
Thank you.
Comment: How does your problem occur? What do you want to do? We can't do anything with that description...
Comment: I have new installation of Xcode 6.  1. create New Project iOS->Single View Application     when I click on object library (circle with square inside), it just says "No Matches"  and nothing is shown.     I am trying to follow instruction for "Hello World" tutorial and it says to go to object library to create edit box.   Surely I am missing something.
Comment: what object library!?
Comment: I've been seeing this today as well. The Object Library in Interface Builder of Xcode 6.1. That is normally where you find UIButton, UILabel, etc. The area is void of objects and instead says "No Matches". Nothing is in the search field, so it shouldn't be filtering the list. I've restarted Xcode and even restarted my computer. :-/
Answer: I discovered a solution. It was happening when I was editing a Storyboard in an Assistant Editor. I closed the Assistant Editor and opened the Storyboard in the main editor and my Object Library began working again. I would guess this is a bug in Xcode.
Comment: anyone seeing this please raise a bug with Apple ;-)
Answer: I have got the same problem today, started a new project, opened main.storyboard, object library was saying "No Matches".
solution: right click on main.storyboard file, select "open as", choose "interface builder-storyboard" and now the objects library should be filled.
Comment: this above solution worked for me on Xcode 8.1 version
Answer: I also had same problem, I tried opening another file and switching back to storyboard again started showing everything normal.
Answer: My object library tab was totally empty, not even the filter field existed. My solution was the following: at the right upper corner, I found a symbol circle with square inside. Clicked there and the options appear, among them "Label" which was what I was looking for.


Get gateway address of non default interface

Question: I have three interfaces connected to my machine. How can I get the gateway IP of one non default interface? I'm using Debian 9
Answer: "Gateways" are part of the routing. (Actually, the routing algorithm just wants to know where to send a particular packet (next hop), it doesn't care if the next hop is something you'd call a "gateway", or just a normal host).
So use ip route to see your routing table. If you don't know the address ranges, use ip addr to see them. All routes that have next hops in the address range of some interface will be "gateway" candidates.
You can also use ip route get 126.96.36.199 to see to which next hop a packet with this final destination will be sent. This might be more convenient.
Edit
Just in case, a short reminder of what happens behind the scenes:
When a host connects to a LAN segment, and can send out a DHCP broadcast to acquire an IP address. ("Hello, I'm new here, what IP address should I use?"). The DHCP server in the LAN segment (e.g. your home router) then answers "Welcome, use this IP address, and by the way, if you want to reach the internet from this segment, please use this gateway address as next hop."
The typical reaction to this gateway address announcement is that the host sets the default route to this address.
If you are connected to three LAN segments, each with their own DHCP server, and each with a connection to the internet via a gatway (which shouldn't happen in a professionally designed network), then the host will receive three DHCP answers with different gateways, will set the default route each time, and the last wins. Note that there is no "default interface".
So if your situation is not that you are part of a corporate network with different next hops in each segment on each interface, but you are accidentally connected to three standard home networks, where no one has bothered to set up the right infrastructure for such a case, and you want to know the announced gateway in the DHCP answers, you can (1) look in the logs for DHCP answers, (2) disconnect all three interfaces, re-connect each in turn, get a new DHCP answer and write down the default route, (3) use a tool to debug DHCP requests, so you can send out an additional one.
Note that this information will be of no use to you: You can only use one default route, and you can't use different gateways into the internet to somehow get faster speeds etc.


how to use functionality from existing aspx page in usercontrol?

Question: I am trying to use existing functionality which is embedded in a asp.net aspx page. So I have controls on this page and code behind for it. What is the best way to reuse this functionality in a new ascx control? Or do I just have to copy everyting into the control?
Answer: Can you not just take the controls you want to use from the aspx page and turn those into a control? Then you can use that control wherever you like.
Answer: To access the page parent just written this.Page in your control. But for access to these methods, you must apply an interface to the aspx page.


Do we know who is the source of the cure applied to the Fool in Fool's Quest?

Question: So Ash/Spark gives the Fool dragon's blood which Chade got. Do we know which dragon in the Rain Wild Chronicles it was? I'm not sure if it was Relpda (if I remember correctly, whichever one that made the secretary an elderling), or one of the more stunted dragons that died early in the journey. Can't recall if there was a yellow dragon which I believe was the color of some of the elderling features the Fool gained.
Comment: It is never mentioned (so far) and I'm 99% sure we will never find out...
Answer: As @yasskier mentioned in the comment, it is not obvious from any book.
In my opinion it is more likely to come from Icefyre/Tintaglia resulting from the attack on them by humans in City of Dragons, or from time Icefyre was iced in the Outislands. There is no mention of any other interactions of humans with dragons and the detailed story of the Rainwilders with the dragons the only dragon blood stolen is accounted for.
But again, this is just a guess.


Copy Album Art from One Song to Rest of Album

Question: I'm uploading music and Google auto-detects some of the artwork, but not all of it. Is there a way to copy the detected artwork to all of the songs in the album?
Answer: Easy!
1. Select album with missing or incorrect cover art
2. Goto iTunes or other music app that contains that album with your desired cover, select or right click edit, select cover and drag to your desktop (or copy and paste on desktop)
3. Go back to google album with missing cover, right click and select edit, in the edit screen select the up arrow in the cover section and select the cover you placed on desktop, then save edit screen and voila: the cover is where it belongs, hurray!
4. This way associates all tracks with the same cover, easy!
Cheers


Mac CRM software with iCloud Contacts integration

Question: I'm looking for basic customer relationship management (CRM) software that syncs with iCloud Contacts. I'm not looking for software that imports contacts into its own proprietary database. I'm seeking software that, like BusyContacts and Contacts.app, works with iCloud Contacts. It reads and writes to the .vcf or Vcard files themselves, so its changes are viewable in contact management software.
Comment: The more I use BusyContacts, the happier I am with it. All it lacks is a sales pipeline, and I've submitted that as a feature request.
Answer: I don't know much about the software, but it seems like Contacts Journal may do what you're looking for, with two caveats:

new contacts entered in Contacts.app are not automatically imported into Contacts Journal, but it will automatically prompt you to do so, and thereafter keep the contacts sync'd
contacts added directly in Contacts Journal will not automatically appear in Contacts.app, and I don't see an indication of how to accomplish this.

There is a lite version that you can try for free, and also a FAQ.
I have no affiliation with the product.
Comment: Thanks, Joe, but the inability to sync automatically is a dealbreaker.


How can I include a setting that has a variable number of values in a settings page using register_setting?

Question: I have one option on a settings page that can have between 1 and 5 values. I have a basic understanding on how to set up single value settings using the Settings API, but how do I go about generating the markup etc. for the setting with a variable number of values?
Comment: Please could the person who voted this question down try and be constructive by leaving a comment saying why. I see nothing wrong with it myself, but would appreciate any input on how to improve it.
Answer: If you are using the Settings API correctly, you should be using the add_settings_field function. The 3rd argument in this function is for the callback function that will generate the HTML for the form field for the individual setting. The Codex states:

Function that fills the field with the desired inputs as part of the
  larger form. Name and id of the input should match the $id given to
  this function. The function should echo its output.

In this callback function, you just write your HTML, just like you would if WordPress was not involved. As such, you can setup radiobuttons, a select field, multi-select, etc.
As an example, let's say that you use add_settings_field as such:
add_settings_field(
    'my_setting_name',
    'My Setting Name',
    'my_setting_callback_function',
    'general',
    'my_settings_section_name'
);

In this snippet, the callback function named "my_setting_callback_function" will generate the HTML for the setting. You can then do something like:
function my_setting_callback_function() {
?>
    <select name="my_setting_name" id="my_setting_name">
        <option value="1">Enabled</option>
        <option value="0">Disabled</option>
    </select>
<?php
}

As you can see, this function generates the different possible values for this setting.
I highly encourage reading this part of the Codex: http://codex.wordpress.org/Settings_API. It does a nice job explaining the Settings API and the example does a good job illustrating how to use it. I find that the API is a bit convoluted; however, it does what it says it should do, so with a little discipline and careful checking, it should work quite well for you.
Good luck!


Phrase Question "Be preoccupied with"

Question: One question on meaning of the phrase "be preoccupied with", I am not a native speaker and tried to find out the accurate meaning and nuance on the web search, but could not.
I have seen that a native speaker use this phrase when he excused for a delayed response to a client as in "Sorry for my late feedback, we are preoccupied with many things in the past few weeks". I understand that this means "I have been busy for many things to do". But there is no any results relating to what I expected. Would my understanding on the meaning be correct?
Answer: Yes, you are correct. "to be preoccupied with something" means "to be busy with something" or "to be completely focussed on something".
The original sentence can be rephrased as:
"Sorry for my late feedback, we have been busy with many things in the past few weeks"

Phrase Question "Be preoccupied with"


Mathematical models for money lending and antidiscrimination laws in the US

Question: Are there any federal or state laws in the US regulating which models can banks and money lenders use to decide for/against lending money to an individual? I am interested on this topic in the context of mechanisms to avoid discrimination (for example, how do you ensure that your AI model doesn't have a variable that indirectly or directly takes into account ethnicity when making a decision).
Comment: The classic method of demonstrating discrimination is not by examining the formula, but by presentating sets of matched applicants who differ in ethnicity but are very comparable in wealth and other relevant indicators. If the model reliably favors the same ethnicity from such matched pairs, it is discriminatory.
Comment: When it is natural to base money lending decisions on wealth and income factors and these factors happen to be highly correlated, the same AI that can make good predictions about money lending can certainly also make better-than-average predictions of the applicant's ethnicity. How would you decide if *implicit* criteria (perhaps automatically learned from "experience") such as "add 10 points if applicant practices as a dentist" or "deduct 10 points if given name begins with 'Yam'" are deeply hidden in a neural netwrok?
Comment: @HagenvonEitzen I concur this is an interesting, and that is precisely what I am trying to understand further by going to the exact laws regulating it. How are implicit criteria defined? Or is it up to a judge to determine what is or what is not from intuition
Comment: Thanks @DavidSiegel. Do you happen to have references to a trial or public case where this practice occurred?
Answer:
Are there any federal or state laws in the US regulating which models
can banks and money lenders use to decide for/against lending money to
an individual?

There aren't really safe harbors regarding what lenders can use. There are only laws that prohibit certain practices like discrimination in lending. Everything else is permitted.

ow do you ensure that your AI model doesn't have a variable that
indirectly or directly takes into account ethnicity when making a
decision).

Using a "black box" machine learning or AI model is inherently risky legally because it isn't transparent and there is no good way to demonstrate that discriminatory effects aren't due to to discriminatory factors as opposed to neutral factors.
AI models tend to pick up on impermissible factors by attaching weight to factors that aren't substantively important, but are correlated strongly with impermissible factors, for example, assigning different weights to different surnames.
On the other hand, if you can spell out the precise formula by which your model is constructed (in a closed court proceeding if necessary to preserve trade secrets) and can demonstrate that no impermissible factors are considered, directly or indirectly, then your mathematical model is very likely to be upheld as legal and permissible.
Comment: Can you give specific references to the laws prohibiting discrimination in lending and what methods does law enforcement use to ensure their compliance? @ohwilleke
Comment: The federal reserve summarizes the requirements here: https://www.federalreserve.gov/boarddocs/supmanual/cch/fair_lend_over.pdf enforcement is mostly through private civil actions and by complaints to regulatory agencies (of which there are many, divided by type of lender)


Is it possible to make any abelian group homomorphism into a linear map?

Question: Let $G$
  and $H$
  be abelian groups and let $\varphi:G\rightarrow H$
  be a group homomorphism. Can we define a nontrivial scalar multiplication on $G$
  (from some field $F$
 ) and another nontrivial scalar multiplication on $H$
  (from $F$
 ), thereby making them vector spaces, such that $\varphi$
  becomes a linear map? If the answer is yes, then would this also work if we made $G$ and $H$ into modules over some ring $R$?
Answer: Every abelian group is a $\mathbb{Z}$-module, so we can always treat $\varphi$ as a linear map of $\mathbb{Z}$-modules.
However, it is not always possible to view an abelian group as a vector space over a field. For example, the abelian group $\mathbb{Z}$ (with addition) is not a vector space over any field.
Why not? Well, suppose $\mathbb{Z}$ was (the underlying group of) a vector space over a field $k$. First, note that $k$ must have characteristic $0$ - if $k$ had characteristic $p\not=0$ then we'd have $1+1+...+1$ ($p$ times) equals $0$ in $\mathbb{Z}$.
So $k$ has characteristic $0$, which means $\mathbb{Q}$ is a subfield of $k$. (In fact, we may assume without loss of generality that $k=\mathbb{Q}$, but we don't need to.) What can ${1\over 2}\cdot 1$ be (where the ${1\over 2}$ is in $k$ and the $1$ is in $\mathbb{Z}$)? Whatever integer this is, it must satisfy ${1\over 2}\cdot 1+{1\over 2}\cdot 1=1$. But there is no integer with this property.
Answer: Notice that any commutative $G$ is a $\Bbb Z$-module in a natural way: just define $n \cdot g$ to be $g^n$. Check that the usual properties for modules are satisfied.
Now, if $\varphi$ is a group morphism, then $\varphi (g^n) = \varphi (g) ^n$, or in our $\Bbb Z$-module notation: $\varphi (n \cdot g) = n \cdot \varphi (g)$, i.e. $\varphi$ is $\Bbb Z$-linear.
On the other hand, not all groups can be given a vector space stucture. For instance, if $G$ is a finite group (write it in additive notation) and $d = |G|$, and if $K \supseteq \Bbb Q$, then $d \cdot g = 0$ for all $g \in G$. Multiplying by the scalar $\frac 1 d \in \Bbb Q$ would give $g=0$.
Comment: Your last paragraph is incomplete - all you've shown is that no finite group can be the underlying group of a vector space *over a field of characteristic $0$.* But there are fields of [nonzero characteristic](https://en.wikipedia.org/wiki/Characteristic_(algebra)#Case_of_fields)! Andreas' answer below gives the right approach to building a finite group which cannot be a vector space.
Comment: @AlexM. The "trivial multiplication" isn't a valid one - vector spaces satisfy $1_k\cdot v=v$. And my argument does *not* only apply to characteristic $\not=2$ - note that I first show the characteristic must be $0$, so $\mathbb{Z}$ cannot be the underlying group of a vector space over *any* field.
Comment: @NoahSchweber: I agree with you: my last paragraph was meant only to show that in general the problem has a negative answer. Your argument is much better, since it shows that if the characteristic of the field is $\ne 2$, the only possible multiplication by scalars is the trivial one: $q \cdot g = 0$.
Answer: To record another example, a finite vector space has order a power of a prime. So if the order of the abelian group $G$ is not a power of a prime, it cannot be turned into a vector space.
Actually, even if the abelian group $G$ is of order $p^{n}$, for some prime $p$, then if it can be turned into a vector space over a field $F$, then it will also be a vector space over the field with $p$ elements. And then  $p x = 0$ has to hold for all $x \in G$. Conversely, if this conditions holds, then even if $G$ is not finite, it can be turned into a vector space over the field with $p$ elements.

Addendum. Even if $G$ and $H$ can be turned into vector spaces, it is not always the case that $\phi$ can be made linear. In fact, if $G$ and $H$ can be made into vector spaces over a field $F$, then they can be made into vector spaces over the prime field $P$ contained in $F$, thus over the rationals if $F$ has characteristic zero, over the field with $p$ elements if $F$ has prime characteristic $p$. And any group homomorphism from $G$ to $H$ will be a $P$-linear map.
But take for instance $G = H = \mathbb{R}$. Then the only $\mathbb{R}$-linear maps from $G$ to $H$ are the multiplications by a fixed real number. Whereas there are many more group homomorphisms from $G$ to $H$, see Hamel bases. So if you make $G$ and $H$ into rational vector spaces, all group homomorphisms will be linear. If you attempt to make them into real vector space, this is not the case anymore.
Answer: Not ANY morphism pf groups allows this, however I will show a sufficient condition for this to be true.
In the following question
Prove this homomorphism gives an equivalent definition of Linear Space
we provide an equivalent definition to linear space, in terms of a homomorphism from the product group of a field, and the group of automorphisms of an abelian group. There we prove how this homomorphism provides us with a definition of scalar prodcut, and the elements of the vector space are obviously the elements of the abelian group.
Let $G$ and $H$ be turned into vector spaces by this manner, and using the same field. This means we have two homomorphisms $*_1:\mathbb K(\cdot)\rightarrow\{GfG\}$ and $*_2:\mathbb K(\cdot)\rightarrow\{HfH\}$, here we use $\{GfG\}$ to represent the group of automorphisms of $G$. We know $*_1(a)$, for any $a\in\mathbb K$, is an automorphism of $G$, and this defines our scalar product, the same is true for $*_2(a)$.
We know $\phi(u+v)=\phi u+\phi v$. Then, we can say that a functor (homomorphism) $\phi:G\rightarrow H$ is a linear map if the following condition holds:
$$\phi\circ*_1(a)=*_2(a)\circ\phi$$ for every $a$ in the field. This condition simply means $\phi(au)=a(\phi u)$, for every element in th field.
In conclusion, if $G$ and $H$ can be made into linear spaces by means of the homomorphisms $*_1:G\rightarrow\{GfG\}$ and $*_2:H\rightarrow\{HfH\}$, and if the morphism $\phi$ commutes with the morhpsims in $Im(*_1)$, $Im(*_2)$, in the sense we just made clear, then we can say $\phi$ is a linear transformation from the linear space $G$ into the linear space $H$.


Wordpress change role from administrator to author by itself (automatically)

Question: do anybody know this kind of phenomenon? I do not have any user managing plugins installed in my WP, but after some interaction e.g. editing pages or creating postings (its not matter) WP changes for my logged in user the role from Administrator to Author. It already happens few times. I do also not know where to start with the root cause analysis. I will be happy for any kind of information which helps me to go the right direction. Thanks.
Comment: Can you edit your question and add the list of the plugins you have on your website ? You should start with removing all the plugins and see what happens. (By any chance, dont you have Authorizer activated ?).
Comment: I'd stick error_log() trace into any function that sets or changes role, or just everything set or update in the WP_User class, and the add/update/delete_user_meta functions too.
Answer: sorry but do not have enough reputation on stackoverflow to add a comment under yours. So my reply then here.
I can list all my plugins but how I should reproduce it, because it happens randomly. And how should I put a error_log() in each function? I do not have the "Autorizer" so this should not be the issue.
I somewhere a general error log of WP to have a look on? I do not now where to start with the analysis. The deactive each plugin not helps, because I not know in which activity this role changing happening.
Comment: Did you write the question? You would have permission to comment if you logged in with that account.
Comment: error_log() e.g. open wp-includes/user.php, find "function update_user_meta" which is line 1196 for me, and then inside the function braces add two lines `error_log("update_user_meta user_id=$user_id meta_key=$meta_key meta_value=".print_r($meta_value,true));` and `error_log(print_r(debug_backtrace(), true));`. Then when it goes wrong look at your server error log for any update_user_meta calls that changed 'role'.
Comment: Yes i am. I was not able to reach my old account. I will test your approach and will give an update. Thanks for the hint.


When dealing with an issue of Maarit Ayin, can someone just make a sign with a piece of paper to let people know what things are?

Question: If someone is cooking or eating meat with almond milk, would a sign that says almond milk, work just as well (if not better) than actual almonds? Are there any sources that say a written sign works or doesnt work?
Answer: With regards to basar bchalav,and pareve items which look like dairy ,or items that look like meat and are pareve the concern of maryis ayin come into play.
The Badei Hashulchan 87:47 notes that leaving the container or wrapper and writing on that what it is,is sufficient . However, in his Biurim he notes that writing on a separate paper "almond milk" without using the container or wrapper is not a sufficient siman.
Text :


What if someone comes up with a proof of consistency of arithmetic under the following conditions?

Question: Suppose that one day, someone comes up with a proof of consistency of Peano arithmetic (PA) within itself. Then, does it mean that PA is actually inconsistent? Because, by the Gödel's incompleteness theorem, it is impossible to do so if PA is consistent. So, by contradiction it means that PA is inconsistent. Is my reasoning right? If not, why? If yes, in what theory/set of axioms it is inconsistent by that reasoning?
Comment: Gödel gave a precise statement in Peano arithmetic *Consis*, which has a clear intuitive meaning that Peano arithmetic is consistent, based on Gödel numbering of formulas and proofs.  If you were able to prove *Consis* in Peano arithmetic, then yes, that would establish that Peano arithmetic is inconsistent.
Comment: IMO if such a thing were to happen we would probably examine the proof and find an instance of induction wherein to declare the predicate used in that instance to be invalid.
Comment: @DanielV I understand that such a proof would be checked, but I talked about the consequences of such a proof which would be right after checking.
Answer: You are correct. Even more is true:

When we appropriately formulate the expressions "Con(PA)" and "PA proves ---" in the language of arithmetic, it is the case that PA proves "If PA proves Con(PA), then $\neg$ Con(PA)." That is, PA proves that you are correct.
In fact, the initial PA can be weakened and the later PAs can be vastly strengthened: e.g. PRA proves "If ZFC proves Con(ZFC), then $\neg$ Con(ZFC)." That is, Godel's theorem is provable from very little and applies to very much.
Moreover, this is all done constructively. Specifically - taking PA as an example - there is an explicit (if messy to write down) algorithm $\alpha$ which would convert any PA-proof of Con(PA) into (say) a PA-proof of "$0=1$," and the fact that $\alpha$ does this can be proved in a very weak system. It's this last bit that makes this statement non-vacuous, since - assuming PA is in fact consistent - there are no PA-proofs of "$0=1$" at all, and hence any $\alpha$ will do if we drop the "provable behavior" requirement.

This $\alpha$, and the proof of its correctness, are a bit messy, but if you're interested I can summarize it.
Comment: It's worth mentioning - to forestall possible future confusion - that the various "consistency proofs of PA" kicking around (e.g. [Gentzen's](https://en.wikipedia.org/wiki/Gentzen%27s_consistency_proof)) are proofs of Con(PA) in systems other than PA. They are quite interesting and surprising since the system they take place in is usually PRA (much weaker than PA) + something fairly innocuous-seeming (for Gentzen, [a weak transfinite induction principle](https://en.wikipedia.org/wiki/Epsilon_numbers_(mathematics))); in particular, the theory in which these proofs take place does not extend PA.


Who first noticed violation of aufbau principle of elements like Cr, Cu, Pd, Au, and how?

Question: It is often referred to as 'anomalous electron configurations' or 'unusual order of filling of orbitals' of a few elements e.g. Cr, Cu, Nb, Mo, Ru, Rh, Pd, Au etc.
Answer: The Wikipedia article clearly states :

[n+l rule] was suggested by Charles Janet in 1928...Janet "adjusted" some of the actual n + ℓ values of the elements, since they did not accord with his energy ordering rule, and he considered that the discrepancies involved must have arisen from measurement errors. In the event, the actual values were correct and the n + ℓ energy ordering rule turned out to be an approximation rather than a perfect fit...
Comment: Thanks for your greeting (while writing the answer I thought I was in SE Physics!)... But I didn't ask the question, so why are you saying about the title to me?
Comment: My mistake. (+1)


Getting exactly circular/rounded NURBS corners

Question: How can the weight of a NURBS curve/surface be calculated such that corners are exactly circular? It has something to do with the angle of the corner, but that doesn't seem to be displayed anywhere.
Answer: I'm not absolutely certain this pertains, but it may not be possible. NURBS cannot be used to represent a circle exactly, but may only be used to create an approximation, however close. You may want to refer to https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline for more information (especially the note in the section titled: Example: a circle).
Of course, this is a good answer if you are attempting to make a full circle. If your goal, however, is to make an exactly circular join between two perpendicular segments, it may or may not be possible.
Then again, as blender is typically used to generate imagery with a finite sample size (i.e. pixels) it may be possible that the rendering of the NURBS approximation of a circle would be sufficiently accurate so as to be indistinguishable from an actual mathematically precise circle.
Hope this helps.
Comment: Well as close as possible is sufficient, perfect circles are finitely impossible because as far as is known π is infinite. NURBS curves can be made very close to circular regardless of the angle between the segments. So based on that angle there must be a formula to calculate what the weight must be of the vertices?


Intervals in scale context

Question: Does the intervals in a scale context sounds different from playing it without any notes in the middle?
example to clarify: if i played the major scale ascendingily (C-D-E-F-G-A-B-C) does every interval in it sound the same when i play it like (C-D),(C-E),(C-G),etc..?
Im confused i feel like they sound different.
Comment: Depending on the tuning, there might be two or more slightly different perfect fourth intervals.  So yes, it's possible for intervals to be different depending on the context, but this difference doesn't necessarily depend on whether you get there by a series of steps or by a leap.
Comment: Can you explain what you mean by "they sound different"? Being those intervals different, they *should* sound different.
Comment: Perfect forth for example, if you played C-D-E-F ascendingily the F (perfect forth) will sound different from playing it C then F (skipping the notes in the middle). am i right ?
Comment: Well, playing 4 notes or playing just the first and the last is not the same: in the first case you are listening to 3 intervals, in the latter you're listening to just one. But the F will still be a perfect fourth from the C. Do you mean that when you play the scale you are perceiving a different F than when directly jumping from C to F?
Comment: @musicmante Yes that's what i mean
Comment: @Edd - Does this include when playing those notes on a piano (or other fixed-tuning instrument - note that the guitar provides too much leeway to re-tune notes on the fly), or just when sung?
Answer: The only reason they 'sound the same' is that they're all diatonic - they all belong to the key of C.
The consecutive intervals (C>D, E>F, A>B etc.) are either one tone or one semitone. Starting from C, and using that as the lower note, all intervals are different. C>D =tone. C>E = M3, C>F = P4, C>G = P5. I don't understand how, say, C>D can sound anything like say, C>B !!
From your comment, play C D E F then just play C F. That C and that F haven't changed at all, and the two will sound the same (maybe not to you!!) played with D E in between or straight off.
Possibly you're playing on a non-12tet instrument, where just about every interval will vary, very slightly. On piano or guitar, both 12tet instruments, each and every note will always sound the same, whereas on, say, violin or trombone, which can play notes in just intonation, (for example), notes can be played, that sound at slightly different pitches from those found in 12tet.
Comment: Thanks you.
But i mean in my comment if i played C>D>E>F melodically not harmonically the F will sound different from playing C>F melodically too, right ?
Answer: You don't specify what instrument you're playing, but the wording makes it sound like there's no way that the pitches are actually changing, just your perception of them. (If this were an instrument like a violin or flute, which can adjust the intonation of individual notes, then maybe the F is actually different when approaching with intervallic vs scalar motion).
If this is a question about perception, then it's difficult to answer because perception is inherently subjective. But there might be a reasonable explanation. The phenomenon is: "If I play C-D-E-F, and then C-F, the F that I approach by a fourth sounds different in some way than the F that I approach stepwise." The explanation might be that juxtaposing two things right next to each other makes their difference more obvious than when separating them with degrees of change.
To use a visual analogy: Here's a quick image of colored squares:

The top row is a list related colors, gradually changing from light to dark. On the second row, I juxtapose the lightest color alongside the darkest. That  bottom square is in fact the same color as the farthest one to the right, but we feel that it's slightly different because of its context. There are similar optical illusions like the "checker shadow" or Cornsweet illusion in which colors that are the same appear different because of their surrounding context.
Another, more complicated, explanation, relies on tonal function. If you'll indulge my microsoft-paint skills again:

Here is an image with two stick figures. The one of the left is standing upright; the one on the right is leaning to the right. The leaning stance means something to us; the figure on the right seems to be leaning "away" from the one of the left. The situation suggests that the figure on the right wants to avoid or escape from the one on the left. Here's another image:

This time both stick figures are the exact same ones; I just moved the upright figure to the right of the leaning one. This time we perceive the leaning figure in a totally different way. Since it's leaning "toward" the upright figure, it expresses aggression or attraction.
Similarly, it's possible that when you play "C-D-E-F," the scalar motion (combined with our centuries-ingrained sense of tonal harmony) leads us to expect a "G" next, but when you play "C-F," you're willing to hear it in a more static, plagal way—that is, your ear is content to "stop" on "F," perhaps even construing it as part of an F major chord. So in the scalar version, you hear the "F" as "leaning" towards an implied "G," but in the intervallic version it "stands upright" and leads nowhere.
Answer: When you say notes "sound different," that means the listener's experience of them is different.  This is certainly possible, as music is a language, and the order of musical relationships can affect their perceived meaning.
There are issues with tuning.  On the piano, some scale intervals are a little "off," while the perfect 4th is very close to harmonic tuning.
Answer: Relative changes and relationships are very important in music, so I think you sense of this makes sense.

..if i played the major scale ascendingily (C-D-E-F-G-A-B-C) does every interval in it sound the same when i play it like (C-D),(C-E),(C-G),etc..?

If you put that into relative terms write it out with intervals...

(C M2 D M2 E m2 F M2 G M2 A M2 B m2 C)
(C M2 D),(C M3 E),(C P5 G)

...M2 is major second, m2 minor second, M3 major third, P5 perfect fifth.
So, you can see that only the C-D is the same between the two cases.
One way to describe the difference is conjunct or scalar motion versus disjunct or chordal motion which can also be called arpeggiation.
Conjunct/scalar will be all in half and whole steps, m2 and M2, but the disjunct/chordal/arpeggiation will be lots of thirds and fourth/fifths.
If I follow your description, when you sing, for example C D E versus C E, you have a different "sound" for those two arrivals on E, but I suspect the difference is not that you have two different pitches for the Es, but that getting to E by conjunct steps versus a disjunct leap, gives it a different "sound" or "feel". Personally, I might say the conjunct approach is a bit "softer" and the disjunct leap is a bit more "assertive", or something along those lines.
The effect may be even more noticeable between (C D E F) and (C-F) where F is approached by a half step versus perfect fourth.
Answer: What complicated answers!
No, on the same instrument, played by the same person, the F on the top of C - F is exactly the same as the F on the top of C - D - E - F.  I really don't think trying to analyse any possible difference will be useful.
Here's a possibly more productive question.
Play the C major scale C - D - E - F - G - A - B - C.    Now, with that scale still in your head, play the Perfect 4th C - F.   Now play D - G, another Perfect 4th.   Try E - A and G - C as well.  (Not F - B, that isn't a Perfect 4th, it's a Diminished 4th.)
In the context of C major, do all those Perfect 4ths feel different?
Comment: But, this is a different case, because those perfect fourth will all be obviously different by _pitch_. The crux of the OP's question seems to be the type of motion to arrive at a certain pitch.
Comment: They probably will do  - to the OP. Hence the question!
Comment: And by relationship to a C major framework.  A much more definite and interesting difference than whatever @Edd is (almost certainly) just imagining he hears in the original question.

Intervals in scale context


Do any crypto libraries take advantage of Windows GPU API "Direct Compute"?

Question: Are there any encryption (decryption?) libraries that take advantage of the Windows GPU API?
Comment: I don't think it would be much advantageous - normal stream encryption/decryption is not that much parallelizable, which is the main strength of a GPU. It would help for breaking (brute-forcing) cryptographic algorithms, though.
Comment: @PaŭloEbermann I'm interested in learning about this brute force parallelization so I can have first hand knowledge / examples to show the business as I argue for stronger encryption.  Do you have any pointers?
Comment: I have highlighted the key sentence in @Ninefingers' answer - this could be useful for you.
Answer: As Paulo quite rightly says in the comments, many encryption operations do not lend themselves well to parallelisation. For example, consider the two AES modes ECB and CBC. ECB consists of applying the AES transforms to each data point using various elements of the key schedule according to the position of the data modulo the key schedule length. Essentially, once you've generated the key schedule, you could easily parallelise AES in ECB mode.
Except that ECB is not a great mode of operation security-wise, because for larger amounts of data you begin to reveal patterns in your ciphertext. Wikipedia explains all of this much better than I can.
CBC mode can basically be described as "take the output of the last operation, xor it with the plaintext and encrypt the result". Typically, you start by xor-ing the first plaintext with an IV. For encryption, you must calculate each block at a time and so the operation is not at all suitable for parallelisation; however, for decryption, you can parallelise the process since a pair of blocks are all that are required to decrypt a block (i.e. if you have block 1 and block 2, decrypt block 2 according to its position in the key schedule and xor with block 1).
These are just some examples; some algorithms do lend themselves to parallelisation. Consider you want to try many passwords against some hashed password you have. Each hash calculation is hard to parallelise, since each block must be fed into the hash function by turn; however, what you can do is to do many hash operations at once - imagine setting off a thread for each hash attempt. Graphics processors are good at this kind of work as they're essentially designed to transform whole sets of co-ordinates in 3D space according to a mathematical result - basically, to do 3D graphics.
A good paper on this topic is Cuda compatible Gpu as an efficient hardware accelerator for AES. Bruce Schneier covers speeding up password cracking. Distributed hash cracking tools have also been studied and google turns up a number of implementations.
I expect that as more work is done, more and more methods will be found to take advantage of parallelisation, both in terms of cryptanalysis and in terms of cryptography. I am not a cryptographic researcher, however, so you'll have to take that with a very large dose of wariness.
Answer: I've just open-sourced the code that performs AES encryption in ECB and CTR mode and AES decryption for ECB, CBC and CTR mode. The GPU specific code uses Direct3D 10 API (not DirectCompute).
On a GeForce GTS 240 I achieved ~300 MB/sec for CBC decryption with 256 bit key.
You can check out the project page here: http://code.google.com/p/amclibrary/


UMTS/HSDPA Data SIM Card on Ubuntu 14.04

Question: Hardware is a Compaq Mini Notebook with HP HS2300 Broadband Wireless Module. UMTS provider and SIM card is Vodafone. Wireless WWAN is working well under Windows XP, but um my second System, UBUNTU 14.04 only WLAN has functionality.
Does anybody know a software connecting the existing hardware to UBUNTU 14.04?
Answer: Go to System Settings > Software and Updates > Additional Drivers
I have gut feeling your module will be there and it will need to download additional drivers. (best doing of this is when you have some alternative connection available)
Answer: I had a similar issue with a 6930p, un2400 WWAN card and Ubuntu 12.04. Both the 2300 and the 2400 have the same issue – on startup, the driver needs to load the firmware into the card. Being a proprietary binary blob, the firmware cannot be shipped with Linux – one needs to download the Windows driver installation package from HP and extract the firmware from it. With this hack it is reportedly possible to get the card to work under Linux.
Another approach might be to install a different, more Linux-friendly PCI-e WWAN adapter. Unfortunately I do not have any reliable reports of PCI-e models that are known to work. I have been able to use a Huawei USB adapter as well as an Option Express Card adapter, both of which were recognized out of the box, thus PCI-e adapters from these vendors might work too. I have also used an Ericsson F5521gw PCI-e adapter with a different laptop, which is supported out of the box but has a bug (most likely in the firmware) that causes it to lock up and refuse to reconnect until the next reboot.
I ended up working around the HP WWAN issue by using the USB stick, and on the other machine I live with the Ericsson bug.


What is $(-1)^{\frac{2}{3}}$?

Question: Following from this question, I came up with another interesting question: What is  $(-1)^{\frac{2}{3}}$?
Wolfram alpha says it equals to some weird complex number (-0.5 +0.866... i), but when I try I do this: $(-1)^{\frac{2}{3}}={((-1)^2)}^{\frac{1}{3}}=1^{\frac{1}{3}}=1$.If it has multiple "answers", should we even call it a "number"? Because if we don't, it would be a bit different from what we were taught in elementary school. I actually thought if it doesn't have a variable in it, it should be a number.  I'm a bit confused. Which one is correct and why? I would appreciate any help.
Comment: Welcome to the wonderful world of ambiguity. For non-integer exponents, the expression $a^x$ has multiple values. Wolfram Alpha gave you one, you found another.
Comment: The problem is that functions of the form $f(x)=a^x$ are multi-valued functions in the complex plane. More precisely, this means $1^{1/3}$ has not one answer, not two answers, but a total of three answers! This corresponds to the fact that $f(x)=x^3-1$ has three roots.
Comment: Google calculator gives the same answer.
Comment: And why isn't there any standard for it?
Comment: There is no clear way which option to choose. In different situations, you want different answers to the same question.
Comment: It's simply ... Undefined.
Comment: @CODE, Related : http://math.stackexchange.com/questions/192742/how-to-solve-x3-1
Answer: Interesting question. This is a subtle point so I will say a lot.

There is a function defined and continuous on the set of all real numbers, which is
$$
x \mapsto x^{1/3}
$$
where the symbol $x^{1/3}$ denotes the unique real number whose cube is $x$. Similar for other fractions with $1$ for a numerator and an odd denominator.
There is a function defined and continuous on the set of all positive real numbers, which is
$$
x \mapsto x^{1/2}
$$
where the symbol $x^{1/2}$ denotes the unique positive real number whose square is $x$. Without that caveat "positive" the symbol would be ambiguous, in contrast to the case with cube roots. Similar with other fractions with $1$ for a numerator and an even denominator.
There is a function defined and continuous on the set of all real numbers, which is
$$
x \mapsto x^2
$$
which needs no more justification.
There is a rule for exponents which works when $x$ is real and positive: when you see
$$
x\mapsto x^{ab}
$$
you may write this as $(x^a)^b$ or as $(x^b)^a$. In fact this rule works for any fractions $a, b$.
Rule 4 does not continue to work when $x$ is a negative real number and $a$ or $b$ are allowed to be fractions. For example,
$$
(-1)^1 = (-1)^{(1/2)*2} \neq ((-1)^2)^{1/2} = 1.
$$
Note that the failure here has nothing to do with imaginary numbers; indeed, in the above equality, I never took a square root of a negative number. It's just that Rule 4 does not work when $x$ is allowed to be negative.
For this reason, it's somewhat dangerous to try to define a symbol like $(-1)^{2/3}$. For instance, is it the same as $(-1)^{4/6}$? Note that either answer you give will be problematic; on the one hand $2/3$ is the same number as $4/6$, and so whatever definition we pick we had better get the same value; on the other hand, we shouldn't be speaking of taking even roots of negative numbers if we insist on working with only real numbers.
We can introduce complex numbers to get rid of the problem in (6). However, when we introduce complex numbers, it's no longer true that there is a unique number whose cube is a given real number. For instance, as you've discovered, by playing with Wolfram, there are cube roots of $1$ in the complex plane other than $1$ itself. Therefore, the function defined in (1) breaks down if we no longer insist that $x^{1/3}$ be real-valued.
On the complex plane, it is best to think of $x^{1/3}$ as being a "multi-valued function," i.e. not a function at all, but something that takes in one value and returns multiple values. In fact, every complex number but $0$ has three distinct "cube roots."
Comment: For the record, if anyone is still reading, if I bump into a symbol $(-1)^(2/3)$ without any context, in my opinion the least bad interpretation is that the answer is $1$.
Comment: about 8) we can see it as a function with the codomain C^3, no?
Comment: No, because there is no natural ordering. You can see it as a function with values in $C^3 \text{mod} S_3$ if you like, though. For the more usual way to make 8 rigorous, google the Riemann surface of the square root (or cube root in this case) function.
Comment: thank you, it makes sense
Answer: As a number of commenters have pointed out, there are three possible values that satisfy $$x = (-1)^{\frac{2}{3}}.$$
These can be found by replacing -1 with three different ways of expressing -1 as a complex exponential, $e^{\pi i}, e^{-\pi i},$ and $e^{3 \pi i}$. Substituting in, we find that:
$$\begin{align}
\left(e^{\pi i}\right)^\frac{2}{3} & = e^{\frac{2}{3} \pi i} \approx -0.5 + 0.866025 i\\
\left(e^{-\pi i}\right)^\frac{2}{3} & = e^{-\frac{2}{3} \pi i} \approx -0.5 - 0.866025 i\\
\left(e^{3 \pi i}\right)^\frac{2}{3} & = e^{2 \pi i} = 1
\end{align}$$
There are even more ways to express -1, specifically $e^{(1 + 2n) \pi i}$, where $n \in \mathbb{Z}$ is any integer. This means that there are infinite ways to express -1, and all will give us a valid answer. However, if you try some, you'll notice that they are repeats of the three we have already seen. For example, $$\left(e^{5 \pi i}\right)^\frac{2}{3} = e^{\frac{10}{3} \pi i} = e^{-\frac{2}{3} \pi i}.$$
Answer: If we look for real answer in two ways answer is $1$ for complex cases see other answers
$$(-1)^{\frac{2}{3}}=(-1)^{2\cdot\frac{1}{3}}=((-1)^2)^{1/3}=1^{1/3}=1$$
$$(-1)^{\frac{2}{3}}=(-1)^{\frac{1}{3}\cdot2}=((-1)^{1/3})^2=(-1)^2=1$$
Answer: If you read a bit below in Wolfram Alpha
you'll find all 3rd roots of $(-1)^2$:
$$
\begin{align}
\operatorname{e}^{\frac{2i\pi}{3}}&\approx 0.5+0.86603i\\
1&\quad\text{real root}\\
\operatorname{e}^{-\frac{2i\pi}{3}}&\approx 0.5-0.86603i\\
\end{align}
$$
Answer: The key is De Moivre's Theorem.  You want the cube roots of 1.
You might be able to prove that the square of $\cos\theta+i\sin\theta$ is $\cos2\theta+i\sin2\theta$, where $i$ is the square-root of -1.
Also, the cube of $\cos\theta+i\sin\theta$ is $\cos3\theta+i\sin3\theta$.
If we want the cube to equal 1, then $3\theta$ can be any multiple of $2\pi$ because $\cos2k\pi=1$ and $\sin2k\pi=0$ for any integer $k$.
Then $\theta = 2k\pi/3$.  For example, if $k=1$, we find $\theta=2\pi/3$, and
the cube-root is $\cos\theta+i\sin\theta=\cos(2\pi/3)+i\sin(2\pi/3)=-0.5+i0.866...$
Answer: How to choose which of the values to use?  One consideration: Perhaps I want $(-1)^t$ to be a continuous function of $t$, defined for all real $t$.  If I want that, then the conventional choice is:
$$
(-1)^t = e^{i t \pi} = \cos(i t \pi) + i\sin(i t \pi)
$$

What is $(-1)^{\frac{2}{3}}$?


In google analytics, hourly data shows user's timezone or the website owner's timezone?

Question: Suppose my google account settings has my timezone as PST. And I have included google analytics on my website. A user opens the site from New york city at 4pm ET. In the hourly dashboard what is shown, PST or ET ?
Answer: "The country or territory and the time zone you want to use as the day boundary for your reports, regardless of where the data originates. For example, if you choose United States, Pacific Time, then the beginning and end of each day is calculated based on Pacific Time, even if the hit comes from New York, London, or Moscow."
Source: https://support.google.com/analytics/answer/1010249?hl=en