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.Matcher; | |
import java.util.regex.Pattern; | |
public class LeftAndRightHandedDiv2 { | |
// srm 612 div 2 | |
public int count(String S) { | |
// find number of "RL" in S | |
int cpt = 0; | |
Pattern regex = Pattern.compile("RL", Pattern.MULTILINE); |
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
package bridge.services; | |
public interface BridgeService extends /* refine */ LimitedRoadService { | |
/** Observateur: nombre de véhicule sur le pont en direction de l'ile */ | |
public int getNbIn(); | |
/** Observateur: nombre de véhicule sur le pont en direction du continent */ | |
public int getNbOut(); | |
// inv: getNbCars() == getNbIn() + getNbOut() |
This file has been truncated, but you can view the full file.
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
.file 1 "a.c" | |
.section .mdebug.abi32 | |
.previous | |
.gnu_attribute 4, 1 | |
.abicalls | |
.comm caml_code_fragments_table,12,4 | |
.comm caml_extern_sp,4,4 |
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
/** | |
* fib.java engendre par ml2java | |
*/ | |
/** | |
* de'claration de la fonction fib___1 | |
* vue comme la classe : MLfun_fib___1 | |
*/ | |
class MLfun_fib___1 extends MLfun { |
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
int coin = 0; | |
for (Coord c : coords) { | |
if (coin==0) { | |
previousNode = createOrUpdateNode(c, previousNode); | |
System.err.println("Pile"); | |
} else { | |
System.err.println("Face"); | |
} | |
coin = (coin+1)%2; | |
} |
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
int coin = 0; | |
for (List<Coord> l : coords) { | |
if (coin==0) { | |
List<MapNode> nodes = new ArrayList<MapNode>(); | |
for (Coord c : l) { | |
// make coordinates match sim map data | |
if (mirror) { | |
c.setLocation(c.getX(), -c.getY()); | |
} | |
c.translate(xOffset, yOffset); |
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
# | |
# Default settings for the simulation | |
# | |
## Scenario settings | |
Scenario.name = default_scenario | |
Scenario.simulateConnections = true | |
Scenario.updateInterval = 0.1 | |
# 43200s == 12h | |
Scenario.endTime = 43200 |
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
@Override | |
public Object clone(){ | |
Zoo res = new Zoo(t.length); | |
for(int i = 0; i<t.length; i++){ | |
res.t[i] = new Cage(t[i]); | |
} | |
res.n = n; | |
return res; | |
} |
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
package dict; | |
import java.rmi.Remote; | |
import java.rmi.RemoteException; | |
public interface IRappel extends Remote { | |
void done() throws RemoteException; | |
void setResult(Object o) throws RemoteException; |
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
// Exercice 2 : | |
// Fait la meme chose que l'exo1, mais lorsque l'aio a fini il n'envoie pas de signal | |
// on utilise le timer qui envoie un signal (SIGRTMIN ici) périodiquement | |
// à chaque fois qu'on recoit le signal, on vérifie si l'aio est terminée | |
void interrupt_signal(int s, siginfo_t *si, void *val) { } | |
int main(int argc, char **argv) { | |
/* masquer tout */ | |
sigset_t block_mask; | |
struct sigaction action; | |
sigfillset(&block_mask); |