Odd string algorithm (string is for Runtime for linux/unix browser popup)

I was given this code snippet from this forum in an attempt to popup a web brower in linux/unix operating systems. It doesn't work.
I have never seen the part of code in bold (the for loop) below, so I can't really make sense of it (the '?' and ':' are new operators to me). When I print the StringBuffer, I show some memory addresses, so I suspect the bold code to be the problem (perhaps needs to specify array indexes?).
If anyone can either decipher the bold code for me or offer a solution that would work, I would be very grateful.
Thanks!
static boolean showInBrowser(String url)
    String os = System.getProperty("os.name").toLowerCase();
    Runtime rt = Runtime.getRuntime();
    try
            if (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0)
              String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror",
                  "netscape","opera","links","lynx"};
              StringBuffer cmd = new StringBuffer();
for (int i=0; i<browsers.length; i++)
cmd.append( (i==0 ? "" : " || " ) + browsers +" \"" + url + "\" ");
              rt.exec(new String[] { "sh", "-c", cmd.toString() });
              //System.out.println(cmd.toString());
           else
             return false;
    catch (IOException e)
        e.printStackTrace();
        return false;
    return true;
}

?: is like an if-else operator: i==0?foo:bar is
if(i==0) value_of_expression = foo else value_of_expression = bar.
You probably get memory addresses because in the loop "browsers" should really be browsers
Plain "browsers" just keeps giving you the memory address of the array (or if you want to get nitpicky the hash code which is not really the address.)

Similar Messages

  • Please package Java ME SDK 3.0 for Linux/Unix

    Hi Oracle guys!
    Please package Java ME SDK 3.0 for Linux/Unix soon!
    It would be of benefit both to us developers, and to Oracle.
    Thanks!

    user8771084 wrote:
    Señores Oracle si ustedes no pueden desarrollar Java ME SDK 3.0 for Linux/Unix no importa!!!, igual sabemos que no están a la altura de Sun Microsystems ni de la comunidad de Linux/GNU.
    Si ustedes se deciden lanzar la versión Java ME SDK 3.0 for Linux/Unix se lo agradeceremos, recuerde que Linux/GNU dia a dia crece mas y mas, y es un mercado que se debe cuidar.Translated to English:
    Oracle Gentlemen if you can not develop Java ME SDK 3.0 for Linux / Unix does not matter!,
    As we know are not up to Sun Microsystems or the community of Linux / GNU.
    If you decide to launch the Java ME SDK 3.0 for Linux / Unix appreciate it, remember that GNU / Linux is growing day by day more and more, and is a market that needs to be nurtured.

  • Java ME SDK 3.x for Linux/Unix

    Hi!
    There was talk the last couple of years of a Linux/Unix release for the Java ME SDK 3.x,
    but as of today I see nothing like that at the download site.
    Does anybody know the state of this?
    A Linux/Unix SDK would be very helpful to me in my development work!
    (This is a ping to users, who themselves are Oracle Product Development personnel!)

    Yes, a real need for many developers.
    cherrs

  • FormsCentral PDFs not working for Linux and Unix users

    I recently created a PDF (using Indesign > Acrobat IX Pro > Formscentral [AFC]) that includes radio buttons, form fields, linked videos set to play in the PDF once clicked and (after running through AFC) a submit button.
    The form has been distributed and we have already had hundreds of successful responses collected in the AFC site, all is working well there.
    One major problem we are having is that we have a lot of Linux/Unix users and the response from them is that they can't activate the videos, the form fields are out of kilter alignmentwise and the submit button does not work. Even when using the proper Adobe Acrobat Reader (v9, for example).
    Is the Adobe development team aware of problems such as these for Linux/Unix platforms and is there a suggested fix that they know of?
    The link to the actual file is here: http://cms.iopscience.iop.org/alfresco/d/d/workspace/SpacesStore/b5a48eac-8642-11e2-8cf8-e 50acbc9fd86/NJP-Video-Abstracts-Competition-2013.pdf
    Thanks in advance

    Hi Jesse,
    can you email me ([email protected]) the original PDF (before you imported it in FormsCentral)? Also, I'm curious about the format of the video in the PDF. Does the video in the PDF worked in Linux/Unix before going through the FormsCentral import/export?
    When I look at your PDF on my Red Hat Entrprise Linux 6.0 system with Reader 9.5.4 it does look fine (location of the fields) but the video generate an error (which I'm still investigating). I have not yet try the submit button on your form (as I don't want to submit bad data to you) but I seem to have an issue with the submit button on other PDF forms I generated (when I try to submit from a linux machine). Still investigating that as well.
    Gen

  • Sound in PDFs not playing - suse - latest Reader for linux  (7.0.9?)

    I have a pdf that has sound files incorporated into it somehow and I can't get them to play. I am using the latest available adobe reader for linux and I have suse linux, I forget what version but not too old. When I click on the link for the sound, absolutely nothing happens. I know it does work because it works at work on Vista. I am not sure whether there are actual sound files in there or if they are links to files on the internet. I suspect maybe they are links because it also will not work in windows XP with Reader 8 on a computer not connected to the internet. However, I have been able to find no information on this, so I don't have a clue.
    Is sound in pdfs a Reader 8 only feature? Does it just not work in Linux? Is there any way to be able to listen to those audio clips?

    So you mean there is a release coming out that will solve my problem? Does anyone know when?
    (The only thing I've found is stuff written in December last year saying they will release Reader 8 for linux/Unix soon. Soon has been and gone since then ;) )

  • How to fix "no valid 'aps-environment' entitlement string found for application"?

    I am trying very very hard to create a simple simple iOS app which can recieve push notifications.  My only reason for doing this is to establish a procedure for some other team members to use.  Our shop is fairly new to iOS dev, I personally am completely inexperienced with iOS dev and Xcode.  I've stumbled through tens of tutorials, articles, and trouble posts from Apple and elsewhere and I feel like I'm nearly there.  Here is where I've got to (note I'm using Xcode 4.3 and trying initially to deploy just to iOS 5.1, and I gather that some things may have changed recently vs earlier versions of Xcode, but again I'm new to all this -- and finding it completely confusing and convoluted):
    1. I've got a provisioning profile on my iPhone which has Push enabled
    2. In my test Xcode project I've got that provisioning profile selected as the signing identity (in Build Settings > Code Signing)
    3. I've got my bundle identifier under Summary and Info > Custom iOS Target Properties set properly* (I think??)
    4. I've got registerForRemoteNotificationTypes being called in my delegate's didFinishLaunchingWithOptions
    5. I've got didRegisterForRemoteNotificationsWithDeviceToken and didFailToRegisterForRemoteNotificationsWithError in my delegate, set up to log the device token or error respectively
    6. I've got Enable Entitlements checked under Summary. 
    7. Right below that the Entitlements File selected is Tinker6 (the name of my project), which was generated automatically when I checked Enable Entitlements
    8. In the Tinker6.entitlements file I've got the following (which I've gathered is correct based on several different posts all over the web, but which I can't find anything definitive from Apple itself on):
    When I attempt to run this on my device, I get the following error in Xcode output:
    2012-06-11 12:45:23.762 Tinker6[13332:707] Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x24a3b0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
    I've tried setting get-task-allow to NO, aps-environment to production, all four possible combinations, same thing.
    How can I get past this?  Where is definitive documentation on this?
    -- further background follows --
    *As far as the bundle id, I am still not clear on how this should be set in relation to App Ids and Profile ids in the Provisioning profile.  In the Provisioning portal under App Ids I have this (I've scrambled the number and domain but otherwise structurally will be the same):
    And the two places bundle id is set I have this:
    I am not at all sure these are correct or whether one or both should be set to 12355456A7.com.whatever.tinker, though I've tried those earlier in the process with no success...
    Message was edited by: jwlarson

    Solution: startover, do everything exactly the same (but with new IDs and certs for everything), and it worked.

  • [svn] 1751: Bug: BLZ-174 - MessageClient.testMessage() is incorrectly doing a string compare for the subtopic header of an inbound message against the subtopic value (which may contain wildcards) that the Consumer is using.

    Revision: 1751
    Author: [email protected]
    Date: 2008-05-15 14:21:43 -0700 (Thu, 15 May 2008)
    Log Message:
    Bug: BLZ-174 - MessageClient.testMessage() is incorrectly doing a string compare for the subtopic header of an inbound message against the subtopic value (which may contain wildcards) that the Consumer is using.
    QA: No - customer verified the fix.
    Doc: No
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-174
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/MessageClient.java
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/services/MessageService.java

    If you create a metadatatype with a single metdata block, and you reference that in your vm/cm cell attribute using a *one* based index, Excel seems to see the link and it honors it when saving the spreadsheet.
    So, I ended up with something like:
    <c ... cm="1"/> (I'm dealing with cell metadata, but the concept is equivalente to value metadata)
    <metadataTypes count="1">
      <metadataType name="MyMetaType" .../>
    </metadataTypes>
    <futureMetadata count="1" name="MyMetaType">
      <bk>
        <extLst><ext
    uri="http://example" xmlns:x="http://example"><x:val>87</x:val></ext></extLst>
      </bk>
    </futureMetadata>
    <cellMetadata count="1">
      <bk><rc
    t="1" v="0"/></bk> <!-- this is what gets referenced as cm=1 on the cell -->
    </cellMetadata>
    Hope this helps. 

  • I want to take a series of hex characters in a string control and produce an HDLC string indicator for example if the data string control is 3F27 then the HDLC string indicator is 7E003F2700B57E

    I want to take a series of hex characters in a string control and produce an HDLC string indicator for example if the data string control is 3F27 then the HDLC string indicator is 7E003F2700B57E

    "thanks for your help "
    Does that mean you figured it out already?
    If not, see this thread for some HDLC related code.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=146859&query.id=3388#M146859
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Error in OFR : "No database connection string set for connection group"

    Hi all..
    In OFR, Batches Fail To Export When Line Pairing is Enabled and Batch Remains in State 750 With Error "No database connection string set for connection group".
    I have followed all steps associated to line pairing with database still my batch is not exported..
    Any help is appreciated..
    Thanks in advance

    Hi,
    in case you haven't done this already: for this problem we'd really need you to open a CSS message.
    From your problem description it sounds likely that LCA routines and liveCache user don't fit together. Please check the solution of note 811207 to see if that assumption is correct.
    Furthermore: liveCache 7.5 and SCM 4.0 are not released together (yet). When using SCM 4.0 only liveCache versions 7.4.03 Build XX are released. This it seems you're current combination is not supported!
    Please take a look at PAM (Produkt Availability Matrix) on the SAP Service Marketplace to see which combinations have been released.
    Kind regards,
    Roland
    Message was edited by: Roland Mallmann

  • [svn:osmf:] 15983: Updating VideoQoSPluginMetadataSynthesizer to create comma separated string values for all of the available keys .

    Revision: 15983
    Revision: 15983
    Author:   [email protected]
    Date:     2010-05-10 04:47:46 -0700 (Mon, 10 May 2010)
    Log Message:
    Updating VideoQoSPluginMetadataSynthesizer to create comma separated string values for all of the available keys.
    Modified Paths:
        osmf/trunk/apps/samples/plugins/VideoQoSPlugin/src/org/osmf/qos/VideoQoSPluginMetadataSyn thesizer.as

    Rob:
    "but the sad thing is, that managers will most likely respond with a "This used to be fast in MSSQL, but now it isn't any more in Oracle. Oracle is so slow ...""
    On the bright side, it sounds like most of the database calls are implemented as stored procedures, so there is an opportunity to do it right (in Oracle terms) in the stored procedures.
    I did a similar conversion a while back, converting bad SQLServer procedures to good Oracle procedures. Everyone said "Oracle is much faster that SQLServer"
    John

  • Byte to String conversion for encryption and decryption

    Hi Friends ,
    I am trying to encrypt a password string and then decrypt it .
    The thing is i need to convert the encrypted String which is a byte array to a string . While decrypting i need to convert the encrypted string to a Byte .
    I tried using String.getBytes() for converting a string to byte array , but this is giving an exception
    javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipherPlease find below my code
    import java.security.Key;
    import javax.crypto.Cipher;
    import javax.crypto.KeyGenerator;
    import sun.misc.BASE64Encoder;
    import sun.misc.BASE64Decoder;
    * @author rajeshreddy
    public class Encrypt
        public static void main(String[] args)
            try
            BASE64Encoder en = new BASE64Encoder();
            BASE64Decoder en1 = new BASE64Decoder();
                String password = "S_@!et";
                KeyGenerator kg = KeyGenerator.getInstance("DESede");
                Key key = kg.generateKey();
                Cipher cipher = Cipher.getInstance("DESede");
                cipher.init(Cipher.ENCRYPT_MODE, key);
                // Encrypt password
                byte[] encrypted = cipher.doFinal(password.getBytes());
                String e = new String(encrypted);
                byte[] toDecrypt  = e.getBytes();
                // Create decryption cipher
                cipher.init(Cipher.DECRYPT_MODE, key);
                byte[] decrypted = cipher.doFinal(toDecrypt);
                // Convert byte[] to String
                String decryptedString = new String(decrypted);
                System.out.println("password: " + password);
                System.out.println("encrypted: " + encrypted);
                System.out.println("decrypted: " + decryptedString);
            } catch (Exception ex)
                ex.printStackTrace();
    }I cab use sun.misc.BASE64Decoder and sun.misc.BASE64Encoder which avoids this error, but this packages are sun proprietery packages so there is a chance of removing these in future releases.
    Please suggest me the best way to tackle this

    1) The "Jakarta Commons Codec" project has Base64 and Hex encoders that are well tested and well regarded. Google is your friend.
    2) Since this is a new project, you should use AES rather than DESede.
    3) The defaults when generating the Cipher object using
    Cipher cipher = Cipher.getInstance("DESede");
                is for ECB block mode with PKCS5 padding. ECB is not a good block mode since it allows some limited forgery though splicing of ciphertext. Use one of the feedback modes such as CBC.
    4) Why are you encrypting passwords rather than just hashing them? While there are situations where encryption rather than hashing is required, it is not the norm and does normally require justification.
    5) Converting encrypted or hashed data to a String is not normally required. What are you doing with that requires this?
    Edited by: sabre150 on Dec 29, 2008 7:44 AM

  • Change a string parameter for different session

    Hi Gurus,
    I would like to find out how can I change a string parameter for an existing different session?
    In DBMS_SYSTEM package there are two functions :
    - SET_INT_PARAM_IN_SESSION
    - SET_BOOL_PARAM_IN_SESSION
    which change values of parameters, but not string ones :(
    Is it possible and if not, is there an alternative for changing STATISTICS_LEVEL for different session to ALL?
    Thank you in advance,
    Ela

    Hi,
    >>Once again: how to change a string parameter for a DIFFERENT session?
    Once again I will repeat if I was not clear before: You cannot to do this. Just directly using ALTER SESSION against the session.
    * SET_INT_PARAM_IN_SESSION: Sets[u] integer-type init.ora parameters in any session
    * SET_BOOL_PARAM_IN_SESSION: Sets boolean-type init.ora parameters in any session
    Cheers
    Legatti

  • DHCP SCOPE Option 67 string value for OS deployment

     I am completely new to OS Deployment and very less knowledge on dhcp. We are using SCCM2012 in our environment.  I am confused on  what should be the string value for DHCP 67 OPTION . Does the \ back slash make any
    difference when setting a string value. for example- \\smsboot\x64\wdsnbp.com or \smsboot\x64\wdsnbp.com or would i need to specify the complete path where  remote install folder is located  for example \\server name\c$\remoteinsall\smsboot\x64\wdsnbp.com
     .I cant test myself due to restrictions in our organization as the DHCP servers are handled by other team . Appreciate your help!!!

    Hi,
    >>what should be the string value for DHCP 67 OPTION
    The Option 67 should be SMSBoot\x86\wdsnbp.com
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • String Literal for ASCII Encoding

    I need to know what is the STRING LITERAL for ASCII CHAR. ENCODING in Java (as ISO_LATIN-1 has "8859_1").
    Thanks in Advance!

    import java.nio.charset.Charset;
    import java.util.Set;
    import java.util.Iterator;
    class Test {
         void m(String name) {
              Charset s = Charset.forName(name);
              System.out.println("display name= " + s.displayName());
              Set aliases = s.aliases();
              Iterator it = aliases.iterator();
              while (it.hasNext()) {
                   String x = (String)it.next();
                   System.out.println("alias= " + x);
         public static void main(String[] args) {
              if (args.length > 0) new Test().m(args[0]);
    }display name= US-ASCII
    alias= us
    alias= ISO_646.irv:1991
    alias= ANSI_X3.4-1968
    alias= iso-ir-6
    alias= 646
    alias= ISO646-US
    alias= cp367
    alias= ANSI_X3.4-1986
    alias= csASCII
    alias= ASCII
    alias= iso_646.irv:1983
    alias= IBM367

  • From where can i download ADF runtime 11.1.1.2.0 for linux

    Hello ,
    From where can i download ADF runtime 11.1.1.2.0 for linux.
    I used below link but i dont know whether i will get it for which OS (windows/Linux).
    http://www.oracle.com/technetwork/developer-tools/adf/downloads/index.html
    Regards,

    The runtime installation package is generic, ie. there are installers for both Windows and Linux.

Maybe you are looking for

  • Loadjava Problems !!

    Hi All, I'm experiencing some problems trying to load the SSOHash.class file to the schema that I created just like the same in the Install guide... The error String follows : E:\Projetos\Portal_SSO\lib\packages\oracle\security\sso>loadjava -user par

  • Screen flicker Mac Mini i5 2.3GHz 2011 ?

    Hi people, Does anybody else also experiences screen flicker on the Mac Mini i5 2.3GHz 2011 model, during startup from sleep-mode or a cold-boot in the morning? I posted a video on YouTube, to visualize the problem (otherwise hard to imagine, perhaps

  • Saving an html page in a blob

    Hi, i 've posted this question on some other forums with no luck. I need to find the simplest way to save a submitted html page(html code along with its values) into a blob so that i can redisplay the page with its values later on(like taking a scree

  • Product registrati​on website.

    Posting in the main forum so someone could give me pointers.... I recently purchased a new Toshiba laptop( L305-S5955) and googled for the product registration website. One of the links landed me onto: http://www.toshibaproductregistration.com/cgi-bi

  • Can't add PDF's to iTunes

    I cannot import PDF's into iTunes.  When I either "Add to Library..." or drag the PDF into the "Books" section nothing happens.  When I drag a PDF onto the "Books" section, the list area is surrounded by a blue box as if the file is going to be impor