This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import sys | |
| import hashlib | |
| import codecs | |
| import hmac | |
| from random import SystemRandom | |
| _sys_rng = SystemRandom() | |
| SALT_CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' | |
| DEFAULT_PBKDF2_ITERATIONS = 150000 | |
| PY2 = sys.version_info[0] == 2 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | stage("Publish to Artifactory") { | |
| // create a Artifactory server reference with some credentials we stored in Jenkins already | |
| def server = Artifactory.newServer url: 'http://artifactory.example.com/artifactory', credentialsId: 'artifactory-credentials' | |
| // Upload spec is a definition for the Artifactory plugin to tell it how and what to upload, and where in Artifactory it should go | |
| def uploadSpec = """{ | |
| "files": [ | |
| { | |
| "pattern": "binaries/*", | |
| "target": "generic-local/golang/${applicationName}/", | |
| "flat": false | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env groovy | |
| // this will start an executor on a Jenkins agent with the docker label | |
| node('docker') { | |
| // Setup variables | |
| // application name will be used in a few places so create a variable and use string interpolation to use it where needed | |
| String applicationName = "basic-app" | |
| // a basic build number so that when we build and push to Artifactory we will not overwrite our previous builds | |
| String buildNumber = "0.1.${env.BUILD_NUMBER}" | |
| // Path we will mount the project to for the Docker container | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env groovy | |
| // this will start an executor on a Jenkins agent with the docker label | |
| node('docker') { | |
| // Setup variables | |
| // application name will be used in a few places so create a variable and use string interpolation to use it where needed | |
| String applicationName = "basic-app" | |
| // a basic build number so that when we build and push to Artifactory we will not overwrite our previous builds | |
| String buildNumber = "0.1.${env.BUILD_NUMBER}" | |
| // Path we will mount the project to for the Docker container | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package main | |
| // Import the fmt for formatting strings | |
| // Import os so we can read environment variables from the system | |
| import ( | |
| "fmt" | |
| "os" | |
| ) | |
| // create a function named getUserName that returns a single string | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package com.reynn.dailyprogrammer.Easy; | |
| import java.io.*; | |
| import java.util.Properties; | |
| import java.util.Scanner; | |
| /** | |
| * create a program which is password protected, and wont open unless the correct | |
| * user and password is given. | |
| * For extra credit, have the user and password in a seperate .txt file. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import string | |
| morseAlphabet = { # Messy Dictionary | |
| ".-" : 'A', "-..." : 'B', "-.-.": 'C', "-..": 'D', | |
| ".": 'E', "..-.": 'F', "--.": 'G', "....": 'H', | |
| "..": 'I', ".---": 'J', "-.-": 'K', ".-..": 'L', | |
| "--": 'M', "-.": 'N', "---": 'O', ".--.": 'P', | |
| "--.-": 'Q', ".-.": 'R', "...": 'S', "-": 'T', | |
| "..-": 'U', "...-": 'V', ".--": 'W', "-..-": 'X', | |
| "-.--": 'Y', "--..": 'Z', | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package com.reynn.dailyprogrammer.Easy; | |
| import com.sun.javafx.css.CssError; | |
| import sun.misc.Regexp; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.util.HashMap; | |
| import java.util.Iterator; |