Jump to content


Active Members
  • Posts

  • Joined

  • Last visited

Profile Information

  • Location

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

barrytone's Achievements


Newbie (1/14)

  1. Thanks cooper. Having talked to a few others, this seems to be the general consensus. I think PHP and it's min() have softened me up :roll: I'm just gonna pass the length of the array to the function and use: int minvalue(int iar[], int size) { int ret = iar[0], count=0; while (count < size) { if (iar[count] < ret) { ret = iar[count]; } count++; } return(ret); } Oh: one last thing... Why can't I call the array "iar"? I don't know Hungarian. I just meant it to be "Input ARray" :roll:
  2. I've hit a bit of a problem with a function I wrote in C. I needed a function to find the minimum value in an array of integers, without knowing it's size. I started with this: int minvalue(int iar[]) { int ret = iar[0], count=0; while (iar[count]) { if (iar[count] < ret) { ret = iar[count]; } count++; } return(ret); } But I then realised I would hit problems if the array contained a '0' half way though, and the loop would stop executing. So then I tried this: int minvalue(int iar[]) { int ret = iar[0], count=0; int size = sizeof(iar)/4; while (count < size) { if (iar[count] < ret) { ret = iar[count]; } count++; } return(ret); } I'm sure it's a feature and not a bug, but the sizeof() function doesn't seem to be returning the size of the array that's fed to the function. It just returns '4' no matter what. If anyone could help me out and explain what it is I have to do to make this work, or has a neat little function of their own that they wouldn't mind sharing, that would be fantastic :) Many thanks. Oh, and yes: I am a C newbie.
  3. Not bad. But wait a minute... Is your friend Actually called Dave Gorman?
  4. That's pretty cool :) If you didn't want to mess with the mains: you could use an old mic or even an old speaker and amplify the output to drive some LEDs/lights. Shouldn't be too hard to do with batteries. It'd flash to any sound source too.
  5. Try running: runas /env /user:administrator control and getting to the disk management that way. You shouldn't have any problems, in theory :) runas can be a bit of a pain sometimes though, so if you can't get control panel up that way, run runas /env /user:administrator cmd and then in the command prompt that appears run compmgmt.msc :)
  6. psexec %1 -u administrator -p %3 sc config messenger start= auto psexec %1 -u administrator -p %3 net start messenger psexec %2 -u administrator -p %3 sc config messenger start= auto psexec %2 -u administrator -p %3 net start messenger psexec %2 -u administrator -p %3 net send %1 "%4" save as sendmsg.bat http://sysinternals.com -> pstools. Make sure psexec is in your PATH or in the same dir as the above file. sendmsg.bat <recipient ip> <sender ip> <admin password> <message> That should work fine. You can use the at command to schedule it
  7. Rab, I'm afraid it is! Moonlit, double choc chip would be great! :D
  8. COOKIES FOR ME! It's my birthday next week too :) What kinda cookies? :D
  9. Got it. PMed Moonlit :) Won't ruin it for everyone else :P
  10. Although a you can use the GET method and put the details into the url, this won't work for a lot of websites written in php. Newer versions of php have register globals turned off by default (or has been turned of deliberately). With the result that the code has to reference $HTTP_GET_VARS[varname] instead of just $varname to get the value inputted by file.php?varname=somevalue. Basically, unless the coder intended the variable's value to be taken from the url, it won't work.
  11. There's some handy tools at http://rumkin.com/tools/cipher/ Pencil, paper and a whole lot of spare time is the best way to go if you ask me, though :P You never know. It might just be Rot 13 :P
  12. It might be cheating, but you could just wire one of the pots from one of the analog sticks into a circuit for controlling the speed of the motor. Not as efficient as PWM, but it would work. Otherwise: look here and here, and try to come up with a circuit that would read signals from the data pin and turn it into something usefull. The latter method seems a little over the top if you ask me.
  13. Try and pick a name that's something to do with where it is. As stupid as it may seem: where I was living till recently, in a place called Aire Vally, there was a guitar shop opened called "Aire Guitars". I thought it was a sucky name, but then they won an award for it. Seriously though, I passed a computer shop yesterday called "MEGABYTE". So I'm sure you can do better than that :roll: Or call it "Less Than Three"
  14. Sorry. That just made me laugh. P2P shit... I grabbed a pic of a fancy new media centre pc blue-screening the other week :) Would you pay £1999 ($3700) for that?!
  15. Am I the only one with a good experience of Ubuntu? :? My laptop is only a few months old. I can't get BackTrack, Auditor, Knoppix or any of the other live cds I've tried to boot. I couldn't get suse to install. Or slackware, or debian, or fedora. Ubuntu just worked. And not only that, it detected ALL my hardware. I'm not saying Ubuntu will work for everybody, but I don't want it getting a completely bad rep. It's the best "easy to use" distro I've used.
  • Create New...