23/09/2016

VALUES(ID,

Patern to replace/remove

\VALUES \([1-9][0-9]{0,4}|10000,

Event - how to load data infile using windows tasks

08/03/2013

program: "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysql.exe"
arguments: "-uroot" "-ppasword12*" "-eSOURCE c:/loadquery.sql"

Using Batch

cd C:\inetpub\wwwroot\folderScript
start php.exe -f C:\inetpub\wwwroot\folderScript\somescript.php

/var/www permissions

06/03/2013

Add your user to www-data group

how to set default document on apache

19/02/2013

Set apache to accept it:
sudo gedit /etc/apache2/sites-available/default



Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all



On your app i.e. /var/www/app create .htaccess file with this:

Order deny,allow
ErrorDocument 400 error.php
DirectoryIndex list.php

Decimal Validator

18/12/2012

<html>
<head>
  <title></title>
  <script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"></script>
  <script type="text/javascript">
   $(document).ready(function() {
         $('.numbersOnly').keyup(function (e) {
            if(($(this).val().split(".")[0]).indexOf("00")>-1){
                    $(this).val($(this).val().replace("00","0"));
            } else {
                    $(this).val($(this).val().replace(/[^0-9\.]/g,''));
            }
            if($(this).val().split(".")[2] != null || ($(this).val().split(".")[2]).length ){
                    $(this).val($(this).val().substring(0, $(this).val().lastIndexOf(".")));
         }
         });
  });
  </script>
</head>
<body>
  <input type="text" class="numbersOnly" value="" />​
</body>
</html>

Search filters build on views

21/09/2012

- Add a Filter Criteria
- Expose this filter to visitors, to allow them to change it

Import Data into Drupal

-Save UTF-8 .csv file in Excel
-Create the content type = like the structure of the data your excel have.
-http://drupal.org/project/feeds enable it
- Define in Mapping a unique field.

Problems
in my.ini
max_allowed_packet=24M
restart

if it dind't fix
try in php configurarion

php_value memory_limit 128M




Drupal7 in any language

20/03/2012

1º Download Language http://localize.drupal.org/translate/downloads
2º Enable Locale Module
3º Configuration > Regional And Language > Translate interface > Import (see image below)
Import Screen
4º  Configuration >  Regional And Language  > Languages - And set your language to default

netPonto

02/01/2012

A comunidade NetPonto é uma iniciativa independente e sem fins lucrativos, que tem como simples e único objectivo a partilha de conhecimento na área de arquitectura e desenvolvimento de software na plataforma .NET, na tentativa de disseminar o conhecimento diferenciado de cada um de seus membros.

http://netponto.org/

Count weeks and days between two dates

06/11/2011

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="JavaScript">

    function inst(){
                        ayear=2011;
   amonth=08;
   aday = 11;
   
   var currentTime = new Date();
   byear=currentTime.getFullYear();
   bmonth= (currentTime.getMonth()+1);
   bday = currentTime.getUTCDate();
            
            
            //firstdate = new Date(ayear,amonth, aday);
            //seconddate = new Date(byear,bmonth,bday);
            
            firstdate = Date.UTC(ayear,amonth, aday,0,0,0);
            seconddate = Date.UTC(byear,bmonth,bday,0,0,0);

            DAY = 60 * 1000 * 60 * 24;
            daydif = (seconddate-firstdate)/ DAY;
            
            weeks = daydif / 7;

            sparedays = daydif%7;
              
            return "Semanas: " + parseInt(weeks) +" <br/> Dias: "+sparedays;
            document.dateform.yahoo.value = "Semanas: " + parseInt(weeks) +"  Dias:"+sparedays;
            
            //lastdigit=document.snform.sn3.value.charAt(3);
            //document.snform.results.value=instructor[lastdigit];
            //document.snform.address.value=email[lastdigit];
            //document.links[0].href="mailto:"+email[lastdigit];    
            
        
     }

</script>
</head>
<body>
<script type="text/javascript">
document.write(inst());
</script>
</body>
</html>

Customize drupal page nid

02/11/2011

page-node-3.tpl.php