678 Forum Posts by "Cryzabey"
A PHP Bar Graph Function
I have recently created my first, decent in size, PHP script. As it is one of my first creations, I was hoping that one or two users could offer some opinions/critique my coding so that I can attempt to strengthen my weaknesses. Basically, I'm looking for people to point out my mistakes.
Things to keep in mind:
- This script uses style elements to allow for easier portability. Also, style elements were chosen over html/xml equivalents due to the general preference people seem to have for it.
- I had a bit of trouble managing the parameters of functions and the scope of some variables, so I'm not entirely sure if I used anything even resembling the suggested method(s).
Things that I would especially appreciate:
- Pointing out outdated or wasteful areas along with a generally accepted substitute.
- Organizational tips to make code more readable.
- Anything that makes you cringe or ask "Why?"
- Bugs/fixes [:
Resources:
PasteBin
Live Version
Wow, guys. I'll try to respond with my opinions on your book suggestions as soon as I can, but with the number of books being suggested, it may take me a while to make my way through them. I've set a pace for myself of roughly forty pages a day. I figure much more than that, and I won't take in or remember as much information. (I take notes on and practice the material in those forty pages.)
@DrearonElensar.
Thank you for the book suggestion; however, your book suggestion does raise a couple of questions. At the risk of sounding ignorant:
- How widely used is C?
- Has C++ or any other languages impeded the usage of it?
- And what applications is it typically used for?
@Xenolithic.
Haha, thank you. Unfortunately, as much as I appreciate your praise, I don't see myself as being worthy. For example, the majority of the contributors in the Programming Forum produce high quality posts that rival and usually surpass mine. Also, I'm afraid closer inspection of my grammar usage would unveil a number of unruly holes ;)
But I digress. Thank you for your book suggestion. The passion with which you described it has guaranteed its place in my Amazon shopping cart. I can't wait until it arrives so I can witness first hand the awesomeness it supposedly secretes.
@Never-One
Thank you. Everyone loves a Free good reference ;)
@Pinoyguy75
Thank you for the book suggestion, as well as the timeless gift of wisdom. I wholeheartedly intend to develop my programming knowledge and skills for quiet some time to come. Entering college fairly soon, I plan to pursue courses that will lead to an eventual degree in something computer programming related.
As far as your book suggestion goes, I'll definitely look into it. The reasons for which you suggested it make a lot of sense, and it seems a great place to start for good foundation in not only one language, but many.
What. The. Hell.
So Tom gets an "EDIT" button, aye?
Thanks for the book suggestions. I've filled my Amazon shopping cart and am currently waiting for a box loaded with knowledge to be delivered at my doorstep. I'll continue checking back for any other suggestions you may have, thanks again.
Comments for individuals are expressed below.
@Wonderful
Timeless, so I've heard. Thanks for the book suggestion [:
@kiwi-kiwi
Ha.
@thoughtpolice
Thanks for the heads up on SICP. I've started on "How to Design Programs", like you suggested, with hopes that SICP will become slightly less daunting. Also, I hadn't even considered non-programming books until you mentioned them. I'll be sure to check up on the ones you suggested, as well as search for books that branch out on the other tangents of programming.
@zenyara.
Nearly 200 customer reviews and 4 1/2 stars on Amazon, not bad. Thanks for the book suggestion [:
Hello,
In an attempt to not squander another summer, I've decided to take on the challenge of learning a new programming language or two (or at least get my feet wet). I have a fairly decent knowledge of quiet a few languages and have already started with these books:
Learning Visual Basic .NET
- Jesse Liberty
C++ Programming
- Larry Ullman and Andreas Signer
PHP and MySQL For Dynamic Web Sites
- Larry Ullman
It would be greatly appreciated if you could put forth a book suggestion. If you intend to do so, please include the title of the book, the author(s), and the reason you're suggesting the book. Thanks [:
--
In an attempt to curb flaming:
I used NG's search to look for topics similar to this one; however, because the search cannot be used on specific forums, very few of the returned topics were related to what I was searching for.
Also, while google is generally a good source for finding pretty much anything, I would rather have a someone that can vouch for a book's quality and give reason for why it should be bought.
--
At 4/19/09 11:15 AM, Jon-86 wrote:At 4/19/09 11:11 AM, Cryzabey wrote: Any and all help is appreciated, especially workarounds ;)"as" is a reserved word! So you will have to call it something else!
http://dev.mysql.com/doc/refman/5.1/en/r eserved-words.html
Thanks for the help!
This Query:
$query = "UPDATE Length2 SET an='$an', as='$as', at='$at', by='$by', do='$do', go='$go', he='$he', if='$if', in='$in', is='$is', it='$it', me='$me', my='$my', no='$no', of='$of', on='$on', or='$or', so='$so', to='$to', tv='$tv', up='$up', us='$us', we='$we' WHERE id=0";
mysql_query($query) or die ('Error : ' . mysql_error());
Produces this error:
Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as='0', at='0', by='0', do='0', go='0', he='0', if='0', in='0',...
When I tinker with the query to try and correct the syntax I find that the error seems to go away when certain words are removed fro the update. Because of this, I believe that SQL has certain predefined 'things' (I can't think of a better word) that are being used in place of my table columns' names, causing the syntax error.
Could be wrong though :l
Any and all help is appreciated, especially workarounds ;)
At 4/18/09 07:30 PM, ElegantGremlin wrote: This might be your problem:
if([toast] === "a" || "i"){
should be:
if([toast] === "a" || [toast] === "i"){
Yupp. That does it.
Thanks for the help ;)
So the code I'm using looks like this:
(Some of the variables are defined on a previous frame)
ran2 = random(31) + 1;
ranName2 = "Letter" + ran2;
toast2 = toast + eval(ranName2);
if(eval(ranName2) == " "){
if([toast] === "a" || "i"){
trace(["_" + toast]);
_root["_" + toast] +=1;
}
_root.one_ +=1;
gotoAndPlay("end");
}
Unfortunately, the code between if([toast... ...} continues to execute even when the variable toast is not equal to a string with the value "a" or "i". I'm probably missing something obvious, anyone, help?
At 2/25/09 05:27 AM, Kirk-Cocaine wrote:At 2/24/09 08:21 PM, Glaiel-Gamer wrote: Should be a fun night i set the fan to suck and full powerYou really need a girlfriend.
Or at least a pretty wig for his fan.
Thanks for all the information guys [:
I'll look into the degrees you mentioned, attempt to get a co-op course, and do a little bit of my own stuff throughout the rest of high school. Unfortunately, my school's too small to offer any programming courses, so that part is a no go :P
After reading New Grounds' Forum Rules I stumbled upon this thread, not wanting to break forum rules I have spent the last two years slowly reading each individual post made in this thread in order to abide by this rule:
General Conduct
Lurk first, post second. Read the entirety of every thread you post in before you post.
Also. Page 743 with Kirk's first post deserves a reading for all of you that have neglected to do so. It's rather funny.
And... Hi :D
At 2/21/09 03:54 PM, Cinjection wrote: Try to do anything that would let you apply programming to projects (ie, develop a site for someone, participate in contests, ect). This will help a lot for getting a job later. Employers really care about your experiences.
I guess that makes sense. I'll probably just try to pick up a few new languages and refine the ones I already know through various projects that I can use. I guess experience is the only existing route that makes sense.
Most computer programmers have a degree in Computer Science or Software Engineering. I'm currently in CS at Waterloo, doing a Software Engineering option.
Are those degrees specific to a certain area of programming, or do they pretty much transfer over to anything that involves it? Does the college you go to greatly affect the knowledge you would gain from a degree with a similar title? and are most degrees take 2, 4, or more years to acquire?
Co-op
Sounds like the way to go about it.
Hello,
I'm currently a junior in high school, and I'm extremely interested in the programming field. Unfortunately, I have no idea how to go about acquiring the skills necessary for a job in programming, or even what companies look for in a candidate for a programming position.
Those of you that have gone to college for something like this, or are currently employed at a company as a programmer, could you perhaps shine some light on the following subjects?:
- Are there any pre-college things I can work on?
- What college courses are a must?
- How would you go about job seeking?
- And anything else that could help me with my intended career path.
I think it's worth noting that I'm no interested in programming simply because I'm a "gamer" that wants to create games because it would be "cool". I enjoy math, physics, and art; as well as the satisfaction that comes from creating something that others can use and enjoy.
Sincerely,
Danny B.
I was checking links that lead back to my website, and I found an extreme modification of a game I had released some while back. The game had been broken down, a couple of new features added, and loaded with Japanese characters (Although still carrying my intro & logo).
Link:
Link to the Japan Version
Link:
Link to Original Version
I'm not really mad about it, but I found it kind of weird. Thoughts? Comments?
So, the only thing you really change is the host name?
I'll fiddle around with it until I can get it to work,
I think I get the gist of it though.
Thanks [:
How would one go about connecting to a database that is not associated with their domain? I already have a cross-domain policy set up, but I have no idea as far as coding goes on how to connect/send queries to a database located on a different server.
Any help, references, or matches to light the path?
All would be greatly appreciated.
-Danny B.
At 9/23/08 04:58 PM, smulse wrote: http://www.google.com/search?q=php+detec t+browser
http://www.google.com/search?q=php+detec t+browser+safari
</common sense>
I checked w3schools and didn't find what I was looking for.
That, and I have a personal vendetta against Google.
Thanks though ;)
Is there a way to detect the browser being used with PHP?
If so, how? and what would the browser "Safari" return?
There's a button in my flash, that when pressed updates over 400 variables in a mysql database. If the window with flash in it is closed before the script echos that it is done, will that make it so not all of the variables are updated?
At 9/7/08 01:00 PM, hesselbom wrote: ...in order for you to get all rows printed, or whatever, you can use a while loop, like so:
$result = mysql_query("SELECT * FROM prg1_1");
while ($row = mysql_fetch_array($result))
{
echo $row[0];
}
Thank you.
Works like a charm.
At 9/7/08 10:34 AM, hesselbom wrote: "SELECT * FROM prg1_1"
Woops, that was a typo on my part. Because it was a failed attempt I had deleted the code, and when I went to retype it in my post I forgot to take out the "WHERE". I should have proofread my post, sorry.
That being said, the sql_query "SELECT * FROM prg1_1", when printed, only returns the first row of data. Leaving me in the same situation in which I started.
Issue: Retrieving, modifying, and Updating material on a Mysql Database in an efficient way.
I originally tried something like this:
$result = mysql_query("SELECT * FROM prg1_1 WHERE") or die('Error : ' . mysql_error());
$row = mysql_fetch_array($result);
but the array only contained data from the first entry.
Fail :(
So then I used this:
$result = mysql_query("SELECT occur FROM prg1_1 WHERE word='a'") or die('Error : ' . mysql_error());
$row = mysql_fetch_array($result);
$a = $row[0] + $a;
$result = mysql_query("SELECT occur FROM prg1_1 WHERE word='i'") or die('Error : ' . mysql_error());
$row = mysql_fetch_array($result);
$i = $row[0] + $i;
// Update the Database
if($action == "UPDATE") {
$query = "UPDATE prg1_1 SET occur = '$a' WHERE word='a'";
mysql_query($query) or die('Error : ' . mysql_error());
if($action == "UPDATE") {
$query = "UPDATE prg1_1 SET occur = '$i' WHERE word='i'";
mysql_query($query) or die('Error : ' . mysql_error());
}
And while it works, it would be a lot nicer if I didn't have to repeat it every time I wanted to update a word's occurrence. Especially because I'll eventually be doing over 1,000 at a time. If you have any ideas, suggestions, or resources on how I could "Condense" the coding, I would appreciate your input.
I've already hit up w3schools, and a few of my other favorite help sites. As well as the Google machine.
The Mullet:
Eh, even if you do look younger, I think you look a lot cleaner. If I was a chick, I'd be more apt to bang the new you rather than the old one. All you need is some black t-shirts, the ability to snap, and some coffee.
Treerung's Game:
It was... Ok. But what's up with the hitTest for the water drops being at the top of the handle rather than at the curved dome part of the umbrella? Overall, not an exciting game, but I personally reject almost any game that requires using my mouse. (Laptop Pad)
Epic Final Battles:
I was trying to think of Epic Final Battles in video games I've seen. Mainly in an attempt to find something that I could adopt, warp the hell out of, and add to my own game. The FSF final battle, an episode of DB, and some other obscure things come to mind, but nothing "Epic".
Do you recall any boss battles that left your mouth open from the shear intensity or "Epicness"?
At 8/18/08 11:49 PM, Alpharius120 wrote: I have yet to make a spam post, so I have to say you're probably mistaking me with someone to.
Forum spam, posting advertisements or useless posts on a forum
If you think about it, the post you JUST made can be considered spam. No one gains anything from a statement by you stating that you're not at fault. However, if you would have provided some kind of proof...
I miss debate club :(
Is it just me, or does it seem like the longer you're working on a project, the more cluttered it gets? I try my best to organize things, but eventually the shear size of everything becomes overwhelming. I put layers into folder based on what section of the game they pertain to, and folders in the image library to match.
What methods do you guys you to keep things organized?
=]
At 8/18/08 03:17 PM, J1mp wrote: Ok its worked now :)
Haha, amazing game.
I loved the art, but the gameplay got boring.
After a while I gave up on pooping and just started hacking birds down with my propellers.
Music:
- Dollyrots
- We The Kings
- Plain White T's
- Jack's Mannequin
- Zolof and The Rock and Roll Destroyers
I like girly stuff.
Although, "Blood Brothers" by Iron Maiden is fucking sweet.
I have a nice, working, version of my swf file on my desktop. All the audio plays perfectly and the animation is smooth.
But...
When I upload it anywhere at all, everything goes to hell. My start animation doesn't work, and ALL of my audio is gone.
Is this the result of some weird export setting, or what?
It's seriously starting to bug me :/
Favorite Old School Game
I was sorting threw some of my old game systems when I happened across Kirby. I booted it up and ended up playing it for about 8 straight hours. Are there any Old School games you guys still play, or at least think could stand their own against today's games?
At 8/14/08 06:58 PM, FloppyDiskClock wrote: Luis loves the cockcrew

