Chatlet Created Chatlet Thrown Inside reply 5684dc24617149a601dea913 Yes, Please let me in. java.lang.reflect.InvocationTargetException  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  at java.lang.reflect.Method.invoke(Unknown Source)  at com.teamchat.client.sdk.impl.TeamchatAPIImpl.invokeMethod(Unknown Source)  at com.teamchat.client.sdk.impl.TeamchatAPIImpl.onMsg(Unknown Source)  at com.teamchat.client.sdk.events.EventStreamConnector.onMsg(Unknown Source)  at com.teamchat.client.sdk.impl.SimpleEventsExecutor.notifyCallbackMessage(Unknown Source)  at com.teamchat.client.sdk.events.EventStreamImpl.handleLine(Unknown Source)  at com.teamchat.client.sdk.events.EventStreamImpl.fetchEventStream(Unknown Source)  at com.teamchat.client.sdk.events.EventStreamImpl.fetchOnceAndReturnInterruptedStatus(Unknown Source)  at com.teamchat.client.sdk.events.EventStreamConnector.getEvents(Unknown Source)  at com.teamchat.client.sdk.events.EventStreamConnector.mainloop(Unknown Source)  at com.teamchat.client.sdk.events.EventStreamConnector.access$000(Unknown Source)  at com.teamchat.client.sdk.events.EventStreamConnector$1.run(Unknown Source)  at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException  at frontEnd.sendRequest.onReply(sendRequest.java:75)  ... 16 more     I am currently working on task where I need to throw some message on reading null value from the database cell. But When I try to do so my code throws NullPointerException. I tried to handle it using try catch block but nothing helped me.    public String getCellData(String sql_query) throws Exception {   System.out.println("Inside getCellData");   String cell_data = "";   try{    JSONArray queried_data = (JSONArray)db_work.retrieveQueryRows(db_work.retrieveData(sql_query).toString());    for (int i = 0; i &lt; queried_data.size(); i++) {     JSONArray queried_row=(JSONArray) queried_data.get(i);     cell_data = queried_row.get(0).toString();    }         }   catch(NullPointerException e)   {    cell_data="empty";    return cell_data;   }   return cell_data;  } if(response.equals("Yes, Please let me in.")){    String gender = fetch_details.getCellData("select * from Group_Join where Room='"+room_id+"'");    System.out.println(gender);    String goal = fetch_details.getCellData("select * from Group_Join where Room='"+room_id+"'");    System.out.println(goal);    api.performPostInCurrentRoom(new TextChatlet("Sure, thanks. We will add you to the support group."));    if (goal.equals("empty")) {     if (gender.equals("empty")) {      System.out.println("Gender and Goal Both Empty");      PrimaryChatlet gender_goal_chatlet=new PrimaryChatlet();      gender_goal_chatlet.alias("GenderGoal");      Form gender_goal_form=api.objects().form();      gender_goal_form.addField(api.objects().select().name("Goal").label("Goal").addOption("Weight Loss").addOption("Weight Gain").addOption("Muscle Tone"));      gender_goal_form.addField(api.objects().select().name("Gender").label("Gender").addOption("Male").addOption("Female"));      gender_goal_chatlet.setReplyScreen(gender_goal_form);      api.performPostInCurrentRoom(gender_goal_chatlet);     }
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?
Similar to '', is it also ok to add an example?   I was going to  but I noticed that one answer had most of the things I needed to say, except perhaps that the questioner didn't perhaps understand the answer and  I feel that an example may help. Show that $\ker \hat{T} = \text{ann}(\text{range } T)$ What is so special about speed of light in vacuum? Same gravatar is displayed for different users in stackexchange.com filters Same gravatar is displayed for different users in the stackexchange.com , under the Top Network Askers in the right side bar.   The red circled image's source (&lt;img src=) are from   https://www.gravatar.com/avatar/?s=18&amp;d=identicon&amp;r=PG&amp;s=30                                ^   Seems the gravatar id is missing here in the image source.  For an example from the list, the user  gravatar id should be    https://www.gravatar.com/avatar/66c66c4d97a7bc3859a85253f003e1fb?s=18&amp;d=identicon&amp;r=PG&amp;s=30   but it is mapped with   https://www.gravatar.com/avatar/?s=18&amp;d=identicon&amp;r=PG&amp;s=30   which caused the display issue. What is the logic behind the timer of the Sojourner Badge? Does the 24 hours timer start:     when you hack a portal on a particular day     or     does it use the calendar days and check if you did hack a portal on a particular day   or     does it simply use a fixed international timezone to calculate the 24 hour cycle   or     does it use the agent's hacking cell's timezone to start it?   If it's the calendar days method than the explanation of the badge would be a little bit misguided because you could hack a portal on 00:01 on Saturday and then hack another one on 23:59 on Sunday and it would be practically two days between two hacks.  If it's based on the agent's last hack for a particular day then the explanation still would be problematic?  The third option would be a little bit unfair (or timezone racist) for the rest of the world.  The last option (the cell's timezone) would/could be both unfair for travellers and/or non-travellers.  Does anyone know any details about it? I am currently using a macbook pro but the operating system is debian 8.2 not os x  I am using a macbook pro but there's this one device that's just draining a lot of power. This USB device: Card Reader (Apple)   32.5 W    100.0%                      Device         USB device: Card Reader (Apple)   2.60 W    100.0%                      Device         Radio device: btusb   209 mW     19.7 pkts/s                Device         Network interface: wlan0 (wl)   This device really drains my battery, I noticed that my laptop wouldn't even get 2 hours when not plugged in, I installed powertop. Made all the recommended changes but this device, I can't find out how to disable it. I don't even use that reader and forgot that it was there.  I configured all my devices to use limited power in my rc.local  echo '0' &gt; '/proc/sys/kernel/nmi_watchdog' echo 'min_power' &gt; '/sys/class/scsi_host/host0/link_power_management_policy' echo '1' &gt; '/sys/module/snd_hda_intel/parameters/power_save' echo '1500' &gt; '/proc/sys/vm/dirty_writeback_centisecs' echo 'auto' &gt; '/sys/bus/usb/devices/2-4/power/control' echo 'auto' &gt; '/sys/bus/usb/devices/1-12/power/control' echo 'auto' &gt; '/sys/bus/usb/devices/1-8.3/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:1f.3/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:01:00.1/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:1c.3/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:1c.4/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:1c.2/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:1c.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:1b.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:16.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:14.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:01.1/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:01.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:00.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:01:00.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:08:00.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:07:06.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:07:05.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:07:04.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:07:03.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:07:00.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:06:00.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:05:00.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:04:00.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:03:00.0/power/control' echo 'auto' &gt; '/sys/bus/pci/devices/0000:00:1f.0/power/control'   How can I get this device to act sanely or disable it completely because I  haven't used it. Give an example of a relation R on $A^2$ which is reflexive, symmetric, and not transitive 32-bit vs. 64-bit systems I remember reading a time travel book when I was young, which means it would have been written no later than the '80s, but probably much before that.  It featured an adult and some kids back in time and them trying to get back to the present.  I recall that the time travel effect was a ring, as at one point the ring opened up and a "brontosaurus" hit it and burned it's leg sending chunks of it back through the ring.  I recall a section where they were with "cave people" who had just hunted and killed some animal, and they used their pocket knife to extract more meat from the carcass, and actually cooking the meat unlike their paleolithic 'friends'.  (I seem to recall that one of the paleolithic girls seemed to fancy the boy time traveler, much to his discomfort.)  I am pretty sure that at one point they were watching the time ring appear over water, knowing they could not reach it, and waiting for it to be reachable.  I think the close of the book was them freezing to death in the ice age, commenting on how in the future when their bodies are found how it would be hard to explain how they got there, and then finally being rescued before it was too late.  I hope that's enough to go on?  Any ideas? Convert LaTeX to HTML Proving normality of affine schemes One of the exercises in Ravi Vakil's algebraic geometry notes, Ex. $5.4.$I(b), is to show that    $$ \operatorname{Spec}\left(k[x_1, \ldots, x_n]/(x_1^2 + \cdots + x_m^2)\right) $$   is normal, where $k$ is any field of $\operatorname{char}(k)\neq 2$, and $n \geq m \geq 3$.    I have absolutely no idea how to get started on this. Is there anyone that could give a hint as to how one would approach this problem? I've got a road bike with brake lever shifters, and it's developed a small problem with age: sometimes, the shifter doesn't catch the first time or two I push it. It'll move easily, with no resistance, since it's not actually pulling on the cable, then after a few tries, catch and work normally. The colder the temperature, the more often this happens.  I don't know how the mechanism works internally, so I'm curious what would cause this, and also whether it's (as I suspect) gradual wear of some part of the mechanism, and if it's likely to fail catastrophically, or gradually worsen. I'm trying to prove that if $A\neq 0$ is a commutative ring and there is an injective $A$-module homomorphism $A^m\hookrightarrow A^n$ then $m\leq n$ must necessarily hold.    This is exercise 2.11 from Atiyah and MacDonald's Introduction to Commutative Algebra, but unfortunately all the solutions available online are either very sparse with regard to this question or seem to use (to my surprise) a generalized version of Cramer's rule. Is there perhaps some other "cleaner" approach to solving this problem? Building a matrix by merging the same row vector multiple times How to stop Katoolin from crashing Ubuntu? I updated from 14.04 to 16.04 and used katoolin to add some Kali tools. After restart, the boot up of Linux ran codes, but stopped at a certain point never to load login. So I reinstalled 16.04, ran updates and tried again. This time, the boot menu was changed to Kali as well as the OS name (I'm using Windows 7 dual boot with Ubuntu); login started in Ubuntu style without user name, had to type in the name... then it goes to the logo screen never to log in.  How can I use katoolin without it affecting the boot menu interface? Does this happen when the user selects the option 'add Kali repositories and updates'? Are the Kali repositories necessary? I'd much rather just install the tools and not mess with the Ubuntu interface. ubuntu 18.04 how do I install drivers for my NVIDIA GeForce GTX 1050? Solve system of simultaneous equations in $3$ variables: $x+y+xy=19$, $y+z+yz=11$, $z+x+zx=14$ So i've been working on a Page Object Model framework for a large web application for our current company. It's the first time i've made my own framework and implemented the page object model. Im using Ruby w/Capybara and Selenium-Webdriver for my language/driver of choice.  Currently i've divided each page (or obvious "section of the site") into a class file. This class file has methods for just about everything (or an API of sorts). The problem i've ran into is that I am literally writing a method for every single thing....and i've came across 2 ways people seem to do this:  Lets pretend for a section/page of the site is a widget creation form, the widget has a name/description and some sort of "type" dropdown. Also a save button to save the widget.  Option A (Which is what i've done so far): Make a method for each element (the save button, called save_widget, all the different inputs, etc...)  Option B: Have getter and setter methods for each element, then a larger method which uses these private getter and setter methods.   With Option A my test scripts end up being longer, and honestly not much different than using selenium calls themselves.   Option B would probably call one method (Such as create_widget which would pass in multiple items which that method would call all the smaller getter/setter methods). This would make the test script MUCH shorter and more abstracted. However the getter/setter methods would probably take more actual writing for the page objects themselves (but possibly easier to maintain).  Is there a certain style that favors one over the other? The more I think about it the more Option B seems better...but I wonder if in this case abstraction is a good thing. 'help' link is located lower than the other items It shows like this on Firefox 25 and Internet Explorer 11 (minus the red line of course):    Chrome seems to be fine. Showing $\gcd(2^m-1,2^n+1)=1$