How would you flip an ImageView along its vertical axis?

Hello,
How would you flip an ImageView along its vertical axis? This would help me reduce the number of image files I would require in my project.
thanks
jose

Rotation about x_axis should works (javafx 2.2):
Translate flipTranslation = new Translate(0,imageView.getImage().getHeight());
Rotate flipRotation = new Rotate(180,Rotate.X_AXIS);
imageView.getTransforms().addAll(flipTranslation,flipRotation);Regards.
Edited by: 918075 on 2013-02-01 07:44
Edited by: 918075 on 2013-02-01 07:47

Similar Messages

  • How would you configure your database?

    How would you configure your disks with those specifications?
    General Database Characteristics:
    os is Oracle Enterprise Linux 64 bit
    Enterprise Edition
    180GIG size database.
    High "oltp" environment.
    Estimated growth of 40 to 60GIG/year
    20GIG of archivelogs/Day
    Flashback time is 24 hours:120GIG of flashback space in avg
    Local backup. Full database copy, then incremental is the preferred method.
    That way, if a datafile goes bezerk, replace with backup datafile then recover.
    Or if only a few corrupt block, block recover with rman.
    BTW: Backup is done locally first, then send to another server, than on tape.
    Archivelogs is duplexed on another server.
    General Hardware Info:
    Server Platform: Dell PowerEdge 1950
    16 GIG RAM
    2 * 64 bit CPU's
    2 * local 300G/15rpm disks
    Storage: Dell PowerVault MD3000
    15 * 300G/15rpm Disks
    Possibility for 17 disks here.
    Here is my configuration so far:
    OS+ oracle binary + Online Redo Logs Copy 1 + Control File Copy 1: 2 disks raid 1
    flashback + backup + Online Redo Logs Copy 2 + Control File Copy 2: 4 disks raid 1 or 10
    archivelogs: 2 disks raid 1
    Temporary Datafiles: 1 disk no raid
    UNDO Datafiles: 2 disks raid 1
    Datafiles 6 disk raid10
    total 17 disks: + spare disks on the side of one ever fails
    1) How would you configure it with those specs?
    2) Is there missing info to make a particular decision?

    Here is my reply concerning data separate from index files:
    See http://www.dizwell.com/prod/node/751 for the complete article.
    "Why wouldn't you keep indexes separate from their tables?! Because doing so makes no difference to performance... and I patiently explained that a table and its index are never accessed simultaneously by a single user so that contention between them cannot arise. And yes, in a multi-user system, of course the two could be accessed simultaneously -but so could two tables, or two indexes. "

  • How would you find the pitch period of a sound signal?

    Hi
    I have a few questions and i would like if somebody could help me even with the smallest comment on this.
    How would someone be successfully estimate the pitch period (fundamental frequency) of a 5 second sound file?How would you successfully distinguish the voiced from the unvoiced parts and how would you make sure you dont mix voiced/unvoiced sections? Finally how can you find the exact points where the pitch is at its peak throughout the signal?
    Any help/comment/suggesion would be much appreciated

    Hello Madgreek,
    After some thought I think I may have come up with an algorithm for what we have discussed. Basically, you are interested in knowing the time intervals over which you can observe any given frequency in your signal. As you had suggested, you can examine small windows of your signal and perform FFTs on each of the small windows to determine what frequency content is contained in that window. By examining all of the windows, you will see when particular frequencies are prevalent in the original signal. You'd want to use the smallest allowable window to give you the most resolution, but one that is large enough to cover an entire period of the lowest frequency (so that you don't miss this frequency).
    I have attached an example program that performs this operation. The example performs this analysis on an array that represents audio data. I am basically performing multiple FFTs (for each window) and stacking these FFTs in time to form a 3D plot. By examining the 3D plot, I can then see when in time my frequencies of interest are at their peaks. Rather than graphing these plots, you may work out a different algorithm for programmatically determining and logging these peaks and times. I hope this is what you were looking for!
    Attachments:
    Time Variable FFT.vi ‏250 KB

  • Im wondering how would you do a scrolling page over a static background?

    I watched this and its great https://www.youtube.com/watch?v=qRC5-GKYa_Q but im wondering how would you do this over a static background?

    Hi Paul,
    This is done using Parallax Scrolling. Static back ground should not be a problem in achieving this. Please try it and let us know if you face any issue.
    Regards,
    Aish

  • How would you change the state to the base state?

    How would you change the state to the base state? Its not
    letting me do something like:
    currentState='<Base State>';

    Sorry about the vagueness of that last reply :)
    What I have done now in my code is this:
    viewstack1.addChildAt(loginCanvas,0);
    toggle.selectedIndex = 0;
    However nothing happens at this line of code:
    toggle.selectedIndex = 0;
    but this works:
    toggle.selectedIndex = 1; or ...
    toggle.selectedIndex = 2;
    toggle.selectedIndex = 3;
    toggle.selectedIndex = 4;
    toggle.selectedIndex = 5;
    toggle.selectedIndex = 6;
    The strange thing is that if I have a button on the screen:
    <mx:Button x="10" y="3" label="Button"
    click="toggle.selectedIndex =0"/>
    and the user clicks it the toggle.selectedIndex = 0; works.
    I'm stumped, any ideas?

  • How would you realize a "blinking"-Effect

    The question narrows down to : Which is the best solution to trigger each 0,5 seconds an event (on the JavaFX thread) ?
    I could do this with a TimelineAnimation or with a Task<Void>, the problem withthe Task is that I have to update the UI with Platform.runLater() each time which is an impact on the overall perfomance. On the otherhand the TimerLineAnimation is useful to update a property and I do not think that it is the approriate method to realize a blink effect.
    How would you do this ?
    E.G. I have a circle. This shape is supposed to change its Color every 0,5 seconds (And there can be many of this circles..)

    I would use some kind of Transition, not because of any performance consideration but merely because it will keep your code cleaner. Used properly, a Task with Platform.runLater(...) to update the UI will be as efficient as anything else, but it can be a bit tricky to get it right (and using Transitions, you delegate the job of getting the code right to the JavaFX team, who are probably better at this kind of thing than either you or I).
    The Timeline will actually animate the transition between property values. Almost anything you want to do can be expressed as a change in property; your example of changing the color of a Circle simply involves changing the value of the fillProperty. So using a Timeline will fade one color into another.
    If you want a "traditional" blink, you could two PauseTransitions with the onFinished event set to change the color.
    This compares the two approaches:
    import javafx.animation.Animation;
    import javafx.animation.KeyFrame;
    import javafx.animation.KeyValue;
    import javafx.animation.PauseTransition;
    import javafx.animation.SequentialTransition;
    import javafx.animation.Timeline;
    import javafx.application.Application;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.layout.HBox;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.Paint;
    import javafx.scene.shape.Circle;
    import javafx.stage.Stage;
    import javafx.util.Duration;
    public class BlinkingCircles extends Application {
         @Override
         public void start(Stage primaryStage) {
           final HBox root = new HBox();
              final Group faders = new Group();
              final Color blue = new Color(0, 0, 1.0, 0.3);
              final Color red = new Color(1.0, 0, 0, 0.3);
              final ObjectProperty<Paint> colorFader = new SimpleObjectProperty<Paint>(blue);
              for (int i=0; i<20; i++) {
                faders.getChildren().add(createCircle(colorFader));
              KeyValue blueKV = new KeyValue(colorFader, blue);
              KeyValue redKV = new KeyValue(colorFader, red);
              KeyFrame blueKF = new KeyFrame(new Duration(1000), blueKV);
              KeyFrame redKF = new KeyFrame(new Duration(500), redKV);
              Timeline fadeTimeline = new Timeline(redKF, blueKF);
              fadeTimeline.setCycleCount(Animation.INDEFINITE);
              fadeTimeline.play();
              final Group blinkers = new Group();
              final ObjectProperty<Paint> colorBlinker = new SimpleObjectProperty<Paint>(blue);
              for (int i=0; i<20; i++) {
                blinkers.getChildren().add(createCircle(colorBlinker));
              PauseTransition changeToRed = createPauseTransition(colorBlinker, red);
              PauseTransition changeToBlue = createPauseTransition(colorBlinker, blue);
              SequentialTransition blinkTransition = new SequentialTransition(changeToRed, changeToBlue);
              blinkTransition.setCycleCount(Animation.INDEFINITE);
              blinkTransition.play();
              root.getChildren().addAll(faders, blinkers);
              Scene scene = new Scene(root, 640, 400);
              primaryStage.setScene(scene);
              primaryStage.show();
         private Circle createCircle(ObjectProperty<Paint> color) {
           Circle c = new Circle(Math.random()*300, Math.random()*300, 20);
           c.fillProperty().bind(color);
           c.setStroke(Color.BLACK);
           return c ;
         private PauseTransition createPauseTransition(final ObjectProperty<Paint> colorBlinker, final Color color) {
           PauseTransition changeColor = new PauseTransition(new Duration(500));
              changeColor.setOnFinished(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent evt) {
                  colorBlinker.set(color);
              return changeColor ;
         public static void main(String[] args) {
              launch(args);
    }

  • How would you model a trip or trajectory with Spatial ?

    Hello,
    I have a design question that is probably simple : "how would you model a trip/trajectory with Spatial".
    I would like to query trips that were in a specific area between 2 dates.
    Thank you for your help
    Gregory

    Hi Gregory,
    A simple way to model a trajectory is to model it as a set of trajectory points with a timestamp.
    Each trajectory has a trajectory id as its PK.
    Table Trajectory:
    Trajectory_ID NUMBER,
    Trajectory_Pt SDO_GEOMETRY,
    Time TIMESTAMP
    The above schema enables you to query the trajectory using time, geometry, and can be used fro tracking purpose (trajectory point level).
    A complete trajectory is to query a trajectory order by the time of its trajectory points.
    If you are only interested in the full trajectory geometry and time,the following might be sufficient.
    Trajectory_ID NUMBER,
    Start_Time TIMESTAMP,
    End_Time TIMESTAMP,
    Trajectory SDO_GEOMETRY
    You can build indexes on spatial and temporal information for your query if needed.
    jack

  • How would you detect a ground like this:

    I have made racing games in the past, but never a side scrolling type.
    Im trying to make one similar to this: http://www.gamesfreak.net/games/Cyclo-Maniacs_3730.html
    But how would you keep the player on the ground? well not stuck to the ground because we would want the player to be able to use things like ramps.
    Would it be a hit test? hmmmmmmmm Any ideas? anyone.

    Oh i apoligize. I pressumed because of the popularity of box2D you meant that. Well the code I have so far does a OK job for physics. Allthough i made it in intensions of a platform/side scroller. But its ok. I guess it could possibly be  modified for a car or something.
    Here is what i have so far:
    package
              import flash.display.MovieClip;
              import flash.events.Event;
              import flash.events.MouseEvent;
              import flash.events.KeyboardEvent;
              import flash.geom.Point;
              public class DocumentMain extends MovieClip
                        public var _startMarker:StartMarker = new StartMarker;
                        public var _Player:Player;
                        public var _Boundaries:Boundaries;
                        public var _Wall:Wall;
                        public var _Floor:Floor;
                        public var _LButton:LButton = new LButton;
                        public var _RButton:RButton = new RButton;
                        public var _UButton:UButton = new UButton;
                        public var _DButton:DButton = new DButton;
                        private var _vy:Number;
                        private var _vx:Number;
                        public function DocumentMain()
                                  stage.focus = stage;
                                  //stage.addChild(_startMarker);
                                  //_startMarker.x = 300;
                                  //_startMarker.y = 300;
                                  stage.addChild(_LButton);
                                  _LButton.x = 80;
                                  _LButton.y = 600;
                                  _LButton.height = 75;
                                  _LButton.width = 75;
                                  _LButton.addEventListener(MouseEvent.MOUSE_DOWN, LMouseDown);
                                  _LButton.addEventListener(MouseEvent.MOUSE_UP, LMouseUp);
                                  stage.addChild(_RButton);
                                  _RButton.x = 210;
                                  _RButton.y = 600;
                                  _RButton.height = 75;
                                  _RButton.width = 75;
                                  _RButton.addEventListener(MouseEvent.MOUSE_DOWN, RMouseDown);
                                  _RButton.addEventListener(MouseEvent.MOUSE_UP, RMouseUp);
                                  stage.addChild(_DButton);
                                  _DButton.x = 140;
                                  _DButton.y = 650;
                                  _DButton.height = 75;
                                  _DButton.width = 75;
                                  //_DButton.addEventListener(MouseEvent.MOUSE_DOWN, DMouseDown);
                                  //_DButton.addEventListener(MouseEvent.MOUSE_UP, DMouseUp);
                                  stage.addChild(_UButton);
                                  _UButton.x = 140;
                                  _UButton.y = 550;
                                  _UButton.height = 75;
                                  _UButton.width = 75;
                                  _UButton.addEventListener(MouseEvent.MOUSE_DOWN, UpMouseDown);
                                  _UButton.addEventListener(MouseEvent.MOUSE_UP, UpMouseUp);
                                  _startMarker.visible = true;
                                  _startMarker.x = 500;
                                  _startMarker.y = 300;
                                  _vx = 0;
                                  _vy = 0;
                                  _Player.addEventListener(MouseEvent.MOUSE_DOWN, JumpDownHandler);
                                  _Player.addEventListener(MouseEvent.MOUSE_UP, JumpUpHandler);
                                  this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
                                  stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
                                  stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
                        private function JumpDownHandler(MouseEvent):void
                                  _vy = -20;
                        private function JumpUpHandler(MouseEvent):void
                                  _vy = 0;
                        private function LMouseDown(MouseEvent):void
                                  _vx = -20;
                        private function LMouseUp(MouseEvent):void
                                  trace("LMouseUp");
                                  _vx = 0;
                        private function RMouseUp(MouseEvent):void
                                  _vx = 0;
                        private function RMouseDown(MouseEvent):void
                                  trace("RMouseDown");
                                  _vx = 20;
                        private function UpMouseDown(MouseEvent):void
                                  _vy = -20;
                        private function UpMouseUp(MouseEvent):void
                                  trace("UMouseUp");
                                  //_vx = 0;
                        private function enterFrameHandler(e:Event):void
                                  _vy +=  2;
                                  //_vx += 20;
                                  _Player.x += + _vx;
                                  _Player.y += + _vy;
                                  processAllTheCollisions();
                                  scrollTheStage();
                        private function processAllTheCollisions():void
                                  if (_vy > 0)
                                            if (_Player.y > 500)
                                                      _Player.x = _startMarker.x;
                                                      _Player.y = _startMarker.y;
                                                      _Boundaries.x = 0;
                                                      _Boundaries.y = 0;
                                                      _vy = 0;
                                            else
                                                      var collision:Boolean = false;
                                                      if (_Boundaries.hitTestPoint(_Player.x,_Player.y,true))
                                                                collision = true;
                                                      if (collision)
                                                                while (collision)
                                                                          _Player.y -=  0.1;
                                                                          collision = false;
                                                                          if (_Boundaries.hitTestPoint(_Player.x, _Player.y, true))
                                                                                    collision = true;
                                                                _vy = 0;
                        private function scrollTheStage():void
                                  _Boundaries.x += (stage.stageWidth * 0.5) - _Player.x;
                                  _Player.x = stage.stageWidth * 0.5;
                                  //_Boundaries.y += (stage.stage.stageHeight * 0.5) - _Player.y;
                                  //_Player.y = stage.stageHeight * 0.5;
                        private function keyDownHandler(e:KeyboardEvent):void
                                  switch (e.keyCode)
                                            case 37 :
                                            _vx = -20;
                                            break;
                                            case 38 :
                                            _vy = -20;
                                            break;
                                            case 39:
                                            _vx = 20;
                                            break;
                                            default:
                        private function keyUpHandler(e:KeyboardEvent):void
                                  switch (e.keyCode)
                                            case 37 :
                                            case 39 :
                                            _vx = 0;
                                            break;
                                            default:

  • How would you describe the function of 'Camera roll'?

    How would you describe the function of 'Camera roll'?

    ITs the folder that stores pictures taken with the camera or downloaded from the web.   Or stored from Apps running on the iPad.
    Basically any picture or image created on the iPad will reside in there.

  • HT4759 how would i find my iphone if its offline?

    how would i fimd my iphone if its offline?

    You can't.  If it's offline it can't communicate with the Find My iPhone servers.  All you can do is put it in lost mode.  If and when it goes back online and lost mode in implemented, you will receive an email informing you.  (See http://help.apple.com/icloud/#/mmfc0f0165.)

  • In Security, clicking on the "Saved Password" button displays your current saved password for each site. It does not allow you to change a password. How would you do that?

    In Security, clicking on the "Saved Password" button displays your current saved password for each site. It only allows you to view and delete site passwords. It does not allow you to change a password. How would you do that?

    If you enter a new password Firefox should offer to change the password.
    *You may not need to delete the old password. Try "Refreshing" the page, entering the site again, you may need to let Firefox fill in the old password, then enter the new password, and Firefox should ask to save the new password. See:
    **http://kb.mozillazine.org/Deleting_autocomplete_entries
    *If you delete the old password, you may need to "Refresh" the site after deleting the old password.
    If you want to delete the password that has been saved do the following:
    #In the Tools menu select Options to open the options window
    #Go to the Security panel
    #Click the "Saved Passwords" button to open the passwords manager
    #Select the site in the list, then click Remove
    <br />
    <br />
    '''You need to update the following.''' The Plugin version(s) shown below was/were submitted with your question and is/are out of date. You should update to avoid known security issues with the version(s) you have installed. Click on "More system info..." to the right of your question to see what was included with your question.
    *Adobe PDF Plug-In For Firefox and Netscape 8.3.0 (''Note: this is a very old version and installing the current version may not delete it or overwrite it. To avoid possible problems with having 2 versions installed on your system, you may want to remove the old version in Windows Control Panel > Add or Remove Programs before installing the new version'').
    *Shockwave Flash 10.3 r181 (''this may be current but a new version was released on 2011-06-14 with a ".26" after the "181". You can use the Plugin Check below and/or look in Add-ons > Plugins for the version of Shockwave Flash that you have installed. The newest version will be shown in Add-ons > Plugins as "Shockwave Flash 10.3.181.26"'').
    *Next Generation Java Plug-in 1.6.0_24 for Mozilla browsers
    #'''''Check your plugin versions''''' on either of the following links':
    #*http://www.mozilla.com/en-US/plugincheck/
    #*https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #*There are plugin specific testing links available from this page:
    #**http://kb.mozillazine.org/Testing_plugins
    #'''Update Adobe Reader (PDF plugin):'''
    #*From within your existing Adobe Reader ('''<u>if you have it already installed</u>'''):
    #**Open the Adobe Reader program from your Programs list
    #**Click Help > Check for Updates
    #**Follow the prompts for updating
    #**If this method works for you, skip the "Download complete installer" section below and proceed to "After the installation" below
    #*Download complete installer ('''if you do <u>NOT</u> have Adobe Reader installed'''):
    #**SAVE the installer to your hard drive (save to your Desktop so that you can find it after the download). Exit/Close Firefox. Run the installer you just downloaded.
    #**Use either of the links below:
    #***https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox ''(click on "Installing and updating Adobe Reader")''
    #***''<u>Also see Download link</u>''': http://get.adobe.com/reader/otherversions/
    #*After the installation, start Firefox and check your version again.
    #'''Update the [[Managing the Flash plugin|Flash]] plugin''' to the latest version.
    #*Download and SAVE to your Desktop so you can find the installer later
    #*If you do not have the current version, click on the "Player Download Center" link on the "'''Download and information'''" or "'''Download Manual installers'''" below
    #*After download is complete, exit Firefox
    #*Click on the installer you just downloaded and install
    #**Windows 7 and Vista: may need to right-click the installer and choose "Run as Administrator"
    #*Start Firefox and check your version again or test the installation by going back to the download link below
    #*'''Download and information''': http://www.adobe.com/software/flash/about/
    #**Use Firefox to go to the above site to update the Firefox plugin (will also install plugin for most other browsers; except IE)
    #**Use IE to go to the above site to update the IE ActiveX
    #*'''Download Manual installers'''.
    #**http://kb2.adobe.com/cps/191/tn_19166.html#main_ManualInstaller
    #**Note separate links for:
    #***Plugin for Firefox and most other browsers
    #***ActiveX for IE
    #'''Update the [[Java]] plugin''' to the latest version.
    #*Download site: http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)
    #**'''''Be sure to <u>un-check the Yahoo Toolbar</u> option during the install if you do not want it installed.
    #*Also see "Manual Update" in this article to update from the Java Control Panel in Windows Control Panel: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
    #* Removing old versions (if needed): http://www.java.com/en/download/faq/remove_olderversions.xml
    #* Remove multiple Java Console extensions (if needed): http://kb.mozillazine.org/Firefox_:_FAQs_:_Install_Java#Multiple_Java_Console_extensions
    #*Java Test: http://www.java.com/en/download/help/testvm.xml

  • How would YOU retype these old XM08 types for use in an ABAP OO method?

    The XM08 function group has the following type declarations:
    TYPES: BEGIN OF mmcr_drseg_co.
            INCLUDE STRUCTURE cobl_mrm_d.
    TYPES: cr LIKE drseg_cr    OCCURS 0,
           unpl_refwr TYPE refwr,
           END OF mmcr_drseg_co.
    TYPES: mmcr_tdrseg TYPE mmcr_drseg OCCURS 0,
    TYPES: BEGIN OF mmcr_drseg.
            INCLUDE STRUCTURE drseg.
    TYPES: cr LIKE drseg_cr OCCURS 0,
           co TYPE mmcr_drseg_co OCCURS 0,
           sm LIKE drseg_sm OCCURS 0,
           charact TYPE rbcharact_instance OCCURS 3,
                                           "instances of characteristics
           uebgmat  TYPE matnr,
           uebrblgp TYPE rblgp,
           selkz_db TYPE selkz,
           rblgp_old TYPE rblgp,           "rblgp before aggregation
           END OF mmcr_drseg.
    How would YOU redeclare these types so that they work in an ABAP Objects class?  
    Some of the "fixes" are easy, like replacing "LIKE" with "TYPE:".
    But what about the "INCLUDE STRUCTURE" and the "occurs 0" specifications?
    The reason I'm asking this is that I have to call a method from ZXM08U16 and I'd like to be able to pass this method exactly what XXM08U16 gets from SAP, i.e. the table E_TDRSEG of type  MMCR_TDRSEG

    David,
    I wonder it can be directly in ABAP (I would like to hear opinions from others as well!), I needed to use Data Dictionary as well:
    TYPES: BEGIN OF mmcr_drseg_co.
            INCLUDE STRUCTURE cobl_mrm_d.
    TYPES: cr TYPE z_tt_drseg_cr,
           unpl_refwr TYPE refwr,
           END OF mmcr_drseg_co.
    z_tt_drseg_cr is a table type created in SE11, based on structure drseg_cr.
    the way to create internal table and work area, based on the above:
    DATA : gt_... TYPE TABLE OF mmcr_drseg_co.
    DATA : gw_... TYPE mmcr_drseg_co.
    hope this helps some
    ec
    UPDATE : Rich is right, it is possible to do it only in ABAP with the DEFAULT KEY addition.

  • Disable the pop-up message box "How would you like to open this file" to open pdf file??

    Hi,
    is there any way i can stop the pop-up box displaying to open pdf file in sharepoint document library? Right now whenever i am trying to open pdf file, asking "how would you like to open"  Read only or edit mode. currently MIME Type is setup
    but still pop-up message box.
    Thanks in advanced!

    Hi ,
    As far as I know, This is a default feature. and is not recommended to delete or deactivate this pop up. 
    This is a feature of office and there is a dll called owssupp.dll which is responsible for getting the popup to open.
    You can go to IE tools> addon settings and deactivate the above dll (sharepoint open document class). But if you do so, then the other office office files which are word/excel/pptx etc.. would aslo gets affected and they also wont get the popup.
    Hope this helps.
    Best Regards, Ashok Yadala

  • How would you write a "wildcard" in a filefilter?

    How would you go about to have a wildcard instead of the "*" in the following filefilter;
              File[] files = new File("./resultat/resultat_" + "*" + "_" + index[0]).listFiles (new FileFilter () {
                    public boolean accept (File file) {
                        return ! file.isDirectory ();
              });All help appriciated
    - Karl XII

    Shouldn't "a*" accept all files that begins with "a" and ends with whatever?No. "*" in regexp is a not a wildcard match. Instead it matches one or more instances of the preceeding
    value.
    Therefore "a*" will match "a", "aa", "aaa", "aaaa" etc but will not match anything which does not end in
    an "a".
    The following might help you out. (not the most elegent expression but it will do
    import java.util.regex.*;
    public class RegExp{
      public static void main(String[] args) {
      Pattern p = Pattern.compile("a*b");     
      Matcher m = p.matcher("aaaab");     
      System.out.println(m.matches());                    
      // interesting bit here
      // match one or more occurances of any characters in the ASCII charset  (the \\p{ASCII}* bit   
      p = Pattern.compile("hello_\\p{ASCII}*_b");     
      m = p.matcher("hello_wibble_b");     
      System.out.println(m.matches());
    }

  • How would you pass more than 255 args?

    I have an SFTP program that currently is only passed a single file. I am modifying it so that it will loop though an array of files to simulate an mput command. Originally I was just going to call the program with each file to be transferred as an argument but noticed the 255 argument limit. I am looking at potentially having 1500 - 2000 files to transfer at one time. I am just looking for advice on how this should be designed. One idea that was forwarded to me was to just create a listing of the files on the server and use that list file as my argument. Would this be the best approach for this issue?

    sdhalepaska wrote:
    georgemc wrote:
    sdhalepaska wrote:
    georgemc wrote:
    sdhalepaska wrote:
    georgemc wrote:
    I see no reason why you need an argument for every file.I would not necessarily need one for every file. Prior to our needing to use this for multiple files, it was easy enough to pass in one file as an argument. That is my question, how would you try to pass in a long list of files?Let's establish what you are concerned about. The 255 argument limit is on method signatures. From what you're saying here, you're talking about arguments being passed into your application from, say, the shell. Am I right?Correct, please see my clarified post. From what I have tested, the 255 argument limit appears to exist even for arguments passed to main.Ah, but arguments passed to main from the command line are passed into main as a single array of Strings, no matter how many of them there are. I have no idea what the limit on those is, but an array can hold millions of elements. I expect your shell will moan about that many, though.
    As I see it, you have a few choices. Unless these files are all in different, arbitrary directories, you can specify a list of directories for your app to search. Or you can pass them all in one at a time, and see how you go. Or you can list them in a text file, pass that to your app and have it work them out. Or write a script that invokes your app multiple times. What you don't need, is a method that takes each file as an argument.Thank you for walking me through this. Would you mind telling me which way you would lean if you were designing this? The files will all be in a single directory on the server and I would not like to invoke the app multiple times as it creates a connection during each invocation. They're all in the single directory. Ok, are all the files in that directory to be transferred? If so, I'd just pass the directory name to the app, and have it iterate over all the files. If it's only to be certain ones, how do you know which ones? Is there some regex or filtering you can do on the command line?
    If you are interested, the 255 argument limit for main that I tested was from this article:
    [http://www.javaspecialists.eu/archive/Issue059.html|http://www.javaspecialists.eu/archive/Issue059.html]
    It does die at 255 using Java 1.5.Like I said, arguments to a method are thus limited. But the args passed to an app are passed to main as one argument - an array. In short, that article is not relevant to your problem.

Maybe you are looking for