Messages récents

Pages: [1] 2 3 4 ... 10
1
TEA 4 Tous / How to calculate flexible vacation days, and moor
« Dernier message par Arenas le mars 26, 2024, 17:35:46 pm »
cls



" 1 Sripte"
"==========================================="
""
"Use each script individually"
" - How to calculate flexible vacation days"
" - What season is it now?"
" - Find left day(s) of the Year active"
""
"==========================================="

""
" How to calculate flexible vacation days"
" For:"
" - Ash Wednesday,"
" - Easter,"
" - The first Advent Day"
" there are other days like this in the year ..... "
""

"Us PowerShell any version"

# We are in 2024.
$YYYY = (Get-Date).Year

# this is the 1. fool luna, the reel luna year at this moment is the ....
""
""
"  "" The reel Luna Year at this moment is for the: "" " + ($yyyy-1)
"  If the "" Men "" (Luna-Month-Name) is equale at the "" Nisannu """
"  and "" Hemera "" (Luna-Day) is the first-day = 1;"
"  The year will by crow to the next "" Etos "" (Year) = "" $YYYY "" "
""
""
" Tis exemple works only for 2024, of the Luna/ Earth Kalender"
""

""
$Ash_Wednesday = '14-02-2024'
$ts1 = New-TimeSpan -Start $date_full_luna -End $cendre
$Ash_Wednesday2 = (Get-Date $date_full_luna).AddDays($ts1.Days).ToString("ddd d MMM yyyy")
"--------------------------------------------"
"  " + $Ash_Wednesday2 + " "" Get Ash Wednesday $YYYY """
"--------------------------------------------"

$date_full_luna = Get-Date "11 - 01 - $YYYY"
$date_easter = (Get-Date $date_full_luna).AddDays(80).ToString("ddd d MMM yyyy")
"-------------------------------------------"
"  " + $date_easter + " "" Get Easter for $YYYY """
"-------------------------------------------"
""" The Kalendar cycle start, ordone par Rom """
$first_advent = '01-12-2024'
$ts = New-TimeSpan -Start $date_full_luna -End $first_advent
$first_advent = (Get-Date $date_full_luna).AddDays($ts.Days).ToString("ddd d MMM yyyy")
"----------------------------------------------------"
"  " + $first_advent + " "" Get the first Advent-Day $YYYY """
"----------------------------------------------------"
""
" - Tat's all - "
"Arenas 25 March 2024"

"================================="

"Us only the yellow champs"
Luna Kalender for Excel


Rapport-luna-earth-march-2024

Rapport-luna-earth-april-2024




" 2 Another script"

"==========================="
"What season we have now ?"
"Us also PawerShell, any version."

Cls

$Date = Get-Date

Function Get-Season([datetime]$Date){
    If (!$Date) {$Date = Get-Date}
   
    #If date was not provided, assume today.
    # The dates are obviously not exactly accurate and are best guesses

    $Spring = Get-Date -Day 20 -Month 03 -Year $Date.Year
    $Summer = Get-Date -Day 21 -Month 06 -Year $Date.Year
    $Autumn = Get-Date -Day 22 -Month 09 -Year $Date.Year
    $Winter = Get-Date -Day 21 -Month 12 -Year $Date.Year
    $Season = switch($Date) {
        {($_ -lt $Spring)}  {"Winter";Break}
        {($_ -lt $Summer)}  {"Spring";Break}
        {($_ -lt $Autumn)}  {"Summer";Break}
        {($_ -lt $Winter)}  {"Autumn";Break}
        {($_ -ge $Winter)}  {"Winter"}
    }
    "{0:d} is in season {1}" -f $Date,$Season
}

""
"------------------------------"
    Get-Season
"------------------------------"






""
"================================="

" 3 Find the past days of 2 dates"


cls
""
""
" Synopsys 1 : Find left day(s) of the Year active"
""

"-------------------------------------------------"
""" Study from: ** 2023 oct. 14, from arenas. ** """
"-------------------------------------------------"

""
"    Days of Year ""minus"" Day of Year
    = Days of Year ""minus"" Day of Year
    -eq left Days for the Year active,
    as one Liner"
""
"The whole calculation process"
"    " +[string]([datetime]'12/31' - [datetime]'1/1' | % days) + " - " + [string](Get-Date).dayofyear`
 + " = "" left Day(s) for "" " + [string](Get-Date).year + ", " +(((Get-Date).dayofyear) - `
(([datetime]'12/31' - [datetime]'1/1') | % days))+ " Days"
""
"    Rigth ? "
""

""" Or """
"Short version"
""
 $xday_left_year = ((Get-Date).dayofyear) - (([datetime]'12/31' - [datetime]'1/1') | % days)
 $xday_left_year

 ""
2
TEA 4 Tous / Re : Easter Sunday in 2024 is on ?
« Dernier message par Klaatou le mars 01, 2024, 09:45:11 am »
"is on is on" ;) mais ça marche
3
TEA 4 Tous / Zoom in on the record-breaking quasar J0529-4351
« Dernier message par Arenas le février 21, 2024, 21:07:09 pm »

Brightest and fastest-growing: astronomers identify record-breaking quasar.

quasar J0529-4351
as-gif-file
quasar J0529-4351
as-txt-file

@
4
TEA 4 Tous / Re : Wath love Cats?
« Dernier message par Arenas le janvier 31, 2024, 08:50:29 am »
Center any Txt
Us PowerShell, any version.

The Scripte
=================
cls

function Write-HostCenter { param($Message) Write-Host ("{0}{1}" -f (' ' * (([Math]::Max(0, $Host.UI.RawUI.BufferSize.Width / 2) - [Math]::Floor($Message.Length / 2)))), $Message) }
""
Write-HostCenter '_            _'
Write-HostCenter '_"            "_'
Write-HostCenter '_"   Help me !  "_'
Write-HostCenter '_"   (\.(°.°)./)  "_'
Write-HostCenter '_"                  "_'
Write-HostCenter '_"     Good  night    "_'
Write-HostCenter '_"                      "_'
Write-HostCenter '_"   Demo or carnival  ?  "_'
Write-HostCenter '_" What time do we live in? "_'
Write-HostCenter '_"                            "_'
Write-HostCenter
""

===================
@
5
TEA 4 Tous / Easter Sunday in 2024 is on ?
« Dernier message par Arenas le janvier 24, 2024, 14:57:45 pm »
Easter Sunday in 2024 is on ?

Us PowerShell any version
@

=================

cls

$year = Get-Date -Format "yyyy"

$year = "$year"
$g = $year % 19
$s = [math]::Floor($year / 100)
$k = [math]::Floor(($s - 17) / 25)
$i = $s - [math]::Floor($s / 4) - [math]::Floor(($s - $k) / 3) + 19 * $g + 15
$i = $i - 30 * [math]::Floor($i / 30)
$i = $i - [math]::Floor($i / 28) * ([math]::Floor($g / 11) + 1) * ([math]::Floor((29 / ($i + 1))))
$j = $year + [math]::Floor($year / 4) + $i + 2 - $s + [math]::Floor($s / 4)
$j = $j - 7 * [math]::Floor($j / 7)
$l = $i - $j
$month = 3 + [math]::Floor(($l + 40) / 44)
$day = $l + 28 - 31 * [math]::Floor($month / 4)
""
Write-Host "Easter Sunday in $year is on is on $day-$month"

""
6
TEA 4 Tous / Wath love Cats?
« Dernier message par Arenas le janvier 22, 2024, 22:53:16 pm »

# us PowerShell

cls

write-host -object (("1*0x1*1x1*2x1*3x1*4x1*2x1*3x1*0x1*5x1*1x1*6x1*1x1*6x1*1x1*7x1*0x1*8x1*3x1*4x1*9x1*4x1*2x1*8x1*1x1*10x1*11x1*12x1*13x1*1x1*14x1*15x1*9x1*16x1*1x1*17x1*15x1*18x1*16x1*19x1*13x1*20x1*16x2*14x1*0" -split "x") -split "x"|%{ if ($_ -match "(\d+)\*(\d+)") { "$([char][int]("10T32T47T92T95T40T46T41T61T118T67T97T116T115T108T111T101T80T119T114T104" -split "T")[$matches[2]])" * $matches[1] } }) -separator ""

:)
7
TEA 4 Tous / Trouver les 4 dimanche avant noël 2023
« Dernier message par Arenas le décembre 05, 2023, 10:18:50 am »
cls

#  trouver les 4 dimanche avant noël 2023
# PowerShell toute version

$year = get-date -Format yyyy   

    $cd = ([datetime]"12/25/$year").tooadate()   
    $array = 1..28 |% {   
if (($cd - $_) % 7 -eq 1){   
    [datetime]::fromoadate($cd - $_).tolongdatestring()
    }   
 }   

"1." +$array[3]   
"2." +$array[2]   
"3." +$array[1]   
"4." +$array[0]   

""

@r
8
TEA 4 Tous / Artificial art (Second Options)
« Dernier message par Arenas le octobre 08, 2023, 10:36:48 am »
Artificial art
Second Options

Have you see und read the previous scripts? on :
http://www.interplanete.com/forum/index.php?topic=794.msg6717#msg6717

Today I'm going to show you the same picture but in color.
You can see the image but you can't keep it.
We'll discuss that another time

The script: us PowerShell

Open the link with Edge.

Download the scripte :
http://burschi.fr/Artificial-art/artificial-art.ps1
9
TEA 4 Tous / Création station fm
« Dernier message par Arenas le août 22, 2023, 05:34:39 am »
En utilisant dans la même page web pour deux nation: de "switcher" entre les jour paire et empaire
A utiliser pour un Pc ou pour un Mobile

Exemple comment utiliser la command "switch" pour PowerShell v. 7

$Xdate2 = 'en-US' -as [Globalization.CultureInfo]
(get-date).AddMinutes(60).ToString("h:mm tt", $Xdate2)

if((Get-Date).DayofYear % 2 -eq 0)
# au
{$Create.WriteLine(" <div style=""height:2px""></div>")}
# is
else {$Create.WriteLine(" <p style=""text-align:center;font-family:'Times New Roman';color:#FFFFFF""><em style=""color:#FF0000"">Luna Date: </em><em style=""color:#000000"">$Xhemera_nom </em><em style=""color:#FF0000"">$Xhemera_valeur</em><em style=""color:#000000""> - $Xmen_name </em><em style=""color:#FF0000"">$Xvaleur2</em><em style=""color:#000000""> - $Xetos_name </em><em style=""color:#FF0000"">$Xetos_valeur</em></p>")}

Avec un lien:




Une inconnu !




Bonne chance
10
TEA 4 Tous / L'art et intelligence artificielle ou le grand détournement
« Dernier message par Arenas le avril 30, 2023, 23:45:15 pm »
L'Art numérique

Le scripte ( fonction )

For PowerShell  version  4 or plus
===============
cls

function Convert-ImageToAsciiArt
{
  param(
    [Parameter(Mandatory)][String]
    $Path,
   
    [ValidateRange(20,20000)]
    [int]$MaxWidth=80,
   
    # character height:width ratio
    [float]$ratio = 2 # 1.5
  )

  # load drawing functionality
  Add-Type -AssemblyName System.Drawing
 
  # characters from dark to light
  $characters = '$#H&@*+;:-,. '.ToCharArray()
  $c = $characters.count
 
  # load image and get image size
  $image = [Drawing.Image]::FromFile($path)
  [int]$maxheight = $image.Height / ($image.Width / $maxwidth)/ $ratio
 
  # paint image on a bitmap with the desired size
  $bitmap = new-object Drawing.Bitmap($image,$maxwidth,$maxheight)
 
 
  # use a string builder to store the characters
  [System.Text.StringBuilder]$sb = ""
 
  # take each pixel line...
  for ([int]$y=0; $y -lt $bitmap.Height; $y++){
    # take each pixel column...
    for ([int]$x=0; $x -lt $bitmap.Width; $x++){
      # examine pixel
      $color = $bitmap.GetPixel($x,$y)
      $brightness = $color.GetBrightness()
      # choose the character that best matches the
      # pixel brightness
      [int]$offset = [Math]::Floor($brightness*$c)
      $ch = $characters[$offset]
      if (-not $ch){ $ch = $characters[-1] }     
      # add character to line
      $null = $sb.Append($ch)
    }
    # add a new line
    $null = $sb.AppendLine()
  }

  # clean up and return string
  $image.Dispose()
  $sb.ToString()
}

$Path = "C:\......."
$OutPath = "C:\........txt"

Convert-ImageToAsciiArt -Path $Path -MaxWidth 100 |
Set-Content -Path $OutPath -Encoding UTF8

Invoke-Item -Path $OutPath

====================
30.04.2023 23h45
Origine file (your format)


Sortie d'image en format txt
Pages: [1] 2 3 4 ... 10