Determine if a number is even or odd in php

hi,
working on a site that uses php and mysql. on one page, i
pull data from a database and put it into a table. the data is
about scientific papers so i have the following fields: id (unique
to each row), title, author, type, content (contains url to the pdf
file), and size. when i run it, the background of the whole table
is white. i want it so that each row of the table alternates
between having a light grey and a white background. i was thinking
about looking into my loop to see if the variable $i is even or
odd. using an if statement if $i is even, background is grey, if $i
is odd, the background is white. how do i do this, and am i on the
right track or is there an easier way to do this? below is the
code. im new to php and mysql. Thanks!!

use de modulus operator:
($i % 2) = 0 --> even
($i % 2) = 1 --> odd
jmack159 wrote:
> hi,
>
> working on a site that uses php and mysql. on one page,
i pull data from a
> database and put it into a table. the data is about
scientific papers so i have
> the following fields: id (unique to each row), title,
author, type, content
> (contains url to the pdf file), and size. when i run it,
the background of the
> whole table is white. i want it so that each row of the
table alternates
> between having a light grey and a white background. i
was thinking about
> looking into my loop to see if the variable $i is even
or odd. using an if
> statement if $i is even, background is grey, if $i is
odd, the background is
> white. how do i do this, and am i on the right track or
is there an easier way
> to do this? below is the code. im new to php and mysql.
Thanks!!
>
> <table border="0" cellspacing="2" cellpadding="2">
> <tr>
> <th></th>
> <th>Title</th>
> <th>Author</th>
> <th>Size</th>
> </tr>
> <?
> $username="username";
> $password="password";
> $database="database";
>
> mysql_connect(localhost,$username,$password);
> @mysql_select_db($database) or die( "Unable to select
database");
>
> $query="SELECT * FROM paper";
> $result=mysql_query($query);
> $num=mysql_numrows($result);
>
> $i=0;
> while ($i < $num) {
> $title=mysql_result($result,$i,"title");
> $author=mysql_result($result, $i, "author");
> $content=mysql_result($result, $i, "content");
> $type=mysql_result($result, $i, "type");
> $size=mysql_result($result, $i, "size");
> ?>
>
> <tr>
> <td><a href="<? echo "$content";
?>"><img src="images/icon_pdf.gif"
> alt="download pdf" /></a></td>
> <td><a href="<? echo "$content";
?>"><? echo "$title"; ?></a></td>
> <td><a href="<? echo "$content";
?>"><? echo "$author"; ?></a></td>
> <td><? echo "$size"; ?></td>
> </tr>
>
> <?
> $i++;
> }
>
> mysql_close();
> ?>
>
> </table>
>

Similar Messages

  • Best way to determine if a number is evenly divisible by a double?

    I need to determine if some number is divisible by some other number. A simple solution is:
    public boolean isDivisibleBy(double dividend, double divisor)
       return dividend % divisor == 0;
    }Unfortunately this does not work if the divisor is not an integer (e.g. 1.0 % 0.1 results in 0.1).
    I am trying to find a solution with good performance, but hopefully doesn't make the code too messy. I assume someone has solved this problem before, but apparently my Google-fu is weak. :-(
    Anyone have a solution they'd care to share?

    Sorry, I realized my post did not ask my real question (but you answered too quick for me to edit it ;-) ).
    What I'm unsure of is what metric I should use. I was hoping perhaps the maximum imprecision would be determined by the IEEE double standard. I take it from your reply this is not the case? So I should just choose whatever limit I feel will be sufficiently small for my application?
    Edit: I've experimentally found 1.0E-16 to be sufficient for the imprecision in my test cases. Since the smallest imaginable divisor for my application would be several orders of magnitude larger than that, I think I will be fine just by picking an arbitrary number.
    Still, I would be interested to know if the definition of the remainder function would provide any insight into the maximum imprecision which would be possible.
    Anyway, thanks for the help.
    Edited by: dsiegmann on Dec 11, 2007 4:18 PM

  • Change colour of a circle whether mousePressed is an even or odd number

    Right this is sort've difficult to explain. I have implemented a grid of circles for a Connect 4 game with the help of you fine people :) Now to add to this, I am looking to change the colour of a circle depending on whether it's an even or odd mousePressed. Basically this is like playing somebody else, so each player takes it in turns. If there is an easier way to do this then I would greatly appreciate it.
    public class CircleGrid extends JPanel implements MouseListener
            boolean ifRed;
            public CircleGrid()
              ifRed = true;
              addMouseListener(this);
            public void toggleColor()
              ifRed = !ifRed;
              repaint();
            public void paintComponent(Graphics g)
              if (ifRed)
                g.setColor(Color.RED);
              else
                g.setColor(Color.BLUE);
              g.fillOval(0, 0, 50, 50);
            public void mousePressed(MouseEvent evt)
               toggleColor();
            public void mouseClicked(MouseEvent evt)
            public void mouseReleased(MouseEvent evt)
            public void mouseEntered(MouseEvent evt)
            public void mouseExited(MouseEvent evt)
         }That is the code which draws the ovals and such on to my gameCenter JPanel.
    I was thinking something like:
    pesudo code --
    if mousePressed is an even number
    then set g.setColor = blue
    else
    g.setColor = red
    Thank you guys. I would appreciate any help. I'm still very much a newbie and some of my questions, I'm sure, are trivial to most of you but we all have to start somewhere.

    Hey LW, cheers buddy. :)
    I used your idea.
    Here's my working code:
    if (clicks == 0)
                        ifRed = true;
                        repaint();
                        clicks = 1;
                   else if (clicks > 0)
                        ifRed = false;
                        repaint();
                        clicks = 0;
                   }

  • How to work even and odd number query

    Plz explain how below worked even and odd query
    2 ) why used subquery after from and which time we can use(what time of out put)
    even
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=0   
    odd
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=1

    Row_Number function returns the sequential number of a row
    (By using partition of a result set, starting at 1 for the first row in each partition)
    >> why used subquery after from and which time we can use(what time of out put)
    When we need sequntial numbers, we can use row_number function. Put it into derived table and use this derived table after FROM clause (Same way it is used in your query)
    CREATE TABLE stud_Enrollment (
    grno int,
    stud_id int,
    stud_name varchar(20)
    INSERT INTO stud_Enrollment
    VALUES (101, 511, 'Dheeraj'), (112, 521, 'Vaibhav'), (132, 522, 'Lalit'), (124, 564, 'Amogh'), (143, 598, 'Sushrut')
    SELECT * FROM stud_Enrollment
    -- Result of your table
    --grno stud_id stud_name
    --101 511 Dheeraj
    --112 521 Vaibhav
    --132 522 Lalit
    --124 564 Amogh
    --143 598 Sushrut
    -- Now we need to find out the rows which are at even position, ie row should be at position of 0,2,4,6,8 etc..
    -- But we don't have sequential number here in your table result
    -- So we can create one new column by using row_number function
    SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row, --> additiona "row" column
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment
    -- We got "row" column in below output
    --row grno stud_id stud_name
    --1 101 511 Dheeraj
    --2 112 521 Vaibhav
    --3 132 522 Lalit
    --4 124 564 Amogh
    --5 143 598 Sushrut
    -- Now above table is used after FROM clause. It uses row column in WHERE part
    SELECT
    FROM (SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row,
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment) d
    WHERE d.row % 2 = 0
    --row grno stud_id stud_name
    --2 112 521 Vaibhav
    --4 124 564 Amogh
    -Vaibhav Chaudhari

  • Random number generator. Even and odd numbers

    I have a problem.
    I have a random number generator, it goes from 0 to 20, I need to have two indicators, one will show how many numbers are pairs, and how many are not.
    I tried to use the decimated 1D array, but since those numbers are random, it doesn´t work for me. I´m new with LabView, and I don´t know if there is some other way to make it work, I need some help, especially with some examples.
    Thank you so much.
    Solved!
    Go to Solution.

    RavensFan wrote:
    Spoiler (Highlight to read)
    Create the array.  Use quotient remainder to divide by 2.  Now you have an array where all the odd numbers are now 1, and all the even numbers are now 0.  Sum the array and you have the total number of odd numbers.  The number of evens will be the length of the array divided by the # of odds.
    Create the array.  Use quotient remainder to divide by 2.  Now you have an array where all the odd numbers are now 1, and all the even numbers are now 0.  Sum the array and you have the total number of odd numbers.  The number of evens will be the length of the array divided by the # of odds.
    Haha I lost sight of the fact that he was looking for the amount off odds and evens.  Good one.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • How to display even and odd number ranges between two given inputs.

    Hi Every one,
    I am just started my career in sap abap and trying to find the solution for this.
    I am trying to display number range using select options, but I am getting an error "Memory low leave the transaction before taking a break".
    Example: when I give two number 2 and 10 , it should display set of all even and odd numbers in that range.
    Below is the code logic that I am using:
    data: a type i,
             b type i,
             c type i,
             d type i,
             num type i.
    select-options: in for num.
    a = inp-low.
    b=inp-high.
    c = inp-low mod 2.
    d = inp-high mod 2.
    while a <=b and c = 0.
    write: "even numbers:', a.
    b = a + 1.
    endwhile.
    while a <=b and c <> 0.
    write: "odd numbers:', b.
    b = a + 1.
    endwhile.
    Any help will be much appreciated.

    This is your logic...changed:
    data: a type i,
              b type i,
              c type i,
              d type i,
              num type i.
    data: even type i,
           odd  type i.
    select-options: in for num.
    a = in-low.
    b = in-high.
    c = a mod 2.
    if c is INITIAL. "It measn a is even
       even = a.
       odd  = a + 1.
    else.
       odd  = a.
       even = a + 1.
    endif.
    * Even
    a = even.
    while a <= b.
       write: / 'even numbers:', a.
    *  b = a + 1.
       a = a + 2. "The next even number
    endwhile.
    * Odd
    a = odd.
    while a <= b .
       write: / 'odd numbers:', a.
       a = a + 2. "The next odd number
    endwhile.

  • Add Even and Odd Numbers

    I have a programming assignment that needs to read a set of integers and then finds and prints the sum of the evens and sum of the odds.
    I know how to find out which numbers are odd and even, I just can't figure out how to add up the evens and odds. Say a set of 10 integers is inputted, how can they be added up after it is determined if they are even or odd?

    Here is my code after the tip from student... It compiles but once ran it doesn't do anything after the integers are put in.
    import java.util.*;
    public class EvenOddIntegers {
        static Scanner console = new Scanner(System.in);
        static final int limit = 10;
        public static void main(String[] args) {
             int number = 0, limit = 0, sumEven = 0, sumOdd = 0;
             int odds = 0;
            int evens = 0;
             System.out.print("Enter ten positive integers: ");
             while (limit <= 10)
                  number = console.nextInt();
             if (number % 2 == 0)
                  sumEven += number;
             else if (number % 2 != 0)
                  sumOdd += number;
             System.out.println("Sum of even numbers is " + sumEven + ".");
             System.out.println("Sum of odd numbers is " + sumOdd + ".");
    }

  • An Even or Odd Problem...

    Hey all,
    I'm trying to write a program that has a variable with a randomly generated number between 1 and 100, and if the number is even I would output EVEN to the screen, if it was Odd I would output ODD, like so:
    81 Odd
    39 Odd
    60 Even
    88 Even
    27 Odd
    then it would count them up in the end and out put that:
    Number of evens: 11
    Number of odds: 9
    I've been working on it for 4 days now and am having a heck of a time with it. Here's the code I've come up with so far:
    public class EvenOdd {
    public static void main(String[] args) {
    final double LIMIT = 100;
         double num = ((Math.random() * 100) + 1) * 5;
         if (num % 2 == 0)
         System.out.println(Math.round((2*(num-0.5))) + " Odd.");
         else
    System.out.println(Math.round((2*(num-0.5))) + " Even.");
    But it only outputs one number to the screen and it's FAR too large. I also don't know how I would add the numbers up to come up with an totaling output at the end. Does anyone have any idea as to how to help with this? All help is appreciated...

    public class EvenOdd {
         public static void main(String[] args) {
              final double LIMIT = 100;
              int evenNum = 0;
              int oddNum = 0;
              for (int i =0; i<LIMIT; i++) {
                double num = (Math.random() * 100);
                int roundedNum = (int) Math.round( num);
                if (roundedNum % 2 == 0) {
                   System.out.println(roundedNum + " Even");
                   evenNum++;
                else {
                   System.out.println(roundedNum + " Odd");
                   oddNum++;
              System.out.println("Number of evens: "+ evenNum);
              System.out.println("Number of odds: "+ oddNum);
    }AA

  • Is there a way to apply a master page to even (or odd) pages in a long document?

    I'm taking a very simple, large pdf document and bringing it into InDesign to add some graphics. The pdf is actually a customized 2-page document for a large employee group (i.e. pages 1 and 2 are for employee001, pages 3 and 4 are for employee002, pages 5 and 6 are for employee003, etc.).
    I've found a script that allows me to bring in all the pages of the pdf at one time, provided I've set up the correct number of blank pages in InDesign. What I'm looking for now is a way to apply a master page to all even numbered pages at one time. Or all odd pages. Anyone have any ideas?
    Ideally, an option that would import the entire pdf document, add the appropriate number of pages to the InDesign document, and be able to assign different master pages to even and odd pages would rock! Help!

    for (var i=0;i<= PageLength-1;i++)
    var isEven = function(someNumber){
    return (someNumber%2 == 0) ? true : false;
    if(isEven(newDoc.pages.item(i).name) == true)
              //Apply Master B for right page
              newDoc.pages.item(i).appliedMaster = app.activeDocument.masterSpreads.item("B-Master");
    //Move elements by x, y position, script label ContactEmail
    newDoc.pages.item(i).pageItems.item("ContactEmail").move([0.7292, 6.011]);
    }else{
              //Apply Master A for left page
              newDoc.pages.item(i).appliedMaster = app.activeDocument.masterSpreads.item("A-Master");
    }//for Else
    }//For

  • How to test if a decimal is even or odd in labview

    i made a VI that tests for even and odd integers using the quotient/remainder function and the Select function but when i test a decimal it does not work properly.
    i have my VI testing to see if the input diveded by 2 gives you a remainder equal to 0, and if it does then it is even and the VI displays a messege saying "Even", but when i put in a decimal ( for example 7.2) the remainder is spitting out 1.2 which is not equal to 0 making my VI not work properly, if anybody can help me with this i would greatly appreciate it and if you could attached a photo that would help me understand what my mistake is, Thanks i have attached my VI for you to look at
    Attachments:
    P 3.7.vi ‏34 KB

    As has been already said, odd/even is only defined for integers, so you need to tell us what you expect for e.g. 7.2.
    Do you want to know if the last decimal digit is even or odd?
    Do you want to know if the nearest integer is even or odd?
    While you are at it, you might also think a bit more about your program design:
    What is the purpose of your "select" primitive? What do you think would be different if you just leave it out completely?
    Why do you test for "equal zero" and "not equal zero"? One is just the inversion of the other and knowing one also determines the other automatically.
    Why do you use two dialog boxes? Do one comparison and use "select" to switch between the two messages. Only one express dialog needed.
    Don't mix blue and orange. Select the correct representation for your diagram constants.
    There is a primitive for "equal zero"
    Never use equal and not equal comparison with orange numeric data (DBL). You might not get expected results.
    LabVIEW Champion . Do more with less code and in less time .

  • Split and add Even and odd numbers

    Hi All,
    I got a seven digit number any number say for example (6581231). Now i need to add even number and odd number separately.
    Output should be
    6 + 8 + 2 = 16
    5 + 1 + 3 + 1 = 10
    Thanks
    S

    Assuming the number is always 7 digits one way to do this would be:
    Data: string(7) type c,
             num type i.
             Nmod type i.
    **move the number to a string.
    Move num to string.
    split into 7 individual chars.
    Num1 = string+1
    Num2 = string+2.
    Num3 = string+3
    Etc…
    divide each by 2 and find remainder
    Nmod = num  mod 2.
    if remainder is 0, number is even
    If nmod = 0.
    Number is even.
    Else.
    Number is odd.
    Endif.

  • Detecting even and odd numbers

    Hi, I'm drawing a series of rectangles using AS3, and need
    every alternate one to be lighter... I'm using a switch statement
    currently, with a variable counting the number of rectangles and
    case 1, case 2, case 3, etc.
    Is there a formula or some way of telling whether there is an
    even or odd number of rectangles so my switch statement can just be
    case even:, case odd: ? The way I have it is fine for 10 or so
    rectangles but I'd rather make it more expandable.
    Would appreciate any suggestions

    % is a modulo operator that finds a remainder of a division.
    9%2 = 1, 9%4 = 1, but 9%3 = 0.
    In the case of odd/even numbers one can look at it as that an
    even number that leaves no remainder when divided by 2 and odd
    number is a number that leaves remaining 1 when divided by
    2.

  • Counting even and odd values

    Is there another way to count even and odd number than this one
    private static int countEvenOrOdd(int[] array, boolean countEvenNumbers){
              int count = 0;
              int remainderRequired = (countEvenNumbers ? 0 : 1);
              for(int i = 0; i < array.length; ++i){
                   if(array[i] % 2 == remainderRequired){
                        ++count;
              return count;
         }

    > I like hacking ;-) Have a look at this: ...
    Jos, you forgot the method for counting both:int countOddsAndEvens(int[] array) {
    return (countOdds(array) + countEvens(array));
    } ; )Yep, you're right, and for completeness reason I'd like to add the following:int countOthers(int[] array) {
       return array.length-countOddsAndEvens(array);
    }And for those junit maniacs:boolean testCounters(int[] array) {
       return countOddsAndEvens(array)+countOthers(array) == array.length;
    }btw, the moment I posted my previous reply I realized that I could've done better:int countOdds(int[] array) {
       int c= 0;
       for (int i= 0; i < array.length; c+= array[i++]&1);
       return c;
    }kind regards,
    Jos ( <-- never has to maintain others' code ;-)

  • Determine tcp port number

    my project requires me to read the data from one TCP port and process the data then transfer it out from another TCPO port. (using PXIe-8115 which have 2 tcp port). problem is i have no idea how to determine the port number of the TCP port.
    in what way i can determine the port number of both port?

    here is an example i found online but i couldn't understand it. the instruction says the server need to be run before client. but the port number seems a little bit random to me but it did manage to get some signal. 
    can i know where the signal come from and how i can determine the correct port number. i know this question mayby sounds basic or even stupid. but i really don't have much knowledge on Labview. any help would be useful. 
    Attachments:
    Client (trial).vi ‏16 KB
    Server (trial).vi ‏11 KB

  • [SOLVED] Unable to determine major/minor number of root device - USB

    I installed Arch on a USB harddrive of mine from within VirtualBox with the intention of running the installation (via the drive) on a laptop in my house. I passed through the drive through by creating a special vmdk (here - it's for "expert users only". ) and installed Arch on it by booting off the Arch 2011.08.19 iso and following the instructions. I do recall the installer complaining because /sbin/mkinitcpio was missing, so I copied over the one from the host (which is also an up-to-date Arch system). After that, everything worked and I was able to boot the drive within virtualbox.
    Then I went and plugged it in to another laptop in the house and, surprisingly (for me at least), it got past GRUB. My joy was short-lived, because it failed just a bit later:
    :: Running Hook [udev]
    :: Triggering uevents...done.
    ERROR: Unable to determine major/minor number of root device 'Waiting 10 seconds
    for device /dev/disk/by-uuid/[the uuid] ...
    /dev/disk/by-uuid/(the uuid)'.
    You are being dropped to a recovery shell
    Type 'exit' to try and continue booting
    sh: can't access tty: job control turned off
    [ramfs /]#
    So I googled around for a while and plugged it back in to my computer, booted it up in virtualbox, and added "usb" to the HOOKS array right after udev in /etc/mkinitcpio.conf. Then I rebuilt the initramfs:
    # mkinitcpio -p linux
    So I plugged it back into the laptop, booted it, and got the same error.
    Later, in an attempt to isolate the problem, I removed "sata" from HOOKS, ran the same mkinitcpio command again, and rebooted the VM. I got what looked like the same error as the one above. yay. So I guess the usb hook isn't being loaded or something like that. (I've since added the "sata" hook back and rebuilt the initramfs so I can mess around in the VM )
    I've tried removing autodetect from HOOKS (saw that in some threads) and trying different USB ports on the laptop, but nothing seems to be working. I also checked to see if virtualbox was providing a bogus uuid or something, but the one it's specifying seems to be correct - I looked in my computer's /dev/disk/by-uuid and it matched.
    Info on the drive (first partition is /boot, second is swap (derp!), third is /, and fourth is /home):
    # sudo fdisk -l /dev/sdg
    Disk /dev/sdg: 500.1 GB, 500107861504 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773167 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00016b3d
    Device Boot Start End Blocks Id System
    /dev/sdg1 * 63 208844 104391 83 Linux
    /dev/sdg2 208845 4417874 2104515 82 Linux swap / Solaris
    /dev/sdg3 4417875 209230559 102406342+ 83 Linux
    /dev/sdg4 209230560 976768064 383768752+ 83 Linux
    Screengrab of my VirtualBox storage setup (just for giggles):
    My /etc/mkinitcpio.conf:
    # vim:set ft=sh
    # MODULES
    # The following modules are loaded before any boot hooks are
    # run. Advanced users may wish to specify all system modules
    # in this array. For instance:
    # MODULES="piix ide_disk reiserfs"
    MODULES=""
    # BINARIES
    # This setting includes any additional binaries a given user may
    # wish into the CPIO image. This is run first, so it may be used to
    # override the actual binaries used in a given hook.
    # (Existing files are NOT overwritten if already added)
    # BINARIES are dependency parsed, so you may safely ignore libraries
    BINARIES=""
    # FILES
    # This setting is similar to BINARIES above, however, files are added
    # as-is and are not parsed in any way. This is useful for config files.
    # Some users may wish to include modprobe.conf for custom module options
    # like so:
    # FILES="/etc/modprobe.d/modprobe.conf"
    FILES=""
    # HOOKS
    # This is the most important setting in this file. The HOOKS control the
    # modules and scripts added to the image, and what happens at boot time.
    # Order is important, and it is recommended that you do not change the
    # order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for
    # help on a given hook.
    # 'base' is _required_ unless you know precisely what you are doing.
    # 'udev' is _required_ in order to automatically load modules
    # 'filesystems' is _required_ unless you specify your fs modules in MODULES
    # Examples:
    ## This setup specifies all modules in the MODULES setting above.
    ## No raid, lvm2, or encrypted root is needed.
    # HOOKS="base"
    ## This setup will autodetect all modules for your system and should
    ## work as a sane default
    # HOOKS="base udev autodetect pata scsi sata filesystems"
    ## This is identical to the above, except the old ide subsystem is
    ## used for IDE devices instead of the new pata subsystem.
    # HOOKS="base udev autodetect ide scsi sata filesystems"
    ## This setup will generate a 'full' image which supports most systems.
    ## No autodetection is done.
    # HOOKS="base udev pata scsi sata usb filesystems"
    ## This setup assembles a pata mdadm array with an encrypted root FS.
    ## Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
    # HOOKS="base udev pata mdadm encrypt filesystems"
    ## This setup loads an lvm2 volume group on a usb device.
    # HOOKS="base udev usb lvm2 filesystems"
    # Tried this line instead -- didn't work either
    #HOOKS="base udev usb autodetect pata scsi sata filesystems usbinput"
    HOOKS="base udev usb sata filesystems"
    # COMPRESSION
    # Use this to compress the initramfs image. With kernels earlier than
    # 2.6.30, only gzip is supported, which is also the default. Newer kernels
    # support gzip, bzip2 and lzma. Kernels 2.6.38 and later support xz
    # compression.
    #COMPRESSION="gzip"
    #COMPRESSION="bzip2"
    #COMPRESSION="lzma"
    #COMPRESSION="xz"
    #COMPRESSION="lzop"
    # COMPRESSION_OPTIONS
    # Additional options for the compressor
    #COMPRESSION_OPTIONS=""
    My GRUB menu.lst:
    # Config file for GRUB - The GNU GRand Unified Bootloader
    # /boot/grub/menu.lst
    # DEVICE NAME CONVERSIONS
    # Linux Grub
    # /dev/fd0 (fd0)
    # /dev/sda (hd0)
    # /dev/sdb2 (hd1,1)
    # /dev/sda3 (hd0,2)
    # FRAMEBUFFER RESOLUTION SETTINGS
    # +-------------------------------------------------+
    # | 640x480 800x600 1024x768 1280x1024
    # ----+--------------------------------------------
    # 256 | 0x301=769 0x303=771 0x305=773 0x307=775
    # 32K | 0x310=784 0x313=787 0x316=790 0x319=793
    # 64K | 0x311=785 0x314=788 0x317=791 0x31A=794
    # 16M | 0x312=786 0x315=789 0x318=792 0x31B=795
    # +-------------------------------------------------+
    # for more details and different resolutions see
    # https://wiki.archlinux.org/index.php/GRUB#Framebuffer_resolution
    # general configuration:
    timeout 5
    default 0
    color light-blue/black light-cyan/blue
    # boot sections follow
    # each is implicitly numbered from 0 in the order of appearance below
    # TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
    # (0) Arch Linux
    title Arch Linux
    root (hd0,0)
    kernel /vmlinuz-linux root=/dev/disk/by-uuid/b4a677d0-cb0d-4acd-bb09-2dc2f4b9501f ro
    initrd /initramfs-linux.img
    # (1) Arch Linux
    title Arch Linux Fallback
    root (hd0,0)
    kernel /vmlinuz-linux root=/dev/disk/by-uuid/b4a677d0-cb0d-4acd-bb09-2dc2f4b9501f ro
    initrd /initramfs-linux-fallback.img
    # (2) Windows
    #title Windows
    #rootnoverify (hd0,0)
    #makeactive
    #chainloader +1
    Last edited by UncleNinja (2011-12-02 15:33:21)

    UncleNinja wrote:
    skunktrader wrote:https://bugs.archlinux.org/task/27385
    Perfect! Thank you!
    Would it be safe to copy over the version from HEAD into my mkinitcpio?
    EDIT: nevermind, derp derp the package is updated
    EDIT again: Actually, it's not.
    I copied over the init_functions in HEAD into /lib/initcpio/init_functions and rebuilt the initramfs. It worked!
    Thanks guys!
    Last edited by UncleNinja (2011-12-02 15:35:20)

Maybe you are looking for

  • "Show doc panel" on two monitors

    Hi, JDev 11.1.2 offers super behavior "Show doc panel" on "Completion insight" menu. Unfortunately with two monitors (JDev active on right one) is display of doc panel ruptured between left and right monitor and in practice useless. Is there any chan

  • Je ne peut pas faire de mises à jour, on m'indique : une erreur inattendue est survenue. Que faire ??

    Je ne peut pas faire de mises à jour, on m'indique : une erreur inattendue est survenue. Que faire ??

  • App world si me cobro y no recibi mis descargas

    Blackberry app World si me descargo de mi tarjeta de debito pero marco error y no pude descargar mis software, de echo hay uno que me cobro doble, a donde me puedo dirigir para aclarar esto, ya mande correos a los dueños de los programas pero me dice

  • Something wrong with my built-in camera

    Hi all: I'm having trouble with my MacBook Pro (2012Mid, 13-inch), the built-in camera just don't work. Like it completely disconnected form my Macbook Pro. the facetime and the photo booth only said "No camera connected". I have tried to reset my PR

  • RFC or Proxies

    Hi All,         If I have ECC6 and sap xi, then is it mandatory that I have to go for proxies and not RFC's? If I want to use RFC's instead of proxies at the sender end where sender is ECC6 system, then what could be the reasons for the same? Regards