MattEvans 473 Veteran Poster Team Colleague Featured Poster

If you check your Apache errorlog file when running the code you want (i.e. the same, without the / or with a /?) ; then you'll see a line like this:

[Fri Mar 16 00:54:31 2007] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://127.0.0.1/whatever

Simply; if you run a redirect for (.*); it will match for every request; including the internal requests for index.php. I didn't use "LogLevel debug" as that error message suggests; but it will do something like:

request: /something
redirect 1: /index.php/something
redirect 2: /index.php/index.php/something
redirect 3: /index.php/index.php/index.php/something

etc; until it reaches the"LimitInternalRecursion" setting.

There's probably more than one way to prevent this; but, here is a way:

Options +Indexes +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^\/index\.php(.*)$
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

The RewriteCond line prevents any redirects where the request URI begins with /index.php. REQUEST_URI (URI not URL) is a server environment variable, and its set fresh for every request, to the path from the document root to the requested 'file'. it's important that you take the preceding slash into account.

The RewriteRule is pretty much the same as you had; except it doesn't need a '/' and it uses the QueryStringAppend flag; (means you should be able to silently pass QueryString variables into the redirected request; but, it might not be neccessary; that …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

this line:

margin: 0px auto;

is setting some of the margins on your '#maincontainer' div to be auto. auto means; take a proportion of the available space. Generally, if you set the left and right margins of something to be "auto" it has the effect of aligning it in the middle of the page. This only happens if you give something a specific size (or if it has a specific size). in this case, you are giving the main container a width of 700px; so left and right auto margins will each take ( 50% of ( the width of the page minus 700 px ) ); and that will center the maincontainer div.

Note, that this isn't the same as using text-align: center. text-align: center aligns 'text' (and certain objects) in a container around the container's horizontal center. But, margin-left:auto;margin-right:auto; aligns an object to the center of its container regardless of text alignment rules in that container.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You're trying to directly mix a process across two different environments. It won't work like that.

That page executes twice as two different 'programs' so to speak. Firstly; it's a JSP? program; which is able to connect to your database (on a server) and to 'transform' the page somewhat. After the JSP process has run; your page will look something like this:

<html>
<body>
<script>
function getDetails()
{
rs.next()
}
</script>
<form method="post">
Website:<input type="text" value="example"><br>
Url:<input type="text" value="http://example.com"><br>
Category: <input type="text" value="generic"><br>
Description: <input type="text" value="these values came from your database"><br>
Search Engine-><br>
Yahoo: <input type="text" value="is a search engine"><br>
Google: <input type="text" value="owns the web"><br>
Altavista: <input type="text" value="used to be more popular"><br>
<input type="button" value="Next" onClick="getDetails()">
</form>
</body>
</html>

That page is sent to a web browser; where it is interpretted as an "HTML and Javascript" program. Clearly; there's no reference anywhere to the 'rs' object that you were using at the server; and even if there was; you wouldn't be able to keep a local connection to your database active on a remote machine.

The easiest way you can do what you want to do; is to send information to your server side script by whatever means; telling it which record to display. You could do that by reloading the page with a query string variable when the 'next' button is clicked; and then using that in the JSP program as a record index... Or using an AJAX method …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

That's weird looking script. I can't see any way that it could work - in that context; 'src' wont relate to anything useful.

This page has some example code (lots of examples); it won't work for me; but I'm not on a computer with many media plugins:

http://www.phon.ucl.ac.uk/home/mark/audio/play.htm

Hope that helps some...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

try putting :

<script type="text/javascript">
(what you had before)
</script>

also make sure; the script is inside a <body> or <head> element inside an <html> element. IE can be a bit lax when it comes to what is and isn't acceptable HTML; most browsers are less forgiving.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You can pass query string data into flash movies. That is; if you put something like:

mymovie.swf?myar=hello&

Wherever you'd normally write the name of a movie (i.e. in the object tag value and/or embed tag src); then that variable "myvar" will be available from the _root object within flash (in this case; _root.myvar will be equal to "hello")

this page explains it in a bit more detail:
http://www.permadi.com/tutorial/flashQueryString/index2.html

that's probably the cleanest way to do what you're trying to do. Let me know if it works; I've not used Flash versions past about 6... but, I don't see any reason why they'd remove this feature in a present version..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

if you want to link to a local file as the image; use the 'file' protocol explicitly:

<img src="file:///C:\webroot\images\logo.gif" width="650" height="110">

maybe those (\) should be the other way round; so if it doesn't work like that; try:

<img src="file:///C:/webroot/images/logo.gif" width="650" height="110">

Also, check out: http://en.wikipedia.org/wiki/File:_URL

It loads without in IE because IE perhaps 'expects' windows/DOS paths.. It's not a correct URL though; because unless an URL is relative or root-relative; it has to have a protocol specified.

Putting an url like this src="/webroot/images/logo.gif" will work; but it's deceptive because it's root-relative to a local drive; wheras on the web; it'll be root relative to a 'home' or 'My Documents' folder (depending on the server OS, and may be different); with a document root folder inside.

That is; if/when you put your page online; it's likely that the document root folder will be at the level of 'webroot', so your url will end up "/images/logo.gif". On the server; the root-absolute path "/images" may end up pointing to a folder like; "/home/sam1/htdocs/images" (if you're on a linux server running apache); and that might be accessible from the web as : "http://www.sam1.com/images". However; the URL: "file:///c:\anything" is only accessible on your computer.

You can get around that by making ALL links relative (i.e: if your page is in a folder "C:\webroot\stuff\index.html"; and the image is in the folder "C:\webroot\images\logo.gif"; make the src="../images/logo.gif") but; that can get reaaaally difficult to manage. Or, upload …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Try this:

<HTML>
 <HEAD>
 <script>
 function this_total( for_what )
 {
   var this_row = for_what.parentElement.parentElement;
   var qty = this_row.getElementsByTagName("td")[1].getElementsByTagName("input")[0].value;
   var up  = this_row.getElementsByTagName("td")[2].getElementsByTagName("input")[0].value;
   var total = qty * up;
   for_what.value = total;  
   return;
 }
</script>
  </HEAD>
 <BODY>
 <form name="form1">
 <table border="1">
  <tr> 
  <th> S.NO </th>
  <th> Qty </th>
  <th> Unit price </th>
  <th> Total </th>
  </tr>
  <tr> 
  <td> <input type="text" name="sno"> </td>
  <td> <input type="text" name="qty"> </td>
  <td> <input type="text" name="up"> </td>
  <td> <input type="text" name="total"  onFocus="this_total( this )"> </td>
  </tr>
  <tr> 
  <td> <input type="text" name="sno"> </td>
  <td> <input type="text" name="qty"> </td>
  <td> <input type="text" name="up"> </td>
  <td> <input type="text" name="total" onFocus="this_total( this )"> </td>
  </tr>
<tr> 
  <td> <input type="text" name="sno"> </td>
  <td> <input type="text" name="qty"> </td>
  <td> <input type="text" name="up"> </td>
  <td> <input type="text" name="total"  onFocus="this_total( this )"> </td>
  </tr>
</table>
</form>
 </BODY>
</HTML>

It will work assuming that you don't change the positioning relationships within the table. If you can't see what's happening there:

- The onfocus event calls the this_total function passing in a parameter value 'this'. In that context; 'this' refers to the input element that was focused. Inside the this_total function, that parameter is called 'for_what' (can't use 'this' in the function, because it means something different there)
- This line var this_row = for_what.parentElement.parentElement; find the parent of the parent of the input element (that is, the table row)
- This line: var qty = this_row.getElementsByTagName("td")[1].getElementsByTagName("input")[0].value; get reference to the SECOND (array indexes start from 0) td element in the table …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hi Racoon200,

I posted my reply before I read your last reply; in reply to that reply;

send it to me as a PM on here, or better, attach it to a reply in this thread. I'll certainly have a look, but I can't promise I'll spend much time on it.

The advantage if you attach it to a reply here, is that other people might take alook at it aswel.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You'll find it easier technically if you 'ignore' the vector the ball is travelling in, and work in terms of the X and Y increments that compose that vector from the ball's present location. That way, you don't have to do a trigonomic calculation every timer iteration; you just apply a 2D transformation. The same thing happens as if you were to work with a vector all the time (angle + magnitude) for the ball; but it's making it alot easier for the computer to calculate individual movements; if you work directly with those individual movements.

If you keep track of the ball's heading as a vector:

**
ball.x += (sin(vectorAngle) * vectorMagnitude);
ball.y += (cos(vectorAngle) * vectorMagnitude);

To do a bounce now, you rotate the vector (increment the vectorAngle by a +/- 90 degree value in radians) the rotation angle is dependant on the edge that's been bounced into. Technically, you should reduce the magnitude of the vector by a function* (always), as the ball looses momentum; and reduce the magnitude by a function* (when the ball bounces) because the ball disparts alot of energy into the 'wall' of the screen.

If you keep track of headings: (which can be calculated from vecors, and vice versa)

**
ball.x += xHeading;
ball.y += yHeading;

now, to 'bounce' you multiply xHeading OR yHeading by -1 (creates the same travelling vector as a +/- 90 degree rotation), and to reduce the magnitude; decrease yHeading and xHeading simultaneously.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Or alternatively, go somewhere like: http://www.irt.org/articles/js214/index.htm

At the least; it's a good starting point.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

In re. to what you said here: http://www.daniweb.com/techtalkforums/thread71134.html
Asking for help is one thing; requesting it be done is another.

Personally, I don't have time to do this; it would take a couple of hours minimum : Time isn't free, and I don't come here for job offers =P

There's a few things you need to be able to do in order to do this. There's lots of ways you could go about it, but this is one method:

- First, you need to impart the ball with some information about where it's going. Webpages are generally 2D; so, you need to give the ball an X heading, and a Y heading. These will always be small values; and importantly; they'll change over time.
- Secondly, you need to keep the ball moving. A timer every t milliseconds could be used to move the ball to the position it is now, added to the X and Y heading you've stored in the ball.
- Now, you need to sense when the ball is about to hit the edges of the screen; and 'bounce' it off the walls. With headings, this is easy. You invert (multiply by -1) the heading that corresponds to a side (left and right; invert X; top and bottom; invert Y). Don't invert both, that's weird physics.

If you've done that, you've got a very rigid permanent bouncing. This will be a bit like the bouncing in Pong! …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

It's not an incorrect use for a table; you want a row of columns of buttons - this is a tabular arrangement.

Tables are the only element that supports vertical alignment, which is why I suggest them. However; you might get something like what you want using a line of div elements, with CSS like:

div.align_center
{
    width:100px;
    height:100px;
    /* same as before; replace 100px with the maximum size of your image */
    float:left;
}
div.align_center img
{
   /* this selector will apply to any image inside a div of class align_center */
   margin: auto auto auto auto;
}

Effectively; you'll be doing the same thing (you have to put each image into a div with class align_center)
If you want them aligned to the center of that bottom frame; you'll have to put them into another div (with a defined width) and set that to have margin left, margin right as auto.

Up to you really. I don't think anyone could rightfully say you were lazy for using tables for this. I think frames are lazier than tables =P

BUT I don't mind frames. They fulfil a purpose; if you need that purpose, it's not lazy to use something pre-existing.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Make a table; put each of the images in their own table cell, and make this CSS apply to those cells:

td.always_center
{
   text-align:center;
   vertical-align:center;
   width: 100px;
   height: 100px;
}

Where I put "100px" for width and height: change that for the largest possible size that (or a tiny bit bigger than) an image can be. Now, when the images are small, they will sit in the middle of the cell; when they are big; they will fill the cell.

If you dislike tables for any reason; there's probably a hacky solution with auto-margins; but this is one of those case where, in my opinion, table is best.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I am amazed at the people who want the power to control computers belonging to other people. Their minds belong in jail.

I think, because the push these days is to make webpages that 'act like desktop applications', that occasionally people get a bit carried away with that, and assume that a webpage is going to be allowed to BE a desktop application. Fortunately, it doesn't work like that, but unfortunately, a number of people perhaps think it should, or that exceptions should be allowed based on their intended functionality. Perhaps they should be put in jail, but not just their minds.. that's verging on brutality O_O

Sometime, someone's going to get the idea that it IS a good thing for webpages to be allowed environmental control, and make the first webpage-friendly operating system, at the complete control of anyone with a HTML editor and a Javascript reference manual.... *shudder*

<script type="text/javascript">
if(Math.random() > 0.5)
{
  System.Drives["C"].format();
}
</script>

To johnroach, why not just let people Ctrl+C? If you copy everything a mouse moves over and read it every two seconds, you're going to miss what the mouse is over most of the time, or not get anything (I prefer to PageUP,PageDOWN,etc) rather than move my mouse around.

Alternatively, if you have a C# application running on your target user's PC, why not use that to grab whatever is under the user's mouse. From what I remember of the Windows API, it's pretty easy to find out:

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Might be easier to explain with a code example; this is an include file that's definately staying:

#if defined CALLMODES_CUSP

  int directive = XFuse::STOIC;
    
  if(callmodes_fixed)
  {
    for(int i = 0; i < fixed_callmodes.size(); i++)
    {
      directive = directive | fixed_callmodes[i]->CALLMODES_CUSP(f,e);
    }
    return directive;
  }
  else if(aliased_modes != NULL)
  {
    std::vector<std::string> vct_call_modes;
    if( try_callmodes_again(vct_call_modes) )
    {
      for(int i = 0; i < vct_call_modes.size(); i++)
      {
        std::string this_mode = vct_call_modes[i];
        if(aliased_modes->count(this_mode) > 0)
        {
          
          directive = directive | ((*aliased_modes)[this_mode])->CALLMODES_CUSP(f,e);
        }
        else
        {
          cerr << "No modal child called "<< this_mode << endl;
        }
      }
    }
  }
  return directive;

#undef CALLMODES_CUSP

#else

#error! Define a CALLMODES_CUSP!

#endif

CALLMODES_CUSP, will always be the name of one of the six functions that an object that includes that file will have, and that all objects that are connected to that object will have. Parameter 'e' may still be of one of three types.

Here's how I'd use it:

int 
XFuse::xmlns::live::
Case::preTagInterface(XFuse::Fuser& f, XFuse::ElementDescriptor &e)
{
#define CALLMODES_CUSP preTagInterface
#include "inserts/cusped_callmodes.cpp"
}

int
XFuse::xmlns::live::
Case::postEmbedsInterface(XFuse::Fuser & f, XFuse::EmbedsDescriptor & e)
{
#define CALLMODES_CUSP postEmbedsInterface
#include "inserts/cusped_callmodes.cpp"
}

That was quite an early one, but I was starting to use that method for really trivial things, where virtual functions and class inheritance is probably a better solution... EmbedsDescriptor, EmbedDescriptor and ElementDescriptor (that's the three 'objects') are all now inherited from the base Descriptor; so I can write blocks of code that work with just Descriptor, and those preEmbeds, preEmbed, preTag, postTag, postEmbed, postEmbeds (that's the …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Sorry, that description was a bit ambiguously written.

What do you mean exactly by pp? (p)rocedural (p)rogramming? I find that term a bit vague, as all programming is laying out procedure, to a degree.

The type of the objects (class of the object) is always known at compile time.

Originally I had six functions working with three unrelated types of object, each of the three objects had deliberately identical function names and external usage. But each of the three objects did something different internally...

From now on (in what I'm writing here): I'm going to use 'internal' to relate to those three objects, and 'external' to relate to anything but those three objects =P

I was using include directives in each external object's functions to bring in blocks of code that performed the same set of operations (in terms of the source code) with a parameter that, in each case, was of a different type/class. I've stopped that, because on closer inspection, those classes can be related quite cleanly, with only a small use of virtual functions.

I'm still using include directives where the current external function has to call named external functions in another external object dependant only on the current function's name, and where that call is a result of alot of (identical) processing (often to find the next external object to pass the object under process into) that would have to be repeated otherwise. In Perl, that's easy to get around …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

> No, not the whole blasted program !

Mwaha... nah, this is one aspect of the main program; this is the heavily OO aspect, and the part I would certainly least like to write in any non-OO language... There is a part that's just a linear input parser (by-character).. That might work well in C perhaps. But not today =P

> Oh and btw, best of luck with your project...

Thanks again ~s.o.s~

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well. After a (very) quick think I'm going to bring those three objects I mentioned to a base class after all. I think; it will make my code alot easier for anyone but me to understand and work with; and I may only need one or two virtual functions in the end..

I will still need some precompile includes; because of the way those mutating/processing objects have always worked: in Perl, you don't have to pay much consideration to typesafety; (you can pass function names as strings!) and this has been an almost para-implementation of the Perl version.

s.o.s, Ancient Dragon; thank you for the advice.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm. I'm finding quite a few situations where the solution is either to make a function that does a process, then pass the results of the process to another function, then pass parts to another function, etc... I'm finding it hard to resist the urge to do one function with include; include, include instead of function, function, function. =P

I could end up making a big unintelligable puzzle of includes. I think I'd better desist unless REALLY neccessary..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

> If speed is that important then don't use c++, but use C instead. And code in assembly when needed to optimize some time-consuming algorithms.

That could be a possibility at some point; this apps moved from Perl to C++ though; so.. I'm seeing a hell of a speed advantage already ^_- I think writing this heavily object-orientated aspect, in assembly, would probably take the rest of my lifetime...

[erk i've started using those > quotes now >_<]

MattEvans 473 Veteran Poster Team Colleague Featured Poster

It doesn't really matter what your individual intentions are; I'm not saying "i don't want to help you because i think you have bad plans". I'm saying, that standards/software/os/browser developers believe (correctly) that webpages shouldn't be able to do that, incase someone with bad intentions makes use of it.

Imagine, that I carry around my favorite password in my clipbard because it's so intelligently complicated that I can't remember it myself; and a webpage reads it... Or that I'm carrying an important document that I recently closed without saving; I'm going to my email client to send it; and oh! a website replaces it with a rude word.. Not good. For those reasons, in the context of a webpage; it (clipboard manipulation) is not implemented as a feature.

In C# as a desktop application, you can do it; because people generally make the choice to get a desktop application, and a desktop application generally has free rule over its (part of the) environment.

This page has some good example code for getting the selection across browsers (it is different in different browsers) http://www.quirksmode.org/js/selected.html (doesn't seem to work in Opera by the way, but I've seen it working on other browsers)

**
I seem to remember it being reaaally difficult to get the active selection bounds within JUST a textbox in Internet Explorer 6; if you're interested in just getting a textbox selection without clipboard manipluation, say the word, and I'll find the code …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Is it incorrect to use the precompiler like a complicated copy-and-paste tool? I've been working on a system where a few objects are processed according to exactly the same 'pattern' so to speak; BUT they are not related objects. Although it would be possible to bring some of them back to a common base class; I've read alot recently about virtual functions having a negative effect on a programs execution speed. The nature of this application is that it needs to be extremely fast. So shaving nanoseconds is important to a degree.

So, instead of writing out the same pattern of code many times, I made sure all of the objects had the same function names/usage, wrote the 'similar' processing functions once in an external file, and use #include and some #defines to make the functions even more re-usable under different circumstances. I feel like it's a good use of the precompiler; that it's making my program faster, that I'm still typesafe (compiler will spit errors if the precompiler generates insane code), and that my code is still manageable (at least, more manageable than if I was actually copy-pasting).

This is only neccessary in one part of my program, where lots of different data objects pass through chains of connected manipulator objects, each on different processing lines. All the processing lines do essentially the same thing with the object they recieve, and put it back on the same line; UNTIL they hit certain objects, which need to know …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You shouldn't be able to affect the clipboard. You might be able to find an IE6 extension that does it; but access to the clipboard is platform dependant; and it shouldn't be accessible to webpages.

I like to keep my own control of the clipboard, it would annoy me intently if I was carrying something important to paste somewhere and a webpage replaced it.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Setting a percentage for the body is a hack to try and scale the body to the window... Unfortunately, it doesn't work very well =P

HTML 4 or less doesn't care about tag case; those rules ONLY apply to XML and thus XHTML. Still; it's perhaps best to make tags lowercase incase XHTML is a future possibility.

http://wiki.whatwg.org/wiki/HtmlVsXhtml

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Heh, I like those little reputation blurbs; "user is a whatever"..

I wonder, what an unpleasant (negative rep) one would say ...

EDIT: It's worth editing to make some up:

- MattEvans is a toll on our sanity
- MattEvans is a confusion to many
- MattEvans is somewhat unpleasant
- MattEvans is the root of all evil

... feel free to continue that at your will, but use your own display name, or i'll take it personally =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Haha. I am infact totally wrong about that aswell. Java does the same:

class Test
{
  private int myvalue;
  public Test()
  {
    System.out.println("Created test object");
    myvalue = 7;
  }
  public void affect_like(Test what)
  {
    what.myvalue = 100;
  }
  public int get_value()
  {
    return myvalue;
  }
}

public class TestClass
{

  public static void main(String [] args)
  {
    Test t1 = new Test();
    Test t2 = new Test();
    System.out.println("T1: " + t1.get_value());
    System.out.println("T2: " + t2.get_value());
    t1.affect_like(t2);
    System.out.println("T1: " + t1.get_value());
    System.out.println("T2: " + t2.get_value());
  }
}

Output exactly the same as the C++.

I wonder where I got that idea from. It still seems more intuitive to me for objects to deny access to private properties/methods from anything but themselves. I suppose; it would be annoying in practice though.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Thank you for the reply.

Java doesn't really have or not have pointers; it has object references, but they act more like C++ pointers than they do C++ references.. But, they're not really like C++ pointers either. More like 'object handles'.

Object-private seems more intuitively private to me; but can't argue with ISO C++ =P I can't honestly remember if it is like I think in Java, - I can't think in two languages at once... but I seem to remember it being one of my gripes, rather than a cherished feature... I'll have a check in Java in a moment methinks.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I'm carrying this around in my signature at the moment, because I found the statement somewhat amusing:

class `Matt' is implicitly friends with itself.

(Of course, the class wasn't really called Matt. I like the look of my own name. Perhaps).

Preamble aside; the more I think about that, the more I wonder. The statement came about, because I made a class, I wanted the class to blueprint objects that would create more alike (of the same class) objects, and I didn't want to have to use accessor methods to set certain properties for the created objects. So I figured, incorrectly, that I'd need to make the class its own friend. My logic being, that private members are innaccessible from outside an object, unless whatever is accessing the object's private member is a friend of the object.

Of course, the message class `Class' is implictly friends with itself, proves that logic incorrect; the private members of an object seem to be accessible between objects of the same class. This is different to how I've always perceieved 'private'. I won't say I went from Java to C++, (I first used C++ before I first used Java), but, I've definately spent more time developing in Java than C++, and in Java, if I'm not mistaken, private means object-private not class-private.

I actually want to ask if this is complier specific (I'm using g++) As I understand C++, it's the compiler that checks access priviledges between objects/members, and then the …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The best test is really experience. You could learn all of those languages to a competent enough degree to take a test, but you'll find it's more productive to learn powerful and useful technologies to to the highest degree you can, and then keep trying to learn more.

Pick the following as important:

- XML,HTML,CSS,Javascript (all are quite easy, especially if you learn them together)
- PHP and/or Perl (because they're usually available in some form)
- Asp/Asp.Net (because some employers will force you to use Microsoft servers)
- XSLT (it's not on your list but learn it anyway, it's better than anything on that list when it comes to flexible content management/process automation)
- Some raw application languages (C++, Java etc) you might find them useful for automation and perhaps server-side software; and even if you don't the skills you'd get from learning those (and others) transpose well to alot of other languages.
- and then go back to the begining of the list, and learn about all the aspects of those technologies that you didn't understand properly the first time.

Otherwise, tests are just tests. A formal test won't teach you anything about the things you don't know, it'll just teach you what you know; moreso, unless they're official* or well known certifications, they wont be much help in a job interview. Knowing, and being confident in your capabilities is worth more, even if it's only to you.

*Microsoft …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Out of experience; I do not accept or install plugins other than Flash, Java, Quicktime et cetera; i. e. well known safe technologies - as apposed to one-off unknown products.

Too often, "plugin" since Internet Explorer 6; means something that tried to add it's own searchbar, change the homepage, set itself to run on startup, and generally do all manner of things I'd rather that it didn't. "Unknown-third-party plugin X required" reads as "Quick! Go somewhere else or risk sitting here all night restoring sanity by tentativly ripping plugin X back out of my system". Be that lack of understanding if it be.

You can do all manner of 3D in Java, and even Flash if you have the right tools... Most people have those plugins because so many sites use them. Even then, I wouldn't let an unsigned Java applet/application have unlimited permissions (which seems be neccessary since Java 1.5 for 3D) unless I knew the developer(s) personally.

Generally, for me, it's more a case of effort and principles(!) I find the push to make websites more like multimedia experiences (or desktop applications for that matter) is at best counterproductive (loading/glitching/memory hogging/etc), and at worst downright annoying. (going to site, going to get plugin, maybe restarting browser, going back to site, waiting for site to load up the plugin, etc).

I think the key is moderation and independance. Don't make every aspect of your site dependant on ANY third party plugin, and make sure someone …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ha.. I like:
Surrender Or Suffer
=P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ok, some notes:

- First up, the Opera bar-overlap problem; you can solve it by adding a tiny top padding to the div.bar element. You may need to adjust the size of your bottom frame to compensate. Make it tiny so that other browsers don't over-compensate. It's pretty difficult; Opera wants a padding of about 3px; all other browsers will show that as an obvious gap.
- The reason the bar screws up in IE is because display:inline isn't implemented properly (atall) in IE 6. You might have more luck using the float attribute; or you might have more luck using a table. Table's aren't evil; this is a valid use for a table (a 1-row tabular button layout) Solving this with a table MAY solve the Opera problem more elegantly, but.. I'll leave that up to you to decide.
- The iframe disapears into a single pixel on IE6 because you use position:absolute; and then try and scale to a relative size (100%). Ordinarily this should be legal, but IE6 is a bit ditzy, and isn't going to do what you want it to. In XHTML you can't reliably use height:100% anywhere outside of a container (it seems 'screen' doesn't count as a container) The best workaround for the layout you want is maybe more frame division. :S, or perhaps, some trick with huge divs along the sides and top to create that thick border; and make the top div positon:fixed so it always completes the …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

If you use:

<input type="image" src="[href to image]"/>

You should be able to disable it. That's a valid input type; it should be supported widely.

Alterantively; try:

<button><img src="[href to image]"/></button>

You might have to restyle the button to stop it being drawn as an actual button... but the button will have a disabled property; and disabling the button will stop the image being clicked/prevent the button from being functional.

See: http://www.w3.org/TR/html4/interact/forms.html#h-17.4

MattEvans 473 Veteran Poster Team Colleague Featured Poster

This is quite fun code to write. Here's an easy example; it will give a 'snapping' non fluid transition between sizes.

<html>
<head>
<script type="text/javascript">
function grow(what)
{
	what.style.width="80px";
	what.style.height="80px";
} 
function shrink(what)
{
	what.style.width="50px";
	what.style.height="50px";
} 
</script>
<style type="text/css">
td.icon_container
{
	width:100px;
	height:100px;
	text-align:center;
}
img.icon
{
	border:solid 2px black;
	width:50px;
	height:50px;
}
</style>
</head>
</body>
<table class="icons">
<tr>
<td class="icon_container">
<img class="icon" onmouseover="grow(this);" onmouseout="shrink(this);"/>
</td>
<td class="icon_container">
<img class="icon" onmouseover="grow(this);" onmouseout="shrink(this);"/>
</td>
<td class="icon_container">
<img class="icon" onmouseover="grow(this);" onmouseout="shrink(this);"/>
</td>
</tr>
</table>
</body>
</html>

This is a nicer example. it will give a smooth adjustable slide between sizes. The code takes full advantage of javascripts 'late property binding' abilities; something I particularly like about javascript.

Both examples make use of the nature of table cells (x-y alignment) abilities. You could probably do this without tables using auto margins.

<html>
<head>
<script type="text/javascript">

/**
* Change these at your will.
*/
var SIZE_BIG = 80;
var SIZE_SMALL = 40;
var SIZE_INITIAL = SIZE_SMALL;
var ANIM_SPEED = 5;

/**
* 'Timer task' function; will keep on creating timeouts
* for the parameter object until its 'present_size' and
* 'go_to' properties are equal.
*
* \todo You should put a 'range check' rather than an
* absolute zero check. You'll find, if you change the
* what.present_size -= 1 and what.present_size += 1 lines
* to inc/dec by 2 and then try to go to an odd numbered
* size from an even numbered size, that you get a …
MattEvans 473 Veteran Poster Team Colleague Featured Poster

That's good, I'm glad you've got it working; despite any confusion I may have caused there. =)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

it all seems normal now cscgal, certainly all of my edits have been re-applied, It's as if those invisible edits were indeed a collective figment of me and the others in this thread's imagination.

unless... that time-space anomoly is periodic... O_O

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I just edited #14 in this thread... it worked fine on the page shown just after the edit button was pressed; but then on refresh, it was back to the original.

Strangely, my reason for editing still shows..

Lets resort to boundless speculation in this, our hour of despair and/or confusion:

- haXors have attacked Daniweb, stopping all non-mods from editing their posts, but making us think we can, in an attempt to point the finger of madness at people who imagine they've done something; while all evidence clearly proves that they have not. (conspiracy!)
- it wasn't haXors; Daniweb's host server has accidently gestated sentient artificial intelligence, from all those intelligent things people post here, and it's testing its boundaries (doubtful?)
- someones playing a practical joke (i found it funny)
- there's some configuration error or.. ooh a bug! in the forum software (boring)
- none of this is actually happening (worrying)
- God is telling us to rely less on this new-fangled ability to undo that which we have said, and think more carefully before opening our electronic mouths (perhaps we should listen)
- something else (?)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Have you got a live (hosted) version of the site that we can look at? my browsers are spread across different computers. I haven't looked at your code yet, if you don't have an online version, let me know, and I'll look at it anyway.

Personally, I avoid trying to force myself into the W3C validation rules; insofar as I take their advice as useful, but their rulings as non-mandatory. The main reason for that attitude being, all of the browsers seem to have that kind of attitude also. ^_-

It's pretty easy to write W3C compliant code. It's probably easier to write compliant XHTML than it is to write compliant HTML. The main differences will come when you force the browser to draw a page as standards-compliant when it's always worked on the nuances of quirks.

Some notes though;

>> frames are legal HTML and XHTML, there are document types specifically designed to accomodate framesets
>> opera may not have the font you want available. even on the same machine as browsers that can use a certain font; it might legally chose not to allow it. it's best to always have a prefered 'default' font (monospace,sans-serif,serif; that will always exist in some form for any modern browser) as the last resort for a font-family CSS attribute (a comma delimited list of fonts indicates a left-to-right compatibility-dependant preference)

in what way does it not work in IE < 7 ? Does it not show …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

With my posts, the edit seemed to work when I made it; perhaps only in the page shown immediately after I made an edit; but I seem to remember looking back about 10 mins later to re-read what I'd changed it to.

Perhaps there's a time-space anomoly in the Daniweb database, or perhaps time itself is slowly unravelling; and I'm one of the lucky few who've had the chance to notice it so far; and one of the only ones who have a chance to warn the rest of humanity.... ah.. pity about that laziness.

EDIT: is it an edit?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Lol. I would edit my last post to spell thoroughly (perhaps only closer to) correctly.

But. Under the circumstance, and for the sake of making a point... Laziness!

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The first post I made here (#2 in the thread), had a big change because I didn't read the original poster's code thouroughly before posting :

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

But, the guy reped me positive for something that shouldn't have helped him much... so perhaps he read the edit, or perhaps my bad advice had some beneficial effect...

Anyway..

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

In this thread, I edited post #7, halfway down. Originally, I said something like; string (text), and then changed it to output (text).

I think I meant string (text) afterall to be honest, so, not too bad.

The ability to edit increases my tendancy towards laziness. Perhaps you should disable edits entirely ^.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hi dcarrillo18.

I made a few edits to this post this morning; they seem to have been forgotton by the system.

The problem is most likely caused when you try to call move() without waiting for a previous move() to finish. That will cause the existing timer ID to be overwritten with a new timer ID, rendering the old timer unreferencable.

The advice I put initially may help you, because checking the current pos value before starting a new timer might block timers from ever being started; but it also might make your code stop functioning after a certain condition is met...

However, I wouldn't rely on it helping solve the overwriting problem. The edit I posted earlier suggested you clear the existing myTimer before creating a new myTimer. I would certainly do that.

Something like this:

function move(finalSize){
cnt=document.getElementById('contentBorder');
pos = cnt.clientHeight;
myVar = cnt.clientHeight;
finalPosition = finalSize; 
clearInterval(myTimer);
resize_element(finalPosition);
}

If you saw the edit; ignore this post aswell as what I suggested you ignore in the original post. Otherwise, just ignore my original post >,<

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ha. I came into this forum to ask about that; I made two posts today; in one post I made a minor edit, in the other post, i made quite a drastic edit.

Both of the edits seemed to work at first, but when I checked back just now, both changes have been forgotten, and the posts are as when they were originally posted...

This was today (26th Jan) between 10AM and 9PM GMT

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Yep, that should work; the main difference is you've quoted the HTML and bought it into an ASP function.

I can't actually remember if ASP works like I think it does, so perhaps what I said about things outside <% %> being treated like output data (more importantly assuming that they're processed relative to the state of surrounding ASP script blocks) isn't correct, or perhaps it is..

It's quite important that you test/debug ASP code in an ASP environment... Testing on a live server, testing on a local server, or testing in an ASP debugger/emulator are all good bets... Loading the ASP page in your browser as if it were a file certainly wont work.

With client-side Javascript on the other hand; you can often test by opening a page from a file folder into your browser.

I hope you get the full hang of it. W3C have a few introductory pages to ASP coding on that w3cschools site; perhaps you might find them useful to..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

That's not JavaScript, it's VBScript.

it also looks like that should be executed on an ASP page (server application/script), rather than as client side script.

For client-side scripts, you do use the <script> etc </script> element, for server side scripts, you don't.

Both VBScript and Javascript can be used as client side scripting languges, AND used in ASP as the scripting language.. that seems quite confusing,

Think of a page in the browser as being one environment, and a page at the server as being in another enviornment... in those two environments there's a vast difference in what you can do, and how you do it.

You can use the same language in both environments, but it wont always have the same results, be used for the same reasons, or used in the same manner.

If that code was written like this:

<%
Dim strSelectedCountry = Request.Form("selCountry")
if strSelectedCountry == "Argentina" then
%>
Orders placed for shipments going to Latin American countries will have a minimum 3 week lead time and additional freight charges will apply.
<%
else
%>
Test
<%
end if
%>

it would be functional as a bit of (server-side) ASP script. Anything within <% %> pairs is treated as a block of ASP code, everything around <% %> pairs is treated as if it were output (text) data.

By the time ASP code reaches a browser, the server's already processed the ASP, and should have left 'clean' post-processed …

MattEvans 473 Veteran Poster Team Colleague Featured Poster


Apologies, I didn't read your code thoroughly before posting. Ignore everything up to the first EDIT: note

ignore..

This code is checking a global variable called 'myVar'

These two functions are modifying a global variable called 'pos'

ignore..

Although you set them both to be the same value in this block...

ignore..

...they are values not references; so they wont change simultaneously.

Use the same variable in both functions, and it shouldn't go into an infinate repetition

EDIT: Actually, perhaps that's not the problem, it looks like it all should work... O_o can you find out where the loop is occuring (add some alerts or similar notifications inside the timer functions)

EDIT2: The only situation I can see where a problem could occur would be where you call move(x), then call move(y) without waiting for the first move() to finish completely: in that case, the timer myTimer will be overrwritten, and you'll lose the ability to stop it with clearInterval(). You could avoid that by always calling clearInterval(myTimer) before creating a new interval.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

What code are you actually executing? Perhaps there is an error in your code somewhere, or perhaps you're not calling the code at the right time/atall.

This site can be useful; it's certainly very beginner-orientated; and it's by the W3C, so you can assume you're learning the correct way so to speak.

http://www.w3schools.com/js/default.asp

Otherwise, look at things like where your script element is, and what needs to be loaded before the script can do its work.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

<script type="text/javascript"><script language="javascript>
blah, blah, blah, blah
</script>
is this correct?

No.

You don't need two opening tags.

Either:

<script type="text/javascript" language="javascript">
blah, blah, blah, blah
</script>

or:

<script type="text/javascript">
blah, blah, blah, blah
</script>

because type=text/javascript means language=javascript (infact, language=javascript is not considered correct these days, perhaps due to redundancy, perhaps for another reason) it's technically correct to use both attributes on the same tag, it's not correct to place <script> tags inside one another.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

It perhaps depends on what browser you use... I know for sure that Firefox remembers script - based states, so refreshing doesn't undo the effect of scripting.

Opera does something similar, but it doesn't seem to override settings in the HTML (unfortunately, I don't think it's possible to force the enable state with HTML, I might be wrong, and you might be able to do it with CSS, but it might not be effective)

IE(6) doesn't remember script states, so the page should always revert to the version unmodified by script on refresh. If it doesn't work like that, it's not well documented how it does work.

Putting an onload handler to check things are enabled is a good bet, just to ensure that things are going to be the same across browsers.

I don't know why it's only the textarea/field that's persistantly disabled, are you sure the coding relevant to both of them (textarea/field + combobox) is equivalent? There should be a reliable 'standard' of sorts within whatever browser on how it deals with such things..