When I used to create the record in Event object it is showing error like:     Error: Invalid Data.   Apex trigger General_Event_Trigger caused an unexpected exception, contact your administrator: General_Event_Trigger: execution of BeforeINsert caused by: System.NullPointerException: Attempt to de-reference a null object: Class.EventClass.updateNewCustomFieldsEvent: line 369, column 1   Trigger code:  trigger General_Event_Trigger on Event (...)     {         if (trigger.isBefore)         {             if (trigger.isInsert)             {                 EventClass.updateNewCustomFieldsEvent(trigger.new);             }             else if (trigger.isUpdate)             {                 EventClass.updateNewCustomFieldsEvent(trigger.new);             }         }     }   Apex class:  public static void updateNewCustomFieldsEvent(List<Event> eventList)     {         for (Event eve : eventList)         {             if (Administrators__c.getInstance().Update_field_Last_Modified_End_User__c)             {                 String userIdString = eve.LastModifiedById;   eve.Last_Modified_By_End_User__c=userIdString.subString(0,15);  why this line showing Null pointer exception error,In before insert, LastModifiedById will be null,Then Null value should assign to eve.Last_Modified_By_End_User__c,Then why it is showing error,what is wrong with this line userIdString.subString(0,15)              }         }     }

When I used to create the record in Event object it is showing error like:     Error: Invalid Data.   Apex trigger General_Event_Trigger caused an unexpected exception, contact your administrator: General_Event_Trigger: execution of BeforeINsert caused by: System.NullPointerException: Attempt to de-reference a null object: Class.EventClass.updateNewCustomFieldsEvent: line 369, column 1   Trigger code:  trigger General_Event_Trigger on Event (...) {     if (trigger.isBefore)     {         if (trigger.isInsert)         {             EventClass.updateNewCustomFieldsEvent(trigger.new);         }         else if (trigger.isUpdate)         {             EventClass.updateNewCustomFieldsEvent(trigger.new);         }     } }   Apex class:  public static void updateNewCustomFieldsEvent(List<Event> eventList) {     for (Event eve : eventList)     {         if (Administrators__c.getInstance().Update_field_Last_Modified_End_User__c)         {             String userIdString = eve.LastModifiedById;             eve.Last_Modified_By_End_User__c = userIdString.subString(0, 15);             eve.Last_Modified_Date_End_User__c = eve.LastModifiedDate;         }     } }


When i run the test code, it throws me message "System.LimitException: Too many SOQL queries: 101". How do i avoid using too many SOQL in this code.     trigger GetObjLabel on Task (before insert, before update) {     for(Task t : trigger.new){      if(t.whatID != null){       List<HOA__c> HOAList= [select id,name from HOA__c where id =: t.whatID];       LIST<Patient_Event__c> SafetyEventList=[select id, name from Patient_Event__c where id=:t.whatID];       List<Review__c> SEreviewList=[Select id, Name from Review__c where id=:t.whatId];       List<Patient_Satisfaction__c> PRList=[Select id, Name from Patient_Satisfaction__c where        id=:t.whatId];       List<Root_Cause_Analysis__c> RCAList=[Select id, Name from Root_Cause_Analysis__c where        id=:t.whatId];         if(HOAList.size() > 0){         for(HOA__c o : HOAList){                 t.Object_Label__c= 'HOA' + '('+o.Name+ ')'; //This will give output as HOA(<HOA. name>)              }           }           else if(SafetyEventList.size() > 0){              for(Patient_Event__c a : SafetyEventList){                 t.Object_Label__c= 'Safety Event' + '('+a.Name+ ')';                }           }            else if(SEreviewList.size() > 0){              for(Review__c r : SEreviewList){                 t.Object_Label__c= 'Safety Event Review' + '('+r.Name+ ')';               }           }               else if(PRList.size() > 0){              for(Patient_Satisfaction__c r : PRList){                 t.Object_Label__c= 'Patient Relations' + '('+r.Name+ ')';               }           }               else if(RCAList.size() > 0){              for(Root_Cause_Analysis__c r : RCAList){                 t.Object_Label__c= 'RCA' + '('+r.Name+ ')';              }           }           else{                t.Object_Label__c= null;           }       }    }          }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, navigate to the  tag. This question and answer is owned by the community! If you can improve it and make it more useful, you're welcome to edit it. I have a collection of records, like a List<sObject> or the Trigger.new context variable. I need to query other records that are related to these records either directly or indirectly, and I want to use the related data to make further updates. When I write a query in a loop, like for (Account a : Trigger.new) {     Account parent = [SELECT Name FROM Account WHERE Id = :a.ParentId];     // ... }  I keep hitting Salesforce query limits, and I know this is not best practice. What can I do to avoid this problem and bulkify my code?


Show that the following set is closed.  $$ S_n = \{ A \;\epsilon \; \mathbb R^{n^2} | \text{A is symmetric} \} \,\subset\, \mathbb R ^{n^2}$$  We are given a hint to use this theorem: Let f be a function from $\mathbb R^n \, to \,\mathbb R^m$ Then, f conts $\iff f^{-1}(F) $ is closed for each closed set F in $\mathbb R^m$.  Not sure where to even begin. Thanks!

This problem seems to be easy yet I have no idea to deal with.  If $\mathbb{M} ^n$ is the set of all real square matrices of order n, identified here with $\mathbb{R} ^{n^2}$ equipped with its usual Euclidean norm which induce an usual topology on the space $\mathbb{M}^n$. Show that:   The set of all invertible real matrices of order n is open in $\mathbb{M} ^n$ with respect to the Euclidean norm topology; The set $\mathbb{S} ^n$ which consists of all real symmetric matrices of order n is closed in $\mathbb{M} ^n$ with respect to the Euclidean norm topology.   For question #1, by the hint which is given by @Brent Kerby, that $det:\mathbb{M}^n \rightarrow \mathbb{R}$ is continuous.


It's true, But how can we prove that fact?

I am trying to figure out how to prove that all rational numbers are either terminating decimal or repeating decimal numerals, but I am having a great difficulty in doing so. Any help will be greatly appreciated.


My question is - Is resistance fundamental property of matter that conducts electricity?  Here's what I mean.  Let's take a wire that has 100 Ohm resistance (it's made from crappy metal with a lot of defects in it). If I send electricity through it, the electrons will experience 100 Ohm resistance because that's how the wire is. It's a bad quality wire with lot of resistance.  Now let's combine two 100 Ohm wires in parallel:     ---100Ohm--- ---|          |---    ---100Ohm---   By doing this and applying resistor formula, we get that this new wire is only 50 Ohms in resistance!!  Somehow using two crappy wires and combining them we were able to create a "new" wire that has better conductivity properties!  Isn't resistance (and conductivity) properties of material?  I'd imagine 100 Ohms would be the lower limit for this wire NO MATTER HOW we combine wires (in circles or parallel or twisting etc). It's still the same crappy wire with 100 Ohm resistance.  How is that possible? My mind is bending.   Let's say we take world's crappiest material that has 1000000000000 Ohms of resistance (almost infinite). Now if we combine a billion pieces of this wire, will we get a superconductor that has no resistance?   How does it work? How is it possible?  Somehow by combining the same material with the same conductive electric properties we were able to decrease resistance.  Isn't resistance defined as fundamental property of matter? I'm puzzled how it was possible that by using same material we were able to achieve lower resistance.

This is blowing my mind.  Let's say I've a bunch of 100 Ohm resistors, all identical.  How is it possible that if I combine them in parallel, I can get something that has less resistance?  Check this out:     ----100OHM--- ---|           |---    ----100OHM---   This is effectively a 50 Ohm resistor!  It was already hard for current to get through one resistor (at 100Ohms), but I combined two resistors together, and now it became easier for current to go through!  If I take ten 100 Ohm resistors in parallel:  Check this out:     ----100OHM---    ----100OHM---    ----100OHM---    ----100OHM---    ----100OHM--- ---|---100OHM--|---    ----100OHM---    ----100OHM---    ----100OHM---    ----100OHM---   This is now 5 Ohms!!!!!!!!!!!!!!!!!!!!!!! Electricity is no longer having almost any resistance, yet each of resistors is 100 Ohms. If I added even more 100 Ohm resistors, resistance would go close to 0, and current would just flow through with no resistance.  How is that even possible? If I think logically, then it could only have gotten HARDER for current to go through two resistors, but somehow it became easier.  Real life analogy:  Let's say there's a 500 pound bouncer at club entrance. It's hard to get past him right? He's strong and will resist you getting past him. Now if the club adds another bouncer at 500 pounds, it suddenly becomes EASIER to get past both of them??  There's no way it's possible!! Can anyone explain this in simple terms?


I recently started playing Hearthstone, and I realized I already knew the correct rarities of different cards without having it explained to me, because I'd seen it before. Stopping to think about it, any time I play a game with items of different tiers of value/power/rarity, I expect them to be color coded as follows:   Gray - junk White - common Green - uncommon Blue - rare Purple - epic/very rare Orange - legendary/wicked rare   This pattern, or something very close to it, holds true in games as diverse as Gems of War, SWTOR, Blizzard games (WoW/Hearthstone), Torchlight, Titan Quest, Borderlands, etc.   So what gives? I'm certainly not complaining, because all else being equal, familiar interface design is beneficial. But how did this come to be the standard? What was the first game to use it, and why did it spread?

In most new titles, especially RPGs, item rarity is colour coded in an easy to remember white-green-blue-purple-orange progression, sometimes with omissions (no green, no orange) or additions (extra silver or neon blue as ultra-rare). Why and how was this introduced in gaming? Does this trend come from outside gaming? How did this evolve to become a trend that almost all games began to follow?


One of my NPC's constantly wants to move in and I have 3 rooms available but it won't settle down. The NPC's name is Reishi by the way.

I keep getting an alert that Amanita would like to settle down. I have a house ready for them however they still won't move in. Who is this NPC and why won't they settle down?


How to show list of contacts in a child component based on the Parent component Account Id, I have a Parent component which shows the list of Accounts and I would like to get all the related contacts of the Account to be displayed in a child component, when I change the Account name in the list. I have used the lightning:select tag and the aura:iteration to get the respective Account Id, when the item is selected from the parent component list. How to pass this Account Id within the iteration to the child component to show the related contacts.  //Parent Component <aura:component controller="AccountListController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >  <aura:attribute name="accounts" type="Account[]" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}" />  <aura:attribute name="parentAttr" type="String" default="parent attribute"/>  <lightning:select label="Your Accounts" name="a_opt" aura:id="a_opt" onchange="{!c.change}">     <aura:iteration items="{!v.accounts}" var="account">         <option value="{!account.Id}"> {!account.Name} </option>         <!-- <c:ContactsList childAttr="{#v.parentAttr}" /> -->     </aura:iteration> </lightning:select>     // Apex Controller global class AccountListController {   @AuraEnabled    global static Account[] getAccountList() {     return [SELECT Name FROM Account LIMIT 10];   } }   // Js Controller ({ doInit: function(component, event, helper) {     // Request from server     var action = component.get("c.getAccountList");     action.setCallback(this, function(result){         var accounts = result.getReturnValue();         console.log(accounts);         component.set("v.accounts", accounts);      $A.enqueueAction(action); },  change: function(cmp,event,hlpr){      var AccId = cmp.find("a_opt").get("v.value");     cmp.set("v.parentAttr", AccId);  } })

Can someone explain me, why object binding is not working?  cmpOne.cmp  <aura:component extensible="true" abstract="true" access="global">     <aura:attribute name="testObject" type="Account" access="global"/>      <span>         {!v.body}     </span> </aura:component>   cmpOneFirst.cmp  <aura:component extends="c:cmpOne" access="global">       <ui:inputText value="{!v.testObject.Name}" />  </aura:component>   cmpOneSecond.cmp  <aura:component extends="c:cmpOne" access="global">     <aura:attribute name="types" type="Aura.Component[]" access="global"/>     {!v.types} </aura:component>   cmpOneThird.cmp  <aura:component extends="c:cmpOne" access="global">     // value of field should be changed, as  this value  is changing  in  inner component     {!v.testObject.Name} <br/>       <c:cmpOneSecond>         <aura:set attribute="types">             <c:cmpOneFirst testObject="{!v.testObject}"/>         </aura:set>     </c:cmpOneSecond> </aura:component>   No controllers.   Desired behaviour: when  you change value of  name field in cmpOneFirst.cmp, new value is displayed in cmpOneThird.cmp   If you change type of testObject attribute from Account to String - binding works.  Any suggestions?


Good day I have the release version of Qgis (2.16) installed into Mint and it can be updated just with apt install qgis whenever a notification comes out that a new version is released.  I want to also install the latest master (2.99) alongside 2.16 for testing but I don't want 2.16 to be overwritten in case there is a problem with master.  Unlike the Windows scenario where you can install different versions of the osGeo4W package to have several versions of Qgis, I haven't been able to work out a way of just creating a 2nd Qgis installation alongside the existing one. I haven't been able to find a simple install package I can download, just repositories, but I haven't been able to work out how to get the master version from them.

I am trying to install development files which include the headers and the libraries for qgis in Ubuntu 12.04. I used Ubuntu software center, synaptic and the terminal and am still getting the same result.  The following packages have unmet dependencies:  libqgis-dev:  -Depends: libgeos-dev (>= 3.0.0) but 3.3.3-2~precise2 is to be installed  -Depends: libgsl0-dev but it is not going to be installed  -Depends: libqgis1.9.0 (= 1.9.0+git20120902+5a0d2f5~precise-ubuntugis1) but 1.9.0+git20120902+5a0d2f5~precise-ubuntugis1 is to be installed  -Depends: libqt4-dev (>= 4.4.0) but 4:4.8.1-0ubuntu4.2 is to be installed  -Depends: python-qt4 (>= 4.1.0) but 4.9.1-2ubuntu1 is to be installed  -Depends: python-qt4-dev (>= 4.1.0) but it is not going to be installed  -Depends: qt4-designer (>= 4.4.0) but 4:4.8.1-0ubuntu4.2 is to be installed  Can anyone help me with this installation?  Thank You.


I don't know why can't I modify a variable in Java, take my code, please help me public class Main {     public static void main(String[] args){         int number = 1;         change(number);         System.out.println(number); // it should print 100     }      public static void change(int number){         number = number * 100;     } }  Now, why when I use an array it does work? public class Main {     public static void main(String[] args) {         int[] numbers = {1, 2, 3};          // prints 100, 200, 300         for(int i = 0; i < numbers.length; i++){             System.out.println(numbers[i]);         }     }      public static void change(int[] numbers) {         for(int i = 0; i < numbers.length; i++){             numbers[i] = numbers[i] * 100;         }     } }

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


Why didn't Dumbledore show his memory of Barty Crouch Jr's confession to Cornelius Fudge to confirm his point that Voldemort returned? Wouldn't that just prevent all the mumbo-jumbo happening in the 5th book?

It seems to me that Harry could have saved himself a lot of grief if he had allowed people to see his memories (either through extraction or Occlumency). For instance:   He could have proved Lucius Malfoy placed the diary in Ginny's basket. He could have proved Sirius's innocent (with the memory of Wormtail's confession). Most importantly, he could have proven Voldemort was back.    Maybe it would have made for a less exciting story, but it sure would have made his life easier.


From , I've found inability to turn off v-sync listed as a negative point.  I understand lowering graphics settings like texture quality, various effects and changing resolution, which very noticeably , but vertical synchronization doesn't seem to do any harm.  From what I know, it only removes image tearing, and as a side-effect may result in displayed framerate change from 60 to 59 (or max_fps-1) in some games due to faulty framerate counting algorithm, which some users may see as literally unplayable. From my experience, in game streams with low framerate, disabled v-sync shows as a lot of tearing frames and disgruntled viewers.  Are there any advantages to disabling v-sync? Does it cost anything performance-wise to worry about?

I have been developing a game engine, and have been discovering and reading up on game technologies such as anisotropic filtering, ambient occlusion, anti-aliasing, etc.  Usually in games, you can toggle these settings on and off. However, if these settings only add nothing but positives, is there a reason to add toggle values for these in a game engine for the developer?  I understand that performance is a major factor, but is there any other reason why these settings are always available to change?


I was messing around on Wolfram Alpha's summation calculator and when I plugged in the summation $$\sum_{i=1}^n\sin\frac{i\pi}{180}$$ and it gave me the value $$\frac12\left(\cot\frac\pi{360}-\csc\frac\pi{360}\cos\frac{(2n+1)\pi}{360}\right)$$ I don't understand... how does it arrive at this formula? And how do I verify this? If I wanted to, how could I find similar formulas in the future?

How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? For example here is the sum of $\cos$ series:  $$\sum_{k=0}^{n-1}\cos (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \cos \biggl( \frac{ 2 a + (n-1)\cdot d}{2}\biggr)$$  There is a slight difference in case of $\sin$, which is: $$\sum_{k=0}^{n-1}\sin (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \sin\biggl( \frac{2  a + (n-1)\cdot d}{2}\biggr)$$   How do we prove the above two identities?


Find $\arctan(x) + \arctan(y)$ in terms of $\arctan\left(\dfrac{x+y}{1-xy}\right)$.    I want to essentially prove this equation given in the textbook: $$ \arctan(x) + \arctan(y) =  \begin{cases} \arctan\left(\dfrac{x+y}{1-xy}\right),  &\text{if } xy\lt 1 \\[1.5ex] \pi + \arctan\left(\dfrac{x+y}{1-xy}\right),  &\text{if } x\gt 0, y\lt 0\text{ and } xy \gt 1 \\[1.5ex] -\pi + \arctan\left(\dfrac{x+y}{1-xy}\right),  &\text{if } x\lt 0, y\lt 0\text{ and } xy \gt 1 \\ \end{cases}$$     By now i have proven the third case where $x<0$ and $y<0$ as follows:   Let $A=\arctan(x)$ and $B=\arctan(y)$, and $A+b=\alpha$. If $-\pi<A+B<-\pi/2$, then $A<0,B<0 \iff x<0,y<0$. As $A+B<-\pi/2$ for the third case, thus:   $$A<-(\pi/2+B) \\ \arctan(x)<-(\pi/2+\arctan(y)) \\ \because y<0, \qquad \therefore -(\pi/2+\arctan(y))=\arctan(1/y) \\ \therefore \arctan(x) < \arctan(1/y) \implies x<1/y \\ \therefore xy>1 $$   I am specifically not able to find such a condition in $x$ and $y$ for the first case, that is the case where $xy < 1$. How do i prove it using a similar approach to mine? (That is no differentiation, only trigonometry). I tried using the inequality $A+B\in(-\pi/2,\pi/2)$, but am stuck.

I know $$g(x) = \arctan(x)+\arctan(y) = \arctan\left(\frac{x+y}{1-xy}\right)$$  which follows from the formula for $\tan(x+y)$. But my question is that my book defines it to be domain specific, by which I mean, has different definitions for different domains:  $$g(x) = \begin{cases}\arctan\left(\dfrac{x+y}{1-xy}\right), &xy < 1 \\[1.5ex]  \pi + \arctan\left(\dfrac{x+y}{1-xy}\right), &x>0,\; y>0,\; xy>1 \\[1.5ex]  -\pi + \arctan\left(\dfrac{x+y}{1-xy}\right), &x<0,\; y<0,\; xy > 1\end{cases}$$  Furthermore, When I plot the function $2\arctan(x)$, it turns out that the book definition is correct. I don't understand how such peculier definition emerges. Thank you.


The new user badge is showing up on meta for users who really aren't new. In this case it was really obvious - turns out they've been on Stack Overflow for 5+ years, but maybe this is their first meta post.  I think it'd be clearer if child metas inherited someone's new user status from the main site.

Earlier today I saw the New Contributor indicator attached to a user who had 2,700 reputation and had been a member of the site for over 2 years. When I went to leave a comment, I saw a banner of “(User) is a new contributor. Be nice, and check out our Code of Conduct.” above the comment.  This was very confusing until I realised what was going on: this occurred on our per-site meta, and this was the first day the user had contributed to our site's meta.  Could the indicator & banner be updated on meta sites to make it clear it's not just being buggy?   Update the “New Contributor” indicator to say “New Contributor to Meta” or “New Meta Contributor” Update the comment/answer banner to say “(User) is a new contributor to this meta. Be nice, and check our Code of Conduct.”   (Text bolded just for the sake of this feature request; don't have it bolded in the released version.)


Is it possible to get the time zone by country name and city name in android ?  ex : input -> city: Delhi ,country:India  TZ: Asia/Calcutta  i am not able to find good answer for this .   here is the list of time zone available .  is there any public api for this ?

Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't fancy creating own database of the places that don't follow DST. Is there a way to pull this data on demand?   I need this for the database server (not for client workstations) - there entities stored in the database that have City, State as properties. I need know current timezone for these entities at any moment of time.


I have become quite fond of using TikZ pics, but sometimes I run into some unexpected behaviour.  As far as I know, if you define coordinates like (-A), (-B),... inside a pic and draw the pic later as \pic (yourname) {pictype};, you can access them as (yourname-A), (yourname-B), and so on, which is quite convenient if you want to build a base/scaffolding pic on which you add more stuff in subsequent pics. But sometimes this breaks in unexpected ways:  \documentclass{article}  \usepackage{tikz}  \begin{document}     \tikzset{         brokenbase/.pic={             \node (-A) at (0,0) {};             \draw (-A) to[in=0] (0,0);         },         broken/.pic={             \pic (B) {brokenbase};         },         works/.pic={             \node (-A) at (0,0) {};             \draw (-A) to (0,0);         },         worksbase/.pic={             \pic (B) {worksbase};         }     }     \tikz{\pic {works};}     \tikz{\pic {broken};} \end{document}   I've implemented the same thing twice here: A base pic that draws an empty node and then a to-path from the node to the origin. If I don't give any arguments to the to-path, this works. If I give an in or out argument, it fails with this error: Package pgf Error: No shape named BB-A is known.  I have heard of a similar bug here:  But I don't think my problem is exactly the same since it goes away once you don't give to any options or use a usual -- path.  P.S.: It seems it would make some sense to have "pic inheritance" in an OOP sense. Anyone up to implement that? ;)

I am using the new TikZ/PGF 3.0 pic feature.  I use them heavily, including using a pic inside another pic.  The problem is that Tikz sometimes cannot find the node names of nested pics.  I expect the following to work:  \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \tikzset{complex/.pic={   \node(re) {re};   \node[right=0mm of re](im) {im}; }} \tikzset{su3v/.pic={   \path pic(c0) {complex};   \path pic[right=1mm of c0im](c1) {complex};   \path pic[right=1mm of c1im](c2) {complex}; }} \tikzset{spinor/.pic={   \path pic(v0) {su3v};   \path pic[below=2mm of v0c2re](v1) {su3v};   \path pic[below=2mm of v1c2re](v2) {su3v};   \path pic[below=2mm of v2c2re](v3) {su3v}; }}  \path pic {su3v};       % Works \path pic(name) {su3v}; % ! Package pgf Error: No shape named namec0im is known. \path pic {spinor};     % ! Package pgf Error: No shape named v0c1im is known. \end{tikzpicture} \end{document}   What is wrong here?


When I pass a variable into a PHP script I firstly check if it isset, is not blank, check that it's a string and that the length is greater than 1 and less than 255 (the DB varchar field limit) then I run it through this:   $f_name= stripslashes(htmlentities($_POST["f_name"], ENT_QUOTES));   I then use PDO prepare to update the f_name field. When I then fetch it to put it on the page I decode it like:  html_entity_decode($row["f_name"], ENT_QUOTES);   Return it in a JSON array to the AJAX call that initiated the fetch and then parse it into an input field.  If the f_name field was saved with an apostrophe in it, everything works right up to the point I try and put it in the input field with JavaScript. It just cuts off the apostrophe and anything after it. How can I stop this from happening?  var response = "<input type='text' id='f_name' value='"+rdata.patient[0].f_name+"' onkeydown='onedit(1)' maxlength='255' />";

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I'm a complete beginner at LaTeX but would now like to write a mathematical article with MLA style referencing. The set of references I'm using are for this article only and nothing else, so I don't need to be able to use the same references for several documents. Also, I have no experience with bibtex or biblatex, nor have I ever used the citation system that comes with LaTeX. What is the most direct way to achieve this?

I know how to create a bibliography of the MLA style manually:  \begin{thebibliography}{9}   \bibitem{Poz}     Pozrikidis, C. \emph{Boundary Integral And Singularity Methods For Linearized Viscous Flow}. Cambridge [England] : Cambridge University Press, 1992. Print.  \end{thebibliography}   The link about BibTeX gives the following description:     If a document references this handbook, the bibliographic information may be formatted in different ways depending on which citation style (APA, MLA, Chicago etc.) is employed. The way LaTeX deals with this is by specifying \cite commands and the desired bibliography style in the LaTeX document.   It does not mention how can the bibliographic information be formatted in different style.  Question: How can I create the bibliography automatically with  with the same ? (Window Vista, MiKTeX, WinEdt 6.0)  [EDITED: ]Are there other ways to create the bibliography in MLA style in LaTeX?


Prove $$\sum_{k=0}^n {n \choose k}=2^n$$ by proving that both sides of the formula represent the number of subsets of a set of $n$ elements. For the left side use the addition rule for counting after partitioning the collection of all subsets according to size. And for the right side use the product rule for counting after identifying a subset $A \subset \{1, 2, ..., n\}$ with the sequence of zeros and ones which is the indicator of $A$.

Please help with this question. Show that for a finite set $A$ of cardinality $n$, the cardinality of $P(A)$ is $2^n$, where $P(A)$ is the power set of $A$. Thank you in advance for any help that is given.


If I copy the title of this question below it appears as  Why can't I put the phrase System.Data.Entity.DbSet in my question?

How do I post text so that it is formatted as code?  What do I need to do so that my code shows up properly — not escaped or removed — when posted? And how to get the correct syntax highlighting?     For more information, see "" in the .


Scenario:   Given a Cleric 1 / Wizard 4 / Ur-Priest 2 (character level 7).  This character has both arcane and divine spellcasting and is assumed to meet the requirements for Mystic Theurge. Takes 8 levels of Mystic Theurge (Cleric 1 / Wizard 4 / Ur-Priest 2 / Mystic Theurge 8), which advances the spellcasting of the Wizard base class to 14 and the Ur-Priest to 10. Ur-Priest only has 10 class levels available to progress through.  What happens on the next level of Mystic Theurge? The character is still only an Ur-Priest 2.  What happens if the character takes a level of Ur-Priest, to advance to Ur-Priest 3, but the spellcasting level of the Ur-Priest is already Ur-Priest 10?

Suppose I have a human character who invested 5 levels on Wizard, 2 on Ur-priest(by appropriate feat chain), and 8 levels of Mystic Theurge, net level of 15. This allows you to cast spells as stated in 10th level Ur-priest Spells per day table. Now, assume that I leveled up, and I choose Mystic Theurge as the next level class. This makes me to look up Ur-priest table for Level 11, which does not exist. In this case, what happens to my divine spells per day? Does it continue to progress "in the same pattern", as Hellfire Blast progresses with Hellfire Warlock-Legacy Champion build? Does it stop and I only get Wizard spells per day? Or, isn't it allowed to do so?  I am totally aware that although the answer is "yes", it does not mean it means spells over 9th level will be granted to my character unless I take Improved Spell Capacity, which requires me to be epic. What I am curious is the progression of spells per day of existing spells.  P. S. Don't ask me how to satisfy the requirements. This is possible by combining Apprentice (Criminal), Iron Will and Great Fortitude as level-up feat, and Spell Focus (evil) as a Wizard bonus feat (RAW, it is a "Spell Focus" feat, anyway.)


In Dungeon World, let's say we have two archers in the party, both mechanically the same.  It's time for some feats of arrow-work, so the two archers take aim.  Alice aims at an ogre who's a fair distance away.  It's a reasonable attempt that could succeed or fail.  Bob decides to aim at the human standing near the ogre, a much smaller target.  I warn him that it's a harder shot than Alice's, but he wants to go ahead anyhow.  What can I do to make Bob's task less likely to succeed?    The usual advice (as seen ) doesn't fit the fiction -- that is, it doesn't make sense according to the narrative of what's going on in the story.  And in DW, the fiction drives the mechanics, not the other way around.  Some of the usual answers:   Break the task into smaller tasks.  There's no reason Bob's shot would be multiple tasks while Alice's would be just one. It's impossible unless the player gets creative.  Bob's shot is just as reasonable to attempt as Alice's, it's just a harder shot. Make failure hurt more.  There's no in-fiction reason why Bob missing his target should hurt more than Alice missing hers.

In a game of Dungeon World, how do you handle different difficulties at the same task?  A few examples:   climbing a wall with easier handholds vs. climbing a smoother wall pushing a heavy cabinet out of the way vs. pushing it while enemies are pushing back lifting a heavy beam with debris on it vs. lifting the beam after the debris has been removed   Each of these examples gets at the players' approach to the problem.  They have a difficult (not impossible) task in front of them.  If they deal with something else, the task becomes easier.  So it would be really helpful to have some way of adjusting the difficulty of a task to reflect this.  In other roleplaying games, I'd just (as the GM) change the target difficulty, or give some bonus/negative to the die roll.  What's the Dungeon World way of handling this?    There's  about how to pile on more problems before you can even try the underlying task.  I'm not looking to just pile on more stuff, I'm looking to make the underlying task possible, but more difficult.


I have the following code: \documentclass[11pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs,siunitx} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} %\usepgfplotslibrary{external} %\tikzexternalize \begin{document} \begin{center} \begin{tikzpicture} \begin{axis}[     title={$x-t$ graph model of LAB 1},     height=10cm,     width=10.2cm,     xlabel={time ($t$)},     ylabel={position ($x$)},     xmin=0, xmax=10,     ymin=0, ymax=12,     xtick={0,1,2,3,4,5,6,7,8,9,10},     ytick={0,2,4,6,8,10,12},     legend pos=south east,     ymajorgrids=true,     grid style=dashed,     legend entries={$x$,$x^2$},         legend style={             at={(1.03,0.5)},             anchor=west} ] \addplot[     color=blue,     mark=square,     ]     coordinates {     (0,0)(1.48,2)(2.76,4)(4.02,6)(5.22,8)(6.43,10)(7.76,12)     }; \addplot[     color=red,     mark=square,     ]     coordinates {     (0,0)(1.66,2)(3.21,4)(4.76,6)(6.32,8)(7.81,10)(9.47,12)     }; \addplot[     color=green,     mark=square,     ]     coordinates {     (0,12)(1.53,10)(2.94,8)(4.53,6)(5.95,4)(7.36,2)(8.83,0)     }; \addplot[     color=black,     mark=square,     ]     coordinates {     (0,12)(1.80,10)(3.46,8)(4.94,6)(6.49,4)(8.20,2)(9.85,0)     }; \legend{Trail 1 (fast and $+$), Trail 2 (slow and $+$), Trail 3 (fast and $-$), Trail 4 (slow and $-$)} \end{axis} \end{tikzpicture} \end{center} \end{document}  which produces the following:  I have two questions: How do you change the font size of the text in the legend? Also, how do I made the line segments shown dotted? I want to add a line of best fit, so I want the line segments shown to be dotted. Thanks!

I have the following code: \documentclass[11pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs,siunitx} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} %\usepgfplotslibrary{external} %\tikzexternalize \begin{center} \begin{tikzpicture} \begin{axis}[     title={$x-t$ graph model of LAB 1},     height=10cm,     width=10.2cm,     xlabel={time ($t$)},     ylabel={position ($x$)},     xmin=0, xmax=10,     ymin=0, ymax=12,     xtick={0,1,2,3,4,5,6,7,8,9,10},     ytick={0,2,4,6,8,10,12},     legend pos=south east,     ymajorgrids=true,     grid style=dashed,     legend entries={$x$,$x^2$},         legend style={             at={(1.03,0.5)},             anchor=west} ] \addplot[     color=blue,     mark=square,     ]     coordinates {     (0,0)(1.48,2)(2.76,4)(4.02,6)(5.22,8)(6.43,10)(7.76,12)     }; \addplot[     color=red,     mark=square,     ]     coordinates {     (0,0)(1.66,2)(3.21,4)(4.76,6)(6.32,8)(7.81,10)(9.47,12)     }; \addplot[     color=green,     mark=square,     ]     coordinates {     (0,12)(1.53,10)(2.94,8)(4.53,6)(5.95,4)(7.36,2)(8.83,0)     }; \addplot[     color=black,     mark=square,     ]     coordinates {     (0,12)(1.80,10)(3.46,8)(4.94,6)(6.49,4)(8.20,2)(9.85,0)     }; \legend{Trail 1 (fast and $+$), Trail 2 (slow and $+$), Trail 3 (fast and $-$), Trail 4 (slow and $-$)} \end{axis} \end{tikzpicture} \end{center} \end{document}  which produces the following image:  I am wondering how I am make the above line segments dashed (ie the black, blue, red, green). I want to add a line of best fit over it, so I would like the lines to be dotted. Also, how do you change the text size of the legend? I would like it to be slightly smaller so I am make the graph larger. Thanks!


This email is regarding  to draw Kiviat Diagrams.  This Solution is working perfectly upto 9 axis. But when we make number of axis as 10, it's giving error as : "You already have nine parameters."   Can you please suggest, how to handle more than 9 axis using second solution suggested in above mentioned URL.

I have a mathematical transformation that takes 16 parameters (grouped into 3+8+5) and would like to make a latex command for it, so that I can easily change the notation for it if the need arises.  As far as I know, both \def and \newcommand take a maximum of 9 arguments, is there any (recommended) way to extend this?


I am trying to write a website blocker and the simplest thing I found is putting lines at the end of /etc/hosts. If I want ot have 1 million websites blocked that redirect to localhost would that slow something about internet browsing or something about normal OS operations.

How can I determine or set the size limit of /etc/hosts? How many lines can it have?


I have been trying to find sites online, like  to find kids around my age to play d&d with, and that would mostly have a general idea of the game and rules, but no results.  One of the biggest issues is that I live in clarksville, and there aren't many people that are interested, while in a place like Nashville, several tabletop RPG group would let someone join with open arms.  The second biggest issue is that most friends and family would rather use their time playing fortnite and other video games and not take the time for what they think of a stupid and nerdy games that only losers play (except my father). I hope that the internet will have the answer, and know my fate depends on YOU.

I'd really like to learn how to play pen-and-paper RPGs.  I know that it takes a few players to actually sit down and play, but I'm not at all sure where to find more gamers.  How do I find existing groups to join? Or, are there any resources online that may help me find existing RPG groups or players?


We know that  $2^2=2+2$  $3^2=3+3+3$  Similarly  $x^2=x+x+...$ ( upto $x$ times)  Now I want to differentiate both side with respect to $x$  This gives $2x=1+1+1+.....$ ( upto $x$ times)  $2x=x$  Cancelling $x$ I have   $2=1$  Which should be false. Where am I going wrong? Please tell. The proof has to be wrong somewhere.

Consider the following:   $1 = 1^2$ $2 + 2 = 2^2$ $3 + 3 + 3 = 3^2$   Therefore,   $\underbrace{x + x + x + \ldots + x}_{x \textrm{ times}}= x^2$   Take the derivative of lhs and rhs and we get:   $\underbrace{1 + 1 + 1 + \ldots + 1}_{x \textrm{ times}} = 2x$   Which simplifies to:   $x = 2x$   and hence    $1 = 2$.     Clearly something is wrong but I am unable pinpoint my mistake.


I have created a user called training using the adduser command and user training appears in the login screen. How to not show any particular user in the login screen? I am using Ubuntu 12.04 with the default Unity.

How do I hide a particular user from the login screen on a default install of 11.10 and higher? (ie. using Unity Greeter)?


Using Google Chrome Version 30.0.1581.2 dev on OSX Mavericks, I've found an issue where I can't type a custom message for flagging a question.  Steps to Reproduce   Click flag on a question Click "Other, needs moderator attention" Click to focus on the text box used for inputting extra information and type something   Expected Results   Focus is shifted to the input box and a reason for flagging can by typed.   Actual Results   Focus is shifted to the text field, but is shifted back to the "Other" Radio button almost immediately.   Other Information   Tabbing to the next field works as expect, indicating it's the click event being handled by both inputs. Repeatable on Safari 7.0 (9537.71) OSX Mavericks

Which browsers are officially supported by Stack Exchange?  Also, what else is needed in order to use every feature of the site?


In many languages, the standard dynamic list (not fixed-size array) type will resize after an item is deleted:  Python:  myList = ['a', 'b', 'c'] del(myList[0]) print(len(myList)) # Prints '2'   C#:  var myList = new List<string> {"a", "b", "c"}; myList.RemoveAt(0); Console.WriteLine(myList.Count); // Prints '2'   and so on.  However, in Javascript, the list length stays the same, even though the element evaluates to undefined ( tells me that it's different to array[index] = undefined):  Javascript:  var myArray = ['a', 'b', 'c'] delete myArray[0] console.log(myArray.length) // Prints '3' console.log(myArray) // Prints "[ , 'b', 'c' ]" in node, '[undefined × 1, "b", "c"]' in Chrome  myArray[0] = undefined console.log(myArray) // Prints "[ undefined, 'b', 'c' ]" on both node and Chrome  myArray.splice(0, 1) console.log(myArray) // Prints "['b', 'c']"   My questions are:   Is the JS array delete behaviour by design or an oversight that couldn't be fixed for fear of breaking legacy code? What exactly is the 'undefined-like' value that replaces the deleted array element?

What is the difference between using  on the array element as opposed to using ?   For example:  myArray = ['a', 'b', 'c', 'd'];  delete myArray[1]; //  or myArray.splice (1, 1);   Why even have the splice method if I can delete array elements like I can with objects?


I googled quite a bit and tried to find out why my german date won't put out "03. März 2016" but instead always prints "03. M�rz 2016"  <?php      $event_date_format = DateTime::createFromFormat('Ymd', $event_date[0]);       setlocale(LC_TIME, 'de_DE', 'de_DE.UTF-8');     echo strftime("%A, %d. %B %Y", $event_date_format->getTimestamp()); // Donnerstag, 03. M�rz 2016      echo $event_date_format->format('F'); // March ?>     Looks like this:    Umlauts work correctly and fine for the rest of the page.  I was able to fix it with  $fmt = new IntlDateFormatter('de_DE' ,IntlDateFormatter::FULL, IntlDateFormatter::NONE, 'Europe/Berlin', IntlDateFormatter::GREGORIAN); $fmt->setPattern("MMMM"); $event_date_format = DateTime::createFromFormat('Ymd', $event_date[0]); echo $fmt->format($event_date_format);

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


What is the physical meaning of Ricci scalar is a covariantly constant?

Regarding general relativity:   What is the physical meaning of the Christoffel symbol ($\Gamma^i_{\ jk}$)? What are the (preferably physical) differences between the Riemann curvature tensor ($R^i_{\ jkl}$), Ricci tensor ($R_{ij}$) and Ricci scalar ($R$)? For example why do the Einstein equations include the Ricci tensor and scalar, but not the Riemann tensor?   To be clear, by "physical meaning" I mean something like - what physical effect do these components generate? Or, they make the GR solutions deviate from Newton because of xxx factor... or something similarly physically intuitive.


The post  shows that watch is the utility that is useful for the invoking a command at fixed interval repeatedly.  Now, I have very long commands, and have used aliases to group them logically to get a quicker output, like  $ alias c1='grep "checking for" file1.log' $ alias c2='grep "validated" file1.log' $ (echo "Checking: "`c1`) && (echo "Validated: "`c2`)   The output of 3rd command is like  Checking: 100 Validated: 80   It is a long running process, I need to check the status of this process, to get the mentioned counts. But invoking the above with watch gives error      $ watch '(echo "Checking: "c1) && (echo "Validated: "c2)'   c1 command not found   I can put the entire command in there and remove the aliases, but is there any other work-around to get the aliases working with watch command?  Note: Did quickly go through the man page for watch, but didn't find any reference to alias in specific.

If a run the watch command containing an alias, it will not expand the alias. I have tried both with single quote and double quotes, in fact given the following alias:  # alias ll alias ll='ls -l --color=tty'   The following command will fail  # watch ll sh: ll: command not found   Shouldn't command line expansion work in this case?


Consider:  char amessage[] = "now is the time"; char *pmessage = "now is the time";   I read from , 2nd Edition that the above two statements don't do the same thing.  I always thought that an array is an convenient way to manipulate pointers to store some data, but this is clearly not the case... What are the "non-trivial" differences between arrays and pointers in C?

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


I want to swing this triangle around on that green axis.    or some way of accomplishing the same thing.  I just need to flip the triangle on its longest side.  as you can see me attempting to do in this gif animation.    I haven't found a way of doing it without distorting the shape of the triangle. and I don't want to just eyeball it by trying to pull the corner into place. I want it to be exactly the way it was only flipped.

First, the screenshots:     Given the highlighted edge in the left excerpt of the screenshot collage above, is there a quicker way to be able to rotate the cube around that edge than rotating the whole cube so that the active edge is parallel to one of the primary axes, making the rotation, and then rotating the cube back to its original position?  How about if the cube is chosen, but instead forming the diagonal of one of the faces, one selects the first vertex, and for the other end of the new edge, selects the vertex opposite of the first, along the diagonal of the cube. The new edge referred to is the active edge in the right half of the screenshot excerpt above. Again, is there a faster or more efficient way to rotate around the diagonal, than rotating the cube so the diagonal aligns with one of the primary axes, making the rotation, and then rotating the cube back to its original position?   In both cases, I want to rotate the cube around and perpendicular to the highlighted edge, as in the results screenshots below.


my lecturer used this theorem in the title without proof. I didn't find a proper proof by myself. Could anyone help me out, please?

Let $K$ be an algebraically closed field ($\operatorname{char}K=p$). Denote $${\mathbb F}_{p^n}=\{x\in K\mid x^{p^n}-x=0\}.$$ It's easy to prove that ${\mathbb F}_{p^n}$ consists of exactly $p^n$ elements.  But if $|K|<p^n$, we have collision with previous statement (because ${\mathbb F}_{p^n}$ is subfield of $K$).  So, are there any finite algebraically closed fields? And if they exist, where have I made a mistake?  Thanks.


I want thick ticks but the 1st and last ticks are cut. It seems that the figure is cut exactly at axis boundaries so the thick ticks are cut off and look thiner than it others. Could someone tell me how to fix it please ?  Here is a minimal example :  \documentclass[a4paper,11pt,twoside]{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document}  \begin{figure} \begin{tikzpicture}  \begin{axis}[ axis equal image, xmin=0., xmax=4, ymin=-1.5, ymax=1.5, xlabel={centimètres}, ylabel={}, xlabel style={yshift=10pt}, axis x line*=middle, axis y line=none, xtick={0,1,2,3,4}, major tick length=10pt, minor tick length=5pt, major x tick style={thick, color=black}, minor x tick num={9}, xticklabels={}, xtick align=center, axis on top, width=0.9\textwidth ] \end{axis}  \end{tikzpicture} \end{figure}  \end{document}

I am trying to make the thickness of the ticks equal to the axis line thickness. That is what I have so far:  \documentclass{article}   \usepackage{pgfplots}  \pgfplotsset{compat=1.5}   \begin{document}     \begin{tikzpicture}     \begin{axis}[         xlabel=Binding Energy (eV),         ylabel=Intensity (a.\,u.),         xtick pos=left,         x dir= reverse,         ytick = \empty,         every x tick/.style={color=black, thin},         tick align=outside,         xlabel near ticks,         ylabel near ticks,         xmin = 96,         xmax = 108     ]         %\addplot[mark=none] table[x=BE,y=cnts] {si2p.txt};         % This data looks similar:         \addplot[mark=none, smooth] table[x=BE,y=cnts] {             BE      cnts             95      1             98      1             99      10             99.5    5             100 6             101 2             108 2         };      \end{axis}     \end{tikzpicture} \end{document}     But if you take a closer look on the ticks on the outside, you'll see that they are somehow clipped or a least thinner. They are also black so the style seems to work for them.    Is this a bug or can I change the clipping region? And as a second question: is thin the correct value for the thickness?


On my phone, I can make drafts for questions.  However, upon returning home, I wanted to complete my draft, but cannot find any drafts button on my PC.  Is this a bug?

Many times it takes me a while to properly compose my question before posting. Sometimes it's just a jumble of ideas and concepts, and is not something I'd want seen immediately. However, there is no way to save a partial question unless you post it.  This should work exactly like it does in Gmail. There, once you start composing your question, it's autosaved as a draft. If your browser crashes or you need to come back later to complete it, it will be there for you to finish and post later.  Optionally, allow multiple draft questions and a page to edit/delete them. If needed, make them expire after some amount of time.


This is one feature I miss it on Win10, if I have 3 open chrome windows or file managers, can I use Alt+Tab to switch between them?

Currently if I hold ALT + TAB and then while still holding down ALT I press TAB I am able to go between applications in a little view and then when I release all the keys that application and all its windows come to the front.  And this is very useful, but I would like to know if there is a way of switching between individual windows with this keyboard shortcut in the same way rather than grouping windows with an application to switch to?  I am running Ubuntu GNOME 15.10 with GNOME 3.18.


Is there a way to communicate with web designer not using the PhotoShop on both sides? It is too expensive. When hand writing annotations will be always incomplete, buggy and time-expensive.    May be there is PhotoShop viewer with which developer would catch colors, sizes, gradients, fonts?  Or may be tool that can generate     design annotations text file from Photoshop psd that can describe     "how it is made"?   Or may be export to any third party format can         help? Or may be photoshop is just not the right tool?   Added: CSS export (I have tried CSSHat) doesn't suit well: a) sizes are in pixels (need to be converted to em/rem) b) shadows are not visually the same.  So if the goal is "not to do the work twice" designers should use another tool than PhotoShop. Of course I understand that Photoshop still the best for pure creativity...

I found this plugin SpecKing that looks like it's just about exactly what I'm looking for, I haven't tried it out yet though because I was hoping to find a free, maybe even open source alternative..  Does anyone know of any open-source and/or free Photoshop plugins similar to this one?  I'm looking to extend the functionality of the measure tool so as to actually display annotated measurements of the measured distances for convenient reference.. like a blueprint basically.


I am trying to pull data from multiple cells into one. A device can be in multiple device groups and device groups can have multiple devices.  The first table looks as follows:    The second table looks as follows:    The output should look as follows:  DID | DGID 12  | 342,543,100,132 45  | 342,678,987,100   Could someone please assist me with this?

Using MySQL, I can do something like:  SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;   My Output:  shopping fishing coding   but instead I just want 1 row, 1 col:  Expected Output:  shopping, fishing, coding   The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.  I've looked for a function on  and it doesn't look like the CONCAT or CONCAT_WS functions accept result sets.  So does anyone here know how to do this?


Ok ... i just installed Blender today, watched some tutorials but i got stuck at this step because on none of the tutorials has this happened :  when i select an object and i go into properties menu, under material, i have no + button to add a new one

I have added a sphere and I was able to add material and give it a color. Now when I add a second sphere (separate object), the material panel is just blank.


In the Standard Model, U(1) corresponds to the electromagnetic, SU(2) to weak, and SU(3) to strong interactions. I realize that gravity is not a part of the Standard Model. However, sometimes gravity is also viewed as a gauge theory. If so, does it correspond to any particular symmetry group or is this a wrong way of thinking and why?

Currently, (classical) gravity (General Relativity) is NOT a gauge theory (at least in the sense of a Yang-Mills theory).   Why should "classical" gravity be some (non-trivial or "special" or extended) gauge theory? Should quantum gravity be a gauge theory?  Remark: There are some contradictory claims in the literature to this issue. To what extent gravity is "a gauge" theory?Obviously, GR is not a YM theory. So, why do some people say that gravity "IS" a gauge theory? I found this question relevant, e.g., then we handle GR in the Einstein-Cartan theory or any other theory beyond GR, like teleparallel theories or higher-derivative gravitational theories. So I think it could be useful to discuss the "gauge flavor" of gravity here.


For functions $f:[a,b] \to \mathbb{R}$ I know that there holds $|\int_{a}^{b}f(t) dt| \leq \int_{a}^b |f(t)| dt$. But how can I show that this holds for functions $f:[a,b] \to \mathbb{R}^n$ when we consider an arbitrary norm $||\cdot||$ on $\mathbb{R}^n$ and the integral is defined componentwise. (for the euclidean norm or the 1-Norm its clear, but I dont know how to show it for an arbitray norm. I first tried to use the fact that all norms are equivalent but this didnt work.)

I came across this problem :  Let $f\colon [a,b]\rightarrow \mathbb{R}^n$ a continuous vector valued function. Then it is true that:  $$\left\Vert\int \limits_a ^b f(t) dt\right\Vert \leq \int \limits_a^b \left\Vert f(t)\right\Vert dt$$  I consider that the integral of $f$ is given by integrating each component and then I am trying to reduce it to having an integral inequality for $n$ single valued functions but I am stuck.  I would appreciate some help.  Thank you!


I frequently come across data sets that have both categorical and numeric data.  I think this is just a fact of life where the data is not all in one category.  I'm basically trying to find some practical approaches or strategies on how to go about solving this problem.  In many books and initial searches on google I tend to get some sort of Kmeans clustering and a lot of phd-looking papers.  I think this is a common problem so I'm wondering if anyone can guide me to some practical suggestions or methods that I can further investigate and implement in R or Python?  I'm basically lost and just looking for some direction!

I wonder whether it is possible to perform within R a clustering of data having mixed data variables. In other words I have a data set containing both numerical and categorical variables within and I'm finding the best way to cluster them. In SPSS I would use two - step cluster. I wonder whether in R can I find a similar techniques. I was told about poLCA package, but I'm not sure ...


I have the following issues / question. I use WIFI and Ethernet through each other like most people probably.  Certain things like ripping a blu ray I want to do through the Ethernet connection so that is when I plug it on.  However, I first have to turn WIFI off to "force" the mac to choose to route the data through the Ethernet connection.  In system settings under network / priorities I have the proper order, so Thunderbolt Ethernet above WIFI.  Any idea how I can make the Mac use the Ethernet cable without turning off the WIFI? THANKS!

Brief Description:  I need my Ethernet card (en0) to see all traffic under 192.168.2.xxx.  However I also need to use WiFi card (en1) for all other traffic.  OS: OS X Lion    I am using a separate network location to deal with this specific use (since this is a for a robotics project that communicates via Ethernet). Ethernet (en0) had to be set up as a static IP (192.168.2.10) per the requirements for the device I am connecting to. All connections on the Ethernet card (en0) should be 192.168.2.xxx as specified above. WiFi (en1) is set up as DHCP to a router since their is no point in assigning it as a static for general purpose traffic. Ethernet (en0) is set up as priority over WiFi (en1).  I would also like to keep this under the network location preferences if at all possible since I do not require this feature to be on all the time.  I would really appreciate your help on this. No one I have talked to knows how to solve this.


I actually work on a plugin for wordpress and I have problem to dynamically stylize a button form (input[type="submit"]), because some wordpress themes use the "!important" property.  I want to override that use JavaScript under HTML input objects, because i want to call some css value using php.  In the demo below I have volentary put the "!important" property in the css style to try to override it.      input[type="submit"] {     font-family: FontAwesome, 'Diplomata SC', "Helvetica Neue", helvetica, arial, sans-serif;     font-weight: bold;     text-transform: uppercase;     display:block;     background-color: #333333!important;     color: #FFFFFF!important;     padding: 5px 11px;     letter-spacing: 2px;     border: none;     cursor: pointer;     font-size: 15x;       border-radius: 3px;     box-shadow: 0 -3px rgba(0, 0, 0, 0.14) inset; }  input[type="submit"]:hover {   background-color: #27ccc0!important;   color: #FFFFFF!important; } <input  onmouseover="this.style.backgroundColor='#6ce033'; this.style.color='#FFF'; return true;" onmouseout="this.style.backgroundColor='#40c200'; this.style.color='#FFF'; return true;" type="submit">       <?php function add_button($id) {    $stored_meta = get_post_meta($id);  $btn_bg_color = esc_attr( $stored_meta['btn_bg_color'][0]);  $btn_txt_color = esc_attr( $stored_meta['btn_txt_color'][0]);  $hover_btn_bg_color = esc_attr( $stored_meta['hover_btn_bg_color'][0]);  $hover_btn_txt_color = esc_attr( $stored_meta['hover_btn_txt_color'][0]);      echo '<input onmouseover="this.style.backgroundColor='."'".$btn_bg_color."'".'; this.style.color='."'".$btn_txt_color."'".'; return true;"  onmouseout="this.style.backgroundColor='."'".$hover_btn_bg_color."'".'; this.style.color='."'".$hover_btn_txt_color."'".'; return true;" type="submit">'  ?> }     Above, a concrete example of what I want to do. Changing the style depending the post id.

Title pretty much sums it up.  The external style sheet has the following code:  td.EvenRow a {   display: none !important; }   I have tried using:  element.style.display = "inline";   and  element.style.display = "inline !important";   but neither works. Is it possible to override an !important style using javascript.  This is for a greasemonkey extension, if that makes a difference.


I want to know the file count for a particular format like .txt in a particular directory

For the purpose of testing, I'd like count how many images files are inside a directory, separating each image file type by file extension (jpg="yes". This because later it will be useful for another script that will execute an action on each file extension). Can I use something like the following for only JPEG files?  jpg="" count=`ls -1 *.jpg 2>/dev/null | wc -l` if [ $count != 0 ] then echo jpg files found: $count ; jpg="yes" fi   Considering file extensions jpg, png, bmp, raw and others, should I use a while cycle to do this?


I am using SharePoint 2013.  There are four lists: List1 List2 List3 List4  With different users assigned to each List. Now, In the Home Page, I want to insert a Web Part named "Quick Links".  Whenever a user from List1 logs in, only List1 link should be displayed. All the other three links should be invisible for the List1 user.  Same applies to the other three List users too.  How can I achieve this?  Thanks

I have a page in which several sharepoint groups have access to. Picture a department page in sharepoint. On this page we have several webparts that we would like everyone to see. My question is, how can I show a link (or list of links) to only one specific group that has access to this page?  This seems so simple but I cannot figure out how to do it. I would like to avoid doing any development as well as multiple instances of this page (if possible). Maybe I am just having a slow monday morning....


This short story is probably from the 1950s or 60s. In it, a pair of astronauts are stranded on a planet where all the vegetation is red and there is nothing green to be seen. The only time they ever see the color green is when they fire their ray-gun style weapons, which produce a green glow. As the story progresses and their chances of rescue slowly diminish to zero, one of the pair grows increasingly unhinged, eventually murdering his partner.

I remember reading a short story 10 to 15 years ago about a man stranded alone on a red planet, where nothing would be green, and so he would miss that color. There was a sentient hand to keep him company, and it talked to him. I don't remember if the hand was a native life form or his own hallucination.  The story was not very old at that time, so it may have been written in the late 90s or 00s.


I am creating a pager component and faced a problem. I simplified the code to show the problem :  @for (int i = 0; i < 10; i++)         {
UpdatePager(i)" class="waves-effect">@(i+1)
                   } @code{      public void UpdatePager(int iCurPage)     {         Console.WriteLine(iCurPage);     }  } // when click on 1  console result is 10 // when click on 2  console result is 10 // ... // when click on 10  console result is 10  My expectation is when I click any of lis the corresponding number(i) should be logged in the console but what is actually happen is for all of the lis the number 10 ( final value of i) is printed. What is the problem and how should I pass different values for each rendered elements?

I met an interesting issue about C#. I have code like below.  List<Func<int>> actions = new List<Func<int>>();  int variable = 0; while (variable < 5) {     actions.Add(() => variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?


Lets say I have a class:  function Dog(name) {     this.name = name;  } Dog.prototype = {     constructor: Dog }   I would like to add some methods to that class, but I'm confused where I should add them, to the constructor itslef, or to the prototype of that class.   for example I can do:    function Dog(name) {         this.name = name;         this.bark = function() {              console.log(this.name + ' barked!');         }     }   Or I can alternatively do this:  function Dog(name) {         this.name = name;      }     Dog.prototype = {         constructor: Dog,         bark: function() {             console.log(this.name + ' barked');         }     }   What are the differences between the 2 options? which one is better? and which situations should I use each one?  Sidenote: I am aware this question is basic enough to likely have duplicates, but I cannot find any simillar posts, maybe I am constructing the question wrong.

What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };


Why is memory I haven't initialized set to 0xCC? Setting the memory to 0xCC will decrease performance, so there must be a reason for filling the memory with this byte.

I know that the compiler will sometimes initialize memory with certain patterns such as 0xCD and 0xDD.  What I want to know is when and why this happens.  When  Is this specific to the compiler used?  Do malloc/new and free/delete work in the same way with regard to this?  Is it platform specific?  Will it occur on other operating systems, such as Linux or VxWorks?  Why  My understanding is this only occurs in Win32 debug configuration, and it is used to detect memory overruns and to help the compiler catch exceptions.  Can you give any practical examples as to how this initialization is useful?  I remember reading something (maybe in Code Complete 2) saying that it is good to initialize memory to a known pattern when allocating it, and certain patterns will trigger interrupts in Win32 which will result in exceptions showing in the debugger.  How portable is this?


My task is to modify Sergiu Dotenco's  code to not use boost (not saying boost is bad, but due to some company's policy i have to remove it).   now, Sergiu's WELL is using boost's mpl library, there are quite some logic behind it. So one way is to read up all those, then naturally i would be able to finish the task. The other way is, replacing bit by bit with some best guess.   I'm on the 2nd way to hope this try-and-error approach would be faster. So far I've successfully replaced boost::mpl::if_ and if_c with std::conditional, but hit error when try to update IsPowerOfTwo and Power2Modulo etc, that's why i'm seeking help there.   Below is the code, how to rewrite it without boost, but only c++17?  /**     * Conditional expression of type (r & (r - 1)) == 0 which allows to check     * whether a number @f$r@f$ is of type @f$2^n@f$.     */     typedef boost::mpl::equal_to<         boost::mpl::bitand_<         boost::mpl::_,         boost::mpl::minus<boost::mpl::_, boost::mpl::int_<1>         >         >,         boost::mpl::int_<0>     > IsPowerOfTwo;      template<class UIntType, UIntType r>     struct Power2Modulo     {         typedef typename boost::mpl::apply<             IsPowerOfTwo,             boost::mpl::integral_c<UIntType, r>         >::type type;          BOOST_STATIC_ASSERT(type::value);          template<class T>         static T calc(T value)         {             return value & (r - 1);         }     };   If possible, pls give a short example on how to call it? I tried to instantiate IsPowerOfTwo or Power2Modulo in main with   Detail::IsPowerOfTwo p0;        or  Detail::Power2Modulo<int, 3> p1;   but got compilation error.  I asked a . However, not familiar to metaprogramming and boost, I don't quite get it.

Today I needed a simple algorithm for checking if a number is a power of 2.  The algorithm needs to be:   Simple Correct for any ulong value.   I came up with this simple algorithm:  private bool IsPowerOfTwo(ulong number) {     if (number == 0)         return false;      for (ulong power = 1; power > 0; power = power << 1)     {         // This for loop used shifting for powers of 2, meaning         // that the value will become 0 after the last shift         // (from binary 1000...0000 to 0000...0000) then, the 'for'         // loop will break out.          if (power == number)             return true;         if (power > number)             return false;     }     return false; }   But then I thought, how about checking if log2 x is an exactly round number? But when I checked for 2^63+1, Math.Log returned exactly 63 because of rounding. So I checked if 2 to the power 63 is equal to the original number - and it is, because the calculation is done in doubles and not in exact numbers:  private bool IsPowerOfTwo_2(ulong number) {     double log = Math.Log(number, 2);     double pow = Math.Pow(2, Math.Round(log));     return pow == number; }   This returned true for the given wrong value: 9223372036854775809.  Is there a better algorithm?


I upgraded my phone nexus 4 to Android 5.0 lolly pop, it was over the air upgrade. Before upgrading i had set pattern lock to my phone, after upgrade it is using the same but in settings/security the options to disable the pattern lock is disabled (option none). Also swipe to unlock the device option is also disabled. Pin, Password and Pattern are enabled. please let me know to disable the lock.  Thanks, Harish S

I have my mobile phone (Samsung Galaxy S2) running on ICS. Recently I activated Microsoft Exchnage ActiveSync to connect to my corporate email. It disabled all the security options like 'Pattern Unlock'. I hated it, and removed my microsoft active exchange account from the phone, but these options are still disabled. How do I get it enabled?


A level 10 creator can use the feat  to create a wand of  modified by the metamagic feats  and . Normally, the price of such a wand is 30,000 gp ([1 (spell level) +3 (metamagic adjustments to spell level)] ×10 (caster level) ×750 gp).  However, if the creator has the trait  (snowball), can the creator make a nearly identical wand except at a total adjusted spell level of 3 instead of 4 yet that has the same effect?  And if the creator possesses the supernatural ability  (or another ability that allows the creator to change one energy type to another), can that creator create a wand of snowball that's, instead, a wand of fire snowball that deals fire damage?

One of my players has recently obtained the Craft Wondrous Item feat. In an attempt to prepare for what he may build I want to know the specific limits of Wondrous Items.  I know that someone can create an item for which they do not meet the prerequisites by adding +5 to the spellcraft DC, and that assistance is a thing.  Can someone use meta-magic when crafting a non-specific wondrous item?  Example: Amulet of Empowered Fire-Ball.  If so, can they use meta-magic feats they do not know, substituting for +5 DC?  Can the Spell Level exceed 9 for these items, as long as they add +5 for not meeting the CL requirements, and make the higher check?  Example: Amulet of Maximized Empowered Still Silent Disintigrate.


I'm working on a C# WinForms project. I try to work with multi threading in a part of my App : Part code (Method) : public void ShowData() {     Thread t;     t = new Thread(() =>       {            using (GVentesEntities context = new GVentesEntities())           {               dataGridView1.DataSource = (from F in context.Facture.AsEnumerable() join C in context.Client.AsEnumerable() on F.CLT equals C.ID select new { ID = F.ID, F.Date, Client = $"{C.Nom} {C.Prenom}", Total = $"{(from df in context.Det_Fact.AsEnumerable() join cmd in context.Commande.AsEnumerable() on df.CMD equals cmd.ID where df.FACT == F.ID select cmd.QTE * cmd.PRU).Sum():00} MAD" }).OrderBy(x => int.Parse($"{x.ID.Substring(x.ID.IndexOf("-") + 1)}")).ToList();           }        });      Thread.Sleep(1000);     t.Start(); }  The problem is when I try to access this method when application is run I get an error : Error System.InvalidOperationException: 'Cross-thread operation not valid: Control 'dataGridView1' accessed from a thread other than the thread it was created on.' Please any help to handle this problem and execute my method with threading ? thanks in advance.

I have a scenario. (Windows Forms, C#, .NET)   There is a main form which hosts some user control. The user control does some heavy data operation, such that if I directly call the UserControl_Load method the UI become nonresponsive for the duration for load method execution. To overcome this I load data on different thread (trying to change existing code as little as I can)   I used a background worker thread which will be loading the data and when done will notify the application that it has done its work.   Now came a real problem. All the UI (main form and its child usercontrols) was created on the primary main thread. In the LOAD method of the usercontrol I'm fetching data based on the values of some control (like textbox) on userControl.    The pseudocode would look like this:  CODE 1  UserContrl1_LoadDataMethod() {     if (textbox1.text == "MyName") // This gives exception     {         //Load data corresponding to "MyName".         //Populate a globale variable List<string> which will be binded to grid at some later stage.     } }   The Exception it gave was     Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on.   To know more about this I did some googling and a suggestion came up like using the following code  CODE 2  UserContrl1_LoadDataMethod() {     if (InvokeRequired) // Line #1     {         this.Invoke(new MethodInvoker(UserContrl1_LoadDataMethod));         return;     }      if (textbox1.text == "MyName") // Now it wont give an exception     {     //Load data correspondin to "MyName"         //Populate a globale variable List<string> which will be binded to grid at some later stage     } }   BUT BUT BUT... it seems I'm back to square one. The Application again  become nonresponsive. It seems to be due to the execution of line #1 if condition. The loading task is again done by the parent thread and not the third that I spawned.  I don't know whether I perceived this right or wrong. I'm new to threading.  How do I resolve this and also what is the effect of execution of Line#1 if block?  The situation is this: I want to load data into a global variable based on the value of a control. I don't want to change the value of a control from the child thread. I'm not going to do it ever from a child thread.   So only accessing the value so that the corresponding data can be fetched from the database.


My question deals with the following exercise from Hartshorne's Euclid: Geometry and Beyond:     Following our general principles, we say that two models $M,M'$ of our geometry are isomorphic if there exists a 1-to-1 mapping $\phi:M\to M'$ of the set of points of $M$ onto the set of points $M'$, written $\phi(A) = A'$, that sends lines to lines, preserves betweenness, i.e., $A\ast B\ast C$ in M $\iff$ $A'\ast B'\ast C'$ in M', and preserves congruence of line segments, i.e., $AB\cong CD$ in M$ \iff$ $A'B'\cong C'D'$ in $M'$   If $A=(a_1,a_2),B=(b_1,b_2)\in\mathbb{R}^2$, the exercise asks you to first show that $\mathbb{R}^2$ endowed with the taxicab metric: $$d(A,B)=|a_1-b_1|+|a_2-b_2|$$ Is isomorphic to the model of $\mathbb{R}^2$ endowed with the infinity distance: $$d(A,B)=sup\{|a_1-b_1|,|a_2-b_2|\}$$ How can we proceed in order to prove these models are isomorphic? How should we describe our isomorphism $\phi:\mathbb{R}^2\to \mathbb{R}^2$? I'm definitely having trouble with sending congruent lines to congruent lines.  The second part of the exercise claims that the taxicab metric model is not isomorphic to that of the standard model, i.e., the cartesian plane $\mathbb{R}^2$ equipped with the usual Euclidean distance. Hartshorne leaves a hint to this exercise: in order to prove two models are not isomorphic, one just has to find a statement which is true in one model but not in the other. I'm thinking, for example, that the line: $$y=x+1$$ Cuts the circle of center the origin $(0,0)$, and radius $1$ in infinitely many points in the taxicab metric model, a property that never holds in the standard model, which should make it clear that both models are not isomorphic. However, the first part still puzzles me, and I can't imagine how to proceed.  Thanks in advance for your time, any comments will be appreciated.

I've been reading about Hilbert's Axioms of geometry, and I have two models on $\mathbb{R}^2$ which satisfy the usual axioms of incidence, betweenness, and congruence.   The first model has a distance function given by  $$ d(A,B)=|a_1-b_1|+|a_2-b_2| $$ where $A=(a_1,a_2)$, $B=(b_1,b_2)$, and two segments $AB\cong CD$ if $d(A,B)=d(C,D)$.  The second model has a distance function given by $$ d(A,B)=\sup\{|a_1-b_1|,|a_2-b_2|\}, $$ and again $AB\cong CD$ if $d(A,B)=d(C,D)$.  The author claims that these two models are isomorphic in that there is a bijection between the sets of points in $\mathbb{R}^2$ that preserves lines, betweenness and congruence. I've been toying with it for a while, but it seems to me that the notions of congruence in particular are too different.   For example, in the first model, if $A=(0,0)$ and $B=(2,1)$, and $C=(2,0)$ and $D=(5/2,5/2)$, then $AB\cong CD$ since both segments have length $3$. To preserve congruence, I suppose two segments are congruent if the maximum of the displacement along the $x$-axis or $y$-axis by traveling along one segment is equal to the maximum of the displacement along either axis when traveling along the other segment. In this sense, how could you shape the segment $CD$ so that the maximum of the displacements along either axis is the same as the maximum of the displacement for whatever the image of $AB$ is?  In the first model, $AB$ is congruent to any segment which is the hypotenuse of triangle with legs that sum to $3$, and this sum could split into any two terms. I just don't see a function that could handle all these possibilities at once. Does anyone know of a particular isomorphism between these two? Thanks.


I've been doing my research and found some clues as to where I should be looking, but just can't quite get it perfect.  I'm trying to create a new user, and allow them to have access to SFTP for file management, but I do not want them to be able to SSH and access console. Nor am I trying to su the account.  I've tried changing their bash to (/bin/nologin), but then they cannot login to SFTP, I've tried locking their account as well but that didn't work either.   I'm on Centos 6, and I'm just using the built in sftp service.   Similar to probably how a small server host would set it up, allowing access to a specific directory, but not console. Just trying to project my butt if one of my server staff tries to railroad me.

I'm starting a very little hosting company for a few friends and little clients, nothing big.  I want to give my "clients" the right to manage their files on the server. I hate FTP as it is not secure and it's in my opinion obsolete.  So I'd like to allow my users to connect through SFTP but not allow them to connect through SSH. (I know, I know, SFTP is using SSH). But I was just wondering, is it possible?  So I wouldn't have to install a FTP service on the server and everything would be awesome!


I've gathered from   that the Informed badge is not awarded here on the Big Meta.  But  does have this badge.  Why did this one user get the badge when the rest of us can't?

When I signed up I received a welcome message specifically indicating I should take the tour to earn my first badge:     Clicking the message takes me directly to the .  However, as   , the 'Informed' badge is not active here on meta.  Shouldn't the wording of the welcome message be altered if a user signs up on a site which does not use this badge?


package mainPackage;  import java.util.Random;  public class Test {     public static void main(String args[]){         int[][] d = new int[][]{{34,43,23,54,24},{43,34,32,43,}};         int g = d.length;         int k = d[1].length;         for(int i = 0; i<d.length;i++){             System.out.println(d[i]);         }         for(int j = 0; j<d.length;j++){             System.out.println(d[j]);         }     } }   instead of printing out the arrays it print this out   [I@15db9742  [I@6d06d69c  [I@15db9742  [I@6d06d69c   How can I fix it. and what is the problem? Do I need to convert something?

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


The way I'm installing the DEs:  XFCE:  apt install -y xfce4   KDE:  apt install aptitude tasksel aptitude install ~t^desktop$ ~t^kde-desktop$   Both seem to prompt for a selection for the language/keyboard halfway through. Is there an option to make it auto-select default and proceed?

How do you stop all interactive prompts from apt-get when installing or upgrading packages?  I'm trying to write a non-interactive script to install packages on servers, whenever an upgrade requires installing a new kernel, apt-get always ignores the -y option and prompts me on what option to take to update grub.lst. I always want to install the package maintainer's version. How do I disable this prompt?


I have seen a proof that for two subgroups $H$ and $K$ of a finite group $G$, $$ |H K| = \frac{| H\| K\rvert}{| H\cap K|} $$ The proof counts the number of elements $hk$ that are the same as $h'k'$ for $h,h'\in H$ and $k,k'\in K$. I got confused with this proof.  My question is if there is another way to make things like this more clear. For example, I know that if one has a surjective homomorphism $f:G \to H$ then $\lvert G\rvert / \lvert \ker f\rvert = \lvert H\rvert$. That is, one can count the number of elements in something by essentially finding the order of the kernel of a map. This looks like what is going on with the product $HK$. But I guess that $HK$ in general isn't a group, so one can't talk about a group homomorphism.  Is there a way to find the "kernel" of a general function and get something like the first isomorphism theorem? All I would be interested in is how this can be used to count things.

Let $H$, $K$ be subgroups of $G$. Prove that $o(HK) = \frac{o(H)o(K)}{o(H \cap K)}$.  I need this theorem to prove something.


Some of titles are too long, and when I make the table of contents, one line is not enough for them. How can this problem be solved? Can I split the title by a certain line break command? Or can I use a short version of the title instead? What commands should be used in the both cases?

I am writing a book and one of my chapters has a very long title. As it can't be displayed correctly on the top of even pages, I provide a "short title name" via the   \chapter[short title]{long title}   command. But then, "short title" appears in the table of contents instead of the original/true/long one.  How can I have the "short title" in the header of even pages, and the "long title" in the ToC and in the "Title header"?  For reference, here is the code I use:  \documentclass[11pt,a4paper]{book} \begin{document} \tableofcontents  \chapter[Short title]{Very vey very very very very very very long title     i can't display in the header} Lorem ipsum dolor sit amet, consectetur adipiscing elit. \end{document}


I am extremely new with java. I have been working on a project and am completely stumped.  What I am trying to do is I need to build a application that generates an ArrayList of certain students and grades, and then i will be able to manipulate them from there.   I thought I had it down to where I could get it to create the object at the very least, but it looks like that is not the case. It compiles correctly, but when I try to create the object using the Student() constructor with no arguments it gives me the following stack trace:  java.lang.NullPointerException     at Student.addInitialStudents(Student.java:61)     at Student.<init>(Student.java:23)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)     at bluej.runtime.ExecServer$3.run(ExecServer.java:759)   from reading the stack trace it looks like the issue is in my constructor.  import java.util.ArrayList;  public class Student {      public ArrayList<Student> students = new ArrayList<Student>();     private String studentID;     private String firstName;     private String lastName;     private String email;     private int age;     private int grade1;     private int grade2;     private int grade3;     private int[][] grades;     private int i;     private int x;      /**      * Constructor for objects of class Student      */     public Student(){         addInitialStudents();     }      public Student(String studentID, String firstName, String lastName, String email, int age, int[][] grades)     {         this.studentID = studentID;         this.firstName = firstName;         this.lastName = lastName;         this.email = email;         this.age = age;         this.grades = grades;     }      private void addInitialStudents(){         String[] id = {"1","2","3","4","5"};         String[] fName = {"John", "Suzan", "Jack", "Erin", "Sam"};         String[] lName = {"Smith", "Erickson", "Napoli", "Black", "smith"};         String[] mail = {"John1989@gmail.com","Erickson_1990@gmailcom","The_lawyer99yahoo.com","Erin.black@comcast.net","ssmith@gmail.com"};         int[] listAge = {20, 19, 19 ,22, 28};         int[][] iniGrades =         {             {88, 79, 59},             {91, 72, 85},             {85, 84, 87},             {91, 98, 82},             {99, 87, 92}         };          for (i = 0; i <= 4; i++){              studentID = id[i];             firstName = fName[i];             lastName = lName[i];             email = mail[i];             age = listAge[i];              for (x = 0; x <= 2; x++){                 grades[i][x] = iniGrades[i][x];             }               students.add(new Student(studentID, firstName, lastName, email, age, grades));          }      }      public void getID(){         System.out.print(students.get(0));     }  }   Anyone have any tips on this?   BlueJ is highlighting the line   grades[i][x] = iniGrades[i][x];   I'm sorry if this is a duplicate, but I couldn't find a solution no matter how much research i tried to do and no matter how many changes I make.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Often I'm working my through suggested edits and I'll come across a suggested edit to a tag-wiki.  I read through it, it looks good so I say "Approve!".  Then I work through a few other suggestions only to discover the same tag-wiki (edited by the same person), but it is generally much shorter.  In other words I'll see something like (assume for the sake of argument that these are good edits and that foobar originally had no info attached to the tag):  tag-wiki foobar    foobar is a term that programmers use a lot.  Nobody really knows why but wikipedia   has some info you can check out.                      edited by mgilson   ...work through some more edits here...  tag-wiki foobar    foobar is a term that programmers use a lot.                    edited by mgilson   What is going on here?  Is it just that the user made multiple edits?  Why don't they all get lumped together? (Maybe that should be a feature request)?  More importantly, should I reject the second because I already approved the first, or does the approval of the first somehow depend on the approval of the second?

At the moment, in major part because they are two separate post objects in the system, the excerpt and the body of a tag wiki count as two separate posts with regards to suggested edits in the queue. Mechanically, this is sane, but when it comes to handling the actual queue, it can be confusing. A body edit might consist of little more than a bed of links, which looks bad. But then an excerpt is shown that includes the rest of the data, and since excerpts can be included on the actual wiki page, it makes a lot more sense when they're taken in the same space.  And this is how they are composed, too. The actual edit interface for working on tag wikis has both the excerpt and the body on the same page. In a sense, the excerpt behaves a lot like the "title" of the wiki, if we make a parallel to normal post edits.  Thus, my suggestion (which is to say a suggestion that I repossessed from Robert Cartaino) is that when suggested edits are reviewed for tag wikis, that they be presented in a single unit, treating the excerpt the same as how a title is treated in a question edit. This way, relevant information that is crossed between the two isn't lost because they are reviewed separately.


Is Fractionalation a thing? That is, if first order is addition, and second order is multiplication, is there a 1.5th order? a sqrt(2) order? a ith order operation?  Lets define a function A(o, x, y) where o is the order, and x and y are the arguments to the function.  A(1, x, y) would just be addition, x+y  A(2, x, y) would be multiplication, x*y, or x + x + x } y times  A(3, x, y) would be x^y or xxx } y times  A(4, x, y) would be tetration, i think it's denoted as ^y(x) or something? but x^x^x } y times  I raise the question, has this space been filled out? Can we take A(1.5, x, y)? or A(sqrt(2), x, y)? or A(2i, x, y)?  Is this something that has been studied?  Are there papers on it that I can read?  Update: Question has some answers here:   here:  and here:

I noticed this  which attempts to find the shades of grey between a linear and log scale where results are between zero and one.  However, I was looking for the more general case where we find the continuum between the operators themselves - add, multiply, and exponentiation or even higher.  The function could be a hyperoperation$(n,x,y)$, where $x$ and $y$ are the numbers to operate on, and $n$ is allowed to be a non-integer number for the type of operator. So $n=1$ would be 'addition', $n=2$ would be multiplication, and $n=3$ would be exponentiation. But one would also have $n=2.5$ to be the shade of grey BETWEEN multiplication and exponentiation, or $n=3.5$ or $4$ for beyond exponentiation and tetration).  I want the formula to work with real numbers, not just integers. Any thoughts?  These related posts may also be of interest:


I'm trying to compile my tex file but it keeps giving me this error. Overfull \hbox (11.0894pt too wide)  Someone who can help me out?

I often see output from TeX with the warning overfull hbox, badness 10000. What does this message mean?


I want to calculate the RMSE of two grids based on their z-value: a calculated and a reference grid. I do have the statistics: Cells, Range, Min, Max, Sum, Mean, Variance, St.dev.  How could I solve the problem using e.g. ArcGIS or SAGA Gis?

I have the following two files:   LiDAR las file1 Let's give it a name LiDAR las file2, contains the same file1 data, where number of points randomly removed.   So if file1 contains X number of points, file2 would contain Y number of points, where Y is less than X.  Now, I am using ArcGIS "LAS to Multipoint" to create from both files above their shape counterparts. Next I am creating two empty TIN(triangulated irregular network) files using ArcGIS. Then I edit both TINs, let's say tin1 and tin2, with the appropriate input feature classes, i.e. file1 to tin1 and file2 to tin2.  Is there any tool/package/library or any software that would let me calculate the RMSE(root mean square error) or any difference information that would give me information on the accuracy of the second file, i.e. file2, with respect to file1? I tried to use the TIN difference but it gives system error and cannot obtain the result. I would really appreciate if anyone could show how to obtain accuracy information and interpretation of the results obtained.


Over on , people often describe themselves as "beginners" or "newbies". Nothing at all wrong with that — in fact, it's great. Both of these terms have the implication of starting at a low level now, but with the general expectation of gaining knowledge.  I want to distinguish this from someone who doesn't really want to begin at all. In photography, they may just want to take a decent picture for social media but don't actually want to learn anything or, heaven forbid, practice. But I also don't (always) mean this negatively: if that's not your interest, you're just needing to do this thing in the course of something you do care about, why should you become an actual beginner?  The same could apply to computers — I may be not very skilled at spreadsheets, but, also I don't consider myself a beginner, because I have no intention of getting better. I just sometimes find myself needing to edit them and send them around to people for my job.  Is there a word for this concept? I was thinking "tourist" — but, hopefully something less metaphorical. Sometimes people say "not a professional" or "just an amateur" with this kind of meaning, but particularly in photography that's really not the right distinction — an amateur may in fact be an expert.  This also isn't the same as "dilettante" — which does seem a perfect match for the full text of the question , because that has a) an implication of showiness I don't mean to imply and b) doesn't apply very well at all to the case of someone just wanting a basic question answered so they can get a different job done. A dilettante has — or feigns — interest in a topic (and even may pretend expertise), but doesn't really have the will to learn. I'm looking for a word for someone who doesn't even have the interest or pretense of one.  In usage: "I just want a camera that will do everything for me — I don't want this as a hobby... I'm just a _____".

I used to know this word but cannot remember it.   Basically it’s someone who likes the prospect of being knowledgeable about many things, or at least wants the appearance of erudition, but who is unwilling to put in the time and effort to learn new things.  He may put in just enough effort to learn some trivia to impress others.  And pretentious isn’t the word I was thinking of.


I want to create a regular reference section with all the literature I cited in my document but also a separate one with a custom title (uncited literature) where All the keys should be listed that I haven't cited. Is there a (simple) way to do that?

I need two bib-like sections: a "References" giving works explicitly cited in my text, and a "Bibliography" (or "Further reading" if you prefer) giving everything from my bibfile that didn't already appear in "References". The first is of course completely standard, but the second... I'm stumped.  Further loose constraints: I'm somewhat committed to biblatex and the biblatex-apa style. But I'll happily accept an answer not related to them if there's any chance I can adapt it.


The question is as follows: $\DeclareMathOperator{\rank}{rank}$     Is the set $S_r = \{A \in \Bbb R^{n \times n}: \rank(A) \leq r\}$ closed in $\Bbb R^{n \times n}$ in the Euclidean topology?   I have a feeling that this is true, but I got stuck looking for a convincing argument.  Certainly this is true for $r = n-1$.  Perhaps it can be shown that $S_{r-1}$ is a closed subset of $S_r$?  No neat tricks are coming to mind, but I would think that there must be one. This seems like the kind of thing that has a canonical answer, so links are welcome.

Let $M$ be the space of all $m\times n$ matrices. And $C=\{X\in M|rank(X)\leq k\}$ where $k\leq \min\{m,n\}$. How to proof that C is a closed subset of M?