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
#!/usr/bin/env ruby | |
array, places = [1,2,3,8,5,8,0,4], [] | |
puts "Maximum value of array is #{array.max.to_s}" | |
array.each_with_index do |val,i| | |
places << i if val == array.max | |
end |
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
#!/usr/bin/ruby | |
$pronoms = [ "je", "tu", "il/elle", "nous", "vous", "ils/elles" ] ; | |
terminaisons_1 = [ "e", "es", "e", "ons", "ez", "ent" ] ; | |
terminaisons_2 = [ "is", "is", "it", "issons", "issez", "issent" ] ; | |
def conjugate(verb, terminaisons) | |
puts "\nLes formes du verbe " + verb + " au présent de l'indicatif sont :\n" | |
inf = verb.gsub(/.{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
#!/usr/bin/env ruby | |
array=[1,2,0,3,3,5,0,4] | |
value_to_search = 3 | |
total = 0 | |
# ruby one-line | |
array.each { |value| total += 1 if value == value_to_search} | |
# ruby multiple |
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
#!/usr/bin/env perl | |
use strict ; | |
use locale ; | |
my @table=(1,2,3,8,5,8,0,4) ; | |
my @places ; | |
my ($index,$value) ; | |
# Max value |
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
#!/bin/bash | |
#!/bin/bash | |
iconv -f iso8859-1 -t utf-8 \ | |
2> log.karoSegment-id001 \ | |
| sed -f ./tex2utf.sed \ | |
2> log.karoSegment-id002 \ | |
| /usr/bin/perl \ | |
-pe 's!>!>\n!g' \ |
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
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use utf8; | |
# Try with and without the folowing | |
binmode(STDOUT, ":utf8"); | |
use Cwd; | |
chdir $ARGV[0]; | |
print cwd() . "\n"; |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my @file = ("med.txt"); | |
&columnize(@file); | |
sub columnize { | |
foreach my $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
#!/usr/bin/env ruby | |
etudiants = ["Name1", "Name2", ... , "Namen"] ; | |
def extract(etudiants) | |
random_number = rand(etudiants.length) | |
etudiant = etudiants[random_number] | |
return etudiants.delete(etudiant) | |
end |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
vim = [ | |
"Ma configuration Vi / Vim / gVim - theClimber", | |
"Chapitre 16. Vim : un éditeur de texte", | |
"Ultimate Vim Config | Steve Francia's Epic Blog", | |
"Vim - Configuration complete (Page 1) / Logiciels éducatifs ...", | |
"vim - Documentation Ubuntu Francophone", | |
"The ultimate Vim configuration - vimrc", |
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
# /etc/X11/xorg.conf.d/50-joystick.conf | |
Section "InputClass" | |
Identifier "joystick catchall" | |
MatchIsJoystick "on" | |
MatchDevicePath "/dev/input/event*" | |
Driver "joystick" | |
Option "StartKeysEnabled" "False" | |
Option "StartMouseEnabled" "False" | |
EndSection |
OlderNewer