sábado, 25 de agosto de 2018

fix angular vulnerabilities


added 1096 packages from 1283 contributors and audited 21689 packages in 252.426s
found 14 vulnerabilities (9 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
"git" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

run     $ npm i karma@3.0.0 --save

https://angular.io/guide/rx-library

lunes, 26 de agosto de 2013

Get Table by Column name

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE '%column_name%'
ORDER BY TABLE_NAME

viernes, 12 de julio de 2013

buscar texto contenido en stored procedure

SELECT DISTINCT o.name ,o.xtype
FROM syscomments c
INNER JOIN sysobjects o ON c.id=o.id
WHERE c.TEXT LIKE '%TEXTO_A_BUSCAR%'

jueves, 15 de noviembre de 2012

LOG4NET filename as datetime



  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
  </configSections>



  <log4net>
  <appender name="FileAppender" type="log4net.Appender.FileAppender">
    <file type="log4net.Util.PatternString" value="myPrefix%date{yyyyMMdd}.fileExtension" />

    <appendToFile value="true" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline"/>
    </layout>
  </appender>
  <root>
    <level value="All"/>
    <appender-ref ref="FileAppender"/>
  </root>
  </log4net>

viernes, 7 de septiembre de 2012

Jquery Selector example


This Gets all input type=text and return a string containing a list
with the Ids and the values.
example:

Id0:500,Id1:501,Id2:502,Id3:503,Id4:504,


<script> var parameters = '';
     $('[type="text"]').each(function (index)
     {
         parameters += $(this).attr('id') + ":" + $(this).attr('value') + ',';
     });


alert( parameters );

</script>

Explanation:

[ attribute=value] in this case attribute=type, value=text.

For more information about jquery selectors visit:http://api.jquery.com/category/selectors/

jueves, 2 de agosto de 2012

SRP: Single Responsibility Principle THERE SHOULD NEVER BE MORE THAN ONE REASON FOR A CLASS TO CHANGE.


I want to show you  how SRP helps us to deal with the requirement and with the  requirement  changes. 
This is a real life problem I encountered in my work.

1)
The Idea is to build a WindowServices that runs somes processes in backGound.
There are 7 processes each one has its own hour to run and it is set from the database.

The first implementation was this:
We have a timer that polls the database each 5 minutes and checks if the process should run.
The process excecution is serial.




















2) The next change we were asked to do was to run processes in paralell, then the Services Class had  to be modified



















3) Next the services were installed in 3 nodes and now we could have a sincronitalization problem, then the Services Class had to be modified to fix it.




We noticed that "services class" had at least two differents responsibilities, one is To check the timer and the other one is to checks if the process should run.
In short we could add new functionalities such as Loggings, Exception Hangling and so on.
A better soluction  could have been to give the responsibility to check the process and run the process to another new class.It could be called ProcessDispatcher, and write new interfaces. 









Para ver otro ejemplo de este principio ver este el blog de NELO.