Jump to content
Can't remember your login details? Read more... ×


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Serf

About hetman

  • Rank
  1. hetman

    Help me choose a language

    Sounds like you've already made up your mind so I'll +1 for Python. It's not the most interesting language but it's probably one of the cleanest and easiest to grasp and probably the one I would recommend to anyone learning their first language. The only downside is that GUI programming is a pain if it's not something you're familiar with. Java is not a nice language, the power is really in the platform and libraries... a lot of which are also not very nice to work with but there's pretty much libraries for anything you could imagine. It's not as fast as C/C++ but it's probably the next best thing. Also nice if you want to get into Android programming or some heavy duty large applications. Also the IDE tools are much nicer than a language like Python (which means easier to do GUIs, debugging, etc). C... if Python was the high pressure hose you use to clean your driveway, then C is a toothbrush. You can definitely do a more thorough job with a toothbrush. Unless you're planning to write Linux kernel drivers or are finding you're hitting performance barriers in languages like Python, you probably won't need it. Ruby is a really nice language. It's great for writing glue code if you're doing admin stuff, the syntax is incredibly expressive and is a joy to work with. If you were getting into backend web server programming for the first time I would probably recommend Ruby because the ecosystem for this is so well developed and it'll be easy to learn a lot about the right way of doing things. I would suggest staying away from PHP here because it's not terribly nice and it would probably teach you some very bad habits. Ruby and Python are similar in where you can use them. Finally there is JavaScript. This one is worth looking at in the future. The available VMs mean it's faster than Python or Ruby. You can use it to do both backend webserver stuff (though not as easy as Ruby for beginners) or frontend web browser stuff. For the backend you'd want to become familiar with Node.js, and for the frontend you'd need HTML5/CSS3. There's tools that combine both Node.js and HTML5 to let you create standalone desktop apps. There are also tools (like PhoneGap) to let you wrap up your JavaScript/HTML5 app in a native outer shell for deployment on any of the popular smart phone platforms. The caveat for phone apps is that it's not as fast as more low level languages so you wouldn't want to use it for things like games (but as hardware and JavaScript VMs keep improving this might very well change... there was a recent tech demo showing off the Unreal Engine running in Firefox).
  2. hetman

    Python pointers

    Like most dynamic languages, Python does everything by reference. All Python variables are just pointers to objects. Copying is something you have to do explicitly (for example using copy.copy() or copy.deepcopy()).
  3. hetman

    Reading other people's code

    I tend not to read other people's code very often out of pure interest, but often due to a lack of sufficient interface commenting (I don't mean type information but how the interface is intended to be used), or because I need to make tweaks etc. But when I do dive into others' code I usually find it very instructive. You can always pick up better methods/approaches to solving problems. I never liked commenting in uni, even though I tended to be good at being verbose when an assignment required commenting. However working in industry has taught me to appreciate commenting. In part because I've had to work with code written by other programmers and I loathe seeing large chunks of code with nary a comment in sight (double hatred for lack of decent interface doco), in part because I've come back to my own code after a months or even a year sometimes and what should have been quick changes were not so because of lack of documentation. I never bought the whole "code should be self commenting" thing. Of course it should, but not as a substitue for comments. Comments should summarise what's happening in the code because reading through every single line of code is often a pointless waste of time, regardless of how understandable that code is. I've found that guiding principle has made coming back to my own old code a pleasure rather than a pain. In any case, we spend more time thinking about algorithms than expressing them in a comp. language, adding a few comments is not exactly going to kill productivity :)
  4. hetman

    What do people use Python/Ruby for?

    I dunno, in my experience, nice looking solutions like this (if I even agree on that judgment in this particular case :P) tend to be great until you hit a wall and then you need to spend stupid amounts of time bending the solution to do something that should actually be quite simple. The liquid templating engine is another good example. At the end of the day, some problems need a sufficiently flexible turing machine representation, and dumbing it down usually leads no place good.
  5. hetman

    What do people use Python/Ruby for?

    I've only done some small projects in PHP in my dark past best left forgotten. Needless to say, not cool. In its pure unstructured form I would not use it for any site using more than 5 pages. Some frameworks inspired by the RoR boom are now available for PHP, however they seem to be very slow compared to RoR or Django. It's a common missconception that PHP is faster than Ruby/Python which seems to have originated from the fact that unstructured PHP sites are faster than those using frameworks like Rails/Django. I've doe web page development in Ruby with Ruby on Rails and with Python in Pylons. Rails/Pylons is fantastic, having structure means you can actually manage large sites far more easily and there's a lot less boiler plate you have to worry about (although the idiot who invented the standard form validation strategy for Pylons needs to build an actual website). And comparing the languages themselves, PHP to Ruby/Python... well it's like comparing BASIC to C#. Sadly I've done more development in Python than Ruby now because of my day job, it's a nice language but it's just missing a little bit of that magic I get in Ruby :)
  6. hetman

    Upload/download System

    I would suggest the most natural solution for this problem is using a thin web client. A thick custom built client for which Visual Basic might be appropriate will probably take more effort, and be less convenient for your customers to use. It doesn't mean it can't be done that way but it wouldnt' be my choice. For web development of custom applications I'd say the most popular modern frameworks out there are Ruby on Rails and Django (therefore the ones with most documentation and support). Rails is meant to be better suited for webapps (like this problem), Django better for publishing, however I have not used Django so I'm not aware of the current state of things. On the flip side, Rails uses Ruby and Django uses Python, however Python is a somewhat simpler language to pickup so it might be more up your alley. Neither language has a singular IDE driven GUI development scheme. You can get GUI builders though which generate resource files that can be used by Ruby or Python but this is more complicated than what you get in VB. However, for a web application this won't be of much value anyway. Finally, you can also use VB to do web development through ASP.NET, I think this is more painful and ugly than the alternatives above however not everyone will probably agree with me so you might consider this approach also.
  7. hetman

    Upload/download System

    Modern browsers allow you to access FTP sites and download files. You'd need a special FTP specific client only if you inteded to upload files as well.
  8. hetman

    Generating a grid based on an image?

    Is there any reason the playable area bitmap needs only define borders? If you define continents or something in one colour, unplayable areas in another colour, then all you need to do is look at a re-scaled area of the image corresponding to a grid square on the map, and count the number of playable pixels in the image. If it is over some threshold tag the grid box as playable. Are these maps generated automatically or manually?
  9. hetman

    Upload/download System

    Ok, so first up, I believe there might be services to facilitate this sort of thing for businesses already. Nothing spring immediately to mind, but I'm sure I've seen something like this. Have a look around. Assuming you can find nothing like that out there, for something like this I would probably get some cheap web hosting somewhere. Deploy it on a remote server for the reasons given by lew~, if your PC goes down over the weekend or something similar, no one can access the artwork until you come back to work. How small is your business? Do you have a dedicated server running 24/7? Does your internet plan allow you to host HTTP web servers; ffor cheaper plans, ISPs will block the HTTP port for example so you upgrade to a more premium service... for a business oriented plan I imagine this would generally not be an issue but would still have to be checked. Now, assuming you are running a really small business, if I was in your shoes I'd be going with the remote web host route. You can get plenty of storage space/bandwidth these days for as little as $20/year. Pay more for improved reliability/speed. Also have factor in domain name registration... could be looking at $30 for a couple years... can't remember 100%, it will depend on type of top level domain: .com, .com.au, etc. I would consider 3 options in increasing levels of complexity: 1. Provide an FTP server, different directories would be dedicated for different clients and protected with digest-authentication: i.e. user gets ugly username/password dialogue box in their browser then gets a list of available files and pulls what they want. 2. Provide a pretty HTTP website frontend that essentially has the functionality of option #1. Now using cookie based authentication. 3. Website that has more access tracking features, for example, database might automatically track how long files remain available for, support many users per company etc. You'd be able to upload files your self through the website also rather than doing an FTP upload. Depending on your tech savvy, you might be able to setup option #1 your self, although you'll probably save money paying someone else to do it. The other options will require some web development ability.
  10. hetman

    Generating a grid based on an image?

    Does that mean the playable areas all lie on a uniform grid? Or do you want the squares to be aligned relative to each other but only within playable areas? Or no alignment at all just kind of jammed into the playable areas? Rybag's approach sounds lik he's onto something for the last case? But I think I'd need to see a diagram :)
  11. hetman

    Generating a grid based on an image?

    So I'm not really getting what you're trying to do. Here's what I'm getting: You want to define a bunch of co-ordinates to bound areas of your map which are usable (versus those that are not) for your game. Then you want to put squares (the size of which depends on the game setup) to be put inside those usable areas. The valid locations for these squares are determined by a grid which is overlayed on the game grid. Am I getting it right so far?
  12. Ok, I've never had to do something like this so I'm just going to give you some guesses and it might help you out. You're probably after something like the Greasemonkey plugin for Firefox which will let you execute custom bits of JavaScript on specific pages. Have a look at this: http://www.greasespot.net/ You'll have to play with greasemonkey to figure out how to allow triggering of scripts via the UI. Once you've got that you need JavaScript to start and stop periodic execution of your function. Start: executer = setInterval(function() { xajax_findtimes(1337, document.form1.sub_code.value, document.form1.sub_code2.value, document.form1.foobar.value, document.form1.foobar2.value); }, 30*1000); Stop: clearInterval(executer); Note, it's hard to know without seeing the code for the xajax_findtimes() function, however the function may need to be bound in the context of the select element on which it is called. In which case your start code will look a bit more like this: executer = setInterval(function() { xajax_findtimes.call(document.getElementById('streams2'), 1337, document.form1.sub_code.value, document.form1.sub_code2.value, document.form1.foobar.value, document.form1.foobar2.value); }, 30*1000);
  13. hetman

    Which Programming Language Is Best To Learn?

    Cool, keep in mind though learning your second language is the most frustrating language you'll learn because there'll be lots of things that are done in a slightly weird way compared to what you're used to. Don't let that discourage you if you eventually move on to Python though, for the kind of application you've mentioned Python/Ruby will really be worth the investment in hours saved thinking about your actual domain problems instead of how to make the language let you program them. Good luck :)
  14. hetman

    Which Programming Language Is Best To Learn?

    All other things being equal, Python is an easier language than Java. However like .:Cyb3rGlitch:. said, if you're finding the Java learning resources are better stick with that. Learning Java will definitely make learning Pythong easier (and vice versa).
  15. hetman

    Which Programming Language Is Best To Learn?

    C++ is a terrible languge for beginners. There are a lot of concepts that must be managed which are only "easy" because you get used to them over time. This might be fun if programming is your primary interest rather than a means of achieving something like data analysis in the case of atomicnewbie. I don't think Java's expresiveness is ideal for bioinformatics, however it does have a speed advantage over scripting languages (if this is important) and it does see some use in this field so there should be some stuff you can leverage out there. Personally I would recommend a scripting language: Ruby or Python. If you need to optimise parts for speed you can write extensions using C. Writing C extensions in Ruby is much simpler than in Python, but neither is as simple as just using Java all round. There's a real trade off between processing speed and how difficult it is to express your ideas/algorithms so do some reading first from people that do significant work in bioinformatics to make sure you don't get stuck with a crappy language for what you need, I get the impression scripting languages tend to be more popular in the field though. Finally you might want to take a look at Perl, I think it's a bit dated and painful as a scripting language but because it's older it's seen earlier adoption in bioninformatics and so is more widely used than Ruby or Python. Still, if there's enough stuff to get you going in either of these other two I would strongly suggest avoiding Perl. Personally I think I would use Haskell for this sort of thing. Far more expressive than Java. Faster than scripting languages. The caveat being I would probably not recommend it for a beginner :) Anyway, I'm just getting into it my self so my opinion may still change.