This forum is in permanent archive mode. Our new active community can be found here.

Weekend coding

1235739

Comments

  • It might be dying, but it's not dead.
    Yes, if you want to be involved with maintaining or migrating legacy code, same as Perl in most cases.

    My core programming classes at RIT were Visual Basic. I certainly don't use VB today.
    The current core IT programming courses teach Java, I imagine it won't be terribly useful in the longer run.

    Could be worse - the CS program is fucking around, forcing Python for the first quarter and Java for the next. Would be fine, except 22/25 students in CS2 right now are failing. They're good programmers, but the way CS is being introduced right now at RIT is fairly messy.
  • Would be fine, except 22/25 students in CS2 right now are failing. They're good programmers, but the way CS is being introduced right now at RIT is fairly messy.
    Why are they failing? Changing languages is hardly an excuse.
  • The current core IT programming courses teach Java, I imagine it won't be terribly useful in the longer run.
    What ever happened to C/C++? I mean it wasn't that long ago when I was being taught with C on the VAX ... nevermind, I keep forgetting that was 13 years ago.
  • Would be fine, except 22/25 students in CS2 right now are failing. They're good programmers, but the way CS is being introduced right now at RIT is fairly messy.
    Why are they failing? Changing languages is hardly an excuse.
    From what I can tell, it's because they're starting the curriculum with, basically, an intro to programming course in Python, then jumping to high-level theory stuff in another language the next quarter. This is a recent change for this year, I believe, and it just seems like the professors for CS2 assume that certain topics were covered in CS1 that have been glossed over for the sake of this language change.

    The rumor going around is that the CS program changed the languages for CS1 so that most students, who are coming in with AP Comp Sci (which teaches Java) have to re-take RIT's basic programming course. Since Python isn't really used at all later in the curriculum, far as I can tell, there's a decent amount of logic behind that rumor.
  • When Rym says the language was VB, that's because he was in the IT department. In the CS department it was Java when I was there.

    RIT CS has always had a problem with retention. They promise people that they can be successful CS students with no prior experience. When I was there they even claimed that you didn't need to own a computer. That was technically true because you could do all your work in the labs. The reality was that if you had never programmed before in your life, and you didn't already know, or couldn't learn, UNIX without any instruction, you were in deep doo doo.
  • edited February 2011
    Python is probably the best language for an introductory course to software engineering.
    The introductory course I did at UQ used Scheme (a dialect of Lisp); I believe they mostly copied from an MIT course (which is a good thing) and have since switched over to Python, as I believe MIT did.
    Scheme was a great language for teaching purposes, but Python is also great and is a lot more practical.

    However, I will note that at the same time as the intro to software engineering course I did a course that went from logic gates to programming microchips in Assembly and C to light LEDs and the like.

    I'd say teaching those two at the same time is actually a great move.
    Post edited by lackofcheese on
  • I know about the issues with retention and all, and I definitely agree with you there. The problem that's showing up now, because of this one-quarter-of-Python screwing everyone up (professors and students alike), is that even talented programming students are seriously struggling. If they started with Java during the 1st quarter and just went ahead with that (at least for the basic programming core), I'd bet that a good number of the students right now would survive.
  • Well, it sounds like you are working on totally different stuff. I've been doing over 90% Python for over a year.
    Yeah, I mostly work on lower level systems stuff with the odd OS kernel/driver work. Python is my go-to scripting language, however. Yes, I know, you can write large scale high-level applications in Python and not just quick-and-dirty scripts, but given the nature of my work, that's about all I typically use it for.
    What ever happened to C/C++? I mean it wasn't that long ago when I was being taught with C on the VAX ... nevermind, I keep forgetting that was 13 years ago.
    They probably still use it for operating system classes as OSes are still typically written in those languages. They're probably still also used for many generic systems programming classes (networking, databases, compilers, etc.). However, many other classes are moving to Java or other languages. The same software engineering class I took in college which was taught in C++ during my time (also about 13 years ago) switched to Java a couple of years after I graduated.
  • edited February 2011
    I finished my simple "Pet" program today.
    The good: it works just like I expected it to; I finally learned how to use classes and objects!
    The bad: it looks TERRIBLE and is a pain to use. I need to learn how to implement a GUI.

    EDIT: You can find it here. I know that the code is not optimal (there are several unnecessary functions), but this is more of a practice program than anything else; it's not like I'm going to use it.
    Post edited by Snickety-Snake on
  • When I was reading this thread and Scott was beating up on Luke, all I could think was, "wait, Luke can program?!" It's not exactly in his job description. I was impressed.
  • When I was reading this thread and Scott was beating up on Luke, all I could think was, "wait, Luke can program?!" It's not exactly in his job description. I was impressed.
    I write handy python scripts to help me run my podcasts and my websites. One day I'll learn more, but it is just one of many things I do on an ad-hoc basis.
  • edited February 2011
    Hey guys, I kinda need your help with this. I need my arduino to wait until a particular string is received over serial before continuing on with the code. I thought maybe an If/Then, but I don't know enough to properly write one. Google wasn't much help either.
    My current code is below. If you could help me, I'd appreciate it.

    #include <Servo.h>
    Servo tilt;
    int pos = 0;
    const int gledPin = 13;
    const int rledPin = 12;
    const int lazrPin = 11
    void setup()
    {
    pinMode(rledPin, OUTPUT);
    pinMode(gledPin, OUTPUT);
    pinMode(lazrPin, OUTPUT);
    tilt.attach(10);
    Serial.begin(9600); // start serial port at 9600 bps:
    establishContact(); // send a byte to establish contact until receiver responds
    digitalWrite(gledPin, HIGH);
    }
    void loop()
    {
    //code for waiting until serial command
    {
    digitalWrite(rledPin, HIGH);
    digitalWrite(lazrPin, HIGH);
    int max = 5;
    int i = 0;
    for(i = 0; i < max;i++){
    for(pos = 32; pos < 169; pos += 1) // goes from 32 degrees to 169 degrees
    { // in steps of 1 degree
    myservo.write(pos); // tell servo to go to position in variable 'pos'
    delay(15); // waits 15ms for the servo to reach the position
    }
    for(pos = 169; pos>=32; pos-=1) // goes from 169 degrees to 32 degrees
    {
    myservo.write(pos); // tell servo to go to position in variable 'pos'
    delay(15); // waits 15ms for the servo to reach the position
    }
    }
    digitalWrite(rledPin, LOW);
    digitalWrite(lazrPin, LOW);
    }


    Post edited by Victor Frost on

  • // how many bytes is the string, in this case five
    #define STRING_LENGTH 5
    void loop() {
    char buffer[STRING_LENGTH]; // a place to store the string
    // if there are enough bytes available on the serial port
    if( Serial.available() >= STRING_LENGTH)
    {
    // put them in the buffer
    int i = 0;
    for(i=0; i < STRING_LENGTH; i++)
    {
    buffer[i] = Serial.read();
    }
    }
    /*
    keep going about your business in the main loop()
    buffer will contain a string if one was available on this go-around of the loop
    */
    }
  • edited February 2011
    So then, to start the main laser sweep code, all I have to do is encapsulate it in an if/then that checks if the string in the serial buffer matches some arbitrary string that I set, right?
    Post edited by Victor Frost on
  • edited February 2011
    Is there a python function like string.find() except it returns the end of the string you're looking for, rather than the beginning?
    Post edited by Pegu on
  • edited February 2011
    Is there a python function like string.find() except it returns the end of the string you're looking for, rather than the beginning?
    Could you explain this better? I'm not sure what you mean by "end of the string you're looking for".
    str.find() finds the first index at which a substring is found; if you want the last one you need str.rfind()
    Post edited by lackofcheese on
  • edited February 2011
    Well, I'm looking for the end of the text before something, because the something is variable and so is it's location in the string I'm searching. For example, "My shirt is red.", I'm looking for the end of "My shirt is ", to get the color because my shirt could be another color or there could be text in the string before "My shirt is red." Is this a dumb way of accomplishing the task?
    Post edited by Pegu on
  • Nevermind, I'm an idiot. All I have to do is look for the location of the string plus the length of the string.
  • That works, but it's a pretty simple case. In general, you want to use regex for this kind of thing.
    How are you going to pull out the color?
  • color = stringwithcolor[locationofcolor:]
  • That works, if you're guaranteed there won't be any text after the color. Also, in the example you gave, you'd be left with a full stop on the end.
  • What do you mean by full stop?
  • A period, as in "red."
  • edited February 2011
    Yeah, I guess I shouldn't have put a period in the example. What I'm actually doing doesn't have one so it's ok.
    Post edited by Pegu on
  •   CommentAuthorlackofcheese CommentTime3 minutes ago
    That conjures thoughts that I do not want to think about.
  • That quote is pretty broken.
  • That quote is pretty broken.
    It's a cool kind of broken though.
  • I should find the bit of code I had that broke the forum oh so awesomely.
  • I should find the bit of code I had that broke the forum oh so awesomely.
    All you've got to do is double click to select (in Mac Chrome at least).
  • Java is dying, so I try to avoid it.
    Interesting you say this (yeah, I know, a bit of a necro), given how IBM just revealed how Watson was mostly written in Java.
Sign In or Register to comment.