Jump to content

goldenratiophi

Community Members
  • Posts

    1.383
  • Joined

  • Last visited

Posts posted by goldenratiophi

  1. Yep. Linux comes w/ KDevelop, which automatically generates my Makefile.am's, configure.in's, and other stuff which makes me very happy. I'm having one little problem - every so often the screen goes blank, but unscrewing part of the case makes it suddenly start working. Odd....

  2. After having to order a new motherboard because my other one got scratched, the computer my brother and I built now works! Linux installation... 10 more minutes.... I have pictures too (but I can't find the cable to connect the digital camera to the computer ;) oh well )! :)

  3. Hello,

    My brother is trying to learn java from Sams Teach Yourself Java 2 in 21 Days and is stuck on a problem:

    Using the countDays() (not listed here) from the DayCounter application (also not listed), create an application that displays every date in a given year in a single list from January 1 to December 31

    Here's his source code:


    class DayList {
       public static void main(String[] args) {
        int[] cal= new int[365];
     int i = 0;
     int day = 0;
     int month = 1;
     int yeer = Integer.valueOf(args[0]).intValue(); /* Line 14 */
     while (i<cal.length & month <= 12) {
     while (day < countDays(month, yeer)) {
     day++;
     System.out.println(month + "/" + day);
     }
     month++;
     }
    }  
       static int countDays(int month, int year) {
        int count = -1;
     switch (month) {
         case 1:
      case 3:
      case 5:
      case 7:
      case 10:
      case 12:
          count = 31;
       break;
         case 4:
      case 6:
      case 9:
      case 11:
          count = 30;
       break;
         case 2:
          if (year % 4 == 0)
           count = 29;
          else
           count = 28;
          if ((year % 100 == 0) & (year % 400 != 0))
          count = 28;
     }
     return count;
      }
    }

    Unfortunately, me not being a Java programmer, I can't help him. So.... any tips? The compiler throws an exception saying "ArrayIndexOutOfBoundsException:14" (line 14 labeled by a comment), which seems to imply that args[] doesn't exist, but public static void main(String[] args) gaurentees that it does. Help!

  4. Hmm... syntax highliting for HTML and SQL...

    <HTML></HTML>

    SELECT from BLAH WHERE 2 > 3

    I wonder if there is that for C...

    [C]

    #include <stdio.h>

    #include <stdlib.h>

    int

    main (argc, argv)

    int argc;

    char** argv;

    {

    FILE *out = fopen("hello.out", "w");

    fprintf(out, "Hello, world.");

    exit (0);

    }

    [/C]

    Darn.

    Hehe... spoilers!

×
×
  • Create New...