User selects a SWF and stuff data into an Image

In my app user can upload an image, but if they select a SWF with FileReference, my code tries to stuff the data into an Image and in Internet Explorer screen goes black and IE hangs, Firefox just hangs.
Any ideas?
BTW, the SWF they upload might be corrupt.

Mike. I've created a quick VI that may do want you want. The only problem arises when a pattern is rotated and you try to extract it. Since you can't build an image that isn't rectangular, I had to extract the rectangle that surrounds the pattern.
Please let me know if you have any other questions.
Kyle V
Applications Engineer
National Instruments
www.ni.com/ask
Attachments:
Extract_Match.zip ‏1099 KB

Similar Messages

  • Please recommend if we have options to read xml file and insert data into table without a temporary table.

    Please recommend if we have options to read xml file and insert data into table without a temporary table. 

    DECLARE @data XML;
    SET @data =N'<Root>
    <List RecordID="946236" />
    <List RecordID="946237" />
    <List RecordID="946238" />
    <List RecordID="946239" />
    <List RecordID="946240" />
    </Root>'
    INSERT INTO t (id) SELECT T.customer.value('@RecordID', 'INT') AS id
    FROM @data.nodes('Root/List')
     AS T(customer);
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Drop, create and insert data into few intermediate tables

    Hi All,
    I need to schedule a process to drop, create and insert data into few intermediate tables on a weekly basis. Here is what i need to do in the stored procedure, which can be scheduled weekly.
    DROP TABLE TABLE_NAME1;
    DROP TABLE TABLE_NAME2;
    DROP TABLE TABLE_NAME3;
    CREATE TABLE TABLE_NAME1
    CREATE TABLE TABLE_NAME2
    CREATE TABLE TABLE_NAME3
    INSERT INTO TABLE_NAME1 SELECT ....;
    INSERT INTO TABLE_NAME2 SELECT ....;
    INSERT INTO TABLE_NAME3 SELECT ....;
    Any suggestions, examples or code on how to accomplish this task would be very helpful. Any question pls let me know.
    Thanks in advance.

    I am using the intermediate tables in an extract process. The idea was that the table would be created prior to calling the extract procedure and once the data written to the intermediate table had been processed the table would be dropped. This would be repeated each time the extract process is run. From a DBA's point or view, would it be better to just leave the table on the database and truncate it after each run or is removing it entirely best?

  • Reading file and dump data into database using BPEL process

    I have to read CSV files and insert data into database.. To achieve this, I have created asynchronous bpel process. Added Filed Adapter and associated it with Receive activity.. Added DB adapter and associated with Invoke activity. Total two receive activity are available in  process, when tried to Test through EM, only first receive activity is completed, and waiting on second receive activity. Please suggest how to proceed with..
    Thanks, Manoj.

    Deepak, thank for your reply.. As per your suggestion I created BPEL composite with
    template "Define Service Later". I followed below steps, please correct me if I am wrong/missing anything. Your help is highly appreciated...
    Step 1-
    Created File adapter and corresponding Receive Activity (checkbox create instance is checked) with input variable.
    Step 2 - Then in composite.xml, dragged the
    web service under "Exposed Services" and linked the web service with Bpel process.
    Step 3 - Opened .bpel file and added the DB adapter with corresponding Invoke activity, created input variable. Web service is created of Type "Service" with existing WSDL(first option aginst WSDL URL).
    and added Assign activity between receive and invoke activities.
    Deployed the composite to server, when triedTest it
    manually through EM, it is promting for input like "subElmArray Size", then I entered value as 1 with corresponding values for two elements and click on Test We Service button.. Ptocess is completing in error. The error is
    Error Message:
    Fault ID
    service:80020
    Fault Time
    Sep 20, 2013 11:09:49 AM
    Non Recoverable System Fault :
    Correlation definition not registered. The correlation set definition for operation Read, process default/FileUpload18!1.0*soa_3feb622a-f47e-4a53-8051-855f0bf93715/FileUpload18, is not registered with the server. The correlation set was not defined in the process. Redeploy the process to the containe

  • Header data and item data into same internal table

    Hi Experts,
    I WANT TO KNOW THE LOGIC TO POPULATE HEADER DATA AND ITEM DATA INTO SAME INTERNAL TABLE AND AGAIN DOWNLOAD THE SAME TO EXCEL FILE .Output file should be displayed like this format
    Header1  rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
    Item1  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Item2  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Header2: rectyp ,hdnum ,sbank ,bankl ,accnr , paytp , crda ,iso.
    Item1  : rectyp ,valut ,cknum ,amount,bankl,accnr,pdate,bnktc.
    Thanks
    Moderator message: Please do not use all upper case in the future.
    Edited by: Thomas Zloch on May 12, 2010 3:10 PM

    Hi,
    for example we have 3 internal tables 
    1> it_header  2>it_items   3>it_final (which contains all the header and item fields)
    once  it_header   it_items  are filled
    loop at it_items.
    read table it_header with key xyz = it_item-xyz.
    if sy-subrc = 0.
      here move all the header fields to it_final like below.
    it_final -xfield  = it_header-xfield.
    endif.
      here move all the item fields to it_final like below.
    it_final -yfield  = it_item-yfield.
    append it_final.
    clear it_final.
    endloop.
    now header and item fileds will be fillled in it_item

  • How can FMS create a text file and write data into it in the Server application folders?

    Recently, I writed a programe about creating a text file and writing data into it in the server application folder. My code is as following:
               var fileObj = new File("/MyApp/test.txt");
               if( fileObj !=  null)
                      if(fileObj.open( "text", "append"))
                            fileObj.write( "                                                      ———— Chat Info Backup ————\r\n" );
                            fileObj.close( );
                            trace("Chat info backup document :" +  fileObj.name + " has been created successfully!");    
    But when I run it, FMS throw the error as following: File operation open failed  ;  TypeError: fileObj has no properties.
    Can you help me ? Thanks in advance.
    Supplement: The text file named test.txt doesn't exist before create the fileObj, an instance of File Class.

    Is MyApp the name of the application directory, or is it a child of the application directory? If myApp is the app name, just use test.txt as the path flag in the file constructor.

  • How to activate another worksheet in excel file and write data into it

    Hi,
    I am writing an automation program to collect test data and write the data to an excel file.
    The excel file has several worksheets and now I can only write data to one sheet. Can anyone please let me know how to activate another worksheet and write data into it? Thank you very much.

    You can do a search in the Example Finder for more Excel VIs.
    They will give you a clearer idea of how to go about doing things in the way you need.
    - Partha
    LabVIEW - Wires that catch bugs!

  • Get a portion of a CGPDFPage and put it into an image context

    I would to take a rect portion of a CGPDFPage and draw it into an image context (in fact the second step is to try to upscale the portion but that's another problem right now).
    This is my code. It works fine, the correct rect is taken but... it's placed at the same location inside the final image. So if I try to take (x1,y1,w,h) from pdf the result image portion will be draw at x1,y1,w,h and not at 0,0,w,h.
    Any idea?
    -(UIImage *) zoomedPDFImageAtPoint:(CGPoint) point size:(CGSize) thumbsize{
    CGRect pdfcropBox = CGPDFPageGetBoxRect(myPageRef, kCGPDFCropBox);
    NSLog(@"x:%0.f,y:%0.f w:%0.f,h:%0.f",point.x,point.y,thumbsize.width,thumbsize.height);
    UIGraphicsBeginImageContext(thumbsize);
    CGContextRef context = UIGraphicsGetCurrentContext();
    int scale = 1;
    CGContextTranslateCTM(context,0,pdfcropBox.size.height);
    CGContextScaleCTM(context, scale, -scale);
    CGContextSaveGState(context);
    CGAffineTransform m = CGPDFPageGetDrawingTransform (myPageRef,kCGPDFCropBox, pdfcropBox, 0, true);
    CGContextConcatCTM (context, m);
    CGPoint correctpoint = CGPointMake(point.x-(thumbsize.width/2.0),pdfcropBox.size.height-point.y-(thumb size.height/2.0));
    CGRect therect = CGRectMake(correctpoint.x,correctpoint.y, thumbsize.width, thumbsize.height);
    CGContextClipToRect (context, therect);
    CGContextDrawPDFPage(context, myPageRef);
    CGContextRestoreGState(context);
    UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    [ UIImagePNGRepresentation(resultingImage) writeToFile:@"/Users/malcom/Desktop/file.png" atomically:NO];
    return resultingImage;
    }

    This work fine to get the portion.
    The problem of this code is that does not support scaleFactor. The idea is to scale the CTM of the context by scaleFactor: so my pointOfClick will be multipled by scaleFactor and the same with pageRect. However the result is a blank page.
    -(UIImage *) zoomedPDFImageAtPoint:(CGPoint) pointOfClick size:(CGSize) resultImageSize scale:(CGFloat) scaleFactor {
    // get the rect of our page
    CGRect pageRect = CGPDFPageGetBoxRect(myPageRef, kCGPDFCropBox);
    // my thumb rect is a portion of our CGPDFPage with size as /scaleFactor of resultImageSize
    // then we need to scale the image portiong by *scaleFactor and draw it in our resultImageSize sized graphic context
    CGSize myThumbRect = resultImageSize;
    // page rect has size as original size * scaleFactor
    //resultImageSize = pageRect.size; // togliere
    pointOfClick = CGPointMake(-pointOfClick.x, -pointOfClick.y);
    NSLog(@"Click (%0.f,%0.f) Page (%0.f,%0.f ; %0.f,%0.f)",pointOfClick.x,pointOfClick.y,pageRect.origin.x,pageRect.origin.y,p ageRect.size.width,pageRect.size.height);
    // create a new context for resulting image of my desidered size
    UIGraphicsBeginImageContext(resultImageSize);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextSaveGState(ctx);
    // because rect is that for drawing in a flipped coordinate system, this translate the lower-left corner of the rect
    // in an upright coordinate system
    CGContextTranslateCTM(ctx, CGRectGetMinX(pageRect),CGRectGetMaxY(pageRect));
    // scale to flip the coordinate system so that the y axis goes up the drawing canvas
    CGContextScaleCTM(ctx, 1, -1);
    // translate so the origin is offset by exactly the rect origin
    CGContextTranslateCTM(ctx, -(pageRect.origin.x), -(pageRect.origin.y));
    // zoomRect is interested region.the clickPoint is the center of this region
    CGRect zoomedRect = CGRectMake(-pointOfClick.x, (pageRect.size.height-(-pointOfClick.y)),myThumbRect.width,myThumbRect.height);
    zoomedRect.origin.y-=(myThumbRect.height/2.0);
    zoomedRect.origin.x-=(myThumbRect.width/2.0);
    NSLog(@"Zoom region at (%0.f,%0.f) (%0.f,%0.f)",zoomedRect.origin.x,zoomedRect.origin.y,zoomedRect.size.width,zoom edRect.size.height);
    // now we need to move clipped rect to the origin
    // x: x was moved subtracting current click x coordinate and adding the half of zoomed rect (because zoomedRect contains pointsOfClick at it's center)
    // same with y but inverse (because ctm is flipped)
    CGPoint translateToOrigin = CGPointMake(pointOfClick.x+(zoomedRect.size.width/2.0), -pointOfClick.y-(zoomedRect.size.height/2.0));//(pageRect.size.height-zoomedRec t.size.height)+pointOfClick.y);
    NSLog(@"Translate zoomed region to origin using translate by (%0.f,%0.f)",translateToOrigin.x,translateToOrigin.y);
    CGContextTranslateCTM(ctx, translateToOrigin.x,translateToOrigin.y);
    CGContextClipToRect (ctx, zoomedRect);
    // now draw the document
    CGContextDrawPDFPage(ctx, myPageRef);
    CGContextRestoreGState(ctx);
    // generate image
    UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    [ UIImagePNGRepresentation(finalImage) writeToFile:@"/Users/malcom/Desktop/file.png" atomically:NO];
    return finalImage;
    }

  • How to get new and updated data into LO Excel in Xcelsius

    Dear Experts,
    I have created dashboard on top of webi report by using Live-Office connection. Latest data of webi report is imported into excel and mapped data with components and generated SWF file and exported into server.
    To day my webi report has latest instance with new and updated data. But until unless by clicking "Refresh All Objects" i am not getting updated data into excel.
    When i am trying to open dashboard in BI Launch Pad/CMC it is showing data whatever exist in excel(i.e yesterday data). But here we need to show data of latest instance of webi report.(i.e New and updated data as of now).
    I have selected option "Latest instance: From latest instance scheduled by" in "refresh options".
    My Question & Doubts:
    1) Is it mandatory to open dashboard every day and need to click on "Refresh All Objects" to get updated data into excel or dashboard.
    2) Is there any option to automate this process.
    Regards,
    PRK.

    Hi,
    Schedule the webi report to get the latest data from the source. To answer your query no is doesn't require to open the dashboard every time to refresh the excel to get the latest data.
    Please use the Refresh Before Components are Loaded: Select this option to refresh the data each time the model loads and to use that data as the initial data for the model (using a Reset Button component, it will reset the data to the values from the last time the model was loaded).
    You are using the Live Office  so here automatic refresh is not possible without touch the swf file, you need to use the refresh but to get the latest data. If you are using QAAWS, Web Service & XML then automatic refresh is possible.
    For more information please check the below document for in-depth idea on the design pattern.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b02e31fb-3568-2e10-e78f-92412c3c0a96?overridelayout=t…
    Kindly revert for more clarification!!!
    --SumanT

  • How Do I Filter a Report Using a Multi Select List Box and Specifying Date Between Begin Date and End Date

    Hope someone can help.  I have tried to find the best way to do this and can't seem to make sense of anything.  I'm using an Access 2013 Database and I have a report that is based on a query.  I've created a Report Criteria Form.  I
    need the user to be able to select multiple items in a list box and also to enter a Begin Date and End Date.  I then need my report to return only the records that meet all selected criteria.  It works fine with a ComboBox and 1 selection but can't
    get it to work with a List Box so they can select multiple items.  Any help is greatly appreciated while I still have hair left. 

    The query should return all records.
    Let's say you have the following controls on your report criteria form:
    txtStart: text box, formatted as a date.
    txtEnd: text box, formatted as a date.
    lbxMulti: multi-select list box.
    cmdOpenReport: command button used to open the report.
    The text boxes are used to filter the date/time field DateField, and the list box to filter the number field SomeField.
    The report to be opened is rptReport.
    The On Click event procedure for the command button could look like this:
    Private Sub cmdOpenReport_Click()
    Dim strWhere As String
    Dim strIn As String
    Dim varItm As Variant
    On Error GoTo ErrHandler
    If Not IsNull(Me.txtStart) Then
    strWhere = strWhere & " AND [DateField]>=#" & Format(Me.txtStart, "yyyy-mm-dd") & "#"
    End If
    If Not IsNull(Me.txtEnd) Then
    strWhere = strWhere & " AND [DateField]<=#" & Format(Me.txtEnd, "yyyy-mm-dd") & "#"
    End If
    For Each varItm In Me.lbxMulti.ItemsSelected
    strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    Next varItm
    If strIn <> "" Then
    ' Remove initial comma
    strIn = Mid(strIn, 2)
    strWhere = strWhere & " AND [SomeField] In (" & strWhere & ")"
    End If
    If strWhere <> "" Then
    ' Remove initial " AND "
    strWhere = Mid(strWhere, 6)
    End If
    DoCmd.OpenReport ReportName:="rptMyReport", View:=acViewPreview, WhereCondition:=strWhere
    Exit Sub
    ErrHandler:
    If Err = 2501 Then
    ' Report cancelled - ignore
    Else
    MsgBox Err.Description, vbExclamation
    End If
    End Sub
    If SomeField is a text field instead of a number field, change the line
            strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    to
            strIn = strIn & "," & Chr(34) & Me.lbxMulti.ItemData(varItm) & Chr(34)
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to Create a Rich Dynamic Input and Output PDF to insert and get data into, from Database (MSSQL)

    HI ,
    I want to use Adobe LiveCycle Designer and Adobe LiveCycle Workbench features to create a Dynamic PDF form which can allow me to store data into database(MSSQL Server) and Can also provide me the Output PDF form with all the information which has been been filled in by the User in input form. Both Input and Output forms must be Dynamic. I am stuck in this process and Need Experts Advice on the Complete optimal process flow of the Adobe.
    Regards
    Ritesh Grover

    HI
    Go to the lay out of your screen and doublr click on the table control fields, you can get the Properties/Attribute of the screen or table control Fields
    Assing a Group GRP1 for all the fields i n the table control.
    in PBO
    if ok_code = 'INPUT'.
    LOOP AT SCREEN.
    IF screen-grp1 = 'GRP1'.
    screen-input = 1.
    modify screen.
    endif.
    ENDLOOP.
    elseif ok_code = 'OUTPUT'.
    LOOP AT SCREEN.
    if screen-grp1 = 'GRP1'.
    screen-input = 0.
    modify screen.
    endif.
    endloop.
    endif.
    Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Aug 8, 2009 5:27 AM

  • Getting Data from Structure and Store Data into Table using Function Module

    Hello...
    we are created a function module to import 2 structures in the systems and want to read the data from the structure into a customized table when the fucntion module is called. However, whenever the function module is run, we only managed to have one data into the customized table whereas the actual results is that there will be a few records in this customized table.

    Hi,
    It should be something like this...
    TABLES ZRESMORT.
    DATA E_ZRESMORT TYPE STANDARD TABLE OF ZRESMORT WITH HEADER LINE.
    SELECT * FROM ZRESMORT.    <=====================
      DELETE ZRESMORT.              <==================  It is deleting all the records in your Z table
    ENDSELECT.    <===============================
    Loop at I_CKF_CONTRACT.  " Assuming this is the Main Table
    Read table I_CKF_PROCESS with key ." Here you will read this table to get the corresponding records of Table I_CKF_CONTRACT
    E_ZRESMORT-MORT_FT_ID  = I_CKF_CONTRACT-COMMON-CONTRACT_ID_EXT.
    E_ZRESMORT-MORT_KDATE  = I_CKF_PROCESS-TECHNICAL-KEY_DATE.
    E_ZRESMORT-MORT_TSTAMP = I_CKF_PROCESS-TECHNICAL-TIMESTAMP.
    E_ZRESMORT-MORT_FLAG   = 1.
    E_ZRESMORT-MORT_BUPA   = I_CKF_CONTRACT-BUPA-BUSINESS_PARTNER_ID.
    E_ZRESMORT-MORT_PORTFO = I_CKF_CONTRACT-BUPA-PORTFOLIO_CAT.
    E_ZRESMORT-MORT_FT_ID_DUM  = I_CKF_CONTRACT-COMMON-CONTRACT_ID.
    INSERT INTO ZRESMORT VALUES E_ZRESMORT.
    IF SY-SUBRC EQ 0.
    ENDIF.
    endloop.

  • Using .csv file and adding data into database

    hi,
    i'm working on a project which shows all the share prices on a webpage from the FTSE100..
    my problem is..i connect to yahoo.co.uk to get my share price information which is updated every 15mins..they return a .csv file to me...at the moment, i am just printing the information onto my website, but is there any way that i could store this information into a database if i needed the data to be used elsewhere...thanx for the help in advance

    below is my code which i used to get my info onto the web...i'd just like to know how i would use this to store the data into a database..
    import java.net.*;
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class SharePrice
         private String line;
         private int maxShares = 101;//maximun shares a user can have
         private int details = 5;//five details, name,date,time,price,change.
         public String [][] shareData = new String[maxShares][details];
    public SharePrice(String [] shares) throws Exception
              getShare(shares);
         //returns a double array containing share data of each share as a seperate row in the array
    public String [][] getShare(String [] sh) throws Exception
                   for(int i=0; i<sh.length; i++)
                        //if the entry is null we have reached the end of the array
                        if(sh!=null)
                             String share = sh[i];
                             //part of url of the resource
                             String address ="http://uk.finance.yahoo.com/d/quotes.csv?s=";
                             //adds the share tothe url so that particular shares data is retieved
                             address = address+share;
                             System.out.println(address);
                             try
                                  //connection is created to the resource and input stream opened to read data
                                  URL url = new URL(address);
                                  BufferedReader in = new BufferedReader(
                                            new InputStreamReader(
                                            url.openStream()));
                                  line = in.readLine();
                                  in.close();
                             }catch(Exception e){System.err.println("Exception: " + e.getMessage());
                                  e.printStackTrace();}
                             //the line of data retrieved is spli and placed in a single row of the array
                             //beause the each piece of data is seperated by commas it is easily seperated.
                             StringTokenizer t = new StringTokenizer(line, ",");
                             int count = t.countTokens();
                             System.out.println(" count= "+count);
                             while(t.hasMoreTokens())
                                  for(int j=0; j<count; j++)
                                       String s = t.nextToken();
                                       shareData[i][j] = s;
              return shareData;

  • Reading file from ftp server and importing data into table

    Hi experts,
    Well basically i have text files with different layout that have been uploaded on an ftp server. Now i have to write a procedure to fetch those files, read them and insert data in a table... can that be done?
    your precious help would be greatly helpful.
    Thanks

    declare
    file1 UTL_FILE.FILE_TYPE;
    filename varchar2(1000) := 'GTECHFILES';
    str long;
    begin
    file1 := UTL_FILE.FOPEN (filename,'agent_dump_csv.rep','r',32767);
    loop
    UTL_FILE.GET_LINE ( file1, str );
    --dbms_output.put_line('Value is :'||to_char(str));
    end loop;
    UTL_FILE.FCLOSE( file1 );
    exception
    when no_data_found then
    dbms_output.put_line('END OF FILE');
    UTL_FILE.FCLOSE( file1 ) ;
    when others then
    UTL_FILE.FCLOSE( file1 ) ;
    dbms_output.put_line('ERROR: '||sqlcode||':'||sqlerrm) ;
    end;
    i have managed to write this piece of code and all lines are being read and now i need to insert data into my table and the fields are seperated by a `|` i am strill trying to figure how to do that now. help ...
    Edited by: Kevin CK on 17-Jan-2010 22:40

  • How to read a CSV file and Insert data into an Oracle Table

    Hi All,
    I have a Clob file as a in parameter in my PROC. . File is comma separated.need procedure that would parse this CLOB variable and populate in oracle table .
    Please let me some suggestions on this.
    Thanks,
    Chandra R

    jeneesh wrote:
    And, please don't "hijack" 5 year old thread..Better start a new one..I've just split it off to a thread of it's own. ;)
    @OP,
    I have a Clob file as a in parameter in my PROC. . File is comma separated.need procedure that would parse this CLOB variable and populate in oracle table .You don't have a "clob file" as there's no such thing. CLOB is a datatype for storing large character based objects. A file is something on the operating system's filesystem.
    So, why have you stored comma seperated data in a CLOB?
    Where did this data come from? If it came from a file, why didn't you use SQL*Loader or, even better, External Tables to read and parse the data into structured format when populating the database with it?
    If you really do have to parse a CLOB of data to pull out the comma seperated values, then you're going to have to write something yourself to do that, reading "lines" by looking for the newline character(s), and then breaking up the "lines" into the component data by looking for commas within it, using normal string functions such as INSTR and SUBSTR or, if necessary, REGEXP_INSTR and REGEXP_SUBSTR. If you have string data that contains commas but uses double quotes around the string, then you'll also have the added complexity of ignoring commas within such string data.
    Like I say... it's much easier with SQL*Loader of External Tables as these are designed to parse such CSV type data.

Maybe you are looking for