MattEvans 473 Veteran Poster Team Colleague Featured Poster

i've never looked at vbulletin but i imagine '1','2'; breaks the line too early.. try:

'1,2';

MattEvans 473 Veteran Poster Team Colleague Featured Poster

hmmm, not sure I understand that? you should be able to include a file from the document root directory, by preceding it with a slash, ie:

include ("/includes/header.php");

... maybe that will go to your "home" directory though...

EDIT: Well, on my server, / goes to the server root folder. So, you'll need to know the path from the server root folder to your document root (public_html) folder. You can find that using:

<?php echo getcwd() ?>

For me, that's /home/fusion/public_html/(+ the path to the folder where the echo getcwd script is running in).

So, to get a file from the "includes" folder in my document root in PHP, I'd use:

include ("/home/fusion/public_html/includes/header.php");

This will be different for your server, and it may even be based from a "C:\" drive if you're hosted on a Windows flavour...

There is an environment variable you can use to find the server's document root I think, don't know which one, but it's probably DOCUMENT_ROOT... =)

EDIT (2): You should use absolute hrefs if your header includes ok but the links are 'broken'. Or, write some complex logic ^_-

MattEvans 473 Veteran Poster Team Colleague Featured Poster

if you arange your folders like a tree, and have each page as the folder index... then you can just link relatively to the folder above*, like this: "../". if you don't arrange your files into a neat and logical tree, i'd advise that you do.

*above being towards the http:// in matt-syntax

MattEvans 473 Veteran Poster Team Colleague Featured Poster

mmm, the delimiter between a HTTP header and the HTTP response is two line returns (one empty line). you can put aload of stuff before a header, but not an empty line... lol.. PHP tries to handle this automatically (in true CGI you have to send a content-type/location/[some other headers work], otherwise the request fails, if you use echo before you set a header, PHP sends a text/html content-type.)

So, as said, put header() before you do anything that could produce output.

The Location header is a request-level redirect (meaning a page that sends the Location header is never shown); so if you actually want to show something on the page during the redirect, maybe the Redirect header is more appropriate.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

make sure the mail's Content-Type header is text/html:

i.e:

$headers = "Content-type:text/html";
mail($to, $subject, $message, $headers);

MattEvans 473 Veteran Poster Team Colleague Featured Poster

well. im guessing it doesn't save the image's because their locations are relative to somewhere else.. if you're using the File>Save As.. in Internet explorer, you have to choose "Web page,complete" rather than "Web page, HTML only". That will copy the images into a folder called {name_of_page}_files, and update all links to point into that folder.

But, I don't know what you mean by save as .doc? You can't just save HTML as a Word Document (well, you can, but it wont be a Word Document). You could then open the saved HTML file in Word, and save it as a DOC file I suppose. Give it a try.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

And here's an EG,

http://www.fusiongroups.net/testbed/test.html

<div>
VERY OPAQUE<br/>
<div style="position:absolute;width:400px;height:200px;background-image:url('bg1.gif');"><br/>This text is infront of (on) the screen-door
<br/><br/>
This is the tile used as the divs background-image:
<br/>
<img style="width:80px;height:80px;background-color:white;" src="bg1.gif"/>
</div>
This text is behind the screen-door!
</div>

It looks ok at high (large) resolutions, at smaller resolutions it's clear that the image is dotted... On my somewhat blurry high-res screen though, you couldn't tell the difference between that and a translucent PNG ^_-

MattEvans 473 Veteran Poster Team Colleague Featured Poster

:| javascript won't do it i'm afraid, i've never tried an opacity setting in CSS, but if it's not in the official "standard" for CSS (and possibly even if it is) IE probably doesn't implement it.

you could try with medium alpha PNG files? that way, your image files contain the translucency (alpha) information in the pallete (or in each pixel). they could work in modern versions of IE...

if that doesn't work for you (I've never actually tried PNG translucency in browsers), you could always try good old fashioned screendoor transparency? XD
by that method, transparency is just "removing" pixels, the more pixels you remove, the more transparent a picture is ^_-

EDIT: Just a quick follow-up, translucent PNG files DO work (in Opera atleast).. To make a DIV background color transparent, use a small translucent PNG as the (tiled) background image. =)

EDIT (2): And just to follow that up again, translucent PNG's do NOT work in IE (version 6 atleast), maybe they work in IE7, I don't know. It might end up an IE-only screendoor job ^_-

MattEvans 473 Veteran Poster Team Colleague Featured Poster

displaying a picture that a user "selects" by loading it into an image element using an absolute path to a file on the user's computer will only work in IE, and it will only work because IE is bad =P

to "get" the picture you can send the form to a PHP script, and it will be in the global $_FILES array, or you can use Perl, and strip the picture from the form-data by searching for Content-Delimiters (which are sent in the Form header). If none of that made any sense, I'd advise learning PHP (or better still, Perl =P).

PHP example:
http://www.phpfreaks.com/tutorials/36/0.php

MattEvans 473 Veteran Poster Team Colleague Featured Poster

well, a good browser should be able to either allow a user to increase font sizes, or override parts of a stylesheet (font-size/colors etc)...

a really good browser (like Opera) will handle all of the calculation for resizing things relatively, that is it can zoom in and out on content, while respecting positioning and relativity, whether or not you use tables.

I find tables are the best things for keeping things positioned relative to each other, and for making content-controlled layouts.

The "problem" with tables comes with screenreaders: screenreaders though, are horrible things. I've downloaded screenreaders to test them out, all i can say is i'm glad that I can see :|

In general, if content in your markup (HTML) reads logically: top-down, left-to-right by EN standards, then a good screenreader should be able to read the content in that order.. If your markup doesn't read logically from top down, and you move things around using absolute positioning or whatever, then a screenreader will find it more difficult, and a bad screenreader's attempts to read the page "as actually seen" sound like a garbled mess..

one note on accessability: it's not always right to put text in image alt tags :| especially if the image doesn't contribute to the page's informative content. If you have an image followed by a text description, putting the text description in the alt tag aswell, just means it will be read twice.

In general, the page's I make …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Direct child selectors are interesting:

div.parent>div.child{}

Will apply to all divs of class child within divs of class parent, BUT only if they are direct children.

However: table>tr>td , doesn't work, unless you use: table>tbody>tr>td ... REGARDLESS of whether or not you have a tbody tag in your markup.

Rude, no?

MattEvans 473 Veteran Poster Team Colleague Featured Poster


[a valid, functional javascript function in an event handler attribute]

IS NOT a JavaScript, it is only action taken once button pressed, which will triget this action. So as it is on its own that code will do nothing

heck, I write huge javascript functions dynamically (on CGI/XSLT pages); directly into onwhatever attributes.

and i've never had any problems.

well that's a lie.

generally lengthly event attributes in HTML should be avoided where possible for managability, but sometimes it's the most simple solution: <body onload="alert({$STATUS});"/> for example, works nicely in XSLT, and the other language I'm using at the moment.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

change the application to use the "tag" property instead; it's a general usage property, and its use shouldn't have any side effects.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

thats not a local variable; you are assigning index "i", of the inherited scope/routine scope/public scope array "preload" to reference a new Image object, which is automatically var'd and scoped by that assignment (infact, you'll find that Image isn't accessible by any scope; its scope sort of disapears, and it can only be accessed through the array)

If you were doing this:

for (var i = 0; i < array_name.length; i++) {
    [b]var[/b] thisImage = new Image();
    thisImage.src = array_name[i];
    preload[i] = thisImage;
}

then you'd need (or should use) the var.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

ha... the only thing i can think is:

for (var i = 0; i < array_name.length; i++[b];[/b]) {
    var preload[i] = new Image();
    preload[i].src = array_name[i];
}

but hey, i've never seen that last ; put in, and it shouldn't (doesn't need to) be put in really...

EDIT: Actually, this seems wrong/uneccessary:

[b]var[/b] preload[i] = new Image();

preload is already indirectly "var'd" when you make the array.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

try replacing:

array_name=[];
preload=[];

with:

array_name= new Array();
preload=new Array();

What is the error produced?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

So if you only fit parts of that profile are you only half as geeky?......or just on your way to being totally geeky.

I don't think geekyness is measurable, although it could be judged relatively, and I'm sure everyone has a bit of geek inside somewhere...

In a given geeky conversation between 2 people, defined as p1 and p2, and where t is the time since the beginning of that conversation, and [cg] is the geekyness of the conversation in question:

p2{sleepness} = [cg] * t * (p1{geekyness} - p2{geekness})

it can be seen thus, that when two people speak to each other, the less geeky may become lethargic, and possibly confused and irritated as a result. The more geeky will start to become excited, more awake, and end up dramatically demonstrating concepts using everyday objects such as cups and spoons. Should the conversation continue indefinately (which is unlikely as the less geeky will probably either fall asleep, or make an excuse and leave; or the more geeky will have somethine geeky to be getting on with), the more geeky, who we will notate henceforth as the geek++, will add to a new variable, public_geekyness, as shown in the equation below:

p1{public_geekyness} = [gncr] * (p1{geekyness} / p2{geekyness})

(where [gncr] is the ratio of geeky conversations divided by normal conversations, since time of first contact with a person, or group of people)

Hencewith, the more a geeky a person becomes, the less likely they are to HAVE geeky …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

15. never plan/design a new program, just start typing and see where it will take you.

Oh yeah, that's always fun, but it doesn't always pertain to future-proofing and/or manageablity... However, good imagination >= good planning

16. write programs in assembly language. higher-level languages are for wimps.

Without planning!? :eek:

MattEvans 473 Veteran Poster Team Colleague Featured Poster

should be the same if you use a correct path to the binary. some functions to access the binary will be different (won't work), but calling open $out," | *.exe" or exec(*.exe) should work the same...

I don't know whether system() works, but I imagine it does..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Yes, there is, you can do it all with server side scripting, or alternatively, make lots of files that represent every potential state that your tree can be in.

You could even do it with
Server Parsed XML, but you'd still need a way of maintaining state (possibly a session cookie, or a huge dynamic key that is generated by a server side script and affects the XML file returned by a page request at each click).

If you only want one area (node) of the tree to be expanded at a time, then I suppose it's easier, but it still requires a bit of href logic on your part when writing or generating the pages.

Why not show the tree expanded, and if Javascript is running on the computer, use it to collapse all of the unwanted nodes? That way, users who don't use JavaScript will have alot to read, and user's with JavaScript will only have a slight advantage.

I don't like using Javascript for anything that represents a "core" functionality.

EDIT: I should add, relying on client side XSL transformations is worse than relying on JavaScript! IF you are using XSL, look at the Xalan application (www.apache.org) if you want to generate pages one-time on your computer; or the PHP XSLT module if your pages might change frequently.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

i think the property you're looking for is 'checked'..

I don't know whether forms.elements.xxx will give you a named object handle in return...

if your input is set up: <input name="termsandconds" type="check"/>, you should be able to access it as bookingform.termsandconds.

EDIT: I imagine both methods work though (document.forms.bookingform.elements.termsandconds | bookingform.termsandconds)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

SQL for a single vote! :|

Use a single text file, or a text file for each color.

You could do that in PHP, Perl, ASP, etc. But definately: no way without some script sitting on your server.

Is this like, a school/college/university question? If so, they're certainly raising the bar O_O

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You could do it, but you'd need some Javascipt to create the expand/collapse buttons, and (probably) some XSL to convert the XML into HTML.

Non-JS alternatives would involve some messy backend stuff with query strings... (and heck, if you're using client-side XSL transformations, getting hold of the query string is like getting hold of the holy grail [but it is possible])

PHP doesn't have to be present in the end user's system, it's server-side. But like I said, it will be messy witout Javascript...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You should look into XML Stylesheet Language Transformations (XSLT for short).

http://www.w3.org/TR/xslt ...this is a good reference
http://www.w3schools.com/xsl/ ..and this is a good introduction

I would advise building the pages using an offline XSLT processor, as client side (browser) XSLT processors are at best; bad.

EDIT: Or, you could use the PHP XSLT module. IF it's installed on your server.

I make alot of pages using offline XSLT processors (Xalan + Xerces) to create static HTML pages - but they are command line tools, and you need to understand XSL to use them...

For learning, you can create XML files, link them to XSL stylesheets and test them in certain browsers (Internet Explorer and Firefox) bear in mind, that the browser is doing work that is conventionally regarded as a "server side job", and that has a number of implications, the biggest I guess is that some browsers (i.e. Opera) don't have XSLT processors, and search engines can't make head or tail of your pages.

If you need any help when you're using XSL (setup, nuances, etc) let me know, I've been using it for a while now; for pages that are too static to be considered dynamic and to dynamic to be considered static.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I study Computing with Games. At the moment my courses are:

-Computer Programming
-Multimedia Games Development
-Networking, Security and Computer Systems
-3D Animation

So, for the most part, I study actively/practically. I use the Internet to research anything I don't know... And most of my courses are totally coursework based, so I don't go into lessons much.

The only one I have a problem with is Networking Security and Computer systems, I should go into lab sessions to get on the equipment. But me and schedules aren't the best of friends. That course is also 90+% exam based I think... And I did pretty badly on the year 1 exam for the same/equivelent course.

Guess I should get a book and learn ^_-

MattEvans 473 Veteran Poster Team Colleague Featured Poster

TO EVEN CLARIFY THIS I WON'T SMOKE

good! you shouldn't, it's bad for you, extremely addictive, and costly.

smoking does keep me awake, alert and concentrated. and I should probably add to that; edgy, skittish, and addicted.

doing one work at a time is better than doing alll of them at once

damn right. but unfortunately not all bosses/managers would agree O_O

atleast the work you do once at a time is perfect

Ah, I love optimism ^_^

There's a similar quote in english.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

When you know your death is near the time is of course less....so how are you gonna do em all in such less time

smoke less and geek faster i guess?

15. Use the word "geek" as a verb

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well, I don't intend to write the full list, I'm going to list geeky things I've done (and am proud of), and as for the rest, I'm going to rely on community support.

1. Work for more than a week on a personal (unpaid) project, during all waking hours.
2. Gain a more than unhealthy addiction to coffee, and a vampiric aversion to daylight and human contact (ok, maybe I'm not so proud of that one)
3. Use Linux more than Windows
4. Use two computers at the same time
5. Expect everyone else to, naturally, know what you're talking about
6. Run a localhost webserver to save FTPing time
7. Write a programming language
8. And use it
9. Have more friends that are programming languages/concepts than people
10. Try to conform to W3C guidelines
11. If the wheel isn't rolling, reinvent it
12. Work as a programmer
13. Dream a computer program
14. Start a list of "Geeky things to do before you die"

And some 'geeky' things to do, until you die:

1. Learn something everyday.
2. Don't listen to anyone who thinks they know better than you
3. Listen to people who do know better than you
4. Don't expect everyone to be interested in everything you are
5. Help others; if you know what you're doing.
6. Don't spend too long thinking.
7. …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Is it true that spiders and bots don't like document-root or relative paths? I read it somewhere just now; and I don't know whether "don't like" means a spider will act as if there's nothing there and prompty leave; or feel somewhat offended, but compensate and carry on...

Do spiders go in circles? If all my pages have at least one "go back up one level" and lots of "go down some levels", are the bots clever enough to remember where they've been? If they're not... can I tell a spider to ignore just some links on a page?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I paid £40 (~ $80) for a far-from-perfect seat at Muse yesterday... Still, I bought it from a random at the train station at the very last minute... so, I can't complain :)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I listen to punk & metal, it helps me relax although that might sound strange...

hmm..Perhaps with bands like coldplay and muse or what are you reffering to?

i'm going to see muse tomorrow, if i can get a ticket from a tout at wembley =P
i also play in a punk/jazz-ish band www.myspace.com/thenowherenears.. we don't practise much though :rolleyes:

MattEvans 473 Veteran Poster Team Colleague Featured Poster

fasthosts are very bad,

at my job, we have quite alot of client sites hosted on fasthosts with windows. I find their installed PHP modules are lacking, advertised support for "precompiled CGI" isn't true (C CGI doesn't work).

worst of all, Perl scripts are executed on an unrelated server. That turns "local" files into "remote" files; in other words, you can't open a text file directly adjacent to a Perl script in your folder hierachy. Nor can you use your own modules.

i'd definately consider either upgrading to a Unix hosting package w/ fasthosts (+£10!!) or moving elsewhere. i could give you a tip for a good UK hosting company, but it could be considered advertising :P

but, do a whois search on my domain (in signature) and give my registrar's plans a look. =)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Music from video games: Final Fantasy, Vagrant Story, Brave Fencer Mushashi, RuneScape

Ah.. I forgot that =P I got badass remixes of some later FF tunes,

it's a pity it's easier, or sometimes only possible, to find MIDI versions of alot of good videogame music. Useful for remixes, not so good for general listening.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

What kind of music do "geeks" listen to, while performing their geeky duties?

As a half-geek, I prefer rolling trancey bass-like techno-esque outings by bands such as the Prodigy, and hella-hardcore pulse techno like Angerfist. However, I may be caught enjoying a bit of evokative ultra-cheese pop, by the likes of Apoptygma Berzerk and Echo Image. At times, I may listen to re-jigged techno-classical. And sometimes, hard-rock/metal; System of a Down, Stratovarius, maybe even Cradle-of-Filth.

As a favorite, it's gotta be techno-dash-trance, but, it's gotta be just right...

Cast your votes.

mattyd commented: cool +1
MattEvans 473 Veteran Poster Team Colleague Featured Poster

well, if you are submitting your page by "typing" (pasting) it into the box on the W3C site; it will probably complain bitterly about the php constructs. if you access your page on the internet, that php code should all become (X)HTML, and some of those errors will likely go away. you can test that by uploading the page, and validating via an URL rather than validating a block of mixed HTML/PHP.

javascript can cause markup errors, but only if its inline javascript that contains < or > characters. for the most part you're safer keeping javascript in an external .js file, but if you must have inline javascript, enclose it in comments, or a CDATA tag:

http://www.w3schools.com/xml/xml_cdata.asp

MattEvans 473 Veteran Poster Team Colleague Featured Poster

ahhh... just got Opera to work instead. it's much easier (but by no means "user friendly") with RPMs.. I had to satisfy some dependancies (stdc++5) but, at least i was informed what those dependancies were =P.

methinks that, for now atleast, Mozilla have lost this part of the "Linux n00b" market.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

well, i unpacked it twice, once to /home/matt/ and once to /usr/local/bin/ as an online walkthrough guide suggested i should put it there... i unpacked it twice, once using the GUI unpacker that comes with Mandrake and once using the command line. same thing happens both times, it looks ok, but running the firefox script in a terminal or from a menu shortcut gives me an "opening firefox" taskbar item with an hourglass, then it shortly disappears and nothing happens...

another online source suggested it might be a dependancy issue, but the instructions in that one don't seem to be bash commands, and i can't for the life of me see how to find out what the missing dependancies are :/

my linux pc is within those specification ranges, i don't know exactly but i think it's a (Celeron) P3 equivalent.

the version of linux that came with the distro works ok, but apparently it's a version that pre-dates the auto-update feature..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

hey all, I've never been in this forum before; but then I've only just got into using my Linux PC.

I'm using Mandrake with mostly KDE sessions, and I'm having a bit of trouble figuring out how to do something that seems simple... I have only got old(er) web browsers on here, so I figured I'd download Firefox version 2; downloaded, unzipped, now I have a load of files and I don't know what to do with them.

All the ones that "look" like applications don't do anything when I open them: I'll get a question "Do you really want to execute 'file:/home/matt/firefox/firefox-bin'?" and then nothing...

do I have to move them somewhere, or do something to get them to be applications? there doesn't even seem to be an "install" file..

firefox website isn't helpful, it has an "installing the application" section; but all it really says is "first, install the application" =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

there shouldn't be... if each class allowed x inner classes you've still got a potential of infinity levels deep.

it might make your addressing a bit long winded though o_O

weird question!

when classes with inner classes or anonymous classes are compiled they tend to occupy a single addressing level with a hash between the "parent" class and the "child" class. so an object of an inner classtype will be of type:

Package/ParentClass#InnerClass rather than type Package/ParentClass/InnerClass

in theory it should be possible to continue that naming convention indefinately, but in practice, the VM or compiler might not be expecting it.. try it out, let me know =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

well, do you want to know cgi/perl? or do you want a solution that uses neither cgi, nor perl? methinks, you'll find it easier to learn cgi (perl or php) than to find a solution that doesn't use the cgi (or another server side solution) in one way or another.

there are sites that let you "use" their mail sending facilities, but perhaps, they aren't reliable. (i don't know if that's true).

there's some prerequisites for sending mail from your own server, most importantly, that you're allowed to do so: if you're hosted on a reasonable unix/linux server, you'll probably be allowed. if you're hosted with a cheap uk company on an IIS/Windows server, you may find it more difficult.

I posted a thread somewhere (here: http://www.daniweb.com/techtalkforums/thread61310.html) in this forum with snippets from mail sending rotuines in perl and php... but you'll need to know a tiny bit of perl or php in order to use either of them, and the basics of cgi to get information from your form to the mail part.

you should probably research the CGI; there are better ways of using form data than throwing it at an inbox =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I use the following function (part of a larger lib) to get the window scroll offset: /// together with window.scroll() you can achieve the same effect...

that definately seems nicer =P

methinks on re-reading Nouvelle's post, maybe he/she wants to create another scrollbar around an object... you can do that with a DIV, and CSS:

div.scrollish{
   overflow:scroll;
}
---OR---
div.scrollish{
   overflow:auto;
}

be aware, putting certain things in scrolling/auto scrolling divs screws them right up: if you put a table with width 100% in a div with a scrollbar, it goes underneath the scrollbar.

i had a similar concept on my website for user uploaded images in blocks of nicely laid out text, instead of resizing the image arbitrariliy i put it as the background image of a div, inside a sized div with scroll set to auto. i changed it because divs don't vertical-align properly >_<

oh, one final thing, you can't have an un-sized div with scroll set to auto. it wouldn't make sense =P

EDIT: I do still use them: http://www.fusiongroupuk.com/fuse-data/index.xrm. The IT section is big enough to cause its container to scroll. does that look like the sorta thing you're after?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

how about a function that could, potentially, print 1...10 =P

(in Perl)
for(my($i) = 2; $i <= 11; $i++){
  print int(rand()*$i);
  print " ";
};

very silly.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

could also try using javascript to move focus through a vertical line of objects on a page. might be more graceful if movement is what's wanted.

a'la http://www.fusiongroupuk.com/sillyscrolling

well. maybe it didn't turn out so graceful. once it starts moving you'll probably have to close your browser window.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

well, it sounds like Nouvelle would rather manipulate focus than dynamically move the scrollbar, one could even set up a js timer routine to iterate between a vertical line of anchors, which would force movement of the scrollbar.

it would make a horrible clicking noise though... could also try using javascript to move focus through a vertical line of objects on a page. might be more graceful if movement is what's wanted.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

the way you're using them, they are synonymous.

arrays store indexed values, but they can also store values by associative keys. Objects can store values by associative keys also; so, when you write person[0] = la, you're creating a key (0) which you can then use to retrieve the Person-class objects from the generic Object named person. You can store values in objects using the more object-orientated "dot" syntax, without ever creating Object classes. Methinks thats bad practice though.

I think that the main difference between objects and arrays is that objects can contain inner functions.

Generally, you should use arrays to store indexed or keyed Objects or values, and you should probably avoid using the generic "Object" entirely. It reduces the strength of the code you're writing: you never really know what "Object" has inside it, or what it does.

EDIT:

I think that the main difference between objects and arrays is that objects can contain inner functions.

...apparently not true:

var test = new Array();
test.test = function(){document.write("werd")};
test["hello"] = 45;
document.write(test["hello"]);
test.test();

does exactly what it says on the tin.

well. you certainly can't prototype, class or extend the Array object.

Come to think of it, you probably can. JavaScript is a bit of a weird one.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

what do you mean by block? subroutine scope or method scope?

if you do one regex then another within a subroutine, you don't need to reset $1,$2,$3 etc, the next regex will overwrite the old values, if you want to preserve them, make a named copy of each one: my($match1) = $1; etc...

if you mean method scope, specifically the scope when you treat a regular expression's replace expression as an expression (i.e. s|(whatever)|do_funct($1)|eg); the "$1" isn't really needed after the method do_funct is called, because the value is passed into the method (and the format of that expression means $1 is likely to be replaced frequently), but even if it was needed afterwards, the do_funct() subroutine won't affect the value of $1 even if a regular expression is called within do_funct(). this is because the $1,$2,$3 variables are all "localized" to the subroutine that sets them. basically, perl automatically saves the value of global localized variables before exiting and leaving subroutines via subroutine calls. when those called subroutines return, the values are restored so that the calling subroutine can keep using them. it's a strange system! i've only ever had one use for making localized variables.

#!/usr/bin/perl
$in = "Hello, World...\n";
$in =~ s|(Hello)|get($1)|e;
print "after sub: ".$1."\n";
sub get{
  my($t) = @_[0];
  $t =~ m|(H)|;
  print "in sub: ".$1."\n";
}
 
[B]OUTPUT:[/B]
[I]in sub: H[/I]
[I]after sub: Hello[/I]

or, to better show the localization:

#!/usr/bin/perl
$in = "Hello, World...\n";
$in =~ s|(Hello).*(World)|get($1)|e;
print "after sub: …
MattEvans 473 Veteran Poster Team Colleague Featured Poster

you can use bookmarked anchor tags to position the user's view somewhere. combined with some absolute positioning over the part of your image you want in focus, and a bit of offset calculation (you'll see what I mean if you take the <br/> parts out of the <a> tags), you'll get something like the effect you described...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd[/URL]">
<html>
<head>
<title>Anchor Bouncing</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<img src="big_picture.gif" width="100%" height="1000px"/>
<a name="place1" style="position:absolute;left:100px;top:50px;" href="#place2"><br/><br/><br/><br/><br/>Place 1 is here</a>
<a name="place2" style="position:absolute;top:400px;left:50%;" href="#place3"><br/><br/><br/><br/><br/>Place 2 is here</a>
<a name="place3" style="position:absolute;left:50px;top:700px;" href="#place1"><br/><br/><br/><br/><br/>Place 3 is here</a>
</body>
</html>

i've uploaded it so you can see it working:

http://www.fusiongroupuk.com/anchorbouncing/index.html

try:

http://www.fusiongroupuk.com/anchorbouncing/index.html#place1
http://www.fusiongroupuk.com/anchorbouncing/index.html#place2
http://www.fusiongroupuk.com/anchorbouncing/index.html#place3

or click the anchors to bounce about =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

VB is good for learning, but don't get too caught up programming in it. I started programming at 11, and now I'm 20. It took me a long time (>2 years) to realise there was more out there than VB, and that I was using it for (mostly) the wrong things.

You will find though; if you can pick up one language, it's quite easy to move onto another. I'd suggest Java if you want something as simple as VB but with a better structure, and C++ if you want to learn loads. I never finished learning C++.

Delphi's a nice thing but the syntax is strange (similar to VB) when compared to other Object-Orientated languages.

What sort of things do you want to program?

MattEvans 473 Veteran Poster Team Colleague Featured Poster
procedure TfrmMain.btnCloseClick(Sender: TObject);
begin
self.Close;
end;
end.

or, if you prefer to be explicit:

procedure TfrmMain.btnCloseClick(Sender: TObject);
begin
frmMain.Close;
end;
end.
MattEvans 473 Veteran Poster Team Colleague Featured Poster

the reason you can't do that is because on most filesystems a running exe "locks" its file for write operations. if you were to directly overwrite parts of an application while it was running it would probably crash anyway.

you could recompile the application using a command line call and then close or exit the application, overwrite it, and then re-open or re-enter it.

a better solution would be to write your application in a way that it can be customized without needing to be recompiled.

some programming languages do allow scripted processes to be written into, but as far as I know; all of them are interpretted languages, so they don't compile to an exe atall.