MattEvans 473 Veteran Poster Team Colleague Featured Poster

The buttons work when the basic editor is selected and with script enhancements enabled.

I have more info..

When the page is loaded, with script enahancements enabled and the wysiwyg editor chosen; For a few moments after the page is refreshed, the buttons are functional ( they change color on hover ); however, about 5-10 seconds after refreshing, all of the text on the page starts to vibrate for a while.. Seriously; the content of the page seems to grow and shrink, and repeat for about 1-2 seconds. Visually; any point of reference on the page vibrates up and down; then eventually stops. It is after this period that the buttons stop being clickable.

The growing and shrinking phase still happens when the wysiwyg editor is disabled and script enahancements enabled, but crucially: after that phase, the buttons continue to work. [[ The submit buttons are relatively 'higher' on the page with the basic editor than they would be with the wysiwyg editor - which might suggest them moving into and ending up in a position 'underneath' something invisible that only starts to exist at a certain height; or of course, this fact might be irrelevent. ]]

The growing and shrinking phase does not occur unless script enhancements are enabled.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ah, that seems to have fixed it.

I guess I will leave the Javascript setting off for now, since I do use Quick Reply quite frequently.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well. It's still not working; but I can tell you the problem is style/layout related rather than any problem with the buttons/form itself. Heres a description of the problem with more insight:

- Normally, buttons on Opera can be clicked ( really! ), the color of the button changes when a button can be clicked and/or has just been clicked.

- The buttons on the quick reply form however, don't get this anymore. When I mouse over them, they don't change color, when I click them, nothing happens. That activity is expected if a button is disabled, but these buttons aren't disabled; because:

- Opera has a mode to supress layout elements; when I enable this mode, the buttons can be clicked. This mode is not generally disabling style or anything else; just divs, tables, lists etc; so, the buttons themselves can't be disabled, because they work when this mode is on.

I would put forth as potential reasons: some hidden and click-absorbing layout element is over the buttons, or the buttons are in a disabled layout element, or Opera generally disagrees with some layout at that point in the page.

As I said, it is only recently that this has stopped working, but not immediately.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ah, that's a different number; When I submit this reply, I will have 731 posts, but my reputation score is different - it's based on people clicking that "add to mattevans' reputation" link, which is strictly independant from the number of posts I've made. Optimistically, there is a correlation between my number of posts and my reputation points, but that'd only be because more people see my posts, there being more of them, thus there being a higher probablity of my posts being read by someone who appreciates them, or of course, is annoyed enough by them to give 'anti reputation points'.

The titles like 'Master Poster' are based on number of posts; although certain users can change their title to anything they want - Dani for example sets her title to 'The Queen of Daniweb', other people can do that aswel. I can't, I guess you can't either.

To find them out what the un-changed title will be at any number of posts.. well, I don't know if there's a table showing this publically available; but : http://www.daniweb.com/forums/memberlist.php?&order=DESC&sort=posts&pp=50 go through the list of members ordered by post count if you want; it'll tell you many of the titles.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Agreed.. But I don't see C++ as more, or Java as less time consuming to work in than any other language, once I know what needs to be done and how to best go about it. Depending on the app, C++ might be easier : with third party libraries, the need to write code for different platforms in C++ can often be removed anyway - graphic libs, input libs, thread libs, network libs; they are written to be machine independant with a common interface. I guess that's the whole point of Java, in that it's ALL a common interface; which is, I suppose, a natural progression. If more game-specific libs were available on Java, and if the language wasn't so abstracted and neutered; It'd perhaps be a better choice for 'bigger' games than it is at the moment. Unrelated; I actually prefer C# to Java, although it's still lacking in terms of the capabilities afforded by the base language - no multiple inheritance, no 'const' in the C++ sense, no stack-allocated class-type ( polymorphically-capable ) objects, forced non-deterministic garbage collection and no manual memory management... But, you can write inline code with pointer arithmetic, and marshal C++ objects in and out of the managed system, pass-by-value or reference in some circumstances, use closures/anonymous functions, use a function pointer-like/event-based syntax, it's quite fast to work in, since it has a reasonable DX-wrapping game framework library that works on the XBox 360 and PC. But, poor support outside of Microsoft platforms of …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

so can i click on add to your rep to increase the green dot for U

You can; but as far as I know, all reputation given in coffee house boards isn't counted towards (any?) of the scores.

EDIT: Oh.. you can't click on the picture of the dot itself if that's what you meant.. you click on "Add to bobbyraw's Reputation".. Except, you can't give yourself reputation either.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ha! I think it is just there to show who you can afford to start an argument with.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm. I understood that for a moment, but now I see another, different, number.. your 'reputation altering power' on your profile = 9, but your 'rep power' as shown under your name on posts = 31.. aren't they the same thing? That's what I understood from your post.

Mine are different to; on my posts it's 4, on my profile it's 6..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The 'Quick reply' and 'Go advanced' buttons on the quick reply form stopped working for me about a week ago, I thought it might be temporary/known about, but that's quite some time, and perhaps it is Opera specific. This is only on the quick reply form at the bottom on a thread, I experience no problems with the form on the full 'post new thread' page.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

What's the significance of the numbers? I have 2 green dots, a power of 4, and 120 point(s) [which is secret].. is there some simple mathematic relationship between points, green squares and power? 1 power integer = 30 points = 0.5 green squares? Green squares relationship there can't be right, because I see people with one more green dot than me might have 10+ more rep power than me.. is that because green dots aren't linearly mapped to rep points? Or is each measure related to other things than rep given, or is rep-power relative over all members? I must admit, it is quite confusing without clear explanation.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I can't see any gain in using Java over C++ in games unless it was always much faster in execution speed than C++, or provided some functionality or freedom that C++ doesn't; which it isn't, and doesn't. Like C++, Java can only ever hope to equal the speed of optimized machine code, and if it met the speed of machine code generated from C++ :- so what, it doesn't have the same existing 3rd party useful-for-games libs as C++ does at the moment, the standard library isn't as good ( I like simple and general rather than complex and all-encompasing ) all acccess to the OS/videocard is via a higher abstraction layer as exists in C++, garbage collection is a problem I suppose ( but the same strategy VeAr just outlined - minimizing collection, should be employed for C++ games anyway, i.e. minimizing allocations/deallocations on the heap during time-critical periods of runtime- even pre-arranging heap objects using estimated usage frequency/order, but you couldn't hope to do that in the Java as I know it ), the language architecture just isn't optimum anyway beyond prototyping - if I know the lifetime of an object, and that it should be stack allocated, I want to specify that explicitly in the code, not perhaps imply it in the design.

There's nothing special in Java that doesn't exist in C++, thread stuff is arguably made simpler across different platforms, and the general multiplatform aspect is a good thing - but this doesn't matter …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

If the entire site/page is offline, yes... I'm not 100% sure on the OPs requirements, but 'web page' implies a page on the web; and if the page really is hosted on the web ( i.e. on a host that cannot be assumed to be the localhost ); then the obvious way to access anything on a given user's machine from that webpage is using an absolute path starting with 'file://' as per that example ( and to my knowledge this only works with < IE6[7??], and only with images ).. If the site/page that requests the image is also on the localhost, then no problem, it will work in any browser: use relative, absolute, or root-relative paths, whatever you prefer.

But I don't think that's the case, read the posts, the OP specifically says 'i cant access those files on server side if i say <img src = "c:\a.jpg"/> it will search on server.' Forcing the browser to use the file:// protocol instead http:// protocol in theory will allow the browser to access files on the user's own filesystem; in practice it wont work reliably - not all browsers will allow it in all circumstances - because it's dangerous. BUT it will always work, if the page and the image are sourced from the same host... e.g. if the .html file is saved on the same computer as the .gif/.jpg/etc files.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

>_< OR, if you're gonna ask someone to do your assignment for you; at least TRY and make it look unlike you've just typed in whatever your teacher gave you, rather; make it look like it's something you've been stuck with trying to do at work, something that isn't clearly defined as tasks for a grading scheme, at the very least edit out the word 'assignment'... Laziness and an absolute lack of deceptive creativity aren't gonna get you any help. For your own benefit; don't follow that advice.

What course are you studying, and do you have a choice about it? Because this really isn't hard stuff, to do, or learn how to do.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Whether or not a browser allows a page to reference files on a user's computer in any way is dependant on the browser and perhaps security settings; although, it's certainly been possible in previous IE versions to display images that are stored on a user's PC via a webpage, regardless of the host of the webpage. For that user only of course...

This works for me in IE6:

<html>
<head>
</head>
<body>
<img src="file://c:/synd.gif"/>
</body>
</html>

But not in Opera or Firefox.. Dunno about IE7. Opera and Firefox only allow this when the host is the localhost - in other words; when the page referencing the image is also on the user's PC.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

...as long as the string is always a valid CSS property; "95px", "95%" "95pt" etc; you shouldn't need to use eval atall. You're eval-ing putting quotes around the value of a var; so the eval will return an object of type string; the var in that example is already a string, growing suspense... conclusion : the eval does _nothing_. Some kind of property parser gets invoked when you assign a string to a CSS property via script - it will parse the string 95%.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I think you should put more information about the game on a link from the frontpage - maybe explain how a user plays, what the experience is like, etc. Certain people will not provide their email address without knowing why they're giving it and whether or not it's worth it.. Sorry I can't give you a review of the game; because I'm one of those people.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm, the best way to learn how to use w3c schema is to actually look at the working schema for some XML languages, that and consulting the actual specification for schema http://www.w3.org/XML/Schema#dev ...although, w3cschools isn't that helpful since it only details each element's functionality singularly, not really as they interact with each other.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

It does mean that only one of the elements within the choice can be chosen - but putting maxOccurs = unbounded means that you can make that choice an unbounded number of times at that point... It's similar to how one would express the same constraint in DTD language:

i.e.

<!ELEMENT house ( door | window | roof ) * >

That means, house may contain ( ANY NUMBER OF [ * ] ( door OR window OR roof ) ).. so, first element is a door, ok that meets ( door OR window OR roof ), second is a door, ok that meets ( door OR window OR roof ), third is a roof.. and so on. Since your allowed an unbounded number of choices, you can pick any of the elements allowed by the choice, any number of times, in any order.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

replace <sequence> with <choice>, and use the attributes 'minOccurs="0" maxOccurs="unbounded"'. Take out the maxOccurs on each of the potential children in the choice. Something like this:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="building">
    <xs:annotation>
      <xs:documentation>a building</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="window" >
          <xs:complexType>
            <xs:attribute name="state" type="xs:string" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element name="door" >
          <xs:complexType>
            <xs:attribute name="state" type="xs:string" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>

What does this mean? it means that the author of a document may choose only one of the potential children, but do so as many times as they like; i.e. they can pick children in any order and any number of times. It's a nasty workaround to, what I feel is a nasty shortcoming in the W3C schema language. It's a nasty workaround, because you lose any level of evaluation of the actual provided sequence of children; all you can say is that there's some number of them.

Please, please don't assume that if you can't describe something, or can't well define it with W3C schema that the data "shouldn't" be modelled in XML!! there are other schema languages, RelaxNG/Schematron for eg. W3C schema are near-awful for anything where structure is more important than datatyping.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm, I can't seem to reproduce the problem.. Using the code in post #4 with no modifications ( except changing the imgs' srcs to point at Matty's server )... Firefox 2 on Linux, screenshot attached.. But I can't see any gaps...

With the link Matty posted (in #5), I also see no gaps.. but the layout breaks down at widths larger than a certain threshold in Firefox and Opera, and I imagine also IE..

Can you post a screenshot of how you see the code in post #4, on your FF vishesh. Put 'http://stormtrooper.webng.com/' infront of all of the image srcs.. sorry about the hotlinking Matty =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Have you got code for a page that I can look at?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Try this, aswel as the code recommended by MidiMagic to ensure that the relevant cells have no inner padding.

img{ 
display:block;
margin:0;
}

That'll make images act like blocks, so, if you're relying on the inline behaviour of images, you might be able to get away with removing the display:block;.. the important part is to make sure that images have no margin ( outer padding ).. but, browsers ( particularly Firefox ) seem to make their own rules for the initial vertical spacing/line height/baseline/etc for text, and images are as specified, inline, thus subject to 'text rules' for placement.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

It isn't accessible for users who use such things as screenreaders

Screenreaders work better, ( i.e. more intuitively and standardized ), with tables than they do with some div layouts that force table-like display using floating/positioning, or with div layouts that want to order markup weirdly for the purpose of upping search engine rankings. It's an old myth that screenreaders fail with tables; more modern readers are very capable of reading tables, whether they be used for layout or pure tabular data.
Order of markup and correct use of 'special tags' is more important than the block tags used in markup. Search engines and screenreaders alike care little for table/div/span... all are at best semantically meaningless. 'h1', 'h2', 'title' should be important, as is 'a' and others.

It isn't just about tables: it is about using ANY html for layout purposes. xHTML should be used just for content and CSS for layout. It's that simple.

Great in theory. Not so great in practice. XHTML defines a series of tags, the purpose of most of them is layout and presentation. If you really only care about 'semantics', use plain XML and style that with CSS; you might have compatibility problems for the moment since only the latest browsers support XML pages.. and you need the latest CSS standard to be well implemented for it to be useful for anything non-trivial.. but I guess, any 'web developer worth their salt' isn't as bothered about compatilibity and what they can actually …

GreenDay2001 commented: very well said buddy! :) +4
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Yep. Change the code to:

print "<script type=\"text/javascript\">window.opener.location.reload(); </script>";

or

print "<script type='text/javascript'>window.opener.location.reload(); </script>";

If you don't escape the quotes within a string; the parser will think that the string ends early. i.e, it will get to
"<script type=" and then get confused. In this context, putting a \ character means 'ignore the next character', and using single quotes inside the string rather than double quotes stops the parser thinking that your inner-string quotes are end-of-string quotes..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Coding 'for' any browser is as easy as coding for any other browser; once you learn the discrepancies of said browser. The standard is stubborn because it's a standard...! As a designer; you don't have to adhere if you don't wish to.

It's best to only use the subset of a given standard that you know is interpreted identically by all popular UAs at this moment in time. This approach saves time and effort in the long run. Validation isn't really relevant, but it's something to aim for with every page. Regardless; you get most of the benefits of standardization without validation - if you break your doctype's rules, your code is still treated as being in that doctype; and most browsers are forgiving of all but the most heinous of markup crimes.

Anyway, the latest versions of popular browsers DO conform quite well to the current W3C standards; and, if anything, the standard(s) aren't strict enough; because there appears to be room for interpretation of certain things.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Are you escaping the quotes ( " ) ?

should be <script type=\"text/javascript\">window.opener.location.reload(); </script> - if you're putting it in a doublequoted sring; which it appears you are, looking at the last 2 characters..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

something like:

<script type="text/javascript">
<!--
onload=function() {

var divh = document.getElementById('pageContent').offsetHeight;
var target = document.getElementById('flashOverlay');
target.style.height = ( divh + 460 ) + "px";
}
//-->
</script>
MattEvans 473 Veteran Poster Team Colleague Featured Poster

The first and second and third documents are equivalent; only in terms of the hierachal relationship between nodes. They are not by any means equal, and depending on the actual XML language they belong to, might not be considered equivalent semantically; nor are they necessarily equivalent in terms of hierachy if nodes are considered instances of something as opposed to types of something. That is, you might be saying, in the first case, that the X's in A are constituent parts of some single 'definition' of A, whereas in the second case, you might be saying that each X within an A or B is a unique X 'instance' within some unique A or B 'instance'. It depends on the XML language or representation, but in most XML languages I've used, the treatment of nodes is as instances, and the order of nodes that are in a 'sibling level' sequence is considered to some degree; so, the first, second and third examples would certainly not be considered equivelant on any meaningful level in a language like say, XHTML or XSLT.

In short, if you're authoring the XML dialect, it's up to you; it's merely a design decision. If you're working within the bounds of an existing dialect, you have to consult the specification of the dialect, because there's no way you can assume any level of equivalence.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

There's probably a solution to the specific problem in your code that's causing the error message. But it's an oft-encountered message and doesn't indicate anything by itself; just that a dereferencing problem occured somewhere. Is it an error in clientside Javascript or server ASP code? Post code if you have some idea where the problem may be... but, please don't post masses of code. Does the error have a line number? if so, post that line, and the block that the line is in ( i.e. the function it's in )

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The image was/is a fullsize screenshot of a website that looks wierd. When I viewed the uploaded image as hosted here, the top inch was correct, then half an inch of randomly coloured distortion, then nothing. The screenshot I put in this thread shows it exactly how I saw it. I could post the original again for comparison.. but that'd be the third time.. and it really is quite an ugly picture.

What I see when I view the PNG ( first ) image has changed now. Now I see about half of the image before it turns into distortion. No change with the JPG.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

No, certainly not.. I'm guessing you're not seeing it, which would suggest it's not a real problem.. but it's only happening when viewing those two images.

I hesitate to post another screenshot, but, here goes..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

As title, I uploaded an image here: http://www.daniweb.com/forums/thread91317.html, as a PNG. Looks ok on preview, but, checked it in fullscreen view, and it looks strange, only 10% of the image is visible, the rest is messed up: http://www.daniweb.com/forums/attachment.php?attachmentid=4191&d=1191368633.

Uploaded again, thinking it might be a result of compression, as a JPG this time; only about 30% of the image is visible; http://www.daniweb.com/forums/attachment.php?attachmentid=4192&d=1191369391.

Not sure if it's just me seeing this, if so, apologize for posting the image twice, and this message. Might also be a problem with the image(s), I suppose.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm. That uploaded image got messed up somehow, preview is ok, fullsize view is only about 15% of the image visible, then noise/distortion, then blank.. It was a 256 colour PNG.. maybe that did it. Uploading a jpg aswell.. ignore this one if the last one worked for you.

EDIT: Ha. That one's cut in half on fullsize view aswell, I dunno.

I'm sure you understand what I'm saying though, and it doesn't really need a picture to support it. The text size increase within Firefox itself is bad enough, and I think that it could be even worse visually if an operating system font size setting was being respected, half heartedly, by Firefox.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

She seems to have massive fonts on her window title frames, and on the text of the page itself. Look at the size of font for the title bar on the Firefox window. I'm gonna go out on a limb here, and assume that she has some need or desire to have larger than usual fonts. I'm also gonna assume that she uses Firefox's god-awful increase/decrease text size setting; which is like a poor-mans zoom in/out OR she uses Windows configuration to increase font size in all windows.

Result; your text size increases, everything which relies on text size /placement gets misplaced. Can be fixed, but it involves total redesign with this in mind.

It looks even worse for me, with only a moderate increase in text size under FF.. Well I say moderate.. it jumps between 'slightly large' and 'enormous' with about two clicks.. It's an awful feature, and it messes up anything but plaintext.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

How are you drawing the sphere; are you generating the vertices and texture coordinates manually? What is the projection method of the world texture you're using? A projection like this is easy to map: ( http://arstechnica.com/reviews/4q00/macosx-pb1/images/earth-map-huge.jpg ), there are other projection types though.. Some of them are easy, some of them not so easy.

You say you're having some problems with some of the coords, that implies to me that you've got it working for the most part, what exactly are the problems though? Is it mostly textured correctly, but with one line of faces where the texture seems really dense ( possibly across the point where the texture joins between 0 and 1 where it 'should' horizontally wrap in texture space )...? I had that problem myself for a while, in OpenGL. Turns out it was because I was re-using point structures, where the vertex would be shared but the texcoord isn't always shared, and that was causing the texture to wrap between 1-dx and 0... which meant I got a whole 0 to ~1 texture segment, backwards, within one column of faces... Easy to solve; double up the last column of vertices so that 1-dx spans to 1; or treat every compound point as unique..

Anyway, be a bit more specific, and I can try and be more helpful.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Couple of questions from me...

(Me.ClientSize.Width - Me.ClientSize.Width)

and

(Me.ClientSize.Height - Me.ClientSize.Height)

both of these subexpressions will surely always evaluate to 0 right? They seem totally unecessary.. You have a missing closing bracket somewhere.. also, you're incrementing the loop variables x and y manually. don't do this. so, take out the statements x += 1 and y += 1. That should fix the problem with less than 11 tiles across the x and y.. as for the gaps between the tiles... are you sure that the units in the method you're using and the units you're measuring the image in are the same? I would have expected that pixels would be used as units in the draw method, but, the MSDN site for this method gets confusing, talking about 'physical width' and 'pixel width', and doesn't specifically mention the units expected for x/y...

http://msdn2.microsoft.com/en-us/library/93c57cby.aspx

So.. Just to try it out, and see if it is a problem with units, try this please:

Private Sub Face_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
    For y = 0 To 10
        For x = 0 To 10
            'Using another flavour of this function, this time providing width and height explicitly, and assuming that the units will be the same for placement as they are for size
            e.Graphics.DrawImage(New Bitmap("grass.jpg"), ( 35 * x ), ( 35 * y ), 35, 35 )
        Next
    Next 
End Sub

Report back any changes..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

would altering body onload to a built in window.onload instead work?

By the way, it should be document.body.onload... And in tests, it only works if you register that event handler after the starting body tag has been processed.. like:

.... Rest of site ^^^^
    <img src="http://www.link.cs.cmu.edu/splay/tree5.jpg" alt="user posted image"/>
    <img src="http://www.link.cs.cmu.edu/splay/tree5.jpg" alt="user posted image"/>
    
    <script type="text/javascript">
    document.body.onload = "ResizeThem( );";
    </script>
</body>
</html>

That's erring on the side of 'really bad practice'.. You can't just call the function from script in the head section though; none of the objects will exist..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

If by builtin you mean registered as an event handler using javascript to do the 'registering'.. yes, it will work. Consider fixing the code though, somewhere you're dropping another <body> tag in there, and that's a big error. I don't imagine that the second <body> tag gets processed atall, and that's the one with the event.

Even if you can't lose the JS dependance, you should still be able to address and affect (in CSS) the images generated from the BBcode, CSS doesn't care how the images are generated.. A CSS selector that should address every image within a post on your site:

div.postcolor img
{
/* CSS here */
}

Looking at your site again though, the images don't seem to have a specific class.. You CAN collect them indirectly based on the assumption that they're always in DIVs with class 'postcolor'... But try and get it working on the specific ALT first, since your posted images all seem to have that ALT anyway..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

can we do away with the requirement for an alt attribute altogether? so any image posted in img tags will work?
Its still not resizing, see here

http://testmods.5.forumer.com/index.php?showtopic=158&st=0&#entry578

it seems the alt tag is added afterwards?

can we make it focus on images posted in [img] tags?

In your source, you have 2 <body> open tags. I'm not gonna look much further than that, sorry.

Look at the JS code for the image resizing, it's pretty easy to see the part that checks the 'alt' of the images. You could change that to check for a classname instead.. that's something that the user never sees, and your forum software may already be using a certain class for the <img> tags that it generates from BBcode

To be honest, you can ditch the JS dependancy entirely, and the dodgy delayed scaling entirely; if you rely on a bit of new-ish CSS, and the target="_blank" attribute.. ( Before any hippy tirades, I know 'target' is deprecated in XHTML 1.0 strict, but, Inny's site isn't XHTML 1.0 strict ). I'm not sure though, whether max-height/max-width is supported on older browsers, I've not had much luck with it in the past, but it works for me right now... If you don't mind assuming that the image is always going to be roughly square, you can just set img.thumbnail{ width: 300px; } , but, that's a big assumption. ( EDIT: whatever you do though, don't set width AND …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You know it'll only work for images that have an alt attribute of 'user posted image' right?

Also, you're not saving a lot by using this code; better, serverside, means of doing this actually decrease the size of the thumbnail image, because that saves on download bandwidth.. this code will download fullsize pictures then put them into little img boxes to make them visually smaller.. but, not smaller in terms of the download itself.

This works for me, I tidied it up abit but it does almost the same things, I changed a bit of the code so that it uses those w and h variables; they weren't being used before. This way, you don't have any need to call parseInt more than twice:

<html>
<head>
<script type="text/javascript">
function ResizeThem()
{
  var maxheight = 300;
  var maxwidth = 300;
  var imgs = document.getElementsByTagName("img");
  for ( var p = 0; p < imgs.length; p++ )
  {
    if ( imgs[p].getAttribute("alt") == "user posted image" )
    {
      var w = parseInt( imgs[p].width );
      var h = parseInt( imgs[p].height );
      if ( w > maxwidth )
      {
        imgs[p].style.cursor = "pointer";
        imgs[p].onclick = function( )
        {
          var iw = window.open ( this.src, 'ImageViewer','resizable=1' );
          iw.focus();
        };
        h = ( maxwidth / w ) * h;
        w = maxwidth;
        imgs[p].height = h;
        imgs[p].width = w;
      }
      if ( h > maxheight )
      {
        imgs[p].style.cursor="pointer";
        imgs[p].onclick = function( )
        { 
          var iw = window.open ( this.src, 'ImageViewer','resizable=1' );
          iw.focus( );
        };
        imgs[p].width = ( …
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Er.. yeah. Use the sure-fire, well tested, unecessary to even implement behaviour of a standard input element.

If you MUST reimplement the behaviour of an input yourself, reimplement it entirely, and don't use the standard input as a base; in that way, you can easily control and query the cursor position yourself, and then you know where to start deleting from. Hard work? relatively.

If you MUST use the standard input and you MUST use your own code to do backspace/delete, you'll need to use crazy code like this:
http://weetbixthecat.com/blog/2006/getting-and-setting-the-cursor-position-in-an-input/
to get hold of the current position of the cursor. It's crazy because, in internet explorer, you need to calculate a content length offset from the beggining of the page to the beggining of the input, in order to work out exactly where the cursor is relative to the input itself. Then, you can use that offset to determine from where to start removing text.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Quite alot if you want the windows forms to actually open from a page or link on a user's web browser. You'd have to either; convert the VB standalone application to an ActiveX application, and use that on the webpage, but be warned, clientside ActiveX only works on Microsoft's web browsers and VB only really works under Windows. Still, you could convert the application in that way very simply; since you could reuse pretty much all the code with a few changes at the entry point of the application; and then add it to webpages with a tiny bit of ( MS only ) HTML code.

http://www.geocities.com/SiliconValley/Horizon/3950/ActiveX.htm
[this is for the old VB; but I imagine the same principles apply today.. although doing the necessary things might require different actions to be taken]

Alternatively, you could rewrite the application as a Java applet, Java is more widely supported than VB, and can do much the same form-based things as VB; it'd be a bit of work, but, IMHO it's the best option here. Alternatively, write it again in Javascript; although, it'd be more difficult to rewrite most VB apps in JS than it would to rewrite them in Java, and JS has no 'forms' framework, at least not for the kind of forms you're talking about. Alternatively, allow the user to download your application; and run it on their desktop. There's nothing to stop you making HTTP connections from your app, which would give you …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

In light of X(ML)HTML superceeding (SGML)HTML in most applications; I propose that the old-style unterminated <daniweb> tag, daniweb's logo, have an appropriate end tag. See attached.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well; it's good to know that it will behave like this consistantly. I can't actually use it in the situation with the arbitrary number of numbers; since, as I mentioned, I forgot that I have to deal with blocks of numbers with slashes et al, but, I'm gonna use it for the fixed count space delimited data, it's very fast compared to iostreams, and can detect errors like missing numbers/spaces. My pullfloat is like this now.. neater, less redundant, seems to work correctly.

#include <stdlib.h>
#include <stdio.h>

int pullfloat( char ** p_str, double & f )
{
  char * str = *p_str;
  char ** check = &str;
  f = strtod( str, p_str );
  return( *check != *p_str );
}

int main( void )
{
  char * str = "1 2 3 456.0002 789       76.32      99999.888      3662 \n 1535 \t\t \n 1159 1593 1.24e+2 ";
  char ** p_str = &str;
  double f = 0.0;
  while( pullfloat( p_str, f ) ) printf( "Float: %f\n", f );
}

$289.00 USD for the standard documents? That's expensive for something like that..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well.. I thought, perhaps, an implementation of strtod might use that pointer to look ahead through the string, in which case, it would get moved forwards even if a number wasn't 'consumed'... Thinking about it right now though, I don't think that's likely, it would be quite silly if that was the case.

Surely any individual apect of the whole behaviour is only guaranteed to work on multiple machines identically if that part of the behaviour's actually defined in the standard? I mean, if it wasn't explicitly in the standard that 'the pointer will be unchanged on failure', implementors of the cstdlib library could be free to implement the internal workings of the function it in their own way [ like the silly way above for example ]; or, is the standard totally rigid - to the level of a mandate for the code in each function rather than a specification for each function?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Actually, no change is indication that it has failed; since it wouldn't be able to convert a lengthless string to a number.. If it pointed the pointer to something random on failure, that wouldn't be useful.. but I don't think it's very likely to do that...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I've seen that page, I have it open in a tab already =P The fact it doesn't mention a change is why I was wondering.

The problem with writing a small program to test it out, is that a positive result won't necessarily tell me that it is well defined - it might work on my machine, but not work elsewhere. The best I could prove is that it doesn't work atall... Still; I suppose that's something. I will give it a try, but if it does work, unless I can test it on other machines, or see it in use, or see some document saying it will do that always, I won't feel happy using it.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Actually, ignore that. I realised it's not as simple as just looking at whitespace, because in the parts where there IS an arbitrary number of numbers, they are delimited like this:

1/1/1 2/2/4 3/6/4 8/0/1

or sometimes even like this:

1//3 2//4 5//7 etc..

back to the drawing board.. o_O

EDIT: it would still be useful to know if the value of the char ** passed in as the last argument of strtod is defined if a number can't be extracted...?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I'm working on a C++ module to read wavefront OBJ files; these are text files with many lines with either 2, 3, or more integer or floating point numbers; separated by spaces or tabs. It's not always possible to know how many numbers there will be in a single line without processing it. The C++ stringstream >> float technique is well suited to this, but it is painfully slow compared to the atof; strtod, possibly even sscanf methods ( the atof method below, even with extra whitespace processing, is 5x faster than stringstream >> float ) ... my problem is, im having to use the 'extra whitespace processing', because none of the C methods seem to show any good indication of whether a number was read, and if so, how much of the string was converted.

My question is mainly about strtod; since it's the only one of those that looks like it could do this, because it lets one pass in a pointer to a char pointer, and that's supposed to point to the 'rest' of the string after a number's been extracted.. however, what happens when it fails? is the value of the char ** passed in as the last argument defined after a failed operation?

I want to be able to say something like:

if( ! pullfloat(str, x ) ) //error;
if( ! pullfloat(str, y ) ) //error;
if( ! pullfloat(str, z ) ) //error;

but also something like:

while( pullfloat(str, f ) …
MattEvans 473 Veteran Poster Team Colleague Featured Poster

www.google.[insert tld] shouldn't be able to find a 'totally' intranet server, since intranets, by definition, are not connected to nor accessible from the Internet, nor subsequently 'the web'. If a certain intranet is accesible (publicly or otherwise) from the Internet, that's OK, and that doesn't make it 'not an intranet', but regardless, no public, or infact any, connection to the Internet is implied.

http://en.wikipedia.org/wiki/Intranet
http://en.wikipedia.org/wiki/Internet
http://en.wikipedia.org/wiki/World_Wide_Web
http://en.wikipedia.org/wiki/Google_search

Read the first paragraph on every page..