Search Results

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

Page 118/206 | < Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >

  • Ordering by top commented.

    - by MILESMIBALERR
    How would I list a page of the top commented pages on the site with PHP and mysql. The database is set up sort of like this: page_id | username | comment | date_submitted page 1-------bob-------hello-----current date page 1-------joe-------byebye-----current date page 4-------joe--------stuff-------date page 3-------mark--------this--------a date how would you query it so that it orders them by top commented pages? here is a simple query to start with: $querycomments = sprintf("SELECT * FROM comments WHERE !!!!!HELLLLLP HERRE!!!!! = %s ORDER BY !!!!!!HELLLP HERE!!!!!! DESC", GetSQLValueString(????????????, "text"));

    Read the article

  • Do you have any tips for comments code to keep them in step with the code?

    - by Rob Wells
    G'day, I've read both of Steve McConnell's excellent Code Complete books "Code Complete" and "Code Complete 2" and was wondering if people have any other suggestions for commenting code. My commenting mantra could be summed up by the basic idea of expressing "what the code below cannot say". While enjoying this interesting blog post by Jeff about commenting I was still left wondering "When coding, when do you feel a comment is required?" Edit: Oops. Seems to be a duplicate of this question http://stackoverflow.com/questions/121945/how-do-you-like-your-comments so sorry for the noise. Thanks to my, seemingly, SO shadow for pointing it out - wouldn't have thought I was that interesting. Now off to read the original post and see if it is relevant. Edit: I meant to emphasise the best appraoch to ensure that your comments will stay in step with the code. Maybe expressing an intent rather than the mechansim for instance.

    Read the article

  • MVC architectural question - Where should payment processing go?

    - by Keltex
    This question is related to my ASP.NET MVC 2 development, but it could apply to any MVC environment and a question of where the logic should go. So let's say I have a controller that takes an online payment such as a shopping cart application. And I have the method that accepts the customers' credit card information: public class CartController : Controller CartRepository cartRepository = new CartRepository() [HttpPost] public ActionResult Payment(PaymentViewModel rec) { if(!ModelState.IsValid) { return View(rec); } // process payment here return RedirectToAction("Receipt"); } At the comment process payment here should the payment processing be handled: In the controller? By the repository? Someplace else?

    Read the article

  • wordpress functions.php

    - by Ayrton
    Hi I'm having issues with the functions.php file with variables $prev_dept = 0; $comment_count = 0; $comment_index = 0; function setCommentCount($size){ $comment_count = $size; } function flowhub_comment($comment, $args, $depth) { $comment_index ++; if($depth > 1) { $line = true; } echo '$prev_dept:' . $prev_dept.'<br>'; } I can't access $comment_index so I can't set nor get it from within a function. What should I do to fix this? Yours truthfully

    Read the article

  • In your experience, what has inspired you to change a fundamental programming tool

    - by Dr J
    A lot of what I am working on is changing the mindset of a community of developers. Moving them from one tool to another, or to picking up a new tool. What are some of the suggested or recommended ways to get a community to pick up a new meme? While we can mandate tool usage, this is a last resort. I would rather have the developers move to any new tools of their own accord. I'm not a programmer, I need to understand why a programmer will move from one tool to another. Edited the title thanks to a fabulous comment! My world runs on Meme's, tipping points, and general pressures. This is why I needed to ask. And clarifying yet more- I am the middle manager needing to plan and manage an implementation and not a sales person.

    Read the article

  • Nested While Loop for mysql_fetch_array not working as I expected

    - by Ayush Saraf
    I m trying to make feed system for my website, in which i have got i data from the database using mysql_fetch_array system and created a while loop for mysql_fetch_array and inside tht loop i have repeated the same thing again another while loop, but the problem is that the nested while loop only execute once and dont repeat the rows.... here is the code i have used some function and OOP but u will get wht is the point! i thought of an alternative but not yet tried vaz i wanna the way out this way only i.e. using a for loopo insted of while loop that mite wrk... public function get_feeds_from_my_friends(){ global $Friends; global $User; $friend_list = $Friends->create_friend_list_ids(); $sql = "SELECT feeds.id, feeds.user_id, feeds.post, feeds.date FROM feeds WHERE feeds.user_id IN (". $friend_list. ") ORDER BY feeds.id DESC"; $result = mysql_query($sql); while ($rows = mysql_fetch_array($result)) { $id = $rows['user_id']; $dp = $User->user_detail_by_id($id, "dp"); $user_name = $User->full_name_by_id($id); $post_id = $rows['id']; $final_result = "<div class=\"sharedItem\">"; $final_result .= "<div class=\"item\">"; $final_result .= "<div class=\"imageHolder\"><img src=\"". $dp ."\" class=\"profilePicture\" /></div>"; $final_result .= "<div class=\"txtHolder\">"; $final_result .= "<div class=\"username\"> " . $user_name . "</div>"; $final_result .= "<div class=\"userfeed\"> " . $rows['post'] . "</div>"; $final_result .= "<div class=\"details\">" . $rows['date'] . "</div>"; $final_result .= "</div></div>"; $final_result .= $this->get_comments_for_feed($post_id); $final_result .= "</div>"; echo $final_result; } } public function get_comments_for_feed($feed_id){ global $User; $sql = "SELECT feeds.comments FROM feeds WHERE feeds.id = " . $feed_id . " LIMIT 1"; $result = mysql_query($sql); $result = mysql_fetch_array($result); $result = $result['comments']; $comment_list = get_array_string_from_feild($result); $sql = "SELECT comment_feed.user_id, comment_feed.comment, comment_feed.date FROM comment_feed "; $sql .= "WHERE comment_feed.id IN(" . $comment_list . ") ORDER BY comment_feed.date DESC"; $result = mysql_query($sql); if(empty($result)){ return "";} else { while ($rows = mysql_fetch_array($result)) { $id = $rows['user_id']; $dp = $User->user_detail_by_id($id, "dp"); $user_name = $User->full_name_by_id($id); return "<div class=\"comments\"><div class=\"imageHolder\"><img src=\"". $dp ."\" class=\"profilePicture\" /></div> <div class=\"txtHolder\"> <div class=\"username\"> " . $user_name . "</div> <div class=\"userfeed\"> " . $rows['comment'] . "</div> <div class=\"details\">" . $rows['date'] . "</div> </div></div>"; } } }

    Read the article

  • View Latest Comments Made

    - by Abs
    Hello all, I hope I can give feedback like this. It may be just me and others may have already suggested this but is there a way to view our recent comments in our account profiles? I mean I can see questions asked, questions answered etc. But there are loads of questions where I add a comment to the question asker and when I leave the site, I either have to remember what the question was to go back and check if anyone has posted anything. Simply, I think having a place where we can view our latest comments if not all our comments in the control panel/user area would be great! Thanks all

    Read the article

  • Setting a session variable in Global.asax causes AJAX errors

    - by Fly_Trap
    I'm getting a very peculiar problem with my asp.net application, it took me an age to track down but I still don't know what is causing this behaviour. If I set a session variable in the Application_PreRequestHandlerExecute event, then my external JavaScript files are ignored, and therfore causing a raft of errors. I have simplified the problem below. E.g. I have file called JScript.js containing the code: function myAlert() { alert("Hi World"); } And in my Default.aspx file I reference the js with the code: <script src="JScript.js" type="text/javascript"></script> And in the body onload event I call the myAlert() function: <body onload="myAlert()"> And finally in the Global.asax file: Private Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs) HttpContext.Current.Session("myVar") = "MyValue" End Sub If you run the Default.aspx file you will see the js function isnt called, however, if you comment out the line of code Global.asax then the external js is called and the function executed when the page loads. Why is this?

    Read the article

  • Doctrine Mssql uniqueidentifier isn't cast as char or nvarchar when retrieved from the database.

    - by Tres
    When I retrieve a record from the database which has a column of type "uniqueidentifier", Doctrine fills it with "null" rather than the unique id from the database. Some research and testing has brought this down to a PDO/dblib driver issue. When directly querying via PDO, null is returned in place of the unique id. For reference, http://trac.doctrine-project.org/ticket/1096, has a bit on this, however, it was updated 11 months ago with no comment for resolution. A way around this, as mentioned at http://bugs.php.net/bug.php?id=24752&edit=1, is to cast the column as a char. However, it doesn't seem Doctrine exposes the native field type outside of generating models which makes it a bit hard to detect uniqueidentifier types and cast them internally when building the sql query. Has anyone found a workaround for this?

    Read the article

  • Code Golf Christmas Edition: How to print out a Christmas tree of height N

    - by TheSoftwareJedi
    Given a number N, how can I print out a Christmas tree of height N using the least number of code characters? N is assumed constrained to a min val of 3, and a max val of 30 (bounds and error checking are not necessary). N is given as the one and only command line argument to your program or script. All languages appreciated, if you see a language already implemented and you can make it shorter, edit if possible - comment otherwise and hope someone cleans up the mess. Include newlines and whitespace for clarity, but don't include them in the character count. A Christmas tree is generated as such, with its "trunk" consisting of only a centered "*" N = 3: * *** ***** * N = 4: * *** ***** ******* * N = 5: * *** ***** ******* ********* * N defines the height of the branches not including the one line trunk. Merry Christmas SO!

    Read the article

  • How do i create a local bare repository with tortoisegit?

    - by acidzombie24
    Greg's comment help me understand http://stackoverflow.com/questions/1698552/tortoisegit-push-successfully-but-no-new-files/1698657#1698657 How do i create a local bare repository with tortoisegit? I can right click and clone a repository from github and push. I would like to create a local repository then do the same thing, clone and push. How do i do that? -edit- i have created a local repository just fine but i cant push to it. I need to pull everything. I like the consistency of pushing in both my projects.

    Read the article

  • Executing / Running a python script from ubuntu server

    - by Shishant
    Hello, Can anybody help me how to run a python script through command line? My python script http://buffis.com/2007/07/25/getting-info_hash-for-xbt-tracker/comment-page-1/ I am using this command /var/www/hash_info.py /var/www/Muha_Album.7912.torrent I have copied dependency file bencode.py mentioned in article link above. When I execute the above command I get error No such file or directory but when i chmod the file to 644 it says Permission denied the file is present at the location. I have installed pythong using this command apt-get install python-gtk2 python-glade2 Thank You.

    Read the article

  • ETL mechanisms for MySQL to SQL Server over WAN

    - by Troy Hunt
    I’m looking for some feedback on mechanisms to batch data from MySQL Community Server 5.1.32 with an external host down to an internal SQL Server 05 Enterprise machine over VPN. The external box accumulates data throughout business hours (about 100Mb per day), which then needs to be transferred internationally across a WAN connection to an internal corporate environment before some BI work is performed. This should just be change-sets making their way down each night. I’m interested in thoughts on the ETL mechanisms people have successfully used in similar scenarios before. SSIS seems like a potential candidate; can anyone comment on the suitability for this scenario? Alternatively, other thoughts on how to do this in a cost-conscious way would be most appreciated. Thanks!

    Read the article

  • Incorporating MIT/X11 licensed code into project

    - by Yktula
    I'm rewriting a small MIT-licensed program in C, and I intend to copy a segment from it (though not verbatim) that prints usage information and such things. The programs are going to behave, for the most part, the same, but the implementations are going to be much different. What is the best way to incorporate this code into my program, whether it's licensed under Apache 2, GPLv2/3, or under the MIT license? My guess is that for the first two listed I'd just add the original authors name to the NOTICE file along with relevant information and paste the license header as a comment above the derived code, and for the latter I'd just add the original author's copyright statement above my own.

    Read the article

  • How to get use text columns in a trigger

    - by Jeremy
    I am trying to use an update trigger in sql 2000 so that when an update occurs, I insert a row into a history table, so I retain all history on a table: CREATE Trigger trUpdate_MyTable ON MyTable FOR UPDATE AS INSERT INTO [MyTableHistory] ( [AuditType] ,[MyTable_ID] ,[Inserted] ,[LastUpdated] ,[LastUpdatedBy] ,[Vendor_ID] ,[FromLocation] ,[FromUnit] ,[FromAddress] ,[FromCity] ,[FromProvince] ,[FromContactNumber] ,[Comment]) SELECT [AuditType] = 'U', D.* FROM deleted D JOIN inserted I ON I.[ID] = D.[ID] GO Of course, I get an error "Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables." I tried joining to MyTable instead of deleted, but because the insert triger fires after the insert, it ends up inserting the new record into the history table, when I want the original record. How can I do this and still use text columns?

    Read the article

  • Include FileUtils raises an error

    - by Bilal Aslam
    I am trying to install CruiseControl.rb on an Amazon EC2 instance. I get this error in the mongrel log: /data/cruisecontrol/releases/20100313003145/vendor/rails/activesupport/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant ProjectsMigration::FileUtils (NameError) This error is raised in a file called projects_migration.rb: http://gist.github.com/331025. Check out line 3, which I have commented out. If you remove the comment-out, you will get this error as well. The weird part: from ruby script/console I can include FileUtils just fine!

    Read the article

  • PHP Doctrine: Filter Table?

    - by ropstah
    I'm still not convinced after my previous question and some experience. Requirements: I don't want to use an SQL query everytime a filterBy() function is called and still be able to call -filterBy() on the returned table. Please find the comment @ ObjectsTable class: "How to instantiate another table and add records which match the filter criteria?" Usage: $globaltable = new ObjectsTable(); //globally accessible variable $globaltable->findAll(); //this call is made once at the beginning of the request $globaltable->filterBy('somefield', $someValue); //this function is used all over the place ObjectsTable class: class ObjectsTable extends Doctrine_Table { function filterBy($field, $value) { //How to instantiate another table and add records which match the criteria? } }

    Read the article

  • NSNotificationCenter and ASIHTTPRequest

    - by user262325
    Hello everyone: I hope to get the http header info(file size) in asynchronous mode. So I initialize as codes: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(processReadResponseHeaders:) name:@"readResponseHeaders" object:nil]; my codes to read the http header -(void)processReadResponseHeaders: (ASIHTTPRequest *)request ;//(id)sender; { unsigned long long contentLength = [request contentLength]; //error occurs here } It has to change the source code of ASIHTTPRequest.m I did add my codes in function readResponseHeaders to notify the event is triggered ) - (void)readResponseHeaders { //......................... [[NSNotificationCenter defaultCenter] postNotificationName:@"readResponseHeaders" object:self];// } the log file reports: 2010-05-15 13:47:38.034 myapp[2187:6a63] * -[NSConcreteNotification contentLength]: unrecognized selector sent to instance 0x46e5bb0 Welcome any comment Thanks interdev

    Read the article

  • mod_php / mod_suphp / FastCGI | Which do you recommend and why.

    - by Saif Bechan
    I am at the point that I have to choose on what type of setup my application should run. I know there are some types available where apache runs smooth on, but they all have there downsides. System: Apache 2 / PHP 5.2 I hope you can give me some tips from firsthand experience. To give you an example of what to be covered. - Performance - Ease of setup - Security I know this does not really involve programming, but I have seen post concerning this and I know that you guys/girls here are certainly qualified to comment on this subject.

    Read the article

  • How do I create a check constraint?

    - by Zack Peterson
    Please imagine this small database... Diagram Tables Volunteer Event Shift EventVolunteer ========= ===== ===== ============== Id Id Id EventId Name Name EventId VolunteerId Email Location VolunteerId Phone Day Description Comment Description Start End Associations Volunteers may sign up for multiple events. Events may be staffed by multiple volunteers. An event may have multiple shifts. A shift belongs to only a single event. A shift may be staffed by only a single volunteer. A volunteer may staff multiple shifts. Check Constraints Can I create a check constraint to enforce that no shift is staffed by a volunteer that's not signed up for that shift's event? Can I create a check constraint to enforce that two overlapping shifts are never staffed by the same volunteer?

    Read the article

  • Simple hardware RNG

    - by roygbiv
    I made a tongue-in-cheek comment to this question about making a hardware RNG. Does anyone know of any simple plans or can anyone descibe a simple hardware based RNG and the software to drive it? Go to Radio Shack. Buy a diode, an NTR resistor, a capacitor and serial cable. Cut off the end of the serial cable that does not fit on your computer. Solder the diode and resistor in series between pins DTR and DSR of the cable. Solder the capacitor between DSR and TXD pins. Write a small C program to do the following: Set DTR to 1. Start Timer. Monitor DSR until it goes to 1. Stop Timer. Calculate resistance from elapsed time. Retreive serveral bits from that value to use as part of random number. Repeat until enough bits have accumulated.

    Read the article

  • Using Jquery to load Facebook fb:profile-pic - not working in IE

    - by Gublooo
    Hey.... I followed the tips given on Loading Facebook fb:profile via ajax In my app, I am basically loading more comments posted by the user via Jquery and along with each comment showing the user's picture using the fb:profile-pic tag This is a sample of how I'm building the string via Jquery newcomment += "<fb:profile-pic uid='"+data.fb_userid+"' height='50' width='50' /"; newcomment += ""+data.user_name+": "; newcomment += ""+data.user_comment+": "; $("#morecomments").append(newcomment); So the profile-pic was not being displayed - After reading the above link, I added if ( FB.XFBML.Host.parseDomTree ) setTimeout( FB.XFBML.Host.parseDomTree, 0 ); The weird thing now is - its working in Chrome and Firefox but not in IE Cant figure out why. Any help will be appreciated. Thanks

    Read the article

  • Useful Eclipse Java Code Templates

    - by Jon
    You can create various Java code templates in Eclipse via the Window->Preferences->Java -> Editor -> Templates e.g. sysout is expanded to: System.out.println(${word_selection}${});${cursor} You can activate this by typing sysout followed by CTRL+SPACE What useful Java code templates do you currently use? Include the name and description of it and why it's awesome. There's an open bounty on this for an original/novel use of a template rather than a built-in existing feature. Create Log4J logger Get swt color from display Syncexec - Eclipse Framework Singleton Pattern/Enum Singleton Generation Readfile Const Traceout Format String Comment Code Review String format Try Finally Lock Message Format i18n and log Equalsbuilder Hashcodebuilder Spring Object Injection Create FileOutputStream

    Read the article

  • Eclipse code template to insert a bookmark?

    - by Mike
    Eclipse has a nifty feature which allows you to define "templates" for code. I have created one to automatically put in a println and add a "TODO" comment. I'd like for this to also add a bookmark so I can easily find it again. (The codebase I am working with makes it unfeasible to use just the Task List to find what I need to do since there are a lot of TODOs laying around.) My current template is simply System.out.println("don't commit me!"); //TODO: fix this ${cursor}.

    Read the article

  • Why is UIControlTouchUpInside UNDEFINED?

    - by munchine
    I've got a simple question but it has got me confounded. The code below gets an UNDEFINED error for UIControlTouchUpInside. What do I need to include or import? If I comment out the line, it works. So that means forState:UIControlStateNormal is defined. I'm new so hope you can help. UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button setTitle:@"Accept?" forState:UIControlStateNormal]; [button addTarget:self action:@selector(acceptTapped) forControlEvents:UIControlTouchUpInside];

    Read the article

< Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >