Jump to content

Shinryuu

Moderators
  • Posts

    1,025
  • Joined

  • Last visited

  • Days Won

    40

Posts posted by Shinryuu

  1. So I have an odd request, if djbob doesn't mind I'd like him or whoever manages the cPanel login page to give the login button a name or id, preferrably id. I made an automation script in Ruby that opens IE, moves to the cPanel login page, and submits it with the proper info. Problem is it fills the user and pass inputs but doesn't click the button because the getElementByClass method isn't supported, I tried, and so in attempting to run this line:

     

    button = doc.getElementByClass("input-button")
    

     

    the script crashes. The reasons for the script are: a) I can :D b ) I don't like typing passwords, I get paranoid in public and c) it's easier to remember passwords when they are in programs heh.

  2. XML and HTML are similar in that you have tags with attributes, values, and tags are embedded in each other, the difference is that in HTML your stuck with a set amount of tags, in XML you make them up as you and keep track of them in your own DTD. I can explain a Wall definition as the code is expecting it to show you how to backtrace the XML structure.

    var walls = document.getElementsByTagName('Wall');
    for(var i = walls.length - 1; i &--#62;= 0; --i) {
    	var str = '';
    	var points = walls[i].getElementsByTagName('Point');
    	for(var j = points.length - 1; j &--#62;= 0; --j) {
    			var x = parseFloat(points[j].getAttribute('x'));
    			var y = -parseFloat(points[j].getAttribute('y'));
    			str += x + ',' + y + ' ';
    			if(minx &--#62; x) minx = x;
    			if(maxx &--#60; x) maxx = x;
    			if(miny &--#62; y) miny = y;
    			if(maxy &--#60; y) maxy = y;
    	}
    	var polyline = document.createElementNS('http://www.w3.org/2000/svg', 'polyline');
    	polyline.setAttribute('points', str);
    	polyline.setAttribute('stroke', 'black');
    	polyline.setAttribute('stroke-width', stroke);
    	polyline.setAttribute('fill', 'none');
    	svg.appendChild(polyline);
    }
    

    The first line creates an array of walls by scanning for &<Wall> tags, <Wall></Wall>.

    The fourth line creates a point array and expects x and y attributes in the tag in the form of <Point x= y=/>.

    After the inner loop finishes running you have the code making polyline elements based on w3c's 2000 svg DTD.

    Because the point loop is inside the wall loop you know the point tags are embedded in wall tags

     

    <Wall>

    <Point x= y= />

    </Wall>

     

    I'm not a javascript programmer, but it's usually pretty straightforward.

  3. Personally I prefer internal stylesheets, but if you want the same CSS to be used across several pages use ICE's link method, for an internal stylesheet add <style> </style> tags in the <head> section of your page and put your style rules in the style section. For example:

     

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    p { color: #ca8; background-color: #000;}
    </style>
    </head>
    <body>
    <p>Hello World!</p>
    </body>
    </html>
    

  4. Hiya guys, my name's Shin, I self-learned Ruby, C++, and C# but recently started a computer tech program in college. In my first semester I learned HTML/CSS, was forced to remember why I liked C# over C++ and had to take my C# .NET knowledge and transfer it all to VB. But I digress, part of my web design course involved a semester project of making a rather simple sample site, I slacked off and never got around to it so I figured I'd one-up the project by making actual sites [nearly 4 months later].

×
×
  • Create New...