I'm using amsart. When I create an enumeration inside a remark environment, the numbering is not aligned properly:  Remark. (1) (2) (3) (4)   How do I shift the (1) nextline?  Remark.  (1)  (2)  (3)  (4)  MWE:  \documentclass{amsart} \newtheorem{remark}[theorem]{Remark}  \begin{document} \begin{remark} \begin{enumerate} \item Item 1 \item Item 2 \item Item 3 \item Item 4 \end{enumerate} \end{remark} \end{document}

I'm currently writing up some solutions, and I like to rewrite the problem before answering it.   I've set exercise to be a theorem environment, and the code I'm using is  \begin{exercise}  \begin{enumerate}  \item Show that $R$ is symmetric iff $R^{-1}\subseteq R$. \item Show that $R$ is transitive iff $R\circ R\subseteq R$. \end{enumerate} \begin{proof} \end{proof} \end{exercise}   However, when I build, the first item (a) appears immediately to the right of the Exercise heading, and the second item (b) appears below and indented:    I've tried using \newline and \linebreak, and even skipping a line before typing \begin{enumerate} after the \begin{exercise} command but those don't work. Is there a way to push (a) down below Exercise 3.32. so that it's lined up with (b)? Thank you.  As requested, my preamble is:  \documentclass[11pt]{article} \input{other/packages.tex} \input{other/theoremdef.tex}   where packages.tex is  \usepackage{amsthm} \usepackage{amsmath} \usepackage{amscd} \usepackage{url} \usepackage[top=1.3in, bottom=1.3in, left=1.3in, right=1.3in]{geometry}  % header and footer \pagestyle{headings}  \usepackage{amssymb} \usepackage{amsfonts} \usepackage{stackrel} \usepackage{mathrsfs} \usepackage{verbatim} \usepackage{enumerate} \usepackage{hyperref} \usepackage{xy} \input xy \xyoption{all}   And theoremdef.tex is:  \newtheorem{exercise}{\bf Exercise} \newcommand{\dom}{\text{dom}\ } \newcommand{\ran}{\text{ran}\ } \newcommand{\fld}{\text{fld}\ } \newcommand{\op}[2]{\langle #1,#2\rangle} \newcommand{\ot}[3]{\langle #1,#2,#3\rangle} \newcommand{\ms}[1]{\mathscr{#1}}


I have this list of object:  public class Location {     public string area { get; set; }     public string sensorId { get; set; }     public string address { get; set; } }  List<Location> items = List<Location>(){ new Location(){area = "london ", address ="king road", sensorId ="2134"}, new Location(){area = "moscow",  address ="george str", sensorId ="2134"}, new Location(){area = "york ",   address ="johnson str ", sensorId ="2134"}, new Location(){area = " tokyo",  address ="king road 5", sensorId ="2134"}, new Location(){area = "paris",   address ="elitom road", sensorId ="2134"} }   how can I remove white spaces in area and address properties in items variable using linq?

Is there a way to do the following using LINQ?  foreach (var c in collection) {     c.PropertyToSet = value; }   To clarify, I want to iterate through each object in a collection and then update a property on each object.  My use case is I have a bunch of comments on a blog post, and I want to iterate through each comment on a blog post and set the datetime on the blog post to be +10 hours. I could do it in SQL, but I want to keep it in the business layer.


I read from  that the geometric standard deviation is  $$\sigma_g = \text{exp}\left( \sqrt{\frac{\sum_{i=1}^n\left(\frac{A_i}{\mu_g}\right)^2}{n}}\right)\,, $$  where $\mu_g$ is the geometric mean, $A_i$ is the observation $i$, and $n$ is the sample size.  How can I calculate a confidence interval for a geometric mean?  Is the standard error for the geometric mean $se_g = \frac{\sigma_g}{\sqrt{n}}$? Assuming the distribution of $A$ is normal, is my 95% confidence interval for the geometric mean $\mu_g - 1.96 \cdot se_g < \mu_g < \mu_g + 1.96 \cdot se_g$

As title, is there anything like this? I know how to calculate CI for arithmetic mean, but how about geometric mean? Thanks.


I am using windows subsystem for linux (WSL) and I am writing a bash script to check the battery temperature. Information related to battery can be accessed in the directory "/sys/class/power_supply/battery". The information for battery temperature is available in the file temp (which is a read only file). when i output the content of the file,it gives me a number which I think is the battery temperature but there is no temperature unit associated with it. In my case,my battery temperature is shown as 256. Can anybody tell me what is the temperature unit associated with it?

How to check battery temperature? How do I know the normal temperature of it?  My OS is Ubuntu, and my laptop is Lenovo G470.  Output of acpi -t:  Thermal 0: ok, 0.0 degrees C


Tried out Xubuntu via:  sudo apt-get install xubuntu-desktop  How do i go back to unity and delete everything xubuntu related?  Thanks.

A few days ago I installed Xubuntu on top of a normal Ubuntu system:  sudo apt-get install xubuntu-desktop   I didn't play around for long on Xubuntu before I realised that I liked Ubuntu 2D better. Now my problem is how do I uninstall Xubuntu and all of it's dependencies and the recommended packages like Thunar and Abiword.  For now I just run:  sudo apt-get remove xubuntu-*   but I still have a lot left from Xubuntu. It would be nice if by doing  apt-get remove xubuntu-desktop   all of the packages installed with the metapackages were also removed, but that is not the case.


Problem Let $f(x)$ be twice-differentiable over $[-2,2]$, $|f(x)|\leq 1$ and $f^2(0)+[f'(0)]^2=4.$ Prove that $\exists \xi \in (-2,2):f(\xi)+f''(\xi)=0.$ My Proof First，by Lagrange' Mean Value Theorem，we have $$\exists \xi_1 \in (-2,0),\xi_2 \in (0,2):f'(\xi_1)=\frac{f(0)-f(-2)}{2},f'(\xi_2)=\frac{f(2)-f(0)}{2}.$$ Thus $$|f'(\xi)|\leq \frac{|f(0)|+|f(-2)|}{2}\leq \frac{1+1}{2}=1,$$ and likewise $$|f'(\xi_2)|\leq 1.$$ Denote$$F(x):=f^2(x)+[f'(x)]^2.$$ It's easy to verify that $F(x)$ is continuous and differentiable over $[\xi_1,\xi_2]$. Therefore, $F(x)$ can reach its maximum value over the interval above. But $$F(\xi_1)\leq 1+f'^2(\xi_1)\leq 2<F(0),$$ and similarily $$F(\xi_2)\leq 2<F(0),$$ the maximum value can not come out at the end points of the interval.Hence, it must be taken over $(\xi_1,\xi_2)$. Let the point be $x=\xi\in(\xi_1,\xi_2)\subset (-2,2)$. Then $$F'(\xi)=0,$$ which implies that $$2f'(\xi)[f(\xi)+f''(\xi)]=0.$$ Now, Notice that $$4\leq F(\xi)=f^2(\xi)+f'^2(\xi)\leq 1+f'^2(\xi),$$ which implies $f'(\xi)\geq 3$，and hence$f'(\xi) \neq 0$. It follows that $$f(\xi)+f''(\xi)=0,$$ which is desired. Please correct if I'm wrong. Hope to see other solutions. THX.

Let $f:\mathbb{R}\to\mathbb{R}$ be a function, two times   differentiable with $\left|f(x)\right|\leq1,\forall x\in\mathbb{R}$   and $f^2(0)+\left(f'(0)\right)^2=4$. Prove that there exists at least   one $x_0\in\mathbb{R}$, such that $f(x_0)+f''(x_0)=0$.   I have tried the usual Rolle method by $e^x$, but didn't go far... Any help available?


I use Xcode. I want to use bash to batch modify the UI fonts.  Here is the code to ".xib" and ".storyboard":  xibd(){      cd "$(dirname "$1")/.." && pwd      find . -type f -name "*.xib"  -exec  sed -i '' s/'\<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"\/\>'/'\<fontDescription key=\"fontDescription\" name=\"PingFangSC-Regular\" family=\"PingFang SC\" pointSize=\"12\"\/\>'/ {} +       find . -type f -name "*.storyboard"  -exec  sed -i '' s/'\<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"\/\>'/'\<fontDescription key=\"fontDescription\" name=\"PingFangSC-Regular\" family=\"PingFang SC\" pointSize=\"12\"\/\>'/ {} +  }   I want to combine -name ".storyboard" and -name ".xib", how to achieve it?  I tried   find . -type f -name '*.storyboard'  -o  -name  "*.xib"  -exec  sed -i '' s/'\<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"\/\>'/'\<fontDescription key=\"fontDescription\" name=\"PingFangSC-Regular\" family=\"PingFang SC\" pointSize=\"12\"\/\>'/ {} +   find . -type f -name "*.xib|storyboard"  -exec  sed -i '' s/'\<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"\/\>'/'\<fontDescription key=\"fontDescription\" name=\"PingFangSC-Regular\" family=\"PingFang SC\" pointSize=\"12\"\/\>'/ {} +   it does not work.  I have read the related of man find.  Still working on it.

Why in Linux (Debian 8)  touch 1.cpp 1.h find . -name "*.cpp" -o -name "*.h" -exec echo {} \;   outputs only 1.h while  find . -name "*.cpp" -o -name "*.h"   outputs both? Is it a bug or feature?


In java, I usually use  boolean x = a? b : c;   instead  if(a)     boolean x = b; else     boolean x = c;   Is there any possibility for doing that in python?

If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?


I am implementing a simple website which has a toggle sidebar. I want to make the sidebar be hidden when I clicked somewhere on the page except the sidebar. So I think that I should get all elements on the page except a element that has sidebar class. Is there any way to do like that with plain javascript? JQuery has :not() select for this, but I'm trying to not using JQuery... :(

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area.  Is something like this possible with jQuery?  $("#menuscontainer").clickOutsideThisElement(function() {     // Hide the menus });


What is the difference between "I expected" and "I had expected"?

What are the difference between the following sentence?    I ate apples. I have eaten apples.    When should we use simple past tense? When should we use perfect past tense?


Ok guys, so I have this code:  var q=(function(){     var u,q,x;     x=616;     q=q_construct();     qp_construct();     return q;     function q_construct(){         var q,pro;         q={             a:1         };         return q;     };     function qp_construct(){         console.log('1 ⇒    ',q,x);         Object.defineProperty(Object.prototype,'q',{get:function(){             console.log('2 ⇒    ',q,x);             var r={b:2};             return r;         }});     }; })();   When I enter y={z:616}; y.q; into the console, I get:  1 ⇒  Object {a: 1} 616  y={z:616}; y.q;                 //  console entry point  2 ⇒  Object {a: 1} 616 Object {b: 2}   Yet if i change:  var r={b:2}; return r;   to  var q={b:2}; return q;   the result changes from:  2 ⇒  Object {a: 1} 616   to  2 ⇒  undefined 616   I can not find out why, when setting this variable name to q, the q from the inherent scope is redefined as undefined.  Something is niggling in the back of my head, saying I read something on "hoisting" that might help?

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I want to install google-chrome-stable debian (.deb) package but it doesn't install. The process succeeds, but Google Chrome doesn't appear. I use this command:  sudo dpkg -i /home/aakaashsingh/Downloads/google-chrome-stable.deb

How do I install a .deb file via the command line?


How can i check if the creditcard is VISA Debit or Visa Electron? I found this example, but i don't know anything about creditcard algortime.  I know how the functions works, i am just asking how i can check if it's a VISA ELECTRON or VISA DEBIT card. Currently it only supports VISA Debits, but it need to make a check for VISA ELECTRON  $cards = array(     "visa" => "(4\d{12}(?:\d{3})?)",     "visaelectron" => "??????????????????????????",     "amex" => "(3[47]\d{13})",     "jcb" => "(35[2-8][89]\d\d\d{10})",     "maestro" => "((?:5020|5038|6304|6579|6761)\d{12}(?:\d\d)?)",     "solo" => "((?:6334|6767)\d{12}(?:\d\d)?\d?)",     "mastercard" => "(5[1-5]\d{14})",     "switch" => "(?:(?:(?:4903|4905|4911|4936|6333|6759)\d{12})|(?:(?:564182|633110)\d{10})(\d\d)?\d?)", );   Thanks!

I'm trying to figure out how to detect the type of credit card based purely on its number. Does anyone know of a definitive, reliable way to find this?


Let's say I run a command which takes a long time to do its stuff, but I don't want or need to look at it the whole time, and as I need to do some other stuff as well I might get into that and forget to check on how the command is doing for some time... Then when I finally do check I may find that the command finished 3 hours ago and needed my attention then... Or perhaps it didn't need my attention, if I had seen that it had finished at the time I would have had more time to run more commands...  So I was wondering if there is a way to get it so that when a command or program has been run, whenever it finishes and returns to $, for it to make a little sound, like play an mp3 file or something? Though it would be acceptable just to get this working in gnome-terminal, I would like it in as many CLI environments as possible including the TTYs if that would be possible... I am running Ubuntu GNOME 15.10 with GNOME 3.18.

I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need to keep checking, but will instead be notified through a sound.


New to Linux as of 5 days ago..all good just 1 issue, please help   I get this whenever i try to update using apt-get update.  W: The repository 'cdrom://Ubuntu 16.04.1 LTS _Xenial Xerus_ - Release amd64 (20160719) xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'http://archive.ubuntu.com/ubuntu Xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'http://archive.getdeb.net /ubuntu Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository '

Every time I try update (using sudo apt-get update) my Ubuntu I get this problem:  W: The repository 'cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.   How can I fix it? I use Ubuntu 16.04 LTS


My organization has a mishmash of apex classes, both regular classes that execute specific business logic and test classes that execute unit tests on those regular classes. When we started developing on the platform we really didn't know what we were doing, so we didn't enforce any kind of naming convention on class names. For example, one developer might have created a class called ShowDay and an accompanying test class called ShowDayTest. Another developer might have a class called Host_Validate with test class called Host_Validate_Test. There are two problems with this for me:  (1) When looking at a list of all of the classes in the Force.com IDE or in the Salesforce UI, all the classes are there in a big jumble, whether they are test or not. I'd love to be able to see my test classes separate from all others. I can't quite articulate why except for the fact that I just feel like it would help me organize things better.  (2) The inconsistent naming convention leads to all kinds of weird class names. It would be nice to have one convention that's clean, consistent, and makes sense. However, I don't want to implement such a convention if it's outside of what's considered "normal."  Are there any best practices here?

I've looked in the Apex developer's guide and a saw the   which has basically only has this:   We recommend following Java standards for naming, that is, classes start with a capital letter, methods start with a lowercase verb, and variable names should be meaningful.   I'm looking for something more in depth, such as end all Controllers with Controller and their tests with ControllerTest, etc.  What is a good set of naming conventions to use when developing on the Force.com platofrm?  It would be preferable if the answer has something that handles custom objects, classes, visualforce pages, and components and not just Apex classes.


I have written a question that did not meet the standards (see below).  I noticed that just by adding uppercase correctly, it meets the standards.  Is this okay?

While trying to ask a question, I got the error message     This question body does not meet our quality standards. Please make sure that it completely describes your problem - including what you have already tried - and is written using proper grammar.    Why am I getting this message? What can I do to get the system to accept my question? Can you be more specific? What are good resources on how to ask high-quality questions?      For more information, see  in the .


I noticed my new MacBook Air getting kinda hot and the fan spinning up when running a 3D game. I know this Laptop is not made for gaming but I like to run a less demanding game from time to time. Also I'm not crazy and wouldn't do this in a already hot environment but technically it should not degrade the Laptop in the long run am I right?

I have a 2010 MacBook Pro MC371 (Core i5, GeForce 320M, 4Gb RAM).   When I launch a game either new one (i.e. Starcraft 2) or rather old (Unreal Tournament 2004, bootcamped) my MacBook gets rather warm, even hot in the top left corner, around the place where magsafe charger is plugged in. The temperature is more than 40C. The fact that confuses me is that this warming occures even when I play old games.  Is that OK?


**Show that $S_n$ is isomorphic to a semidirect product $C_2\ltimes A_n$ ($n\geq2$).**$$\text{---------------------------}$$     The solution boils down to showing that $S_n=A_nC_2$, $A_n\unlhd S_n$ and that $C_2\cap A_n=e$.  I show this below.   Assuming we can do that, then by definition, we have $S_n\cong C_2\ltimes A_n$.$$$$     By the index 2 theorem $A_n\unlhd S_n\implies C_2A_n\le S_n$.  By the fact that all of $A_n$ consists of even functions and the identity and the fact that $\# C_2=2$ therefore can contain at most a transposition which is odd we get $C_2\cap A_n=1$.  Finally $C_2\cap A_n=1$ gives $\#C_2A_n=2n!/2=\#S_n\implies S_n=C_2A_n$.  $$$$Does this seem correct?

In  note, I've read that $\mathbb S_n$ is a semidirect product of the alternating group $A_n$ by $\mathbb Z_2$. So I am trying to define a morphism $\rho: \mathbb Z_2 \to Aut(A_n)$ to show that $\mathbb S_n \cong A_n \rtimes Z_2$. I would appreciate suggestions on how could I define the morphism. Thanks in advance.


Why is it that in so many books they would say something along this line:  private E[] data;//E is a generic type  public ArrayList(int capacity){   data = (E[]) new Object[capacity];//safe casting }   instead of saying   data = new E[capacity];   why use safe casting when you can just declare it this way? does it have anything to with the fact that generic data will be declared during runtime instead of compile time? or does it more or less make no difference??

Due to the implementation of Java generics, you can't have code like this:   public class GenSet<E> {     private E a[];      public GenSet() {         a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array creation     } }   How can I implement this while maintaining type safety?  I saw a solution on the Java forums that goes like this:  import java.lang.reflect.Array;  class Stack<T> {     public Stack(Class<T> clazz, int capacity) {         array = (T[])Array.newInstance(clazz, capacity);     }      private final T[] array; }   But I really don't get what's going on.


So I wanted to download some software, and it says I need to put in my password, but I didn't put a password on my account, so I didn't add a password and clicked authenticate, but it says that my authentication attempt was unsuccessful, what do I do? I can't download anything now... and i'm new to ubuntu as well...

The problem can be reproduced as follows:   When I remove the password of an administrator account, "Log In without Password", I cannot use that account to authenticate. When I do something that requires authentication, I cannot use an admin without a password to authenticate. If I leave the password box blank without a password while choosing a non-password admin, authentication fails (in terminal or in GUI).   How to fix this problem?


I am having difficulties with getting my AMPscript to resolve in the sender profile. I can't get both values to populate for the Sender Name. The from email doesn't resolve at all and I'm not sure if it's because I'm putting in the email address directly with an @ symbol. %%=IIF(EMPTY(AttributeValue("OwnerID")), "Bill", AttributeValue("LeadFirstName") AttributeValue("LeadLastName"))=%%  Here is the from email: %%=IIF(EMPTY(AttributeValue("OwnerID")), "bill@domain.com", AttributeValue("OwnerEmail"))=%%  I want to create dynamic sender profile with a dynamic from name and a dynamic from email with logic that says, if this field has a value, use fields FirstName and LastName. If it is blank, use "Bill".

I'm trying to create a dynamic sender profile where the from name and from email change if a value is present in a specific field of the data extension. I want the Lead First Name value and Lead Last Name values to appear. I'm trying to keep all the logic in the sender profile. %%=IIF(EMPTY(AttributeValue("X")), "Bill", AttributeValue("LeadFirstName") AttributeValue("LeadLastName"))=%%  Not sure why, but doing the test, the script shows up as the sender and isn't resolving.


I have an AJAX code that update a PHP page and I want to hide the AJAX code so the users when view source of the page don't show for them the AJAX code so How can I do it? This is my AJAX code  <script type="text/javascript"> function Ajax(){ var xmlHttp;     try{             xmlHttp=new XMLHttpRequest();     }     catch (e){         try{             xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");         }         catch (e){             try{                 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");             }             catch (e){                 alert("Oops!");                 return false;             }         }     }  xmlHttp.onreadystatechange=function(){     if(xmlHttp.readyState==4){         document.getElementById('ReloadThis').innerHTML=xmlHttp.responseText;         setTimeout('Ajax()',2000);     } } xmlHttp.open("GET","reload.php",true); xmlHttp.send(null); }  window.onload=function(){     setTimeout('Ajax()',2000); } </script>   So how cna I hide this code from view source?

I want to make a JavaScript application that's not open source, and thus I wish to learn how to can obfuscate my JS code? Is this possible?


Assume I am using 4 workspaces and I incidentally need more, is there an automated process or, if impossible, an easy way to incidentally add more workspaces (instead of installing Ubuntu tweak etc. etc.).

I was reading about , however since Compiz is replacing Mutter how do I go about adding and removing workspaces in Compiz version of Unity?


i have been creating an App that uses Fragments Mostly here is how it is supposed to work, on the Home Fragment i click a button that takes me to another Fragment for filling information  on this fragment when I click a button a Dialog Fragment opens and I select a City Name then Submit, it dismisses the Dialog and is supposed to SetText on a TextView.  I use an interface that calls a method on the City Selection fragment in order to set the Text. here is some Code   Declaration for the EditText         EditText editText_From;  Setting finding the View  OnCreate     @Override     public View onCreateView(LayoutInflater inflater, ViewGroup container,                              Bundle savedInstanceState)     {          // Inflate the layout for this fragment         View view = inflater.inflate(R.layout.fragment_trip_date, container, false);          editText_From = view.findViewById(R.id.editText_From);          return view;     }          public void setSelectedCity(String city) {      Log.i("<<269>>", "Setting Text on Edit Text <<269>>:" + city);     editText_From.setText(city);  }   This Method below is supposed to set text for the my EditText or TextView      public void setSelectedCity(String city) {      Log.i("<<269>>", "Setting Text on Edit Text <<269>>:" + city);     selectedCityConfirmed = city;     editText_From.setText(city);  }   the App Crashes on EditText with the Following Error Message,  02-16 19:37:43.928 26582-26582/com.example.bob2609.busticketingapp E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.example.bob2609.busticketingapp, PID: 26582     java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.support.v4.app.FragmentActivity.findViewById(int)' on a null object reference         at com.example.bob2609.busticketingapp.TripDateFragment.setSelectedCity(TripDateFragment.java:188)         at com.example.bob2609.busticketingapp.MainActivity.selectedCity(MainActivity.java:176)         at com.example.bob2609.busticketingapp.LocationSelector$1.onItemClick(LocationSelector.java:69)         at android.widget.AdapterView.performItemClick(AdapterView.java:313)         at android.widget.AbsListView.performItemClick(AbsListView.java:1201)         at android.widget.AbsListView$PerformClick.run(AbsListView.java:3195)         at android.widget.AbsListView$3.run(AbsListView.java:4138)         at android.os.Handler.handleCallback(Handler.java:761)         at android.os.Handler.dispatchMessage(Handler.java:98)         at android.os.Looper.loop(Looper.java:156)         at android.app.ActivityThread.main(ActivityThread.java:6523)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)   The Interface Method on MainActivity    @Override public void selectedCity(String city) {       tripDateFragment.setSelectedCity(city);  }   Anyone knows a way around this?

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?


Does $S = \sum_{n=1}^{\infty}(-1)^n (e- (1+ \frac{1}{n})^n)$  converge or diverge?  My attempt  : I know that  $e = \lim_{n\rightarrow \infty}( 1+ \frac{1}{n})^n$.  Now put the value  e in   given series $S$ , I got $\sum_{n=1}^{\infty}(-1)^n (e- (1+ \frac{1}{n})^n)= \sum_{n=1}^{\infty}(-1)^n (e- e)=0$  so the given series  is converges    is  it  correct????

I am having a lot of trouble with these series questions. Up until this point, I had relatively little trouble with all the questions in the book. These seem to require knowledge about approximations of functions and other external experience-based knowledge, which I just don't have yet.  Determine convergence or divergence of the given series. In the case of convergence, determine whether the series converges absolutely or conditionally.  $$\sum_{n=1}^\infty (-1)^n\left[e-\left(1+\frac 1 n \right)^n\right]$$  It's easy to see that  $$\lim_{n\to\infty}\left[e-\left(1+\frac 1 n\right)^n\right]=0$$  however, in order to apply Leibniz's Rule and show conditional convergence I need to show that the sequence is monotonically decreasing. This doesn't seem doable with straight inequalities, so I tried taking the derivative, which just resulted in an uninterpretable mess. This doesn't even begin to address the question of absolute convergence/divergence.  There are 54 of these questions... I must be missing something really fundamental if they all take this long.


Apple has stopped publishing my apps in appstore, because my appleId has to be enabled with "Two-factor authentication" first. Now I have no MAC nor any iOS Phone / Tablet anymore.  How can I enable "Two-factor authentication" without to be bounded to any physical device. I can still manage the disabled apps in "Apple Store Connect", but I am forced to enable "Two-factor authentication".

I would like to add non-SMS, non-Apple multi-factor authentication to my Apple ID.  Specifically the "code generator"-type  based on  implemented by client apps such as:  Google Authenticator Microsoft Authenticator Yubico Authenticator Authy 1Password LastPass etc.  I do not see any such option. Is this type of authentication available for Apple ID? I am also interested in adding YubiKey or other similar non-SMS hardware or software multi-factor solutions.  Note: I am able to add Apple's proprietary  integrated within iOS and macOS as an alternative to SMS-based . This question is asking instead for a 3rd-party-compatible two-factor mechanism that does not involve using an Apple device signed in to iCloud.  Related:


Is there a way to remove unnecessary header files in my C file?  I can comment each header and check for implicit declaration warnings.  But technically, i feel GCC should be having some extension to enable this check. Please let me know.

I am working on a large C++ project in Visual Studio 2008, and there are a lot of files with unnecessary #include directives. Sometimes the #includes are just artifacts and everything will compile fine with them removed, and in other cases classes could be forward declared and the #include could be moved to the .cpp file.  Are there any good tools for detecting both of these cases?


I want to use the $\pitchfork$ symbol to denote transversal intersection, but when I compile my code, it does not appear. So for example, $\Gamma \pitchfork W$ just comes up like $\Gamma W$. I am using Texmaker.  Would appreciate any help to resolve this issue.  MWE:  \documentclass[10pt]{article} \usepackage{amsmath} \usepackage{graphicx} \usepackage{cite} \usepackage{authblk} \pdfoutput=1 \usepackage{amsfonts} \usepackage{float} \usepackage{mathtools, cuted} \usepackage{lipsum, color} \usepackage[margin=1.8cm]{geometry} \usepackage{amsthm}  \begin{document}  Consider $\Gamma \pitchfork W$  \end{document}

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


This is my question : Let G be a group without subgroups with index 2 (i.ee. there is no subgroup M s.t $[G:M]=2$).prove that every group $H<G$ s.t $[G:H]=3$ is normal in G.  What I thought to do: Let N be a subgroup s.t $[G:H]=3$ so $G/H={N,xN,yN}$ so every $g \in G$ is of the form : $g=n,g=xn,g=yn$ when $n \in \mathbb N$. I tried to prove that for every $g \in G$ : $gNg^{-1} =N$  but without a success.

Generalizing the case $p=2$ we would like to know if the statement below is true.  Let $p$ the smallest prime dividing the order of $G$. If $H$ is a subgroup of $G$ with index $p$ then $H$ is normal.


Back in the early days of the Internet, when 56K modems were considered state-of-the-art, when the modem was disconnected I could still freely browse the pages that I recently visited because they were kept in the browser's cache.  Now, I cannot find this option, at least not in Firefox.  The Internet was disconnected due to a storm, and I tried to open a Wikipedia page I visited just yesterday, but Firefox could not open it.  I tried "File -> Offline mode", but this didn't help: I got a page showing the message "Firefox is currently in offline mode and can't browse the Web."  Is there a way to make Firefox automatically cache pages I visit, so that I can visit them again without Internet connection?

I am on a slow internet connection. I would like to use Firefox to load local copies of websites when it exists and is relatively recent (say one week).   An example usage would be browsing a lot of Wikipedia webpages, coming back to the same ones on a regular basis.  I would like to avoid having to manually specify to save single pages on each website I visit (which is what I guess I would need to do with a plugin like ). And I would also like to avoid having to switch between "work offline" or "work online".   Any suggestions?


The other day I got one of my question on the hot question list, it mad it all the way to the top, in fact :)    So I got thinking how do these get chosen. I noticed there is a number next to the question in the hot questions tab but I could not figure out what this was. this number seems to be a ranking of some sort as the higher it is the higher up the list but it does not match anything I can see like up votes or views.   This got me thinking is there some kind of vote system like the close system that users can vote for a hot question but I cannot see one so maybe it is for high rep users?

I know questions on the "hot" tab of a site homepage are based on some sort of views/velocity criteria, but does anyone know the actual algorithm used?  Background: I was considering a feature-request about the "hot" tab, but I don't have enough information to speak about it intelligently.


My gravatar has been   since I joined in 2009  and has now changed (where not cached) to    Why? I have not changed anything and it changed whilst I was just browsing  the other questions are not answering this case. The gravatar was the same in small and large mode so not gravatar issue.  It seems to be all sites not just Area 51

When I first signed up on a Stack Exchange site and got a profile image, it was this one (see my current user card I'm actually not sure what I look like any more):     Later, I got  and SEDE profiles, and my user image there was a different identicon. Because . I would have a picture of it, but that's the problem. ... Thanks to , I have a picture:     On those two sites, it changed from that purple one to this new one recently:   I don't know when the change happened exactly, but I KNOW I didn't change it (I don't know how to change it, otherwise I would have changed it to my main pink one).  Why did this change? Can I get my other icon back or will I be stuck with this new one?   Also, are the gravatars at Area 51 and SEDE securely generated?    After looking in my profile settings, I really confused (I am seeing my wrong avatar in more and more places since I first posted this.):        Seriously.......    What...?    (I'm using this , but be warned that they will try to IP block you after a certain number of requests to force you to pay... May look for a better alternative later.)


For instance when I run the command -   $ apt-rdepends --build-depends qbittorrent    it gives the output something like -     Build-Depends: debhelper (>= 10)   Build-Depends: dpkg-dev (>= 1.16.1)   Build-Depends: libboost-dev   Build-Depends: libqt5svg5-dev   Build-Depends: libtorrent-rasterbar-dev (>= 1.1.2)   Build-Depends: qtbase5-dev (>= 5.2.0)   Build-Depends: qttools5-dev-tools   Build-Depends: zlib1g-dev   But how do I find which packages for instance use libtorrent-rasterbar-dev which might be in other packages build-depends ? Not depends, recommends or suggests but is a requirement only in build-depends

I would like to find all possible reverse dependencies (no need for recursive reverse dependencies) of a certain package p, that is, I want to find all packages which depend on p. This shall include reverse dependencies on p's source package and also reverse build dependencies.  If I understand it correctly, there are 4 types of reverse dependencies:   r depends on p r depends on source package of p Building r requires p Building r requires the source package of p   I would like to find all of them.  For Debian, there is apt-rdepends -r but the  says:   apt-rdepends cannot do reverse build-dependencies.   For Ubuntu, there is reverse-depends, which seems to let me do what I want but it seems to be Ubuntu specific, as the manual pages states it is      Provided by: ubuntu-dev-tools_0.153_all   Are there reverse-depends-like tools which will work for non-Ubuntu distributions, especially those using deb and rpm packages?


I'm building a website which uses information passed through a URL to pick out information from a database table, but it was brought to my attention that doing this may cause a SQL Injection. As I thought this was only an issue where you were inserting information into a database, I'm a bit confused as to when, how and where you should protect your code.  Currently I have a url which looks like:  www.website.com/article.php?title=title&id=1   Which is shortened in htaccess to www.website.com/article/title/1  In my article.php page I then have:  <?php if(isset($_GET["id"])){$url_id = $_GET["id"];}else{ header("Location: $site_url"); exit(); }; ?> <?php if(isset($_GET["title"])){$url_title = $_GET["title"];}else{ header("Location: $site_url"); exit(); }; ?> <?php $article_sql = "SELECT ...   I currently use mysqli_real_escape_string to prevent SQL Injection threats, but I'm unsure where to use it here. I'm guessing that adding...  ... <?php if(isset($_GET["title"])){$url_title = $_GET["title"];}else{ header("Location: $site_url"); exit(); }; ?> <?php $url_id = mysqli_real_escape_string($url_id); // ADDED $url_title = mysqli_real_escape_string($url_title); // ADDED ?> <?php $article_sql = "SELECT  ...   Should do the trick, but is this correct?

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?


So for this program I don't understand why times is still 0 . Why is count able to increment but times is not? I thought changing the parameter name would change this but I was wrong. Does this have to do with the scope of variables or something entirely different? Thanks1  1  public class Test { 2    public static void main(String[] args) { 3      Count myCount = new Count(); 4      int times = 0; 5      for (int i = 0; i < 100; i++) 6        increment(myCount, times); 7      System.out.println("count is " + myCount.count); 8      System.out.println("times is " + times); 9    } 10 11   public static void increment(Count c, int times) { 12     c.count++; 13     times++; 14   } 15 }   1  public class Count { 2    public int count; 3    public Count(int c) { 4      count = c; 5    } 6    public Count() { 7      count = 1; 8    }   }

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?


I'm trying to populate the sum(total selling price)of child object on to the "total order item value"{currecny data type field} of parent object. Here is the code  trigger Rollup on OSF_Order_Items__c (after delete,after insert,after update,after Undelete) {  set<Id>OpportunityIds=new set<Id>(); if(trigger.isInsert || trigger.isUpdate || trigger.isUnDelete){ for(OSF_Order_Items__c o:trigger.new){ OpportunityIds.add(o.Opportunity__c); } } if(trigger.isDelete) { for(OSF_Order_Items__c o:trigger.old){ OpportunityIds.add(o.Opportunity__c); }} Map<Id,Double>OpportunityMap=new Map<Id,Double>(); for(AggregateResult q:[select Opportunity__c,sum(Total_Selling_Price__c)from OSF_Order_Items__c where Opportunity__c IN:OpportunityIds group by Opportunity__C]){ OpportunityMap.put((Id)q.get('Opportunity__c'),(Double)q.get('expr0')); } List<Opportunity>OpportunitiesToUpdate = new List<Opportunity>(); for(Opportunity o:[Select Id,**convertcurrency(Test_Total_Order_Item__c)** from Opportunity where Id IN:OpportunityIds]){ Double Item =OpportunityMap.get(o.Id); o.Test_Total_Order_Item__c=Item; OpportunitiesToUpdate.add(o); } update OpportunitiesToUpdate; }   Problem: The vaule which was returned was not coorect. for example the value expected is USD 15,561 AND result is USD 11335. I observe 11335 is and euro euivalent of 1556l. my org currency is euro.  i want to display the sum of child along with userdefined currency on to the parent as it is. any luck?

I am confused by the behaviour of Currency fields in Multi-Currency environments. My app does a calculation on day X and stores its result in a record.  The custom page which displays a SUM of those values should always display the same as a database query. But...it does not. If I change Exchanges Rates those values change.  Was it wrong to store currency values in a Currency field, am I querying incorrectly or do I need to display a values that is manually calculated?  How does Multi-Currency and Currency fields work together? When are currency values converted and which conversion rate is taken into account?  I am confused?!


I made the most ridiculous thing. I accidentally disabled both remote logins and database accesses for the Administrator accounts (including the one with Windows Authentication (Administrator account) and sa account on the production server! Please tell me a way that there is a way to access the server with administrator privileges! :(  Is it possible from an installation or some kind of command line etc?  Again, Administrator account IS disabled for SQL Server (but I have remote connection to server, the account itself is working...) So I literally cannot access to the sql instance with admin privileges.

I have a SQL server 2008 instance running. Unfortunately during testing I deselected the sysadmin rights for my login and now can't readd it (because I don't have sysadmin rights).  There are no other sysadmin accounts for the instance except SA.  I was set up for just Windows Authentication so I hacked the LoginMode in the registry to 2 so I could login as SA using Sql Authentication. This does indeed set the login mode to Mixed, however the SA user is disabled by default and I can't reenable it because I am don't have sysadmin rights.  How do I enable the SA login so I can get in and reassign the sysadmin to my normal account? Is there a registry setting for this too or is it stored in the master database?


In Einstein's Field Equations, does it ever make sense to write the Cosmological Constant as: $\Lambda_{\mu\nu}$? It was written this way in a BBC Horizon Programme on Sunday,     But, $\Lambda$ is a constant, so how can it have subscripts? I think they meant to put in a lowercase $g$ (to represent the Metric Tensor) (i.e. $\Lambda g_{\mu\nu}$), or is there some sense in the way they showed it? This is not a duplicate, I'm asking about notation not about whether it is a scalar or not.

Maybe my understanding is just off, but the  is just a scalar, right? What are it's units? Why a scalar? - was a tensor 'cosmological constant' ever considered or is it just not conformable to the math or physics of the field equations?


Are Hunter's Mark / Hex / other spells like that noticeable to the target of the spell?   I've watched Critical Role, and it looks like the only thing the character needs to do is pass a sleight of hand check if they are visible to the target (but Hunter's Mark has a verbal component, not a somatic one?).   The basic question is: Can the target tell in any way if they are now marked, by way of seeing, hearing, or just feeling like, "Oh man, I feel magic on me." Would it make a difference if the target was a magic user, or a commoner, or a beast?

Both spells have a verbal component when casting them, but they can both be cast from 90 feet away, possibly from stealth or while the creature is distracted, so it may not notice the casting.   I'm sure the creature would feel the disadvantage to the chosen ability from Hex (would feel/be clumsier if Dexterity is chosen, or short of breath and tired if Constitution is chosen, etc), but might not know the cause. And would an actual mark appear on the target if Hunter's Mark is cast on it?  Would they maybe need to pass an Arcana check (or passive check, maybe) to discern/notice what's affecting them?


We know from physics that the colour of something comes from the light it reflects.  Dark/Black objects absorb most light while light/white objects reflect most light.  Sunburn is the absorbance of too much light and is bad for your skin's health suggesting that absorbance of light is bad for you.  So why is darker skin better than lighter skin for high sun intesity living conditions? Logically darker skin should absorb more light (and so energy) while lighter skin should reflect most light (and energy).

I don't understand why darker skin is advantageous in hotter climates. Wouldn't it absorb more of the heat? I have heard that it reduces the incidence of cancer, but I would think absorbing more radiation would increase the risk?


Suppose A play a shot in the ground .he go for single.both batsman go for run but A go back to his end at the time B also reached to A's crease but A out of crease but he running side of his crease

See following image. Who is Run-out?    A is crossed the crease and B is crossed half of the pitch. Run-out happening in B's side. Then who is out? A or B?


Currently I am using Nikon D5100 DSLR camera with default kit lens 18-55MM lens. Now I am planning to buy some new lens but i am confuse because still i am new to photography. Mainly I want to do landscape photography and sky photography.But since kit lens is not having very good zooming so can you just suggest me some economic lens which i can use with my Nikon D5100.  Please check out my sample picture and let me know that is this correct time to upgrade to lens of continue with kit lens and learn more.

I am new to dslr's and got a nikon 3000 with 18-55 lens as a gift.  I already see some limitations with the lens for walking about or on trails.  So my question is being new should I go with a 55-200 or 55-300 or is there another step before I go with a telephoto lens.


I just spotted a spam answer in the VLQ review queue on Travel. I wanted to flag but there was no link. So I clicked Delete and then used the history to get to the question and flagged it as spam. But why wasn't that an option in the Review?

, for example, should certainly be flagged for spam. But to do so, I have to click the question title below and find the answer. Why can't there be a Flag button next to the Recommend Deletion button?


How do I compute  $$\int_{|z|=r} x \, dz$$  by use of a parameter?

I have a complex integral $$\int_{|z|=r}x \, dz$$ for the positive portion of the circle.  I know that this integral seems easy enough but I am having trouble with it, and I'm fairly certain my answer is incorrect.  I wanted to use a parameter such that $x=r\cos\theta$, so we then have $dz=dx+i\,dy=dx$ since there is no reason to have have the $i\,dy$ since the imaginary part is equal to $0$.  So now I have the double integral  $$\int^r_0\int^\pi_0 r \cos\theta \, dx$$  which equals $0$ since integration the $\cos\theta$ gives $\sin\theta$ and evaluated from $0$ to $\pi$ makes the integral evaluate to $0$.  Am i misinterpreting part of the question?  Way off base?  The book suggests to also solve the problem by realizing $x=\frac{1}{2}\left(z+\frac{r^2}{z}\right)$ along the circle.  For this portion of the problem I assume that I would integrate the above by $z$ as if it were a normal calculus problem, but I have problems with what to put as upper and lower limits.  Thanks in advance!


I've written identically-titled SX data explorer queries, by mistake. Can I merge them (including merging their star count)? If not, can I make the system forget about one of them (i.e. delete one of them)?

Is it possible to delete or at least hide your own data explorer query when you know you've only been testing something and don't want it to show?


I see from this question that you can transfer a world from PE version to the PC version. ()  Is it possible to go from the PC back to the PE? (IOS)  Basically, my son is only using PE version now. If I got the PC version can you keep the two synchronized and if so how hard is it to do?

Now that I've discovered that I can host a , I'd like to know if is it possible to use the textures and maps of the PC version for the pocket version.  I'm planning to visit Peru and Machu Picchu. It would be really cool to entice them for the voyage by letting them play a  in their favourite video game. Unfortunately, this God of Deceit world looks really sophisticated. I don't believe the Pocket Edition would be able to play it.


As a moderator on HSM, I'm notified when a new meta post is started on HSM meta by a diamond on the top bar lighting up in blue. Here it is, not lit up.    Don't judge the big bright orange 12; we're going through a site self-evaluation as of this screenshot.  On other sites, I'm extremely active on meta, occasionally more so than on the main site itself. I check daily for new and/or active questions.  Proposal: Let users of sufficiently high rep see the same notifications as moderators. This would be quite handy for those active on meta.  One thing to consider, though, is that not all high-rep users are active on meta, and not all users active on meta have a lot of rep. I would guess there is a correlation, but I can't support that hypothesis.    I considered posting this on , but I don't think it should be limited to those with 30k rep.

I'm currently helping out on . One of the most valuable things on new beta sites, especially private/early public betas, is Meta participation - see :  Treat Meta Questions Like Gold It’s not unusual for your meta site to receive significantly less traffic than the main site. The problems begin when you meta starts to get ignored by the community and ignored by the moderators. It is particularly disturbing when users reach out in meta and starts talking about improving the site or asking for help… only to be ignored; No follow-up, only deafening silence  Because of this, Diamond mods get a notification in their inbox for each new question on their Meta, helping ensure that each meta post is addressed. However, wouldn't it be great if Diamond mods weren't the only ones that could do this? The post does say that the community needs to be seeing these questions too. As an involved user, I would really like to be notified of these new questions - it would increase the good I could do the site. How about this?:  Of course, it would be opt-in, not opt-out, and per-site. A feature like this would greatly improve the good that enthusiastic site-builders can do for the site, and would, most likely, increase the overall chances of a site's success.


Prove that if $a_k\ge0$ and $\sum{a_k}$ converges, then $\sum{a_k^2}$ also converges.  I am not far at all, new to trying to prove math expressions... anyways all that I have written is $a{_k^2}\le{a_k}$  It makes sense that if a series is convergent then squaring it would make it converge faster at least as k is getting bigger knowing $\lim\limits_{k\to \infty} a_k=0$ for a convergent series...but how would I show this in general?

If $\sum a_n$ with $a_n>0$ is convergent, then is $\sum {a_n}^2$ always convergent? Either prove it or give a counter example.  Im trying in this way, Suppose $a_n \in [0,1] \ \forall\  n.\ $ Then ${a_n}^2\leq a_n\ \forall\  n.$ Therefore by comparison test $\sum {a_n}^2$ converges.  So If $a_n$ has certain restrictions then the result is true.  what about the general case?  How to proceed further? Hints will be greatly appreciated.


I have a string that is encoded as base64 by using the Convert.ToBase64String() in C#.  I want to decode the same string in Java. How is it possible? I am using:   decodedString = Base64.getMimeDecoder().decode(data);   And it shows this error:     Exception in thread "Thread-6" java.lang.IllegalArgumentException:   Input byte

I have an image that is Base64 encoded. What is the best way to decode that in Java? Hopefully using only the libraries included with Sun Java 6.


Given something like this - where the string contains line breaks and carriage returns; I added the character in to the example for brevity:  AB01 88 99 10 \nHH01 123 123 \nHH02 123 123 \nHH03 123 123 \nXX10 88 99 10 \nHH01 456 789 \nHH02 456 789 \nHH03 456 789 \nXX10 99 10 11   I am trying to extract groups of HH01 to HH03  I'm expecting a result like this.  groups = [         "HH01 123 123\nHH02 123 123\nHH03 123 123",         "HH01 456 789\nHH02 456 789\nHH03 456 789"          ]   I'm trying to extract it with regular expressions, though am not fully understanding what I'm doing.   My expression looks like this: /HH01(.*)HH03/  I can't figure out how to handle the line breaks. I've tried /HH01(.*)HH03/m too.  Can anybody help point me in the right direction?

For example, this regex  (.*)<FooBar>   will match:  abcde<FooBar>   But how do I get it to match across multiple lines?  abcde fghij<FooBar>


I'm writing a description for my game's store page, and I'm having a bit of a trouble with a sentence:  Use plants and animals, collect and channel water... However only with strategy and optimisation you can solve all the levels.  Is the "you can" in the correct order there? Or should it be "can you"? Or this sounds ugly in both ways, and I should restructure it? This question already makes it a bit suspicious so I would be happy if you could suggest something else. Thanks!

I have seen this construction quite often:      Online ads have been around since the dawn of the Web, but only in   recent years have they become the rapturous life dream of Silicon   Valley.   What is the rule there?. When your sentence doesn't start with pronoun + verb, invert them as verb + pronoun?. I know it sounds awkward but is it possible (grammatically correct) to use something similar to:      Online ads have been around since the dawn of the Web, but only in   recent years they have become...   And in any case, does this only work with have (or has)? Maybe it works fine with 'had' but I can't think of an example right now.


Which of this is right and really safe? Using prepared statements:  $stmt= $db->prepare("INSERT INTO books (title) VALUES (?)"); $booktitle=$_POST['booktitle']; $stmt->bind_param('s', $booktitle);    $stmt->execute();   Or using escape function :  $unsafe_variable = $login; $safe_variable = mysqli_real_escape_string($unsafe_variable); $stm=mysqli_query($db,"SELECT post_amount FROM users WHERE login='" . $safe_variable . "'"); $stmone=mysqli_fetch_assoc($stm); $stmtwo=implode($stmone); echo($stmtwo);   Please, help to deal with it.

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 trying to buy a used Merida Scultura Road frame, but the current owner does not know the year of manufacturing. It is possible to extract this information from serial number?  Serial:   WC 93055 B  BI - 1582 BR

This is a canonical question that will hopefully encompass all of the questions we get asking us to determine what year a bicycle was manufactured (how old is my bike, how old is my frame, etc.). Each "answer" should address a different way to determine the manufacturing year of a bicycle. To some extent, these will also help you narrow down the model as well as it will tell you what distinguishing features to look at.  The span of answers would include things such as:      Skiptooth cranks Cartridge bottom brackets (BB30/90 etc) Elliptical chainring Quick releases versus contemporary through-axles How the steerer attaches to the fork (quill vs. threadless)  Braking system (especially with mountain bikes: v-brake, direct pull, etc.)   Shifting ramps and pins on cassettes/sprockets and chainrings (versus flat sprockets) Frame material (e.g., shift from tubular steel to use of CF and hydroformed aluminium)  Frame tubing type (e.g. Reynolds 531 tubing introduced around 1934, still used today; Reynolds 501 tubing introduced around 1983). So a frame with an original 501 decal can't be from the 70', 531 decal doesn't help as much because of the range of years produced. Also, see Decals.   *Decals: style/design, amount, placement, color, etc. can help not only determine models, but also year of manufacture. Many changed decal design for the same model bike often yearly, with special/limited editions even more specific. This applies only if decals are original or have been replaced with the identical design. Tubing decals (Reynolds, Columbus, etc.) also changed designs for same tubing made in different years, although the changes aren't made as often, and manufacturers didn't always put tubing Brand decals on every model. Earlier bikes tended to have less fancy, less colorful, less quantity of decals.   Headbadges: most early bikes had actual "badges", often quite detailed and fancy, made of metal, then plastic, and finally just using decals on the headtube. Most bikes lost their metal badges in the 60's and early 70's, although some brands still have actual badges to this day, but in general a real badge indicates an earlier model bike. Dropout style (including the later inclusion of lawyers lips) Presence or absence of CPSC reflectors (USA only) Manufacturing method (shift from lugs to TIG welding, for example)  Number of gears (shift from 2x5 ten-speed to 3x8, 2x9, 1x11, etc.)  Inspection of lug design: pantographs, cut-out, stampings, custom brazing/filing, chrome, fork crow n sweep, etc. Frame/Fork Braze-ons. Race bikes tended have less braze-ons the earlier the year of manufacture. Most 60's racers and earlier had few or none with cable guides/stops, shifters, bidons, etc. being clamp-on. By the 80's if it was clamp-on, it was a sign of very cheap models and most frames had braze-ons for all cables, with multiple bottle and accessory bosses depending on style and use.   and so forth. Please edit this question if you have an answer that isn't in the index above.   A couple of caveats:   A previous owner could have replaced or upgraded components on a bicycle, so this guide only applies to original equipment There is a delay between the introduction of a technology (such as indexed shifting) and when manufacturers start selling products that use it. Low-end manufacturers may continue using technology that is severely outdated (such as one-piece cranks, freewheels, or quill stems) because it is cheaper to do so. A number of bikes are built in a Retro style, but with modern components.  Dutch bikes, trendy coffee cruisers, and beach cruisers may be modern but appear to be 1950s styling.  These tend to have modern rims and brakes as a giveaway.     Note that bicycles.stackexchange does not do valuations of bicycles. How much your bicycle is worth depends on the location of the buyer and seller, how much the buyer wants the bike, etc. etc. etc.


What are the differences between \newcounter vs \newcount?  So far as my knowledge goes \newcounter is from LaTeX and  \newcount is from TeX. Also, I  \newcounter has an optional automatic reset mechanism. So, if I define \newcounter{mycounter}[section], mycounter is reset to zero every time the section counter is incremented.  Are there any other differences between the two? Are there specific places or situations of their use? And internally, what exactly is used by \newcounter? Is it actually \newcount?

Let's clarify that countdef\mycount=<number> is a bad idea in LaTeX, then clarify appropriate usage of \newcount\mycount vs \newcounter{mycount} in LaTeX.  Background: I only started with TeX last year and before long I got tired of doing everything from scratch. Everyone surely knows what it's like reading The TeXBook. At any one time I had the book at my fingertips with around 10 or so cardboard bookmarks interspersed, jumping from bookmark to bookmark, referring to the index, adding more bookmarks, driving myself towards some solution or other.  I discovered countdef\mycount=<reg number> on page 119, where Knuth just tells you how to use them without any warning. So, as a naive rookie I used them, my solution worked and I had no reason to look further. Sometime later, working in LaTeX, I dredged this out of my memory and got in to trouble using it. I discovered \newcounter{mycount} and didn't look back.  Now that I'm looking into matters more deeply I need to raise the issue again. Back during my initial struggle to understand Plain-TeX, if I'd continued to read on to page 121, where Knuth explains the importance of \newcount, I wouldn't have been asking the first part of my question now. The TeXBook is a vast and complicated book and I think raising this question is a useful awareness raiser of one of the "traps for young players" in delving into Plain-TeX.  Hopefully this explains how I originally fell foul of such a fundamental error and I'm pointing out that others could do the same. Also, as there are many times when using Plain-TeX in creating a LaTeX solution is useful, I'd really like to know the dos and don'ts of \newcount vs \newcounter{} in LaTeX.


I tried to calculate the sine of 30 degrees, just for testing and JS returns 0.49999999999999994. The correct answer is 0.5. Can someone explain why sometimes the calculation in JS going in such way?

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


When a ball is struck, how can we know in which direction both balls will go when ball is struck? I know the angle at which the ball strikes the other ball matters, but how can we calculate that angle?  I've seen some of the videos to get started with elastic collision. Here is the link:    But it assumes that we know the angle at which the ball strikes other ball. May be I am asking too basic question but I am not a Physics guy so I need to understand how to calculate the angle.   Thanks in advance :)

I'm making a billiard game and I have two questions:  How do I find the velocity of two balls when they collide with each other and how do I apply it to both balls?  I already know the angles that they're gonna move, I just need to find the velocity that they'll move in those directions.  My game is in 3D, and I'm using Unity. I don't want to use Unity's built-in physics to compute the result in this case, I'd like to know how to compute it myself.


Hello I have been trying to install anaconda to work with the terminal but I can't find how to add the Conda command to the terminal I tried looking it up but didn't find anything I recently started using Ubuntu and I am really unfamiliar with everything, I realize I need to find a $path somewhere but I don't know what exactly I need to do..    Edit: I need to find how to edit the .bashrc file, I can't find it. thanks in advance.

I tried to install anaconda on my Ubuntu VM (following ), but for some reason the installation skipped on adding anaconda to the PATH variable. I followed instructions  and it somewhat helped. Now I have to call:   export PATH=$PATH:/home/myname/anaconda3/bin   every time. It works (for example, if I want to import numpy) , but obviously not comfortable. how can I solve it so it will work from now?  this is the PATH variable -   PATH="$HOME/bin:$PATH:/home/name/anaconda3/bin"   and echo $PATH returns /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin  when I try to import I get -      >>> import numpy Traceback (most recent call last):   File "<stdin>", line 1, in <module> ImportError: No module named 'numpy'   right now, calling echo $PATH in the in the window where i called source  gives  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ofirarzi/anaconda3/bin:/home/ofirarzi/anaconda3/bin  but in any other window I get   /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin


I'm running my fourth fresh install of Ubuntu. I've tried using the fglrx drivers but it always results in a catastrophic failure where I login to a black screen. I'm using the default xorg drivers but the fan is always at a continuous speed.  My laptop is a Dell Insprion 15 and my video card is an Radeon HD 7730M. How can I control the fans?

Is it possible to set the GPU fan speed using the default free ati driver?  My card (X1900) was deprecated in the fglrx drivers a while back.  The free drivers seem to work with 3D, Compiz and such, but running graphics intensive programs makes my GPU heat up and produce artifacts, while the GPU fan never seems to increase. (When set to 100% in Windows it makes a massively louder noise.)


I would like to get the unique element from an array with specific sequences. For example, initially, I have array as following: array([3, 3, 6, 6, 5, 5, 5, 5, 2, 8, 8])  I would like to get the unique element from the array above and maintain its original order sequence. The sample output as following: array([3, 6, 5, 2, 8])  I know that using numpy.unique() will get the unique elements for the array, but it will return sorted unique elements. However, in my case, I need the output in the original sequence. To generate toy example, here easy for you to just copy & paste arr = np.array([3,3,6,6,5,5,5,5,2,8,8])  At the time I post this, I still working on this, and I wish to get your suggestion so that I could move to the next part of work. Your advice will be highly appreciated. Thank you for your time!

Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this:  def uniq(input):   output = []   for x in input:     if x not in output:       output.append(x)   return output   (Thanks to  for that .)  But I'd like to avail myself of a built-in or a more Pythonic idiom if possible.  Related question:


I would like to rotate an object (white rectangle) towards another object (black rectangle). EDIT: the white rectangle (at the top) has a camera. I finally rotated the camera by 180 around the "y" axis, because it was looking to the right of the image. Now, the goal is to rotate the camera around the "x" axis, by the green angle.  I found some images that explains atan2 :     What I try to do is :    Edit : the green angle seems wrong, here is a new one :    If I refer to the trigonometry circle, I should have a value around -120 :     Would someone know what is happening? Here is the code I am using :      //boxNode is the black rectangle, boxYellow is the white rectangle at the top     //163 degrees      let opposite = boxNode.position.z - boxYellow.position.z     let adjacent = boxNode.position.y - boxYellow.position.y      //-73 degrees     //let opposite = boxNode.position.y - boxYellow.position.y     //let adjacent = boxNode.position.z - boxYellow.position.z      camRadians = atan2(opposite, adjacent)     println("deg: \(convertRad2Deg(camRadians))")   Thanks

I am having some trouble understanding Math.tan() and Math.atan() and Math.atan2().  I have basic knowledge of trigonmetry but the usage of SIN, COS, and TAN etc for game development is very new to me.  I am reading on some tutorials and I see that by using tangent we can get the angle in which one object needs to be rotated by how much to face another object for example my mouse. So why do we still need to use atan or atan2?


Which of these sentences is correct? and why?     There is a car and a bicycle in the yard.      There are a car and a bicycle in the yard.   Which of these should be used in an academic essay?

Is the following correct:     There's a sofa, two armchairs, a TV and a big cage for our parrots.   Or should we change it to:     There's a sofa, there are two armchairs, there's a TV and a big cage   for our parrots.


I got this challenge question on brilliant.org: $\int_{0}^{\pi/4}\sqrt{\tan x} dx$  I first used, $\int_{0}^{\pi/4}\sqrt{\tan(\pi/4-x)} dx$ which simplifies: $\int_{0}^{\pi/4}\sqrt{\frac{1-\tan x}{1+\tan x}} dx$  Then, I used Weierstrass's substitution by using $t=\tan(\frac{x}{2})$ and $dx=\frac{2}{1+t^2}$ and simplified: $2\int_{0}^{\tan(\pi/8)}\frac{1-t}{(1+t)(1+t^2)} dx$  After some manipulation, I calculated the integral to be $I=2\ln(\tan(\frac{x}{2}))-\ln(1+t^2)+c$ and $I(\pi/4)-I(0)=0.53$  But Desmos tells something different:  Have I done something wrong? I have rechecked a few times. But I find no error!

I have been having extreme difficulties with this integral. I would appreciate any and all help. $$ \int \sqrt{\tan x} ~ \mathrm{d}{x}. $$


Lets see how a downvote without a comment explaining the reason, is like a critical sneak attack:   We don't know who did it. We don't know why they did it. The target can't defend him/herself. The target can't adapt and learn from it. The target can't improve what he/she was doing. The one who attacks isn't challenged in absolutely any way.    :P  "Forcing a comment will end in even worse results." at  why? how? ppl doing the harm will complain more? how can that be bad??? less worse than not knowing why we got downvoted, that's for sure.    So I request this alternative message and feature: "If someone, that downvotes, comment in the next 2 hours, all downvotes will be kept, otherwise all downvotes will be cancelled." (this refreshes every 2h after a new downvote) Now that is a great incentive to let someone take an honorable action!    Dup-friend of this +-10 year old question:  Related to , and possibly to also all the ones heavily down-voted and linked from it :P    hot tip:  If you readed til here, make it sure to further read  BEFORE creating your equivalent/duplicate question about this same subject (I wont edit above to keep it as raw as I used to think :))    (Suggestion) Btw, from the comments I came to this:    I think the "taking the downvote personal" instead of being "about the question/answer itself" problem arises from the fact of the personal penalizations we receive (or we see others receiving) when we have little points on that account, like we cant do many things when we have little points.    If we could, for ex. vote something up/down but that vote be "ignored" by the system until we reach a minimum score to validate these votes we cast (so it would keep the votes we cast and our effort on reading and understanding and voting wouldnt be discarded), it would lower the side effect of personalizing the downvote, helping on keeping the feeling about the downvote limited to the question it-self, instead of a personal practical/usage kind of punishment.   In short, let newcomers do all basic things, but only make these actions available to everyone after we have enough points to grant what we did has enough quality to be made public. What would be a further incentive on contributing for sure :)  Obs.: I just found an answer deserving a downvote. The user had just a few points above 100. If I downvoted him, he would be prevented from several actions in the network. I saw other of his answers, they were ok, had effort on it, but I couldnt upvote any of them yet. If I had downvoted I would help the network itself what is good, but I would mess his usability of the network what is bad. So, we that care not only for the network but also for the ppl using it (what is the network w/o ppl? nothing) are thrown in a dilemma. If I downvote he will be forced to put more effort on his answers, what is good, but can he? does he have such time/energy/knowledge? how long his actions will be limited on the network? will he simply giveup? So, I wont downvote his answer right now, and that is bad for the network, but I know (I feel) I am doing the overall right thing, and that is what matters to me. Also, that subject had more than 11K visualizations, and NOBODY downvoted it! someone should begin trying to really understand why as apparently my argumentation is not enough.    (Suggestion) about possible anonymous comments:  I think, if comments could be made anonymously (may be only for ppl with enough score to do so), then they would be more willing to provide help about their downvotes w/o fear of retaliation.

Note: If you're looking for a simple explanation as to why comments aren't required on downvotes, see .   I used to get "upset" (though that is too strong a term) when I got downvoted without comment. If my answer isn't good enough then I'd like to know why. Not only does it improve the answer for the OP but it improves my knowledge too.  Where the down-vote has been explained I've found it useful & it has improved my answer, or forced me to delete the answer if it was totally wrong.  So is there any way we can encourage people to leave a comment? Perhaps they don't lose rep if they explain their down-vote?  I must admit though that I haven't always explained my down-vote either so you could call me a hypocrite. I've also grown a thicker skin over the months of using SO (it seems to have come with the higher rep score ;-)), so I'm less bothered about this now.


I am making a Restful call which is returning me Json and dates are coming in a weird format which looks like following:  /Date(-62135568000000)/   What is easiest way to make it look normal like (January 10, 2016)?  I did come across some of the articles but everything was requiring me to write some regex function. I am thinking that this must be a common problem and there has to be an easy one-liner in Java-script. Any ideas?

I'm taking my first crack at  with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string back that looks like this:  /Date(1224043200000)/   From someone totally new to JSON - How do I format this to a short date format? Should this be handled somewhere in the jQuery code? I've tried the jQuery.UI.datepicker plugin using $.datepicker.formatDate() without any success.  FYI: Here's the solution I came up with using a combination of the answers here:  function getMismatch(id) {   $.getJSON("Main.aspx?Callback=GetMismatch",     { MismatchId: id },      function (result) {       $("#AuthMerchId").text(result.AuthorizationMerchantId);       $("#SttlMerchId").text(result.SettlementMerchantId);       $("#CreateDate").text(formatJSONDate(Date(result.AppendDts)));       $("#ExpireDate").text(formatJSONDate(Date(result.ExpiresDts)));       $("#LastUpdate").text(formatJSONDate(Date(result.LastUpdateDts)));       $("#LastUpdatedBy").text(result.LastUpdateNt);       $("#ProcessIn").text(result.ProcessIn);     }   );    return false; }  function formatJSONDate(jsonDate) {   var newDate = dateFormat(jsonDate, "mm/dd/yyyy");   return newDate; }   This solution got my object from the callback method and displayed the dates on the page properly using the date format library.


I have ubuntu 14.04 on my aws ec2 instance. I ran following command to find out the mysql-server installations and I got multiple results :   dpkg --get-selections | grep mysql     Now I would like to remove the one's not in use, so my question is how to find out which one is in use?  Noob Alert

Shall I install both of them and both of its modules?  apt-cache depends php php   Depends: php7.2   And there is two packages for php cli:  apt-cache policy php7.2-cli  php7.2-cli:   Installed: (none)   Candidate: 7.2.7-0ubuntu0.18.04.2   Version table:      7.2.7-0ubuntu0.18.04.2 500         500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages         500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages      7.2.3-1ubuntu1 500         500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages   The next one:  apt-cache policy php-cli  php-cli:   Installed: (none)   Candidate: 1:7.2+60ubuntu1   Version table:      1:7.2+60ubuntu1 500         500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages         500 http://archive.ubuntu.com/ubuntu bionic/main i386 Packages


Apparently for $p_i\in [0,1)$, it's true that $\prod_i (1-p_i)=0 \Leftrightarrow \sum_i p_i=\infty$.  How can I prove this using Borel-Cantelli? I've said that $p_i = P(X_i=1)$ for some sequence $X_i$ where $X_i$'s are all $0-1$ valued. If $\sum_i p_i=\infty$, then $X_i=1$ infinitely often, so it's impossible for $X_i=0$ for all $i$. Thus $\prod_i (1-p_i)=0.$  But how do I prove the reverse step?

This is supposed to be related to the  (my justification for the independence tag). In Williams' Probability with Martingales, 2BCL is proven and then the following is given as an exercise:  Prove $S \doteq \sum_{n=1}^\infty p_n < \infty \implies \prod_{n=1}^\infty (1-p_n) > 0$ assuming $0 \leq p_n < 1$. Hint: Show that $S < 1 \implies \prod_{n=1}^\infty (1-p_n) \geq 1 - S$.   Proving the hint: I tried to find $\{a_n\}$ s.t. $$\prod_{n=1}^\infty (1-p_n) \geq \prod_{n=1}^\infty e^{a_n} = e^{\sum_{n=1}^\infty a_n} \geq 1 - \sum_{n=1}^\infty a_n \geq 1 - S > 0$$ That is, find $\{a_n\}$ s.t.: 1a. $1 - p_n \geq e^{a_n}$ 1b. $a_n \leq p_n$ I thought of $a_n = \ln(1-p_n)$ (a reason why $p_n < 1$, I guess) Is that right? Edit: Actually, assuming my proof is right, is $S < 1$ used in the proof? If so, where?  From Williams book:


I have the camera tracking an object with a "Track To" Constraint.  After the camera is done tracking the object I want it to continue, but I want to delete the constraint at a certain keyframe and keep the camera set to the exact same coordinates. When I delete the constraint the camera jumps back to it's state before the constraint was added.  How do I get around this? In other words: Can you apply a Constraint?

I have got a beautiful bone constraint:    I would like to be able to enable and disable this constraint without the bone reverting to the original position.  By default, the bone appears to return to it's original starting position when influence is set to 0 or visibility is set to off.  So, for example:   Constraint is "on" or "enabled" - bone follows Hand.L as expected Constraint is "off" - bone stays where it is at this exact moment and does not move.   I would like to be able to 'apply' the constraint without actually deleting the constraint, as I am intending to turn it on and off frequently during animation.


Simple question: about how many hours of gameplay are required to complete Legend of Zelda: Twilight Princess?  I know that it depends upon skill and how thoroughly one explores the game, but can I please have a ballpark estimate of how long I should expect to take to finish the game?

I'm going down my huge backlog of unplayed Steam games and I'm thinking the best way to tackle the list is to go through the shortest games first and then concentrate on the 20+ hour ones. I'm wondering if there's a website or something else that has an estimated amount of gameplay time for games.   Is there anything like that?


I have been debugging some long case expressions in the field calculator and getting frustrated because I have to remember to copy the expression before I test it otherwise I end up having to reenter the expression again, fix the typos, ...  Is there a more efficient way of doing this?  Things like the SQL pane of the the database plugin store past queries.

Is there any way to save frequently used expressions in the selection or field calculator dialogs? Obviously I can cut and paste them into a file where I might save them, but I mean within the context of QGIS like you can do in ArcMap.


I've just bought a stick to download the latest version of Ubuntu Desktop. I downloaded the program from Ubuntu and it is now on the stick. I downloaded it and I see both the file and the ISO file. I open the file folder and all files are listed include "Install" I click on that file and a mt86plus comes up....  I am then asked how do you want to open this file, I tried opening it with 7-Zip and nothing...  Any suggestions?

I would like to see a full how-to guide on how to install Ubuntu.


This is the code, i want my form keep be alive while downloading code from internet and when its finish i want to update html container. When i do this form freeze. I am new to threading and tasking and i need little help. Thanks!   private void buttonGetHTML_Click(object sender, EventArgs e)     {         Task.Run(() => Download(textBoxUrl.Text)).ContinueWith((Download) => htmlContent.Text = Download.Result);     }      private string Download(string url)     {         using (WebClient client = new WebClient())         {             string context = client.DownloadString(url);             return context;         }     }

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.


How can I format a phone number from (###)###-#### to ##########? Is there best way to do that? I can use String.Substring to get each block of  numbers and then concatenate them. But, Is there any other sophisticated way of doing it?

Quick add on requirement in our project.  A field in our DB to hold a phone number is set to only allow 10 characters.  So, if I get passed "(913)-444-5555" or anything else, is there a quick way to run a string through some kind of special replace function that I can pass it a set of characters to allow?  Regex?


I have the following file: cat regex16.txt gives     foo bar baz     bar foo baz     baz foo bar     bar baz foo     foo baz bar     baz bar foo  I want to grep only the lines which end with bar. So, I am using $ symbol to grep for bar. But, I don't get any results. What am I doing wrong here? grep '.*bar$' regex16.txt  Why bar$ isn't working here?

Very new to UNIX but not new to programming. Using Terminal on MacBook. For the purposes of managing and searching word lists for crossword construction, I'm trying to get handy with the Grep command and its variations. Seems pretty straightforward but getting hung up early on with what I thought should be a simple case.  When I enter   grep "^COW" masternospaces.txt   I get what I want: a list of all the words starting with COW.  But when I enter   grep "COW$" masternospaces.txt   I expect to get a list of words ending with COW (there are many such words), and nothing is returned at all.   The file is a plain text file, with every line just a word (or a word phrase with no spaces) in all caps.  Any idea what could be happening here?


So lets say I answer a question and get +1. If there are 7 other answers competing do I get 7 counts towards my progress or only 1 if I upvote all of them?

The definition of the :     Up voted 100 competing answers   doesn't specify whether each upvote on competing answers to the same question counts towards this criteria, or if it's limited to one "point" per question no matter how many additional competing answers you upvote. Can someone explain how it works?


I know that to show this I have to show there’s an injection from the $\varnothing$ to $\{\varnothing\}$. But how can one even define a function on the $\varnothing$?

I meet with term 'empty function' from time to time. It's high time to understand its nature. What is field( set of arguments) and what is image? ( set of value)?


I have been trying for days to get postgresql to work and it did briefly before a restart. How to I set the correct permissions? This is the error I get when I try to start the service after a reboot.  root@kali:~# service postgresql start [....] Starting PostgreSQL 9.1 database server: main[....] The PostgreSQL server failed to start. Please check the log output:  2015-05-24 08:51:21 UTC LOG: database system was interrupted; last known up at 2015-05-24 07:33:08 UTC  2015-05-24 08:51:22 UTC FATAL: could not open file "/etc/ssl/certs/ssl-cert-snakeoil.pem": Permission denied  2015-05-24 08:51:22 UTC LOG: startup process (PID 2505) exited with exit code 1  2[FAIL5-24 08:51:22 UTC LOG: aborting startup due to startup process failure ... failed!  failed!   I have read all the related posts on the subject, they didn’t solve my problem, so it's different. I don’t know exactly how, I can provide any extra info that is required.

This is about Metasploit Framework.   root@kali:~# service postgresql start [....] Starting PostgreSQL 9.1 database server: main[....] The PostgreSQL server failed to start. Please check the log output:  2015-05-23 19:07:58 EDT LOG: database system was interrupted;  last known up at 2015-05-23 16:52:00 EDT 2015-05-23 19:07:58  EDT FATAL: could not open file "/etc/ssl/certs/ssl-cert-snakeoil.pem":    Permission denied 2015-05-23 19:07:58 EDT LOG: startup process  (PID 3466) exited with exit code 1 2015-05-23 19:07:58 EDT LOG:  aborting startup due to startup [FAILss failure ... failed! failed!   My first question is, PostgreSQL was working perfectly. What things triggered this problem suddenly?  Secondly, how to fix this?


Anyone else wonder how the default profile pics for Stack Overflow are generated? It must be generated dynamically as it shows random patterns. Can anyone show an implementation of the algorithm in Java?

Is there a name for the default avatars that are generated for users who do not assign one themselves? Not the avatar of the blank user, but the one made up of shards, shapes, and colours:      Is there an online generator for something like that? See also:


I have committed a few files on master and also merged some of the local branches with master branch. How can I get the list of committed files on the master branch?

I am looking for a simple Git command that provides a nicely formatted list of all files that were part of the commit given by a hash (SHA-1), with no extraneous information. I have tried: git show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d  Although it lists the files, it also includes unwanted diff information for each. Is there another git command that will provide just the list I want, so that I can avoid parsing it from the git show output?


I'm travelling from UAE to London through Fiumicino airport . Do I need an Anairport transit visa for a 2-hour layover in the Fiumicino airport? I hava a valid visa to Uk

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


I have a dataset of 25 instances these instances are divided into 2 classes Green Circles and Blue Squares  data distributed as this graph    I want to predict X's class based on "Likelihood Weighted KNN with k =3"  In normal KNN this is easy  the nearest 3 points are 2 Blue Squares and 1 Green Circle  which means X will be Blue Square   there are more Blue Squares neighbours than Green Circles (2 vs 1)   But What is needed is to find the Likelihood Weighted KNN with k =3  This is my try  In this case we have to calculate the weight (Likelihood) for each instance  Each Green Circle likelihood is $\frac{1}{5} $ , we have 5 Green Circles  While for Blue Squares it is  $\frac{1}{20} $ , we have 20 Blue Squares  Therefore the weights around X will be $\frac{1}{5} $  Green Circle, and $\frac{2}{20} $ Blue Squares.  which means $\frac{1}{5} > \frac{2}{20} $  Then X is Green Circle  Well, this is wrong :(  Can someone help me find the

I am reading about KNN      So I made another example to make things clearer  In this example (Image attached)    You can see there are in total 5 Greed Circles and 20 Blue Squares  by standard KNN (k=3) , X should be a Blue Square   This is obvious 2 Blue Squares vs 1 Green Circle.  But in weighted KNN things are difference  In this case we have to calculate the weight (Likelihood) for each instance  Each Green Circle likelihood is $\frac{1}{5} $ , we have 5 Green Circles  While for Blue Squares it is  $\frac{1}{20} $ , we have 20 Blue Squares  Therefore the weights around X will be $\frac{1}{5} $  Green Circle, and $\frac{2}{20} $ Blue Squares.  which means $\frac{1}{5} > \frac{2}{20} $  Then X is Green Circle  But if try to think of it logically then there are more Blue Squares than Green Circles which means X more likely to be Blue Square than Green Circle.  My question is :  Am I doing anything wrong here? Can someone explain why the equation is showing Green Circle while logic says Blue Square?


Hatched a Grimer which caused the game to crash during the hatch-animation. Clicking on Grimer afterwards, results in a freeze at the stats-screen of Grimer. It also results in freezes for every pokemon I caught after Grimer.  Crashed happened initially on the non-updated version. Tried a re-install (and now am updated to the latest version, i.e. 0.31.0) and still not working.  The phone I was playing on is a Sony Xperia Compact Z1.   Any ideas how to get rid of that bug ?  Bug summary: clicking on Grimer (either in the Pokédex or in the list with all your Pokémons) results in a freeze, so does clicking on the Pokémon left or right (before and behind), likely because the app is already trying to load the image of Grimer.  Update 1: I can click on any pokemon except on Grimer now without a crash but none of the images of any pokemon is loading. The images are only there when the pokemon stats are automatically showing up directly after you caught them. (see Update 3 for an explanation).  Update 2: Android Version 4.4.4  Update 3: After a few crashes and restarts, the pokemon images are back.  Update 4: After a little bit of research, I found that for  (did not work for me and for most of the other users.). Also, I , just to let them know (they might read it, maybe...).  Update 5: Bug is still there in current version (0.33.0)  Update 6: Version 0.35.0, bug is still there  Update 7 (as requested from @Vemonus): in my opinion, it is not a duplicate of  since that question was specifically addressing the arenas (when somebody else put a Grimer there) whereas here we are talking about the situation when you own a Grimer (although the origin of the bug is, of course, the same: Grimer's heavy animation).

Today i was at a arena. A player from the red team put a Grimer there, which causes my game to crash every time I select the arena (Samsung Galaxy S4 mini). All other pokemons i saw so far did not make any problems  I searched a bit, and found out that this is a known bug, e.G.:   Now my question, is there a way to battle in the arena or even select it without crashing my app? Some option like "hide model in arena",changing some smartphone-settings or another trick? Or do i have to wait till a bugifx from niantec comes or somebody else which has a handy which dont crashes with grimer clears the arena, before selecting the arena?  Because somebody could place him there i guess this is only a bug for specific smartphones, but this could be used to exclude a lot of players from arenafighting by only placing grimers in arenas to let the game crash for them, are there some official notes about this from niantec or how to avoid the crash?


I'm having a time in this format like   var time = "22:00:00"   I need to convert this into UTC time format like 1567890764 I'm using this one to convert time into UTC.  Math.floor(new Date().getTime() / 1000) //it return current UTC timestamp   how to pass the "time" variable and get UTC timestamp for that particular time?

Something similar to Unix's timestamp, that is a single number that represents the current time and date. Either as a number or a string.


I just finished setting up a dual boot with Ubuntu and Windows 10 on my HP G6, and I ran into a really frustrating problem. Ever since I finished the install, my screen goes black right after I choose Ubuntu and it finishes loading. I can bypass by changing around the quick splash in grub. Or by opening in recovery and them proceeding to launch normally.   I assume it has something to do with my drivers but they're all active in additional drivers. So it's probably something I need to either change in grub that will stay permanently or find a driver update online.   I'm really new to Linux so any help is really appreciated. Very excited to get into this OS and have some fun. Thanks.

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


Suppose $f:[0,1]\to \mathbb R$ be integrable such that $\displaystyle\int_{0}^{1} f(x) dx = \int_0^1 xf(x) dx= 1$. Define $\displaystyle I= \int_0^1 f(x)^2 dx$ Then find the minimum achieved by $I$. Progress - I think it is $3$, but the answer states something else. Here is the approach- We use CS. $\displaystyle \Big(\int_0^1 f(x)^2 dx\Big)\Big(\int_0^1 x^2 dx\Big) \geq \Big(\int_0^1 xf(x) dx\Big)^2$. This gives $I \geq 3$. This is not the given answer as said and I don't see other approaches other than the CS inequality, as we know nothing about the function. Thanks for your time.

So far I've done this, but I don't know if it will help.  Let $\int_0^xf(t)dt=F(x)$.  Now, $1=\int xf(x)=F(x)x|_0^1-\int_0^1F(x)dx=1-\int_0^1 F(x)dx$. Then, $\int_0^1 F(x)dx=0$.  But I don't know how to keep going.


Every time I follow the directions on my instant steel-cut oats they bubble up and overflow. I am using the microwave instructions.  1/3 cup of oats 1 Cup of water  Microwave on 70% power for 4 minutes  What am I doing wrong? Also am I just a probability wave traveling through space-time?

Whenever I cook oatmeal (whether steel cut oats in a rice cooker or pan, or rolled oats in the microwave), it always overflows. How do you prevent this?   Do you just use a bigger container? Do you just take the pan off the heat or bowl off the microwave when it's about to overflow? I've also heard that if you put dried fruit or something like that along with the oatmeal while cooking, that helps prevent it from overflowing -- is this true?


I want to use equation numbering like this  I tried like this but doesn't work \begin{equation} \begin{cases} \varlimsup_{r \to \infty} \dfrac{\log ^{+} n\left\{U_{k=1}^{N} \Omega\left(\theta_{k}+\varepsilon, \theta_{k+1}-\varepsilon ; r\right), f=0\right\}}{\log r}<\mu, &\text{if } \mu>0 \tag{2.5}\label{e2.5}\\  \varlimsup_{r \rightarrow \infty} \dfrac{\sum_{k=1}^{N} n\left(\Omega\left(\theta_{k}+\varepsilon, \theta_{k+1}-\varepsilon ; r\right), f=0\right)}{\log r}<+\infty, & \text{if } \mu=0,\tag{2.6}\label{e2.6} \end{cases} \end{equation}

As much as I have tried, it doesn't seem possible to use separate labels when using a casesconstruction (from the amsmath package).  Ideally, I would like to be able to write something like  \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} f(x)=\begin{cases}   1&x\geq0\label{positive}\\   0&x<0\label{negative} \end{cases} \end{equation} \end{document}   and later refer to both cases at different places. What would be the best way to achieve this result?