Genarating random strings?

could someone please tell me if this code will generate a 'b' and a 'w'
if i tell it too. and how do i make it 5 characters long. And its says
this is how you call it and i dont have a clue what that means. and when
you answer this please dont use techincal terms cause im just learning
and i probaly wont have a clue what your talking about. thankyou.
<?php
// function to generate random strings
function RandomString($length=32)
$randstr='';
srand((double)microtime()*1000000);
//our array add all letters and numbers if you wish
$chars = array ( 'a','b','c','d','e','f');
for ($rand = 0; $rand <= $length; $rand++)
$random = rand(0, count($chars) -1);
$randstr .= $chars[$random];
return $randstr;
?>
and call it like this
<?php
echo RandomString(8);
?>
Example
ebbfbcbae

Well, first of all this is PHP code and not Java. And I am not sure but I don't think it's possible to call PHP functions in Java Code (the otehr way around it should be working though, at least with the Java Extension for PHP). So, if you are writing a Java programm, you will probably have to translate this code piece to Java.
Second. It will do what you want it to do - given you make a few modifications. You will have to change the line
$chars = array ( 'a','b','c','d','e','f');
to
$chars = array ( 'b','w');
as these are the characters you want. And you will have to call the function like this
echo RandomString(5);
if you want a string with five letters.
I don't know how much this will help you, since this code is PHP and written procedural and not object-orientented as you have to write Java in, and the translation to Java might not be that easy if you don't know much about Java.

Similar Messages

  • When accessing certain websites, I am met with a random string of characters in the browser window. What could be causing this?

    When trying to access certain websites, http://redditenhancementsuite.com/ or http://www.channel4.com/programmes/the- ... od#3293733 for example, all I get is a random string of characters in my browser window like the following:
    ‹­XmoÛ6þ>`ÿáª/Ý€ZÊËú²Í6Ð%ÍZ¬íŠ&A±O%щTI*®‡ýø='J¶”8^†._L‰wÇ{yîá)ÓG§¿Ÿ\üñᜟx÷vþí7ÓÂWeû+Eο•ô‚ ïë‰üÜš›YtbŽ—ÚO.ÖµŒ(O³ÈË/>aåŸ)+„uÒÏ¿˜ŒˆØˆWŸ”ó2Ï•§Wº:“ŒÐy£Œœ&a‚¥Ò×de9‹œ_—ÒRúˆ<ŽêNÈœ‹š°r1‹¬t1?Îÿ›Z$kœ7ÕÄp#¹úÜH»ž4jr¿ˆŸÅa7‡S.³ªöC/®Äo#r6›Eœ Ÿ’$3¹Œƒ¹83Uoù0~WJÇWpvšExý»É•ëÜqïŽÅ‡¹º5/Y–r"Ž(×^enìàÃÍUâ+ƒ‹ÆVwNOŠ€A8’š| aÅï€Åšhš«›v%0Ú‚"A†UµUQ•XJ—”fiâZ/#Z©Ü³èèé@$Õ²ðxx—¹YÄ‚\!qÛjmMÌØÞa<õzÂÛ#ûÇ°ÙÛçug²ìà„i"˜¶‘¶Q!B-BTÓ†‘ð‡¶˜"ìÍeµh¢hþÚTh"Ï!žC%7+]‘‡zua­YEóÓnsŸ…Ÿá~I8ë÷©@z²ºWùøêœÎðžOe›å_ !Qûds“5Ì Â+£;·N‡ïö)‹Zu*/?ŒÙ'˜¬Ôµÿ»ŸEŠ¥Ð×ÑüÞîS©i|¯GÂÓ€-ì4 …fL/­iêŸ.®(óf€xÿŸ+BØÀVq8ç¬þÄÇ€gŒí°OЄÀ¿Ò©¥–9žœÒKÇüíL œ rz鳊,ךPý%ÒRR.\‘aóâçMÊ|–Jò†rå èPòèK‘£îwxg¬€…*œŽp…LÍ¥Ü%xYçÂÃé÷òFZ\9‹‡Ëd‡ÙSÕ¥ôÎÛmÀ—šóƃ®ÜZˆ¶§ŽÝ]’yÁíuOçcwÜùÏÜvþ‹£™ ×ûR"NN4¿‰Cýz&xšK¿ uŒÜãVÚm|;<ÌÛ;ošÔœ="" ò1êgôt;®]ôÍ+ÐÖ1]:0ªŒ‘ÛpJç;G †ÑÆ«…‚%€‚広ÜȲ6T rawpgYàÜñ•9J†ˆ®‘›“vŒ€Ó-_ö›”5S˜©cw\%Ê~bÞE Ñ#@8BšrÔ8DGN°fLï'¡×S誇#gCÑ1+žU0óàòŒLÀG‰Ë‡Ó5Á‚äºMËöÌ'H*ŸŽ…š®‹ZT„)¹‘­ûˆ.P%£îRU*\Äp?dÚÏ^J‡ëù«Áˆ‚õ7ù0™ÝØvJ2€­—倕:)*Î.œUºODÈïškÙ˜rú±§+TS#òÜè Zñ1£Ûš”ß—br|‹F·”òókºB’j‘]£\mMR¢XŠì\ãðÿožËJ42“9ÞÍùþèoCÁí¢·ÁÁcÐX·ÃóæîK¶C$ý}ï8šGr·žål0 ŽäöL…#¹]£àHàAóßHãÎÐ7Úý—Io${ÏxÇùçaÎRÒç—ñ„P–VTøZ[RºÞŽÝ'ãjµŠ|x@UÖø€5Õ݉óÜcö¡s“JÜVbNßm*70Ý~x‚3l24͇Olã{º|ƒ;•ÂûüÊ…V²Ìōʙ¡ônßN[)zÉwS§ÊÁÌâãÕø¹u°ŠŠÉµÈoÒ}‚¿*þò—ÔTÄ
    The characters change depending on the website. I've tried disabling all extensions and plugins, reinstalling firefox and reinstalling java to no avail. The issue seems to be isolated to firefox, chrome is able to display the webpages without a problem. The problem occures following a malware in infection which would redirect goolgle searches in firefox. It was dealt with using Malwarebytes Anti-malware and by removing some entries from C:\WINDOWS\system32\drivers\etc\hosts file.

    Hi,
    I tried everything above but to no avail. Windows firewall seemed to be allowing Firefox through without it actually being in the exception list. However, I did remove Firefox but this time removing all profile data too. Reinstalling Firefox seemed to make the websites work. However I then restored my bookmarks, and suddenly the websites stopped functioning again, displaying the random string of characters. Could this be an issue with my bookmarks?

  • How do I generate a random String

    Hi, there is probably a very simple answer to this question, but nevertheless....
    Is there a class I can use which will allow me to generate a random String of any length?
    Many thanks.

    depending on which chars you want to use for the String, sometimes it is more handy to use a char[], something like
    publc static final char[] CASE_SENSITIVE_ALPHNUM = {'a', ...., 'A',....'1',...};//for alphamumeric case sensitive chars
    public static final char[] CASE_INSENSITIVE_ALPH = {"a", ....,'z'};
    public String randString(int length, char[] charset) {
    StringBuffer sBuf = new StringBuffer();
    for (int i = 0; i < length; i++ ) {
    sBuf.append(charset[(int)(Math.random() * charset.length)] )
    return sBuf.toString();

  • Generate random string ABAP

    Does anyone have sample code to generate a random string of 12 characters?
    Urgently needed.
    Thanks very much for any replies.

    You could generate a random number between 1 and 999999999999 (see RUTRANDU program). Then you could convert each position in the number to a corresponding character. 0 = A, 1 = B, etc.
    Hope it helps
    Regards

  • How to generate random strings

    Gday all,
    So I have to create a simple guessing game where the user guesses a 3 letter string that is randomly generated:
    "For each new game your program will generate three unique random numbers between 0 and 9
    inclusive, and convert them into a String of three characters in the range A to J. This String will be an
    input to a game, where the user tries to guess the correct letters in the correct order. Examples of valid
    input Strings would be, �JAD�, �ABC�, �IBE� and �EFG�. Examples of some invalid input Strings could be
    �abc�, �AAA�, �123�, �AdE� or �NME�."
    Just wondering how to create this random string? I know how to generate a random 3 char number (num = (int) (Math.random() * 1000)) but I dont know how to convert this into a corresponding string, as the instructions say.
    I know this is very basic, but any tips?

    I know how to generate a random 3 char number (num = (int) (Math.random() * 1000)) but I dont know how to convert this into a corresponding stringUse string concatenation (+ with one or two String operands).
    int i = 42;
    char ch1 = '*';
    char ch2 = '!';
    String str = "foo";
        // the System.out.println() is not important
        // in each case a string is being created and printed
    System.out.println("" + i);
    System.out.println("2 times i = " + (2 * i));
    System.out.println(i + "*2=" + (2 * i));
    System.out.println("" + ch1 + ch2); // hint, hint
    System.out.println(1 + 2 + "???");
    System.out.println("???" + 1 + 2);

  • I need to append a random string to a loadVariablesNum file...

    i need a little help creating a random (2 digit?) string to
    append to this html call... if someone wouldn't mind helping me
    with this...
    url = "xxxxx";
    loadVariablesNum(url+"_main.html", 0);
    something like:
    string = "whatever()";
    url = "xxxxx";
    loadVariablesNum(url+"_main.html?"+string, 0);
    i'm guessing...?
    thanks much,
    GN

    will this work:
    end = "Math.floor(Math.random() * 10) + 1";
    loadVariablesNum(url+"_main.html?"+end, 0);
    ?

  • Crazy bug - Flash is deleting random string characters

    Hello!  I'm working through Adobe's "Actionscript 3.0 for Adobe Flash CS4 Professional" book (though I'm using a trial version of CS5).  I've run into a crazy error on the 2nd lessons that I believe is out of my control, and wanted to see if the more advanced users had seen it or had any advice.
    Everything was going well, when suddenly this bug appeared out of nowhere.  It appears that some random characters are getting removed from my strings.  For example, when I write the code:
    info_txt.text = "Welcome to the home page";
    And then run the program, then info_txt just shows: "elmehehmepage", which is the same string minus a bunch of characters.  When I try to write the code:
    info_txt.text = "abcdefghijklmnopqrstuvwxyz0123456789";
    Then it comes out as "aeghilmnprs".  This character removal happens for all strings.  And it seems that it isn't random, it's just removing a bunch of letters and all numbers, the same ones every time.
    Troubleshooting that didn't work:
    I thought it might have been something that I did, so I removed ALL actionscript from the project except for the above lines, and got the same result
    I tried opening the end-of-the-lesson completed example file that came with the book, and that had the same problem (now I KNOW it wasn't a problem with the actionscript)
    Tried restarting Flash CS5, no luck
    Does anyone have any ideas what's going on?  I can't figure out what made this occur suddenly, and I can't figure out how to undo it.
    Thanks!

    Dear Friends
    I find the solution for this Text Problem....
    The Problem is Anti-alias property of the TextField.
    by default it will be in "Anti-alies animation".
    but for Display the text properly we need to chang it...
    In Flash CS5 do the following chantge........
    Select Text Field ----> Properties Pallete ----> Anti-alias ---> Use Device Fonts
    or
    Select Text Field ----> Properties Pallete ----> Anti-alias  ---> Bitmap Text[no Anti-alias]
    now it will work properly.....

  • Generating random String

    Hi My randomString() method is generating junk character, I know this is due to some character set problem .I have not handeled properly the generation of randomCharacter.Please help.
    package javaProg.completeReferance;
    import java.util.*;
    import javaProg.completeReferance.*;
    public class TestMap
         public static void main(String [] args)
               Map m= new HashMap();
               System.out.println("The Size of the Map is "+m.size());
               fillMap(m,12);
               System.out.println("The Size of the Map after fillMap Method is "+m.size());
               ArrayList1.space("");
               Collection c = m.entrySet();
               Iterator i=c.iterator();
               displayMap(i);
         public static void fillMap(Map map,int number)
              for(int i=1;i<=number;i++)
              map.put(nextString(5),((int)(Math.random()*500)));
         public static void displayMap(Iterator i)
               while (i.hasNext())
                    Map.Entry m= ((Map.Entry) i.next());
                    System.out.print(m.getKey()+"    "+m.getValue());
                    System.out.println();
         public static String nextString(int length)
              int randomInt=0;
              char randomChar=' ';
              StringBuffer randomString = new StringBuffer("");
              for(int i=1;i<=length;i++)
                randomInt = ((int)(5+Math.random()*500));
                randomChar = (char) randomInt;
                randomString.append(randomChar);
              return (randomString.toString()).trim();
    }

    Hi It still shows juck character, below is the sample output.
    We are using
    t?O%q 298
    ?W?8! 424
    pR*fz 12
    ]5dA? 310
    Ek?7? 466
    /@JYL 313
    UNY 262
    (&#8962;%3? 25
    ?z,?? 98
    ????q 414
    V?0s? 370
    ?_?oo 91

  • Generating random string not like - example

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Hi,
    I want to generate a random one char string of which is not like a char.
    select str from (select DBMS_RANDOM.STRING('U',1) str from dual) where str!='A';
    some times i am getting NULL. How can i get some char all the time? i want to create a function using this logic. can some one help me to achieve this?
    Thanks,
    sg

    One more way to do this... (Without function)
    WITH t AS (SELECT 'X' charac FROM DUAL)  --- 'X' is the  input
    SELECT COLUMN_VALUE letter
      FROM (  SELECT *
                FROM t a,
                     TABLE (sys.odcivarchar2list ('A',
                                                  'B',
                                                  'C',
                                                  'D',
                                                  'E',
                                                  'F',
                                                  'G',
                                                  'H',
                                                  'I',
                                                  'J',
                                                  'K',
                                                  'L',
                                                  'M',
                                                  'N',
                                                  'O',
                                                  'P',
                                                  'Q',
                                                  'R',
                                                  'S',
                                                  'T',
                                                  'U',
                                                  'V',
                                                  'W',
                                                  'X',
                                                  'Y',
                                                  'Z')) b
               WHERE COLUMN_VALUE <> a.charac
            ORDER BY DBMS_RANDOM.VALUE ())
    WHERE ROWNUM = 1;
    Cheers,
    Manik.

  • Need help with random string arrays

    Hi, I could really use some specific advice about how to randomize and display strings. I'm trying to create an applet that displays a list of 12 chores and a list of four people for whom the chores should be distributed to. So far I have set up the code to display the chores list in the first column and what I'm tring to do is then randomly assign each persons name 3 times in the second column. I'm not getting any error messages but the problem is that I can't seem to get the names to appear only 3 times.
    // Random generator = new Random();
    // JButton assignChores = new Button("Assign Chores")'
    // JTextArea outputArea = new JTextArea("");
    // ect....
    public void actionPerformed(ActionEvent e) {
    String[] chores = {"Living Room",
    "Dining Room",
    "Kitchen",
    "Boy's Room",
    "Garbage",
    "Backyard",
    "Pets",
    "Front Bathroom",
    "Back Bathroom",
    "Laundry",
    "Computer Room",
    "Parent's Room"};
    String[] person = {"Mom",
    "Dad",
    "Son",
    "Daughter"};
    int[] numIndex = new int[13];
    String output = "Chores" + "\t" + "Person";
    output += "\n________________________________\n";
    // I feel relatively certain that a while statement should go
    // here but I'm lost as to how I should go about this.
    for (int i = 1; i < numIndex.length; i++) {
    int arrayIndex = generator.nextInt(person.length); // generate a random number based on the number of people
    output += "\n" + chores[numIndex[0]++] // display the chores list in column 1
    + "\t" + person[arrayIndex]; // then randomly display the names in column 2
    output += "\n________________________________\n";
    outputArea.setText(output);
    JOptionPane.showMessageDialog (null, outputArea,
    "Chores List", JOptionPane.INFORMATION_MESSAGE);
    System.exit(0);

    Hi,
    Here's even a more elegant twist on the problem.
    import java.util.*;
    class FamilyMember
      private String name;
      private ArrayList chores;
      private final int MAX_CHORES = 3;
      public FamilyMember( String name )
        this( name, null );
      public FamilyMember( String name, Collection chores )
        this.name = name;
        setChores( chores );
      public String getName()
        return( name );
      public Collection getChores()
        return( chores );
      private void initArray()
        if( chores == null )
          chores = new ArrayList();
      public void setChores( Collection newChores )
        if( newChores != null )
          initArray();
          if( newChores.size() <= MAX_CHORES )
            Iterator it = newChores.iterator();
            while( it.hasNext() )
              chores.add( it.next() );
      public boolean addChore( String newChore )
        boolean outBool = false;
        initArray();
        if( chores.size() < MAX_CHORES )
          chores.add( newChore );
          outBool = true;
        return( outBool );
      public void setName( String newName )
        name = newName;
    class Chore
      private String name;
      private boolean assigned;
      public Chore( String name )
        this.name = name;
      public String getName()
        return( name );
      public void setName()
        this.name = name;
      public void setAssigned( boolean newAssigned )
        assigned = newAssigned;
      public boolean isAssigned()
        return( assigned );
    public class ChoreLister
      public static void main(String[] args)
        Chore[] chores = { new Chore( "Living Room" ),
                           new Chore( "Dining Room" ),
                           new Chore( "Kitchen" ),
                           new Chore( "Boy's Room" ),
                           new Chore( "Garbage" ),
                           new Chore( "Backyard" ),
                           new Chore( "Pets" ),
                           new Chore( "Front Bathroom" ),
                           new Chore( "Back Bathroom" ),
                           new Chore( "Laundry" ),
                           new Chore( "Computer Room" ),
                           new Chore( "Parent's Room" ) };
        FamilyMember[] fm = { new FamilyMember( "Mom" ),
                              new FamilyMember( "Dad" ),
                              new FamilyMember( "Son" ),
                              new FamilyMember( "Daughter" ) };
        Random generator = new Random();
        System.out.println( "Chores\tPerson" );
        System.out.println( "________________________________" );
        // Loop through all chores assigning them as we go.
        for( int j = 0; j < chores.length; ++j )
          int arrayIndex = generator.nextInt( fm.length );
          while( !chores[j].isAssigned() )
            while( !fm[arrayIndex].addChore( chores[j].getName() ) )
              arrayIndex = generator.nextInt( fm.length );
            chores[j].setAssigned( true );
          System.out.print( chores[j].getName() + "\t" );
          if( chores[j].getName().length() < 8 )
            System.out.print( "\t" );
          System.out.println( fm[arrayIndex].getName() );
        System.out.println( "________________________________" );
    }Enjoy,
    Manfred.

  • Trying to setText on random JPanels via a String array?

    My assignment is to create a bunch of JButtons, and randomly have an "X" appear on one, until it is clicked, and then it goes away and reappears on another random one. It does this ten times and displays the time it took to do so.
    I've created all the JButtons, named b01 to b48 and put them in a gridLayout. That part works fine.
    I created a String[] array with the 48 names of the JButtons in it, then I was thinking I could go this route...
    Random r = new Random();
    String random = panels[r.nextInt(panels.length)];
    random.setText("X");  //This is where the program hangs up.I can replace the setText statement with a System.out.println statement, and it shows up on the console correctly...

    Brandon,
    Have a chook at my minesweeper game at http://forum.java.sun.com/thread.jspa?forumID=54&threadID=5248903 ... it uses a matrix of cells[rows][cols]... each Cell is a JPanel which contains a Button.
    I think you'll end up with something like ...
      // create an array of Buttons
      Button buttons[] = Button[NUM_BUTTONS];
      for (int i=0; i<NUM_BUTTONS; i++) {
        buttons[] = new Button(i);
      // Xify a random button for a random time
      buttons[random.nextInt(NUM_BUTTONS)].xify()I'd create a:
    class Button extends JButton
    * provides a constructor(int index) which sizes and places the button according to it's index
    * provides an "xify" method, which setText("X"), then sets-up a SwingTimer to setText(null) after a random time.
    Cheers. Keith.

  • Producing a string of 3 random letters for a hash table

    I'm pretty new to all this and i was wondering if anyone would be able to help me produce a random string of 3 letters to be inputted into a hash table. I already have the code for integers to be placed into the table but am having difficulty with letters. I've tried using the Random() function but am probably putting it into the wrong place.
    I will place the code underneath so you can all have a look at it.
    Any help would be greatly appreciated.
    Thanks in advance
    Code:
    class HashTable
    private DataItem[] hashArray; // array holds hash table
    private int arraySize;
    private DataItem nonItem; // for deleted items
    public HashTable(int size) // constructor
    arraySize = size;
    hashArray = new DataItem[arraySize];
    nonItem = new DataItem(-1); // deleted item key is -1
    public void displayTable()
    System.out.print("Table: ");
    for(int j=0; j<arraySize; j++)
    if(hashArray[j] != null)
    System.out.print(hashArray[j].getKey() + " ");
    else
    System.out.print("** ");
    System.out.println("");
    public int hashFunc(int key)
    return key % arraySize; // hash function
    public void insert(DataItem item) // insert a DataItem
    // (assumes table not full)
    int key = item.getKey(); // extract key
    int hashVal = hashFunc(key); // hash the key
    // until empty cell or -1,
    while(hashArray[hashVal] != null &&
    hashArray[hashVal].getKey() != -1)
    ++hashVal; // go to next cell
    hashVal %= arraySize; // wraparound if necessary
    hashArray[hashVal] = item; // insert item
    } // end insert()
    public DataItem delete(int key) // delete a DataItem
    int hashVal = hashFunc(key); // hash the key
    while(hashArray[hashVal] != null) // until empty cell,
    {                               // found the key?
    if(hashArray[hashVal].getKey() == key)
    DataItem temp = hashArray[hashVal]; // save item
    hashArray[hashVal] = nonItem; // delete item
    return temp; // return item
    ++hashVal; // go to next cell
    hashVal %= arraySize; // wraparound if necessary
    return null; // can't find item
    } // end delete()
    public DataItem find(int key) // find item with key
    int hashVal = hashFunc(key); // hash the key
    while(hashArray[hashVal] != null) // until empty cell,
    {                               // found the key?
    if(hashArray[hashVal].getKey() == key)
    return hashArray[hashVal]; // yes, return item
    ++hashVal; // go to next cell
    hashVal %= arraySize; // wraparound if necessary
    return null; // can't find item
    } // end class HashTable
    class HashTableApp
    public static void main(String[] args) throws IOException
    DataItem aDataItem;
    int aKey, size, n, keysPerCell;
    // get sizes
    System.out.print("Enter size of hash table: ");
    size = getInt();
    System.out.print("Enter initial number of items: ");
    n = getInt();
    keysPerCell = 10;
    // make table
    HashTable theHashTable = new HashTable(size);
    for(int j=0; j<n; j++) // insert data
    aKey = (int)(java.lang.Math.random() *
    keysPerCell * size);
    aDataItem = new DataItem(aKey);
    theHashTable.insert(aDataItem);
    while(true) // interact with user
    System.out.print("Enter first letter of ");
    System.out.print("show, insert, delete, or find: ");
    char choice = getChar();
    switch(choice)
    case 's':
    theHashTable.displayTable();
    break;
    case 'i':
    System.out.print("Enter key value to insert: ");
    aKey = getInt();
    aDataItem = new DataItem(aKey);
    theHashTable.insert(aDataItem);
    break;
    case 'd':
    System.out.print("Enter key value to delete: ");
    aKey = getInt();
    theHashTable.delete(aKey);
    break;
    case 'f':
    System.out.print("Enter key value to find: ");
    aKey = getInt();
    aDataItem = theHashTable.find(aKey);
    if(aDataItem != null)
    System.out.println("Found " + aKey);
    else
    System.out.println("Could not find " + aKey);
    break;
    default:
    System.out.print("Invalid entry\n");
    } // end switch
    } // end while
    } // end main()
    public static String getString() throws IOException
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);
    String s = br.readLine();
    return s;
    public static char getChar() throws IOException
    String s = getString();
    return s.charAt(0);
    public static int getInt() throws IOException
    String s = getString();
    return Integer.parseInt(s);
    } // end class HashTableApp

    public class Foo {
        private java.util.Random rand = new Random();
        public static void main(String[] args) throws Exception {
            new Foo().go();
        void go() throws Exception {
            String allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
            System.out.println(getRandomString(allowedChars, 3));               
        String getRandomString(String allowedChars, int length) {
            StringBuffer buf = new StringBuffer();
            int charCount = allowedChars.length();
            for (int count = 0; count < length; count++) {
                int index = rand.nextInt(charCount);
                buf.append(allowedChars.charAt(index));
            return buf.toString();
    }

  • No VM, No Edge/3G, random shut-downs since iOS4 Update after restores

    I have followed all of the fixes I could find and I still do not have a notification that I have a vm, I do not get any internet service via 3G or Edge, and the phone shuts down and cannot be turned back on for for several minutes (happens randomly). This is so frustrating. I now have a phone that has had the iOS 4 reinstalled twice, it has been restored twice, I have a new vm PW, I have a new greeting, I have turned the airplane mode on and off, I have made all sorts of other setting changes per the forum. The only place my phone has data functionality is in my house and that is negligible. But I can't make phone calls in the house because the reception is so poor. Any other brilliant fix ideas from anyone (please help!)? I am so frustrated I could cry. This 3GS is useless to me now and I won;t be able to get a new phone until the next shipments come in. Those seem to be having their own issues too (which apple is blaming the user for or telling them to ride it out).
    Message was edited by: hippieRN

    This fix worked for me - THANK YOU!!!!!
    New! Re: Got Edge and 3G data working in iOS4 - Temp workaround!
    Posted: Jun 25, 2010 11:31 AM in response to: Silvefox
    I have figured out a fix for the Cellular Data, MMS, and VVM not working after upgrading to iOS 4. All of your data will still work with your phone but you will lose your camera roll so please back that up to your computer 1st. Also, initial reports are that this fix does work for iPhone 4 and will restore Face Time functionality.
    Originally Posted Here: http://forums.macrumors.com/showthread.php?t=944733
    "Ok guys, here it is another new fix that covers it all while maintaining your data. (CAUTION: Photos from the camera roll will not work after this method is complete so please back them up to the computer first. I'm not responsible if you lose your pictures.
    This method is based off of dankirsh's SMS Restore method (Only fixes Cellular Data), loveturtle's Non-Corrupted APN Restore method (Only fixes Cellular Data), and my own unique concepts which seem to fix everything and keep data intact minus the photo roll.
    Step 1:
    Windows Users: Navigate to "X:\Users\User Name\AppData\Roaming\Apple Computer\MobileSync\Backup"
    Mac Users: Navigate to "~/Library/Application\ Support/MobileSync/Backup/"
    NOTE: "X:" is the drive you installed Windows on and "User Name" is the name of your account on Windows.
    Step 2:
    Move all Backup files to another location to make sure the entire folder is empty.
    Step 3:
    Plug in your iPhone and perform a full backup.
    Step 4:
    After backup completes, disconnect the iPhone and copy the new folder under the backup directory to a separate location perferably named "Old" for ease of use.
    Step 5:
    After folder completes the copying delete it from the backup directory, NOT THE NEW LOCATION.
    Step 6:
    Plug in your iPhone and perform a full restore.
    Step 7:
    Upon completion of restore if iTunes asks to restore from a backup that you select a new configuration. While configuring the iPhone for new settings uncheck all sync boxes including Applications and Data. <-- (IMPORTANT)
    Step 8:
    Right click the iPhone and backup the iPhone.
    Step 9:
    Upon backup completion copy the new backup folder out of the previously mentioned location and copy it to a folder called "New".
    Step 10:
    Delete the backup that was recently created in the Backup folder.
    Step 11:
    Copy the backup located in the previously created "Old" folder to the Backup folder.
    Step 12:
    Upon completion of the copy go into the randomly named folder and delete a file named "8218978e4ab0a48035bb92653145a6be872ea858", then right click the iPhone in iTunes and select "Restore from Backup" and select "Ok" since this is the only backup in the folder.
    Step 13:
    Upon backup restoration completion let your iPhone sync itself with the computer and restore all of your applications. (At this point all is back to what it was like at the beginning of Step 1.)
    Step 14:
    After all of your Applications are synced navigate into the "New" folder and into the backup folder located inside of it, it will be named as a random string of numbers and letters.
    Step 15:
    Copy and overwrite the following files from the randomly named backup in the "New" folder to the "MobileSync\Backup\Randomly Named Backup" folder; "Manifest.mbdb", "Manifest.mbdx", and "Manifest.plist", they are located near the very bottom if sorted by name.
    Step 16:
    In iTunes right click the iPhone and "Restore Backup" once again since this is the only backup available, click ok.
    Step 17:
    iTunes will display an error and reboot the iPhone, this is normal.
    Step 18:
    Upon boot of the iPhone, check your Cellular Data, MMS, and VVM to verify all is working fine.
    Step 19:
    If all is working, delete any backup located in the "MobileSync" folder and perform a full backup again. As stated before, your camera roll will not work anymore for your old files. The files appear to be present on the iPhone but are corrupt and will be overwritten when a new photo is taken.
    Enjoy your fully functioning iPhone once again and please keep your OLD backup files as I am not sure if the App Data will backup now. I will have to continue more testing with this.
    FINAL NOTE: Resetting network settings did not break my iPhone after completing this method.
    Update #1: Reports from a few users are indicating this method does work for the iPhone 4 and does fix Face Time. See post #68, #69, and #71 for more information."
    Message was edited by: pilot76103

  • Getting lenght of String array

    Hi,
    How can i find the lenght of a string array, i have used length method to calculate length of single string value,e.g
    String value = "test"
    int length = value.length()
    Now i want to calculate length of a string array.e.g
    String csv_values = "test,by,random"
    String[] str = csv_values.split(",")
    int lenght = str.length()
    As you can see i want to calculate total number of entries in an array after i split it dynamically.
    Currently it is giving me exception, "Unable to parse exception; Undefined method: length for class: [Ljava.lang.String]"
    Thanks

    This is a tricky one.  An Array has a length property, unlike a String which has a length method.
    So...
    int length = str.length
    Anthony Holloway
    Please use the star ratings to help drive great content to the top of searches.

  • How to lock a user by using random password?

    hello,
    i need to lock a user from a target system by pushing in random passwords for the accounts. i am successfully able to create an adapter that can generate a random string, but the place where i am stuck is that where to use it as i just need to lock the user and not delete it. if the corresponding manager approves the suspension then the account needs to be deleted else again the account needs to be enabled.
    Please help!
    Thanks!

    ok... sorry...
    so what i did is that i have created a resource that has to be provisioned to the user if the user is to be terminated, in which the manager will mention the user to be terminated and the reason.
    now OIM has to lock the user till the reason that has been given by the manager is deemed valid by the second level manager.
    so for that i have a approval and a process form and processes associsted with them. but the problem is that i need to lock the user using the "Entity Adapter" so i need to do so only in the "Data Object Manager" and thus the problem starts as i dont know where to map the adapter that generates the random password so as to lock the user.
    please, if you find anything confusing here, go thru the discussion in the whole of the thread.
    Thanks!

Maybe you are looking for