Author Archives: admin

MySql Group_Concat

The result of GROUP_CONCAT is truncated to the maximum length that is given by the group_concat_max_len system variable, which has a default value of 1024.

This will cause  data-destroying bugs in production. For this reason you should probably not use GROUP_CONCAT . At least you must set the value of group_concat_max_len to an insanely high value on every database server your application runs on.

Like MAX or COUNT, GROUP_CONCAT is a MySQL aggregation function you can use whenever your query contains a GROUP BY. You can use it to retrieve a comma-separated list of all values in a given column within each group.

select  client
,Month
,year
,Sum(Amount) as Amount_Total
,GROUP_CONCAT(Amount) as Amount_Detail
,GROUP_CONCAT(InvoiceNum) as Invoices
from mytable
 group by Client

Pass Array via Query String

http://galhano.com/?var=1&var=2&var=3&var=4

vb sample:

  Dim arr = Request.QueryString("var").Split(",")
  For Each s In arr
    Response.Write("<br />var:" & var)
  Next

Measure a function’s performance

Imports System.Diagnostics


Dim sw As New Stopwatch()
sw.Start()
' Do the work here
sw.Stop()
Console.WriteLine("Elapsed time: {0}", sw.Elapsed.TotalMilliseconds)

IIS 8.0 error 401.2

Goto  IIS Console > web site properties >IIS authentication and Activate “Basic Authentication”

WordPress Pretty Permalinks on IIS 7.0

Just create a web.config  in wordpress root dir:


<?xml version="1.0"?>

<configuration>

    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Main Rule" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
     </system.webServer>
</configuration>

Read more:

WordPress Pretty Permalinks on IIS 7.0


http://codex.wordpress.org/Using_Permalinks

Add value for dropdown list in asp.net


ListItem li =new ListItem();
 li.value="PT";
 li.Text="Portugal";
 dropdownlist1.Items.Add(li);

or


dropCategory.Items.Add( New ListItem( "Portugal", "PT" ) )

PT inaugura Datacenter na Covilhã com olhos postos na internacionalização

A primeira fase do projeto da PT na Covilhã abre hoje oficialmente as portas, inaugurando uma nova aposta da empresa que quer ser cada vez mais fornecedora de serviços de TI, transformando a operação e abrindo-se à internacionalização.

Dois anos depois de ter sido lançada a primeira pedra da construção a operadora abre a primeira fase do centro de dados que é ainda uma pequena parte do projeto global, pensado para integrar 4 edifícios. Zeinal Bava, CEO da PT Portugal e Presidente da Oi, assume na inauguração que este é um passo importante em direção à concretização do ciclo de transformação tecnológica que a PT está a desenvolver há mais de cinco anos e que sustenta uma estratégia de diferenciação da oferta da empresa.

read more »

Fix corrupted Public Folder in exchange 2003

Fix corrupted Public Folder in exchange 2003:

1. Dismount the store
2. From a command prompt, navigate to z:\program files\exchsrvr\bin folder where z: represents the drive where the exchange program files were installed.
3. Run

eseutil /p "z:\program files\exchsrvr\mdbdata\pub1.edb" 

4. Run

eseutil /d "z:\program files\exchsrvr\mdbdata\pub1.edb"

5. Run

 isinteg -s servername -fix -test alltests

(choose the Public Folders when prompted)
6. Run the above command again to make sure isinteg has fixed all errors (last line should read 0 errors and 0 fixes).
7. Re-mount the Public Folder store.

All should be repaired now.

Set Calendar Extender’s SelectedDate=”<%=DateTime%>”

&lt;asp:TextBox ID=&quot;txtDate&quot; runat=&quot;server&quot; &gt;&lt;/asp:TextBox&gt;
&lt;cc1:CalendarExtender ID=&quot;CalendarExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;txtDate&quot; Format=&quot;MM/dd/yyyy&quot; OnClientShowing=&quot;showDate&quot; &gt; &lt;/cc1:CalendarExtender&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
function showDate(sender,args)
{
if(sender._textbox.get_element().value == &quot;&quot;)
{
var todayDate = new Date();
sender._selectedDate = todayDate;
}
}
&lt;/script&gt;

Schedule Mysql Backups to Amazon S3 in Windows server 2008 R2

1 – Access Amazon Services, S3
2 – Create a New Bucket if there’s no one.
3 – Create credentials in  IAM Amazon Services
4 – Download the tool s3.exe for windows, from s3.codeplex.com

read more »