OData results in random order

When I do certain OData queries, the results in the Excel worksheet are in random order. In the Power Query preview they are ordered correctly and in PowerPivot they are also ordered correctly. How does Power Query decide how to order rows? And why is
it reordering them?

By default, we attempt to download OData feeds in parallel by issuing multiple simultaneous requests for different ranges of the data. When this happens, we don't try to reorder the data when it comes back. Because the return order of the requests is nondeterministic,
it's possible and even likely that the original sort order is lost.
Setting the third parameter to false disables parallel requests, which restores determinism to the data being fetched.

Similar Messages

  • IOS8 Mail search bug, duplicates in random order!

    Does anyone know of a fix for iOS mail search duplicate results, in random order?
    When searching in Mail on iOS 8 (and iOS 7 before), on an Exchange 2010 hosted account (like Rackspace) the search results are all duplicated, and in random order, making Mail search almost useless, and very frustrating for business users.
    I've reported this through Apple's official bug report website, and repeatedly been told my report matches other's previously reported bug reports, and so my reports are Closed... but never Fixed! My understanding of what happens is, Spotlight searches the locally-stored Mail, then sends the search request to the server via ActiveSync, and of course duplicate results come back (since it is synced email, duh!) but iOS doesn't resolve the duplicates, and then puts them in random order. This doesn't seem to happen for IMAP, but business users don't always have a choice, and need to connect via ActiveSync for work, and always need to search mail given the quantity... Please Apple, email and email search are still central to mobile devices, especially for business users. Please fix!

    I have the same problem and in addition I see search results with blue dots indicating they are drafts, however they appear to be have the same text content as the versions of the emails that were sent (and are also showing up in the search results). When I click through to that email from the search results it opens as a draft email ready to be (re) sent. I don't know if these are partially complete drafts that were saved somewhere while I was writing the email (an issue I saw referred to regarding OSX Mail app search result problems).
    The outcome is I often see 5-6 versions of the same email showing up in search results rendering the spotlight search useless. This is a major issue for me as ease of search was a big plus for me as a blackberry user, and in finally making the transition to IP6 /iOS 8 I am really frustrated in not being able to find emails quickly through search.
    I raised this with the head of the genius bar at our local store and he had no ideas on it and had not seen the problem before.

  • Random order by in SQL!

    11g
    Hi There,
      I had posted this query in the Application express forum, but I guess it really should have been posted in this forum, since its more of a sql question. Apologies if this is against the forum rules.
      We have a pie chart in Application Express which has select like
    select null, '0-10' Days , count(*) from table
    union
    select null, '11-20' Days, count(*) from table
    union
    select null, '21-30' Days, count(*) from table
    union
    select null, '>30' Days, count(*) from table
    The 3d pie chart was showing the slices is the correct order 0-10, 11-20, 21-30, >30 but now shows it in random order.
    Unfortunately, the charts in Apex have a restriction as far as the select statement is concerned, it should just have three values in the select statement, the first is a link (can be null), the second can be any column_name or description and the third a value like count, sum etc. Now, the above query is to get the count of sales in the mentioned number of days and so what is happening is that it is taking the values as character sorting and I think randomly sorting in the apex chart. Now, this works fine in SQL! So was wondering if anyone has any suggestions on how to maybe force the sorting on the second column (0-10, 11-20 etc). If I take those values as 010, 1120, 2130 3000, something like that(basically a number) it seems to work fine, but then those show up as labels on the chart which is not correct.
    Any suggestions on how to get the order by working. I suspect since the Days column in the select is a Character column this issue is occurring, however, with the restrictions in the number of select items we can have in the Apex charts, was wondering how do you get the order by working?
    Thanks,
    Ryan

    you would have to add an explicit order column that maps the string to its position in the result: that could be an id:
    group_name|group_id
    > 60      | 4
    11-30     | 2
    0-10      | 1
    31-60     | 3
    Regards
    Martin
    P.S.: and you could add the information via: case when group_name = ... then 1 end group_id

  • Combined pdf random order

    I have tried to combine several PDFs into one using the combine menu option but the result is a random order of the files. I have done this several times and the result is different every time with a different order and number of pages. I have used the same files each time. I have adobe acrobat 9 pro extended.
    Message was edited by: markgian

    No error messages. Some of the pages are duplicated and in random order. The result is different each time????
    Regards
    Mark Giandomenico
    [email protected]<mailto:[email protected]>
    0401 798210
    www.planityouth.org.au<http://www.planityouth.org.au

  • Random order for slide show?

    I have a lot of pictures in an album that I would like put in random order for a slide show. I want to burn that to a dvd to play at our day care centers (pics of the kids throughout the summer). is there any way to do this other than dragging and dropping the pictures manually? that takes a lot of time.

    OK. Well here's a helpful answer. Someone's already written a quick Applescript for adding random numbers to every file in a folder. I added a little bit to the beginning and the end to let you be able to just drag and drop the folder onto the file, but give full credit to the poster
    Steps:
    (1) Open the Applescript Editor:
    Finder->Applications->Apple Script->Script Editor.app
    (2) In a new Script copy and paste the following text:
    --start copying
    on open the_Droppings
    tell application "Finder"
    set separator to ("_") as text
    set source to the_Droppings as alias
    set destination to make new folder at source with properties {name:"Shuffled"}
    set shuffle_pool to duplicate files of source to destination
    set shuffle_count to count shuffle_pool
    set duplicates to {}
    repeat with shuffle_file in shuffle_pool
    repeat
    set an_item to random number from 1 to shuffle_count
    if an_item is not in duplicates then exit repeat
    end repeat
    shuffle_file as alias
    set name of result to an_item & separator & name of result as string
    set end of duplicates to an_item
    end repeat
    end tell
    end open
    -- stop pasting here
    (3) File->Save As
    (4) Type in a name for the file and IMPORTANT save it as an application.
    (5) Place all the images that you want to randomize into any folder. (In iPhoto6: File->Export from an album or; in iPhoto5: Share->Export)
    (6) Drag the folder with your images onto the little application that you saved from the Script Editor
    (7) The Script will create a new folder inside whatever folder you dropped on it called "Shuffled".
    (8) Now if you do an Edit->Add Slideshow in iDVD you can just drag the contents of the Shuffled folder to iDVD and you're done! It'll make a DVD in seconds! Now if only you could set the time to more than 10 seconds!
    ALL CREDIT TO: http://forums.macosxhints.com/showthread.php?t=46359
    and
    http://macscripter.net/articles/4670_10_0C/

  • Selector.selectedKeys() random ordering vs. fairness

    All Sun's selector implementations are based on SelectorImpl, which keeps selectedKeys in a classic HashSet with a random order of elements.
    Now, suppose I insist on processing the incoming requests in the exact order as they were received, to ensure fairness. The classic mechanism for ensuring fairness are threads, but this a single-thread solution, and even with threads, it would be more fair to dispatch firstly-received requests first.
    So far the only solution seems to be a dirty (should I say dodgy) replace (via reflection) of the aforementioned HashSet with a LinkedHashSet. (tested on Linux/epoll, works)
    If you know of any other solution please let me know.

    Hi, thanks for replying to both of my comments. (the other thread: http://forum.java.sun.com/thread.jspa?threadID=407203&tstart=0 )
    These two issues are correlated so I will sum it up here, as the other thread is old and in a wrong forum.
    I'm getting the following results:
    1. only a single OP_ACCEPT is signalled in any given select() operation
    2. OP_READs are grouped to a single select(), no matter what time intervals they came in
    Tested on Windows (sun.nio.ch.WindowsSelectorImpl) and Linux (sun.nio.ch.EPollSelectorImpl).
    The accepts are fired inside of 100ms (linux) and 50ms (windows). The reads are split into 3 groups separated by 5 second wait.
    I'm attaching my test program. The two tests are separated and must be manually switched on.
    import java.net.InetSocketAddress;
    import java.net.Socket;
    import java.nio.ByteBuffer;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.ServerSocketChannel;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    public class test2 {
         public static void main(String[] args) throws Exception {
              server server = new server();
              server.bind();
              int test = 1;
              p("running test " + test);
              if(test == 1) { //test the partitioning of read events into more select() operations
                   client cc[] = new client[30];
                   for(int i = 0; i < cc.length; i++) {
                        cc[i] = new client("" + i);
                        cc.connect_to_server();
                   while(server.process_a_single_loop()); //process all the accepts
                   for(int i = 0; i < cc.length; i++) { //send requests in 3 groups separated by 2 waits
                        cc[i].send_data_to_server("hello");
                        if(i == 9 || i == 19) {
                             p("waiting 5 sec");
                             Thread.sleep(5000L);
                   while(server.process_a_single_loop()); //now process the reads
                   p("done");
              if(test == 2) { //test the grouping of more accept events into a single select() operation
                   connect_thread tt[] = new connect_thread[30];
                   client cc[] = new client[30];
                   for(int i = 0; i < cc.length; i++) {
                        cc[i] = new client("" + i); //create new clients
                        tt[i] = new connect_thread(cc[i]); //create connector threads
                   //now quick-start the threads
                   long max = 0L, start = System.currentTimeMillis();
                   for(int i = 0; i < tt.length; i++)
                        tt[i].start();
                   Thread.sleep(1000L); //let the dust settle
                   for(int i = 0; i < tt.length; i++) { //gather client connect time statistics
                        if(max < tt[i].finished)
                             max = tt[i].finished;
                   p("all connections happened inside of " + (max - start) + " ms");
                   while(server.process_a_single_loop()); //now process the accepts
                   p("done");
              server.unbind();
         static class connect_thread extends Thread {
              client c;
              long finished;
              connect_thread(client c) {
                   this.c = c;
              public void run() {
                   try {
                        c.connect_to_server();
                        finished = System.currentTimeMillis();
                   catch(Exception e) {
                        e.printStackTrace();
         static void p(Object o) {
              System.out.println(o);
         static class server {
              ServerSocketChannel server_chan;
              Selector server_selector;
              int loop;
              void bind() throws Exception {
                   server_chan = ServerSocketChannel.open();
                   server_selector = Selector.open();
                   server_chan.socket().bind(new InetSocketAddress (8401));
                   server_chan.configureBlocking(false);
                   server_chan.register(server_selector, SelectionKey.OP_ACCEPT);
                   p("Used selector implementation: " + server_selector.getClass().getName());
              boolean process_a_single_loop() throws Exception {
                   boolean anything_done = false;
                   loop++;
                   p("server - processing loop " + loop);
                   server_selector.selectNow();
                   Iterator<SelectionKey> it = server_selector.selectedKeys().iterator();
                   while(it.hasNext()) {
                        anything_done = true;
                        SelectionKey key = it.next();
                        if(key.isAcceptable()) {
                             ServerSocketChannel server = (ServerSocketChannel) key.channel();
                             SocketChannel channel = server.accept();
                             channel.configureBlocking(false);
                             channel.register(server_selector, SelectionKey.OP_READ, channel);
                             p("server - accepted a new connection");
                        if(key.isReadable()) {
                             anything_done = true;
                             SocketChannel channel = (SocketChannel) key.attachment();
                             ByteBuffer bb = ByteBuffer.wrap(new byte[10000]);
                             channel.read(bb);
                             bb.flip();
                             String s = new String(bb.array(), bb.position(), bb.limit() - bb.position(), "UTF-16");
                             p("server - received data: " + s);
                        it.remove();
                   return anything_done;
              void unbind() throws Exception {
                   server_chan.close();
         static class client {
              String id;
              Socket socket;
              client(String id) throws Exception {
                   this.id = id;
              void connect_to_server() throws Exception {
                   socket = new Socket();
                   //s.setTcpNoDelay(true);
                   socket.connect(new InetSocketAddress("localhost", 8401));
              void send_data_to_server(String data) throws Exception {
                   String buf = "hello from " + s() + ": " + data; // + "\n";
                   socket.getOutputStream().write(buf.getBytes("UTF-16"));
              String s() {
                   return "client[" + id + "]";
    I think I can solve this "unfairness" problem by having a dedicated thread constantly transferring any new events from the selector to my own queue - the select() would be called frequently enough to get the events properly ordered.

  • Random results with  random access query

    Hi,
    when I execute a random access query
    (fetchConfig.setResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE);
    fetchConfig.setFetchDirection(ResultSet.FETCH_UNKNOWN)) and iterate over the
    result set twice, the second time the objects are retrieved in a different
    order, also when I set the ordering of the objects. This only happens if the
    first loop touches the last item. If not, everything works fine. I am using
    MS Sql Server, microsoft driver, kodo 3.4
    regards,
    Christiaan

    Hi,
    I am using datastore identity. I do implement equals and hashcode in the
    super class, not sure whether that is of any impact. The order of the items
    look random to me, however it stays constant after the second loop. The same
    order is also produced when I re-start the test application. The output
    shows the index of the object I am retrieving, the description of the object
    (which is also the order in which the items are created) and their order
    attribute. The query sorts on the order attribute. As you can see the first
    loop is correct. I now and then have the situation where the last item in
    the first loop (retrieve 7) results in the first item (item nr 0) being
    retrieved. Same behaviour applies for both jtds and microsoft driver.
    first loop:
    retrieve 0: item nr: 0 order: 0
    retrieve 1: item nr: 1 order: 1
    retrieve 2: item nr: 2 order: 2
    retrieve 3: item nr: 3 order: 3
    retrieve 4: item nr: 4 order: 4
    retrieve 5: item nr: 5 order: 5
    retrieve 6: item nr: 6 order: 6
    retrieve 7: item nr: 7 order: 7
    second loop
    retrieve 0: item nr: 3 order: 3
    retrieve 1: item nr: 6 order: 6
    retrieve 2: item nr: 7 order: 7
    retrieve 3: item nr: 0 order: 0
    retrieve 4: item nr: 5 order: 5
    retrieve 5: item nr: 4 order: 4
    retrieve 6: item nr: 2 order: 2
    retrieve 7: item nr: 1 order: 1
    third loop
    retrieve 0: item nr: 3 order: 3
    retrieve 1: item nr: 6 order: 6
    retrieve 2: item nr: 7 order: 7
    retrieve 3: item nr: 0 order: 0
    retrieve 4: item nr: 5 order: 5
    retrieve 5: item nr: 4 order: 4
    retrieve 6: item nr: 2 order: 2
    retrieve 7: item nr: 1 order: 1
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Christiaan-
    My first guess is are you using application identity, and if so, are you
    correctly implementing the equals() and hashCode() method? Failure to do
    so may conceivably cause this problem.
    Otherwise, can you provide some details about how the results are our of
    order? It it exactly reverse or something, or are elements in random
    order?
    Christiaan wrote:
    Hi,
    when I execute a random access query
    (fetchConfig.setResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE);
    fetchConfig.setFetchDirection(ResultSet.FETCH_UNKNOWN)) and iterate over
    the result set twice, the second time the objects are retrieved in a
    different order, also when I set the ordering of the objects. This only
    happens if the first loop touches the last item. If not, everything works
    fine. I am using MS Sql Server, microsoft driver, kodo 3.4
    regards,
    Christiaan
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Photos uploaded are in random order in my flickr photostream

    When I use flickr feature to upload multiple photos, upload starts in parallel and results is that those photos showing in random order in my flickr photostream. How can I line up my photos in photostream in the same way I arranged photos in iPhoto? They are ordered as expected within flickr "sets" but I want to have my photos also arranged in expected order in photostream. Both Flickr Uploadr and jUploadr are capable of doing this so I expect the same with iPhoto.

    I have the same problem too. In iPhoto '09 the built in export to flickr feature results in my flickr photostream appearing random.
    Dear iPhoto '09 Product Managers-- *For users posting group events this is not the expected outcome at all.*
    Very bad bug, Apple needs to fix this error.
    It's almost false advertising that this '09 feature is helpful at all, it's actually worse than tools that have been around since 2007.
    I'm going back to using the stand alone application from Flickr: Flickr Uploadr.
    http://flickr.com/tools/uploadr
    Apple, please fix this major bug!

  • Photos Sometimes in Random Order

    I'm trying to upload certain photos from iPhoto to a website.  When the website goes to my iPhoto to get the certain photos, they are completely in random order.  If I click on iPhoto, my photos are in the order taken.  I have OS X Yosemite, 10.10.2 (14C1514).  This has not always been the case but has occurred after one of the system updates.  What can I do to keep the photos in date order?

    Perhaps the website or the browser window that is accessing your photos is looking at them alphabetically and that's different from chronologically.  May sites sort alphanumerically so you'll need to rename the photos so when exported to the Desktop for upload to the website they will be in the correct order. You can do that by selecting the photos and using this option in the Export window:
    to get this result:

  • Random order recordset

    i'm trying to do something that i would think would be fairly simple, and am actually surprised its not a standard dreamweaver selection possibility...
    i'm retrieving a recordset, and i want to return it to the user in a random order.  but i only have the option of ascending, or descending.
    i want to display 1 record per page, for however many pages are in the recordset, but i want them to display in a random order... and differently random each time the first page loads.
    any input would be greatly appreciated.  please speak to me as if i were a child. i'm very new to dynamic development.
    by the way, i'm using PHP/MySQL.
    thanks!
    jamie

    thanks, that sort of works.
    i'm showing 1 result per page though, and instead of showing all the results from the recordset randomly spread throughout the pages, it chooses a new random record for each page.
    so i can be viewing the first record, which IS being pulled randomly as it should, but when i click to go to the next page, it picks an all new record, and therefore repeats previous records, skips others entirely, etc.
    i'm out of my scope of knowledge here obviously. attached is the code for my page in case anyone cares to give it a look.
    thanks!
    <?php require_once('Connections/mZamboni.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_RS_cards = 1;
    $pageNum_RS_cards = 0;
    if (isset($_GET['pageNum_RS_cards'])) {
      $pageNum_RS_cards = $_GET['pageNum_RS_cards'];
    $startRow_RS_cards = $pageNum_RS_cards * $maxRows_RS_cards;
    $colname_RS_cards = "-1";
    if (isset($_GET['set_id'])) {
      $colname_RS_cards = $_GET['set_id'];
    mysql_select_db($database_mZamboni, $mZamboni);
    $query_RS_cards = sprintf("SELECT * FROM cards WHERE set_id = %s ORDER BY RAND() ", GetSQLValueString($colname_RS_cards, "int"));
    $query_limit_RS_cards = sprintf("%s LIMIT %d, %d", $query_RS_cards, $startRow_RS_cards, $maxRows_RS_cards);
    $RS_cards = mysql_query($query_limit_RS_cards, $mZamboni) or die(mysql_error());
    $row_RS_cards = mysql_fetch_assoc($RS_cards);
    if (isset($_GET['totalRows_RS_cards'])) {
      $totalRows_RS_cards = $_GET['totalRows_RS_cards'];
    } else {
      $all_RS_cards = mysql_query($query_RS_cards);
      $totalRows_RS_cards = mysql_num_rows($all_RS_cards);
    $totalPages_RS_cards = ceil($totalRows_RS_cards/$maxRows_RS_cards)-1;
    $queryString_RS_cards = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_RS_cards") == false &&
            stristr($param, "totalRows_RS_cards") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_RS_cards = "&" . htmlentities(implode("&", $newParams));
    $queryString_RS_cards = sprintf("&totalRows_RS_cards=%d%s", $totalRows_RS_cards, $queryString_RS_cards);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php do { ?>
      <p><?php echo $row_RS_cards['id']; ?></p>
      <?php } while ($row_RS_cards = mysql_fetch_assoc($RS_cards)); ?>
      <table border="0">
        <tr>
          <td><?php if ($pageNum_RS_cards > 0) { // Show if not first page ?>
              <a href="<?php printf("%s?pageNum_RS_cards=%d%s", $currentPage, 0, $queryString_RS_cards); ?>"><img src="images/First.gif" /></a>
              <?php } // Show if not first page ?></td>
          <td><?php if ($pageNum_RS_cards > 0) { // Show if not first page ?>
              <a href="<?php printf("%s?pageNum_RS_cards=%d%s", $currentPage, max(0, $pageNum_RS_cards - 1), $queryString_RS_cards); ?>"><img src="images/Previous.gif" /></a>
              <?php } // Show if not first page ?></td>
          <td><?php if ($pageNum_RS_cards < $totalPages_RS_cards) { // Show if not last page ?>
              <a href="<?php printf("%s?pageNum_RS_cards=%d%s", $currentPage, min($totalPages_RS_cards, $pageNum_RS_cards + 1), $queryString_RS_cards); ?>"><img src="images/Next.gif" /></a>
              <?php } // Show if not last page ?></td>
          <td><?php if ($pageNum_RS_cards < $totalPages_RS_cards) { // Show if not last page ?>
              <a href="<?php printf("%s?pageNum_RS_cards=%d%s", $currentPage, $totalPages_RS_cards, $queryString_RS_cards); ?>"><img src="images/Last.gif" /></a>
              <?php } // Show if not last page ?></td>
        </tr>
      </table>
    </body>
    </html>
    <?php
    mysql_free_result($RS_cards);
    ?>

  • Why restored windows after crash is with random order?

    I use new windows for grouping taks and tabs in each taks. If browser crash then after restoring windows is in random order.

    fractur wrote:
    Why do you doubt that a particular driver may be causing crashes? This is not an unusual thing. Do you have any evidence or reasons for dismissing this (e.g. Apple's touchpad drivers are user-mode)?
    Regarding the issue, I am experiencing the same problem. After upgrading the trackpad driver I started getting BSODs and other odd behavior.
    Yes, it's an Apple driver issue, as are some of the audio problems Windows is having. The audio noise/corruption is being caused by Apple's wireless driver. Some users are reporting good results by replacing Apple's wireless driver with a downloaded Windows broadcom driver. Sorry I don't have a link but it's been posted on this forum.
    I believe the OP mentioned several applications were upgraded.
    "boot camp, track pad driver, bonjour and iTune"
    pancenter-

  • HOW DO I KEEP AN ARRAYLIST IN RANDOM ORDER AFTER EXITING THE SUB ROUTINE CONTAINING IT

    PLEASE HELP!I am trying to go from VB4 which I loved to VB2010 which I find somewhat more challenging. I’ve searched the web for help and have adapted the following to my project. This code does
    rotate randomly through every card in the deck and displays unique cards until all have been drawn. BUT I want to draw one card
    only from the first “hat” of Boy’s names; then draw the second card from the second “hat” of Girl’s names and repeat this process until all cards in both decks have been drawn. How do I get the TextBox (OR any
    MsgBox) to display JUST ONE unique random card at a time so I can exit that deck and go to the next deck?
    On my form, I have two TextBoxes (to display the names (as drawn), two buttons (to re-load each deck once exhausted) and one command (&End)control (to end the process). I created two ArraysLists
    (to hold the Boys names and Girls names separately) and two ArrayLists to hold the cards for the random decks when created in code.
    I can
    NOT get this code to draw random UNIQUE names once I exit the deck. I have tried to ReDim the deck; randomly pull a card from the second (temp) deck, etc
    NOTHING seems to work.
    WHY does my deck lose randomness once I exit it?
    How can I fix it? I don’t understand this. Below is the code for the "hat" with the 10 girl's names.
    Also, when I don't loop through all the cards, I usually get "An Out of Index exception was not handled" error. Hope someone can help me with this problem. It seems like this should
    be easy BUT I'm baffled. Thank you for any help.
    Imports System.Collections.Generic
    Public Class Form1
    Dim Count As Integer
    Dim Rcard As New ArrayList
    Dim Dcard As New ArrayList
    Dim NewRDeck As New ArrayList
    Dim NewDDeck As New ArrayList
    Dim temp_Rnum As Integer
    Dim temp_Dnum As Integer
    Dim MyRand As New Random()
    Public Sub Rcards_Click(sender As Object, e As System.EventArgs) Handles Rcards.Click
    While Rcard.Count > 0
    Dim temp_Rnum As Integer = Int(MyRand.Next(Rcard.Count))
    NewRDeck(temp_Rnum) = Rcard(temp_Rnum)
    Rem Check that the ArrayLists work correctly and display properly
    MsgBox(Rcard(temp_Rnum), , "New random card selected is: ")
    Console.WriteLine(Rcard(temp_Rnum))
    Rcard.Text = (Rcard(temp_Rnum))
    REM Now remove the Rcard with the random number generated so it can't be drawn again
    Rcard.RemoveAt(temp_Rnum)
    End While
    REM When all 10 cards have been picked, alert player to re-load deck if desired.
    MsgBox("No new cards left in deck; please Re-Load the cards. Thank you.")
    EndSub
    End Class

    Hi Acamar,
    Thank you for such a fast response. Sorry if my text wasn't clear. I'm really struggling with creating unique random elements in Collections in VB2010 and feel I understand ArrayLists better than some of the other Collection types.The code works perfectly
    and generates unique random cards until the original deck is exhausted. Then it prompts the user to re-load the original deck so it can be reused if needed. But I need to draw one card only and exit the deck. Then when I click on the TextBox again, I want
    that deck to be in the same random order - just minus any cards I have already drawn and thrown away.  Thanks again for your help.
    Here's the rest of the code for just the girl's "hats" of names, if it helps:
    Private Sub btnShuffleRCards_Click(sender
    As System.Object, e
    As System.EventArgs)
    Handles btnShuffleRCards.Click
    Dim j As
    Integer
    For j = 1 To 10
    NewRDeck.Add(j)
    Next j
    Randomize()
    REM Create original Deck with names for the girls.
    Rcard.Add("1 HELEN”)
    Rcard.Add("2 OLIVIA")
    Rcard.Add("3 <st1:city w:st="on"><st1:place w:st="on">ALICE</st1:place></st1:city>")
    Rcard.Add("4 VALERIE")
    Rcard.Add("5 DONNA")
    Rcard.Add("6 ZELDA")
    Rcard.Add("7 MARGARIE")
    Rcard.Add("8 <st1:city w:st="on"><st1:place w:st="on">NANCY</st1:place></st1:city>")
    Rcard.Add("9 WANDA")
    Rcard.Add("10 IRENE")
    End Sub

  • HT1399 As I have added pocast shows to my itunes podcast list it is in a random order.  How do I alphabetize my list of podcasts.  Can I manually arrange them in an order of my choosing.  Thanks

    As I have added podcast subscriptions to my itunes podcast list on the far left menu window the list is in a random order.  How do I aphabetize the podcast list ?   Can I arrange them manually ?

    I have about 500 bookmarks ..   and they are arranged within 60 folders.  I would like to see them in chronological order as before, because now to find a bookmark is a hard task.
    thanks for your suggestion, anyway.

  • When I listen to music on Apple TV 2 my pictures from iPhoto come in, but always the same album (which I nevr asked for), always in random order and always in a different format. How can I control what is going on and choose the album myself.

    When I listen to music on Apple TV 2 my pictures from iPhoto come in aafter about ten minutes, but always the same album (which I never asked for), always in random order and always in a different format. How can I choose a different album myself and control the order and format?

    Thank you Winston for a helpful response and for reminding me of something which I found nearly a year ago and then lost (in my mind) because I did not use it. I am grateful for a correct answer but it still only achieves part of what I wanted.
    I can now choose my photos, decide how long they stay on screen and choose one of a variety of presentations. Two things I still can't do.
    One is to get it to play the photos in the chronological order in which I have carefully set them in an album; it still tends to be random and repetitive. The other is that I cannot get any of them them to saty on screen for more than about 20 seconds. I guess this is all due to the way Apple TV is constructed.
    But still thanks, nevertheless.
    Alec

  • How can I make a playlist play on my iPod in random order?

    I have made a playlist on my computer in iTunes. The songs are now in alphabetical order by song title, and when they play on my iPod they play in that same alphabetical order.
    Is there a way that I can make the songs in the playlist play in some other order? Preferably, just a random order?
    Or, is there a way that I can arrange them in iTunes that is not in alphabetical order and have them stay in that non-alphabetical order?
    Thanks!

    Just go to Settings, Shuffle, then turn it to Songs. The songs will stay in the same order in the playlist, but they'll switch it up.

Maybe you are looking for

  • Back out Reader 9.5.1 upgrade/update, restore previous version 9.x

    How can I back out the most recently installed Reader (9.5.1) which is evidently causing a problem in opening links for PDF files from within IE 8 and Firefox 14? Thanks. Jerry

  • No images in Library grid view

    Hi, In V1.0, when I set my Library to grid view I only see my images for a short while. Then all images turn to grey squares. Updating the grid (like changing thumbnail size or sorting order) again shows images only for a short while. Loupe and Compa

  • How to call web service on a button click in Web UI

    Hi Experts, I have a requirement to call/consume external web service on a button click in CRM web UI. Can someone help me with the code sample for invoking web service from crm web ui? Thanks in advance. Cheers, Sumit Mittal

  • Servlet.jar

    can anyone tell me what this error message means. Ive installed a .war file that should work. but i get this error. Is it something to do with not being able to find servlet.jar ? if it is where do i need to put it? Thanks exception org.apache.jasper

  • My opening window for elements 9 does not log me in. I have lost my contact book and cannot log in.

    My elements 9 opening window does not log me in. I have lost my contact book and cannot log in manually even with an updated password.