14 nov 2014

libre office draw loading gallery objects


download galerry files here ;
http://www.openoffice.org/fr/Documentation/Gallery/indexgal.html


go to C:\Users\\AppData\Roaming\LibreOffice\4\user\gallery
and save the content of the zips.

restart your libre office.

Now you have upgraded your gallery with a lots of symbols.

another good source
is the openclipart gallery where you can download a lot of SVG files


8 jan 2014

ldapfilter with timestamps in powershell

$DateString = (Get-Date).AddMinutes(-30).ToString("u") -Replace "-|:|\s"
$DateString = $DateString -Replace "Z", ".0Z"
write-host "(&(sAMAccountType=805306368)(whenCreated>=$DateString))"

9 sep 2013

create shortcut with powershell

 function Set-Shortcut ($linkpath , $targetPath )
{
    Write-Host $linkpath
    $strlinkpath = [String ]$linkpath
    if($targetPath -eq -$NULL)
    {
     throw ("targetpath not available" )
    }
    else
    {
        if(Test-Path $targetPath)
        {
        }
        else
        {
            throw " $targetPath does not exist"
        }
    }
    if($strlinkpath -eq $NULL)
    {     
            throw “linkpath not correct”
    }
    elseif($strlinkpath .EndsWith(".lnk" ))
    {
     $link            = ( New-Object -ComObject WScript.Shell). CreateShortcut($strlinkpath)
     $link.TargetPath = $targetPath
     ## Added after grawity's post
     $link.Save()
    }
    else
    {
        throw ("filename not available in path" )
    }

}
 

11 mrt 2013

script to generate files in folder structure


$DefaultPath = ""



$dirs =  get-childitem  -Recurse -Path $DefaultPath | where {$_.mode -match "d"}

foreach($dir in $dirs)
{
 $dirname =  $dir.FullName

    for ($i=1; $i -le 100; $i++)
    {
     $filename = "$dirname\file$i.txt"  
     write-host $filename
     New-Item $filename -type file -force -value "This is text added to the file"
    }
}

30 sep 2012

Reading and writing to GPX Files


 public static void CreateNewGpxFile()
        {
            gpxType  Gpxfile = new gpxType();
            trkType Tracking1 = new trkType();
            trksegType TrackingRegister = new trksegType();


            wptType Waypoint1 = new wptType();
            Waypoint1.lon = ( decimal) 4.13;
            Waypoint1.lat = ( decimal) 51.7;

            wptType Waypoint2 = new wptType();
            Waypoint1.lon = ( decimal)4.18;
            Waypoint1.lat = ( decimal)51.6;

            List<wptType > Waypoints = new List<wptType >();
            Waypoints.Add(Waypoint1);
            Waypoints.Add(Waypoint2);

            TrackingRegister.trkpt = Waypoints.ToArray();
            Tracking1.trkseg = TrackingRegister.SingleItemAsArray< trksegType>();
            Gpxfile.trk = Tracking1.SingleItemAsArray< trkType>();

            string Gpxfilestring = FileToStringBuilder(@"c:\temp\test.gpx" ).ToString();

            Gpxfile =  DeserializeFromXml<gpxType>(Gpxfilestring);
           

        }



1.  Go to http://www.topografix.com/GPX/1/1/gpx.xsd and dowload the xsd schema to C:\temp\ of your computer.
2. Start the Visual Studio 2010 CMD
3. execute the command : xsd c:\temp\gpx.xsd /classes  /out:c:\temp\

25 sep 2012

excel is very slow

- be sure there are no conditional formatting rules
- be sure that the excel file does have links to websites / server that aren't accessible at this moment.
- be sure that the images are small (compress all pictures in the excel)