This file contains 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
private List<Manager> _managers = new ArrayList<Manager>(); | |
private List<Employee> _employees = new ArrayList<Employee>(); | |
private List<User> _usrs = new ArrayList<User>(); | |
public User findUser(String userID){ | |
refreshUserList(); //updates _usrs so it has all the current users | |
Iterator<User> i; | |
User u = null; //abstract class User | |
i = this._usrs.iterator(); |
This file contains 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
mklink "C:\Users\Gabriel\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ip.lnk" "interpol.bat" | |
set var1=You have been tracked by Interpol. Turn your terminal off and await the local authorities calmly. | |
set var2=You are being arrested for posession of illegal digital content. | |
set cont=500 | |
:loop | |
echo ALERT! | |
if %cont% equ 0 goto end | |
set /a cont=cont-1 |
This file contains 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 java.util.LinkedList; | |
import java.lang.Math; | |
public class SquareDigit { | |
LinkedList<Integer> stack = new LinkedList<Integer>(); //stack where I'll push each digit for easy ordered extraction | |
String str = ""; | |
/** | |
* this method receives a number and returns a number which digits are the input number's digits square. |
This file contains 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 java.lang.StringBuilder; | |
public class ReverseLonger { | |
public static String shorterReverseLonger(String a, String b) { | |
if (a.length() < b.length()) { | |
return a + reverse(b) + a; | |
} else { | |
return b + reverse(a) + b; | |
} |
This file contains 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
public class Number { | |
public boolean isEven(double n) { | |
if (n % 2 == 0) return true; | |
else return false; | |
} | |
} |
This file contains 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
public class Negative { | |
public static int makeNegative(final int x) { | |
if(x >= 0) return -x; | |
else return x; | |
} | |
} |
This file contains 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 java.lang.StringBuilder; | |
public class Bio { | |
public static String dnaToRna(String dna){ | |
StringBuilder strb = new StringBuilder(dna); | |
while(strb.indexOf("T") != -1) { | |
strb.replace(strb.indexOf("T"),strb.indexOf("T")+1,"U"); | |
} |
This file contains 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 java.util.regex.Pattern; | |
import java.util.regex.Matcher; | |
public class BatmanQuotes{ | |
public static int indexOf(Pattern pattern, String s) { | |
Matcher matcher = pattern.matcher(s); | |
return matcher.find() ? matcher.start() : -1; | |
} | |
This file contains 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
def capitals(word): | |
lst = [] | |
for i,ch in enumerate(word): | |
if ch.isupper(): | |
lst.append(i) | |
return lst | |
This file contains 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
public class TicketLine { | |
public static String Tickets(int[] peopleInLine) { | |
int money=0; | |
for(int i = 0;i<peopleInLine.length;i++){ | |
if(peopleInLine[i] == 50){ | |
if (money < 25) return "NO"; | |
else money+=25; | |
} |
OlderNewer