Better method than switch?

I have the following code.
public Animalinfo(int animalInfo){
        switch (animalInfo) {
            case 1:File inputFile1 = new File("monkey.txt"); FileInputAnimal monkey = new FileInputAnimal(inputFile1);break ;
            case 2:File inputFile2 = new File("rooster.txt"); FileInputAnimal rooster = new FileInputAnimal(inputFile2);break ;
            case 3:File inputFile3 = new File("dog.txt"); FileInputAnimal dog = new FileInputAnimal(inputFile3);break ;
            case 4:File inputFile4 = new File("boar.txt"); FileInputAnimal boar = new FileInputAnimal(inputFile4);break ;
            case 5:File inputFile5 = new File("rat.txt"); FileInputAnimal rat = new FileInputAnimal(inputFile5);break ;
            case 6:File inputFile6 = new File("ox.txt"); FileInputAnimal ox = new FileInputAnimal(inputFile6);break ;
            case 7:File inputFile7 = new File("tiger.txt"); FileInputAnimal tiger = new FileInputAnimal(inputFile7);break ;
            case 8:File inputFile8 = new File("rabbit.txt"); FileInputAnimal rabbit = new FileInputAnimal(inputFile8);break ;
            case 9:File inputFile9 = new File("dragon.txt"); FileInputAnimal dragon = new FileInputAnimal(inputFile9);break ;
            case 10:File inputFile10 = new File("snake.txt"); FileInputAnimal snake = new FileInputAnimal(inputFile10);break ;
            case 11:File inputFile11 = new File("horse.txt"); FileInputAnimal horse = new FileInputAnimal(inputFile11);break ;
            case 12:File inputFile12 = new File("sheep.txt"); FileInputAnimal sheep = new FileInputAnimal(inputFile12);break ;
//where fileinputanimal prints the text file in the window
        }It works and i can't see much else to addto it. But i was just wondering if anyone had other possible improvements on it, like a way of not adding a number to the end of each File inputFilex. Also, is there an alternate method to switce. I can't think of any myself, but that means i'll have to start working on a switch like above but containing around 500 cases in it this time.
Any suggestions appreciated.

Sazazezer_Mililipili wrote:
Jeez, so much help in fifteen minutes alone. I feel bad for taking a day to respond.
The animalInfo int comes from the user input. The user types in their date of birth. It then converts to a float so i can do 'year % 12', Okay, that makes sense. But an int would be better.
Now...to learn about maps.Nah, since it's always going to be 0-11, and it's the numerical value that has significance, not some arbitrary "key", it's simpler to just stick with the switch statement. Do pay attention to the simplifications I gave you though, and rather than having the constructor do anything besides initialize the state of an object, after construction, call a print or display or whatever method.
EDIT: Or, possibly better, go with the other poster's suggestion of an array of Strings, whose values are the file names.
Edited by: jverd on Sep 25, 2008 2:15 PM

Similar Messages

  • I want to transfer my iPhoto from my old MacBook Pro to my new MacBook Pro. I have a firewire or I could also do it from my TimeCapsule. Would one be a better method than the other?

    I want to transfer my iPhoto from my old MacBook Pro to my new MacBook Pro. I have a firewire or I could also do it from my TimeCapsule. Would one be a better method than the other?

    Hi brotherbrown,
    A direct FireWire transfer (especially if it's 800 to 800) is going to be the fastest method. TimeCapsule would work, if you connect to it via Ethernet, via wireless it would be quite slow (especially if you have a large library).

  • Better method than using a large number of shift registers?

    I'm trying to work with example code provided free by stanford research systems (http://www.srsys.com/downloads/soft.htm).
    Their example software alows the user to run an analog scan across 100 masses (the x axis) which progressively produces a graph of all the data. It repeats scanning (and updating the graph)until the user hits stop.
    My goal is to find a way to make the program display the graph of the last scan while it is displaying the current scan (this way it is possible to compare the graphs and see how they change). But as best I can tell the data is generated and plotted in a while loop piece by piece so the best thing my labview inept mind has managed so far is using a large nu
    mber of shift registers and graphing the points as they generated along with points that were generated 10 cycles ago in a different color.
    So I hope to either find a good way to use shift registers to get values from over 100 cycles ago (which doesn't really seem to work unless i just make space for over 100 little arrows in my loop) or to find a better approach to the whole mess.
    The example does not seem to use XY plot and to tell the truth I don't know exactly what its using to plot.
    Can anyone offer any guidance or at least understand my question enough to point me in the right direction.
    I'm including the stock example and my adaptation to it but if you need to use the included sub vi's the package is on that SRS webpage I listed above (look under RGA).
    I suppose this may all be too much to ask but I can dream can't I?
    Attachments:
    original.vi ‏87 KB
    changed.vi ‏92 KB

    I certainly agree that the DAQ programming is the part leaving me most confused. I'll attach the package that I am trying to modify, the trouble is there are so many sub vis involved in actually acquiring the data that I am not entirely sure what format the data comes out in.
    Perhaps to someone more skilled than I am with lab view the inner workings of this package would be clearer. If you are up for it then look at SRSRGAa simple analog.vi in SRSRGA61.lib and you can see what I'm working with.
    I'll also attach my attempt to modify the code to make it work like altenbachs example... however somehow it would seem my timing/synchronization is off. Hope some of this makes sense, I'll see what luck I can have with get w
    aveform components, I suppose I have been approaching this so far as if my DAQ was just giving me data points as opposed to a waveform.
    Attachments:
    rga_lv_61.zip ‏2132 KB
    graph_app.1.vi ‏101 KB

  • Is m4v better quality than a remuxed MKV file via Subler?

    I'm slowly building my home media server and putting my Blu-Ray's onto it. I normally do a Handbrake conversion for ATV3, so the MKV files end up being significantly smaller m4v's and the quality is outstanding. But I recently learned about the quick remux method using Subler, which quickly converts the MKV container into an m4v container without any quality loss and while keeping the same size file.  But I noticed that, say, a 29GB MKV file is a much poorer softer picture on my plasma TV than the same movie that's only a 9GB MKV file (remuxed to m4v with subler for streaming over ATV3). I'm running a 300mbps cable modem so the streaming shouldn't be a problem over my home wifi.  But I also noticed that the smaller m4v's (say a 3.5GB file that comes from a 9GB MKV file via Handbrake) seem to be slightly better quality than the 9GB file that was remuxed.  So it seems like the larger file should be even higher quality -- but I'm getting better results with a smaller file that's Handbrake'd from MKV to m4v.
    Is there some sort of streaming setting on the ATV3 that needs to be set or adjusted that will allow the full gorgeous pic quality of a 29GB file to stream right through to it, and look better than the Handbrake'd m4v file?  It feels like there's a bottleneck somewhere that's not letting all of the complete picture information through, and an intact, perfect 29GB file should look light years better than that 29GB file Handbrake'd down to 4GB.  Trying to figure this out before I continue down this home media server path cuz it's a lot of work to do these Blu's one at a time.
    Kirby

    I have no experience of the remuxing you describe, but interesting observations.
    There is nothing you can adjust on AppleTV - it will either play the encoded movie or it won't.
    AppleTv's generally playback the h264 codec (in an m4v container) - there are many many versions/levels of this codec and each generation of AppleTv has been able to play slightly more sophisticated versions.
    I suspect but cannot prove that the issue you notice is due to AppleTV attempting to support advanced h264 features but making compromises which affect playback quality - in other words it is cutting corners to playback advanced h264 profile features rather than refusing.  Handbrake on the other hand has time at its disposal - it has been refined over many years by dedicated enthusiasts so if a simple remux is all that's required i'd be surprised they have not implemented that.  Instead I suspect it more accurately processes enhanced h264 features before transcoding into a new smaller m4v file.  Equally there might be settings in HB which artificially sharpen or otherwise alter the video which you prefer.  I'd compare the BluRay tothe remuxed or HB versions to attempt to decide which was more faithful to the original but even then it would be dependent on the BluRay player's settings in some cases.

  • Does AirPort Express require better Internet than Ethernet?

    Wondering since I was having intermittent problems w my Linksys router & trouble updating it so thought switching to Airport Express would give me a simple way to get things working.
    Very disappointed that noes it's worse than before. Yesterday after a # of tries I did get it partly set up & although amber blinking lights, I was able to use Internet.
    Called Set up AppleCare call online to resolve amber light issue. She had me reset modem & when we were done, I again had green light on Airport BUT NO INTERNET CONNECTION. She said to call my ISP cox.
    I did try after a reset to connect MacbookPro directly to Ethernet & got it to connect. Then I unplugged Ethernet from Mac & plugged into airport & no connection again.
    So instead of Airport Express making things better, they are worse. I'm typing this on my iPhone 4S which for some reason has really slowed down.
    I learned that my old Motorola Surfboard modem is Docsis 2.0 & cox is switching to 3.0.
    But it was working better, although frequent brief loss of connection.
    So does Airport require a better modem or better connection than just Ethernet or via my Linksys E1200?
    Not happy also that functionally worse off after calling AppleCare. I know she didn't cause the issue but her suggestion while standard tipped it over to not be connecting.
    & typing all this on my iPhone is not fun although it did just now get back temporarily there for just a bit to its usual speed but now back to having to wait for it.

    Well I did the power down reset. But I think you missed the import of my question.
    I'm talking about an older modem that may be marginal. Not positive about the 2 Ethernet cables I have used either.
    So yes if the modem is working as it should I guess it should make a difference.
    But something is weird when I can can next via Ethernet & then I just unplug the the rent from my Mac & plug it into the wan port on the AirPort Express & no connection.
    To look at the modem & Airport across the room the lights make it look like they are fine.
    I just done have Internet connection to my Mac. I did yesterday w the amber lights flashing.
    & I was connecting w the Linksys but had frequent loss of connection.
    So wondering if maybe Airport has slightly greater requirements that act as a tipping point so it connected without it but doesn't connect w it. But the green light supposedly shows its working fine.
    Well I did put out a wanted request on FreeOC for a compatible Docsis 3.0 cable modem. Supposedly they work better & that might just make the difference.
    Don't really want to buy a new modem when I'm about to move to a new area where requirements might be different.

  • Is a PowerMac G5 2.4 Dual Chip (used) a better option than an iMac?

    Hi Guys
    I'm still reasonably new to Macs, and I am really more of a music person than a computer person (which is frustrating at times!!).
    I am looking at selling my iMac 2.4GHz (4GB RAM) and replacing it with a current iMac 2.66GHz, because the new iMacs can handle 8GB of RAM, which would really help me run BFD2 with less problems.
    But I noticed this on eBay:
    APPLE POWERMAC G5 2.3 GHZ DUAL CHIP-240gb HD-1.5 gb RAM (eBay item 230346540784) - would this be a better choice than going with a new iMac?
    I don't even know if this one is Quad Core. My knowledge of Mac Pros is zero! But I do know a lot of people go for them over iMacs, and even suggest getting a second hand Mac Pro in preference to a new iMac if it's for music.
    Could someone help out and tell me if the above machine is a better bet than going for a new iMac?
    Thanks heaps,
    Mike

    i dont have any evidence to prove this, but i would think that your iMac would run circles around the much older power mac G5 system.
    a mac pro would be a diff story. mac pros are the 'new' version of the power macs now running intel chips.
    www.everymac.com can give you all the tech specs you need on macs.

  • IPhoto 09 Gives Better Results than Aperture 2.0 on RAW

    I wanted to compare the results of Aperture 2.0 to iPhoto '09 on a RAW photo. To my chagrin, iPhoto had done a better job on the photo just by using the instant fix wizard and then one click on the color saturation effect.
    With Aperture, I imported the iPhoto library and made sure I was working on the "Original" RAW photo from that library. My workflow started with autoexposure, then the two auto levels (Luminance & RGB) by the histogram. I maxed the Sharpening in the RAW fine tuning.
    I tried tweaking the contrast, saturation, exposure and recovery. Nothing I can seem to do in Aperture can get the photo to look have the details as sharp and the colors as vibrant. iPhoto's automatic algorithms appear to be far superior to Aperture's auto exposure and auto levels of Luminance and RGB. Plus, it appears to do a better job than all the other controls will allow me to do manually.
    Has anyone else compared the two products side by side on the same photo and experienced the same?
    Thanks,
    Don

    Hmmmm,
    This is a meaningless comparison - If you cannot get the results you want in Ap then just use iPhoto and it's auto everything button and be happy. There is nothing magic going on in iPhoto, it uses the same CoreImage subroutines as Aperture for RAW interpretation prior to applying any of it's adjustments. One thing that the iPhoto auto functions will do is it will sacrifice more highlights and shadows detail than the Aperture auto levels will, you can set that in prefs if you like more contrast.
    RB
    Ps. the raw fine tuning sharpen slider will make virtually no visual difference, it is NOT for final output sharpening.

  • Better results than you could achieve in a real-time onlining suite?

    Another for Zeb and anyone else who cares about color. HD for Indies (http://www.hdforindies.com/) reviews The DV Rebel's Guide by Stu Maschwitz. In a section, "Why so AE centric when such a pain - why not do in FCP?", Mike Curtis pseudo-interviews Stu, who says "When onlining, the rule is the polar opposite: no amount of render time is too much to endure in the name of increased image quality. I detail some techniques for extracting every last bit of luminance range from your video source, removing color subsampling artifacts (without plug-ins), and a complete pipeline for multiple digital masters. If you follow these guidelines you can actually achieve better results than you could in an expensive real-time onlining suite."
    He is talking about the poor boy with a three year old laptop for whom long render times don't cost too much. Sounds like me.
    Comment?

    I have a valid example data file attached to this thread.
    If you open BEXTEST.bin in a hex-editor of your choice, you'll see the BEXUS as 42 45 58 55 53 and then the time as 00 28 09 etc.
    I couldn't get Joe Guo's VI to work. It doesn't count packages correctly, and the time is not displayed correctly either.
    The file was saved using a straight save to file VI.
    The data is from actual launching area tests performed a few mintues ago. The time displayed is "On time" e.g. how long the gondola has been powered up.
    I have a spare T-junction, so I can hook into the balloon real-time data as we fly, in case anyone care to see if they can figure out why the latest version of Joe Guo's program is not displaying correctly.
    I will monitor this
    thread during and after flight to see if anyone can make it in time!
    Thanks for the great effort!!
    Attachments:
    bextest.bin ‏53 KB

  • Better client than sqlplus for bulk fetch testing .

    Hi,
    I'm doing some test with rows speed retriving via Net8 and need some better client than sqlplus itself .
    There is araysize limit of 5000 in sqlplus and its not oriented for massive row fetching , although Im using set termout off .
    Test are in 10.2.0.3 environment and 100Mbit ethernet netowrk .
    So is there any better client I can use ? Or I need to write it by myself :) ?
    I've tried with pmdtm (informatica fetch utility) but it has got some problems with thread synchronization , basicaly strace profiling returns
    % time     seconds  usecs/call     calls    errors syscall
    57.35    1.738975         161     10819      2145 futex
    41.35    1.253799       32149        39           poll
      1.21    0.036717           3     11869           read
      0.08    0.002491           1      2163           write
      0.00    0.000000           0        50           fcntl
      0.00    0.000000           0        19           clock_gettime
    100.00    3.031982                 24959      2145 totalso instead of reading it's latching :).
    Regards
    GregG

    GregG wrote:
    its not oriented for massive row fetching , although Im using set termout off .You can use SQL*Plus AUTOTRACE command to disable query result printing:
    SQL> set autotrace  traceonly;
    SQL> select * from dba_objects;
    18816 rows selected.
    Execution Plan
    Plan hash value: 1919983379
    | Id  | Operation                      | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |             | 16154 |  3265K|    75   (3)| 00:00:01 |
    |   1 |  VIEW                          | DBA_OBJECTS | 16154 |  3265K|    75   (3)| 00:00:01 |
    |   2 |   UNION-ALL                    |             |       |       |            |          |
    |*  3 |    TABLE ACCESS BY INDEX ROWID | SUM$        |     1 |    26 |     0   (0)| 00:00:01 |
    |*  4 |     INDEX UNIQUE SCAN          | I_SUM$_1    |     1 |       |     0   (0)| 00:00:01 |
    |   5 |    TABLE ACCESS BY INDEX ROWID | OBJ$        |     1 |    25 |     3   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | I_OBJ1      |     1 |       |     2   (0)| 00:00:01 |
    |*  7 |    FILTER                      |             |       |       |            |          |
    |*  8 |     HASH JOIN                  |             | 19706 |  2290K|    72   (3)| 00:00:01 |
    |   9 |      TABLE ACCESS FULL         | USER$       |    66 |  1122 |     3   (0)| 00:00:01 |
    |* 10 |      HASH JOIN                 |             | 19706 |  1962K|    69   (3)| 00:00:01 |
    |  11 |       INDEX FULL SCAN          | I_USER2     |    66 |  1452 |     1   (0)| 00:00:01 |
    |* 12 |       TABLE ACCESS FULL        | OBJ$        | 19706 |  1539K|    67   (2)| 00:00:01 |
    |* 13 |     TABLE ACCESS BY INDEX ROWID| IND$        |     1 |     8 |     2   (0)| 00:00:01 |
    |* 14 |      INDEX UNIQUE SCAN         | I_IND1      |     1 |       |     1   (0)| 00:00:01 |
    |  15 |     NESTED LOOPS               |             |     1 |    30 |     2   (0)| 00:00:01 |
    |* 16 |      INDEX SKIP SCAN           | I_USER2     |     1 |    20 |     1   (0)| 00:00:01 |
    |* 17 |      INDEX RANGE SCAN          | I_OBJ4      |     1 |    10 |     1   (0)| 00:00:01 |
    |  18 |    NESTED LOOPS                |             |     1 |    43 |     3   (0)| 00:00:01 |
    |  19 |     TABLE ACCESS FULL          | LINK$       |     1 |    26 |     2   (0)| 00:00:01 |
    |  20 |     TABLE ACCESS CLUSTER       | USER$       |     1 |    17 |     1   (0)| 00:00:01 |
    |* 21 |      INDEX UNIQUE SCAN         | I_USER#     |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - filter(BITAND("S"."XPFLAGS",8388608)=8388608)
       4 - access("S"."OBJ#"=:B1)
       6 - access("EO"."OBJ#"=:B1)
       7 - filter(("O"."TYPE#"<>1 AND "O"."TYPE#"<>10 OR "O"."TYPE#"=1 AND  (SELECT 1
                  FROM "SYS"."IND$" "I" WHERE "I"."OBJ#"=:B1 AND ("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR
                  "I"."TYPE#"=3 OR "I"."TYPE#"=4 OR "I"."TYPE#"=6 OR "I"."TYPE#"=7 OR
                  "I"."TYPE#"=9))=1) AND ("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND
                  "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND
                  "O"."TYPE#"<>12 AND "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND
                  "O"."TYPE#"<>87 AND "O"."TYPE#"<>88 OR BITAND("U"."SPARE1",16)=0 OR ("O"."TYPE#"=4 OR
                  "O"."TYPE#"=5 OR "O"."TYPE#"=7 OR "O"."TYPE#"=8 OR "O"."TYPE#"=9 OR "O"."TYPE#"=10 OR
                  "O"."TYPE#"=11 OR "O"."TYPE#"=12 OR "O"."TYPE#"=13 OR "O"."TYPE#"=14 OR
                  "O"."TYPE#"=22 OR "O"."TYPE#"=87) AND ("U"."TYPE#"<>2 AND
                  SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' OR "U"."TYPE#"=2 AND
                  "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id')) OR  EXISTS
                  (SELECT 0 FROM SYS."USER$" "U2",SYS."OBJ$" "O2" WHERE "O2"."OWNER#"="U2"."USER#" AND
                  "O2"."TYPE#"=88 AND "O2"."DATAOBJ#"=:B2 AND "U2"."TYPE#"=2 AND
                  "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))))))
       8 - access("O"."SPARE3"="U"."USER#")
      10 - access("O"."OWNER#"="U"."USER#")
      12 - filter("O"."NAME"<>'_NEXT_OBJECT' AND "O"."NAME"<>'_default_auditing_options_'
                  AND BITAND("O"."FLAGS",128)=0 AND "O"."LINKNAME" IS NULL)
      13 - filter("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR "I"."TYPE#"=3 OR "I"."TYPE#"=4 OR
                  "I"."TYPE#"=6 OR "I"."TYPE#"=7 OR "I"."TYPE#"=9)
      14 - access("I"."OBJ#"=:B1)
      16 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','curren
                  t_edition_id')))
           filter("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','curren
                  t_edition_id')))
      17 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."USER#")
      21 - access("L"."OWNER#"="U"."USER#")
    Statistics
              0  recursive calls
              0  db block gets
           3397  consistent gets
             78  physical reads
              0  redo size
         908471  bytes sent via SQL*Net to client
          14213  bytes received via SQL*Net from client
           1256  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          18816  rows processed
    SQL>

  • Why does the Fireworks save for web function give better results than in Photoshop?

    Having used the trial version of Fireworks, I have noticed that the save for web function gives greater compression and image quality than saving for web in Photoshop. Why is this?
    As Adobe are not continuing in developing Fireworks, does anyone know if will they will improve the save for web function in Photoshop to match the Fireworks version?
    Are there any third party companies who anyone can recommend who will process large volumes of images for web?
    Thanks

    One of my favourite topics ;-P
    First, the save for web function in Photoshop has not seen any real updates in a long time. In Fireworks PNG export allows for fully transparent optimized files with indexed 256 or less colours, which is impossible in the save for web function in Photohop. It is unsupported.
    This is one of the reasons why Fireworks does a much better job than Photoshop. Another reason is that Photoshop adds meta junk in its exported files, and this also increases the file size (and should be removed, because there are also a number of fields which include information about your setup).
    One other caveat is that Photoshop's save for web functions neither allows for a choice in chroma subsampling, and instead decides automatically below a certain quality threshold to degrade the colour sharpness quality. The user has no control over this. (Fireworks also limits the user this way.)
    One thing to be careful of: FW's jpg quality setting, and PS's quality settings are very different - a 50 in Photoshop is not the same 50 setting in Fireworks.
    For jpg optimization I generally use RIOT (free): http://luci.criosweb.ro/riot/
    (When you install, be careful NOT to install the extra junkware!)
    Fireworks cannot change the chroma subsampling to 4:2:0, which does degrade the quality a bit compared to RIOT and Photoshop in my experience. Photoshop adds useless meta information, even if the user tells it not to do that. RIOT allows you to remove that information, saving 6k. RIOT also offers an automatic mode that optimizes existing jpg images without degrading the quality further, and often saves 10k or more, depending on the images.
    Interestingly enough, in my tests exported Fireworks jpg images are always reduced in file size by RIOT, due to FW's jpg export limitations, without any image degradation.
    In my tests FW's jpg quality versus file size turns out to be the worst of all three. RIOT generally wins, or is at least on par with Photoshop.
    As for PNG export, Photoshop's save for web function is quite abysmal. No 256 colour full transparency export is possible, while Fireworks does support this.
    Having said that, there is a free alternative that leaves both Photoshop AND Fireworks in the dust: Color Quantizer. http://x128.ho.ua/color-quantizer.html
    CQ is an amazing little tool: with it anyone can create PNG files with full transparency and reduced to ANY number of colours! It means that a 512 colour PNG with full transparency is now very easy to do. On top of that, for more difficult images a simple quality mask brush tool allows the user to control and retain even small colour details in a PNG, while reducing the file size to an absolute minimum.
    CQ is one of the best kept secrets of a Web Developer's toolkit. And it is free!
    Both RIOT and Color Quantizer have a built-in batch mode. Both are available for WIndows. Not for Mac. If you are on a Mac, try imageOptim. Not nearly as good as RIOT and CQ, but quite passable.
    PS to be fair, the newest versions of Photoshop do allow for export of 8bit PNGs with full transparency through the use of its Generator functionality. But again, it cannot compete with CQ. And as far as I am aware, Generator cannot be used in Photoshop's batch processing (which, btw, is very slow! For simpler daily image processing tasks I have to do in batches, I prefer IrfanView, which is lightning fast! IrfanView).

  • Will insert (ignore duplicates) have a better performance than merge?

    Will insert (ignore duplicates) have a better performance than merge (insert if not duplicate)?

    Ok. Here is exactly what is happenning -
    We had a table with no unique index on it. We used 'insert all' statement to insert record.
    But later when we found duplicates in there we started removing them manually.
    Now, to resolve the issue we added unique index and added exception handling to ignore DUP_VAL_ON_INDEX exception.
    But with this all records being inserted by 'INSERT ALL' statement gets ignored even if only one record is duplicate.
    Hence we have finally replaced 'insert all' with merge statement. Which inserts only if a corresponding record is not found (match based on column in unique index) in the table.
    But I am wondering how much performance will get impacted.

  • Better method of coding.

    In my program i have to take the name of the first record and store it in a variable.I am using this value down in my program. I am simulating the scenario with an
    example
    declare
    vname emp.ename%type;
    begin
    select * from
    (select ename into vname from emp where deptno in(10,20) and rownum =1)
    dbms_output.put_line (vname);
    end;
    ERROR at line 6:
    ORA-06550: line 5, column 15:
    PL/SQL: ORA-01744: inappropriate INTO
    ORA-06550: line 4, column 1:
    PL/SQL: SQL Statement ignored
    So i modified the code like this..
    declare
    vname emp.ename%type;
    begin
    for emprec in(select * from
    (select ename from emp where deptno in(10,20) and rownum =1))
    loop
    vname:=emprec.ename;
    end loop;
    dbms_output.put_line (vname);
    end;
    Is there any better method of doing this?

    declare
    vname emp.ename%type;
    begin
    select ename into vname from emp where deptno in(10,20) and rownum =1;
    dbms_output.put_line (vname);
    end;

  • Better method to search

    Hallo,
    the user want to habe a better method for searching.
    Example: 0customer. They want to have the change to search for M....er and geht all results like
    Maier, Meier, Mayer etc..... ist this possible.
    Thanks
    Santra

    Santra,
    M*er and then press F4...
    It doesn't work ?
    Bye,
    Roberto

  • Adobe has made upgrades with the Dreamweaver CS6 fluid grids. Is there a better tutorial than this?

    It there a better tutorial than this anywhere http://blogs.adobe.com/dreamweaver/2013/02/updated-fluid-grids-in-dreamweaver.html ? I can't seem to understand this guy. I know he means well. I really want to learn fluid grids. Thanks any reconmandations?

    If you want to learn to make responsive Web pages, do not rely on
    Adobe's fluid grid system. Learn CSS yourself. If you need to rely on a
    grid framework, then you are barking up the wrong tree. I can absolutely
    guarantee that if you do not fully understand the theories behind
    responsive design and you use the Adobe fluid grid (or the open source
    frameworks/scripts that Adobe uses) your site will eventually break.
    Study and learn. If you are sharp enough, you will quickly come to
    understand that nearly every article and tutorial on the subject is
    plain wrong. The essence of responsive design is very easy and does not
    require anyone's code but your own.
    Al Sparber - PVII
    http://www.projectseven.com
    The Finest Dreamweaver Menus | Galleries | Widgets
    Since 1998

  • A better method?

    Hi, I use Forte for Java development. I tried to define a menu with some items having icons but not other. How can I align vertically the menu_item_text from a popup composed from both icon and non icon menu items? For now I'am thinking to add an empty icon to the non icon items. Is there any better method?
    thanx

    Hi, I use Forte for Java development. I tried to define a menu with some items having icons but not other. How can I align vertically the menu_item_text from a popup composed from both icon and non icon menu items? For now I'am thinking to add an empty icon to the non icon items. Is there any better method?
    thanx

Maybe you are looking for

  • ProRes playback quality

    Hi all I am capturing HDV through the HDMI on a black magic intensity card using ProRes HQ which captures fine. My problem is when I monitor the playback of the captured clips on a HD TV the playback looks like it has a real problem with jaggies. I h

  • Problems with my HTML Editor

    Hi All, Here's my problem. I have created a text editor using HTML IFrame. In this IFrame , I am calling a .DOC (MS-WORD) file. This is all fine. The file opens in te IFrame but I'm unable 2 get the MS-Word toolbar so that I can edit the .DOC within

  • Is it possible to just show new posts of selected forums?

    Hi there, is there a possibility to just show new posts of selected forums? At vbulletin forums you can do this via  search.php?include=1,2,3 so I tried search.php?action=show_new&fid=20,30,33,47,42,24,50 here. But it only searches for the new posts

  • Scritps to create new user in portal

    Hi, anyone knows where can i get a script to create new users in portal?: add new user, add user in groups, set default group i've been trying to insert in the tables WWSEC_PERSON$ and WWSEC_FLAT$ but i couldnt get to see the user in portal applicati

  • [Bug?] DSC - Clusters Different between 'Read Alarm.vi' and 'Alarm and Event Query.vi" but Contain 'Same' Data

    Howdy! Why are the clusters different coming out of the Read Alarm.vi and the Alarm and Event Query.vi when they have the exact same data? The only difference is the order of two last elements. I am leaning towards bug on this one, unless these clust