Programación

Preguntas y respuestas para programadores profesionales y entusiastas.




13
Eliminar el canal alfa en una imagen
Tengo un ícono de aplicación para iOS, pero Apple no permite que el alfa esté en la imagen. ¿Cómo eliminar este canal alfa? Solo tengo la imagen png conmigo. No tengo el archivo fuente, ya que mi amigo hizo la imagen por mí.
101 ios  image  alpha 

2
¿Cómo fuerzo a git a verificar la rama maestra y eliminar los retornos de carro después de haber normalizado los archivos usando el atributo "texto"?
Bien, agregué el archivo .gitattributescon líneas como esta *.css text *.js text etc... Luego seguí las instrucciones en http://git-scm.com/docs/gitattributes#_checking-out_and_checking-in $ rm .git/index # Remove the index to force Git to $ git reset # re-scan the working directory $ git status # Show files that will be normalized $ git …


8
Evitar el autocompletado en Visual Studio Code
Estoy usando el nuevo código de Visual Studio , que claramente aún no está listo para el horario de máxima audiencia, pero espero resolver un problema que tengo. En un archivo SQL, cada vez que escribe case, se agrega automáticamente end, como si estuviera construyendo un casebloque. Incluso si está …

9
tslint dice que las llamadas a console.log no están permitidas. ¿Cómo puedo permitir esto?
Acabo de comenzar a usar create-react-app con mecanografiado create-react-app my-app --scripts-version=react-scripts-ts y la configuración tslint.json predeterminada no permite console.log (). ¿Cómo puedo (por ahora) habilitar console.log? Los documentos para esto se encuentran en https://palantir.github.io/tslint/rules/no-console/ . Pero no dicen dónde poner esta línea: "no-console": [true, "log", "error"] Busqué y encontré esta …





6
¿Cómo decodificar el Token JWT?
No entiendo cómo funciona esta biblioteca. Usted me podría ayudar por favor ? Aquí está mi código simple: public void TestJwtSecurityTokenHandler() { var stream = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJJU1MiLCJzY29wZSI6Imh0dHBzOi8vbGFyaW0uZG5zY2UuZG91YW5lL2NpZWxzZXJ2aWNlL3dzIiwiYXVkIjoiaHR0cHM6Ly9kb3VhbmUuZmluYW5jZXMuZ291di5mci9vYXV0aDIvdjEiLCJpYXQiOiJcL0RhdGUoMTQ2ODM2MjU5Mzc4NClcLyJ9"; var handler = new JwtSecurityTokenHandler(); var jsonToken = handler.ReadToken(stream); } Este es el error: La cadena debe estar en formato JSON compacto, que tiene …
101 c#  .net  jwt 

4
Cómo almacenar el archivo de configuración y leerlo usando React
Soy nuevo en react.js He implementado un componente en el que estoy obteniendo los datos del servidor y los uso como, CallEnterprise:function(TenantId){ fetchData('http://xxx.xxx.xx.xx:8090/Enterprises?TenantId='+TenantId+' &format=json').then(function(enterprises) { EnterprisePerspectiveActions.getEnterprise(enterprises); }).catch(function() { alert("There was some issue in API Call please contact Admin"); //ComponentAppDispatcher.handleViewAction({ // actionType: MetaItemConstants.RECEIVE_ERROR, // error: 'There was a problem getting the …

3
¿Cómo cat << EOF >> un archivo que contiene código?
Quiero imprimir código en un archivo usando cat &lt;&lt;EOF &gt;&gt;: cat &lt;&lt;EOF &gt;&gt; brightup.sh !/bin/bash curr=`cat /sys/class/backlight/intel_backlight/actual_brightness` if [ $curr -lt 4477 ]; then curr=$((curr+406)); echo $curr &gt; /sys/class/backlight/intel_backlight/brightness; fi EOF pero cuando verifico la salida del archivo, obtengo esto: !/bin/bash curr=1634 if [ -lt 4477 ]; then curr=406; echo …
101 linux  unix  sh  heredoc 

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.