What is a gentle reminder to a squash opponent to stop an ongoing evaluation?

Question: Although the question applies to many sports, I'm seeking an answer in the particular context of the rules and culture of squash. Is the answer formally specified in the competition rules of squash? Is the (worldwide) culture established firmly enough for the question to have a universal answer? In case it matters, I'm talking here about international, not US, squash.
I occasionally play against a opponent who likes to comment. This happens in many variations, but the main one is that if I make a difficult shot, they'll comment "nice shot", perhaps after they themselves have missed the return.
If this pat-on-the-back is made two or three times in a game, and after particularly strong play, I find that it's a nice compliment. But if the comments are made incessantly, for just about every rather-ordinary successful shot, the comments rattle me. I'm not sure if other players are capable of putting up with an ongoing evaluation. I'm not sure if a player ought to be able to handle some evaluation without being rattled. This is, after all, not chess. In chess, at least when I played semi-seriously a long time ago, a player would automatically lose a formal game if they spoke and told their opponents "nice move". It's understood that this will destroy the focus of one's opponent.
In squash I can never tell whether the comments are (intentionally or unintentionally) malicious. But I do know that they affect the ongoing game.
I have two questions:

Is there a formal rule in squash that prevents an opponent from making a comment at all, at least until the game is over.

More importantly:

Even though I'm particularly bothered by comments in the middle of the game, and even if I get a gut-feeling that some comments are intended to change the course of a game, I do not wish to be rude and say "no comments until the game is over, please". What is a civil way of telling one's opponent "kindly keep your trap shut until we finish. You're my opponent, not my critic nor an audience member"?
Comment: This happens in golf. If my playing partner says, "nice shot" after a decent shot, then I take it at face value. We're not competing, but I take it as nothing other than good sportsmanship.
Comment: @ᴍᴀsᴛᴇʀᴍɪɴᴅ_ᴇᴅ You're right. It depends on the context, and it depends on the frequency. If someone says it for a truly outstanding shot, once or twice during 40-60 minutes of play, it's all right. If someone says it routinely, almost every time they lose a shot, it's grating. If after the evaluation the play resumes with the same intensity and friendliness as before, it's all right. If after the evaluation I sense more aggressive play, sometimes bordering on hostile playing, I start to wonder if the comment was not said amicably, but with some sinister (psychological) objective.
Comment: Interesting question, also interesting anecdote about the court sizes.. Thanks for that. Not really an answer but more of a comment, psychology is part of most sports if not all. There is trash talking in most team sports, and yes even in chess you can psyche your opponent out by for example taking excessively long time for your initial moves (one of my mates won a game by practically boring his opponent like that). That being said, I really dont think giving credit to your opponent for a point isn't bad manners just keeping it casual and friendly.
Answer: There are all kinds of players out there. Some are completely quiet, not even calling out scores once in  a while, and on the other end of the spectrum some comment and joke around without pause.
There is one kind that annoys me very much - the swearing ones who seem to have no fun at all. What you are describing is very common, in my experience, and you really should not take it as malice.
Frankly, my advice would be to ignore it, or to endure it for one match and then avoid further matches with them if you can. Trying to talk them out of it will likely be very awkward and futile.
Comment: Your suggestion to just avoid the unpleasant players is right on. Unfortunately, when playing in a league, there is no avoiding some players. Here I'm seeking a way to make the best of the one hour I have to spend with them on the court.
Comment: Then try to live with it, by assuming that it is not meant in an offensive way. ...
Answer: Rules 15.5 and 15.6 could apply, theoretically.  Among dangerous play and direct abuse these rules also bar unfair behaviour and deliberately distracting the opponent.
With a favourable referee you might have luck with complaining about your opponent, but I think it's unlikely. I doubt any referee is likely to award conduct warnings for mere casual chatter under these provisions; not only do we see far worse conduct on professional tournaments every day with no referee action, even in everyday life you would have a hard time convincing anyone that casual compliments are "unfair" or "deliberately distracting".
Squash is no chess, and psychology is just part of the game.  You are not entitled to have your focus protected from casual chatter, and indeed, you are responsible for maintaining your focus regardless of court action all by yourself.

In a casual game I would just politely ask my opponent, along the lines of "Hey, thanks for these compliments. I'm sorry to say though that they really affect my focus; would you mind if we played silently for the rest of the match?"
If you ask politely, and as a question, I think a decent person would do as you ask; if they don't they are perhaps not the person you should play against if their behaviour stresses you. And that's totally fine, not everyone is fun to play, and you wouldn't go to a pub for a beer with some folks either, would you?
After all, in a casual game you are playing for fun, so you should not force yourself to do so much emotional labour.

In a tournament however you should rather not ask; it would just reveal your weak spot to the opponent and show them that they hit a sore point.
I would not blame your opponent for making even more compliments afterwards; it's part of the game and a legitimate strategy to win—we see weaker players beat better ones just because of stronger focus and better mental protection every day, even in professional tournaments.
Instead, take it as a training exercise to improve your focus and your psychological stability.  Casual chatter and compliments should not put you off balance in a tournament match; if they do that is something that you can work on with exercises and mental training.
I used to play against "talkers" a lot, even against people who would make entire games by fishing for cheap points and lets (which is hard to prevent without a referee).  It's not fun per se, but it's a great exercise to learn to shut all else out and focus on your game not your opponents behaviour.
And in the end, a confident victory against a "talking point fisher" feels all the better 8)
Comment: I don't think it's the opponent the OP is talking about, but his/her partner.
Comment: You mean, like in a double, or perhaps even in a relationship? I'm not sure; I understood "partner" as a synonym for "opponent", in the sense that's the person they are on court with (perhaps also because "international" suggests that the OP is not a native speaker).
Comment: Good point as it could be interpreted either way.
Comment: @lunaryorn Nice answer! I see that 15.6.9 (deliberate distraction) is just about the only rule I could invoke formally. But then I don't recall ever having watched either the shark players in my clubs or championship-level play where the players spoke during the game. If psychology is part of the game, I'm surprised the game doesn't move in that (awful IMHO) direction. Good players are usually quite stoic, and that's the example that vibes with me.
Comment: @lunaryorn As to contrasting "international squash" against "US squash", I'm lost there. Throughout the US and Canada both types of courts are (unfortunately) seen. It's perfectly understood everywhere that the game ought to be played on an "English" court to facilitate interacting/competing with the rest of the world, but wherever conversion has taken place, two US courts were turned into one, since the width is usually constrained by concrete walls, and often they were left alone. In Germany of course US courts are unknown. What term would you use to distinguish the two courts/games?
Comment: @Calaf I'm quite surprised by your experience here.  There are actually quite a few top players who are anything else than stoic on the court (look at e.g. Gaultier or El Shorbagy). As I said I think it's unlikely that a referee would consider talk between rallies as "deliberate distraction"—I would not when refereeing; if at all I'd ask to continue the game when they players are talking for too long.  As for US/international I wasn't even aware that there were different courts in the U.S..  You're not referring to racketball or so, are you?
Comment: @Calaf PS: 15.9.6 is more about deliberately distracting the opponent *during* a rally, not about talking in between rallies.  For instance, you'd invoke 15.9.6. if a player cheers loudly at their own shot *while* the rally's still going on—if the opponent complains that'd be a let plus conduct warning.
Comment: @lunaryorn US courts are narrower and longer. They're easy to spot in photos because the lines on the sides are not straight slanted, but rather (oddly) a Z shape. The variation refuses to die, because buildings (especially on university campuses) have been constructed based on the different dimensions. I can say from experience that it's very difficult to switch between the two courts. For a time I asked when booking for an international court, and took an american court if the international ones were taken, until I found that a lot of the game is played by reflex, not by calculation, ..
Comment: @lunaryorn and that it's best to skip playing if the international courts were already booked (because playing on a court with different size is actually detrimental to one's game). The >100-year-old confusion about the court size may be the reason why the US participates little in the sport, despite committed players. The lore is that a traveler in 1912 wanted to teach Americans about the dimensions used in Europe, except that he traveled on the Titanic.
Comment: @Calaf Cool thank for sharing this info. Wasn't aware :) I've only ever played in Europe :)
Answer: Without wanting to seem too harsh: you don't sound like someone who I'd want as a playing partner. When I'm playing sport, I'm there primarily because I enjoy it - and I don't enjoy doing things in complete silence, never saying a word. I simply wouldn't play with someone who insisted on no comments while playing. Equally, my experience is that this applies to the vast majority of people I've played sport with. Therefore I suggest that if you want to play in silence, then you need to find like-minded people, not try and change your current partners to fit your ideal of how a sport should be played.
Comment: By all means. I'm also there to enjoy it. I love to chat between games. I'm glad if my partner is up for a beer after the game. With a good partner I am so soaked that I always feel I deserve it. But I also dislike the continuous commentary, as if I'm watching a game played by myself on TV, with my partner volunteering his opinion, nearly every-single-shot.
Comment: I suggested a solution: find different people to play with.


Composition over Inheritance - where do extra properties go?

Question: Take this following code from an example HR system. The user has the ability to log an absence and can be of various types including holiday and sickness. This would be a domain model over an ORM such as NHibernate.
public class Absence
{
    public long Id {get;set;}
    public Employee Employee {get;set;}
    public DateTime StartDate {get;set;}
    public DateTime EndDate {get;set;}

    public virtual void DoSomething()
    { ... }
}

public class Holiday : Absence
{
    public string Location {get;set;}

    public override void DoSomething()
    { ... }
}

public class Sickness : Absence
{
    public bool DoctorsNoteProvided {get;set;}

    public override void DoSomething()
    { ... }
}

This is an example - please don't question why location would be required, assume it is a specification.
The user wants to change the type - he thought the employee was off sick but then remembered it was a holiday. Again, you may think this is a bad design but treat it like a requirement - this represents a problem that has come up many times for me.
The problem is that you cannot change the type of an object from Sickness to Absence. Generally, the advice would be to Favour Composition Over Inheritance (Gang of Four) and do this:
public class Absence
{
    public long Id {get;set;}
    public Employee Employee {get;set;}
    public DateTime StartDate {get;set;}
    public DateTime EndDate {get;set;}

    public AbsenceType Type {get;set;}

    public void DoSomething()
    {
        Type.DoSomething();
    }
}

But when I do this, when do the properties specific to Holiday and Sickness go (Location and DoctorsNoteProvided  respectively)?
Answer: Why do you need to change the type of an object?
You will have some kind of collection of Absences, just replace the item in question.
Conceivably rather than replacing you even keep the original request and mark it as superceded, that might be important for audit trail purposes.
Comment: Three answers all saying the same thing, very hard to choose between them, but this one just had the edge because it considered audit trails etc. Mike Mozhaev and Ray Toal get upvotes but this get the tick!
Answer: It's not the right place for Composition over Inheritance. Here the inheritance is appropriate. And if you need to change the type of absence just create a new one and delete old.
Answer: Hmmm, without knowing more about your requirements, I would say the right design is not to change an Absence object to a Sickness object (or vice versa) but to just delete the one you don't want and create a new one of the type you do.  Somewhere you must be maintaining a collection of absences, right?
You are correct that classes don't change.
Answer: I would model this by having a type hierarchy for an AbsenceType, or AbsenseReason:
abstract class AbsenseReason {
}

class HolidayAbsenseReason : AbsenseReason {
    public string Name { get; }
}

I like this model because now AbsenseReason is a value object and is independent of an employee Absence, which is an entity object. This, as you stated, solves the issue with changing the absence reason. Generally speaking, I would favor this over deleting a record, because there may be many associations to consider as well.
Things to consider:

NHibernate does not support inheritance mappings on components so you will have to provide a custom implementation of IUserType.
Consider storing all the data for the different absence reason sub types together with the record for the employee absence entity. Possibly as XML so that you can have collections, etc.
Comment: I did conceive that there would be SicknessAbsenceType, HolidayAbsenceType inheriting from AbsenceType. I should probably have explained that better in my post. However, I had conceived it as an entity, not a value. I'm not sure how you are suggesting I would store the information specific to an absence in the actual absence type? In my concept it would only contain information about holidays /sickness in general, not about one specific instance. I would be interested to know more about your theory?
Answer: So try to move all type specific functionality to AbsenceType derivatives. If they require something from parent class Absence, you could pass them its reference. Though I would try to avoid that.
If you manipulated Absence object via base class interface, nothing changes, you can keep your old code. Now, if you manipulated specific derivatives, then you will have to grab AbsenceType object from specific Absence and do all the same things on them - still not much to change. If you had holiday.DoSomething(), now you have holiday.Type.DoSomething().
Comment: I'm not sure where you're suggesting I store holiday/sickness specific properties?
Comment: so yeah, `AbsenceType` would be kind of Value Type, with no identity, would belong solely to single `Absence` object, and all type specific behavior should be moved to its derivatives: `SicknessAbsenceType`, `HolidayAbsenceType`, ...
Comment: This is a simmilar answer to eulerfx. It seems to be a pattern that people are using that I am not totally fammiliar with. I still don't quite grasp it. Could you point me to a code example please?


Can I use a BOSS Power Supply with a JHS Andy Timmons Drive Pedal?

Question: I had to order my JHS Andy Timmons Drive pedal from the United States (it is not available in my country).
Apparently the pedal does not use battery and requires a 9V DC power supply. I am not sure if I will need to order a JHS power supply for the pedal.
Can I use my BOSS power adapter to power the pedal? I would assume so as it the pedal has a 9V DC input like my BOSS pedals. I have not received the pedal yet, and can't really find much information around this.
Thanks
EDIT: As per the accepted answer below, I used a BOSS PSA with this pedal without any issues, it is a standard 9v adapter like any of the BOSS pedals.
Answer: A Boss PSA-style PSU should work fine.
https://www.jhspedals.com/faqs/ says:

All of our pedals use a standard 9v DC adapter with a negative ground

Well, 9v DC, centre negative is the Boss-style PSU spec, the only one that in the pedal world that can be called 'standard'... but what about that 'with a negative ground' bit?
I stand to be corrected, but I don't believe that a typical pedal power supply, including the BOSS PSA, itself presents a 'true' ground to the pedal. 'ground' in a pedal context usually means what side of the power connector is connected to the pedal's case (and, consequently, the signal cables' shield).
Usually with pedals, this is the 'negative' side - i.e. the centre. I'll quote http://www.diago.co.uk/adaptors/positive-ground.html :

The Diago Positive Ground Adaptor allows positive-ground pedals to be
  powered alongside regular negative-ground pedals via the same power
  supply.

And I guess this is what JHS are saying about their pedals when they say 'with a negative ground' - just that they're normal in this respect. I guess it also means that if you are using a PSU with a true ground, it would have to be negative ground.
The only time I've had to worry about what is 'ground' was when powering pedals off a daisy chain - in this case, you need to know which side (+ or -) of the PSU input is grounded to the case as if you mix up 'positive ground' and 'negative ground' pedals, you'll short your PSU as both + and - will be connected to the case.
Answer: Boss power supplies are 9vdc, but the polarity is centre pin negative. There's a 50:50 chance. Doing a bit of homework reveals that JHS pedals use 9vdc negative ground. So, no, it's the wrong 50%. Unless you rewire the adaptor, or make a male/female dc lead that's wired back to front.Best buy the appropriate psu. The other factor of course is the power consumption of the pedal, and there's no clue that I've found - yet. Most of the JHS pedals seem to consume 100mA, and the Angry Charlie can be run on up to 18vdc, apparently, looking at the JHS site.
EDIT - checked with JHS and the site states that they run on 9vdc neg.centre. So it would appear that it'll be good to go.


How to populate the select option using select index

Question: -- Modifying my previous question --
This really got me. This is what I am doing right now with my module. I created a menu_hook which creates a form using a theme to create data. Another menu link which displays the saved records. When the user clicks on the Name, it should display the form with all fields populated with the corresponding data but with form fields disabled. To attain this, my module file looks like this.
<?php
  function agents_menu(){
    $items=array();
    $items['enquiryform']=array(
      'title'=>'New Enquiry',
      'description'=>'Add new enquiries form',
      'page callback'=>'agents_form',
      'access callback'=>TRUE,
      'access arguments'=>array('access content'),
      'type'=>MENU_NORMAL_ITEM,
    );
    $items['enquirylist']=array(
      'title'=>'View Enquiries',
      'description'=>'Lists all the enquiries',
      'page callback'=>'show_enquirylist',
      'access callback'=>TRUE,
      'access arguments'=>array('access content'),
      'type'=>MENU_NORMAL_ITEM,
    );
    items['enquiry_details']=array(
      'title'=>'New Enquiry',
      'description'=>'Add new enquiries form',
      'page callback'=>'enquiry_details',
      'access arguments'=>array('access content'),
      'type'=>MENU_CALLBACK,
    );
    return $items;
  }

  function agents_form(){
    $form = drupal_get_form('enquiries_form');
    return render($form);
  }
  function agents_theme(){
    return array(
      'enquiries' => array(
        'render element' => 'form',
        'template' => 'customTemplate',
      ),
    );
  }

  function enquiries_form($form, &$form_state){
    $form = array();
    $form['#theme'] = 'enquiries';
    $form['efname'] = array(
      '#type' => 'textfield',
      '#title' => 'First Name',
      '#size' => 28,
      '#maxlength' => 100,
      '#required' => TRUE,
  );
  $form['elname'] = array(
    '#type' => 'textfield',
    '#title' => 'Last Name',
    '#size' => 28,
    '#maxlength' => 100,
    '#required' => TRUE,
  );
  $form['edob'] = array(
    '#type' => 'date',
    '#title' => 'Date of Birth',
    '#date_format' => 'Y-m-d',
    '#required' => TRUE,
  );
  $options = array('0'=>'Male','1'=>'Female');
  $selected = '0';
  $form['egender'] = array(
    '#title' => t("Choose Gender"),
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => $selected,
  );
  $form['submit_btn'] = array(
    '#type'=>'submit',
    '#value'=>'Submit',
  );
  return $form;
}
function enquiries_form_validate($form, &$form_state){}

function enquiries_form_submit($form, &$form_state){
  $dobarr = $form_state['values']['edob'];
  $dob = $dobarr['year'].'-'.$dobarr['month'].'-'.$dobarr['day'].' 00:00:00';
  db_insert('enquiries')->fields(array(
    'efname'=>$form_state['values']['efname'],
    'elname'=>$form_state['values']['elname'],
    'edob'=>($dob),
    'egender'=>$form_state['values']['egender'],
    'active' => 1,
    )
  )->execute();
  drupal_set_message($form_state['values']['efname']);
}

function enquiry_details(){
  $query = db_query("SELECT * FROM {enquiries} WHERE eid='".$_GET['vars']."'");
  $form = drupal_get_form('enquiries_form');
  foreach($query AS $result){
    $form['efname']['#value']=t($result->efname);
    $form['efname']['#attributes']['readonly'] = 'readonly';
    $form['efname']['#attributes']['class'][] = 'readonly';

    $form['elname']['#value']=t($result->elname);
    $form['elname']['#attributes']['readonly'] = 'readonly';
    $form['elname']['#attributes']['class'][] = 'readonly';

    $form['egender']['#default_value'] = '1';
    $form['egender']['#disabled'] = TRUE;
    $form['egender']['#attributes']['readonly'] = 'readonly';

    $form['edob']['#value'] = date($result->edob, '00:00:00');
  }
  return $form;
}

No matter what I do, select drop-down doesn't populate "Female". I checked the value of $form['egender']['#default_value'] before and after setting it to 1. Though the value is returned, select drop-down won't change as per the default_value. My understanding is that the form element is not refreshed after setting the value. Tried using the same approach in hook_form_alter but of no use. Same way, date is also not getting populated. What and where am I doing wrong?
Comment: Where are you setting $result ?
Comment: Also, adding $_GET['vars'] directly to a db query is quite a large security hole. There is a [Drupal database api](https://www.drupal.org/developing/api/database) for a reason.
Comment: My bad. I am setting the result in foreach. Here is the code

`foreach($query as $result){
      $form['egender']['type_options']['#values'] = intval($result->egender);
    }`
Comment: $form['egender'] is '#type' => 'select'. why are you setting ['type_options']['#values'] ? The 'select' type will ignore 'type_options'. Are you trying to add more options to go with male and female?
Comment: Please update your original question and explain what you are trying to achieve exactly (what form items and what values)
Comment: Here is what I am trying to do. I am trying to populate the values that I fetched from the query into the form elements. In this case, I got the value 1 from database, but not able to show the select with index value 1 (which in this case is female) ['type_options]['#values'] is just a option that I tried. I'm new to drupal, so am learning it in a hard trail and error method. I am trying to populate the values into the form which I already defined in enquiries_form. Hope I am clear with what I am trying to achieve
Answer: If you are trying to set the default value, you need to set:
$form['egender']['#default_value'].
setting it to 1 will make female the default value.
HERE is a page that shows you the relevant form array values that an be set.
Comment: 2pha - That is where I was stuck. It is not populating the default value into the dropdown. The value remains unchanged. I checked the value of $form['egender'] using dpm() and the default_value still showing integer 1. But the dropdown value remains unchanged rather than showing "Female" What am I missing?
Comment: Make sure you "hard refresh" to check it as I think most browsers will remember the dropdown value that was selected from page to page. Make sure the values of the options are correct in the  tags. dpm the form after setting the default value to check the default value is set in the form array.
Answer: The problem is solved now and this is what I did, exactly what 2pha has suggested me to do.
$form['egender']['#default_value'] = t($result->egender);

The key is, clear the cache as much as you can. I tried to see the result by clearing the cache, but nothing happened. Finally I ended up restart the server and try again, and it worked. Thanks to 2pha


Showing $\lim_{n\to \infty} \left( 1+\frac{1}{2n} \right)^n = \sqrt{e}$, intro to analysis

Question: I am in an intro to Analysis class, and I want to show that
$$\lim_{n\to \infty} \left( 1+\frac{1}{2n}  \right)^n = \sqrt{e}$$
I already have a result that
$$\lim_{n\to \infty} \left( 1+\frac{1}{n}  \right)^n = e$$
Which was not proven rigorously but was given to us. We basically just proved that the limit was bounded between 2 and 3, and then they gave us the real limit $e$. I am not sure if I need to use that result or not.
I have also found in the text a property that says a suite of real numbers converges to $\sqrt{a}$ if $x_1>0$ and $x_n=\frac{1}{2}\left(x_{n-1}+\frac{a}{x_{n-1}}\right),n\ge2$
I am having trouble representing the first expression in this way. Any direction would be greatly appreciated.
Comment: Note: A limit doesn't approach anything. It's not moving around and doing a little dance. It either exists or it doesn't, and if it does, it's just a number.
Comment: See also: [Why is $\lim\limits_{n\to\infty} (1 + \frac{1}{2n})^n = e^{\frac{1}{2}}$](https://math.stackexchange.com/q/1833678)
Comment: @zhw. thanks for the pointer there I have adjusted the title
Answer: We have that
$$\left( 1+\frac{1}{2n}\right)^n=\left[\left( 1+\frac{1}{2n}\right)^{2n}\right]^\frac12$$
then let $k=2n \to \infty$.
Comment: OK I guess I found it here: if $\lim_{n\to \infty} x_n = x$ and $\lim_{n\to \infty} y_n = y$ then $\lim_{n\to \infty} x_ny_n = xy$
Comment: This is very easy :-). +1 for all the users.
Comment: Yes thanks for the quick explanation, but I am in an intro class and we are expected to show every part of the logic. I see what you did here but I am missing that part that we are allowed to assume that the limit of a product of a suite approaches the product of the limits of the component suites.
Comment: @jeffery_the_wind Yes of course! Refer to these [notes](http://tutorial.math.lamar.edu/Classes/CalcI/LimitsProperties.aspx).
Answer: Hint:$$\left(1+\frac1{2n}\right)^n=\sqrt{\left(1+\frac1{2n}\right)^{2n}}.$$
Answer: $$
\left(1+\frac 1{2n}\right)^{2n}\longrightarrow e.
$$
Now, by the continuity of the square root,
$$
\left(1+\frac 1{2n}\right)^{n} = \left[\left(1+\frac 1{2n}\right)^{2n}\right]^{1/2}\longrightarrow \sqrt e.
$$
Answer: There is a striking similarity between
$$\left(1+\frac1{n}\right)^n$$
and
$$\left(1+\frac1{2n}\right)^n,$$
which you should try to exploit.
With a little bit of thinking and $m:=2n$,
$$\left(1+\frac1{2n}\right)^n=\left(1+\frac1{2n}\right)^{2n/2}=\sqrt{\left(1+\frac1{m}\right)^m}.$$
And the limit works because the square root is a continuous function.


Accessing SQL with the PC name not the IP

Question: I'm trying to connect to a SQL instance (default instance) on a machine. When using the IP of the machine it connects to the machine. Using the name of the machine on that machine you are able to establish a connection to the SQL instance but using the machine name on another PC the connection cannot be established. And gives the error
A network-related or instance-specific error occurred while establishing a connection to SQL Server. ... (Microsoft Server, Error: 10060)

The machine that I am trying to establish the connection from can ping the machine with the SQL instance both on the IP and on the name.
Why would this be and how can I fix it?
Edit: pinging the name does resolve the correct IP. Pinging the FQDN also works correctly.
Comment: [Sounds like the same problem I had a while back...](http://serverfault.com/q/384700/118258) that unfortunately, I had to rebuild the server to fix.  Hopefully you'll have better luck finding a solution than I did.
Answer: [original]The DNS name you are using to connect to the server may not be resolving to the IP hosting the instance. You can check this by using nslookup to resolve the name and verify this resolves to the instance IP address you have configured on the SQL server.
Beyond this, tas @mrdenny mentioned, there may be a network based firewall in the way, or a host based
[/original]
Edit1: saw the bit about ping by name... Is the name you are pinging actually resolving to the server hosting the SQL instance?
Edit2: The named instance you have created may be configured to use a uniquely different TCP port for the listener. Your IP based listener may be on the default port, but the named instance may be listening on the next port or some other arbitrarily defined port.
Also, in SQL Configuration Manager, verify the Named Instance service is running...
Answer: It sounds like either the firewall is enabled, or SQL Server isn't configured to allow remote connections.
The firewall can be configured via the control panel.  The SQL Server can be configured to support remote connections via the SQL Server Configuration Manager.
Once you have confirmed that SQL is listening on the TCP port , you can test if it's the firewall easily enough by telnetting from the client machine to the SQL port number on port 1433.
Comment: If this was the case, it would not be possible to connect to the machine even using its IP address. This looks like a name resolution problem, not a firewall problem at all.
Comment: Given that the OP said that pinging the server worked it's not DNS.  The wirewall could be configured to block SQL but allow ICMP easily enough.
Comment: Read it again... he said he can **CONNECT TO SQL SERVER** by using the IP address. So port 1433 (or any other SQL port) is definitely not blocked.
Comment: Did miss that part. Ping can resolve the name so DNS should be working.  At this point I'd want to see what network protocol's are enabled on the SQL Server, ports, etc. that are being used when it's working and when it isn't.
Answer: After more investigation the cause of the problem was that the machine name was added as an Alias to the IP of the correct machine but listening on port 2305 and not on 1433. Changing it to 1433 solved the problem.
Answer: Open cmd prompt and write this:
notepad C:\Windows\System32\drivers\etc\hosts

This will open the file named Hosts using Notepad.
Add one entry like below:
 [Machine_IP] [Press Tab] [Full Machine Name]

E.g. If my IP is 10.10.3.222 and FQDN of my machine is: WinServer-L2Lab.contoso.com
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      22.214.171.124     rhino.acme.com          # source server
#       126.96.36.199     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
10.10.3.222      WinServer-L2Lab.contoso.com

Save the file. And try to connect.
Answer: This looks like a name resolution problem.
You said you can ping the SQL server using its name; ok, but please double check this.
Try to ping the FQDN (servername.domain.com, not servername only) of the SQL server. Does this work? Does it actually ping the server's IP address, or does it ping a different one?
Then, try to ping the server's name without the domain suffix (thus, servername only). Does this work? Does it ping the server's IP address? Does it automatically resolve to the server's FQDN (servername.domain.com), or does it stay as you requested it (servername)?
There are a couple of possibile issues here: either the name maps to the wrong server in DNS, or DNS is not working and NetBIOS is used to resolve the name (and this could map to the wrong server, too); the above tests should clarify this. Please try them and then post your results.
Comment: pinged both the FQDN and the servername only same results and the IP for this ping is the same as the IP I ping and can connect to. Pinging the servername only does resolve to the FQDN.
Comment: Ok, name resolution is good then. This has to be a problem specific to SQL Server.
Comment: Why the downvote? These were perfectly reasonable checks to do...
Comment: Agreed, I do think it was reasonable checks.


Power series representation for $x\arctan(x)$. How?

Question: I am supposed to start with the P.S representation for $\dfrac{1}{1-x}$ and then figure out the P.S representation for $x\tan^{-1}(x)$. I know the process of making it for just the $\tan^{-1}x$. But wouldn't the fact that there is an extra $x$ at the front change everything dramatically? Or am I not getting something?
Can I just do the same process as for $\tan^{-1}(x)$ and then just add an extra $x$ after sigma?
Thanks!
Comment: Yes, you can just multiply. Get $x$ inside the sum and that's it.
Answer: Recall that
$$\arctan x=\int_0^x\frac{dt}{1+t^2}$$
We also know that, for $|t|<1$,
$$\frac1t=\sum_{k\geq0}(1-t)^k$$
So we then have that
$$\frac1{1+t^2}=\sum_{k\geq0}(-1)^kt^{2k}$$
So for $|x|<1$,
$$
\begin{align}
\arctan x=&\int_0^x\sum_{k\geq0}(-1)^kt^{2k}dt\\
=&\sum_{k\geq0}(-1)^k\int_0^xt^{2k}dt\\
=&\sum_{k\geq0}(-1)^k\frac{x^{2k+1}}{2k+1}\\
\end{align}
$$
Which means that
$$x\arctan x=\sum_{k\geq0}(-1)^k\frac{x^{2k+2}}{2k+1}$$
Answer: $\tan^{-1}x=\int\frac1{1+x^2}=\int\sum_n(-x^2)^n=\sum_n\int(-x^2)^n=\sum_n(-1)^n\frac{x^{2n+1}}{2n+1}$.
Thus $x\cdot\tan^{-1}x=\sum_n(-1)^n\frac{x^{2n+2}}{2n+1}$.


Atualizar node.js no ubuntu

Question: Não estou conseguindo atualizar o node.js no ubuntu.
Fiz a instalação, mas aqui aparece que foi instalado a versão:

Node = v8.10.0
Npm = v5.3.2

No site fala que a ultima versão é a 10.16, porque não foi instalado a ultima versão? Como atualizar para a ultima versão?
Já segui vários tutoriais na internet, nenhum me ajudou a fazer a atualização.
Estou tendo problema ao rodar uma aplicação minha que havia feito no windows. Agora tentando rodar no linux da esses erros:
Comment: E como fez a instalação?
Comment: Olá @AndersonCarlosWoss Segui instruções de vários sites, que me lembre agora, vendo no meu histórico foram esses sites: (https://github.com/nodesource/distributions/blob/master/README.md) e (https://www.digitalocean.com/community/tutorials/como-instalar-o-node-js-no-ubuntu-16-04-pt) Obrigado.
Comment: No primeiro link há especificações de instalação para cada versão do Node. Qual delas utilizou?
Comment: @AndersonCarlosWoss Node.js v12.x: `curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -` e depois `sudo apt-get install -y nodejs`
Answer: instale usando o nvm.
Execute esses comandos no terminal:

sudo apt-get update

e depois:

sudo apt-get install build-essential libssl-dev

Para baixar a instalação NVM que está no GitHub digite esse código no terminal:
<code>curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o
  install_nvm.sh
</code>
Em seguida execute esse comando:

bash install_nvm.sh

Depois disso, digite no terminal:

source ~/.profile

Agora com NVM instalado, próximo passo é verificar as versões no NodeJs:

nvm ls-remote

Depois só escolher a versão que deseja instalar:

nvm install v12.13.1

Isso contorna o problema da instalação do nodejs sempre vir com a versão 8.

Atualizar node.js no ubuntu


Does the direction of a dependency connector matter in UML?

Question: I have come across several examples of dependencies e.g. include, extend however it is utterly confusing. One example dictates that include should be in the direction of;
user profile --> login

Whilst extends should be in the direction of;
validate credit card <-- print receipt.

Whereas required should in the direction of; For the life of me I don't get why this can't be an include
place order --> create account

Also does it matter how these are constructed i.e.
user profile --> login (include)

      **vs**

validate credit card (extend)
       ^
       |
       |
       |
  print receipt

Answer: I am not sure I fully understand every part of your questions, but here we go:
An include goes from the including to the included. It denotes a mandatory sub part of the use case :
including -----------> included
          <<include>>

Extend is the same than include, but the sub part is not mandatory. And unfortunately, the arrow is the other way around. Which seems to puzzle you a lot.
including <----------- optionnally included
            <<extend>>

When you speak about required, I suppose it is an anonymous dashed arrow? In fact, such a dependency can be written for anything, use case or not. It is not that usual for use cases, but it could mean that a use case has another as a prerequisite. Difference with include is that it is not a sub part. In this case, it is drawn this way.
requiring -----------> required

In your example, it seems that to place an order, you must have created an account (logical indeed). But account creation is not a sub part of order placing, so it is not an include.
As for your last question, are you talking about vertical/horizontal? If so, it does not matter in UML. In fact, there is no rule about positioning, the only rule is to remain clear.


Ajax textfield in hook_form_alter

Question: I'm attaching ajax on textfield value. One enter value in textfield and ajax callback returns form element.
Below code is showing ajax 500 error. Can anyone tell what is mistake in this code?
function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {

    $form['field_base_price']['widget'][0]['value']['#ajax'] = array(
            'event' => 'change',
            'wrapper' => 'final-price-wrapper',
            'callback' => 'final_price_ajax_callback',
            'method' => 'replace',
          );

    $form['field_final_price']['#prefix'] = '
';
        $form['field_final_price']['#suffix'] = '
';
          $form['final_price_label'] = array(
            '#weight' => 11,
            '#prefix' => '
',
            '#suffix' => '
',
          );
          $form['final_price_label']['title'] = array(
            '#type' => 'markup',
            '#markup' => '' . $form['field_final_price']['widget'][0]['value']['#title'] . '',
          );

    }

    /**
     * Final price AJAX callback.
     */
    function final_price_ajax_callback($form, $form_state) {
      return $form['final_price_label'];
    }

Comment: A 500 error can mean anything, could be a missing ";". You need a full error message, so that you know where to look.
Comment: Do you have access to the apache or nginx error log? As 4k4 mentioned, more detail is needed to provide the proper feedback.
Answer: You can use simple jQuery to achieve this then. Try putting the following code in your JS file:
$("#fname").blur(function(){
  var fname = $("#fname").val();
$("#lname").val(fname);
});

Comment: but on saving my node, this value not saved in db, we have to go with the ajax approach because jquery is client side.
Comment: You can get the data of field on the controller.php file and then assign the data to some variable. Then assign that variable to the column variable in the DB. Insert the values in the DB. Done.

Ajax textfield in hook_form_alter


Mysql string with all groups

Question: It's a bit of a non-descriptive title, but I'm not sure how to describe this in one sentence.
I've designed a MySQL database containing three tables.
Simplified, they look like this:

MenuItem
ID INT
Desc TEXT

Groups
ID INT
Desc TEXT

ItemPerGroup
ID INT
ItemID INT
GroupID INT

The ItemPerGroup table contains a list of items and the groups they belong to. An item can belong to multiple groups.
I would like a query that gives me all the MenuItems (Desc) and a string of all the groups the item belongs to (like: "Group1, Group2, Group3")
Is this possible and how to get there? Any pointers/directions are appreciated
Comment: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat
Comment: Hi Marc, Thanks, didn't know that one. Ike already explained below.
Answer: You can use the GROUP_CONCAT() function.
Something like this:
 select MenuItem.Desc, group_concat(distinct Groups.Desc)
 from ItemPerGroup
   inner join MenuItem on MenuItem.ID = ItemPerGroup.ItemID
   inner join Groups on Groups.ID = ItemPerGroup.GroupID
 group by MenuItem.Desc

Answer: Try joining all three tables, something like:
SELECT m.Id, GROUP_CONCAT(`g.Desc` separated by ',')
FROM MenuItem m INNER JOIN ItemPerGroup i
ON m.Id = i.groupId
INNER JOIN Groups i
ON m.Id = i.itemId
GROUP BY m.Id

Mysql string with all groups


Can we prove that $(2^{2^{n}}+1)+(2^{2^{n-1}}+1) -1$ have at least $n$ different prime divisors

Question: My point was to prove it using induction.
Then for $n=1$ it is true, for n = k it is also true so we assume that
$ \color{Red}{ 2^{2^{k}} + 2^{2^{k-1}} + 1}$ has at least k different prime divisors
When we consider $n=k+1$ we have:
$x^4+x^2+1$ where $x=2^{2^{k-1}}$
we also know that:
$x^4+x^2+1 = (x^2+x+1)(x^2-x+1) = \color{Red}{(2^{2^{k}} + 2^{2^{k-1}} + 1)}(2^{2^{k}}-2^{2^{k-1}}+1)$
And my question is: Is it sufficient to show that polynomial $x^2-x+1$ is not divisible by $x^2+x+1$ so $(2^{2^{k}}-2^{2^{k-1}}+1)$ gives us at least one more prime number which implies that this statement is true for all natural numbers?
Comment: show $2^{2^k}+2^{2^{k-1}}+1$ and $2^{2^k}-2^{2^{k-1}}+1$ are coprime
Comment: If common factor $d>1$ divides both of them, then it must divide their difference $(2^{2^k}+2^{2^{k-1}}+1)-(2^{2^k}-2^{2^{k-1}}+1)=2\cdot2^{2^{k-1}}$, can you prove it with this?
Comment: God sorry I missed something in title
Comment: I tried to prove it but I failed. But I know that two different Fermat's numbers are coprime so perhaps I can start with this fact.
Comment: Yeah I think so
Answer: Assuming $2^{2^k}+2^{2^{k-1}}+1$ has at least $k$ different prime divisors,
for the inductive step it suffices to show that $2^{2^k}-2^{2^{k-1}}+1$ has a different prime factor.
Well, if $p$ divides $2^{2^k}+2^{2^{k-1}}+1$ and $2^{2^k}-2^{2^{k-1}}+1$, then $p$ divides their difference, which is a power of $2$,
so $p$ is a power of $2$, but $2^{2^k}+2^{2^{k-1}}+1$ and $2^{2^k}-2^{2^{k-1}}+1$ are not powers of $2$, so $p=1$.
Since $2^{2^k}-2^{2^{k-1}}+1>1$ for $k\gt 0$, it follows that $2^{2^k}-2^{2^{k-1}}+1$ has different prime factor(s)
from those of $2^{2^k}+2^{2^{k-1}}+1$, so the inductive step works.


What key information should be included in an academic paper that uses machine learning?

Question: Imagine you are reviewing a manuscript that describes application of a supervised machine learning algorithm (e.g. SVM, CART, logistic regression, random forest etc.) to predict a binary output.  Perhaps they've even applied all of them to the same problem.
What would be the optimal information that should be included in a report using classification algorithms?
Essentially, I'm asking this question (Reporting results of simple linear regression: what information to include?), but for classification algorithms.
This is what I've devised so far:

Information about the data (n, sample, source, rates of each event class, # of predictors)
If/how it was split into training and test (60/40, crossvalidation)
Performance of the algorithm at classification (OOB, error rate, accuracy, efficiency, ROC AUC, TP/FP)
Variable importance/significance (Gini, p-values, OR)
Overfitting/lack of fit parameters (AIC, residuals, plots of fit, QQ plots)

While ignorant, I anticipate the answer will depend on the algorithm used, so please feel free to break it down by method (or tell me that this can't/shouldn't be generalized and why).
Comment: It would depend on the practical use (skewed data? FP/FN costs? selectivity/sensitivity? inference? exploratory?). The choices of performance measures should arguable reflect that. I guess many of the mentioned measures could be a part of such selection. (personally would not use Gini and p-values).   If more methods are to be compared, then models should be wrapped in the same outer cross validation such as 20-rep 10-fold CV or similar.
Comment: Would it be useful if I provided a detailed hypothetical example to establish a framework for key information?  Not trying to make work, but provide a starting point for neophytes.
Comment: Yes that would help. Here's some suggentions on what to include: http://meta.stats.stackexchange.com/questions/1479/how-to-ask-a-good-question-on-crossvalidated
Comment: It needs to be reproducible, so there needs to be enough information to derive the same result from the data from the description given in the paper (the hyper-parameter tuning is the bit that many leave out, but unfortunately is crucial)
Answer: I'll start off your list and both comment on it and add something.

Information about the data (n, sample, source, rates of each event class, # of predictors)

Possible biases in sampling the data, e.g., Most people are not WEIRD
Descriptive plots for predictors: marginal and pairwise distributions, histogram/beanplots and scatterplots

If/how it was split into training and test (60/40, crossvalidation)

If cross-validation: was this run once or multiple times?

Model selection and training

What models were available, and how were they selected (or combined, for ensemble methods)?
How were they trained?

Performance of the algorithm at classification (OOB, error rate, accuracy, efficiency, ROC AUC, TP/FP)

Accuracy, error rate, precision, TPR, FPR etc. are not good quality measures. Better to use scoring-rules instead. Of course, these should be assessed out-of-sample.
Always compare your new model to a simple benchmark
Compare your results to published results of other methods, not to your own reimplementation. "My results are better than the M5 competition winner's" is more informative than "my results are better than when I reimplemented (what I believe to be) the method of the M5 competition winner" (Bergmeir, 2023) - but be aware that since you have access to the test data, your hurdle was lower than in the original competition.

Variable importance/significance (Gini, p-values, OR)

Variable importance is important. Time spent reading up on variable importance measures is time well spent
p-values do not measure variable importance
For ORs, you first need to discretize continuous predictors, which is not a good idea

Overfitting/lack of fit parameters (AIC, residuals, plots of fit, QQ plots)

Overfitting is important. Best to report OOB scoring rules
Many ML algorithms have no notion of AIC or other information criteria, because they don't have an underlying statistical model, or the model is almost unknown to ML researchers. Plus, ICs are not always comparable between different models
Residuals and q-q plots make more sense in numerical prediction than in classification
Comment: I would add that one should report what software (what programming language, what library, what package) was use to fit the model.
Comment: +1 (especially model selection bit) I disagree about accuracy.  In some applications, it **is** the quantity of interest in the practical application (e.g. https://stats.stackexchange.com/questions/312780/why-is-accuracy-not-the-best-measure-for-assessing-classification-models/538524#538524), and where that is the case it needs to be included in the performance evaluation.  Accuracy is probably not going to be a good model selection criterion and proper scoring rules are better there, but it is important to bear in mind that model selection and performance evaluation are not the same thing.
Comment: I would include how any hyper-parameters were tuned in the model selection and training bit.  ML is particularly bad about that, especially as the hyper-parameters are very important for many ML methods.
Comment: Also ML has alternatives to AIC, such as VC dimension, bounds on generalisation performance, MDL etc.  ML tends to be more in favour of out-of-sample evaluation.  I am not altogether sure why statisticians would prefer AIC to thorough out of sample evaluation, at least in applications with sufficient data available.


Qual a extensão do VisualG para o GitHub?

Question: Tenho uns códigos meus antigos em VisualG e gostaria de publicar no GitHub, alguém sabe a extensão do VisualG que o GitHub reconhece?
Comment: Provavelmente nenhuma.
Answer: O GitHub não reconhece os códigos do VisualG.
Quando alguém opta por colocar códigos do VisualG no GitHub essas pessoas normalmente o disponibiliza em formato txt.
Answer: O VisualG salva os seus scripts com a extensão .por que acho que também é usada pelo Portugol Studio, porém, mesmo se você enviar seus arquivos com esta extensão, creio que ela não será reconhecida pelo GitHub pois de fato não é uma linguagem.
Veja => Pseudocódigo


How to delete the item from the list

Question: Im creating an app using ionic and angularjs. In the app developing I have used swipe option from the ionic to delete the specific coupon from the main-list. The problem I problem face here is, Im only able to delete the description of the selected coupon, but not able to delete/remove the coupon from the main-list. Also I have use $rootScope where I have declared my json array. I have declare a $scope.item into which the selected coupon and its details are being pushed, in-order to display the description of each selected coupons. I'm going wrong somewhere in the code please help me to get it right. Thank you.
HTML:
<ion-list>
        <ion-item ng-click="select_item(coupons)" ng-repeat="coupons in couponList" ng-model="coupons.selected">
            {{coupons.CouponTitle}}

            <ion-option-button ng-click="editCoupons(coupons)">Edit</ion-option-button>
            <ion-option-button class="button-assertive" ng-click="deleteSelected(coupons)">Delete</ion-option-button>
        </ion-item>
    </ion-list>

            Coupon offer: {{item.data.description}}
 Valid From: {{item.data.Fromldate}}

 Valid Till: {{item.data.Todate}}

Controller:
$scope.items = [];
      $rootScope.couponList = [{ CouponTitle: "Purchase worth $100", data: {description: "$50 off", Fromldate: "2016-09-09", Todate: "2016-09-18"}},
      {CouponTitle: "Purchase worth $300",  data:{description: "$75 off", Fromldate: "2016-11-09", Todate: "2016-10-19"}},
      { CouponTitle: "Purchase worth $500",data:{description: "$95 off", Fromldate: "2016-09-10", Todate: "2016-09-30"}}];

      $scope.select_item = function (key) {
        $scope.items.push(key);

      }

 $scope.deleteSelected = function () {
           $scope.items.splice($scope.items.indexOf());
    }

Answer: As suggested in one answer you can use the $index mechanism to remove an object from an array.
You have to delete both from items array and rootscope array
View:
<ion-option-button class="button-assertive" ng-click="deleteSelected($index,coupons)">Delete</ion-option-button>

Controller:
 $scope.deleteSelected = function (index,coupons) {
     $rootScope.couponList.splice(index,1);

     var to_delete = $scope.items.find(find_data)

     function find_data(items) {
        return items.CouponTitle === coupons.CouponTitle;
     }

     var index = $scope.items.indexOf(to_delete);

     $scope.items.splice(index,1)

 }

HEre is a partial implemented fiddle
You should delete both the items array and also, couponList to remove in ng-repeat
Comment: @jazzoria, please check my answer.
Comment: Can you explain me how to use `ng-repeat` for this. Please
Comment: it is the same as you taken, check the fiddle link,
``
Comment: and I also tried the controller you have defined here. I was only able to delete the coupons from list but not the displayed details i.e anyone of the splice action is working but not both together.
Comment: can you create a fiddle for this?
Comment: I understood your issue, updating the answer.
Comment: you save my day.  Thank you so much.
Answer: pass index inside deleteSelected as a parameter, and delete from array directly.
<ion-option-button class="button-assertive" ng-click="deleteSelected($index)">Delete</ion-option-button>

But for $index you will have to use track by $index mechanism of ng-repeat.
Let me know if you want more clerification.
Comment: I used $index but was able to delete only the description but not the coupon from main list. @Jigar7521

How to delete the item from the list


Regex - get string after full date and before standard text

Question: I'm stuck on another regex. I'm extracting email data. In the below example, only the time, date and message in quotes changes.
Message Received 6:06pm 21st February "Hello. My name is John Smith" Some standard text.
Message Received 8:08pm 22nd February "Hello. My name is "John Smith"" Some standard text.

How can I get the message only if I need to start with the positive lookbehind, (?<=Message Received ) to begin searching at this particular point of the data? The message will always start and end with quotes but the user is able to insert their own quotes as in the second example.
Comment: Do you want to extract data written in double quotes?
Answer: For extracting message in between double quotes.
(?=Message Received)[^\"]+\K\"[\w\s\"\.]+\"
Regex demo
Answer: You capture the message in a group
(?<=Message Received)[^"]*(.*)(?=\s+Some standard text)

Answer: You can just use a negated charcter class in a capturing group:
/Message Received.*?"([^\n]+)"/

Snippet:
$input = 'Message Received 6:06pm 21st February "Hello. My name is John Smith" Some standard text.
Message Received 8:08pm 22nd February "Hello. My name is "John Smith"" Some standard text.}';

preg_match_all('/Message Received.*?"([^\n]+)"/', $input, $matches);

foreach ($matches[1] as $match) {
    echo $match . "\r\n";
}

Output:
> Hello. My name is John Smith
> Hello. My name is "John Smith"

Answer: Two out of the other three posted answers on this page provide an incorrect result.  None of the other posted answers are as efficient as they could be:
To correctly extract the substring between the outer double quotes, use one of the following patterns:
/Message Received[^"]+"\K[^\n]+(?=")/ (No capture group, takes 132 steps, Demo)
/Message Received[^"]+"([^\n]+)"/ (Capture group, takes 130 steps, Demo)
Both patterns provide maximum accuracy and efficiency using negated character classes leading up to and including the targeted substring.  The first pattern reduces preg_match_all()'s output array bloat by 50% by using \K instead of a capture group.  For these reasons, one of these patterns should be used in your project.  As your input string increases in size, my patterns provide increasingly better performance versus the other posted patterns.
PHP Implementation:
$in represents your input string.
Pattern #1 Method:
var_export(preg_match_all('/Message Received[^"]+"\K[^\n]+(?=")/',$in,$out)?$out[0]:[]);
// notice the output array only has elements in the fullstring subarray [0]

Output:
array (
  0 => 'Hello. My name is John Smith',
  1 => 'Hello. My name is "John Smith"',
)

Pattern #2 Method:
var_export(preg_match_all('/Message Received[^"]+"([^\n]+)"/',$in,$out)?$out[1]:[]);
// notice because a capture group is used, [0] subarray is ignored, [1] is used

Output:
array (
  0 => 'Hello. My name is John Smith',
  1 => 'Hello. My name is "John Smith"',
)

Both methods provide the desired output.

Anirudha's incorrect pattern: /(?<=Message Received)[^"]*(.*)(?=\s+Some standard text)/ (345 steps + a capture group + includes the unwanted outer double quotes)
Josh Crozier's pattern: /Message Received.*?"([^\n]+)"/ (174 steps + a capture group)
Sahil Gulati's incorrect pattern: /(?=Message Received)[^\"]+\K\"[\w\s\"\.]+\"/ (109 steps + includes the unwanted outer double quotes + unnecessarily escapes characters in the pattern)


Gaussian curvature from isometric embedding

Question: Let $M$ be a two-dimensional Riemannian manifold, and assume that $M$ can be realized as a surface $S$ in $\mathbb{R}^{3}$.
I know that one can compute the Gaussian curvature $K$ of $M$ as the determinant of the shape operator of $S$.
Question: What if you are given an isometric embedding of $M$ into some Riemannian three-manifold $N \neq \mathbb{R}^{3}$? Can you still compute $K$ as in the classical case?
Comment: To supplement the existing answers, it's easy to see the product of the principal curvatures is not generally the Gaussian curvature: If $S$ is a great sphere (or "equator") in a round $3$-sphere, itself sitting in Euclidean $4$-space, a continuous unit normal field is constant, so the shape operator of $S$ in $S^{3}$ vanishes identically.
Answer: You'll have a correction term given by the sectional curvature of the ambient $N$ itself. If $(v,w)$ is an orthonormal basis for the tangent plane of $M$ at some point $p$, then: $$K_M(v,w)= K_N(v,w) + \langle \alpha(v,v),\alpha(w,w)\rangle - \langle \alpha(v,w),\alpha(v,w)\rangle, $$where $\alpha$ is the second fundamental form of $M$ in $N$. This is true for all dimensions and codimensions.
In the present case we simplify it: since $M$ has dimension $2$, you can write $K_M(p)$ for the Gaussian Curvature, and if $\nu$ is an unit normal field, and $X$ is a parametrization, you can write $\alpha(X_i,X_j)=h_{ij}\nu$ for $1\leq i,j\leq 2$, apply Gram-Schmidt to $\{X_1,X_2\}$ and plug all in the Gauss Formula above. For $\Bbb R^3$, $K_N =0$ so you'll get the usual formula.
Answer: Denote by $\mathbb{M}^3(c)$ a simply-connected Riemannian $3$-space with constant sectional curvature $c=-1,0,1$. That is, $\mathbb{M}^3(c)$ denotes the hyperbolic space $\mathbb{H}^3$ if $c=-1$, the Euclidean space $\mathbb{R}^3$ when $c=0$, or the sphere $\mathbb{S}^3$ if $c=1$.
Now,  consider an  oriented Riemannian surface $\Sigma$ with induced metric $I=\langle,\rangle$ and $f:\Sigma\to\mathbb{M}^3(c)$ an isometric immersion. Let
$N$ be a unit normal along $\Sigma$ which is compatible with the orientation, and
$II$ its associated second fundamental form. That is, $II(X,Y)=\langle-\nabla_X N,Y\rangle$, where $X,Y$ are smooth vector fields in $\Sigma$ and $\nabla$ the Levi-Civita connection of the ambient space.
If $k_1$, $k_2$ are the principal curvatures of the immersion, namely, the eigenvalues of the shape operator $S$, given by $SX=-\nabla_X N$, then we shall denote by
$$K=k_1k_2,\quad H={1\over 2}(k_1+k_2)$$
the extrinsic curvature and the mean curvature of the immersion, respectively. These two quantities are extrinsic and depend on how $S$ is immersed into $\mathbb{M}^3(c)$.
On the other hand, we denote by $K(I)$ the curvature of the metric $I$, namely, the Gauss curvature, which is an intrinsic quantity. For the previous immersion
$f:\Sigma\to\mathbb{M}^3(c)$ the following relations must be satisfied
$$K(I)=K+c,\quad\text{(Gauss equation)}$$
$$\nabla_X SY-\nabla_Y SX-S[X,Y] = 0,\quad\text{(Mainardi-Codazzi equation)},$$
where $\nabla$ is the Levi-Civita connection of the metric $I$.
You can see with these examples, the space forms, that the Gauss curvature is the product of the eigenvalues of the shape operator when your ambient space is $\mathbb{R}^3$, but there is a term (the sectional curvature $c$) that modifies it in general.


How can I make a module's configuration exportable by features?

Question: At a high level, what needs to be undertaken to take a module's configuration data and make it exportable by Features?
Whether this is a contrib module that does not yet have Features support or a custom module that I have written, where can I start so that I can get it in code?
Comment: Too trivial: answered by looking at the readme files for the Features module.
Comment: People just saying "RTFM" is the reason sites like StackOverflow were created in the first place.
Comment: Have to say I disagree. For one, the concept of features and exportability is not a novice issue. Secondly, if for questions like these we are just going to say, "refer to the readme", then this site will add no value over what can be found on drupal.org.
Comment: If referring to the readme is all it takes to answer a question, that speaks more about the quality of the question than the quality of the answer.
Answer: Instructions are in the Features API.txt, which provides several examples of how to better integrate your module with Features.
The easiest way seems to be building your module around the CTools Export API. Here's a pretty good article explaining how to do that.
Answer: If your module is already taking advantage of the Entity API:

specify EntityAPIControllerExportable as the controller class, set the exportable key in hook_entity_info() to TRUE and include the schema fields necessary (module, status column) by copying the schema as defined in entity_exportable_schema_fields() to your hook_schema() implementation

See the Community Docs: Make an entity type exportable
Comment: looks working .


Can math be subjective?

Question: Often times in math, ever since Kindergarten and before, math has been defined by the fact that there are only one answer for problems. For example: $1+1=2$ and $\frac{d}{dx}x^2=2x$. What I am showing by these two examples are two questions that are from completely different areas of math. However, they both have have only one solution. Problems with multiple answers doesn't necessarily mean they are subjective though, such as $|x|=2,$ which has two solutions. My question is that are any such problems that depend entirely on perspective? If all subjective math problems follow a certain pattern, please tell me what that pattern is. I really have no idea of any examples of this and I would really be interested to see one. Thank you very much.
Comment: At the very least, math is contextual, meaning there is often more than one answer to a problem depending on context. For example, what is $22+5$? Without a context we would assume what you might call a "default context" of Real numbers or Integers and say $22+5=27$. But in the context of hours of 24-hour time, we would decide that $22+5=3$  (five hours after 2200 is 0300) without giving it a second thought.
Comment: I don't know about subjective, but sometimes it is clearly surjective... (Sorry for the pun)...
Comment: This is really a question for the philosophy SE. As a philosophy student, I wrote a paper (admittedly just an undergrad paper, but I'm working towards having it published) in which I argue mathematics is *analytic a priori,* which would imply objectivity (otherwise it couldn't be analytic). I can send you this paper if you like.
Comment: @Rich: The teacher was correct.
Comment: @AsafKaragila, for a seventh-grader to conclude that $1/0$ is "infinity" is completely reasonable-sensible, I think, even if there do remain issues, as there certainly do.
Comment: @Todd: Yes, but the equation $22+5=27$ holds in *any* ring (including $\mathbb{Z}$ and $\mathbb{Z}/24\mathbb{Z}$), whereas $22+5=3$ holds only in rings such that $24=0$. By the way, in the countries with a.m./p.m. times, we should use the ring $\mathbb{Z}/12\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}$ instead.
Comment: Mathematics and perception psychology. If I show you an image and I show a child the same image, you will or will not think of the same mathematical concept.
Comment: @Thomas, it is an interesting question, but the underlying "what is mathematics?" corrupts it, in that answers and arguments are (at least) relative to _that_. Is mathematics the "residue" of formal narrative left after professional mathematicians work? Does it exist (etc) independently of people? And so on. Too crazy. As you may suspect, I tend to think that mathematics is _not_ just the narrative, but is something people _do_, and the formalization(s) is/are attempts to depersonalize it, make it something objective/external... which succeeds to a degree, sometimes, temporarily... :)
Comment: This is a very intriguing question. I can't help but think of controversy over automated proofing in mathematics... is that subjective?
Comment: In 7th grade I answered infinite to the test question 1/0. The teacher marked it wrong.
Comment: @paulgarrett: I would like to read your response to the question about subjectivity in mathematics.
Comment: @MartinBrandenburg Why look at it as a ring when a group will do just fine?
Comment: @ToddWilcox: We need a distinguished element $1$. And I've never seen this notation for elements in *abstract* abelian groups.
Comment: Sometimes people think of something as being the "right" definition of some concept, despite the fact that definitions can't be right or wrong. The epsilon-delta definition of continuity is seen as the "right" definition, the open-cover definition of compactness is seen as the "right" definition, etc., despite the fact that it's not obvious how anyone would have come up with either definition.
Comment: @user253532 In computer programming--specially floating point numbers--1 divided by zero does yield infinity. See the last example on this mdn page about the JavaScript floating point constant `Infinity` at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity#Examples. Perhaps your math teacher has not realized that 7th grade is not time for Calculus, where infinity and undefined can be distinguished via one sided limits towards zero producing infinity and ordinary division by zero producing undefined.
Answer: There's plenty of room for subjective opinion in mathematics. It usually doesn't concern questions of the form Is this true? since we have a good consensus how to recognize an acceptable proof and which assumptions for such a proof you need to state explicitly.
As soon as we move onwards to Is this useful? and Is this interesting?, or even Is this likely to work?, subjectivity hits us in full force. Even in pure mathematics, it's easy to choose a set of axioms and derive consequences from them, but if you want anyone to spend time reading your work, you need to tackle the subjective questions and have an explanation why what you're doing is either useful or interesting, or preferably both.
In applied math, these questions are accompanied by Is this the best way to model such-and-such real-world problem? -- where "best" again comes down to usefulness (does the model answer questions we need to have answered?) and interest (does the model give us any insight about the situation we wouldn't have without it?).
The subjective questions are important in research, but can also arise at more elementary level. The high-school teacher who chooses to devote several lessons to presenting Cardano's method for solving the generic third-degree equation will certainly have to answer his students' questions why this is useful or interesting. Perhaps he has an answer. Perhaps he has an answer that the students don't agree with. In that case, he cannot look for a deductive argument concluding that Cardano's formula is interesting -- he'll have to appeal to emotions, curiosity, all of those fluffy touchy-feely considerations that we need to use to tackle subjective questions.
Comment: I wish more teachers would take your answer into account when teaching.
Comment: I would agree, and point out that it follows all of science and engineering and thereby all subjects that are studied seriously. Since there is subjectivity, there are different interpretations, which leads to intra-subject politics. In fact, it always surprises me when people claim Math is objective, because from what admittedly very little I've seen, it's subject to as much debate and disagreement as any other subject.
Answer: Every single statement, question, and claim in mathematics is subjective because they are always based on a set of axioms, which are arbitrary, and are picked to observe their consequences.
However, once you phrase the claim in the form of an implication, (such as: "if [the axioms of Euclidean geometry], then [the Pythagorean theorem]") then you have an objective truth. This is assumed to be the meaning when any mathematician states a theorem - we understand what axiomatic framework they are working in and understand that their claim is contingent on those axioms.
Given a particular axiom system, three of the possible results for a mathematical claim are:
We prove the claim true. [Ex: The Pythagorean theorem]
We prove the claim false. [Ex: "The integers under multiplication form a group"]
We prove that the claim is independent of our axiomatic system. [Ex: the continuum hypothesis].
(see Mario Carneiro's comment for other possibilities).
There are no claims that can be subjective if we take for granted that we are working in an axiomatic system. Some people might argue that the continuum hypothesis is "subjective" under ZFC, but I prefer to think of it as simply having no truth value.
Comment: The word "arbitrary" I think, is inappropriate. We rarely ever just pick an arbitrary set of axioms. Quote: ... based on random choice or personal whim, rather than any reason or system. "his mealtimes were entirely arbitrary" synonyms: capricious, whimsical, random, chance, unpredictable; More antonyms: reasoned, rational
Comment: @Tobia: That's a bunch of bullocks. There's absolutely nothing shady in the axiom of choice, or else people would have noticed it right away. The fact that there are strange consequences of both the axiom of choice and its failure is because infinite sets are weird, and they don't agree with our physical, finite, intuition. Calling it shady suits very well to a physics student who understands very little of mathematics. Just saying.
Comment: I'm surprised that no one has pointed out that the "three categories" division of mathematical facts as provable, refutable, or provably independent is false. If I write these cases as $T\vdash\phi$, $T\vdash\lnot\phi$, $T\vdash{\rm Ind}(\phi)$ (where ${\rm Ind}(\phi)=(T\nvdash\phi\land T\nvdash\lnot\phi)$), it should be clear that there are also the options $T\vdash T\nvdash{\rm Ind}(\phi)$ ($\phi$ is provably unprovably independent), $T\vdash T\nvdash T\nvdash{\rm Ind}(\phi)$ ($\phi$ is provably unprovably unprovably independent), and so on a countable infinity times...
Comment: Since ZFC is a system of axioms (and implicitly assumed standard FOL), it has no "truth value" in any case. Truth value comes when you look at models of ZFC. In a given, specific, model of ZFC the continuum hypothesis has a truth value. Simply because in a given structure, a given statement has an assigned truth value. What you probably want to say, is that only know that $M$ is a model of ZFC does not provide us with enough information to determine if CH is true in $M$. If you are a Platonist, though, and you believe ZFC is true, then subjectivity enters the game in the form of beliefs.
Comment: My point is that subjectivity can only exist if we pretend that we don't know what axiom system the statement is referring to. We usually do, so we don't bring up the axioms of Euclidean geometry as an antecedent each time we state the Pythagorean theorem.
Comment: ...plus one more category $T\nvdash{\rm Ind}(\phi)\land T\nvdash T\nvdash{\rm Ind}(\phi)\land\dots$, which basically says "$T$ proves nothing whatsoever about $\phi$'s truth status" and is not expressible in $T$ (but may be observed from a metatheory stronger than $T$).
Comment: Pedantry: the continuum hypothesis would not be "subjective" under ZFC. (But I guess that was just a typo.)
Comment: @AsafKaragila Of course ZFC itself has no "truth value". In what way do you think I suggested that?
Comment: Jonathan, you wrote in your answer "*Some people might argue that the continuum hypothesis is "subjective" under ZFC, but I prefer to think of it as simply having no truth value.*" which reads, to me, as saying that while CH cannot be assigned  a truth value in ZFC, the notion of assigning such value is meaningful.
Comment: No, I don't think that assigning a value to this is meaningful, that statement is a statement against those who think it is, it has no truth value. I think that if statement A, statement B, and statement C are true in ZFC, false in ZFC, and independent from ZFC respectively, then the statements "if ZFC, then A", "if ZFC, then B", "if ZFC, then C" are either vacuously true or respectively, an objective truth, and objective falsehood, and no truth value - not a preferred one, or anything of the sort.
Comment: I would like to add, as an example, that the C in ZFC is considerably controversial. The ZF axiom system is equivocal and ill-defined enough, so it's no surprise that it leads to many paradoxes. But the Axiom of Choice is an exceptionally shady and worrisome item to include in something that is then fed to students as the "foundations" of modern Mathematics. Just saying.
Comment: That's interesting Mario, I will try to edit the answer to correct for that.
Comment: @AsafKaragila I agree that "shady" is an overstatement, but perhaps Tobia is thinking of [constructivism](https://plato.stanford.edu/entries/mathematics-constructive/#AxioChoi), which does reject some versions of the axiom as nonconstructive.
Comment: @senderle: There is no "one flavour of constructivism", and in some of them the axiom of choice is in fact a theorem. Because to prove a set is non-empty is to point at an element, and if we have a family of sets which are non-empty, that means we can uniformly point at an element of each one, and that is exactly a choice function. But of course, this is but just one flavour of constructivism.
Comment: @AsafKaragila there is no one flavor of constructivism, but as far as I'm aware, the unifying precept of all flavors is that they reject the law of the excluded middle. In some contexts, some versions of the axiom of choice imply the law of the excluded middle, and would therefore be rejected by the overwhelming majority of self-identified constructivists. (You can see the linked source for details.) I'd be happy to learn that I'm mistaken on some detail, but I don't think this point deserves to be hand-waved.
Answer: There are a few more points of subjectivity that are related to, but slightgly different from the sometimes subjective choice of axiom system: I am talking about definitions of some standard objects. For example, people may have different "opinions" whether or not $0\in\mathbb N$. Or whether they accept an answer to a question asking for an explicit solution only if it is elementary (a combinations of polynomials, trigonmetrics, esponential, logarithm) or if they would also accept something involving the Lambert $W$ function or the error function ...
And then there are things that are just personal preferences for different notation (or cultural preerences - I personally have great difficulties reading something as simple as a long division if it is written the "American way" that looks to me rather like a $\sqrt .$)
Comment: How do you do long division where you're from?
Comment: like [this](https://de.wikipedia.org/wiki/Schriftliche_Division#/media/File:Division_Schriftlich.jpg), not like [this](https://en.wikipedia.org/wiki/Long_division#/media/File:Long_division.JPG). Of course the method is the same, but I really have difficulties "to adapt my eyes"
Answer: It depends on what you mean.
First: You give the equation $\lvert x \rvert = 2$ as an example of an equation/problem with two solutions. In a sense you could say that the problem only has one solution in that the solution set is $\{-2, 2\}$.
The point of saying that a problem only has one solution/answer is that you can't have two answers that contradict each other. If you, for example, ask if a given equation has a solution, then the answer is only yes or no. It can't be both yes and no.
There are, of course, questions that mathematicians are interested in that will have several answers. You could ask how you best mathematically describe something using an equation. Here the key work is "best". It is, to some extent, subjective what is best.
So in general you will not have answers that depend on something subjective in (pure) mathematics.
Now, you can drive the question about subjectivity and different answers to a philosophical one. Mathematics is (can be) built on a set of axioms (say of set theory) and the rules of logic. Some will argue that mathematics is just a game of how to use the rules of logic given the set of axioms. But then questions arise about how to best pick the axioms and questions about exactly what rules of logic we should allow. These discussions are interesting to some mathematicians and some will say that this is inherent to the nature of mathematics. And in these discussions answers will have a level of subjectivity to them. Much more can be said about this, but when we fix a system of axioms and a set of rules, then we avoid these discussions (I might be oversimplifying things).
Another way that subjectivity can arise in mathematics is when the discussions turn to what areas deserve the most attention. If an institution is hiring a new faculty, then the existing faculty will have discussions about the directions of the department. Here arguments can be made for the different areas and the discussions can turn political.
Note, some might say that $1+1 = 2$ is subjective because we have $1+1 =0$ when we do modular arithmetic (mod $2$). But understand that the elements $1$ are completely different in the two situations. We are taking about two different sets of "numbers" and so there isn't any subjectivity here.
Comment: I think a slightly better example than solving x in your absolute value example is square root. Everyone "knows" the square root of 4 is 2. Why isn't it -2? Convention. (A useful one, to be sure.) Of course, depending on the context, you might instead report it as ±2.
Comment: This is rare enough outside philosophy that I would bet most mathematicians have never heard of it, but there are logical systems where the answer to something can be both yes and no. The system is neutered in such a way that this doesn't result in the principle of explosion.
Comment: @MattSamuel: There's very extensive, very well-researched and pretty well-understood theory of provability, and determinability. If you talk to mathematicians that dealt with logic, they'd most likely have heard of systems where *yes-and-no* is a valid state.
Answer: There are some notions which have no common accepted definition or actually many competitive definitions which do not agree. Some examples are:

mixed motives
the "field" with one element
$n$-categories

Perhaps, one day, mathematicians will agree in each of these cases which is the correct definition, but of course this is kind of subjective (what makes a definition correct?). In any case, the mathematics done with each of these notions is objectively true.
Comment: No, please read carefully. Mathematicians have a notion in mind, as if it existed outside the universe, based on long mathematical experience, and want to define it "correctly". This kind of "correctness" is subjective, since it cannot be tested objectively.
Comment: So you are saying that the fact the people disagree about how to define a term is an example of subjectivity?
Comment: Then I don't understand your answer. Can you elaborate?
Comment: @Thomas: The subjective question is "which of these possible definitions produces the theory that is most useful / most interesting / easiest to work with / best at generating new insights?" The arguments on favor of different answers are ultimately subjective, but that doesn't prevent them from being, at their core, _mathematics_.
Comment: @HenningMakholm: This is what your answer says, but I mean something different. The "correctness" does not primarily depend on usefulness, but rather by the "nature" of a notion which mathematics with long experience "feel", even without looking at examples (because they focus too much). As we all know, Grothendieck understood this better than anyone else, and his work has also shown that following this kind of feeling produces useful theories.
Comment: As far as I know, in the case of  Grothendieck with experience came the  appreciation of the usefulness of examples.
Answer: Some people does not aggree with usage of Axiom of choice in proofs* https://en.wikipedia.org/wiki/Axiom_of_choice
https://mathoverflow.net/questions/22927/why-worry-about-the-axiom-of-choice
There is Constructivism (* for example this ones ) which does not accept proofs by contradiction as a proof of existence
 https://en.wikipedia.org/wiki/Constructivism_(mathematics)
Gödel's incompleteness theorems are two theorems of mathematical logic that establish inherent limitations of all but the most trivial axiomatic systems capable of doing arithmetic. The theorems, proven by Kurt Gödel in 1931, are important both in mathematical logic and in the philosophy of mathematics. The two results are widely, but not universally, interpreted as showing that Hilbert's program to find a complete and consistent set of axioms for all mathematics is impossible, giving a negative answer to Hilbert's second problem.
The first incompleteness theorem states that no consistent system of axioms whose theorems can be listed by an "effective procedure" (e.g., a computer program, but it could be any sort of algorithm) is capable of proving all truths about the relations of the natural numbers (arithmetic). For any such system, there will always be statements about the natural numbers that are true, but that are unprovable within the system. The second incompleteness theorem, an extension of the first, shows that such a system cannot demonstrate its own consistency. https://en.wikipedia.org/wiki/G%C3%B6del%27s_incompleteness_theorems
Consequences, within the meaning of subjectivity is left to the reader ;)
Answer:
Are there problems whose solutions are subjective?

It depends on how far you are willing to stretch the word "subjective." An idea may have two essentially different meanings to two different mathematicians. To one mathematician, the fundamental theorem of algebra might mean the field of complex numbers is algebraically closed. To another, it might mean that every complex $n\times n$ matrix has a complex eigenvalue. Both meanings are equivalent, but they are not "the same," in a very restrictive sense, so one might convey this as subjective.
Otherwise? Not really. I think, however, that there is a larger question to be answered here.

Is mathematics subjective?

No...but yes.
As far as "the facts," as you call them, are concerned, once we agree on definitions and axioms, things are pretty much set in stone. The theorems are either right or wrong (or unprovable), and there isn't any wiggle room.
Here's something that most laypeople, and even a good handful of mathematicians, don't get: mathematics is not just "the facts." The myth that mathematics is solely about the theorems is as wrong as it is dangerous; it scares away many people that only know mathematics by the bland material fed to them in high school and discourages mathematicians who decide that their value is based solely on what Thurston called "theorem-credits."
While on the topic of theorem-credits, I think many, if not most, questions of the form "Is mathematics [blah-dee-dah-dee-dah]?" can be resolved by reading On proof and progress in mathematics. In fact, if you haven't read it, then you probably should.
Mathematics, or at least the mathematics that I do, is about thinking and sharing ideas with other mathematicians. This is where subjectivity creeps in. Typical questions of a mathematician, amidst the deep mathematical thoughts, are

"Does this look presentable?"
"Is this notation clear?"
"Is this worth further study?"
"Does mathematics honestly need another use for the word 'normal'?"

These are about as subjective as questions can get.
Answer: Mathematics is not subjective because it is perceived differently by different mathematicians. That's a misuse of the word subjective.
I think mathematics is the most objective thing we have. If that's true, then if the word objective means anything, we can simply say that mathematics is objective, without qualification.
I want to bring up two related questions in the mathematics realm. The first is why mathematics so often relates directly to fundamental properties of the natural world. This happens so often it's spooky - someone goes off and researches an obscure mathematical problem, and the answer turns out to predict the curve of a NDA molecule's spirals or something like that.
The second is whether all reality is socially constructed. I say no, that mathematics and much of science are entirely or mostly objective. Usefulness, implementation, interest, our readiness to take a given piece of work further - those are much more socially constructed. (But influenced by objective qualities of the work.) The fact that the results are perceived differently for reasons that are significantly socially constructed does not make them inherently subjective or socially constructed.
Sorry for not reading/taking into account all the other comments, I have to get back to work...
Answer: I would argue that the number of solutions does not influence the subjectivity of mathematics. Rather that mathematics is an inherently subjective art in the sense that it is perceived differently by different mathematicians. However, what I think is the true beauty of it, is that we all (most of us) operate under the same vast framework, where even with differing perspectives, all our results are consistent with one another.
In comparison with other fields such as psychology or economics, the results obtained in those fields can be disputed, many economists hold different viewpoints and the results obtained are not consistent for the most part. This is something that does not occur (or if it does, occurs infrequently) in the field of Mathematics.
For example, you said that $1 + 1 = 2$ has only one solution, yet in certain field of mathematics you will often see $1 + 1 \equiv 0 \pmod{2}$. Yet this does not mean that it is not consistent with $1+1 =2$, Mathematics just works under incredibly precise foundations.
My point is, I think you need to reconsider your definition of subjectivity in mathematics.
Comment: I don't think this implies subjectivity. You have simply masked the problem by changing the context. Surely when working mod 2, it is still an objective fact that $ 1+1 \equiv 0$, since it is an analytic fact (it is based on the definition of "mod 2." What you've shown is that the beauty of mathematics entails a certain personal subjectivity. But the content itself does not. On the other hand, which axioms are reasonable and intuitive is a subjective matter.
Comment: Oh, I agree. I was simply trying to point out to the OP that his/her definition of subjectivity wasn't totally logical.
Comment: @ZainPatel But what is OP's definition of subjectivity? He/she explicitly stated that having two solutions does not make it subjective.
Answer: One important subjective question is when exactly an argument is sufficiently rigorous. I'm very fond of reminding people that rigor is a continuum, not a binary property.
Take the Pythagorean theorem. Is this proof by rearrangement a rigorous proof? I would say yes, in the sense that I would consider it very pedantic of someone not to find it convincing. For all practical purposes, once you've seen that image, you know the theorem is true.
But maybe you can't quite squish the nagging doubt that if you picked a really oddly shaped right triangle, it would reveal an implicit assumption in that diagram, and so you couldn't do the rearrangement and it wouldn't work. Or maybe you just find precision aesthetically appealing. Then maybe the Euclidean proof would suit you, or some more modern formalization of it.
Or, perhaps you find the physical universe so complicated and ambiguous that you just prefer not to think of it at all, and you won't be satisfied unless you've defined triangles as subsets of the set of all pairs of real numbers, and proven the theorem formally in that setting, thus escaping from empiricism and reality altogether and reducing the theorem to a statement about real numbers (which are defined in some other way, etc). Of course, a disadvantage of this approach is that it becomes hard to justify that your argument gives you any knowledge about real world triangles, since you deliberately cut away any connection to them. But whether or not this is really bothersome is subjective.
It all depends on why you're studying math and what you want to do with your theorems, as well as your sense of aesthetics.
Answer: Many of the answers posted here cover much what I would say about subjectivity in mathematics. For the most part, the subjectivity of mathematics arises from the acceptance of certain collections of axioms. One possibly controversial one is the Axiom of Choice. There are several "paradoxes" associated with it, such as the Banach-Tarski paradox. Whether or not you accept this as a paradox depends on how weird you think the statement is, but it is not a paradox in the mathematical sense. Once axioms are accepted, the deductions that follow are not subjective.
There is another vein of skepticism in mathematics comes from the point of computability. For instance, in mathematics, we often talk about real numbers. We can produce logical formalisms to purport the existence of the set of real numbers, but a valid question is whether such a system exists in the real world. A computer can only compute in rational numbers (an then only a small subset of rational numbers can be represented by a computer), and measurements made in the physical world can only be expressed as rational numbers. Thus even though we talk about representing real numbers as limits of rational numbers, no such limit can be measured. This leads to other number systems such as the $p$-adic completion of the rational numbers.
A less technical example is prime factorizations. As far as we are aware, there are only a finite number of particles in the universe, this means that there must be numbers that we can never express given any computer we could ever construct. If there is no way to express these numbers, then a valid question is if it is meaningful to work with these numbers. Certainly number theory tells us that formally every integer has a prime factorization, but consider the number $$N=2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2}}}}}}}}}}}}+1.$$ Theoretically, this has a prime factorization, but this number is so large, that no computer can calculate this prime factorization. (Even if this one can be factored, there must be some upper limit on the numbers that can be by the finiteness of the universe.) You could say that the claim that this number has a prime factorization is subjective, since none could be produced (formal proofs aside).
As for myself, I happily work with the real numbers everyday I do calculus, and I thoroughly enjoy Hardy's number theory work. My paycheck depends on my ability to do analysis. However, while I work I must accept the Axiom of Choice, the real numbers, and prime factorizations.
Answer: Erdos (well, actually Alfréd Rényi) said that a mathematician is a machine for turning coffee into theorems. If that's literally true, then mathematics is objective.
Erdos also referred to The Book, in which God kept all of the most elegant proofs of each theorem. I believe that the ability to perceive elegance is a subjective thing. The fact that a problem has more than one solution does not make mathematics subjective. But the fact that the two proofs can be compared to each other and arguments can be made over which is the better definitely does make mathematics subjective.
Finally, someone said that mathematics is what mathematicians do. I don't think that is literally true either. It blurs the distinction between The Book and the act of creating an entry for The Book.
I really want to believe that no machine can create elegant theorems as well as a mathematician and a pot of coffee, or a really hot cup of tea. The act of creating or discovering a proof may or may not be a subjective act. The act of deciding whether that proof belongs in The Book is a subjective act.
Comment: Erdos didn't say that. If he would have said something like this, he would have more likely refer to amphetamines, not caffeine.
Comment: @AsafKaragila The source of the coffee quote is debatable and Erdos did like bennies. I tried them in college but quit because I didn't like the side effects. I hate coffee. Maybe that's why I haven't created a zillion theorems.
Comment: Do you have any references that it is debatable? To my knowledge, the original quote is in German, and it's a wordplay on "theorem" and "used coffee grounds". So being a joke told in English by a Hungarian mathematician... sounds less likely. (Not to mention that one Hungarian visitor mentioned this quote just last week, and while he mentioned the name of the mathematician who said that, I can't recall at this moment. It wasn't Paul Erdos though.)
Comment: According to WikiQuotes
"Widely attributed to Erdős, this actually originates with Alfréd Rényi, according to My Brain Is Open : The Mathematical Journeys of Paul Erdos (1998) by Bruce Schechter, p. 155"

The following quote is also in the list of misattributed quotes:
"The first sign of senility is that a man forgets his theorems, the second sign is that he forgets to zip up, the third sign is that he forgets to zip down."
Answer: This question is on the edge of being too soft to learn from. Some people are Platonists and will read this question differently. I'd say yes, math should be considered entirely subjective.
You can imagine you encounter a homeless man who loudly recites Alice in Wonderland on the market place all day long. He may be personally convinced that $50^2$ equals $5225$ and not $2500$ or another number. Now if you ask most math students, they'd say $50^2=5225$ is wrong. They all share this opinion, but the beauty is we only need one person with another opinion to label something as subjective. And the mere opinion of the majority that this man is may be "crazy" (i.e. not acting according to our rules and expectations), or that he doesn't change his mind upon being shown a "proof" or "demonstration", doesn't make him any less of a agent with a subjective opinion. His deviant view makes the issue subjective, by definition.
We can now ask anybody on StackExchange and any fields medalist what $50^2$ reduces to, or $\frac{d}{dx}x^2$ for that matter, but we'll only find opinions that (probably) agree with each other. Opinions of people that reassure themselves, and nothing more than exactly that.
Answer: Yeah, it can:

Consider that polynomials of degree 4 or lower are said to be solvable (or solvable "in radicals" or whatever) whereas the higher-order ones are said to be unsolvable. But this is quite subjective and arbitrary. The definition of $\sqrt{2}$ is literally "the positive real number $x$ that satisfies $x^2 = 2$". What makes solving $x^2 = 2$ any different from solving $x^5 + x + 10 = 0$? I really don't see a meaningful distinction -- both are real numbers and both are irrational. To write either of them out as decimals, you have to use the same kinds of root-finding algorithms for both. To me, the distinction that one of them can be written in terms of radicals and the other one can't seems pretty arbitrary and subjective.
Just look at the definition of e.g. "closed-form solution". It's completely subjective.

etc.
Comment: Not all higher degree polynomials are non-solvable. And the definition is not at all arbitrary or subjective.
Comment: @TobiasKildetoft: (1) Yes, I know that, you know that, the reader probably knows that, and the reader probably realizes that all of us already know that, so I'm not sure why there's a need to be pedantic here. (2) I certainly find it subjective. I don't see why a different definition for solvability instead of via radicals would be illogical. If you think it is impossible to come up with another reasonable definition then feel free to show why you think so. Just saying something "isn't subjective" isn't exactly compelling.
Comment: @Mehrdad: I think you're still missing the earlier commenter's point. The criterion "lies in a radical extension $k/\mathbb{Q}$" may be arbitrary (and I would definitely say it isn't, given, well, the entirety of Galois theory), but it certainly isn't subjective. As for closed-form expressions, we're often loose about the exact criteria, but it's not a term of art anyway. When we talk about the lack of a closed form for, say, $\int_0^x e^{-t^2}$, that can make completely precise and objective by specifying, say, $\mathbb{R}(t)$; we usually just don't care enough to bother.
Comment: You right on one point. Closed-form is made up jargon with little mathematical relevance.

Can math be subjective?