This is the second activity of the app. I have already asked for permission to access location in the first activity.This is the error:  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.livelocationfinder/com.example.livelocationfinder.MapsActivity}: java.lang.NullPointerException: Listener must not be null         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3123)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3266)         at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)         at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)         at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1957)         at android.os.Handler.dispatchMessage(Handler.java:106)         at android.os.Looper.loop(Looper.java:214)         at android.app.ActivityThread.main(ActivityThread.java:7099)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)      Caused by: java.lang.NullPointerException: Listener must not be null         at com.google.android.gms.common.internal.Preconditions.checkNotNull(Unknown Source:11)         at com.google.android.gms.common.api.internal.ListenerHolders.createListenerHolder(Unknown Source:13)         at com.google.android.gms.location.FusedLocationProviderClient.requestLocationUpdates(Unknown Source:14)         at com.example.livelocationfinder.MapsActivity.onCreate(MapsActivity.java:54)         at android.app.Activity.performCreate(Activity.java:7327)         at android.app.Activity.performCreate(Activity.java:7318)         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1275)         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3103)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3266)          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1957)          at android.os.Handler.dispatchMessage(Handler.java:106)          at android.os.Looper.loop(Looper.java:214)          at android.app.ActivityThread.main(ActivityThread.java:7099)          at java.lang.reflect.Method.invoke(Native Method)          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)  2020-04-01 22:44:27.324 30588-30588/com.example.livelocationfinder I/Process: Sending signal. PID: 30588 SIG: 9   This is the code of the onCreate() method and I am getting the error in the last line.  The locationCallback has been initialized in onMapReady() method.   protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_maps);     // Obtain the SupportMapFragment and get notified when the map is ready to be used.     SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()             .findFragmentById(R.id.map);     mapFragment.getMapAsync(this);     fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(MapsActivity.this);     locationRequest = LocationRequest.create();     locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);     locationRequest.setInterval(5000);     fusedLocationProviderClient.requestLocationUpdates(locationRequest,locationCallback,Looper.getMainLooper());

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?


How can I get the write permission for the files residing under /snap directory which is created by snap v.2.44? I cannot do that even with root access and also there isn't any group named snap in /etc/group to enable me to add my user to it to gain any special privilege. Also when I want to chmod the files I get this error :  Read-only filesystem

I have been trying for a long time to change Blender's icon, but no matter what I do, I am not allowed to edit anything in /snap/blender-tpaw/3/.  Here's what I tried:   Editing the files from nautilus without sudo. Editing the files from nautilus with sudo (sudo nautilus in terminal ). Using terminal commands such as cp or rm without sudo. Using terminal commands with sudo (such as sudo cp <source> /snap/blender-tpaw/3/ or sudo rm /snap/blender-tpaw/3/<filename.ext>) Doing everything above in a root terminal (using sudo -i)   In every case I get the following error:  cannot remove/copy '/snap/blender-tpaw/3/filename.ext': Read-only file system   where filename is the file and .ext is its extension.  This also applies to other snaps' files, not only Blender.  Am I doing something wrong here? Or is it just impossible to change those files? Although I don't think it is impossible because everything here from Ubuntu to Blender is open-source, so they have no reason to block us from modifying those files.  EDIT:  I used Main Menu (alacarte) to change the icon, but I still want to know why I cannot modify any snap file.


I'm trying to upgrade Ubuntu but there is no new release available.  Output of lsb_release -a:  No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 17.10 Release:    17.10 Codename:   artful   Output of sudo do-release-upgrade:  Checking for a new Ubuntu release No new release found.   Also, when I do Alt+F2 and update-manager -c it says "Failed to download repository information".  New output of cat /etc/apt/sources.list (see comments):  deb http://old-releases.ubuntu.com/ubuntu/ artful main universe restricted multiverse deb http://old-releases.ubuntu.com/ubuntu/ artful-security universe main multiverse restricted deb http://old-releases.ubuntu.com/ubuntu/ artful-updates universe main multiverse restricted     The answer for  didn't solve my problem, I'm still having the same output for sudo do-release-upgrade.  Thanks for any help.

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


How can I mark tags as favorite one so when I log in to Stackexchange site only questions related to that tag.For example when I log in to Stackoverflow site only questions related to C++ appear on my browser.

What are watched tags and ignored tags? How do they work? What are tag subscriptions? What are interesting tags? On Stack Overflow, the content of the main page question list appears to be influenced by watched and ignored tags. How does that work?   For more information, see "" in the .


I want to change my Minecraft username, but I cannot find a way to do this anywhere. Is this possible? If so, how can I do so?

I'm trying to change my Minecraft username. I've logged onto my Mojang account, but can't find where to change my username.  When I log in, it should show me the games by Mojang that I own, as well as my username for them. However, it only shows me "My Gift Codes", and won't let me scroll up or down. I've tried videos, I went to the Mojang help site, and even my best friend isn't having this problem. Any ideas?


Is this correct?  The Heisenberg Uncertainty Principle is not a Principle or law of physics. It's one of many results you can work out from quantum theory with some math:   -- In quantum theory observables can be represented by Hermitian matrices.   -- If an observable of a system can be represented by a particular matrix at a particular instant, then all matrices of the same dimension represent observables of that system.   -- In a state specified by the vector |psi>, an observable X is sharp if and only if X|psi> = x|psi> for some real number x. In which case x is an eigenvalue of X and |psi> is an eigenvector of X.   Now let Y be any matrix that does not have |psi> among its eigenvectors. (For any vector, there exists an infinity of such matrices.)   If the actual state is |psi>, the observable Y cannot be sharp. (Because of the 'if and only if' above.)  EDIT: I'm trying to find out if this line of reasoning is correct. Those other questions don't address this.

To take an example,           Let's think of an electron which ban be in either one of two positions [...] There are two possible states of definite energy for the electron.  Each state can be described by the amplitude for the electron to be in each of the two basic positions.  In either of the definite-energy states, the magnitudes of these two amplitudes are constant in time, and the phases vary in time with the same frequency.  On the other hand, if we start the electron in one position, it will later have moved to the other, and still later will swing back to the first position.   (Feynman derives this behaviour from first principles in chapter 8-6 by solving equations for the state of an ammonia molecule, but that's a nice summary).  This sounds like the uncertainty principle - that you can know energy or position but not both.  Is it possible to derive the uncertainty principle from such an analysis?  Or is the uncertainty principle somehow axiomatic in the way this behaviour is derived?


I am trying to write a script that needs to be run by cron. But because the script depends on some hardware components (can take variable time to execute or even hang), I need to make sure it's not already running to prevent it from piling in memory.  Script name is fan_control.sh, cron is a parameter. Here's what I've come up with so far:  ps aux | grep -w "fan_control.sh cron" | grep -v grep | wc -l   This line returns number of instances running, if it's > 1 then I have to exit. It works exactly as intended. However, to use it, I need to capture output to a variable. I tried both `...` and $(...) methods and was surprised to find out that it would return +1 compared to actual number if instances running. Not understanding what was happening, I just decided to live with it and use > 2 for comparison. Looked like it worked.  However, when I tried running the script via cron, I found out it was returning +2 compared to what I was expecting. If I remove wc -l from the command line, I can actually see extra instances listed (with different PIDs).  UPDATE:  So i've tried what was suggested, here is the script:  #!/bin/bash  if [ "$1" == "cron" ]; then  COUNT_RUNNING=$(pgrep -fc "fan_control.sh cron") if [[ $COUNT_RUNNING > 1 ]]; then date "+%Y-%m-%d %H:%M:%S" echo "Too many instances running ($COUNT_RUNNING), exit." exit; fi fi  [main script contents]   This seems to work fine if called from command line. I've tried calling it simultaneously from two shell windows and I can actually see the message "Too many instances running (2), exit." Now, I add a cron job:  * * * * * /usr/local/user90/fan_control.sh cron > /home/user/cronlog.txt   And cronlog.txt contents is:  2018-03-18 22:20:01 Too many instances running (2), exit. 2018-03-18 22:21:01 Too many instances running (2), exit. 2018-03-18 22:22:01 Too many instances running (2), exit.   So, I've gotten rid of extra process spawned when capturing command output to variable, however, CRON still spawns an extra process. I'm just curious why it's happening?

I am looking for a simple and generic solution that would allow you to execute any script or application in crontab and prevent it from running twice.  The solution should be independent on the executed command.  I assume it should look like lock && (command ; unlock) where lock will return false if there was another lock.  The second part would be like if it acquired the lock, run command and unlock after command is executed, even if it returns error.


I cannot seem to get a paste command to work in a bash script. The command pastes the contents of a range of files together and outputs a new combined file. This is what works outside the script if I wanted to paste file1 through file90 together:  paste file1 file{2..90} > combinedfile   Within the script, which has many variables and other commands pre and proceeding it, it does not. For simplicity, the code in essence:  #!/bin/bash  START=1 END=90  let j=$START+1 paste file1 file{$j..$END} > combinedfile   It seems like there might be some kind of special notation to run this command using defined variables, but I do not know what it is. I've also tried the following:  paste file1 file{"$j".."$END"} > combinedfile paste file1 file${$j..$END} > combinedfile paste file1 file${"$j".."$END"} > combinedfile   I'll get errors like:  ${$j..$END}: bad substitution {847..902}: No such file or directory   Any help would be appreciated.

I want to use $var in a shell brace expansion with a range, in bash. Simply putting {$var1..$var2} doesn't work, so I went "lateral"...   The following works, but it's a bit kludgey.    # remove the split files echo rm foo.{$ext0..$extN} rm-segments > rm-segments source rm-segments   Is there a more "normal" way?


Which sentence is correct?   They won't tell me where is the office.  They won't tell me where the office is.

I believe the sentence in the title is grammatically correct.   Recently I've seen too many people writing it this way:     I'm not sure what is the right way.   Is it grammatically correct as well? Maybe in a different sense? Or simply misuse by non-native speakers?


If someone were to change his face through plastic surgery, would he become immune to the Death Note?

To kill a person using the Death Note, you are required to think of their face while writing their name.   If the Death Note user last saw a person decades ago when he was a child, but has no idea what he looks like now, can he kill the person by remembering the childhood face?


Diff is a great tool to display the changes between two files. But how to display the similarities of two text files (while ignoring the differences)?  I.e. sample input:  a: Foo Bar X Hello World 42  b: Foo Baz Hello World 23   Pseudo output (something like this):  @@ 2,3 =Hello World   Just sorting both files and using comm is not enough, because in that case the line information is lost.


I have a new project with existing code. And I saw that in one method was used a stream without 'using' statement:   private FileInfoRequest ParseFileInfoRequest(Stream body)         {             try             {                 var sr = new StreamReader(body, Encoding.UTF8);                 return JsonConvert.DeserializeObject<FileInfoRequest>(sr.ReadToEnd());             }             catch (Exception ex)             {                 _log.Error("Could not parse FileInfoRequest", ex);                 throw Thrower.GetThrowError(HttpStatusCode.BadRequest,                     _localization.Api().BadRequestBody,                     UiMessageKey.ApiBadRequest);             }         }   Question is: will this stream clear by GC or I need to write something like:              using(sr)             {                 return JsonConvert.DeserializeObject<FileInfoRequest>(sr.ReadToEnd());             }

I have the following code:  MemoryStream foo(){     MemoryStream ms = new MemoryStream();     // write stuff to ms     return ms; }  void bar(){     MemoryStream ms2 = foo();     // do stuff with ms2     return; }   Is there any chance that the MemoryStream that I've allocated will somehow fail to be disposed of later?    I've got a peer review insisting that I manually close this, and I can't find the information to tell if he has a valid point or not.


I am writing several chemical formulas and reactions and I want to write over a reversible reaction the reaction constants for the Forwards and reverse reaction.  So far I have the following:    But  I would like to have this:    Thanks in advance.  My MWE is:  \immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls} \documentclass[a4paper,11pt,oneside]{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{mathpazo} \usepackage{geometry} \usepackage[colorinlistoftodos]{todonotes} \usepackage{tablefootnote} \usepackage{graphicx} \usepackage{adjustbox} \usepackage{array} \usepackage{mathtools} \usepackage{float} \usepackage{subfig} %, nccmath} \usepackage{siunitx}  \usepackage{mhchem} \usepackage{chemfig}     \usepackage[colorinlistoftodos]{todonotes} \usepackage[autostyle]{csquotes} \usepackage{multirow} \usepackage{xcolor} \usepackage{booktabs} \usepackage{soul} \usepackage{acro} \usepackage{pgfplots} \usepackage{enumitem} \usepackage{lscape} \usepackage{tabularx} \usepackage{nomencl} \makenomenclature \usepackage{amsmath} \usepackage{lipsum} %\usepackage[toc,page]{appendix} %\usepackage{tikz} \usetikzlibrary{intersections, calc} \pgfplotsset{compat=1.14} \usepackage{filecontents} \acsetup{first-style=short} \DeclareAcronym{PFD}{ short = PFD , long = Process Flow Diagram ,  class = abbrev } \DeclareAcronym{PIB}{ short = PIB, long = Polyisobutene (OPPANOL\textsuperscript{\textregistered}), class = abbrev }  \DeclareAcronym{BDIS}{ short = BDIS, long = Process Information Management System, class = abbrev }  \DeclareAcronym{BD}{ short = BD, long = 1-3 Butadiene, class = abbrev }  \DeclareAcronym{IOC}{ short = IOC, long = Octenes isomers, class = abbrev }  \DeclareAcronym{Raf}{ short = Raf, long = Raffinate, class= abbrev }  \DeclareAcronym{VLE}{ short = VLE, long = Vapor-liquid equilibrium, class= abbrev }    \DeclareAcronym{CSTR}{ short = CSTR, long = Continuous Stirred Tank Reactor, class = abbrev }  \DeclareAcronym{wrt}{ short = wrt,     long = with respect to, class = abbrev }  \DeclareAcronym{SQP}{ short = SQP,     long = Sequential quadratic programming, class = abbrev }  \DeclareAcronym{PFR}{ short = PFR,     long = Plug flow reactor, class = abbrev }  \usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex}   \addbibresource{example.bib}  \begin{document} \frontmatter \tableofcontents \listoffigures \listoftables    \mainmatter  \begin{center} \ce{B <=>[k1] A <=>[k2] C} \end{center}  \end{document}

I'm working on the Chemwiki Dynamic Textbook Project at UC Davis, California and I've run into a problem. I need to formulate a symbol containing double harpoons (as in a reversible reaction, e.g. \rightleftharpoons); however, I need to have text both above and below the harpoons. I have an image I can email, but I can't post with an image because I'm new to this.  I can find code for \overleftrightarrow and \underleftrightarrow, but that's not quite what I need. I need both, on the same expression. If anyone has a minute to help me, I would greatly appreciate it!


Rather than computing out the whole Fibonacci sequence and check if $n$ is even and in there, is there a more straightforward way to compute if $n$ is a even Fibonacci number?

The standard way (other than generating up to $N$) is to check if $(5N^2 + 4)$ or $(5N^2 - 4)$ is a perfect square.  What is the mathematical logic behind this? Also, is there any other way for checking the same?


After a fail in the HDD, I am trying to reinstall  (or Lion or whatever other without any particular choice) on a Mac Mini 2011 in an empty HDD.  Guessing because the disk is empty, most , mainly Option (Boot Options), Command+R (Recovery), D (Hardware Diagnostics), do not work, hence I do not know how to finish these tutorials, since the OSX USB Boot do not appear.  The unique keyboard combinations working are Command+Option+P+R for an  and PowerOn + Hold (10 s), for a .  From the hardware: I hear the Startup Sound, the keyboard is working but not the Num|Caps|Hold lights, I have disconnected the mouse or other peripherals, and the monitor and basic electronics apparently works, by sending a failure messages while booting from a Windows 8 USB Bootable media ("The Boot Configuration Data file doesn't contain valid information for an operating system").  I have tested some tricks on making some tricky formatting on the hard disk, plugging in pre-made bootable disks, but up to this moment, no choices made the Mac Mini to get loaded.  Neither Apple Stores accepts me to have the machine reinstalled for free (they don't do "maintenance service").  Question is which tutorial should I follow in this case.

I've just installed a new SSD replacing an HDD in my old (late 2008) iMac. When I switched it on all I got on screen was a question mark.   On the advice of my son I tried cmdR during switch on with no result.   I then tried alt which at least got me a cursor on the screen, but nothing else. Any suggestions? I've got everything backed up on an external Hard Drive, by the way.


I have a requirement where my current table has  id     value 1      newyork 1      boston 1      dallas   I need the following output  id      value 1       newyork, boston, dallas

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


I own a Aspire E 15 laptotp where I installed Ubuntu 18.04 because I fell in love with this OS.  I later discovered that games doesn't run very well on this system because they are simply not designed to, even with compatibility layers like Wine the performances reached are terrible and the hybrid GPU design of my pc doesn't allow me to fully experience the dedicated Nvidia card.    My laptop uses UEFI and some people told me that I would never be able to install W10 in a double boot configuration with Ubuntu, is it true?

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


I tried install git via apt-get install git, and from source using these instructions:  Either way, if I type in git --version, it says I have 1.9.1, instead of 2.7, which is the latest version. I tried to purge git, but on re-install, it is still version 1.9.1 Any ideas on what I did wrong?

Why are packages in the official Ubuntu repositories older than the latest (upstream) versions from Debian Sid, PPAs, the authors, etc.?


very often when I drag the top of windows such as a browser window to move it to another location, Ubuntu expands the window instead. This happens regardless I use an external mouse or a trackpad. Is there a way to solve this problem?

I know this has been asked for other Ubuntu releases, but the solutions posted are not working for me in 14.04. I've installed CCSM and turned off the grid option, but the windows still maximize when dragging to the top of the screen. I've dealt with it for a while but it's getting rather obnoxious. Anyone else had this problem and come across a solution?  EDIT:  This is happening in Gnome Classic, but not Gnome 3


I am on ubuntu vps server and I am running these problem always     cannot create temp file for here-document: no space left on device   from days to days my server stop and the error shown to me that there is no disk space however I changed my space from 96 GB to 192 GB on linode servers  when I run df -h    Filesystem            Size  Used Avail Use% Mounted on  /dev/xvda              47G   45G  1.6G  97% /  devtmpfs              4.0G  112K  4.0G   1% /dev  none                  4.0G     0  4.0G   0% /dev/shm  none                  4.0G   48K  4.0G   1% /var/run  none                  4.0G     0  4.0G   0% /var/lock  none                  4.0G     0  4.0G   0% /lib/init/rw   when It becomes 0% available the problem was in my apache log files after I disabled the logs and removing it it becomes 96% and however I am checking the file space it grows   when I run df -i    Filesystem            Inodes   IUsed   IFree IUse% Mounted on  /dev/xvda            11300032 3933086 7366946   35% /  devtmpfs             1026040    2094 1023946    1% /dev  none                 1026334       1 1026333    1% /dev/shm  none                 1026334      26 1026308    1% /var/run  none                 1026334       2 1026332    1% /var/lock  none                 1026334       1 1026333    1% /lib/init/rw   how can I increase the available free space and I can use from the rest of my 192 GB

I'm using Ubuntu 11.04 and I want to free up some space in my root directory, which is overloaded. I especially want to change the path used for installing applications (they are getting installed directly to the root drive).  Another consideration is that I'm working on a MySQL database server. The server is installed in the root directory itself, so I don't want to  risk losing any data.  Please give me some tips to help sort out this problem.


How do we find the area that the cow can graze?  The question goes as follows--  There is a circular barn house surrounded by a huge grazing field. A cow is tied to the rope ($AB$) at the end $A$ as shown. The length of the rope is half the circumference of the barn. Find the area that the cow can graze.  The left side of the area is obvious but i cannot get a hang of what is happening on the right side..all i can say is that the rope starts to wrap around the barn when the cow goes to the right.  The length of the rope is $16\pi$ units.

A dog is tied to circular pillar by a rope. Radius of this pillar is $1m$ and length of rope is $\pi m$. What is an area where dog can roam?   I tried to find the area of all semicircles and then to find its sum. It is easy to find an area at front side of the pillar. It is $\displaystyle\frac12\pi^2\pi=\frac{\pi^3}{2}$. Problem is how to find remaining area. I tried to write this area using compass and straightedge, but I couldn't. Then I wrote this in AutoCAD and it looks like this: Is it possible to find the exact value of this area?


I have a list of email addresses and I want to check if they are a valid email address for GMail.  Possible email addresses  "admin@gmail.com" "john.smith@googlemail.com" "john5.a.smith@gmail.com" "jane_doe@googlemail.com" "patrick.o'reilly@gmail.com"    However the following wouldn't be valid email address  ".admin@gmail.com" "postmaster.@gmail.com"   This is what I have so a string beginning with a-z or 0-9 following by zero or more of any special character.  re.search("^[a-z0-9]+[\.'\-]*[a-z0-9]+@(gmail|googlemail)\.com$", s)   but it is failing on   "john5.a.smith@gmail.com"

Over the years I have slowly developed a  that validates MOST email addresses correctly, assuming they don't use an IP address as the server part.  I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing 4-character TLDs).  What is the best regular expression you have or have seen for validating emails?  I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.


I want to find the parameters of a logistic function. I read the guide . It has a very clear explanation, but it did not have the final solution that I need.   Now, we will consider a basis logistic function:  $$h_\theta(x^{i})=\frac{1}{1+e^{-\theta_0-\theta_1x}}$$ We want to find $\theta_0$ and $\theta_1$ subject to minimum cost function: $$J(\theta)=-\frac{1}{m}\sum_{i=1}^{m}y^{i}\log(h_\theta(x^{i}))+(1-y^{i})\log(1-h_\theta(x^{i}))$$  We use the notation:  $$\theta x^i:=\theta_0+\theta_1 x^i_1 $$  Then  $$\log h_\theta(x^i)=\log\frac{1}{1+e^{-\theta x^i} }=-\log ( 1+e^{-\theta x^i} ),$$ $$\log(1- h_\theta(x^i))=\log(1-\frac{1}{1+e^{-\theta x^i} })=\log (e^{-\theta x^i} )-\log ( 1+e^{-\theta x^i} )=-\theta x^i-\log ( 1+e^{-\theta x^i} ),$$  and  $$J(\theta)=-\frac{1}{m}\sum_{i=1}^m \left[y_i\theta x^i-\theta x^i-\log(1+e^{-\theta x^i})\right]=-\frac{1}{m}\sum_{i=1}^m \left[y_i\theta x^i-\log(1+e^{\theta x^i})\right],~~(*)$$  where the second equality follows from:  $$-\theta x^i-\log(1+e^{-\theta x^i})= -\left[ \log e^{\theta x^i}+ \log(1+e^{-\theta x^i} ) \right]=-\log(1+e^{\theta x^i}). $$  All I need now is to compute the partial derivatives of $(*)$ w.r.t. $\theta_j$.  As  $$\frac{\partial}{\partial \theta_J}y_i\theta x^i=y_ix^i_j$$ $$\frac{\partial}{\partial \theta_j}\log(1+e^{\theta x^i})=\frac{x^i_je^{\theta x^i}}{1+e^{\theta x^i}}=x^i_jh_\theta(x^i), $$  The above steps are correct, but it did not have the solution for $\theta_0$ and $\theta_1$. We can take the derivative and put it equal $0$. Namely,  $$\frac{\partial J(\theta)}{\partial \theta_0}=y-\frac{e^{\theta_0+\theta_1 x}}{1+e^{\theta_0+\theta_1 x}}=0~~(*)$$  $$\frac{\partial J(\theta)}{\partial \theta_1}=yx-\frac{xe^{\theta_0+\theta_1 x}}{1+e^{\theta_0+\theta_1 x}}=0 ~~(**) $$     Are $(*)$ and $(**)$ correct?   Assume that $y$ and $x$ are known. How do you represent $\theta_0$ and $\theta_1$ by $y$ and $x$?

Take $x \in \{0,1\}^d$ and $y \in \{0,1\}$ and suppose we model the task of predicting y given x using logistic regression. When can logistic regression coefficients be written in closed form?  One example is when we use a saturated model.  That is, define $P(y|x) \propto \exp(\sum_i w_i f_i(x_i))$, where $i$ indexes sets in the power-set of $\{x_1,\ldots,x_d\}$, and $f_i$ returns 1 if all variables in the $i$'th set are 1, and 0 otherwise. Then you can express each $w_i$ in this logistic regression model as a logarithm of a rational function of statistics of the data.   Are there other interesting examples when closed form exists?


Yet I cannot remain in these moments for very long without being reminded of nature's harsh and unforgiving side;  I think about fording a raging glacial river in Denali National Park in Alaska and avoiding a bear as he ravages my two-week supply of food.   I am not sure what punctuation to use here.  My reasoning for currently using the semicolon is the rule of two related sentences.  Would a dash serve this thought better?

When you want to connect two closely related sentences, you can use a semicolon or a dash. (You can also use a dash for other kinds of non-sentential relations). How would you choose whether to use a semicolon or dash?


(Important for readers and AskUbuntu editors: I know my 12.04 has reached its EOL, but I'm asking for an upgrade, so please do not set my question as off-topic.)  I'm using Ubuntu 12.04.5 LTS Precise Pangolin as dual-boot with Windows 7. I know that my installation has reached its End Of Life and I was wondering if I could upgrade from 12.04.5 LTS to 14.04.5 LTS, but with some modifications. My graphics card is not fully supported for the Unity 3D Interface, so I was wondering if I could upgrade to Trusty Tahr, remove Unity somehow and add GNOME (3.x or 2.x, whatever it installs) and use it as my main desktop environment. I have also tried GNOME 3 (using a Debian 8 live DVD) and my PC can handle that. With GNOME 2 (Classic/Fallback Session), no problems at all.  So, can I do so? Can I upgrade to 14.04 and use GNOME as my main desktop environment?  My computer specifications:  Dell Optiplex GX270 SFF (Small-Form-Factor)   Operating Systems: Windows 7 & Ubutnu 12.04.5 LTS Precise Pangolin Partitioning: Windows 7 (/dev/sda2, NTFS, 5.80/40.80 GB free)              dev/sda3 -> Extended Partition (Ubuntu + Swap)              Ubuntu (/dev/sda5, ext4, 5.02/14.00 GB free)              Swap Partition (/dev/sda6, linux-swap, 1020.00 MB) Motherboard: Dell Corp. 0YF936 RAM: 1024 MB (1GB) CPU: Intel Corporation Pentium 4 @ 2.40 GHz Graphics Card: Intel HD Graphics 82865G, 1280x1024 Hard Disk: Western Digital WD600BB-00CA   Thanks in advance,  Bajiru

I followed the instructions for compiling GNOME Shell and it did compile with a few errors here and there but it didn't run. I installed GNOME Shell using sudo apt-get install gnome-shell but I got version 2.31.x, while the latest is 2.91.5 or something. So is there a way for me to install the latest build?   Is there some repository available for the latest build?


I'm very used to my Linux desktop, but in my new job I'm forced to use Windows. For efficiency, I'm veeery used to minimize/maximize using keyboard shortcuts and move/resize windows using alt+mouse. Thus, window titlebars and borders are useless, and I can remove them using Compiz.  My question is: is this remotely possible to be done in Windows Vista? I could manage to quite reduce the borders and title font (minimum is still big, 17pt), but the titlebars still bother me. I also found that Win+M minimizes a window, and I think that would help with the shortcuts also.  No, I'm not looking for a way to hide a titlebar when needed, as explained in the said duplicated question "". I want to preferently remove all titlebars and frames, from all windows, at once. Furthermore, AHK is quite hackish, since I need to write a full blown script to make that work. Isn't there any better solutions in Windows? That's the reason of this question.  As a help to understand how I'm used to live, here's a completely normal [reduced] window of my home computer:

I like playing computer games in windowed mode, as opposed to full screen. I don't like staring at the title bar, frame, and other UI junk. I also don't like seeing other stuff on my desktop around the window. Is there a simple Windows program that will strip the UI chrome off of an arbitrary window from some other application? Extra points for an easy way to put a black screen underneath the window, hiding the desktop.  Note: I'm looking specifically to handle windows that are smaller than my desktop size. There's a variety of 'windowed maximized' options that make a window exactly the desktop size, and positioned so all the UI decorations are off screen. (E.g.: ShiftWindow). I'm trying to strip all the decorations away from a window that's smaller than desktop size.


To reproduce the problem, on a brand new fresh organization I have created two records  insert new List<Account>{     new Account(Name = 'FDD App'),     new Account(Name = 'FDD MatureApp') };   Now, SOQL query select id, name from Account where name like '%app%' returns both records     while SOSL query FIND {*app*} IN ALL FIELDS RETURNING Account (Id, Name) returns only the first record but doesn't return the second record even if I put asterisks around the search term   Why does this happen? Is SOSL Full text search broken in Salesforce and why? Why SOSL fails to find the record with search term in it?  I am not asking about , am I asking how do I find records like "FDD MatureApp" using SOSL. Is this possible to get full text search results to find "FDD MatureApp" record using SOSL by search term "App"?

I have the following SOSL:  FIND {*ball*} IN ALL FIELDS RETURNING Campaign(Name, Subscription_Center_Description__c)   I have the following 3 campaigns that SHOULD show up:   Name: Sportsball, Description: The sport that utilizes a ball and the players will do things with the ball to score many of the points. The one with the correct number of points at the end of the sportsball game will be victory. Name: Baseketball, Description: probably the silliest sport ever invented... Name: Football, Description: The one you play with your arm feet.   Note:   I also have Name: Futbol Description: The one you play with your foots.  But that's not relevant to the question.  The SOSL query is only displaying Sportsball as an acceptable result for the query and I am having a heck of a time trying to figure out why baseketball and football are not showing up.


I'm thinking about applying to PhD programs focused on Deep Learning and Theoretical Neuroscience this fall, and quite frankly I feel like I'm not good enough.  I just started doing research in the past 6 months, and I feel like I'm so far behind my peers its not even funny. I have a paper accepted for a small conference in the fall, but after talking to some folks at Phd programs at places like Stanford or MIT, I hear that students often come in with multiple first author publications. Is this true? I don't know how I can compete with that :/  I want to do research, I love it and have been working 80 hour weeks juggling two RAships and a research internship at a startup this summer, but I just feel like I won't be able to get into a solid background because of my non traditional background.   I'm finishing two Master's degrees, one in Biology and one in Computer science, from Harvard and Georgia Tech respectively. I previously did my undergraduate studies in Cognitive Science from UCSD. My GPA in my masters is a 4.0. I'll have theses written for each program as well.   My undergrad was non technical and weak (some family issues, I finished in 2.5 years without a strong focus on doing particularly well), and my research record is short, if a little intense. I've worked in Industry and have started a small, semi successful ML startup.   Do you have any advice for a nervous kid?

I've looked at the resumes of the type of candidates that get into computer science PhD programs at the top few universities (e.g. Stanford, MIT etc.) and a lot of them seem to have multiple publications (2-4) done during their undergraduate years. Is this representative of the entire pool? Or is this just a self-selected group that puts their resumes online.  I currently have one first-author workshop paper (5 pages), and I wonder how this might affect my chances at entry into these top universities.


I hold an Indian passport and I am flying to Seattle, US from Bangalore, India via LHR, London and the layover is 11 hours. Can I visit London with the US visit visa I have (this is accepted in many countries I heard)?  Do British Airways provide any help in this kind of situation either to visit or stay comfy at airport?

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


How executable locates functions from DLLs exactly? I know that DLL files have entry points but how does the executable locate those entry points with name since everything inside a DLL is 1s and 0s?

How exactly do DLL files work? There seems to be an awful lot of them, but I don't know what they are or how they work.  So, what's the deal with them?


I'm following a tutorial for beginners and I can't figure out what I'm doing wrong despite a lot of time trying to figure it out.  When using the Loop Cut and Slide tool it is behaving differently for me than it does in the video I'm following.  I'll show the images here in a second to give you an example of what I mean.  So for me, after click-selecting my wanted axis, the tool selection only spans as far as the second next edge, where as for the instructor it spans around the entire wall - in this case I'm trying to mark a selection to extrude skirting.  The instructor using the tool:   How the tool behaves for me:   You can see that when creating the two horizontal edges (for the window) using this tool I had the same problem where the selection would only go as far as the second edge intersection it met.

why does the loop-cut-and-slide operation ignore certain faces but happily cut others?the model is symmetrical so it is a bit strange to pick 3 faces that won't get cut. I tried applying it to see if it was just a graphics glitch causing the purple line to not display over everything, but it did end up cutting only what the line was selecting, instead of the whole mesh.    as requested,here's a paste of the blend:


I have a list with 15 numbers in, and I need to write some code that produces all 32,768 combinations of those numbers.   I've found  (by Googling) that apparently does what I'm looking for, but I found the code fairly opaque and am wary of using it. Plus I have a feeling there must be a more elegant solution.  The only thing that occurs to me would be to just loop through the decimal integers 1–32768 and convert those to binary, and use the binary representation as a filter to pick out the appropriate numbers.   Does anyone know of a better way? Using map(), maybe?


I have been trying for hours to add a color scale to my vector layer in order to avoid showing all those boxes in my legend.   But I don't find any solution. I tried the Geoproc plugin without success, it only works with rasters and my layer is a vector. I also tried generating .qml files but the Geoproc plugin did not accept them.   Does anyone have an idea?    I would like a color scale like this but in red:

I have a map with graduated symbology, with 328 unique values. I would like to add a legend to my map (as in the picture), illustrating that light blue indicates low values and dark blue high values.  I have done this in ArcGIS before. Is there a way to do this in QGIS as well?


I came across this sentence in an elementary grammar book:     Another class of animals is fish. Scientists believe there are more than 24,000 kinds of fish. Fish live in the water and come in many shapes and sizes. They have scales, fins, and gills. Most are cold-blooded.   Shouldn’t this be written "Another class of animals are fish" ?  Using “is” doesn’t sound right to me.

Essentially, I wonder that if X is a plural noun, should we use a plural or singular verb in a sentence such as "X are a subject that [verb] ..."? I believe that we should always use the singular verb form there (for example, "Eatable flowers are a subject that comes up ..."). However, I was surprised to find this sentence on the  page:     Eatable flowers are a subject that come up in almost all cooking classes eventually and I am a big fan of them.   as well as this on Google Books:     Tools are a subject that come up at our house from time to time.   I think they are typos, but I would like a double check to be sure.


Hey I'm new to this site. I really like the concept, but I think that it's kinda unfun to use.  For example, what's up with having to put two spaces at the end of each line to get a line break? I've never seen a site where you have to do this before. The other formatting options are also kinda unintuitive, though with the editor, that's okay (it ain't there on the mobile version of the site, though).  Then somehow, when I was posting a comment, even with that double space method, it didn't format correctly (could be a bug). Then, when I wanted to add something to my comment, it said that you can only edit it for 5 minutes after it was posted. The hell?!  Thoughts in my head:     "This website is badly coded!" "Maybe they're making it a pain to use on purpose, so that only hard-working people will be willing to put up with it and they will get less lazy questions and answers." "Either way, there is no excuse for a modern website to not be easy and fun to use!"   Tbh, I hate writing such negative posts, but when I see something like this, I cannot hold back. Just trying to post stuff on this site got me annoyed. What were the people coding this thinking...???    Lol, why did someone add a list...? Well, have it your way. Guess one person's posts are everyone's posts over here.  This question is not identical to that other question, as I am asking about the site in general and its usability. I see, you want me to make a list...     double space for line break can only edit a comment for 5 minutes enter sends comments (is that only here in meta?) (guess it can be useful if you KNOW that it will happen, but it always causes me to send the comment by accident) no editor on mobile site (possibly something that can be added as an improvement?) website confusing for newbies (in many ways...)   In short, it doesn't really feel up to snuff to contemporary website design standards. :/ Not sure how to say it any better than that. Maybe the last point could be fixed by giving new users a comprehensive explanation about how the site works. There was some kind of "website explanation" or something, but it was rather goofy and didn't explain much.  Would be nice to get an answer from the site admins, because they can probably explain best what thoughts and ideas went into the making of their website. But I can understand if they don't have time to answer to some random user feedback. Yet they said: "Feedback is welcome", if I remember correctly.

When I post a question and want to add a new line, I have to press Return two times, or else the next text will appear on the same line.  Is this really supposed to behave this way? If so, why?


Currently, We are getting large file average size is 60 MB .  Here, We have to ways in terms of file processing.  I have two option for doing this:  1. Use File_get_content 2. Use file line by line using fopen   My concern is, How we can save in terms on memory, speeding. So we can utilize resource better.  Another thing, If we use PHP generators (yield) will benefit in this case.  Kindly mentor on this.

fopen is failing when I try to read in a very moderately sized file in PHP.  A 6 meg file makes it choke, though smaller files around 100k are just fine.  i've read that it is sometimes necessary to recompile PHP with the -D_FILE_OFFSET_BITS=64 flag in order to read files over 20 gigs or something ridiculous, but shouldn't I have no problems with a 6 meg file?  Eventually we'll want to read in files that are around 100 megs, and it would be nice be able to open them and then read through them line by line with fgets as I'm able to do with smaller files.  What are your tricks/solutions for reading and doing operations on very large files in PHP?  Update:  Here's an example of a simple codeblock that fails on my 6 meg file - PHP doesn't seem to throw an error, it just returns false.  Maybe I'm doing something extremely dumb?  $rawfile = "mediumfile.csv";  if($file = fopen($rawfile, "r")){     fclose($file); } else {   echo "fail!"; }   Another update:  Thanks all for your help, it did turn out to be something incredibly dumb - a permissions issue.  My small file inexplicably had read permissions when the larger file didn't.  Doh!


I use Spotlight Search frequently to launch apps on my Mac, and it works perfectly. I use Telegram Desktop frequently by typing a few letters in Spotlight Search. I just type a few letters and tap enter and it opens. Simple as that.  However, today it started not finding it. Instead, it shows this:    The app is there, launches perfectly manually from Applications folder:    But in Spotlight Search, it's not being suggested. I've got Applications option ticked in Spotlight options from System Preferences (though I haven't touched it anyway) and it suggests other apps from the Applications folder with no problem. I am on macOS 10.12.6.  How can I fix this problem?

I have a strange issue where Matlab stubbornly refuses to appear in Spotlight search results.  I'm not sure what information to provide besides the fact it clearly exists in Applications:    It even appears in Launchpad just fine:    I don't have anything blocked from being indexed by Spotlight:    And yet, even searching for the exact name in Spotlight only yields some crash log.    The Spotlight search also works just fine for anything else / any other apps, and it updates fine (for example, I just searched it for the screenshots I made, and it found them) so it is not just "stuck".  Any ideas?


Problem:  Let $X_1,..., X_{n_1} \stackrel{iid}{\sim} \text{Binomial}(n, p_1)$ and $Y_1,..., Y_{n_2} \stackrel{iid}{\sim} \text{Binomial}(n, p_2)$. I want to test the following hypotheses:  $$ H_0: p_1 = p_2 \\ H_A: p_1 \neq p_2 $$  My approach so far:  Let $\hat{p}_1 = \frac{ \sum_{i=1}^{n_1} X_i/n }{n_1}$ and $\hat{p}_2 = \frac{ \sum_{i=1}^{n_2} Y_i/n }{n_2}$. Test if these proportions are equal using a chi-squared test of homogeneity (see  for details).  My questions:   Is there a better way to do this test? Letting $p_1$ and $p_2$ be the averages of all individual proportions feels silly because it ignores the distributions of the proportions. Could I let $\hat{p}_1 = (X_1/n, ..., X_{n_1}/n)$ and $\hat{p}_2 = (Y_1/n, ..., Y_{n_2}/n)$ and use a non-parametric ANOVA (like the Kruskall-Wallis test) to test if the vectors of proportions are different? Would this approach be better than my initial proposal?

I have a data set that is a group of participants who accept or reject each of two devices, and I'd like to test if the two devices are accepted at different rates. Summary table like so  Overall Acceptance         Accept  Reject X       124     20 Y       111     33   What's the best statistical test to determine if the difference between X's acceptance rate and Y's acceptance rate is significant?  I'm unused to binary data so out of my depth here.


Okay, I am a newbie java programmer, and am trying to create some java code to read a configuration file that I have created, and return the results. I will give you the code first, then explain what I am trying to do:  public static String read(String property, File file) throws IOException{      FileInputStream in = new FileInputStream(file);     BufferedReader br = new BufferedReader(new InputStreamReader(in));     String line;     String r = "ERROR";     while ((line = br.readLine()) != null) {         if(!line.startsWith("//")){             String[] split = line.split(" ");             if(split[0] == property){                 r = split[1];             }         }     }      br.close();      return r;  }   This is what the actual configuration file looks like, where "hello" is the property, and "world" is the value:  hello world   To explain, the  desired property is taken as a parameter, as well as the location of theconfiguration file.  It will then read each line (ignoring "//") and split it into the property name and value. It will then return the value if it was found, or "ERROR" if the property could not be found.  I then run the following code:  System.out.println(Property.read("hello", new File("config/confix.txt")));   However, every time I run this code, "ERROR" will be printed. I have checked and re-checked my code, and still can't think of what I have done wrong.  Apologies if I have not made myself very clear, so do ask if I need to explain better!

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I have a split A/C system in a room that runs on low 24 hours a day during Summer that unfortunately cannot be connected to any drain or pipe and which therefore requires a bucket to be used to collect the condensate from the condensate drain line in the exterior unit that sits on my balcony in my apartment building.  I have not yet been able to solve this issue.  This is quite frustrating as the bucket has to be emptied every single day (once a day), so I'm looking for a better solution.  Without going into details, connecting the condensation drain line to any drain of any kind, drain line, drainage hole, ground, etc. is not an option, so I need an outside-the-box solution.  The bucket is already quite large and gets quite heavy at the end of the day when it's full, so maybe something that makes the water evaporate faster than normal so that I don't have to empty the water so often?  The A/C Condensate Drain Line seems to empty about 3 Gallons / 12 L per 24 hour period.  Potential solutions:  Humidifier   Are there outdoor-friendly humidifiers that could get rid of 3 Gallons/ 12 L per day?  The tank would not have to hold that much as the drain line would just drip the water constantly into the tank. CONSIDERATIONS: Would I need to use more than 1 humidifier and serialize them?  Can a humidifier handle being on for 24 hours a day for 4 months straight?  Can a humidifier handle the elements (e.g. could rain affect the circuitry or create any electrical issues)?   Plant/Grass garden   My balcony has 37sqft / 3.4 m2 of area to play with but only 1 hour of direct sunlight (although plenty of indirect sunlight) per day, could I create a garden of plants/grass to absorb the water? -CONSIDERATIONS:  How much garden would I need?  Which plants could meet this criteria?  Could the balcony handle the weight of soil + plants + water?   Any other outside-the-box solutions?  Would any of the solutions listed above work?  If so, what specific details would I need to make it work?  Are there any other solutions?

I have a split A/C system in a room that runs on low 24 hours a day during Summer that unfortunately cannot be connected to any drain or pipe and which therefore requires a bucket outside to be used to collect the condensate from the condensate drain line in the exterior unit that sits on my balcony in my apartment building.  This is quite frustrating as the bucket has to be emptied every single day (once a day), so I'm looking for a better solution.    The bucket is already quite large and gets quite heavy at the end of the day when it's full, so maybe something that makes the water evaporate faster than normal so that I don't have to empty the water so often?  Does such a solution exist or am I condemned to a lifetime of emptying the bucket every night during Summer?  ** 14 May 2015 EDIT **  I have not yet been able to solve this issue.  Without going into details, connecting the condensation drain line to any drain of any kind, drain line, drainage hole, ground, pumps, pipes, etc. is NOT an option, so I need an outside-the-box solution.  The A/C Condensate Drain Line seems to empty about 3 Gallons / 12 L per 24 hour period.  Potential solutions:  Humidifier   Are there outdoor-friendly humidifiers that could get rid of 3 Gallons/ 12 L per day?  The tank would not have to hold that much as the drain line would just drip the water constantly into the tank. CONSIDERATIONS: Would I need to use more than 1 humidifier and serialize them?  Can a humidifier handle being on for 24 hours a day for 4 months straight?  Can a humidifier handle the elements (e.g. could rain affect the circuitry or create any electrical issues)?      My balcony has 37sqft / 3.4 m2 of area to play with but only 1 hour of direct sunlight (although plenty of indirect sunlight) per day, could I create a garden of plants/grass to absorb the water? CONSIDERATIONS:  How much garden would I need?  Which plants could meet this criteria?  Could the balcony handle the weight of soil + plants + water?   NEW: Drip Tray + Humidifier Wick   What about something like  plus several of , could that evaporate 3 Gallons / 12L per day? CONSIDERATION: Would they get clogged from dirty city air? How many wicks would I need to evaporate all that water?   Any other outside-the-box solutions?  Would any of the solutions listed above work?  If so, what specific details would I need to make it work?  Are there any other solutions?  CLIMATE:  On the hottest Summer months, the average relative humidity is about 72%, with about 9 mean daily sunshine hours, 1-2 inches of monthly rain, and daily mean temperatures of about 76 F / 24 C (with average highs of 84 F / 29 C). Remember, however, that the balcony only receives about 1 hour of direct sunlight, although plenty of hours of indirect sunlight.    As you can see, it gets VERY dirty due to this being in the inner city next to a large avenue where a lot of cars run through creating a lot of direct air pollution, so any solutions that may clog need to take this into account. This is another reason I want to avoid having to open the balcony doors to empty it every night. In case it helps, the model of the outdoor unit is Mitsubishi MXZ-18TV.


I want to create a div that span the whole real estate of my device exactly like   What I tried doing is to create an header with fixed height but could not create the div below the header to span the remaining height.   //Fixed Header  .fixed-nav {     position: fixed;     width: 100%;     height: 69px;     background-color: #f2333a; }  .x-div {     position: relative;     height: 100%;     background-color: #F2333A;     z-index: 10; }

I am working on a web application where I want the content to fill the height of the entire screen.  The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom.  I have a header div and a content div. At the moment I am using a table for the layout like so:  CSS and HTML    #page {     height: 100%; width: 100% }  #tdcontent {     height: 100%; }  #content {     overflow: auto; /* or overflow: hidden; */ }

...

...

     The entire height of the page is filled, and no scrolling is required.  For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work.  Is there a way to achieve the same effect without using the table?  Update:  Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%.  Update 2:  For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.


I'm in Minecraft Pocket Edition. My command block is set to repeating and always active. I have it attached to a comparator that runs into a block with an iron door on top. The command input I have is  /clear @p[x=~0,y=~0,z=~-2,r=2] tripwire_hook 0 0 {display:{Name:”key”}}  The IDEA is to set off the command block whenever the tripwire hook is within 2 blocks of the door. This works fine UNTIL I try adding the custom name. The Previous Output box keeps saying:  Syntax error: Unexpected “{“: at “_hook 0 0 >>{<  any ideas on how to fix this syntax error? If you don't, do you have any other ways to lock a door and open it when you have a custom names item?

I have seen posts of people that are trying to put command blocks in their world with preset commands in the blocks, and they claim to have them work, but I am having trouble doing the same thing in the Pocket Edition of Minecraft. Usually it says that the “{“ character is unknown, creating a syntax error.


Hi All I've been trying to download software from the software centre and it keeps saying Use this Source instead of install. When I try clicking universe source it never installs and gives me an error. Im new to ubuntu. And am on a fresh install. Any help would be appreciated. Thanks.

Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found:  $ sudo apt-get install vlc Reading package lists... Done                Building dependency tree        Reading state information... Done     E: Couldn't find package vlc


Let $g:\mathbb{R}\rightarrow\mathbb{R}$ be a function of class $C^2$. Show that $$\lim_{h\rightarrow 0}\dfrac{g(a+h)-2g(a)+g(a-h)}{h^2}=g''(a).$$   It seems like an application of mean-value theorem might help: Since $g$ is differentiable, for any $h>0$ there exists $h_1\in(0,h)$ such that $$g(a+h)-g(a)=h\cdot g'(a+h_1).$$ And then since $g'$ is differentiable, there exists $h_2\in(0,h_1)$ such that $$g'(a+h_1)-g'(a)=h_1\cdot g''(a+h_2).$$ Combining the two we have $$g(a+h)-g(a)=hg'(a)+hh_1g''(a+h_2).$$ which doesn't quite get to the desired expression.

I've been trying to understand how the second order derivative "formula" works:  $$\lim_{h\to0} \frac{f(x+h) - 2f(x) + f(x-h)}{h^2}$$  So, the rate of change of the rate of change for an arbitrary continuous function. It basically feels right, since it samples "the after $x+h$ and the before $x-h$" and the $h^2$ is there (due to the expected /h/h -> /h*h), but I'm having trouble finding the equation on my own.  It's is basically a derivative of a derivative, right? Newtonian notation declares as $f''$ and Leibniz's as $\frac{\partial^2{y}}{\partial{x}^2}$ which dissolves into:  $$(f')'$$ and $$\frac{\partial{}}{\partial{x}}\frac{\partial{f}}{\partial{x}}$$  So, first derivation shows the rate of change of a function's value relative to input. The second derivative shows the rate of change of the actual rate of change, suggesting information relating to how frequenly it changes.  The original one is rather straightforward:  $$\frac{\Delta y}{\Delta x} = \lim_{h\to0} \frac{f(x+h) - f(x)}{x + h - x} = \lim_{h\to0} \frac{f(x+h) - f(x)}{h}$$  And can easily be shown that $f'(x) = nx^{n-1} + \dots$ is correct for the more forthcoming of polynomial functions. So, my logic suggests that to get the derivative of a derivative, one only needs to send the derivative function as input to finding the new derivative. I'll drop the $\lim_{h\to0}$ for simplicity:  $$f'(x) = \frac{f(x+h) - f(x)}{h}$$  So, the derivative of the derivative should be:  $$f''(x) = \lim_{h\to0} \frac{f'(x+h) - f'(x)}{h}$$  $$f''(x) = \lim_{h\to0} \frac{  \frac{ f(x+2h) - f(x+h)}{h} - \frac{ f(x+h) - f(x)}{h}  }{h}$$  $$f''(x) = \lim_{h\to0} \frac{  \frac{ f(x+2h) - f(x+h) - f(x+h) + f(x)}{h}  }{h}$$  $$f''(x) = \lim_{h\to0} \frac{  f(x+2h) - f(x+h) - f(x+h) + f(x)  }{h^2}$$  $$f''(x) = \lim_{h\to0} \frac{  f(x+2h) - 2f(x+h) + f(x)  }{h^2}$$  What am I doing wrong? Perhaps it is the mess of it all, but I just can't see it. Please help.


Assume $L$ is the algebraic closure of $\mathbb{F}_p$. Show there exists a unique finite field of cardinality $p^n$ containing $\mathbb{F}_p$. The existence is easy just have to define the splitting field of $X^{p^n}-X$. But what about uniqueness?

This is from A Course in Arithmetic by JP Serre          Theorem 1           ii) Let $p$ be a prime number and let $q = p^f(f \geq 1)$ be a power of $p$. Let      be an algebraically closed field $\Omega$ of characteristic $p$. There exists a  unique subfield $F_q$ of $\Omega$ which has $q$ elements. It is the set of roots of the polynomial$X^q-X$.           iii) All finite fields with $p^f$ elements are isomorphic to $F_q$.      The proof of the last part says          Assertion iii) follows from ii) and from the fact that all fields with $p^f$     elements can be embedded in $\Omega$, since $\Omega$ is algebraically closed.      Can someone explain me how iii) follows fom ii)?


We know the following fact from gorup theory: If $G$ is a group of prime order then it has no nontrivial subgroups.  Lets try to prove the converse statement: If $G$ has no nontrivial subgroups, show that $G$ must be finite of prime order.  Proof: Suppose by contradiction: If $G$ has no nontrivial subgroups $\Rightarrow$  $G$ is infiinite or $|G|\neq p$.  The case when $G$ is infinite we can rule out using .  Suppose that $|G|=n$ where $n$ is composite $\Rightarrow$ $n=pm$ where $p$ - prime and $m\geqslant 2$. Let $a\in G$ such $a\neq e$ then $a^{pm}=e$.   If $a^p\neq e$ then considering the cyclic group of G, namely $H=\left \langle a^p\right \rangle$ $\Rightarrow$ $1<|H|\leqslant m<pm$ this is a contradiciton. If $a^p=e$ then we know that $a\neq e$ and considering the cyclic subgroup of $G$, namely $H=\left \langle a\right \rangle$ $\Rightarrow$ $1<|H|\leqslant p<pm$   So we get two contradiction and it follows that $G$ is finite and its order is prime.  P.S. I think that my post is not duplicate because my solution somewhat is different from given duplicates. And this solution was created by me and it was important for me to understand is it correct or not.

I want to show that if $G$ is a group with more than one element, and that $G$ has no proper non-trivial subgroups. Prove that $|G|$ is prime. (Do not assume at the outset that |G| is finite).  My question is not that how to prove it.  I am saying that suppose $|G|\geq 2$ possibly $|G|=\infty.$ By assumption the only subgroups of $G$ are $\{e\}$ and $G$, i.e., the trivial groups. Let $a$ be non-identity element in $G$. Consider $\langle a\rangle$. Then  $\langle a\rangle=G.$ So $G$ is cyclic.   My question is, why can I say that $G=\langle a\rangle$. I know there are only two subgroups and $\langle a\rangle\neq e$ because $a\neq e$. Therefore we must have $G=\langle a\rangle$. But my problem is why cant I say that consider $a,b\in G$ and then we look at $\langle a,b\rangle$. And then I say $G=\langle a,b\rangle$ and then I cannot say that $G$ is cyclic, and then I will have problem proving question.


I recently read a code snippets about how to reverse a sequence  >> l = [1,2,3,4,5,6] >> print l[::-1]   Output  >> [6,5,4,3,2,1]   How to explain the first colon in bracket?

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


Assume that I have a class in which all members (excluding the indexer) are set to static, should I make the class static?

Here's what :   static class CompanyInfo {     public static string GetCompanyName() { return "CompanyName"; }     public static string GetCompanyAddress() { return "CompanyAddress"; }     //... }       Use a static class as a unit of   organization for methods not   associated with particular objects.   Also, a static class can make your   implementation simpler and faster   because you do not have to create an   object in order to call its methods.   It is useful to organize the methods   inside the class in a meaningful way,   such as the methods of the Math class   in the System namespace.   To me, that example doesn't seem to cover very many possible usage scenarios for static classes. In the past I've used static classes for stateless suites of related functions, but that's about it. So, under what circumstances should (and shouldn't) a class be declared static?


I'm making my schema with tikz and I want to add a background.  To do this, I use the fit but it doesn't take the label of my node. Here is my MWE:  \documentclass{article} \usepackage{xcolor} \usepackage{float} \usepackage{tikz}  \usepackage{siunitx} \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}  \definecolor{mycolor}{RGB}{31,22,70} \definecolor{mycolor2}{RGB}{21,126,251} \begin{document}          \begin{figure}[H]         \centering         \begin{tikzpicture}[             scale=0.8,             transform shape,             %show background rectangle,             background rectangle/.style={fill=gray!10},             box/.style={draw, font=\itshape}             ]             \coordinate (b) at (current page.center);             \node [                 label={[xshift=1cm,yshift=-2cm ]\Large{Cloud central}},              ] (cloud)at(b)[scale=1.3]{\includegraphics[width=3cm]{example-image-a}};             \node[right =-0.1cm of cloud,rounded corners=3mm, label=above:{xx}] (heiafr) [draw,minimum width=4cm,minimum height=5cm] {};             \node [                 label=below:\Large{Edge cloud a},below left = of cloud               ] (eca)at(b)[scale=.7]{\includegraphics[width=3cm]{example-image-a}};             \node [                 label=left:\Large{Edge cloud b}, left =3cm of cloud             ] (ecb)at(b)[scale=.7]{\includegraphics[width=3cm]{example-image-a}};             \node [                 label=above:\Large{Edge cloud c}, above left = of cloud             ] (ecc)at(b)[scale=.7]{\includegraphics[width=1cm]{example-image-a}};             \node [] ()at(eca)[]{\includegraphics[width=1cm]{example-image-a}};             \node [] ()at(ecb)[]{\includegraphics[width=1cm]{example-image-a}};             \node [] ()at(ecc)[]{\includegraphics[width=1cm]{example-image-a}};             \node [label=below:{Orchestrateur}] (sc)at(heiafr)[]{\includegraphics[width=1cm]{example-image-a}};              \draw [thick,mycolor,->](heiafr) .. controls  (cloud).. (eca)node[very near start, above]{Orchestre};             \draw [thick,mycolor,->](heiafr) .. controls  (cloud).. (ecb)node[very near start, right]{};             \draw [thick,mycolor,->](heiafr) .. controls  (cloud).. (ecc)node[very near start, right]{};              \begin{scope}[on background layer]                 \node[fill=mycolor2!20,rounded corners=1mm,draw,thick,dashed,fit=(ecb)(eca)(ecc)(sc),inner sep=7mm](){};             \end{scope}         \end{tikzpicture}         \caption{xxx}     \end{figure}  \end{document}         Here is the output : (I know it's kind of messy)  Thanks

I'm using the fit TikZ library to fit a rectangle around two nodes which include labels. However, the rectangle is only fit around the actual nodes, not about their labels:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{fit}  \begin{document} \begin{tikzpicture}   \node [label=label1,draw] (node1) {Node1}; \node [label=label2,draw] (node2) at (4,2){Node2};  \node[fit=(node1)(node2), draw] {}; \end{tikzpicture} \end{document}     How to fit the rectangle also around the node labels?


With PCRE, how can you construct an expression that will only match if a string is not found.    If I were using grep (which I'm not) I would want the -v option.  A more concrete example:  I want my regexp to match iff string foo is not in the string.  So it would match bar would but not foobar.

I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a regular expression?   Input:  hoho hihi haha hede   Code:  grep "<Regex for 'doesn't contain hede'>" input   Desired output:  hoho hihi haha


I am trying to debug my Android code using Android Studio on an Ubuntu machine, but Android Studio is stopping on adb initialize with error  Cannot run program "/media/aghed/New Volume/all programs/sdk2/sdk2/platform-tools/adb": error=13, Permission denied   I have tried:  sudo chmod 777 adb    on ~/sdk2/platform-tools/   but the permissions are still:  ls -l adb -rw------- 1 aghed aghed 2357745 تشرين 27 14:54 adb   It is not changing???  by the way I am running Ubuntu alongside Windows, not sure if it is relevant...

I have a script that I need to execute on an NTFS partition. The script's permission is set to 600.  I attempted to modify the permissions by running chmod 755 script.sh, which doesn't report a failure or anything - but it also doesn't change the permissions on the file:  $ stat script.sh    File: `script.sh'   Size: 297070      Blocks: 584        IO Block: 4096   regular file Device: 811h/2065d  Inode: 35515       Links: 1 Access: (0600/-rw-------)  Uid: ( 1000/  xxxxxx)   Gid: ( 1000/  xxxxxx) Access: 2010-09-30 14:05:16.041621000 -0700 Modify: 2010-09-30 14:05:05.070157000 -0700 Change: 2010-09-30 14:05:05.070475000 -0700  $ chmod 755 script.sh $ stat script.sh    File: `script.sh'   Size: 297070      Blocks: 584        IO Block: 4096   regular file Device: 811h/2065d  Inode: 35515       Links: 1 Access: (0600/-rw-------)  Uid: ( 1000/  xxxxxx)   Gid: ( 1000/  xxxxxx) Access: 2010-09-30 14:05:16.041621000 -0700 Modify: 2010-09-30 14:05:05.070157000 -0700 Change: 2010-09-30 14:05:05.070475000 -0700   As you can see, it remains unchanged.


what's the pure virtual function?what's the constructor function?  public abstract class AmAbstract {     private String name;     public  AmAbstract(){     }     public  AmAbstract(String name){     } }

Can an abstract class have a constructor?  If so, how can it be used and for what purposes?


I have this string "5,7,6,1" and I want to make an integer array of the size 4 like this: out={5 7 6 1} which out[0]=5 and out[1]=7 and... actually I want to have the number of the string in an integer array but when I print the out the output is the address of the array out like this: [I@152b6651 what's wrong with this code????  public static void main(String[] args) {         String a = new String();         a="5,7,6,1";         int element, temp = 0, ans = 0,j=0;         element = a.length() / 2 + 1;         int[] out = new int[element];         for (int i = 0; i < a.length(); i++) {             if (j < element) {                 temp = (int) a.charAt(i);                 if (temp != 44) {                     ans = ans * 10 + temp;                 } else {                     out[j] = ans-48;                     ans=0;                     j++;                 }                 if(i==a.length()-1){                     out[j] = ans-48;                 }             }         }         int[] array=new int[element];         System.out.println(out);     }

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


<input> for select images:  <input type="file" class="form-control forminputs files photoimg" multiple name="photoimg[]" placeholder="Choose 3 image files" accept="image/png,image/jpeg" id="photoimg" />    I am trying to select at least 3 images. If it is exceeded 3, then it alerts "please select 3" and again automatically opens file browse window.   Up to alert everything works fine but after that file browse window is not opening.   JS code:  $('#photoimg').change(function() {     var files = this.files.length;     if (files > 3)     {         alert("Please select 3 images only(png/jpg)");         document.getElementById("photoimg").click();     }  });   tried with this.click() and  $('#photoimg').click();.   $('#photoimg').click(function() {      alert("clicked");      });   to test it click event was taken, click event was working but still file browse was not working. Why it is not working?

I'd like to make a click event fire on an <input type="file"> tag programmatically.  Just calling click() doesn't seem to do anything or at least it doesn't pop up a file selection dialog.  I've been experimenting with capturing events using listeners and redirecting the event, but I haven't been able to get that to actually perform the event like someone clicked on it.


I sometimes have to write code in JavaScript that handles both null and undefined the same way. For example, a function that removes from an array every item that is either null or undefined. How should I name the function?  removeNullAndUndefined is very long. removeNull is short but imprecise. Ideally I want to name it removeX, where X has the meaning "null or undefined".   Does anyone know a good word for X?

Is there a null coalescing operator in Javascript?  For example, in C#, I can do this:  String someString = null; var whatIWant = someString ?? "Cookies!";   The best approximation I can figure out for Javascript is using the conditional operator:  var someString = null; var whatIWant = someString ? someString : 'Cookies!';   Which is sorta icky IMHO. Can I do better?


What is $\lim_{n \to \infty} 1+ 1/2 + 1/3 +\dots +1/n$. What is $\lim_{n \to \infty} 1- 1/2 + 1/3 +\dots +1/(2n-1)-1/(2n)?$ I feel like $\lim_{n \to \infty} 1+ 1/2 + 1/3 +\dots +1/n$ should be equal with 2, but I'm not sure. Any help is hugely appreciated, because I've never done such exercises before and I couldn't find how to approach them.

Can someone give a simple explanation as to why the       $$\sum_{n=1}^\infty\frac1n=\frac 1 1 + \frac 12 + \frac 13 + \cdots $$   doesn't converge, on the other hand it grows very slowly?   I'd prefer an easily comprehensible explanation rather than a rigorous proof regularly found in undergraduate textbooks.


As I understand it a "console terminal/user" is a user logged into a "console terminal" (CTRL+ALT+ {F1 to F7}) Heres a sequence of what I've done  Boot local machine Login on login screen (console F7) Change to console F1 Login (local, again) ssh -Y user@server startx  This error is produced /usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server  I have lightdm installed. This is the output of systemd status sudo systemctl status lightdm  ● lightdm.service - Light Display Manager    Loaded: loaded (/lib/systemd/system/lightdm.service; indirect; vendor preset: enabled)    Active: active (running) since Fri 2020-06-26 16:00:33 BST; 22h ago      Docs: man:lightdm(1)  Main PID: 3565 (lightdm)     Tasks: 7 (limit: 4915)    Memory: 22.4M    CGroup: /system.slice/lightdm.service            ├─3565 /usr/sbin/lightdm            ├─3577 /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch            └─3639 lightdm --session-child 14 21  Jun 26 16:00:33 server systemd[1]: Starting Light Display Manager... Jun 26 16:00:33 server systemd[1]: Started Light Display Manager. Jun 26 16:00:33 server lightdm[3565]: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: T Jun 26 16:00:34 server lightdm[3594]: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: T Jun 26 16:00:34 server lightdm[3594]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)  I do not know if those error lines are related to the problem I am observing. The suggested linked question does not solve the problem. The linked question seems to be in relation to root privilages and starting startx. I checked my /etc/X11/Xwrapper.config and it already contains allowed_users=console. This is one of the suggested possible answers to that question. There is a third "answer" which is related to sessions over ssh whereas the origional question is not related to this and neither are the two other answers however this does not solve the problem, because it is another question, not an answer. It appears to me that this user might have had the same issue I am having, however it is not clear to me because minimal details are given.

So when i try to use the Xorg command as a normal user, this is the error that it gives me :   /usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server   but i don't understand, what are the "console users"?  and when i switch to root it gives me another error :   _XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed _XSERVTransMakeAllCOTSServerListeners: server already running (EE)  Fatal server error: (EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)  (EE)  Please consult the The X.Org Foundation support       at http://wiki.x.org  for help.  (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. (EE)  (EE) Server terminated with error (1). Closing log file.   So what is going on and what are the reason for each of these errors?   UPDATE: and the output of the command netstat -ln | grep -E '[.]X|:6[0-9][0-9][0-9] is :  unix  2      [ ACC ]     STREAM     LISTENING     18044    @/tmp/.X11-unix/X0 unix  2      [ ACC ]     STREAM     LISTENING     47610    @/tmp/.X11-unix/X1 unix  2      [ ACC ]     STREAM     LISTENING     18045    /tmp/.X11-unix/X0 unix  2      [ ACC ]     STREAM     LISTENING     47611    /tmp/.X11-unix/X1


Water's boiling point is 100 degree Celsius. So water shouldn't remain vapour under 100 degree Celsius. But water remains vapour even in the environment temperature. Why does that happen?

When the sun is out after a rain, I can see what appears to be steam rising off a wooden bridge nearby. I'm pretty sure this is water turning into a gas.  However, I thought water had to reach 100 degrees C to be able to turn into a gas.  Is there an edge case, for small amounts of water perhaps, that allows it to evaporate?


I am a php beginner and in order to create a chart I need a php file with json data, which is created through a database query. My query code looks as follows:  <?php  $servername = "xyz";  $username = "x"; $password = "y"; $dbname = "z";   // Create connection $mysqli = new mysqli($servername, $username, $password, $dbname);  $data1 = [];    $sql = "SELECT ROUND value, timestamp FROM table"; $result = mysqli_query($mysqli, $sql); while ($row = mysqli_fetch_array($result)) {     array_push($data1,[intval($row['timestamp']),doubleval($row[0])]); }  ?>   Now I want to display the code by printing the query so it has a json format like:  [ [12000000000000,5.5],   [12000000000000,5.5],   ....... ]   I tried several things like print_r etc. but nothing quite got me there.

How do I use the json_encode() function with MySQL query results? Do I need to iterate through the rows or can I just apply it to the entire results object?


I always see An HTML editor but surely it would be A HTML editor as the H isn't a vowel nor does it sound like a vowel.  Why is this?

I've seen many people who say:     This is a HTML page.   Yet I've also seen many people who say:     This is an HTML page.   Are both usages equally correct?  Or, which is the grammatically correct one?       Possible Duplicates:


java.lang.NullPointerException: Attempt to invoke virtual method   'android.database.Cursor   com.example.munna.homeauto.DatabaseCreation.getScene()' on a null   object reference   public class Server extends Activity {      DatabaseCreation myDb;     int i;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         //setContentView(R.layout.scenario);          myDb = new DatabaseCreation(this);      }      public void server_check() {         System.out.println("client");         int j;         int k;         Cursor scene = myDb.getScene();//unfortunetly stops when cursor comes to this step         while (scene.moveToNext()) {             System.out.println("client 1");             for (i = 0; i <= 5; i++) {                 scene.getString(i);                 System.out.println("client 2");                 // my code for server message              }          }      } }

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?


New to the forum. I bought a Macbook Pro last year. It has 2 USBC ports. I'd like to set up a 3 monitor system for my home office.   Looking for the least amount of adapters and plugs. I am envisioning plugging my mac in while it's closed and having the display pop up on 3 screens side by side as extended displays and not mirror.   Is this possible? If so, what's the easiest adapter or docking station to pull this off? Also, anyone have suggestions on a 3 monitor holding stand and 3 monitors? I just use basic programs for work, so basic monitors will be fine. I do not watch videos.

I looked for 20 minutes for a post similar to mines, and couldn't find one. Which is interesting to me, because I don't understand why people want to use the display to HDMI instead of using thunderbolt USB-c port natively instead. Before I get to this...I shall ask my question.  I plan on buying a MacBook Pro-2018 15 inch for my home-based business. I need to connect 3 monitors to this laptop. I understand the 15 inch MacBook Pro comes with 4 thunderbolts 3 ports. I plan to buy 3 24-27 inch monitors that are 4k display. Also, I understand that the charger for this laptop uses a Thunderbolt 3 port, which leaves me with 3 left. Will connecting 3 monitors that have Thunderbolt 3 ports leave me with performance issues? Will the refresh rate lower?  Finally, why do I see a lot of post with people using old 2.0 display port to HDMI; why they can use Thunderbolt 3 port natively?


I wanted to post a picture with my question on Stack Overflow, but an error message came up saying "You need at least 10 reputation points to post images" yet I have exactly 10 rep.  Is this a bug or am I misinterpreting the error message?  It says "at least" therefore doesn't that mean my rep has to be >= 10? not >10?

Whats the deal with posting images? I've just spent a long time composing a nice post with images and stuff, only to be told I can't post images unless my rep is 10, but my rep is 10 (on Stack Overflow)! Maybe you mean rep > 10 not rep >= 10?


Which one is correct if I am asking about a group of people that someone is going to meet?  I know that the it should depend if the following word is on singular or plural, but on this case I am not sure as "who is going to the PLACE A" has no indication of plural or singular. Who is going feels right.... but I might be wrong.

In a question like this one, for example,      Who have/has come?    Is the word "who" singular or plural? Or is it both plural and singular?   I have heard it’s plural. Please correct me if I am wrong.


Yesterday I was at a medical conference in which a lot of plots of Point Clouds with linear fits were shown. In many cases the fit seemed (at least to me and colleagues) to be influenced mostly by some outliers, while most of the points seemed to be pretty much random point clouds. I think there is a name for that fallcy but I can't remember. Can you help me? That would help me talk about the problem with the participants.  Also what do you typically recommend to deal with outliers?

I just got some question about the hat matrix in linear models.  My first question is: Why in a balanced one-way layout $(n_1=...=n_c=n_0)$, all leverages $h_{ii}$ have the same value $\frac{1}{n_0}$? I know that $h_{ii}$ is the $(i,i)$ entry in the hat matrix $H=X(X^TX)^{-1}X^T$.  But I couldn't see any relationship between this expression and the result.   My second question is:  when discussing the leverage points in a general linear model, we know that  $$0\leq h_{ii}\leq1$$ $$\sum_{i=1}^n h_{ii}=p$$ where $p$ is the number of parameters to be estimated, and $$Var(\hat {Y_i})=\sigma^2h_{ii}=\frac{\sigma^2}{\frac{1}{h_{ii}}}$$ Then it says $\frac{1}{h_{ii}}$ is roughly the number of observations needed to estimate $\hat{Y_i}$. Why is that?   My third question is:   Continuing with my second question, it then says, if $h_{ii}$ is very close to 1, then variance of the $i$th residual very lose to zero (already know that $Var(E_i)=\sigma^2(1-h_{ii})$)  so $Y_i-\sum_{j=1}^p\hat{\beta_j}x_{ij}\simeq0$.  Isn't this expression for the $i$th residual? Why we can conclude this from 0 variance of residual? I mean, can't $E_i$ be constant so that the variance is also zero?   My last question is:  Continuing with the above, it then conclude that $\hat{Y_i}\simeq Y_i$ and hence almost one degree of freedom needs to be used to just fit this one observation.  Could anyone explain this result to me? Isn't $\hat{Y_i}=Y_i$ exactly what we want?  Since I think it means we estimate the $i$th observation perfectly.


If $m = a_1x + b_1y$ , $n = a_2x + b_2y$ , $a_1b_2 - a_2b_1 = 1$ then prove that $\gcd (m,n) = \gcd (x, y)$   My attempt  Let $c = \gcd (x,y)$ and $d = \gcd (m,n)$   then $c \mid d$  $\frac{d}{c} = \gcd (a_1k + b_1l, a_2k + b_2l) = \gcd \big(k(a_1 + a_2) + l(b_1 + b_2) , a_2k + b_2l \big)$ where $k = \frac{x}{c}$ and $l = \ \frac{y}{c}$  Two observations at this point are that $ \gcd (k, l) = 1$ and $\gcd (a_1 + a_2, a_2) = \gcd (b_1 + b_2, b_2) = 1$  At this point my proof will be complete if I can prove that $\frac{d}{c} = 1$ and hence $d = c$. Unfortunately I don't know how to to do this, so I would appreciate any help.   Update: I thank you all for your answers, although admittedly I don't have enough experience to understand things like Cramer's rule (I guess I'll come back to it once I learn linear algebra).

Problem:     If $(k,l) = 1$, show that $(b_2k-b_1l, a_1l-a_2k) = 1$ for $a_1b_2-a_2b_1=1$   Note: ($a_1, a_2,b_1,b_2,k,l \in \mathbb{Z}$)   Also note that the actual (bigger) problem is:     If $m = a_1x+b_1y$ (Eq1) and $n=a_2x+b_2y$ (Eq2) and $a_1b_2-a_2b_1=1$, prove that $(m,n)=(x,y)$.   I have proved that $(m,n) = d | x \text{ and } d|y$ I am left to prove that $d = (x,y)$, that's why I asked above question.  I had made $m = dk$ and $n = dl$ ($\therefore (k,l)=1$) and after substitution in Eq1 and Eq2 for $x$ and $y$ values I got $d(b_2k-b_1l)=x$ and $d(a_1l-a_2k) = y$. If I can show  $(b_2k-b_1l, a_1l-a_2k) = 1$ then definitely $d = (x,y)$  Method:  Suppose $(b_2k-b_1l, a_1l-a_2k) = d > 1$. Then, $d | b_2k, d | b_1l, d|a_1l,d|a_2k$ must be true.  This implies $d|a_2b_1kl$ and $d|a_1b_2kl$ must be true. Let, $dp = a_2b_1kl \implies a_2b_1 = \frac{dp}{kl}$ and $dq=a_1b_2kl\implies a_1b_2 = \frac{dq}{kl}$  So, $$a_1b_2-a_2b_1=1 \implies \frac{d(q-p)}{kl}=1 \implies kl =d(q-p)$$  I am stuck here. How to prove a contradiction so that $d = 1$?


As shown in the below posted code, I am trying to print and pass the value of feature['geometry'] to the method postgreSQLHelper.queryPostgreSQLForGeoJSON the output of the log-statement: DEBUG:root:feature['geometry']: {'type': 'Polygon', 'coordinates': [[[6.69223420722764, 51.1329165124371], [6.69222819326484, 51.1329081193748], [6.69221180776184, 51.1329013203209], [6.69219149698336, 51.1329073049609], [6.69217949340067, 51.1329244260894], [6.69217956546811, 51.1329430447612], [6.69218526127669, 51.1329578171713], [6.692200130301, 51.1329606289999], [6.69220511560768, 51.1329581192089], [6.69221372090576, 51.1329518135339], [6.69222707128915, 51.132939215911], [6.69223420722764, 51.1329165124371]]]}  which is a valid GeoJSON format, but when I pass the object features['geometry'] to the method I receive an error: self.cur.execute(sql,bindings)  psycopg2.errors.SyntaxFehler: FEHLER: Syntaxfehler bei "type" ZEILE 1: SELECT ST_AsText(ST_GeomFromGeoJSON('{'type': 'Polygon', 'co... Why, despite the fact that the GeoJSON object is well formatted, does this error appear, and how do I fix it? I pass the code: for feature in featuresArray[0:1]:     logger.debug("feature['geometry']: {0}".format(feature['geometry']))     postgreSQLHelper.queryPostgreSQLForGeoJSON(feature['geometry'])


Does anyone have a method to remove the "Ads by Speedcheck" malware?  My mom has it and it completely crippled her computer.  I googled it and just got a bunch of sites (ironically) that were short on info but big on ads.  No "legit" hits (such as SE) came back.  The one blog I did find that didn't look like an obvious ad trap gave instructions that didn't work.  I should probably just smoke the HD and start from scratch, but if anyone knows of a tried and true method I'd like to hear it.  She's using Win 7, which probably makes a difference if your suggestion is manual.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I am trying to prove ex 2.13 from Jech's book on set theory:     Ex 2.13: A limit ordinal $\gamma$ is indecomposable if and only if $\alpha + \gamma = \gamma$ if and only if $\gamma = \omega^{\alpha}$ for some $\alpha$.   I think this is equivalent to proving that the 3 following statement are equivalent:   $\gamma$ is indecomposable (i.e. there are no $\alpha,\beta < \gamma$ s.t. $\gamma = \alpha + \beta$). For every $\alpha < \gamma$, $\alpha + \gamma = \gamma$. There exists $\alpha$ s.t. $\gamma = \omega^{\alpha}$.   I think that I can prove $(1) \rightarrow (3)$ since it seems almost straight forward from Cantor's normal form theorem. I can also prove that $(1) \Rightarrow (2)$ since, for every $\alpha < \gamma$, there exists a unigue $\delta$ s.t. $\alpha + \delta = \gamma$. Given, (1), $\delta \geq \gamma$. But $\delta > \gamma \Rightarrow \alpha + \delta > \gamma$ and we are left with $\delta = \gamma$.   My problem is with the other directions. Any help?

A limit ordinal $\gamma>0$ is said to be indecomposable iff $\nexists\alpha,\beta<\gamma$ such that $\alpha+\beta=\gamma$.  In view of this definition, I’m trying to prove the equivalence of the following statements for limit ordinals $\gamma$:  (1) $\gamma$ is indecomposable.  (2) $\alpha+\gamma=\gamma$ $\forall\alpha<\gamma$.  (3) $\gamma=\omega^\alpha$ for some $\alpha\in\mathrm{ON}$.  I’ve been able to get $(1)\implies(2)$ and $(3)\implies(1)$, but I have nothing more than scratch work for $(2)\implies(3)$.  Any suggestions would be appreciated.


Consider a simple undirected, unweigthed graph $G=(V,E)$ and its edge-induced subgraph $G^{*}=(V^{*},E^{*})$. Suppose that $G$ and $G^{*}$ have $c$ and $c^{*}$ connected components, respectively. Is it true that exactly   $$|V^{*}|-\min\{0,c-c^{*}\}$$  edges can be selected for any spanning tree of $G$ from $E^{*}$? Could somebody give a proof/counterexample? Thank you for the help!

Consider a simple undirected, unweigthed graph $G=(V,E)$ and its edge-induced subgraph $G^{*}=(V^{*},E^{*})$. Suppose that $G$ and $G^{*}$ have $c$ and $c^{*}$ connected components, respectively. Is it true that any spanning tree of $G$ has exactly  $$|V^{*}|-\min\{c^{*},c\}$$  edges from $E^{*}$? Could somebody give a proof/counterexample? Thank you for the help!


I saw this as a question on  and I've seen similar questions elsewhere. Can someone explain the intuition of how to solve a problem like this? There are two scenarios   The uniform RVs in question are discrete   The uniform RVs in question are continuous   For the continuous case, my intuition is: say $X\sim Uniform[1,5] $, then $y = \frac{x-1}{5-1}*(7-1)+1\sim Uniform[1,7]$  Not sure if this is right. And not sure how to do the discrete case.

I wish to draw integers from 1 to some specific $N$ by rolling some number of fair six-sided dice (d6). A good answer will explain why its method produces uniform and independent integers.  As an illustrative example, it would be helpful to explain how a solution works for the case of $N=150$.  Furthermore, I wish for the procedure to be as efficient as possible: roll the least number of d6 on average for each number generated.  Conversions from  to decimal are permissible.    .


First I do not want to use boost library. I have a program which is reading a line and saving it to a string:  ajf938    sshd         Thu Mar 27 23:25   still logged in  c110-20-242-157.mirnd4.nsw.optusnet.com.au   And then I am trying to split it into 5 string. However the size of each element in string will be changed. The other string can be like:  jcm995    sshd         Thu Mar 27 15:18 - 15:19  (00:00)   192.131.251.2   What I already have is   pos=name.find(' ',0); cout<<pos<<endl; string username = name.substr(0,pos); cout<<username<<endl;   And then I look for fist not character from that position:  find_first_not_of(' ');   But I think there should be other efficient way. Any idea will be appreciated.  UPDATE:  This is what I have done so far:  if(name.find('(',0))         {             string username;             string date;             string duration;             string hostname;             int val = 0;             istringstream iss(name, istringstream::in);             string word;             while( iss >> word )             {                 if(val==0){                     username = word;                 }                 else if(val>1 && val<6)                 {                     date +=" "+word;                 }                 else if(val==6){                     duration = word;                 }                 else if(val == 7){                     hostname=word;                 }                 val++;             }             cout<<"usename= "<<username << " date= "<<date <<" duration= "<<duration<<" hostname= "<<hostname<<endl;          }

I'm trying to iterate over the words of a string.  The string can be assumed to be composed of words separated by whitespace.  Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your answer.  The best solution I have right now is:  #include <iostream> #include <sstream> #include <string>  using namespace std;  int main() {     string s = "Somewhere down the road";     istringstream iss(s);      do     {         string subs;         iss >> subs;         cout << "Substring: " << subs << endl;     } while (iss); }   Is there a more elegant way to do this?


I have a find command:  find Directory/{Alpha,Bravo,Charlie} arg1 arg2   I want to replace Alpha,Bravo,Charlie with $find_dir  find Directory/{$find_dir} arg1 arg2   however the latter expands to   find Directory/{Alpha,Bravo,Charlie} arg1 arg2   rather then   find Directory/Alpha Directory/Bravo Directory/Charlie arg1 arg2   Why? It's part of a fairly complex bash script that may have more or less directories, not all which are relevant (so globbing Upload/* would not work). So if I setup three now and add another, I'll have to manually add it in later. Plus I need it run from the root of directories to keep finds outputs perspective (./Upload/Dir/file as opposed to ./Dir/file).   But using a variable would permit me to change that as needed and keep it relevant to other parts of the script.

Can I use variables inside {} expansion without appealing to eval? If so, how?  This doesn't work:  $ touch 1.foo 1.bar $ ls 1.{foo,bar} 1.bar  1.foo $ extensions=foo,bar $ ls 1.{$extensions} ls: cannot access 1.{foo,bar}: No such file or directory   It works with eval:  $ eval ls 1.{$extensions} 1.bar  1.foo