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

Weekend coding

1246739

Comments

  • edited February 2011
    I've thought about getting an arduino, but I don't have any knowledge of electronics (capacitors, resistors, and the like) to speak of.
    You don't need to. I wasn't very adept at that stuff either, but there are SO MANY free resources online to teach you.

    Originally, I bought just the Duemillanove and a breadboard because I had everything else from endlessly butchering toys as a kid. I bought a solid core jumper set a little while after. A few weeks ago, I bought the budget pack and an acrylic mounting plate. I love the arduino and how versatile it is. I spend hours at a time, wading my way through instructions, endlessly debugging code because, for some reason, I can never remember to end a line with a semi-colon, all for that moment of sheer glee when my new macguffin actually works HOW I WANT IT TO.

    Buy any of the starter kits, buy just the arduino, but buy one. It's cheap as chips and it will open a brand new world of tinkering for you.
    Post edited by Victor Frost on
  • edited February 2011
    I'm considering using a Duemillanove as the systems controller and avionics/camera brain for a high powered rocket (solid first stage, hybrid second stage with electronics command capsule) I'm considering building. That thing is nifty.
    Post edited by WindUpBird on
  • edited February 2011
    I'm considering using a Duemillanove as the systems controller and avionics/camera brain for a high powered rocket (solid first stage, hybrid second stage with electronics command capsule) I'm considering building. That thing is nifty.
    Don't bother with the duemillanove, just get the new UNO. It has a few new features that really improve it.

    And anyways, I think for your use, you should use the full arduino board for only prototyping, and use the boarduino/custom-arduino-based-board for the final run. It'll save you space and probably weight.

    I've been looking for my next arduino project and I think I've found it. I've only got one spare servo that I've been fooling around with, so I think I'll make a 3D laser scanner based around the DAVID system I toyed with many years back. This'll give me a chance to program for the arduino and maybe a windows GUI front end to control it's operation.

    This is one of my favorite things about this little gadget. It's just so versatile that it really opens the doors to what is possible. It's Zombocom, but real. ^_~
    Post edited by Victor Frost on
  • edited February 2011
    What are people using for C# IDEs? Should I torrent .NET, can I use MonoDevelop or use Notepad?
    Post edited by Omnutia on
  • Just get Visual C# Express
  • What are people using for C# IDEs? Should I torrent .NET, can I use MonoDevelop or use Notepad?
    At work and home I use VS2k8, I've used SharpDevelop before and I liked it. I tried to use Eclipse for some Java stuff and never really liked it. I don't know why it were just ... queer.
  • vim and a terminal. Everything else is for sissies.
  • I've got no problem with vim and a terminal, but having something with good code browsing/indexing/etc. integrated into it has its pluses too. I still drop down to the terminal to run gdb, however.
  • I've got no problem with vim and a terminal, but having something with good code browsing/indexing/etc. integrated into it has its pluses too. I still drop down to the terminal to run gdb, however.
    NERDTree, buffers, and extensive vim knowledge.
  • NERDTree, buffers, and extensive vim knowledge.
    Fuck NERDTree. My vimrc is the tiniest. Defaults for everything. Spend time getting work done, not configuring your text editor.

    https://github.com/Apreche/vim
  • I used to feel the same way as Scott. Then I got old (is 30+ old?) and started using things like CScope once I started dealing with really freaking huge projects. Then I started using GUI wrappers around CScope (like Kscope). Then I used to start using fancier IDEs, though generally only for C/C++ stuff (and the odd Java I may come across). Right now, I'm using Qt Creator at work and it's working quite well for me.

    I fully admit that I feel like I've started going soft in my "old age."

    For just about anything else I work on, though, I usually fire up a vim derivative.
  • Well, it sounds like you are working on totally different stuff. I've been doing over 90% Python for over a year.
  • public static int highOfNRoll(int n)
    {
    int[] rolls = new int[n];
    for(int i = 0; i < n; i++)
    {
    rolls[i]=dice(6);
    }
    int transfer = 0;
    for(int i = 0; i < 3; i++)
    {
    for(int j = i + 1; j < n; j++)
    {
    if(rolls[i] < rolls[j])
    {
    transfer = rolls[i];
    rolls[i] = rolls[j];
    rolls[j] = transfer;
    }
    }
    }
    return rolls[0] + rolls[1] + rolls[2];
    }
    A while back I got to thinking about how to simulate 3.5 DnD character creation, specifically the dice rolls. I then realized that if you had to find the top 3 in a number of dice that was greater than 4 it required some thought, so I made a method to sort the top 3 into the first three slots. Does this look like it would work?

    My fairly simple dice methodpublic static int dice(int sides)
    {
    return (int) (sides*Math.random() + 1);
    }
  • I don't know if your syntax and such is correct without actually testing your code, but your search is a little off. It won't work in all cases. You almost discovered the bubble sort, though!
  • edited February 2011
    I don't know if your syntax and such is correct without actually testing your code, but your search is a little off. It won't work in all cases. You almost discovered the bubble sort, though!
    It runs. Could you be a bit more specific as to when it would not work? Keep in mind that this only needs to find the top 3 integers, and not sort all of them.
    EDIT: Looked up bubble sort, very cool.
    DOUBLE EDIT: Read further, apparently it is terrible. I will persevere in my search.
    Post edited by GreyHuge on
  • I don't know if your syntax and such is correct without actually testing your code, but your search is a little off. It won't work in all cases. You almost discovered the bubble sort, though!
    It runs. Could you be a bit more specific as to when it would not work? Keep in mind that this only needs to find the top 3 integers, and not sort all of them.
    EDIT: Looked up bubble sort, very cool.
    DOUBLE EDIT: Read further, apparently it is terrible. I will persevere in my search.
    Yeah, actually I think your sort might actually be working. I didn't actually calculate it all the way out. I thought it might not work, but actually it was just that it was so horribly inefficient it was putting things out of order on its way to putting them in order. Thing is, there's really no reason you should have to write a sort, unless it's an assignment for class. People have already written all these algorithms, and you should just be able to reuse their work which is in available libraries.
  • Thing is, there's really no reason you should have to write a sort, unless it's an assignment for class. People have already written all these algorithms, and you should just be able to reuse their work which is in available libraries.
    You're probably right, but this was just s little fun thing I did for no reason. I think of it as a form of meditation.
  • edited February 2011
    Last time I posted in this thread you told to stop being a pussy. It worked like magic, and now I have basic understanding of programming with Python. I coded a couple of features for 3d roguelikes, but I need a faster language to handle the graphics. Or so I want to believe, since it motivates me to learn C++.

    So, could someone please recommend a good introductory book?
    I understand the basic concepts of programing as detailed here, but anything too technical would probably be too much for me. Sorry if it seems like a Google question, but I couldn't find a book I can trust enough to spend days reading.
    Post edited by Adelbert on
  • edited February 2011
    I don't know if your syntax and such is correct without actually testing your code, but your search is a little off. It won't work in all cases. You almost discovered the bubble sort, though!
    It runs. Could you be a bit more specific as to when it would not work? Keep in mind that this only needs to find the top 3 integers, and not sort all of them.
    EDIT: Looked up bubble sort, very cool.
    DOUBLE EDIT: Read further, apparently it is terrible. I will persevere in my search.
    Yeah, actually I think your sort might actually be working. I didn't actually calculate it all the way out. I thought it might not work, but actually it was just that it was so horribly inefficient it was putting things out of order on its way to putting them in order. Thing is, there's really no reason you should have to write a sort, unless it's an assignment for class. People have already written all these algorithms, and you should just be able to reuse their work which is in available libraries.
    Well, as a technical problem, it is possible to find just the top 3 faster than sorting all of the elements. If n is very large, Grey's approach would actually be faster than, say, a full quicksort. However, I doubt this would be the case in 3.5 DnD character creation. The (expected time) fastest approach would likely be some kind of incomplete quicksort.

    In any case, I suspect Grey's code would work.
    Post edited by lackofcheese on
  • In these kind of things I like to have something like Eclipse around. No questioning "does this seem like it would work". Just throw the code there, make main function that calls the function you are working with and run debug mode. And you shall see what the program does row by row if you need to.
  • Yeah, I like Eclipse for that as well.
  • Per IDEs, I like having the best of both worlds. For my particular work we use NetBeans, which has the project organization I like, plus SVN integration and it runs the JBoss server we need for development. But I also have a vi plugin for it, so even though it's NetBeans, it has an almost-complete version of vi wrapped around the actual code work. Still use vim and a terminal for everything else not directly code related, like config and property files.
  • edited February 2011
    In these kind of things I like to have something like Eclipse around. No questioning "does this seem like it would work". Just throw the code there, make main function that calls the function you are working with and run debug mode. And you shall see what the program does row by row if you need to.
    Yeah, I like Eclipse for that as well.
    bash ~ $ python
    >>> from myfile import myfunc
    >>> myfunc()
    Interpreters ftw.
    Post edited by Apreche on
  • Yeah, you need barely any tools to code in Python. Just about the only thing you need is syntax highlighting.

    However, from time to time I need to use Java or the like, and I prefer having an IDE for that.
  • edited February 2011
    However, from time to time I need to use Java or the like, and I prefer having an IDE for that.
    Java is dying, so I try to avoid it. Also, it seems like the cool/hip thing to do lately is to use another JVM language such as Scala, Clojure, or Jython instead of actual Java. The only time I use an IDE is when I was trying to use XNA, since all Microsoft stuff requires Visual Studio.

    Also, if you kids like IDEs and such, you should use the bpython shell instead of the default one.

    http://bpython-interpreter.org/
    Post edited by Apreche on
  • Java is dying, so I try to avoid it.
    Sadly, it's not always my choice what language I use.
  • Java is dying, so I try to avoid it.
    Sadly, it's not always my choice what language I use.
    Part of why I changed my job.
  • Java is dying, so I try to avoid it.
    It might be dying, but it's not dead. One can still find knowledge of Java useful. At least that's what I'm telling to myself, our basic programming classes were done with Java and that's what I have most experience with.
  • 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.
Sign In or Register to comment.