Search Results

Search found 15 results on 1 pages for 'bodie2003'.

Page 1/1 | 1 

  • Setup my domain at Whois.com as nameservers for a Dedicated Server with Kloxo

    - by BoDiE2003
    Hello, this is my first time at ServerFault, I'm a stackoverflow user. I'm faceing the next problem and may be its me, but I can't find proper guides to set up a domain and nameservers for a dedicated box. I have a domain, at whois.com, and a Dedicated server at Reliable Hosting Services, the server has 5 IPs, I know that I need 2 of them for the nameservers. Right now, my domain at whois.com is using nsX.whois.com nameservers and it has 2 child nameservers: ns1.mydomain.com & ns2.mydomain.com pointing to those 2 IPs from my Server. Whats next? I still cannot set that domain as my main server domain since it says: To map an IP to a domain, the domain must ping to the same IP, otherwise, the domain will stop working. The domain you are trying to map this IP to, doesn't resolve back to the IP, and so it cannot be set as the default domain for the IP. Well and I'm stuck on those steps, whats next to have my nameservers working and my main domain assigned to my server? Thank you very much and happy new year!!

    Read the article

  • Problems forwarding port 3306 on iptables with CentOS

    - by BoDiE2003
    Im trying to add a forward to the mysql server at 200.58.126.52 to allow the access from 200.58.125.39, and Im using the following rules (its my whole iptables of the VPS of my hosting). I can connect locally at the server that holds the mysql service as localhost, but not from outside. Can someone check if the following rules are fine? Thank you # Firewall configuration written by system-config-securitylevel # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -p 50 -j ACCEPT -A RH-Firewall-1-INPUT -p 51 -j ACCEPT -A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s 200.58.125.39 --dport 3306 -j ACCEPT -A INPUT -p tcp -s 200.58.125.39 --sport 1024:65535 -d localhost --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT -A OUTPUT -p tcp -s localhost --sport 3306 -d 200.58.125.39 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT COMMIT And this is the output of the connection trial. [root@qwhosti /home/qwhosti/public_html/admin/config] # mysql -u user_db -p -h 200.58.126.52 Enter password: ERROR 2003 (HY000): Can't connect to MySQL server on '200.58.126.52' (113)

    Read the article

  • Javascript: addClassName if input is checked and removeClassName if it was un-checked

    - by BoDiE2003
    Im trying to select all the li tags of the document and check if it hasClassName('yes') so if it has, it will remove it. But im having a TypeError: Object [object HTMLLIElement], has no method 'hasClassName' error. This is the DOM method: document.observe("dom:loaded", function() { $(document.body).select('input').each(function(element) { element.observe('click', function() { init(); }); init(); }); }); The previous code will take the init fuction and check the if there are checked inputs and add them the 'yes' class name, but if I un-check those inputs, the class remains. This is the funcion that Im trying to do dynamic (add and remove class 'yes'); function init() { $(document.body).select('input').each(function(element) { if (element.checked) { element.up('li').addClassName('yes'); } if ($(document.body).select('li').hasClassName('yes')) { element.removeClassName('yes'); } }) } Can you help me solving the last part of this function, so the removeclassname method will work? Thank you

    Read the article

  • Javascript: Dynamic Check box (Fieldset with Father/Child Checkboxes)

    - by BoDiE2003
    I have a problem here, when I select any of the 'father' checkboxes all the child checkboxes are getting enabled or disabled. So I need each father checkbox to affect it own child fieldset. Could someone help me with this. Thank you <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>toggle disabled</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> .cssDisabled { color: #ccc; } </style> <script src="http://prototypejs.org/assets/2009/8/31/prototype.js" type="text/javascript"> </script> <script type="text/javascript"> Event.observe(window, 'load', function(){ // for all items in the group_first class $$('.father').each(function(chk1){ // watch for clicks chk1.observe('click', function(evt){ dynamicCheckbox(); }); dynamicCheckbox(); }); }); function dynamicCheckbox (){ // count how many of group_first are checked, // doEnable true if any are checked var doEnable = ($$('.father:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label $$('.child').each(function(item){ if (doEnable) { item.enable().up('label').removeClassName('cssDisabled'); } else { item.disable().up('label').addClassName('cssDisabled'); } }); }; </script> </head> <body> <fieldset> <legend>First Group</legend> <label><input type="checkbox" value="1" class="father" />Check box 1</label><br /> <label><input type="checkbox" value="2" class="father" checked/>Check box 2</label> </fieldset> <fieldset> <legend>Second Group</legend> <label class="cssDisabled"><input type="checkbox" value="x" class="child" disabled="disabled" />Check box x</label><br /> <label class="cssDisabled"><input type="checkbox" value="y" class="child" disabled="disabled" />Check box y</label><br /> <label class="cssDisabled"><input type="checkbox" value="z" class="child" disabled="disabled" />Check box z</label> </fieldset> <fieldset> <legend>First Group</legend> <label><input type="checkbox" value="3" class="father" />Check box 1</label><br /> </fieldset> <fieldset> <legend>Second Group</legend> <label class="cssDisabled"><input type="checkbox" value="x" class="child" disabled="disabled" />Check box x</label><br /> <label class="cssDisabled"><input type="checkbox" value="y" class="child" disabled="disabled" />Check box y</label><br /> <label class="cssDisabled"><input type="checkbox" value="z" class="child" disabled="disabled" />Check box z</label> </fieldset> </body> </html>

    Read the article

  • Java: Detecting image format, resize (scale) and save as JPEG

    - by BoDiE2003
    This is the code I have, it actually works, not perfectly but it does, the problem is that the resized thumbnails are not pasting on the white Drawn rectangle, breaking the images aspect ratio, here is the code, could someone suggest me a fix for it, please? Thank you import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image; import java.awt.RenderingHints; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import javax.imageio.ImageIO; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class ImageScalerImageIoImpl implements ImageScaler { private static final String OUTPUT_FORMAT_ID = "jpeg"; // Re-scaling image public byte[] scaleImage(byte[] originalImage, int targetWidth, int targetHeight) { try { InputStream imageStream = new BufferedInputStream( new ByteArrayInputStream(originalImage)); Image image = (Image) ImageIO.read(imageStream); int thumbWidth = targetWidth; int thumbHeight = targetHeight; // Make sure the aspect ratio is maintained, so the image is not skewed double thumbRatio = (double)thumbWidth / (double)thumbHeight; int imageWidth = image.getWidth(null); int imageHeight = image.getHeight(null); double imageRatio = (double)imageWidth / (double)imageHeight; if (thumbRatio < imageRatio) { thumbHeight = (int)(thumbWidth / imageRatio); } else { thumbWidth = (int)(thumbHeight * imageRatio); } // Draw the scaled image BufferedImage thumbImage = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_RGB); System.out.println("Thumb width Buffered: " + thumbWidth + " || Thumb height Buffered: " + thumbHeight); Graphics2D graphics2D = thumbImage.createGraphics(); // Use of BILNEAR filtering to enable smooth scaling graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); // graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null); // White Background graphics2D.setPaint(Color.WHITE); graphics2D.fill(new Rectangle2D.Double(0, 0, targetWidth, targetHeight)); graphics2D.fillRect(0, 0, targetWidth, targetHeight); System.out.println("Target width: " + targetWidth + " || Target height: " + targetHeight); // insert the resized thumbnail between X and Y of the image graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null); System.out.println("Thumb width: " + thumbWidth + " || Thumb height: " + thumbHeight); // Write the scaled image to the outputstream ByteArrayOutputStream out = new ByteArrayOutputStream(); ImageIO.write(thumbImage, OUTPUT_FORMAT_ID, out); return out.toByteArray(); } catch (IOException ioe) { throw new ImageResizingException(ioe); } } }

    Read the article

  • Javascript: Check if checkboxes are selected on page load and add a class to parent html li

    - by BoDiE2003
    Im looking a way to do it with prototype, this js, needs to loads with the page and interate over all the elements (inputs - checkboxes, in this case) with the given id and assign a class to its parent <li></li> The JS is: function changeSelectionStyle(id) { var inputId = id.substr(0,id.length-2); if(document.getElementById(inputId).checked){document.getElementById(id).className = 'yes';} alert(document.getElementById(inputId).checked); /* * if(document.getElementById(id).className != 'yes'){ * document.getElementById(id).className = 'yes'; * } else{document.getElementById(id).className = '';} */ } And the HTML (piece of it) that interacts with this JS is: <li id="selectedAuthorities-4_1li"> <input type="checkbox" id="selectedAuthorities-4_1" name="selectedAuthorities" value="ROLE_ADD_COMMENT_TO_CV" checked="checked" onclick="changeSelectionStyle(this.id + 'li'); checkFatherSelection(this.id);"> <a href="#" onclick="document.getElementById('selectedAuthorities-4_1').click(); return false;"> Agregar comentario <samp><b></b>Permite agregar comentario en el detalle</samp> </a> </li> After iteration, checking is the checkbox is checked, it has to add the class="yes" to the <li id="selectedAuthorities-4_1li">

    Read the article

  • Javascript: Onload if checkbox is checked, change li class

    - by BoDiE2003
    I have this code on javascript side: function changeSelectionStyle(id) { if(document.getElementById(id).className != 'yes'){ document.getElementById(id).className = 'yes'; } else{document.getElementById(id).className = '';} } And this on html: <ul> <li id="selectedAuthorities-4_1li" class=""> <input type="checkbox" id="selectedAuthorities-4_1" name="selectedAuthorities" value="ROLE_ADD_COMMENT_TO_CV" checked="checked" onload="changeSelectionStyle(this.id + 'li');" onclick="changeSelectionStyle(this.id + 'li'); checkFatherSelection(this.id);"> <a href="#" onclick="document.getElementById('selectedAuthorities-4_1').click(); return false;"> Agregar comentario <samp><b></b>Permite agregar comentario en el detalle.</samp> </a> </li> Well what I cant get work is when the checkbox is selected, on load, the JS should check it, and assign class="yes" to the li, here: <li id="selectedAuthorities-4_1li" class=""> What should I add to my original JS function to make that possible. Note that li ids are not static, they are dynamic, the html li id is generated.

    Read the article

  • Javascript: Enable checkboxes list when a checkbox is checked (With Prototype)

    - by BoDiE2003
    Guys, Ive been using jquery to do this, but now I need to do it with Prototype and Im little confused due lack of documentation I have 2 lists of check boxes First List: Check box 1 Check box 2 Second list: Check box x check box y check box z I need the JS code, using prototype to work like this: Second list, remains disabled unless I check one of the checkboxes of the First List. Any suggestions, or help, please! Thankyou.

    Read the article

  • Java: Detect if image isGIF or isTIFF and convert to JPG

    - by BoDiE2003
    I have a Java website, now Ive build an uploader, the validation for JPG images is done and a way to save it into the server it is too. But now I need to create an utility class using isGIF and isTIFF validated them by byte[] and convert that byte[] to java.awt.Image to save as JPG So basically I need boolean isGIF(byte[]), boolean isTIFF(byte[]), java.awt.Image convertGIF(byte[]) and java.awt.Image convertTIFF(byte[]). But I have no idea how to do it, could someone help me please? Thank you!

    Read the article

  • Prototype: Enable checkboxes list of a specific checkbox is checked

    - by BoDiE2003
    Guys, Ive been using jquery to do this, but now I need to do it with Prototype and Im little confused due lack of documentation I have 2 lists of check boxes First List: Check box 1 Check box 2 Second list: Check box x check box y check box z I need the JS code, using prototype to work like this: Second list, remains disabled unless I check one of the checkboxes of the First List. Any suggestions, or help, please! Thankyou.

    Read the article

  • Java: Detecting image formate - resize (scale) and save as JPEG

    - by BoDiE2003
    This is the code I have, it actually works, not perfectly but it does, the problem is that the resized thumbnails are not pasting on the white Drawn rectangle, breaking the images aspect ratio, here is the code, could someone suggest me a fix for it, please? Thank you import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image; import java.awt.RenderingHints; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import javax.imageio.ImageIO; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class ImageScalerImageIoImpl implements ImageScaler { private static final String OUTPUT_FORMAT_ID = "jpeg"; // Re-scaling image public byte[] scaleImage(byte[] originalImage, int targetWidth, int targetHeight) { try { InputStream imageStream = new BufferedInputStream( new ByteArrayInputStream(originalImage)); Image image = (Image) ImageIO.read(imageStream); int thumbWidth = targetWidth; int thumbHeight = targetHeight; // Make sure the aspect ratio is maintained, so the image is not skewed double thumbRatio = (double)thumbWidth / (double)thumbHeight; int imageWidth = image.getWidth(null); int imageHeight = image.getHeight(null); double imageRatio = (double)imageWidth / (double)imageHeight; if (thumbRatio < imageRatio) { thumbHeight = (int)(thumbWidth / imageRatio); } else { thumbWidth = (int)(thumbHeight * imageRatio); } // Draw the scaled image BufferedImage thumbImage = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_RGB); System.out.println("Thumb width Buffered: " + thumbWidth + " || Thumb height Buffered: " + thumbHeight); Graphics2D graphics2D = thumbImage.createGraphics(); // Use of BILNEAR filtering to enable smooth scaling graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); // graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null); // White Background graphics2D.setPaint(Color.WHITE); graphics2D.fill(new Rectangle2D.Double(0, 0, targetWidth, targetHeight)); graphics2D.fillRect(0, 0, targetWidth, targetHeight); System.out.println("Target width: " + targetWidth + " || Target height: " + targetHeight); // insert the resized thumbnail between X and Y of the image graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null); System.out.println("Thumb width: " + thumbWidth + " || Thumb height: " + thumbHeight); // Write the scaled image to the outputstream ByteArrayOutputStream out = new ByteArrayOutputStream(); ImageIO.write(thumbImage, OUTPUT_FORMAT_ID, out); return out.toByteArray(); } catch (IOException ioe) { throw new ImageResizingException(ioe); } } }

    Read the article

  • Javascript: Make a static code, dynamic - List of inputs

    - by BoDiE2003
    I have this code, that checks some ids and enable others, the javascript is pretty clear about what it does, but since it corresponds to some specific id ranges, I cant do just a look until it finishes, but I'm looking a way to do this dynamic and save 40 lines of code (or more), since its not the best way. function loopGroup1() { var a = 0; do { $$('.selectedAuthorities-3_' + a).each(function(chk1) { // watch for clicks chk1.observe('click', function(evt) { dynamicCheckbox1(); }); dynamicCheckbox1(); }); a++; } while (a < 4); } function dynamicCheckbox1() { // count how many of group_first are checked, // doEnable true if any are checked var doEnable = ($$('.selectedAuthorities-3_0:checked').length > 0) ? true : false; var doEnable1 = ($$('.selectedAuthorities-3_1:checked').length > 0) ? true : false; var doEnable2 = ($$('.selectedAuthorities-3_2:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label var i = 0; do { $$('.selectedAuthorities-4_' + i).each(function(item) { if (doEnable || doEnable1 || doEnable2) { item.enable().up('li').removeClassName('cssDisabled'); } else { item.disable().up('li').addClassName('cssDisabled'); } }); i++; } while (i < 4); }; /* * * Loop Group 2 * * */ function loopGroup2() { var a = 0; do { $$('.selectedAuthorities-5_' + a).each(function(chk1) { // watch for clicks chk1.observe('click', function(evt) { dynamicCheckbox2(); }); dynamicCheckbox2(); }); a++; } while (a < 4); } function dynamicCheckbox2() { // count how many of group_first are checked, // doEnable true if any are checked var doEnable3 = ($$('.selectedAuthorities-5_0:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label var i = 0; do { $$('.selectedAuthorities-6_' + i).each(function(item) { if (doEnable3) { item.enable().up('li').removeClassName('cssDisabled'); } else { item.disable().up('li').addClassName('cssDisabled'); } }); i++; } while (i < 4); }; /* * * Loop Group 3 * * */ function loopGroup3() { var a = 0; do { $$('.selectedAuthorities-6_' + a).each(function(chk1) { // watch for clicks chk1.observe('click', function(evt) { dynamicCheckbox3(); }); dynamicCheckbox3(); }); a++; } while (a < 4); } function dynamicCheckbox3() { // count how many of group_first are checked, // doEnable true if any are checked var doEnable4 = ($$('.selectedAuthorities-6_0:checked').length > 0) ? true : false; var doEnable5 = ($$('.selectedAuthorities-6_1:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label var i = 0; do { $$('.selectedAuthorities-7_' + i).each(function(item) { if (doEnable4 || doEnable5) { item.enable().up('li').removeClassName('cssDisabled'); } else { item.disable().up('li').addClassName('cssDisabled'); } }); i++; } while (i < 4); }; /* * * Loop Group 4 * * */ function loopGroup4() { var a = 0; do { $$('.selectedAuthorities-9_' + a).each(function(chk1) { // watch for clicks chk1.observe('click', function(evt) { dynamicCheckbox4(); }); dynamicCheckbox4(); }); a++; } while (a < 4); } function dynamicCheckbox4() { // count how many of group_first are checked, // doEnable true if any are checked var doEnable6 = ($$('.selectedAuthorities-9_0:checked').length > 0) ? true : false; var doEnable7 = ($$('.selectedAuthorities-9_1:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label var i = 0; do { $$('.selectedAuthorities-10_' + i).each(function(item) { if (doEnable6 || doEnable7) { item.enable().up('li').removeClassName('cssDisabled'); } else { item.disable().up('li').addClassName('cssDisabled'); } }); i++; } while (i < 4); };

    Read the article

  • Javascript: Change li class if checkbox is selected (on load)

    - by BoDiE2003
    I have this code on javascript side: function changeSelectionStyle(id) { if(document.getElementById(id).className != 'yes'){ document.getElementById(id).className = 'yes'; } else{document.getElementById(id).className = '';} } And this on html: <ul> <li id="selectedAuthorities-4_1li" class=""> <input type="checkbox" id="selectedAuthorities-4_1" name="selectedAuthorities" value="ROLE_ADD_COMMENT_TO_CV" checked="checked" onload="changeSelectionStyle(this.id + 'li');" onclick="changeSelectionStyle(this.id + 'li'); checkFatherSelection(this.id);"> <a href="#" onclick="document.getElementById('selectedAuthorities-4_1').click(); return false;"> Agregar comentario <samp><b></b>Permite agregar comentario en el detalle.</samp> </a> </li> </ul> Well what I cant get work is when the checkbox is selected, on load, the JS should check it, and assign class="yes" to the li, here: <li id="selectedAuthorities-4_1li" class=""> Any suggestions? Thank you

    Read the article

  • Javascript: Remove checked status from disabled input (already checked)

    - by BoDiE2003
    Im trying to make this function to check an element and if its checked, or not, add or remove respective className. Also, if the element is disabled but is checked, it should un-check it and remove the className('yes') function init() { $(document.body).select('input').each(function(element) { if (!element.checked) { element.up().removeClassName('yes'); } else { element.up().addClassName('yes'); } if (element.checked && element.disabled) { element.checked = false; element.up().removeClassName('yes') } }); } Right now, the last part, is not working, no effect

    Read the article

  • Javascript: Remove checked status from disabled input on load (already checked)

    - by BoDiE2003
    On load, the script is not un-checking the disabled checkboxes, I have tried everything. I have even tried running this code from Chrome Console, and it is working, but not in normal ways. Where is the error?Javascript: document.observe("dom:loaded", function() { $(document.body).select('input').each(function(element) { init(); element.observe('click', function(element) { init(); }); }); loopGroup1(); loopGroup3(); loopGroup4(); }); function init() { $(document.body).select('input').each(function(element) { if (!element.checked) { element.up().removeClassName('yes'); } else { element.up().addClassName('yes'); } if (element.disabled && element.checked) { element.checked = !element.checked; element.up().removeClassName('yes'); } }); }

    Read the article

1