Is this the best way to Triple Boot?

Hi all, I have a had a pickle of a time setting up Leopard...with my triple boot setup.
I am curious if I went about it "properly"or if there is a better way.
Use instructions at your own peril if you wish. I am not responsible for errors or any problems you may have by using my instructions. This is my individual experience. *I am happy if this works for someone* struggling to set up a triple boot, but am posting this more so to see if there are any improvements to be made, or mistakes that need correcting to this method...
I had an Intel MBP (SR) with 3 partitions. Tiger, Vista and Ubuntu but when trying to install Leopard it said it would not install and I would have to change my drive to guid partition scheme.
So, through trial and error this is the only way I could get it to work.Keep in mind I started from scratch with vista and ubuntu, but did make a backup of my tiger drive.
1. BACK UP
2. Wipe everything and repartition internal disk to guid partition map and 1 partition. Install Leopard.
3. Use either disk utility or carbon copy cloner(my purchased copy of SuperDuper is still not able to do what CCC, a free program can do,apparently because they are trying to figure out time machine and are holding up a leopard compat. version, uuughh, but thats a different post...) to clone Leopard to external drive that is set up as GUID partition scheme.Make sure you are able to boot this external.
4. Wipe internal, repartition to 3 partitions using disk utility and MBR partition scheme in this order from top to bottom(in disk utility partition gui);
  a. Leopard partition: OSX extended journaled
  b. Vista partition: I think there is only one option: maybe Fat? Just make sure you select "windows" format (The vista installer will need to reformat this during install anyway)
  c. Ubuntu partition: "Free Space"
5. Then to install leopard, (which apparently won't install on a drive set up as MBR partition scheme, but that is what we formatted the internal drive as anyway) clone the external copy of leopard to the internal OSX partition we just made.
6. Then install vista by booting from install cd. During install you may have to reformat the Windows partition using the windows installer, but it should install fine after that.
7. Then Install ubuntu using live cd/dvd to the internal free space partition, splitting/ formatting the last partition using the ubuntu install/partition tool on the "manual"partition mode(make sure you are using the correct free space partition. I confirmed this by looking at the sizes of the partitions that showed up): "free space" into root and swap partitions if you want. I used ext2 for root
     *Side note:*If you have the same MBP as me you may have to change some setting when booting the live cd: Once the cd loads and you get to the preliminary menu window, press F6 to edit. A command will show up on the screen: You have to erase the last two words starting at "quiet" till end. Then write "allgenericide" in their space, keeping all of the command before quiet.  then press enter. It should then load to the ubuntu desktop where you can click on the install icon.(this took me a long time to figure out. I have also have to do this everytime I want boot into ubuntu, which stinks. Anyone know how to resolve this? (Linux masters?)
8. boot into osx and install rEFIt
Issues:
1. My Leopard partition is not showing up in OSX's startup disk pane in sys pref. but it is booting/ showing up as if it was, if having trouble, try holding option key during startup.
2. I have also had a few issues with rEFIt not starting up as default menu, but when holding option key at startup it will show up. Then gives me the option of OSX, Vista or Ubuntu once selected.
3. And the command thing with ubuntu at every startup I mentioned earlier.Is there a way to write allgenericide as a default or any other way to fix this?
If anyone has a better way of accomplishing this please let me know. I got to this point through a lot of trial and error and I'm not sure if there is a more stable/better way for a triple boot setup...
I would like for the Leopard partition to show up as the osx startup disk in the pref pane, but regardless it is still working.
Correct me if I'm wrong, but it seems boot camp makes the drive into an MBR partition scheme anyway, so I'm curious what others who were already running dual or triple boot, boot camp systems had to do when upgrading their boot camp setups from tiger to leopard. Did it not allow you to install to the MBR partition scheme made by boot camp? Did you have to start from scratch as well?
Thank you in advance for your patience and support.  

http://wiki.onmac.net/index.php/TripleBoot_viaBootCampI would install Vista before installing Leopard.
That has worked better for me anyway.
And that may make Leopard the default.
In Vista, AppleControl is under /Windows/SysWOW64 if you ever need to get to it (there is also AppleOSSMgr and AppleTimeSrvc )
http://wiki.onmac.net/index.php/TripleBoot_viaBootCamp

Similar Messages

  • Cfqueryparam numeric help - is this the best way

    I have an update in one of my programs and I'm using the
    cfqueryparam. It works fine if the value is not entered since the
    type is cf_sql_varchar. If the value is cf_sql_integer/cf_sql_float
    and the field is required, it again works fine. Now if the field is
    cf_sql_integer and not required, it will throw an error if no value
    is passed to it. I tried using the NULL parameter, but that will
    put NULL in the field every time. I finally ended up using a cfif
    statement to check. Is this the best way? Am I missing something?
    How do others handle this?

    Your's is as good a way as any. But since you asked, my
    approach is usually like this:
    Step 1, build a string variable called sql. Perform all your
    if/else and other logic at this step.
    Step 2
    <cfquery>
    #PreserveSingleQuotes(sql)#
    </cfquery>
    My method makes it almost impossible to use cfqueryparam
    because of all the quotes. However, I find it easier to develop,
    read, and maintain code when you have as much if/else, loop, etc
    processing in the same block of code.
    You might be able to do both. Something like
    Step 1 - use if/else logic to set a variable (call it null)
    to either yes or no.
    Step 2
    cfqueryparam null="#null#">
    I've never actually tried. Most of my work is with a db that
    does not support cfqueryparam so using it is not a high priority
    item for me.

  • BC4J datatags: is this the best way to do this?

    In my BC4J JSP application, in the DataTableComponent.jsp, I want to check
    if a property exists on the view object. This is the best way I could come
    up with:
    String PropertyValue =
    (String)dsBrowse.getApplicationModule()
    .findViewObject(dsBrowse.getViewObjectName())
    .getProperty("PropertyName");
    Is this the proper way to get at a view property? Seems like it should be more straightforward.
    Also, does an instance of the ViewImpl class get automatically created when the DataSource tag is used or do you have to specifically instantiate it if you want to use a client method on the view?
    Thanks,
    Steve

    You can do:
       String propVal = dsBrowse.getRowSet().getViewObject().getProperty("PropName");You do not have to instantiate any classes on your own to accomplish this.

  • Is this the best way to redirect using servlet?

    I making a servlet application where the user sends some FORM value to a servlet. I want the servlet to redirect to the answer page after processing the page. Do you think the following code is the correct way of doing?
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            String dnaText = request.getParameter("dnaText");
            /*Getting the tranlated output from dnaToRna method*/
            String finalVal = null;
            String link="http://www.mail.yahoo.com";
            try{
                 finalVal = String.valueOf(dnaToRna(dnaText));
                 response.sendRedirect(link);
                }catch(Exception ex){}
        }

    Many thanks for replying.
    My output file have lots of html code and I dont want to make my servlet heavy with unnecessary code. So I have decided to use another page result.jsp as output file. In result.jsp I intend to call these objects which is storing the value here to display the result.
    As I am new to jsp. I am still in the processing of thinking the best way to handle errors. I have created a method which takes in int values and returns corresponding String values. Like this
    public class DnaToRna extends HttpServlet {
       String error=" * NULL *";
    private String printError(int i) {
            if(i==1){
                error = "There is an error in String to char array";
            }else if (i==2){
                error = "There is an error in your DNA sequence";
            return error;
        }Since error is declared as a class object, if there is no error then I think it should rerun the String NULL. Which can be used to tell people if there is no error. On the contrary if there is really an error, I can use this to tell what is exactly causing the error.
    Although I am new to web programing. I think this would be nice.
    Here is the other method
    public String dnaToRna (String dnaText) throws Exception{
                /*Trim()*/
                dnaText = dnaText.trim();
                /*Codes for Dna to Rna translation*/
                if(Pattern.matches(".*[^atgc]+.*",dnaText))
                return printError(2);
                return dnaText.replaceAll("t","u");
                }

  • Is This The Best Way To Put iMovie Effects On An FCE Clip?

    I have often suggested to other people that they should export clips from FCE to iMovie in order to make use of certain iMovie effects that FCE can't do.
    As with most things there are several different ways of "transporting" the clips.
    Bearing in mind that we want the quickest/lossless method possible, is this the best?
    1. In the FCE Timeline double-click the clip.
    2. Select File>Export>QuickTime Movie and click "Save".
    3.Open a new iMovie Project, import the newly made QuickTime Movie clip and add the necessary effect.
    4. Back in FCE, Import the QuickTime Movie from the iMovie Project.
    Is this in fact the best way or do you know of a better/quicker one?
    Ian.

    Thanks for the confirmation, Tom.
    By "clip" I was actually meaning a few seconds of video I had chopped up on the timeline.
    What caught me out initially was when I simply highlighted the 10 second "clip" and selected QuickTime Movie.
    The estimated time for conversion was around 10 minutes! It was actually making a QT Movie of the complete Sequence, not just the selected "clip". I soon realised that the "clip" needed double-clicking to ensure that only the required 10 seconds were converted.
    Ian.

  • Adding buttons to multiple frames -- is this the best way to do this?

    In CS5, I want to create a series of buttons that when clicked will linked to other frames in the same timeline. So one button will link to frame 5, one will link to frame 10, one will link to 15, etc. All the buttons will appear across the top of the stage on a layer, and I want them to appear on all of the frames so the user can click back-and-forth to the different frames/screens.
    1. Is the best way to do this to just add the buttons to frame 1 and add a keyframe to the last frame in the timeline, frame 15, so they are copied to all the frames in between?
    2. Are there any issues with doing it this way?
    Thanks!!!

    Just have the one keyframe in frame 1 and extend it to frame 15.  You do not need/want another keyframe at frame 15.

  • Is this the best way to measure the speed of an input stream?

    Hi guys,
    I have written the following method to read the source of a web page. I have added the functionality to calculate the speed.
    public StringBuffer read(String url)
            int lc = 0;
            long lastSpeed = System.currentTimeMillis();
            //string buffer for reading in the characters
            StringBuffer buffer = new StringBuffer();
            try
                //try to set URL
                URL URL = new URL(url);
                //create input streams
                InputStream content = (InputStream) URL.getContent();
                BufferedReader in = new BufferedReader(new InputStreamReader(content));
                //in line
                String line;
                //while still reading in
                while ((line = in.readLine()) != null)
                    lc++;
                    if ((lc % _Sample_Rate) == 0)
                        this.setSpeed(System.currentTimeMillis() - lastSpeed);
                        lastSpeed = System.currentTimeMillis();
                    //add character to string buffer
                    buffer.append(line);
            //catch errors
            catch (MalformedURLException e)
                System.out.println("Invalid URL - " + e);
            catch (IOException e)
                System.out.println("Invalid URL - " + e);
            //return source
            return buffer;
        }Is it faster to read bytes rather than characters?
    This method is a very important part of my project and must be as quick as possible.
    Any ideas on how I can make it quicker? Is my approach to calculating the speed the best way to it?
    Any help/suggestions would be great.
    thanks
    alex

    sigh
    reading bytes might be slightly faster than reading chars, since you don't have to do the conversion and you don't have to make String objects. Certainly, you don't want to use readLine. If you're using a reader, use read(buf, length, offset)
    My suggestion:
    Get your inputstream, put a bufferedInputStream over it, and use tje loadAll method from my IOUtils class.
    IOUtils is given freely, but please do not change its package or submit this as your own work.
    ====
    package tjacobs;
    import java.awt.Component;
    import java.io.*;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.JOptionPane;
    public class IOUtils {
         public static final int DEFAULT_BUFFER_SIZE = (int) Math.pow(2, 20); //1 MByte
         public static final int DEFAULT_WAIT_TIME = 30 * 1000; // 30 Seconds
         public static final int NO_TIMEOUT = -1;
         public static final boolean ALWAYS_BACKUP = false;
         public static String loadTextFile(File f) throws IOException {
              BufferedReader br = new BufferedReader(new FileReader(f));
              char data[] = new char[(int)f.length()];
              int got = 0;
              do {
                   got += br.read(data, got, data.length - got);
              while (got < data.length);
              return new String(data);
         public static class TIMEOUT implements Runnable {
              private long mWaitTime;
              private boolean mRunning = true;
              private Thread mMyThread;
              public TIMEOUT() {
                   this(DEFAULT_WAIT_TIME);
              public TIMEOUT(int timeToWait) {
                   mWaitTime = timeToWait;
              public void stop() {
                   mRunning = false;
                   mMyThread.interrupt();
              public void run () {
                   mMyThread = Thread.currentThread();
                   while (true) {
                        try {
                             Thread.sleep(mWaitTime);
                        catch (InterruptedException ex) {
                             if (!mRunning) {
                                  return;
         public static InfoFetcher loadData(InputStream in) {
              byte buf[] = new byte[DEFAULT_BUFFER_SIZE]; // 1 MByte
              return loadData(in, buf);
         public static InfoFetcher loadData(InputStream in, byte buf[]) {
              return loadData(in, buf, DEFAULT_WAIT_TIME);
         public static InfoFetcher loadData(InputStream in, byte buf[], int waitTime) {
              return new InfoFetcher(in, buf, waitTime);
         public static String loadAllString(InputStream in) {
              InfoFetcher fetcher = loadData(in);
              fetcher.run();
              return new String(fetcher.buf, 0, fetcher.got);
         public static byte[] loadAll(InputStream in) {
              InfoFetcher fetcher = loadData(in);
              fetcher.run();
              byte bytes[] = new byte[fetcher.got];
              for (int i = 0; i < fetcher.got; i++) {
                   bytes[i] = fetcher.buf;
              return bytes;
         public static class PartialReadException extends RuntimeException {
              public PartialReadException(int got, int total) {
                   super("Got " + got + " of " + total + " bytes");
         public static class InfoFetcher implements Runnable {
              public byte[] buf;
              public InputStream in;
              public int waitTime;
              private ArrayList mListeners;
              public int got = 0;
              protected boolean mClearBufferFlag = false;
              public InfoFetcher(InputStream in, byte[] buf, int waitTime) {
                   this.buf = buf;
                   this.in = in;
                   this.waitTime = waitTime;
              public void addInputStreamListener(InputStreamListener fll) {
                   if (mListeners == null) {
                        mListeners = new ArrayList(2);
                   if (!mListeners.contains(fll)) {
                        mListeners.add(fll);
              public void removeInputStreamListener(InputStreamListener fll) {
                   if (mListeners == null) {
                        return;
                   mListeners.remove(fll);
              public byte[] readCompletely() {
                   run();
                   return buf;
              public int got() {
                   return got;
              public void run() {
                   if (waitTime > 0) {
                        TIMEOUT to = new TIMEOUT(waitTime);
                        Thread t = new Thread(to);
                        t.start();
                   int b;
                   try {
                        while ((b = in.read()) != -1) {
                             if (got + 1 > buf.length) {
                                  buf = expandBuf(buf);
                             buf[got++] = (byte) b;
                             int available = in.available();
                             if (got + available > buf.length) {
                                  buf = expandBuf(buf);
                             got += in.read(buf, got, available);
                             signalListeners(false);
                             if (mClearBufferFlag) {
                                  mClearBufferFlag = false;
                                  got = 0;
                   } catch (IOException iox) {
                        throw new PartialReadException(got, buf.length);
                   } finally {
                        buf = trimBuf(buf, got);
                        signalListeners(true);
              private void setClearBufferFlag(boolean status) {
                   mClearBufferFlag = status;
              public void clearBuffer() {
                   setClearBufferFlag(true);
              private void signalListeners(boolean over) {
                   if (mListeners != null) {
                        Iterator i = mListeners.iterator();
                        InputStreamEvent ev = new InputStreamEvent(got, buf);
                        //System.out.println("got: " + got + " buf = " + new String(buf, 0, 20));
                        while (i.hasNext()) {
                             InputStreamListener fll = (InputStreamListener) i.next();
                             if (over) {
                                  fll.gotAll(ev);
                             } else {
                                  fll.gotMore(ev);
         public static interface InputStreamListener {
              public void gotMore(InputStreamEvent ev);
              public void gotAll(InputStreamEvent ev);
         public static class InputStreamEvent {
              public int totalBytesRetrieved;
              public byte buffer[];
              public InputStreamEvent (int bytes, byte buf[]) {
                   totalBytesRetrieved = bytes;
                   buffer = buf;
              public int getBytesRetrieved() {
                   return totalBytesRetrieved;
              public byte[] getBytes() {
                   return buffer;
         public static void copyBufs(byte src[], byte target[]) {
              int length = Math.min(src.length, target.length);
              for (int i = 0; i < length; i++) {
                   target[i] = src[i];
         public static byte[] expandBuf(byte array[]) {
              int length = array.length;
              byte newbuf[] = new byte[length *2];
              copyBufs(array, newbuf);
              return newbuf;
         public static byte[] trimBuf(byte[] array, int size) {
              byte[] newbuf = new byte[size];
              for (int i = 0; i < size; i++) {
                   newbuf[i] = array[i];
              return newbuf;

  • MouseOver is this the best way?

    I'm trying to create mouse over (tool tip) for everything in
    my simulated control panel my question is, is mouseOver event
    handler the best way to have the program display a small amout of
    text over the mouse pointer. seems to me this is done all the time
    and there should be a better way.
    thank you in advance for your help

    kglad i agree on the Array way i have many buttons, lights,
    vents,......... that i want tool tips for so i will do the Array.
    another dumb question what is bubbling i did not see a differance
    when i tried MOUSE or ROLL.
    i thought
    Knobtip.x = this.mouseX;
    Knobtip.y = this.mouseY;
    would make the tip follow the mouse pointer.
    thanks again guys i'm taking a 5 day class in 2 weeks so i
    will not (hopefully) ask so many stupid questions

  • Is this the best way to write this in AS3

    I have converted my old AS2 to As3. It now appears to work the same as before but being new to AS3 I have a few questions.
    In this example I click on a button which takes me to a keyframe that plays a MC. There is another btn that takes me back to the original page.
    In AS2 it is written like this.
    // Go to keyFrame btn
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Scul_mc");
    //End Behavior
    // Play Movie
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Movie");
    //End Behavior
    //load Movie Behavior
    if(this.mcContentHolder == Number(this.mcContentHolder)){
    loadMovieNum("PL_Japan_Scul.swf",this.mcContentHolder);
    } else {
    this.mcContentHolder.loadMovie("PL_Japan_Scul.swf");
    //End Behavior
    // Return key
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndStop("Jpn_Intro");
    //End Behavior
    In AS3 it is written like this.
    // Play Movie
    var myrequest_Jpn:URLRequest=new URLRequest("PL_Japan_Scul.swf");
    var myloader_Jpn:Loader=new Loader();
    myloader_Jpn.load(myrequest_Jpn);
    function movieLoaded_Jpn(myevent_Jpn:Event):void {
    stage.addChild(myloader_Jpn);
    var mycontent:MovieClip=myevent_Jpn.target.content;
    mycontent.x=20;
    mycontent.y=20;
    //unload method - Return to keyframe
    function Rtn_Jpn_Intro_(e:Event):void {
    gotoAndStop("Japan_Intro");
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    function removeMovie_Jpn(myevent_Jpn:MouseEvent):void {
    myloader_Jpn.unload();
    myloader_Jpn.contentLoaderInfo.addEventListener(Event.COMPLETE, movieLoaded_Jpn);
    Rtn_Jpn_Intro_btn.addEventListener("click",Rtn_Jpn_Intro_);
    // Go to keyFrame btn
    function Scul_Play(e:Event):void {
    gotoAndStop("Jpn_Scul_mc");
    Jpn_Scul_btn.addEventListener("click",Scul_Play);
    1. Is there a better, more efficient way to achieve this in AS3?
    2. I have used an //unload method in the AS3 script which does remove the MC from the scene but I notice in the output tab my variable code is still being counted for the last MC played.
    Is this normal?

    Hi Andrei, I have started a new project and taken your advice to construct it with a different architecture with all the code in one place.
    I have two questions regarding your last code update.
    var myrequest_Jpn:URLRequest;
    var myloader_Jpn:Loader;
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    Jpn_Scul_btn.addEventListener(MouseEvent.CLICK, Scul_Play);
    function Scul_Play(e:MouseEvent):void {
         myrequest_Jpn = new URLRequest("PL_Japan_Scul.swf");
         myloader_Jpn = new Loader();
         myloader_Jpn.contentLoaderInfo.addEventListener(Event.COMPLETE, movieLoaded_Jpn);
         myloader_Jpn.load(myrequest_Jpn);
    function movieLoaded_Jpn(e:Event):void {
         // remove listener
         myevent_Jpn.target.removeEventListener(Event.COMPLETE, movieLoaded_Jpn);
         this.addChild(myloader_Jpn);
         myloader_Jpn.x = 20;
         myloader_Jpn.y = 20;
         // remove objects that are in "Japan_Intro" frame
    function removeMovie_Jpn(e:MouseEvent):void {
         // add back objects that are in "Japan_Intro" frame
         // remove from display list
         this.removeChild(myloader_Jpn);
         myloader_Jpn.unload();
         myloader_Jpn = null;
         // this moved from Rtn_Jpn_Intro_ function
         //gotoAndStop("Japan_Intro");
    Its all works great except for the line to remove event..
    1.
    myevent_Jpn.target.removeEventListener(Event.COMPLETE, movieLoaded_Jpn);
    I get an error:   1120: Access of undefined property myevent_Jpn.
    Removing this statement allows the code to work but that is not a solution.
    2.
    Rtn_Jpn_Intro_btn.addEventListener(MouseEvent.CLICK, removeMovie_Jpn);
    I would like this button to remove more than one movie. Is this possible.
    Thanks for the help todate.

  • Is this the best way to test a prime number?

    Ok so I think I finally got my program to work. I tested It with very big 8 digit prime numbers if that means anything. here are 2 Questions about my program"
    -Is this a way of finding prime numbers? (does the program fulfill its purpose?)
    and Second is there a smarter way of doing it?
    Here is the program:
    //This program tests if a number is a prime number
    import java.util.Scanner;
    public class Main
    public static void main ( String args [ ] )
    Scanner input = new Scanner( System.in );
    int number;
    int bob;
    System.out.print(" Enter the number you wish to test:\n");
    number = input.nextInt();
    if (number == 1)
    System.out.print(" 1 is divisible only by 1, therefore it is not prime or composite\n");
    if (number == 2)
    System.out.print(" It's Prime\n ");
    for ( int test = 2 ; test < number ; test++ )
    bob = number % test;
    if ( bob == 0)
    System.out.print("It's Composite\n");
    return;
    System.out.println("It's Prime");
    }

    I got interested in this ...
    //1. PrimeTester_BruteForce: found 3001134 primes <= 50000000 in 410500 milliseconds
    //2. PrimeTester_SieveOfEratosthenes: found 3001134 primes <= 50000000 in 4422 milliseconds
    //3. PrimeTester_SieveOfAtkin: found 3001134 primes <= 50000000 in 24843 milliseconds
    ... so Wkipedia's SieveOfAtkin algorithm apparently requires some serious optimization before it outruns the Greeks... see http://cr.yp.to/primegen.html for an optimized C implementation (which I can't follow).
    PrimeTester_BruteForce.java//find all prime numbers upto the given maximum.
    //Using the brute force method
    //http://www.newton.dep.anl.gov/newton/askasci/1995/math/MATH039.HTM
    //PrimeTester_BruteForce: found 3001134 primes <= 50000000 in 410500 milliseconds
    import java.io.PrintWriter;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    public class PrimeTester_BruteForce {
         public static void main(String[] argv) throws IOException {
              long start = System.currentTimeMillis();
              PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("PrimeTester_BruteForce.txt")));
              int limit = 50000000;
              int count = 0;
    nextn:     for (int n=2; n<=limit; n++) {
                   int top = (int)Math.sqrt(n);
                   for(int i=2; i<=top; i++) {
                        if(n%i==0) {
                             continue nextn;
                   out.print(n);
                   out.print(" ");
                   if(++count%20==0) out.println();
              long took = System.currentTimeMillis()-start;
              out.println();
              out.println("PrimeTester_BruteForce: found "+count+" primes <= "+limit+" in "+took+" milliseconds");
              out.close();
    PrimeTester_SieveOfEratosthenes.java/******************************************************************************
    //find all prime numbers upto the given maximum.
    //http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
    limit = 1000000;       // arbitrary search limit
    // pressume all are prime
    for (i=2; i<=limit; i++) is_prime[i] = true;
    // eliminate multiples of each prime, starting with its square
    for (n=2; n<=sqrt(limit); n++) {
       if (is_prime[n]) {
          for (i=n^2; i<=limit; i+=n) is_prime[i] = false;
    // print the results
    for (n=2; n=<limit; n++) {
      if (is_prime[n]) print(n);
    //PrimeTester_SieveOfEratosthenes: found 164185 primes <= 1000000 in 125 milliseconds
    import java.io.PrintWriter;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    public class PrimeTester_SieveOfEratosthenes {
         public static void main(String[] argv) throws IOException {
              long start = System.currentTimeMillis();
              PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("PrimeTester_SieveOfEratosthenes.txt")));
              int limit = 50000000;
              int n, i;
              boolean[] is_prime = new boolean[limit+1];
              // pressume all are prime
              is_prime[2] = true;
              for (i=2; i<=limit; i++) {
                   is_prime[i] = true;
              // eliminate multiples of each prime, starting with its square
              for (n=1; n<=Math.sqrt(limit); n++) {
                   if (is_prime[n]) {
                        for (i=n*2; i<=limit; i+=n) {
                             is_prime[i] = false;
              // print the results
              int count = 0;
              for (n=2; n<=limit; n++) {
                   if (is_prime[n]) {
                        out.print(n);
                        out.print(" ");
                        if(++count%20==0) out.println();
              long took = System.currentTimeMillis()-start;
              out.println();
              out.println("PrimeTester_SieveOfEratosthenes: found "+count+" primes <= "+limit+" in "+took+" milliseconds");
              out.close();
    PrimeTester_SieveOfAtkin.java/******************************************************************************
    //find all prime numbers upto the given maximum.
    //http://en.wikipedia.org/wiki/Sieve_of_Atkin
    limit = 1000000; // Arbitrary search limit
    array is_prime[5:limit] initial false; // Sieve array.
    biginteger x,y,n,k; // Must be able to hold 5*limit: 4x^2 + y^2!
    // put in candidate primes: integers which have an odd number of representations
    // by certain quadratic forms.
    for x:=1:sqrt(limit) do
    for y:=1:sqrt(limit) do
       n:=4x^2 + y^2; if n<=limit and n%12 = 1 or 5 then is_prime[n]:=not is_prime[n];
       n:=3x^2 + y^2; if n<=limit and n%12 = 7 then is_prime[n]:=not is_prime[n];
       n:=3x^2 - y^2; if n<=limit and x>y and n%12 = 11 then is_prime[n]:=not is_prime[n];
    next y;
    next x;
    // eliminate composites by sieving
    // if n is prime, omit all multiples of its square; this is sufficient because
    // composites which managed to get on the list cannot be square-free
    for n:=5:sqrt(limit) do
      if is_prime[n] then for k:=n^2:limit:n^2 do is_prime[k]:=false; next k;
    next n;
    // Present the results.
    print 2, 3; for n:= 5:limit do if is_prime[n] then print n; next n;
    //PrimeTester_SieveOfAtkin: found 441 primes <= 1000000 in 203 milliseconds
    import java.io.PrintWriter;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    public class PrimeTester_SieveOfAtkin {
         public static void main(String[] argv) throws IOException {
              long start = System.currentTimeMillis();
              PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("PrimeTester_SieveOfAtkin.txt")));
              int limit = 50000000;
              int sqrt = (int)Math.sqrt(limit);
              boolean[] is_prime = new boolean[limit+1]; // Sieve array.
              int x, y, n, k; // Must be able to hold 5*limit: 4x^2 + y^2!
              // put in candidate primes: integers which have an odd number of representations by certain quadratic forms.
              for (x=1; x<=sqrt; x++) {
                   for (y=1; y<=sqrt; y++) {
                        //n=(4*(x^2)) + y^2; if (n<=limit && n%12 in(1,5)) is_prime[n] = !is_prime[n];
                        int xSq = (int)Math.pow(x,2);
                        int ySq = (int)Math.pow(y,2);
                        n = 4*xSq + ySq;
                        if (n<=limit && (n%12==1||n%12==5)) {
                             is_prime[n]= !is_prime[n];
                             //debug("A: x="+x+", y="+y+", is_prime["+n+"]="+is_prime[n]);
                        //n=((3*(x^2)) + y^2; if (n<=limit && n%12==7) is_prime[n] = !is_prime[n];
                        n = 3*xSq + ySq;
                        if (n<=limit && n%12==7) {
                             is_prime[n]= !is_prime[n];
                             //debug("B: x="+x+", y="+y+", is_prime["+n+"]="+is_prime[n]);
                             //debug("   if (n<=limit:"+limit+" && n%12:"+(n%12)+"==7");
                             //debug("   (3*(x^2)):"+xSq+" + (y^2):"+ySq);
                        //n=((3*(x^2)) - y^2; if (n<=limit && x>y && n%12==11) is_prime[n]= !is_prime[n];
                        n = 3*xSq - ySq;
                        if (n<=limit && x>y && (n%12==11)) {
                             is_prime[n]= !is_prime[n];
                             //debug("C: x="+x+", y="+y+", is_prime["+n+"]="+is_prime[n]);
                   }//next y
              }//next x
              // eliminate composites by sieving
              // if n is prime, omit all multiples of its square; this is sufficient because
              // composites which managed to get on the list cannot be square-free
              // for (n:=5:sqrt(limit)) {
              //   if (is_prime[n]) for (k:=n^2:limit:n^2) is_prime[k]:=false;
              for (n=5; n<=sqrt; n++) {
                   if (is_prime[n]) {
                        int nSq = (int)Math.pow(n,2);
                        for(k=nSq; k<=limit; k+=nSq) {
                             is_prime[k]=false;
                             //debug("D: n="+n+" is_prime["+k+"]="+is_prime[k]);
              // Present the results.
              int count = 2;
              out.print("2 3 ");
              for(n=5; n<=limit; n++) {
                   if(is_prime[n]) {
                        out.format("%d ", n);
                        if(++count%20==0) out.println();
              long took = System.currentTimeMillis()-start;
              out.println();
              out.println("PrimeTester_SieveOfAtkin: found "+count+" primes <= "+limit+" in "+took+" milliseconds");
              out.close();
         //private static void debug(String msg) {
         //     System.out.println(msg);
    }

  • HT5622 My whole family shares an Apple ID so that we can share apps, games, calendars, etc..  Is this the best way to do that?  Can we each have our own cloud if we share an Apple ID?

    My whole family share and Apple ID so that we can share games, apps, calendars, etc..  Is there a better way to do this, and can we each have our own cloud for each device while sharing an Apple ID?

    No. There is no way to transfer purchases between IDs
    Allan

  • Is this the best way?

    I'm using two selections for a master and detail ALVs
    Here is their SELECT codes:
    form get_data. "for the first master ALV
      clear it_ekko[].
      select ebeln kunnr lifnr bedat from ekko into
        corresponding fields of table it_ekko where bedat in s_tar and
                                                    kunnr in m_num and
                                                    lifnr in s_num.
      sort it_ekko by bedat ebeln.
      loop at it_ekko.
    * getting customer information
        select single * from kna1 where kunnr = it_ekko-kunnr.
        it_ekko-m_name1 = kna1-name1.
        it_ekko-m_adrnr = kna1-adrnr.
    * getting seller information
        select single * from lfa1 where lifnr = it_ekko-lifnr.
        it_ekko-s_name1 = lfa1-name1.
        it_ekko-s_adrnr = lfa1-adrnr.
        modify it_ekko.
      endloop.
    endform.                    "get_data
    form get_it_ekpo_data. "And this is for the detail
      clear it_ekpo[].
      loop at it_ekko.
        if it_ekko-sel = 'X'.
    * filling in material information
          select * from ekpo where ebeln = it_ekko-ebeln.
            move-corresponding ekpo to it_ekpo.
            append it_ekpo.
          endselect.
        endif. "it_ekko-sel = 'X'
      endloop. "it_ekko
      sort it_ekpo by ebeln ebelp.
    * again filling in material details.
      loop at it_ekpo.
        select single * from mara where matnr = it_ekpo-matnr.
        move-corresponding mara to it_ekpo.
        select single * from makt where matnr = it_ekpo-matnr.
        move-corresponding makt to it_ekpo.
        modify it_ekpo.
      endloop. "it_ekpo
    endform.                    "get_it_ekpo_data

    You can use the "FOR ALL ENTRIES" addition with an internal table like BELNR that has entries that you need.
    After loading BELNR do a SELECT with the FOR ALL ENTRIES IN BELNR addition.
    You have to make sure that table BELNR is not initial.
        IF BELNR[] IS NOT INITIAL.
                 select * from ekpo left outer join makt on ekpo~matnr = makt~matnr
                           left outer join mara on ekpo~matnr = mara~matnr
                           into corresponding fields of table it_ekpo
                           FOR ALL ENTRIES IN BELNR
                           where ekpo~ebeln in belnr~ebeln.
                 ELSE.
                 [optional code to handle empty BELNR]
                 ENDIF.

  • Is this the best way to use flash?

    Our new corporate video at [] 
    was built using flash.  Do you think the interactive piece of it works?  Interactive part starts about 1 minute in or click the "SKIP" button.
    Thanks in advance for your help and feedback!

    Flash can work quite well for presentations like this, but... I have no intention to offend with this... I didn't dare tread beyond the first step of the interactive part.
    The opening presentation has too much of a Sham-wow flavor to it--a carny sales pitch, and it makes me skeptical of what clicking anything might end up leading to.  I wouldn't create this style of presentation (the atmosphere, not the content) for a corporation, but that's just me, and I may not qualify as being young/savvy enough to know what a good corporate image is these days.

  • Is this the best way to do this?

    I have a Authentication servlet that checks username/password. I'm getting I have got this to work but every once and a while I get errors and it doesn't work.
    import java.io.*;
    import javax.servlet.*;
    import java.beans.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.Vector;
    public class DisplayData extends HttpServlet {
    //declare needed variables
    public DisplayData(
    HttpServletRequest req,
    HttpServletResponse res,
    String uName,
    String uPass)
    throws ServletException, IOException, SQLException {
    //run code that takes uName and uPass and validates and sends redirect
    //this code works
    if (errorCode != 0) {
    SQLException sqlError = new SQLException("Database Connection Failure");
    throw sqlError;
    } catch (java.lang.ClassNotFoundException errEvent) {
    errorCode = 1;
    } catch (SQLException sqlError) {
    errorCode = 2;
    } finally {
    dbDriver.close();
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    String uName = req.getParameter("txtUserName");// get user name
    String uPass = req.getParameter("txtPass"); //get password
    if (uName != null && uPass != null) {
    try {
    DisplayData displayData = new DisplayData(req, res, uName, uPass);
    } catch (SQLException s) {
    System.out.println(s.getMessage());
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    doGet(req, res);
    I think my error is where I send the req and res parameters

    I figured out my problemThats good then dont fix it :)
    even though there is no call to this I am required to
    have:
    public DisplayData(){
    Why is that?
    There is a call to this when the servelet is first instanciated and an object is created for it.
    tho' it may happen only once in the servlet's life cycle.
    i think OOAD demads a default constructor..... i am not sure about this.

  • My daughter is going on an exchange to France for a year.  I saw that there is a SIMS prepaid card that fits into an iPhone 4S.  Do you think this is the best way to go and oDo d I suspend her service with our carrier?

    My daughter is going on an exchange to France for a year.  I saw that there is a SIMS prepaid phone card that fits into an iPhone 4S.  Is this the best way to go and if so,  Do I suspend her service with our carrier?

    Is your daughter's phone officially unlocked? If not, you won't be able to use any sim other than a sim from the carrier your daughter's phone is locked to. To do what you want, you need to get your daughter's phone officially unlocked. Once done, she can then purchase a local sim when she gets to France.

Maybe you are looking for

  • All Active Application Requests is empty

    I have setup the Application Approval Workflow.  I use 3 different servers one for SCOR one for SCSM and one for SM Datawarehouse.  Everything appears to be set up correctly according to the AAW documentation. Under All Applications in Configuration

  • OCI doc says Cursor and Nested table have the same bind type SQLT_RSET but they don't

    5 Binding and Defining in OCI PL/SQL REF CURSORs and Nested Tables in OCI says SQLT_RSET is passed for the dty parameter. If I use SQLT_RSET for the return value of a function that returns a table and pass a statement handle's address for the OCI par

  • Set up table data extracted from R/3 not visible in data target of BW

    Hai friends,          I am currently working on extracting data from R/3 to BW. I read the several docs given in the forum and did the following:   1) In the LBWE transaction, my extract structure is already active.   2) In SBIW, i went to the fillin

  • Adding a light in Lingo

    Can someone please help me with this? I want to have a light under a car model that shines down on the ground. I know how to create a light in Lingo, but I can't seem to get it to position under my model. Also, can I attach the light to the model?

  • Start up has yellow flashing light -HD running no screen

    I just got a blue iMac G3 and on booting it up there is a green light, long yellow, short yellow and green light again. The hard drive is running but there is nothing appearing on the screen. Since I cannot boot it up I don't know what software it ha