Jump to content

davej

Moderator
  • Posts

    3,988
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by davej

  1. I am struggling a little here. I wanted both border-collapse and padding, but that does not seem to be possible.
  2. I would think that all you could do is box it up and make it into a figure and then float text around it.<!DOCTYPE HTML><html><head><style>.cent {text-align: center;border: 1px solid #888;background-color: #ddd;margin-right: 15px;padding: 50px 50px;float: left;border-collapse: collapse;}.title {text-align: center;background-color: #fff;border: 1px solid #888;font-size: small;font-style: italic;}</style></head><body><p>We then multiply and then divide and then multiply and then add and then multiply and then add and then divide and then add. Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide. Then we multiply and then we add and then we divide.</p><table class="cent"><tr><td>(3*2) + (4*3) + (2*4) + (3*3) + (4*1)<br/> ————————————————<br/>13</td><td> = 3 </td></tr><tr><td colspan="2" class="title">Figure 2-3</td></tr></table><p>We then multiply and then divide and then multiply and then add and then multiply and then add and then divide and then add. Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide. Then we multiply and then we add and then we divide.</p><p>We then multiply and then divide and then multiply and then add and then multiply and then add and then divide and then add. Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide. Then we multiply and then we add and then we divide.</p></body></html>
  3. davej

    What is an SRO ?

    Saw this question: http://answers.yahoo.com/question/index;_ylt=As9MLaY3xXy_0H2IYamFGRjsy6IX;_ylv=3?qid=20121226205109AAbgNHF
  4. Here is a sample. I think the rule I have been having trouble with is that apparently the "starting circle" must be positioned inside the area of the "ending circle." I thought I was having trouble because of the narrowness of the rectangle, but the rectangle size and proportions are quite irrelevant. <!DOCTYPE html><html lang="en"><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Radial Gradient by Dave</title><style>#canvas1 { border: 1px solid #000;}</style><script src="jonerror.js"></script><script>function draw1() {var canvas = $('canvas1');var context = canvas.getContext('2d');context.clearRect(0, 0, canvas.width, canvas.height);var x0 = $('x0').value;var y0 = $('y0').value;var r0 = $('r0').value;var x1 = $('x1').value;var y1 = $('y1').value;var r1 = $('r1').value;var grad = context.createRadialGradient(x0, y0, r0, x1, y1, r1);grad.addColorStop(0, '#0ff'); // light blue-greengrad.addColorStop(1, '#003'); // dark bluecontext.fillStyle = grad;var xu = $('xupper').value;var yu = $('yupper').value;var w = $('width').value;var h = $('height').value;context.fillRect(xu, yu, w, h); //xupperleft,yupperleft,width,heightcontext.closePath();}function $(id) {return document.getElementById(id);}window.onload = function() {$('btndraw').onclick = draw1;}</script></head><body><canvas id="canvas1" width="800" height="600">HTML5 Canvas is not supported</canvas><br/>X:<input type="number" id="xupper" value="100" step="25"/>Y:<input type="number" id="yupper"value="100" step="25"/>W:<input type="number" id="width" value="600" step="25"/>H:<input type="number" id="height" value="400" step="25"/><input type="button" id="btndraw" value="Draw"/><br/>x-coordinate of the starting circle of the gradient:<input type="number" id="x0" value="300" step="25" /><br/>y-coordinate of the starting circle of the gradient:<input type="number" id="y0" value="300" step="25" /><br/>radius of the starting circle:<input type="number" id="r0" value="2" step="1" /><br/>x-coordinate of the ending circle of the gradient:<input type="number" id="x1" value="200" step="25" /><br/>y-coordinate of the ending circle of the gradient:<input type="number" id="y1" value="200" step="25" /><br/>radius of the ending circle:<input type="number" id="r1" value="200" step="10" /></body></html>
  5. davej

    Valid number?

    I thought that was the whole point of the Number() function? Oh, I think I solved it using isNaN() http://www.w3schools.com/jsref/jsref_isnan.asp
  6. I read about the HTML5 database feature and thought it was pretty nifty -- then I read that it had been essentially abandoned. http://www.w3.org/TR/webdatabase/ Now I read about the "Indexed database" and wonder how it is different. Has anyone here used it? http://www.w3.org/TR/IndexedDB/ Thanks
  7. davej

    Valid number?

    I'm having a problem in Chrome with some navigation values causing exceptions to be thrown when .toFixed is used on them. I am now trying to use... temp = position.coords....if (temp != null && Number(temp) != NaN)data += temp.toFixed(8); But this isn't working 100% either, at least not in Firefox. What is the best way to screen for invalid numbers?
  8. Yes, I guess it is time to try the obvious approach.
  9. davej

    ABC News Photos

    I get annoying erratic results.
  10. davej

    Background images

    So I can trust that background repeat will always be turned on by default? Seems like I have needed to use it occasionally but rarely.
  11. http://abcnews.go.com/News/fullpage?id=18005885 This doesn't work well for me.
  12. davej

    SQL Injection

    The risk is accepting any input from the outside and using it to create a SQL query. Even cookies and hidden fields can be easily edited by a hacker. The two primary defenses are to sanitize all external inputs with a regex (and a length limiter for XSS) and to use parameterized queries.
  13. I'm still not feeling too certain about the semi-optional almost interchangeable use of beginPath() and closePath()
  14. davej

    Browser checks?

    Speaking of Linux, why does it seem to come with a stupid version of Firefox? I guess I'm thinking of Ubuntu.
  15. Yes, I skimmed through Amazon's AWS service options and it seems that it is all based on vmware virtualization using server clusters. The AWS cost seems to be difficult to estimate since the various pricing schemes are very confusing. I guess ordinary VPS is something like US$50-$75 per month. http://aws.amazon.com/ec2/http://www.vmware.com I had thought the Amazon cost was something like US$175/month and up but this calculator seems to say it can be much less than that although I'm not sure how you can know how many "hours" to enter. http://calculator.s3.amazonaws.com/calc5.html
  16. davej

    Background images

    Why is it that I normally do not need to specify all of the background image properties such as background-repeat?
  17. Yes, and I'm just curious what they might be. Can you formulate some nice rules?
  18. The specificity calculation panel is one of the more useful features in Dreamweaver.
  19. <!DOCTYPE HTML><html><head><style>.cent {text-align: center;}</style></head><body><table class="cent"><tr><td>(3*2) + (4*3) + (2*4) + (3*3) + (4*1)<br/>————————————————<br/>13</td><td> = 3</td></tr></table></body></html> Wow, the code editor eats nbsp's. Or tableless... <!DOCTYPE HTML><html><head><style>.cent {text-align: center;float: left;}</style></head><body><div class="cent">(3*2) + (4*3) + (2*4) + (3*3) + (4*1)<br/>————————————————<br/>13</div><div><br/> = 3</div></body></html>
  20. I guess you mean you could not find a long line here? http://www.w3schools...ref_symbols.asp But of course you can. It is simply — inserted as many times as is needed.
  21. davej

    DJ centre script

    It depends on whether your website already allows logins. If it does then you should post a link to your website here. If it doesn't then you should probably post this question to the PHP forum.
  22. So is the 'cloud' a different animal than the typical web hosting service?
  23. The browser knows the path to the file. It just isn't allowed to reveal it. I would have thought that the correct way to deal with that would be to have a file handle. If they didn't provide a file handle then I guess you have only one opportunity to read the file -- unless perhaps you use AJAX so that you don't reload the page.
  24. Uh, do you mean division? That simply says (3*2 + 4*3 + 2*4 + 3*3 + 4*1) / 13 It is just clearer to draw a horizontal line when you are working with fractions, but writing code doesn't offer that luxury unless you are working in a math-specific program such as Mathematica.
  25. I think it looks quite spiffy, but why doesn't it seem to center in the window? It creates too much left margin.
×
×
  • Create New...