tag:blogger.com,1999:blog-48075238489581908922024-03-13T04:51:09.756+01:00tecnicumeMarco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.comBlogger160125tag:blogger.com,1999:blog-4807523848958190892.post-71798728114482140102021-04-27T22:30:00.007+02:002021-04-27T22:30:00.208+02:00Spring - JPA - Monitor Log Slow Query<p> </p><p>Per eseguire un monitoraggio delle tempistiche di esecuzione delle query è possibile creare un file di log che contenga i tempi in modo da verificare l'eventuale aggiunta di indici.</p><p>Definire le tempistiche di monitoraggio di esecuzione della query nel file di <b>properties</b>:</p><div style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, "Courier New", Courier, monospace; font-size: 14px; white-space: pre;">
spring.jpa.properties.hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS=50
</div><div style="box-sizing: border-box; font-family: Menlo, Monaco, Consolas, "Courier New", Courier, monospace; font-size: 14px; white-space: pre;"><br /></div><br /><br />Aggiungere il logger nel file <b>logback-spring.xml</b><div><br /></div><!-- query time debug --><div><br /><appender name="query" class="ch.qos.logback.core.rolling.RollingFileAppender"><br /> <file>queryLog.log</file><br /> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><br /> <fileNamePattern>queryLog.log.%d{yyyy-MM-dd}.%i.gz</fileNamePattern><br /> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"><br /> <maxFileSize>50MB</maxFileSize><br /> </timeBasedFileNamingAndTriggeringPolicy><br /> <maxHistory>3</maxHistory><br /> </rollingPolicy><br /> <encoder><br /> <pattern>%m%n</pattern><br /> </encoder><br /></appender><br /><br /><br /><logger name="org.hibernate.SQL_SLOW" level="INFO"><br /> <appender-ref ref="query"/><br /></logger></div><div><br /></div><div>il file generato contiene:</div><div><br /></div><div><b>SlowQuery: 297 milliseconds</b>. SQL: 'HikariProxyPreparedStatement@984805610 wrapping com.mysql.cj.jdbc.ClientPreparedStatement: select a.id as col_0_0_ from abc a where a.id > 10'</div><div><br /></div><div><br /></div>Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.17136817.056697663821154 -26.984882 73.677165336178845 43.327618tag:blogger.com,1999:blog-4807523848958190892.post-82169343851953424082021-02-26T21:00:00.003+01:002021-02-26T21:00:03.008+01:00HAProxy - Halog<br /><div><b>HaProxy possiede un suo log analyzer che si chiama <a href="https://manpages.debian.org/testing/haproxy/halog.1.en.html" target="_blank">halog</a></b></div>
<div><br /></div><div>
halog -srv -ut -H < haproxy.log | column -t<br /><div>
halog -u -H -q < haproxy.log | column -t | more</div>
</div>
<div>halog -u -H -q -hs 404 < haproxy.log | column -t | more</div>
<br /><div>viene estratta questa lista dove vengono evidenziate gli errori le chiamate etc per ogni occorrenza.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYqOzGogfFfJSPRhDxYQlGabfeaXFk1OTchp470EicHx1Uit-CjNzSo_RUkUW-8gH4AAnu57PZwFQPXFn89_tU8ITdfAJY1trQrIXzEetPW9E1t1XIm5NJ9U704W4OYUUhjij8iemEDa-c/s1600/Cattura.PNG" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="96" data-original-width="811" height="73" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYqOzGogfFfJSPRhDxYQlGabfeaXFk1OTchp470EicHx1Uit-CjNzSo_RUkUW-8gH4AAnu57PZwFQPXFn89_tU8ITdfAJY1trQrIXzEetPW9E1t1XIm5NJ9U704W4OYUUhjij8iemEDa-c/s640/Cattura.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.17136817.056697663821154 -26.984882 73.677165336178845 43.327618tag:blogger.com,1999:blog-4807523848958190892.post-68363256315348029362020-12-13T17:58:00.001+01:002020-12-13T17:58:28.317+01:00InfluxDB<p> Qualche esperimento veloce con un db time series come <a href="https://www.influxdata.com/" target="_blank">Influx DB</a>. Questi db sono specifici per utilizzare dati temporali ed è fornito di alcuni strumenti molto comodi di visualizzazione come <a href="https://www.influxdata.com/time-series-platform/chronograf/">Chronograf</a></p><p>Per prima cosa ho installato su una vmware una debian 8, successivamente ho installato influxDB e Chronograf dalla repo seguendo le info sul sito.</p><p>Como dataset ho utilizzato il db del meteo sono circa 3M di righe. Importando con un semplice programmino in <a href="https://gist.github.com/marcoberri/6e4a01a8a8fa63966e8307fe8eef045e#file-influxdbimport-java" target="_blank">java</a>.</p><p>A questo punto ho iniziato a fare qualche esperimento con Chronograf ottenendo delle visualizzazioni molto esplicative con pochi click.</p><p><br /></p><p></p><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggayJ16L2ZytChFjWzrLJsH41EwaPjCM7knO_Ala922bvpkkzBq3H1FfayVHVmTiSAwQS1BsNOovMDI0jpxIKVaYS6W70A892Hxr8HI5UTs91Y-ldihEN3fNydwazY0Nu2m5rlUWCtaQ_b/" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="529" data-original-width="1347" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggayJ16L2ZytChFjWzrLJsH41EwaPjCM7knO_Ala922bvpkkzBq3H1FfayVHVmTiSAwQS1BsNOovMDI0jpxIKVaYS6W70A892Hxr8HI5UTs91Y-ldihEN3fNydwazY0Nu2m5rlUWCtaQ_b/w491-h194/image.png" width="491" /></a></div><br /><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCX-MXjHYJ1BsaHPVcy1nJQvW7b8fQeIYvygpH8HUTnIT3l0q-K7kH3XLCtBLKI6f2YoefCOvwjLVwL32JSw-b8m0CCgfGQF0YL8TTIHuFCYCh0h27-58Yij_KPLle25OjEUpY8omzLgWM/" style="margin-left: 1em; margin-right: 1em;"><img data-original-height="503" data-original-width="1356" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCX-MXjHYJ1BsaHPVcy1nJQvW7b8fQeIYvygpH8HUTnIT3l0q-K7kH3XLCtBLKI6f2YoefCOvwjLVwL32JSw-b8m0CCgfGQF0YL8TTIHuFCYCh0h27-58Yij_KPLle25OjEUpY8omzLgWM/w494-h184/image.png" width="494" /></a></div><br /><br /><p></p>Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.17136817.056697663821154 -26.984882 73.677165336178845 43.327618tag:blogger.com,1999:blog-4807523848958190892.post-35810740588935398842019-07-22T22:00:00.000+02:002019-07-22T22:00:08.680+02:00SqlServer - conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" <br />
<br />
Capita spesso di avere problemi di collate sui db SqlServer quando si utilizza Hibernate. Soprattuto quando cambia la codifica del db o la versione dello stesso:<br />
<br />
<br />
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.<br />
<br />
<pre style="background-color: #eff0f1; border-radius: 3px; border: 0px; box-sizing: inherit; color: #242729; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px 8px; vertical-align: baseline; width: auto;"><code style="border: 0px; box-sizing: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">SELECT SERVERPROPERTY('EditionId') AS EditionId
GO
use master
GO
ALTER DATABASE [dbaname] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
GO
use [dbaname];
GO
USE [master]
GO
ALTER DATABASE [dbaname] COLLATE Latin1_General_CI_AS
GO
ALTER DATABASE [dbaname] SET MULTI_USER
GO</code></pre>
<br />
un query che genera uno script di alter potrebbe essere di aiuto per eseguire la modifica sul singolo campo [<a href="https://stackoverflow.com/questions/1878430/update-collation-of-all-fields-in-database-on-the-fly">via</a>]:<br />
<br />
<br />
<pre class="lang-sql prettyprint prettyprinted" style="background-color: #eff0f1; border-radius: 3px; border: 0px; box-sizing: inherit; color: #393318; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px 8px; vertical-align: baseline; width: auto;"><code style="border: 0px; box-sizing: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">SELECT</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'ALTER TABLE ['</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSOBJECTS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Name </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'] ALTER COLUMN ['</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSCOLUMNS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Name </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'] '</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
SYSTYPES</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">name </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">CASE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> systypes</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">NAME
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">WHEN</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'text'</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">THEN</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">' '</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">ELSE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'('</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> RTRIM</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">CASE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSCOLUMNS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">length
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">WHEN</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="lit" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">-1</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">THEN</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'MAX'</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">ELSE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">CONVERT</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">CHAR</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">SYSCOLUMNS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">length</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">END</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">') '</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">END</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">' '</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">' COLLATE Latin1_General_CI_AS '</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">+</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">CASE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> ISNULLABLE </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">WHEN</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="lit" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">0</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">THEN</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'NOT NULL'</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">ELSE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'NULL'</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">END</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">FROM</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSCOLUMNS </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSOBJECTS </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSTYPES
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">WHERE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSCOLUMNS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">ID </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSOBJECTS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">ID
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">AND</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSOBJECTS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">TYPE </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'U'</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">AND</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSTYPES</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Xtype </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSCOLUMNS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">xtype
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">AND</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSCOLUMNS</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">COLLATION </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">IS</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">NOT</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">NULL</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">AND</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">NOT</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> sysobjects</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">NAME </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">LIKE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'sys%'</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">AND</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">NOT</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">(</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> SYSTYPES</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">name </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">LIKE</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="str" style="border: 0px; box-sizing: inherit; color: #7d2727; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">'sys%'</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">
GO</span></code></pre>
Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-66813869898089780812019-06-13T23:00:00.000+02:002019-06-13T23:00:01.686+02:00SqlServer - Verificare lo stato degli indiciQuery di comodità per verificare lo stato di deframmentazione degli indici.<br />
<br />
L'ultima colonna contiene il comando di rebuild dell'indice.<br />
<br />
<br />
<script src="https://gist.github.com/marcoberri/50673f250a77d791b44c316b497ed3be.js"></script>Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-52648524349125983282018-10-28T21:43:00.001+01:002018-10-28T22:21:06.857+01:00Comunicazione tra MicroServices in Spring Boot con RabbitMQ<br />
Dopo attenta lettura di documentazione on-line e suggerimenti da amici provo ad eseguire qualche test di comunicazione tra Micro Services utilizzando un gestore di code di messaggi <a href="https://www.rabbitmq.com/">RabbitMQ</a>.<br />
<br />
Con una semplice app in Spring Boot, con interfaccia rest, al richiamo di una path, viene spedito un messaggio al RabbitMQ installato sullo stesso PC in locale.<br />
<br />
Per RabbitMQ vi consiglio vivamente di installare il <a href="https://www.rabbitmq.com/management.html">plugin</a> per il management da web<br />
<br />
http://localhost:15672/ guest/guest.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWcHMLN0hi-tY2qcpJj3Cbvv46uJCUtLB2YOfr5SgqW26JfQfItdB8BThyphenhyphenb774q3u7H_0FcGvKebPHF4lthNMS_GdfcN25V1JklEFuYrZce9OnMNfGEfEGe7k5W-vupoNdDG7HS0bc1MuD/s1600/rabbitmq.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="160" data-original-width="728" height="86" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWcHMLN0hi-tY2qcpJj3Cbvv46uJCUtLB2YOfr5SgqW26JfQfItdB8BThyphenhyphenb774q3u7H_0FcGvKebPHF4lthNMS_GdfcN25V1JklEFuYrZce9OnMNfGEfEGe7k5W-vupoNdDG7HS0bc1MuD/s400/rabbitmq.png" width="400" /></a></div>
<br />
<br />
<br />
La parte di <a href="http://msmqtesting/src/main/java/it/marcoberri/msMQTesting/GreetingController.java">controller</a> è molto semplice, è un api rest che quando viene richiamata spedisce un messaggio al RabbitMQ e nella stessa classe un metodo che rimane in ascolto sulla stessa coda.<br />
<br />
<br />
Adesso eseguiamo alcuni stress test:<br />
<br />
<ol>
<li> creiamo diversi file di configurazione di spring per ogni file cambiamo semplicemente la porta.</li>
<li>eseguiamo la build del progetto e lanciamo n jar per ogni <a href="https://github.com/marcoberri/msMQTesting/tree/master/src/main/resources">profiles</a> creato nel file di configurazione yaml.</li>
</ol>
<br />
<div style="text-align: center;">
java -jar rabbit-spring-test-0.0.1.jar --spring.profiles.active=9001</div>
<div style="text-align: center;">
java -jar rabbit-spring-test-0.0.1.jar --spring.profiles.active=9002</div>
<div style="text-align: center;">
java -jar rabbit-spring-test-0.0.1.jar --spring.profiles.active=9003</div>
<div style="text-align: center;">
java -jar rabbit-spring-test-0.0.1.jar --spring.profiles.active=9004</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBbbyT5H4qOVK5GxYEEuiX6vUmYL2VyVTEINSfNDBCSHV-n2nCq7T4z-gsXFQS7gVyU571RliN3zAG48f7XsgCjLCfzthMgoBhhEApEK3Klhd5rU3enbmAbzMKp3_c7W3bhSd01FzBl9sJ/s1600/pagina.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="1247" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBbbyT5H4qOVK5GxYEEuiX6vUmYL2VyVTEINSfNDBCSHV-n2nCq7T4z-gsXFQS7gVyU571RliN3zAG48f7XsgCjLCfzthMgoBhhEApEK3Klhd5rU3enbmAbzMKp3_c7W3bhSd01FzBl9sJ/s400/pagina.JPG" width="400" /></a></div>
<br />
il vostro desktop diventa qualcosa di delirante...</div>
<div style="text-align: center;">
<br />
<div style="text-align: justify;">
3. Configuro il <a href="https://jmeter.apache.org/">jMeter </a>per iniziare ad eseguire chiamate sui quattro server </div>
<div style="text-align: center;">
http://localhost:900{1-4}/sendMessage</div>
<div style="text-align: center;">
<br /></div>
</div>
<div style="text-align: center;">
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<pre>C:\dev\apache-jmeter-5.0\bin> .\jmeter -n -t .\sendmessage.jmx -l tmp\jmeter-o.log -o tmp\dashboard
</pre>
<br />
il file <a href="https://github.com/marcoberri/msMQTesting/blob/master/src/test/resources/sendmessage.jmx">sendmessage.jmx</a><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_-MN0CK3nrH2Qsyf1DVlS4y6eqqMgLuFnC92HUcb9A1vcyBX-YSj8WhADuROkUEqsX4QZc0qFXPkPzmQpt8Tc4wahAf8utmSsJVZZaHJnheFYxvG10GQHYFcLeiPx0acyQ8irLiHPRwM9/s1600/Cattura4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="162" data-original-width="959" height="66" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_-MN0CK3nrH2Qsyf1DVlS4y6eqqMgLuFnC92HUcb9A1vcyBX-YSj8WhADuROkUEqsX4QZc0qFXPkPzmQpt8Tc4wahAf8utmSsJVZZaHJnheFYxvG10GQHYFcLeiPx0acyQ8irLiHPRwM9/s400/Cattura4.JPG" width="400" /></a></div>
<br />
<div style="text-align: center;">
Client web di RabbitMQ</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkYKk-mvoSq8tbIeNtclWqOd7kW68oAfbL10PeLs1mRFRzt9nngdOJ4o69j2VhQ8OU9q0kDGYukGH9K-Sg_zKQUSg9RV7jna_-vCO0pfyq-mB6lkHB_cw-8q7kORwYwxYwQzeGiW7xm1m-/s1600/Cattura.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="541" data-original-width="819" height="263" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkYKk-mvoSq8tbIeNtclWqOd7kW68oAfbL10PeLs1mRFRzt9nngdOJ4o69j2VhQ8OU9q0kDGYukGH9K-Sg_zKQUSg9RV7jna_-vCO0pfyq-mB6lkHB_cw-8q7kORwYwxYwQzeGiW7xm1m-/s400/Cattura.JPG" width="400" /></a></div>
<br /></div>
<div style="text-align: center;">
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<div style="text-align: justify;">
Riassumendo con jMeter abbiamo spedito 48000 richiese di invio di messaggi alle 4 app Spring Boot.</div>
<div style="text-align: justify;">
Le app hanno inviato una richiesta in coda al RabbitMQ che a sua volta per ognuno dei suddetti ha reinviato il messaggio alle 4 app.<br />
<br />
<div style="text-align: center;">
<b>In ingresso ha processato 48000 messaggi.</b></div>
</div>
<div style="text-align: justify;">
<div style="text-align: center;">
<b>In uscita ha processato 192000 messaggi.</b></div>
</div>
<div style="text-align: justify;">
<div style="text-align: center;">
<b>Tutto questo in 1 minuto.</b></div>
</div>
<div style="text-align: justify;">
<b><br /></b></div>
<br />
<div style="text-align: justify;">
<div style="text-align: center;">
<a href="https://github.com/marcoberri/msMQTesting/tree/master">Sorgente completo</a></div>
</div>
</div>
Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-46200859549704935882018-10-09T22:00:00.000+02:002018-10-27T20:52:16.363+02:00Nginx, Angular 6 e FontAwesome 4.7 - Problemi UrlI Modulo npm dei <a href="https://fontawesome.com/v4.7.0">FontAwesome</a> 4.7.0 in Angular aggiunge alla path chiamante del file css l'estensione con la versione:<br />
<br />
es: http://xxx.xxx.xx/static/fontawesome-webfont.af7ae505a9eed503f8b8.woff2?v=4.7.0<br />
<br />
<a href="https://www.nginx.com/">Nginx</a> non accetta di default la tipologia di file, quindi è necessario modificare il file mime.types, aggiungendo le seguenti tipologie:<br />
<br />
<pre>application/x-font-ttf ttc ttf;
application/x-font-otf otf;
application/font-woff woff;
application/font-woff2 woff2;
application/vnd.ms-fontobject eot;
</pre>
<div>
<br /></div>
<div>
Questa cosa causa nella risposta standard del browser un errore OTP, a questo punto è necessario inserire un regola di rewrite su Nginx per eliminare la parte di estensione non prevista ?v=4.7.0<br />
<br /></div>
<pre> location /static/ {
alias /opt/static/html/;
index index.html;
if ($request_uri ~* ^.+\.(woff2|otf|woff|tff)\?v=(.*)$){
rewrite ^(.*)$ $uri? permanent;
}
try_files $uri$args $uri$args/ $uri/ /index.html =404;
error_log /var/log/nginx/static_error.log;
access_log /var/log/nginx/static_access.log;
}
</pre>
<br />
Esempio completo:
<script src="https://gist.github.com/marcoberri/67546c24890b87cd0c04ae5bd5fcddd6.js"></script>
Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-53896466451180970082018-10-05T23:00:00.000+02:002018-10-05T23:00:08.141+02:00Jasper Report - Report senza query ma solo con paramsIl problema nascosto di jasper report è la possibilità di creare un report (con il vecchio iReport) senza dati al suo interno, semplicemente un documento a cui passo un oggetto java e poi elaboro, magari un DTO proveniente da elaborazione di una chiamata API rest o simili.<br />
<br />
Il documento non viene generato via java, perché?<br />
<br />
E' necessario aggiungere all'XML di jasper una attributo nel ramo principale del file:<br />
<br />
<jasperReport ........ whenNoDataType="AllSectionsNoDetail"><br />
<br />
a questo punto il report viene correttamente interpretato e renderizzato via java<br />
<br />
<a href="https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.1.1">JasperReport versione 6.1.1</a><br />
<br />
<br />
<br />Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-22738538838097899612018-10-04T13:53:00.002+02:002018-10-04T13:53:29.334+02:00Maven - pacchetti danneggiatiAlle volte capita di avere problemi con il deploy di alcune applicazioni legate alle dipendenze maven causate da file corrotti durante lo scaricamento automatico.<br />
<br />
Per risolvere questo problema basta ricercare nella cartella di scaricamento dei pacchetti (solitamente la .m2 nella cartella di windows %userprofile%\.m2) tutti i file "*-sha1-in" e procedere all'eliminazione della cartella padre.<br />
<br />
Eseguire da Eclipse un clean ed un maven update.<br />
<br />
<br />
[grazie a <a href="https://www.linkedin.com/in/domenicocapezzuto/">Domenico</a>]Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-22085069399221185162018-08-22T15:54:00.003+02:002018-08-22T15:55:23.682+02:00Angular e SWAPI<br />
<br />
Mi sono iscritto ad un corso di Angular e React tenuto da <a href="https://www.linkedin.com/in/antonymistretta/" target="_blank">Antony Mistretta</a>.<br />
<br />
Nella prima lezione ci ha suggerito un ottimo sito di API online da utilizzare come sorgenti per delle applicazioni di prova <a href="https://swapi.co/">https://swapi.co</a> con un semplice set di oggetti e di <a href="https://swapi.co/documentation" target="_blank">chiamate</a> REST basate su architettura Django. ( Indagando sul web ho trovato anche le <a href="https://pokeapi.co/">https://pokeapi.co/</a> ma sono veramente troppo complesse... e poi bisogna conoscere il mondo dei pokemon.... )<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgenArhy2wX7J400jLNER9GKhT70ZgwkMCbyYVfLzlAtIru51UzxYkrhl6QS_8k5T9Re4Dx49x4DwkOCV-omOGjrKdiYwrbZgw0QgYiWOSEohw1tnh6gQ8tiD4ctjvOFEdmS1cTjtNS9yTY/s1600/swaping_screen.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="533" data-original-width="1332" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgenArhy2wX7J400jLNER9GKhT70ZgwkMCbyYVfLzlAtIru51UzxYkrhl6QS_8k5T9Re4Dx49x4DwkOCV-omOGjrKdiYwrbZgw0QgYiWOSEohw1tnh6gQ8tiD4ctjvOFEdmS1cTjtNS9yTY/s400/swaping_screen.PNG" width="400" /></a></div>
<br />
<br />
Per realizzare una piccola demo con Angular per sfruttare le informazioni presenti nel sito ho utilizzato alcuni componenti a me famigliari:<br />
<br />
- <a href="https://www.primefaces.org/primeng/" target="_blank">PrimeNG</a> : personalmente le trovo più complete delle <a href="https://material.angular.io/" target="_blank">Material</a><br />
- <a href="https://github.com/compodoc/compodoc" target="_blank">Compodoc</a>: generatore di documentazione like javadoc molto completo<br />
<br />
<br />
Alcune funzionalità degne di nota:<br />
<br />
- Cache : cache delle chiamate nella sessione del browser, quando devo accedere a elementi uguali ricorrenti salvo l'informazione come chiave valore, dove la chiave è il mio url di chiamata e invece il valore è l'object caricato.<br />
<br />
<script src="https://gist.github.com/marcoberri/367c12a04b796876613731cb7871ab47.js"></script>
- Estensione dei modelli e dei controller principali con classi di base per ridurre codice in esubero.<br />
<br />
<div style="text-align: center;">
<span style="font-size: large;">Demo: </span><a href="http://swaping.marcoberri.it/" style="font-size: x-large; text-align: center;">http://swaping.marcoberri.it</a></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<span style="font-size: large;">Doc</span>: <span style="font-family: inherit; font-size: large;"><a href="http://swaping.marcoberri.it/documentation/">http://swaping.marcoberri.it/documentation/</a></span></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<span style="font-size: large;">GitHub : </span><a href="https://github.com/marcoberri/swaping" style="font-size: x-large;">https://github.com/marcoberri/swaping</a></div>
<br />
<b>TODO</b><br />
- e2e test<br />
- karma test<br />
- Caricamento di un templateUrl dinamico così da utilizzare un solo Componente per gestire tutte le pagine.<br />
- Ricerca sulle tabelle usando i parametri di search<br />
<br />Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-76966433047927956442018-04-14T19:59:00.000+02:002018-05-28T11:27:57.776+02:00Firefox Portable CustomCondeterminati applicativa da rilasciare nasce anche l'esigenza di un browser custom per ridurreal minimo il cambio di configurazione da parte dell'utenza che combina sempre disastri sulle configurazioni. Oppure semplicemente per bloccare l'update di firefox o bloccare le impostazione di proxy o configurare forzatamente dei plug-in evitanto che l'utenza possa andare a toccare le configurazioni.<br />
<br />
La soluzione è quella di usare una versione <a href="https://portableapps.com/apps/internet/firefox_portable" target="_blank">portable di Firefox</a>.<br />
<br />
Tutte le configurazioni disponibile sono presenti a questo <a href="http://kb.mozillazine.org/About:config_entries" target="_blank">indirizzo</a> e successivamente vediamo come modificarle.<br />
<br />
Per accedere manualmente alla configurazioni è possibile digitare da browser About:config.<br />
<br />
<br />
Per prima cosa è necessario modificare/creare il file \FirefoxPortable\App\Firefox\defaults\pref\autoconfig.js<br />
inserendo riferimenti nel nostro file di configurazione:<br />
<br />
pref("general.config.filename", "nomefile.cfg");<br />
pref("general.config.obscure_value", 0);<br />
<br />
<br />
il nostro file di configurazione: \FirefoxPortable\App\Firefox\nomefile.cfg<br />
<br />
//GENERAL - STARTUP<br />
<br />
//pagina di default<br />
pref("browser.startup.homepage", "http://miapagina.lan");<br />
lockPref("browser.startup.homepage", "http://miapagina.lan");<br />
<br />
pref("browser.startup.page", 1);<br />
lockPref("browser.startup.page", 1);<br />
<br />
//lock default brauser<br />
pref("browser.shell.checkDefaultBrowser", false);<br />
lockPref("browser.shell.checkDefaultBrowser", false);<br />
<br />
//GENERAL - TABS<br />
pref("browser.tabs.warnOnClose", false);<br />
lockPref("browser.tabs.warnOnClose", false);<br />
<br />
<br />
//GENERAL - Language and Apparence<br />
pref("layout.spellcheckDefault", 2);<br />
lockPref("layout.spellcheckDefault", 2);<br />
<br />
<br />
//GENERAL - Browsing<br />
pref("general.autoScroll", true);<br />
lockPref("general.autoScroll", true);<br />
<br />
pref("general.smoothScroll", true);<br />
lockPref("general.smoothScroll", true);<br />
<br />
pref("accessibility.typeaheadfind", false);<br />
lockPref("accessibility.typeaheadfind", false);<br />
<br />
pref("accessibility.browsewithcaret", false);<br />
lockPref("accessibility.browsewithcaret", false);<br />
<br />
<br />
//GENERAL - Proxy<br />
pref("network.proxy.type",0);<br />
lockPref("network.proxy.type",0);<br />
<br />
<br />
<br />
//GENERAL - Updated<br />
<br />
pref("app.update.enabled", false);<br />
lockPref("app.update.enabled", false);<br />
<br />
pref("app.update.silent", false);<br />
lockPref("app.update.silent", false);<br />
<br />
//expire history<br />
pref("browser.history_expire_days",0);<br />
lockPref("browser.history_expire_days",0);<br />
<br />
pref("browser.search.update",false);<br />
lockPref("browser.search.update",false);<br />
<br />
<br />
//SEARCH<br />
pref("browser.urlbar.autocomplete.enabled",false);<br />
lockPref("browser.urlbar.autocomplete.enabled",false);<br />
<br />
<br />
//PRIVACY<br />
pref("browser.formfill.enable",false);<br />
lockPref("browser.formfill.enable",false);<br />
<br />
pref("browser.cache.disk.enable",true);<br />
lockPref("browser.cache.disk.enable",true);<br />
<br />
pref("browser.cache.disk.capacity",5000);<br />
lockPref("browser.cache.disk.capacity",5000);<br />
<br />
pref("browser.cache.check_doc_frequency",3);<br />
lockPref("browser.cache.check_doc_frequency",3);<br />
<br />
pref("signon.rememberSignons",false);<br />
lockPref("signon.rememberSignons",false);<br />
<br />
pref("browser.urlbar.autoFill",false);<br />
lockPref("browser.urlbar.autoFill",false);<br />
<br />
pref("browser.preferences.privacy.selectedTabIndex",4);<br />
lockPref("browser.preferences.privacy.selectedTabIndex",4);<br />
<br />
//PRIVACY - Permissions<br />
pref("browser.urlbar.showPopup",true);<br />
lockPref("browser.urlbar.showPopup",true);<br />
<br />
pref("dom.disable_open_during_load",false);<br />
lockPref("dom.disable_open_during_load",false);<br />
<br />
pref("privacy.popups.policy",1);<br />
lockPref("privacy.popups.policy",1);<br />
<br />
//PRIVACY - Security<br />
pref("browser.safebrowsing.enabled",true);<br />
lockPref("browser.safebrowsing.enabled",true);<br />
<br />
pref("browser.safebrowsing.malware.enabled",true);<br />
lockPref("browser.safebrowsing.malware.enabled",true);<br />
<br />
pref("browser.safebrowsing.phishing.enabled",true);<br />
lockPref("browser.safebrowsing.phishing.enabled",true);<br />
<br />
pref("signon.prefillForms",false);<br />
lockPref("signon.prefillForms",false);<br />
<br />
pref("signon.rememberSignons",false);<br />
lockPref("signon.rememberSignons",false);<br />
<br />
pref("signon.expireMasterPassword",true);<br />
lockPref("signon.expireMasterPassword",true);<br />
<br />
pref("security.OCSP.enabled",0);<br />
lockPref("security.OCSP.enabled",0);<br />
<br />
pref("security.warn_entering_secure",false);<br />
lockPref("security.warn_entering_secure",false);<br />
<br />
//VARIE<br />
pref("browser.tabs.warnOnClose",false);<br />
lockPref("browser.tabs.warnOnClose",false);<br />
<br />
pref("browser.feedview.showBar",false);<br />
lockPref("browser.feedview.showBar",false);<br />
<br />
pref("layout.textarea.spellcheckDefault",true);<br />
lockPref("layout.textarea.spellcheckDefault",true);<br />
<br />
//disabilita il messaggio di firefox sulle https<br />
pref("security.insecure_field_warning.contextual.enabled", false);<br />
lockPref("security.insecure_field_warning.contextual.enabled", false);<br />
<br />
<br />
con la creazione di questo file è possibile personalizzare la parte di contenuti<br />
<br />
\FirefoxPortable\Data\profile\chrome\userContent.css<br />
<br />
ad esempio se vogliamo eliminare delle voci dalla pagina di configurazione alla fine è una semplice pagina html modificabile da questo css.<br />
<br />
<br />
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */<br />
<br />
@-moz-document url("about:preferences") {<br />
<span style="white-space: pre;"> </span>#category-sync { display:none!important; }<br />
<span style="white-space: pre;"> </span>#category-search { display:none!important; }<br />
}<br />
<br />
@-moz-document url("about:addons") {<br />
<span style="white-space: pre;"> </span>#category-discover { display:none!important; }<br />
<span style="white-space: pre;"> </span>#category-theme { display:none!important; }<br />
<span style="white-space: pre;"> </span>#category-plugin { display:none!important; }<br />
<span style="white-space: pre;"> </span>#category-service { display:none!important; }<br />
<span style="white-space: pre;"> </span>#category-locale { display:none!important; }<br />
<span style="white-space: pre;"> </span>#category-dictionary { display:none!important; }<br />
}<br />
<br />
#context-back #context-sep-navigation {<br />
display:none !important;<br />
}<br />
<br />
Per intercettare le configurazioni basta usare lo strumento di sviluppo integrato:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBmjNeBLeA4Uv5Pv_73dEV9ZytcZILwZuZp-9tyT4YWlGig36Aue7unBOiNyjsyRmbl7ja11uBrkd_v1siBiISzxGUoRHyOnCw60Ues-8eR-rHOwcUoT3RPZ46CN79VOK3ZfxnbSMECQ2k/s1600/Cattura.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="313" data-original-width="798" height="249" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBmjNeBLeA4Uv5Pv_73dEV9ZytcZILwZuZp-9tyT4YWlGig36Aue7unBOiNyjsyRmbl7ja11uBrkd_v1siBiISzxGUoRHyOnCw60Ues-8eR-rHOwcUoT3RPZ46CN79VOK3ZfxnbSMECQ2k/s640/Cattura.JPG" width="640" /></a></div>
<br />
<br />
<br />
<br />
per eseguire sia firefox portable che firefox installato è necessario inserire questo file nella cartella portable principale.<br />
<br />
file: FirefoxPortable.ini<br />
<br />
[FirefoxPortable]<br />
FirefoxDirectory=App\firefox<br />
ProfileDirectory=Data\profile<br />
SettingsDirectory=Data\settings<br />
PluginsDirectory=Data\plugins<br />
FirefoxExecutable=firefox.exe<br />
AdditionalParameters=-contentLocale it -UILocale it<br />
LocalHomepage=<br />
DisableSplashScreen=false<br />
<b>AllowMultipleInstances=true</b><br />
DisableIntelligentStart=false<br />
SkipCompregFix=false<br />
RunLocally=false<br />
<br />
<br />
<br />Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-14803856935765921582017-09-15T21:12:00.000+02:002017-09-15T21:12:11.798+02:00Test Syma X8HW con Andoer 4k<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Potenziare la camera del Syma X8HW è stato un test ottimo effettuato nel periodo estivo. Dopo varie ricerche e articoli non volendo spendere cifre eccessive trovo questa <a href="https://www.amazon.it/dp/B018I3MX7S/ref=pe_3310731_189395851_TE_dp_1">Andoer 4k 1080P Wifi Cam 16 MP Action Camera 5,08 cm (2") Ultra HD LCD 170°</a><br /><br /><br /><br /><div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnonAqoud0mex0JTf8YEpRGqtN86mdxFWrvVc2G05EfIMXi1_Cm16uOyuuj0owBnVKro_49gqKCiFwdW3SoDyGct5wiy3xv14UMroZVSUVZJ_Ooh-0hMuT5CWM7CDsWobqRnGAMEuOQfn3/s1600/IMG_20170904_233235.jpg"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnonAqoud0mex0JTf8YEpRGqtN86mdxFWrvVc2G05EfIMXi1_Cm16uOyuuj0owBnVKro_49gqKCiFwdW3SoDyGct5wiy3xv14UMroZVSUVZJ_Ooh-0hMuT5CWM7CDsWobqRnGAMEuOQfn3/s320/IMG_20170904_233235.jpg" /></a></div>
<br /><br /><br /><br /><br /><a href="https://www.aliexpress.com/item/SYMA-X8C-X8W-X8G-X8-X8HC-X8HW-X8HG-RC-Drone-spare-parts-FPV-SJCAM-Xiaoyi-Gopro/32795417020.html?spm=a2g0s.9042311.0.0.Lk7yZy">Modificate</a> anche le slitte di atterraggio e blocco porta camera<br /><br />Ecco una prova veloce con 4K per verificarne la qualità.<br /><br /><br /><br /><br /><div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/jq5iY-_j_-0/0.jpg" src="https://www.youtube.com/embed/jq5iY-_j_-0?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<div style="text-align: center;">
<br /></div>
<br /><br /><br /><br />naturalmente con la colonna sonora dei <a href="http://www.doctor-groove.it/">Doctor Groove</a> .... :)Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-64830802576551200082017-07-25T09:16:00.003+02:002017-07-25T09:16:30.650+02:00MongoDB, C and Bulk Operation<br />
<div style="text-align: justify;">
E' molto tempo che voglio provare ad eseguire delle operazione su MongoDB utilizzando il Linguaggio C. Sono tantissimi anni che non uso più il C (circa 18.. dai tempi dei CGI sulla WebSphere Commerce Suite di IBM).</div>
<div style="text-align: justify;">
<br /></div>
Per prima cosa vediamo come <a href="http://mongoc.org/libmongoc/current/installing.html">installare </a>sotto Debian/Ubuntu il driver con i relativi sorgenti.<br />
<br />
<code><span style="font-size: x-small;">apt-get install libmongoc-1.0-0</span></code><br />
<br />
<div style="text-align: justify;">
A questo punto inizio ad analizzare il funzionamento del driver, la <a href="http://mongoc.org/libmongoc/current/tutorial.html#making-a-connection">documentazione</a> è molto valida.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Il problema che voglio risolvere è un calcolo su un numero elevato di record. Per testing utilizzo il db del <a href="http://meteo.marcoberri.it/">Meteo</a>. Il calcolo prevede di prendere i dati presenti nell'archivio delle piogge (Field RC) che sono in realtà un numero incrementale azzerato ad ogni riavvio della console del meteo. Quindi oggi il contatore è 200, domani 200, dopodomani 201, quindi andando per differenza oggi è caduto 1 mm di pioggia.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
La struttura dell'object su cui vengono eseguite le query di mongo è la seguente:</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsQS_feEvUxMUXDf6iJcBdlgsqOOm_O-um_5OkZi7Nveqz74y9ou24mP9XPrSGEiyumTWU3zUjix2hhCebxyaumvWG5m_PKlVE6Iq6KP7TUToDWwAEpMSfv95ELyoxYQcvLEyfn_MgZygQ/s1600/source.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="334" data-original-width="536" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsQS_feEvUxMUXDf6iJcBdlgsqOOm_O-um_5OkZi7Nveqz74y9ou24mP9XPrSGEiyumTWU3zUjix2hhCebxyaumvWG5m_PKlVE6Iq6KP7TUToDWwAEpMSfv95ELyoxYQcvLEyfn_MgZygQ/s400/source.png" width="400" /></a></div>
<br />
I record sono circa 1 M.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjubVqid8nyq5EzYGdpfuHozpuzUSPmhyphenhyphenE5Ij4rkvUMibd2Co84c48mlvs9uoRM78vtc6K2a0RrasVGsOHv6xjkHAg03ubzoxjGaiYvpl03lQD5zRRJlcW5Y_Jr59ZO_RbXgSP45qCAxlCf/s1600/count.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="119" data-original-width="315" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjubVqid8nyq5EzYGdpfuHozpuzUSPmhyphenhyphenE5Ij4rkvUMibd2Co84c48mlvs9uoRM78vtc6K2a0RrasVGsOHv6xjkHAg03ubzoxjGaiYvpl03lQD5zRRJlcW5Y_Jr59ZO_RbXgSP45qCAxlCf/s1600/count.png" /></a></div>
<br />
<br />
per la compilazione del pacchetto basta eseguire il comando:<br />
<br />
<br />
<code><span style="font-size: x-small;">sudo gcc -o raindata raindata.c utils.c $(pkg-config --cflags --libs libmongoc-1.0)</span></code><br />
<br />
<div style="text-align: justify;">
La cosa molto interessante è la funzionalità di Bulk insert molto simile alle transazione dei classici db relazioni. Ovvero si caricano tutti i dati in una struttura e poi si esegue una flush e tutti i dati vengo inseriti in modo molto veloce.
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Non mi soffermo tanto sul calcolo del dato puro ma sulle performance di inserimento. </div>
<div style="text-align: justify;">
La prima esecuzione è con insert ripetitive, la seconda con la funzionalità di bulk. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Si passa da 8 minuti a 12 secondi!!</b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiM8pFYhGxvNPPB1cvwlEiM5ethVQ7xGr_NAfBOwCVcW5Ey5Dhy5CCcNvEXjfhSKk4BYRTzIpf1LHBJHMPlVIoeeAM1ZybNwNg_abktjozbgVLVUq_jiR3emFgVRuO6LSB85SSmlxJFw9O/s1600/execute.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="211" data-original-width="745" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiM8pFYhGxvNPPB1cvwlEiM5ethVQ7xGr_NAfBOwCVcW5Ey5Dhy5CCcNvEXjfhSKk4BYRTzIpf1LHBJHMPlVIoeeAM1ZybNwNg_abktjozbgVLVUq_jiR3emFgVRuO6LSB85SSmlxJFw9O/s640/execute.png" width="640" /></a></div>
<br />
<br />
come sempre trovate tutto il sorgente sul <a href="https://github.com/marcoberri/mbmeteomongoc">github</a> https://github.com/marcoberri/mbmeteomongocMarco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com0Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-19598857842629016932017-04-19T21:00:00.000+02:002017-04-19T21:00:31.605+02:00SqlServer 2014 - Spring Oauth2 Sql Table Script<div>
<br /></div>
<div>
Script per la creazione delle tabelle di Spring Security per la gestione del Oauth2 sul db di SQLServer 2014</div>
<div>
<br /></div>
<div>
https://gist.github.com/marcoberri/b02d5c523c0e511bdd18bda18ee5eb38</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<script src="https://gist.github.com/marcoberri/b02d5c523c0e511bdd18bda18ee5eb38.js"></script><br />Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com0Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-64874014162683656922017-04-08T11:46:00.002+02:002017-04-11T20:33:52.280+02:00Microservices : Spring Boot + Eureka + Zuul + OAuth2Esempio completo della gestione a Microservices con Spring Boot e tutto il pacchetto completo di gestione di proxy e bilanciamento. Per la gestione dell'autenticazione sempre attraverso i services di spring con Oauth2. L'esempio è basato su Jpa su Hibernate e MySql.<br />
<br />
Trovate i sorgenti completi <a href="https://github.com/marcoberri/microservices-example">https://github.com/marcoberri/microservices-example</a><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://raw.githubusercontent.com/marcoberri/microservices-example/master/doc/structure1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://raw.githubusercontent.com/marcoberri/microservices-example/master/doc/structure1.png" width="202" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Gestione della security</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/marcoberri/microservices-example/raw/master/doc/Security.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="264" src="https://github.com/marcoberri/microservices-example/raw/master/doc/Security.png" width="640" /></a></div>
<br />Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com0Santhià VC, Italia45.3669315 8.1713680000000345.277716 8.01000650000003 45.456147 8.33272950000003tag:blogger.com,1999:blog-4807523848958190892.post-34037100012109173762016-12-28T11:00:00.000+01:002017-01-01T11:16:18.789+01:00Syma - X8HWRegalo di Natale Graditissimo!!!<br />
<br />
Un bellissimo <a href="http://www.symatoys.com/goodshow/x8hw-syma-x8hw-fpv-real-time-the-new-drone.html">Syma X8HW</a>.<br />
<br />
Il mio primo drone è stato un syma e questo regalato da Cinzia dimostra come si sono evoluti negli ultimi 4 anni. Abbiamo una stabilità per i filmati ottima, è quasi impossibile schiantarlo per una manovra sbagliata facendolo ribaltare in aria. La stabilità data dalle dimensioni delle eliche e dalle dimensioni è formidabile, certo non è paragonabile ad un 250 da race ma per filmati da molta affidabilità paragonata al prezzo.<br />
<br />
Ecco un video fresco fresco...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/X5Q8TKyZnK4/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/X5Q8TKyZnK4?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
<span id="goog_389524729"></span><span id="goog_389524730"></span>Il mantenimento dell'altitudine è buono, essendo molto leggero una bava di vento laterale lo rende meno manovrabile e meno stabile. A mio parere per panoramiche a 360 gradi è utile usarlo in assenza di vento per avere un discorso di stabilità laterale.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/tjp6_gkzkGw/0.jpg" src="https://www.youtube.com/embed/tjp6_gkzkGw?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<br />
<br />Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com113048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-79142902976618799262016-08-18T17:46:00.000+02:002016-08-21T23:31:40.460+02:00WpScan - Trovare le criticità del vostro blog in WordpressStavo cercando un tool per analizzare le criticità esposte di un Wordpress.<br />
Cosa di meglio di <a href="https://wpscan.org/">WpScan</a> compreso nella distribuzione linux <a href="https://www.kali.org/">Kali</a>...<br />
I risultati sono stupefacenti quanto paurosi....<br />
<br />
<script src="https://gist.github.com/marcoberri/23a4da2736b680cb79bc74c2590d50bd.js"></script>
Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-22585158733727989032016-03-29T22:34:00.001+02:002016-03-30T09:09:34.040+02:00Bilanciare due Tomcat con apache 2.4<div>
Capita spesso di dover realizzare un servizio session-less che punti a due o più nodi di tomcat pilotati da un classico balancer di apache2.</div>
<div>
<br /></div>
<div>
Ecco l'esperimento su una macchina virtuale.</div>
<div>
<br /></div>
<div>
<br /></div>
<script src="https://gist.github.com/marcoberri/799d4ba7a82aef026f99.js"></script>Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-77545466426632882632016-02-10T22:00:00.000+01:002016-02-10T22:00:01.652+01:00MongoDB - Backup di grandi db<div>
Nasce, molte volte, il problema di eseguire un backup su una grande mole di dati.</div>
<div>
<br /></div>
<div>
Uno dei modi possibili (<a href="https://docs.mongodb.org/v3.0/core/backups/#backup-by-copying-underlying-data-files">vedi doc</a>) è prendere i file dei db di mongo e semplicemente copiarli.</div>
<div>
<br /></div>
<div>
Il nostro problema nasce che non tutti i db devono essere backuppati per essere ribaltati, e il nome dei file di archivio di mongo non sono parlanti.</div>
<div>
<br /></div>
<div>
Una soluzione e configurare ogni db in una singola cartella con i parametri di configurazione</div>
<br /><b>storage.directoryPerDB</b><br />
<div>
<br /></div>
<div>
un'altro parametro ottimo è:</div>
<div>
<br /></div>
<b>storage.wiredTiger.<wbr></wbr>engineConfig.<wbr></wbr>directoryForIndexes</b><br />
<div>
<br /></div>
<div>
i db vengono archiviati in cartelle separate e divisi in due cartelle collections e index così eventualmente in fase di copia dei dati è possibile escludere le folder degli indici risparmiando spazio e tempo.</div>
<div>
<br /></div>
<br />Questa configurazione necessita di un mongodump e un mongorestore. In caso di ReplicaSet basta fermare il primario, svuotare le cartelle, cambiare le conf e attendere che si replichi con il secondario che è diventato primario. Al termine il primario diventa nuovamente secondario e viceversa.<br /><div>
<br /></div>
<div>
MongoDB version 3.0.7</div>
Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-25650992697078178472016-02-09T21:50:00.000+01:002016-02-09T21:50:14.225+01:00MongoDB - Script to Delete all collection with exclusionSemplice script per eliminare tutte le collection di un db ad esclusione di una lista di collection.<br />
<br />
<br />
<script src="https://gist.github.com/marcoberri/953f33a85b56e0d00261.js"></script>Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-77695078802108228252016-02-04T21:30:00.000+01:002016-02-04T21:30:09.713+01:00MongoDB - Script per eseguire una purge di dati dalle varie collection di logCapita alle volte di voler svuotare delle collection che contengo informazioni di log.<br />
<br />
Questo script partendo dal nome del server ricerca tutti i db che iniziano con un certo nome, cicla tutte le collection (ad esclusione di quelle specificate), esegue una query per conteggiare i record che devono essere eliminati e poi elimina in base al numero di giorni che vogliamo mantenere sui log a partire da oggi.<br />
<br />
Il campo di controllo di data è chiamato ts.<br />
<br />
<br />
<br />
<script src="https://gist.github.com/marcoberri/b18cd2a9792c98c2b248.js"></script>Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-82577573554156630452016-02-02T21:00:00.000+01:002016-02-02T21:00:23.209+01:00MongoDB - Migrazione da ReplicaSet a Singolo NodoAlle volte capita di dover demolire una replica e riportare i dati su un singolo nodo del MongoDB.<br />
<br />
ecco la procedura testata su MongoDB 3.0.8<br />
<br />
<br />
<br />
<script src="https://gist.github.com/marcoberri/0dbab369afa69593d77b.js"></script>Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-88085021812197657692016-01-26T21:00:00.000+01:002016-01-26T21:00:02.161+01:00MongoDB Script per current operationsScript molto utile per analizzare le operazioni in esecuzione sul Mongo Server.<br />
<br />
Ottimo per prevedere la creazione di eventuali indici senza utilizzare il profile standard.<br />
<br />
<br />
<br />
<script src="https://gist.github.com/marcoberri/5ff35ced0a8d3c744008.js"></script>
risultato:<br />
<br />
on:<dbname>.<collectionname><br />
time:12968<br />
query: {"_id":{"str":"54b64c9ee4b009e7c6df0f40"}}<br />
<br />
on:<dbname>.<collectionname><br />
time:18489<br />
query: {"_id":{"str":"54b64c9ee4b009e7c6df0f40"}}<br />
<br />
on:<dbname>.<collectionname><br />
time:131<br />
query: {"field1":"515c785c9ccb3d8e563baf32","field2":"AAA","field1":"BBB"}<br />
<div>
<br /></div>
Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-14990986459733859882015-12-14T10:17:00.002+01:002015-12-14T10:17:59.155+01:00MongoDB Tools 3.0.7 - mongorestore bug<br />
<a href="https://jira.mongodb.org/browse/TOOLS-939">Mongorestore</a> bug:<br />
<br />
<b>mongorestore --drop --host <HOST> -v /dump/DB_FOLDER</b><br />
<br />
Command result:<br />
<br />
Failed: restore error: komparu_product_dev.product: error restoring from dump/<dbame>/>collection-name>.bson: insertion error: EOF<br /><br />
<br />
<b>FIX:</b><br />
<br />
mongorestore --drop <b>batchSize=1</b> --host <HOST> -v /dump/DB_FOLDER<br />
<br />
<br />Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001tag:blogger.com,1999:blog-4807523848958190892.post-34373973761140710072015-10-19T21:28:00.000+02:002015-10-19T21:28:00.111+02:00MongoDB v.3 Memory ProblemUtilizzando un piccolo server (magari con più processi di mongod ) è possibile che per mancanza di risorse il processo venga killato dal SO.<br />
<br />
Nel var/log/messages si trova questa cosa devastante...<br />
<br />
Oct 15 02:00:33 <servername> kernel: [723954.577468] Out of memory: Kill process 18100 (mongod) score 368 or sacrifice child<div>
<br /></div>
<div>
la soluzione è semplicemente dosare correttamente la cache del wiredTiger nel file di configurazione</div>
<div>
<br /></div>
<div>
s<a href="http://docs.mongodb.org/manual/reference/configuration-options/?_ga=1.219808538.2005627762.1433862535#storage.wiredTiger.engineConfig.cacheSizeGB">torage.wiredTiger.engineConfig.cacheSizeGB</a></div>
<div>
<br /></div>
<div>
nel mio caso con un server (debian 8.1 con 16Gb di Ram) con 3 mongod in esecuzione in replica secondaria il parametro è settato a 3Gb per ogni mongod.</div>
<div>
<br /></div>
<div>
dopo una taratura i mongod non crollano più.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Marco Berrihttp://www.blogger.com/profile/05430204330007340711noreply@blogger.com013048 Santhià VC, Italia45.3669051 8.1713889000000145.3445931 8.1310484000000116 45.389217099999996 8.21172940000001