<commit_before>rem @echo off
if exist c:\jenkins\swarm-client.jar goto :EOF

echo Ensuring .NET 4.0 is installed
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.github.com/StefanScherer/arduino-ide/install/InstallNet4.ps1'))"
where cinst
if ERRORLEVEL 1 (
  echo Installing Chocolatey
  @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
)

where cinst
if ERRORLEVEL 1 goto set_chocolatey
goto inst
:set_chocolatey
set ChocolateyInstall=%SystemDrive%\Chocolatey
set PATH=%PATH%;%ChocolateyInstall%\bin
:inst

where java
if ERRORLEVEL 1 call cinst java.jdk

where wget
if ERRORLEVEL 1 call cinst wget

if not exist c:\jenkins mkdir c:\jenkins

if not exist c:\jenkins\swarm-client.jar (
  if exist c:\vagrant\resources\swarm-client.jar (
    copy c:\vagrant\resources\swarm-client.jar c:\jenkins\swarm-client.jar
  ) else (
    call wget -O c:\jenkins\swarm-client.jar http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/1.15/swarm-client-1.15-jar-with-dependencies.jar
  )
)

call :heredoc html >%TEMP%\JenkinsSwarmClient.xml && goto next2
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2014-03-09T01:02:10</Date>
    <Author>vagrant</Author>
  </RegistrationInfo>
  <Triggers>
    <BootTrigger>
      <StartBoundary>2014-03-09T01:02:00</StartBoundary>
      <Enabled>true</Enabled>
    </BootTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>vagrant</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
    <RestartOnFailure>
      <Interval>PT1M</Interval>
      <Count>3</Count>
    </RestartOnFailure>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>java.exe</Command>
      <Arguments>-jar c:\jenkins\swarm-client.jar -autoDiscoveryAddress 172.16.32.255 -labels windows -fsroot c:\jenkins</Arguments>
    </Exec>
  </Actions>
</Task>
:next2

rem Schedule start of swarm client at start of the machine (after next reboot)
rem

schtasks /CREATE /TN JenkinsSwarmClient /RU vagrant /RP vagrant /XML "%TEMP%\JenkinsSwarmClient.xml"

goto :EOF

<commit_msg>added comment for swarm client username and password<commit_after>rem @echo off
if exist c:\jenkins\swarm-client.jar goto :EOF

echo Ensuring .NET 4.0 is installed
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.github.com/StefanScherer/arduino-ide/install/InstallNet4.ps1'))"
where cinst
if ERRORLEVEL 1 (
  echo Installing Chocolatey
  @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
)

where cinst
if ERRORLEVEL 1 goto set_chocolatey
goto inst
:set_chocolatey
set ChocolateyInstall=%SystemDrive%\Chocolatey
set PATH=%PATH%;%ChocolateyInstall%\bin
:inst

where java
if ERRORLEVEL 1 call cinst java.jdk

where wget
if ERRORLEVEL 1 call cinst wget

if not exist c:\jenkins mkdir c:\jenkins

if not exist c:\jenkins\swarm-client.jar (
  if exist c:\vagrant\resources\swarm-client.jar (
    copy c:\vagrant\resources\swarm-client.jar c:\jenkins\swarm-client.jar
  ) else (
    call wget -O c:\jenkins\swarm-client.jar http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/1.15/swarm-client-1.15-jar-with-dependencies.jar
  )
)

call :heredoc html >%TEMP%\JenkinsSwarmClient.xml && goto next2
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2014-03-09T01:02:10</Date>
    <Author>vagrant</Author>
  </RegistrationInfo>
  <Triggers>
    <BootTrigger>
      <StartBoundary>2014-03-09T01:02:00</StartBoundary>
      <Enabled>true</Enabled>
    </BootTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>vagrant</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
    <RestartOnFailure>
      <Interval>PT1M</Interval>
      <Count>3</Count>
    </RestartOnFailure>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>java.exe</Command>
      <Arguments>-jar c:\jenkins\swarm-client.jar -autoDiscoveryAddress 172.16.32.255 -labels windows -fsroot c:\jenkins</Arguments>
    </Exec>
  </Actions>
</Task>
:next2

rem IF Jenkins has security set, use following Arguments for scheduled task:
rem add options -username and -password to swarm-client:
rem       <Arguments>-jar c:\jenkins\swarm-client.jar -autoDiscoveryAddress 172.16.32.255 -username vagrant -password <PASSWORD> -labels windows -fsroot c:\jenkins</Arguments>

rem Schedule start of swarm client at start of the machine (after next reboot)
rem

schtasks /CREATE /TN JenkinsSwarmClient /RU vagrant /RP vagrant /XML "%TEMP%\JenkinsSwarmClient.xml"

goto :EOF


{'fraction_non_alphanumeric': 0.12826215895610912, 'fraction_numerical': 0.022538552787663108, 'mean_word_length': 4.537766830870279, 'pattern_counts': {'":': 0, '<': 156, '<?xml version=': 2, '>': 158, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2116418', 'n_tokens_mistral': 2421, 'n_tokens_neox': 2270, 'n_words': 418}