Layout  &lt;?xml version="1.0" encoding="utf-8"?&gt;   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="match_parent" android:id="@+id/llist" tools:context="com.android.parteek.contentprovider.Main2Activity"&gt;  &lt;android.support.v7.widget.SearchView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/serch"&gt; &lt;/android.support.v7.widget.SearchView&gt;  &lt;ListView     android:id="@+id/list"     android:layout_width="match_parent"     android:layout_height="match_parent"     tools:context="com.android.parteek.contentprovider.Main2Activity"&gt;  &lt;/ListView&gt;  &lt;/LinearLayout&gt;   Code  package com.android.parteek.contentprovider;  import android.content.ContentResolver; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.SearchView; import android.util.Log; import android.view.Menu; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.Toast;  import java.util.ArrayList;  public class Main2Activity extends AppCompatActivity implements AdapterView.OnItemLongClickListener, SearchView.OnQueryTextListener { ListView l; ArrayList&lt;Bean&gt; arrayList; UserAdapterr userAdapterr; ContentResolver contentResolver; SearchView searchView; Bean b,b1; int pos; void views(){     l=(ListView)findViewById(R.id.list);     searchView=(SearchView)findViewById(R.id.serch);  } @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main2);     views();     contentResolver=getContentResolver();     retrieve(); } @Override public boolean onCreateOptionsMenu(Menu menu) {     getMenuInflater().inflate(R.menu.searchmenu,menu);     searchView=(SearchView)menu.findItem(R.id.search).getActionView();    searchView.setIconifiedByDefault(true);    searchView.setOnQueryTextListener(this);    searchView.setQueryHint("search.....");      return super.onCreateOptionsMenu(menu); }   @Override public boolean onQueryTextSubmit(String query) {     return false; }  @Override public boolean onQueryTextChange(String newText) {     return false; } }   Error   java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.SearchView.setIconifiedByDefault(boolean)' on a null object reference                                                                                          at com.android.parteek.contentprovider.Main2Activity.onCreateOptionsMenu(Main2Activity.java:147)
129
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?
122018
I am trying to add a list into an another nested list before adding values of a list to nested list it is getting the correct value but after adding i am getting (already output) in debug log when i checked.    public List&lt;String&gt; fieldName {get;set;}  public List&lt;List&lt;String&gt;&gt; fileValuesXML; // To get the field values of xml  for(Dom.XMLNode child : SalesforceObjecet.getChildElements()) {                        objecetName = child.getText();             system.debug('Object Name in XML field  ' + objecetName );              for(Dom.XMLNode subchild : child.getChildElements())              {                 system.debug('Sub child ' + subchild.getText() );                 for(Dom.XMLNode subchildfield : subchild.getChildElements())                 {                     system.debug('Sub child Field ' + subchildfield );                     fName  = subchildfield.getText();                     fieldName.add(fName);                     //fileValuesXML.add(fieldName);                     //system.debug('Filed Name in XML field  ' + fieldName);                 }                  system.debug('Filed Name before affing to filevalueXML  ' + fieldName);                                     fileValuesXML.add(fieldName);                 fieldName.clear();                 system.debug('Filed Name after affing to filevalueXML  ' + fileValuesXML);             }    }    I am getting values in debug log as:     Filed Name before affing to filevalueXML  (AccountSource, field3)   Filed Name after affing to filevalueXML  ((), (already output),   (already output))
29591
There is an alignment issue occurred while searching the users in the .   The grid cells' height is increased while fetching the result. Once the result fetched, the grid's height become normal, so the issue is due to the searching indicator, when it is visible.  Screenshot for reference:        GIF for the same:
28865
When I used this piece down, I got.  \documentclass[a4paper,12pt]{report} \usepackage[inner=0.75in,outer=0.65in,top=0.75in,bottom=0.75in]{geometry} \usepackage{graphicx} \usepackage{url} \usepackage[sc]{mathpazo} %\usepackage{mathptmx} \usepackage{url} \usepackage[onehalfspacing]{setspace} \usepackage{parskip} \usepackage{paralist} \usepackage{multirow} \begin{document} \begin{table}[!htb] \centering \caption{Present Strength-Production} \begin{tabular}{|c|l|l|c|c|c|c|c|c|} \hline \multirow{2}{*}{Sl.No} &amp;  \multicolumn{2}{c|}{\multirow{2}{*}{\textbf{Designation}}} &amp;  \multicolumn{4}{c|}{\textbf{Shifts}} &amp;\textbf{Leave/Off} &amp;  \multirow{2}{*}{\textbf{Total}}\\ \cline{4-7} &amp; &amp; &amp;\textbf{A} &amp; \textbf{B} &amp; \textbf{C}&amp; \textbf{G}&amp;\textbf{Reserve}&amp;\\ \hline 1 &amp; \multicolumn{2}{l|}{Plant Engineer} &amp; &amp; &amp; &amp; 1&amp; &amp; 1\\ \hline \multicolumn{3}{|l|}{\textbf{Sub Total}} &amp; &amp; &amp; &amp; \textbf{1} &amp; &amp; \textbf{1}\\ \hline 2&amp;\multirow{2}{*}{Operator}&amp;Work related to water regeneration&amp;1&amp;1&amp;1&amp;&amp;1&amp;  4\\ \cline{3-9} 3&amp; &amp; Work related to valve control&amp; 1&amp;1&amp;1&amp; &amp;1&amp;4\\ \hline \multicolumn{3}{|l|}{\textbf{Sub Total}}&amp;\textbf{2}&amp;\textbf{2}&amp;\textbf{2}&amp; &amp;\textbf{2} &amp; \textbf{8}\\ \hline 1 &amp; \multicolumn{2}{l|}{Worker} &amp;2 &amp; 2&amp; 2&amp; &amp; 2&amp; 8\\ \hline \multicolumn{3}{|l|}{\textbf{Sub Total}} &amp;\textbf{2}&amp;\textbf{2}&amp;\textbf{2}&amp; &amp;\textbf{2} &amp; \textbf{8}\\ \hline \hline \multicolumn{3}{|l|}{\textbf{Total}} &amp;\textbf{4} &amp;\textbf{4} &amp;\textbf{4}  &amp;\textbf{1}&amp;\textbf{4} &amp; \textbf{17}\\ \hline \end{tabular} \label{tab:pro_pro} \end{table} \end{document}     Can anyone show me the right path?  Certain important things are   The starting place of Sub total and Total should be from the second column The vertical line in the Designation box Horizontal line between 2 and 3
110605
When creating a question/answer on the Android app, it gives you a little bar above the keyboard to bold/italicize, add a link easily, add a picture etc.  When editing however, this bar isn't shown. To ease editing on mobile, it would be exceedingly helpful to have this bar show up. I find myself resorting to the full site to add a embedded link if I can't at the moment remember the exact syntax.
85015
if you create html layout like so  &lt;ul&gt;      &lt;li class='a'&gt;&lt;/li&gt;      &lt;li class='b'&gt;&lt;/li&gt;      &lt;li class='a'&gt;&lt;/li&gt;      &lt;li class='b'&gt;&lt;/li&gt;      &lt;li class='a'&gt;&lt;/li&gt;      &lt;li class='b'&gt;&lt;/li&gt;      &lt;li class='a'&gt;&lt;/li&gt;      &lt;li class='b'&gt;&lt;/li&gt; &lt;/ul&gt;   and try to select odd elements with 'a' class like so $$('.a:odd') you will get empty array, and if you do $$('.a:even') you will get all four li elements with 'a' class.. It really strange.. But im new to mootools, maybe im doing something wrong..    So my question is how to select first and third li elements with a class. I know that i can do it with function like this  $$('.a').filter(function(item, index) { return index%2; }  but its too complicated for such small task as selecting odd or even elements..
42999
This appears to be a css bug which (I think) has recently been introduced. It's most visible when viewing questions on Stack Exchange sites using mobile devices (the full site with responsiveness, not the mobile site) but can easily be reproduced by resizing a browser window on a question where the combined width of the tags is large. A couple of example questions show this behaviour:  On Meta Stack Overflow:   On Meta Stack Exchange:     Using the Meta Stack Overflow question to demonstrate (as the total width of the tags is larger):  At 1100px, the tags just about fit into their containing div.     At 800px, the tags appear on top of related questions:     At 450px, the tags are now wider than the view (the last tag is completely off the screen), causing scroll bars to appear:      This doesn't happen to lists of questions - the tags flow onto multiple lines:     Reproduced on: { Firefox 81, Chrome 84, Edge 84 } on Windows 10, and Chrome 85 on Android 11.
115316
I was toggling between layout views (Default, Animation, etc) and I accidentally got this:    I don't know how to simply restore the "Default" layout... or any layout. Many of the interface elements are gone and I was able to bring back some by clicking "maximize area" in one of the tool bars  So, anyone knows a way of restoring the default layout without using the layout button? thanks in advance!  (I've tried searching and apparently no-one had this problem before...)
88644
In any tag's info page, the Tag Info box is overlapped with the above horizontal line. Adding some space in between them or adding margin-top to the tag info div will improve the page design.  For example, in the  tag info page.  Current UI:        Expected UI:
14667
Noticed that sometimes when there are 10+ answers to a question - some answers look like they have \n\n...\n line breaks in the end, so the body of the answer has incorrect height.  It probably has something to do with ViewHolder or adapter not setting correct row height. Although as far as I know, it should do this according to text amount/length.
72669
I try to adapt this solution  to my needs.  But I have a width problem 1\tabcolsep is too short, but anything longer is too long, should be 2\tabcolsep.    \documentclass[10pt]{article} \usepackage[T1]{fontenc}  \usepackage{array} \usepackage{tabularx} \usepackage{ragged2e}  \newcolumntype{C}[1]{&gt;{\Centering}p{#1}} \usepackage{tikz}  \newcommand\Tdiag[4]{%     \multicolumn{1}{|p{#2}|}{\hskip-\tabcolsep     \begin{tikzpicture}[%                 baseline={(0,-.25\baselineskip)},                 every node/.style={outer sep=0pt,inner sep=#1}]     \node[minimum width={#2+1\tabcolsep-\pgflinewidth},         minimum height=2\baselineskip-\pgflinewidth+\extrarowheight,         use as bounding box] (box) {};     \draw[line cap=round] (box.north west) -- (box.south east);     \node[anchor=south west,text width=.75*#2,align=left] at (box.south west) {#3};     \node[anchor=north east,text width=.75*#2,align=right] at (box.north east) {#4}; \end{tikzpicture}\hskip-\tabcolsep}}  \begin{document}  \begin{tabular}{|C{1.2cm}*{3}{|c}|}\hline \Tdiag{.2em}{1.2cm}{\^Age}{Sexe}&amp; Féminin &amp; Masculin &amp; Totaux  \\\hline 15 ans&amp;&amp;1&amp;\\\hline 16 ans &amp; 16 &amp; &amp;  \\\hline 17 ans &amp; 3 &amp; &amp;  \\\hline Totaux &amp; &amp; &amp; 36  \\\hline \end{tabular}   \end{document}
117514
contains several lines with inline formatted code. It looks aligned in web:        But it looks like spaces are eaten in the Android app:        Same buggy behavior in iOS app:         And mobile web:         App Version: 1.0.95 Device Manufacturer: LGE Device Model: LG-H860 OS Version: 7.0 (1710300506712)      App Version: 1.7.0.1 Device: Unknown (iPad7,3) / iPad Pro 10.5" OS Version: Version 10.3.3 (Build 14G60)
76068
It happens to me rather often that I look at a question such as "How to do whatever with Collections" and while that's what I'm looking for in Java, it's useless if the question refers to, for instance, C#.  So, this is purely a UI thing: how about putting the tags right under the question title, rather than arbitrarily far under the question text itself?  EDIT: here's what I mean
84853
Comment on Duplicate Reference: Why would this be marked duplicate when it was asked years prior to the question referenced as a duplicate?  I also believe the question, detail, and response is much better than the referenced question.  I've been a C++ programmer for quite a while but I'm new to Java and new to Eclipse.  I want to use the  to visualize some data I'm working with.  This code is organized like this:  ./com ./com/touchgraph ./com/touchgraph/graphlayout ./com/touchgraph/graphlayout/Edge.java ./com/touchgraph/graphlayout/GLPanel.java ./com/touchgraph/graphlayout/graphelements ./com/touchgraph/graphlayout/graphelements/GESUtils.java ./com/touchgraph/graphlayout/graphelements/GraphEltSet.java ./com/touchgraph/graphlayout/graphelements/ImmutableGraphEltSet.java ./com/touchgraph/graphlayout/graphelements/Locality.java ./com/touchgraph/graphlayout/graphelements/TGForEachEdge.java ./com/touchgraph/graphlayout/graphelements/TGForEachNode.java ./com/touchgraph/graphlayout/graphelements/TGForEachNodePair.java ./com/touchgraph/graphlayout/graphelements/TGNodeQueue.java ./com/touchgraph/graphlayout/graphelements/VisibleLocality.java ./com/touchgraph/graphlayout/GraphLayoutApplet.java ./com/touchgraph/graphlayout/GraphListener.java ./com/touchgraph/graphlayout/interaction ./com/touchgraph/graphlayout/interaction/DragAddUI.java ./com/touchgraph/graphlayout/interaction/DragMultiselectUI.java ./com/touchgraph/graphlayout/interaction/DragNodeUI.java ./com/touchgraph/graphlayout/interaction/GLEditUI.java ./com/touchgraph/graphlayout/interaction/GLNavigateUI.java ./com/touchgraph/graphlayout/interaction/HVRotateDragUI.java ./com/touchgraph/graphlayout/interaction/HVScroll.java ./com/touchgraph/graphlayout/interaction/HyperScroll.java ./com/touchgraph/graphlayout/interaction/LocalityScroll.java ./com/touchgraph/graphlayout/interaction/RotateScroll.java ./com/touchgraph/graphlayout/interaction/TGAbstractClickUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractDragUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractMouseMotionUI.java ./com/touchgraph/graphlayout/interaction/TGAbstractMousePausedUI.java ./com/touchgraph/graphlayout/interaction/TGSelfDeactivatingUI.java ./com/touchgraph/graphlayout/interaction/TGUIManager.java ./com/touchgraph/graphlayout/interaction/TGUserInterface.java ./com/touchgraph/graphlayout/interaction/ZoomScroll.java ./com/touchgraph/graphlayout/LocalityUtils.java ./com/touchgraph/graphlayout/Node.java ./com/touchgraph/graphlayout/TGAbstractLens.java ./com/touchgraph/graphlayout/TGException.java ./com/touchgraph/graphlayout/TGLayout.java ./com/touchgraph/graphlayout/TGLensSet.java ./com/touchgraph/graphlayout/TGPaintListener.java ./com/touchgraph/graphlayout/TGPanel.java ./com/touchgraph/graphlayout/TGPoint2D.java ./com/touchgraph/graphlayout/TGScrollPane.java ./TG-APACHE-LICENSE.txt ./TGGL ReleaseNotes.txt ./TGGraphLayout.html ./TGGraphLayout.jar   How do I add this project in Eclipse and get it compiling and running quickly?
18961
I have the following code:   DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlFile);   How can I get it to parse XML contained within a String instead of a file?
49587
In the Stack Exchange Android app ➡️ About ➡️ Submit a bug report, when trying to report a bug, by default the configuration details are showing in the body section.      The content in the screenshot is as below (for reference of future search):    - App Version: 1.0.85 - Device Manufacturer: Motorola - Device Model: XT1033 &nbsp;- OS Version: 5.1 (2)   The four items are to be shown in the same bulleted list order, but there is one extra space before the - OS Version:, so it is causing the first three items to be in the same bulleted list order and the last one in the sub bulleted list.   The rendered output is below:   App Version: 1.0.85 Device Manufacturer: Motorola Device Model: XT1033   OS Version: 5.1 (2)    The issue is in the recent questions with the  +  .
122597
Hello Stack Overflow Experts, i have need of your expertice:  I am trying to use Hibernate on an Existing DB. Currently im trying to load a User object and a list of UserData objects that go along.  in the DB the (simplified) layout is  |    User      |      |          UserData               | ----------------      ----------------------------------- uid | username |      | uid | parentuid | field | value |    So each User object matches all the UserData objects where UserData.parentuid = User.uid.  My User class mapping file      &lt;class name="com.agetor.commons.security.User" table="ac_users"&gt;     &lt;id name="uid" column="uid" type="long" &gt;         &lt;!--&lt;generator class="native"/&gt;--&gt;     &lt;/id&gt;     &lt;property name="username" column="username" /&gt;         &lt;list name="fieldData" cascade="all"&gt;         &lt;key column="parentuid" not-null="true" /&gt;         &lt;index column="parentuid" /&gt;         &lt;one-to-many class="com.agetor.commons.fields.FieldData"/&gt;     &lt;/list&gt;  &lt;/class&gt;    Mu  UserData mapping file      &lt;class name="com.agetor.commons.fields.FieldData" table="ac_userdef_data"&gt;     &lt;id name="uid" column="uid" type="long" &gt;     &lt;!--&lt;generator class="native"/&gt; --&gt;     &lt;/id&gt;     &lt;!--&lt;property name="parentuid" column="parentuid" /&gt;   --&gt;     &lt;property name="fieldname" column="fieldname" /&gt;     &lt;property name="value" column="value" /&gt; &lt;/class&gt;   So far i have tried many different configurations and all of them have had various degrees of failue. The code pasted here, does not work.    The parentuid property is commented out, because Hibernate gives a "Repeated column in mapping" error otherwise. Currently there is still a "Repeated column in mapping" on the uid field, i use for &lt;list-index /&gt; I do not understand where i specify that UserData.parentuid is the foreign key and that  the list should use User.uid as key.   I hope someone is able to help.    When you define both a One-To-Many and a Many-To-One, does this not make it Bi-Directional? The current working model, is Unidirectional and UserData does not have a reference to User. Your suggestion fails, because Hibernate could not find a get or set method for User on UserData.  Is it implied that, this code uses User.uid as a key and matches this against the UserData.parentuid column? Or is this fact specified somewhere else?    &lt;list name="fieldData" inverse="true"&gt;     &lt;key column="parentuid" not-null="true" /&gt;     &lt;one-to-many class="com.agetor.commons.fields.FieldData"/&gt;   &lt;/list&gt;   I am still learning Hibernate and working my way through documentation and examples i can find.