Skip to content

Instantly share code, notes, and snippets.

Avatar

Guillaume Massé MasseGuillaume

View GitHub Profile
@MasseGuillaume
MasseGuillaume / JHashMap.cpp
Created April 26, 2012 15:51
Insert key value pair in a std::map then output in a java HashMap
View JHashMap.cpp
// @author Guillaume Masse
#include "JHashMap.h"
#include <string>
using namespace std;
void JHashMap::insert( std::string key, std::string value )
{
@MasseGuillaume
MasseGuillaume / Radio.cpp
Created April 26, 2012 15:51
Loop audio with FMOD
View Radio.cpp
void Radio::playTrack( string fileTrack )
{
systeme_->createStream( fileTrack.c_str(), FMOD_ACCURATETIME, false, &sound_ );
systeme_->playSound( FMOD_CHANNEL_FREE, sonRadio_, false, &channel_ );
}
void Radio::update()
{
bool playing = false;
if( channel_ ->isPlaying(&playing) != FMOD_OK )
@MasseGuillaume
MasseGuillaume / test.sh
Created April 26, 2012 15:52
log1000 correction tp4
View test.sh
#! /bin/sh
SOURCE=tictactoe.cpp
SOURCE_TMP=tmp_tictactoe.cpp
DIFF_FAIL="ok"
COMPILE_FAIL="ok"
cp $SOURCE $SOURCE_TMP
#test patches
for diff in *.diff
@MasseGuillaume
MasseGuillaume / P06.scala
Created May 23, 2012 02:34
Scala Kata: Test & Implementation
View P06.scala
// source: http://aperiodic.net/phil/scala/s-99/
def isPalindrome[A](in: List[A]):Boolean = in == in.reverse
// source: https://github.com/dadrox/scala.katas (adapted for spec2)
import org.junit._
import org.specs2.matcher._
class NinetyNineScalaProblems extends JUnitMustMatchers {
@test def P06
{
isPalindrome Nil must beTrue
@MasseGuillaume
MasseGuillaume / tp1.scala
Created July 7, 2012 05:30
LOG3210 - TP1
View tp1.scala
import scala.util.parsing.combinator._
object Main
{
def main(args: Array[String])
{
println(TP1.parseAll(TP1.program, args(0)))
}
}
@MasseGuillaume
MasseGuillaume / tp2.scala
Created July 7, 2012 22:55
LOG3210 - TP2
View tp2.scala
import scala.util.parsing.combinator.Parsers
import scala.util.parsing.combinator.JavaTokenParsers
object Main
{
def main(args: Array[String])
{
val arg = "( x + 0 ) - ( 1 * --x )"
TP2.parseAll( TP2.expression, arg ) match {
@MasseGuillaume
MasseGuillaume / error.sh
Created July 26, 2012 01:05
Cloudbees: Cannot deploy with SDK
View error.sh
bees app:deploy target/scala-2.9.1/scalakata_2.9.1-0.1-SNAPSHOT.war
# CloudBees SDK version: 0.8.1
Deploying application masgui/scala (environment: ): target/scala-2.9.1/scalakata_2.9.1-0.1-SNAPSHOT.war
2012-07-25 21:00:54,558 [main] INFO - I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
2012-07-25 21:00:54,558 [main] INFO - Retrying request
2012-07-25 21:00:54,617 [main] INFO - I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
2012-07-25 21:00:54,617 [main] INFO - Retrying request
2012-07-25 21:00:54,675 [main] INFO - I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameter
View gist:3927821

tu peux modifier et accèder le DOM produit par la template avec du code javascript

<ol id="cheminement">
	<li class="session">
		<span class="periode">Automne</span>
		<span class="annee">2009</span>
		<ul class="liste-cours">
			<li class="placeholder"></li>
 
View 2009_3_Automne.html
<li draggable="true" class="cours" id="INF1005C">
<lift:surround with="cours">
<lift:bind-at name="sigle">INF1005C</lift:bind-at>
<lift:bind-at name="credits">3</lift:bind-at>
<lift:bind-at name="titre">Programmation procédurale</lift:bind-at>
<lift:bind-at name="definition">
<ul class="disponibilite">
<li>Automne</li>
<li>Hiver</li>
View AfficherUaTest.scala
package ca.polymtl.log4420
package test
package systeme
import org.scalatest._
import matchers.ShouldMatchers
import selenium.{WebBrowser, Chrome}
@EquipeDeQuatre
class AfficherUaTest