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
/* | |
* Animal.java | |
* | |
* Copyright 2010 Mònica Ramírez Arceda <[email protected]> | |
* This is free software, licensed under the GNU General Public License v3. | |
* See http://www.gnu.org/licenses/gpl.html for more information. | |
* | |
*/ | |
package animals; |
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
/* | |
Examen PLpgSQL | |
Carles Koch Busquets | |
*/ | |
drop function afegirservei ( integer, integer, integer) ; | |
drop function checkin ( character varying) ; |
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 java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.Comparator; | |
public class CSVUtils { |
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
private char possibleDelimitadorCampsEntrada = '\"'; | |
private char separadorEntrada = ','; | |
/** | |
* | |
* @param fila un string separat amb estil csv | |
* @return array de Strings amb un valor per cada camp separat correctament. | |
*/ | |
public String[] filaCsvToArrString(String fila) { | |
ArrayList<String> strings = new ArrayList<>(); |
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 BookTxt(String filePath) { | |
this.filePath = filePath; | |
BufferedReader br = null; | |
try { | |
br = new BufferedReader(new FileReader(this.filePath)); | |
strFitxer = new ArrayList<>(5000); // 5k de linies inicials, falta buscar quantes serien més aproximadament a partir del tamany del fitxer. | |
String actualLine; | |
while ((actualLine = br.readLine()) != null) { | |
strFitxer.add(actualLine); |
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 int countWords() { | |
int totalWords=0; | |
for (String s : strFitxer) { | |
for (String i : s.split(" ")) { | |
if (!i.isEmpty()) { | |
totalWords++; | |
} | |
} | |
} | |
return totalWords; |
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
Fitxer /var/lib/pgsql/data/postgresql.conf : | |
- listen_adresses='*' | |
- port=5432 | |
(les dues anteriors descomentades) | |
Fitxer /var/lib/pgsql/data/pg_hba.conf: | |
(al apartat IPv4, afegir:) | |
- host all all 192.168.3.4/32 trust | |
(amb /32 només pot entrar el propi pc) |
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 java.util.ArrayList; | |
public class Ferry { | |
private String regNumber; // Matricula del ferry | |
private String name; // Nom del ferry | |
private String harbourName; // Nom del port destí del ferry | |
private double pricePerAxle;// Preu en € que cobra el ferry al camió per cada eix | |
private double pricePerTon; // Preu en € que cobra el ferry al camió per cada Tm de pes | |
private double maxWeight; // Pes màxim en Tm dels camions transportables pel ferry. | |
private ArrayList<Lorry> boardedLorries; // Els camions carregats al ferry |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="CompilerConfiguration"> | |
<resourceExtensions /> | |
<wildcardResourcePatterns> | |
<entry name="!?*.java" /> | |
<entry name="!?*.form" /> | |
<entry name="!?*.class" /> | |
<entry name="!?*.groovy" /> | |
<entry name="!?*.scala" /> |
NewerOlder