elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Temas
Páginas: 1 2 3 [4] 5 6
31  Programación / Java / problemas con la salida en: 14 Junio 2016, 22:54 pm
este es el ejercicio
Código
  1.  
  2. Quirksome Squares
  3.  
  4. The number 3025 has a remarkable quirk: if you split its decimal representation in two strings of equal length (30 and 25) and square the sum of the numbers so obtained, you obtain the original number:
  5.  
  6. displaymath26
  7.  
  8. The problem is to determine all numbers with this property having a given even number of digits.
  9.  
  10. For example, 4-digit numbers run from 0000 to 9999. Note that leading zeroes should be taken into account. This means that 0001 which is equal to  tex2html_wrap_inline28 is a quirksome number of 4 digits. The number of digits may be 2,4,6 or 8. Although maxint is only 32767 and numbers of eight digits are asked for, a well-versed programmer can keep his numbers in the range of the integers. However efficiency should be given a thought.
  11.  
  12. Input
  13.  
  14. The input of your program is a textflle containing numbers of digits (taken from 2,4,6,8), each number on a line of its own.
  15.  
  16. Output
  17.  
  18. The output is a textfile consisting of lines containing the quirksome numbers (ordered according to the input numbers and for each input number in increasing order).
  19.  
  20. Warning: Please note that the number of digits in the output is equal to the number in the corresponding input line : leading zeroes may not be suppressed.
  21.  
  22. Sample Input
  23.  
  24. 2
  25. 2
  26. Sample Output
  27.  
  28. 00
  29. 01
  30. 81
  31. 00
  32. 01
  33. 81
  34.  

no entiendo como obtener esa salida, ayuda

no entiendo como obtener el output 00
01
81
00
01
81???
es el ejercicio 256 del juez uva de la universidad de valladolid
32  Programación / Java / algoritmo de ordenamiento radix sort en java en: 13 Junio 2016, 07:44 am
Código
  1.  
  2. import java.util.ArrayList;
  3. import java.util.Collections;
  4. import java.util.HashMap;
  5. import java.util.Map;
  6.  
  7. /**
  8.  *
  9.  * @author qwery,azc
  10.  */
  11. public class RadixSort {
  12.  
  13.    public ArrayList<Integer> radixSort(ArrayList<Integer> entryData) {
  14.        int max = Collections.max(entryData);
  15.        max = cantidadDigitos(max);
  16.        Map<Integer, ArrayList> regid = new HashMap();
  17.        int dataAux = 0;
  18.        int digMenorSig = 0;
  19.        int porciento = 10;
  20.        ArrayList<Integer> lista = new ArrayList<>();
  21.        ArrayList<Integer> copiaSort = new ArrayList<>();
  22.        for (int i = 0; i < max; i++) {
  23.  
  24.            porciento *= 10;
  25.            for (int j = 0; j < entryData.size(); j++) {
  26.                dataAux = entryData.get(j);
  27.                digMenorSig = dataAux % 10;
  28.                lista.add(dataAux);
  29.                regid.put(digMenorSig, lista);
  30.                dataAux = dataAux / porciento;
  31.            }
  32.  
  33.            for (Map.Entry<Integer, ArrayList> entry : regid.entrySet()) {
  34.                Integer key = entry.getKey();
  35.                ArrayList<Integer> value = entry.getValue();
  36.                for (int j = 0; j < value.size(); j++) {
  37.                    copiaSort.add(value.get(j));
  38.                }
  39.  
  40.            }
  41.            entryData=copiaSort;
  42.  
  43.        }
  44.        for (int i = 0; i < entryData.size(); i++) {
  45.            System.err.println(entryData.get(i));
  46.        }
  47.        //System.out.println("max " + max);
  48.        return null;
  49.    }
  50.  
  51.    public int cantidadDigitos(int data) {
  52.        int res = 0;
  53.        while (data > 0) {
  54.            data = data / 10;
  55.            res++;
  56.        }
  57.        return res;
  58.    }
  59.  
  60.    public static void main(String args[]) {
  61.        RadixSort r = new RadixSort();
  62.        ArrayList<Integer> a = new ArrayList();
  63.        a.add(34);
  64.        a.add(27);
  65.        a.add(38);
  66.        r.radixSort(a);
  67.  
  68.    }
  69. }
  70.  
  71.  



no funciona... no se en que estoy fallando ayuda...
33  Programación / Java / StringBuilder vs String ( JAVA ) en: 12 Junio 2016, 23:48 pm
por que cuando utilizo StringBuilder el tiempo de ejecucion disminuye respecto al utilizar String

alguna explicacion?
34  Programación / Java / app que te reconozca en: 8 Junio 2016, 17:34 pm
quiero implementar una app en android que con solo usarlo te reconozca, mediante interaccion humano computador

que tendria que usar,
como lo harian?
machine learning?
ia?
muchas gracias
35  Programación / Java / resumen algoritmo en: 5 Junio 2016, 17:27 pm
como podria implementar resumen de una hoja, un libro por decir

algun algoritmo? 
tendria que usar grafos?

como lo harian?
36  Seguridad Informática / Bugs y Exploits / algun proyecto de tesis que trate de virus? en: 2 Junio 2016, 05:07 am
alguien tiene una idea que trate de sguridad o creacion de un nuevo virus?

o alguna idea referente?

se puede plantear un tema de virus como tesis?
37  Programación / Desarrollo Web / se puede trabajar con php + node en: 31 Mayo 2016, 22:04 pm
buenas comunidad
lo que sucede es lo siguiente soy desarrollador php pero ahora tengo una aplicacion en tiempo real para lo cual quiero utilizar node js, solo para el socket quiero utilizar node js y para todo lo demas PHP.


he implentado geolocalizacion con node.js + sockets.io y ahora cada ves que cambia de  posicion un cliente tengo que guardar en mi base de datos mysql


mi duda es como paso datos desde nodejs a php para luego guardar los datos?

algun buen samaritano que me oriente porfavor, algun material, ejemplos , todo eso necesito


gracias

38  Programación / Desarrollo Web / ayuda con proyecto de geolocalizacion + js + php +websocket en: 29 Mayo 2016, 05:11 am
estoy iniciando un proyecto de geolocalizacion porque es muy interesante
si quieren ayudarme se los agradeceria mucho

estoy siguiendo este tutorial de youtube

https://www.youtube.com/watch?v=fd5kwf_jcLA

pero no logro aun 
39  Programación / Desarrollo Web / no ejecuta script en: 28 Mayo 2016, 20:58 pm
hice este codigo pero no ejecuta mi script
Código
  1. <title>Geolocalizacion</title>
  2. <meta name="viewport" content="initial-scale=1.0, user-scaleble=no">
  3. <meta charset="utf-8">
  4. <style >
  5. #map-canvas{
  6. height: 380px;
  7. width: 300px;
  8. margin: :0px;
  9. padding: 0px;
  10. background-color: #000;
  11. }
  12. </style>
  13. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  14. <script src="fancywebsocket.js"></script>
  15. <script language="javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
  16. <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
  17. <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  18.  
  19. alert("lslslsl");
  20. var map;
  21. var marker;
  22. function initialize(){
  23. var mapOptions={
  24. zoom:15;
  25. };
  26. map=new google.maps.Map(document.getElementById('map-canvas'),mapOptions);
  27.  
  28. if (navigator.geolocation) {
  29. navigator.geolocation.getCurrentPosition(function(position){
  30. var pos=new google.maps.LatLng(position.coords.latitude,position.coords.longitude)
  31.  
  32. var goldStar={
  33. path:google.maps.SymbolPath.CIRCLE,
  34. strokeColor:'#276ED0',
  35. fillColor:'#276ED0',
  36. fillOpacity:.9,
  37. strokeWeight:1,
  38. scale:6,
  39. };
  40.  
  41. var marker=new google.maps.Marker({
  42. position:pos,
  43. icon:goldStar,
  44. draggable:true,
  45. animation:google.maps.Animation.DROP,
  46. map:map,
  47. });
  48. map.setCenter(pos);
  49. },function(){
  50. handleNoGeolocation(true);
  51. });
  52. }else{
  53. handleNoGeolocation(false);
  54. }
  55. }
  56.  
  57. function animar(){
  58. navigator.geolocation.getCurrentPosition(function(position)
  59. {
  60. var pos =new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
  61.  
  62. map.panTo(pos);
  63.  
  64. var goldStar={
  65. path:google.maps.SymbolPath.CIRCLE,
  66. strokeColor:'#FF4E51',
  67. fillColor:'#FF4E51',
  68. fillOpacity:.9,
  69. strokeWeight:1,
  70. scale:5,
  71. };
  72. var marker=new google.maps.Marker({
  73. position:pos,
  74. icon:goldStar,
  75. draggable:true,
  76. map:map,
  77. });
  78.  
  79. var option={
  80. map:map,
  81. position:pos,
  82. };
  83. send(position.coords.latitude+","+position.coords.longitude);
  84. map.setCenter(options.position);
  85. });
  86. }
  87. function handleNoGeolocation(errorFlag){
  88. if (errorFlag) {
  89. var content='Error:the service';
  90. }else{
  91. var content="tu buscador";
  92. }
  93. var options={
  94. map=map,
  95. position:new google.maps.LatLng(60,105),
  96. content:content,
  97. };
  98. var infowindow=new google.maps.infoWindow(options);
  99. map.setCenter(options.position);
  100. }
  101. google.maps.event.addDomListener(window,'load',initialize);
  102. setTimeout(function(){animar()},5000);
  103. function pocision(pos){
  104.  
  105. }
  106.  
  107. </script>
  108. </head>
  109. <div id="map-canvas">
  110.  
  111. </div>
  112.  
  113. </body>
  114. </html>
40  Programación / Desarrollo Web / websockets + php en: 26 Mayo 2016, 22:33 pm
algun material para aprender websocket ?
Páginas: 1 2 3 [4] 5 6
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines