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 python | |
import socket, threading, sys | |
class ClientThread(threading.Thread): | |
def __init__(self, ip, port, socket, thread_id): | |
threading.Thread.__init__(self) | |
self.ip = ip | |
self.port = port |
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 javax.xml.parsers.SAXParser; | |
import javax.xml.parsers.SAXParserFactory; | |
import org.xml.sax.Attributes; | |
import org.xml.sax.SAXException; | |
import org.xml.sax.helpers.DefaultHandler; | |
import java.util.HashMap; | |
import java.util.Map; |
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
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
void ShowCollection(vector<char> &v); | |
void ShowCollection(int arr[], int size); | |
void testOnArrayOfInts(); |
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
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
void printStringVector(vector<string*> &v) ; | |
void freeDictionary(vector<string*> &v); | |
vector<string*> loadDictionary(); |
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
#include <algorithm> | |
#include <cstdlib> | |
#include <ctime> | |
#include <fstream> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <list> | |
#define DICTIONARY_PATH "/cygdrive/d/files/gdrive/Uczelnia/ZBP/lab1/lab1-1/lab1.dic" |
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
public void processSales(List<Sale> sales, Customer customer) { | |
boolean foreignCurrencyFound = false; | |
List<Transaction> transactions = new LinkedList<Transaction>(); | |
for (Sale sale : sales) { | |
Transaction transaction = createTransaction(sale, customer); | |
transactions.add(transaction); | |
if (!foreignCurrencyFound && isInForeignCurrency(transaction)) | |
foreignCurrencyFound = true; | |
} | |
if (foreignCurrencyFound) |
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
public void processSales(List<Sale> sales, Customer customer) { | |
List<Transaction> transactions = createTransactionsForSales(sales, customer); | |
if (isAnyTransactionInForeignCurrency(transactions)) { | |
notifyForeignOffice(customer); | |
} | |
saveInDatabase(transactions); | |
} |
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
public Transaction createTransaction(Sale sale, Customer customer) { | |
Transaction transaction = new Transaction(); | |
populatePaymentDetails(transaction, sale); | |
populateCustomerDetails(transaction, customer); | |
sale.setProcessed(true); | |
return transaction; | |
} |
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
public Transaction createTransaction(Sale sale, Customer customer) { | |
Transaction transaction = new Transaction(); | |
populatePaymentDetails(transaction, sale, customer); | |
populateCustomerDetails(transaction, customer); | |
sale.setProcessed(true); | |
return transaction; | |
} | |
private void populatePaymentDetails(Transaction transaction, Sale sale, Customer customer) { | |
transaction.setPayerId(customer.getId()); |
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
public static Style getSmallStyle() { | |
Style style = new Style(); | |
style.getFont().setFontSize(6); | |
return style; | |
} |
NewerOlder