Sorry Im a beginner

Here is part of an xml file
<field name="ip.frag_offset" showname="Fragment offset: 0" size="2" pos="20" show="0" value="4000"/>
<field name="ip.ttl" showname="Time to live: 64" size="1" pos="22" show="64" value="40"/>
<field name="ip.proto" showname="Protocol: TCP (0x06)" size="1" pos="23" show="0x06" value="06"/>
<field name="ip.checksum" showname="Header checksum: 0xdcd2 (correct)" size="2" pos="24" show="0xdcd2" value="dcd2"/>
<field name="ip.src" showname="Source: 192.168.2.21 (192.168.2.21)" size="4" pos="26" show="192.168.2.21" value="c0a80215"/>
<field name="ip.addr" showname="Source or Destination Address: 192.168.2.21 (192.168.2.21)" size="4" pos="26" show="192.168.2.21" value="c0a80215"/>
<field name="ip.dst" showname="Destination: 192.168.3.10 (192.168.3. etc etc
i use a SAXParser to read it including the code
public void startElement(String URI, String localName,
String qName, Attributes atts) {
if (qName.equals("field")) {
String n = atts.getValue("name");
this works ok until I reach a line where there is no "name" attribute
in such a case n is null and I get the error
n is null
Problem with the SAX parser.
java.lang.NullPointerException
how can I avoid this

First. No need to apologize. We are all beginners at some point.
It sounds like you are getting a NullPointerException when you try to dereference n.
Anwhere you have a '.' following the n will throw a NullPointerException when n is null.
You need to do a null check.
if (n != null) something = n.getSomething();You can also do things like this:
if (n != null && n.getSomething().equals("blahblah")) { //...

Similar Messages

  • Beginner question - how to efficiently check if a photo is part of the selection

    Dear all,
    Sorry for this beginner question, however I don't know how to solve it and I'm sure that there is a quick and easy answer to this:
    My target is to get all the "heads of stack" (photos with Position 1 in stacks) of the selection ("photos" below).
    for i, photo in ipairs( photos ) do
      local photoName = photo:getFormattedMetadata('fileName')
       if photo:getRawMetadata( 'isInStackInFolder' ) then
       --Photo is in a stack
            local photoHeadOfStack = photo:getRawMetadata('topOfStackInFolderContainingPhoto')
            local stackPos = photo:getRawMetadata( 'stackPositionInFolder' ) -- get the position in the stack
            local photoHeadName = photoHeadOfStack:getFormattedMetadata('fileName')
            app:logVerbose("Photo nb ^1, name ^2 is in a stack with the position ^3", i, photoName, stackPos)
            if stackPos == 1 then
            -- photo is master of the stack
                 stackTop[#stackTop+1]=photo
                 app:logVerbose("Photo ^1 is top of the stack ^2", photoName, #stackTop)
                 -- check if couple if correct
            elseif photos.photoHeadOfStack then
                 app:logVerbose("Photo ^1 is in a stack, but not on top. Top of the stack already selected", photoName)
            else
                 stackTop[#stackTop+1]=photoHeadOfStack
                 app:logVerbose("Photo ^1 is in a stack, but not on top. Top of the stack ^2 - ^3 ", photoName, #stackTop, photoHeadName)
            end
      end
    end
    In the if structure in the middle checking the Position in the stack, if the Position is not 1, I would like to check if the photo heading the stack ('photoHeadOfStack') is part of 'photos'. I tried 'elseif photos.photoHeadOfStack then' and 'elseif photos[photoHeadOfStack] then' but it doesn't work ->this elseif is never true even if 'photoHeadOfStack' is part of 'photos'.
    Is there anyway to have this check done without checking "manually" photos ?(via for example a for Loop)
    I'm sure that Lua proposes this, but I don't know how...
    I thank you for your Support!

        --[[ This code creates "stackTops", an array of LrPhotos that are the
        tops of all the stacks containing photos in the array
        "photos". ]]
    stackTopSet = {}
    for _, photo in ipairs (photos) do
        local stackTop = photo:getRawMetadata ("topOfStackInFolderContainingPhoto")
        if stackTop ~= nil then stackTopSet [stackTop] = true end
        end
    stackTops = {}
    for photo, _ in pairs (stackTopSet) do table.insert (stackTops, photo) end

  • CSS layout - two questions on sidebar

    So I'm having trouble with my sidebar:
    site
    1. I want to get it to stretch to the bottom of the div it's
    in, with a 10 px margin on the bottom, basically, stretch exactly
    the same distance down as the main content div. I get the
    impression this is tough in CSS, but there has to be some work
    around? I don't think I can use faux columns in this instance,
    though if it's possible please explain how.
    2. This isn't really a big deal, but it'd be nice to have a 1
    px black line on only the left side of my sidebar (I have one drawn
    onto the actual images, it'd be nice to do that in CSS). Is this
    possible?
    Thanks a lot and sorry for the beginner questions.

    I have another question about the same site. In IE I'm
    getting this:
    pic
    In Firefox I'm getting this:
    pic
    Firefox is much closer to what I want, but I'm not sure why
    IE is showing up like it does. Seems the margins are changing and
    IE is padding my sidebar for some reason. Any ideas?

  • Need help on how to add a delimeter into a text file

    Actually, this program reads a textfile. After reading, i need to put certain delimeters after certain characters and print them out to a new file.
    this is how it works :
    for example...
    471117-01-5179052004 VENUE SECURITIES SDN. BHD.
    This is wat the programs read. Now i have to put a semicolon after this numbers ..
    471117-01-5179052004 (;)
    then put another semiclon after this words
    VENUE SECURITIES SDN. BHD.(;)
    But, this text file contains around 2000 lines, and i have to do this for each line...thts y i dunt understand how to code it.

    thanks mr. micheal dunn. Anyway, how can i put this code to read from a text file.....because i need to read the whole text line and put semicolons. i cant use stringbuffer as it only reads a certain length of string..could u tell me how to do this.
    this line is actaully a short line from the text file.
    String str = "471117-01-5179052004 VENUE SECURITIES SDN. BHD.";
    need to put the semicolon is this line actually :
    471117-01-5179052004(;)AVENUE SECURITIES SDN.BHD. (;)000350785A (;)RAHMAN BIN KADIRAN 51, TAMAN MUHIBBAH SUNGAI MATI MUAR 84400(;)JMY(;)SMYSBI (;) 8516 000000030000004600 (;)1581800 ...can u explain wat is tht \\d+-..sorry im a beginner here...hope u can help me out..

  • 2 airport extreme base stations later and still no internet connection-

    Sorry - yet another beginner with internet connection troubles! (I have read all the posts I could find relating, but without any help).
    I have had a Demon broadband account now for about a month (I’m in the UK) and in that time I have purchased a D-Link DSL-300T Ethernet modem and an Airport Extreme Base Station. I got wireless internet working relatively easily – with a powerful range over the whole house and garden, but then one Sunday night, the internet connection via the base station suddenly ‘died’.
    I spent the following 3 days scrutinising all of my settings of both the Modem and the Base station, re-setting both, and bought new Ethernet cables / micro filters etc but with no luck. (I’ll point out at this stage that my broadband account is still active, and if I connect the Ethernet modem directly to my iBook [wired] I can still get my broadband connection. Alternatively, I tried daisy chaining the modem to the base station and then via an Ethernet cable to an iBook, but no connection could be made).
    When wireless, Airport Admin recognises there is a modem there, and under preferences > network under Airport it states I am connected to the internet – but I’m not.
    I then phoned D-Link and they confirmed my firmware was up-to-date for use with Apple products and talked me through all of the modem settings and tweaked a few things, but there was still no connection to the base station. I then phoned Apple. They were incredibly helpful (as ever) and after 35 min. came to the conclusion the base station might not be re-setting itself properly. The replacement one came yesterday, and again I spent a number of hours trying to get it connected to the internet, but there is still no internet connection via airport and I can confirm this from both my eMac and iBook.
    Reading through the forums on here, I understand that my particular modem is problematic with the base station, but I can’t work out why it use to work and now it doesn’t! One theory I have investigated is that the firmware of the base station is two advance for the modem following an update, but after reinstalling the original firmware I started with, I still have no luck.
    - The eMac is running 10.3.9 / iBook is running 10.4.3. The base station is reinstalled with the latest firmware via system update. The first base station and the modem were delivered to me 31/10/05.
    Any help or suggestions would be really appreciated if anyone has any ideas
    Thanks for your time
    Will.
    UK.

    http://discussions.apple.com/thread.jspa?threadID=2316
    78&tstart=0
    I think if you follow the instructions I gave in this
    link you will be fine.
    Remember, If you for any reason loose your
    connection, it is normally always a Power Issue..Your
    ISP is down for service ..or some other anomoly, If
    you were good before your settings will still be
    good...Good Luck...Don
    Hi Don,
    Thanks for you quick response. I printed off the instructions you posted on the support forum before, and ran through your procedue exactly, (twice) but I'm sorry to inform you that I haven't been able to re-establish my wireless internet connection. Would it be safe for me to assume at this stage that my modem is indeed fualty? It contines to work fine independantly, (I'm using it right now) but it can't seem to make contact with the basestation.
    Will.

  • Form based security in WebLogic 7.0

    I'm sorry for the beginner level question, but I seem to be missing a critical step
    in getting Form based security to work. I have a Web application comprised of several
    JSPs. I want to attache simple FORM based security contrainsts to all pages in the
    app. Here are the exceprts from my web.xml:
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>DTSTAT</web-resource-name>
    <url-pattern>/StateServlet/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>Sysops</role-name>
    </auth-constraint>
    <user-data-constraint>
    <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
    <form-login-page>/StateServlet/login.html</form-login-page>
    <form-error-page>/StateServlet/login-error.html</form-error-page>
    </form-login-config>
    </login-config>
    <security-role>
    <role-name>Sysops</role-name>
    </security-role>
    The app deploys correctly and I have verified that the constrinsts, etc. are recognized
    by WebLogic by inspecting the content displayed from the Admin console under the
    "Edit Web Apllication Deployment Descriptor" link - all looks as I had expected and
    matches the XML configuration above.
    I then use the "Define Resources and Roles for Web Resource Collections" link. Under
    the "Define Policies" section I see the constraints as defined above. I then use
    the "Define Roles" link to define the "Sysops" role for this application and add
    the condition "Caller is a member of the group" and use Administrators as the Group.
    From this point, I invoke one of the JSPS in the app and presented with the Login
    page as expected. However, no matter what I enter for user and password, I always
    get the login-error page back. I'm purposely trying to keep this simple so that
    I can use the system user as a test case (who is a member of the Administartors group).
    However, I have also created an additional separate user and added them to the Administartors
    group as well with the same unsuccessful results.
    Can anyone help me out please? I've been reading the docs and seem to be missing
    a key element somewhere.
    Thanks in advance,
    Todd

              Try to refer to the documentation for
              Configuring Security in Web Applications at
              http://e-docs.bea.com/wls/docs70///webapp/security.html
              Does the weblogic.log file contain any error or warning
              messages corresponding to your problem ?
              If you have a test case to reproduce the problem, you
              can contact BEA support at [email protected]
              Thanks
              Developer Relations Engineer
              

  • How can I use Method in the bean

    Hi every one
    please I made a method in for example employees entity "EmployeesImpl"
    the name of method getmax() it return number
    how can I use it at the bean
    for eaxmple when I want to press button give me the value from this method
    sorry Iam still beginner
    thanks in advance

    Thanks sir for your response
    my version
    oracle jdeveloper reales 1 (11,1,1,4,0)
    I use business component
    I make method
    this metod wrote at enitity "EmployeesImpl"
    public Number getMax() throws JboException
    PreparedStatement stat=null;
    ResultSet rs=null;
    try {
    String sql="select max(EMPLOYEE_ID)+1 from EMPLOYEES";
    stat=getDBTransaction().createPreparedStatement(sql, 1);
    rs=stat.executeQuery();
    if (rs.next()) {
    return new Number (rs.getInt(1));
    } catch (Exception e) {
    // TODO: Add catch code
    //e.printStackTrace();
    throw new JboException("error");
    } finally {
    try {
    rs.close();
    stat.close();
    } catch (Exception e) {
    // TODO: Add catch code
    //e.printStackTrace();
    // oracle.jbo.domain.Number
    return new Number (1);
    I made a jsf page
    and I put button at the page
    I want when press the button give me message contain the number which come from previous metod
    thanks my dear

  • How to include JAR file as package

    I am trying to code for passing data from an Applet to javascript. It appears the preferred method involves a package netscape.javascript to include support for the JSObject class. found a download of a jar file which contains this package. I am using Sun Creator and JCreator but dont know where to or how to install this package to be available to the compiler. Sorry for the beginner level question but any help is greatlyt appreciated. TIA

    You need to create a project and add the jar to the classpath. Then you can import the required libraries.

  • Using customized css in a portal application

    Hi,
    Sorry for the beginner question but I can't find sufficient documentation for that.
    I would like to use my own css in my portal component and override the default theme design, could someone please point me to what I should do ?
    Thanks,
    Elad.

    Hi Elad,
    For JSPs to access this css file here is the sample code. Make sure that you keep your css file inside dist->css folder.
    <Html>
    <Head>
    <%@ page import="com.sapportals.portal.prt.component.IPortalComponentResponse"%>
    <%@ page import="com.sapportals.portal.prt.resource.IResource"%>
    <%
    IPortalComponentResponse componentResponse =
        (IPortalComponentResponse)pageContext.getAttribute(javax.servlet.jsp.PageContext.RESPONSE);
    IResource suckerfishCss = componentRequest.getResource(IResource.CSS, "css/GlobalReportStyles.css");
    componentResponse.include(componentRequest, suckerfishCss);
    %>
    </Head>
    <body>
    </body>
    </html>
    Now the class files must be availble to you.
    Regards,
    Vishal

  • I tried install photoshop ,Erro was under ,My pc is windows 7

    Please teach me How to clear this problem. sorry I am beginner of PC!!!
    ----------- Payload: Microsoft Visual C++ 2012 Redistributable Package (x64) 11.0.61030.0 {3E272A93-C06B-4206-AD02-0EBE02535E20} -----------
    ERROR: Third party payload installer vcredist_x64.exe failed with exit code: -2147024546
    ERROR: Failed to install Microsoft Visual C++ 2012 Redistributable Package (x64). Please try installing it by double clicking on the executable at "C:\Users\kdeji\AppData\Local\Temp\{F72A6880-D160-4B45-AC0B-23B57CA16BA0}\Photoshop_15_LS 20_win64\Adobe CC 2014\payloads\Microsoft VC 2012 Redist (x64)\vcredist_x64.exe", or download and install the latest Microsoft Visual C++ 2012 Redistributable Package (x64) from Microsoft website - www.microsoft.com
    ----------- Payload: Microsoft Visual C++ 2012 Redistributable Package (x86) 11.0.61030.0 {873BE68F-480F-49A6-9649-F98CAB056AFC} -----------
    ERROR: Third party payload installer vcredist_x86.exe failed with exit code: -2147024546
    ERROR: Failed to install Microsoft Visual C++ 2012 Redistributable Package (x86). Please try installing it by double clicking on the executable at "C:\Users\kdeji\AppData\Local\Temp\{F72A6880-D160-4B45-AC0B-23B57CA16BA0}\Photoshop_15_LS 20_win64\Adobe CC 2014\payloads\Microsoft VC 2012 Redist (x86)\vcredist_x86.exe", or download and install the latest Microsoft Visual C++ 2012 Redistributable Package (x86) from Microsoft website - www.microsoft.com

    The menu selection only shows the other options if you already have a selection active; a selection made with one of the available tools like lasso or quick selection. First select with the tools, then use the menu 'Select'.

  • Send form like pdf

    Hi,
    I have form and I need to send form in PDF format to specific mail ...
    in the start user must select check box :
         when user select 1 check box option subject mail is Name 1 + address2 ....
         when user select 2 check box option subject mail is Name 2 + address2....
    My problems (sorry I'm beginner), is button for send form in the PDF format ...
    I create one button for each subform like (click event) :
    --------------- subform1 -----------------
    var oDoc = event.target;
    oDoc.mailDoc(
    bUI: true,
    cTo: "[email protected]",
      cSubject: form1.page1.subform1.Name1.rawValue + " " + form1.page1.subform1.address1.rawValue
    ------------------ subform2 -----------
    var oDoc = event.target;
    oDoc.mailDoc(
    bUI: true,
    cTo: "[email protected]",
      cSubject: form1.page1.subform2.Name2.rawValue + " " + form1.page1.subform2.address2.rawValue
    But that work only for option 1.
    When select on then check box option 2 and press button - don't work.
    Can i set one button for all form (and where put it) , where mail subject will be value from actual subform , and format form="pdf" ?
    Thanks ...

    I have solution :
    in each subform create a Button (Object -> Field -> Control type -> Regular)  with click event :
    var vSubject;
    var vCC="";
    var vBody="";
    var vEmail="[email protected]";
    // Create subject from subform field :
    vSubject = first_name.rawValue + " " + last_name.rawValue + " - born : " + born_date.rawValue ;
    event.target.submitForm({cURL:"mailto: "+ vEmail +"?subject=" + vSubject +"&body=" + vBody + vCC,cSubmitAs:"PDF",cCharset:"utf-8"});

  • How to open a file, change the name and write file

    Hi,
    I want to open an existing .dat-file in Labview, manipulate the data and save this data into a new file with a different file name.
    Though the name should be different I would like to use the old name and add something to it.
    (In my programm the .dat file containes the date and time the data was
    measured and I would like to keep this information in the filename.)
    For example: the original title is file1.dat now I want to save it as file1_manipulated.dat
    Is that possible? What is the best and easiest way to do it?
    Thanks a lot
    Chris

    Hi Mike,
    thanks for your help.
    This will give me my path in string format. But to open a new file and then write my data into it, I need a path format (see right side of png)
    Is that right?
    I attached a png, so you hopefully get an idea where this is going. (I know this won´t work yet)
    I open a file and this filename depends on the date and time the data was recorded. So I can´t work with a stringconstant.
    Sorry for this beginner questions - this stuff is absolutly new to me.
    Thanks in advance
    Chris
    Attachments:
    newfile.png ‏11 KB

  • Where do I find the DTP monitor?

    Sorry for this beginner question, but I already checked the online docu, SDN forums and even the SAP press books about this. There are lots of references of the DTP monitor, but so far I couldn't find any information where to locate it. I already searched through transactions RSA1 and RSMO, but nowhere is a button or anything.
    Is there a transaction or report which can be used to start the DTP monitor directly?
    If not, how can a beginner like me (idiot proof) enter the DTP monitor?
    Regards,
    Mark

    Thanks for your hints. After hours and hours of searching I found
    at least a partial solution:
    On BI 7.0 systems there is a transaction called RSDTP, here I finally found the DTP monitor.
    Unfortunately there is also a BW 3.5 system where this useful transaction is missing.
    Do you know how it is possible to start something like RSDTP on a BW 3.5 system?
    An ABAP report name would be best, transaction RSA1 is very uncooperative in my case.
    Regards,
    Mark

  • Joining jsp and jstl

    first of all, i'm a newbie..sorry for my beginner question.
    <sql:setDataSource var="datasource" driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost/test"
                       user="root" password="123"/>
    <sql:query var="ts" dataSource="${datasource}">
      SELECT id FROM t1
    </sql:query>
    <c:forEach items="${ts.rows}" var="row">
        <tr>
            <td><c:out value="${row.id}" /><img src=<${row.path}></td>
        </tr>
    </c:forEach>I want to change the above code and give the image source like this:
    <img src=<###CONTEXTPATH###+${row.path}>how can I do that?

    The contextpath is available by HttpServletRequest#getContextPath().
    But you also can define a <base href> with the contextpath in the <head>. This will be applied to all relative links inside the page.

  • Image Array , GUI Issue

    I am currently trying to insert a 20X20 image a specific spot on an array spot[X][Y], but do not know how to get them in the array.
    Can anyone help me?
    I am using JPanel and want the images to be displayed within the GUI.

    AWebster wrote:
    How would i be able to do this? By reading the Sun Swing tutorials JLabel section and by playing with JLabels and ImageIcons first before trying to incorporating them into your main application.
    And sorry im a Beginner, but would this mean i would have to make 100 separate JLabels to fill the 10X10 grid for the array?Yes, you'd have to make 100 JLabel objects, but not 100 separate JLabel variables as all the JLabel objects would be held in a single 10 by 10 array.
    Is this a memory game application?

Maybe you are looking for

  • How To Get FileType and MIME Type from a File

    Hi, I am using following ways to get FileType and MIME Type. I am able to get file type, but I am getting MIME Type as */* Can any one please let me know how to get MIME Type, but it should not be time consuming process. For File Type I am using foll

  • Costing variant , how to config rounding for component quants ?

    Hello everyone , i am new to CO-PC my user want to change rounding for component quants. Current setting is u2018Round up with Nondimensional units of Measureu2019. This affects too high loss in standard product cost due to rounding up. For instance,

  • Using two wireless routers for two separate networks

    I have one WRT54G router and a newly purchased E2000 router that replaced the WRT54G . I have one DSL connection coming into the house. I have the DSL going directly into my main E2000 router which runs my existing wireless home network and it does t

  • I am having real problems setting up mulitple profiles on a windows 7 pc... help please

    i have set up mulitple profiles on my other pc, op system xp pro, but i have tried doing exactly the same thing on this pc with windows 7 and it just wont work.. i get the new profile set up, and i set up a profile manager shortcut on my desktop, but

  • Application specific key-value pair in jndi.properties

    Hello, Can I specify my application specific key-value pair in jndi.properties? I tried something like this java.naming.factory.initial=.jndi.WLInitialContextFactory java.naming.provider.url=t3://localhost:7001 myVar=myVal When i tried looking up "my