Random FLV from an SMIL Playlist

I have been trying to find a way to randomly select an flv
file to play in a 400x100 signature I have for some of my forums.
There is no user control on this swf besides onRollOver to start
the flv and onRollOut to pause it. What I want to achieve is
whenever the swf is loaded that it will randomly select an flv from
a playlist. From what I have read, SMIL is the best format to use
with FLVPlayback. All I should be needing to do is typing in the
SMIL URL into the concenturl inside the properties of the
FLVPlayback. However, this doesnt work. I also haven't a clue how
to actually randomize it. I could not find anything regarding the
required code used in SMIL to randomize the playlist.
Any help, hints and clues would be very appreciated as this
has stumped me for quite some time.

If I am listening to my Shuffle in random/shuffle
order and come to a song from an album I want to hear
more of, can I switch it to Playlist order and hear
the rest of the songs in order of the playlist?
I believe that's the way it's supposed to work... WHY not TRY it?

Similar Messages

  • Running a live stream from an XML playlist

    I have just successfully installed Adobe FMS on my server.
    I would now like to know how to program a script to run a continuous live stream, of MP4 videos, from an XML playlist.
    Can anyone tell me how to do this? ...or provide me a good tutorial? (I am a complete newbie to ActionScript.)
    Thanks in advance...

    application.allowDebug = true;
    application.onAppStart = function(){
    this.userID =0;
    this.playObj = new Object();
    this.timObj = new Object();
    this.passCli = new Object();
    this.couObj = new Object();
    this.couObj.count = 1;
    application.so0 = SharedObject.get("so",false);
    this.dates = new Object;
    this.dates.dat0 = new Date().valueOf()+"a";
    this.dates.dat1 = new Date().valueOf()+"b";
    this.dates.dat2 = new Date().valueOf()+"c";
    this.dates.dat3 = new Date().valueOf()+"d";
    this.myStream = new Object;
    this.myStream.st = Stream.get (this.dates.dat0.toString());
    this.myStream.st1 = Stream.get (this.dates.dat1.toString());
    this.myStream.st2 = Stream.get (this.dates.dat2.toString());
    this.myStream.st3 = Stream.get (this.dates.dat3.toString());
    this.int0
    this.int1
    this.int2
    this.int3
    this.int4
    this.lock0=0;
    this.lock1=0;
    this.lock2=0;
    this.lock3=0;
    this.lock4=0;
    listen();
    function listen(){
    clearInterval(application.int3);
    application.int0 = setInterval(time,1000,application.myStream.st);
    application.myStream.st.onStatus = function(info){
    if(info.code == "NetStream.Play.Stop"&&application.lock0==0){
      trace("code0"+info.code);
      clearInterval(application.int0);
      application.timObj.tim = 0;
      application.int1 = setInterval(time,1000,application.myStream.st1);
      application.couObj.count = 2;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      listen1(application.myStream.st1);
      application.lock0=1;
      function listen1(mystreamst1){
      mystreamst1.onStatus = function(info){
    if(info.code == "NetStream.Play.Stop"&&application.lock1==0){
      trace("code1"+info.code);
      mystreamst1 = null;
      clearInterval(application.int1);
      application.timObj.tim = 0;
      application.int2 = setInterval(time,1000,application.myStream.st2);
      application.couObj.count = 3;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      listen2(application.myStream.st2);
      application.lock1=1
      function listen2 (mystream2){
    mystream2.onStatus = function(info){
    trace("code2"+info.code);
    if(info.code == "NetStream.Play.Stop"&&application.lock2==0){
      clearInterval(application.int2);
      application.mystream2 = null;
      application.timObj.tim = 0;
      //application.int3 = setInterval(time,1000,application.myStream.st3);
      application.couObj.count = 4;
      playcurr(application.passCli.cli);
      switchStream(application.so0);
         application.lock2=1;
      listen3(application.myStream.st3);
      function listen3(mystream3){
    mystream3.onStatus = function(info){
    trace("code3"+info.code);
    if(info.code == "NetStream.Play.Stop"&&application.lock3==0){
      trace("yes yes yes yes yes yes");
      clearInterval(application.int3);
      application.couObj.count = 1;
      mystream3 = null;
      application.timObj.tim = 0;
      //application.int4 = setInterval(time,1000,application.myStream.st);
      playcurr(application.passCli.cli);
      switchStream(application.so0);
      application.lock0=0;
      application.lock1=0;
      application.lock2=0;
      application.lock3=0;
    application.dates.dat0 = new Date().valueOf()+"e";
    application.dates.dat1 = new Date().valueOf()+"f";
    application.dates.dat2 = new Date().valueOf()+"g";
    application.dates.dat3 = new Date().valueOf()+"h";
    application.myStream.st = Stream.get (application.dates.dat0.toString());
    application.myStream.st1 = Stream.get (application.dates.dat1.toString());
    application.myStream.st2 = Stream.get (application.dates.dat2.toString());
    application.myStream.st3 = Stream.get (application.dates.dat3.toString());
    application.myStream.st.play(application.playObj.vid[0],0,-1,0);
    application.myStream.st1.play(application.playObj.vid[1],0,-1,0);
    application.myStream.st2.play(application.playObj.vid[2],0,-1,0);
    application.myStream.st3.play(application.playObj.vid[3],0,-1,0);
    listen();
    ///here next
    application.onConnect = function(client){
    application.acceptConnection(client);
    application.passCli.cli = client;
    client.call("setUserID",null,this.userID);
    this.userID++;
    if(application.clients.length == 1 ){
    videoArray = new Array();
    var playlist = new XML();
    playlist.ignoreWhite = true;
    //parse xml play list for individual elements
    playlist.onLoad = function( success ) {
    if(playlist.loaded == true) {
    if (playlist.firstChild.hasChildNodes()) {
    for (var aNode = playlist.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) {
    if (aNode.nodeType == 1) {
    //create array from parsed xml elements.
    videoArray[aNode.attributes.id] = aNode.attributes.name ;
    //pass array out of onload function
    application.playObj.vid = videoArray;
    application.myStream.st.play(application.playObj.vid[0],0,-1,0);
    application.myStream.st1.play(application.playObj.vid[1],0,-1,0);
    application.myStream.st2.play(application.playObj.vid[2],0,-1,0);
    application.myStream.st3.play(application.playObj.vid[3],0,-1,0);
    pass0(videoArray);
    //play first video on playlist
    playlist.load("http://www.privatechatnow.com/fmsuser/playlist.xml");
    }//end onetime if statement
    function pass0(videoArray){
      //receive array
      //play intial video
      if(application.clients.length == 1){
    // application.playObj.vid=videoArray;
    playcurr(application.passCli.cli);
    for (var key in application.playObj){
    trace(key + ": " + application.playObj[key]);
       //put currently playing videio into object
      //isolate playlist switching loop for each connected client
      //listen to currently playing stream with onStatus
      //change to next video in playlist
      //use onStatus and current duration and seek to scrub to cuurently playin video each time a user connects.
      //continue untill playlist is played then loop back to first video in playlist.
        //onConnect play currently playing video
    if (application.clients.length >1){
    playcurr(application.passCli.cli);
    //message client with currently play flv
    //message client when flv changes
    //message client with metadata
    application.onPublish = function(clientObject, streamObject){
    trace("Stream name :: "+streamObject.name);
    function switchStream(so0){
    if(application.couObj.count == 1){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[0].length;
        nextlen = application.playObj.vid[1].length;
    so0.send("playSecond",application.playObj.vid[0],clength,currlen,nextlen);
    if(application.couObj.count == 2){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[1].length;
    nextlen = application.playObj.vid[2].length;
        so0.send("playSecond",application.playObj.vid[1],clength,currlen,nextlen);
    if(application.couObj.count == 3){
    clength = application.timObj.tim-3;
    currlen = application.playObj.vid[2].length;
      nextlen = application.playObj.vid[3].length;
        so0.send("playSecond",application.playObj.vid[2],clength,currlen,nextlen);
    if(application.couObj.count == 4){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[3].length;
      nextlen = application.playObj.vid[0].length;
        so0.send("playSecond",application.playObj.vid[3],clength,currlen,nextlen);
    function playcurr(client){
    trace("count = "+application.couObj.count.toString());
    if(application.couObj.count ==1){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[0].length;
      nextlen = application.playObj.vid[1].length;
        client.call("playZero",null,application.playObj.vid[0],clength,currlen,nextlen); 
    if(application.couObj.count ==2){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[1].length;
      nextlen = application.playObj.vid[2].length;
        client.call("playZero",null,application.playObj.vid[1],clength,currlen,nextlen); 
    if(application.couObj.count ==3){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[2].length;
      nextlen = application.playObj.vid[3].length;
        client.call("playZero",null,application.playObj.vid[2],clength,currlen,nextlen); 
    if(application.couObj.count ==4){
        clength = application.timObj.tim-3;
    currlen = application.playObj.vid[3].length;
      nextlen = application.playObj.vid[0].length;
        client.call("playZero",null,application.playObj.vid[3],clength,currlen,nextlen); 
    application.onDisconnect = function(oldclient){
    if(application.clients.length ==0){
    this.userID--;
    function time(myStream){
    application.timObj.tim = myStream.time;

  • Load random FLV with NetStream

    Dear Adobe members,
    I'm puzzeling for days on this one. I'm a bit of a noob so please help me
    I want to create a videowall in a grid of 7 x 7 flv's.
    In this grid, the flv's have to be loaded at random and when finished, a new
    random flv has to be loaded and played.
    I've come so far that I have a MovieClip that loads an flv at random and then
    loops it, but it loops the same video, not a random new one.
    Can anybody help me out please?!
    The code:
    var video:Video = new Video();
    addChild(video);
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    ns.client = {onMetaData:ns_onMetaData, NetStatusEvent:ns_onPlayStatus};
    var video_array = new Array("Scenes/001.flv", "Scenes/002.flv", "Scenes/003.flv", "Scenes/004.flv");
    // Function that gets a random video from the array
    function getRandomVideo():String {
    return video_array[Math.floor(Math.random() * video_array.length)];
    video.attachNetStream(ns);
    ns.play(getRandomVideo());
    function ns_onMetaData(item:Object):void {
    // Resize video instance.
    video.width = item.width;
    video.height = item.height;
    // Center video instance on Stage.
    video.x = (stage.stageWidth - video.width) / 2;
    video.y = (stage.stageHeight - video.height) / 2;
    //loop the video
    function ns_onPlayStatus(event:NetStatusEvent):void {
    if(event.info.code == "NetStream.Play.Stop"){
         ns.seek(0);
    ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus);
    Thanks!

    For those who want to know how I solved it:
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    ns.bufferTime = 0;
    ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
    var video_array = new Array("Scenes/001.flv", "Scenes/002.flv", "Scenes/003.flv", "Scenes/004.flv");
    // Function that gets a random video from the array
    function getRandomVideo():String {
    return video_array[Math.floor(Math.random() * video_array.length)];
    ns.play(getRandomVideo());
    var vid:Video = new Video(182,137);
    vid.attachNetStream(ns);
    addChild(vid);
    function asyncErrorHandler(event:AsyncErrorEvent):void{
    // ignore error
    // loop video
    ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus)
    function ns_onPlayStatus(event:NetStatusEvent):void{
    if(event.info.code == "NetStream.Play.Stop"){
    ns.play(getRandomVideo());
    ns.seek(0);

  • Load random flv

    This is my catch 22 ...
    Im trying to load random flv's into my mc. I cant seem to figure out how to loop random flv's.  Currently, it plays a random flv the 1st time, plays a random flv the 2nd time around, but the 3rd time (and so on) it loops the same 2nd flv.  I need it to constantly loop random flv's every time.  Any suggestions? 
    var randomNum:Number=Math.random();
    var connection:NetConnection = new NetConnection();
    var stream:NetStream;
    var video:Video=new Video(stage.stageWidth,stage.stageHeight);
    var metaObj:Object = new Object();
    var isPaused:Boolean=true;
    connection.connect(null);
    stream=new NetStream(connection);
    stream.client=metaObj;
    metaObj.onMetaData=onMetaData;
    function onMetaData(data:Object):void {
    video.attachNetStream(stream);
    mc.addChild(video);
    //load background video
    function videoInit():void {
         if (randomNum<=.333) {
              stream.play("clipA.flv");
         if (randomNum>.333&&randomNum<.666) {
              stream.play("clipB.flv");
         if (randomNum>=.666) {
              stream.play("clipC.flv");
    videoInit();
    function videoLoop(stat:Object):void {
         if (stat.info.code=="NetStream.Play.Stop") {
              if (randomNum<=.333) {
                   stream.play("clipA.flv");
              if (randomNum>.333&&randomNum<.666) {
                   stream.play("clipkB.flv");
              if (randomNum>=.666) {
                   stream.play("clipC.flv");
         stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);
    Thanks in advance!

    First, you can shorten code and remove function videoLoop altogether. As for random issue, you need to reset random number to a new one - I don't see other issues with it. See code below:
    import flash.events.Event;
    var randomNum:Number;
    var connection:NetConnection = new NetConnection();
    var video:Video = new Video(stage.stageWidth, stage.stageHeight);
    var metaObj:Object = new Object();
    var isPaused:Boolean = true;
    connection.connect(null);
    var stream:NetStream = new NetStream(connection);
    stream.client = metaObj;
    metaObj.onMetaData=onMetaData;
    function onMetaData(data:Object):void {
    video.attachNetStream(stream);
    mc.addChild(video);
    videoLoop();
    function videoLoop(stat:Event = null):void {
         if (!stat || stat.info.code == "NetStream.Play.Stop") {
              randomNum = Math.random();
              if (randomNum <= .333) {
                   stream.play("clipA.flv");
              else if (randomNum > .333 && randomNum < .666) {
                   stream.play("clipkB.flv");
              else {
                   stream.play("clipC.flv");
        stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);
    Also, you may want to reconsider how you reference videos and put the into an array and choose from it - this is more scalable:
    import flash.events.Event;
    var videoArray:Array = ["clipA.flv", "clipB.flv", "clipC.flv"];
    var connection:NetConnection = new NetConnection();
    var video:Video = new Video(stage.stageWidth, stage.stageHeight);
    var metaObj:Object = new Object();
    var isPaused:Boolean = true;
    connection.connect(null);
    var stream:NetStream = new NetStream(connection);
    stream.client = metaObj;
    metaObj.onMetaData=onMetaData;
    function onMetaData(data:Object):void {
    video.attachNetStream(stream);
    mc.addChild(video);
    videoLoop();
    function videoLoop(stat:Event = null):void {
         if (!stat || stat.info.code == "NetStream.Play.Stop") {
              stream.play(videoArray[Math.random() * videoArray.length]);
         stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);

  • My phone will randomly disconnect from the wifi and when I retype the password it says it is wrong. It will eventually work but I have to wait for a message to pop up on my screen to allow me to retype the wifi password.

    When I first got my phone it worked perfectly fine with the wifi. Although later on I began to have problems connecting it. It will randomly disconnect from the wifi and when I try to retype the password it tells me it is wrong, although it is right. It will eventually work but in its own time, a message will pop up and allow me to type in the password and it will work. But sometimes it takes an hour or more and sometime it takes 10 minutes. I've seen where other people have had this problem but I don't know how to fix it. I'm not sure if it's an issue with my phone or if it's with my wifi. Does anyone know how to fix this?

    Does this happen with all Wi-Fi hotspots?  A specific one?
    Have you tried forgetting the Wi-Fi connection and then reconnecting to it?
    What about power cycling the Wi-Fi router?

  • Reading a Random Line from a Text File

    Hello,
    I have a program that reads from a text file words. I currently have a text file around 800KB of words. The problem is, if I try to load this into an arraylist so I can use it in my application, it takes wayy long to load. I was wondering if there was a way to just read a random line from the text file.
    Here is my code, and the text file that the program reads from is called 'wordFile'
    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    public class WordColor extends JFrame{
         public WordColor(){
              super("WordColor");
              setSize(1000,500);
              setVisible(true);
              add(new WordPanel());
         public static void main(String[]r){
              JFrame f = new WordColor();
    class WordPanel extends JPanel implements KeyListener{
         private Graphics2D pane;
         private Image img;
         private char[]characterList;
         private CharacterPosition[]positions;
         private int charcounter = 0;
         private String initialWord;
         private File wordFile = new File("C:\\Documents and Settings\\My Documents\\Java\\projects\\WordColorWords.txt");
         private FontMetrics fm;
         private javax.swing.Timer timer;
         public final static int START = 20;
         public final static int delay = 10;
         public final static int BOTTOMLINE = 375;
         public final static int buffer = 15;
         public final static int distance = 4;
         public final static Color[] colors = new Color[]{Color.red,Color.blue,Color.green,Color.yellow,Color.cyan,
                                                                          Color.magenta,Color.orange,Color.pink};
         public static String[] words;
         public static int descent;
         public static int YAXIS = 75;
         public static int SIZE = 72;
         public WordPanel(){
              words = readWords();
              setLayout(new BorderLayout());
              initialWord = getWord();
              characterList = new char[initialWord.length()];
              for (int i=0; i<initialWord.length();i++){
                   characterList[i] = initialWord.charAt(i);
              setFocusable(true);
              addKeyListener(this);
              timer = new javax.swing.Timer(delay,new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        YAXIS += 1;
                        drawWords();
                        if (YAXIS + descent - buffer >= BOTTOMLINE) lose();
                        if (allColorsOn()) win();
         public void paintComponent(Graphics g){
              super.paintComponent(g);
              if (img == null){
                   img = createImage(getWidth(),getHeight());
                   pane = (Graphics2D)img.getGraphics();
                   pane.setColor(Color.white);
                   pane.fillRect(0,0,getWidth(),getHeight());
                   pane.setFont(new Font("Arial",Font.BOLD,SIZE));
                   pane.setColor(Color.black);
                   drawThickLine(pane,getWidth(),5);
                   fm = g.getFontMetrics(new Font("Arial",Font.BOLD,SIZE));
                   descent = fm.getDescent();
                   distributePositions();
                   drawWords();
                   timer.start();
              g.drawImage(img,0,0,this);
         private void distributePositions(){
              int xaxis = START;
              positions = new CharacterPosition[characterList.length];
              int counter = 0;
              for (char c: characterList){
                   CharacterPosition cp = new CharacterPosition(c,xaxis, Color.black);
                   positions[counter] = cp;
                   counter++;
                   xaxis += fm.charWidth(c)+distance;
         private void drawThickLine(Graphics2D pane, int width, int thickness){
              pane.setColor(Color.black);
              for (int j = BOTTOMLINE;j<BOTTOMLINE+1+thickness;j++){
                   pane.drawLine(0,j,width,j);
         private void drawWords(){
              pane.setColor(Color.white);
              pane.fillRect(0,0,getWidth(),getHeight());
              drawThickLine(pane,getWidth(),5);
              for (CharacterPosition cp: positions){
                   int x = cp.getX();
                   char print = cp.getChar();
                   pane.setColor(cp.getColor());
                   pane.drawString(""+print,x,YAXIS);
              repaint();
         private boolean allColorsOn(){
              for (CharacterPosition cp: positions){
                   if (cp.getColor() == Color.black) return false;
              return true;
         private Color randomColor(){
              int rand = (int)(Math.random()*colors.length);
              return colors[rand];
         private void restart(){
              charcounter = 0;
              for (CharacterPosition cp: positions){
                   cp.setColor(Color.black);
         private void win(){
              timer.stop();
              newWord();
         private void newWord(){
              pane.setColor(Color.white);
              pane.fillRect(0,0,getWidth(),getHeight());
              repaint();
              drawThickLine(pane,getWidth(),5);
              YAXIS = 75;
              initialWord = getWord();
              characterList = new char[initialWord.length()];
              for (int i=0; i<initialWord.length();i++){
                   characterList[i] = initialWord.charAt(i);
              distributePositions();
              charcounter = 0;
              drawWords();
              timer.start();
         private void lose(){
              timer.stop();
              pane.setColor(Color.white);
              pane.fillRect(0,0,getWidth(),getHeight());
              pane.setColor(Color.red);
              pane.drawString("Sorry, You Lose!",50,150);
              repaint();
              removeKeyListener(this);
              final JPanel p1 = new JPanel();
              JButton again = new JButton("Play Again?");
              p1.add(again);
              add(p1,"South");
              p1.setBackground(Color.white);
              validate();
              again.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        remove(p1);
                        addKeyListener(WordPanel.this);
                        newWord();
         private String getWord(){
              int rand = (int)(Math.random()*words.length);
              return words[rand];
         private String[] readWords(){
              ArrayList<String> arr = new ArrayList<String>();
              try{
                   BufferedReader buff = new BufferedReader(new FileReader(wordFile));
                   try{
                        String line = null;
                        while (( line = buff.readLine()) != null){
                             line = line.toUpperCase();
                             arr.add(line);
                   finally{
                        buff.close();
              catch(Exception e){e.printStackTrace();}
              Object[] objects = arr.toArray();
              String[] words = new String[objects.length];
              int count = 0;
              for (Object o: objects){
                   words[count] = (String)o;
                   count++;
              return words;
         public void keyPressed(KeyEvent evt){
              char tempchar = evt.getKeyChar();
              String character = ""+tempchar;
              if (character.equalsIgnoreCase(""+positions[charcounter].getChar())){
                   positions[charcounter].setColor(randomColor());
                   charcounter++;
              else if (evt.isShiftDown()){
                   evt.consume();
              else{
                   restart();
              drawWords();
         public void keyTyped(KeyEvent evt){}
         public void keyReleased(KeyEvent evt){}
    class CharacterPosition{
         private int xaxis;
         private char character;
         private Color color;
         public CharacterPosition(char c, int x, Color col){
              xaxis = x;
              character = c;
              color = col;
         public int getX(){
              return xaxis;
         public char getChar(){
              return character;
         public Color getColor(){
              return color;
         public void setColor(Color c){
              color = c;
    }

    I thought that maybe serializing the ArrayList might be faster than creating the ArrayList by iterating over each line in the text file. But alas, I was wrong. Here's my code anyway:
    class WordList extends ArrayList<String>{
      long updated;
    WordList readWordList(File file) throws Exception{
      WordList list = new WordList();
      BufferedReader in = new BufferedReader(new FileReader(file));
      String line = null;
      while ((line = in.readLine()) != null){
        list.add(line);
      in.close();
      list.updated = file.lastModified();
      return list;
    WordList wordList;
    File datFile = new File("words.dat");
    File txtFile = new File("input.txt");
    if (datFile.exists()){
      ObjectInputStream input = new ObjectInputStream(new FileInputStream(datFile));
      wordList = (WordList)input.readObject();
      if (wordList.updated < txtFile.lastModified()){
        //if the text file has been updated, re-read it
        wordList = readWordList(txtFile);
        ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(datFile));
        output.writeObject(wordList);
        output.close();
    } else {
      //serialized list does not exist--create it
      wordList = readWordList(txtFile);
      ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(datFile));
      output.writeObject(wordList);
      output.close();
    }The text file contained one random sequence of letters per line. For example:
    hwnuu
    nhpgaucah
    zfbylzt
    hwnc
    gicgwkhStats:
    Text file size: 892K
    Serialized file size: 1.1MB
    Time to read from text file: 795ms
    Time to read from serialized file: 1216ms

  • How can i get the random values from database?

    Hi,
    i want to get random values from database.
    I try my best find no solution
    plz give solution in either sql query or java method.
    thanks in advance.

    try this:
    Give a numeric row-id to each row of database.
    say (1-100) for 100 rows
    In the program use random function to get random number between 0 and 1. this value u multiply with 100(or total number of rows) and take integer value of it . u then perform sql query to select the a row which matches randomly genarated value with row-id assigned to each row of database
    madhu

  • I am trying to burn a cd from my itunes playlist but it keeps canceling my burn and says their is an error 4450. What am I doing wrong?

    I am trying to burn a cd from my itunes playlist but it keeps canceling my burn and says their is an error 4450. What am I doing wrong?

    Could you post your diagnostics for us please?
    In iTunes, go "Help > Run Diagnostics". Uncheck the boxes other than DVD/CD tests, as per the following screenshot:
    ... and click "Next".
    When you get through to the final screen:
    ... click the "Copy to Clipboard" button and paste the diagnostics into a reply here.

  • HT203164 Error trying to burn a CD from an iTunes playlist - files not found on hard drive??

    I have a new computer with Windows 8 Home Premium.  Before the old computer crashed, I had backed up all my iTunes Media in the cloud.  I had also purchased a soundtrack album from the iTunes store and put the songs into a playlist.  All media was matched with the new computer, and the new computer was authorized by me in iTunes, so all my previous media shows up in iTunes on the new computer.  The only symbol next to the song titles in iTunes for all my songs is a picture of a tiny cloud.
    When I play the songs in the playlist from the new computer in iTunes, they all play just fine.  However, when I try to burn a CD with the songs in the playlist, I get this error message (it has no number associated with it):  The song "[name of song]" could not be burned because the file cannot be found on the computer hard drive.  I tried burning CD's from any other playlist but was not able to burn a CD from ANY playlist; I get the same error message no matter what I try to do.  I would really like to be able burn CD's from iTunes, because that's what plays in my car.  Hooking up an iPod in the car does play music, but it is faded and of bad quality (my car is an '05 model).
    Does anyone have any ideas on what is wrong here and how I can fix it so burning CD's in iTunes will again be an option?  I don't burn many CD's but would really like to be able to do so.  The version of iTunes I have is 11, all the iTunes files are updated, and the CD drive is working fine,  I am able to play CD's in iTunes from it and burn other songs to it using another media player.  I am also using top-quality new blank CD's, and when trying to burn a CD from a playlist, I select Audio CD with 2 seconds for the gap between songs, and the album text, then I select Burn.  I've tried selecting other options in turn, but get the same error message.
    Thank you in advance to anyone who can help with this issue - it seems I am the only one having it.

    I actually solved this problem myself.  I discovered, while playing around with the new iTunes, that clicking on PLAYLISTS on the menu bar shows the playlists that I have created on the left side of the window (like the old iTunes used to do by default).  I scrolled down to the playlist I wanted to burn to a CD, right-clicked on it, and a menu came up.  I selected DOWNLOAD....this downloads my playlist songs from the cloud to my computer hard drive.  After that, the little "cloud pictures" next to my songs disappeared, and I was able to burn the CD with no problems.
    I hope this helps someone else....I was quite lost for a while.  Which is amazing, considering how user-friendly most Apple products have historically been.

  • HT1386 I synced (updated) my iphone to itunes and some songs were deleted from my iphone playlist on my phone.  On the computer, a circle is next to the song and the title faded out.  What the heck is that all about and how do I get my songs back onto my

    I synced (updated) my iphone to itunes and some songs were deleted from my iphone playlist on my phone.  On the computer, a circle is next to the song and the title faded out.  What the heck is that all about and how do I get my songs back onto my phone playlist?  Never happened before.  My software is up to date?

    http://support.apple.com/kb/HT2519

  • Safari on iPad Air 2 flashes random pages from history

    iPad Air 2 64GB WiFi running 8.1.3
    When I open Safari, a random page from my history (usually from days or weeks ago) flashes on the screen for 1/2 second and then shows the current webpage.
    I've cleared History and Website Data in Settings>Safari. Still does it. Safari even flashes pages that should have been cleared In that process!
    I then restored the iPad as a new device through iTunes. Still does it.
    I've had the iPad since November. It never did this until January. Hopefully the next iOS update will take care of it. Very annoying.

    Forgot to mention- this happens upon launching Safrari from either a "quit" state or "background" state.

  • After upgrading to yosemite my macbook pro late 2011 does a random sound from time to time.

    After upgrading to yosemite my macbook pro late 2011 does a random sound from time to time. Its completely random and i already checked all apps in use and its not from them.

    Sounds like Notifications app.
    Maybe some other app. In SystemPreferences->Users&Groups->LoginItems tab: remove all entries with the minus sign underneath. This will not uninstall anything, you have to start those apps by hand now. Restart.
    Still there?
    Yes: Restart again while holding the shift key, this will start the mac in SafeMode: only the necessary items are loaded to run.
    Still there?
    Yes: Make an etrecheck list and post it here.
    No: Restart, put the items in the LoginItems back, one by one, restart after each entry, and you will find the "culprit"
    Please report accordingly. I will be back in 24 hours.

  • How can you generate Multiple random numbers from 1 to 49?

    I am very new at programming with the iPhone SDK and I need some help with a project I am working on. What I want to do is set up a window with 6 labels and 1 button. When the user clicks the button, the program will populate 6 randomized numbers each ranging from 1 to 49, and then place each of 6 numbers in a label. But each time the program ends and starts again the numbers cannot be the same, and also when the user clicks the button, no label can have the same number twice, so for example. If label 1 had the number 10, the other 5 labels cannot have that number until the button is clicked again. I know how to set up the interface, I just need the code. I would so greatly appreciate someone's help in this matter. I have been trying to do this for days and I cannot figure it out. Possibly someone who knows tons about Objective C programming can help me!
    Thank-you so very much!!

    I see that you're writing a lottery number generator. Perhaps the easiest way to do it is to emulate a real lottery: fill an array (NSMutableArray, probably) with the numbers between 1 and 49, pick one at random, remove that number from the array, and repeat. (You can think of the numbers as being the balls and the array as being the machine that pops them out.)
    One simple way to get the random indices needed is to extract six random bytes from Randomization Services using SecRandomCopyBytes, then loop over them, using the modulo operator (%) to select an index within the size of the array.
    And no, I'm not going to write your code for you. If I was going to do that, I could package and sell the app myself.

  • How do I transfer music from my itunes playlist to my iphone?

    How do I transfer music from my itunes playlist to my iphone?

    Maddening!!!!! What used to work now doesn't!
    Where did simple drag and drop go? Apple invented it!
    I have an iPhone 5s and want to transfer Playlists from my desktop iMac to the iPhone. I have had these products since their first releases years ago. I am a computer power user. What used to be a simpe "drag and drop" of your Playlist (yes, in Column View which I have turned on now) to your iPhone was easy and you were set. It is now impossible to do. Or easily!
    There are been other posts on this. I have tried them all. None work or the explanations are not adequate.
    WHY IS THIS SAME **** HARD WHEN IT USED TO BE DRAG AND DROP?
    PS: Fire the iTune Product Manager who did this version..get Jony Ive on the case to fix the User Interface Design ASAP!

  • Random selection from a list

    I’m setting up a multiple-choice question, and I want to re-arrange the position of the button sprites representing the correct answer and distractors.
    I can randomly select one of the sprites via gDistractorLoc = random(4). The random function fails me after that.
    Is there a means of randomly selecting one of the entries from a list, e.g. gDistractorList = [1, 2, 4] or [1, 4]?
    I realize that I am perhaps complicating the process, and I'd be grateful for a simpler approach.

    I don't know if this is simpler or not, but here is a method for grabbing a random item from a list:
    gDistractorList = [1, 2, 4]
    put gDistractorList.getAt(random(gDistractorList.count))

Maybe you are looking for

  • Adobe Media Encoder won't open MPEG2 files

    Hi All, I'm hoping you can help me, I'm having some trouble with Adobe Media Encoder CS4, it won't open any MPEG2 files I throw at it. They all open fine in Media Player Classic, MPC-HC and VideoLan, so I'm wondering what I'm doing wrong. Any ideas g

  • Change Doc title in Tcode sost when emailing quotation doc

    Hi, Currently, After emailing a quotation, I go to tcode SOST to check the status of the email. I saw that: the "Doc title" of the email is: Program name/Date/time. I want to change the "Doc title" to a new value. Could you please help me with this i

  • [solved] OpenGL apps in window do not obey window manager

    Hello, I have another X related problem, the first one resulted in downgrading my X (see http://bbs.archlinux.org/viewtopic.php?id=44460 ) Now I am finally able to run both xv (video rendering) and dri (3d rendering), but I have a problem, that when

  • Boot camp or Parallels Desktop?

    Hi, I'm planing on getting an iMac and need win7 for ONLY the sole purpose of playing games that are not OS X supported. Now correct me if I'm worng but Boot Camp installs Win on a partition of its own on the HDD right and Parallels is just a virtual

  • TS1424 I'm having a hardtime syncing my new ipod shuffle, get a message that says my songs are not found

    I'm having a difficult time transfering my songs to my new ipod shuffle 4th generation. A message says that my songs are not found. Any help would be greatly appreciated. Thanks.