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.
 

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.

  • Array of Cluster with event structure

    Hi,
    I am having Array of cluster with cluster having 1 String Control , 1 Combo box, 1 Led control and 2 Numeric control. In the combo box i am having two options to select ('Binary' and 'PWM').Whenever Binary is selected then Led control has be enabled and whenever PWM is selected 2 Numeric control has to be enabled.
    Is there any way to do this??
    Pleas help me...
    Regards
    Meenatchi

    actually in my application, the front panel has to have 16 rows of controls (1 string control, 1 combo box, 1 Led control, 2 numeric control).so i planned to keep all those controls in a cluster and create one array.If i didnt so i will have 16x5 controls in my front panel and i have to put 16 event cases for each combo box to do the enable and disable of controls..
    is there any simple way to do this..i have attached my front panel view
    Attachments:
    Untitled10.vi ‏139 KB

  • Write 1d array of cluster with 2 elements to file

    HI!
    I'm new at LabView so I hope the question is very simple to you:
    I am using a waveform graph to display several measurements.
    Now I want to save these Measuremens. The data are stored in 1d array of cluster with 2 elements.
    What is the easiest way to do this??
    Thanks

    If you are already using waveforms you can simply wire right up to "Write Waveforms to File.vi" in the Waveform palette under Waveform File I/O.
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

  • Question: Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages? - Problem: I have 1400 e-mails with attachments that need to be conv

    Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages?
    - Problem: I have 1400 e-mails with attachments that need to be converted into pdf and the attachments cannot be embeded.
    System: PC Windows 7 using Acrobat X Prof. - Thank you!

    Hi ,
    There is an option of embedding index for faster search while converting email to a PDF .
    However I am not sure that will serve your purpose or not .
    I would recommend you to get in touch with Microsoft support as well .
    Meanwhile I'll work on it and get back to you in case I get a desired solution .
    Regards
    Sukrit Dhingra

  • Write an 1d-array of cluster with 3 elements

    Hi,
    I have to make a "Power spectral densities" analyse from my waveform data. The results from this VI is an array of cluuster with 3 elemments. Now I want to write this array of cluster with 3 elements to a file. And later it must be able to use this file with EXCEL!!
    thanks

    Hi
    I found some outer Forum entries about this topic.
    Look at this links:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=49553&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=51526&requireLogin=False
    I hope this helps
    Manuel

  • How can I write a 1d array of cluster with 3 elements to a file?

    Hi,
    I have to make a "Power spectral densities" analyse from my waveform data. The results from this VI is an array of cluuster with 3 elemments. Now I want to write this array of cluster with 3 elements to a file. And later it must be able to use this file with EXCEL!!
    thanks

    Hello schloronzo,
    make a for loop feeded with your array. Inside the for loop unbundle
    the cluster, "format into string" the 3 values, adding the result to
    the ones before and collect them in a shift register. Then save the
    resulting string to a txt-file. If you make a good format string then
    Excel is able to read your txt-file (use tab a separator and CR/LF
    after each 3 values aka "csv format").
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • 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.

  • Array to cluster with adjustable cluster size

    Hi all
    Here I have  a dynamic 1D array and I need to convert it into cluster. So I use Array to Cluster function. But I notice that the cluster size is a fix value. How can I adjust the cluster size according to the 1D array size?
    Anyone pls give advise..
    Thanks....

    I won't disagree with any of the previous posters, but would point out a conversion technique I just recently tried and found to work well for my own particular purposes.  I've given the method a pretty good workout and not found any obvious flaws yet, but can't 100% guarantee the behavior in all settings.
    Anyhow, I've got a fairly good sized project that includes quite a few similar but distinct clusters of booleans.  Each has been turned into a typedef, complete with logical names for each cluster element.  For some of the data processing I do, I need to iterate over each boolean element in a cluster, do some evaluations, and generate an output boolean cluster.  I first structured the code to use the "Cluster to Array" primitive, then auto-index over the resulting array of booleans, perform the evaluations and auto-index an output array-of-booleans, then finally convert back using the "Array to Cluster" primitive.  I, too, was kinda bothered by having to hardcode cluster sizes in there...
    I found I could instead use the "Typecast" primitive to convert the output array back to my cluster.  I simply fed the input cluster into the middle terminal to defin! the datatype.  Then the output cluster is automatically the right size and right datatype.
    This still is NOT an adjustable cluster size, but it had the following benefits:
    1. If the size of my typedef'ed cluster changes during development by adding or removing boolean elements, none of the code breaks!  I don't have to go searching through my code for all the "Array to Cluster" primitives, identifying the ones I need to inspect, and then manually changing the cluster size on them one at a time!
    2. Some of my processing functions were quite similar to one another.  This method allowed me to largely reuse code.  I merely had to replace the input and output clusters with the appropriate new typedef.  Again, no hardcoded cluster sizes hidden in "Array to Cluster" primitives, and no broken code.
    Dunno if your situation is similar, but it gave me something similar to auto-sizing at programming time.  (You should test the behavior when you feed arrays of the wrong size into the "Typecast" primitive.  It worked for my app's needs, but you should make sure it's right for yours.)
    -Kevin P.

  • 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?

  • 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 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).

  • How to set multple values in cluster with local variable?

    Hello all,
    Ok, I've made my way through Labview for everyone, and have some basic concepts down. I can see with a cluster, if acting directly upon it, you can unbundle, change values, rebundle, etc.
    I'm trying something a bit more complex...and just not sure how to get started on this.
    I have a drop down menu ring. I have set this up as a typedef, with 4 values.  I have used this typedef 7 times, plus some LED bools, in a cluster. I have made this cluster a typedef.
    So, in my main vi I"m starting to design, I've set up an example posted here....and in it, I have two instantiations of the cluster typedef, Left Selector and Right Selector.
    I have dropped into this vi, a copy of the menu ring typedef (same typedef as in the clusters, same values)....called reset all tubes.
    I'm trying now, to figure out how, with an event on the change of value for 'reset all tubes'....that I can start with the left selector, and change all the tubes (these are the menu ring selector)  to the same value as what has been selected with the 'reset all tubes' menu ring.
    I've created a local variable for the left selector. It is set to read values. (I'll be doing the same with the right one too, but just starting with the left).
    In examples I've seen where directly accessing a cluster, you could unbundle the cluster...loop through and change the values...maybe pull out all of the 'tubes' into an array and move through that to update the values.  And when you bundle or unbundle the cluster...you can see the values, etc, when you stretch them out on the block diagram.
    With the local variable..I can't see to 'stretch' it out like I was expecting..so I can access the values for the 'tubes'...and set them all to the value of the 'reset all tubes' ring menu value.
    Can someone put me on the path on the best way to do this....or is there a structure of component I'm missing here ?  Am I on the right track to begin with here?
    This would seem pretty basic to me, but I'm just missing something here on how to start...
    Thank you in advance,
    cayenne
    Solved!
    Go to Solution.
    Attachments:
    example_select_dropdown.ctl ‏5 KB
    public_selector_cluster.ctl ‏6 KB
    laptop_test_public.vi ‏12 KB

    nathand wrote:
    You can't do this with a for loop the way the cluster is structured, but why make it so complicated?  Just bundle the new value into the cluster as shown below:
    If you do want to use a for loop, consider restructuring your cluster.  Group the ring and a boolean into a cluster, then drop 7 of those into the selector cluster.  Then you can use "cluster to array" and "array to cluster" since all elements in the outer cluster will be of the same type.
    Also, be careful using rings as type definitions.  You probably want to use an enumeration instead.  The items in a ring do not update when you update the type definition because they're considered to be cosmetic; the items in an enumeration type definition do update, because the items in an enumeration are considered part of the data type.
    Oh my goodness!!
    What was MUCH easier than I was trying to make it!!
    I was attempting to do this reset, in an incremental fashion, as that later, I'm going to need to change values in this cluster by individual elements....and was using this as a way to try to understand how to iterate between cluster elements, and change the values of each one.
    This solution works much better for this 'reset' all solution.
    One question on this....with regard to the enum vs the ring menu.
    I was actually going to go with the enum, however, I could not find a way to make it LOOK like the ring menu...with the arrow to the side that a user would know to click to present the menu list of choices.
    I see with the enum, that you can remove the increment/decrement indicator.....and if the user clicks the control, it will indeed pop up a menu of choices...but there is no 'arrow' on that control to indicate to the user that it is a menu choice there.....
    Is there a way to make and enum look like a ring with the "drop down menu" control look?
    Again, thank you !!
    This helps!
    C

  • Can we install a new mssql cluster on the same windows cluster which already containes a mssql cluster with named instance

    We have a MSSQL 2008R2 Enterprise edition with a two node active passive fail-over cluster running on 2008R2 windows cluster with out any issues,
    Now my question is can we add one more MSSSQL cluster instance for the same setup with out disturbing the existing one ?
    Also give thoughts on load sharing as the second node is mostly ideal now except fail-over scenarios,
    Why we go for this situation is because of the collation setting which can be set only one per instance(Database collation setting change not working), we need a different default collation for the new setup

    hi,
    >>Now my question is can we add one more MSSSQL cluster instance for the same setup with out disturbing the existing one ?
    Yes it is possible .You need to add new drives as cluster aware and install SQL server and put data and log files on thse drives.YOu would need to create named instance of SQL server and need to create different resource group.Both old installation and new
    onw would work separately.
    >>Also give thoughts on load sharing as the second node is mostly ideal now except fail-over scenarios,
    Good point indeed.You are about to create Multi instance cluster and should plan for scenario where one node is down and other node is handling load for both instances.Memory and CPU should be enough to handle the load.
    >>Why we go for this situation is because of the collation setting which can be set only one per instance(Database collation setting change not working), we need a different default collation for the new setup .
    Just for collation if you are installing new instance seems little wierd to me.You can manage collation at column ,database and at server level.
    http://technet.microsoft.com/en-us/library/aa174903(v=sql.80).aspx
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • 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

Maybe you are looking for