MattEvans 473 Veteran Poster Team Colleague Featured Poster

i don't have flash (on my favorite browser, out of choice), besides, using flash to replace simple animated gifs is mega-overkill, and flash doesn't work well atall with CSS (each 'movie' has to be hard-coded into individual pages)..

SVG looks promising if it's taken up by all relevant parties... it's not only pretty, static, scalable vector images; it can be manipulated with client-side script, it could feasibly be controlled on a very fine basis using a CSS -type technology; and it's an open, W3C, standard, unlike flash.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hahah...

or maybe onions?

Strangely enough;

[^o]*(.*?)n(.*?)i[^o]*ns.

is a regular expression (perl form) that matches the string:

"philosophy, cabbages, and regular expressions?"

edit: oops. I certainly do need an interprettor. throw another dot in there:

[^o]*(.*?)n(.*?)i[^o]*.ns.

otherwise the last 'not o' ([^o]) in the expression ends right before the last o in the input text, and the expression wants an n..

optimization! This [^o]*(.*?) could just be: [^o], and this (.*?)i could be [^i]*, giving:

[^o]*n[^i]*[^o]*.ns.

Yay for useless code!

MattEvans 473 Veteran Poster Team Colleague Featured Poster

philosophy, cabbages, and regular expressions?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

So is this thread still about myspace?

;)

Nope, now it's become a mix of quickly-whipped-up psuedocode; corrections to said psuedocode (which shows how much some of us, myself included, need a compiler/interprettor); and debate over assignments and comparators in different languages.

Well. This is the 'geeks'' lounge, so I suppose that's to be expected.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

As I said, they have to be of the same type

String java = "java";
String awesome = "awesome";

java.equals(awesome);

Following this, java would now equal "awesome", and awesome would still equal "awesome".

>_< boolean Object.equals( Object ) is a comparator, not an 'assigner'

as in:

String java = "java";
String awesome = "awesome";

if(java.equals(awesome))
{
  System.err.println("An unexpected error has occured!");
}
joshSCH commented: Thanks for that correction :) +9
MattEvans 473 Veteran Poster Team Colleague Featured Poster

yep, as in

java.equals(awesome)

in which java and awesome are of the same type, say string.

If they're both strings, you're either setting the String java to "awesome" or the String awesome to "java" at some point before making the comparison*.. which stunts the results of such a test somewhat, does it not? =P

*edit: or maybe anything else. silly assumptions in my head there... still... they'd have to be the same thing.. java can't equal awesome.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Wow. I did this again just now; a search for 'MattEvans'. My daniweb profile; is the number 1 result for the term.

http://www.google.com/search?q=mattevans&

So not just a reference to me, but a page with a picture of me is the first google result for my concatenated name; a pity it's such a bad picture - But hey! Google thinks that I am the no#1 MattEvans of all MattEvanses.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

group of questions 1:

1. There is no 'most powerful' language for anything... If you want high speed and compact, compiled code, you can write serverside programs in C; but if you want a bit more simplicity and a webpage-based language with lots of existing modules to help with oft-used web functionality, ASP or PHP might be a better option. A good midrange is Perl IMHO; it's not the best language (it's not fast to execute when you start to explore its OO capabilities), but it has a relatively easy to understand syntax, and it's very suited to certain forms of web development.
It's not neccessary to pick ONE language for everything. Different languages do different things better, and sites often have lots of different 'things' to manage.

2. Graphic design is an art, it can't be well-taught or quickly learned.. drawing things out by hand is good to save uneccessary work, looking at other peoples sites might help you somewhat. 'Putting stuff together' is generally done with HTML and CSS, which is quite a detailed concept in itself, but I'm going to assume that you know HTML and CSS, having used Dreamweaver before, although if you work only in 'Design' mode, you're sheltered from the majority of 'code'.

3. When you have your flash ready,search for the means to add it.. it's really simple, and quite easy to find info. If you have Flash MX, it can generate HTML pages with the neccessary embed code, …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

In java, "=" is used as comparison, while "==" is used to assign a value..

?? No, It's the opposite:

int n = 5; //assignment
if( n==5 ) //comparison.
{
  explode();
}

In MS Visual Basic.. I think there is only a '=' operator; and its functionality depends on usage context:

Dim n as Integer
n = 5;
If n = 5
 Call explode
End If
MattEvans 473 Veteran Poster Team Colleague Featured Poster

I'm fairly sure from most of what I've been reading recently on programming that the expression is calculated, then if it doesn't result in a 0, it's treated as a true statement. (In C, at least; you may be correct for other languages.)

If I am incorrect on this, please point me to the appropriate documentation so that I might learn more.

This is true.

#include<iostream>
using namespace std;
int main()
{
int n=0;
if(n=5){};
cout<<n<<"\n";
return 0;
}
its output is 5.

That doesn't disprove that the statement n=5 doesn't evaluate true; it is indeed an assignment, but it will evaluate to true:

this is better proof, of the statement by EnderX being correct.

#include<iostream>
using namespace std;
int main()
{
    int n=0;
    if(n=5){
    cout << "yes, n=5 is true" << endl;
    };
    cout<<n<<"\n";
    return 0;
}
MattEvans 473 Veteran Poster Team Colleague Featured Poster

How does one tell the difference between a function and variable then? That sounds like not a great feature.

One makes sure one doesn't use the same name for a variable and a function... the same principle is in other langauges, in Javascript you use something = function(); to call a function and set 'something' to the return, and something = function; to make 'something' a pointer/reference to that function... That works because functions are objects... But, parenthesis are mandatory for function calls.

Even in C++, you can't use a member variable name that's the same as a member method name; it would be difficult to disambiguate a pointer to a variable and a pointer to a function otherwise...

VB actually has non-mandatory parenthesis for function parameters in some circumstances.. It's not a great feature though admitadly.

Perhaps! time is an in-scope object with overloaded operators such that it always returns the result of the function time() +-/* rhs ...

Or perhaps... I forgot to add the parenthesis.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Unless time is a local variable which gets updated all the time I would expect that should be time()-t1 ...

er... >_>

In Cavascript++ the parenthesis for function parameters are not mandatory.

I'm suprised I missed that though. It's considered bad form among the few existing Cavascript++ programmers to leave them out. That sort of ambiguity lost Cavascript++ alot of support.. I think they renamed it to Palaverscript eventually.

<_<

MattEvans 473 Veteran Poster Team Colleague Featured Poster
try
{
  var t1 = time(); 
  while(!myspace.is_boring())
  {
    myspace.use();
  }
  assert ((time - t1) < NOT_LONG);
  bebo.wonder_what_the_what_that_is();
  while(girlfriend.using(facebook))
  {
    girlfriend.laugh_at();
  }
}
catch( Lameness l )
{
  while((8*2+1)!=(8+2*1))
  {
    something_more_productive.do();
    sleep(0);
  }
}
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Look at the full userAgent string. It's weird though; this is for Opera identifying as Internet Explorer. Internet Explorer 6.0 under Wine (Linux) says similar. I can't (be bothered to) go on 'real' MS Windows:

UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en)

The 'Mozilla/4.0' part is totally misleading again; the only clue is the MSIE 6.0 part... Which, when compared with the other userAgent strings; doesn't even appear in the same relative position in the string as 'Firefox' or 'Opera' does... Weird indeed.

Using browser detection for anything more than trivial isn't a good idea; partly because it's clearly diffiicult to get a version and browser application that are correct. Even something as obviously neccessarily standard as this; isn't well standardized (userAgent, appName, version give conflicting information, the userAgent string isn't in a standard order etc ).

Another reason why it's bad; is because some users give deliberately incorrect browser identification. For example, one of the websites I have to log onto frequently uses a check like: "is browser netscape X or ie Y? come in; else? sorry! your browser version is out-of-date." - Not so; my browser just isn't one of those two. So I ask it to pretend that it is (by sending a different userAgent string and appName) and in I go; often leaving that identification 'incorrect' for a while after.

Finally; browser version doesn't specifically (or manageably) indicate support or lack of support for any aspect of Javascript... I suppose …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Technically; .org is for non profit organisations; .com is for companies, and .info is a new one for just about anything informative.

In reality, it's up to you. I prefer .com; because if you type 'example' into some browser address bars; it turns it into http://www.example.com.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Indeed; but until it isn't; IE Version 6 is a big target platform, and I can't tell any client to upgrade their browser and expect to keep them. I wish I could! I'd get the whole world on Opera if I had the chance.

I'm sure this 'problem' will fix itself soon enough; but I imagine there'll still be die hard browsers (in context of users) and designers who stick with GIF until IE6 is long dead and buried.

I tend to follow this policy:

- PNG for background images; or images with no transparency that shouldn't be lossy compressed.
- GIF for anything that should have a transparent background; ( unless I know that it's only going to be on one color background and where that one color background is a part of a PNG; in which case, I'd use PNG with a fake background ), and in the rare case where I'd use an animation.
- JPG for anything else.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

PNG transparency doesn't work well for me in a webpage context on Microsoft Internet Explorer <= 6; PNG background transparent images have a grey background instead (notably; my connection does funny compression things to all images; but it only seems to negatively affect IE). If that issue was fixed; I would certainly use PNG instead; it's a superior format. However; I still need to make pages work correctly and look correct in MY Internet Explorer 6; so I bite the bullet, turn dithering to max, and stick with websafe-pallete GIF for now.

On the web these days; formats are only widely adopted by site developers if they are adopted by ALL relevant browser developers, and correctly...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm, I thought perhaps you might have wierd browser identification settings.. But apparently not; I tested that code in Firefox 2, and in Opera 9 ( which can pretend to be other browsers; and is pretending to be Mozilla today ). In both cases; Netscape 5 is given back, as per your example. I imagine that this is an attempt to indicate that Firefox and Netscape are compatible on some level...

The userAgent string is perhaps more useful; it's more difficult to use, because you have to parse it manually, or at least search for known indicators within it:

'Real' Firefox
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

Opera Faking Mozilla
Mozilla/5.0 (X11; Linux i686; U; en) Opera 9.02

Opera REALLY Faking Mozilla
Mozilla/5.0 (X11; Linux i686; U; en; rv:1.7.5) Gecko/20041110

(ignore my semicolons if you don't use 'em)
<html> <body>
<script type="text/javascript">
var u_agent=navigator.userAgent;
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
document.write("UserAgent: "+ u_agent);
document.write("<br>");
document.write("Browser: "+ browser);
document.write("<br>");
document.write("Version: "+ version);
</script>
</body> </html>
linux commented: Thanks for the browser help -- pythonusr +1
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well.. I don't think it's neccessarily a good thing when people sign up for help with one problem, get the help, and then never return.. and you can never know that's going to happen UNTIL a person never returns. It's not neccessarily a bad thing either; since other people may benefit from past threads; especially if good questions are asked.

Perhaps; the rep score for a person could be calculated dynamically based on the present rep score of all past givers of rep to that person.. erk maybe not.. cyclic dependancy error!

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I like the rep system, it's taken me since I signed up to get my relatively few points, but I'm proud of the total that only I can see..

I think 'new entrants' should get more rep or that rep given should be less dependant on the givers rep; why? That's personal really, most of my rep points are from helping individuals, but most of my rep score was given by 'megarep members' - either in conversation threads, or from people repping me while passing through technical discussion; which is less that someone that I've helped approves of the quality of help given, as it is someone that I likely haven't helped approving of something I've said. My point; some of my grey reps mean more to me than my green reps; yet they are never 'counted for anything' publicly.

Not a huge gripe; the forums I post in do seem to have quite a big turnover of question askers compared to question answerers; so perhaps this is less noticeable in forums with more consistent frequent poster bases.

WolfPack commented: My opinion exactly. +8
Nick Evan commented: Exactly what I was trying to say in broken English - Niek +2
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Here is some example code. The returns are the important bit:

<html>
<head>
<script>
function checkForm()
{
  var oTarget = document.getElementById('must_be_hello');
  if(oTarget.value=="hello")
  {
    //Returning true! the form will submit.
    return true;
  }
  else
  {
    alert("Sorry you cannot submit anything but hello");
    //Returning false. Not today thanks.
    return false;
  }
}
</script>
</head>
<body>
<form action="http://google.com" method="POST" onsubmit="return checkForm();">
<input type="text" id="must_be_hello" value="?"/>
<input type="submit" value="Submit?"/>
</form>
</body>
</html>

Notice this:

<form action="http://google.com" method="POST" [B]onsubmit="return checkForm();"[/B]>

Returning this function to the form onsubmit event will make the submit dependant on the return of the function. So, if the function returns false; the onsubmit is cancelled; if the function returns true; the onsubmit continues.

The checkForm function is a silly example; but remember the function(s) that you do use should return a 'true' if submission should continue; and a 'false' if it should be aborted; and importantly; remember that onsubmit is a form event, not a submit button event.

~s.o.s~ commented: Good explanation for a beginner. +20
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Are you sure you don't mean 'file' fields? input type="image" fields are just graphical submit buttons; input type="file" fields let a user pick a file on their filesystem to upload..

As for checking the file; you should be able to interogate the value of said file field, split it by slashes, and then split it by .:

<html>
<head>
<script type="text/javascript">
function getFileType(sValue)
{
  var aParts = sValue.split( "/" );
  var iParts = aParts.length;
  if( iParts >= 1 )
  {
    var sFile = aParts[ iParts - 1 ];
    var aFile = sFile.split( "." );
    if( aFile.length == 2 )
    {
      sName = aFile[0];
      sExt = aFile[1];
      alert("Filename is: "+sName+" extension is: "+sExt);
    }
    else
    {
      alert("Bad filespec; should have one dot between name and extension");
    }
  }
  else
  {
    alert("No file selected");
  }
}
</script>
</head>
<body>
<form>
<input type="file" id="file_input"/>
<span onclick="getFileType(document.getElementById('file_input').value);">GetFileType</span>
</form>
</body>
</html>

(this WONT validate a form; it will just show you how to get the file extension from a filespec in string format. post back if you have any problems integrating this with existing code...)

Tested on Firefox and Opera.

As for checking the size of the file; this certainly can't be done with JS. You have to write some server side code to handle the upload correctly. That is probably a better way to check the filetype aswell; by interogating the MIME type of an uploaded file rather than just assuming the extension indicates filetype.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Did you solve this yet? I would have to put it down to a bug in IE. I tested on IE6 and can confirm the same behaviour... it occurs only when the padding is expressed as a percentage.

I can't really suggest a fix if it is indeed a bug; the best you could do is either, do as you've done already, which is obviously not ideal, or use a padding in px rather than %, which also might not be ideal.

You might want to try expressing the padding in px for IE and in % for modern browsers:

/*Will apply on all CSS-enabled browsers*/
td{
  padding:[number]px;
  vertical-align:middle;
}
/*This rule will only work in browsers that understand the direct child selector; IE6 doesn't*/
html>body td{
   padding:2%;
}

Again, not ideal.

However; if you use code like this:

td{
  padding-left:2%;
  padding-right:2%;
  vertical-align:middle;
}

There's no problem; it works as you might expect.. So if it's possible to use a constant padding on the top and bottom, you could try that.

IE6 sucks.. are you testing in IE6 or 7?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Your question needs more clarification; development of what, and maintenance of what:

#include <iostream.h>

int main(void)
{
std::cout << "Hello, world!";
}

That code cost more (time) to develop than it will to maintain, and some 'real-life' trivial/one-function applications are the same. Others are not; things like web browsers/APIs/etc need to follow changing standards, but that should be seen less as maintenance than it is further development.

In an ideal world one released version of an application shouldn't need extensive maintenance - if maintenance means patching, covering holes, or fixing bugs; because good development should include a period of very, very detailed testing; and it should be based on well-considered plans.

The real world isn't an ideal world by any means; but program code is a complete infallible unit; it shouldn't break down like a lawnmower; because it isn't subject to mechanical stresses.

That is, perhaps an opinionated view; but it's the best reply I can give for such a general statement..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Wow. I remember thinking that rant, but I'm quite suprised that I actually posted it..

I suppose, in light of the dredging-up of this topic; I should give an update. I don't use LiveMail anymore, nor do I use only Windows for that matter, I generally use Linux more than Windows, but am occasionally forced to use Windows-only applications for extended periods.

I have my complaints about Linux, but they're mostly superficial, and much harder to direct at a specific body, In terms of my own preference, I prefer whichever OS I'm using at a given time, and miss the other one.

Thanks nse, for that somewhat random information paraphrased from a systems analysis textbook. I would imagine, that it would be more use to Microsoft than it would to me; I always stick with the flexible 'start in the middle and (optionally) finish at the end' methodology.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I'm not disputing the validity of the rest of your post; but:

- The div tag doesn't know how to use an onclick attribute, because a div box isn't a clickable object.

The onclick attribute can be given, correctly, on (almost) every visible element.
See http://www.w3schools.com/jsref/jsref_onclick.asp for a full list.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm.. when I use color with any rgb code (i.e. #ff0000) it becomes green; when I use a word (i.e. red) it works fine:

RED (COLOR="#ff0000")
RED (COLOR="red")

I get that same green with any RGB code.

I don't know whether this is only in preview.. I guess I'll have to post this to find out.

On the topic of "why colors?" - I like them; if only to draw attention to a few lines in a code block. If I review a long bit of code and make changes, I color the changed parts red and embolden them, it's sometimes easier to see than if I'd JUST emboldened.

I must say though; I tend to use the 'generic' code tag rather than the language specific tags for anything more than a trivial amount of text because I find the line numbers on the syntax colored blocks throw layout. I say that, because if I used a syntax coloring code block, I probably wouldn't highlight parts with a (different) color.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well, it's a 'well made' product; and I suppose it helps with project/site management aswell, so it's more than just a text editor. Basically, it's a text editor, a (nasty) live editing tool, an ftp client, a site manager, some wizards, a little collection of javascript examples, and assorted tools (like one to make regions on image maps).

But; personally I don't think it's worth the price tag. If I bought a copy for home use it would cost more than my PC did 2 years ago (it's a cheap PC), and all of the functionality it provides is available in the form of individual tools.

I guess, it's down to personal preference; do you prefer a consolidated tool and environment, or lots of separate tools?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

If you have access to PHP:

<?php 
header("Content-Type: text/javascript");
include "script1.js";
include "script2.js";
?>

Save as 'allscripts.php' and link as if it were a js file:

<script type="text/javascript" src="allscripts.php"><!--screwIE6--></script>

This might not be ideal in all situations...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Try and test on a 'real server'; or make sure that you always also access the page with the Javascript directly from 127.0.0.1. Providing that you do that; you should be able to omit the 127.0.0.1 from the Javascript code (which also removes the need to change the code when you do go live).

Xampp sets up a system whereby you can access any kind of page in a folder using a http url, so you should certainly be able to make a folder structure similar to the one I did.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I ftp'd your files up to a live host. There, I arranged the files like so:

www [folder]
|_ temp [folder]
     |_ index.html (your html page)
     |_ clienthint1.js ( the javascript )
     |_ minor.php ( a php file that just echos 'OK', suitable for a test )

I had to change one line of your Javascript:

var url="http://127.0.0.1/testminor/minor.php"
 .. changed to .. 
var url="minor.php"

This meets the conditions of Firefox not allowing XMLHTTP open to 3rd party hosts; I could equally have used a full URL; but I'd have had to ensure I used the exact same domain to access the page.

The result is here: http://fusiongroups.net/temp

It works for the version of Firefox I have on Windows (1.0.7); try on yours, let me know if it says 'OK' when you click the button... If it does, the XMLHTTP open is working, and this means that there may still be a problem in that the domain you're using to access the page differs from the domain referenced in the XMLHTTP open() URL.

If the page at that link doesn't work (i.e. no OK when clicking the image), I'll swap operating system and have a look on the latest Firefox for you.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Are you getting any specific errors in the firefox error console?

^ it would be helpful to list any errors you may, or may not, be recieving

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Are you getting any specific errors in the firefox error console? I believe FF will reject XMLHTTP connections to pages that aren't on the same domain that the script runs from; I imagine that's amplified by the fact you're trying to connect to 127.0.0.1... Easiest way to get around this is to use relative/server absolute URLS in XMLHTTP opens..

http://developer.mozilla.org/en/docs/AJAX:Getting_Started

As a security feature, you cannot call pages on 3rd-party domains. Be sure to use the exact domain name on all of your pages or you will get a 'permission denied' error when you call open(). A common pitfall is accessing your site by domain.tld, but attempting to call pages with www.domain.tld.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

First up, add a body tag around the body, and a html close tag after everything:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <title>AlienNet Public Access Gateway</title>
  <embed src="audio/thunder3.wav" autostart="true" loop="false" width="0" height="0"></embed>
  <link rel="icon" type="image/png" href="http://alienlinux.homelinux.net/images/alien.png">
  <link rel="stylesheet" href="mystyle.css">
</head>
[B]<body>[/B]
<ul class="banner">
test
</ul>

<ul class="navbar">
test
</ul>

<ul class="main">
test
</ul>
[B]</body>
</html>[/B]

Then change your CSS like this:

ul.banner {
  position: fixed;
  top: 0px;
  left: 0px;
  right: 0px;
  height: 78px;
  background-color: green;
  padding: 0px;
[B]  margin-top:0;[/B]
}

ul.navbar {
  position: fixed;
  top: 78px;
  left: 0px;
  width: 180px;
  height: 100%;
  bottom: 0px;
  background-color: red;
  padding: 0px;
[B]  margin-top:0;[/B]
}

ul.main {
  position: fixed;
  top: 78px;
  left: 180px;
  right: 0px;
  width:100%;
  height: 100%;
  bottom: 0px;
  background-color: yellow;
  padding: 0px;
[B]  margin-top:0;[/B]
}
[B]body
{
  margin-top:0;
  padding-top:0;
}[/B]

It gets rid of the white top border for me on Opera9 and Firefox2. The whole layout doesn't work on Internet Explorer 6; you might want to check that out.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

This is possibly not the ideal place to post this; but I'm hoping someone with a good idea of 3D math can help me a bit.

I'm planning something for a project, and am trying to find out how to implement some of the more neccessary parts. One of these parts is obviously, collision and collision response; and I'm at 3D elastic collisions right now.

Based on the code and walkthrough on this site, http://www.geocities.com/vobarian/2dcollisions/ I got a 2D test working, all is good, and I certainly prefer this method to text I've seen using lots of trigonometry.

I'm assuming this same method can be applied in three dimensions, and it seems to work; but I'm having a problem calculating one of the neccessary values; I need to find ONE of the points (vectors) that lies on a tangent plane between two objects. Without this, I can't calculate the unnafected part of velocit(ies), and energy drains from the system rapidly; with an incorrect value, the system gets unstable and fluctuates from loads of energy to little energy... This isn't elastic, and isn't good. That guide uses 2 dimensions, and in two dimensions:

N = [Nx, Ny]
T = [-Ny,Nx]

Where N is the normal, and T is one of the tangents. This is the only part in the guide that can't be translated directly into 3D.. And it certainly has a massive effect on the values that are calculated..

I'm thinking …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The latest dreamweaver is quite good, but don't rely on the 'live-edit' features; if you don't know HTML they wont help you learn, and if you do know HTML you'll find them to be a hinderance.

As long as all you want is a syntax coloring text editor with a bit of code insight (i.e. it can list the attributes for tags and help with values like colors, fonts ) dreamweaver is a good tool.

I certainly wouldn't buy it for full price though..

For working with ASP/ASP.NET you'll probably want Visual Studio/Visual Studio.NET respectively, although neither are essential and you can write ASP certainly in any text editor. Same goes with PHP.

If all you want is a multisyntax coloring text editor, look at:

EditPlus: http://www.editplus.com/
Komodo: http://www.activestate.com/products/komodo_ide/

Both for Windows; Komodo is probably the better of the two as it provides script debugging for a number of languages.. You gotta pay for both, but nowhere close to as much as you'd have to pay for Dreamweaver or VS.NET..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I like Wikipedia; so much infact, that when searching for information in Google, I've got into the habit of prefixing 'wiki' in front of whatever term I'm looking for, because I'm pretty sure wikipedia will have an enlightening/well-written/interpretable entry; perhaps a basic entry, but that's sometimes the best place to start.

Anyway; just today I've noticed, perhaps I didn't need to type 'wiki mushroom' to be assured of a wikipedia page about mushrooms being high up in the ranking. Based on a random check, of what I deemed to be 32 completely unrelated terms across a number of 'fields of interest' 88% of those had a wikipedia entry on the first page, of those, 70% had the wikipedia link as the first entry. Here's my raw data:

These had a wiki page as the first link

deterministic
horse
cabbage
spider
dns
http
soul
dot product
quaternion
cigarette
television
window
chair
coffee
permanent marker
religion
smoothie
lamp
ceiling
internet

These had a wiki page as the second link

beer
truth
duvet

These had a wiki page somewhere relatively high on the first page

sanity
overture (knocked down because it seems to be a yahoo trademark)
forward
nutella
mirror

These didn't seem to have a link on the first page

math
google (worth a try =P)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Perl is a good language for isolating and extracting data from formatted text (i.e. (X)HTML). Some parts of Perl are like C++, most of it isn't; but it's easy to grasp.

XSLT can be used to extract and present data from well-formed XML (i.e. XHTML), but it is very 'strict' with regard to input, and somewhat constrained with regard to output.

Sieving data, as you put it, isn't really webdesign; but both of those languages can be used to generate pages and manage websites aswell.. It depends to a great extent on what you're trying to do overall.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Post some code, and the error message you're experiencing. It's a bit difficult to understand what you're doing/where the problem might be. The result of the XSLT transform and the relevant javascript is the part I'd consider to be important to look at, given that you say the problem is with the javascript.

it's not normal to use special characters (i.e. @) in 'names' of elements or 'ids'. I don't know if it's 'forbidden' by spec; but it would make certain things (i.e. CSS and javascript document/etc collections) act wierd, perhaps. If that's what you mean; why do you have, or need, to have @ in the name of an element?

If you do actually NEED one in a name or id, use it as an id on the element.

<input id="field@code1"/>

and use the document.getElementById() method with the ID as parameter, as apposed to using document.forms[X].name, or whatever other collecion-based method you may be using.

var myField = document.getElementById("field@code1");

Code like this though, will certainly not work:

var myField = document.myform.field@code1;

Again, try and get the '@' out of the field id/name. A little investigation into permitted values in W3C XHTML for attribute of type 'id' says the pattern should be:

[A-Za-z][A-Za-z0-9:_.-]*
//That is, one upper/lowercase alphabetic character followed by any number of alphanumeric characters, and/or (:_.-) characters

See:
http://www.w3.org/TR/xhtml1/#C_8
http://www.w3.org/TR/html4/types.html#h-6.2

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I honestly can't say why; but I find that overflow:scroll/auto only works reliably on fixed size div elements. It works ok on 'bounded' size divs (with max and min height) in Firefox 2 and Opera 9, but not in Internet Explorer 6.

Change your HTML so that the cell with the scrollable list has a div between the cell and the data, and apply the size and overflow CSS settings to the div rather than the table cell:

<td id="content-containertable" class="override">
<div>
[lots of lines]...<br/>...
</div>
</td>
#content-containertable.override{
  width:150px;
  border-color:Silver;
  border-style:Double;
  background-color:Lime; 
}
#content-containertable.override div{
  height:200px;
  overflow:scroll;
}

Try with a fixed-height div first, especially if you might be targetting IE6 users. Also, try overflow:auto instead of overflow: scroll; it's nicer because the scrollbars only appear when neccessary.

As said, I honestly have no firm evidence that it categorically doesn't work on table cells; indeed, overflow:hidden seems to work on fixed width table cells to hide superflous content. However, oveflow:scroll has never worked for me on table cells, even when the height of the table cell is fixed.

Maybe it works on other elements aswell as divs, but I haven't experimented that much.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Another thing, if you do type one solid line of characters, like in the example screenshot you posted; the cell HAS to expand to include the text..

You can avoid this, in a somewhat hacky way, but only in the following browsers (tested) Opera 9, Firefox 2. It does not work in Internet Explorer 6 ( and thus not frontpage versions that use IE6's rendering component for preview ):

<td colspan="2" valign="middle" align="center">
<div style="width:inherit;overflow:hidden;">
[long_line_of_non_breaking_characters]
</div>
</td>

This will essentially, chop off any characters that continue in a line that exceeds the current ( i.e. 100% of page ) width of the table.

Considering; most text has some breaking characters (i.e. spaces) this isn't normally a problem... O_o

Make the changes in my last post first; they are more important..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The posted code goes a fair deal of the way to solving the problem. Try it out, the important changes are removing conflicting width/height attributes. For example (this isnt from your code, but it serves to demonstrate):

<table width="100%">
<tr>
<td width="200px">&nbsp;</td>
<td width="400px">&nbsp;</td>
</tr>
</table>

This configuration, although not strictly an error, doesn't make sense unless the sceen is exactly 600 pixels wide. Assuming only the 200px setting is necessary (for a fixed width column), the 400px setting is either redundant (if the screen is 600pixels wide), or it conflicts with the implied table total width ( all rows must fill this width ) being 100% of the screen..

Removing all such conflicts from your code will prevent the bottom cell from eating width from the sidebar on the left; in frontpage livepreview though; you will still be able to see the width of the whole table fluctauate very, very slightly as text is entered (this is more visible when the cell is aligned to the center, strangely enough). Personally, I would put this down to frontpage's HTML editing controls rather than anything else, and in any case, the difference between the table width for two different pieces of text, even in frontpage, is so minimal, it's only noticeable when viewed as a change.

Ok, I'm posting code modified with correct col/rowspans and removal of conflicting width/height values. Beyond what I've mentioned, I'd advise using a modern document type definition, and then using CSS width/height/valign/font attributes …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm. I still can't see the problem you describe... there is another span discrepancy by the way:

<td width="103" height="314" valign="top" rowspan="[B]3[/B]">

should be

<td width="103" height="314" valign="top" rowspan="[B]2[/B]">

As for the expansion of the cell; for me it only expands vertically (upwards), which would be normal considering the content of the cell changes. What do you want it to do? it should be possible to force it not to expand upwards (stay at a fixed height) if that's what you want; but is it?

If you use &nbsps; they can have weird effects, in that they can prevent a line breaking, meaning it HAS to break layout; but only if they are interspersed heavily in a bit of text (i.e. only if every space in that text is replaced with an nbsp entity).

Quick question; is the problem related to the cell expanding outwards (i.e. making the table expand larger than the width of the page ), or is it expanding into the table (i.e. eating a proportion of the navigation bar to the left) ?

Otherwise, can you post a screenshot to this thread highlighting what the problem is?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

That last cell ( the one with the &nbsp; ) should be colspan = 2, otherwise you'll have a mismatch in your columns per row...

It doesn't need a width either; it will inherit the 'correct' width automatically...

I can't really see the problem you described, but changing that cell's attributes to:

<td colspan="2" height="1" valign="middle" align="center">

Does at least make the page look the same on the browsers I test with (Opera 9, Firefox 2, IE6)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Considering that you're asking someone to fix and/or refine your site's entire design, I would advise that you hire another webdesigner..

http://www.daniweb.com/techtalkforums/forum59.html

It would not be easy to diagnose the problems in the CSS, without say, consultation, and access to your site's content management system. I would suggest that the HTML would be a better place to start than the CSS; based on a view source of the link you posted: the HTML is messy, doesn't conform to the standard of its declared document type, and defines things that would override any CSS.**

Time = money, and I don't think anyone will take this on as a favour.

** EDIT: Well, I just noticed based on your post that the link isn't your site. STILL what I said isn't innacurate, and it's even more difficult to diagnose CSS problems with no HTML reference..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You can create a new window using the window.open() funtion. This will help http://www.w3schools.com/htmldom/met_win_open.asp

Using spawned windows as popup menus is a naff approach. Alot of 'modern' browsers block out popups, or put them behind the active window. Also, you'd have to be careful to avoid multiple window.opens every time the user moves the mouse...

You can make popup menus without any Javascript (using CSS)... but they only work well in those 'modern' browsers already mentioned.

If using Javascript, look at moving and hiding/showing some 'menu HTML', or if appropriate, creating such a menu dynamically..

The code I'm posting is gratuitously commented, and has been tested on Opera 9, Firefox 2, and IE6. It will let you assign different menus to multiple objects; but the menus don't disapear very cleanly... You can hack the Javascript around to do things like, alter the position of the popup relatively, so it appears 'from' the parent element rather than over it; or even at the position of the mouse exactly. You also might want to make the popups disapear automatically when the user mouses out of the vicinity of the popup... I'll leave that to you to research:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Simple PopupMenu</title>

<style type="text/css">
/*Important style definition is 'position:absolute'. Means the element can
be placed at an arbitrary position without affecting the flow of surrounding
elements*/
.popup
{
	position:absolute;
	border:solid 1px black;
	background-color:white;
	padding:4px;
}
</style>

<script …
MattEvans 473 Veteran Poster Team Colleague Featured Poster

- you could use iframes (inline frames) but i wouldn't suggest it, this situation pertains better to frames if its a choice between the two;

- you can get a certain amount of 'global control' using sitewide stylesheets, but often not enough;

- beyond that, using some PHP, Perl, ASP, JSP, XSLT, etc at the server to glue parts of pages together works, with a fair degree of control;

- avoid using client-side Javascript or XSLT to do this, it doesn't make good sense;

- alternatively, if you don't have a need or desire for pages to be created everytime they are accessed, use any kind of programming / transformation language or other technology to prepare your pages from mutliple sources offline.

tgreer commented: Good answer. +7
MattEvans 473 Veteran Poster Team Colleague Featured Poster

if your CSS files are ALWAYS in the folder that maps to http://yourdomain.tld/css_directory/, you can use an absolute link as follows:

<link rel="stylesheet" href="/css_directory/style.css" />

This is useful if your linking files are in folders nested to levels deeper than 1 from the document root.. note, it can make 'moving things around' easier or more difficult, depending on what you're trying to do..

absolute links can certainly make it more difficult to preview pages that you're working on offline, unless you go REALLY absolute:

<link rel="stylesheet" href="http://yourdomain.tld/css_directory/style.css" />

or run Apache offline, or always work at root or in some kind of dynamically rooted environment, or use a site-aware url rewriting preview tool; like that in Dreamweaver...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

innerHTML, innerText, and outerHTML don't work.

innerHTML certainly works. Providing that you have a valid reference to the <style> element that you want to extract; innerHTML will return the 'body' of the style; that is, any rules in the style, exactly as is is in the <style> itself. This behaviour was tested using code following this post, in Opera 9, Firefox 2, and even Internet Explorer 5**.

** EDIT: Sorry; that's Internet Explorer 6 not Internet Explorer 5...

For <link> elements, look at the 'href' attribute of a reference to any <link>, targetting only 'stylesheet' ones obviously. Some browsers (Opera 9, Firefox 2) will give you an absolute URL to the stylesheet; others may not be as helpful (IE5** just gives the href as specified in the link href). Depending on what you want to DO with the style information, will determine what to do with the href. In my example code below, I could use the href in one of my own <links>, and it would be like making any other (remote) stylesheet link. IF you wanted to read the content at a href; you might hit problems, specifically, Javascript wont permit you to download and inspect information from a domain other than that on which the script is a resident. The only way to get around that ( unless there IS a way speficially for stylesheets) , would be to use some kind of interim server side code; perhaps an XMLHTTP request asking your own server …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Isn't & bitwise and && logical? It is that way in C/++ as far as I know; but is it different in PHP? What about 'and'; is that another way of writing '&', '&&' or something else?

I would think that bitwise would be more likely to work as I'd like it to; since a bitwise AND is always dependant on a myriad of true / falses; thus, the value can never be determined from either operand alone... Saying that; one case : 00..0 bitAnd f() is always going to evaluate to 00..0, and that's a case I want to be fully evaluated..

I wouldn't like to risk unpredictability due to trying to one-line as much as I can; it's already a waste of process to AND on each iteration.

For now, I have gone with if(!validate($i)){$ret=false;} but I suppose I could go with:

validate( $i ) or ( $ret = false );

Using a short-circuit to my advantage; I can see it more clearly there.

Thanks for reading and replying both. I distrust PHP for some valid reasons, this would have been an invalid one; but finding this nearly drove me to move the related project into another language for want of not crashing into more weirdness.

However; I can't really argue with C++'s interprettation of the same construct.