Search Results

Search found 5136 results on 206 pages for 'comment bot'.

Page 14/206 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Comment améliorer le temps de compilation pour C/C++ ? Apple propose un système de modules pour remplacer les en-têtes

    Comment améliorer le temps de compilation pour C/C++ ? Apple propose un système de modules pour remplacer les en-têtes Un des problèmes assez décriés des langages C et C++ est le temps de compilation, qui est un peu plus long. Cela est surtout dû à l'utilisation des en-entêtes (headers). Les développeurs d'Apple viennent de proposer un document assez intéressant qui introduit un système de modules pour C et C++ afin d'améliorer le temps de compilation. À titre d'exemple, Apple cite le minuscule code source de « Hello world » en C : quatre lignes de code seulement. Pourtant, le fichier d'en-tête nécessaire pour sa compilation est 173 fois plus grand que l'application elle-m...

    Read the article

  • L'exécution d'applications Web est ralenti sous iOS 4.3, comment ce problème peut-il être résolu ?

    Le rendu d'applications Web est ralenti sous iOS 4.3, comment ce problème peut-il être résolu ? Mise à jour du 18.03.2011 par Katleen Si vous faîtes parti des pionniers de la mise à jour qui sont déjà passés à iOS 4.3, dont la sortie est très récente, peut-être avez-vous remarqué quelques dysfonctionnements ? En effet, suite à divers plaintes et remarques déposées en ligne par des utilisateurs mécontents, les regards se sont tournés vers le système d'exploitation mobile qui semble mal s'en tirer avec les applications Web, au niveau de la fluidité. Une information qui vient d'ailleurs d'être confirmée par Apple, dont le porte-parole Trudy Muller a expliqué que les applications en ligne ...

    Read the article

  • Un bug de la barre de recherche de Chrome 20 fait croire à un malware, comment y remédier

    Un bug de la barre de recherche de Chrome 20 fait croire à un malware Comment y remédier Depuis sa version 20, Chrome contient un bug assez ennuyeux : la barre de recherche mène automatiquement sur une page blanche. Le 1er réflexe de nombreux utilisateurs a été de penser que ce comportement était dû à un nouveau malware. En fait, il n'en est rien. Si vous faîtes partie de ceux qui se sont inquiétés, rassurez vous. La solution temporaire est très simple ? bien que laborieuse. Il suffit de supprimer "blank.html" de l'URL générée. Cette solution a été trouvée après 116 messages sur le Google Group dédié au problème. [IMG]http://ftp-developpez...

    Read the article

  • Comment les constructeurs répartissent-ils leurs dépenses pour les composants de leurs smartphones ? Un tableau interactif le montre

    Comment les firmes répartissent-elles leurs dépenses pour les composants de leurs smartphones ? Un tableau interactif le montre La firme américaine Tableau Software propose un tableau interactif qui permet d'en savoir plus sur les dépenses des firmes pour la fabrication de leurs smartphones. Si le prix moyen de la conception est assez semblable d'un modèle à l'autre, en revanche la façon dont les entreprises répartissent leurs dépenses varie de l'un à l'autre, et en fonction des composants. Par exemple, Apple fait les plus grosses dépenses pour les coques de ses téléphones ; Nokia ne compte pas lorsqu'il s'agit d'objectif caméra, etc. Source :

    Read the article

  • Comment l'analyse statique moderne peut-elle faciliter la vie des développeurs ? Découvrez la solution de Coverity, utilisée par le CERN

    Webinar : comment l'analyse statique de dernière génération peut-elle faciliter la vie des développeurs ? Découvrez la solution de Coverity, utilisée par le CERN Dans un monde où un bug mineur peut avoir des effets dévastateurs, les outils d'analyse statique d'ancienne génération s'avèrent souvent incapables de détecter les vrais défauts de code, difficiles à identifier. Mais des outils modernes d'analyse statique de code existent, permettent de détecter ces défauts critiques et potentiellement dommageables tôt dans le cycle de développement, permettant ainsi de réduire les coûts, les délais et les risques liés aux erreurs logicielles. Coverity Static Analysis est l'une de...

    Read the article

  • Get Your Google Back : Google ne veut pas perdre ses utilisateurs sur Windows 8 et explique comment retrouver son univers sous l'OS

    Get Your Google Back : Google ne veut pas perdre ses utilisateurs sur Windows 8 et explique comment retrouver son univers sous l'OS Windows 8 est disponible depuis quelques jours avec de nouveaux PC et tablettes sous le nouveau système d'exploitation de Microsoft. Les possesseurs d'une version de l'OS ont certainement remarqué la mise en avant de Bing et Internet Explorer 10 qui sont respectivement utilisés comme moteur de recherche et navigateur par défaut. Un geste qui ne doit certainement pas être vu d'un bon oeil par les éditeurs des solutions concurrentes. Google, pour sa part, a déjà réagi en mettant au point un moyen de faire retourner ses solutions sur Windows 8.

    Read the article

  • Team Foundation Server : Microsoft organise un WebCast gratuit sur comment structurer son contrôleur de source avec TFS le 1 décembre à 10h

    Team Foundation Server : Microsoft organise un WebCast gratuit sur comment structurer son contrôleur de source avec TFS le 1 décembre à 10h Team Foundation Server 2010 (TFS) est un outil de travail collaboratif accompagnant la suite Visual Studio Team System(VSTS) L'outil automatise le processus de livraison des applications et met à la disposition du développeur, des ressources dont il a besoin pour gérer efficacement les projets informatiques et leur cycle de vie. TFS permet entre autre : la gestion des sources, celle des builds, le suivi des éléments de travail, la planification et l'analyse des performances. Microsoft organise un WebCast gratuit en direct, dénommé « T...

    Read the article

  • Comment stimuler la présence des femmes dans l'IT ? Elles ne représentent que 35% des effectifs

    Mise à jour du du 02.04.2010 par Katleen Comment stimuler la présence des femmes dans l'IT ? Elles ne représentent que 35% des effectifs Et voici de nouveau la seule femme de l'équipe news qui va, encore une fois, vous parler de la situation de la gente féminine dans les milieux informatiques professionnels. Le site de recrutement anglais IT Job Board vient de publier une étude surce sujet. En Europe, seulement un tiers des salariés en informatique sont des femmes (soit 35% des effectifs). De plus, ces dernières ne sont pas satisfaites de leur conditions de travail, dont elles pensent qu'elles pourraient être améliorées. 51 % des femmes interrogées en Angleterre c...

    Read the article

  • mcsCustomscrollbar append new content not working

    - by Dariel Pratama
    i have this script in my website. $(document).ready(function(){ var comment = $('textarea[name=comment_text]').val(); var vid = $('input[name=video_id]').val(); $('#add_comment').on('click', function(){ $.post('<?php echo site_url('comment/addcomments'); ?>', $('#comment-form').serialize(), function(data){ data = JSON.parse(data); if(data.userdata){ var date = new Date(data.userdata.comment_create_time * 1000); var picture = data.userdata.user_image.length > 0 ? 'fileupload/'+data.userdata.user_image:'images/no_pic.gif'; var newComment = '<div class="row">\ <div class="col-md-4">\ <img src="<?php echo base_url(); ?>'+picture+'" class="profile-pic margin-top-15" />\ </div>\ <div class="col-md-8 no-pade">\ <p id="comment-user" class="margin-top-15">'+data.userdata.user_firstname+' '+data.userdata.user_lastname+'</p>\ <p id="comment-time">'+date.getTime()+'</p>\ </div>\ <div class="clearfix"></div>\ <div class="col-md-12 margin-top-15" id="comment-text">'+data.userdata.comment_text +'</div>\ <div class="col-md-12">\ <div class="hr-grey margin-top-15"></div>\ </div>\ </div>'; $('#comment-scroll').append($(newComment)); $('#comment').modal('hide'); } }); }); }); what i expect when a comment added to the DB and the PHP page give JSON response, the new comment will be added to the last line of $('#comment-scroll'). #comment-scroll is also have custom scroll bar by mcsCustomscrollbar. the above script also hiding the modal dialog when comment saved and it's working fine which is mean data.userdata is not empty, but why the append() isnt?

    Read the article

  • trying to find the comment hook I need for wordpress?

    - by beagleguy
    hi all , I'm writing a wordpress plugin that will execute a certain function when a user submits a comment. The only issue is I'm using the hook "comment_post" which works but if that comment gets stopped by akismet I'm still logging that comment but now my numbers are off from what's on the actual site. Is there a comment_approved type hook I should be using instead? thanks!

    Read the article

  • Modifying a gedit syntax highlighting file

    - by Oscar Saleta Reig
    I am trying to change a highlighting file from Gedit. I have modified the file /usr/share/gtksourceview-3.0/language-specs/fortran.lang because I want to change the cases in which the editor takes a statement as a comment. The problem I have is that when I choose the new highlighting scheme nothing highlights, it just remains as plain text. The file fortran.lang was opened with su permissions and I just copy-pasted everything into a new Gedit file and later saved it as fortran_enhanced.lang in the same folder. The changes I've done to the original file are these: Original fortran.lang file: <language id="fortran" _name="Fortran 95" version="2.0" _section="Sources"> <metadata> <property name="mimetypes">text/x-fortran</property> <property name="globs">*.f;*.f90;*.f95;*.for</property> <property name="line-comment-start">!</property> </metadata> <styles> <style id="comment" _name="Comment" map-to="def:comment"/> <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/> <style id="keyword" _name="Keyword" map-to="def:keyword"/> <style id="intrinsic" _name="Intrinsic function" map-to="def:builtin"/> <style id="boz-literal" _name="BOZ Literal" map-to="def:base-n-integer"/> <style id="decimal" _name="Decimal" map-to="def:decimal"/> <style id="type" _name="Data Type" map-to="def:type"/> </styles> <default-regex-options case-sensitive="false"/> <definitions> <!-- Note: contains an hack to avoid considering ^COMMON a comment --> <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check"> <start>!|(^[Cc](\b|[^OoAaYy]))</start> <include> <context ref="def:escape"/> <context ref="def:in-line-comment"/> </include> </context> (...) Modified fortran_enhanced.lang file: <!-- Note: changed language id and name --> <language id="fortran_enhanced" _name="Fortran 95 2.0" version="2.0" _section="Sources"> <metadata> <property name="mimetypes">text/x-fortran</property> <!-- Note: removed *.f and *.for from file extensions --> <property name="globs">*.f90;*.f95;</property> <property name="line-comment-start">!</property> </metadata> <styles> <style id="comment" _name="Comment" map-to="def:comment"/> <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/> <style id="keyword" _name="Keyword" map-to="def:keyword"/> <style id="intrinsic" _name="Intrinsic function" map-to="def:builtin"/> <style id="boz-literal" _name="BOZ Literal" map-to="def:base-n-integer"/> <style id="decimal" _name="Decimal" map-to="def:decimal"/> <style id="type" _name="Data Type" map-to="def:type"/> </styles> <default-regex-options case-sensitive="false"/> <definitions> <!-- Note: I want comments only beginning with !, not C --> <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check"> <start>!</start> <include> <context ref="def:escape"/> <context ref="def:in-line-comment"/> </include> </context> (...) I have read this question [ Custom gedit Syntax Highlighting for Dummies? ] and I tried to make the new fortran_enhanced.lang file readable with $ cd /usr/share/gtksourceview-3.0/language-specs $ sudo chmod 0644 fortran_enhanced.lang but it doesn't seem that made some difference. I have to say that I have never done a thing like this before and I don't even understand most of the language file, so I am open to every criticism, as I have been guided purely by intuition. Thank you in advanced!

    Read the article

  • (Facebook) Tag fb:comment does not work when I put it in Static FBML.

    - by binhlq
    This tag allow user to post comments in my Static FBML and display these comments on their Wall. But for some cause, comments can not be displayed in users' Wall even they checked the box "Post comment to my Facebook profile". I don't know what was wrong with the code I really appreciate if you can help. This is my FBML: click this to view And this is my code: fb:comments xid="comment" " canpost="true" candelete="false" numpost="10" publish_feed="true"><fb:title>Comment</fb:title></fb:comments>

    Read the article

  • Are there any tools in IDEs to automatically fix comment formatting?

    - by Fragsworth
    /* Suppose I have a multi-line comment with hard line-breaks * that are roughly uniform on the right side of the text, * and I want to add text to a line in order to make the * comment a bit more descriptive. */ Now, most unfortunately, I need to add text to one of the top lines. /* Suppose I have a multi-line comment with hard line-breaks (here is some added text for happy fun time) * that are roughly uniform on the right side of the text, * and I want to add text to a line in order to make the * comment a bit more descriptive. */ It takes O(n) time (n being the number of lines) to fix each line so that they roughly line up again. The computer should do this, not me. Are there tools to deal with this in our IDEs? What are they called?

    Read the article

  • How to parse phpDoc style comment block with php?

    - by Reveller
    Please consider the following code with which I'm trying to parse only the first phpDoc style comment (noy using any other libraries) in a file (file contents put in $data variable for testing purposes): $data = " /** * @file A lot of info about this file * Could even continue on the next line * @author [email protected] * @version 2010-05-01 * @todo do stuff... */ /** * Comment bij functie bar() * @param Array met dingen */ function bar($baz) { echo $baz; } "; $data = trim(preg_replace('/\r?\n *\* */', ' ', $data)); preg_match_all('/@([a-z]+)\s+(.*?)\s*(?=$|@[a-z]+\s)/s', $data, $matches); $info = array_combine($matches[1], $matches[2]); print_r($info) This almose works, except for the fact that everything after @todo (including the bar() comment block and code) is considered the value of @todo: Array ( [file] => A lot of info about this file Could even continue on the next line [author] => [email protected] [version] => 2010-05-01 [todo] => do stuff... / /** Comment bij functie bar() [param] => Array met dingen / function bar() { echo ; } ) How does my code need to be altered so that only the first comment block is being parsed (in other words: parsing should stop after the first "*/" encountered?

    Read the article

  • How do I comment out a block in XML?

    - by Jonas
    How do I comment out a block of tags in XML? I.e. How can I comment out <staticText> and everything inside it, in the code below? <detail> <band height="20"> <staticText> <reportElement x="180" y="0" width="200" height="20"/> <text><![CDATA[Hello World!]]></text> </staticText> </band> </detail> I could use <!-- staticText--> but that's just for single tags (as what I know), like // in Java and C. I would like something more like how /** comment **/ can be used in Java and C, so I can comment out longer blocks of XML code.

    Read the article

  • WWW::Mechanize Perl login only works after relaunch

    - by Klaus
    Hello, I'm trying to login automatically in a website using Perl WWW::Mechanize. What I do is: $bot = WWW::Mechanize->new(); $bot->cookie_jar( HTTP::Cookies->new( file => "cookies.txt", autosave => 1, ignore_discard => 1, ) ); $response = $bot->get( 'http://blah.foo/login' ); $bot->form_number(1); $bot->field( usern => 'user' ); $bot->field( pass => 'pass' ); $response =$bot->click(); print $response->content(); $response = $bot->get( 'http://blah.foo' ); print $response->content(); The login works, but when I load the page it tells me that I am not connected. You see that I store cookies in a file. Now if I relaunch the script without the login part, it says that I am connected... Does anyone understand this strange behaviour ?

    Read the article

  • Advice on my jQuery Ajax Function

    - by NessDan
    So on my site, a user can post a comment on 2 things: a user's profile and an app. The code works fine in PHP but we decided to add Ajax to make it more stylish. The comment just fades into the page and works fine. I decided I wanted to make a function so that I wouldn't have to manage 2 (or more) blocks of codes in different files. Right now, the code is as follows for the two pages (not in a separate .js file, they're written inside the head tags for the pages.): // App page $("input#comment_submit").click(function() { var comment = $("#comment_box").val(); $.ajax({ type: "POST", url: "app.php?id=<?php echo $id; ?>", data: {comment: comment}, success: function() { $("input#comment_submit").attr("disabled", "disabled").val("Comment Submitted!"); $("textarea#comment_box").attr("disabled", "disabled") $("#comments").prepend("<div class=\"comment new\"></div>"); $(".new").prepend("<a href=\"profile.php?username=<?php echo $_SESSION['username']; ?>\" class=\"commentname\"><?php echo $_SESSION['username']; ?></a><p class=\"commentdate\"><?php echo date("M. d, Y", time()) ?> - <?php echo date("g:i A", time()); ?></p><p class=\"commentpost\">" + comment + "</p>").hide().fadeIn(1000); } }); return false; }); And next up, // Profile page $("input#comment_submit").click(function() { var comment = $("#comment_box").val(); $.ajax({ type: "POST", url: "profile.php?username=<?php echo $user; ?>", data: {comment: comment}, success: function() { $("input#comment_submit").attr("disabled", "disabled").val("Comment Submitted!"); $("textarea#comment_box").attr("disabled", "disabled") $("#comments").prepend("<div class=\"comment new\"></div>"); $(".new").prepend("<a href=\"profile.php?username=<?php echo $_SESSION['username']; ?>\" class=\"commentname\"><?php echo $_SESSION['username']; ?></a><p class=\"commentdate\"><?php echo date("M. d, Y", time()) ?> - <?php echo date("g:i A", time()); ?></p><p class=\"commentpost\">" + comment + "</p>").hide().fadeIn(1000); } }); return false; }); Now, on each page the box names will always be the same (comment_box and comment_submit) so what do you guys think of this function (Note, the postComment is in the head tag on the page.): // On the page, (profile.php) $(function() { $("input#comment_submit").click(function() { postComment("profile", "<?php echo $user ?>", "<?php echo $_SESSION['username']; ?>", "<?php echo date("M. d, Y", time()) ?>", "<?php echo date("g:i A", time()); ?>"); }); }); Which leads to this function (which is stored in a separate file called functions.js): function postComment(page, argvalue, username, date, time) { if (page == "app") { var arg = "id"; } if (page == "profile") { var arg = "username"; } var comment = $("#comment_box").val(); $.ajax({ type: "POST", url: page + ".php?" + arg + "=" + argvalue, data: {comment: comment}, success: function() { $("textarea#comment_box").attr("disabled", "disabled") $("input#comment_submit").attr("disabled", "disabled").val("Comment Submitted!"); $("#comments").prepend("<div class=\"comment new\"></div>"); $(".new").prepend("<a href=\"" + page + ".php?" + arg + "=" + username + "\" class=\"commentname\">" + username + "</a><p class=\"commentdate\">" + date + " - " + time + "</p><p class=\"commentpost\">" + nl2br(comment) + "</p>").hide().fadeIn(1000); } }); return false; } That's what I came up with! So, some problems: When I hit the button the page refreshes. What fixed this was taking the return false from the function and putting it into the button click. Any way to keep it in the function and have the same effect? But my real question is this: Can any coders out there that are familiar to jQuery tell me techniques, coding practices, or ways to write my code more efficiently/elegantly? I've done a lot of work in PHP but I know that echoing the date may not be the most efficient way to get the date and time. So any tips that can really help me streamline this function and also make me better with writing jQuery are very welcome!

    Read the article

  • If-else statement comments [closed]

    - by Jin35
    Possible Duplicate: What is a good way to comment if-else-clauses? What is the best way to write comments for if-else statement? There is possible ways: A. //first comment if (condition) { ... } //second comment else { ... } B. if (condition) { //first comment ... } else { //second comment ... } C. if (condition) { //first comment ... } else { //second comment ... } Which one is the best, or there is some better possibilities?

    Read the article

  • Comments Parent-Child query with indentation

    - by poldoj
    I've been trying to retrieve comments to articles in a pretty common blog fashion way. Here's my sample code: -- ---------------------------- -- Sample Table structure for [dbo].[Comments] -- ---------------------------- CREATE TABLE [dbo].[Comments] ( [CommentID] int NOT NULL , [AddedDate] datetime NOT NULL , [AddedBy] nvarchar(256) NOT NULL , [ArticleID] int NOT NULL , [Body] nvarchar(4000) NOT NULL , [parentCommentID] int NULL ) GO -- ---------------------------- -- Sample Records of Comments -- ---------------------------- INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'1', N'2011-11-26 23:18:07.000', N'user', N'1', N'body', null); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'2', N'2011-11-26 23:18:50.000', N'user', N'2', N'body', null); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'3', N'2011-11-26 23:19:09.000', N'user', N'1', N'body', null); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'4', N'2011-11-26 23:19:46.000', N'user', N'3', N'body', null); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'5', N'2011-11-26 23:20:16.000', N'user', N'1', N'body', N'1'); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'6', N'2011-11-26 23:20:42.000', N'user', N'1', N'body', N'1'); GO INSERT INTO [dbo].[Comments] ([CommentID], [AddedDate], [AddedBy], [ArticleID], [Body], [parentCommentID]) VALUES (N'7', N'2011-11-26 23:21:25.000', N'user', N'1', N'body', N'6'); GO -- ---------------------------- -- Indexes structure for table Comments -- ---------------------------- -- ---------------------------- -- Primary Key structure for table [dbo].[Comments] -- ---------------------------- ALTER TABLE [dbo].[Comments] ADD PRIMARY KEY ([CommentID]) GO -- ---------------------------- -- Foreign Key structure for table [dbo].[Comments] -- ---------------------------- ALTER TABLE [dbo].[Comments] ADD FOREIGN KEY ([parentCommentID]) REFERENCES [dbo]. [Comments] ([CommentID]) ON DELETE NO ACTION ON UPDATE NO ACTION GO I thought I could use a CTE query to do the job like this: WITH CommentsCTE(CommentID, AddedDate, AddedBy, ArticleID, Body, parentCommentID, lvl, sortcol) AS ( SELECT CommentID, AddedDate, AddedBy, ArticleID, Body, parentCommentID, 0, cast(CommentID as varbinary(max)) FROM Comments UNION ALL SELECT P.CommentID, P.AddedDate, P.AddedBy, P.ArticleID, P.Body, P.parentCommentID, PP.lvl+1, CAST(sortcol + CAST(P.CommentID AS BINARY(4)) AS VARBINARY(max)) FROM Comments AS P JOIN CommentsCTE AS PP ON P.parentCommentID = PP.CommentID ) SELECT REPLICATE('--', lvl) + right('>',lvl)+ AddedBy + ' :: ' + Body, CommentID, parentCommentID, lvl FROM CommentsCTE WHERE ArticleID = 1 order by sortcol go but the results have been very disappointing so far, and after days of tweaking I decided to ask for help. I was looking for a method to display hierarchical comments to articles like it happens in blogs. [edit] The problem with this query is that I get duplicates because I couldn't figure out how to properly select the ArticleID which I want comments from to display. I'm also looking for a method that sorts children entries by date within a same level. An example of what I'm trying to accomplish could be something like: (ArticleID[post retrieved]) ------------------------- ------------------------- (Comments[related to the article id above]) first comment[no parent] --[first child to first comment] --[second child to first comment] ----[first child to second child comment to first comment] --[third child to first comment] ----[first child to third child comment to first comment] ------[(recursive child): first child to first child to third child comment to first comment] ------[(recursive child): second child to first child to third child comment to first comment] second comment[no parent] third comment[no parent] --[first child to third comment] I kinda got myself lost in all this mess...I appreciate any help or simpler ways to get this working. Thanks

    Read the article

  • How can I make my Perl Jabber bot an event-driven program?

    - by TheGNUGuy
    I'm trying to make a Jabber bot and I am having trouble keeping it running while waiting for messages. How do I get my script to continuously run? I have tried calling a subroutine that has a while loop that I, in theory, have set up to check for any messages and react accordingly but my script isn't behaving that way. Here is my source: http://pastebin.com/03Habbvh # set jabber bot callbacks $jabberBot-SetMessageCallBacks(chat=\&chat); $jabberBot-SetPresenceCallBacks(available=\&welcome,unavailable=\&killBot); $jabberBot-SetCallBacks(receive=\&prnt,iq=\&gotIQ); $jabberBot-PresenceSend(type="available"); $jabberBot-Process(1); sub welcome { print "Welcome!\n"; $jabberBot-MessageSend(to=$jbrBoss-GetJID(),subject="",body="Hello There!",type="chat",priority=10); &keepItGoing; } sub prnt { print $_[1]."\n"; } #$jabberBot-MessageSend(to=$jbrBoss-GetJID(),subject="",body="Hello There! Global...",type="chat",priority=10); #$jabberBot-Process(5); #&keepItGoing; sub chat { my ($sessionID,$msg) = @_; $dump-pl2xml($msg); if($msg-GetType() ne 'get' && $msg-GetType() ne 'set' && $msg-GetType() ne '') { my $jbrCmd = &trimSpaces($msg-GetBody()); my $dbQry = $dbh-prepare("SELECT command,acknowledgement FROM commands WHERE message = '".lc($jbrCmd)."'"); $dbQry-execute(); if($dbQry-rows() 0 && $jbrCmd !~ /^insert/si) { my $ref = $dbQry-fetchrow_hashref(); $dbQry-finish(); $jabberBot-MessageSend(to=$msg-GetFrom(),subject="",body=$ref-{'acknowledgement'},type="chat",priority=10); eval $ref-{'command'}; &keepItGoing; } else { $jabberBot-MessageSend(to=$msg-GetFrom(),subject="",body="I didn't understand you!",type="chat",priority=10); $dbQry-finish(); &keepItGoing; } } } sub gotIQ { print "iq\n"; } sub trimSpaces { my $string = $_[0]; $string =~ s/^\s+//; #remove leading spaces $string =~ s/\s+$//; #remove trailing spaces return $string; } sub keepItGoing { print "keepItGoing!\n"; my $proc = $jabberBot-Process(1); while(defined($proc) && $proc != 1) { $proc = $jabberBot-Process(1); } } sub killBot { print "killing\n"; $jabberBot-MessageSend(to=$_[0]-GetFrom(),subject="",body="Logging Out!",type="chat",priority=10); $jabberBot-Process(1); $jabberBot-Disconnect(); exit; }

    Read the article

  • Tests unitaires d'un DomainService WCF RIA : pattern Repository, un tutoriel de Kyle McClellan, traduit par Deepin Prayag

    Citation: Étant donné que WCF RIA Services emploie un « pipeline pattern » pour invoquer vos opérations DomainService, il n'est pas toujours évident de savoir comment les tester. Dans cette série d'articles nous allons voir un petit DomainService et comment le tester. Entre autres nous allons voir comment implémenter une IDomainServiceFactory personnalisée, comment implémenter le pattern Repository, et comment utiliser la DomainServiceTestHos...

    Read the article

  • Tests unitaires d'un DomainService WCF RIA : IDomainServiceFactory, un tutoriel de Kyle McClellan, traduit par Deepin Prayag

    Citation: Étant donné que WCF RIA Services emploie un « pipeline pattern » pour invoquer vos opérations DomainService, il n'est pas toujours évident de savoir comment les tester. Dans cette série d'articles nous allons voir un petit DomainService et comment le tester. Entre autres nous allons voir comment implémenter une IDomainServiceFactory personnalisée, comment implémenter le pattern Repository, et comment utiliser la DomainServiceTestHos...

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >