Need a 'Time' Code More Efficient

Hi,
I have a script here that I have written to basically calculate a 'turn around time' using two number fields (arrival_time and departure_time). The script functions perfectly and succesfully uses a decode and sign function to make sure that none of the hours exceed 24.
However, as you will notice - the code is huge for something so simple - it really couldn't be more less efficient.
I am new (ish) to SQL so I'm happy that it works for now but the amount of code I have copied and pasted is silly - it takes longer than necessary to implement on an existing table.
Thanks in advance for any ways you can come up with to cut the code down:
UPDATE dw_dmcn.time_tester
UPDATE dw_dmcn.time_tester
SET TURN_AROUND = DECODE(SIGN(floor(((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60)/3600)), -1, (floor(((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60)/3600) + 24), 1, (floor(((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60)/3600)), 0, (floor(((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60)/3600))) ||
DECODE(round((((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60) -
floor(((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60)/3600)*3600 -
(floor((((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60) -
floor(((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60)/3600)*3600)/60)*60) )), 60, (floor((((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60) -
floor(((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60)/3600)*3600)/60) + 1), 0, floor((((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60) -
floor(((to_date('2008-01-01 '||lpad(departure_time, 4, '0'), 'yyyy-mm-dd hh24,mi') - to_date('2008-01-01 '||lpad(arrival_time, 4, '0'), 'yyyy-mm-dd hh24,mi'))*24*60*60)/3600)*3600)/60))
btw - i've forgot how to use the code tags in here, doesn't seem to work!?
Thanks again,
Dan
Edited by: Dan Mc on 16-Feb-2009 07:11                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Try Timestamp:
declare
ts1 timestamp;
ts2 timestamp;
tsResult VARCHAR2(30);
BEGIN
ts1 := to_timestamp('04-JUL-2008','DD-MON-YYYY');
ts2 := to_timestamp('20-OCT-2008 15:30:00','DD-MON-YYYY HH24:MI:SS');
tsResult :=  SUBSTR((ts2-ts1),1,30) ;
dbms_output.put_line('Time diff is ' || tsResult);
END;
Time diff is +000000108 15:30:00.000000000
PL/SQL procedure successfully completed.108 day, 15 hours, 30 minutes...
or if you need it in a select [from this site|http://www.akadia.com/services/ora_date_time.html]
SELECT SUBSTR(time1,1,30) "Time1",
       SUBSTR(time2,1,30) "Time2",
       SUBSTR((time2-time1),1,30) "Time1 - Time2"
FROM date_table;
Time1                          Time2                          Time1 - Time2
17-DEC-80 12.00.00.000000 AM   03-DEC-04 10.34.24.000000 AM   +000008752 10:34:24.000000 Either way, you can pick off whatever pieces you want with SUBSTR or REGEXP.

Similar Messages

  • Make Code More Efficient

    I got this code to play some audio clips and it works alright. The only issue is that when I call the play method it lags the rest of my game pretty badly. Is there anything in the play method you guys think could be moved to the constructor to make it more efficient?
    package main;
    import java.io.*;
    import javax.sound.sampled.*;
    public class Sound
         private AudioFormat format;
        private byte[] samples;
        private String name;
         public Sound(String filename)
              name=filename;
              try
                AudioInputStream stream =AudioSystem.getAudioInputStream(new File("sounds/"+filename));
                format = stream.getFormat();
                samples = getSamples(stream);
            }catch (Exception e){System.out.println(e);}
         public byte[] getSamples()
            return samples;
        private byte[] getSamples(AudioInputStream audioStream)
            int length=(int)(audioStream.getFrameLength()*format.getFrameSize());
            byte[] samples = new byte[length];
            DataInputStream is = new DataInputStream(audioStream);
            try
                is.readFully(samples);
            }catch (Exception e){System.out.println(e);}
            return samples;
        public void play()
             InputStream stream =new ByteArrayInputStream(getSamples());
            int bufferSize = format.getFrameSize()*Math.round(format.getSampleRate() / 10);
            byte[] buffer = new byte[bufferSize];
            SourceDataLine line;
            try
                DataLine.Info info=new DataLine.Info(SourceDataLine.class, format);
                line=(SourceDataLine)AudioSystem.getLine(info);
                line.open(format, bufferSize);
            }catch (Exception e){System.out.println(e);return;}
            line.start();
            try
                int numBytesRead = 0;
                while (numBytesRead != -1)
                    numBytesRead =
                        stream.read(buffer, 0, buffer.length);
                    if (numBytesRead != -1)
                       line.write(buffer, 0, numBytesRead);
            }catch (Exception e){System.out.println(e);}
            line.drain();
            line.close();
        public String getName()
             return name;
    }

    I don't know much about the guts of flex, but I assume it's
    based on Java's design etc.
    Storing event.target.selectedItem in an objet should not be
    anymore efficient than calling event.target.selectedItem. The objet
    will simply be a pointer of sorts to event.target.selectedItem. At
    no point in the event.target.selectedItem call are you doing a
    search or something, so storing the result will not result in any
    big savings.
    Now, if you were doing something like
    array.findItem(something) 4 times, then yes, it would be to your
    advantage to store the data.
    Keep in mind that storing event.target.selectedItem in an
    object will probably break bindings....that may or may not be a
    problem. Objet doesn't support binding. There is a subclass of
    Object that does, but I forget which.
    Just a suggestion based on my knowledge of how data is stored
    in an object oriented language...this may not be the case in
    flex.

  • Making code more efficient

    I am having a lot of trouble getting my code to work fast enough. I have 4 sonic anemometers and currently my code is only efficient enough to collect data from one. I have programs that run 2 sonic anemometers and save the data, but bites pile up at the port. The instruments are in unprompted mode and send data at 10hz. I find that using the wait command dose not work well for some reason so I have the loop continuously running. The first version of my code (V3a) worked for one sonic and bites did not pile up at the port. So I made (V3b) and tried to make a more efficient program. I tried separating things into multiple loops but, it still does not work well and was hoping to get some ideas to make things work better.
    I attached the 2 versions of my code. I am not sure if I should attach the subVIs, let me know.
    Thanks!
    Attachments:
    fo3csat_unprompted_v3a.vi ‏23 KB
    fo3csat_unprompted_v3b.vi ‏27 KB

    I'm going to ask you a very important question about that occurrence in the top loop: by using the occurrence the way you have, have you eliminated the possibility of a race condition? The answer is NO... study it, and you'll see why. If you can't figure it out, post back and I'll tell you why the race condition is still present.
    Also, if you ever are coding and thinking to yourself, "WOW, I can't believe the guys who developed LabVIEW made it so hard to do this simple task!", odds are, you're making it hard yourself! Rather than making 4 parallel branches of a numeric, converting to an ASCII string, then reinterpreting as 4 separate numerics, consider the following code. It's nearly equivalent, except my seconds has more significant digits (maybe good, maybe not):
    I'm going to argue that even splitting the discrete components of time is unnecessary, unless your logging protocol specifically requires that format. Instead, simply write the timestamp directly to file with the data points.
    Also, remember to use a standard 4x2x2x4 connector pane on your SubVIs. Refer to the LabVIEW Style Guide (search, and you will find it).
    Finally, I'm going to disagree with the other guys, it's not evident why you split the one loop into three loops. The only "producer/consumer" architecture has the top loop as the "producer", and all it's producing is a timestamp! This is not a typical or intended use of the producer/consumer architecture. Your VI is intended to only save a data point once every 30 minutes (presumably), so it's no big deal of both of your serial devices are in the same loop.
    The single biggest problem why your VI is completely railing out a CPU core (you didn't state this, but I'm guessing the reason you posting is because you noticed a core running at 100%!) is the unmetered loop rate... like the other guys say, drop a "Wait Until Next ms Multiple" and slow the loop rate down significantly. 10msec is probably too fast for your application.... actually, a loop rate of once every 30 minutes (that's 1800000msec) might be best.
    Let us know how it goes!
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • Help needed with timer codes

    i have tried to do a countdown timer but can't debug it.. can anyone help me with it or can anyone provide me with the correct coding for countdown timer..
    import java.awt.*;
    import java.Swing.*;
    import java.util.*;
    import java.awt.*;
    import java.Swing.*;
    import java.util.*;
    public class timer
         public static void main (String [] args)
              double sec = 150;
              countDown(sec);
         private Thread countDown(double seconds)
            final double time = seconds;
            Runnable runnable(){
                   public void run(){
                  try{
                    Thread.sleep(time * 1000);
                  }catch(Exception e){}
            return new Thread(runnable);
         public  void displayCountDown(){
           int seconds = 22;
           for(int i = 0; i < seconds; i++){
             Thread trd = countDown(i);
             trd.start(){
             while(trd.isAlive()){
               ; // wait
             System.out.print('\r');
             System.out.print(i);
    }

    I would suggest using javax.swing.Timer or java.util.Timer instead of implementing it yourself.

  • How can I make my code more efficient?

    Hello Everyone,
    I have a problem that is something like this:
    Say you have a database and inside that database you have a table called 'books' which has only 3 columns: id, title, author.
    Now let's say you have a servlet/jsp (servlet1) that expects a parameter called 'author' and it will display a list of all books by a certain author to the client. It will display this list such that each book is a link to another servlet/jsp (servlet 2)that accepts the book 'id' [primary key] as a parameter. Servlet 2 will display all the information about that book to the client.
    Servlet1 works by querying the database and building a list of beans, one of which will contain the same data as servlet 2 is going to need to display the book information. But I don't know how to make so that servlet2 can see the bean used in servlet 1. Right now servlet2 gets the primary key as a parameter and queries the database again. This can't be the right way to being going about this. Can anyone offer me some insight as to a better way to approach this problem?
    Thanks v. much.
    Chris Latimer

    put all the data you wish the 2nd servlet to recieve from the first servlet in a bean or object and pass it to the second. This works great with small amounts of data, but if you are going to have huge beans there are other ways of doing it.
    If you have huge beans, then you may consider updating/inserting into a table in the database and then reading the data from the table into the 2nd servlet.
    tnx,
    Les

  • 3 Table Joins -- Need a more efficient Query

    I need a 3 table join but need to do it more efficiently than I am currently doing. The query is taking too long to execute (in excess of 20 mins. These are huge tables with 10 mil + records). Here is what the query looks like right now. I need 100 distinct acctnum from the below query with all the conditions as requirements.
    THANKS IN ADVANCE FOR HELP!!!
    SELECT /*+ parallel  */
      FROM (SELECT  /*+ parallel  */  DISTINCT (a.acctnum),
                                  a.acctnum_status,
                                  a.sys_creation_date,
                                  a.sys_update_date,
                                  c.comp_id,
                                  c.comp_lbl_type,
                                  a.account_sub_type
                  FROM   account a
                         LEFT JOIN
                            company c
                         ON a.comp_id = c.comp_id AND c.comp_lbl_type = 'IND',
                         subaccount s
                 WHERE       a.account_type = 'I'
                         AND a.account_status IN ('O', 'S')
                        and s.subaccount_status in ('A','S')
                         AND a.account_sub_type NOT IN ('G', 'V')
                         AND a.SYS_update_DATE <= SYSDATE - 4 / 24)
    where   ROWNUM <= 100 ;

    Hi,
    Whenever you have a question, post CREATE TABLE and INSERT statements for a little sample data, and the results you want from that data.  Explain how you get those results from that data.
    Simplify the problem, if possible.  If you need 100 distinct rows, post a problem where you only need, say, 3 distinct rows.  Just explain that you really need 100, and you'll get a solution that works for either 3 or 100.
    Always say which version of Oracle you're using (e.g. 11.2.0.3.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    For tuning problems, also see https://forums.oracle.com/message/9362003
    Are you sure the query you posted is even doing what you want?  You're cross-joining s to the other tables, producing all possible combinations of rows, and then picking 100 of those in no particular order (not even random order).  That's not necessarily wrong, but it certainly is suspicious.
    If you're only interested in 100 rows, there's probably some way to write the query so that it picks 100 rows from the big tables first. 

  • I want a new and more powerful (non-Apple) wireless router but I still want to use my existing Time Capsule to continue with my Time Machine backups and I still need the Time Capsule's Network Attached Storage (NAS) features and capabilities

    THE SHORTER STORY
    My goal is to successfully use my existing Time Capsule (TC) with a new and more powerful wireless router. I need a new and more powerful wireless router in order to reach a distant Denon a/v receiver that is physically located in a master bedroom some 50 feet away from my modem. I need to provide this Denon a/v receiver with an Internet connection so that it can obtain its firmware updates and I need to connect this Denon a/v receiver to my network in order to use its AirPlay feature. I believe l still need the TC's Network Attached Storage (NAS) features because I am not sure if the new wireless router will provide me with the NAS like features / capabilities I need to share files between my two Apple laptops with OS X 10.8.2. And I know that I absolutely need my TC's seamless integration with Apple's Time Machine (TM) application in order to continue to make effortless backups of my two Apple laptops. To my knowledge nothing works with TM like Apple's TC. I also need the hard disk storage space built into the TC.
    I cannot use a long wired Ethernet cable connection in this apartment and I cannot use power-line adapters. I have read that wireless range extenders and repeaters are difficult to successfully set-up and that they will reduce data speeds, especially so when incorrectly set-up. I cannot relocate my modem and/or primary base station wireless router.
    In short, I want to use my TC with my new and more powerful wireless router. I need to stop using the TC to connect to the modem. However, I still need the TC for seamless TM backups. I also need to use the TC's built in hard drive for storage. And I may still need the TC's NAS capabilities to share files wirelessly between laptops because I am assuming the new wireless router will not provide NAS capabilities for OS X 10.8.2 (products like this/non-Apple products rarely seem to work with OS X 10.8.2/Macs to provide NAS features and capabilities). Finally, I want to continue to use my Apple laptop and AirPlay to wirelessly access and play my iTunes music collection stored on the TC's hard drive. I also want to continue to use my Apple laptop, AirPlay and Apple TV to wirelessly watch movies and TV shows stored on the additional external hard drive connected to the TC via USB. Can someone please advise on how to set-up my new Asus wireless router with my existing TC in such a way to accomplish all of this?
    What is the best configuration or set-up to accomplish my above goals?
    Thank you in advance for your assistance!!!
    THE FULL STORY
    I live in an apartment building where my existing Time Capsule (TC) is located in my living room and serves many purposes. Specially, my TC is at least all of the following:
    (1) Wi-Fi router connected to Comcast Internet service via Motorola SB6121 cable modem - currently the TC is the Wi-Fi base station that connects to the modem and has the gateway address to the Internet. The TC now provides the DHCP service for the Wi-Fi network.
    (2) Wireless router providing Internet and Wi-Fi network access to several Wi-Fi clients - two Apple laptop computers, an iPod touch, an iPad and an iPhone all connect wirelessly to the Internet via the TC.
    (3) Wired Ethernet router providing Internet and Wi-Fi network access to three different devices - a Panasonic TV, LG Blu-Ray player and an Apple TV each use one of the three LAN ports on the back of the TC to gain access to the Internet.
    (4) Primary base station in my attempt to extend my wireless network to a distant (located far away) Denon a/v receiver requiring a wired Ethernet connection - In addition to the TC, which is my primary base station, I am also using a second extended Wi-Fi base station (a Netgear branded product) to wirelessly extend my WiFi network to a Denon receiver located in the master bedroom and requiring a wired Ethernet connection. I cannot use a wired Ethernet connection to continuously travel from the living room to the master bedroom. The distance is too great as I cannot effectively hide the Ethernet cable in this apartment.
    (5) Time Machine (TM) backup facilitator - I use my TC to wirelessly back-up two Apple laptops using Apple's Time Machine (TM) application. However, I ran out of storage space on my TC and therefore added external storage to it. Specifically, I added an external hard drive to my TC via the USB port on the back of the TC. I now use this added external hard drive connected to the TC via USB as the destination storage drive for my TM back-ups. I have partitioned the added external hard drive, and each of the several partitions all have enough storage space (e.g., each of the two partitions used by TM are sized at three times the hard drive space of each laptop, etc.). Everything works flawlessly.
    (6) Network Attached Storage (NAS) - In addition to using the TC's Network Attached Storage (NAS) capabilities to wirelessly back-up two Apple laptops via TM, I also store other additional files on both (A) the hard drive built into the TC and (B) the additional external hard drive connected to the TC via USB (there are additional separate partitions on this drive for these other additional and non-TM backup files).
    I use the TC's NAS feature with my Apple laptop and AirPlay to wirelessly access and play my iTunes music collection stored on the TC's hard drive. I also use my Apple laptop, AirPlay and Apple TV to wirelessly watch movies and TV shows stored on the additional external hard drive connected to the TC via USB. Again, everything works wirelessly and flawlessly. (Note: the Apple TV is connected to the network via Ethernet and a LAN port on the back of the TC).
    The issue I am having is when I try to listen to music via Apple's AirPlay in the master bedroom. This master bedroom is located at a distance of two rooms away from the TC's current location in the living room, which is a distance of about 50 feet. This apartment has a long rectangular floor plan where each room is connected to the next in a straight line. In order to use AirPlay in the master bedroom I am using a second extended Wi-Fi base station (a Netgear branded product) to wirelessly extend my WiFi network to a Denon receiver located in the master bedroom and requiring a wired Ethernet connection. This additional base station connects wirelessly to the WiFi network provided by my TC and then gives my Denon receiver the wired Ethernet connection it needs to use AirPlay. I have tried moving my iTunes music directly onto my laptop's hard drive, and then I used AirPlay on this same laptop to connect to the Denon receiver. I always get a successful connection and the song plays, but the problem is that the connection inevitably drops.
    I live in an apartment building and all of the many wireless routers in this building create a great deal of WiFi interference on both the 2.4 GHz and 5GHz bands. I have tried connecting the Netgear product to each the 2.4 and 5 GHz bands, but neither band can successfully maintain a wireless connection between the TC and the Netgear product. I also attempted to maintain a wireless connection to an iPod touch using the 2.4 GHz band and AirPlay on this iPod touch to play music on the Denon receiver. Again, I was able to establish a connection and successfully play music, but after a few minutes the connection dropped and the music stopped playing. I therefore have concluded that I have a poor wireless connection in the master bedroom. I can establish a connection, but it is intermittent with frequent drops. I have verified this with both laptops by working in the master bedroom for an entire day on both laptops. The Internet connection in this master bedroom proved to drop out frequently - about once an hour with the laptops. The wireless connection and the frequency of its dropout are far worse with the iPod touch and an iPhone.
    I cannot relocate the TC. Also, this is an apartment and I therefore cannot extend the range of my network with Ethernet cable (I cannot drill through walls/ceilings, etc.). It is an old building with antiquated wiring and power-line adapters are not likely to function properly, nor can I spare the direct power outlet required with a power-line adapter. I simply need every outlet I can get and cannot afford to block any direct outlet.
    My solution is to use a more powerful wireless router. I found the ASUS RT-AC66U Dual-Band Wireless-AC1750 Gigabit Router which will likely provide a better connection to my wireless Internet in the master bedroom than the TC. The 802.11ac band of this Asus wireless router is totally useless to me, but based on what I have read I believe this router will provide a stronger connection at greater distances then my TC. And I will be ready for 802.11ac when it becomes more widely available.
    However, I still need to maintain the TC's ability to work seamlessly with TM to backup my two laptops. Also, I doubt the new Asus router will provide OS X 10.8.2 with NAS like features and capabilities. Therefore, I still would like to use the TC's NAS capabilities to share files on my network wirelessly assuming the Asus wireless router fails to provide this feature. I need a new and more powerful wireless router, but I need to maintain the TC's NAS features and seamless integration with TM. Finally, I want to continue to use my Apple laptop and AirPlay to wirelessly access and play my iTunes music collection stored on the TC's hard drive. I also want to continue to use my Apple laptop, AirPlay and Apple TV to wirelessly watch movies and TV shows stored on the additional external hard drive connected to the TC via USB. Can someone advise on how to set-up my existing TC with this new Asus wireless router in such a way to accomplish all of this?
    Modem
    Motorola SB6121 SURFboard DOCSIS 3.0 Cable Modem
    Existing Wireless Router and Primary Wi-Fi Base Station - Apple Time Capsule
    Apple Time Capsule MC343LL/A 1TB Sim DualBand (purchased June 2010, likely the Winter 2009 Model)
    Desired New Wireless Router and Primary Wi-Fi Base Station - Non-Apple Asus
    ASUS RT-AC66U Dual-Band Wireless-AC1750 Gigabit Router
    Extended Wi-Fi Base Station - Provides an Ethernet Connection to a Denon A/V Receiver Two Rooms Away from the Modem
    Netgear Universal Dual Band Wireless Internet Adapter for TV & Blu-Ray (WNCE3001)
    Addition External Hard Drive Attached to the Existing Apple Time Capsule via USB
    WD My Book Studio 4TB Mac External Hard Drive Storage USB 3.0
    Existing Laptops on the Wireless Network Requiring Time Machine Backups
    MacBook Air (11-inch, Mid 2012) OS X 10.8.2
    MacBook Pro (13-inch Mid 2010) OS X 10.8.2
    Other Existing Apple Products (Clients) on the Wireless Network
    iPod Touch (second generation) is model A1288.
    iPad (1st generation)
    Apple TV (3rd generation) - Quantity two (2)

    Thanks Bob Timmons.
    In regards to a Plan B, I hear ya brother. I am already on what feels like Plan Z. Getting WiFi to a far off room in an apartment building crowded with WiFi routers is a major pain.
    I am basing my thoughts on the potential of a new and more powerful router reaching the far off master bedroom based on positive reviews on cnet.com, pcmag.com and pcworld.com. All 3 of these web sites have reviewed the Asus RT-AC66U 802.11AC wireless router as well as its virtual twin cousin 802.11n router. What impressed me is that all 3 sites rated this router #1 overall in terms of both range and speed (in both the 802.11n and 802.11AC flavors). They tested the router in real world scenarios where the router needed to compete with a lot of other wireless routers. One of the sites even buried this Asus router in a media room with thick walls and inside a media cabinet. This Asus router should be able to serve my 2.4 GHz band wireless clients (iPod Touch and iPhone 4) with a 2.4GHz Wireless-N band offering some 50 feet of dependable range and a 60 Mbps throughput at that range. I am hoping that works, but it's borderline for my master bedroom. My 5 GHz wireless clients (laptops) will enjoy a 5GHz Wireless-N band offering 150 feet of range and a 200 Mbps throughput at that range. I have no idea what most of that stuff means, but I did also read that Asus could reach 300 feet and I got really excited. My mileage may vary of course and I'm sure I'm making some mistakes in my interpretation of their data. However, my Winter 2009 Time Capsule was rated by cnet.com to deliver real world performance of less than that, and 802.11AC may or may not be useful to me someday. But when this Asus arrives and provides anything other than an excellent and consistent wireless signal without drops in the master bedroom it's going right back!
    Your solution sounds great, but I have some questions. I'm using OS X 10.8.2 and Airport Utility (version 6.1 610.31) and on its third tab labeled "Wireless" the top option enables you to set "Network Mode" to either:
    Create a wireless network
    Extend a wireless network
    Off
    Given your advice to "Turn off the wireless on the TC," should I set Network Mode to Off? Sorry, I'm clueless in regards to how to turn off the wireless on the TC any other way. Can you provide specific steps on how to turn off the wireless on the TC? If what I wrote is correct then what should the rest of this Wireless tab look like, or perhaps it is irrelevant when wireless is off?
    Next, what do you mean by "Configure the TC in Bridge Mode?" Under Airports Utility's fourth tab labeled "Network" the top option "Router Mode" allows for either:
    DHCP and Nat
    DHCP Only
    Off (Bridge Mode)
    Is your advice to Configure the TC in Bridge Mode as simple as setting Router Mode to Off (Bridge Mode)? If yes, then what should the rest of this "Network" tab look like? Anything else involved in configuring the TC in Bridge Mode or is it really as simple as setting the Router Mode to "Off (Bridge Mode)"?
    How about the other tabs in Airport Utility, can they all stay as is assuming I use the same network name and password for the new Asus wireless router? Or do I need to make any other changes to the TC via Airport Utility?
    Finally, in regards to your Plan B suggestion. I agree. But do you have a Plan B for me? I would greatly appreciate any alternative you could provide. Specifically, if you needed a TC's Internet connection to reach a far off corner of your home how would you do it? In the master bedroom I need both a wired Ethernet connection for the Denon a/v receiver and wireless Internet connection for the iPhone and iPod Touch.
    Power-Line Adapters - High Cost, Blocks at Least One Wall Outlet and Does Not Solve the Wireless Need
    I actually like exactly one power-line adapter, which is the D-Link DHP-540 PowerLine AV 500 4-Port Gigabit Switch. This D-Link power-line adapter plugs into your wall outlet with a normal sized plug (regular standard power cord much like any other electronic device) instead of all of the other recommended power-line adapters that not only use at least one wall outlet but also often block the second outlet. You cannot use a power strip with a power-line adapter which is very impractical for me. And everything about my home is strange and upside down. The wiring here is a disaster and I don't have faith in its ability to carry Internet access from the living room to the master bedroom. And this D-Link power-line adapter costs $90 each and I need at least two to make the connection to the Denon A/V receiver. So, $180 on this solution and I still don't have a dependable drop free wireless connection in the master bedroom. The Denon might get its Ethernet Internet connection from the power-line adapter, but if I want to use an iPhone 4 or iPod Touch to stream AirPlay music to the Denon wirelessly (Pandora/iTunes, etc.) from the master bedroom the wireless connection will not be stable in there and I've already spent $190 on just the two power-line adapters needed.
    Extenders / Repeaters / Wirelessly Extending the Wireless Network
    I have also read great things about the Amped Wireless High Power Wireless-N 600mW Gigabit Dual Band Range Extender (Repeater) SR20000G and the My Net Wi-Fi Range Extender. The former is very powerful and the latter is easier to install. Both cost about $150 ish so similar to a new Asus router. However, everything I read about Range Extenders points to them not being very effective for a far off corner of your house wherein it's apparently hard to place the range extender in the sweet spot where it both gets a strong enough signal to actually effectively extend the wireless signal and otherwise does not reduce network throughput speeds to unacceptable speeds.
    Creating a Roaming Network By Hard Wiring with Ethernet Cable - Wife Would Say, "**** No!"
    Even Apple seems to warn against wirelessly extending your network (see: http://support.apple.com/kb/HT4145#) and otherwise strongly recommends a roaming network where Ethernet cable is used to connect two wireless base stations. However, I am in an apartment where stringing together two wireless base stations with Ethernet cable would have an extremely low wife acceptance factor (WAF). I cannot (both contractually and from a skill prospective) hide Ethernet wire in the walls or ceiling. And having visible Ethernet cable running from room-to-room would be unacceptable, especially to the wife.
    So what is left? Do you have a Plan B for me? Thanks in advance for your help!

  • I need a more efficient method of transferin​g data from RT in a FP2010 to the host.

    I am currently using LV6.1.
    My host program is currently using Datasocket to read and write data to and from a Field Point 2010 system. My controls and indicators are defined as datasockets. In FP I have an RT loop talking to a communication loop using RT-FIFO's. The communication loop is using Publish to send and receive via the Datasocket indicators and controls in the host program. I am running out of bandwidth in getting data to and from the host and there is not very much data. The RT program includes 2 PID's and 2 filters. There are 10 floats going to the Host and 10 floats coming back from the Host. The desired Time Critical Loop time is 20ms. The actual loop time is about 14ms. Data is moving back and forth between Host and FP several times a second without regularity(not a problem). If I add a couple more floats each direction, the communications goes to once every several seconds(too slow).
    Is there a more efficient method of transfering data back and forth between the Host and the FP system?
    Will LV8 provide faster communications between the host and the FP system? I may have the option of moving up.
    Thanks,
    Chris

    Chris, 
    Sounds like you might be maxing out the CPU on the Fieldpoint.
    Datasocket is considered a pretty slow method of moving data between hosts and targets as it has quite a bit of overhead assosciated with it.  There are several things you could do. One, instead of using a datasocket for each float you want to transfer (which I assume you are doing), try using an array of floats and use just one datasocket transfer for the whole array.  This is often quite a bit faster than calling a publish VI for many different variables.
    Also, as Xu mentioned, using a raw TCP connection would be the fastest way to move data.  I would recommend taking a look at the TCP examples that ship with LabVIEW to see how to effectively use these. 
    LabVIEW 8 introduced the shared variable, which when network enabled, makes data transfer very simple and is quite a bit faster than a comparable datasocket transfer.  While faster than datasocket, they are still slower than just flat out using a raw TCP connection, but they are much more flexible.  Also, the shared variables can fucntion in the RT fifo capacity and clean up your diagram quite a bit (while maintaining the RT fifo functionality).
    Hope this helps.
    --Paul Mandeltort
    Automotive and Industrial Communications Product Marketing

  • Need to see the Time code when playing

    I need to send, on a DVD, a project I'm working on to someone so he can see the time code as the movie is playing. Anyone have any ideas as to what I can do, either imovie 11, or outside of it?

    Top right corner, press the tiny album cover art.

  • Can we replace this SELECT query by more efficient code

    can we replace this SELECT query by more efficient code ?:-
    SELECT * FROM zv7_custord
         INTO TABLE G_T_ZV7_CUSTORD
         WHERE ( SENDER in S_SENDER and
                 ORDNUM in S_ORDER  and
                 ZDATE   in S_DATE ) OR
               ( SENDER in S_SENDER AND
                 STATUS = SPACE )
         ORDER BY IDOCNUM.

    Hi
    U can leave ORDER BY option and sort the table by yourself and try to split the query:
    SELECT * FROM zv7_custord
         INTO TABLE G_T_ZV7_CUSTORD
         WHERE  SENDER in S_SENDER and
                       ORDNUM in S_ORDER  and
                       ZDATE   in S_DATE .
    SELECT * FROM zv7_custord
         APPENDING TABLE G_T_ZV7_CUSTORD
         WHERE  SENDER in S_SENDER        and
                       NOT ORDNUM in S_ORDER  and
                       NOT ZDATE   in S_DATE       and
                       STATUS = SPACE
    or
    SELECT * FROM zv7_custord
         INTO TABLE G_T_ZV7_CUSTORD
         WHERE  SENDER in S_SENDER and
                       ORDNUM in S_ORDER  and
                       ZDATE   in S_DATE .
    SELECT * FROM zv7_custord
         APPENDING TABLE G_T_ZV7_CUSTORD
         WHERE  SENDER in S_SENDER        and
                       STATUS = SPACE.
    * Sort the table key fields
    SORT G_T_ZV7_CUSTORD BY <KEY1> <KEY2> .....
    DELETE ADJACENT DUPLICATES FROM G_T_ZV7_CUSTORD COMPARING <KEY1> .....
    Max

  • Creating a time channel in the data portal and filling it with data - Is there a more efficient way than this?

    I currently have a requirement to create a time channel in the data portal and subsequently fill it with data. I've shown below how I am currently doing it:
    Time_Ch = ChnAlloc("Time channel", 271214           , 1      ,           , "Time"         ,1                  ,1)              'Allocate time channel
    For intLoop = 1 to 271214
      ChD(intLoop,Time_Ch(0)) = CurrDateTimeReal          'Create time value
    Next
    I understand that the function to create and allocate memory for the time channel is extremely quick. However the time to store data in the channel afterwards is going to be highly dependent on the length I have assigned to the Time_Ch. In my application the length of Time_Ch is variable but could easily be in the order of 271214 or higher. Under such circumstances the time taken to fill Time_Ch is quite considerable. I am wondering whether this is the most appropriate way of doing things or whether there is a more efficient way of creating a time channel and filling it.
    Thanks very much for any help.
    Regards
    Matthew

    Hi Matthew,
    You are correct that there is a more efficient way to do this.  I'm a little confused about your "CurrDateTimeReal" assignment-- is this a constant?  Most people want a Time channel that counts up linearly in seconds or fractions of a second over the duration of the measurement.  But that looks like you would assign the same time value to all the rows of the new Time channel.
    If you want to create a "normal" Time channel that increases at a constant rate, you can use the ChnGenTime() function:
    ReturnValue = ChnGenTime(TimeChannel, GenTimeUnit, GenTimeXBeg, GenTimeXEnd, GenTimeStep, GenTimeMode, GenTimeNo)
    If you really do want a Time channel filled with all the same values, you can use the ChnLinGen() function and simply set the GenXBegin and GenXEnd parameters to be the same value:
    ReturnValue = ChnLinGen(TimeChannel, GenXBegin, GenXEnd, XNo, [GenXUnitPreset])
     In both cases you can use the Time channel you've already created (which as you say executes quickly) and point the output of these functions to that Time channel by using the Group/Channel syntax of the Time channel you created for the first TimeChannel parameter in either of the above functions.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Why does my laptop give me a warning saying that firefox is using too much memory and to restart firefox to be more efficient? I just bought this laptop so I know it has the power to run what I need it to.

    Why does my laptop give me a warning saying that firefox is using too much memory and to restart firefox to be more efficient? I just bought this laptop so I know it has the power to run what I need it to.

    You appear to have AVG installed:
    *See --> http://forums.avg.com/ww-en/avg-forums?sec=thread&act=show&id=173969#post_173969
    From reading on the internet, it appears that when there is a spike in memory usage, AVG "interprets" that as a memory leak, possibly caused by malware. AVG could be incorrect concerning that assumption. Maybe they are being a bit too conservative about memory usage; just my opinion.
    The decision is yours to turn off the "advisor" or leave it on.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *'''''Adobe PDF Plug-In For Firefox and Netscape''''': [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *'''''Next Generation Java Plug-in for Mozilla browsers''''': [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • I have 1TB time capsule and i need to back up more media. Can i also use a 3TB time capsule asswell?

    i have 1TB time capsule and i need to back up more media. Can i also use a 3TB time capsule asswell?

    You can, but it is not possible to continue backups "seamlessly" from one Time Capsule to the other.
    Time Machine will make a new complete backup of each Mac on the first pass when you connect the new 3TB Time Capsule.

  • How to make it more efficient

    Hi,
    I am working on AQ where I am just sending and receiving simple messages. But the performance is very poor. It takes around 35 seconds to send (enqueue) just 100 messages which is not acceptable for our project. Can someone help me how to make it more efficient. I am using JMS for sending and receiving messages.
    Thanks,
    Sateesh

    Bhagath,
    Thanks for your help.
    Oracle server we are using is 8.1.7. We are using JDBC client that ships with Oracle client (classes12.zip).
    Right now we are working on point to point messages.
    I am just wondering whether I need to do any tuning on server.
    Your help is greately appreciated.
    Here I am pasting sample code that I wrote which may help in finding the problem.
    Thank you so much once again for your help.
    -Sateesh
    import java.sql.*;
    import javax.jms.*;
    import java.io.*;
    import java.util.Properties;
    import oracle.AQ.*;
    import oracle.jms.*;
    public class CDRQueueSender {
    private final String DB_CONNECTION = "jdbc:oracle:thin:@dev1:1521:dev";
    protected final String DB_AQ_ADMIN_NAME = "dev78";
    private final String DB_AQ_ADMIN_PASSWORD = "dev78";
    /** DB AQ user agent name and password */
    private final String DB_AQ_USER_NAME = "dev78";
    private final String DB_AQ_USER_PASSWORD = "dev78";
    private QueueConnectionFactory queueConnectionFactory = null;
    private QueueConnection connection = null;
    private QueueSession session = null;
    private Queue sendQueue;
    private QueueSender qSender;
    public CDRQueueSender() {
    try {
    Properties info = new Properties();
    info.put(DB_AQ_USER_NAME, DB_AQ_USER_PASSWORD);
    queueConnectionFactory = AQjmsFactory
    .getQueueConnectionFactory(DB_CONNECTION, info);
    connection = queueConnectionFactory.
    createQueueConnection(DB_AQ_USER_NAME,
    DB_AQ_USER_PASSWORD);
    session = connection.createQueueSession(
    true, Session.AUTO_ACKNOWLEDGE);
    connection.start();
    sendQueue = ((AQjmsSession) session).getQueue (DB_AQ_ADMIN_NAME,"CDR_QUEUE");
    qSender = session.createSender(sendQueue);
    catch (Exception ex) {
    ex.printStackTrace();
    public boolean sendCDRMessage(CDRMessage messageData)
    throws JMSException, SQLException {
    ObjectMessage objectMessage = session.createObjectMessage(messageData);
    try {
    qSender.send(objectMessage);
    session.commit();
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    return true;
    public void close() throws JMSException {
    session.close();
    connection.close();
    public static void main(String[] args) throws SQLException, JMSException {
    int count = 0;
    CDRQueueSender qSender = new CDRQueueSender();
    long startTime = System.currentTimeMillis();
    long endTime;
    CDRMessage message;
    while(count < 100) {
    message = new CDRMessage("filename", 20, "This is testing", count);
    qSender.sendCDRMessage(message);
    count++;
    //qSender.sessionCommit();
    endTime = System.currentTimeMillis();
    System.out.println("time taken to process 100 records is " +
    ((endTime - startTime)/1000) + " seconds");
    qSender.close();

  • Are multiple processes more efficient in Solaris 2.6 ?

    I am running performance measurement tests in a Solaris 2.6 environment. The tests run one message at a time through my application and measure the response time. I found that my app will process the test message more quickly when multiple instances of the (single threaded) app are running.
    This runs contrary to my intuition - since only one message is available in the message queue for processing at one time, the performance should be the same, with one or several instances running.
    Does Solaris 2.6 run programs more efficiently when multiple instances exist?
    I ran sar with various options, and some of the results vary, but I'm not sure which results are significant.
    Thanks -

    Your thinking is a little off.
    What you are seeing is an attribute of a multi-processing operating system. I'm going to explain this wrong but hopefully the theme is correct. One characteristic is a single process runs on the CPU for a specific time quantum. If the process uses all of its time quantum, it gets forced off the CPU and its priority gets raised - meaning the potential that more processes could knock it off of the CPU cuz their priority is better. If it voluntarily releases the CPU, its priority gets lowered - means it may be the CPU more often if and when it needs it.
    So maybe your CPU can phsyically handle 10 operations/sec. Because of scheduling topics (time quantums, interrupts, etc) and the nature of single threaded apps, that single threaded performance process of yours may only get 2 operations/sec all by itself.. By increasing the number of processes you run to say 5, you'll get your 10 operations/sec. Increasing it to 6 processes, you might get 10.5 operations/sec but you've reached your point of limited return and may start slowing thing down.
    There are several good books on performance and high level queueing theory which can explain this much better then I just did.

Maybe you are looking for

  • Cannot find my printer over the network

    Hi, I've been using my printer (HP Photosmart C6100 All-in-one) for some time... till today. I tried to print one document and got an error, that printer cannot be found. System and printer restart - no effects. I removed the printer under system pre

  • Nano "iPod service error" cured...?

    I had to set up a Nano for a client, and he was having the same issues everyone else has been having (service errors, not recognized in iTunes, etc.) Here's what I did to get it to work (after 3 hours of troubleshooting)(by the way, this was posted i

  • Display of change documents: Material BOM

    Hi, Using transaction CS80, I wish to display the changes made to a material BOM. However I could not see any output although I know I have made quite a lot of changes to that material BOM. Am I missing some config or data set-up?? Thanks in advance

  • Height of the richtexteditor dialog

    Can we set the height of the richtext editor dialog? Is it possible to show more than 8 lines in the Rich Text component? When formatting multiple lines of text, it is easier to have more lines visible in the component dialog, having more room to wor

  • Customer master contacts - Download

    Is there a standard transaction, program, Query to download customer master contacts? Writing a custom program is an option, I checking the standard functionality.