Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. So continuing with the trend of an update from my original post: I guess quite a lot of that's changed. For starters, i've not done much running at all this year. Mostly because i've had problems with my knees but also because i've been being pretty lazy. I'm now actually at University, studying Computer Science. Not at Oxford, but Bristol. I guess maybe it's a shame I didn't make it into Oxford, but hey, I really like it here. Plus, I've a feeling the course at Oxford was a bit too theoretical for my liking. I'm in my second year now and really liking it. In terms of languages, we tend to focus on C and Java. Though, as i understand it, my next lecture will be to introduce us to some horrible, esoteric language called Occam. It's supposed to help with parallel computation I believe. Fortunately I think we only use it once! To be honest, I spend much less time with PHP then i used to. I still try and drop in here as and when. It's usually when I really should be working :s In fact, right now I'm supposed to be writing up some coursework for my algorithms unit. Whoops. Outside of my uni work, I spend quite a lot of time with my girlfriend. We've been together for just under a year now and things are going great. Plus of course the general university cycle of: drinking, lecture, hangover, sleep. Unfortunately not always in that order though.
  2. Sounds pretty nasty. How are discrimination laws over in The States? Here in the UK, it seems things have swung the other way a little; it seems to be quite common now for job averts to promise to interview any and all people with a disability for fear of appearing discriminatory. Now, im not being funny, but would they really interview you if you applied to be a brain surgeon, just because you had a disability?
  3. Brilliant, lol. Did you get caught for that one?
  4. What do you mean by 'combine'? Do you with your player array to contain two cars afterwards? If so, you need to make your player array a two dimensional one. I.e: $playerSelected = array(); $playerSelected[] = array( 'manufacturer' => 'Toyota', 'model' => 'Celica', 'modexp' => '1200000', 'traction' => '500000', 'aerodynamics' => '3000000', 'acceleration' => '1500000', 'styling' => '6000000' ); You can then add a new car in the same vain as above; $playerSelected[] = $carList[$key];
  5. In answer to the question, the default visibility of attributes is public; if you do not say otherwise they will be accessible from outside the class. IMHO, PHP should throw a notice if you use a class attribute without having previously defined it. In fact, I was pretty surprised to see that it doesn't.
  6. What is it that you are actually hoping to achieve? Writing object-oriented programs is more than just moving your procedural code inside a class. If you do that, all you are achieving is a higher level of "wrapping" of your code (by that, i mean your code is inside a function which is inside a class). The point of the object-oriented paradigm is to allow you to more easily build extensible self-reliant code. A class should (at least in theory) be an entity in it's own right; it should make sense and have a purpose. It should represent something. It shouldn't (as much as is possible) be dependant on another class or another piece of code. In terms of writing classes for database interaction, one of the key points of this is usually to abstract away the particular RDBMS. For example, it shouldn't (in theory) matter if you are using a MySQL database, or PostgreSQL or whatever; the usage of your class should be the same. It should (again, in theory) facilitate the movement of RDBMS in the future. Ideally, it should handle errors and exceptions in your database, and should (probably) deal with cleaning your data before input. The whole point of this spiel? There's no point writing a function that simply calls mysql_**** and putting it in a class.
  7. That will still not work for the reasons outlined by Andy-H. Did you connect to the database first? In any case, add some debugging to your query: mysql_query("INSERT INTO `table1` (id, fname) VALUES (1, '" . $regName . "')") or trigger_error(mysql_error(),E_USER_ERROR);
  8. This is a simpler version of the procedure outlined in this FAQ: http://www.phpfreaks.com/forums/index.php/topic,95426.0.html Basically, use a counter in a loop and add the tags where necessary.
  9. What do you mean by breaks? What actually happens? Also, you should be setting the content type with the header function if you're outputting to a browser.
  10. I've not done this before, but i think what you're going to have to do is download the file using ftp_get to a temporary file on your webserver before offering it to the user for download.
  11. That looks like you've overcomplicated the issue. Why are you executing the same query for various users. What is it that you're actually trying to do?
  12. Well it's a similar kind of process to a hotel room-booking system, albeit on a smaller time-scale. I'd expect that you're more likely to find information on how to do this if you look into that problem instead -- it's more common.
  13. Well that is because you appear to be asking for someone to do this for you. If that is what you want, i suggest you pay someone. If you want to do this yourself, i suggest you start learning a little PHP. Read some tutorials. Find out how to interact with a database from PHP. Find out how to process a form with PHP. You could try the tutorial section on this website: www.phpfreaks.com/tutorials
  14. Without root access it's a bit difficult for me to do it. But in any case, i've arranged for a group to be created for this. Thanks anyway!
  15. Err, yep. Pretty much. These are the tools you'll need: file, array_search, unset and fwrite
  16. How are you planning on storing the data? You could either put the title and content into a database, or you could use a template and write the content to a file. Whichever method you choose, you'll need some basic form handling to do this -- do you have any experience of PHP already?
  17. You do, unfortunately, waste everyone else's time owing to them having to spend twice as long deciphering your posts and, ultimately, ignoring what you've written because they can't read it anyway. So if we consider the overall time spend on your posts, it would be much lower if you used a spell checker.
  18. If you want to add to the system-wide bashrc file (i.e. the one in /etc/) you'll need root access so you'll have to use sudo: sudo gedit /etc/bash.bashrc But I dont think you should need to make changes to this -- just use the one located in your home directory. This will mean the changes that you make will only apply to that user: gedit ~/.basrhc As for your java problem -- do you have any network access? You're obviously not going to be able to download a package if you're wireless isn't working and you don't have a wired network...
  19. Long story short, i'm pretty sure the only way to restrict access to a folder to a bunch of users would be to add them to a group and set the group of the folder, which requires root access. Is this correct? Full explanation, i'm just starting a group project at university and it was my intention to set up a Subversion repository on my university's server. Given that there is another group doing a similar project, I'd like to make sure that they couldn't get desperate and copy the entire repository over and view/steal our files. However, i don't have root access(obviously!) so I cannot create a group for the members of our team. Do I have any options?
  20. Haha. Yeah, i remember there was something like that on a welcome sign in the UK..."Welcome to wheverer. Now f*** off"
  21. They are aliases for the tables. It just means you don't have to write the full table name each time. You can specify a table alias in the FROM clause.
  22. mrMarcus, i'm assuming that those are example values for various parts of the URL. To the OP: you'll need to use regular expressions. You can use the preg_replace function to do what you want.
  23. So what is your question? Does the above not work? What does it do? What doesn't it do?
  24. Bit of a bizarre input format, but you could use ltrim with the optional second parameter to remove the 0s from the left side of the string, then divide by 100 and use the number_format function.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.