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

 

 


Tema destacado: Tutorial básico de Quickjs


  Mostrar Mensajes
Páginas: 1 ... 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 [731] 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 ... 1236
7301  Programación / Scripting / Re: Ayuda con Ruby en: 12 Marzo 2014, 14:08 pm
Advertencia - mientras estabas escribiendo, una nueva respuesta fue publicada. Probablemente desees revisar tu mensaje.



pero hago eso y me da error :D

¿Nos piensas mostrar el código que estás usando, con las modificaciones, o debemos inventarlo?,
¿y nos vas a mostrar el detalle del error que te indica, o debemos adivinarlo?, no se, ¿tienes alguna pregunta sobre programación?.

Porfavor, lee las reglas de este subforo (lo tienes en un post con chincheta), sobre todo deberías leer el tema de sugerencias para formular una pregunta inteligente.


De todas formas... :
Código
  1. # -*- coding: UTF-8 -*-
  2.  
  3. num  = 25
  4. bool = true
  5. str  = "Ruby"
  6.  
  7. puts (
  8. "Numero : #{num}
  9. Boolean: #{bool}
  10. String : #{str} "
  11. )
  12.  
  13. sleep 10 and Process.exit
  14.  
  15. __END__

Saludos.
7302  Foros Generales / Foro Libre / Re: noticia de concurso + juego para aprender a programar en: 12 Marzo 2014, 02:16 am
Citar
Programa un algoritmo para cazar asteroides y gana 35.000 dólares

Juas!

Pues como no te lleven a la misma NASA para que te dejen programar allí...

No se yo quien podría ser el Genius capaz de planificar y desarrollar un algoritmo semejante ...sentado enfrente de su PC, sin disponer del instrumental astronómico necesario (telescopios, satelites, o que se yo) para realizar las distintas pruebas y comparaciones, y un software de predicción astronómica que solo la NASA y 4 gatos más tendrán para poder calcular todas las posibles variantes aritméticas (no muy documentadas hasta la fecha si lo comparamos con cualquier otro objeto cercano) que conlleva el estudio de un objeto a miles y millnes de kilómetros y/o incluso años luz como es un Asteroide.

No es por ser pesimista, pero el concurso me parece más que ridículo, destinado a gente con muchos, pero muchos recursos científicos tecnológicos,
en fin considero una pérdida de tiempo inconmesurable el simple hecho de leer más que el enunciado del artículo xD (he leido eso y pocos párrafos más).

Saludos!
7303  Programación / Scripting / Re: No puedo iniciar un bat desde otro batch windows 7 que ascooo en: 12 Marzo 2014, 01:56 am
si lo ejecuto en la misma carpeta si funciona pero la idea es ejecutarlo desde otra

No se si entiendo muy bien lo que quieres decir...

Si ejecutas el Script desde otro directorio, óbviamente el directorio de trabajo actual cambia, y  entonces, aquí:

Citar
Código
  1. @echo off
  2. del /Q "Bank_022\*.bat"
  3. xcopy /y "*.bat" "Bank_022\*.bat"
  4. start "" "D:\GTAndroidRipeado\com.rockstargames.gtasa\main.2.com.rockstargames.gtasa\audio\n\Bank_022\sss.bat"
  5. del /Q "Bank_022\*.bat"

Debes indicar la ruta absoluta del cirectorio "Bank_022".

Saludos
7304  Programación / Scripting / Re: [Python] Traductor Ingles-Español en: 12 Marzo 2014, 01:32 am
me parecio interesante que lo tengas en .net , no lo podrias subir en algun lado? ,  para ver si lo puedo traducir a C#.

No se, teniendo en cuenta las cosas tan feas que me dijiste...  :rolleyes: ;)

No te costará convertirlo, el código es simple, el código original que escribí lo puedes ver aquí ~> Usar Google Translate sin comprar la API de pago xD

Óbviamente el método de parsing que empleo es muy básico y tiene sus fallas (caracteres escapados como la comilla doble los dejo como están), quien quiera puede perfeccionarlo, a mi me vale tal como está para seguir sacando las castañas del fuego.

De todas formas he tomado el código y lo acabo de documentar un poco y cambiar su modo de empleo, aquí tienes:

Código
  1. ' ***********************************************************************
  2. ' Author   : Elektro
  3. ' Modified : 03-12-2014
  4. ' ***********************************************************************
  5. ' <copyright file="GoogleTranslator.vb" company="Elektro Studios">
  6. '     Copyright (c) Elektro Studios. All rights reserved.
  7. ' </copyright>
  8. ' ***********************************************************************
  9.  
  10. #Region " Usage Examples "
  11.  
  12. ' MsgBox(GoogleTranslator.Translate("Hello Google!", GoogleTranslator.Language.en, GoogleTranslator.Language.es))   ' Result: Hola Google!
  13.  
  14. ' MsgBox(GoogleTranslator.Translate("Hello Google!", GoogleTranslator.Language.auto, GoogleTranslator.Language.fr)) ' Result: Bonjour Google!
  15.  
  16. #End Region
  17.  
  18. #Region " Google Translator "
  19.  
  20. ''' <summary>
  21. ''' Uses GoogleTranslate page to translate text from one Language to another.
  22. ''' </summary>
  23. Public Class GoogleTranslator
  24.  
  25. #Region " Enumerations "
  26.  
  27.    ''' <summary>
  28.    ''' Indicates a GoogleTranslate Language abbreviation.
  29.    ''' </summary>
  30.    Public Enum Language As Integer
  31.  
  32.        ''' <summary>
  33.        ''' Let Google Detect The Language
  34.        ''' </summary>
  35.        auto
  36.  
  37.        ''' <summary>
  38.        ''' afrikáans
  39.        ''' </summary>
  40.        af
  41.  
  42.        ''' <summary>
  43.        ''' árabe
  44.        ''' </summary>
  45.        ar
  46.  
  47.        ''' <summary>
  48.        ''' azerí
  49.        ''' </summary>
  50.        az
  51.  
  52.        ''' <summary>
  53.        ''' bielorruso
  54.        ''' </summary>
  55.        be
  56.  
  57.        ''' <summary>
  58.        ''' búlgaro
  59.        ''' </summary>
  60.        bg
  61.  
  62.        ''' <summary>
  63.        ''' bengalí; bangla
  64.        ''' </summary>
  65.        bn
  66.  
  67.        ''' <summary>
  68.        ''' bosnio
  69.        ''' </summary>
  70.        bs
  71.  
  72.        ''' <summary>
  73.        ''' catalán
  74.        ''' </summary>
  75.        ca
  76.  
  77.        ''' <summary>
  78.        ''' cebuano
  79.        ''' </summary>
  80.        ceb
  81.  
  82.        ''' <summary>
  83.        ''' checo
  84.        ''' </summary>
  85.        cs
  86.  
  87.        ''' <summary>
  88.        ''' galés
  89.        ''' </summary>
  90.        cy
  91.  
  92.        ''' <summary>
  93.        ''' danés
  94.        ''' </summary>
  95.        da
  96.  
  97.        ''' <summary>
  98.        ''' alemán
  99.        ''' </summary>
  100.        de
  101.  
  102.        ''' <summary>
  103.        ''' griego
  104.        ''' </summary>
  105.        el
  106.  
  107.        ''' <summary>
  108.        ''' inglés
  109.        ''' </summary>
  110.        en
  111.  
  112.        ''' <summary>
  113.        ''' esperanto
  114.        ''' </summary>
  115.        eo
  116.  
  117.        ''' <summary>
  118.        ''' español
  119.        ''' </summary>
  120.        es
  121.  
  122.        ''' <summary>
  123.        ''' estonio
  124.        ''' </summary>
  125.        et
  126.  
  127.        ''' <summary>
  128.        ''' euskera
  129.        ''' </summary>
  130.        eu
  131.  
  132.        ''' <summary>
  133.        ''' persa
  134.        ''' </summary>
  135.        fa
  136.  
  137.        ''' <summary>
  138.        ''' finlandés
  139.        ''' </summary>
  140.        fi
  141.  
  142.        ''' <summary>
  143.        ''' francés
  144.        ''' </summary>
  145.        fr
  146.  
  147.        ''' <summary>
  148.        ''' irlandés
  149.        ''' </summary>
  150.        ga
  151.  
  152.        ''' <summary>
  153.        ''' gallego
  154.        ''' </summary>
  155.        gl
  156.  
  157.        ''' <summary>
  158.        ''' gujarati
  159.        ''' </summary>
  160.        gu
  161.  
  162.        ''' <summary>
  163.        ''' hindi
  164.        ''' </summary>
  165.        hi
  166.  
  167.        ''' <summary>
  168.        ''' Hmong
  169.        ''' </summary>
  170.        hmn
  171.  
  172.        ''' <summary>
  173.        ''' croata
  174.        ''' </summary>
  175.        hr
  176.  
  177.        ''' <summary>
  178.        ''' criollo haitiano
  179.        ''' </summary>
  180.        ht
  181.  
  182.        ''' <summary>
  183.        ''' húngaro
  184.        ''' </summary>
  185.        hu
  186.  
  187.        ''' <summary>
  188.        ''' armenio
  189.        ''' </summary>
  190.        hy
  191.  
  192.        ''' <summary>
  193.        ''' indonesio
  194.        ''' </summary>
  195.        id
  196.  
  197.        ''' <summary>
  198.        ''' italiano
  199.        ''' </summary>
  200.        it
  201.  
  202.        ''' <summary>
  203.        ''' hebreo
  204.        ''' </summary>
  205.        iw
  206.  
  207.        ''' <summary>
  208.        ''' japonés
  209.        ''' </summary>
  210.        ja
  211.  
  212.        ''' <summary>
  213.        ''' javanés
  214.        ''' </summary>
  215.        jw
  216.  
  217.        ''' <summary>
  218.        ''' georgiano
  219.        ''' </summary>
  220.        ka
  221.  
  222.        ''' <summary>
  223.        ''' Jemer
  224.        ''' </summary>
  225.        km
  226.  
  227.        ''' <summary>
  228.        ''' canarés
  229.        ''' </summary>
  230.        kn
  231.  
  232.        ''' <summary>
  233.        ''' coreano
  234.        ''' </summary>
  235.        ko
  236.  
  237.        ''' <summary>
  238.        ''' latín
  239.        ''' </summary>
  240.        la
  241.  
  242.        ''' <summary>
  243.        ''' lao
  244.        ''' </summary>
  245.        lo
  246.  
  247.        ''' <summary>
  248.        ''' lituano
  249.        ''' </summary>
  250.        lt
  251.  
  252.        ''' <summary>
  253.        ''' letón
  254.        ''' </summary>
  255.        lv
  256.  
  257.        ''' <summary>
  258.        ''' macedonio
  259.        ''' </summary>
  260.        mk
  261.  
  262.        ''' <summary>
  263.        ''' maratí
  264.        ''' </summary>
  265.        mr
  266.  
  267.        ''' <summary>
  268.        ''' malayo
  269.        ''' </summary>
  270.        ms
  271.  
  272.        ''' <summary>
  273.        ''' maltés
  274.        ''' </summary>
  275.        mt
  276.  
  277.        ''' <summary>
  278.        ''' holandés
  279.        ''' </summary>
  280.        nl
  281.  
  282.        ''' <summary>
  283.        ''' noruego
  284.        ''' </summary>
  285.        no
  286.  
  287.        ''' <summary>
  288.        ''' polaco
  289.        ''' </summary>
  290.        pl
  291.  
  292.        ''' <summary>
  293.        ''' portugués
  294.        ''' </summary>
  295.        pt
  296.  
  297.        ''' <summary>
  298.        ''' rumano
  299.        ''' </summary>
  300.        ro
  301.  
  302.        ''' <summary>
  303.        ''' ruso
  304.        ''' </summary>
  305.        ru
  306.  
  307.        ''' <summary>
  308.        ''' eslovaco
  309.        ''' </summary>
  310.        sk
  311.  
  312.        ''' <summary>
  313.        ''' esloveno
  314.        ''' </summary>
  315.        sl
  316.  
  317.        ''' <summary>
  318.        ''' albanés
  319.        ''' </summary>
  320.        sq
  321.  
  322.        ''' <summary>
  323.        ''' serbio
  324.        ''' </summary>
  325.        sr
  326.  
  327.        ''' <summary>
  328.        ''' sueco
  329.        ''' </summary>
  330.        sv
  331.  
  332.        ''' <summary>
  333.        ''' suajili
  334.        ''' </summary>
  335.        sw
  336.  
  337.        ''' <summary>
  338.        ''' tamil
  339.        ''' </summary>
  340.        ta
  341.  
  342.        ''' <summary>
  343.        ''' telugu
  344.        ''' </summary>
  345.        te
  346.  
  347.        ''' <summary>
  348.        ''' tailandés
  349.        ''' </summary>
  350.        th
  351.  
  352.        ''' <summary>
  353.        ''' tagalo
  354.        ''' </summary>
  355.        tl
  356.  
  357.        ''' <summary>
  358.        ''' turco
  359.        ''' </summary>
  360.        tr
  361.  
  362.        ''' <summary>
  363.        ''' ucraniano
  364.        ''' </summary>
  365.        uk
  366.  
  367.        ''' <summary>
  368.        ''' urdu
  369.        ''' </summary>
  370.        ur
  371.  
  372.        ''' <summary>
  373.        ''' vietnamita
  374.        ''' </summary>
  375.        vi
  376.  
  377.        ''' <summary>
  378.        ''' yidis
  379.        ''' </summary>
  380.        yi
  381.  
  382.        ''' <summary>
  383.        ''' chino
  384.        ''' </summary>
  385.        zh_CN
  386.  
  387.    End Enum
  388.  
  389. #End Region
  390.  
  391. #Region " Public Methods "
  392.  
  393.    ''' <summary>
  394.    ''' Translates the specified text.
  395.    ''' </summary>
  396.    ''' <param name="String">Indicates the string to translate.</param>
  397.    ''' <param name="From">Indicates the text lanuage.</param>
  398.    ''' <param name="To">Indicates the resulting language.</param>
  399.    ''' <returns>System.String.</returns>
  400.    Public Shared Function Translate(ByVal [String] As String,
  401.                                     ByVal From As Language,
  402.                                     ByVal [To] As Language) As String
  403.  
  404.        Dim Query As String =
  405.            String.Format("http://translate.google.com/translate_a/t?client=t&text={0}&sl={1}&tl={2}",
  406.                          [String],
  407.                          From.ToString.Replace("_", "-"),
  408.                          [To].ToString.Replace("_", "-"))
  409.  
  410.        Using WebClient As New Net.WebClient
  411.            [String] = WebClient.DownloadString(Query)
  412.            WebClient.Dispose()
  413.        End Using
  414.  
  415.        Return [String].Substring([String].IndexOf(ControlChars.Quote) + 1, [String].LastIndexOf(ControlChars.Quote)).
  416.                        Split({ControlChars.Quote & "," & ControlChars.Quote}, StringSplitOptions.None).
  417.                        First
  418.  
  419.    End Function
  420.  
  421. #End Region
  422.  
  423. End Class
  424.  
  425. #End Region

Saludos.
7305  Programación / Scripting / Re: No puedo iniciar un bat desde otro batch windows 7 que ascooo en: 12 Marzo 2014, 00:17 am
ya se que no es aconsejable pero ni asi funciona.

Tampoco especificas cual es el comando que no te funciona, ni los detalles del error que te indica la CMD, así no vas a poder conseguir mucha ayuda posible.

Lee la actualización que le hice a mi comentario de arriba, abajo del todo te puse el comando, pruébalo.

saludos!
7306  Programación / Scripting / Re: No puedo iniciar un bat desde otro batch windows 7 que ascooo en: 12 Marzo 2014, 00:10 am
Hola

No es aconsejable utilizar el comando start de esa manera.

La mejor manera de aprender es dándote tu mismo cuenta del porqué.

Escribe en consola:

Código:
Start /?

¿Que ves?

Cita de: CMD
Código:
START ["título"] [/D ruta]

Entonces, ¿que le falta a tu comando?, el parámetro donde debes especificar el "título".

Código:
start "GTA RIP" "D:\GTAndroidRipeado\com.rockstargames.gtasa\main.2.com.rockstargames.gtasa\audio\n\Bank_022\sss.bat"

Saludos
7307  Programación / Scripting / Re: [Python] Traductor Ingles-Español en: 12 Marzo 2014, 00:07 am
A mi la ausencia de una API gratis no me impide seguir utilizando GoogleTranslate enviando peticiones por web, ¿te lo has planteado?, es reálmente sencillo, aunque, claro, más incómodo, y el grado de eficiencia resultante sería la eficacia que tu tengas al momento de parsear la respuesta.

Ahora, en Python no tengo ni conozco ningún código para esto, pero si te sirviera en VB.NET, solo dímelo.

PD: Aquí puedes encontrar muchos ejemplos en Python.

Saludos!
7308  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Compartan aquí sus snippets) en: 11 Marzo 2014, 21:08 pm
Determina si un caracter es diacrítico o si contiene una marca diacrítica (no es 100% efectivo con caracteres demasiado raros de otras culturas)

Código
  1.    ' Character Is Diacritic?
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(CharacterIsDiacritic("á")) ' Result: True
  6.    '
  7.    ''' <summary>
  8.    ''' Determines whether a character is diacritic or else contains a diacritical mark.
  9.    ''' </summary>
  10.    ''' <param name="Character">Indicates the character.</param>
  11.    ''' <returns><c>true</c> if character is diacritic or contains a diacritical mark, <c>false</c> otherwise.</returns>
  12.    Public Function CharacterIsDiacritic(ByVal Character As Char) As Boolean
  13.  
  14.        If String.IsNullOrEmpty(CharacterIsDiacritic) Then
  15.  
  16.            Return False
  17.        Else
  18.            Dim Descomposed As Char() = Character.ToString.Normalize(System.Text.NormalizationForm.FormKD).ToCharArray
  19.            Return (Descomposed.Count <> 1 OrElse String.IsNullOrWhiteSpace(Descomposed))
  20.  
  21.        End If
  22.  
  23.    End Function




Convierte un caracter diacritico

Código
  1.    ' Convert Diacritic Character
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(ConvertDiacritic("á", UnicodeNormalization:=System.Text.NormalizationForm.FormKD)) ' Result: 'a'
  6.    '
  7.    ''' <summary>
  8.    ''' Converts the diacritic characters in a String to an equivalent normalized English characters.
  9.    ''' </summary>
  10.    ''' <param name="Character">
  11.    ''' Indicates the diacritic character.
  12.    ''' </param>
  13.    ''' <param name="UnicodeNormalization">
  14.    ''' Defines the type of Unicode character normalization to perform.
  15.    ''' (Default is 'NormalizationForm.FormKD')
  16.    ''' </param>
  17.    ''' <returns>The converted character.</returns>
  18.    Public Function ConvertDiacritic(ByVal Character As Char,
  19.                                     Optional ByVal UnicodeNormalization As System.Text.NormalizationForm =
  20.                                                                            System.Text.NormalizationForm.FormKD) As String
  21.  
  22.        Dim Chars As Char() =
  23.            CStr(Character).Normalize(System.Text.NormalizationForm.FormKD).ToCharArray
  24.  
  25.        For Each c As Char In Chars
  26.  
  27.            Select Case Globalization.CharUnicodeInfo.GetUnicodeCategory(c)
  28.  
  29.                Case Globalization.UnicodeCategory.NonSpacingMark,
  30.                     Globalization.UnicodeCategory.SpacingCombiningMark,
  31.                     Globalization.UnicodeCategory.EnclosingMark
  32.  
  33.                    ' Do nothing.
  34.                    Exit Select
  35.  
  36.                Case Else
  37.                    Return c
  38.  
  39.            End Select
  40.  
  41.        Next c
  42.  
  43.        Return Character
  44.  
  45.    End Function



Obtiene el keyboardlayout

Código
  1.    ' Get Keyboard Layout
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetKeyboardLayout(IntPtr.Zero)) ' Result: 10
  6.    ' MsgBox(GetKeyboardLayout(Process.GetCurrentProcess.MainWindowHandle)) ' Result: 10
  7.    '
  8.    ''' <summary>
  9.    ''' Retrieves the active input locale identifier (formerly called the keyboard layout).
  10.    ''' </summary>
  11.    ''' <param name="idThread">
  12.    ''' A window handle identifier of the thread to query, or 'IntPtr.Zero' to query the current thread.
  13.    ''' </param>
  14.    ''' <returns>
  15.    ''' The return value is the input locale identifier for the thread.
  16.    ''' </returns>
  17.    Public Shared Function GetKeyboardLayout(Optional ByVal idThread As IntPtr = Nothing) As Short
  18.  
  19.        Return BitConverter.GetBytes(APIGetKeyboardLayout(idThread)).First
  20.  
  21.    End Function
  22.  
  23.    ''' <summary>
  24.    ''' Retrieves the active input locale identifier (formerly called the keyboard layout).
  25.    ''' </summary>
  26.    ''' <param name="idThread">
  27.    ''' A window handle identifier of the thread to query, or 'IntPtr.Zero' to query the current thread.
  28.    ''' </param>
  29.    ''' <returns>
  30.    ''' The return value is the input locale identifier for the thread.
  31.    '''
  32.    ''' The low-order byte contains a Language Identifier for the input language,
  33.    ''' and the high-order byte contains a device handle to the physical layout of the keyboard.
  34.    ''' </returns>
  35.    <System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint:="GetKeyboardLayout",
  36.    CharSet:=System.Runtime.InteropServices.CharSet.Unicode)>
  37.    Private Shared Function APIGetKeyboardLayout(
  38.                            Optional ByVal idThread As IntPtr = Nothing
  39.    ) As UInteger
  40.    End Function



Obtiene el keycode de un caracter (ojo, no el keycode virtual).

Código
  1.    ' Get KeyCode
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    ' MsgBox(GetKeyCode("a")) ' Result: 65
  6.    ' MsgBox(GetKeyCode("á")) ' Result: 65
  7.    ' MsgBox(GetKeyCode("á", IntPtr.Zero)) ' Result: 65
  8.    ' MsgBox(GetKeyCode("a", Process.GetCurrentProcess.MainWindowHandle)) ' Result: 65
  9.    '
  10.    'Private Sub Test() Handles MyBase.Shown
  11.    '    Dim sb As New System.Text.StringBuilder
  12.    '    Dim Characters As Char() = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ñÑçÇ áéíóú ÁÉÍÓÚ àèìòù ÀÈÌÒÙ äëïÖÜ ÄËÏÖÜ º\'¡`+´-.,ª!·$%&/()=?¿".ToCharArray
  13.    '    For Each c As Char In Characters
  14.    '        sb.AppendFormat("Character: {0}", CStr(c))
  15.    '        sb.AppendLine()
  16.    '        sb.AppendFormat("KeyCode  : {0}", CStr(GetKeyCode(c, IntPtr.Zero)))
  17.    '        MessageBox.Show(sb.ToString)
  18.    '        sb.Clear()
  19.    '    Next c
  20.    'End Sub
  21.  
  22.    ''' <summary>
  23.    ''' Translates a character to the corresponding keycode.
  24.    ''' </summary>
  25.    ''' <param name="Character">Indicates the character.</param>
  26.    ''' <param name="KeyboardLayout">Indicates the keyboard layout.</param>
  27.    ''' <returns>
  28.    ''' If the function succeeds, the return value contains the keycode.
  29.    '''
  30.    ''' If the function finds no key that translates to the passed character code,
  31.    ''' the return value contains "-1".
  32.    ''' </returns>
  33.    Public Shared Function GetKeyCode(ByVal Character As Char,
  34.                                      Optional ByVal KeyboardLayout As IntPtr = Nothing) As Short
  35.  
  36.        ' Get the Keycode of the character.
  37.        Dim Keycode As Short =
  38.            BitConverter.GetBytes(VkKeyScanEx(Character)).First
  39.  
  40.        Select Case Keycode
  41.  
  42.            Case Is <> 255S ' Character is found on the current KeyboardLayout.
  43.                Return Keycode
  44.  
  45.            Case Else ' Character is not found on the current KeyboardLayout.
  46.  
  47.                ' Descompose the character.
  48.                Dim Descomposed As Char() =
  49.                    Character.ToString.Normalize(System.Text.NormalizationForm.FormKD).ToCharArray
  50.  
  51.                ' If character is diacritic then...
  52.                If Descomposed.Count <> 1 OrElse String.IsNullOrWhiteSpace(Descomposed) Then
  53.  
  54.                    For Each c As Char In Descomposed
  55.  
  56.                        Select Case Globalization.CharUnicodeInfo.GetUnicodeCategory(c)
  57.  
  58.                            Case Globalization.UnicodeCategory.NonSpacingMark,
  59.                                 Globalization.UnicodeCategory.SpacingCombiningMark,
  60.                                 Globalization.UnicodeCategory.EnclosingMark
  61.  
  62.                                ' Do nothing.
  63.                                Exit Select
  64.  
  65.                            Case Else ' Character is diacritic so we convert the diacritic and try to find the Keycode.
  66.                                Return GetKeyCode(c, KeyboardLayout)
  67.  
  68.                        End Select
  69.  
  70.                    Next c
  71.  
  72.                End If ' Chars.Count <> 1
  73.  
  74.        End Select ' Keycode
  75.  
  76.        Return -1S ' Character is not diacritic and the keycode is not found.
  77.  
  78.    End Function
  79.  
  80.    ''' <summary>
  81.    ''' Translates a character to the corresponding virtual-key code and shift state.
  82.    ''' The function translates the character using the input language and
  83.    ''' physical keyboard layout identified by the input locale identifier.
  84.    ''' For more info see here:
  85.    ''' http://msdn.microsoft.com/en-us/library/ms646332%28v=VS.85%29.aspx
  86.    ''' </summary>
  87.    ''' <param name="c">Indicates the character.</param>
  88.    ''' <param name="KeyboardLayout">Indicates the keyboard layout.</param>
  89.    ''' <returns>
  90.    ''' If the function succeeds,
  91.    ''' the low-order byte of the return value contains the virtual-key code,
  92.    ''' and the high-order byte contains the shift state.
  93.    '''
  94.    ''' If the function finds no key that translates to the passed character code,
  95.    ''' both the low-order and high-order bytes contain '255'.
  96.    ''' </returns>
  97.    <System.Runtime.InteropServices.DllImport("user32.dll",
  98.    CharSet:=System.Runtime.InteropServices.CharSet.Unicode)>
  99.    Private Shared Function VkKeyScanEx(
  100.                            ByVal c As Char,
  101.                            Optional ByVal KeyboardLayout As IntPtr = Nothing
  102.    ) As Short
  103.    End Function



Envio de peticion por el método POST

Código
  1.    ' Send POST
  2.    ' ( By Elektro )
  3.    '
  4.    ' Usage Examples:
  5.    '
  6.    'Dim Response As String =
  7.    '    SendPOST("http://es.wikipedia.org/wiki/Special:Search?",
  8.    '             New Dictionary(Of String, String) From {
  9.    '                 {"search", "Petición+POST"},
  10.    '                 {"sourceid", "Mozilla-search"}
  11.    '             }) ' Formated POST Data: "search=Petición+POST&sourceid=Mozilla-search"
  12.    'Clipboard.SetText(Response) ' Copy the response to Clipboard.
  13.    '
  14.    ''' <summary>
  15.    ''' Sends a POST method petition and returns the server response.
  16.    ''' </summary>
  17.    ''' <param name="URL">Indicates the URL.</param>
  18.    ''' <param name="PostData">Indicates the post data.</param>
  19.    ''' <returns>The response.</returns>
  20.    Public Function SendPOST(ByVal URL As String,
  21.                             ByVal PostData As Dictionary(Of String, String)) As String
  22.  
  23.        Dim Data As New System.Text.StringBuilder ' PostData to send, formated.
  24.        Dim Request As Net.HttpWebRequest = HttpWebRequest.Create(URL) ' HTTP Request.
  25.        Dim Response As HttpWebResponse ' Server response.
  26.        Dim ResponseContent As String ' Server response result.
  27.  
  28.        ' Set and format the post data of the query.
  29.        For Each Item As KeyValuePair(Of String, String) In PostData
  30.            Data.AppendFormat("{0}={1}&", Item.Key, Item.Value)
  31.        Next Item
  32.  
  33.        ' Set the Request properties.
  34.        With Request
  35.            .Method = "POST"
  36.            .ContentType = "application/x-www-form-urlencoded"
  37.            .ContentLength = Data.ToString.Length
  38.            .Proxy = Nothing
  39.            ' .UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"
  40.        End With
  41.  
  42.        ' Write the POST data bytes into the Stream.
  43.        Using RequestStream As IO.Stream = Request.GetRequestStream()
  44.            RequestStream.Write(System.Text.Encoding.UTF8.GetBytes(Data.ToString), 0, Data.ToString.Length)
  45.            RequestStream.Close()
  46.        End Using
  47.  
  48.        ' Get the response.
  49.        Response = Request.GetResponse()
  50.  
  51.        ' Get the response content.
  52.        Using Reader As New IO.StreamReader(Response.GetResponseStream)
  53.            ResponseContent = Reader.ReadToEnd
  54.            Response.Close()
  55.        End Using
  56.  
  57.        ' Return the response content.
  58.        Return ResponseContent
  59.  
  60.    End Function
7309  Programación / Scripting / Re: [AYUDA][BATCH] Sistema para remplazar varios archivos por uno conservando nombre en: 11 Marzo 2014, 19:26 pm
Código
  1. @Echo OFF
  2.  
  3. Set "FakeAudio=.\File.mp3"
  4.  
  5. FOR %%@ IN ("*.mp3") DO (
  6.    Copy /Y "%FakeAudio%" "%%~@"
  7. )
  8.  
  9. Pause&Exit

Saludos.
7310  Sistemas Operativos / Windows / Re: problemas con ms dos ayuda en: 11 Marzo 2014, 16:47 pm
me di cuenta que no tengo la carpeta (system32) dice (system) calculo que es lo mismo

tampoco tengo en mi computadora la carpeta que me señalas "WinSXS" o sea directamente no existe en mi computadora

Es técnicamente imposible que no existan dichas carpetas en tu SO.

La carpeta System32 (no System, esa no es importante) es el corazón de Windows, almacena los drivers de tus dispositivos así como la configuración del Bootloader y todas las herramientas que necesita usar tu SO (comandos externos de Batch, PowerShell, MMC, etc) junto a sus configuraciones de idioma, y casi todos los archivos esenciales que Windows necesita para cargar el sistema, sin esta carpeta, no podrías iniciar Windows.

La carpeta WinSXS se puede reducir de tamaño consideráblemente eliminando gran parte de las copias de seguridad de archivos que contiene la carpeta, pero la carpeta en si misma no se puede eliminar complétamente, ya que almacena otros archivos importantes de los que depende Windows para cargarse.

¿Has comprobado que las carpetas no están símplemente ocultas?, deben existir.

No suelo decir esto, pero dado el extraño caso donde cosas que deberían estar (WBEM), no estan, y otras cosas que deberían ser visibles por defecto pero están invisibles o...no se sabe donde están ubicadas (System32), te recomiendo que hagas una reinstalación limpia del SO.

Saludos!
Páginas: 1 ... 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 [731] 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines