Plz Help With This Important Decision

I really need help deciding if i should run bootcamp or not. i have 33 gb left on my hd(i only started w/55.5 after formatting). i just cant decide. plz help!!!

Remember also, you want to keep about 15% of your drive free, so virtual memory will work efficiently.
-Bmer
Mac Owners Support Group
Join Us @ MacOSG.com
ITMS: MacOSG Podcast
 An Apple User Group 

Similar Messages

  • Views: Thanks mahesh, plz help with this also

    Thanks Mahesh for your note.
    Please also let me know that how we can use the foreign key relationship as i have shown in the join conditions. We use the relationship tab on the view maintainence screen to add all the join conditions due to foreign keys, if i am not wrong.
    Please help me with this point too

    So what are you trying to do.. you want to check if that entry also exist in sfilght table.. include that table in that tables list and add one more condition in the join conditions...  
    View Maintenance? i dont see any..
    Thansk
    Mahesh

  • Adding values to insert query [was: Plz help with this code]

    I have created a comments section in which there is only one field comment here is the code of the form:
    <form id="frmComment" name="frmComment" method="POST" action="<?php echo $editFormAction; ?>">
        <h3>
          <label for="namegd"></label>Comment:</h3>
        <p>
          <label for="comment2"></label>
          <textarea name="comment" id="comment2" cols="60" rows="10" ></textarea>
        </p>
        <p>
          <label for="submit">
          </label>
          <input type="submit" name="submit" id="submit" value="Submit" />
          <label for="reset"></label>
          <input type="reset" name="reset" id="reset" value="Clear" />
        </p>
    <input type="hidden" name="MM_insert" value="frmComment" />
    </form>
    and the insert into code applied to the form is this
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmComment")) {
      $insertSQL = sprintf("INSERT INTO comments (`comment`, ) VALUES (%s)",
                           GetSQLValueString($_POST['comment'], "text"));
      mysql_select_db($database_my_connection, $my_connection);
      $Result1 = mysql_query($insertSQL, $my_connection) or die(mysql_error());
    But I want the form to insert two more values to the database one will be the commented_by and the other will be post_id where commented_by = ($_SESSION['Username']) and post_id = $row_Recordset1['id'] can some one plz let me know what will be the modified code and ya commented_by is a text field and post_id is an int field.
    Plz guys help me Thanks in advance

    Adding the extra values to the insert query is easy:
    $insertSQL = sprintf("INSERT INTO comments (`comment`, commented_by, post_id) VALUES (%s, %s, %s)",
             GetSQLValueString($_POST['comment'], "text"),
             GetSQLValueString($_SESSION['Username'], "text"),
             GetSQLValueString($row_recordset1['id'], "int"));
    You need to make sure that the code for recordset1 comes before the insert query. By default, Dreamweaver places recordset code immediately above the DOCTYPE declaration, and below other server behaviors. So, you need to move the code. Otherwise, this insert query won't work.

  • Wow... someone plz help with this

    ok so I was under the impression that using an int array buffer to draw on, and then using MemoryImageSource was a hell of a lot faster than having an Image buffer that you drew on and then drew to the screen once the frame was done... It was significantly faster with a raycasting engine I did a while ago. However, I have this new 3d engine (calculates screen-points from vertices) and the first version used an Image buffer. It went about 200 fps with a screen size of about 700,700. However, my new one becomes unuseable with a screen-size greater then 300,300 with only 1 model showing(the original has about 30) and uses MemoryImageSource. The fps in the second is greatly dependent on the screen size so Im thinking it has to do with the buffer, anyone got anything to say about this?
    -Mike

    If you factor your code cleanly, switching from MemoryImageSource to any java.awt.Image subtype
    (BufferedImage or VolatileImage) shouldn't be difficult. I would suggest running some examples
    and tests before doing any major changes. The main advantage to VolatileImage is that it tries
    to keep it's pixel data in video memory, and that will accellerate blitting. In the jdk 1.4 this
    acceleration is done to some BufferedImages and in 1.5 all instances of BufferedImage attempt
    to "manage" the pixel data in this way -- you don't have to do anything special to benefit from it,
    just use BufferedImage in a straightforward way.
    As far as Full-Screen Exclusive Mode, it is a complete change in rendering (assuming you go with
    active rendering) and it doesn't mean you will achieve more fps, but as the tutorial states:
    If your performance metric is simply the speed at which double-buffering or page-flipping occurs versus
    direct rendering, you may be disappointed. You may find that your numbers for direct rendering far exceed
    those for double-buffering and that those numbers far exceed those for page-flipping. Each of these
    techniques is for used for improving perceived performance, which is much more important in graphical
    applications than numerical performance.
    Double-buffering is used primarily to eliminate visible draws which can make an application look
    amateurish, sluggish, or appear to flicker. Page-flipping is used primarily to also eliminate tearing, a
    splitting effect that occurs when drawing to the screen happens faster than the monitor's refresh rate.
    Smoother drawing means better perceived performance and a much better user experience.

  • Plz help with this applet problem

    i made this player in jmf... and i tried to play file over http in it..
    player runs as applet in a jsp page.
    the prob is i was using .class file for the applet..but it wouldnt open a remote url coz applets run in sandbox mode...
    so i signed the applet..which caused it to end up in a jar..
    now the jar is perfectly playing remote urls..BUT
    it gives NoClassDefFound Error for ControllerListener class
    so
    1) with .class files it runs in all computers, but opens only files present on same servrer
    2) with .jar file it runs only on computers with jmf 2.1.1 installed, others giv the above error
    any ideas y this is so?
    and how do i add the whole javax.media package to teh jar if need be?
    i used:
    jar cvf test.jar PlayerApplet.java
    but how does ones add javax.media package?
    thanks

    Sorry. In that page I have to insert a CODE. I think I can get the code debugging the applet. Not the source code, a CODE that is in a class called Training.class
    <applet archive="http://www.mod-x.co.uk/mod_x_LeV_2/M_LeVeL3_od/7nf73b.jar" code="Training.class" width=300 height=50></applet>
    Cheers :D
    EDIT: Look, more logs in the java console when I leave the page:
    basic: New window ID: 0
    basic: Stopping applet ...
    basic: Removed progress listener: sun.plugin.util.GrayBoxPainter@ab835a
    basic: Finding information ...
    basic: Releasing classloader: sun.plugin.ClassLoaderInfo@db3331, refcount=0
    basic: Caching classloader: sun.plugin.ClassLoaderInfo@db3331
    basic: Current classloader cache size: 1
    basic: Done ...
    basic: Joining applet thread ...
    basic: Destroying applet ...
    basic: Disposing applet ...
    basic: Quiting applet ...
    basic: Joined applet thread ...
    Cheers :D
    Message was edited by:
    Tiger

  • Plz help with this

    Hello all,
    I have to write a jsp program which edits a text file and saves it...
    here is what i have written..it prints all the lines in a text file and diplays a ewdit button beside each line...
    i would appreciate it if u tell me how to pass an argument to the function respPrompt..
    also please tell me how to display content in a dialog box(text box)..
    once user makes changes it should save the data in a file..
    thanks
    rao
    <%@page contentType="text/html" import= "javax.swing.*,java.io.*"%>
    <%@page pageEncoding="UTF-8"%>
    <!-- dialog box when page load to ask questions -->
    <%
    out.println("<HTML>\n");
    out.println("<HEAD><TITLE>Hello</TITLE></HEAD>\n");
    out.println( "<BODY BGCOLOR=\"#FDF5E6\">\n"); out.println("<table border=0>");
    int counter =0;
    int i=1;
    String dialog;
    String resp;
    String res;
    String title = "\nList of the Departments and equivalent journels\n";
    try{
    int j=1;
    String editline;
    File testFile = new File("C:\\Message.txt");
    BufferedReader input = new BufferedReader( new FileReader(testFile) );
    File testFile1 = new File("C:\\Message.txt");
    BufferedReader input1 = new BufferedReader( new FileReader(testFile1) );
    String line = null;
    //String favorite = window.prompt("What is your favorite color?", "RED");
    while (( line = input.readLine()) != null){
    out.println("<tr><td bgcolor=\"#CCCCCC\">");
    %>
    <input type="button" value="Edit" onClick="respPrompt()">
    <% out.println(i+")"+line+"\n\n");
    out.println("</td></tr>");
                   i++;
    catch (FileNotFoundException ex) { ex.printStackTrace(); }
    %>
    <!-- end of dialog box -->
    <!-- script to generate htmlArea -->
    <script language="JavaScript">
    function respPrompt() {
    var favorite = prompt('What is your favorite color?', "");
    var j = 10;
    // if (favorite) equivalent to if (favorite != null && favorite != "");
    if (favorite) alert("Your favorite color is: " + favorite);
    else alert("You pressed Cancel or no value was entered!");
    </script>
    </body>
    </html>

    Remember also, you want to keep about 15% of your drive free, so virtual memory will work efficiently.
    -Bmer
    Mac Owners Support Group
    Join Us @ MacOSG.com
    ITMS: MacOSG Podcast
     An Apple User Group 

  • I just installed Lightroom 5 but can't import photos, there is no import option anywhere. Get pop-up saying error attempting to change modules  ?? Any help with this??

    I just installed Lightroom 5 but can't import photos, there is no import option anywhere. Get pop up saying error attempting to change modules.
    I had this with the trial , then I purchased license and still happens.  Any help with this ??

    <moved from Downloading, Installing, Setting Up to Photoshop Lightroom>

  • I have uninstalled and reinstalled iTunes several times, but keep getting an error message that "the registry settings for importing and burning CD's and DVD's is missing".  Can anyone help with this?

    I have uninstalled and reinstalled iTunes several times, but keep getting an error message that "the registry settings for importing and burning CD's and DVD's is missing".  Can anyone help with this?

    It keeps telling me to reinstall iTunes, but it continues to come back with the same error message.

  • Please I really need help with this video problem.

    Hi!
    Please I need help with this app I am trying to make for an Android cellphone and I've been struggling with this for a couple of months.
    I have a main flash file (video player.fla) that will load external swf files. This is the main screen.When I click the Sets Anteriores button I want to open another swf file called sets.swf.The app is freezing when I click Sets Anteriores button
    Here is the code for this fla file.
    import flash.events.MouseEvent;
    preloaderBar.visible = false;
    var loader:Loader = new Loader();
    btHome.enabled = false;
    var filme : String = "";
    carregaFilme("home.swf");
    function carregaFilme(filme : String ) :void
      var reqMovie:URLRequest = new URLRequest(filme);
      loader.load(reqMovie);
      loader.contentLoaderInfo.addEventListener(Event.OPEN,comeco);
      loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progresso);
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completo);
      palco.addChild(loader); 
    function comeco(event:Event):void
              preloaderBar.visible = true;
              preloaderBar.barra.scaleX = 0;
    function progresso(e:ProgressEvent):void
              var perc:Number = e.bytesLoaded / e.bytesTotal;
              preloaderBar.percent.text = Math.ceil(perc*100).toString();
              preloaderBar.barra.scaleX =  perc;
    function completo(e:Event):void
              preloaderBar.percent.text = '';
              preloaderBar.visible = false;
    btHome.addEventListener(MouseEvent.MOUSE_DOWN,onHomeDown);
    btHome.addEventListener(MouseEvent.MOUSE_UP,onHomeUp);
    btSets.addEventListener(MouseEvent.MOUSE_DOWN,onSetsDown);
    btSets.addEventListener(MouseEvent.MOUSE_UP,onSetsUp);
    btVivo.addEventListener(MouseEvent.MOUSE_DOWN,onVivoDown);
    btVivo.addEventListener(MouseEvent.MOUSE_UP,onVivoUp);
    btHome.addEventListener(MouseEvent.CLICK,onHomeClick);
    btSets.addEventListener(MouseEvent.CLICK,onSetsClick);
    function onSetsClick(Event : MouseEvent) : void
              if (filme != "sets.swf")
                          filme = "sets.swf";
                          carregaFilme("sets.swf");
    function onHomeClick(Event : MouseEvent) : void
              if (filme != "home.swf")
                          filme = "home.swf";
                          carregaFilme("home.swf");
    function onHomeDown(Event : MouseEvent) : void
              btHome.y += 1;
    function onHomeUp(Event : MouseEvent) : void
              btHome.y -= 1;
    function onSetsDown(Event : MouseEvent) : void
              btSets.y += 1;
    function onSetsUp(Event : MouseEvent) : void
              btSets.y -= 1;
    function onVivoDown(Event : MouseEvent) : void
              btVivo.y += 1;
    function onVivoUp(Event : MouseEvent) : void
              btVivo.y -= 1;
    Now this is the sets.fla file:
    Here is the code for sets.fla
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    var video:Video;
    var nc:NetConnection;
    var ns:NetStream;
    var t : Timer = new Timer(1000,0);
    var meta:Object = new Object();
    this.addEventListener(Event.ADDED_TO_STAGE,init);
    function init(e:Event):void{
    video= new Video(320, 240);
    addChild(video);
    video.x = 80;
    video.y = 100;
    nc= new NetConnection();
    nc.connect(null);
    ns = new NetStream(nc);
    ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
    ns.bufferTime = 1;
    ns.client = meta;
    video.attachNetStream(ns);
    ns.play("http://www.djchambinho.com/videos/segundaquinta.flv");
    ns.pause();
    t.addEventListener(TimerEvent.TIMER,timeHandler);
    t.start();
    function onStatusEvent(stat:Object):void
              trace(stat.info.code);
    meta.onMetaData = function(meta:Object)
              trace(meta.duration);
    function timeHandler(event : TimerEvent) : void
      if (ns.bytesLoaded>0&&ns.bytesLoaded == ns.bytesTotal )
                ns.resume();
                t.removeEventListener(TimerEvent.TIMER,timeHandler);
                t.stop();
    The problem is when I test it on my computer it works but when I upload it to my phone it freezes when I click Sets Anteriores button.
    Please help me with this problem I dont know what else to do.
    thank you

    My first guess is you're simply generating an error. You'll always want to load this on your device in quick debugging over USB so you can see any errors you're generating.
    Outside that, if you plan on accessing anything inside the SWF you should be loading the SWF into the correct context. Relevant sample code:
    var context:LoaderContext = new LoaderContext();
    context.securityDomain = SecurityDomain.currentDomain;
    context.applicationDomain = ApplicationDomain.currentDomain;
    var urlReq:URLRequest = new URLRequest("http://www.[your_domain_here].com/library.swf");
    var ldr:Loader = new Loader();
    ldr.load(urlReq, context);
    More information:
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7de0.html
    If you're doing this on iOS you'll need to stripped SWFs if you plan on using any coding (ABC) inside the files. You mentioned iOS so I won't get into that here, but just incase, here's info on stripping external SWFs:
    http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air- apps-on-ios/

  • Can anyone help with this log? Thanks in advance

    Can you please help with this?
    I cannot make any sense out if it.
    Thank You
    Wed Jan 14 17:06:08 2009
    panic(cpu 1 caller 0x001A8CEC): Kernel trap at 0x00c8000e, type 14=page fault, registers:
    CR0: 0x8001003b, CR2: 0x96ff3776, CR3: 0x01461000, CR4: 0x00000660
    EAX: 0x07a3f000, EBX: 0x07a3fd44, ECX: 0x00001342, EDX: 0x00003384
    CR2: 0x96ff3776, EBP: 0x7ab8f918, ESI: 0x07a3f004, EDI: 0x0000001c
    EFL: 0x00010202, EIP: 0x00c8000e, CS: 0x00000008, DS: 0x077b0010
    Error code: 0x00000002
    Backtrace (CPU 1), Frame : Return Address (4 potential args on stack)
    0x7ab8f308 : 0x12b0fa (0x459234 0x7ab8f33c 0x133243 0x0)
    0x7ab8f358 : 0x1a8cec (0x4627a0 0xc8000e 0xe 0x461f50)
    0x7ab8f438 : 0x19eed5 (0x7ab8f450 0x53654c 0x7ab8f918 0xc8000e)
    0x7ab8f448 : 0xc8000e (0xe 0x48 0x7ab80010 0xbe0010)
    0x7ab8f918 : 0xc84911 (0x79df804 0x7a3f004 0x0 0x0)
    0x7ab8f988 : 0xba8f79 (0x79df804 0x7a3f004 0x0 0x0)
    0x7ab8fb48 : 0xba005b (0x0 0x5340f0 0xd3000001 0x8c55a000)
    0x7ab8fb98 : 0xba156f (0x74db400 0x6f1c400 0x0 0x4)
    0x7ab8fbe8 : 0xba1673 (0x74db400 0x74ce100 0xb7e350 0x79b43c0)
    0x7ab8fc08 : 0xb83133 (0x74db400 0x1 0x0 0x0)
    0x7ab8fc68 : 0xb7c93a (0x74db400 0x5 0x5 0x7801a60)
    0x7ab8fc98 : 0x40fbf5 (0x74db400 0x7801a60 0x7801a60 0x0)
    0x7ab8fce8 : 0x43af53 (0x74db400 0x7801a60 0x7801a60 0x0)
    0x7ab8fd48 : 0x18d210 (0x74db400 0x7801a60 0x0 0x0)
    0x7ab8fdb8 : 0x12d17e (0x767d178 0x767d490 0x7ab8fdf8 0x11ee14)
    0x7ab8fdf8 : 0x126257 (0x767d100 0x6db6ebc 0x7722d20 0x0)
    Backtrace continues...
    Kernel loadable modules in backtrace (with dependencies):
    com.apple.NVDAResman(5.3.0)@0xb9e000->0xdddfff
    dependency: com.apple.iokit.IONDRVSupport(1.5.2)@0xb90000
    dependency: com.apple.iokit.IOPCIFamily(2.4.1)@0x5c1000
    dependency: com.apple.iokit.IOGraphicsFamily(1.5.2)@0xb74000
    com.apple.iokit.IOGraphicsFamily(1.5.2)@0xb74000->0xb8ffff
    dependency: com.apple.iokit.IOPCIFamily(2.4.1)@0x5c1000
    BSD process name corresponding to current thread: WindowServer
    Mac OS version:
    9F33
    Kernel version:
    Darwin Kernel Version 9.5.0: Wed Sep 3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
    System model name: MacBookPro3,1 (Mac-F42388C8)

    Andrea Paesano wrote:
    I have updated the ram but this was over 2 years ago it was right after i purchased the mbp; I never had problem with this computer until last week. Funny enough is now working perfectly "knocking on wood"
    There are two problems with taking that approach to RAM:
    1) RAM can go bad over time for various reasons.
    2) Bad RAM is often only detected if it's something important.
    For example, if a pixel in a graphic changes you may not notice.
    If a jump address in a program changes, it will crash.
    If it's in the kernel, you'll get a panic.
    Worse yet, RAM failures often depend on the value of cells around them, so it's quite possible to get a memory location that only fails if the addresses before and after it contain a particular value.

  • TS3074 Hello anyone with Windows 7, not sure why having followed instructions above, install of latest version of itunes won't work and can no longer open old version either.  anyone help with this?

    Hello anyone with Windows 7, not sure why having followed instructions above, install of latest version of itunes won't work and can no longer open old version either.  anyone help with this?

    Hi,
    thanks for your reply.
    Yes, except n°1 - empty Temp directory, I had tried/checked all of those.
    I emptied the local temp folder tonight, but it still won't work.
    Please note: the installation doesn't give me any problem. The program was working fine, until at one point *plouf* it stopped working. I can re-install it without any problem, it just crashes when opening.
    \\edit\\ I seem to have located the problem, it's in the library files. If I re-install iTunes without my library, it works fine (though there is no music in it, yet). As soon as I import my library, or replace the My Music\iTunes folder with the old one, it stops working.

  • I need help with this code error "unreachable statement"

    the error_
    F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
    int index;
    ^
    F:\Java\Projects\Tools.java:71: missing return statement
    }//end delete method
    ^
    F:\Java\Projects\Tools.java:86: missing return statement
    }//end getrecod
    ^
    3 errors
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    public class Tools//tool class
    private int numberOfToolItems;
    private ToolItems[] toolArray = new ToolItems[10];
    public Tools()//array of tool
    numberOfToolItems = 0;
    for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
    toolArray[i] = new ToolItems();
    }//end for loop
    }//end of array of tools
    public int search(int id)//search mehtod
    int index = 0;
    while (index < numberOfToolItems)//while and if loop search
    if(toolArray[index].getID() == id)
    return index;
    else
    index ++;
    }//en while and if loop
    return -1;
    }//end search method
    public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
    if(numberOfToolItems >= toolArray.length)
    return 0;
    int index;
    index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
    if (index == -1)
    toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
    numberInStock ++;
    return 1;
    }//end if index
    }//end if toolitem array
    return -1;
    }//end insert method
    public int delete(/*int id*/)//delete method
    }//end delete method
    public void display()//display method
    for(int i = 0; i < numberOfToolItems; i++)
    //toolArray.display(g,y,x);
    }//end display method
    public String getRecord(int i)//get record method
    // return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
    }//end getrecod
    }//end class
    Edited by: ladsoftware on Oct 9, 2009 6:08 AM
    Edited by: ladsoftware on Oct 9, 2009 6:09 AM
    Edited by: ladsoftware on Oct 9, 2009 6:10 AM
    Edited by: ladsoftware on Oct 9, 2009 6:11 AM

    ladsoftware wrote:
    Subject: Re: I need help with this code error "unreachable statement"
    F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
    int index;
    ^
    F:\Java\Projects\Tools.java:71: missing return statement
    }//end delete method
    ^
    F:\Java\Projects\Tools.java:86: missing return statement
    }//end getrecod
    ^
    3 errorsThe compiler is telling you exactly what the problems are:
    public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
    if(numberOfToolItems >= toolArray.length)
    return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
    int index;
    index = search(id);  //< -----------------------------------------------------------------------------------------------------------------HERE
    if (index == -1)
    toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
    numberInStock ++;
    return 1;
    }//end if index
    }//end if toolitem array
    return -1;
    }//end insert method
    public int delete(/*int id*/)//delete method
    // <<== HERE where is the return statement?
    }//end delete method
    public String getRecord(int i)//get record method
    // return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
    }//end getrecod
    }//end class

  • Anybody can help with this SQL?

    The table is simple, only 2 columns:
    create table personpay(
    id integer primary key,
    pay number(8,2) not null);
    So the original talbe looks like this:
    ID PAY
    1 800
    2 400
    3 1200
    4 500
    5 600
    6 1900
    The requirement is to use one single query(no pl/sql) to show something lile the following, in other words, for each ID, the pay is the sum of all before itself and itself. So the query result looks like this:
    ID PAY
    1 800
    2 1200
    3 2400
    4 2900
    5 3500
    6 5400
    Again, just use one sql. No pl/sql. Anybody can help with this? I really appreciate that.
    thanks,

    Eh, people are so "analytically minded" that can't even notice a simple join?
    Counting Ordered Rows
    Let’s start with a basic counting problem. Suppose we are given a list of integers, for example:
    x
    2
    3
    4
    6
    9
    and want to enumerate all of them sequentially like this:
    x      #
    2      1
    3      2
    4      3
    6      4
    9      5
    Enumerating rows in the increasing order is the same as counting how many rows precede a given row.
    SQL enjoys success unparalleled by any rival query language. Not the last reason for such popularity might be credited to its proximity to English . Let examine the informal idea
    Enumerating rows in increasing order is counting how many rows precede a given row.
    carefully. Perhaps the most important is that we referred to the rows in the source table twice: first, to a given row, second, to a preceding row. Therefore, we need to join our number list with itself (fig 1.1).
    Cartesian Product
    Surprisingly, not many basic SQL tutorials, which are so abundant on the web today, mention Cartesian product. Cartesian product is a join operator with no join condition
    select A.*, B.* from A, B
    Figure 1.1: Cartesian product of the set A = {2,3,4,6,9} by itself. Counting all the elements x that are no greater than y produces the sequence number of y in the set A.
    Carrying over this idea into formal SQL query is straightforward. As it is our first query in this book, let’s do it step by step. The Cartesian product itself is
    select t.x x, tt.x y
    from T t, T tt
    Next, the triangle area below the main diagonal is
    select t.x x, tt.x y
    from T t, T tt
    where tt.x <= t.x
    Finally, we need only one column – t.x – which we group the previous result by and count
    select t.x, count(*) seqNum
    from T t, T tt
    where tt.x <= t.x
    group by t.x
    What if we modify the problem slightly and ask for a list of pairs where each number is coupled with its predecessor?
    x      predecessor
    2      
    3      2
    4      3
    6      4
    9      6
    Let me provide a typical mathematician’s answer, first -- it is remarkable in a certain way. Given that we already know how to number list elements successively, it might be tempted to reduce the current problem to the previous one:
    Enumerate all the numbers in the increasing order and match each sequence number seq# with predecessor seq#-1. Next!
    This attitude is, undoubtedly, the most economical way of thinking, although not necessarily producing the most efficient SQL. Therefore, let’s revisit our original approach, as illustrated on fig 1.2.
    Figure 1.2: Cartesian product of the set A = {2,3,4,6,9} by itself. The predecessor of y is the maximal number in a set of x that are less than y. There is no predecessor for y = 2.
    This translates into the following SQL query
    select t.x, max(tt.x) predecessor
    from T t, T tt
    where tt.x < t.x
    group by t.x
    Both solutions are expressed in standard SQL leveraging join and grouping with aggregation. Alternatively, instead of joining and grouping why don’t we calculate the count or max just in place as a correlated scalar subquery:
    select t.x,
    (select count(*) from T tt where tt.x <= t.x) seq#
    from T t
    group by t.x
    The subquery always returns a single value; this is why it is called scalar. The tt.x <= t.x predicate connects it to the outer query; this is why it is called correlated. Arguably, leveraging correlated scalar subqueries is one the most intuitive techniques to write SQL queries.
    How about counting rows that are not necessarily distinct? This is where our method breaks. It is challenging to distinguish duplicate rows by purely logical means, so that various less “pure” counting methods were devised. They all, however, require extending the SQL syntactically, which was the beginning of slipping along the ever increasing language complexity slope.
    Here is how analytic SQL extension counts rows
    select x, rank() over(order by x) seq# from T; -- first problem
    select x, lag() over(order by x) seq# from T; -- second problem
    Many people suggest that it’s not only more efficient, but more intuitive. The idea that “analytics rocks” can be challenged in many ways. The syntactic clarity has its cost: SQL programmer has to remember (or, at least, lookup) the list of analytic functions. The performance argument is not evident, since non-analytical queries are simpler construction from optimizer perspective. A shorter list of physical execution operators implies fewer query transformation rules, and less dramatic combinatorial explosion of the optimizer search space.
    It might even be argued that the syntax could be better. The partition by and order by clauses have similar functionality to the group by and order by clauses in the main query block. Yet one name was reused, and the other had been chosen to have a new name. Unlike other scalar expressions, which can be placed anywhere in SQL query where scalar values are accepted, the analytics clause lives in the scope of the select clause only. I have never been able to suppress an impression that analytic extension could be designed in more natural way.

  • I need advise and help with this problem . First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product . At the present time I'm having lots of problems with the router so I was looking in to

    I need advise and help with this problem .
    First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product .
    At the present time I'm having lots of problems with the router so I was looking in to some info , and come across one web site regarding : port forwarding , IP addresses .
    In my frustration , amongst lots of open web pages tutorials and other useless information , I come across innocent looking link and software to installed called Genieo , which suppose to help with any router .
    Software ask for permission to install , and about 30 % in , my instinct was telling me , there is something not right . I stop installation . Delete everything , look for any
    trace in Spotlight , Library . Nothing could be find .
    Now , every time I open Safari , Firefox or Chrome , it will open in my home page , but when I start looking for something in steed of Google page , there is
    ''search.genieo.com'' page acting like a Google . I try again to get raid of this but I can not find solution .
    With more research , again using genieo.com search eng. there is lots of articles and warnings . From that I learn do not use uninstall software , because doing this will install more things where it come from.
    I do have AppleCare support but its to late to phone them , so maybe there some people with knowledge , how to get this of my computer
    Any help is welcome , English is my learned language , you may notice this , so I'm not that quick with the respond

    Genieo definitely doesn't help with your router. It's just adware, and has no benefit to you at all. They scammed you so that they could display their ads on your computer.
    To remove it, see:
    http://www.thesafemac.com/arg-genieo/
    Do not use the Genieo uninstaller!

  • My calendar will no longer let me add new event or delete them, it comes up with an error saying "cannot save event, no end date set" or "event does not belong to that event store". can anyone help with this?

    my calendar will no longer let me add new event or delete them, it comes up with an error saying "cannot save event, no end date set" or "event does not belong to that event store". can anyone help with this?

    Hi,
    To configure your ODBC DataSource, go to Control Panel ---> DataSources(ODBC) (If you are in a Windows environment).
    Select the tab System DSN. If you have not added your data source, then do so by clicking on the Add button. If you have added the datasource, click on the Configure button to configure it.
    Give the datasource name, then the database name.
    You have to give the hostname, service name and server name. I guess, in most cases, the datasource name and host name will be the same, service name and server name will be the same. If you are using TCP/IP, the protocol will be onsoctcp.
    There will be a file named Services under C:\WINNT\system32\drivers\etc where you have to give the port number for accessing this server.
    It will be like this <service name> <portnumber>/tcp
    Hope this helps...
    best wishes,
    Nish

Maybe you are looking for

  • MixRadio Eating Up Memory

    I download a lot of offline mixes and Nokia Mix Radio hogged all the space on my Lumia 620 even though I delete mixes after listening to them. I deleted all my mixes and still Nokia Mix Radio was using most of the memory on my phone. I had to delete

  • Missing iTunes Library on Backup

    My son has a Tiger laptop and he needed to get the hard drive replaced. He had a large iTunes library, which he dragged and dropped onto a CD. He then checked the CD and said that all of his music files were there. After getting the new hard drive an

  • Help!!!asap..about multiple files...

    I already have a working class for this part.All I need is the application part that will create a property object for each data line read from the the input file assign4.dat. This application should also print each object to a data file, according t

  • Exposing (or) Embedded OBIEE report in to  Public webpage

    Hi Gurus , I got a new requirement to expose OBIEE Dashboard like below Oracle Business Intelligence Please  guide me from where should I start... Etc Thanks V

  • Dreamweaver 8 - Tables Jumping

    Hi all...... I had created a fairly simple set of tables, with some nested tables inside some rows/columns of others... I cant remember the last time I had such a problem, but for some reason, on the center column where I am to put in all the content