Jump to content
xisto Community

miCRoSCoPiC^eaRthLinG

Members
  • Content Count

    2,482
  • Joined

  • Last visited

Everything posted by miCRoSCoPiC^eaRthLinG

  1. Yep - all C++ compilers are supposed to be backward compatible, i.e. be able to compile C code as well. That is a standardised rule.
  2. Shouldn't the values you're inserting into an array be enclosed to single/double quotes? For example, shouldn't this line... $string = array(<, >, ', "); be written like this ? $string = array("<", ">", "'", "\""); ... but I may be mistaken. However, keep in mind that strpos will return an INTEGER indicating the location of the first encountered "needle" in the "haystack". Dunno if an if{} statement can interpret a if(strpos()) correctly. What I know is that, when the search string isn't found, strpos() will return a boolean false. Maybe if you invert the code-logic, it'll work. Example.. if( strpos($name, $string) === false ){ // Do nothing }else {// error stuff} Note that a boolean comparison is done using THREE '=' signs as compared to other types of equivalence match, where TWO or '=' are used. Otherwise I see no problem with your logic. It should work out fine. On a side-note, why do you want PHP to validate the character's name? Think of it this way - if you use PHP, it'll involve an extra client >> server >> client data transmission cycle, before the user gets to know about the problems in the name. In comparison, if you use JavaScript for validation - the name is checked in situ.. i.e. right inside your browser and the page is never submitted to the server till the user has got it all right. From the point of efficiency, this is a far better approach as it uses your local CPU to perform these mundane tasks rather than putting some extra load on the server.
  3. Why do you want PHP here? If you have a decent knowledge of PHP you should consider using ActionScript, which has a syntax very similar to PHP / C++ and the likes. ActionScript will let you make queries to SQL DBs too.
  4. Don't agree with you here. While it's illegal to grow / smoke in India - the laws aren't enforced in the strictest sense. People go about smoking it (and it's derivatives - like the purified oil, i.e. Hashish) and aren't bothered by the law enforcement agencies as long as they aren't being a social nuisance and/or into heavy peddling. Here's something that you may find amusing... one of our Gods (Hinduism) - Shiva - is a pothead. All over our mythology - you find him sitting tight with his band of followers and blowing up chillum after chillum of hash (or charas - as it's known in India). Kids back home in their teens get plenty of exposure to such stuff - even I did. I was into regular smoking till the end of my college days. When I got into an active work life (after a stretch of 8years of pot/hash smoking).. I gave it up overnight. No hang-ups. No withdrawal-symptoms either. What I haven't been able to stop is smoking cigarettes. I've tried hard over past few years, made several attempts at stopping - but always broke my resolution and relapsed into the smoking spree and couple days/weeks later. In my view cigarettes are a far-worse addictive "drug" that marijuana will ever be. Lastly, its not marijuana itself that's harmful.. rather the main component, THC (delta 9 - TetraHydroCannabinol) is an actively used compound for alleviating pain in cancer patients. However, when you smoke pot - it's not just the THC that you inhale, but several other harmful chemicals - which do the actual damage. More often you find smokers combining pot and tobacco to make it burn smoother - which in turn makes it even worse. If I'm not mistaken, pot has a higher burning point that tobacco - and that makes tobacco release far more of the harmful chemicals that if you were smoking a plain cigarette. With more and more research into this topic, new facts are being revealed about the usefulness of marijuana - for example, it's been recently discovered that THC can actually cut down / inhibit the tumour growth by half in lung-cancer patients. Thus scientists are looking into alternative methods of delivering THC (vapourising) to the human body, minus the harmful toxins that you'd inhale through direct smoking. The whole socio-political norm of treating marijuana as an "illegal drug" was probably based on the fact that marijuana has always been held as the "gateway" to other hard drugs. Recent researches further dispel this myth. Teen marijuana smokers are no more susceptible to other drugs / alcohol abuse that non-smokers. Dunno when this battle will end - but if something is to be declared banned, it should be cigarettes are alcohol first - which, according to recent re-evaluations are considered far more harmful than even synthetic designer drugs like ecstasy.
  5. Dunno why it didn't work the last time - anyways, I re-enabled it. Please try and let me know.Cheers,m^e
  6. I so totally agree with Teem here. Personally, I'll always stick to Gmail coz of their lightweight service / interface. To me speed and ease-of-use has always been of primary essence. I never really got into using Yahoo coz of their bulky interface - and don't think even the lure of the so-called "unlimited space" can force me to reconsider my decision. I'd prefer the simplistic interface of Gmail anyday over the ad-laden juggernaut of Yahoo. Since I started using Gmail (well over past 2 years) - I've been saving loads and loads of emails, which I would otherwise have booted out long back. Even then I've barely reached 15-17% of the 2.08GB capacity. I don't really see the "unlimited space" being a major determinant factor in drawing new customers... at least not for the tech / number savvy ones. But then of course, there's a whole segment of net users who'd want to boast their "unlimited" accounts.... Maybe Yahoo will pull this off.. maybe not
  7. Ballmer's lost his Balls and gone off the rocker I'm following this closely to see what the outcome is. One of the speculations is that since MS struck up a deal with Novell sometime back, this is their way of scaring end-users away from other Linux distros and turning to the only "Linux" supported by MS, i.e. Novell's own SuSE. If you follow the logic, MS stands to gain some more revenue by the end of it. Silly ploys to lash-back at the falling market shares.Funny thing is whatever tantrums they throw up about those so-called patent infringements, they aren't willing to disclose further details about them, except those figures - coz they know that as soon as they let the world know about the nature of those infringements, there are billions of mad (read "dedicated to open-source") coders out there who'd come up with a workaround within a matter of minutes...Stupid MS
  8. Lol.. I'd written a review of this service LOOOOOOOOONG back on my blog.. The so called destructible emails are actually Graphical Images, which are rendered by GD and attached to the emails sent to someone. The actual email message still resides on the bigstring server. When the recipient reads the email, the link in the email calls the bigstring server and the email in image form is rendered on-the-fly. Thus if you Cancel out an email post-send, GD doesn't render the image anymore. All the recipient sees is a blank mail
  9. I came upon this on some random site quite sometime back.. It's really funny if you can figure out the spelling mistakes and what actually this dude tried to mean. Some of the connotation will be lost upon non-Indian readers as there are lots of allusions to Indian History. Nevertheless, this should make a pretty decent reading... Have fun ================================================================= Notice from Jeigh: Please place all material taken from another source within quote tags. Thank you and welcome to the boards, as you must be new to not know this already
  10. I played a hell lot of SlaveHack when it had just started... As far as I remember, SlaveHack utilised JavaScript based timers along with a timestamp stored in MySQL DB. The JS timer was displayed as a progress bar to the end-user. Right before the progress bar started animating, the current time would be written to the MySQL DB along with (I guess) the time taken to complete the ongoing operation. If the user interrupted it in between, all SH had to do was add the required time to the last registered timestamp and compare it with the current time. The difference would tell whether the user successfully completed the operation or aborted it. To store a timestamp in the DB, you can use the in-built MySQL function called NOW(). The field where you store the timestamp has to be declared as of type TIME or DATETIME. A typical timestamp will look like, 2007-05-08 8:30:21. To insert the current timestamp into a MySQL field, issue the following statement: INSERT INTO table ( time_field_name ) VALUES ( NOW() );Keep in mind that this inserts a SECOND based timestamp i.e. the time lapses can be calculated from days, hours ... lowest upto the level of seconds. However, if your game requires calculations at microsecond levels (or some other fraction of a second) - you'd prolly get down on your knees and mess around with the microtime() function of PHP. Cheers, m^e
  11. Yup - very much so. You can make a post like that and offer your services to other members. You should include a detailed list of your specialisations in order to increase your chances of getting a job. As for the credits exchange you've to negotiate with your prospective client directly. Cheers, m^e
  12. You had probably struck up a deal with a member with lots of credits who transferred part of his/her credits to you... You'll have to go about the same way I guess. Anyone here up to it ???
  13. The lane my house is situated is pretty densely packed with stray dogs. Ever since I shifted here (about an year back) I've been seeing batch after batch of puppies being born and growing up to nice big doggies... One nice thing about this place is that apart from us - all our neighbours keep providing food for them everyday. Rarely do they go unfed. Moreover, my girlfriend (who's an intense dog-lover) makes it a point to cook for them every single day. More often than not - these pups adopt our home at theirs and spend their entire growing-up stage in our courtyard at the front of the house. Once they're full-grown, of course they take off... I shoulnd't have to emphasise what fun it is to watch these playful little tykes every time I look out from my living room. Now there's this big furry dog (probably a mixed-breed i.e. a mongrel) gave birth to 5 ultra-cute multi-coloured pups about a month and a half back (2 pitch-black, 2 brown and 1 white) at this deserted house right across mine. Someone ran-off with 2 of them (a brown and a black) just a couple of weeks after their birth - but that's good considering they got a home rightaway. As for the remaining three - once they were big enough to venture out, instantly took to our courtyard as their home. They spent every single moment out here except for when someone gave them food (outiside on the road). Here are a couple of pics of them.. Whenever we were free, we'd let them into our house and watch them play. Quite naturally, both me and my girlfriend grew really attached to them. She'd even take time out and clean 'em up of those pesky ticks and give them a bath once in a while. Last evening we were on our way out... I was locking up the doors when I heard my girl's panic striken yell.. I ran out and found the white pup lying in our courtyard convulsing like crazy and frothing at her mouth.. We thought she was having some sort of a seizure and I ran out to ask for my neighbour's help in taking her down to a vet. They immediately realised what had happened and tried squeezing in raw eggs, milk, water and what not down her throat to try and make her throw up... unfortunately it was too late. When we'd spotted her she was at her last breath. She stopped moving / twitching altogether within a couple of minutes. Our neighbour seemed very agitated and walked out and started yelling. Soon almost everyone from the houses around had stepped out. We were still at dark as to what happened coz we don't speak much of Thai and couldn't figure out what exactly was up - but we guessed something had gone seriously wrong. Within minutes we found everyone else turning the whole lane upside down in search of the other pups. They were found soon... one below a car and one behind a bunch of flowerpots - dead... with glossy eyes and frothy mouths. :( And so were found two other fully grown-up dogs.. in similar condition. Some bloody motherf***ing son-of-a-***** had dumped poisoned food on the road (trust me when I say that I've got the choiciest expletives on mind right now - just that I can't post 'em all here). Must have been a very strong poison to kill so many in such a short time. There's this pregnant doggie, who'd eaten some of that food too and had just started dribbling. We all got hold of her, force-opened her mouth and poured like 10-12 raw eggs and milk into it. Once we let her go, she vomited all that out and I guess along with that, the poisoned food. She was pretty subdued and looked sick for a long while after that, but today she seems totally normal... being able to save her was the only consolation - but I wonder if her babies survived this ordeal. The general notion around is that someone's upto no good - i.e. there's going to be a robbery soon. Most likely the prospective thief wasn't being able to step into this lane because of so many dogs - so he left the poisoned food around. Saddest part was that all the pups fell victim to it. My home seems so bloody empty ever since.. I believe in karma... i.e. what goes around comes around. Whoever did this should survive a similar fate.. i.e. should live to see something like this happen to a near and dear one that bastard should rot forever in the deepest darkest dungeons of hell. What can I say.... I'm struck speechless at this tragedy..Just yesterday afternoon I was comtemplating on how beautiful these pups were gonna looks once they were all grown up... and now this !!!! Really really sad.... I miss those little ones SO MUCH !! Why did it have to be them ???
  14. Yup... what you're seeking should be fairly simple... simply keep a COUNTER field that'll keep track of how many of an item is owned by the user.. I'm demonstrate a simple example here.. say your inventory table looks like this. ----------------------- USERID - Integer ITEMID - Integer ITEMCOUNT - Integer PRIMARY KEYs - both USERID and ITEMID together ------------------------ When a user buys an item, simply get the item's ID and check if the user owns the item with the following SQL statement... $query = mysql_query("SELECT * FROM inventory_table WHERE USERID = 'users id' AND ITEMID = 'items id'");$result = mysql_num_rows($query); The returned result will be ZERO if the user doesn't own the item at all and will be '1' if the user has the item beforehand. Alternatively, you could check the ITEMCOUNT field itself... $query = mysql_query("SELECT ITEMCOUNT FROM inventory_table WHERE USERID = 'users id' AND ITEMID = 'items id'");$result = mysql_num_rows($query); The returned result will be ZERO if the user doesn't own the item at all and will be a non-negative number if the user has one or more of the item beforehand. Now you fork the code logic in 2 paths... Path A - You got ZERO as a result Issue an INSERT statement to create a new entry for this item... like... $query = mysql_query("INSERT INTO inventory_table ( USERID, ITEMID, ITEMCOUNT ) VALUES ( 'users id', 'items id', '1'); You should insert a 1 here for ITEMCOUNT, coz this is the first time the user is buying the item and post-purchase owns only one piece of it. Path B - You got a non-negative number or '1' as a result Instead of trying to manually figure out how many items the user has and adding a 1 to it, you should let mysql increment the field for faster operation... $query = mysql_query("UPDATE inventory_table SET ITEMCOUNT = ITEMCOUNT + 1 WHERE USERID = 'users id' AND ITEMID = 'items id'; In case you provide the user with the option of buying MORE THAN ONE of the same item at a time, increment the value by a suitable number instead of just '1'. Say a variable called $number_bought contains the number of items bought, your code should look like... $query = mysql_query("UPDATE inventory_table SET ITEMCOUNT = ITEMCOUNT + $number_bought WHERE USERID = 'users id' AND ITEMID = 'items id'; That should effectively deal with what you want to do... If you need further clarifications on any of the above points, write back.. Cheers, m^e
  15. You'd probably need to run a simple script as a cron job. That's the only possible way I know of. Correct me if I'm wrong - but MySQL doesn't have inbuilt time based triggers. The SQL statement that has to be run looks like: UPDATE table_name SET the_field_to_update = the_field_to_update + 1; This should update the required field for all of the records stored in the table in one go - producing exactly the effect you're looking for. However, the field needs to be numeric (INTEGER or DOUBLE) for this to work.
  16. WHOAAA - SO IT'S OUT !!!! Awesomeness.. thanks for informing dude.. I'm a die-hard fan of Gothic and have lost count the number of times I've played Gothic I & II. The worlds they create are so HUMONGOUS and so very detailed. In short, breathtaking. I've rarely come across a game that instills as strong a sense of nostalgia (read belonging to the old times) and adventure as the Gothic series. Time to get Gothic III I guess To encourage others (those who haven't played Gothic yet) to try this game out I'm gonna come back later and post some screen-shots of the earlier ones..
  17. I don't agree with the idea of running an AV-less system at all. While using Ghost to restore your system is an excellent and very effective approach, there cannot be any comparison to having a AV / Anti-Spyware installed - even if a free one. I'd say not having one these days is rather foolish. Keep in mind - you aren't infected by destructive viruses anymore. There's been a big paradigm shift in the modus operandi of viruses / worms etc. Rather than destroying the "host" they are designed to reap the benefits. You may have multiple copies of Ghosted images and / or other forms of backups handy, but think of it this way - a nice little malware gets into your system and starts mailing out all your personal info (login credentials, credit card info etc.) and you haven't got a clue about it. Why ? Coz you've been ignorant enough NOT to have an AV installed. There may not be any "best" or "perfect" AV as wutske pointed out, but there definitely are good free ones out there - and pretty non-resource-hungry ones at that. I don't see any good reason why you shouldn't have one installed on your system... ??? Any thoughts on this ? Cheers, m^e
  18. Ever heard of Gamma-Xene ?? It's a white powdery pesticide which is as effective against roaches as it can ever get. It should be available at most of the regular hardware stores. Dust it all over inside your cabinet. It works wonders Biggest advantage is that it isn't a liquid or aerosol - so you needn't worry about your box getting wet and short-circuiting. However, for a couple of days, you gotta be careful ... so that you don't digest any of that powdery stuff yourself. Keep the box away from your keyboard, as in place it below the table or a bit far off (as far as your keyboard + mouse wires permit). As long as it's not on the same plane (read table) as your kb + mouse you shouldn't have a reason to worry
  19. What exactly do you mean by forming PHP's OOP in the C++ way? AFAIK PHP's OOP strength is quite limited when compared to read world OOP coding.. Can you elaborate please?
  20. See one big advantage here is supposing you create a GAD containing all the phone entries for relatives close & far. It's not possible that you ALONE will have all their numbers on your cell. You may have some of them, your immediate family may have another set of numbers and your close relatives yet another set. If all of you participate in this and dump all the numbers into the GAD, it becomes your own personal directory accessible by all of you from anywhere.. Get the idea?I can't use WAP for some reason.. I've got a Nokia 6708 Smart-phone and somehow the WAP services provided by True (formerly Orange) here in Thailand refuses to work properly with it. So I can't vouch for the mobile part... but as for web and IM based accessibility I've tried out both and it works wonder Even if you forget your mobile at home.. and are sitting at a cafe - you can use either your browser or your IM to get any desired info. out of the GAD.
  21. Tried out all the techniques and only the full-url seems to work fine in all cases.. so full-url it is !! ;)Thanks to all of you... was a very interesting discussion.Cheers,m^e
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.