samedi 4 janvier 2020

Virtual memory harware and direct access (by the rank)

In some case it is interesting to access data directly by the rank(I use this method in the hash.c module  in the ec chess engine (chess-ec.com)

In some case it could happen that much bigger memory is needed and only a very small part would be used(64 chess-board fields only 32 pieces).

It could be interesting (and perhaps it already exists) to have a   virtual memory hardware that can handle this.

I just present what I have in mind  . The concept could be tested  with software but should be an  electronic device (PCI or special Ram).

Suppose that I have data and the index to access this data  is a very big number:  I couldn't reserve enough memory in a computer to access this table.

When retrieving data from memory I suppose a computer send the address  of the data it wants.
The memory controller  receiving the address could transform it in some kind of signature that fit the available size. (the size of the real memory). I think it is usually done with the modulo operation.

The "big" address  could be stored along with the data to verify if there is a "collision" . A link address could give another memory address (having the same "big" address signature).

It could be even used for data base. The main Cpu would compute a numeric signature from a string (hardware computation) send the signature as memory address  to the virtual memory but I don't how it could handle the table row (variable length).

jeudi 2 janvier 2020

Moi , GNU et la FSF

Je n'ai pas passé beaucoup de temps à étudier le mouvement GNU / FSF
Site GNU
Wikipedia GNU/FSF.

Souvent on me reproche de le soutenir, en particulier à cause de nombreux membres se considérant comme Marxistes et donc plus au moins proche des mouvement communistes (ou ce qu'il en reste). Je ne suis pas communiste, et je n'ai jamais pris le temps d'étudier le Marxisme. Je ne le regrette pas parce que j'estime que tous les régimes (sans exception) qui s'en sont inspiré ont échoué sur le plan économique. Ils ont -aux moins- été incapable de résister à la vague capitaliste.  Mais je soupçonne fortement que l'écroulement est du principalement à une cause interne liée à la nature du Marxisme.

Cela dit, il faut savoir que l'organisation FSF/GNU est une association caritative reconnue par l'état Américain et les dons à cette association sont déductibles des impôts aux US. Si cette association présentait un danger politique pour le pays je  ne crois pas qu'une telle mesure fiscale aurait été acceptée. Maintenant, si ont est un peux paranoïaque, on peut se poser la question  du véritable jeux mené par cette association. Les critiques ne manquent pas, même au sein du monde du logiciel libre pris au au sens large. J'ai lu il y a plusieurs années un courriel émit par des avocats liés à RedHat. Si j'ai bien compris, le choix de la Licence GNU et le refus de déposer des brevets favorise les adversaires de GNU.  On ne peux se battre à armes égales sur un marché concurrentiel avec cette licence.

La politique de GNU devrait-elle être de viser à devenir une système unique dans le monde du logiciel? J'ai peur que cet objectif ressemble trop à la tactique utilisée par certains pays d'inspiration Marxiste: pour survire, la seule solution c'est que tous le monde soit comme nous. Mois aussi, parfois, j'aimerais  que tous le monde soit dyslexique ou légèrement autiste.

Je crois à un monde diversifié et je pense que le système GNU devrait trouver et avoir une place dans le  monde d'aujourd'hui. Mon opinion est que cela devrait être l'objectif principal de l'association. Comment s'insérer dans notre économie et proposer une alternative utile.

J'ai reçu de nombreux courrier de GNU présentant ces activités et je trouve que les critiques émises par l'association et les mouvements de protestation  contre DRM par exemple ne sont pas assez argumentés. Je suis plutôt pour une alternative à DRM pas à sa suppression.

On peut se poser la question de savoir si favoriser les éléments les plus extrémistes et peut-être les plus généreux (en terme d'apport concret à l'association) ne serait pas un moyen de détruire à long terme l'association. Si oui il faudrait alors augmenter le nombre de modérés dans le noyau de l'association.

Je vais continuer d'apporter ma très modeste contribution financière à FSF/GNU, parce que je suis content d'utiliser des logiciels sous licence GNU. Maintenant si le logiciel que j'ai publié sous licence GNU est utile et sert à tous le monde, tant mieux. Mais je n'en ai pas la preuve.

Les seuls retours que j'ai, sont des réflexions dans la rue de personnes qui  ne se présentent pas ni ne donnent la preuve de  ce qu'ils affirment:

-- "Algorithme, ayant un impact sur le PIB".
-- "Tout le monde est à égalité".
-- "l'Algorithme est transparent".
--"C'est important".
-- "Il aurait gagné".
-- "Il est con, il aurait pu gagner sa vie avec le logiciel qu'il a conçu".
-- "C'est un bienfaiteur mondial".
-- "Ils ont découvert plusieurs médicaments à cause de lui".
-- "J'ai été obligé de modifier la théorie mathématique à cause de lui".

Parfois des "hallucinations" liées à l'utilisation de technologies internet:
-- On s'est demandé s'il fallait le tuer à cause des implications militaires. Mais les avantages en dehors de la sphère militaire étaient tels qu'on a pensé qu'il fallait "laisser faire".
-- Un grand astrophysicien: "Cela n'est pas possible". Puis quelque mois plus tard: "Je me suis trompé". Et les infos vagues concernant la modification de la théorie mathématique suivent.
   
Et récemment dans un bar à Quimperlé:
-- "Tu ne te rends pas compte de ce qu'il nous a offert".

A force de matraquage avec un chant des sirènes aussi séduisant, les risques d'y croire augmentent. Il n'est pas étonnant que je sois devenu légèrement paranoïaque à moins biens sur que tout cela ne soit seulement la manifestation d'une paranoïa et d'une  schizophrénie déjà existante.

lundi 18 novembre 2019

bash headhach

[dechicom@x220f28 list]$ a="\"er gh ";b="$a";c="$b";echo "$a" "$b" "$c"

"er gh  "er gh  "er gh

# name=xx (for information)

[dechicom@x220f28 list]$ eval $name="'"$a"'"

# very hapyy it works !

[dechicom@x220f28 list]$ eval echo $$name 
"er gh

[dechicom@x220f28 list]$ a="\"er \' \` gh ";b="$a";c="$b";echo "$a" "$b" "$c"

"er \' ` gh  "er \' ` gh  "er \' ` gh 

# does it?

[dechicom@x220f28 list]$ eval $name="'"$a"'"
bash: unexpected EOF while looking for matching ``'
bash: syntax error: unexpected end of file

# I am  pissed of !!!

[dechicom@x220f28 list]$ eval name="'""$a""'"
bash: unexpected EOF while looking for matching ``'
bash: syntax error: unexpected end of file

# still have time before going to bed with little caprice: trying not escaping the '

[dechicom@x220f28 list]$ a="\"er ' \` gh ";b="$a";c="$b";echo "$a" "$b" "$c"
"er ' ` gh  "er ' ` gh  "er ' ` gh 

[dechicom@x220f28 list]$ eval $name='$a'

[dechicom@x220f28 list]$ eval echo \$$name 
"er ' ` gh


# So what do I have to escape? Everythig but '?
# Perhaps nothing but the ". Will see tomorrow with blue angel: nasty nasty nasty, control control control!

#after one day, still in wonderland!

[dechicom@x220f28 list]$ c='"';a='\';b="'";echo $c $a $b;[[ $c=$a || $c=$b ]] && echo true
" \ '

true

# This time I will need veronica Rodriguez.

[dechicom@x220f28 list]$ if [[ "a"="b" ]]; then  echo true; fi
true
[dechicom@x220f28 list]$ if [[ "a" = "b" ]]; then  echo true; fi

[dechicom@x220f28 list]$ 


# Thank you dear.I'll call you again.But...


[dechicom@x220f28 ~]$ a='\''

> ^C
# How is it possible not to allow escaping the '? This time, I am not sure Veronica will help. I am nearly dead.

#I would have bet it is possible to do:
a='"ggg $a \\    ` \'mm'
# So I don't see any way to protect any string with printable char's against substitution. 

# I will need somebody very patient now. Perhaps Maria Rya. Will see...

#another attempt escaping everithing and unsing "" instead:

#!/bin/bash
function pre_protect (){
    name2="$2"
    typeset  size
    size=${#1}
    typeset -i i
    typeset c
    typeset out
    for (( i=0; i<$size; i+=1 ))
    do
eval c="\${1:$i:1}"
c="\\$c"
out+="$c"
    done
    eval $name2="\""$out"\""
    set +o xtrace

   }

#
[dechicom@x220f28 list]$ . ./csv.sh; a="\$a't'y "; pre_protect "$a" b; echo "--->$a<---" "---->$b<----"; eval echo "$b"; echo $a;
--->$a't'y <--- ---->$\a\'\t\'\y\ <----
$a't'y 
$a't'y

# No  I need Brea Brenet

I suppose that, when trying to resolve such problems, programmers decide to switch to python or perl.

But why bash wouldn't  allow us to do more things? Is it possible to create a new eval command that would allow to do such thing without to have to protect the data  that are copied from. Using a special variable name prefix  instead of '$' ? Perhaps a new eval isn't the solution, and we just need indirection (!) that works with array elements? But we have still a problem on the left side ot = (in eval t[3]=$aa).

And I liked also to transfer data between variable without making a copy: aa --> bb.
trans aa bb  # with the option of "unsetting" the origin and working with array. If we don't use array we can use typeset -n name=variablename. I use it to avoid copying data with function arguments.

I think it's possible but I don't have enough knowledge and time to experiment a "fork" of bash.

The reason I say so, is the cost of fork when  calling  programs from within bash and the cost of pipes. Making hour own tools (sort tr .....). Another solution would be to load c library in bash . So we could choose which solution is the best for performances or functionalities.

I  have another idee: offer the possibility for a langage c pgm to be loaded and used as shareable function library in bash. We could simply compile the pgm with a special option or create a format like ELF that would allow it. So we wouldn' have the unix system limitation: one program<->one process. With the AS400 we could have a stack of pgms within the same process, but they were also limitations like the same pgm could no being present  multiple time in the same stack .

I don't know if it is possible, but it would be very wellcome!

function pre_protect (){

    typeset -n __in="$1"
    typeset  size=${#__in}
    typeset -i i
    typeset c
    typeset __out
    for (( i=0; i<$size; i+=1 ))
    do
c=${__in:$i:1}
__out+="\\$c"
echo "__out --$__out--"
    done
    __in="$__out"
    set +o xtrace
}

[dechicom@x220f28 list]$ . ./csv.sh; a="'''\$\"tt\"!"; b=$a; pre_protect "a"; echo "--->$a<---" "---->$b<----"; eval echo "a--$a--"; echo "b--$b--";
__out --\'--
__out --\'\'--
__out --\'\'\'--
__out --\'\'\'\$--
__out --\'\'\'\$\"--
__out --\'\'\'\$\"\t--
__out --\'\'\'\$\"\t\t--
__out --\'\'\'\$\"\t\t\"--
__out --\'\'\'\$\"\t\t\"\!--
--->\'\'\'\$\"\t\t\"\!<--- ---->'''$"tt"!<----
a--'''$"tt"!--
b--'''$"tt"!--



#better, but  need more testing

I want to explain why I need this tool . I am not a good programmer with bash, perhaps I haven't spend enough time reading documentation. But I suppose a lot of peopple got these trouble too. A howto about eval and some tool writen in bash would be welcome. For exemple how to avoid using eval (for newbee) and if it is unavoidable how to use it.

Let see another problem that require eval (on the left side of "=" )

[dechicom@x220f28 list]$ a=t   
[dechicom@x220f28 list]$ i=3
[dechicom@x220f28 list]$ !a[!i]=5
bash: !a[!i]=5: event not found

# it would be very nice to allow this. Is there a bash-core-design that make it unpossible or very hard to allow? 

[dechicom@x220f28 list]$ $a[!i]=5
bash: t[!i]=5: command not found

[dechicom@x220f28 list]$ eval $a[!i]=5
# no error message but it hasn't worked

[dechicom@x220f28 list]$ echo ${t[3]}

[dechicom@x220f28 list]$ a=t; i=7;eval $a[$i]=55;echo ${t[7]};
55
# this time it worked and it is not very risky  because array name don't allow any characters and index are numbers.

#after spending a lot of time with Franziska Facella (They say she is out of business), it seems to be that there is no need to pre_protect a variable before using eval. This is the fault of people saying constantly over internet, that we have to quote variables for our own good ("$var"). There is no need to quote when your are assigning an only variable  to an array or another variable. Whatever ever; after getting more experienced I still have difficulties using eval. Some methods must be learned for good to avoid confusion and bugs. I will publish some code that gives exemples. I needed much time to do it.  So I hope you will be leniant.

# The solution to avoid "protecting" a variable for eval use is :use only one variable argument and if needed, build this variable in several steps):

[dechicom@x220f28 list]$ a="\$a't'y ";b=$a; eval_string="echo \$a" ; eval $eval_string ; echo $b;
$a't'y 
$a't'y 
# I haven't seen this solution proposed in any document about bash. As I allready said I haven't read enough. I think this simple solution should be written in the reference documentation. Is It ?

#perhaps pre_protec can be useful in some other case,

# Special thanks to Casey Chase one of my beloved actress.

# In this experimentation, the result is so astonishing that I might get the nobel Prize!

#!/bin/sh
# this is the tda.sh script!
printf "a<<%s>>\n" $1
printf "b<<%s>>\n" $2

exit 0 # very optimistic!

[dechicom@x220f28 test]$ a=$(echo -e"\$a'\nt'y \\\t\t x");b=$a;echo -e $a;echo -e $b; echo "------"; eval_string="./tda.sh \"\$a\" \"\$b\" " ; eval $eval_string 
-e$a'
t'y \t x
-e$a'
t'y \t x
------
a<<-e$a'\nt'y>>
a<<\\t\t>>
a<<x>>
b<<-e$a'\nt'y>>
b<<\\t\t>>
b<<x>>

# Am I  seeing an pink Elephant? It is Anjelica (Kristal boyd) fault. She should have said me that the printf (the bash builtin) consume all the arguments. This is not a bug!
# So I am still searching a way to pass arguments to a pgm in a safe way.
# For the moment no problems with variable assignation (it seems) and function arguments (using typeset -n) after passing an argument with the variable name  as a pointer. 

# I hope I have found the solution now. Anjelica should be punished! I will talk to rocco about this!

#!/bin/sh
# this is the tda.sh script!
printf "a<<%s>>\n" "$1"
printf "b<<%s>>\n" "$2"


exit 0 # very optimistic!

[dechicom@x220f28 list]$ a=$(echo -e "\$a'\n\"t'y कु \\\t\t x");b=$a;echo "a<<$a>>";echo  "b<<$b>>"; echo "------"; ./tda.sh "$a" "$b" ; echo "========";eval_str="./tda.sh \"\$a\" \"\$b\""; eval "$eval_str";
a<<$a'
"t'y कु \t x>>
b<<$a'
"t'y कु \t x>>
------
a<<$a'
"t'y कु \t x>>
b<<$a'
"t'y कु \t x>>
========
a<<$a'
"t'y कु \t x>>
b<<$a'

"t'y कु \t x>>

# Rocco says "she has already been enough punished by me!" 

# It might be dangerous to go through the mirror so often!
# perhaps I need treatment?

So, if I dont' want to ge t fucked by bash, I might work in  two ways:
-- getting an "intimate" understanding of the bash interpreter by experimenting and reading documentation. It might take a lot of time .... 
-- try to get or build some simple,basic rules that allow to work safely with datas using variable, quotes and eval. 

I suppose, some people like me, have used bash a lot of time without knowing what it would cost them to use its full potential.


I have been working with the GNU core utilities for a long time, I think tools like grep or sed are very powerful. I am not an expert at all using them. I sometime spend a long time without using them. So I forget the syntax. Not able to understand code I didn't write or even my own code.  For example there is again a problem knowing whether a character is a control character and if it needs to be escaped. I will perhaps try to use Yacc to translate these complex grep expressions in something more understandable. Perhaps somebody has already done it . I think grep expression should be allowed to be written in both manners and that they should even allow us to translate a form in an other. 
About the GNU project: I don't think that opening source is enough, we must also find ways -when it is possible- to ease working with the tools. Some people might find that proposing powerful tools -but very hard to use tools- is a sign that those people don't really want to share their knowledge. Or they simply don't know. It might be wrong of course: it might simply be that, if they are not able to use these tools they should better find another occupation.

Another word about reference documentations: It is also very hard for me to use them in order to start learning how to use the tools. I would deter people to use them  as a first step if they can find a good HOWTO or a good book. These pedagogic documents should be proposed everywhere in the GNU documentation. And people having the talent to produce these documents should be helped and praised by the GNU project. This talent being: the ability to make us learn the most important concepts in the easiest way  possible.  The Talent also to give us a glimps of the power of the tools and the envy to know more. I find it difficult to learn using code if I can't test an example of it. I am never completely sure I have understood what I have read. So it is better if I don't memorize immediately what I read.  


dechicom@x220f28 bashcript]$ a="$(printf "\nff\n\ngg\n\n""")" ; printf  "$a"

ff

gg[dechicom@x220f28 bashcript]$ a="$(printf "\nff\n\ngg\n\n""t")" ; printf  "$a"

ff

gg

t[dechicom@x220f28 bashcript]$ a="\nff\n\ngg\n\n""t" ; printf  "$a"

ff

gg

t[dechicom@x220f28 bashcript]$ a="\nff\n\ngg\n\n""" ; printf  "$a"

ff

gg


[dechicom@x220f28 bashcript]

I will ask Gina Divine if she can help me. She says: "You should work harder. You are too lasy"

[dechicom@x220f28 bashcript]$ a=$(printf "%q" "\nff\n\ngg\n\n") ; eval printf  $a

ff

gg


[dechicom@x220f28 bashcript]

You are right Gina. This is not a quantum mechanic!  You should work as a counselor even if you are working mostly a a nurse.


I just try to get all the 256 ASCII characters (but null)  from the decimal code and then go back to the decimal code from the generated characters with bash exclusively.

jeudi 2 mai 2019

l’INSEE et la création d'entreprise.

En jetant un coup d' œil sur  le programme des Bac Pro Commerce j'ai voulu par curiosité essayer de trouver une information de base sur le site de l'INSEE: revenue annuel des ménages par CSP ou PCS et IRV. Après pas loin d'une heure sur le site de l’INSEE je n'ai pu trouver ces informations.

Je suppose donc qu'il est préférable de s'adresser à d'autre organisions. Comme par exemple les associations interprofessionnelles qui vous demande de vous cotiser. 

Si vous avez un projet vague , une idée que vous voulez étudier, vous n'aurez probablement pas les moyens de payer les sommes nécessaire avant et pendant le démarrage de l'entreprise que vous créez. 

Cela me semble anormal si  ces données sont  théoriquement disponibles à tous. 

C'est à mon  avis un exemple du verrouillage qui existe en France dans le domaine de la création d'entreprise.

dimanche 14 avril 2019

Les Documents électroniques

On aurait pu penser que la gestion des documents électroniques aurait du nous simplifier la vie.
Dans la pratique je ne trouve pas du tout que cela soit le cas en ce qui concerne l'archivage.

Il faut bien sur prendre le fait que je suis loin d'être un expert pour la gestion administrative.

Je fais donc une liste des problèmes rencontrés:


-- Pas de nom de fichier standardisés permettant de trier facilement les documents.

 Pour un bulletin de salaire j'aurais aimé par exemple avoir un nom basé sur la liste ordonnée d'informations suivante:
.. Date de période de travail  (2019 03)  et non pas la date de téléchargement.
.. Salaire ou Bulletin_Salaire (indiquant que c'est un bulletin de salaire)
.. Nom de l'employeur
 .. type de fichier (par exemple ".pdf")

Pour un contrat de travail :
.. Date de début du contrat
.. Contrat ou contrat_Travail (indiquant que c'est un contrat de travail)
.. Nom de l'employeur
.. Nom de l'entreprise servie (si c'est de l’intérim)

Pas de possibilité de centraliser tous nos documents dans un site choisi. C'est à dire que c'est un libre choix que les employeurs aient leur propre site de stockage des documents mais ils devrait tous offrir un moyen d'envoyer automatiquement une copie des document vers un site de notre choix. Peut-être même un Protocol de transmission dérivé de ftp devrait être créé à cet effet pour garantir la sécurité et l'accès (cryptage, traçage et journalisation  permettant la reconstruction des données, application dédié de gestion d'archive administrative pour le grand publique.)

Pour les factures je n'ai pas réfléchis mais cela devrait aussi exister. Sur les grand site d'achat internet il faut même parfois demander spécifiquement à chaque achat le document à la boutique. C'est donc encore pire.

Je pense aussi qu'une loi devrait --de manière souple -- obliger  les organisation émettrices de document important à fournir un service minimum standard. Par exemple une liste ouverte de format de nom de fichier devrait être crée.

Dans un pays qui se targue d'être à la point pour la gestion administrative cela me semble  tout a fait anormal.

Je propose aussi différente solutions qui permettrait de facilité la gestion des documents:
 -- le format pdf pourrait contenir le nom original du document et devrait aussi permettre de le régénérer sous différents format.
-- le nom du document devrait aussi être imprimé sur un document de manière à être généré automatiquement avec le format choisi si on le scan.
-- la localisation du document à sa source pourrait être aussi incluse dans le document pour l'identifier et le retrouver avec un format identique à l'URL.
-- formater la version imprimée du  document de manière à facilité la reconnaissance de caractère par le scanner et permettant de repasser à une version entièrement électronique du document.

Aujourd'hui aucune des ces fonctionnalités ne semble être facilement proposée au utilisateur de bulletin de salaire. Je n'ai pas été non plus informé d'une telle possibilité.

J'en profite aussi pour parler des gestionnaires de fichiers  qui ne permettent pas à mon avis une gestion effective des documents:
.. lourdeur si on veut renommer plusieurs document manuellement  : on doit cliquer droit pour chaque fichier, on ne peut facilement revenir en arrière comme pour un document texte
.. pas de possibilité de visualiser plusieurs répertoires comme une seul et de faire facilement des tris et sélections sur un ensembles de répertoires.

mardi 26 février 2019

Credit mutuel de bretagne et la vie privée

Bonjour

je suis content d'avoir cette application à ma disposition. ( bud'jet)

Malgré tout il me semble anormal.

-- que vous cherchiez à accéder à mes contacts et d'autres informations inutiles pour cette application et si elles sont utiles alors il faudrait en expliquer la raison. Bien que vous cherchiez notre consentement je considère cela comme une tentative d'atteinte à ma vie privée. Et un indice montrant la malveillance. 

-- que une date soit nécessaire pour tester si le solde est supérieur à une limite.
Vous préférer semble-t-il pouvoir bénéficier d'un compte largement créditeur. Nouvel indice.

-- que les alertes emails ne soient pas transmises pendant la nuit. Une option devrait être possible car tout le monde reçoit des emails à toute heure.

Merci de soumettre à l'analyse ces premiers commentaires.

Marc

Message non contractuel

samedi 23 février 2019

Pole emploi et les courriels d'offres d'emploi.

J'ai créé trois recherches d'offre  d'emploi :

-- manutention.
-- agent de fabrication.
-- agent de nettoyage.

Pour ces trois types d'offres j'ai été obligé d'utiliser l'assistance d'un agent de pole emploi pour créer et enregistrer les trois  recherches d'annonces.
Il m'a semblé extrêmement difficile voir impossible de trouver les codes métiers correspondant tout seul: N1105, H2102, K2204.

Une fois les recherches enregistrées j'ai demandé un envoi journalier par courriel. Au bout d'un moment voyant la liste se raccourcir je suis allé sur mon espace pole emploie pour consulter directement les offres et m’apercevoir qu'en fait pole emploie n'envoie plus qu'une partie des annonces.

Quelle utilité il y a-t-il a nous envoyer des liens directs sur les annonces à partir du courriel si la liste  ne comporte que les dix premières annonces ? Autant envoyer un lien sur la liste des annonces correspondantes à la recherche qui a été enregistrée. De plus il serait aussi possible de trier ces annonces dans l'ordre ou elles sont apparue de manière que les annonces que nous avons déjà consulté ou auxquelles nous avons déjà postulé apparaissent en dernière position.