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
#!/bin/bash | |
function countContainers() { | |
docker ps -q $1 | wc -l | |
} | |
function countCrashedContainers() { | |
docker ps -a | grep -v -F 'Exited (0)' | grep -c -F 'Exited (' | |
} |
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
@Configuration | |
public class TestMongoConfig { | |
private static final MongodStarter starter = MongodStarter.getDefaultInstance(); | |
@SuppressWarnings("SpringJavaAutowiringInspection") | |
@Autowired | |
private MongoProperties properties; | |
@Autowired(required = false) | |
private MongoClientOptions options; |
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
tep 17 : RUN whoami | |
---> Running in 3240a56670c9 | |
restx | |
---> f80416f3ec29 | |
Error removing intermediate container 7ec7bc8a9760: The given container is <nil> | |
Removing intermediate container 3240a56670c9 | |
Step 18 : RUN ls -al ${HOME} | |
---> Running in efd468ae1f51 | |
total 12 | |
drwxr-xr-x 1 restx restx 76 Jun 18 06:56 . |
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 class VideoHttpMessageConverter extends AbstractHttpMessageConverter { | |
public VideoHttpMessageConverter() { | |
super(new MediaType("video", "mp4")); | |
} | |
@Override | |
protected boolean supports(Class clazz) { | |
return InputStream.class.isAssignableFrom(clazz) || File.class.isAssignableFrom(clazz); | |
} |
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 class GetVideoRoute extends StdEntityRoute<Void, InputStream> { | |
private final VideoResource videoResource; | |
public GetVideoRoute(EntityRequestBodyReaderRegistry readerRegistry, VideoResource videoResource) { | |
super("Get Video Route", | |
readerRegistry.<Void>build(Void.class, Optional.<String>absent()), | |
new AbstractEntityResponseWriter<InputStream>(OutputStream.class, "video/mp4") { | |
@Override | |
protected void write(InputStream value, RestxRequest req, RestxResponse resp, RestxContext ctx) throws IOException { | |
try { |
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 class PutVideoRoute extends StdEntityRoute<InputStream, String> { | |
private final VideoResource videoResource; | |
public PutVideoRoute(EntityResponseWriterRegistry writerRegistry, VideoResource videoResource) { | |
super("Put Video Route", | |
new EntityRequestBodyReader<InputStream>() { | |
@Override | |
public Type getType() { | |
return InputStream.class; | |
} |
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/perl | |
use strict; | |
use Data::Dumper; | |
my $initialNumber = 0; | |
$initialNumber += $_ for map { ord($_) } split //, shift || die "No word supplied"; | |
my ( $tempVol, $volEnAltitude, $altitudeMax, $descendu ); | |
my $number = $initialNumber; | |
my @sequence; |
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 String solve(HttpServletRequest request) throws ResolverException { | |
String q = request.getParameter("q"); | |
if (q == null) return null; | |
String expr = q.replace(',', '.').replaceAll(" ", "+"); | |
try { | |
GroovyShell shell = new GroovyShell(); | |
Object evalResult = shell.evaluate(expr); | |
Object result; |
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 static void addToChange(COIN currentCoin, int value, Map<COIN, Integer> changeMap) { | |
if (value != 0) { | |
changeMap.put(currentCoin, value); | |
} | |
} | |
// Méthode principale on l'appelle avec computeChange(COIN.baz, value) afin en commençant donc par la plus grosse | |
// pièce. | |
public List<Map<COIN, Integer>> computeChange(COIN currentCoin, int value) { | |
if (currentCoin.getValue() == 1) { |
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
for(Entity entity: entityList) { | |
entityList.get(entityList.indexOf(entity)).performOp(); | |
} | |