View gist:efe86163e2a51b4e9dc2c9efdd4430ab
CharSequence emptyInputMsg = null; | |
String title = inputTitle.getText().toString(); | |
String amount = inputAmount.getText().toString(); | |
String date = inputDate.getText().toString(); | |
if(title.equals("")) { | |
emptyInputMsg = "Vänta lite, fuck you."; | |
} |
View gist:9006594c4890153c11b2381c1b183e47
import com.mysql.jdbc.Statement; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.ArrayList; |
View Philosofer.java
package main; | |
import java.util.concurrent.Semaphore; | |
/** | |
* Thread representing a philosofer. | |
* | |
* @author Anton Gustafsson | |
* | |
*/ |
View Buffer.java
package assignment4; | |
/** | |
* | |
* A buffer class that has a 2 arrays, one for strings and one containing | |
* statuses. One index for each operation. Methods use monitors by using the | |
* synchronized keyword. | |
* | |
*/ | |
public class Buffer { |
View Program.cs
//http://www.geeksforgeeks.org/fractional-knapsack-problem/ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
new Program(); | |
} | |
public Program() | |
{ |
View HuffmanTree.java
import java.util.ArrayList; | |
import java.util.Hashtable; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.PriorityQueue; | |
import java.util.stream.Collectors; | |
/** | |
*A huffman tree implementation. To test it, | |
*create a new instance of this class and | |
*pass in a string to encode. |
View Radix.java
package main; | |
import java.util.LinkedList; | |
import java.util.Queue; | |
/** | |
* Implementation of radix sort. | |
* | |
* @author Anton Gustafsson | |
* |