DAZZLE'S UPGRADE PACK

If you haven't already done so, upgrade your game by downloading Dazzle's all-in-one upgrade pack. It comes with everything you need for today's servers. Does your blue bar freeze when joining servers? Do you lag in games? Do you get an annoying siren in Phobik's Servers? This is what you need. CLICK HERE TO DOWNLOAD.

LEARNING CODE - expert help appreciated

Request help or offer help.

Moderator: Moderator

Post Reply
Tankster
Veteran Member
Veteran Member
Posts: 115
Joined: Fri Dec 29, 2006 11:49 pm

LEARNING CODE - expert help appreciated

Post by Tankster »

Hey all,

I'm trying to learn more about computers, so I figured I need to start out by understanding code language.

Everywhere I go tells me to learn Python first, so that's what I will make an attempt at doing unless I hear otherwise.

Can anybody give me any tips or directions on code? If somebody could walk me through it, I'd appreciate it

Thanks
User avatar
SmEaGoL
Veteran Light
Veteran Light
Posts: 535
Joined: Wed Dec 27, 2006 11:35 pm
Location: The Misty Mountains of Middle Earth
Contact:

Re: LEARNING CODE - expert help appreciated

Post by SmEaGoL »

First off, good idea :P

What type of computer programming are you intending to do? As you may know, there are many different approaches to programming: (HTML used for websites and the like/Torque Script used for gaming). It basically depends on you. Many of them become similar with "IF Statements", "Function Calls", and so on. If you learn one, it will be easier to learn a second- just like world languages.

-I started out with Visual Basic 6.0 - a fairly easy "intro" to scripting and programming - intended for the beginning stages of programming. This was a class offered at my school so I siezed the opportunity.
-Second, I went into HTML - a must for website designers - no more FREEWEBS! lol (I still own 3 freewebs sites)
-Third, I took up Torque - it was VERY similar to Visual Basic so I did not have to learn hours and hours of new stuff
-Fourth, I went into Java - more in depth than any of the above, but definately worth it.

All I have to say is that if, whatever you go into, seems to hard, start with an easier programmer. Once again, it all depends on what you want to program. Never start it if you only intend to go half way - half knowledge will get you nowhere. The rest is history!

Scripting forever!
-Smeags
User avatar
Scyth
Veteran Member
Veteran Member
Posts: 884
Joined: Thu Dec 28, 2006 4:53 am
Location: Belgium
Contact:

Re: LEARNING CODE - expert help appreciated

Post by Scyth »

For webprogramming you should start with HTML: Super-easy, certainly when you compare it to PHP and Java or JavaScript which is next on the list :wink:

HTML : HyperText Markup Language
So a short summary for HTML:
HTML is the basic language for the web, it displays what you typed and that cannot be changed but by code. But HTML is omnipresent, just to place everything on the right spot you should use "borderless" tables.

One good example

Code: Select all

<table border="1">
<tr><td>This is your FIRST cell</td>
     <td>This is your SECOND cell</td>
</tr>
<tr><td>This is your THIRD cell</td>
      <td>This is your FOURTH cell</td>
</tr>
</table>
Would give you something like this:
____________________________________________
| This is your FIRST cell | This is your SECOND cell |
____________________________________________
| This is your THIRD cell | This is your FOURTH cell |
____________________________________________

Meh, like this it looks poor but if you set the border to 0, you can do anything (almost :wink:)

A good HTML Tutorial

CSS : Cascading Style Sheets
Second CSS: CSS makes your HTML easier, basically you create sort of a "default" in CSS and then you can use this "default" in your HTML pages.

For example, lets continue with the table, if you want to have the table to have absolutely no border or no space in between cells you d have to make it like this.

Code: Select all

<table border="1" style="border: 0; padding: 0;" border="0" cellpadding="0">
<tr><td>This is your FIRST cell</td>
     <td>This is your SECOND cell</td>
</tr>
<tr><td>This is your THIRD cell</td>
      <td>This is your FOURTH cell</td>
</tr>
</table>
The underlined code is CSS, the rest HTML:
<table border="1" style="border: 0; padding: 0;" border="0" cellpadding="0">

That would make my poor example of a table like this:

This is your FIRST cell This is your SECOND cell
This is your THIRD cell This is your FOURTH cell

A CSS Tutorial

Now lets move on to "more advanced" script languages for the web, now we leave the basics and more on to more "dynamic" sites.

PHP : Hypertext Preprocessor
This is THE code to write sites, well not entirely because php is embed in HTML (that is why you should do HTML first). This basically means that your PHP script is within your HTML page. Like this

Code: Select all

<html>
All the usual jizz-jazz that goes into the top
<body>
<?php here is your PHP-script ?>
</body>

<html>
You don't need to learn a lot of PHP to do some pretty handy stuff for your webpage. 2 examples:

Copyright Statement
Copyright © 2001 - 2008. All rights reserved.
How to do this in php is easy You plant the following line of code into your HTML, at the position you want it to show up..

Code: Select all

Copyright © 2007 - <?php echo date("Y", mktime()); ?>. All rights reserved.
And there ya have it, no stupid updating :)

Include function
This is even more useful then the previous one, it allows you to upload and display a file from somewhere else on the server. For example you have a banner, every site has one, and a menu at the top. So you create a file named header.html or header.php or whatever (almost :wink:).

Then inside your main page (index.php) you place this line of code:

Code: Select all

<?php include('AdditionalPages/header.html'); ?>
The AdditionalPages here is the folder "header.html" is in, it can be a whole filepath too..

Why use this? If you want to change something to your header, and you do not have one script loaded into all your pages then you re pretty stuck :). You would be bound to update e v e r y o n e o f y o u r p a g e s o n e b y o n e.

Enjoy!

An awesome, but huge, PHP Tutorial

JavaScript
Now we have finished HTML, CSS and PHP its time for JavaScript
(note: JavaScript has nothing to do with Java, the biggest resemblance is the Java in both names)
It basically allows you to do everything that PHP does not support? Because for all the rest you will use PHP :)

For example, place your mouse onto the button "reply" below. The button will change color eh? HTML? no - CSS? could be but it would have to be pure text.. - Javascript? Yep!

Code: Select all

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
If you place that in between the <head> tags (yes we re in HTML again!) and then where you want to place your changing image (menubutton for example)

You place this code:

Code: Select all

<a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('HomeButton','','Graphics/Header/Buttons/HomeB.jpg',1)"><img src="Graphics/Header/Buttons/Home.jpg" alt="Home Button" name="HomeButton" width="150" height="35" border="0"></a>
You would have the same effect as the "Reply" button here..

Here's a JavaScript Tutorial, but I didn't use this one. So I don't know wether its good or not..
----------

And then there s flash, I d like to give you some tips or examples.. But unfortunately Im not into Flash-programming (yet!)

If you really didn't have enough, which I cannot imagine but ok, learn java to make applets for your website!
Example of a Java applet

-----------
Something to finish with, you probably don't want to write all that code into Notepad.
UseAdobe Dreamweaver CS3, best for a web programmer! *coughtherearewaystoget-it4freetoocough*

That s just my 2 cents... I know that you probably didn't want to read all about web programming in specific, but its the branch of the future where more will be going through all kinds of networks.
Talk sense to a fool and he calls you foolish
*Stiffler

Re: LEARNING CODE - expert help appreciated

Post by *Stiffler »

i know this is a huge bump. didnt feel like making a new topic

i know almost all of the above except java but i know ther is a link some where on here about torgue script or C+ if any of yall know where to find it please post it

x's
User avatar
Dazzle
Evil Site Admin
Evil Site Admin
Posts: 1320
Joined: Fri Dec 29, 2006 6:59 am
Location: London, England
Contact:

Re: LEARNING CODE - expert help appreciated

Post by Dazzle »

:above: course you do :lol: :lol: :lol: :lol: :lol:
*Stiffler

Re: LEARNING CODE - expert help appreciated

Post by *Stiffler »

:above: grrrrr :above:
*Stiffler

Re: LEARNING CODE - expert help appreciated

Post by *Stiffler »

nvm i found it on your site daz :monkey:
Post Reply