Regex for String.split successive trailing delims

I need to split a string with a "|" delimiter.
so i tried:
line.split("\\|");but the string looks like this:
R|xxxxP2/B4|REFDES|Wire Harness|||||1|ea||M/W xxxxJ2/B4|||||and i would like to have 16 strings but what i'm using doesn't
individually see successive delims at the end of the line so
i'm missing the 4 blank strings.
does anyone know of a regex pattern that can help me?
i've been trying to help myself for a while by reading
info on these sites but i haven't worked it out yet.
http://mindprod.com/jgloss/regex.html
http://www.amk.ca/python/howto/regex/I haven't completely given up on myself but i'd like
to talk to someone about it.
walker

split("\\|",-1)I skipped right over that part:
If n is non-positive(e.g. -1) then the pattern will be applied as many times as possible and the array can have any length.
Ok, that doesn't say much, but...
If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded.
That adds the language "trailing empty strings will be discarded", which implies that trailing empty strings won't be discarded when the second parameter is negative.

Similar Messages

  • Regular expression not working for String.split()?

    hi, i have a String variable called 'table'.
    It has a bunch of chunks of data seperated by whitespace, whether it
    be spaces or carraige returns. Anyways, i want to split this up using
    the String.split function. i want to split it around whitespace.
    here is my code:
    String codes[] = table.split("\s");
    However, i'm getting back all nulls in the codes variable. What am i doing wrong?
    thanks

    split("\\s")\ is special both in Java String literals and in regex, so you need two of them.
    You'll probably also have to take an extra step it you don't want regex to stop at newlines. I forget the details, so check the docs.

  • Regex for string between quotes

    I want to match the string between the double quotes
    e.g. Hello "World" . : Match ="World"
    I used the following pattern.
    Pattern p = Pattern.compile("\\\".*?\\\"");But now I also want to include escaped quote in the string, e.g.
    Hello "\"World\""[\b]

    Pattern.compile("\".*?(?<!\\\\)(\")");The closing quote matches only when it is not preceeded by a backslash. (You might wish to apply the same constraint on the opening quote.)

  • Problems with String.split(regex)

    Hi! I'm reading from a text file. I do it like this: i read lines in a loop, then I split each line into words, and in a for loop I process ale words. Heres the code:
    BufferedReader reader = new BufferedReader(new FileReader(file));
    String line;
    while ((line = reader.readLine()) != null) {
        String[] tokens = line.split(delimiters);
        for (String key : tokens) {
    doSthToToken();
    reader.close();The problem is that if it reads an empty line, such as where is only an "\n", the tokens table has the length == 1, and it processes a string == "". I think the problem is that my regex delimiters is wrong:
    String delimiters = "\\p{Space}|\\p{Punct}";
    Could anybody tell me what to do?

    Ok, so what do you suggest?I suggest you don't worry about it.
    Or if you are worried then you need to test the two different solutions and do some timings yourself.
    And how do you know the regex lib is so slow and badly written?First of all slowness is all relative. If something takes 1 millisecond vs 4 milliseconds is the user going to notice? Of course not which is why you are wasting your time trying to optimize an equals() method.
    A general rule is that any code that is written to be extremely flexible will also be slower than any code that is written for a specific function. Regex are used for complex pattern matching. StringTokenizer was written specifically to split a string based on given delimiters. I must admit I haven't tested both in your exact scenario, but I have tested it in other simple scenarios which is where I got my number.
    By the way I was able to write my own "SimpleTokenizer" which was about 30% faster than the StringTokenizer because I was able to make some assumptions. For example I only allowed a single delimiter to be specified vs multiple delimiter handled by the StringTokenizer. Therefore my code could be very specific and efficient. Now think about the code for a complex Regex and how general it must be.

  • What's rong wiht String.split(".")?

    Hi all
    I have two similar code below:
    public class Test {
        public static void main(String[] args) {
            String ip  = "192,168,30,153";//comma
            String[] ss = ip.split(",");   //it's comma
            for(String s:ss){
                 System.out.println(s);
    }the result is :
    192
    168
    30
    153
    but when it changs to period nothing printed.
    public class Test {
        public static void main(String[] args) {
            String ip  = "192.168.30.153";//period
            String[] ss = ip.split(".");   //it's period
            for(String s:ss){
                 System.out.println(s);
    } thanks

    .is the regex character that means "any character". If you want to split on a literal period, you need to escape it.
    \\.

  • Regex or String methods

    Hi
    Im wondering how more experienced Java developers would approach this.
    I have a parser which receives Strings according to the irc-protocol.
    servername PRIVMSG #channel :Hello worldAlmost every message is defined by the second word in the String. So its easy to just do String.split(" ") ... check the messagetype and start working with the other elements. Of course things gets a bit out of hand with compareTo(), IndexOf(), Substring() ... and all the other String methods.
    How would u use regex for this if u had to? I see this as exercise ... slower code, more work ... doesnt matter and its a plus learning more about regex.
    Example ... the line above, how would u use regex to check the messagetype "privmsg" ... channel "#channel" and the messagepart after the ':' etc ...
    many thanks in advance

    I wouldn't use regex, but split indeed, since I'd
    have very easy access to each part of the message.
    Anyway, since you want to learn regex: why don't you
    grab the Pattern API and read and try a little
    yourself? Nothing teaches you better than finding out
    yourself.Well yes regexes are nice easy and clean. And a wevy usefull if you learn them cos it gives you unlimited power of string manipulation.
    But at a high cost.
    It is verry important to make the right choice (regex or string methods) becouse it will decide how good your code looks and work.
    If the pattern that need to be parsed is simple and cam be done using string methods (including string tokenizer) regex is not the way to go.
    Normally when handling simple text patterns like above the string methods will perform about 5 times faster than regexes.
    So my recomendation is.
    If you are doing this for learning do it both ways and practice both regexes and string methods. Becouse in the industry you have know the both well.
    If you are doing this for some sort of a project and performance is a significant quality factor you need to use string methods in this perticuler situation.
    Above pattern can easilly broaken down using a combination of substring, index of and string tokenizer.

  • How to implement String.split() on 1.3?

    Hi,
    I have a String split method which is able to be run on 1.4.
    The string "boo:and:foo", for example, yields the following results with these parameters:
    Regex Limit Result
    : 2 { "boo", "and:foo" }
    : 5 { "boo", "and", "foo" }
    : -2 { "boo", "and", "foo" }
    o 5 { "b", "", ":and:f", "", "" }
    o -2 { "b", "", ":and:f", "", "" }
    o 0 { "b", "", ":and:f" }
    The program cannot be complied if I run it on 1.3. How can I do the 1.4 split function on 1.3?
    Thanks for advice

    If you don't require the more powerful regular expression matching, you can implement the split() functionality with existing String methods.
    If you are splitting around a character, you can use StringTokenizer, unless you care about empty tokens. If you need empty tokens returned, then you can use the following method:
    public static String[] split(String input, char c) {
        int tokenCount = 0;
        int cIndex = -1;
        do {
            cIndex = input.indexOf(c, cIndex + 1);
            tokenCount++;
        } while (cIndex >= 0);
        String[] tokens = new String[tokenCount];
        int tokenIndex = 0;
        do {
            int index = input.indexOf(c, cIndex + 1);
            if (index < 0) {
                tokens[tokenIndex] = input.substring(cIndex + 1);
            else {
                tokens[tokenIndex] = input.substring(cIndex + 1, index);
            cIndex = index;
            tokenIndex++;
        } while (cIndex >= 0);
        return tokens;
    }If you need to split around a multiple character string, use the following method.
    public static String[] split(String input, String str) {
        int strLength = str.length();
        int tokenCount = 0;
        int strIndex = -strLength;
        do {
            strIndex = input.indexOf(str, strIndex + strLength);
            tokenCount++;
        } while (strIndex >= 0);
        String[] tokens = new String[tokenCount];
        int tokenIndex = 0;
        strIndex = -strLength;
        do {
            int index = input.indexOf(str, strIndex + strLength);
            if (index < 0) {
                tokens[tokenIndex] = input.substring(strIndex + strLength);
            else {
                tokens[tokenIndex] = input.substring(strIndex + strLength, index);
            strIndex = index;
            tokenIndex++;
        } while (strIndex >= 0);
        return tokens;
    }These have only been lightly tested, no guarantees.

  • String split problem around | character

    I'm trying to split a string (well, a bunch of them--astronomical data) into an array of substrings around a common character, the |. Seems pretty simple, but the regular String.split() method doesn't work with it. Here's part of the code I tried (more or less):
    String line = "";
                String[] blah = new String[43];
                //do {
                    line = inputStream.readLine();
                    if (line != null)
                        blah = line.split("|");Reading the line from the input stream gives you a string like so:
    0001 00008 1| | 2.31750494| 2.23184345| -16.3| -9.0| 68| 73| 1.7| 1.8|1958.89|1951.94| 4|1.0|1.0|0.9|1.0|12.146|0.158|12.146|0.223|999| | | 2.31754222| 2.23186444|1.67|1.54| 88.0|100.8| |-0.2
    Basically a long list of data separated by |. But when I split the string around that character, it returns an array of each individual character, where blah[1] is 0, blah[4] is 1, etc. The split function works fine for other expressions, I tried it (using "5" as the expression gives 0001 00008 1| | 2.317 as the first string, for example), so what's wrong? How do I split around the |?

    confusing, the split method takes a regular expression, and as such, the "pipe": |, is a special char for a regexp.
    you need to escape it (in regex-style context), via:message.split("\\|");

  • String.split() regular expression

    Regular expression escapes me. I have a line of a CSV file that looks like this:
    1,,3,2,45.00,"This & That, LLC",0
    I want the string split by commas but the problem with the line above is there's a comma in the name of the company...I obviously don't want the company name split in half...what would the regular expression be that I would provide to the split method to ensure that only commas not found in between double quotes are used to split the string into an array of Strings? is this possible?
    Thanks in advance!
    Rob

    Telling someone to google might be deserved, but it is mean and unhelpful.
    If you want to find a regex for CSV's see O'Reilly's "Mastering Regular Expressions" Section 8.4.4.3. Either buy the book - it's worth it - or subscribe to safari.

  • Hi, I am having trouble MacBook Air crashing since Yosemite upgrade. I ran an Etresoft check but I don't know what it means... my system runs slowly and crashes. I have to force shutdown. Sometimes screen is black for a split second b/w webmail pages

    Hello,
    I am having trouble with my MacBook Air 13 inch June 2012 MacBook Air5, 2 4GB RAM  details below in Etresoft report. I recently upgraded to Yosemite and am having system trouble. My computer crashes and I have to force quit to restart. When using webmail there is a black screen for a split second between pages. This did not happen before. I am worried that it is not running properly and perhaps I need to revert to the previous operating system. I only have a MacBook Air and no need to share images between a tablet or phone so I did not need the new photo sharing software of Yosemite. I wonder if I don't have enough RAM to run it? I did not run time machine before I made the upgrade as I did not realise the significance of an upgrade as not very Mac literate. Any advice on whether my system is in danger... most appreciated! I am writing a book and making a back up but this machine is my lifeline and my work is conducted through it. It ran perfectly before... the Yosemite upgrade has perhaps highlighted some problems and it has unnerved me!
    Thanks ever so much for your advice!
    Lillibet
    EtreCheck version: 2.2 (132)
    Report generated 5/2/15, 9:53 PM
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        MacBook Air (13-inch, Mid 2012) (Technical Specifications)
        MacBook Air - model: MacBookAir5,2
        1 1.8 GHz Intel Core i5 CPU: 2-core
        4 GB RAM Not upgradeable
            BANK 0/DIMM0
                2 GB DDR3 1600 MHz ok
            BANK 1/DIMM0
                2 GB DDR3 1600 MHz ok
        Bluetooth: Good - Handoff/Airdrop2 supported
        Wireless:  en0: 802.11 a/b/g/n
        Battery: Health = Normal - Cycle count = 694 - SN = D86218700K2DKRNAF
    Video Information: ℹ️
        Intel HD Graphics 4000
            Color LCD 1440 x 900
    System Software: ℹ️
        OS X 10.10.3 (14D136) - Time since boot: 0:22:41
    Disk Information: ℹ️
        APPLE SSD SM256E disk0 : (251 GB)
            EFI (disk0s1) <not mounted> : 210 MB
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
            Macintosh HD (disk1) / : 249.77 GB (167.35 GB free)
                Encrypted AES-XTS Unlocked
                Core Storage: disk0s2 250.14 GB Online
    USB Information: ℹ️
        Apple, Inc. Keyboard Hub
            Mitsumi Electric Apple Optical USB Mouse
            Apple Inc. Apple Keyboard
        Apple Inc. FaceTime HD Camera (Built-in)
        Apple Inc. BRCM20702 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple Internal Memory Card Reader
        Apple Inc. Apple Internal Keyboard / Trackpad
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Kernel Extensions: ℹ️
            /Applications/WD +TURBO Installer.app
        [not loaded]    com.wdc.driver.1394HP (1.0.11 - SDK 10.4) [Click for support]
        [not loaded]    com.wdc.driver.1394_64HP (1.0.1 - SDK 10.6) [Click for support]
        [not loaded]    com.wdc.driver.USB-64HP (1.0.3) [Click for support]
        [not loaded]    com.wdc.driver.USBHP (1.0.14) [Click for support]
            /System/Library/Extensions
        [not loaded]    com.wdc.driver.1394.64.10.9 (1.0.1 - SDK 10.9) [Click for support]
        [loaded]    com.wdc.driver.USB.64.10.9 (1.0.1 - SDK 10.9) [Click for support]
    Problem System Launch Daemons: ℹ️
        [failed]    com.apple.mtrecorder.plist
    Launch Agents: ℹ️
        [running]    com.mcafee.menulet.plist [Click for support]
        [running]    com.mcafee.reporter.plist [Click for support]
        [loaded]    com.oracle.java.Java-Updater.plist [Click for support]
    Launch Daemons: ℹ️
        [running]    com.adobe.ARM.[...].plist [Click for support]
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [failed]    com.apple.spirecorder.plist
        [running]    com.mcafee.ssm.Eupdate.plist [Click for support]
        [running]    com.mcafee.ssm.ScanManager.plist [Click for support]
        [running]    com.mcafee.virusscan.fmpd.plist [Click for support]
        [loaded]    com.oracle.java.Helper-Tool.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [loaded]    com.google.keystone.agent.plist [Click for support]
    User Login Items: ℹ️
        iTunesHelper    Application Hidden (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
        Dropbox    Application  (/Applications/Dropbox.app)
        AdobeResourceSynchronizer    Application Hidden (/Applications/Adobe Reader.app/Contents/Support/AdobeResourceSynchronizer.app)
        EvernoteHelper    Application  (/Applications/Evernote.app/Contents/Library/LoginItems/EvernoteHelper.app)
        TouchP-150M    Application  (/Applications/Canon P-150M/TouchP-150M.app)
        iPhoto    Application  (/Applications/iPhoto.app)
        WDDriveUtilityHelper    Application  (/Applications/WD Drive Utilities.app/Contents/WDDriveUtilityHelper.app)
        WDSecurityHelper    Application  (/Applications/WD Security.app/Contents/WDSecurityHelper.app)
    Internet Plug-ins: ℹ️
        FlashPlayer-10.6: Version: 17.0.0.169 - SDK 10.6 [Click for support]
        QuickTime Plugin: Version: 7.7.3
        AdobePDFViewerNPAPI: Version: 11.0.10 - SDK 10.6 [Click for support]
        AdobePDFViewer: Version: 11.0.10 - SDK 10.6 [Click for support]
        Flash Player: Version: 17.0.0.169 - SDK 10.6 [Click for support]
        Default Browser: Version: 600 - SDK 10.10
        JavaAppletPlugin: Version: Java 8 Update 45 Check version
    3rd Party Preference Panes: ℹ️
        Flash Player  [Click for support]
        FUSE for OS X (OSXFUSE)  [Click for support]
        Java  [Click for support]
        MacFUSE  [Click for support]
        NTFS-3G  [Click for support]
    Time Machine: ℹ️
        Skip System Files: NO
        Mobile backups: ON
        Auto backup: YES
        Volumes being backed up:
            Macintosh HD: Disk size: 249.77 GB Disk used: 82.42 GB
        Destinations:
            My Passport Edge for Mac [Local]
            Total size: 499.94 GB
            Total number of backups: 27
            Oldest backup: 2013-01-31 21:15:26 +0000
            Last backup: 2015-05-02 11:33:09 +0000
            Size of backup disk: Adequate
                Backup size 499.94 GB > (Disk used 82.42 GB X 3)
    Top Processes by CPU: ℹ️
             6%    WindowServer
             3%    fontd
             2%    VShieldScanManager
             0%    taskgated
             0%    notifyd
    Top Processes by Memory: ℹ️
        745 MB    Google Chrome Helper(8)
        439 MB    kernel_task
        246 MB    VShieldScanner(3)
        160 MB    Google Chrome
        127 MB    Finder
    Virtual Memory Information: ℹ️
        130 MB    Free RAM
        3.87 GB    Used RAM
        0 B    Swap Used
    Diagnostics Information: ℹ️
        May 2, 2015, 09:30:08 PM    Self test - passed
        May 2, 2015, 08:52:59 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/soffice_2015-05-02-205259_[red acted].crash
        May 2, 2015, 09:28:53 AM    /Library/Logs/DiagnosticReports/backupd_2015-05-02-092853_[redacted].cpu_resour ce.diag [Click for details]
        May 1, 2015, 05:45:24 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/EvernoteHelper_2015-05-01-1745 24_[redacted].crash
        May 1, 2015, 05:38:54 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173854_[redacted].crash
        May 1, 2015, 05:38:43 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173843_[redacted].crash
        May 1, 2015, 05:38:32 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173832_[redacted].crash
        May 1, 2015, 05:38:27 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173827_[redacted].crash
        May 1, 2015, 05:38:10 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173810_[redacted].crash
        May 1, 2015, 05:38:00 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173800_[redacted].crash
        May 1, 2015, 05:37:49 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173749_[redacted].crash
        May 1, 2015, 05:37:38 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173738_[redacted].crash
        May 1, 2015, 05:37:27 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173727_[redacted].crash
        May 1, 2015, 05:37:22 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173722_[redacted].crash
        May 1, 2015, 05:37:06 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173706_[redacted].crash
        May 1, 2015, 05:36:55 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173655_[redacted].crash
        May 1, 2015, 05:36:44 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173644_[redacted].crash
        May 1, 2015, 05:36:33 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173633_[redacted].crash
        May 1, 2015, 05:36:22 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173622_[redacted].crash
        May 1, 2015, 05:36:17 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173617_[redacted].crash
        May 1, 2015, 05:36:01 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173601_[redacted].crash
        May 1, 2015, 05:35:50 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173550_[redacted].crash
        May 1, 2015, 05:35:39 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173539_[redacted].crash
        May 1, 2015, 05:35:28 PM    /Library/Logs/DiagnosticReports/mds_2015-05-01-173528_[redacted].crash
        May 1, 2015, 05:20:29 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/soffice_2015-05-01-172029_[red acted].crash
        May 1, 2015, 04:55:05 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/soffice_2015-05-01-165505_[red acted].crash
        May 1, 2015, 02:53:58 PM    /Library/Logs/DiagnosticReports/sharingd_2015-05-01-145358_[redacted].crash
        Apr 20, 2015, 09:31:20 PM    /Library/Logs/DiagnosticReports/Kernel_2015-04-20-213120_[redacted].panic [Click for details]

    When you have kernel panics, the pertinent information is in the panic report.
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ System Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar.
    There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of reports. A panic report has a name that begins with "Kernel" and ends in ".panic". Select the most recent one. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    If you don't see any reports listed, but you know there was a panic, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.

  • Arraylist and string split help

    i want to add items from a textfile into an array list here is the txt file
    Title,Artist
    tester,test
    rest,test
    red, blue
    here is the code i am using
    try{
      FileReader fr = new FileReader(fileName);
    BufferedReader br = new BufferedReader(fr);
    String s;
    int c = 0;
    while((s = br.readLine()) != null) {
      c=c+1;
      CD c3 = new CD("");
      String tokens[] = s.split(",");
            for(String token : tokens) {
          System.out.println(c);
           System.out.println(tokens.toString());
              if ( c == 2){
                c3.setTitle(token);
                    System.out.println(c);
                     System.out.println(token);
             c = c+1;
                  if ( c == 3 ){
                    c3.setArtist(token);
                    discsArray.add(c3);
                      System.out.println(token);
                    c = 1;
              System.out.println(token); }}
    fr.close();
    }catch (Exception e){
          System.out.println("exception occurrred");
      }here is the output of the array
    title: tester artist: tester title: rest artist: tester title: red artist: red
    as you can see it misses the last line of the textfile and also doesnt display all of the separated string;
    thanks any help is appreciated

    thanks for ur help but that wasnt the problem
    i have fixed it however when its read all the lines
    an exception is always thrown
    everything works just crashes at the end
    any ideas
    try{
      FileReader fr = new FileReader(fileName);
    BufferedReader br = new BufferedReader(fr);
    String s;
    int c = 0;
    while((s = br.readLine()) != null) {
      c=c+1;
      CD c3 = new CD("");
      String tokens[] = s.split(",");
            for(String token : tokens) {        
              if ( c == 2){
                c3.setTitle(token); 
                      c = c+1;
              if ( c == 3 ){
                    c3.setArtist(token); 
           if ( c == 3 ){
                    discsArray.add(c3);
                    c = 1; 
    fr.close();
    br.close();
      }catch (Exception e){
          System.out.println("exception occurrred");
      }

  • Java.lang.string(split)

    I am trying to split a delimited input record using the Perl equivalent pattern of /\|/. Can someone tell me what that translates too exactly in Java? My guess is "//'\'|//".
    Also once I split to an array I would like to pull the contents of each field out individually. The string.split function appears to place the entire record in the array. I am using the following syntax with
    the bufferedReader:
    String[] RecFields = thisLine.split("//'\'|//");
    My understanding was that this would place each field in it's own Array element without saving the delimeter. So that I could retrieve field
    number 3 in it's entirety for example by using the syntax:
    String strField3 = RecFields[3];
    StringTokenizer has already been tried and will not work because of null (empty) values in the string are skipped as Array elements.

    That was it!!! It was the actual delimiter string. I thought the extra slashes were an "OR" statement to eliminate duplicate records. I'll have to get this confirmed with Perl though. It's working perfectly now with \\| as the delimiter string. For those of you who are curious it was a 20 field pipe delimited record. Each field hada a variable length. The only records with values in each field all the time were fields 1 & 2, the others can contain null values. However all 20 fields are delimited no matter what value they contain.
    Thanks for your help everyone!

  • Faster split than String.split() and StringTokenizer?

    First I imrpoved performance of split by replacing the String.split() call with a custom method using StringTokenizer:
                    final StringTokenizer st = new StringTokenizer(string, separator, true);
                    String token = null;
                    String lastToken = separator; //if first token is separator
                    while (st.hasMoreTokens()) {
                        token = st.nextToken();
                        if (token.equals(separator)) {
                            if (lastToken.equals(separator)) { //no value between 2 separators?
                                result.add(emptyStrings ? "" : null);
                        } else {
                            result.add(token);
                        lastToken = token;
                    }//next tokenBut this is still not very fast (as it is one of the "hot spots" in my profiling sessions). I wonder if it can go still faster to split strings with ";" as the delimiter?

    Yup, for simple splitting without escaping of separators, indexOf is more than twice as fast:
        static private List<String> fastSplit(final String text, char separator, final boolean emptyStrings) {
            final List<String> result = new ArrayList<String>();
            if (text != null && text.length() > 0) {
                int index1 = 0;
                int index2 = text.indexOf(separator);
                while (index2 >= 0) {
                    String token = text.substring(index1, index2);
                    result.add(token);
                    index1 = index2 + 1;
                    index2 = text.indexOf(separator, index1);
                if (index1 < text.length() - 1) {
                    result.add(text.substring(index1));
            }//else: input unavailable
            return result;
        }Faster? ;-)

  • [SOLVED] Xorg Strangeness- Running startx runs xorg for a split second

    As in the subject, I am trying to run startx on my Arch (x86_64) machine for the first time since installation, however X only runs for a split second before quitting.. I've checked the log, but there aren't any errors that pop up to tell me what's going on.  What I've been doing that I think may affect the answer:
    Installed proprietary nvidia drivers that I downloaded off of nvidia's website (though I removed it by running sudo ./driver.run -uninstall)
    Installed nvidia drivers from the repository (sudo pacman -S nvidia nvidia-utils)
    shut off nouveau drivers (blacklisted nouveau in /etc/modprobe.d)
    Ran nvidia-xconfig to generate new xorg.conf file
    /var/log/Xorg.0.log shows nothing with (EE), so I assume that everything is going smoothly, however still can't get X to work.  Any help would be appreciated.  Google's let me down so far.
    Perhaps some fresh eyes could help me
    (contents of /var/log/Xorg.0.log)
    [ 22.116]
    X.Org X Server 1.12.2
    Release Date: 2012-05-29
    [ 22.116] X Protocol Version 11, Revision 0
    [ 22.116] Build Operating System: Linux 3.0.32-1-lts x86_64
    [ 22.116] Current Operating System: Linux Ponyville 3.3.7-1-ARCH #1 SMP PREEMPT Tue May 22 00:26:26 CEST 2012 x86_64
    [ 22.117] Kernel command line: root=/dev/sda4 ro
    [ 22.117] Build Date: 30 May 2012 07:24:13PM
    [ 22.117]
    [ 22.117] Current version of pixman: 0.26.0
    [ 22.117] Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    [ 22.117] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    [ 22.119] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jun 7 08:50:45 2012
    [ 22.148] (==) Using config file: "/etc/X11/xorg.conf"
    [ 22.148] (==) Using config directory: "/etc/X11/xorg.conf.d"
    [ 22.166] (==) ServerLayout "Layout0"
    [ 22.166] (**) |-->Screen "Screen0" (0)
    [ 22.166] (**) | |-->Monitor "Monitor0"
    [ 22.166] (**) | |-->Device "Device0"
    [ 22.166] (**) |-->Input Device "Keyboard0"
    [ 22.166] (**) |-->Input Device "Mouse0"
    [ 22.166] (==) Automatically adding devices
    [ 22.166] (==) Automatically enabling devices
    [ 22.196] (WW) The directory "/usr/share/fonts/TTF/" does not exist.
    [ 22.196] Entry deleted from font path.
    [ 22.196] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
    [ 22.196] Entry deleted from font path.
    [ 22.196] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
    [ 22.196] Entry deleted from font path.
    [ 22.213] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
    [ 22.213] Entry deleted from font path.
    [ 22.213] (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
    [ 22.213] (==) FontPath set to:
    /usr/share/fonts/misc/,
    /usr/share/fonts/100dpi/
    [ 22.213] (==) ModulePath set to "/usr/lib/xorg/modules"
    [ 22.213] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
    [ 22.213] (WW) Disabling Keyboard0
    [ 22.213] (WW) Disabling Mouse0
    [ 22.213] (II) Loader magic: 0x7c58e0
    [ 22.213] (II) Module ABI versions:
    [ 22.213] X.Org ANSI C Emulation: 0.4
    [ 22.213] X.Org Video Driver: 12.0
    [ 22.213] X.Org XInput driver : 16.0
    [ 22.213] X.Org Server Extension : 6.0
    [ 22.214] (--) PCI:*(0:1:0:0) 10de:0dc4:196e:085a rev 161, Mem @ 0xf8000000/16777216, 0xe8000000/134217728, 0xf0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/524288
    [ 22.214] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
    [ 22.214] (II) LoadModule: "extmod"
    [ 22.257] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    [ 22.264] (II) Module extmod: vendor="X.Org Foundation"
    [ 22.264] compiled for 1.12.2, module version = 1.0.0
    [ 22.264] Module class: X.Org Server Extension
    [ 22.264] ABI class: X.Org Server Extension, version 6.0
    [ 22.265] (II) Loading extension MIT-SCREEN-SAVER
    [ 22.265] (II) Loading extension XFree86-VidModeExtension
    [ 22.265] (II) Loading extension XFree86-DGA
    [ 22.265] (II) Loading extension DPMS
    [ 22.265] (II) Loading extension XVideo
    [ 22.265] (II) Loading extension XVideo-MotionCompensation
    [ 22.265] (II) Loading extension X-Resource
    [ 22.265] (II) LoadModule: "dbe"
    [ 22.265] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
    [ 22.265] (II) Module dbe: vendor="X.Org Foundation"
    [ 22.265] compiled for 1.12.2, module version = 1.0.0
    [ 22.265] Module class: X.Org Server Extension
    [ 22.265] ABI class: X.Org Server Extension, version 6.0
    [ 22.265] (II) Loading extension DOUBLE-BUFFER
    [ 22.265] (II) LoadModule: "glx"
    [ 22.266] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    [ 22.799] (II) Module glx: vendor="NVIDIA Corporation"
    [ 22.799] compiled for 4.0.2, module version = 1.0.0
    [ 22.799] Module class: X.Org Server Extension
    [ 22.799] (II) NVIDIA GLX Module 295.53 Fri May 11 23:49:08 PDT 2012
    [ 22.799] (II) Loading extension GLX
    [ 22.799] (II) LoadModule: "record"
    [ 22.799] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
    [ 22.885] (II) Module record: vendor="X.Org Foundation"
    [ 22.885] compiled for 1.12.2, module version = 1.13.0
    [ 22.885] Module class: X.Org Server Extension
    [ 22.885] ABI class: X.Org Server Extension, version 6.0
    [ 22.885] (II) Loading extension RECORD
    [ 22.885] (II) LoadModule: "dri"
    [ 22.885] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
    [ 22.911] (II) Module dri: vendor="X.Org Foundation"
    [ 22.911] compiled for 1.12.2, module version = 1.0.0
    [ 22.911] ABI class: X.Org Server Extension, version 6.0
    [ 22.911] (II) Loading extension XFree86-DRI
    [ 22.911] (II) LoadModule: "dri2"
    [ 22.911] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    [ 22.911] (II) Module dri2: vendor="X.Org Foundation"
    [ 22.911] compiled for 1.12.2, module version = 1.2.0
    [ 22.911] ABI class: X.Org Server Extension, version 6.0
    [ 22.911] (II) Loading extension DRI2
    [ 22.911] (II) LoadModule: "nvidia"
    [ 22.912] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    [ 22.993] (II) Module nvidia: vendor="NVIDIA Corporation"
    [ 22.993] compiled for 4.0.2, module version = 1.0.0
    [ 22.994] Module class: X.Org Video Driver
    [ 23.021] (II) NVIDIA dlloader X Driver 295.53 Fri May 11 23:29:56 PDT 2012
    [ 23.021] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
    [ 23.021] (--) using VT number 7
    [ 23.024] (II) Loading sub module "fb"
    [ 23.024] (II) LoadModule: "fb"
    [ 23.024] (II) Loading /usr/lib/xorg/modules/libfb.so
    [ 23.032] (II) Module fb: vendor="X.Org Foundation"
    [ 23.032] compiled for 1.12.2, module version = 1.0.0
    [ 23.032] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 23.032] (II) Loading sub module "wfb"
    [ 23.032] (II) LoadModule: "wfb"
    [ 23.032] (II) Loading /usr/lib/xorg/modules/libwfb.so
    [ 23.038] (II) Module wfb: vendor="X.Org Foundation"
    [ 23.038] compiled for 1.12.2, module version = 1.0.0
    [ 23.038] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 23.038] (II) Loading sub module "ramdac"
    [ 23.038] (II) LoadModule: "ramdac"
    [ 23.038] (II) Module "ramdac" already built-in
    [ 23.047] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
    [ 23.047] (==) NVIDIA(0): RGB weight 888
    [ 23.047] (==) NVIDIA(0): Default visual is TrueColor
    [ 23.047] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
    [ 23.047] (**) NVIDIA(0): Enabling 2D acceleration
    [ 23.817] (II) NVIDIA(GPU-0): Display (ViewSonic VA1916wSERIES (CRT-1)) does not support
    [ 23.817] (II) NVIDIA(GPU-0): NVIDIA 3D Vision stereo.
    [ 23.831] (II) NVIDIA(0): NVIDIA GPU GeForce GTS 450 (GF106) at PCI:1:0:0 (GPU-0)
    [ 23.831] (--) NVIDIA(0): Memory: 1048576 kBytes
    [ 23.831] (--) NVIDIA(0): VideoBIOS: 70.06.13.00.51
    [ 23.831] (II) NVIDIA(0): Detected PCI Express Link width: 16X
    [ 23.831] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
    [ 23.833] (--) NVIDIA(0): Connected display device(s) on GeForce GTS 450 at PCI:1:0:0
    [ 23.833] (--) NVIDIA(0): ViewSonic VA1916wSERIES (CRT-1)
    [ 23.833] (--) NVIDIA(0): ViewSonic VA1916wSERIES (CRT-1): 400.0 MHz maximum pixel
    [ 23.833] (--) NVIDIA(0): clock
    [ 23.868] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display
    [ 23.868] (**) NVIDIA(0): device ViewSonic VA1916wSERIES (CRT-1) (Using EDID
    [ 23.868] (**) NVIDIA(0): frequencies has been enabled on all display devices.)
    [ 23.874] (II) NVIDIA(0): Assigned Display Device: CRT-1
    [ 23.874] (==) NVIDIA(0):
    [ 23.874] (==) NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select"
    [ 23.874] (==) NVIDIA(0): will be used as the requested mode.
    [ 23.874] (==) NVIDIA(0):
    [ 23.874] (II) NVIDIA(0): Validated modes:
    [ 23.874] (II) NVIDIA(0): "nvidia-auto-select"
    [ 23.874] (II) NVIDIA(0): Virtual screen size determined to be 1440 x 900
    [ 23.903] (--) NVIDIA(0): DPI set to (89, 87); computed from "UseEdidDpi" X config
    [ 23.903] (--) NVIDIA(0): option
    [ 23.903] (--) Depth 24 pixmap format is 32 bpp
    [ 23.903] (II) NVIDIA: Using 3072.00 MB of virtual memory for indirect memory
    [ 23.903] (II) NVIDIA: access.
    [ 23.906] (II) NVIDIA(0): ACPI: failed to connect to the ACPI event daemon; the daemon
    [ 23.906] (II) NVIDIA(0): may not be running or the "AcpidSocketPath" X
    [ 23.906] (II) NVIDIA(0): configuration option may not be set correctly. When the
    [ 23.906] (II) NVIDIA(0): ACPI event daemon is available, the NVIDIA X driver will
    [ 23.906] (II) NVIDIA(0): try to use it to receive ACPI event notifications. For
    [ 23.906] (II) NVIDIA(0): details, please see the "ConnectToAcpid" and
    [ 23.906] (II) NVIDIA(0): "AcpidSocketPath" X configuration options in Appendix B: X
    [ 23.906] (II) NVIDIA(0): Config Options in the README.
    [ 23.908] (II) NVIDIA(0): Setting mode "nvidia-auto-select"
    [ 23.952] (II) Loading extension NV-GLX
    [ 24.017] (==) NVIDIA(0): Disabling shared memory pixmaps
    [ 24.017] (==) NVIDIA(0): Backing store disabled
    [ 24.017] (==) NVIDIA(0): Silken mouse enabled
    [ 24.017] (**) NVIDIA(0): DPMS enabled
    [ 24.017] (II) Loading extension NV-CONTROL
    [ 24.017] (II) Loading extension XINERAMA
    [ 24.017] (II) Loading sub module "dri2"
    [ 24.017] (II) LoadModule: "dri2"
    [ 24.017] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    [ 24.017] (II) Module dri2: vendor="X.Org Foundation"
    [ 24.017] compiled for 1.12.2, module version = 1.2.0
    [ 24.017] ABI class: X.Org Server Extension, version 6.0
    [ 24.017] (II) NVIDIA(0): [DRI2] Setup complete
    [ 24.017] (II) NVIDIA(0): [DRI2] VDPAU driver: nvidia
    [ 24.017] (==) RandR enabled
    [ 24.017] (II) Initializing built-in extension Generic Event Extension
    [ 24.017] (II) Initializing built-in extension SHAPE
    [ 24.017] (II) Initializing built-in extension MIT-SHM
    [ 24.017] (II) Initializing built-in extension XInputExtension
    [ 24.017] (II) Initializing built-in extension XTEST
    [ 24.017] (II) Initializing built-in extension BIG-REQUESTS
    [ 24.017] (II) Initializing built-in extension SYNC
    [ 24.017] (II) Initializing built-in extension XKEYBOARD
    [ 24.017] (II) Initializing built-in extension XC-MISC
    [ 24.017] (II) Initializing built-in extension SECURITY
    [ 24.017] (II) Initializing built-in extension XINERAMA
    [ 24.017] (II) Initializing built-in extension XFIXES
    [ 24.017] (II) Initializing built-in extension RENDER
    [ 24.017] (II) Initializing built-in extension RANDR
    [ 24.017] (II) Initializing built-in extension COMPOSITE
    [ 24.017] (II) Initializing built-in extension DAMAGE
    [ 24.018] (II) Initializing extension GLX
    [ 24.296] (II) config/udev: Adding input device Power Button (/dev/input/event1)
    [ 24.296] (**) Power Button: Applying InputClass "evdev keyboard catchall"
    [ 24.296] (II) LoadModule: "evdev"
    [ 24.296] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    [ 24.304] (II) Module evdev: vendor="X.Org Foundation"
    [ 24.304] compiled for 1.12.0, module version = 2.7.0
    [ 24.304] Module class: X.Org XInput Driver
    [ 24.304] ABI class: X.Org XInput driver, version 16.0
    [ 24.304] (II) Using input driver 'evdev' for 'Power Button'
    [ 24.304] (**) Power Button: always reports core events
    [ 24.304] (**) evdev: Power Button: Device: "/dev/input/event1"
    [ 24.304] (--) evdev: Power Button: Vendor 0 Product 0x1
    [ 24.304] (--) evdev: Power Button: Found keys
    [ 24.304] (II) evdev: Power Button: Configuring as keyboard
    [ 24.304] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1/event1"
    [ 24.304] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 6)
    [ 24.304] (**) Option "xkb_rules" "evdev"
    [ 24.304] (**) Option "xkb_model" "evdev"
    [ 24.304] (**) Option "xkb_layout" "us"
    [ 24.317] (II) config/udev: Adding input device Power Button (/dev/input/event0)
    [ 24.317] (**) Power Button: Applying InputClass "evdev keyboard catchall"
    [ 24.317] (II) Using input driver 'evdev' for 'Power Button'
    [ 24.317] (**) Power Button: always reports core events
    [ 24.317] (**) evdev: Power Button: Device: "/dev/input/event0"
    [ 24.317] (--) evdev: Power Button: Vendor 0 Product 0x1
    [ 24.317] (--) evdev: Power Button: Found keys
    [ 24.317] (II) evdev: Power Button: Configuring as keyboard
    [ 24.317] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input0/event0"
    [ 24.317] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 7)
    [ 24.317] (**) Option "xkb_rules" "evdev"
    [ 24.317] (**) Option "xkb_model" "evdev"
    [ 24.317] (**) Option "xkb_layout" "us"
    [ 24.318] (II) config/udev: Adding input device HDA NVidia HDMI/DP,pcm=9 (/dev/input/event14)
    [ 24.318] (II) No input driver specified, ignoring this device.
    [ 24.318] (II) This device may have been added with another device file.
    [ 24.318] (II) config/udev: Adding input device HDA NVidia HDMI/DP,pcm=8 (/dev/input/event15)
    [ 24.318] (II) No input driver specified, ignoring this device.
    [ 24.318] (II) This device may have been added with another device file.
    [ 24.318] (II) config/udev: Adding input device HDA NVidia HDMI/DP,pcm=7 (/dev/input/event16)
    [ 24.318] (II) No input driver specified, ignoring this device.
    [ 24.318] (II) This device may have been added with another device file.
    [ 24.318] (II) config/udev: Adding input device HDA NVidia HDMI/DP,pcm=3 (/dev/input/event17)
    [ 24.318] (II) No input driver specified, ignoring this device.
    [ 24.318] (II) This device may have been added with another device file.
    [ 24.318] (II) config/udev: Adding input device HDA Intel PCH Line Out Side (/dev/input/event10)
    [ 24.318] (II) No input driver specified, ignoring this device.
    [ 24.318] (II) This device may have been added with another device file.
    [ 24.318] (II) config/udev: Adding input device HDA Intel PCH Line Out CLFE (/dev/input/event11)
    [ 24.318] (II) No input driver specified, ignoring this device.
    [ 24.318] (II) This device may have been added with another device file.
    [ 24.318] (II) config/udev: Adding input device HDA Intel PCH Line Out Surround (/dev/input/event12)
    [ 24.318] (II) No input driver specified, ignoring this device.
    [ 24.318] (II) This device may have been added with another device file.
    [ 24.319] (II) config/udev: Adding input device HDA Intel PCH Line Out Front (/dev/input/event13)
    [ 24.319] (II) No input driver specified, ignoring this device.
    [ 24.319] (II) This device may have been added with another device file.
    [ 24.319] (II) config/udev: Adding input device HDA Intel PCH Line (/dev/input/event6)
    [ 24.319] (II) No input driver specified, ignoring this device.
    [ 24.319] (II) This device may have been added with another device file.
    [ 24.319] (II) config/udev: Adding input device HDA Intel PCH Front Mic (/dev/input/event7)
    [ 24.319] (II) No input driver specified, ignoring this device.
    [ 24.319] (II) This device may have been added with another device file.
    [ 24.319] (II) config/udev: Adding input device HDA Intel PCH Rear Mic (/dev/input/event8)
    [ 24.319] (II) No input driver specified, ignoring this device.
    [ 24.319] (II) This device may have been added with another device file.
    [ 24.319] (II) config/udev: Adding input device HDA Intel PCH Front Headphone (/dev/input/event9)
    [ 24.319] (II) No input driver specified, ignoring this device.
    [ 24.319] (II) This device may have been added with another device file.
    [ 24.319] (II) config/udev: Adding input device UVC Camera (046d:09a1) (/dev/input/event5)
    [ 24.319] (**) UVC Camera (046d:09a1): Applying InputClass "evdev keyboard catchall"
    [ 24.319] (II) Using input driver 'evdev' for 'UVC Camera (046d:09a1)'
    [ 24.319] (**) UVC Camera (046d:09a1): always reports core events
    [ 24.319] (**) evdev: UVC Camera (046d:09a1): Device: "/dev/input/event5"
    [ 24.319] (--) evdev: UVC Camera (046d:09a1): Vendor 0x46d Product 0x9a1
    [ 24.319] (--) evdev: UVC Camera (046d:09a1): Found keys
    [ 24.319] (II) evdev: UVC Camera (046d:09a1): Configuring as keyboard
    [ 24.319] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1.3/6-1.3:1.0/input/input5/event5"
    [ 24.319] (II) XINPUT: Adding extended input device "UVC Camera (046d:09a1)" (type: KEYBOARD, id 8)
    [ 24.319] (**) Option "xkb_rules" "evdev"
    [ 24.319] (**) Option "xkb_model" "evdev"
    [ 24.319] (**) Option "xkb_layout" "us"
    [ 24.320] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event3)
    [ 24.320] (**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
    [ 24.320] (II) Using input driver 'evdev' for 'Logitech USB Receiver'
    [ 24.320] (**) Logitech USB Receiver: always reports core events
    [ 24.320] (**) evdev: Logitech USB Receiver: Device: "/dev/input/event3"
    [ 24.320] (--) evdev: Logitech USB Receiver: Vendor 0x46d Product 0xc517
    [ 24.320] (--) evdev: Logitech USB Receiver: Found keys
    [ 24.320] (II) evdev: Logitech USB Receiver: Configuring as keyboard
    [ 24.320] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1.8/6-1.8:1.0/input/input3/event3"
    [ 24.320] (II) XINPUT: Adding extended input device "Logitech USB Receiver" (type: KEYBOARD, id 9)
    [ 24.320] (**) Option "xkb_rules" "evdev"
    [ 24.320] (**) Option "xkb_model" "evdev"
    [ 24.320] (**) Option "xkb_layout" "us"
    [ 24.320] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event4)
    [ 24.320] (**) Logitech USB Receiver: Applying InputClass "evdev pointer catchall"
    [ 24.320] (**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
    [ 24.320] (II) Using input driver 'evdev' for 'Logitech USB Receiver'
    [ 24.320] (**) Logitech USB Receiver: always reports core events
    [ 24.320] (**) evdev: Logitech USB Receiver: Device: "/dev/input/event4"
    [ 24.320] (--) evdev: Logitech USB Receiver: Vendor 0x46d Product 0xc517
    [ 24.320] (--) evdev: Logitech USB Receiver: Found 12 mouse buttons
    [ 24.320] (--) evdev: Logitech USB Receiver: Found scroll wheel(s)
    [ 24.320] (--) evdev: Logitech USB Receiver: Found relative axes
    [ 24.320] (--) evdev: Logitech USB Receiver: Found x and y relative axes
    [ 24.320] (--) evdev: Logitech USB Receiver: Found absolute axes
    [ 24.320] (II) evdev: Logitech USB Receiver: Forcing absolute x/y axes to exist.
    [ 24.320] (--) evdev: Logitech USB Receiver: Found keys
    [ 24.320] (II) evdev: Logitech USB Receiver: Configuring as mouse
    [ 24.320] (II) evdev: Logitech USB Receiver: Configuring as keyboard
    [ 24.320] (II) evdev: Logitech USB Receiver: Adding scrollwheel support
    [ 24.320] (**) evdev: Logitech USB Receiver: YAxisMapping: buttons 4 and 5
    [ 24.320] (**) evdev: Logitech USB Receiver: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    [ 24.320] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1.8/6-1.8:1.1/input/input4/event4"
    [ 24.320] (II) XINPUT: Adding extended input device "Logitech USB Receiver" (type: KEYBOARD, id 10)
    [ 24.320] (**) Option "xkb_rules" "evdev"
    [ 24.320] (**) Option "xkb_model" "evdev"
    [ 24.320] (**) Option "xkb_layout" "us"
    [ 24.320] (II) evdev: Logitech USB Receiver: initialized for relative axes.
    [ 24.320] (WW) evdev: Logitech USB Receiver: ignoring absolute axes.
    [ 24.320] (**) Logitech USB Receiver: (accel) keeping acceleration scheme 1
    [ 24.320] (**) Logitech USB Receiver: (accel) acceleration profile 0
    [ 24.320] (**) Logitech USB Receiver: (accel) acceleration factor: 2.000
    [ 24.320] (**) Logitech USB Receiver: (accel) acceleration threshold: 4
    [ 24.320] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/mouse0)
    [ 24.320] (II) No input driver specified, ignoring this device.
    [ 24.320] (II) This device may have been added with another device file.
    [ 24.321] (II) config/udev: Adding input device Eee PC WMI hotkeys (/dev/input/event2)
    [ 24.321] (**) Eee PC WMI hotkeys: Applying InputClass "evdev keyboard catchall"
    [ 24.321] (II) Using input driver 'evdev' for 'Eee PC WMI hotkeys'
    [ 24.321] (**) Eee PC WMI hotkeys: always reports core events
    [ 24.321] (**) evdev: Eee PC WMI hotkeys: Device: "/dev/input/event2"
    [ 24.321] (--) evdev: Eee PC WMI hotkeys: Vendor 0 Product 0
    [ 24.321] (--) evdev: Eee PC WMI hotkeys: Found keys
    [ 24.321] (II) evdev: Eee PC WMI hotkeys: Configuring as keyboard
    [ 24.321] (**) Option "config_info" "udev:/sys/devices/platform/eeepc-wmi/input/input2/event2"
    [ 24.321] (II) XINPUT: Adding extended input device "Eee PC WMI hotkeys" (type: KEYBOARD, id 11)
    [ 24.321] (**) Option "xkb_rules" "evdev"
    [ 24.321] (**) Option "xkb_model" "evdev"
    [ 24.321] (**) Option "xkb_layout" "us"
    [ 24.497] (II) evdev: Power Button: Close
    [ 24.497] (II) UnloadModule: "evdev"
    [ 24.497] (II) evdev: Power Button: Close
    [ 24.497] (II) UnloadModule: "evdev"
    [ 24.497] (II) evdev: UVC Camera (046d:09a1): Close
    [ 24.497] (II) UnloadModule: "evdev"
    [ 24.497] (II) evdev: Logitech USB Receiver: Close
    [ 24.497] (II) UnloadModule: "evdev"
    [ 24.497] (II) evdev: Logitech USB Receiver: Close
    [ 24.497] (II) UnloadModule: "evdev"
    [ 24.497] (II) evdev: Eee PC WMI hotkeys: Close
    [ 24.497] (II) UnloadModule: "evdev"
    [ 24.680] Server terminated successfully (0). Closing log file.
    Contents of Xorg.conf:
    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig: version 295.53 ([email protected]) Sat May 12 00:34:20 PDT 2012
    Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0"
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    EndSection
    Section "Files"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/psaux"
    Option "Emulate3Buttons" "no"
    Option "ZAxisMapping" "4 5"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    Option "DPMS"
    EndSection
    Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection
    Last edited by Glupoi652 (2012-06-07 20:51:53)

    windscape wrote:
    wgetfree wrote:It may be a stupid question but do you have all the Xorg dependencies?
    It may even be simpler than that. If this is a new installation, a desktop environment or window manager may not be installed. In that case, the Xorg server has nothing to do. Install a desktop environment or window manager and see if Xorg continues running once it has something to do.
    Listen to this man. What I meant by Xorg dependencies is that people usually install xterm, xclock, etc so they have a very basic WM set up so they can see that Xorg is in fact working. Try setting up a .xinitrc with the following in it:
    exec startxfce4 --with-ck-launch
    Or even try to launch it manually with:
    $ startxfce4

  • Program for string comparision in ABAP

    Hi,
    I require a program in abap for string comparision

    Comparing Strings
    Similarly to the special statements for processing strings, there are special comparisons that you can apply to strings with types C, D, N, and T. You can use the following operators:
    <operator>
    Meaning
    CO
    Contains Only
    CN
    Contains Not only
    CA
    Contains Any
    NA
    contains Not Any
    CS
    Contains String
    NS
    contains No String
    CP
    Contains Pattern
    NP
    contains No Pattern
    There are no conversions with these comparisons. Instead, the system compares the characters of the string. The operators have the following functions:
    CO (Contains Only)
    The logical expression
    <f1> CO <f2>
    is true if <f1> contains only characters from <f2>. The comparison is case-sensitive. Trailing blanks are included. If the comparison is true, the system field SY-FDPOS contains the length of <f1>. If it is false, SY-FDPOS contains the offset of the first character of <f1> that does not occur in <f2> .
    CN (Contains Not only)
    The logical expression
    <f1> CN <f2>
    is true if <f1> does also contains characters other than those in <f2>. The comparison is case-sensitive. Trailing blanks are included. If the comparison is true, the system field SY-FDPOS contains the offset of the first character of <f1> that does not also occur in <f2>. If it is false, SY-FDPOS contains the length of <f1>.
    CA (Contains Any)
    The logical expression
    <f1> CA <f2>
    is true if <f1> contains at least one character from <f2>. The comparison is case-sensitive. If the comparison is true, the system field SY-FDPOS contains the offset of the first character of <f1> that also occurs in <f2> . If it is false, SY-FDPOS contains the length of <f1>.
    NA (contains Not Any)
    The logical expression
    <f1> NA <f2>
    is true if <f1> does not contain any character from <f2>. The comparison is case-sensitive. If the comparison is true, the system field SY-FDPOS contains the length of <f1>. If it is false, SY-FDPOS contains the offset of the first character of <f1> that occurs in <f2> .
    CS (Contains String)
    The logical expression
    <f1> CS <f2>
    is true if <f1> contains the string <f2>. Trailing spaces are ignored and the comparison is not case-sensitive. If the comparison is true, the system field SY-FDPOS contains the offset of <f2> in <f1> . If it is false, SY-FDPOS contains the length of <f1>.
    NS (contains No String)
    The logical expression
    <f1> NS <f2>
    is true if <f1> does not contain the string <f2>. Trailing spaces are ignored and the comparison is not case-sensitive. If the comparison is true, the system field SY-FDPOS contains the length of <f1>. If it is false, SY-FDPOS contains the offset of <f2> in <f1> .
    CP (Contains Pattern)
    The logical expression
    <f1> CP <f2>
    is true if <f1> contains the pattern <f2>. If <f2> is of type C, you can use the following wildcards in <f2>:
    for any character string *
    for any single character +
    Trailing spaces are ignored and the comparison is not case-sensitive. If the comparison is true, the system field SY-FDPOS contains the offset of <f2> in <f1> . If it is false, SY-FDPOS contains the length of <f1>.
    If you want to perform a comparison on a particular character in <f2>, place the escape character # in front of it. You can use the escape character # to specify
    characters in upper and lower case
    the wildcard character "" (enter # )
    the wildcard character "" (enter # )
    the escape symbol itself (enter ## )
    blanks at the end of a string (enter #___ )
    NP (contains No Pattern)
    The logical expression
    <f1> NP <f2>
    is true if <f1> does not contain the pattern <f2>. In <f2>, you can use the same wildcards and escape character as for the operator CP.
    Trailing spaces are ignored and the comparison is not case-sensitive. If the comparison is true, the system field SY-FDPOS contains the length of <f1>. If it is false, SY-FDPOS contains the offset of <f2> in <f1> .
    DATA: F1(5) TYPE C VALUE <f1>,
          F2(5) TYPE C VALUE <f2>.
    IF F1 <operator> F2.
       WRITE: / 'Comparison true, SY-FDPOS=', SY-FDPOS.
    ELSE.
       WRITE: / 'Comparison false, SY-FDPOS=', SY-FDPOS.
    ENDIF.
    The following table shows the results of executing this program, depending on which operators and values of F1 and F2.
    <f1>
    <operator>
    <f2>
    Result
    SY-FDPOS
    'BD '
    CO
    'ABCD '
    true
    5
    'BD '
    CO
    'ABCDE'
    false
    2
    'ABC12'
    CN
    'ABCD '
    true
    3
    'ABABC'
    CN
    'ABCD '
    false
    5
    'ABcde'
    CA
    'Bd '
    true
    1
    'ABcde'
    CA
    'bD '
    false
    5
    'ABAB '
    NA
    'AB '
    false
    0
    'ababa'
    NA
    'AB '
    true
    5
    'ABcde'
    CS
    'bC '
    true
    1
    'ABcde'
    CS
    'ce '
    false
    5
    'ABcde'
    NS
    'bC '
    false
    1
    'ABcde'
    NS
    'ce '
    true
    5
    'ABcde'
    CP
    'b'
    true
    1
    'ABcde'
    CP
    '#b'
    false
    5
    'ABcde'
    NP
    'b'
    false
    1
    'ABcde'
    NP
    '#b'
    true
    5
    goto sap library if intsalled in ur system and check the above one....

Maybe you are looking for

  • Macbook Air 2010 trackpad stop working when touching case (palm rest)

    My MBA 2010 A1369 had demaged keyboard and trackpad by liquid. I got used whoel top case and replace. (not myself) Seller claimed it is ok but we face one problem. when I touch case (palm rest) trackpad stops responding. When on one side partly when

  • ITunes Won't Open After Upgrading

    I have tried everything mentioned in the other threads but nothing seems to work for me. Everytime I open itunes it would show the hour glass then the hour glass would just go away and nothing happens, when i check my task manager, itunes is running

  • Calendar colour changes

    My work calemdar suddenly changed from Green To Purple which clases with onother canendar. Unable to get it back. This seems to be a problem for many people. Any answers??

  • P7-1258 no audio dvi-d output?

    ive tried every idt hd audio driver.dont think the sound comes through it any way i have a hdmi adapter hooked in to dvid output hooked in to my tv and can get no sound have also tried every amd radeon driver as well does dvi-d sopport audio?i also h

  • Buy separate liscence for CS4 upgrade

    I have a copy of CS4 to upgrade from CS2.  Two other computers here at work need to be upgraded and we want to all be running the same version of the software - is there a way for me to just buy the correct upgrade liscenses (I have the software)?