miércoles, 25 de junio de 2014

Intellisense not showing in Visual Studio

This happened to me a few days ago. I was coding in ASP.NET (VB) and then suddenly the intellisense was not showing anything when I write the "." to try to access the objetcts propertys/methods and even I kept getting errors from the tags in the aspx file:

"Element 'Panel' is not a known element. This can occur if there is a compilation error in the Web Site, or the web.config file is missing."



I mean, it even tried to blame me!. But the case was that the website compiled and executed correctly. With that in mind I search over the internet (well I googled it and search it using DuckDuckGo too). I found some other interesting stuff that could be useful in some other situation like this y this, however none of them solved my issue.

The idea of reinstall Visual Studio came to my mind again, but finally the solution came from this forum and is as easy as:



The only thing here is that by doing so you'll loose some configs like VS windows locations (class explorer or toolbox for example) and some other IDE config, nothing to really worry about but you I just wanted to inform you.

Greetings!

No se muestra intellisense en Visual Studio

Hace poco me ocurrió que al estar programando en ASP.NET con VB, el intellisense no se mostraba al escribir el "." para intentar acceder a la lista de propiedades/métodos del objeto e incluso las etiquetas en el archivo aspx daban un mensaje de error:

"Element 'Panel' is not a known element. This can occur if there is a compilation error in the Web Site, or the web.config file is missing."

viernes, 20 de junio de 2014

Remove Omiga Plus

Recently it happened that my computer was affected by the "Omiga Plus" malware. The symptoms were:

  • My browser start page, new tab and home page were changed to show the "Omiga Plus" web search page. 
  • One search plugin was added to the list and set as default in Chrome and Firefox.
  • If I change manually the start page, new tab and home page settings, the omiga settings were resetted "magically" when I restart the computer.
It happens that de mentioned "Omiga Plus" is a not a virus but a malware, specifically a browser hijacker and its really annoying to have those bugs lurking in the computer. Some of those only "hijack" the web browser (hence the name) and redirect search to a specific web page, but only they know if they are capturing some other data.

Deleting this kind of software sometimes can be easy or turn out to be an odyssey. There are from every kind and for me this was the most complicated to delete that I have found yet. I tried in several ways but they didn't work, at least for me:
  • Avast!: I have it on my computer as my antivirus of choice but It didn't even blink, didn't detected the omiga malware.
  • Spybot: I installed and executed it, but again, didn't delete the omiga malware.
  • I manually deleted a suspicious file that executes on computer start. Resetted the browser options but those keep emerging after a computer reset.
SOLUTION
  • Adwcleaner: finally, one of the many pages I visited (malwaretips.com) commented it was posible to remove it with some antimalware tools and recommended adwcleaner. I downloaded from this URL (adwcleaner malware removal tool) and it worked perfectly.


After removing the malware, resetted manually the start page, new tab and plugins in my browsers (Firefox, Internet Explorer and Chrome) I restarted the computer and the issues didn't show up again.

Espero que esta información is useful to you.

Eliminar Omiga Plus

Recientemente me sucedió que mi computadora se vió afectada por el malware "omiga plus". Los síntomas eran:

  • La página de inicio, nueva pestaña y el home page de los navegadores fueron cambiados para que se mostrara la web de búsqueda de Omiga Plus.
  • Se añadió un buscador a la lista de buscadores de Chrome y Firefox de forma que el buscador por default fuera Omiga Plus.
  • Al cambiar manualmente las opciones de inicio, nueva pestaña y home page, la configuración de Omiga se reestablecía "mágicamente" al reiniciar la computadora.

Sucede que el susodicho "Omiga Plus" es un malware de tipo browser hijacker, y realmente me resulta molesto tener esa clase de bichos en la computadora, algunos simplemente secuestran el navegador (de ahí su nombre) y redirigen las búsquedas a una página específica, pero solo ellos saben que otra información podrían estar capturando.

Eliminar este tipo de programas puede ser una tarea sencilla o resultar en toda una odisea. Los hay de todo tipo y hasta el momento este ha sido el más complicado que me he encontrado. Intenté de varias maneras pero al menos a mi no me funcionaron:

  • Avast!: lo tengo instalado como antivirus y ni pestañeó, no lo detectó.
  • Spybot: lo instalé y ejecuté pero no funcionó, no eliminó a omiga plus.
  • Eliminé manualmente un archivo sospechoso así como un archivo que se ejecutaba al iniciar el sistema. Reconfiguré las opciones de inicio, nueva pestaña y home page pero estas volvían a cambiarse al reiniciar la computadora.
SOLUCION
  • Adwcleaner: finalmente, una de las tantas páginas que estuve visitando (malwaretips.com) indicaba que era posible eliminarlo con herramientas antimalware y recomendaban adwcleaner. Lo bajé de esta dirección (adwcleaner malware removal tool) y funcionó a la perfección.


Luego de haber eliminado el malware, reestablecí manualmente las configuraciones de inicio, nueva pestaña, plugins activos y buscadores predeterminados de mis navegadores (Firefox, Internet Explorer y Chrome), reinicié la computadora y el problema ya no volvió a presentarse.

Espero que esta información te sea de utilidad.

domingo, 8 de junio de 2014

MySQL - Authentication with old password no longer supported, use 4.1 style password

Estaba retomando un desarrollo web para un cliente y al intentar probar el sitio web en vivo en internet... ¡pum!, que me salta un error al momento de intentar la conexión a la base de datos: "Authentication with old password no longer supported, use 4.1 style passwords".

 SET PASSWORD FOR 'username'@'%' = password( 'mynewpassword' )

Estuve realizando algunos intentos de cambiar el password pero obtenía otros errores:

Access denied for user 'username'@'localhost' to database 'mysql' 
Access denied for user 'username'@'%' to database 'mysql' 

Finalmente, revisando las páginas páginas oficiales de MySQL (ver aquí). Me encontré con la solución y resultó que solamente tenía que poner el nombre del usuario sin las comillas:

 SET PASSWORD FOR username = password( 'mynewpassword' )

En resumen: al parecer hubo un cambio en la manera de establecer la encriptación de los passwords entre las versiones viejas de MySQL y la versíon 5.1. Ahí fue cuando sospeché que mi proveedor de web hosting estaba utilizando una versión "viejita" de MySQL. Por si acaso, les pica la curiosidad y quieren conocer la versión de su servidor de MySQL, es posible obtener ese dato ejecutando el siguiente query:

SHOW VARIABLES LIKE "%version%";


Saludos!

MySQL - Authentication with old password no longer supported

I was resuming a web development for a customer and when I tried to test it live on the internet ¡bang!, an error jumps out when the application attempts to connect to the database: "Authentication with old password no longer supported, use 4.1 style passwords".

 SET PASSWORD FOR 'username'@'%' = password( 'mynewpassword' )

I made some attempts to change the password but I kept getting some other errors:

Access denied for user 'username'@'localhost' to database 'mysql' 
Access denied for user 'username'@'%' to database 'mysql' 

Finally, I double checked the official MySQL pages (here) and found the solución. It turned out that I only needed to write the database user name without the quotes:

 SET PASSWORD FOR username = password( 'mynewpassword' )

Summary: it seems that there was a change in MySQL version 5.1 regarding how the password is encrypted. Then I suspected that my web hosting was using a non fully compatible Parallels Plesk Panel/cPanel - PHP MyAdmin - MySQL.

I solved the issue but if you, like me, are curious about the MySQL server version your web hosting is using, you can get that data by executing the following query:

SHOW VARIABLES LIKE "%version%";


¡Greetings!

domingo, 1 de junio de 2014

Raise (Signal) MySql Exception

It's true that we can do a lot of data validation on the front-end. But, in some cases, it happens that is more convenient to do it at the server side. No only because it helps us to enforce data integrity, but because changes in stored procedures, functions, triggers, etc doesn't involve recompile and redistribute the application executable file.

It happens then that in some cases we need to raise an exception from a stored procedure as a way to let the front-end know that the process was not executed correctly. ¿How to do it in MySQL?. The basic sentence is very simple:

SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Error Message';

In the following video we have a brief example (video is in spanish but you can get an idea just by watching):



This works from MySQL 5.5 and above. It basically assigns an error code ('45000' in this case) and a message as a text for the exception. There are predefined error codes (check this list) but because we want to raise an excepcion (or SIGNAL in MySQL) is for our app/database only then its better to use one code that doesn't exists in that list.

If we wanted to be much more specific about the information we want to send as part of the exception, we can set some other values.

My first search about this topic lead me to a StackOverFlow post and from the a search by jumping from link to link.

¡Greetings!

Levantar una Excepción en MySql / Raise (Signal) MySql Exception

Es  muy cierto que en el front-end podemos realizar muchísimas de las validaciones necesarias a los datos. Sin embargo, en ocasiones resulta más conveniente realizarlo en el lado del servidor, no solo porque nos ayuda a cuidar la integridad de la base de datos, sino porque un cambio en un procedimiento almacenado, trigger, etc. no implica recompilar y redistribuir el ejecutable de la aplicación.

Resulta entonces que en ocasiones necesitamos lanzar una excepción desde un procedimiento almacenado como manera de avisar al front-end de que el proceso no pudo ser ejecutado correctamente. ¿Cómo hacerlo en MySql?. La instrucción básica es muy sencilla:

SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Mensaje de Error';

En el siguiente video podemos ver un ejemplo sencillo:



Esto funciona a partir de la versión 5.5 de MySql. Básicamente se asigna un código de error ('45000' en este caso) y un mensaje como texto de la excepción. Existen códigos de error predefinidos por MySql (ver la lista) aunque, dado que la excepción ó signal que queremos levantar es propia de nuestra aplicación/base de datos, es preferible utilizar un código que no exista en esa lista.

Si quisiéramos ser mucho más específicos en la información que queremos enviar como parte de la excepción, podemos establecer otros valores.

Mi primera consulta acerca de este tema me llevó a un tema en StackOverFlow y de allí busqué un poco más con un par de saltos en la web.

Saludos!