tag:blogger.com,1999:blog-274495012024-02-10T15:47:51.691-06:00El Kardumen" Lo que pasa es de que.."xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.comBlogger97125tag:blogger.com,1999:blog-27449501.post-76434921344773561872023-06-15T12:23:00.008-06:002023-06-15T13:45:04.554-06:00Snippets Mongo DB<p> Esta publicación servirá para ir colocando fragmentos de consultas que en algún momento me fueron útiles para usarlo en MongoDB</p><p><br /></p><p>Fragmento 1: Se requería obtener todos los elementos que dentro de un atributo que es de tipo array(arreglo) coincida con type:"fire" </p>
<script src="https://gist.github.com/xola139/7adafb3132ad140b241d0e06877308fe.js"></script>
<p>Fragmento 2: Se requería actualizar el atributo "<span style="background-color: white; color: #1f2328; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; font-size: 12px; white-space: pre;">lastUpdate</span>" de toda la colección donde la edad sea mayor o igual a 15.</p>
<script src="https://gist.github.com/xola139/51f8d31ade072b401c72b3874f8666a5.js"></script>xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-37687958051496079332022-02-01T11:11:00.003-06:002023-01-11T18:14:59.381-06:00¿Como funciona blockchain?<div><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; margin: 0px 0px 1.25em; white-space: pre-wrap;">Blockchain es una tecnología de registro distribuido que permite registrar transacciones y almacenar información de manera segura, transparente y resistente a la manipulación. La principal característica de blockchain es que es descentralizada, lo que significa que no depende de una autoridad central o entidad para llevar a cabo las transacciones.</p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; margin: 1.25em 0px; white-space: pre-wrap;">Blockchain se basa en una red de nodos, cada uno de los cuales mantiene una copia de la base de datos completa. Cualquier transacción que se realice en la red se registra en todas las copias de la base de datos, lo que significa que es imposible falsificar o alterar transacciones pasadas.</p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; margin: 1.25em 0px; white-space: pre-wrap;">La tecnología blockchain se utiliza principalmente para la criptomoneda y se utiliza para verificar y registrar las transacciones de manera segura, pero su uso no se limita a ello, también se usa en diferentes campos como: la identidad digital, la cadena de suministro, el voto electrónico y contratos inteligentes, entre otros.</p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; margin: 1.25em 0px 0px; white-space: pre-wrap;">Es importante mencionar que aunque es una tecnología con un gran potencial, todavía es una tecnología emergente y en constante evolución, por lo que hay muchas preguntas y desafíos que se están resolviendo en este momento.</p></div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEiK2noADjBZHVkhH50QEM2m37YfK8L1Jop456mArCIWbkskZZiiGOTahWPvKq4QPtvAU_rnNSJZMZE-nKEguC1vToq114zyTOBbm51YO7mveo_BhW_fvTIh9NYGVZnckOniRW4TL4j-cE2RCTCvqj5QOyF8KcUdtx3BsNeUeuVgF6emrp_1wgg" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="507" data-original-width="665" src="https://blogger.googleusercontent.com/img/a/AVvXsEiK2noADjBZHVkhH50QEM2m37YfK8L1Jop456mArCIWbkskZZiiGOTahWPvKq4QPtvAU_rnNSJZMZE-nKEguC1vToq114zyTOBbm51YO7mveo_BhW_fvTIh9NYGVZnckOniRW4TL4j-cE2RCTCvqj5QOyF8KcUdtx3BsNeUeuVgF6emrp_1wgg=s16000" /></a></div><br /><br /></div>xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-69270798856827223082020-10-01T13:50:00.005-05:002020-10-01T13:50:46.043-05:00MongoDB - DeprecationWarning: current URL string parser is deprecated<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzx7fYuPBifcfFk5g4r86jMrdNkTGt8qJIOOpFL4qgy878JD1iN-7QxE0OPUrCCJBhmHqzydlQjm0PJ-csCGlnmgChvmVd46BY5IDE-gW4ADW74zY2wHiGdDnyLkCYbEHvp28TUw/s225/mongoDeprecationWarning2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="225" data-original-width="223" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzx7fYuPBifcfFk5g4r86jMrdNkTGt8qJIOOpFL4qgy878JD1iN-7QxE0OPUrCCJBhmHqzydlQjm0PJ-csCGlnmgChvmVd46BY5IDE-gW4ADW74zY2wHiGdDnyLkCYbEHvp28TUw/s0/mongoDeprecationWarning2.png" /></a></div><br /><p><br /></p><p>Pues ya tenia rato con este tema al hacer mis conexiones hacia mongoDB con Nodejs, cada inicio de conexión siempre me salia el mensaje "<i>DeprecationWarning: current URL string parser is deprecated</i>" si bien el mensaje me permitía trabajar sin complicación llego el momento de hacerlo como se debe.</p><span><a name='more'></a></span><p><br /></p><p>Inicial mente yo tenia configurara mi conexión de la siguiente forma:</p><p><br /></p><p><i><span style="font-size: x-small;">var mongoose = require('mongoose');</span></i></p><p><i style="font-family: inherit; font-size: small;">const MONGO_URI ='STRING_DE_CONEXION'; </i></p><p><span style="font-family: inherit; font-size: x-small;"><i>mongoose.Promise = global.Promise;</i></span></p><p><span style="font-family: inherit; font-size: x-small;"><i>mongoose.connect(MONGO_URI).then(()=> console.log("conexion exitosa Atlas"))</i></span></p><p><span style="font-family: inherit; font-size: x-small;"><i><span style="white-space: pre;"> </span> .catch(function(err){ console.error(err)});</i></span></p><p><br /></p><p>y siempre me mandaba el warning <i>"DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version"</i></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEKk9PJMPAn0dMn7irAqh7jtBYKoMoXA-SH502cS9fUzD3a89ag4DBXt7kRgaUpeo9OWsbFs-i5Q3K0JK6bf-NwUObwJo1O8J8DhnjVqdTWHJNeBLqf3hayQlFkCFgkS9kpJp8yA/s1309/mongoDeprecationWarning.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="106" data-original-width="1309" height="51" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEKk9PJMPAn0dMn7irAqh7jtBYKoMoXA-SH502cS9fUzD3a89ag4DBXt7kRgaUpeo9OWsbFs-i5Q3K0JK6bf-NwUObwJo1O8J8DhnjVqdTWHJNeBLqf3hayQlFkCFgkS9kpJp8yA/w640-h51/mongoDeprecationWarning.png" width="640" /></a></div><br /><i><br /></i><p></p><p>Total que si prestas atención ha ese mensaje claramente te indica que debes colocar las variables useNewUrlParser y useUnifiedTopology, y pues no hay mas la conexión deberá quedar de la siguiente forma:</p><p><br /></p><p><script src="https://gist.github.com/xola139/dd39b6b78cb4158fbd09ca928a921266.js"></script>Claramente no hay mucho que buscar en la red ya que el mismo log te da la solución</p><p><br /></p><p><br /></p><p>Saludos</p>xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-77591043989923617612020-10-01T13:02:00.003-05:002020-10-01T13:02:51.375-05:00MongoDB Atlas - MongoNetworkError: failed to connect to server<div><br /></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://miro.medium.com/max/2560/1*WwJCKQKeZ7H9ghT_qd7iGA.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="450" data-original-width="800" height="180" src="https://miro.medium.com/max/2560/1*WwJCKQKeZ7H9ghT_qd7iGA.png" width="320" /></a></div><br /><div><br /></div>Pues bien esta vez traigo una breve explicación de como solucione el problema "MongoNetworkError: failed to connect to server", pues como ya saben buscando en la red encontré algunos usuarios con el mismo problema, leyendo cada una de las posibles soluciones yo pude hacer lo siguiente:<div><br />
<br /><br />
<a name='more'></a><br /><br />
<br />
<div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwMv7r1-EJk-pj-efaeAX2mRlBFA5Fcmf5rOpuD9ssAInvbTjuBQzshc-qOb31GvKfhIvansfMIheuvZh8q_GI601QdA-9_2ygg8SjtM371Cwo7vQBB1lNqdhyyC_k2M6Ncasuqw/s585/mongoNetwork5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="43" data-original-width="585" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwMv7r1-EJk-pj-efaeAX2mRlBFA5Fcmf5rOpuD9ssAInvbTjuBQzshc-qOb31GvKfhIvansfMIheuvZh8q_GI601QdA-9_2ygg8SjtM371Cwo7vQBB1lNqdhyyC_k2M6Ncasuqw/s320/mongoNetwork5.png" width="320" /></a></div><div><br /></div><div>Con el acceso a MongnoAtlas, una vez con el login exitoso puedes visualizar el menu Security que tiene la opcion de Network Access, seleccionas la opción<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhztibMkTxonX5zbrEpwOu0j0S-V_9TCcKrDMuEYpypBgMZkvthwOa4n7wqBvUmdlLirU2lSao1XtiGJ2M7gvTnSePt4pLUVUmz9oCpkwdQKB0FrWnhYuJEBL8Oi-LwDB637oJVlg/s312/mongoNetwork.png" style="display: block; padding: 1em 0px; text-align: center;"><img alt="" border="0" data-original-height="312" data-original-width="194" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhztibMkTxonX5zbrEpwOu0j0S-V_9TCcKrDMuEYpypBgMZkvthwOa4n7wqBvUmdlLirU2lSao1XtiGJ2M7gvTnSePt4pLUVUmz9oCpkwdQKB0FrWnhYuJEBL8Oi-LwDB637oJVlg/s320/mongoNetwork.png" /></a></div>
</div>
<br />Se muestra la pantalla para poder configurar las IP's que podrán conectarse a la base de datos, aquí sera necesario dar click en el boton +ADD IP ADRESS<div><br /></div><div><br /></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMYdD30IDz-IpWV1XBhQf2aMqGL0ZrBLWnvyd_sKJwE_yw7iITYwwHRLLxmvLpBsAIBzoEreu-bLEjFVeVoM79vVcqDfO8AhR4nmLnOGSFZCQ2BBaN5Ybkx7mggZ445baaLdwWqA/s1145/mongoNetwork2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="189" data-original-width="1145" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMYdD30IDz-IpWV1XBhQf2aMqGL0ZrBLWnvyd_sKJwE_yw7iITYwwHRLLxmvLpBsAIBzoEreu-bLEjFVeVoM79vVcqDfO8AhR4nmLnOGSFZCQ2BBaN5Ybkx7mggZ445baaLdwWqA/w640-h106/mongoNetwork2.png" width="640" /></a></div><br /><div>Cuando se abre el modal para configurar tendrás dos botones con opciones, el primer boton(ADD CURRENT IP ADDRESS) te ayudara a identificar la ip de tu equipo esta se entiende que es donde se esta haciendo el desarrollo, el segundo boton() te permitirá dar acceso a cualquier ip.</div><div><br /></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrABL7CR4gBr7Sgd9QkSyb00ZVYQSXF4XG20ipuUahlMzaA-sL6CPfQxUfJi8OooSXg5LLZfmBHH2OvXhQTBdmMOpOqfgcQN4Jkj5dDEMoGIZc1WB8Sn3Em3GasgCDlu1MXTwfdQ/s991/mongoNetwork4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="39" data-original-width="991" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrABL7CR4gBr7Sgd9QkSyb00ZVYQSXF4XG20ipuUahlMzaA-sL6CPfQxUfJi8OooSXg5LLZfmBHH2OvXhQTBdmMOpOqfgcQN4Jkj5dDEMoGIZc1WB8Sn3Em3GasgCDlu1MXTwfdQ/s320/mongoNetwork4.png" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr7XLsAh0Pz1oO0bFRVEwuP-3OfTVutllzSx8uraY51ieUVwgOEGCGvsI9VhOVgSd-zN7z-XKV7V4DVI8cz89PQWfhe8QtZYgoa2X3NX6-zieyLSsW9V1N7RmpN5eSt-dVzR2kEg/s562/mongoNetwork3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="342" data-original-width="562" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr7XLsAh0Pz1oO0bFRVEwuP-3OfTVutllzSx8uraY51ieUVwgOEGCGvsI9VhOVgSd-zN7z-XKV7V4DVI8cz89PQWfhe8QtZYgoa2X3NX6-zieyLSsW9V1N7RmpN5eSt-dVzR2kEg/s320/mongoNetwork3.png" width="320" /></a></div><br /><div><br /></div><div><br /></div><div>En mi caso elegí la primera opción, esta debe mostrar entre paréntesis la siguiente leyenda</div><div>(includes your current IP address)</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigcWv32IqCZDeE2CXS-UbnopWxaiHiXmWRyVeqyV8S2DO-CxluHJSHZxuVoIHW1wMoO64Loyaty_j6PVGOWLX2YLyzBY750-x6GpWZg12C0UR_sG0kYGQAmKtsjPGTaqLxAbABjw/s991/mongoNetwork4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="39" data-original-width="991" height="26" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigcWv32IqCZDeE2CXS-UbnopWxaiHiXmWRyVeqyV8S2DO-CxluHJSHZxuVoIHW1wMoO64Loyaty_j6PVGOWLX2YLyzBY750-x6GpWZg12C0UR_sG0kYGQAmKtsjPGTaqLxAbABjw/w640-h26/mongoNetwork4.png" width="640" /></a></div><div><br /></div><div><br /></div>Y con esto bastara para que desde tu equipo local donde estés haciendo el desarrollo podrás tener conexión exitosa<div><br /></div><div><br /></div><div>Recursos:</div><div>https://stackoverflow.com/questions/49894913/error-at-connecting-to-mongodb-atlas-server</div><div>https://stackoverflow.com/questions/62368641/mongonetworkerror-failed-to-connect-to-server-cluster0-shard-00-02-aprzj-gcp-m</div><div><br /></div><div>Saludos<br /><div><br /></div><div><br /></div><div><br /></div><div><br /></div></div></div>xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-75927216188870641592020-07-20T13:32:00.006-05:002020-07-20T14:07:02.413-05:00Aviso legal
<a name='more'></a><br /><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM_UykJkD-Ov3Ji-vYmdVyBEkFLFYYB18GUlxfMEvq7nbRQPaJyjUp5c4LtAPu9ZVMtMfiN09tKrsXaeffM2MZqG4lbwJj260ZhqLyR2eVMD6G6d6yehTj5OKLRUtmK6GAeMdo3w/s1600/global+is+not+defined-socket.io-client.png" style="margin-left: 1em; margin-right: 1em;"></a></div>
<p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">LEY DE LOS SERVICIOS DE LA SOCIEDAD DE LA INFORMACIÓN (LSSI)</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">elkardumen</span>, responsable del sitio web, en adelante RESPONSABLE, pone a disposición de los usuarios el presente documento, con el que pretende dar cumplimiento a las obligaciones dispuestas en la Ley 34/2002, de 11 de julio, de Servicios de la Sociedad de la Información y del Comercio Electrónico (LSSICE), así como informar a todos los usuarios del sitio web respecto a cuáles son las condiciones de uso.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Toda persona que acceda a este sitio web asume el papel de usuario, comprometiéndose a la observancia y cumplimiento riguroso de las disposiciones aquí dispuestas, así como a cualquier otra disposición legal que fuera de aplicación. </p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><b>elkardmen</b> se reserva el derecho de modificar cualquier tipo de información que pudiera aparecer en el sitio web, sin que exista obligación de preavisar o poner en conocimiento de los usuarios dichas obligaciones, entendiéndose como suficiente con la publicación en el sitio web de <b>elkardumen</b></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">1. DATOS IDENTIFICATIVOS</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"></p><div style="text-align: justify;">Denominación social: <span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">elkardumen</span></div><div style="text-align: justify;">Nombre comercial: <b>elkardumen</b></div><div style="text-align: justify;">e-mail: xola139<span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">@gmail. com</span></div><p></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">2. OBJETO</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">A través del Sitio Web, les ofrecemos a los Usuarios la posibilidad de acceder a la información sobre nuestros servicios.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">3. PRIVACIDAD Y TRATAMIENTO DE DATOS</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"></p><div style="text-align: justify;">Cuando para el acceso a determinados contenidos o servicio sea necesario facilitar datos de carácter personal, los Usuarios garantizarán su veracidad, exactitud, autenticidad y vigencia. La empresa dará a dichos datos el tratamiento automatizado que corresponda en función de su naturaleza o finalidad, en los términos indicados en la sección de Política de Privacidad.</div><div style="text-align: justify;"> </div><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><div style="text-align: justify;"><span style="font-style: inherit;">4. PROPIEDAD INDUSTRIAL E INTELECTUAL</span></div></span><p></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">El Usuario reconoce y acepta que todos los contenidos que se muestran en el Espacio Web y en especial, diseños, textos, imágenes, logos, iconos, botones, software, nombres comerciales, marcas, o cualesquiera otros signos susceptibles de utilización industrial y/o comercial están sujetos a derechos de Propiedad Intelectual y todas las marcas, nombres comerciales o signos distintivos, todos los derechos de propiedad industrial e intelectual, sobre los contenidos y/o cualesquiera otros elementos insertados en el página, que son propiedad exclusiva de la empresa y/o de terceros, quienes tienen el derecho exclusivo de utilizarlos en el tráfico económico. Por todo ello el Usuario se compromete a no reproducir, copiar, distribuir, poner a disposición o de cualquier otra forma comunicar públicamente, transformar o modificar tales contenidos manteniendo indemne a la empresa de cualquier reclamación que se derive del incumplimiento de tales obligaciones. En ningún caso el acceso al Espacio Web implica ningún tipo de renuncia, transmisión, licencia o cesión total ni parcial de dichos derechos, salvo que se establezca expresamente lo contrario. Las presentes Condiciones Generales de Uso del Espacio Web no confieren a los Usuarios ningún otro derecho de utilización, alteración, explotación, reproducción, distribución o comunicación pública del Espacio Web y/o de sus Contenidos distintos de los aquí expresamente previstos. Cualquier otro uso o explotación de cualesquiera derechos estará sujeto a la previa y expresa autorización específicamente otorgada a tal efecto por la empresa o el tercero titular de los derechos afectados.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Los contenidos, textos, fotografías, diseños, logotipos, imágenes, programas de ordenador, códigos fuente y, en general, cualquier creación intelectual existente en este Espacio, así como el propio Espacio en su conjunto, como obra artística multimedia, están protegidos como derechos de autor por la legislación en materia de propiedad intelectual. La empresa es titular de los elementos que integran el diseño gráfico del Espacio Web, lo menús, botones de navegación, el código HTML, los textos, imágenes, texturas, gráficos y cualquier otro contenido del Espacio Web o, en cualquier caso dispone de la correspondiente autorización para la utilización de dichos elementos. El contenido dispuesto en el Espacio Web no podrá ser reproducido ni en todo ni en parte, ni transmitido, ni registrado por ningún sistema de recuperación de información, en ninguna forma ni en ningún medio, a menos que se cuente con la autorización previa, por escrito, de la citada Entidad.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Asimismo queda prohibido suprimir, eludir y/o manipular el «copyright» así como los dispositivos técnicos de protección, o cualesquiera mecanismos de información que pudieren contener los contenidos. El Usuario de este Espacio Web se compromete a respetar los derechos enunciados y a evitar cualquier actuación que pudiera perjudicarlos, reservándose en todo caso la empresa el ejercicio de cuantos medios o acciones legales le correspondan en defensa de sus legítimos derechos de propiedad intelectual e industrial.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">5. OBLIGACIONES Y RESPONSABILIDADES DEL USUARIO DEL ESPACIO WEB</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">El Usuario se compromete a:</p><ol style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em; outline: 0px; padding: 0px; vertical-align: baseline;"><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Hacer un uso adecuado y lícito del Espacio Web así como de los contenidos y servicios, de conformidad con: (i) la legislación aplicable en cada momento; (ii) las Condiciones Generales de Uso del Espacio Web; (iii) la moral y buenas costumbres generalmente aceptadas y (iv) el orden público.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Proveerse de todos los medios y requerimientos técnicos que se precisen para acceder al Espacio Web.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Facilitar información veraz al cumplimentar con sus datos de carácter personal los formularios contenidos en el Espacio Web y a mantenerlos actualizados en todo momento de forma que responda, en cada momento, a la situación real del Usuario. El Usuario será el único responsable de las manifestaciones falsas o inexactas que realice y de los perjuicios que cause a la empresa o a terceros por la información que facilite.</li></ol><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">No obstante lo establecido en el apartado anterior el Usuario deberá asimismo abstenerse de:</p><ol style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em; outline: 0px; padding: 0px; vertical-align: baseline;"><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Hacer un uso no autorizado o fraudulento del Espacio Web y/o de los contenidos con fines o efectos ilícitos, prohibidos en las presentes Condiciones Generales de Uso, lesivos de los derechos e intereses de terceros, o que de cualquier forma puedan dañar, inutilizar, sobrecargar, deteriorar o impedir la normal utilización de los servicios o los documentos, archivos y toda clase de contenidos almacenados en cualquier equipo informático.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Acceder o intentar acceder a recursos o áreas restringidas del Espacio Web, sin cumplir las condiciones exigidas para dicho acceso.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Provocar daños en los sistemas físicos o lógicos del Espacio Web, de sus proveedores o de terceros.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Introducir o difundir en la red virus informáticos o cualesquiera otros sistemas físicos o lógicos que sean susceptibles de provocar daños en los sistemas físicos o lógicos de la empresa, proveedores o de terceros.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Intentar acceder, utilizar y/o manipular los datos de la empresa, terceros proveedores y otros Usuarios.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Reproducir o copiar, distribuir, permitir el acceso del público a través de cualquier modalidad de comunicación pública, transformar o modificar los contenidos, a menos que se cuente con la autorización del titular de los correspondientes derechos o ello resulte legalmente permitido.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Suprimir, ocultar o manipular las notas sobre derechos de propiedad intelectual o industrial y demás datos identificativos de los derechos de la empresa o de terceros incorporados a los contenidos, así como los dispositivos técnicos de protección o cualesquiera mecanismos de información que puedan insertarse en los contenidos.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Obtener e intentar obtener los contenidos empleando para ello medios o procedimientos distintos de los que, según los casos, se hayan puesto a su disposición a este efecto o se hayan indicado expresamente en las páginas web donde se encuentren los contenidos o, en general, de los que se empleen habitualmente en Internet por no entrañar un riesgo de daño o inutilización del Espacio web y/o de los contenidos.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">En particular, y a título meramente indicativo y no exhaustivo, el Usuario se compromete a no transmitir, difundir o poner a disposición de terceros informaciones, datos, contenidos, mensajes, gráficos, dibujos, archivos de sonido y/o imagen, fotografías, grabaciones, software y, en general, cualquier clase de material que: • De cualquier forma sea contrario, menosprecie o atente contra los derechos fundamentales y las libertades públicas reconocidas constitucionalmente, en los Tratados Internacionales y en el resto de la legislación vigente.• Induzca, incite o promueva actuaciones delictivas, denigratorias, difamatorias, violentas o, en general, contrarias a la ley, a la moral, a las buenas costumbres generalmente aceptadas o al orden público.• Induzca, incite o promueva actuaciones, actitudes o pensamientos discriminatorios por razón de sexo, raza, religión, creencias, edad o condición.• Incorpore, ponga a disposición o permita acceder a productos, elementos, mensajes y/o servicios delictivos, violentos, ofensivos, nocivos, degradantes o, en general, contrarios a la ley, a la moral y a las buenas costumbres generalmente aceptadas o al orden público. Induzca o pueda inducir a un estado inaceptable de ansiedad o temor.• Induzca o incite a involucrarse en prácticas peligrosas, de riesgo o nocivas para la salud y el equilibrio psíquico.• Se encuentra protegido por la legislación en materia de protección intelectual o industrial perteneciente a la sociedad o a terceros sin que haya sido autorizado el uso que se pretenda realizar.• Sea contrario al honor, a la intimidad personal y familiar o a la propia imagen de las personas.• Constituya cualquier tipo de publicidad.• Incluya cualquier tipo de virus o programa que impida el normal funcionamiento del Espacio Web.</li></ol><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Si para acceder a algunos de los servicios y/o contenidos del Espacio Web, se le proporcionara una contraseña, se obliga a usarla de manera diligente, manteniéndola en todo momento en secreto. En consecuencia, será responsable de su adecuada custodia y confidencialidad, comprometiéndose a no cederla a terceros, de manera temporal o permanente, ni a permitir el acceso a los mencionados servicios y/o contenidos por parte de personas ajenas. Igualmente, se obliga a notificar a la sociedad cualquier hecho que pueda suponer un uso indebido de su contraseña, como, a título enunciativo, su robo, extravío o el acceso no autorizado, con el fin de proceder a su inmediata cancelación. En consecuencia, mientras no efectúe la notificación anterior, la empresa quedará eximida de cualquier responsabilidad que pudiera derivarse del uso indebido de su contraseña, siendo de su responsabilidad cualquier utilización ilícita de los contenidos y/o servicios del Espacio Web por cualquier tercero ilegítimo. Si de manera negligente o dolosa incumpliera cualquiera de las obligaciones establecidas en las presentes Condiciones Generales de Uso, responderá por todos los daños y perjuicios que de dicho incumplimiento pudieran derivarse para la empresa.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">6. RESPONSABILIDADES</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">No se garantiza el acceso continuado, ni la correcta visualización, descarga o utilidad de los elementos e informaciones contenidas en la web que puedan verse impedidos, dificultados o interrumpidos por factores o circunstancias que están fuera de su control. No se hace responsable de las decisiones que pudieran adoptarse como consecuencia del acceso a los contenidos o informaciones ofrecidas.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"></p><div style="text-align: justify;">Se podrá interrumpir el servicio, o resolver de modo inmediato la relación con el Usuario, si se detecta que un uso de su Espacio Web, o de cualquiera de los servicios ofertados en el mismo, es contrario a las presentes Condiciones Generales de Uso. No nos hacemos responsables por daños, perjuicios, pérdidas, reclamaciones o gastos derivados del uso del Espacio Web.</div><div style="text-align: justify;"> </div><div style="text-align: justify;">Únicamente será responsable de eliminar, lo antes posible, los contenidos que puedan generar tales perjuicios, siempre que así se notifique. En especial no seremos responsables de los perjuicios que se pudieran derivar, entre otros, de:</div><p></p><ol style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em; outline: 0px; padding: 0px; vertical-align: baseline;"><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Interferencias, interrupciones, fallos, omisiones, averías telefónicas, retrasos, bloqueos o desconexiones en el funcionamiento del sistema electrónico, motivadas por deficiencias, sobrecargas y errores en las líneas y redes de telecomunicaciones, o por cualquier otra causa ajena al control de la empresa. </li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Intromisiones ilegítimas mediante el uso de programas malignos de cualquier tipo y a través de cualquier medio de comunicación, tales como virus informáticos o cualesquiera otros.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Abuso indebido o inadecuado del Espacio Web.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Errores de seguridad o navegación producidos por un mal funcionamiento del navegador o por el uso de versiones no actualizadas del mismo. El administrador del espacio web se reservan el derecho de retirar, total o parcialmente, cualquier contenido o información presente en el Espacio Web.</li></ol><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"></p><div style="text-align: justify;">La empresa excluye cualquier responsabilidad por los daños y perjuicios de toda naturaleza que pudieran deberse a la mala utilización de los servicios de libre disposición y uso por parte de los Usuarios de Espacio Web. Asimismo queda exonerado de cualquier responsabilidad por el contenido e informaciones que puedan ser recibidas como consecuencia de los formularios de recogida de datos, estando los mismos únicamente para la prestación de los servicios de consultas y dudas. Por otro lado, en caso de causar daños y perjuicios por un uso ilícito o incorrecto de dichos servicios, podrá ser el Usuario reclamado por los daños o perjuicios causados.</div><div style="text-align: justify;"> </div><div style="text-align: justify;">Usted mantendrá a la empresa indemne frente a cualesquiera daños y perjuicios que se deriven de reclamaciones, acciones o demandas de terceros como consecuencia de su acceso o uso del Espacio Web. Asimismo, usted se obliga a indemnizar frente a cualesquiera daños y perjuicios, que se deriven del uso por su parte de “robots”, “spiders”, “crawlers” o herramientas similares empleadas con el fin de recabar o extraer datos o de cualquier otra actuación por su parte que imponga una carga irrazonable sobre el funcionamiento del Espacio Web.</div><p></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">7. HIPERVÍNCULOS</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">El Usuario se obliga a no reproducir de ningún modo, ni siquiera mediante un hiperenlace o hipervínculo, el Espacio Web, así como ninguno de sus contenidos, salvo autorización expresa y por escrito del responsable del fichero.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">El Espacio Web puede incluir enlaces a otros espacios web, gestionados por terceros, con objeto de facilitar el acceso del Usuario a la información de empresas colaboradoras y/o patrocinadoras. Conforme con ello, la sociedad no se responsabiliza del contenido de dichos Espacios web, ni se sitúa en una posición de garante ni/o de parte ofertante de los servicios y/o información que se puedan ofrecer a terceros a través de los enlaces de terceros.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Se concede al Usuario un derecho limitado, revocable y no exclusivo a crear enlaces a la página principal del Espacio Web exclusivamente para uso privado y no comercial. Los Espacios web que incluyan enlace a nuestro Espacio Web (i) no podrán falsear su relación ni afirmar que se ha autorizado tal enlace, ni incluir marcas, denominaciones, nombres comerciales, logotipos u otros signos distintivos de nuestra sociedad; (ii) no podrán incluir contenidos que puedan considerarse de mal gusto, obscenos, ofensivos, controvertidos, que inciten a la violencia o la discriminación por razón de sexo, raza o religión, contrarios al orden público o ilícitos; (iii) no podrán enlazar a ninguna página del Espacio Web distinta de la página principal; (iv) deberá enlazar con la propia dirección del Espacio Web, sin permitir que el Espacio web que realice el enlace reproduzca el Espacio Web como parte de su web o dentro de uno de sus “frames” o crear un “browser” sobre cualquiera de las páginas del Espacio Web. La empresa podrá solicitar, en cualquier momento, que elimine cualquier enlace al Espacio Web, después de lo cual deberá proceder de inmediato a su eliminación.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">La empresa no puede controlar la información, contenidos, productos o servicios facilitados por otros Espacios web que tengan establecidos enlaces con destino al Espacio Web.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">8. PROTECCIÓN DE DATOS</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Para utilizar algunos de los Servicios, el Usuario debe proporcionar previamente ciertos datos de carácter personal. La empresa tratará automatizadamente estos datos y aplicará las correspondientes medidas de seguridad, todo ello en cumplimiento del RGPD, LOPDGDD y LSSI. El Usuario puede acceder a la política seguida en el tratamiento de los datos personales, así como el establecimiento de las finalidades previamente establecidas, en las condiciones definidas en la Política de Privacidad.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">9. COOKIES</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">La empresa se reserva el derecho de utilizar la tecnología “cookie” en el Espacio Web, a fin de reconocerlo como Usuario frecuente y personalizar el uso que realice del Espacio Web mediante la preselección de su idioma, o contenidos más deseados o específicos.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Las cookies recopilan la dirección <a class="rank-math-link" href="https://ceporros.com/" style="background-color: transparent; border: 0px; box-sizing: inherit; color: #008be2; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration-line: none; transition: all 0.2s linear 0s; vertical-align: baseline;">IP</a> del usuario siendo Google el responsable del tratamiento de esta información.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Las cookies son ficheros enviados a un navegador, por medio de un servidor Web, para registrar la navegación del Usuario en el Espacio Web, cuando el Usuario permita su recepción. Si usted lo desea puede configurar su navegador para ser avisado en pantalla de la recepción de cookies y para impedir la instalación de cookies en su disco duro. Por favor consulte las instrucciones y manuales de su navegador para ampliar esta información.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Gracias a las cookies, resulta posible que se pueda reconocer el navegador del ordenador utilizado por el Usuario con la finalidad de facilitar contenidos y ofrecer las preferencias de navegación u publicitarias que el Usuario, a los perfiles demográficos de los Usuarios así como para medir las visitas y parámetros del tráfico, controlar el progreso y número de entradas.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">10. DECLARACIONES Y GARANTÍAS</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">En general, los contenidos y servicios ofrecidos en el Espacio Web tienen carácter meramente informativo. Por consiguiente, al ofrecerlos, no se otorga garantía ni declaración alguna en relación con los contenidos y servicios ofrecidos en el Espacio web, incluyendo, a título enunciativo, garantías de licitud, fiabilidad, utilidad, veracidad, exactitud, o comerciabilidad, salvo en la medida en que por ley no puedan excluirse tales declaraciones y garantías.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">11. FUERZA MAYOR</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">La empresa no será responsable en todo en caso de imposibilidad de prestar servicio, si ésta se debe a interrupciones prolongadas del suministro eléctrico, líneas de telecomunicaciones, conflictos sociales, huelgas, rebelión, explosiones, inundaciones, actos y omisiones del Gobierno, y en general todos los supuestos de fuerza mayor o de caso fortuito.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">12. RESOLUCIÓN DE CONTROVERSIAS. LEY APLICABLE Y JURISDICCIÓN</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">Las presentes Condiciones Generales de Uso, así como el uso del Espacio Web, se regirán por la legislación española. Para la resolución de cualquier controversia las partes se someterán a los Juzgados y Tribunales del domicilio social del Responsable del sitio web.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline;">En el supuesto de que cualquier estipulación de las presentes Condiciones Generales de Uso resultara inexigible o nula en virtud de la legislación aplicable o como consecuencia de una resolución judicial o administrativa, dicha inexigibilidad o nulidad no hará que las presentes Condiciones Generales de Uso resulten inexigibles o nulas en su conjunto. En dichos casos, la empresa procederá a la modificación o sustitución de dicha estipulación por otra que sea válida y exigible y que, en la medida de lo posible, consiga el objetivo y pretensión reflejados en la estipulación original.</p><div style="text-align: justify;"><br /></div></div></div>xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.comtag:blogger.com,1999:blog-27449501.post-47479307831812375512020-07-20T13:10:00.008-05:002022-02-15T20:45:19.816-06:00Politicas de privacidad
<a name='more'></a><br /><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM_UykJkD-Ov3Ji-vYmdVyBEkFLFYYB18GUlxfMEvq7nbRQPaJyjUp5c4LtAPu9ZVMtMfiN09tKrsXaeffM2MZqG4lbwJj260ZhqLyR2eVMD6G6d6yehTj5OKLRUtmK6GAeMdo3w/s1600/global+is+not+defined-socket.io-client.png" style="margin-left: 1em; margin-right: 1em;"></a></div>
<p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">1.</span> <span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">INFORMACIÓN AL USUARIO</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">elkardumen.</span>, como Responsable del Tratamiento, le informa que, según lo dispuesto en el Reglamento (UE) 2016/679, de 27 de abril, (RGPD) y en la L.O. 3/2018, de 5 de diciembre, de protección de datos y garantía de los derechos digitales (LOPDGDD), trataremos su datos tal y como reflejamos en la presente Política de Privacidad.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">En esta Política de Privacidad describimos cómo recogemos sus datos personales y por qué los recogemos, qué hacemos con ellos, con quién los compartimos, cómo los protegemos y sus opciones en cuanto al tratamiento de sus datos personales.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">Esta Política se aplica al tratamiento de sus datos personales recogidos por la empresa para la prestación de sus servicios. Si acepta las medidas de esta Política, acepta que tratemos sus datos personales como se define en esta Política.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">2. CONTACTO</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">Denominación social: <span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">elkardumen</span><br style="box-sizing: inherit;" />Nombre comercial: <b>elkardumen</b><br style="box-sizing: inherit;" /><br style="box-sizing: inherit;" />e-mail: <span style="font-weight: 700;">xola139</span><span style="font-style: inherit; font-weight: 700;">@gmail.com</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"> <br style="box-sizing: inherit;" /><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">3. PRINCIPIOS CLAVE</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">Siempre hemos estado comprometidos con prestar nuestros servicios con el más alto grado de calidad, lo que incluye tratar sus datos con seguridad y transparencia. Nuestros principios son:</p><ul style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em; outline: 0px; padding: 0px; vertical-align: baseline;"><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Legalidad</span>: Solo recopilaremos sus Datos personales para fines específicos, explícitos y legítimos.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Minimización de datos</span>: Limitamos la recogida de datos de carácter personal a lo que es estrictamente relevante y necesario para los fines para los que se han recopilado.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Limitación de la Finalidad</span>: Solo recogeremos sus datos personales para los fines declarados y solo según sus deseos.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Precisión</span>: Mantendremos sus datos personales exactos y actualizados.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Seguridad de los Datos</span>: Aplicamos las medidas técnicas y organizativas adecuadas y proporcionales a los riesgos para garantizar que sus datos no sufran daños, tales como divulgación o acceso no autorizado, la destrucción accidental o ilícita o su pérdida accidental o alteración y cualquier otra forma de tratamiento ilícito.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Acceso y Rectificación</span>: Disponemos de medios para que acceda o rectifique sus datos cuando lo considere oportuno.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Conservación</span>: Conservamos sus datos personales de manera legal y apropiada y solo mientras es necesario para los fines para los que se han recopilado.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Las transferencias internacionales</span>: cuando se dé el caso de que sus datos vayan a ser transferidos fuera de la UE/EEE se protegerán adecuadamente.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Terceros</span>: El acceso y transferencia de datos personales a terceros se llevan a cabo de acuerdo con las leyes y reglamentos aplicables y con las garantías contractuales adecuadas.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Marketing Directo y cookies</span>: Cumplimos con la legislación aplicable en materia de publicidad y cookies.</li></ul><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">4. RECOGIDA Y TRATAMIENTO DE SUS DATOS PERSONALES</span><br style="box-sizing: inherit;" />Las tipos de datos que se pueden solicitar y tratar son:</p><ul style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em; outline: 0px; padding: 0px; vertical-align: baseline;"><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Datos de carácter identificativo.</li></ul><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">También recogemos de forma automática datos sobre su visita a nuestro sitio web según se describe en la política de cookies.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">Siempre que solicitemos sus Datos personales, le informaremos con claridad de qué datos personales recogemos y con qué fin. En general, recogemos y tratamos sus datos personales con el propósito de:</p><ul style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em; outline: 0px; padding: 0px; vertical-align: baseline;"><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Proporcionar información, servicios, productos, información relevante y novedades en el sector.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Envío de comunicaciones.</li></ul><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">5. LEGITIMIDAD</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">De acuerdo con la normativa de protección de datos aplicable, sus datos personales podrán tratarse siempre que:</p><ul style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em; outline: 0px; padding: 0px; vertical-align: baseline;"><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Nos ha dado su consentimiento a los efectos del tratamiento. Por supuesto podrá retirar su consentimiento en cualquier momento.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Por requerimiento legal.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Por exisitr un interés legítimo que no se vea menoscabado por sus derechos de privacidad, como por ejemplo el envío de información comercial bien por suscripción a nuestra newsletter o por su condición de cliente.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Por se necesaria para la prestación de alguno de nuestros servicios mediante relación contractual entre usted y nosotros.</li></ul><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">6. COMUNICACIÓN DE DATOS PERSONALES</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">Los datos pueden ser comunicados a empresas relacionadas con elkardumen<span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">.</span> para la prestación de los diversos servicios en calidad de Encargados del Tratamiento. La empresa no realizará ninguna cesión, salvo por obligación legal.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">7. SUS DERECHOS</span></p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">En relación con la recogida y tratamiento de sus datos personales, puede ponerse en contacto con nosotros en cualquier momento para:</p><ul style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1.5em 3em; outline: 0px; padding: 0px; vertical-align: baseline;"><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Acceder a sus datos personales y a cualquier otra información indicada en el Artículo 15.1 del RGPD.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Rectificar sus datos personales que sean inexactos o estén incompletos de acuerdo con el Artículo 16 del RGPD.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Suprimir sus datos personales de acuerdo con el Artículo 17 del RGPD.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Limitar el tratamiento de sus datos personales de acuerdo con el Artículo 18 del RGPD.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Solicitar la portabilidad de sus datos de acuerdo con el Artículo 20 del RGPD.</li><li style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Oponerse al tratamiento de sus datos personales de acuerdo con el artículo 21 del RGPD.</li></ul><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">Si ha otorgado su consentimiento para alguna finalidad concreta, tiene derecho a retirar el consentimiento otorgado en cualquier momento, sin que ello afecte a la licitud del tratamiento basado en el consentimiento previo a su retirada.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">Puede ejercer estos derechos enviando comunicación, motivada y acreditada, a xola139@gmail.com</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="border: 0px; box-sizing: inherit; font-style: inherit; font-weight: 700; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">8. INFORMACIÓN LEGAL</span><br style="box-sizing: inherit;" />Los requisitos de esta Política complementan, y no reemplazan, cualquier otro requisito existente bajo la ley de protección de datos aplicable, que será la que prevalezca en cualquier caso.</p><p style="background-color: white; border: 0px; box-sizing: inherit; font-family: montserrat, sans-serif; font-size: 15px; margin: 0px 0px 1.6em; outline: 0px; padding: 0px; vertical-align: baseline;">Esta Política está sujeta a revisiones periódicas y la empresa puede modificarla en cualquier momento. Cuando esto ocurra, le avisaremos de cualquier cambio y le pediremos que vuelva a leer la versión más reciente de nuestra Política y que confirme su aceptación.</p>xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.comtag:blogger.com,1999:blog-27449501.post-82164617954625830022020-07-20T12:21:00.005-05:002020-07-20T14:05:48.656-05:00Solución Brave crash Aw, Snap!<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlgvKulxrfHSuvKt96jdqU_YfI0R2Fnz4dMwJfbiqm3VLpFrcV8vsHWvUPOYuID1ZIGacPT62GJNsP-tFJNREH_LWQSxqcEkFP-4iObr_mnqrKFqrEWxOAFtc3PGdNDbYF_wYXdw/s375/brave_snap_windows.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="167" data-original-width="375" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlgvKulxrfHSuvKt96jdqU_YfI0R2Fnz4dMwJfbiqm3VLpFrcV8vsHWvUPOYuID1ZIGacPT62GJNsP-tFJNREH_LWQSxqcEkFP-4iObr_mnqrKFqrEWxOAFtc3PGdNDbYF_wYXdw/s320/brave_snap_windows.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: justify;">Pues bien esta vez traigo un pequeño tip para solucionar el problema con el navegador Brave en Windows 10, les doy una breve descripción de que me paso, asi como la pusible solución para el uso de Brave.</div><div class="separator" style="clear: both; text-align: justify;"><br /></div>
<br /><br />
<a name='more'></a><br /><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM_UykJkD-Ov3Ji-vYmdVyBEkFLFYYB18GUlxfMEvq7nbRQPaJyjUp5c4LtAPu9ZVMtMfiN09tKrsXaeffM2MZqG4lbwJj260ZhqLyR2eVMD6G6d6yehTj5OKLRUtmK6GAeMdo3w/s1600/global+is+not+defined-socket.io-client.png" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div class="separator" style="clear: both; text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: justify;">Tengo trabajando un buen rato con brave en linux Ubuntu y no tube complicación alguna con la instalacion, fue entonces cuando me llego a las manos un PC con sistema operativo Windows 10 Pro, tal como se ve en la siguiente imagen:</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNDgZp10WBuTM0aNj35j7kGDDDzzeQ2Aux0pQAI588kMPhT4LcdALpAd1yoep5_e74QV8gdkIviV7moh39UH-5Nnmk62V07TOaI6PMSpkEUW7wIMWq1kHJ4kCpA5G-QoCoLgR2fA/s883/brave_snap_windows_0.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="151" data-original-width="883" height="68" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNDgZp10WBuTM0aNj35j7kGDDDzzeQ2Aux0pQAI588kMPhT4LcdALpAd1yoep5_e74QV8gdkIviV7moh39UH-5Nnmk62V07TOaI6PMSpkEUW7wIMWq1kHJ4kCpA5G-QoCoLgR2fA/w400-h68/brave_snap_windows_0.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: justify;">Intentando abrir Brave siempre me salia el siguiente error:</div><div class="separator" style="clear: both; text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: justify;"><b>Aw, Snap</b></div><div class="separator" style="clear: both; text-align: justify;"><b>Something went worng while displaying this webpage.</b></div><div class="separator" style="clear: both; text-align: justify;"><b><br /></b></div><div class="separator" style="clear: both; text-align: justify;">Bien yo hice lo siguiente y me ahora me encuentro trabajando con Brave.</div><div class="separator" style="clear: both; text-align: center;"><br /></div><div>Realizas una buaqueda iniciando con oprimir la tecla Windows y escribes Brave, una vez que lo identificas das click derecho para sacar el menu de opciones y poder seleccionar Open file location.</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXCNK2EldVFmTRoXos_6RDmIY25iRxSfLi4KBjlLwlqBAMbdRNc7wUd49vAmbl82PbE6bn20AHKhq88-HRLbrCta10rxdoGFYjDm6g10iRqu-jmciFYFAXgiGu7rO-TCmbexdTmw/s367/brave_snap_windows_1.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="186" data-original-width="367" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXCNK2EldVFmTRoXos_6RDmIY25iRxSfLi4KBjlLwlqBAMbdRNc7wUd49vAmbl82PbE6bn20AHKhq88-HRLbrCta10rxdoGFYjDm6g10iRqu-jmciFYFAXgiGu7rO-TCmbexdTmw/s320/brave_snap_windows_1.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: justify;">Ubicado en el directorio donde esta el .exe de Brave, sobre el das clic derecho para mostrar el menu de opciones y seleccionar Properties(Propiedades)</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU3iwFV1fKTvVSTYDrxvUlUZBBWAHtSY_94j0PJF7W_KtGiEK6sCfET55ZbH-JSBJw_XVjVOgngs5MrKNlKyeLUWVcai68OVnWawkB886dI-vjK6o_CmzWbzLaSBX02UmGUyFrVQ/s507/brave_snap_windows_2.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="507" data-original-width="368" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU3iwFV1fKTvVSTYDrxvUlUZBBWAHtSY_94j0PJF7W_KtGiEK6sCfET55ZbH-JSBJw_XVjVOgngs5MrKNlKyeLUWVcai68OVnWawkB886dI-vjK6o_CmzWbzLaSBX02UmGUyFrVQ/s320/brave_snap_windows_2.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: justify;">Se abre la ventana de propiedades, entonces se debe seleccionar la pestaña Compatibility (Compatibilidad) como se ve en la siguiente imagen y deberas dar clic en Run compatibility troubleshooter:</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-UrK1pGLcDLM7KQ-sPkrTpqBK7FES4St-Y5OupxI75qf0P146X13L8JNbN6KeZE9otrti334VBY3RODI6v8khYbgS7CEKLxgKVGXhxvj2jmBr4seabJa4tj0ouzhZ60HvxOs_IQ/s529/brave_snap_windows_3.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="529" data-original-width="423" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-UrK1pGLcDLM7KQ-sPkrTpqBK7FES4St-Y5OupxI75qf0P146X13L8JNbN6KeZE9otrti334VBY3RODI6v8khYbgS7CEKLxgKVGXhxvj2jmBr4seabJa4tj0ouzhZ60HvxOs_IQ/s320/brave_snap_windows_3.png" /></a></div><div class="separator" style="clear: both; text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: justify;">Inmediatamente saldra la siguiente ventana:</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1FH9Hr3I_eHzuNuiuxZFtR4Ps_MLcNzcY67Rg4FONXuRqZ3kg19jI69xEe3wonBma0vva1mjJKXjzLb_TD0VIb1pA0rawLo2RdTCY0LcfWs6g76Y6yQNbYWY1l7JwgQstG-nsqQ/s571/brave_snap_windows_4.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="439" data-original-width="571" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1FH9Hr3I_eHzuNuiuxZFtR4Ps_MLcNzcY67Rg4FONXuRqZ3kg19jI69xEe3wonBma0vva1mjJKXjzLb_TD0VIb1pA0rawLo2RdTCY0LcfWs6g76Y6yQNbYWY1l7JwgQstG-nsqQ/s320/brave_snap_windows_4.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: justify;">Despues de unos segundos mostrara una ventana con 2 posibles opciones, deberas elejir la que dice Try recommended settings(Intenta con configuraciones recomendadas)</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBInmwuyrCFgAY2qBl0rLpHyleKofVguSn-IkOdbLlzPSiRzaa7ma1xP56CpgMzcrdAkdgXtuatTlx0fZx6aCXeNoZtJi-1Ero8iVEZm2c6efUjnvxMdllu4CIvuX5-xt7oDiF4g/s574/brave_snap_windows_5.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="448" data-original-width="574" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBInmwuyrCFgAY2qBl0rLpHyleKofVguSn-IkOdbLlzPSiRzaa7ma1xP56CpgMzcrdAkdgXtuatTlx0fZx6aCXeNoZtJi-1Ero8iVEZm2c6efUjnvxMdllu4CIvuX5-xt7oDiF4g/s320/brave_snap_windows_5.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: justify;">Aparecera una ventana con el boton Test the program (Prueba el programa), este debera darle clic</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwy6h3GHqeKnOCiHMbVsi0LHex4nsvnOX6jHgCKkjY1ZAB83gAnRwZp3mNONKB16QEHMFisj0pKMtH4pq-8kEa1fwY40nmObTI16YEy-xNg_llXkmN4gKV9LhPddz1pINWstvhNw/s577/brave_snap_windows_6.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="448" data-original-width="577" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwy6h3GHqeKnOCiHMbVsi0LHex4nsvnOX6jHgCKkjY1ZAB83gAnRwZp3mNONKB16QEHMFisj0pKMtH4pq-8kEa1fwY40nmObTI16YEy-xNg_llXkmN4gKV9LhPddz1pINWstvhNw/s320/brave_snap_windows_6.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: justify;">Y entonces Vuala!! el navegador Brave podra ser utilizado sin nunguna complicación</div><div><br /></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirHoP2dIXZuVfBTuye1VY3Doxb0HTPw07kWP6jf16RZu6VBR6KFmRzP_PswDrf2_HqUHL-gJiSpCWkUcgdhlPHU4u01swNroDCasLApkF_uVNkKHpHPfIdnqxunZE_D_oO0QHEUQ/s1207/brave_snap_windows_7.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="314" data-original-width="1207" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirHoP2dIXZuVfBTuye1VY3Doxb0HTPw07kWP6jf16RZu6VBR6KFmRzP_PswDrf2_HqUHL-gJiSpCWkUcgdhlPHU4u01swNroDCasLApkF_uVNkKHpHPfIdnqxunZE_D_oO0QHEUQ/s320/brave_snap_windows_7.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: justify;">Cabe mencionar que despues de abir el navegador, quedara una ventana abierta con 3 opciones la cual deberas elegir la prinera Yes,save these settings for this program(Si guardar las configuraciones de este programa)</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1kNfyfDVBYMLIiRO-iZryQF_9K0JhmWsQ9RYCBJQZJdjtq2Yret5zoKYk4fuQfKwVwLrcrE3DQ0L4gB3EzXWGVOe2PCHf0V_MhVgE0pPbQhyu7bUdeFnQ7YpfM7LhNS_6Nj6K7g/s575/brave_snap_windows_8.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="452" data-original-width="575" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1kNfyfDVBYMLIiRO-iZryQF_9K0JhmWsQ9RYCBJQZJdjtq2Yret5zoKYk4fuQfKwVwLrcrE3DQ0L4gB3EzXWGVOe2PCHf0V_MhVgE0pPbQhyu7bUdeFnQ7YpfM7LhNS_6Nj6K7g/s320/brave_snap_windows_8.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: justify;">Finalizando con la siguiente ventana dando clic en close.</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkX2ii1bIISIraUqis1NSqcyULiFiKHksma5M-v_YZa5WqedegG8Jny3hvWOcAvEzte-4I-cC84Qfm16_wDdhH61w443B-lwNTgQKQHt8m4SE4bYiI_5H-mfSeNOxLkUk8_GVAEg/s573/brave_snap_windows_9.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="449" data-original-width="573" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkX2ii1bIISIraUqis1NSqcyULiFiKHksma5M-v_YZa5WqedegG8Jny3hvWOcAvEzte-4I-cC84Qfm16_wDdhH61w443B-lwNTgQKQHt8m4SE4bYiI_5H-mfSeNOxLkUk8_GVAEg/s320/brave_snap_windows_9.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: justify;">Pues bien espero este tip les funcione ya que como saben este blog es para poder ir documentando todo aquello que se presenta durante los ratos de trabajo o de oseo.</div><div class="separator" style="clear: both; text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><span><!--more--></span><span><!--more--></span><span><!--more--></span>xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-45334586880303561962020-03-27T13:27:00.002-06:002020-03-27T13:27:47.709-06:00Uncaught ReferenceError: global is not defined - socket.io-client<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBszyH47F-5PoB71pnS5A8WBQV9nBryJqOR3SGq4eBAZWgtQjjex8NRlJYR_UOsdRaL3GTI5qRX-TNEeRneRYK_qgjNZ-Hx78H_ygjMBpjAjvUJti4tSaM_Bni1t4JSY92_A8y_w/s1600/elkardumen-socketio.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="139" data-original-width="311" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBszyH47F-5PoB71pnS5A8WBQV9nBryJqOR3SGq4eBAZWgtQjjex8NRlJYR_UOsdRaL3GTI5qRX-TNEeRneRYK_qgjNZ-Hx78H_ygjMBpjAjvUJti4tSaM_Bni1t4JSY92_A8y_w/s1600/elkardumen-socketio.png" /></a></div>
<br />
<br />
Bueno esta vez toca turno del cliente socket.oi, les explico muy breve la situación con la que me encontraba y lo que hice para poder arreglar el tema.<br />
<br />
Estaba desarrollando una aplicación Angular, para el caso era necesario utilizar "socket.io-client" para poder conectarse al servidor websocket y poder recibir y enviar mensajes. Tal como lo dice su documetanción hice lo necesario para instalar en mi aplicación <a href="https://github.com/socketio/socket.io-client#readme" target="_blank">(socket.io-client)</a> todo sin nungun problema ejecute ng serve y todo perfecto, pero cuando me dirijo al navegador y en la consola me salia el siguiente error:<br />
<br />
<i>Uncaught ReferenceError: global is not defined</i><br />
<br />
<a name='more'></a><br /><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM_UykJkD-Ov3Ji-vYmdVyBEkFLFYYB18GUlxfMEvq7nbRQPaJyjUp5c4LtAPu9ZVMtMfiN09tKrsXaeffM2MZqG4lbwJj260ZhqLyR2eVMD6G6d6yehTj5OKLRUtmK6GAeMdo3w/s1600/global+is+not+defined-socket.io-client.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="161" data-original-width="627" height="164" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM_UykJkD-Ov3Ji-vYmdVyBEkFLFYYB18GUlxfMEvq7nbRQPaJyjUp5c4LtAPu9ZVMtMfiN09tKrsXaeffM2MZqG4lbwJj260ZhqLyR2eVMD6G6d6yehTj5OKLRUtmK6GAeMdo3w/s640/global+is+not+defined-socket.io-client.png" width="640" /></a></div>
<br />
Pues bien nuevamente buscando en la red hice varias recomendaciones que me daban los guros y los que ya se habían encontrado este problema, como siempre buque, probé y volví a buscar y volvía probar hasta que me encontré la solución sencilla.<br />
<br />
<br />
Donde básicamente me decía que debía declarar en el archivo polyfilld.js lo siguiente:<br />
<br />
<i>(window as any).global = window;</i><br />
<br />
<br />
Y taran todo funciono OK.<br />
<br />
<br />
<br />
<br />
Referencia:<br />
<a href="https://stackoverflow.com/questions/49966827/global-is-not-defined-while-using-socket-io-client-with-webpack">https://stackoverflow.com/questions/49966827/global-is-not-defined-while-using-socket-io-client-with-webpack</a></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-54970946257922314262020-03-25T12:00:00.000-06:002020-03-25T12:00:20.438-06:00Flex Layout- Error An accessor cannot be declared in an ambient context<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizNxVzav_gL0DE3W218zHpX7YF-9jfhi5JmvLnan3XJKPYRj7Eo39Mu45SMCW1psKb9gFcYMLuWXKPDb6AoHjFCq5TQFuaWvScp7klbsGmZlT77UrckIHDwne5mlXs461iQtFJzw/s1600/Post10-2-1568x691_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="183" data-original-width="672" height="87" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizNxVzav_gL0DE3W218zHpX7YF-9jfhi5JmvLnan3XJKPYRj7Eo39Mu45SMCW1psKb9gFcYMLuWXKPDb6AoHjFCq5TQFuaWvScp7klbsGmZlT77UrckIHDwne5mlXs461iQtFJzw/s320/Post10-2-1568x691_2.jpg" width="320" /></a></div>
<br />
Pues que les cuento que esta vez traigo un escenario de un error al momento de querer utilizar flex-layout para angular obviamente la configuración que tenia para el uso de este componente era la siguiente:<br />
<br />
<a name='more'></a><br /><br />
<br />
<div style="background-color: #1e1e1e; color: #d4d4d4; font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; line-height: 19px; white-space: pre;">
<div>
<span style="color: #9cdcfe;">"@angular/animations"</span>: <span style="color: #ce9178;">"~8.0.1"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/cdk"</span>: <span style="color: #ce9178;">"^8.2.3"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/common"</span>: <span style="color: #ce9178;">"~8.0.1"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/compiler"</span>: <span style="color: #ce9178;">"~8.0.1"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/core"</span>: <span style="color: #ce9178;">"~8.0.1"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/flex-layout"</span>: <span style="color: #ce9178;">"^9.0.0-beta.29"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/forms"</span>: <span style="color: #ce9178;">"~8.0.1"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/material"</span>: <span style="color: #ce9178;">"^8.2.3"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/platform-browser"</span>: <span style="color: #ce9178;">"~8.0.1"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/platform-browser-dynamic"</span>: <span style="color: #ce9178;">"~8.0.1"</span>,</div>
<div>
<span style="color: #9cdcfe;">"@angular/router"</span>: <span style="color: #ce9178;">"~8.0.1"</span>,</div>
<div>
<span style="color: #9cdcfe;">"hammerjs"</span>: <span style="color: #ce9178;">"^2.0.8"</span>,</div>
<div>
<span style="color: #9cdcfe;">"rxjs"</span>: <span style="color: #ce9178;">"~6.4.0"</span>,</div>
<div>
<span style="color: #9cdcfe;">"tslib"</span>: <span style="color: #ce9178;">"^1.9.0"</span>,</div>
<div>
<span style="color: #9cdcfe;">"zone.js"</span>: <span style="color: #ce9178;">"~0.9.1"</span></div>
<div>
<span style="color: #ce9178;"><br /></span></div>
</div>
<br />
Como se puede observar tenia : <span style="background-color: #1e1e1e; color: #9cdcfe; font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;">"@angular/flex-layout"</span><span style="background-color: #1e1e1e; color: #d4d4d4; font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;">: </span><span style="background-color: #1e1e1e; color: #ce9178; font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;">"^9.0.0-beta.29" </span> el cual me ocasionaba que saliera un error de tipo "<i> error TS1086: An accessor cannot be declared in an ambient context.</i>" cuando intentaba hacer el ng serve del proyecto.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfyvr8NLY__FuQKrGT8B4a_DXWyTFBNmce1DHAeYVcCr7u1VwDM0wKqUA5bzTc3t5IFwtqe30jkLLbCFYXJqHWdWMh9ceBZu7jOWiB4t5vaSj95yQM4u1po8YpsMXtStyj-oZJaQ/s1600/Captura+de+pantalla+de+2020-03-25+11-57-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="285" data-original-width="1079" height="168" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfyvr8NLY__FuQKrGT8B4a_DXWyTFBNmce1DHAeYVcCr7u1VwDM0wKqUA5bzTc3t5IFwtqe30jkLLbCFYXJqHWdWMh9ceBZu7jOWiB4t5vaSj95yQM4u1po8YpsMXtStyj-oZJaQ/s640/Captura+de+pantalla+de+2020-03-25+11-57-11.png" width="640" /></a></div>
<br />
Pues buscando en la red me encontré que era necesario utilizar <span style="background-color: #1e1e1e; color: #9cdcfe; font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;">"@angular/flex-layout"</span><span style="background-color: #1e1e1e; color: #d4d4d4; font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;">: </span><span style="background-color: #1e1e1e; color: #ce9178; font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback"; font-size: 14px; white-space: pre;">"^8.0.0-beta.27"</span>lo cual hice caso para probar y cual todo fue un éxito.<br />
<br />
<br />
"Siganme para mas soliciones chidas...."<br />
<br />
Referencias:<br />
<a href="https://stackoverflow.com/questions/59942761/how-do-i-include-flex-layout">https://stackoverflow.com/questions/59942761/how-do-i-include-flex-layout</a><br />
<a href="https://github.com/angular/flex-layout">https://github.com/angular/flex-layout</a><br />
<br />
<br />
<br />
Saludos</div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-1322439538338852232020-03-19T12:26:00.001-06:002020-03-19T12:26:25.035-06:00 NgFor only supports binding to Iterables such as Arrays - Angular<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_C6c34th8_PYvhe_54NgobSnP-nYK286mb4gFcfD6sYZGZbNYUJMvqQf1xPqJdf5A0evyvzar28bEcU6eiAHk82-HvBpvX2iW2Pc_VYY0PSqOqQy-eFk0LCflbUbqWsTioiU7WA/s1600/ngFor-in-Angular.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="425" data-original-width="1400" height="97" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_C6c34th8_PYvhe_54NgobSnP-nYK286mb4gFcfD6sYZGZbNYUJMvqQf1xPqJdf5A0evyvzar28bEcU6eiAHk82-HvBpvX2iW2Pc_VYY0PSqOqQy-eFk0LCflbUbqWsTioiU7WA/s320/ngFor-in-Angular.png" width="320" /></a></div>
<br />
Pues otra raya mas al tigre con un error muy común que suele pasar al utilizar NgFor en Angular, resulta ser que este error suele pasar cuando utilizamos un variable que no ha sido inicializada como arreglo.<br />
<br />
Por ejemplo<br />
<br />
Se declara la variable:<br />
<br />
<i> dataArryInit:any; </i><br />
<br />
Y esta variable no fue inicializada como arreglo y se intenta utilizar en el HTML la variable "dataArryInit" algo así como esto<br />
<br />
<div *ngFor="let data of dataArryInit;let i = index"><br />
...<br />
....<br />
..<br />
</div><br />
<br />
Entonces el error que lanzara sera el siguiente:<br />
<br />
<br />
<span style="color: red;">ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.</span><br />
<a name='more'></a><br />
<br />
Traza completa del error:<br />
<script src="https://gist.github.com/xola139/a6debcbed98aae923a76f3b57657c227.js"></script>
<br />
La solución mas sencilla es inicialiar la variable de la siguente forma:<br />
<br />
<i>dataInit:any=[];</i><br />
<i><br /></i>
<i><br /></i>
Y listo no hay mas que hacer....<br />
<br />
Siganme para mas ayuda con temas de Angular...<br />
<br />
Saludos hasta la proxima.<br />
<br />
<br />
<i><br /></i>
<i><br /></i>
<i><br /></i>
<span style="color: red;"><br /></span>
<span style="color: red;"><br /></span></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-25764833550793684072020-03-10T23:13:00.003-06:002020-03-10T23:13:39.848-06:00 HammerGestureConfig cannot be invoked<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiJqQZ_O6AT9CIUc1WPATOPyBhr2qFHx2jvwxarujIOiNoDIG7yuF24aQ0-fiH4UqRzr3Kshc57S0fmq66lQItIOnHEkPmzyRO80i48D0_wJf5IFiLrmgK4LMpu8cRJM35fWt4gQ/s1600/hammerjs-touch-gesture.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="233" data-original-width="628" height="147" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiJqQZ_O6AT9CIUc1WPATOPyBhr2qFHx2jvwxarujIOiNoDIG7yuF24aQ0-fiH4UqRzr3Kshc57S0fmq66lQItIOnHEkPmzyRO80i48D0_wJf5IFiLrmgK4LMpu8cRJM35fWt4gQ/s400/hammerjs-touch-gesture.png" width="400" /></a></div>
<br />
Esta vez estaba trabajando con un proyecto Angular en su versión 8.0.3 cuando decidí utilizar el componente Hammer Gesture, entonces todo bien por que utilice las instrucciones que tenia en npm (<a href="https://www.npmjs.com/package/hammerjs">https://www.npmjs.com/package/hammerjs</a>) cuando ejecute el comando <i>ng serve</i> no me mostró ningún error, por lo qe decidi probar el en ya famoso http://localhost:4200 , y Oh sorpresa me salia un error en el navegador que no me permitía ver el Home, el error era mas o menos el siguiente:</div>
<br />
<br />
<i>core.js:7187 ERROR TypeError: Class constructor HammerGestureConfig cannot be invoked without 'new'</i><br />
<br />
<a name='more'></a><br /><br />
<br />
<script src="https://gist.github.com/xola139/490472f59f8aa41c247f83c83f3d1472.js"></script>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGfOOGfA1gYlZrpanv34ilnRt1cm7EzNuTPalH0MirdPzkfsgGcGJLcQ0RkUaGQ0m_qcC21cJ5hrjD55ZOM_519drYH1rGrmfUWaii6V81GU1qgG6Z5gz4TWCsa4wIZoAOI-kszw/s1600/HammerGestureConfig+cannot+be+invoked.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="368" data-original-width="609" height="385" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGfOOGfA1gYlZrpanv34ilnRt1cm7EzNuTPalH0MirdPzkfsgGcGJLcQ0RkUaGQ0m_qcC21cJ5hrjD55ZOM_519drYH1rGrmfUWaii6V81GU1qgG6Z5gz4TWCsa4wIZoAOI-kszw/s640/HammerGestureConfig+cannot+be+invoked.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Buscando en la red me encontré con algunas recomendaciones de @<span class="css-truncate" style="box-sizing: border-box; color: #586069; font-family: , "blinkmacsystemfont" , "segoe ui" , "helvetica" , "arial" , sans-serif , "apple color emoji" , "segoe ui emoji"; font-size: 14px;"><a class="author link-gray-dark css-truncate-target width-fit" data-hovercard-type="user" data-hovercard-url="/users/Oussail/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Oussail" show_full_name="false" style="box-sizing: border-box; color: #586069; display: inline-block; max-width: 125px; outline-width: 0px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; white-space: nowrap;">Oussail</a> </span><span style="font-family: , "blinkmacsystemfont" , "segoe ui" , "helvetica" , "arial" , sans-serif , "apple color emoji" , "segoe ui emoji";"><span style="font-size: 14px;">las cuales probé y me funciono, esta fue la siguiente:</span></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<script src="https://gist.github.com/xola139/258e16d9030a17d0147fc0fd09f5ef79.js"></script>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
Prácticamente fue sustituir código del archivo <span style="background-color: white; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 12px; white-space: pre;">ngx-gallery.umd.js </span>lo realice y todo ok!<br />
<br />
<br />
<br />
Referencias:<br />
<a href="https://github.com/lukasz-galka/ngx-gallery/issues/242">https://github.com/lukasz-galka/ngx-gallery/issues/242</a><br />
<br /></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-67917241768366970132020-03-05T20:06:00.000-06:002020-03-06T10:19:30.072-06:00Entry not found Angular SPA with Express.js<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2_kn9qRa6C7CFVToSfUgHQizcdMjsih1SqpYk8_hcQzHRRxY5_RKhTF-FF7LpZpRY1H5aNYtyxK2GWorepAoZQJfaVE6GLayevl2kQAvPCEJGI8LwfrwSel3rt6ClUGYoqP8gpw/s1600/angular_express_Kardumen.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="257" data-original-width="475" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2_kn9qRa6C7CFVToSfUgHQizcdMjsih1SqpYk8_hcQzHRRxY5_RKhTF-FF7LpZpRY1H5aNYtyxK2GWorepAoZQJfaVE6GLayevl2kQAvPCEJGI8LwfrwSel3rt6ClUGYoqP8gpw/s400/angular_express_Kardumen.jpg" width="400" /></a></div>
<br />
<br />
<br />
Pues bien una vez mas escribiendo para poder dejar nota de la aventuras que me encontré durante mi largo e interminable aprendizaje.<br />
<br />
<br />
Esta ocasión traigo un escenario de un proyecto que estaba construyendo con Angular 7 y Express.js, como ya saben lo estaba generando sin problema alguno de manera local todo de maravilla.<br />
<br />
Cuando ejecutaba la aplicación con <i>ng serve</i> todo funcionaba bien se podía tener acceso a cada uno de las rutas que había especificado.(Home, Pagina 1, Pagina 2 Pagina 3)<br />
<a name='more'></a><br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgojthpkAS-gC2v1CP90xo54cgshkA4fjNX6850QEUK6j6DiyYFnO1d2Y3dh3NLb42V1TCbwCyQBwCZQajb0E4dOqYN1OMaT2fPSE9mwCoDMrlIaiZ7CCbwoZQKlraoKIaD16Lh9A/s1600/Captura+de+pantalla+de+2020-03-05+19-33-47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="635" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgojthpkAS-gC2v1CP90xo54cgshkA4fjNX6850QEUK6j6DiyYFnO1d2Y3dh3NLb42V1TCbwCyQBwCZQajb0E4dOqYN1OMaT2fPSE9mwCoDMrlIaiZ7CCbwoZQKlraoKIaD16Lh9A/s200/Captura+de+pantalla+de+2020-03-05+19-33-47.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1HAAEDlGEXG49LmPr-E8eNPPj9yh6i51IsY1QXwcysxTNxE5kUK8z1FbxpqG0cWmpcEFbKwys_Tw6mcpqCQ-sKYrOevBn7CTf5JTPI6vje57eqL72M1G3yp2oxrKtwUhyphenhyphenarRu_g/s1600/Captura+de+pantalla+de+2020-03-05+19-34-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="276" data-original-width="655" height="83" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1HAAEDlGEXG49LmPr-E8eNPPj9yh6i51IsY1QXwcysxTNxE5kUK8z1FbxpqG0cWmpcEFbKwys_Tw6mcpqCQ-sKYrOevBn7CTf5JTPI6vje57eqL72M1G3yp2oxrKtwUhyphenhyphenarRu_g/s200/Captura+de+pantalla+de+2020-03-05+19-34-11.png" width="200" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEFc9jram11qk7NVYecG56oDW1VQP5EWh50Qr_CFhfizDiNeP0zj5j2Pn-rjK2-WmQeyf_xOzYerxz-Bq2ssJdDTt_7oJlOPf416hcbYXS0fC4QbpIgxZZ0c-seZkFU4QdUOA5vg/s1600/Captura+de+pantalla+de+2020-03-05+19-34-51.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="291" data-original-width="626" height="92" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEFc9jram11qk7NVYecG56oDW1VQP5EWh50Qr_CFhfizDiNeP0zj5j2Pn-rjK2-WmQeyf_xOzYerxz-Bq2ssJdDTt_7oJlOPf416hcbYXS0fC4QbpIgxZZ0c-seZkFU4QdUOA5vg/s200/Captura+de+pantalla+de+2020-03-05+19-34-51.png" width="200" /></a></div>
<div style="margin-left: 1em; margin-right: 1em; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt4YM6UP_hYQgHv9Wb2k2W4Jw8cbjmeoMsigh8LyCTuthyphenhyphenUc-tJMFsh17xMMsH0vviGN3a9TE4nTx3hswSfCRS2dk8qeovhi9PeTU0sFEq0_RJtxmA9YaGdNMMAD6_Btr4aYJ4GQ/s1600/Captura+de+pantalla+de+2020-03-05+19-35-17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt4YM6UP_hYQgHv9Wb2k2W4Jw8cbjmeoMsigh8LyCTuthyphenhyphenUc-tJMFsh17xMMsH0vviGN3a9TE4nTx3hswSfCRS2dk8qeovhi9PeTU0sFEq0_RJtxmA9YaGdNMMAD6_Btr4aYJ4GQ/s1600/Captura+de+pantalla+de+2020-03-05+19-35-17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="302" data-original-width="662" height="91" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt4YM6UP_hYQgHv9Wb2k2W4Jw8cbjmeoMsigh8LyCTuthyphenhyphenUc-tJMFsh17xMMsH0vviGN3a9TE4nTx3hswSfCRS2dk8qeovhi9PeTU0sFEq0_RJtxmA9YaGdNMMAD6_Btr4aYJ4GQ/s200/Captura+de+pantalla+de+2020-03-05+19-35-17.png" width="200" /></a></div>
<br />
<br />
<br />
<br />
Ahora bien inicie el proceso para colocarlo en producción y para que el proyecto estuviera en un servidor opte por usar Express.js para servir el proyecto estático.<br />
<br />
<script src="https://gist.github.com/xola139/d34e4090ab1826cf4c2c46cebdac688f.js"></script>
<br />
<br />
, mi problema fue cuando se creo la versión para producción utilizando <i>ng build --prod --base-href / </i>y coloque la carpeta<i> dist en la configuracion de Express.js.</i><br />
<i><br /></i>
<span style="background-color: white; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; font-size: 12px; white-space: pre;">app.use(express.static(path.join(__dirname, 'dist')))</span><br />
<i><br /></i>
<br />
<i><br /></i>
Cuando intente tener acceso a Home, Pagina 1, Pagina 2 Pagina 3 oooh sorpresa ya no podía tener acceso y me mostraba un error 404 con el mensaje <span style="white-space: pre-wrap;">entry not found: , </span>como se ve en las imágenes<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPXf6I6xz2J0p2b7AsMUhvqL8RIdytHCwkh4O-QDCqvgZKp9dxEZE0lXq-ojLN3kfJleG4tYXVuymgJGPpZiUtl9zNioXvIjgnmOLD9h42-GDtrt_zOhIbUTrd_PpHxhZh3_vY1Q/s1600/Captura+de+pantalla+de+2020-03-06+10-07-54.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="84" data-original-width="261" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPXf6I6xz2J0p2b7AsMUhvqL8RIdytHCwkh4O-QDCqvgZKp9dxEZE0lXq-ojLN3kfJleG4tYXVuymgJGPpZiUtl9zNioXvIjgnmOLD9h42-GDtrt_zOhIbUTrd_PpHxhZh3_vY1Q/s1600/Captura+de+pantalla+de+2020-03-06+10-07-54.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjovmnTDjiPNyUauaOEFzTsQ4eyhKibMpLZ-acVomm9DnnUDtvxQsxvkC62xUSZ09mszqvP5PsviY3in5sh6PoCMukWXNb5xmeE74Bzi8siqJEH7gjjRhjm_3hPhU-1ODtFm6j19g/s1600/Captura+de+pantalla+de+2020-03-06+10-08-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="87" data-original-width="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjovmnTDjiPNyUauaOEFzTsQ4eyhKibMpLZ-acVomm9DnnUDtvxQsxvkC62xUSZ09mszqvP5PsviY3in5sh6PoCMukWXNb5xmeE74Bzi8siqJEH7gjjRhjm_3hPhU-1ODtFm6j19g/s1600/Captura+de+pantalla+de+2020-03-06+10-08-11.png" /></a></div>
<br />
Investigando en la red me encontre que era necesario tener la siguiente configuracion.<br />
<br />
<script src="https://gist.github.com/xola139/fc3e373dd3608b41853274de818fa00b.js"></script>
y todo excelente funciono!
<br />
<br />
Eperando que sea util para algunos develpers, lo dejo como historia para futuros errores.<br />
<br />
Si no les funciona no duden en enviarme un mensaje por Twitter @<a href="https://twitter.com/xola139" target="_blank">xola139</a> seguro les puedo ayudar.<br />
<br />
<br /></div>
</div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com1tag:blogger.com,1999:blog-27449501.post-23646571926133966602019-08-13T16:09:00.003-05:002019-08-14T10:32:33.224-05:00Resetear usuario y contraseña Weblogic<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpRaSGqRVS5JYN9LIbmyIDxjtvNhIg9AUk8eVwI2tgeuweWGy9SKsf6EyXZljAm5T4-gX5sHCEGjBEnL1xhwsdSoNIiWSzYcvg6K4_h_pF45ANl66lkmoVn-Cb-Tj_x99LOYsiCA/s1600/autenticacionDenegada.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="203" data-original-width="345" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpRaSGqRVS5JYN9LIbmyIDxjtvNhIg9AUk8eVwI2tgeuweWGy9SKsf6EyXZljAm5T4-gX5sHCEGjBEnL1xhwsdSoNIiWSzYcvg6K4_h_pF45ANl66lkmoVn-Cb-Tj_x99LOYsiCA/s320/autenticacionDenegada.PNG" width="320" /></a></div>
<br />
Esta ocasión se me presento un pequeño problema con el acceso a mi weblogic local, podía levantar mi weblogic pero para entrar a la consola no tenia el usuario ni password (Autenticación Denegada Weblogic).Por lo que busque en la red para poder resetear el usuario y password de weblogic.<br />
<br />
<a name='more'></a><br />
<br />
<br />
Características: Versión de WebLogic Server: 10.3.6.0<br />
<br />
Los pasos que seguí los encontré en la red,me fui a la consola de windows (CMD) y me ubique en el path siguiente:<br />
<br />
Oracle\Middleware\user_projects\domains\MiDomain\ desde aquí llamaremos $DOMAIN_HOME )<br />
<br />
Entonces:<br />
<br />
1.- Ejecutamos<br />
<span style="white-space: pre;"> </span> $DOMAIN_HOME/bin/setDomainEnv.sh<br />
<br />
2.-Vamos hacia:<br />
$ cd<br />
$DOMAIN_HOME/security<br />
<span style="white-space: pre;"> </span>$ java weblogic.security.utils.AdminAccount <username> <password> .<br />
<br />
Cambias <username> <password> por el que mas te convenga, nota que hay un "." al final de la linea.<br />
<br />
3.-Editas el archivo:<br />
<span style="white-space: pre;"> </span>$DOMAIN_HOME/servers/AdminServer/security/boot.properties<br />
<br />
Colocas los mismos datos que en el paso 2.<br />
<span style="white-space: pre;"> </span>username=<username><br />
<span style="white-space: pre;"> </span>password=<password><br />
<br />
4.- Por ultimo ejecutas para reiniciar<br />
<span style="white-space: pre;"> </span>$DOMAIN_HOME/bin/startWebLogic.sh<br />
<br />
<span style="white-space: pre;"> </span>Versión de WebLogic Server: 10.3.6.0<br />
<br />
Fuentes:<br />
<br />
<ul style="text-align: left;">
<li><a href="https://www.techartifact.com/blogs/2014/03/reset-your-weblogic-admin-console-password-in-weblogic-server.html">https://www.techartifact.com/blogs/2014/03/reset-your-weblogic-admin-console-password-in-weblogic-server.html</a></li>
<li><a href="https://oracle-base.com/articles/11g/reset-the-adminserver-password-in-weblogic-11g-and-12c">https://oracle-base.com/articles/11g/reset-the-adminserver-password-in-weblogic-11g-and-12c</a></li>
<li><a href="https://blogs.oracle.com/imc/change-password-in-oracle-weblogic">https://blogs.oracle.com/imc/change-password-in-oracle-weblogic</a></li>
</ul>
<div>
Palabras clave:</div>
<div>
<ul style="text-align: left;">
<li>Resetear password weblogic.</li>
<li>Resetear usuario weblogic.</li>
<li>Cambiar usuario y contraseña weblogic.</li>
</ul>
</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-35024852364546247902017-12-06T11:02:00.000-06:002017-12-06T11:02:02.694-06:00Simple ejemplo Scraping con Casperjs <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvSdAIMFM2HbT8N3x8uGeRRzgMaghNethubtM_Osn1gF6rcTrv809Czt-_dkqCNp2Of1kwnwVJ6mNWrvsGW_VmUVpaljjJmLr9yfMKCtgqZ3GXsBz_s7AQuOUXPvs61Wc0GUfV9Q/s1600/crontab%252BGNUParallel%252BCasperjs_TXT.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="242" data-original-width="704" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvSdAIMFM2HbT8N3x8uGeRRzgMaghNethubtM_Osn1gF6rcTrv809Czt-_dkqCNp2Of1kwnwVJ6mNWrvsGW_VmUVpaljjJmLr9yfMKCtgqZ3GXsBz_s7AQuOUXPvs61Wc0GUfV9Q/s640/crontab%252BGNUParallel%252BCasperjs_TXT.PNG" width="640" /></a></div>
<div style="text-align: justify;">
Pues bien.. una entrada mas para este blog, ya que tiene mucho tiempo que no archivo mis actividades. Esta ocasión quiero plasmar un pequeño ejemplo que hice para tenerlo como referencia y que en algún momento le de mayor utilidad pues este ejemplo solo lo hice por simple curiosidad en aplicar una combinación de tecnologías.</div>
<br />
Basicamente lo que se me imagine fue lo siguiente:<br />
<br />
1.- Realizar un scraping de alguna pagina.<br />
2.- El resultado del scraping escribirlo en un archivo.<br />
3.- Ejecutarlo de forma paralela.<br />
4.- Se encuentre en crontab.<br />
<br />
<br />
Para cada uno de los puntos anteriores utilice la siguiente tecnología:<br />
<br />
1.- Casperjs.<br />
3.- GNU Parallel<br />
4.- Crontab.<br />
<br />
<br />
Aqui esta el ejemplo para que vean como utilizar.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/xola139/CasperjsParallel/raw/master/scrap.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="337" data-original-width="800" height="267" src="https://github.com/xola139/CasperjsParallel/raw/master/scrap.gif" width="640" /></a></div>
<br />
<br />
<br />
https://github.com/xola139/CasperjsParallel</div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-59958745195365471002016-08-21T22:27:00.000-05:002016-08-21T22:27:14.017-05:00Error: watch ENOSPC en gulp<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 12.8px;">
<div>
<div>
Pues bien, esta vez traigo una pequeña explicación sobre un error que me lanzaba gulp cuando intentaba ejecutar el comando para iniciar las tareas, en mi consola de la nada me mandaba el sigueinte error<br /><br />Starting 'server'...<br />[14:03:38] Webserver started at <a data-saferedirecturl="https://www.google.com/url?hl=es&q=http://0.0.0.0:8081&source=gmail&ust=1471894605370000&usg=AFQjCNH508VxsQDjJwpfC18iewu5AVBFpQ" href="http://0.0.0.0:8081/" style="color: #1155cc;" target="_blank">http://0.0.0.0:8081</a><br />[14:03:38] Finished 'server' after 8.6 ms<br />[14:03:38] Starting 'watch'...<br />[14:03:38] 'watch' errored after 83 ms<br />[14:03:38] Error: watch ENOSPC<br /> at errnoException (fs.js:1024:11)<br /> at FSWatcher.start (fs.js:1056:11)<br /> at Object.fs.watch (fs.js:1081:11)<br /> at Gaze._watchDir<br /></div>
<div>
Y pues no yo habia hecho ningun cambio en la confiuracion de gulp, pues buen como todo desconocedor empeze b<span style="font-size: 12.8px;">uscando en la red me por lo que me encontre con esto:</span></div>
<br /><a data-saferedirecturl="https://www.google.com/url?hl=es&q=http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc&source=gmail&ust=1471894605370000&usg=AFQjCNG740zd7b9cMMfXAlrfjfivDtbfSw" href="http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc" style="color: #1155cc;" target="_blank">http://stackoverflow.com/<wbr></wbr>questions/16748737/grunt-<wbr></wbr>watch-error-waiting-fatal-<wbr></wbr>error-watch-enospc</a><br /><br /><a data-saferedirecturl="https://www.google.com/url?hl=es&q=https://github.com/gulpjs/gulp/issues/217&source=gmail&ust=1471894605370000&usg=AFQjCNErhBT2ComkIS764eV5nhZnsoqxHg" href="https://github.com/gulpjs/gulp/issues/217" style="color: #1155cc;" target="_blank">https://github.com/gulpjs/<wbr></wbr>gulp/issues/217</a><br /></div>
En la lectura que hice a estos post me encontre que esto era un problema "linux you fix" lo que me decia que debia ejecutar los siguentes comandos.<br /><br /><br />echo fs.inotify.max_user_watches=<wbr></wbr>524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p<br /></div>
<span style="background-color: white;"><span style="color: #222222; font-family: arial, sans-serif;"><span style="font-size: 12.8px;">Realice la operación y listo nueva,ente funciono mi gulp.</span></span></span></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-39264250053980425402016-05-08T21:00:00.001-05:002016-05-08T21:00:27.389-05:00Simple Websocket express nodejs<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://asphostportal.com/img/icon-websocket.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://asphostportal.com/img/icon-websocket.png" height="217" width="400" /></a></div>
<br />
<br />
<br />
Esta ocasión traigo un ejemplo para crear un proyecto websocket utilizando nodejs, ya que había hecho una pequeña descripción <a href="http://elkardumen.blogspot.mx/2016/02/ejemplo-basico-java-websocket.html" target="_blank">de esto con java </a> ahora es turno de hacerlo con javascript , todo esto para poder ser dinámico y conocer un poco las nuevas tecnologías, pues bien, básicamente lo que se debe tener como pre requisitos conocimientos básicos en:<br />
<br />
Nodejs<br />
NPM<br />
Expresjs<br />
<br />
<a name='more'></a><br /><br />
<br />
Una vez que se tiene esto no sera demasiado difícil de entender el siguiente código:<br />
<br />
<br />
var WebSocketServer = require("ws").Server<br />
var http = require("http")<br />
var express = require("express")<br />
var app = express()<br />
var port = process.env.PORT || 5000<br />
<br />
app.use(express.static(__dirname + "/"))<br />
<br />
var server = http.createServer(app)<br />
server.listen(port)<br />
<br />
console.log("http server listening on %d", port)<br />
<br />
var wss = new WebSocketServer({server: server})<br />
console.log("websocket server created")<br />
<br />
wss.on("connection", function(ws) {<br />
var id = setInterval(function() {<br />
ws.send(JSON.stringify(new Date()), function() { })<br />
}, 1000)<br />
<br />
console.log("websocket connection open")<br />
<br />
ws.on("close", function() {<br />
console.log("websocket connection close")<br />
clearInterval(id)<br />
})<br />
})<br />
<div>
<br /></div>
<br />
en consola sera necesario ejecutar lo siguiente en:<br />
<br />
npm install ws<br />
npm install express<br />
<br />
después solo bastara con ejecutar la aplicación:<br />
<br />
node app.js<br />
<br />
es posible que cuando se realice la ejecución aparezca esto,(Esto me paso por que lo hice en windows) solo sera necesario dar Allow access<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtWAAPeLgjK-OwMffvJK2MZEFk-_0Uje0DHKowAYK4jh08Ptds0k-_e6ZKIxWlBygJgK9tp1gDqMyfvA1UtUtiqhkHoNIE4T2093-wgU0mEIT4zBy6OaX9SZLJB7SBh_aGNmvKXg/s1600/websocket.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtWAAPeLgjK-OwMffvJK2MZEFk-_0Uje0DHKowAYK4jh08Ptds0k-_e6ZKIxWlBygJgK9tp1gDqMyfvA1UtUtiqhkHoNIE4T2093-wgU0mEIT4zBy6OaX9SZLJB7SBh_aGNmvKXg/s400/websocket.PNG" width="400" /></a><br />
<br />
cuando este ejecutando se preguntaran como pruebo el websocket, una servicio web que me ayudo a mi es http://websocket.org/echo.html , ahi solo bastara con colocar la ip o el localhost con nuestro puerto que definimos en la aplicación y listo empezara a mandar el mensaje de conexión así como los mensajes que estará enviando el cliente websocket, tal como se ve en la siguiente imagen:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiT3Larjwomnq5PjnrfNsxaerLFUJ411TTXX0iwiqI7Xe2l6XHAKlT6gpTFxgUHqoDA9sAH63xebHudCo3c5ZdYJEq2cGmkqV-UeE-UBPMxBUWxr_BBQxJfgJU6ddBaPxmhmbakA/s1600/websocket2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiT3Larjwomnq5PjnrfNsxaerLFUJ411TTXX0iwiqI7Xe2l6XHAKlT6gpTFxgUHqoDA9sAH63xebHudCo3c5ZdYJEq2cGmkqV-UeE-UBPMxBUWxr_BBQxJfgJU6ddBaPxmhmbakA/s1600/websocket2.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br /></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-38357323973520301652016-02-25T13:30:00.003-06:002016-02-25T13:30:54.942-06:00Simple notificaciones HTML5 con Java<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjghJBgtUd-nyL-_qJqIaak8l-KSR0JCxnZ5CnoH73uISdL36yn8vfrGdP8Z_TQIL5t0g3vu3HHRpBfXXA94fxlJn2IZIyUvnZ8o63WxtCFAMhPFkdXY4hjSebsRLZFpefMPwQj5Q/s1600/NotificacionesHTML5Java4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjghJBgtUd-nyL-_qJqIaak8l-KSR0JCxnZ5CnoH73uISdL36yn8vfrGdP8Z_TQIL5t0g3vu3HHRpBfXXA94fxlJn2IZIyUvnZ8o63WxtCFAMhPFkdXY4hjSebsRLZFpefMPwQj5Q/s400/NotificacionesHTML5Java4.PNG" width="400" /></a></div>
<br />
<br />
<br />
"Bien lo que pasa es de que" estaba revisando una notas sobre el <a href="http://www.html5rocks.com/en/tutorials/notifications/quick/" target="_blank">API de notificaciones</a>, y me pareció interesante la forma en que funcionaban, ya que pueden ser útiles para dar avisos de una forma sencilla. Pues bien como estaba trabajando con <a href="http://directwebremoting.org/dwr/index.html" target="_blank">DWR </a>,un framework ajax para Java pues me di a la tarea de implementar estas notificaciones con DWR y estos fue lo que hice:<br />
<br />
Mi escenario es en siguiente:<br />
<a name='more'></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf8WfzNKTXPl9qv2ZPq_5MEfK4ovAp2bDRGLXYkCbb5LQNoS3yKPvXKTezUqjlqzZhh7SnaSwRIZ3thDMXtF-ogt7OD-lJICYZeE6NVE7OA5BCoQBl0Fr6MwFJIz-4_2HszpX4IA/s1600/NotificacionesHTML5Java.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="146" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf8WfzNKTXPl9qv2ZPq_5MEfK4ovAp2bDRGLXYkCbb5LQNoS3yKPvXKTezUqjlqzZhh7SnaSwRIZ3thDMXtF-ogt7OD-lJICYZeE6NVE7OA5BCoQBl0Fr6MwFJIz-4_2HszpX4IA/s400/NotificacionesHTML5Java.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
El cliente estará esperando a que el administrador envié algún mensaje , este mensaje se mostrara en pantalla principal y mostrara la notificación HTML5 del cliente.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
El proyecto deberá tener la siguiente estructura de paquetes, clases y folders para .jsp .js</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTn_O11QKLJ-5PiOzL4l-mQIqh13Xntaq1hCrDgEErAT3KEPbCIxnRNhkvuMpkjRWMBykaNOeofwcZkbu96HTg_YFtWQMBsmUSrSp73be3-YaiAu2mNP27i6b9wxL_LlbzRNKV2Q/s1600/NotificacionesHTML5Java1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTn_O11QKLJ-5PiOzL4l-mQIqh13Xntaq1hCrDgEErAT3KEPbCIxnRNhkvuMpkjRWMBykaNOeofwcZkbu96HTg_YFtWQMBsmUSrSp73be3-YaiAu2mNP27i6b9wxL_LlbzRNKV2Q/s400/NotificacionesHTML5Java1.PNG" width="321" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
En la clase TheController colocamos los siguientes métodos:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">@RequestMapping("/index.html")</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> public String loadIndex() {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return "index";</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@RequestMapping("/administrator.html")</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> public String loadAdministrator() {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return "admin";</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void enviaElMensaje(String mensaje) {</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>try{</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>final String elmensaje=mensaje;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>WebContext wctx = WebContextFactory.get();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//Browser.withAllSessions(wctx, new Runnable() {</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Browser.withPage("/SimpleNotificacionesDWR/index.html", new Runnable() {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void run() {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>ScriptSessions.addFunctionCall("muestraMensaje",elmensaje);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}catch (Exception e){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>e.printStackTrace();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
El funciones-cliente.js<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">document.addEventListener("DOMContentLoaded", function() {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if (Notification.permission !== "granted")</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Notification.requestPermission();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}, false);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">function muestraMensaje(msj){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>console.log(msj);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$("#mensaje").append(msj);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>notifyMe(msj);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">function errh(data){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>console.log("error"+data);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">function notifyMe(msj) {</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (!Notification) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>alert('Las notificaciones no estan disponibles en tu navegador');</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (Notification.permission !== "granted")</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Notification.requestPermission();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>else {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>var notification = new Notification(</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>'El Kardumen',</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>icon : 'http://a2.cdn.gaiaonline.com/dress-up/avatar/ava/bf/b2/57609e5dbdb2bf.png',</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>body : "Hey existe algo nuevo en el kardumen!"+msj,</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>notification.onclick = function() {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>window.open("http://kardumen.blogspot.com");</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>};</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
<br />
<br />
Para funciones.js<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">$(function(){</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$("#btnEnvia").on("click",function(){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>theController.enviaElMensaje($("#txtmensaje").val());</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$("#txtmensaje").val("");</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">});</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">function errh(data){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>console.log("error"+data);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
Para admin.jsp<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><!DOCTYPE html></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><html></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><head></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><meta charset="UTF-8"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><title>Ejemplo basico notificaciones HTML5 con Java</title></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><link href="http://materializecss.com/css/prism.css" rel="stylesheet"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <link href="http://materializecss.com/css/ghpages-materialize.css" type="text/css" rel="stylesheet" media="screen,projection"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></head></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><body onload="dwr.engine.setActiveReverseAjax(true);dwr.engine.setErrorHandler(errh);"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><h5></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></h5></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><div class="container"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><div class="row"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <div class="col s12 m12"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <div class="card-panel teal"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="white-text">Ejemplo basico de notificaciones html5 enviadas con Java , desarrollado con Frameworks Spring 3 y DWR</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> algunas referencias</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <br></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> http://www.jasoft.org/Blog/post/Mostrando-notificaciones-desde-el-navegador-con-HTML5.aspx</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <br></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> http://www.html5rocks.com/en/tutorials/notifications/quick/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <br></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> https://www.w3.org/TR/notifications/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <br></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> https://developers.google.com/web/updates/2015/05/notifying-you-of-changes-to-notifications</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <div class="input-field col s6"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <input id="txtmensaje" placeholder="mensaje" id="first_name" type="text" class="validate"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span><label for="first_name">Escribe el mensaje</label></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span><button id="btnEnvia" class="btn waves-effect waves-light red lighten-3" type="submit" name="action" alt="online!">Envia notificación</button></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></div></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></body></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script src="js/funciones.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><!--scripts DWR --></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript" src="<%=request.getContextPath()%>/dwr/engine.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript" src="<%=request.getContextPath()%>/dwr/interface/theController.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript" src="<%=request.getContextPath()%>/dwr/util.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript" src="http://materializecss.com/bin/materialize.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></html></span><br />
<br />
<br />
<br />
Para index.jsp<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><!DOCTYPE html></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><html></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><head></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><meta charset="UTF-8"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><title>Espera Notificación</title></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><link href="http://materializecss.com/css/prism.css" rel="stylesheet"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <link href="http://materializecss.com/css/ghpages-materialize.css" type="text/css" rel="stylesheet" media="screen,projection"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></head></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><body onload="dwr.engine.setActiveReverseAjax(true);dwr.engine.setErrorHandler(errh);"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><div class="container"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><div class="row"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><div class="col s12 m12"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><div class="card-panel teal"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span class="white-text">Aca espera las Notificaciones dale</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>aceptar cuando aparesca el mensaje! <br></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><div id="mensaje"></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></body></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript" src="js/funciones-cliente.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><!--scripts DWR --></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>src="<%=request.getContextPath()%>/dwr/engine.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>src="<%=request.getContextPath()%>/dwr/interface/theController.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>src="<%=request.getContextPath()%>/dwr/util.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><script type="text/javascript" src="http://materializecss.com/bin/materialize.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></html></span><br />
<br />
Para spring-servlet.xml<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><?xml version="1.0" encoding="UTF-8"?></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <beans xmlns="http://www.springframework.org/schema/beans"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> xmlns:aop="http://www.springframework.org/schema/aop"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> xmlns:context="http://www.springframework.org/schema/context"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> xmlns:mvc="http://www.springframework.org/schema/mvc"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr/spring-dwr-3.0.xsd</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <context:component-scan base-package="com.elkardumen.controller" /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <mvc:annotation-driven /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <dwr:controller id="dwrController" debug="true"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span><dwr:config-param name="crossDomainSessionSecurity" value="false"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span><dwr:config-param name="activeReverseAjaxEnabled" value="true"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span><dwr:config-param name="pollAndCometEnabled" value="true" /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span><dwr:config-param name="maxWaitAfterWrite" value="-1"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </dwr:controller></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <property value="true" name="alwaysUseFullPath"></property> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <property name="mappings"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <props> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <prop key="/dwr/**/*">dwrController</prop></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> </props></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> </property></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></bean></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><bean id="theController" class="com.elkardumen.controller.TheController" scope="application"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><dwr:remote javascript="theController"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span><dwr:include method="enviaElMensaje"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></dwr:remote></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></bean></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"></bean></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span><bean id="handlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span><bean id="jspViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <property name="prefix" value="/pages/" /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <property name="suffix" value=".jsp" /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </bean></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></beans></span><br />
<br />
y para web.xml<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><?xml version="1.0" encoding="UTF-8"?></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">xmlns="http://java.sun.com/xml/ns/javaee" </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">id="WebApp_ID" version="3.0"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <display-name>SimpleNotificacionesDWR</display-name></span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <!-- ************************** spring MVC ************************** --></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <servlet></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <servlet-name>spring</servlet-name></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <load-on-startup>1</load-on-startup></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </servlet></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><servlet-mapping></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <servlet-name>spring</servlet-name></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <url-pattern>*.html</url-pattern></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </servlet-mapping></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><servlet-mapping></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><servlet-name>spring</servlet-name></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span><url-pattern>/dwr/*</url-pattern></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></servlet-mapping></span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><welcome-file-list></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <welcome-file>/pages/index.jsp</welcome-file></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </welcome-file-list></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"></web-app></span><br />
<br />
para que todo esto funcione yo lo probe con las siguientes versiones:<br />
<br />
Spring 3.0.5<br />
DWR 2.9<br />
Apache Tomcat 7<br />
<br />
Para poder probar una vez desplegado nuestro proyecto podremos probar en<br />
<br />
http://localhost/SimpleNotificacionesDWR/index.html ---Para el cliente<br />
http://localhost/SimpleNotificacionesDWR/administrator.html --Para el administrador<br />
<br />
De cualquier forma yo dejo el proyecto completo listo para importarlo en su workspace<br />
<br />
<a href="https://app.box.com/s/04dr11daky6nhbva8aw1tpl3mfurol7u" target="_blank">DESCARGA AQUI</a><br />
<br />
Fuentes:<br />
http://www.html5rocks.com/en/tutorials/notifications/quick/<br />
https://www.w3.org/TR/notifications/<br />
http://www.chromium.org/developers/design-documents/desktop-notifications/api-specification<br />
https://developers.google.com/web/updates/2015/05/notifying-you-of-changes-to-notifications<br />
https://github.com/ttsvetko/HTML5-Desktop-Notifications</div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-20081242731457613512016-02-17T11:54:00.000-06:002016-02-17T11:54:45.752-06:00Ejemplo básico Java WebSocket <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5jvoKSrvR3SsgVn06um02ZniBXMYsfwBH5qcEngY0t2-N8KNCdxw0S-xmrVBNEtZ44Us-h-qmSXo0LaFjxYgo7ILo6SuUkBsT3ab4OSLyzeKaKXpYJnxmg-PG4srDaUAHUYa4qA/s1600/SimpleWebSocketJava3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5jvoKSrvR3SsgVn06um02ZniBXMYsfwBH5qcEngY0t2-N8KNCdxw0S-xmrVBNEtZ44Us-h-qmSXo0LaFjxYgo7ILo6SuUkBsT3ab4OSLyzeKaKXpYJnxmg-PG4srDaUAHUYa4qA/s400/SimpleWebSocketJava3.PNG" width="400" /></a></div>
<br />
<br />
<div style="text-align: justify;">
Pues bien esta vez traigo un ejemplo así fácil, rápido , sencillo y nada complicado, se trata de un ejemplo sencillo de websocket elaborado con Java, pues estaba buscando en la red como hacer esto y me encontré con algunos ejemplos y explicaciones como las siguientes:</div>
<br />
<a name='more'></a><br /><br />
<a href="http://www.oracle.com/technetwork/articles/java/jsr356-1937161.html" target="_blank">JSR 356, Java API for WebSocket</a><br />
<br />
<a href="https://blog.openshift.com/how-to-build-java-websocket-applications-using-the-jsr-356-api/" target="_blank">How to build Java WebSocket Applications Using the JSR 356 API</a><br />
<br />
<a href="https://blog.idrsolutions.com/2013/12/websockets-an-introduction/" target="_blank">WebSockets – A Quick Introduction and a Sample Application</a><br />
<br />
<a href="http://java-websocket.org/" target="_blank">Java-WebSocket</a><br />
<br />
Entonces me dije, que caray por que no me hago un ejemplo y veo si el copy paste funciona y entonces hice lo siguiente :<br />
<br />
Primero cree un proyecto con Eclipse Mars Release desde <i>File - New - Dynamic Web Project </i>y lo llame <i>SimpleWebSocketJava</i> y empece a crear la siguientes estructura, tal como se ve en la imagen:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4uCK0G3Qq2jaWHfK2PkYATjUjmnDn4tNt1po0xHVyzknwOHuKgGwPArXacQL5rEwKqGBAvppmdYhcKseyOSs9tkvBmggJJdfdsawrMPvcl3bs1K7PpFEeAxQJmmDJ8aFmUDfXVQ/s1600/SimpleWebSocketJava.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4uCK0G3Qq2jaWHfK2PkYATjUjmnDn4tNt1po0xHVyzknwOHuKgGwPArXacQL5rEwKqGBAvppmdYhcKseyOSs9tkvBmggJJdfdsawrMPvcl3bs1K7PpFEeAxQJmmDJ8aFmUDfXVQ/s1600/SimpleWebSocketJava.PNG" /></a></div>
Una ves que tengo esta estructura, "El tema es..." ir colocando todo el codigo, primero creo la clases Customer y WebSocketTest en el paquete com.elkardumen.websoc y hacemos el copy-paste<br />
<br />
<br />
en Customer:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i>String OrderID;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>String CustomerID;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i> String OrderDate;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i> String Freight;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i> String ShipName;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><br /></i></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i> public String getOrderID() {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>return OrderID;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public void setOrderID(String orderID) {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>OrderID = orderID;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public String getCustomerID() {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>return CustomerID;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public void setCustomerID(String customerID) {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>CustomerID = customerID;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public String getOrderDate() {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>return OrderDate;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public void setOrderDate(String orderDate) {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>OrderDate = orderDate;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public String getFreight() {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>return Freight;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public void setFreight(String freight) {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>Freight = freight;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public String getShipName() {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>return ShipName;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>public void setShipName(String shipName) {</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>ShipName = shipName;</i></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><i><span class="Apple-tab-span" style="white-space: pre;"> </span>}</i></span><br />
<br />
En WebSocketTest :<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">@ServerEndpoint("/websocket")</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">public class WebSocketTest {</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> private static Set<Session> clients = </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> Collections.synchronizedSet(new HashSet<Session>());</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@OnMessage</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> public void onMessage(String message, Session session) </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>throws IOException, InterruptedException {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Print para mostrando en consola que llega el mejaje</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>System.out.println("Received: " + message);</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>int sentMessages = 0;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Customer customer=new Customer();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Gson gson = new Gson();</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/*Ciclo que solo enviara 3000 mensajes al cliente una vez que este halla entrado por</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>primera vez*/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>while(sentMessages < 3000){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//while(true){<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>customer=new Customer();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>customer.setOrderID(String.valueOf(sentMessages));</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>customer.setCustomerID("Kardumen.com - " + sentMessages);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>customer.setOrderDate(new Date().toString());</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>customer.setFreight("Carga- " + sentMessages);</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/*Ponemos un sleep de un segundo para que se vea</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> * como va llegando la informacion al cliente*/</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Thread.sleep(1000);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>session.getBasicRemote().sendText(gson.toJson(customer));</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//session.getBasicRemote().getSendStream();</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>sentMessages++;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//al finalizar el ciclo while este mandara un mensaje fina</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>session.getBasicRemote().sendText("Este es el ultimo mensaje de Webspcket");</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> }</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@OnOpen</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> public void onOpen (Session session) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>clients.add(session);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> System.out.println("Cliente conectado");</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> @OnClose</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> public void onClose (Session session) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>clients.remove(session);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>System.out.println("Conexion cerrada");</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<br />
En index.html :<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><!DOCTYPE html></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><html></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><head></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><!-- The jQuery library is a prerequisite for all jqSuite products --></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <script type="text/ecmascript" src="js/jquery.min.js"></script> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <!-- We support more than 40 localizations --></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <script type="text/ecmascript" src="js/grid.locale-en.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <!-- This is the Javascript file of jqGrid --> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <script type="text/ecmascript" src="js/jquery.jqGrid.min.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <!-- This is the localization file of the grid controlling messages, labels, etc.</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <!-- The link to the CSS that the grid needs --></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid-bootstrap.css" /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$.jgrid.defaults.width = 780;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <meta charset="utf-8" /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <title>WebSocket Java</title></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></head></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><body></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><input type="submit" value="Start" onclick="start()" /></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><div id="messages"></div></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>var webSocket = new WebSocket('ws://localhost:8080/SimpleWebSocketJava/websocket');</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>webSocket.onerror = function(event) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>onError(event)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>};</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>webSocket.onopen = function(event) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>onOpen(event)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>};</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>webSocket.onmessage = function(event) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>onMessage(event)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>};</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>function onMessage(event) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//document.getElementById('messages').innerHTML+= '<br />' + event.data;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>addRow(event.data);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>function onOpen(event) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>document.getElementById('messages').innerHTML = 'Conexion establecida';</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>function onError(event) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>alert(event.data);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>function start() {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>webSocket.send('Hola');</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return false;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><div style="margin-left:20px"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <table id="jqGrid"></table></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <div id="jqGridPager"></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <script type="text/javascript"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> $(document).ready(function () {</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> $("#jqGrid").jqGrid({</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>styleUI : 'Bootstrap',</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> colModel: [</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> { label: 'OrderID', name: 'OrderID', key: true, width: 75 },</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> { label: 'Customer ID', name: 'CustomerID', width: 150 },</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> { label: 'Order Date', name: 'OrderDate', width: 150 },</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> { label: 'Freight', name: 'Freight', width: 150 }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> ],</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>viewrecords: true,</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> height: 250,</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> rowNum: 20,</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> pager: "#jqGridPager"</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> });</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> });</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> function addRow(datos){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>console.log(jQuery.parseJSON(datos));</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>$("#jqGrid").jqGrid('addRowData', null, jQuery.parseJSON(datos), "last");</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></body></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></html></span><br />
<br />
Y listo a probar en http://localhost:8080/SimpleWebSocketJava/<br />
<br />
Por cierto tener cuidado por que yo probé con esto:<br />
<br />
Java 1.7<br />
Apache Tomcat 7.0.62 y en Tomcat tengo estas librerias<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLX72NIzcewGxo80sYfWEJXLw3tPsZrBShXRtm1fppzNGirSJ8SoS5QnnOr5FXHOTTggFI42HHpDddkeOh_TnYwiAAoIOBCN4tUYB-4SwGSqgwE-RSIEIR_oK291uqDOC4paVPSg/s1600/SimpleWebSocketJava2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLX72NIzcewGxo80sYfWEJXLw3tPsZrBShXRtm1fppzNGirSJ8SoS5QnnOr5FXHOTTggFI42HHpDddkeOh_TnYwiAAoIOBCN4tUYB-4SwGSqgwE-RSIEIR_oK291uqDOC4paVPSg/s320/SimpleWebSocketJava2.PNG" width="100" /></a></div>
<br />
<br />
Si se hace con versiones anteriores de Apache Tomcat no tiene soporte para websockets.<br />
<br />
Bueno como lo hice asi de rápido, mmm seguro no se entiendo mucho asi que dejo el proyecto tal cual:<br />
<br />
Acá el ejemplo en .zip <a href="https://app.box.com/s/gi6bb6dgd207hfe0xg8en6hmww152df1" target="_blank">DESCARGA</a><br />
<br />
<b>Otra nota:</b> Lo probé en Web Logic 12.1.2.0.0 y nada que funciono al parecer tengo que hacer algo diferente pero eso lo dejo para otro ejemplo.<br />
<br /></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-44639323271489266962016-01-28T11:40:00.000-06:002016-01-28T11:41:09.701-06:00Convertir milisegundos a formato hora,minuto, segundo , milisegundo con javascript<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Funcion que convierte milisegundos en formato "hh:mm:ss.ss" . Esto responde la pregunta ¿Como mostrar milisegundos en los valores de fecha, hora, segundos y milisegundos?</div>
<br />
Aqui el js:<br />
<br />
<br />
<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="300" src="//jsfiddle.net/xola139/z47jyp5x/embedded/js/" width="100%"></iframe>
<br />
<br />
<a name='more'></a><br />
<br />
Aqui el html:<br />
<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="300" src="//jsfiddle.net/xola139/z47jyp5x/embedded/html/" width="100%"></iframe>
Aqui el resultado:<br />
<br />
Prueben con estos ejemplos 601000,1801000,2700000,5400000
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="300" src="//jsfiddle.net/xola139/z47jyp5x/embedded/result" width="100%"></iframe></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com5tag:blogger.com,1999:blog-27449501.post-77275468740544810452015-12-10T22:37:00.001-06:002015-12-10T22:37:42.020-06:00Spring + DWR + materializecss<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijRmQcr4t-Cbnr5r2bV10x2rGklR9IT2TQDX5fBNAzjj_uemuY7UPu4Q9kFyucM6M8dNrLaX71Ph0WKpmO2fQeD7efJaz5T3_ivzXYSvDCzO3k1Bcc8WpziWzMyBAdlvQNCkUivQ/s1600/SpringDWR3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijRmQcr4t-Cbnr5r2bV10x2rGklR9IT2TQDX5fBNAzjj_uemuY7UPu4Q9kFyucM6M8dNrLaX71Ph0WKpmO2fQeD7efJaz5T3_ivzXYSvDCzO3k1Bcc8WpziWzMyBAdlvQNCkUivQ/s320/SpringDWR3.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
Esta ocasión voy a colocar un proyecto completo que utiliza varias tecnologías la cuales voy a colocar en la siguiente lista:<br />
<br />
<ul style="text-align: left;">
<li> Java 1.7 </li>
<li>Spring 3.0.5 </li>
<li>DWR 3.0.0 </li>
<li>Jquery 2.1.4 </li>
<li>Highstock JS 2.0.4</li>
<li>MaterializeCSS</li>
</ul>
El proyecto al final se vera así :<br />
<br />
<a name='more'></a><br />
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
<video autoplay="" class="Live-video" height="300" loop="" muted="" width="350"><source src="http://www30.online-convert.com/es/descarga-fichero/90629983de8c24adc28b4297d78cdef0/converted-ca8d312e.mp4" type="video/mp4"></source></video>
<br />
Ahora vamos a crear el proyecto, la estructura final del proyecto mas o menos es la siguiente:<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsc2cGJaUSVqPdMMMGucpL4S2BFC3H5XlUDiyfsOv1VLtXhsEn4MhEnNTbZ1wA44KvQ1UN_YIQw9-TwNS02HEQl4sFpXnZNrtUarEB9-_6MxdrUQ4NT73msNVYrZpXy0F8rJ4pOA/s1600/SpringDWR.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsc2cGJaUSVqPdMMMGucpL4S2BFC3H5XlUDiyfsOv1VLtXhsEn4MhEnNTbZ1wA44KvQ1UN_YIQw9-TwNS02HEQl4sFpXnZNrtUarEB9-_6MxdrUQ4NT73msNVYrZpXy0F8rJ4pOA/s1600/SpringDWR.png" /></a></div>
Para no hacer la explicación muy larga y aburrida esto funciona mas o menos asi :<br />
<br />
1.- El usuario abre la pagina...comienza cargar el DOM<br />
2.-Durante la carga del la pagina en algún momento llega a la funcion<span style="color: blue; font-size: x-small;"> jQuery(document).ready(function(){});</span><br />
3.- Esta función tiene la ejecución de 3 funciones asincronas, que hacen que comience a trabajar el proyecto, tales son:<br />
<br />
<br />
<ul style="text-align: left;">
<li>getDatosInicialesGrafica</li>
<li>getDatosInicialesLinear</li>
<li>iniciaValoresSecuenciales</li>
</ul>
<br />
La función <i>getDatosInicialesGrafica </i>manda a traer la carga inicia para la gráfica 1 que identificamos como area.<br />
La función <i>getDatosInicialesLinear </i>trae la carga inicial de grafica 2 que identificamos como lineas<br />
La función <i>iniciaValoresSecuenciales</i> esta inicia un Thread que permanecerá activo hasta que el proyecto sea eliminado el server deploy, este Thread estará mandando la información hacia la función javascript que ayudara a pintar en la tabla y los puntos nuevos de las graficas , todo esto con la ayuda DWR.<br />
<br />
y listo así de fácil, rápido y sencillo, nada complicado.<br />
<br />
<br />
<br/>
Acá lo tengo funcionando en:<a href="http://45.55.201.161:8181/SpringDWR/" target="_blank"> http://45.55.201.161:8181/SpringDWR/</a> (si no se encuentra activo manden un twit @xola139) para revisarlo<br />
<br />
<br />
<br />
<br />
Y ps acá esta el código por si alguien le interesa.<br />
https://github.com/xola139/SpringDWR<br />
<br />
<br /></div>xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-63722104648504416962015-10-13T13:43:00.003-05:002015-10-13T13:43:24.112-05:00Manipular errores DWR con javascript<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1OsdU8HK6_aXxeo6X7w4-SuHcFWy64-d2k5ehVF0biBrW5PZzz92ZkhbpBiQWdOlI_Dh3fnFhGqzyxYWUCU8uHFYQCvYj420WqXOtN4iLZCtjTYY__TgQ4n-vgdi14C_e5RD5Kg/s1600/mensajeServicioNoDisponibleDWR.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="134" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1OsdU8HK6_aXxeo6X7w4-SuHcFWy64-d2k5ehVF0biBrW5PZzz92ZkhbpBiQWdOlI_Dh3fnFhGqzyxYWUCU8uHFYQCvYj420WqXOtN4iLZCtjTYY__TgQ4n-vgdi14C_e5RD5Kg/s320/mensajeServicioNoDisponibleDWR.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4NfY8XUBdI554g2NRBuz4LLsvW2THCNFTp07teYvopRLZ1D2T6Kni5EKdTQA0BGKjejHveha7SnbyB240CpKL2SFmsPFnlgPQNbXApLd3QeJOGskkgwOosxg55wC1US1foNSilg/s1600/serverErrorhasOcurredDWR.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4NfY8XUBdI554g2NRBuz4LLsvW2THCNFTp07teYvopRLZ1D2T6Kni5EKdTQA0BGKjejHveha7SnbyB240CpKL2SFmsPFnlgPQNbXApLd3QeJOGskkgwOosxg55wC1US1foNSilg/s320/serverErrorhasOcurredDWR.PNG" width="320" /></a></div>
<br />
<br />
<br />
Tal vez estos mensajes de error "Incomplete reply from server" , "No Found" , "Servicio no Disponible", "A server error has ocurred" se hallan mostrado en una ventana emergente que genera DWR cuando existe alguna inconsistencia, Si es así , entonces es posible manejar esos errores de forma mas discreta colocando solo un console.log() para saber que paso y no mostrar ese molesto alert();<br />
<a name='more'></a><br />
<br />
Pues bien lo que se debe hacer ya que tienes tu proyecto funcionando con DWR, es colocar :<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">dwr.engine.setErrorHandler(errh);</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
Este lo puedes colocar en la pagina donde se esta haciendo uso de DWR, por ejemplo yo lo coloque directo en el body<br />
<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><body dwr.engine.setErrorHandler(errh);" ></span><br />
<br />
después en un archivo o en una etiqueta javascript, sera necesario colocar la siguiente función:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">function errh(msg, exc) {</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span> console.log("Error message is: " + msg +</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span> " - Error Details: " + dwr.util.toDescriptiveString(exc, 2));</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
y entonces esto sera todo, tu deberías ver el error en la consola de tu navegador y no en una ventana emergente.</div>
<div>
por ejemplo ami me salio este mensaje cuando probé:</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Error message is: Incomplete reply from server - Error Details: {</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> name:"dwr.engine.incompleteReply", </span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> message:"Incomplete reply from server"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
</div>
<div>
<br /></div>
<div>
Es muy sencillo si quieren que los ayude o implemente en algún proyecto solo pidan ayuda y con gusto atiendo la petición </div>
<br />
<br /></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com1tag:blogger.com,1999:blog-27449501.post-11443177100569174672015-09-23T13:26:00.003-05:002015-09-23T13:29:33.367-05:00Exportar HTML a PDF con Javascript<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSPXCL70HkAulmV4Fdjlq3w2WbqfhhzRDv5NZVy9bTnJExJ10hIu5pb7PlLzHJRmSkJIoNTk-6we9EzRIPXPfn-8qXHAQjnX29PVlct6CXdTpjba2aYoAvoos98XZu0M8kftj0mg/s1600/HTMLtoPDFWithJavaScript.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSPXCL70HkAulmV4Fdjlq3w2WbqfhhzRDv5NZVy9bTnJExJ10hIu5pb7PlLzHJRmSkJIoNTk-6we9EzRIPXPfn-8qXHAQjnX29PVlct6CXdTpjba2aYoAvoos98XZu0M8kftj0mg/s1600/HTMLtoPDFWithJavaScript.png" /></a></div>
<br />
"El tema es....", que esta ocasion traigo un ejemplo sencillo para poder exportar a pdf una tabla HTML con CSS, pues bien, esto es algo rápido, sencillo y nada complicado para hacer esto tu utilice 2 librerías , tales son:<br />
<br />
<a name='more'></a><br />
<br />
<br />
http://mrrio.github.io/jsPDF/<br />
<br />
http://html2canvas.hertzen.com/<br />
<br />
<br />
Pues bien para hacer esto utilice este recurso de una tabla que aparece en la siguiente url<br />
<br />
http://tympanus.net/Tutorials/CSS3Tables/<br />
<br />
aquí esta su descripción de como fue generadas las tablas<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>http://tympanus.net/codrops/2010/05/03/pimp-your-tables-with-css3/<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
pues bien lo primero que hice fue generar la tabla:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><div id="content" style="width: 600px;background-color: orange;"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><h2>Table Style 3</h2></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <table class="table3"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <thead></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th></th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="col" abbr="Starter">Smart Starter</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="col" abbr="Medium">Smart Medium</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="col" abbr="Business">Smart Business</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="col" abbr="Deluxe">Smart Deluxe</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </thead></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tfoot></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="row">Price per month</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>$ 2.90</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>$ 5.90</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>$ 9.90</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>$ 14.90</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tfoot></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tbody></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="row">Storage Space</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>512 MB</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>1 GB</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>2 GB</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>4 GB</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="row">Bandwidth</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>50 GB</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>100 GB</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>150 GB</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>Unlimited</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="row">MySQL Databases</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>Unlimited</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>Unlimited</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>Unlimited</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>Unlimited</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="row">Setup</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>19.90 $</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>12.90 $</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>free</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td>free</td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="row">PHP 5</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td><span class="check"></span></td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td><span class="check"></span></td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td><span class="check"></span></td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td><span class="check"></span></td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <th scope="row">Ruby on Rails</th></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td><span class="check"></span></td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td><span class="check"></span></td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td><span class="check"></span></td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <td><span class="check"></span></td></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tr></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </tbody></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </table></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </div></span><br />
<br />
<br />
seguido de agregar el boton<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <button id="btnExportar" type="button" ></span><br />
<br />
<br />
importe los css y los js<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <link rel="stylesheet" href="http://tympanus.net/Tutorials/CSS3Tables/css/style.css" type="text/css" media="screen"/></span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <script src="http://mrrio.github.io/jsPDF/dist/jspdf.min.js" type="text/javascript"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <script src="http://html2canvas.hertzen.com/build/html2canvas.js" type="text/javascript"></script></span><span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<br />
<br />
<br />
y por ultimo en el evento click utilice los metodos html2canvas y addImage, tal como se ve en el codigo siguiente:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> $(document).ready(function (){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>$("#btnExportar").on("click",function(){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>var doc = new jsPDF();</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>var imgHeight=140 ;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> var imgWidth=140 ;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> var positionY=20;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> var positionX=20;</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>doc.setFontSize(15);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> doc.text(15, 15, "Hola JSPDF y html2canvas");</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>html2canvas($("#content"), {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> onrendered: function(canvas) {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>var img = canvas.toDataURL("image/jpeg");</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>doc.addImage(img, 'JPEG', positionX , positionY, 140, imgWidth);</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>doc.save('MyPdf.pdf');</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> });</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> }); </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<br />
<br />
<br />
y listo esto quedo mas o menos así<br />
<a href="http://jsfiddle.net/xola139/5ddq7vkk/">http://jsfiddle.net/xola139/5ddq7vkk/</a><br />
<br />
<div>
<br />
<iframe src="http://jsfiddle.net/xola139/5ddq7vkk/embedded/embedded/result/presentation/" style="height: 300px; width: 100%;">
</iframe>
</div>
</div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com2tag:blogger.com,1999:blog-27449501.post-63442520959856816742015-08-13T10:54:00.000-05:002015-08-13T11:03:56.983-05:00Exportar múltiples gráficas hihgcharts a PDF con javascript<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-8ZaR6EcgC71aTsWO6F9mq3uN87epcmXS1VMz5V4JvCe24Y7TfJxbXl8BmlnBzEaIiBMQXCmn7GVWe3BovJny6KtthMssQVGByf1cklpfQIXMh4IjBpW6ziST0pts1XN6jLgt6g/s1600/hihgchartsToPDf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="76" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-8ZaR6EcgC71aTsWO6F9mq3uN87epcmXS1VMz5V4JvCe24Y7TfJxbXl8BmlnBzEaIiBMQXCmn7GVWe3BovJny6KtthMssQVGByf1cklpfQIXMh4IjBpW6ziST0pts1XN6jLgt6g/s320/hihgchartsToPDf.png" width="320" /></a></div>
<br />
<br />
"El tema es" que debia hacer un documento pdf apartir de una grafica hihgcharts, con esto no hay problema pues hihgchart tiene la caracteristica de exportar habilitando exporting: { enabled: false }, bien el detalle es que tenia mas de una grafica las cuales debia poner en solo un documento PDF, Entonces esto fue o que me funciono:<br />
<br />
<a name='more'></a><br />
<br />
Tengo las graficas:<br />
<a href="http://jsfiddle.net/xola139/y8kwg5Lh/">http://jsfiddle.net/xola139/y8kwg5Lh/</a><br />
<iframe src="https://jsfiddle.net/xola139/y8kwg5Lh/embedded/result/" style="height: 300px; width: 100%;">
</iframe>
<br />
Antes de seguir es necesario agregar las siguientes librerias para poder continuar<br />
<br />
http://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.js<br />
http://canvg.googlecode.com/svn/trunk/rgbcolor.js<br />
http://canvg.googlecode.com/svn/trunk/canvg.js<br />
http://code.highcharts.com/modules/exporting.js<br />
<br />
<br />
<br />
//Vamos agregar la funcion para que podamos crear la grafica hihgcharts en canvas, esto se hace con el siquinte codigo:<br />
<br />
(function (H) {<br />
H.Chart.prototype.createCanvas = function (divId) {<br />
var svg = this.getSVG(),<br />
width = parseInt(svg.match(/width="([0-9]+)"/)[1]),<br />
height = parseInt(svg.match(/height="([0-9]+)"/)[1]),<br />
canvas = document.createElement('canvas');<br />
<br />
canvas.setAttribute('width', width);<br />
canvas.setAttribute('height', height);<br />
<br />
if (canvas.getContext && canvas.getContext('2d')) {<br />
<br />
canvg(canvas, svg);<br />
<br />
return canvas.toDataURL("image/jpeg");<br />
<br />
}else {<br />
alert("Your browser doesn't support this feature, please use a modern browser");<br />
return false;<br />
}<br />
<br />
}<br />
}(Highcharts));<br />
<br />
<br />
//Agregamos el evento al boton que nos ayudara a exportar el pdf<br />
<br />
$('#exporta').click(function () {});<br />
<br />
Dentro del evento click vamos a seleccionar las graficas que comiencen con el class =chart, en este ejemplo asi empiezan las clases<br />
de los div donde se dibujan las graficas esto lo hacemos con este pedazo de codigo:<br />
<br />
<br />
$('.chart').each(function (index) {<br />
console.log(this.id);<br />
<br />
});<br />
<br />
Y para exportar con a pdf ya con el evento click configurado y con el ciclo que recorre cada grafica tenemos que poner mas o menos asi el siguiente codigo<br />
<br />
<br />
var imageData = $(this).highcharts().createCanvas();<br />
doc.addImage(imageData, 'JPEG', 45, (index * chartHeight) + 40, 120, chartHeight);<br />
<br />
<br />
<br />
Al final este es mi resultado:<br />
<br />
<a href="http://jsfiddle.net/xola139/y8kwg5Lh/3/">http://jsfiddle.net/xola139/y8kwg5Lh/3/</a><br />
<iframe src="https://jsfiddle.net/xola139/y8kwg5Lh/3/embedded/result/" style="height: 300px; width: 100%;">
</iframe>
<br />
<br />
<br />
<br />
Y claro como era de esperarse la mayoria de las cosas las investigue en la red y me encontre estas url que me fueron de mucha utilidad para hcer mi ejemplo y entender como funciona.<br />
<br />
<br />
http://hayageek.com/generate-pdf-with-javascript/<br />
https://github.com/hongru/canvas2image/blob/master/index.html<br />
http://fiddle.jshell.net/8ypxW/3/show/<br />
http://jsfiddle.net/8ypxW/3/<br />
https://parall.ax/products/jspdf#<br />
http://fiddle.jshell.net/leighking2/dct9tfvn/<br />
http://stackoverflow.com/questions/19807870/how-to-export-the-html-tables-data-into-pdf-using-jspdf</div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com3tag:blogger.com,1999:blog-27449501.post-6791425724864129302015-07-17T11:46:00.002-05:002015-07-17T11:46:45.929-05:00Encriptar palabras con Nodejs<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMV6KIaJ57W-30HclYfctOdwG14K2pvGs54if_XX9PWwvFxjr1mUtVLF7WEckG5bDg-cpufkcXUfDMKUVOiBsdJCuOs22w7e5VlNCVE6PGevwthC1pLaCwlzsoeyimoU_jTD81-g/s1600/encriptaconNodejs1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="153" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMV6KIaJ57W-30HclYfctOdwG14K2pvGs54if_XX9PWwvFxjr1mUtVLF7WEckG5bDg-cpufkcXUfDMKUVOiBsdJCuOs22w7e5VlNCVE6PGevwthC1pLaCwlzsoeyimoU_jTD81-g/s400/encriptaconNodejs1.PNG" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Pues bien , dado que sigo el el camino de poder aprender un poco de nodejs, me di a la tarea de buscar como encriptar mensajes con Nodejs, entonces navegando por la red me encontré algunas propuestas como la de usar crypto ( <a href="https://nodejs.org/api/crypto.html">https://nodejs.org/api/crypto.html</a>) , dado que no encontré un ejemplo que me diera una visión mas clara , tuve que hacer un ejemplo donde básicamente lo que hago es colocar una caja de texto donde colocar una contraseña para encriptar la frase y otra caja de texto para escribir la frase a encriptar.</div>
<div style="text-align: justify;">
</div>
<a name='more'></a><br /><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiQshbfPIVU3RChA3BZuZKo3SOVH5cVhL_RmSr2g51EbwyO3uVxx4aaGCO22oQtjEHnOzbHAnP4RKeoeAaOqHpNfEzfEQ1DErGb5-kr-PH97JDX9tu_I9-PAoMClLefUkaZI17_A/s1600/encriptaconNodejs.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiQshbfPIVU3RChA3BZuZKo3SOVH5cVhL_RmSr2g51EbwyO3uVxx4aaGCO22oQtjEHnOzbHAnP4RKeoeAaOqHpNfEzfEQ1DErGb5-kr-PH97JDX9tu_I9-PAoMClLefUkaZI17_A/s1600/encriptaconNodejs.PNG" /></a></div>
<br />
Bien , también coloque 2 botones para ver el pequeño funcionamiento<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_TRQ7qIwjDCI0HvMmf4ekx3c8LteFzrT1saWfdI3TR3DzspbcexgRaVCzU0xiwHTZmRmQJhbpbWqJkNFcoPY_02xXc0cfGfM8mOO9gEC9g0HcqaIBAym8y8p8IOu_-lQGBm_Nzw/s1600/encriptaconNodejs2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_TRQ7qIwjDCI0HvMmf4ekx3c8LteFzrT1saWfdI3TR3DzspbcexgRaVCzU0xiwHTZmRmQJhbpbWqJkNFcoPY_02xXc0cfGfM8mOO9gEC9g0HcqaIBAym8y8p8IOu_-lQGBm_Nzw/s1600/encriptaconNodejs2.PNG" /></a></div>
<br />
Donde, al dar clic en botón "Encripta" debería mostrar algo así<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj39f_Vs70J5tw2IeRg_O-fWU1Mw1qNjEp1k4MN8OU74JW_0cpsqZ-SgrprC3T2hrTVb8_YhwmEgzW_3Ls7IiWhInkyj34I7r2JErN-hTJQRhTGeajhUTI1mobQnNXvj9uJj5huCw/s1600/encriptaconNodejs3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="25" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj39f_Vs70J5tw2IeRg_O-fWU1Mw1qNjEp1k4MN8OU74JW_0cpsqZ-SgrprC3T2hrTVb8_YhwmEgzW_3Ls7IiWhInkyj34I7r2JErN-hTJQRhTGeajhUTI1mobQnNXvj9uJj5huCw/s320/encriptaconNodejs3.PNG" width="320" /></a></div>
<br />
Y el botón "Decifra" debería dar el texto original<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5NwAh8luHLVCkCOYU3OZ9-YjBgEIsbcqFrzTfiSUKQ5ZVWJ2PXqa4cQOnw_Tv-oGminZUxB2awBULv_pW3Sk_1jRBFeIELg4aLwC7rnabgERvH_HARJy44Qwt6zBwzDHcdyVEWA/s1600/encriptaconNodejs4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5NwAh8luHLVCkCOYU3OZ9-YjBgEIsbcqFrzTfiSUKQ5ZVWJ2PXqa4cQOnw_Tv-oGminZUxB2awBULv_pW3Sk_1jRBFeIELg4aLwC7rnabgERvH_HARJy44Qwt6zBwzDHcdyVEWA/s1600/encriptaconNodejs4.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Bien, básicamente el ejemplo funciona así y de cualquier forma dejo el código fuente para cualquier prueba.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://app.box.com/s/ro3sdwmw6z11y06tf2dyyxpvd179n43g" target="_blank">DESCARGA CODIGO</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
recuerden para probar este código lo puedes ubicar en la carpeta que mas convenga</div>
<div class="separator" style="clear: both; text-align: left;">
entrar ala carpeta y con grunt deberá mostrar algo asi</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjVWAicYB8R2rPIVDjiuMPPwpIpugAKTG2MN7YkAdoUe-GsVe8RqM4FlJNL-OU8xHxhQucBfv9O5SSRY0CaMylGxJ6BtFECrxk1QYqrw67L9-qbKcsc1sGlccWDZRDgLI9rdFjkw/s1600/encriptaconNodejs5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjVWAicYB8R2rPIVDjiuMPPwpIpugAKTG2MN7YkAdoUe-GsVe8RqM4FlJNL-OU8xHxhQucBfv9O5SSRY0CaMylGxJ6BtFECrxk1QYqrw67L9-qbKcsc1sGlccWDZRDgLI9rdFjkw/s1600/encriptaconNodejs5.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Referencias:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
http://docs.nodejitsu.com/articles/cryptography/how-to-use-crypto-module</div>
<div class="separator" style="clear: both;">
http://stackoverflow.com/questions/13855120/nodejs-crypto-module-vs-crypto-js</div>
<div class="separator" style="clear: both;">
http://www.hacksparrow.com/how-to-generate-md5-sha1-sha512-sha256-checksum-hashes-in-node-js.html</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0tag:blogger.com,1999:blog-27449501.post-62113837253399285012015-06-26T12:19:00.002-05:002015-06-26T13:04:11.223-05:00Obtener sonido de Google Traslate con Java<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.ampercent.com/wp/wp-content/uploads/speech-text-google-chrome.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.ampercent.com/wp/wp-content/uploads/speech-text-google-chrome.png" height="242" width="400" /></a></div>
<br />
<br />
<br />
Lo que pasa es de que!!, esta vez quería ver algo así de rápido, no quería nada complicado y claro no hacer algo que ya existiera. Pues bien esta vez necesitaba traer el sonido que genera google traslate ese sonido que se asigna cuando escribes una frase a traducir. si claro como la imagen de abajo<br />
<br />
<br />
<a name='more'></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPXj1XKX-dttPuXoLWkLPhYNrjiX11ukTx6qOAK44PRUscFkeFUA9desZ_nOwjnD-joi2zFp4y1Mn2xSTe6Z1JMhZd9xyGIwAyUK2QZd3MsSLAl51L3_t6CZ6XPblIl2QJV8bU1w/s1600/bocinaGoogle.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="136" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPXj1XKX-dttPuXoLWkLPhYNrjiX11ukTx6qOAK44PRUscFkeFUA9desZ_nOwjnD-joi2zFp4y1Mn2xSTe6Z1JMhZd9xyGIwAyUK2QZd3MsSLAl51L3_t6CZ6XPblIl2QJV8bU1w/s320/bocinaGoogle.PNG" width="320" /></a></div>
<br />
Pues bien yo necesitaba traer este sonido que genera google traslate (Speach Google) a mi maquina pero no sabia como entonces busque en Internet y esto fue lo que encontré.<br />
<br />
<a href="http://stackoverflow.com/questions/9163988/download-mp3-from-google-translate-text-to-speech">http://stackoverflow.com/questions/9163988/download-mp3-from-google-translate-text-to-speech</a><br />
<br />
<br />
Y pues bien dado que ahí ponían algunas soluciones yo quise hacerlo para ver si era cierto, entonces la opción que escogí fue la siguiente:<br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;">package com.elkardumen.googleTraslate;</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><br /></span>
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;">import java.io.FileOutputStream;</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;">import java.net.HttpURLConnection;</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;">import java.net.URL;</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><br /></span>
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;">import org.apache.commons.io.IOUtils;</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><br /></span>
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><br /></span>
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;">public class GetSoundFromGoogleTraslate {</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><br /></span>
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public static void main(String[] args) {</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>URL url;</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>try {</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>url = new URL("http://translate.google.com/translate_tts?tl=en&q=\"hello\"");</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>HttpURLConnection httpcon = (HttpURLConnection) url.openConnection();</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>httpcon.addRequestProperty("User-Agent", "anything");</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>IOUtils.copy(httpcon.getInputStream(), new FileOutputStream("output.mp3"));</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>} catch (Exception e) {</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// TODO Auto-generated catch block</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>e.printStackTrace();</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"> </span></span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;"><br /></span>
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;">}</span><br />
<div>
<br />
(Tuve que importar la librería commons-io-2.4.jar para utilizar IOUtils.copy)</div>
<div>
<br /></div>
<div>
Y sorpresa si me funciono, al ejecutarlo este me genera el archivo <span style="color: blue; font-family: 'Courier New', Courier, monospace; font-size: xx-small;">output.mp3 </span> en la carpeta principal del proyecto.</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnQpA3uOIvjMd0wAMd4jfxn97EjtorgCzCC3Z8enZpvc9ZxJi3r5tgLXBpiD-cQsVVTx7_ifxcj4a7__fZpYCFrOM_OIINffr7Fs7HMPNXUbHLMcHim0G4kzpGR4I-FoTLfdheCw/s1600/resultadoBocinaGoogle.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnQpA3uOIvjMd0wAMd4jfxn97EjtorgCzCC3Z8enZpvc9ZxJi3r5tgLXBpiD-cQsVVTx7_ifxcj4a7__fZpYCFrOM_OIINffr7Fs7HMPNXUbHLMcHim0G4kzpGR4I-FoTLfdheCw/s1600/resultadoBocinaGoogle.PNG" /></a></div>
<div>
<br /></div>
<div>
probé varias palabras y bendito Google me había dado una solución a mi solicitud. Cuando quise traducir frases como "Hello World" , en mi resultado solo me mandaba la palabra inicial, es decir "Hello", entonces,tuve que agregar a esa frase el "%20" en el espacio en blanco , algo asi</div>
<div>
<br /></div>
<div>
<span style="color: blue; font-family: Verdana, sans-serif; font-size: xx-small;">url = new URL("http://translate.google.com/translate_tts?tl=en&q=\"hello%20world\"");</span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
y así fue como funciono, obtuve el sonido que google traslate me respondia. Este pequeño aporte es para compartir algo de lo mucho que hay en Internet y claro para que a mi no se me olvide que hice alguna vez esto. </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
xola139http://www.blogger.com/profile/13926539131502729062noreply@blogger.com0