Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3005 connectés 

 

Sujet(s) à lire :
    - Who's who@Programmation
 

 Mot :   Pseudo :  
  Aller à la page :
 
 Page :   1  2  3  4  5  ..  9559  9560  9561  ..  26896  26897  26898  26899  26900  26901
Auteur Sujet :

[blabla@olympe] Le topic du modo, dieu de la fibre et du monde

n°1283284
black_lord
Truth speaks from peacefulness
Posté le 13-01-2006 à 20:13:17  profilanswer
 

Reprise du message précédent :

masklinn a écrit :

Nan mais c'est bon, c'est pas du python ça, c'est un mélange de php et de c avec la syntaxe de python :o


je suis une merde [:sisicaivrai]


---------------
uptime is for lousy system administrators what Viagra is for impotent people - mes unixeries - github me
mood
Publicité
Posté le 13-01-2006 à 20:13:17  profilanswer
 

n°1283291
ritzle
Posté le 13-01-2006 à 20:19:12  profilanswer
 

masklinn a écrit :

Nan mais c'est bon, c'est pas du python ça, c'est un mélange de php et de c avec la syntaxe de python :o


j'en sais rien, j'ai jamais vu de python :D  :D

n°1283293
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 20:22:37  profilanswer
 

black_lord a écrit :

j'ai merdé dans un copier / coller je crois :D en rajoutant les %s manquants ça va mieux [:romf]


Oui enfin c'est quand même n'importe quoi comme code, c'est illisible et inutilisable alors que tu tires tes données d'un dict :o

Code :
  1. "INSERT INTO directory (id, name, nick, mail, phone, address, zipcode, city, im, http, ftp, comment)"\
  2. "VALUES ('', '%(name)s', '%(nick)s', '%(mail)s', '%(phone)s', '%(address)s', '%(zipcode)s', '%(city)s', '%(im)s', '%(http)s')"%self.data


Et paf, ça marche et c'est quand même plus lisible [:mlc]

black_lord a écrit :

tu les fais comment tes queries ?


Tu utilises Cursor.execute que fournit ton package conforme à la DBAPI 2.0

Citation :

       .execute(operation[,parameters])  
           
            Prepare and execute a database operation (query or
            command).  Parameters may be provided as sequence or
            mapping and will be bound to variables in the operation.
            Variables are specified in a database-specific notation
            (see the module's paramstyle attribute for details). [5]
             
            A reference to the operation will be retained by the
            cursor.  If the same operation object is passed in again,
            then the cursor can optimize its behavior.  This is most
            effective for algorithms where the same operation is used,
            but different parameters are bound to it (many times).
             
            For maximum efficiency when reusing an operation, it is
            best to use the setinputsizes() method to specify the
            parameter types and sizes ahead of time.  It is legal for
            a parameter to not match the predefined information; the
            implementation should compensate, possibly with a loss of
            efficiency.
             
            The parameters may also be specified as list of tuples to
            e.g. insert multiple rows in a single operation, but this
            kind of usage is depreciated: executemany() should be used
            instead.
             
            Return values are not defined.


Parce que execute a pour boulot de sécuriser (préparer la requête) lui même ses paramètres (pas le string query, les paramètres fournis derrière) histoire que t'ais pas à t'en charger.
 
Vas donc lire http://dustman.net/andy/python/python-and-mysql, à partir de la 13e slide :o
 
Tu utilises .execute comme le string interpolation classique, mais avec des syntaxes supplémentaires:

Citation :

           String constant stating the type of parameter marker
            formatting expected by the interface. Possible values are
            [2]:
 
                'qmark'         Question mark style,  
                                e.g. '...WHERE name=?'
                'numeric'       Numeric, positional style,  
                                e.g. '...WHERE name=:1'
                'named'         Named style,  
                                e.g. '...WHERE name=:name'
                'format'        ANSI C printf format codes,  
                                e.g. '...WHERE name=%s'
                'pyformat'      Python extended format codes,  
                                e.g. '...WHERE name=%(name)s'


black_lord a écrit :

et l'id vide c'est de l'auto-increment [:jagstang]


Ben tu l'insères pas [:spamafote]  


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283299
black_lord
Truth speaks from peacefulness
Posté le 13-01-2006 à 20:26:36  profilanswer
 

masklinn a écrit :

Oui enfin c'est quand même n'importe quoi comme code, c'est illisible et inutilisable alors que tu tires tes données d'un dict :o

Code :
  1. "INSERT INTO directory (id, name, nick, mail, phone, address, zipcode, city, im, http, ftp, comment)"\
  2. "VALUES ('', '%(name)s', '%(nick)s', '%(mail)s', '%(phone)s', '%(address)s', '%(zipcode)s', '%(city)s', '%(im)s', '%(http)s')"%self.data


Et paf, ça marche et c'est quand même plus lisible [:mlc]
 
Tu utilises Cursor.execute que fournit ton package conforme à la DBAPI 2.0

Citation :

       .execute(operation[,parameters])  
           
            Prepare and execute a database operation (query or
            command).  Parameters may be provided as sequence or
            mapping and will be bound to variables in the operation.
            Variables are specified in a database-specific notation
            (see the module's paramstyle attribute for details). [5]
             
            A reference to the operation will be retained by the
            cursor.  If the same operation object is passed in again,
            then the cursor can optimize its behavior.  This is most
            effective for algorithms where the same operation is used,
            but different parameters are bound to it (many times).
             
            For maximum efficiency when reusing an operation, it is
            best to use the setinputsizes() method to specify the
            parameter types and sizes ahead of time.  It is legal for
            a parameter to not match the predefined information; the
            implementation should compensate, possibly with a loss of
            efficiency.
             
            The parameters may also be specified as list of tuples to
            e.g. insert multiple rows in a single operation, but this
            kind of usage is depreciated: executemany() should be used
            instead.
             
            Return values are not defined.


Parce que execute a pour boulot de sécuriser (préparer la requête) lui même ses paramètres (pas le string query, les paramètres fournis derrière) histoire que t'ais pas à t'en charger.
 
Vas donc lire http://dustman.net/andy/python/python-and-mysql, à partir de la 13e slide :o
 
Tu utilises .execute comme le string interpolation classique, mais avec des syntaxes supplémentaires:

Citation :

           String constant stating the type of parameter marker
            formatting expected by the interface. Possible values are
            [2]:
 
                'qmark'         Question mark style,  
                                e.g. '...WHERE name=?'
                'numeric'       Numeric, positional style,  
                                e.g. '...WHERE name=:1'
                'named'         Named style,  
                                e.g. '...WHERE name=:name'
                'format'        ANSI C printf format codes,  
                                e.g. '...WHERE name=%s'
                'pyformat'      Python extended format codes,  
                                e.g. '...WHERE name=%(name)s'


 
Ben tu l'insères pas [:spamafote]


 
 
en fait je passais ma string à execute derrière. Sinon je connaissais pas cette syntaxe avec les dicts :)


---------------
uptime is for lousy system administrators what Viagra is for impotent people - mes unixeries - github me
n°1283307
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 20:33:23  profilanswer
 

black_lord a écrit :

en fait je passais ma string à execute derrière. Sinon je connaissais pas cette syntaxe avec les dicts :)


En même temps t'as pas le choix si tu veux exécuter ta query [:moule_bite]  
 
Je te parlais de l'interpolation :o


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283309
0x90
Posté le 13-01-2006 à 20:36:34  profilanswer
 

masklinn a écrit :

En même temps t'as pas le choix si tu veux exécuter ta query [:moule_bite]  
 
Je te parlais de l'interpolation :o


 
l'interpolation marche aussi avec n'importequel object surchargeant __getitem__ ?


---------------
Me: Django Localization, Yogo Puzzle, Chrome Grapher, C++ Signals, Brainf*ck.
n°1283311
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 20:39:43  profilanswer
 

0x90 a écrit :

l'interpolation marche aussi avec n'importequel object surchargeant __getitem__ ?


Code :
  1. >>> class Foo(object):
  2.     def __getitem__(self, key):
  3.         return "bar"
  4.     
  5. >>> foo = Foo()
  6. >>> "%(test)s -- %(foo)s -- %(bar)s"%foo
  7. 'bar -- bar -- bar'
  8. >>>



 
(la doc précise "mapping", pas "dict", donc aucune raison que non)

Message cité 1 fois
Message édité par masklinn le 13-01-2006 à 20:40:13

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283324
nraynaud
lol
Posté le 13-01-2006 à 21:06:40  profilanswer
 

Citation :

[INSCRIPTION] Récéption de votre dossier d'inscription Free Haut Débit


[:uriel]
 
('tain j'ai envoyé la lettre hier [:pingouino])
 
 
edit :  

Citation :

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
 
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
 
More information about this error may be available in the server error log.
 
Apache/1.3.33 Server at adslcgi.free.fr Port 80


[:mlc]


Message édité par nraynaud le 13-01-2006 à 21:07:38
n°1283336
black_lord
Truth speaks from peacefulness
Posté le 13-01-2006 à 21:25:49  profilanswer
 

masklinn a écrit :

En même temps t'as pas le choix si tu veux exécuter ta query [:moule_bite]  
 
Je te parlais de l'interpolation :o


 
mon but avec ce petit projet c'est aussi d'apprendre à faire du python pas trop dégueu donc je risque de reposter des trucs sales [:el g]


---------------
uptime is for lousy system administrators what Viagra is for impotent people - mes unixeries - github me
n°1283340
nraynaud
lol
Posté le 13-01-2006 à 21:28:58  profilanswer
 

black_lord a écrit :

je risque de reposter des trucs sales [:el g]


comme kadreg ?

mood
Publicité
Posté le 13-01-2006 à 21:28:58  profilanswer
 

n°1283341
black_lord
Truth speaks from peacefulness
Posté le 13-01-2006 à 21:30:15  profilanswer
 

nraynaud a écrit :

comme kadreg ?


mon code risque de plus te choquer qu'un goatse [:pingouino]


---------------
uptime is for lousy system administrators what Viagra is for impotent people - mes unixeries - github me
n°1283344
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 21:32:46  profilanswer
 

black_lord a écrit :

mon but avec ce petit projet c'est aussi d'apprendre à faire du python pas trop dégueu donc je risque de reposter des trucs sales [:el g]


Ah ben fallait commencer par ça alors, j'aurais évité de gueuler comme un cochon qu'on égorge [:pingouino]

black_lord a écrit :

mon code risque de plus te choquer qu'un goatse [:pingouino]


Il s'en fout il fait pas de python :o


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283349
nraynaud
lol
Posté le 13-01-2006 à 21:38:26  profilanswer
 

black_lord a écrit :

mon code risque de plus te choquer qu'un goatse [:pingouino]


tu veux voir ce que j'ai remplacé ces 4 dernières semaines ?
 
(putain, je galère avec mon clover et mon intelliJ là [:pingouino])

n°1283352
black_lord
Truth speaks from peacefulness
Posté le 13-01-2006 à 21:46:20  profilanswer
 

nraynaud a écrit :

tu veux voir ce que j'ai remplacé ces 4 dernières semaines ?
 
(putain, je galère avec mon clover et mon intelliJ là [:pingouino])


j'ai pas peur :o


---------------
uptime is for lousy system administrators what Viagra is for impotent people - mes unixeries - github me
n°1283353
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 21:49:38  profilanswer
 

vous voulez voir du code crade ?
lundi je vous poste une saloperie made in PL/SQL (langage qui, vous en conviendrez, n'incite pas à la propreté)


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283354
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 21:53:19  profilanswer
 

Ceux qui parlaient de Business Objects la dernière fois, allez voir le dernier WTF [:dawa]


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283358
chrisbk
-
Posté le 13-01-2006 à 21:58:01  profilanswer
 

jpreferrais ta vieille signature

n°1283360
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 22:00:48  profilanswer
 

chrisbk a écrit :

jpreferrais ta vieille signature


Ouais mais faut qu'je change de temps en temps, et j'ai pas trouvé de citation marrante ces derniers temps.
 
Enfin bon tu peux aller en choisir une dans ma configuration hardware si t'aimes pas celle là, je la mettrais à la place :o


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283363
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:03:58  profilanswer
 

tiens, mes 12484 insert ne prennent plus que 13 minutes au lieu de 105 si je défragmente mon tablespace
on pourrait presque croire qu'Oracle est un SGBD performant avec ces conneries [:el g]


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283370
polo021
Posté le 13-01-2006 à 22:12:15  profilanswer
 

Bonjoir,
Vous vous y connaissez en GPS?
 
Chez Carrefour en Belgique il y a le Mio 268+ pour 289€ avec carte Benelux + grandes routes d'Europe.
Comment faire pour ajouter la carte détailler de la France? On achète le DVD et on la met sur la carte SD puis c'est bon??
 
Thks :jap:

n°1283373
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:19:04  profilanswer
 

postez tas d'cons, postez bordel !!


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283374
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 22:21:06  profilanswer
 

retourne débugger tes requêtes :o


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283375
ritzle
Posté le 13-01-2006 à 22:22:33  profilanswer
 
n°1283376
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:24:01  profilanswer
 


MP à Lam's, c'est le spé wx du forum
moi je ne m'occupe pas de cette lib pour attardés mentaux, je fais dans la lib d'homme comme MFC et Win32 [:kbchris]


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283379
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:24:43  profilanswer
 

masklinn a écrit :

retourne débugger tes requêtes :o


je vais faire ça pendant tout le week end [:el g]


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283381
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 22:26:40  profilanswer
 

Harkonnen a écrit :

je vais faire ça pendant tout le week end [:el g]


Tu l'as bien mérité :o


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283383
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:26:51  profilanswer
 

c'est coule, Sh@rdar est de retour ! la cat PHP va enfin avoir un intervenant digne de ce nom


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283385
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:28:37  profilanswer
 

masklinn a écrit :

Tu l'as bien mérité :o


tiens, j'ai fini par demander à mon chef si ça le dérangerait de migrer sur SQL Server ! réponse : "si je fais ça, tu vas te retrouver au chomage car j'aurais plus besoin de toi"
il a raison le con, MSQL n'a pas besoin de DBA à plein temps, j'avais oublié ce détail [:el g]


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283386
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 22:29:50  profilanswer
 

Harkonnen a écrit :

tiens, j'ai fini par demander à mon chef si ça le dérangerait de migrer sur SQL Server ! réponse : "si je fais ça, tu vas te retrouver au chomage car j'aurais plus besoin de toi"
il a raison le con, MSQL n'a pas besoin de DBA à plein temps, j'avais oublié ce détail [:el g]


Il déboite ton chef [:ddr555]
 
(par contre là ou il se plante c'est que Oracle n'a pas besoin de *1* DBA à plein temps :o)


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283387
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:33:05  profilanswer
 

et un listener.ora de kalitäy [:el g]
 

Citation :


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS =
          (PROTOCOL = IPC)
          (KEY = EXTPROC2)
        )
      )
      (ADDRESS_LIST =
        (ADDRESS =
          (PROTOCOL = TCP)
          (HOST = 127.0.0.1)
          (PORT = 80)
        )
      )
    )


Message édité par Harkonnen le 13-01-2006 à 22:33:25

---------------
J'ai un string dans l'array (Paris Hilton)
n°1283388
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 22:34:14  profilanswer
 

C'est un peu comme du lisp en moins bien quoi [:moule_bite]
 
(btw, si t'es aussi bon avec oracle que pour poster du code c'est pas gagné :o)


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283389
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:34:31  profilanswer
 

je vais quand même demander au nouvel admin réseau quelle mouche l'a piquée de foutre le listener sur le port 80 [:roane]


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283391
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:36:09  profilanswer
 

masklinn a écrit :

C'est un peu comme du lisp en moins bien quoi [:moule_bite]
 


ué, mais la ce qu'il faut remarquer, c'est :
- la machine écoute les connections sur elle même
- et elle les écoute sur le port 80 au lieu du port par défaut d'Oracle (1521)
[:el g]


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283395
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:41:16  profilanswer
 

Citation :


Xav > c'est toi qui a mis le port d'écoute Oracle sur le 80 ?
admin > oui
Xav > et pourquoi t'as pas laissé le 1521 ?
admin > parce que le 80 était déjà ouvert  
Xav > et alors ???
admin > et alors, ça m'évite d'ouvrir le 1521
Xav > mais en quoi ça gène d'ouvrir le 1521 enfin ???
admin > en fait, je sais pas du tout comment on ouvre un port


[:pingouino] [:roane]

Message cité 1 fois
Message édité par Harkonnen le 13-01-2006 à 22:41:43

---------------
J'ai un string dans l'array (Paris Hilton)
n°1283397
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:44:29  profilanswer
 

non mais spapossib, il a trollé, je vois que ça


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283398
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:45:20  profilanswer
 

moment --> j'apprends à un admin réseau à forwarder un port sur le routeur <--


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283400
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:45:54  profilanswer
 

antifloude


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283401
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:46:05  profilanswer
 


merci :o


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283402
masklinn
í dag viðrar vel til loftárása
Posté le 13-01-2006 à 22:47:43  profilanswer
 

Harkonnen a écrit :

moment --> j'apprends à un admin réseau à forwarder un port sur le routeur <--


C'est quoi ta boite, avec un peu de bol même tholdan ils le prennent [:el g]


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1283403
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:48:28  profilanswer
 

masklinn a écrit :

C'est quoi ta boite, avec un peu de bol même tholdan ils le prennent [:el g]


ben il doit être à peine plus vieux que Tholdan en fait [:el g]


---------------
J'ai un string dans l'array (Paris Hilton)
n°1283404
Harkonnen
Modérateur
Un modo pour les bannir tous
Posté le 13-01-2006 à 22:49:59  profilanswer
 

tu m'étonnes que depuis quelques jours j'accédais au web par intermittence ! avec le 80 vampirisé par Oracle et ces cons d'users qui n'arrètent pas de bosser, je pouvais toujours me le mettre profond


---------------
J'ai un string dans l'array (Paris Hilton)
mood
Publicité
Posté le   profilanswer
 

 Page :   1  2  3  4  5  ..  9559  9560  9561  ..  26896  26897  26898  26899  26900  26901

Aller à :
Ajouter une réponse
 

Sujets relatifs
Plus de sujets relatifs à : [blabla@olympe] Le topic du modo, dieu de la fibre et du monde


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)