Skip to content

Instantly share code, notes, and snippets.

View YounesCheikh's full-sized avatar
πŸ›Œ
Sleeping

Younes CHEIKH YounesCheikh

πŸ›Œ
Sleeping
View GitHub Profile
package org.dev.main;
import org.dev.MyClass;
public class Main {
/**
Objective Caml version 3.11.2
# (fun f -> fun x -> f (x + 3)) (fun y -> y+2) ((fun a -> a*2) 3 ) ;;
- : int = 11
# (fun f -> fun x -> f (x + 3)) (fun y -> y+2) (3*2) ;;
- : int = 11
# (fun f -> fun x -> f(x+3)) (fun y -> y+2 ) 6 ;;
- : int = 11
# (fun x -> ( fun y -> y + 2 ) (x + 3 ) ) 6 ;;
- : int = 11
@YounesCheikh
YounesCheikh / MyWindow.java
Created November 25, 2012 19:39
Tutorial explains how to use JFileChosser Properly [Part 1]
/*
* Tutorial: How to use JFileChooser properly (1)
* URL: http://cyounes.com/tutorials/how-to-use-jfilechooser-properly
* @author Cheikh Younes
*/
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import javax.swing.JButton;
@YounesCheikh
YounesCheikh / test.c
Created November 14, 2012 16:49
add more than one argument on C function. va_list
#include <stdio.h>
#include <stdarg.h>
int addThemAll( int numargs, ... )
{
// So this function can accept a variable number
// of arguments. No (practically speaking) limits.
// RULES you must know in order to be able to use "..." in one of your
// own functions:
larg_pcc := proc (G, x)
local y, z, CarnetDeVisite, Distance, Pere;
global Visite, OrdreVisite;
Visite := [seq(false, i = 1 .. nops(G))];
Visite[x] := true;
CarnetDeVisite := [x];
OrdreVisite := [];
Distance := [seq(-1, i = 1 .. nops(G))];
Pere := linalg:-vector(nops(G), proc (i) options operator, arrow; -1 end proc); Distance[x] := 0; print(Distance); while CarnetDeVisite <> [] do y := CarnetDeVisite[1]; CarnetDeVisite := enleve_tete(CarnetDeVisite); print("Carnet :", CarnetDeVisite, "y=", y, "Visite : ", Visite); OrdreVisite := ajoutFin(y, OrdreVisite); for z in G[y] do if Visite[z] = false then CarnetDeVisite := ajoutFin(z, CarnetDeVisite); Visite[z] := true; Distance[z] := Distance[y]+1; Pere[z] := y end if end do end do; evalm(Pere) end proc
@YounesCheikh
YounesCheikh / larg
Created October 11, 2012 19:23
Parcours en Largeur d'un Graphe
larg := proc (G, x)
local y, z, CarnetDeVisite;
global Visite, OrdreVisite;
Visite := [seq(false, i = 1 .. nops(G))];
Visite[x] := true;
CarnetDeVisite := [x];
OrdreVisite := [];
while CarnetDeVisite <> [] do
y := CarnetDeVisite[1];
CarnetDeVisite := enleve_tete(CarnetDeVisite);
s8376gdvj15r2zh70tir24jvkorj194jf1eyqbt3te27u9nbp1eqqs0
da9zadq9am6x3iyg67mqql9as2fo65vxry6h2gxxnf9rqtlz52jkndb
az26kx66ro0bm3qbqrxtt9ytyupl447r59j0elpdasm4m43hm5odl20
ktmouf4ntbtapee1876r4qc6fzrfd525zt71y35pdbevj1ezz333d7d
9rrryyky6ujs4o6xl0kcoazt2whltwm89018h8ie6ly17qn7zj4yhyy
q66fetfzyb4covcqnfy5aorl644yarerhg
<includes>
<include>${basedir}/src/java/main/jmbs/client/img/</include>
</includes>
jmbs/
jmbs/common/
jmbs/common/_RemoteServer_Stub.class
jmbs/common/Message.class
jmbs/common/Project.class
jmbs/common/RemoteServer.class < this the class not found
jmbs/common/User.class
META-INF/maven/
META-INF/maven/jmbs.common/
META-INF/maven/jmbs.common/RMI/
β”œβ”€β”€ pom.xml
β”œβ”€β”€ src
β”‚ β”œβ”€β”€ main
β”‚ β”‚ β”œβ”€β”€ java
β”‚ β”‚ β”‚ └── jmbs
β”‚ β”‚ β”‚ └── common
β”‚ β”‚ β”‚ β”œβ”€β”€ Message.java
β”‚ β”‚ β”‚ β”œβ”€β”€ Project.java
β”‚ β”‚ β”‚ β”œβ”€β”€ RemoteServer.java
β”‚ β”‚ β”‚ └── User.java