Improve The Current Implementation Of A Simple JQuery Filtering Engine

The filtering option on my site appears to be behaving erratically, and not returning the closest result (i.e. items that best match the set filters), but rather "generalising" across the board. I think that this is down to the manner in which
I have implemented the if-else statement that handles the filtering. I think that it would work well if there was just one option, but now that there are multiple, any options selected later would simply be overridden by earlier ones.
What would be the best way to improve the current implementation of my filtering engine, so that it would make matches more effectively?
$('body').on('click', '#reset-button', function (event) {
$('.rideshare-item').show();
$('body').on('click', '#search-button', function (event) {
// Collect values
var date = $('.date').val().trim();
var time = $('.time').val();
var seatsAvailable = $('.seats-available').val();
var womenOnly = $("input[name='women-only']:checked").length ? "Yes" : "No";
var luggageSpace = $("input[name='luggage-space']:checked").length ? "Yes" : "No";
$('.rideshare-item, .no-result').hide();
$('.rideshare-item').each(function (a, b) {
var rideshareDate = $(b).data('date');
var rideshareTime = $(b).data('time');
var rideshareSeats = $(b).data('seats');
var rideshareWomen = $(b).data('women');
var rideshareLuggage = $(b).data('luggage');
if (date.length == 0) {
$(this).closest('.rideshare-item').show();
} else if (date.length > 0) {
var timestamp = Date.parse(date)
if (isNaN(timestamp) == false) {
if (parseDateEntry(date).getTime() == parseDateAttribute(rideshareDate).getTime()) {
$(this).closest('.rideshare-item').show();
// additional if-else statements can be found on the jsfiddle
if (rideshareSeats > seatsAvailable) {
$(this).closest('.rideshare-item').show();
if (womenOnly == rideshareWomen) {
$(this).closest('.rideshare-item').show();
if (luggageSpace == rideshareLuggage) {
$(this).closest('.rideshare-item').show();
The jsfiddle here contains a working example:
http://jsfiddle.net/gpk1f11o/

and...

Similar Messages

  • Will URLS (Unified light speed) improves the current app. perf. as well ?

    Hi,
    We are using ABAP webdynpro application that encapsulates Interactive PDF as well. But it's performance is not good.
    Normally it takes 30-50 seconds when user opens the workitem from UWL which further calls the webdynpro application and shows the pdf to user.
    My question is if we go for EHP1 for NW that will give Unified Rendering Light Speed in Web Dynpro ABAP  then will this technology helps to improve the current webdynpro application performance or only the new applications that will be built using this.
    Please suggest me for this or tell me the other way to improve the performance of webdynpro application.
    Thanks,
    Rahul

    Hi Rahul,
    The new light speed rendering engine is the rendering framework to render the Webdynpro applications. Therefore there is nothing where by you specify that a particular application is developed using the Light speed rendering engine.
    In other words to answer your question, EHP1 will improve the performance for all the applications whether developed on EHP1 or developed prior to EHP1.
    Regards
    Rohit Chowdhary

  • Charm implementation: No maintenance cycle is open for the current system

    Gurus,
    I'm in implementation project to use charm.
    I've created SDCR using charm_create, and choose transaction type subject "Development (implementation)"
    After approving the change request, so that the status become "Approved", I re-open the request to set into "in development", but there's error:
    "No maintenance cycle is open for the current system"
    I've checked notes and search the forum but not relevant to my subject.
    Please help.
    Regards,

    Hi Cesar,
    I'm facing this issue now. I have followed Dolores blog
    - The IBase is wrong: The IBase/component must represent the production system in the project landscape. RP1 is my production
    - Lack of authorizations: Assign role "SAP_SOCM_ADMIN" or "SAP_CM_ADMINISTRATOR_COMP" (or equivalent) to the user who would like to approve the change request. I have updated all roles and given the users SAP_ALL
    - Project is locked in table /TMWFLOW/PROJMAP: If an error is detected during the processing, then the project might be locked in this table. The customer can unlock it by pressing the refresh button under tab "System Landscape" -> "Change Requests". If there are other error messages shown during the refresh process, the customer must fix those errors beforehand. Refreshed it many times without errors
    I'm on the latest level of Solman 7.1 SP8, I have implemented all the new notes as well.
    I have attached a screenshot
    To me it seems like a bug, but haven't found anything on marketplace. Any help is much appreciated.
    Cheers
    Jimmy

  • Will Apple improve the earbud structure? The current ones kill my ears. For the price consumers pay for these products, we should receive top notch earbuds that fit the ear.

    Will Apple improve the earbud structure? The current ones kill my ears. For the price consumers pay for these products, we should receive top notch earbuds that fit the ear.

    Some phones that you can buy do not come with headphones at all.
    http://apple.com/feedback

  • Is there a way to figure out what the current thread is?

    I've got the following snippet of code:
    // create a new thread. If the current thread is not this new thread, return
    Thread CountDownThread = new Thread("CountDownThread");
    CountDownThread.start();
    if (/*CURRENT THREAD*/.getName() != CountDownThread.getName()) {
         System.out.println ("I'm not CountDownThread. I'm leaving.");
         return;
    // current thread should be new thread. Therefore start the countdown
    CurrTime = InitTime;
    while(CurrTime.charAt(0) != '-') {      // go until current time is negative
         CurrTime = C.countDown();       // returns the current time based on the difference between the initial and elapsed time
         setText(CurrTime);                   // display current time in JLabel
    C.reset();
    setText(C.getCurrTime());What I'm trying to do is get a clock (C) to count down and display the time remaining in a JLabel (this snippet is taken from a method within that very JLabel which I'm extending from javax.swing.JLabel). While it's counting down, I'd like for the program to go off and do other things. Therefore, I'm trying to create a new thread that carries out the task of counting down while the original/main thread moves on to do other things.
    Please have a look at the above code and tell me if I'm on the right track. The one thing I don't know how to do is figure out how to tell which thread the current thread is. I'm assuming that both the new thread and original/main one will execute the if statement, the new one after it returns from start() (which I haven't defined). The original/main one will detect that it is not the new thread and return, whereas the new thread will and go on to the while loop. In the while loop, it will count down the clock until it reaches 0, after which point it will reset it and die.
    If I'm on the right track, all I need to know is how to detect which thread is currently executing. If I'm not on the right track, what would be the best way to do this?

    What? No! No Thread terminates on the return of start(). Those two events are unrelated!Uh... I think you misunderstood what I said.
    I didn't say that CountDownThread terminates upon returning from start() (which is what it sounds like you interpreted from me); I said that the thread that CountDownThread creates terminates once CountDownThread returns from start() (i.e. like any other local variable/object). This, of course, assumes that CountDownThread has a Runnable object on which to call its run() method (am I right?), in which case my code above doesn't create a new thread at all (i.e. CountDownThread.start() is executed within the main/original thread) - am I right?
    No, run() doesn't call start()! That would be stupid.Again, you misunderstood. I shouldn't need to explain this one. A simple reference to an ordinary dictionary on the words 'former' and 'latter' should suffice :)
    Anyway, all joking aside, I have now improved my code and it works! Here's what it looks like:
    ClockJLabel.java
    package MazeMania.clock;
    public class ClockJLabel extends javax.swing.JLabel {
    private Clock C;
    private ClockJLabelsRunnable CJLR;
    public ClockJLabel() {
      C = new Clock();
      CJLR = new ClockJLabelsRunnable();
      setText(C.getCurrTime()); // should be 00:00:00:00
      setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
      // need to figure out how to set the size so that it sticks
      setForeground(new java.awt.Color(255, 0, 0));
      setBackground(new java.awt.Color(0, 0, 0));
      setOpaque(true);
    // starts the clock counting up indefinitely from 0
    public void start() {
      (new Thread(new Runnable() {
        public void run() {
         while(true) setText(C.getElapsedTime());
       })).start();
      //System.out.println("Started clock...");
    // starts the clock counting down from an initial time and runs this count down in a separate thread
    public void countDown(String InitTime) {
      // initialize the clock
      try {C.initClock(InitTime);}
      catch(java.text.ParseException PE) {
       System.out.println(PE.getMessage());
      // initialize JLabel's display
      setText(C.getCurrTime());
      // prepare Runnable and give it to new Thread. New Thread starts count down.
      CJLR.task = CJLR.COUNTDOWN;
      CJLR.CJL = this;
      Thread CountDownThread = new Thread(CJLR);
      CountDownThread.start();
    public Clock getClock() {
      return C;
    }ClockJLabelsRunnable
    package MazeMania.clock;
    import java.lang.Runnable;
    class ClockJLabelsRunnable implements Runnable {
    public static int COUNTDOWN = 1;
    public static int COUNTUP = 2;
    // NOTE: this Runnable doesn't test for the proper setting of these variables
    public int task = 0;
    public ClockJLabel CJL = null;
    public void run() {
      Clock C = CJL.getClock();
      while(C.countDown().charAt(0) != '-') {CJL.setText(C.getCurrTime());}
      C.reset();
      CJL.setText(C.getCurrTime());

  • Moving toward a click-less OS: a suggestion for improving the Mac interface

    This is a long post, so if you have a short attention span, or are not interested in UI design, have a nice day and move on to the next post!
    A little history first. Back in the days of OS 7 and earlier, I recall a feature lacking from the OS that was really important. For a long time, Apple did not use sticky menus, and you had to use a third-party extension to have the ability to click once on a menu heading and have the pop down menu display and stay there without having to hold the mouse down. Around OS 8 or so I recall that they made sticky menus part of the OS and all applications, and that was a welcome ergonomic improvement. No need to click and hold when we explore menus. What I plan to talk about in this post is a similar improvement -- one designed to facilitate the easy exploration of files and folders while completely eliminating the need to click at all.
    My idea was inspired by another feature of OS 8 (or thereabouts). This was the ability to display the files in a folder as buttons. This allowed the user to launch the application/file with a single click, rather than the ergonomically bad double-click required in previous OS's. (You could still select a file without launching it by clicking the label rather than the icon.) This very useful feature went away in OS X. So one is back to double clicking to launch all documents, photos, movies, or whatever. If you are editing hundreds of pictures in a folder as I am, and double clicking them to launch PREVIEW for a quick inspection, you start to develop problems with the tendons in the wrist. I have to switch hands regularly to deal with the fatigue.
    The elimination of buttons was a huge step backward for me in OS X. It is simply not acceptable to have to double click files to launch them. I think a future OS -- truly improved, not just one with more flash -- must solve this problem. As I thought about how it should be implemented, I realized there is a much better and more general solution than that offered by buttons. One that allows the examination of files without ever clicking at all.
    Imagine a folder with multiple file types: photos, mp3's, movies, text edit files, etc, and assume the files are displayed as icons (although my suggestion would work with list view as well). You see a jpg thumbnails and want to see some of them at full size. Or you see a song and want to hear it, or a movie and want to view it. Now imagine that there is a special "preview" mode which allows you to easily and quickly examine the contents of the files without having to launch them in an application by double clicking, then close the window with another click, go on to the next icon of interest, and do this again, and again, and again until your hand is ready to fall off. Instead, you toggle an assigned key (say F5), or select an appropriate menu choice in the Finder, in order to activate what I shall call dynamic preview mode (DPM). With DPM, whenever you move the cursor over a file icon you get a preview. For example, moving the cursor over a jpg file would immediately expand it to full size on the screen. The image would stay up for as long as the cursor remained over the file's icon (which may not be visible). Moving the cursor off the icon causes the preview image to "collapse" back into the file icon. Moving the cursor over another jpg would cause its image to expand to full size until you moved on to the next, and so on. Note that you are able to view ALL of the jpg images without ever clicking the mouse once, well enough twice. There isn't any way I can think of to make reviewing large numbers of images easier. All you have to do is move the mouse around and the images appear and disappear dynamically, without you doing anything other than moving the mouse. Since you would have to do that anyway to select a file for launching under OS X, DPM brings the effort down to the bare bones minimum (short of using a slide show -- but that has other problems, which is why I don't use it except at the end for the fully edited pics). Think of DPM as a super convenient way to browse images without launching applications, closing windows, double-clicking, and so on. When you find an image that you might want to do something with, say edit the color balance in Photoshop, you then launch it using the appropriate application.
    Of course, applications are indeed launched during DPM. But not in the usual way. No doubt the Preview app would be used to handle the display of the jpg's in DPM but it would be modified somewhat for dynamically viewing images. When the cursor goes over a jpg, Preview opens it and displays it, but not in the usual window with a close box, but just as a simple untitled pane showing the image. And as soon as the cursor moves the pane disappears. Likewise, there is no Preview menu bar showing at the top of the screen, because Preview is only used for dynamic display, not editing of the jpg. Now, the user might want to launch the parent application when placing the cursor over the icon because they want to use the application to do something with it (besides viewing or listening). No problem. We simply design DPM so that when the option key is pressed while the cursor is moved over a file icon, it fully launches the application with the file, just as it now does when you double click the file icon. You get the usual titled window, application menu bar, etc. But note that you get the application running with the file loaded without having to double click. This click-less OS interaction, of course, could be implemented right now since it is a only a minor tweak on the OS.
    What about other file types? Putting the cursor over an mp3 file (or other supported format) would start playing the song, and putting the cursor over a movie file would start playing the movie, again in an untitled pane. Presumably Quicktime would be used to handle both of these latter two tasks, but without launching in the usual way and taking over the menu bar. Putting the cursor over a text or RTF file would display it in a pane (possibly using Text Edit). More complicated file types (word processor, spreadsheet, statistical, etc.) would probably not be supported in a first-generation DPM. But jpg, mp3, mov, txt, and rtf files could be easily handled using just three applications that come with every Mac. Also, "compressed" stickie notes could now be deposited individually anywhere, in any folder or on the desktop, and putting the cursor over the note would expand it to full view. With the current OS, we need to run the stickies app which displays ALL the sticky notes at once, and which constrains them to the desktop only, both of which are serious limitations.
    Of course, once we have DPM users will want to complicate things -- they always do. For example, they'll want the mp3 preview to have a play bar with a bug to position in the song, volume control, etc, just like the Quicktime player. But be careful what you ask for, or we are right back with full fledged apps loading with a menu bar and a window that has to be closed, and that defeats the point of a click-less preview. This is because any interaction the user might wish to have with the viewer or player will require moving the cursor, and in DPM that would normally cause the preview to cease. That's the point, after all. So I would argue that dynamic preview should be kept very simple: cursor on the icon opens a preview, cursor off the icon closes the preview.
    Would this be enormously difficult to do? No. It is already being done -- kind of. For any of the file types discussed above, you can click on the file icon, then press command-I (Get Info), and you will see a preview at the bottom of the info box. If it is a pic, that's all you get. If a song or movie, you can play it. Unfortunately, if it is an rtf file, no preview is displayed -- kind of odd, that. (How hard is it to display some text?) The only thing not offered in the command-I previews for pics and movies is a full (or at least larger) screen preview. But that shouldn't be too difficult since Preview and Quicktime allow that as a matter of course.
    Oh yeah. We can add folder icons to the list of icons supported by DPM. Right now, if I want to quickly peek at some folders just to see what they contain, I have to double-click each one to open it, and then click on the close box to close it again. With dynamic preview activated, all I would do is move the cursor over the folder icon and it would immediately expand to its usual size showing whatever contents can be seen in that view. Moving the cursor would make the folder collapse again. Again, all that is need to examine the contents of folders would be to move the cursor around. That's it.
    (Don't get greedy -- you might want a scroll bar for the folder preview, but that defeats the point of a quick preview and would require cursor movement which, with DPM, would close the folder preview. Again, holding the option key down while placing the cursor over the folder icon could open the folder in the usual way, without needing to double click. But as with option-launched previews for images and the like, you will have to close the preview window yourself.)
    Now, I do not think think dynamic preview should be activated out of the box, at least not at this point. Inexperienced users will be confused to see things popping up on the screen when they are moving the cursor around (or hearing songs). But for experienced users who have thousands of files archived in dozens of folders who need to quickly and easily examine them without the steps required now -- double-click, look or listen, close -- this would be a real improvement in the UI, one that would really make a difference. One, that once a user tried it (just like the first Mac OS) would make them say "I'll never go back!"
    In closing, I must post a question, or fear being chastised for not following discussion group rules. So, what are the technical obstacles to doing what I am suggesting, and who else would like to see it done? (And, yes, I am sending these suggestions to Apple, so no need to tell me that.)
    Drake

    BDAqua wrote:
    I agree with you totally... except the clickless preview though, since Apple doesn't like to give you options to turn stuff off or not use it at all if they go to the trouble of putting it in the OS!
    Well, they give you the option to display the contents of a folder in list, icon, or column view. So why can't you have the option to view files with and without dynamic previewing? It is the dynamic equivalent (off vs on) of the static options provided by list, icon, and column view. Also, by the logic you give above (for Apple), one should not have preferences, because that makes the functioning of the OS or app different from one user to the next. And as a counter example, the features of the OS for people with disabilities are great to have, but they are not active just because they are there. One has to want to use them...
    And if you think about it, Expose is an optional utility, as is Dashboard. Some people use them, some don't. DPM would be the same.
    Every new OS release makes me spend a lot of time learning how to shut off/disable things like Spotlight, Dashboard, Time Machine, Transparent Dock & Menubar, ad infinitum!
    Me too. Although I have learned to like Spotlight (although it has bugs), and the dock.
    Did I ever tell you Leopard's System Preferences icon in the Dock looks like a Skull & Crossbones to me?
    If you close one eye & squint the other one until it does to you, then you'll get an idea what OSX looks like to me... LOL.
    I tried, but couldn't conjure it up! I must have too limited an imagination.
    BTW, Are you aware you can select as many things to view at once as you want & drag them to say Preview's icon?
    Sure. Have you ever selected several hundred pics and launched preview? Ca-chunk, ca-chunk, ca-chunk, wheez! It is quicker and less demanding of system resources to view one jpg at a time, unless you want to compare them in some way or do a slide show. But for just exploring the files, I want to do it one at a time, especially if iTunes is playing in the background, Photoshop is running and waiting to load a pic that I might decide to edit, mail is up to let me know if anyone is trying to reach me (ding!), Safari is running so I can follow Apple Discussions, etc. In other words, a lot is going on. No need to make matters worse by loading a bunch of pics into Preview, when I am happy to view them singly. This is why I object to the Cover Flow aspect of Quick Look and Safari 4.0. It is just another way to dog down limited system resources.

  • Improving the perspective control grid

    The perspective control for photos is for me the best thing that has happened to LR. I can ( just ) about cope with the speed reduction, but the control for verticals, for rotation and for horizontals is superb.
    At the moment it appears that the centre of the photograph is the point where the rotation and the vertical and horizontal transforms reference from.
    As soon as you select the Vertical / horizontal / rotate / distort, the grid appears that aids you in setting the verticals etc.
    There is no way of seeing the central point, where these transformations occur, you ony have the grid, so I am thinking that when you press the modifier keysthe control / shift  / alt keys, a cross appears over the central point of the grid. This would give you the location of the central point. Plain and simple.
    As soon as you release the modifier keys, this disappears, so you can just see the grid.
    This would speed up rotation tremendously, as this is your reference  point, at the moment, I juggle the rotation and vertical to get where I  want to be.
    Alternatively, like the Crop has various layouts, so pressing "O" could  scan through these same grids, but we will need a central point because  at the moment the crop does not have a grid to mark the centre of the  image.
    LR 4 may enable you to pick your reference point to do the transformations from, then, apply the same principal to that point with the overlaid rotation marking cross.
    Any thoughts?

    function(){return A.apply(null,[this].concat($A(arguments)))}
    hamish niven wrote:
    Would be an interesting combination, however, none of lightrooms controls use any controls like the PS transform controls, so I think its unlikely they will do that.
    Good luck, but try the arrows and expecially zoomed in and see if learning a new trick works for you
    Using the arrows is old hat.  I agree this helps for small adjustments.  I use it all the time.  I also like your idea of establishing a reference point.
    Regarding your statement that no LR controls are like the PS transform - I disagree.  The LR crop tool is similar (size, aspect and rotation).  All I am suggesting is that the vertical and horizontal transforms be added to the LR crop tool, similar to how the PS crop tool (not the PS transform tool) works.  There is no reason why zooming into the image could not be supported.
    Consider this example.  You are copying a document that is rectangular and located on a desk.  You cannot place your camera directly over the document, so you take it at an angle.  Then you want to correct in post processing.  Using the PS crop tool, all you have to do is drag the four corners of the crop rectangle to the four corners of the document.  Done.  Try that in the current LR implementation.  It can be done, but takes a ton of fiddling.
    So, I still want both ways of correcting perspective, and I do not think this is against the "LR way of doing things".  Adobe modified the crop tool, based on beta tester feedback, and they may well again.  At least I know they will look at this carefully and come up with improvements based on their track record.
    Cheers
    Rory

  • How to improve the performance.

    Hi All,
    My question is , What and all we have to check to improve the Query performance . In our schema , all the tables are partitioned and all the tables have indexes . And the tables are not compressed , if i do table compression in my schema , will the query performance increase ? or Do i need to check any other things. Could you please share your ideas.
    Thanks
    Sree

    Hi Sree,
    all the things you mentioned, indexing, partitioning and compression, are not necessarily related to performance or can be both advantageous and deleterious to performance. Just putting them in place is no guarantee of performance.
    Indexing speeds up access but slows down DML. Partitioning is used just as much (if not more) for archival management as it is for performance. Compression is used primarily for space management but has the added benefit of possibly speeding up scan type queries but can slow down DML. Just using these is no guarantee of performance, and can be a hindrance.
    The normal recommendations for performance begin with database design and implementation. Design and implement your database to sound relational principles.
    Design a normalised database to at least 3rd normal form.
    Use appropriate data types.
    Index appropriately, PK's, UK's and obvious FK's (I don't subscribe to the theory that all FK's should be indexed, but that's another argument) Err on the side of less is more.
    Use primarily simple tables, unless experience indicates other storage options such as partitioning or IOT's may be useful.
    Once the application starts to move beyond development then performance issues may start to become obvious, but the method here is to fix the problems. Simply implementing a feature such as partitioning across the whole database in the hope of avoiding future problems will probably be a waste of time at best and cause more issues than it solves at worst. This is not to say that performance is only considered in the last phases. Performance should be a consideration through the whole process, and can be achieved by sound and understood design, implementation and coding principles.
    Once the application moves to testing and implementation phases, then you may be surprised at how few performance issues there are, and even here there is an established performance and tuning methodology for diagnosis and resolution.
    There are whole books written and careers forged in the field of database performance, so it is beyond the scope of this rant to do anything more than give a broad brush stroke of the overall principles. But I hope this at least points you in the right direction.
    Regards
    Andre

  • How to improve the performance of insert statement.

    Hi All,
    I have one procedure and it inserts 40 million records into one table. As my current method taking long time to accomplish the task, Is there any mechanism to improve the performance
    Thanks in Advance.

    > Thanks for pointing out my mistake Billy :)
    It is a common misconception it seems - that Oracle PQ is only useful for multi CPU platforms. I have seen it mentioned numerous times since the Oracle 7 OPS days in the mid 90's.
    > Edit: Could you please highlight which operations
    benefit from a multi-cpu machine?
    More CPUs increase the CPU capacity of the platform (and not speed). Allows it to run more processes.
    So very simplistically - on a single CPU box you find only sufficient CPU capacity (free CPU time) to run a parallel degree of 2 (i.e. 2 PQs). On a 4 CPU box, you may sufficient capacity for a degree of 10.
    But there are some catches here.
    Oracle PQ is specifically used for I/O sharing. Instead of a single process doing all the I/O, the I/O is shared amongst a bunch of PQ processes.
    The real bottle neck here is actually the size of the pipe to the disk.
    Simple example: You may have sufficient CPU capacity to run 20 PQs. But the I/O pipe will be seriously hammered as the pipe can only do a 1000 IOs/sec, and these 20 PQs are trying to push 10,000 IOs/sec.
    Another catch is that there are overheads when using SMP (symetrical multi processing). Again, very basically: as only a single CPU can for example access a specific piece of memory, two processes running on two different CPUs can cause "contention" when trying to access this memory (e.g. a typical piece of shared memory).
    So having two related processes running on two different CPUs can be in fact slower than having both related processes running on the same CPU.
    This is quite noticeable on Windows NT/2000/XP kernel for example. Windows will load the 1st CPU close to capacity, before spilling across to the 2nd CPU. It is the norm to see the 1st CPU with high usage and the 2nd CPU running almost idle. (something that seems to have PC gamers confused in recent times when using "high-end" dual core machines and not understanding why the 2nd CPU does not seem to be used)
    Bottom line. Multi-CPU platforms provide more processing capacity for running PQ than a single CPU platform. But a single CPU is capable of running PQ if there is capacity (which is often the case).

  • How to improve the write performance of the database

    Our application is a write intense application, maybe will write 2M/second data to the database, how to improve the performance of the database? We mainly write to 5 tables of the database.
    Currently, the database get no response and the CPU is 100% used.
    How to tuning this? thanks in advance.

    Your post says more by what is not provided than by what is provided. The following is the minimum list of information needed to even begin to help you.
    1. What hardware (server, CPU, RAM, and NIC and HBA cards if any pointing to storage).
    2. Storage solution (DAS, iSCSCI, SAN, NAS). Provide manufacturer and model.
    3. If RAID which implementation of RAID and on how many disks.
    4. If NAS or SAN how is the read-write cache configured.
    5. What version of Oracle software ... all decimal points ... for example 11.1.0.6. If you are not fully patched then patch it and try again before asking for help.
    6. What, in addition to the Oracle database, is running on the server?
    2MB/sec. is very little. That is equivalent to inserting 500 VARCHAR2(4000)s. If I couldn't do 500 inserts per second on my laptop I'd trade it in.
    SQL> create table t (
      2  testcol varchar2(4000));
    Table created.
    SQL> set timing on
    SQL> BEGIN
      2    FOR i IN 1..500 LOOP
      3      INSERT INTO t SELECT RPAD('X', 3999, 'X') FROM dual;
      4    END LOOP;
      5  END;
      6  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.07
    SQL>Now what to do with the remaining 0.93 seconds. <g> And this was on a T61 Lenovo with a slow little 7500RPM drive and 4GB RAM running Oracle Database 11.2.0.1. But I will gladly repeat it using any currently supported version of the product.

  • Improving the Subtitling Process

    I have two linked suggestions for improving the subtitling process. I'm editing a video of Shakespeare's _Twelfth Night_, and I'd hoped that I could convert the script to subtitles. This was far from easy, but this can be fixed with two steps.
    1. Enable import of subtitle TXT files that do _not_ have timecodes. Let us use TXT files where each subtitle is separated by a linefeed or CR. When we import them, let Encore create subtitles at a default duration of two to three seconds. We can then manually align those subtitles to the project timeline.
    Currently, Encore requires that subtitle text files have formatted timecodes. Well, I can't imagine how one would have the timecodes for each line of dialogue _before_ bringing them into Encore. We don't sit and type those timecodes into our text files. Your own tutorials tell us that this job's frequently shopped out because it's tedious: well, if Encore could import simple text files, and we could move the titles around like video clips, it'd be a lot less tedious.
    Another reason to allow us to avoid entering timecodes is that there's really no easy way to type them in. I attempted to create a timecode-delimited file of the _Twelfth Night_ script; I imported the text into Excel, and tried to use Excel to create the timecodes for two-second-line subtitles. Sadly, Excel does NOT format for video timecode. It formats time as hh:dd:ss, but a) it dosn't inclde frames and b) it uses colons instead of semicolons. I _was_ able to get around this limit, with a bit of work. But frankly, if Encore could simply import a simple TXT file, I would have saved a lot of work.
    2. Enable the user to see the project's audio files _as a waveform_ in the timeline, as in Premiere Pro.
    As I said, we could take the subtitles, and stretch them to match the soundtracks. It's a lot easier to match them _visually_, against the waveforms of the audio. If there's a way to see audio timelines as waveforms in Encore, I've been unable to find it.
    With my two suggestions above, users would be able to a) import a simple text file, and have Encore create subtitles, and b) align the subtitles to the audio files easily and efficiently.

    I applaud your thoughtful suggestions.  I suspect we might end up at different places in what we would pick (if we were the decision makers at Adobe).
    Part of my reaction is the practical belief that Encore is what it is because adobe had and has a deal with sonic to use their authorcore, and that this is both a benefit and a problem for Adobe to tailor encore as it might like.  And Premiere is the more likely application to have such functions added.  I can imagine somethikng like hitting the asterisk key in time to music (which adds markers), but where we're adding a special subtitle marker.  Then this can be exported with the timecodes, and added to the text file.
    I wonder if this is part of what the transcription function is intended to be.
    I also believe that After Effects with its scripting support is the better option.  I believe there are already scripts that can import a text file into separate layers, and I suspect this could be set with the starting time code you want.  But the goal is not a subtitle video/ it is an importable subtitle file for Encore.

  • How do I retrieve the Current Interactive Report Tab Identification

    I have found the FLOWS_030100.Tables.WWV_FLOW_WORKSHEETS and related tables which contain the information relating to the Interactive reports.
    I am writing a Procedure which need the 'Conditions' relating to a Saved Report tab of a Interactive report.
    I am able to retrieve the some current info via 'Substitution Strings' like:
    Flow_ID via APP_ID
    Page_ID via APP_PAGE_ID
    Session_ID via APP_SESSION
    This info will get me to the WWV_FLOW_WORKSHEET_RPTS table which relates to the individual Saved Reports for a IR.
    But if I have multiple Saved Reports on a single IR, I need to find the WWV_FLOW_WORKSHEET_RPTS.ID to be able to find the related rows on the WWV_FLOW_WORKSHEET_CONDITIONS table.
    Is there a location where I can find the current IR information like the 'Substitution Strings' I listed above that will get me this info?
    How would you attack this problem?
    Thanks

    Trying to report off of an interactive report conditions reliably will lead you down a long road of frustration. Getting the current tab ID is not too tricky here is some JS to get you started:
    function getCurTab() {
      //alert('function called');
      //Populate the array with all the page tags
      var tabs = $x('apexir_REPORT_TABS').getElementsByTagName("span");
      //Cycle through the tags using a for loop
      for (i=0; i<tabs.length; i++) {
        //alert(tabs.className);
    //Pick out the tags with our class name
    if (tabs[i].className=='current') {
    //Manipulate this in whatever way you want
    alert(tabs[i].id);
    setTimeout("getCurTab()",5000);
    getCurTab();
    This is just a rough and dirty example. This could greatly be improved by using jQuery and an onclick event rather than the timeout. So dont use this in any sort of production environment.
    Cheers,
    Tyson Jouglet                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Implementing Program into simple GUI

    I have completed a program that will show the inventory one at a time. I am using Netbeans and i have generated two JFrames. One that will be the welcome screen with a start button to show the first item...And the second one to have a textbox with a Next button to act as the enter button for my previous program. I have created the format for both JFrames, I dont know where to start implementing the completed program into a simple screen that will go through each item....not asking for a solution but if there is any suggestions on where to put what...I have created buttons on each JFrame and set it to action..Please help and thank you....
    package inventory;
    import java.util.*;
    public class Main //main class
       // main method
       public static void main( String args[] )
          double total = 0.0;
          Product inventory[]; // This is the array variable
           Scanner input = new Scanner(System.in);
          inventory = new Product[ 5 ];
          inventory [ 0 ] = new Product( "Apple", 1, 200, 1.00 );
          inventory [ 1 ] = new Product( "Banana", 2, 100, 2.00 );
          inventory [ 2 ] = new Product( "Pear", 3, 50, 3.00 );
          inventory [ 3 ] = new Product( "Pinapple", 4, 60, 4.00 );
          inventory [ 4 ] = new Product( "Orange", 5, 150, 5.00 );
           //needed to have a sort method call here BLG
           sortItems(inventory);
          for (int counter = 0; counter < 5; counter++)
             System.out.printf(inventory[counter].toString()); //way to print out
               //added two lines to get one-by-one BLG
               System.out.println("Please press enter to see the next item...");
               input.nextLine();
          } // end for
           total = getTotalValue(inventory); //added BLG
          System.out.printf( "The total value of the inventory is: $%.2f\n\n", total );
       } // end main method
       public static double getTotalValue(Product Items[])
              double totalValue = 0.0;
              for (Product myItem : Items)
                   totalValue += myItem.getValue();     
              return totalValue;
         //sort the items by name  added BLG
         public static void sortItems(Product Items[])
              for(int i=0;i < Items.length; i++)
                   Product myProduct = Items;
                   int j;
                   for (j = i - 1; j >= 0 && Items[j].getproductName().compareTo(myProduct.getproductName()) > 0; j--)
                        //compare the current item to the last item name
                        Items[j+1] = Items[j];
                   Items[j+1] = myProduct;
    } // end class mainpackage inventory;
    public class Product{
    public String name; //Declares product name
    public int id; //Declares product ID
    public int amount; //Declares number of Units
    public double cost; //Declares cost of each unit
    public Product( String name, int id, int unit, double cost ){ //Creates a constructor for Product class
    this.name = name;
    this.id = id;
    this.amount = unit;
    this.cost = cost;
    public Product( double priceUnit )//Seprate constructor for the restock class
    this.cost = priceUnit;
    Product inventory[] = new Product [ 3 ];
    public void setProduct ( String theproductIn ){
    name = theproductIn;
    public void setId ( int itemNumberIn ){
    id = ( ( itemNumberIn > 0 ) ? itemNumberIn :0 );
    public void setAmount ( int unitsIn ){
    amount = ( ( unitsIn > 0 )?unitsIn:0 );
    public void setCost ( double priceUnitIn ){  
    cost = ( ( priceUnitIn > 0.0 )?priceUnitIn:0.0 );
    public String getproductName(){
    return ( name );
    public int getId(){
    return ( id );
    public int getAmount(){
    return ( amount );
    public double getCost(){
    return ( cost );
    public double getValue(){
    return ( amount * cost );
    public String toString (){     
    String formatString = "Product Name : %s\n";
    formatString += "Id Number : %d\n";
    formatString += "Number of units on hand : %d\n";
    formatString += "Price of each unit : $%.2f\n";
    formatString += "Value of total units in stock : $%.2f\n";
    return (String.format ( formatString, name, id, amount, cost, getValue()));

    package inventory;
    public class restock extends Product
            private double reStockingFee;
         public restock(double cost, double reStockingFee,double getValue) {
           super(getValue*1.05);
           this.reStockingFee = reStockingFee;
         public double getCost() {
             return super.getCost() + reStockingFee;
         public String toString() {
               String formatString    = "Restock Price                   : %s\n";
              return (String.format ( formatString, super.getCost()));
    package Inventory4;
    public class Main extends javax.swing.JFrame {
        /** Creates new form Main */
        public Main() {
            initComponents();
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            jLabel1 = new javax.swing.JLabel();
            jButton1 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jLabel1.setText("    Welcome to the inventory program");
            jButton1.setText("Start");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(40, Short.MAX_VALUE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(19, 19, 19))
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(86, 86, 86)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(91, Short.MAX_VALUE))
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(37, 37, 37)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(42, 42, 42)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(46, Short.MAX_VALUE))
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(129, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(139, 139, 139))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(35, 35, 35)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(68, Short.MAX_VALUE))
            pack();
        }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JPanel jPanel1;
        // End of variables declaration
    }

  • Obtaining the current JSF Phase

    Hi all,
    One of the ways to obtain the current JSF phase is by implementing a phase listener. However, I would like to know if there are any simpler ways to obtain the current JSF phase that my code is executing in. For example, I would like to know what phases my getters for my beans is executed in. So, every time when my getters for my beans are executed, I would like to know what phase it gets executed in.
    Thanks,
    Mun Wai

    I am using phasetracker to trace it also.I want to know whether it is it render response phase. I know FacesContext.getCurrentInstance().getRenderResponse() work for normal jsf component but it will not work for qiupukit datatable. FacesContext.getCurrentInstance().getRenderResponse() will not return true in the following phase. Why?
    [ INFO] 27-11-07 16:20:21 : BEFORE RENDER_RESPONSE(6) (http-80-Processor23)
    I want the 'get' method of datatable being called in response phase to reduce the number of calling because i put the query in 'get' method there. Actually i still straggling with the best practice to code the datatable...

  • How to load a class dynamically in the current/system class loader

    I need to dynamically load a new jdbc driver jar to the current/system class loader... Please note that creating a new classloader will not help since the DriverManager refers to the systemclassloader itself.
    Restarting the application by appending the jar to its classpath will solve the problem but I want to avoid doing this.

    Did you then create a ClassLoader to load the JDBC
    driver and then install it into the system as
    directed by the JDBC specification (ie
    Class.forName(someClassName))?
    And then try to use it from a class loaded fromsome
    other ClassLoader (i.e. the system class loader)?
    If you did not try this please explain why not.O.K. I just looked at the source to
    java.sql.DriverManager. I did not know what I was
    talking about, as what I suggested above will not
    work.
    This is my new Idea:
    Create a URLClassLoader to load the JDBC driver also
    in this ClassLoader you need to place a helper class
    that does the following:
    public class Helper {
    public Driver getJDBCDriver(String driverClassName,
    String url) {
    try {
    Class.forName(driverClassName);
    Driver d = DriverManager.getDriver(url);
    return d;
    catch(Exception ex) {
    ex.printStackTrace();
    return null;
    }Now create an instance of the Helper class in the new
    ClassLoader, and call its getJDBCDriver method to get
    an instance of the driver (you will probably have to
    create an interface in the root class loader that the
    Helper implements so that you can easily call it).
    Now from the root classloader you can make calls
    directly to the returned Driver and bypass the
    DriverManager and its restrictions on cross
    ClassLoader access.
    The only catch here is that you would have to call to
    the returned Driver directly and not use the Driver
    Manager.This sounds like will work but I did not want to load DriverManager in a new classloader.. I did a hack
    I unzip the jar dynamically in a previously known location (which I included in my classpath when launching the app). The classLoader finds the class now though it did not exist when the app was launched !
    A hack of-course but works eh ..

Maybe you are looking for

  • AT commands for WIC 1AM analog modem

    Hi guys,    I have a Cisco 2811 Router with WIC-1AM modem in it, i want to switch to use B1 modulation can anybody help me what about "modemcap entry" should look like? Thnx in advance, Shen

  • Imac 27 led failure - left screen dark

    Hi, The LED backlights on the left part of my iMac 27 (Model A1312) are almost dark or completely dark. I see the LCD image but the backlight comes and goes. I have been searching on the web what could cause this issue and found that I'm not the firs

  • Using Smbup and Mavericks Server Questions

    Hello everyone and Happy New Year! My company has been using Mavericks Server for about three months now and we've had some major hiccups along the way, most of them relating to using Apple's iteration of SMB in a mixed environment. After weeks of re

  • Screen layout of MIRO

    DEAR ALL, PLEASE TELL ME CONFIG SETTING OF FIELD CONTROL OF MIRO SO THAT I CAN SET SCREEN LAYOUT AS PER USER REQUIREMENT. PLEASE HELP...

  • No Graphics

    I have written a J3D application that is installing and running fine but, a recent install on a laptop that is running XP, the application is running but no graphics are displaying. Any ideas why? Thanks