CS4\5 - Easy Way to Convert Gradient Stops to Swatches?

Hi Folks
I wonder if there is an easy way to do this?
I am working with an AI file where I want to create swatches for every colour I use to ensure consistency. There are a number of gradients in the document, and I have stored the colour stops from the gradient as swatches. So far so good.
Now I want to adjust the gradient colour stops, but there seems to be no easy way to add a new swatch from a gradient colour stop, or to update an existing swatch from a gradient colour stop.
The swatches palette that appears when clicking the gradient colour stop has no buttons on it to add a new swatch, for example, and none of the usual swatch creating methods seem to work.
Is this possible without reverting to some cumbersome workaround?
Any help appreciated!
Cheers
Richard

Does clicking on a stop then dragging the color from the Color panel to the Swatches panel not work for you (translation, er, repetition of post 1)?
Also, wouldn't the Edit > Edit Colors mechanism help here?

Similar Messages

  • Is there an easy way to convert from a String with a comma, ie. 1,000.00 to

    Is there an easy way to convert from a String with a comma, ie. 1,000.00 to a float or a double?
    thanks,
    dosteov

    Like DrClap said: DecimalFormat. However, make sure you understand the Locale things, as explained at http://java.sun.com/j2se/1.3/docs/api/java/text/DecimalFormat.html (which refers to NumberFormat as well) and use them explicitly. Like
    public class FormatTest
      public static void main(String args[])
        try
          // see NumberFormat.getInstance()
          DecimalFormat fmt = new DecimalFormat();
          Number num = fmt.parse("1,000.01");
          System.out.println(num.doubleValue());
        catch(ParseException pe)
          System.out.println(pe);
    }most likely seems OK on your system, but may print "1.0" (or even fail) on some non-English platforms!
    When performing calculations, also see http://developer.java.sun.com/developer/JDCTechTips/2001/tt0807.html
    a.

  • Is there an easy way to convert original images to b&w ?

    I have a canon 5d mark II and when I decide to shoot b&w pics, this is what i do : I set my camera to b&w and shoot raw+jpeg. raw files come out in color all the time but jpegs show up in b&w when i import them . I decided to do so as it is very time consuming to convert the original images to b&w one by one.
    Is there an easy way to do it?? Any suggestions? 

    Little known hint well worth knowing:
    If you use the menu selection "Photos→Add Adjustment" or "Photos→Add Adjustment Preset", the operation is done to all selected images.
    In addition to what Frank says, you could also apply a B&W Adjustment Preset when the files are imported.  These adjustments are like any others -- they can be toggled on and off, removed, and adjusted with the settings in the Bricks used.
    For grayscale, it is well worth the time exploring the included Presets and the slider controls.  Afaik, sophisticated grayscale photographers optimize their images in color prior to converting to grayscale.
    JPG is 8-bit and lossy.  RAW is (up to) 16-bit and unconverted (no loss of data, but "lossless" isn't quite right).  If the JPG conversion and quality suffices, there is little reason to shoot RAW+JPEG.
    In essence, you can use the in-camera-created grayscale JPGs, with their fixed and baked-in conversion settings, or you can use Aperture's broad (and time-consuming) grayscale controls.  If you do the latter, and settle on a conversion that works for your camera and subject(s), save it as an Adjustment Preset and use it.

  • Is there an easy way to convert and import MTS files from a external hardrive so that I can edit them in FCP?

    I am trying to convert game footage that is in MTS format to something that I can edit into a quick highlights video. I have final cut express and the standard IMovie '09. looking for easiest solution, everything seems to involve using one application to convert to Quicktime and then dropping file into Iphoto etc. is there an easy way?

    I'm not completely sure that MPEG Streamclip can convert AVCHD footage (.mts files).  If MPEG Streamclip doesn't do the job, then get a copy of Clipwrap, which was designed for transcoding .mts files to QuickTime/Apple Intermediate Codec (that's the format/codec you need to convert the .mts files to for use in FCE).

  • Easy way to convert javascript to a java applet?

    Hello all! I am relatively new to java and java programming and had a question about converting a JavaScript to a java applet or even a standalone application. I included the JavaScript code for a checkers game below and wanted to know what would be the easiest way to convert this code if at all possible?
    Thanks in advance,
    Bob
    <SCRIPT language=JavaScript>
    <!--
    version = 1.0;
    // -->
    </SCRIPT>
    <SCRIPT language=JavaScript1.1>
    <!--
    version = 1.1;
    // -->
    </SCRIPT>
    <SCRIPT language=JavaScript>
    <!--
    if (version==1.0)
    document.write("Your browser doesn't have JavaScript 1.1 capabilities. "
    + "This checkers game script only works on Netscape 3+ and MSIE 4+.");
    // -->
    </SCRIPT>
    <SCRIPT language=JavaScript1.1>
    <!--
    // Checkers Game
    // black.gif
    // gray.gif
    // you1.gif -- normal piece (player/red)
    // you2.gif -- highlighted piece
    // you1k.gif -- kinged normal piece
    // you2k.gif -- kinged highlighted piece
    // me1.gif -- normal piece (computer/black)
    // me2.gif -- highlighted piece
    // me1k.gif -- kinged normal piece
    // me2k.gif -- kinged highlighted piece
    function preload() {
    this.length = preload.arguments.length;
    for (var i = 0; i < this.length; i++) {
    this[i] = new Image();
    this.src = preload.arguments[i];
    var pics = new preload("black.gif","gray.gif",
    "you1.gif","you2.gif","you1k.gif","you2k.gif",
    "me1.gif","me2.gif","me1k.gif","me2k.gif");
    var black = -1; // computer is black
    var red = 1; // visitor is red
    var square_dim = 35;
    var piece_toggled = false;
    var my_turn = false;
    var double_jump = false;
    var comp_move = false;
    var game_is_over = false;
    var safe_from = safe_to = null;
    var toggler = null;
    var togglers = 0;
    function Board() {
    board = new Array();
    for (var i=0;i<8; i++) {
    board[i] = new Array();
    for (var j=0;j<8;j++)
    board[i][j] = Board.arguments[8*j+i];
    board[-2] = new Array(); // prevents errors
    board[-1] = new Array(); // prevents errors
    board[8] = new Array(); // prevents errors
    board[9] = new Array(); // prevents errors
    var board;
    Board(1,0,1,0,1,0,1,0,
    0,1,0,1,0,1,0,1,
    1,0,1,0,1,0,1,0,
    0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,
    0,-1,0,-1,0,-1,0,-1,
    -1,0,-1,0,-1,0,-1,0,
    0,-1,0,-1,0,-1,0,-1);
    function message(str) {
    if (!game_is_over)
    document.disp.message.value = str;
    function moveable_space(i,j) {
    // calculates whether it is a gray (moveable)
    // or black (non-moveable) space
    return (((i%2)+j)%2 == 0);
    function Coord(x,y) {
    this.x = x;
    this.y = y;
    function coord(x,y) {
    c = new Coord(x,y);
    return c;
    document.write("<table border=0 cellspacing=0 cellpadding=0 width="+(square_dim*8+8)
    +"<tr><td><img src='black.gif' width="+(square_dim*8+8)
    +" height=4><br></td></tr>");
    for(var j=0;j<8;j++) {
    document.write("<tr><td><img src='black.gif' width=4 height="+square_dim+">");
    for(var i=0;i<8;i++) {
    if (moveable_space(i,j))
    document.write("<a href='javascript:clicked("+i+","+j+")'>");
    document.write("<img src='");
    if (board[i][j]==1) document.write("you1.gif");
    else if (board[i][j]==-1) document.write("me1.gif");
    else if (moveable_space(i,j)) document.write("gray.gif");
    else document.write("black.gif");
    document.write("' width="+square_dim+" height="+square_dim
    +" name='space"+i+""+j+"' border=0>");
    if (moveable_space(i,j)) document.write("</a>");
    document.write("<img src='black.gif' width=4 height="+square_dim+"></td></tr>");
    document.write("<tr><td><img src='black.gif' width="+(square_dim*8+8)
    +" height=4><br></td></tr></table><br>"
    +"<form name='disp'><textarea name='message' wrap=virtual rows=2 cols=40></textarea><br><input "
    +"type=button value=\"Start the Game Over\" onClick=\"location.href+=''\"></form>");
    function clicked(i,j) {
    if (my_turn) {
    if (integ(board[i][j])==1) toggle(i,j);
    else if (piece_toggled) move(selected,coord(i,j));
    else message("First click one of your red pieces, then click where you want to move it");
    } else {
    message("It's not your turn yet. Hang on a sec!");
    function toggle(x,y) {
    if (my_turn) {
    if (piece_toggled)
    draw(selected.x,selected.y,"you1"+((board[selected.x][selected.y]==1.1)?"k":"")+".gif");
    if (piece_toggled && (selected.x == x) && (selected.y == y)) {
    piece_toggled = false;
    if (double_jump) { my_turn = double_jump = false; computer(); }
    } else {
    piece_toggled = true;
    draw(x,y,"you2"+((board[x][y]==1.1)?"k":"")+".gif");
    selected = coord(x,y);
    } else {
    if ((piece_toggled) && (integ(board[selected_c.x][selected_c.y])==-1))
    draw(selected_c.x,selected_c.y,"me1"+((board[selected_c.x][selected_c.y]==-1.1)?"k":"")+".gif");
    if (piece_toggled && (selected_c.x == x) && (selected_c.y == y)) {
    piece_toggled = false;
    } else {
    piece_toggled = true;
    draw(x,y,"me2"+((board[x][y]==-1.1)?"k":"")+".gif");
    selected_c = coord(x,y);
    function draw(x,y,name) {
    document.images["space"+x+""+y].src = name;
    function integ(num) {
    if (num != null)
    return Math.round(num);
    else
    return null;
    function abs(num) {
    return Math.abs(num);
    function sign(num) {
    if (num < 0) return -1;
    else return 1;
    function concatenate(arr1,arr2) {
    // function tacks the second array onto the end of the first and returns result
    for(var i=0;i<arr2.length;i++)
    arr1[arr1.length+i] = arr2[i];
    return arr1;
    function legal_move(from,to) {
    if ((to.x < 0) || (to.y < 0) || (to.x > 7) || (to.y > 7)) return false;
    piece = board[from.x][from.y];
    distance = coord(to.x-from.x,to.y-from.y);
    if ((distance.x == 0) || (distance.y == 0)) {
    message("You may only move diagonally.");
    return false;
    if (abs(distance.x) != abs(distance.y)) {
    message("Invalid move.");
    return false;
    if (abs(distance.x) > 2) {
    message("Invalid move.");
    return false;
    if ((abs(distance.x) == 1) && double_jump) {
    return false;
    if ((board[to.x][to.y] != 0) || (piece == 0)) {
    return false;
    if ((abs(distance.x) == 2)
    && (integ(piece) != -integ(board[from.x+sign(distance.x)][from.y+sign(distance.y)]))) {
    return false;
    if ((integ(piece) == piece) && (sign(piece) != sign(distance.y))) {
    return false;
    return true;
    function move(from,to) {
    my_turn = true;
    if (legal_move(from,to)) {
    piece = board[from.x][from.y];
    distance = coord(to.x-from.x,to.y-from.y);
    if ((abs(distance.x) == 1) && (board[to.x][to.y] == 0)) {
    swap(from,to);
    } else if ((abs(distance.x) == 2)
    && (integ(piece) != integ(board[from.x+sign(distance.x)][from.y+sign(distance.y)]))) {
    double_jump = false;
    swap(from,to);
    remove(from.x+sign(distance.x),from.y+sign(distance.y));
    if ((legal_move(to,coord(to.x+2,to.y+2)))
    || (legal_move(to,coord(to.x+2,to.y-2)))
    || (legal_move(to,coord(to.x-2,to.y-2)))
    || (legal_move(to,coord(to.x-2,to.y+2)))) {
    double_jump = true;
    message("You may complete the double jump or click on your piece to stay still.");
    if ((board[to.x][to.y] == 1) && (to.y == 7)) king_me(to.x,to.y);
    selected = to;
    if (game_over() && !double_jump) {
    setTimeout("toggle("+to.x+","+to.y+");my_turn = double_jump = false;computer();",1000);
    return true;
    function king_me(x,y) {
    if (board[x][y] == 1) {
    board[x][y] = 1.1; // king you
    draw(x,y,"you2k.gif");
    } else if (board[x][y] == -1) {
    board[x][y] = -1.1; // king me
    draw(x,y,"me2k.gif");
    function swap(from,to) {
    if (my_turn || comp_move) {
    dummy_src = document.images["space"+to.x+""+to.y].src;
    document.images["space"+to.x+""+to.y].src = document.images["space"+from.x+""+from.y].src;
    document.images["space"+from.x+""+from.y].src = dummy_src;
    dummy_num = board[from.x][from.y];
    board[from.x][from.y] = board[to.x][to.y];
    board[to.x][to.y] = dummy_num;
    function remove(x,y) {
    if (my_turn || comp_move)
    draw(x,y,"gray.gif");
    board[x][y] = 0;
    function Result(val) {
    this.high = val;
    this.dir = new Array();
    function move_comp(from,to) {
    toggle(from.x,from.y);
    comp_move = true;
    swap(from,to);
    if (abs(from.x-to.x) == 2) {
    remove(from.x+sign(to.x-from.x),from.y+sign(to.y-from.y));
    if ((board[to.x][to.y] == -1) && (to.y == 0)) king_me(to.x,to.y);
    setTimeout("selected_c = coord("+to.x+","+to.y+");piece_toggled = true;",900);
    setTimeout("bak=my_turn;my_turn=false;toggle("+to.x+","+to.y+");my_turn=bak;",1000);
    if (game_over()) {
    setTimeout("comp_move = false;my_turn = true;togglers=0;",600);
    message("Ok. It's your turn. You may make your move.");
    return true;
    function game_over() { // make sure game is not over (return false if game is over)
    comp = you = false;
    for(var i=0;i<8;i++) {
    for(var j=0;j<8;j++) {
    if(integ(board[i][j]) == -1) comp = true;
    if(integ(board[i][j]) == 1) you = true;
    if (!comp) message("You beat me!");
    if (!you) message("Gotcha! Game over.");
    game_is_over = (!comp || !you)
    return (!game_is_over);
    // the higher the jump_priority, the more often the computer will take the jump over the safe move
    var jump_priority = 10;
    function computer() {
    // step one - prevent any jumps
    for(var j=0;j<8;j++) {
    for(var i=0;i<8;i++) {
    if (integ(board[i][j]) == 1) {
    if ((legal_move(coord(i,j),coord(i+2,j+2))) && (prevent(coord(i+2,j+2),coord(i+1,j+1)))) {
    return true;
    } if ((legal_move(coord(i,j),coord(i-2,j+2))) && (prevent(coord(i-2,j+2),coord(i-1,j+1)))) {
    return true;
    } if (board[i][j] == 1.1) {
    if ((legal_move(coord(i,j),coord(i-2,j-2))) && (prevent(coord(i-2,j-2),coord(i-1,j-1)))) {
    return true;
    } if ((legal_move(coord(i,j),coord(i+2,j-2))) && (prevent(coord(i+2,j-2),coord(i+1,j-1)))) {
    return true;
    // step two - if step one not taken, look for jumps
    for(var j=7;j>=0;j--) {
    for(var i=0;i<8;i++) {
    if (jump(i,j))
    return true;
    safe_from = null;
    // step three - if step two not taken, look for safe single space moves
    for(var j=0;j<8;j++) {
    for(var i=0;i<8;i++) {
    if (single(i,j))
    return true;
    // if no safe moves, just take whatever you can get
    if (safe_from != null) {
    move_comp(safe_from,safe_to);
    } else {
    message("You beat me!!");
    game_is_over = true;
    safe_from = safe_to = null;
    return false;
    function jump(i,j) {
    if (board[i][j] == -1.1) { 
    if (legal_move(coord(i,j),coord(i+2,j+2))) {
    move_comp(coord(i,j),coord(i+2,j+2));
    setTimeout("jump("+(i+2)+","+(j+2)+");",500);
    return true;
    } if (legal_move(coord(i,j),coord(i-2,j+2))) {
    move_comp(coord(i,j),coord(i-2,j+2));
    setTimeout("jump("+(i-2)+","+(j+2)+");",500);
    return true;
    } if (integ(board[i][j]) == -1) {
    if (legal_move(coord(i,j),coord(i-2,j-2))) {
    move_comp(coord(i,j),coord(i-2,j-2));
    setTimeout("jump("+(i-2)+","+(j-2)+");",500);
    return true;
    } if (legal_move(coord(i,j),coord(i+2,j-2))) {
    move_comp(coord(i,j),coord(i+2,j-2));
    setTimeout("jump("+(i+2)+","+(j-2)+");",500);
    return true;
    return false;
    function single(i,j) {
    if (board[i][j] == -1.1) {
    if (legal_move(coord(i,j),coord(i+1,j+1))) {
    safe_from = coord(i,j);
    safe_to = coord(i+1,j+1);
    if (wise(coord(i,j),coord(i+1,j+1))) {
    move_comp(coord(i,j),coord(i+1,j+1));
    return true;
    } if (legal_move(coord(i,j),coord(i-1,j+1))) {
    safe_from = coord(i,j);
    safe_to = coord(i-1,j+1);
    if (wise(coord(i,j),coord(i-1,j+1))) {
    move_comp(coord(i,j),coord(i-1,j+1));
    return true;
    } if (integ(board[i][j]) == -1) {
    if (legal_move(coord(i,j),coord(i+1,j-1))) {
    safe_from = coord(i,j);
    safe_to = coord(i+1,j-1);
    if (wise(coord(i,j),coord(i+1,j-1))) {
    move_comp(coord(i,j),coord(i+1,j-1));
    return true;
    } if (legal_move(coord(i,j),coord(i-1,j-1))) {
    safe_from = coord(i,j);
    safe_to = coord(i-1,j-1);
    if (wise(coord(i,j),coord(i-1,j-1))) {
    move_comp(coord(i,j),coord(i-1,j-1));
    return true;
    return false;
    function possibilities(x,y) {
    if (!jump(x,y))
    if (!single(x,y))
    return true;
    else
    return false;
    else
    return false;
    function prevent(end,s) {
    i = end.x;
    j = end.y;
    if (!possibilities(s.x,s.y))
    return true;
    else if ((integ(board[i-1][j+1])==-1) && (legal_move(coord(i-1,j+1),coord(i,j)))) {
    return move_comp(coord(i-1,j+1),coord(i,j));
    } else if ((integ(board[i+1][j+1])==-1) && (legal_move(coord(i+1,j+1),coord(i,j)))) {
    return move_comp(coord(i+1,j+1),coord(i,j));
    } else if ((board[i-1][j-1]==-1.1) && (legal_move(coord(i-1,j-1),coord(i,j)))) {
    return move_comp(coord(i-1,j-1),coord(i,j));
    } else if ((board[i+1][j-1]==-1.1) && (legal_move(coord(i+1,j-1),coord(i,j)))) {
    return move_comp(coord(i+1,j-1),coord(i,j));
    } else {
    return false;
    function wise(from,to) {
    i = to.x;
    j = to.y;
    n = (j>0);
    s = (j<7);
    e = (i<7);
    w = (i>0);
    if (n&&e) ne = board[i+1][j-1]; else ne = null;
    if (n&&w) nw = board[i-1][j-1]; else nw = null;
    if (s&&e) se = board[i+1][j+1]; else se = null;
    if (s&&w) sw = board[i-1][j+1]; else sw = null;
    eval(((j-from.y != 1)?"s":"n")+((i-from.x != 1)?"e":"w")+"=0;");
    if ((sw==0) && (integ(ne)==1)) return false;
    if ((se==0) && (integ(nw)==1)) return false;
    if ((nw==0) && (se==1.1)) return false;
    if ((ne==0) && (sw==1.1)) return false;
    return true;
    message("You may begin! Select a piece to move.");
    my_turn = true;
    // -->
    </SCRIPT>

    Well, you can get a free tutorial to Java at http://www.mindview.net/. It's the "Thinking In Java" book. You can download the whole book from that site, it's about a thousand pages. If you read that whole book, you'll know exactly where to start and probably how to finish it too.
    As a gimmie, think about it -- you'll have to remove all of the browser-detect code, since browser-detection is only done to determine which version of JavaScript is supported by the browser.

  • Is there an easy way to convert a long string into an array?

    I can convert a long string into a 1-d array by parsing and using build array, but I would like to know if there is a function to make this easier.
    For example:
    from/   aaaaaaaabbbbbbbbccccccccdddddddd         (string of ascii)
    to/       an array that is 1-d with each element having eight characters
              aaaaaaaa
              bbbbbbbb
              cccccccc
              dddddddd
    Thank you.
    Solved!
    Go to Solution.

    Try something like this:
    (If you can guarantee that the string length is an integer multiple of 8, you an drop the two triangular modes in the upper left. )
    Message Edited by altenbach on 03-14-2010 06:40 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ChopString.png ‏9 KB

  • Exist an easy way to convert base64 code in XML files into the original image file on forms

    I've made a form in lifecycle that will be distributed by email as a pdf, and submitted back to me as an XML file and then that data imported into the pdf form template to view the data. Issue is I have an "attach image" field on the form and in XML it gets written to a base64 encoded format. Is there convenient way to extract this code from the XML file so that I would have a workable jpeg image file that I can save and open in other apps? Thank you in advance!  -Robert Tampa

    I tried to make John Brinkman's sample working in reverse.
    This script will grab an image field's value and produce an attachment (png-file), which then can be saved to the hard drive.
    //Get Base64 data of the image field
    var b64Data = ImageField1.value.image.value;
    //Convert to a read stream
    var ReadStream = util.streamFromString(b64Data);
    //Decode from Base64
    var DecodedStream = Net.streamDecode(ReadStream, "base64");
    //Attach an empty image file
    event.target.createDataObject("MyExportImage.png", "", "image/png");
    //Update attached image file with stream data
    event.target.setDataObjectContents("MyExportImage.png", DecodedStream);
    //Show attachment pane
    event.target.viewState = {overViewMode:7};
    This works so far, but the produced images are always cutted off.
    No idea what's the reason for this behavior.

  • Is there an easier way to convert files from Windows Media Player to iTunes

    I have many gb's of music in my Windows Media Player...now that I have an ipod I want to move the music over. Do I really have to do this one file at a time or is there away to move over whole albums at once? Is there a way to transfer the entire library at once? Do I have to reload ALL of those CD's? PLEASE HELP !!!!

    Maybe you can help me out too. I have copied over 250 gigs of music in WAV loss less files to windows media player. On media player I see the artist, album etc. However, when I add the file, either as the song or whole album only the track number and song title copy to the itunes. How do I get all the other information like genre, album title, artist. If I convert to applelossless I still do not get anything and when I search AppleSTore for album art nothing happens. Please help.

  • Easier way to convert array to cluster with named variables?

    I have an array of variables, I would like to essentially unbundle that array to named variables.
    I believe the only way of doing this is by converting the array to cluster (besides removing each element one by one)?
    Is what I have done below the best way of doing it? seems a bit weird having to unbundle and rebundle by name.
    comments appreciated.
     

    Your problem code is actually right before the red square. Instead of the "array-to-cluster-unbudle dance", you should simply use a plain index array resized for the same number of outputs. same functionality, less convoluted.
    Your wiring is a bit of a mess and it is hard to tell if the order of elements in the array is the same as in the cluster.  Maybe a simple typecast to the cluster would work.
     

  • I have lots of beta monkey drum loops in WAV format, is there an easy way to convert format for garageband use?

    to convert all these files for garageband use (apple loops)

    You will have to convert them to proper Apple Loops - add tags for key and tempo, category.
    One way to do this would be to use GarageBand to add the wav files to the Loop Library one by one:
    Find out the tempo and the key (if applicable) of one of your loops.
    Set the key and tempo for your project.
    Import a loop to a real instrument track and name the track, select the loop and use the command "Edit > Add to loop library". Set all the tags correctly, so the loopp will be properly indexed.
    There used to be a SoundTrack Loop Utility, but I am not sure if it is still available somewhere. My old links don't work anymore.
    Regards
    Léonie

  • Easier Way to convert Hex to Integer

    This problem is mainly to do with a hex string to integer conversion.  The device, connected via serial connection outputs hex in the format 0A00, when looking at it in hex.  The first two digits are the data, the last two are attached to seperate data points.  what I'm trying to do is to raster the last 2 digits off so that 2A00 becomes 2A and then convert the 2A into integer format (42).  I have come up with a method to do this, but it is very messy and occasionally results in data loss.  I have attached my vi (8.2).  The large integer being subtracted is a constant that continues to come up for reasons I am not aware of.
    another issue which I am coding through is the fact that sometimes a byte slips by, making 2A00 become 00BB or something of that format.  Is there a way to scan the string, determine whether the first two digits or the last two digits are the valid ones and then seperate the valid string?  In this code, it would be necessary to allow for the value 0000 to read 0.
    If there is confusion, here is some examples of incoming data and desired output
    0100 - 1
    0A00 - 10
    0005 -5
    000B - 11
    etc.
    Solved!
    Go to Solution.
    Attachments:
    geiger read.vi ‏28 KB

    Since you are reading 2 bytes, it looks like you should be dealing with a 16 bit number. Typecast to U16 rather than I32 like you are doing now. And all of that string manipulation make it look like you are getting a string of ASCII formatted characters like "0" "A" "1" "B" rather than a 2 byte string of ASCII characters 0A and 1B. Then you can split the U16 number and take the higher order byte.
    I can't explain why you would be having a byte slip by unless it has something to do with all that string manipulation you are trying to do.  But if it still happens, and you know one byte for the other is always zero.  Just take the high order byte and add it to the low order byte.  Since one is zero, it will have no effect on the other byte.
    Message Edited by Ravens Fan on 07-07-2009 01:54 PM
    Attachments:
    geiger%20read[1]_BD.png ‏3 KB

  • Is there an easier way to convert bytes into bit(boolean) arrays?

    I am currently using this method to convert bytes into bit arrays:
    /*convert byte to int such that it is between 0-255 this is the bytes[] array
                        if ((bytes/128)==1)
                             bit[c+0]=true;
                        else
                             bit[c+0]=false;
                        if ((bytes[i]-bitInt[c+0]*128)/64==1)
                             bit[c+1]=true;
                        else
                             bit[c+1]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64)/32==1)
                             bit[c+2]=true;
                        else
                             bit[c+2]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32)/16==1)
                             bit[c+3]=true;
                        else
                             bit[c+3]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16)/8==1)
                             bit[c+4]=true;
                        else
                             bit[c+4]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8)/4==1)
                             bit[c+5]=true;
                        else
                             bit[c+5]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8-bitInt[c+5]*4)/2==1)
                             bit[c+6]=true;
                        else
                             bit[c+6]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8-bitInt[c+5]*4-bitInt[c+6]*2)==1)
                             bit[c+7]=true;
                        else
                             bit[c+7]= false;

    You can loop through and use a bitwise operator instead. Here is an example without the loop.
    byte b = 6 ;
    if( b & Math.pow( 2, 0 ) == Math.pow( 2, 0 ) ) ;
    // the 2^0 bit is on
    if( b & Math.pow( 2, 1 ) == Math.pow( 2, 1 ) ) ;
    // the 2^1 bit is onetc...
    You should get something like 110 when you're done.
    If you're wonder what & does (no, its not a boolean &&), it takes the bits in the two numbers you give it and returns a number with all the bits on that are on for each of them.
    For example:
    10011011 &
    11001101 =
    10001001
    So if we take
    110 (6) &
    010 (2^1, or 2) =
    010 (2 again)
    Which means that the number (6) has the 2^1 bit on.

  • Best way to convert InDesign stories to text doc?

    Is there a fast, easy way to convert multiple stories in ID to one RTF or Word document?
    I do quarterly publications that are composed of dozens (sometimes hundreds) of individual text frames, tables and graphics. The text comes from numerous sources. Before each new issue, the contributors need their pages from the previous issue in an editable format (MS Word) which they revise and send back to me.
    I've been spending hours copying and pasting each story into a Word Doc for each contributor. This has given me the most accurate results, but it's incredibly tedious and time consuming. And the tables always need to be cleaned up and reformatted in Word.
    I've also tried using the script to export all stories, but then I wind up with a bazillion small files. (Is there a way to combine them into one file?)
    I've also tried saving the PDF as a Word doc or RTF file, but there is too much editing required to make it presentable.
    Any suggestions or tips are greatly appreciated!!

    you can try my Export Import InDesign Texts for ID CS1 and CS2:
    http://www.adobescripts.com/search.php?query=export+indesign+texts&action=results
    let me know if you need it for ID CS3
    robin
    www.adobescripts.com

  • Is there an easy way to remove duplicates in my library?

    Hi there, since I first started using my ipod, I've had a new laptop. Having finally figured out (with your help!) how to move the songs from my ipod to the library on my new laptop, I did the transfer but it's duplicated loads of the tracks.
    Is there an easy way to remove them/stop that from happening?
    Any suggestions? Ta Legs xxx

    You'll find a script here.
    http://home.comcast.net/~teridon73/itunesscripts/index.html

  • Any easy way to parse string to date?

    I need get data from process instance and pass it to web service.
    The process instance is xmlObject and one field is date type. The value read from xmlObject is "2011-09-13T20:10:00Z"
    Is there any easy way to convert it to Date?
    Thanks,

    Hi
    Use date format to convert the string to date
    Example:
    String dateString = "Nov 4, 2003 8:14 PM";
    DateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);
    Java.Util.Date date = format.parse(dateString);
    display("Formated Date: " + date);
    Bibhu

Maybe you are looking for

  • Time Machine/Migration Assistant issues

    I just bought a MacBook Pro, and my old computer is a PowerBook G4. I did a Time Machine backup of my old computer onto an external hard drive, then used Migration Assistant to transfer the Time Machine backup from the external drive to my new comput

  • Issue with Java script associated with WAD template

    Hi Experts, I made some changes in the Java Script in Tcode SE80. I actually downloaded it, made changes, saved it and then clicked on Upload and replace in SE80. When I opened the Web cockpit, the changes were relecting as anticipated. But the chang

  • Too many hops

    I have yet another problem. I have groupwise 7.0.4 running on windows 2003. everything is running great. But when i send mail, it sends me the mail back to me saying "too many hops". I think this means that its connected to the internet but it can't

  • My EBAY app has disappeared, but when I go to App Store, it is already installed but won't open

    My EBAY app has dissappeared from my screen. It is already installed, but it won't open (in App Store).  How do I get it back?

  • Disable email appearing in messages list?

    Is there is a way to disable the types of alerts/messages in the Message list?