Binary pipe into to two programs

I have a video stream over a udp connection that I'm transferring using ncat. I'm piping this into mplayer to play it. I'm doing this just on the normal command line. Everything works fine.The command I'm running is:
ncat -l -p 5000 --udp | mplayer -vo direct3d -cache 1028 -
What I want to do is change the pipe to send it to mplayer AND to another ncat process that fowards it to another computer. My research led me first to a Windows implementation of tee, but that doesn't work because it tee's to a file and to the next command
in the pipe instead of to two commands.
So then I was reading about using PowerShell and I think that's the only way to do it without having to write code. I'm a proficient programmer so I can write a program to do this if needed, but I was hoping I could just write a script and make this happen.
However, I'm not getting very far...
My first attempt was modeled after this example I found
here:
PS > "123" | % {
$_.Replace( "1", "a"),
$_.Replace( "2", "b" )
Seems to work for this simple example, but it's not working for what I want to do. Seems this is processing an item at a time, but I have a continuous stream.
I tried to replicate my existing ncat to mplayer example and couldn't even get that to work. For whatever reason, I don't get any output to the console from mplayer and the mplayer video window never starts. I'm not really sure why though.
Another issue that I came across was that PowerShell doesn't seem to pipe bytes as straight bytes. That confused me a bit because it seems restrictive, but I guess most people use PowerShell for text processing so it kind of makes sense. This led me to find
a Get-ProcessOutputAsBinary command here that I tried to make work. I was able to finally get some mplayer output to the console, however it only happened
after I killed the ncat process. Here's what I tried:
.\Get-ProcessOutputAsBinary.ps1 "ncat.exe" "-l -p 5000 --udp" | mplayer -vo direct3d -cache 1028 -
Maybe it's because I'm a programmer and don't write scripts very often, but this seems overly complicated. I guess I can think of a ton of reasons you'd want to pipe output (binary or otherwise) to two (or more) other commands and I don't understand why it's
so difficult. I'm also not understand why I can't even replicate what I can do on a standard windows command line. Am I just missing something?

I know there's no "official" tee program, but there are a couple linux ports and they do the same thing. Supposedly in bash you can tee to a program instead of a file, but obviously that doesn't work in Windows.
I guess I don't see why this isn't a scripting question. It really has nothing to do with any of the utilities I mentioned. I'm simply asking how to write a script that can pipe binary output from one utility to two (or more) other utilities that take binary
from stdin. Seems like something that is done with a script and would be a scripting question.

Similar Messages

  • I am trying to install an update of Microsoft office and I get a message that says.  This application must be closed ETC.....   I am running Parralell and I think it is there.  The two programs are "Microsoft Database Daemon" "SyncServicesAgent"....

    I am trying to install an update of Microsoft office and I get a message that says.  This application must be closed ETC.....   I am running Parralell and I think it is there.  The two programs are "Microsoft Database Daemon" "SyncServicesAgent".  How do I close these programs?

    If the Office updates have to be run through Win in Parallels, there's not really a section here that covers that , because Neither Office or Parallels are Apple products. There is only a small chance that you'll find someone with BOTH your conditions who just happend to look into a forum on older iMacs.
    Parallels has a forum here:
    http://forum.parallels.com/forum.php
    I think you'll get a faster response there.

  • Combining these two programs...

    I have two programs i want to combine into one. I have a solar system view which shows the solar system as a whole and i also have another program where you can individually view the planets by clicking on a button to load them. What i want to be able to do is in the solar system model (which shows the whole solar system) i can click on a planet and bring up the planetary view that i have. So i have two things i need to do:
    i) A mouse event to allow the user to click on a planet in full solar system view and load the 3D representation of that planet
    ii) A way to seperate my planet identifiying program so that each planet has its own code so that they can be clicked on individually
    Lets start with number 1:
    My code for the solar system model:
    onClipEvent (load) {
    function path(t1, t2){
      return Math.sqrt(t1 * t1 + t2 * t2);
    function label(){
      showLabel = !showLabel;
      if(showLabel) for(k = 0; k < count; k++) this[k].info = n[k];
      else for(k = 0; k < count; k++) this[k].info = "";
    c1 = new Array();  // endpoints coordinates of each ellipse conjugate diameters
    c2 = new Array();
    c3 = new Array();
    this.drag._x = 800;  // set zoom
    this.drag._y = -100; // set elevation
    var showLabel = false;
    // Planetary Orbital Elements (J2000)
    J2000 = new Date(2000, 0, 0, 12);
    n = new Array('Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune','Quaoar','Varuna');
    a = new Array(0.38709893, 0.72333199, 1.00000011, 1.52366231, 5.20336301, 9.53707032, 19.19126393, 30.06896348, 39.48168677, 17.94175491, 43.373493, 13.6209635, 43.2718562);
    e = new Array(0.20563069, 0.00677323, 0.01671022, 0.09341233, 0.04839266, 0.05415060, 0.04716771, 0.00858587, 0.24880766, 0.96727724, 0.037457, 0.3809974, 0.0529874);
    i = new Array(7.00487, 3.39471, 0.00005, 1.85061, 1.30530, 2.48446, 0.76986, 1.76917, 17.14175, 162.24220, 7.992, 6.93691, 17.12943);
    o = new Array(48.33167, 76.68069, -11.26064, 49.57854, 100.55615, 113.71504, 74.22988, 131.72169, 110.30347, 58.86004, 188.923, 209.32713, 97.28538);
    w = new Array(77.45645, 131.53298, 102.94719, 336.04084, 14.75385, 92.43194, 170.96424, 44.97135, 224.06676, 111.86560, 156.292, 339.09846, 275.22088);
    l = new Array(252.25084, 181.97973, 100.46435, 355.45332, 34.40438, 49.94432, 313.23218, 304.88003, 238.92881, 115.68, 267.1875, 48.62884, 83.80675);
    p = new Array(87.969, 224.701, 365.256, 686.980, 4332.589, 10759.22, 30685.4, 60189, 90465, 27795, 105192, 18573, 104096);
    cr = Math.PI/180;
    today = new Date();
    dt = (today - J2000)/864e+5;
    count = n.length;
    inc = 1;
    var pre = null; // drag motion detect
    zoom = 8;
    d = new Array();
    B = new Array();
    co = new Array();
    so = new Array();
    ci = new Array();
    si = new Array();
    for (j = 0; j < count; j++) {
      d[j] = 2 * Math.PI / p[j];
      co[j] = Math.cos(o[j] * cr);
      so[j] = Math.sin(o[j] * cr);
      ci[j] = Math.cos(i[j] * cr);
      si[j] = Math.sin(i[j] * cr);
      u[j] = (w[j] + l[j]) * cr;
      b[j] = Math.sqrt( (1 + e[j]) / (1 - e[j]) );
      c1[j] = traf(0);
      c2[j] = traf(Math.PI / 2);
      c3[j] = traf(3 * Math.PI / 2);
      this.attachMovie("ellipse", count + j, j);
      this.attachMovie("dot", j, j + count);
      if(j > 8) this[j]._alpha = this[count + j]._alpha = 50;
    function traf(e1){
      vector = new Object();
      var v = 2 * Math.atan( b[j] * Math.tan(e1/2) ) + u[j];
      var r = a[j] * ( 1 - e[j] * Math.cos(e1) );
      vector.x = r * ( co[j] * Math.cos(v) - so[j] * ci[j] * Math.sin(v) );
      vector.y = r * ( so[j] * Math.cos(v) + co[j] * ci[j] * Math.sin(v) );
      vector.z = r * si[j] * Math.sin(v);
      return vector;
    function place(pass){
      cmx = Math.cos(mx);
      smx = Math.sin(mx);
      zoom = 5 + drag._x/20;
      if (zoom < 1) zoom = 1;
      if (zoom > 120) zoom = 120;
      this.sun._xscale = this.sun._yscale = zoom;
      xk = zoom * pass.x;
      yk = zoom * (pass.z * smx - pass.y * cmx);
      this[j]._x = xk;
      this[j]._y = yk;
      if(pre != drag._y * drag._x){      // if zoomed or turned transform ellipses
       x1 = zoom * c1[j].x;
       y1 = zoom * (c1[j].z * smx - c1[j].y * cmx);
       x2 = zoom * c2[j].x;
       y2 = zoom * (c2[j].z * smx - c2[j].y * cmx);
       x3 = zoom * c3[j].x;
       y3 = zoom * (c3[j].z * smx - c3[j].y * cmx);
       ax = (x2 + x3 + y3 - y2)/2 - x1;
       ay = (x2 - x3 + y2 + y3)/2 - y1;
       bx = (x2 + x3 + y2 - y3)/2 - x1;
       by = (x3 - x2 + y2 + y3)/2 - y1;
       xc = (x2 + x3)/2;
       yc = (y2 + y3)/2;
       ek = path(bx, by) / path(ax, ay);
       ex = bx + ek * ax;
       ey = by + ek * ay;
       es = path(ex, ey);
       et = ( ay * (xc - x1) - ax * (yc - y1) ) / (ax * ex + ay * ey);
       xm = xc - x1 - ey * et;
       ym = yc - y1 + ex * et;
       xa = ax - xm;
       ya = ay - ym;
       sa = path(xm, ym);
       with(this[count + j]){
        _x = xc - sa * ex / es;
        _y = yc - sa * ey / es;
        _xscale = sa;
        _yscale = path(xa, ya);
        _alpha = 25 + 100 * _yscale / _xscale;
        _rotation = 180 * Math.atan2(-ey, -ex) / Math.PI;
    function kepler(){
      for(j = 0; j < count; j++){
       m = dt * d[j];
       e0 = m + e[j] * Math.sin(m);
       e0 = m + e[j] * Math.sin(e0);
       place( traf(e0) );
    onClipEvent (enterFrame) {
    mx = this.drag._y * cr / 2;
    kepler();
    pre = this.drag._y * this.drag._x;
    dt += inc;
    where would i put a mouse event that allows the user to click on a planet in full solar system view and load the 3D representation of that planet?
    Thanks for any and all help!

    Your solar system code is all AS2 code, not AS3, so if your planet code is AS3 then you will probably need to rethink this--you cannot mix the two languages in one file.  If your planet code is AS2, then you should post in the AS2 forum.

  • Combining two programs to make one

    Is there an easy way for me to combine these two programs? What I am wanting to use an array for the different loans. Display the mortgage payment amount for each loan and then list the loan balance and interest paid for each payment over the term of the loan. Use loops to prevent lists from scrolling off the screen. Here are the two programs I have so far. Any guidance is appreciated.
    import java.io.*;  // java input output package
    import java.text.DecimalFormat; // allows placement of decimal
    public class MonthlyPayments4e extends Thread //class header with "Thread" for sleep
    public static void main(String[] args)
    double Loan, NewBal, MIP;
       double Rate, MonthlyInterest, Payments; //double precision variables
       //assign values to variables
    Loan= 200000; // loan amount
    Rate = .0575; //interest rate
    MonthlyInterest = Rate / 12; // interest for each month
         Payments = Loan * (MonthlyInterest / (1 - Math.pow(1+MonthlyInterest, -360))); //my formula
      DecimalFormat twoDigits = new DecimalFormat("$,000.00"); // declares decimal format
      MIP= (Loan * Rate) / 12;
      NewBal = Loan -(Payments-MIP);
      System.out.println("Monthly Payments Interest Paid This Payment Loan Balance");
         System.out.println();//my printout provides extra line
         System.out.print("  " + twoDigits.format(Payments)); //my printout
      System.out.print("\t\t\t" + twoDigits.format(MIP));//my printout
      System.out.println("\t\t\t" + twoDigits.format(NewBal));//my printout
        System.out.print("  " + twoDigits.format(Payments)); //my printout
      MIP=(NewBal*Rate)/12;
      System.out.print("\t\t\t" + twoDigits.format(MIP));//my printout
      NewBal=NewBal -(Payments-MIP);
      System.out.println("\t\t\t" + twoDigits.format(NewBal));//my printout
      System.out.print("  " + twoDigits.format(Payments)); //my printout
      while (NewBal > 1) //while loop to make computations continue until gets to $200000
      MIP=(NewBal*Rate)/12;
      System.out.print("\t\t\t" + twoDigits.format(MIP));//my printout
      NewBal=NewBal -(Payments-MIP);
      System.out.println("\t\t\t" + twoDigits.format(NewBal));//my printout
      System.out.print("  " + twoDigits.format(Payments)); //my printout
    if (NewBal <100000) // tells when this is met to transition to sleep phase
      try
             Thread.sleep (500); //sleep phase needed per change request also states pause is 500 milliseconds
           catch (InterruptedException e)
    import java.io.*;  // java input output package
    import java.text.DecimalFormat;
    public class MonthlyPayments5  //class header
    public static void main(String[] args) //don't know if this is needed or not but here it is
    double Loan;
       double Rate1,Rate2,Rate3, MonthlyInterest1,MonthlyInterest2,MonthlyInterest3,Payment1,Payment2,Payment3; //double precision variables
       //assign values to variables
       Loan= 200000; // loan amount
       Rate1 = 5.75;
       Rate2 = 5.5;
       Rate3 = 5.35;
       MonthlyInterest1 = (Rate1 / 100) / 12;
       MonthlyInterest2 = (Rate2 / 100) / 12;
       MonthlyInterest3 = (Rate3 / 100) / 12;
         Payment1 = Loan * (MonthlyInterest1 / (1 - Math.pow(1+MonthlyInterest1, -360))); //my formula
         Payment2 = Loan * (MonthlyInterest2 / (1 - Math.pow(1+MonthlyInterest2, -180))); //my formula
         Payment3 = Loan * (MonthlyInterest3 / (1 - Math.pow(1+MonthlyInterest3, -84))); //my formula
      DecimalFormat twoDigits = new DecimalFormat("000.00");
         System.out.println("\tYour Monthly Payments for 30 years are:\t $" + twoDigits.format(Payment1)); //my printout
         System.out.println("\tYour Monthly Payments for 15 years are:\t $" + twoDigits.format(Payment2)); //my printout
         System.out.println("\tYour Monthly Payments for 7 years are:\t $" + twoDigits.format(Payment3)); //my printout
     

    Any guidance is appreciated. Here's some guidance:
    ublic class MonthlyPayments4e extends Thread //class
    header with "Thread" for sleepThere's no need for your class to extend Thread. If it truly needs to run in a separate thread, better to implement Runnable.
    public static void main(String[] args)
    {It's a common newbie mistake to put lots of code into main methods. After all, that's what you "run", right? Better to put that code into a class or instance method that you have a main method call. Other objects can get at it that way.
    double Loan, NewBal, MIP;
    double Rate, MonthlyInterest, Payments; //double
    precision variablesLearn and follow the Sun Java coding standards:
    http://java.sun.com/docs/codeconv/
    This isn't VB.
    The comment "// double precision variables" is totally, utterly useless. The fact that they're declared as double is more than sufficient. Useless comments like these just clutter up code.
    //assign values to variablesMORE useless comments! Get rid of them. You've probably been taught that comments are good. I'm here to tell you that comments are bad. Write your code clearly enough and you won't need comments. Good choices for variable and method names and good refactoring are worth a million comments.
    oan= 200000; // loan amount
    Rate = .0575; //interest rate
    MonthlyInterest = Rate / 12; // interest for each
    monthThe principal, interest rate, and term length should all be input values to your method, not hardwired like this. If you're asked to change the rate or principal you have to recompile your code. Terrible.
    Payments = Loan * (MonthlyInterest / (1 -
    Math.pow(1+MonthlyInterest, -360))); //my formulaSeparate the calculation from the display.
    DecimalFormat twoDigits = new
    DecimalFormat("$,000.00"); // declares decimalUse a currency formatter. Your program should not care if it's USD or euros or some other currency. Let the default Locale figure out what the currency format should be.
    format
    MIP= (Loan * Rate) / 12;
    NewBal = Loan -(Payments-MIP);
    System.out.println("Monthly Payments Interest Paid
    This Payment Loan Balance");Do the calculation in the method and let something else print out values.
    System.out.println();//my printout provides extra
    line
    System.out.print(" " +
    twoDigits.format(Payments)); //my printout
    System.out.print("\t\t\t" +
    twoDigits.format(MIP));//my printout
    System.out.println("\t\t\t" +
    twoDigits.format(NewBal));//my printout
    System.out.print(" " +
    twoDigits.format(Payments)); //my printout
    MIP=(NewBal*Rate)/12;
    System.out.print("\t\t\t" +
    twoDigits.format(MIP));//my printout
    NewBal=NewBal -(Payments-MIP);
    System.out.println("\t\t\t" +
    twoDigits.format(NewBal));//my printout
    System.out.print(" " +
    twoDigits.format(Payments)); //my printout
    Why $200000? What if I wanted to calculate payments on $1M USD? Or 2B yen?
    while (NewBal > 1) //while loop to make computations
    continue until gets to $200000
    MIP=(NewBal*Rate)/12;
    System.out.print("\t\t\t" +
    twoDigits.format(MIP));//my printout
    NewBal=NewBal -(Payments-MIP);
    System.out.println("\t\t\t" +
    twoDigits.format(NewBal));//my printout
    System.out.print(" " + twoDigits.format(Payments));
    //my printout
    if (NewBal <100000) // tells when this is met to
    transition to sleep phase
    try
    Thread.sleep (500); //sleep phase needed per
    change request also states pause is 500
    millisecondsUgh - who told you to do this? Take it out.
    catch (InterruptedException e)
    import java.io.*;  // java input output package
    import java.text.DecimalFormat;
    ublic class MonthlyPayments5  //class header
    public static void main(String[] args) //don't know
    if this is needed or not but here it is
    double Loan;
    double Rate1,Rate2,Rate3,
    MonthlyInterest1,MonthlyInterest2,MonthlyInterest3,Pa
    ment1,Payment2,Payment3; //double precision
    variables
    //assign values to variables
    Loan= 200000; // loan amount
    Rate1 = 5.75;
    Rate2 = 5.5;
    Rate3 = 5.35;
    MonthlyInterest1 = (Rate1 / 100) / 12;
    MonthlyInterest2 = (Rate2 / 100) / 12;
    MonthlyInterest3 = (Rate3 / 100) / 12;
    Payment1 = Loan * (MonthlyInterest1 / (1 -
    Math.pow(1+MonthlyInterest1, -360))); //my formula
    Payment2 = Loan * (MonthlyInterest2 / (1 -
    Math.pow(1+MonthlyInterest2, -180))); //my formula
    Payment3 = Loan * (MonthlyInterest3 / (1 -
    Math.pow(1+MonthlyInterest3, -84))); //my formula
    DecimalFormat twoDigits = new
    DecimalFormat("000.00");
    System.out.println("\tYour Monthly Payments for
    30 years are:\t $" + twoDigits.format(Payment1));
    //my printout
    System.out.println("\tYour Monthly Payments for
    15 years are:\t $" + twoDigits.format(Payment2));
    //my printout
    System.out.println("\tYour Monthly Payments for 7
    years are:\t $" + twoDigits.format(Payment3)); //my
    printout
    }See above for same comments on second messy method.
    %

  • Need help on combining these two program

    Hi all,
     I needed some help on combining these two program. But i not very sure how to do it.
    My program in working with TimeIn/TimeOut attendance taking. The snippet vi "insert data" is the where i start to TimeIn and insert into the microsoft access. And i wanted to insert it together with a camera catching the user's face. But i have no clues on how to combine them.
     Can u guys give me some ideas to help me ?
    Thanks in advance.
    Attachments:
    IMAQdx.png ‏55 KB
    insert data.png ‏68 KB

    Hi Himanshu,
    But if i put everything inside the IMAQdx loop ,it make my whole program more complicated. 
    This is how my program looks like below.
    I only want to display the image only when i "insert" all data into the database ( which i given at the perivous post).
    Is there other way?? And how do u make the IMAQdx loop stop without putting a stop button?? Because everytime i run the program,it will run continuously at the IMAQdx loop..
    Thank in Advance.
    Attachments:
    FYP.png ‏205 KB

  • Two Program Windows?

    Hey,
    I just have a short question: How do I open two program windows in Premiere?
    The new multiple timeline feature is really cool, but it would be cool to have two timelines open and one program window for each timeline instead of 1 program, 1 source.
    Thanks in advance!
    Philip

    Fillern1 wrote:
    Yeah, that doesn't really do it. because both are still connected to the same timeline, although not the same time in the timeline.
    It's basically just to have a quick full size scrubbing area to quickly see and select shots to drag from one timeline to the other. So you can use the timeline to scrub instead of scrubbing in the monitor windows, plus the scrub head and monitor window will remain when you click over to to the other timeline.
    You can do that in CC2014.1 by opening the second sequence via the media browser...
    Save your current project then navigate to it via the media browser and open the sequence you want as a 'source-side' sequence.
    This will open in the source monitor and open a timeline appended (Source Monitor)
    you can 'pancake' the two timelines for simultaneous comparison between source and program.
    There is a danger here though... I'm not sure you are supposed to do this / I don't think this has been thought all the way through - I was able to get a spinning beach ball by editing a sequence into itself (Avid always makes you make a dupe to avoid this).

  • Running two programs using two screens

    Hi, I have a 13” Mac Book Pro OSX 10.6.7 (2010) 2.26GHz 4GB I would like to work two programs using a second screen ie iTUNES on one screen and sound editing on the second. My second monitor is a 19” Toshiba HDTV that I can connect via the Mini display port to the HDMI on the monitor, is it possible for a third application by splitting one screen into 2. THXS

    TXTJ wrote:
    Hi, I have a 13” Mac Book Pro OSX 10.6.7 (2010) 2.26GHz 4GB I would like to work two programs using a second screen ie iTUNES on one screen and sound editing on the second. My second monitor is a 19” Toshiba HDTV that I can connect via the Mini display port to the HDMI on the monitor, is it possible for a third application by splitting one screen into 2. THXS
    I don't know about a TV used as a monitor but when using a monitor as a second monitor you can do what you want. You set up the display in extended mode. Start one of your applications and drag it over to the second monitor. Start your other application and don't drag it to the second monitor. You then have an application running on each monitor.

  • My itunes will not open at all. it occasionally will open but when i plug my iphone into it the program freezes and crashes. please help as soon as possible

    my itunes will not open at all. it occasionally will open but when i plug my iphone into it the program freezes and crashes. please help as soon as possible

    i think i might have a solution... i have windows vista and after i installed to latest itunes update everytime i tried to open it it would freeze. I tried everything, including uninstalling itunes and all of its components and reinstalled it numerous times. So i went to the itunes folder in my folders, not on itunes, and i deleted my itunes library and playlists. After that it worked just fine, all of my music was deleted but luckily i had my files saved elsewhere.
    I hope this helped! I know its frustrating and APPLE/ITUNES NEED TO FIX THE PROBLEM!!!!

  • How to let two programs access the same BDB data

    I want to use two programs to access data in one BDB database, but get this error
    multiple databases specified but not supported by file
    db open failed:Invalid argument
    I do not know how to deal with it.....
    anyone can help?
    thank you first

    Hello,
    Can you clarify a bit more as to what you are doing?
    A message like:
    multiple databases specified but not supported by file
    open: Invalid argument
    is expected when you are incorrectly creating multiple databases
    within a single physical file.
    The details are at:
    http://www.oracle.com/technology/documentation/berkeley-db/db/ref/am/opensub.html
    http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/db_open.html
    It is possible to contain multiple databases in a single physical file
    but the application has to follow some steps in order to do that.
    For example you can not attempt to open a second database in a file that
    was not initially created using a database name. Doing will generate
    the error you posted.
    Thanks,
    Sandra

  • I have recently updated my CC programs to the latest version and now all of my files wont open by default into their respective programs, only if I open the program and go to file open and open the file from there. How can I fix this?

    I have recently updated my CC programs to the latest version (CC2014) and now all of my files wont open by default into their respective programs, only if I open the program and go to file>open and open the file from there. How can I fix this?
    I have tried 'Open with' and the version of the program now installed on my computer isn't even suggested as an option and when I browse for it, the file wont open with it anyway

    On Windows (don't know about Mac), the latest version will always take over the file association, and become the default for indd files. It's impossible to change it.
    But there is a plugin for ID that makes this possible. Never tried it myself.
    https://www.rorohiko.com/wordpress/downloads/lightning-brain-soxy/

  • How to get the output of a program into the email program.

    hi
    i had created a java mail program and the keygeneration program.seperately.
    i want to get the keygeneration into my email program.that should be sent along with the text message.so pls help me in this regared.
    i had pasted my coding her
    email pgm.
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
    To use this program, change values for the following three constants,
    SMTP_HOST_NAME -- Has your SMTP Host Name
    SMTP_AUTH_USER -- Has your SMTP Authentication UserName
    SMTP_AUTH_PWD -- Has your SMTP Authentication Password
    Next change values for fields
    emailMsgTxt -- Message Text for the Email
    emailSubjectTxt -- Subject for email
    emailFromAddress -- Email Address whose name will appears as "from" address
    Next change value for "emailList".
    This String array has List of all Email Addresses to Email Email needs to be sent to.
    Next to run the program, execute it as follows,
    SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
    private static final String SMTP_HOST_NAME = "smtp.mail.yahoo.com";
    private static final String SMTP_AUTH_USER = "xxxx";
    private static final String SMTP_AUTH_PWD = "xxxx";
    //private static final String emailMsgTxt = "Online Order Confirmation Message. Also include the Tracking Number.";
    private static final String emailSubjectTxt = "Order Confirmation Subject";
    private static final String emailFromAddress = "[email protected]";
    private static String emailMsgTxt = "I am unable to attend to your message, as I am busy sunning"
    + "myself on the beach in Maui, where it is warm and peaceful."
    + "Perhaps when I return I'll get around to reading your mail."
    + "Or perhaps not.";
    private static final String[] emailList = { "[email protected]","[email protected]"};
    public static void main(String args[]) throws Exception
    SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
    smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
    System.out.println("Sucessfully Sent mail to All Users");
    public void postMail( String recipients[ ], String subject,
    String message , String from) throws MessagingException
    boolean debug = true;
    Properties props = new Properties();
    props.put("mail.smtp.host", SMTP_HOST_NAME);
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.port", "25");
    props.put("mail.smtp.protocol","smtp");
    props.put("mail.debug", "true");
    Authenticator auth = new SMTPAuthenticator();
    Session session = Session.getDefaultInstance(props, auth);
    session.setDebug(debug);
    // create a message
    Message msg = new MimeMessage(session);
    // set the from and to address
    InternetAddress addressFrom = new InternetAddress(from);
    msg.setFrom(addressFrom);
    InternetAddress[] addressTo = new InternetAddress[recipients.length];
    for (int i = 0; i < recipients.length; i++)
    addressTo[i] = new InternetAddress(recipients);
    msg.setRecipients(Message.RecipientType.TO, addressTo);
    // Setting the Subject and Content Type
    msg.setSubject(subject);
    msg.setContent(message, "text/plain");
    Transport.send(msg);
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    return new PasswordAuthentication(username, password);
    keygeneration program:
    import java.io.Serializable;
         import java.security.Security;
    import com.sun.net.ssl.*;
         import javax.crypto.KeyGenerator;
         import javax.crypto.Mac;
         import javax.crypto.SecretKey;
         public class Eval {
         public static void main(String args[]) throws Exception {
         String inputString ="0x0b0b0b0b";
         KeyGenerator keyGen = KeyGenerator.getInstance("HMACMD5");
         SecretKey secretKey = keyGen.generateKey();
         Mac mac = Mac.getInstance(secretKey.getAlgorithm());
         mac.init(secretKey);
         byte[] byteData = inputString.getBytes("UTF8");
         byte[] macBytes = mac.doFinal(byteData);
         String macAsString = new sun.misc.BASE64Encoder().encode(macBytes);
         System.out.println("Authentication code is: " + macAsString);

    I'm not sure what's confusing you. Just generate a String (using a StringBuffer)
    with the data you need and use it as the content of the mail message. If each
    recipient needs different content, they'll each need a different MimeMessage
    object.

  • Hi. I recently got a new computer and transferred all my files across using TimeMachine. Whenever I try to sign into any CC program (including CC) the program instantly shuts down and an Apple error message comes up. I have uninstalled and reinstalled CC

    Hi. I recently got a new computer and transferred all my files across using TimeMachine. Whenever I try to sign into any CC program (including CC) the program instantly shuts down and an Apple error message comes up. I have uninstalled and reinstalled CC twice with no avail and deleted every Adobe product on my computer and nothing is working.

    I have seen similar discussions before... transferring does not work, you must install
    Discussions of RE-installing
    -http://forums.adobe.com/thread/1408331?tstart=0
    -http://forums.adobe.com/thread/1398961?tstart=0
    -and http://helpx.adobe.com/creative-cloud/help/install-apps.html
    -using the cleaner after uninstalling and before reinstalling will usually help
    -http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

  • How do I combine two one page documents into one two page document?

    How do I combine two one page documents into on two page document?????

    Menu > View > Show Thumbnails > Click on the thumbnail > Copy > Paste into the Thumbnails of the 2nd document
    Peter

  • Uninstalled QucikTime, I have these two programs, apple support update, and

    I used QuickTime player on my windows 7 64 bit PC , didn't like it, removed it using add/remove program. Now I have these two: Apple Application Support Version 1.3.1 and is 42.8 MB and Apple Software update 2.1.1.116, 2.15 MB. They are from Apple, Inc. They are listed on my ad /remove program. My question:Since I have Uninstalled Quick time player, do i need to remove these two files? Are they related to any other important software like (e.g adobe)?
    I have apple support update, which has , as I understand,an update , but I no longer have a Quick Time program. Do I need to get rid of these two programs, and how to do it safely?
    Thanks

    They're not doing anything now, so you can remove them. Uninstall them from the Add/Remove Programs, just as you did with QuickTime.
    Regards.

  • Loading Labview Binary Data into Matlab

    This post explains the Labview binary data format. I couldn't find all of this information in any one place so this ought to help anyone in the future.  I didn't want to add any overhead in Labview so I did all of my conversion in Matlab.
    The Labview VI "Write to Binary File" writes data to a file in a linear format using Big Endian numbers of the type wired into the "Write to Binary File" VI. The array dimensions are listed before the actual array data. 
    fid = fopen('BinaryData.bin','r','ieee-be'); % Open the binary file
    Dim1 = fread(fid,4); % Reads the first dimension
    Dim2 = fread(fid,4); % Reads the second dimension
    Dim3 = ...
    Each dimension's length is specified by 4 bytes. Each increment of the first, second, third, and fourth byte represent 2^32, 2^16, 2^8, and 1 respectively. 0 0 2 38 equates to 2*256 + 38 = 550 values for that particular dimension.
    As long as you know the number of dimensions and precision of your binary data you can load it.
    Data = fread(fid,prod([Dim1 Dim2 Dim3]),'double',0,'ieee-be'); % Load double precision data
    If you have appended multiple arrays to the same file in Labview you would repeat this procedure. Load each dimension then load the data, repeat.
    Data = fread(fid,prod([Dim1 Dim2 Dim3]),'int8',0,'ieee-be'); % Load int8 precision data or boolean data
    I had to create a function for my own purposes so I thought I'd share it with everyone else too.  I uploaded it to the Matlab File Exchange.  The file is named labviewload.m.
    This was tested on Matlab R2007a and Labview 8.2.

    Thanks. I have the same questions as I tried to load labview binary data into Matlab. 
    -John

Maybe you are looking for

  • Dataguard Failure scenario

    In my current environemnt Production database has one physical standby database. The size of the database is 5 TB. Due the network failure 4 days archivelog files were not copied to primary database (archivelog files were deleted in primary database)

  • How to chnage the text in an emial

    My workflow is sending emails via extended notification. What do I need to change(I assume somewhere in swnconfig???) in order to change the text in the emails that it sends out? Specifically I want to add a sentence along the lines of "This is a sys

  • Could not boot TMS_ORA  for bankapp---error:GP_CAT:1235:

    Hello group members, When I tried to integrate tuxedo bankapp application with oracle in linux i get this error on booting TMS_ORA---GP_CAT:1235: ERROR: Could not initialize random algorithm. my environment:tuxedo in linux,oracle 8.1.6 my RM string w

  • Server7 Installer crashes on NT

    I am attempting to install a legacy database on a (clean) Windows NT 4.0 system with no other Oracle products installed. Oracle Server 7.3.4 installs correctly but when I attempt to install Designer/2000 1.3.2 (or ANY other Oracle product including s

  • Not able to see published task and not able to reset version for the task

    Hi, Created a task ,validated,by selecting the task clicked Publish button in tools to publish the task. In Client Application(Callcenter) navigated Administration-Business Process->Task Deployment Here not able to see published task to activate. Tri