Search Results

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

Page 135/206 | < Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >

  • Anyway to improve my gzip PHP method?

    - by Joe
    I Gzip my pages currently like so: <?php ob_start("ob_gzhandler"); //my page content ob_flush(); ?> However, I read a comment somewhere, earlier on, that this method uses a lot of memory, and I know that my website has been using a lot of memory on my virtual private server, so I thought it would be nice if I knew a way to reduce memory usage. I tested my site with an online gzip tester which says my websites are sending gzipped pages, so my gzip method works, but the main obviously I'm looking for a less memory intensive option, if any. I appreciate all suggestions. :) Oh and merry christmas ;P

    Read the article

  • Mystery in Ruby sinatra

    - by JVK
    I have the following Sinatra code: post '/bucket' do # determine if this call is coming from filling out web form is_html = request.content_type.to_s.downcase.eql?('application/x-www-form-urlencoded') # If this is a curl call, then get the params differently unless is_html params = JSON.parse(request.env["rack.input"].read) end p params[:name] end If I call this using Curl, params has values, but when this is called via a web form, then params is nil and params[:name] has nothing. I spent several hours figuring out why it happens and asked help from other people, but no one could really find out what is going on. One thing to note is, if I comment out this line: params = JSON.parse(request.env["rack.input"].read) then params has the correct value for "web-form" posting. Actually, the goal is to get the params value if this code is being called by CURL call, so I used: params = JSON.parse(request.env["rack.input"].read) but it messed up the web-form posting. Can anyone solve this mystery?

    Read the article

  • Using Classes / OOP in PHP

    - by Alex Demchak
    I'm pretty proficient with PHP, outside of OOP - which I am just now starting to jump in to. I've been watching videos and reading tutorials, but they are all still pretty confusing... If I have FILE 1 (class.time.php) class Time { function GetTime(){ $time = date('H:i:s'); printf($time); } } and then in a nother php page I've got FILE 2 (page.php) I can do include('class.time.php'); and then anywhere in this page I can then do $time = new Time; //Calling the class and setting the class to a variable $time->GetTime(); //This is BASICALLY saying (run the 'GetTime' function in the 'Time Class' My main question is, is the comment above (This is BASICALLY saying.....) correct? or is there a better way to think of it?

    Read the article

  • Can you Borrow a PDF?

    - by WeNeedAnswers
    What are the legalities of letting someone borrow a book that you have purchased that so happens to be in PDF format with no DRM? I know that I can lend a printed book to someone and this not infringe copyright, but a pdf? I know that the thought police are going to be on my case about "no one here is a legal expert" or the "question can't be answered" or "controversial", But I would like to have the opportunity to at least surface the issue, and allow people to comment. I am not looking for point scoring on this, or even an answer, but as stackoverflow has a rather large technical savvy audience that would appreciate the question I think that it could be the next hurdle that will stop technical progress.

    Read the article

  • Removing response.End() includes the html of the page.

    - by vinay_rockin
    HttpResponse response = Context.Http.Response; response.Headers.Clear(); response.Clear(); response.ContentType = Component.OverrideMimeType ? Component.MimeType : "application/download"; response.AppendHeader("Content-Disposition", String.Format("attachment; filename=\"{0}\"", HttpUtility.HtmlEncode(Path.GetFileName(file.FileName)))); response.OutputStream.Write(file.Contents, 0, file.Contents.Length); response.Flush(); // response.End(); if I use response.End() it throws exception and if I comment response.End() it includes the html of the page on which the download link resides. how want to download file with introducing this exta html. Any Idea how to fix this?

    Read the article

  • How do I make TODO comments show up in the task list for C++ projects in Visual Studio 2010?

    - by Chris Simmons
    I'm trying to get my TODO comments to show up in the task list in Visual Studio 2010 for a C++ project, but they don't. I looked at this, but see no caveats other than the TODO comments need to be in the currently-open file. For example, creating a new Win32 console app places this: // TODO: reference additional headers your program requires here in a new file, stdafx.h. However, there's nothing in the task list. I have "Comments" chosen from the drop-down in the task list, but it's always empty. And it's not this problem; I can open the file and be looking at the TODO comment in the code editor and no task is shown. This is not a problem for C# projects as TODO comments show up as designed in those projects; this appears to be an issue specific to C++ projects. What else can I check?

    Read the article

  • How to join this table?

    - by pamella
    ads table img90.imageshack.us/img90/6295/adsvo.png phones table img194.imageshack.us/img194/3713/phones.png cars table img35.imageshack.us/img35/1035/carsm.png i have 3 tables ads,cars and phones. i want to join tables is based on category in ads table. and i tried this query but no luck,any helps? SELECT * FROM `ads` JOIN `ads.category` ON `ads.id` = `ads.category.id` ** i cant add comment any of your post,but i want it to be automatic based on category in ads table. for example :- if in table have phones category,i will automatic join phones table then SELECT * FROM `ads` JOIN `phone` ON `ads.id` = `phone.id` if in table have cars category,i will automatic join cars table SELECT * FROM `ads` JOIN `cars` ON `ads.id` = `cars.id`

    Read the article

  • F# equivalent of the C# typeof(IEnumerable<>)

    - by Rune FS
    I have a piece of code where I need to figure out if a given type implements IEnumerable (I don't care about the T) I've tried (t:System.Type in case you wonder) let interfaces = t.GetInterfaces() let enumerbale = interfaces.Any( fun t -> (t.GetGenericTypeDefinition() = typeof<IEnumerable<>>) however that wont compile (the compile don't like the <). I then tried let interfaces = t.GetInterfaces() let enumerbale = interfaces.Any( fun t -> (t.GetGenericTypeDefinition() = typeof<IEnumerable<'a>>) but get's a warning that 'a is constraint to obj. I Don't want to figure out if IEnumerable is implemented but IEnumerabl<. Any one know's the solution and btw feel free to comment on the code above as well. It's my first non-trivial F# program

    Read the article

  • What is "with" used for in PHP?

    - by Jason
    I have come across this line in the eloquent ORM library: return with(new static)->newQuery(); I've never seen "with" used before, and cannot find it in the PHP documentation. I'm guessing "with" is a stop-word in most searches, so I am not even getting close. Never having encountered "with" in many years of programming PHP, I feel like I'm missing out. What does it do? I did come across one passing comment regarding the ORM, that mentioned "with" is no longer needed in PHP-5.4, but that was as much as was said.

    Read the article

  • What was your first home computer?

    - by Adam Tegen
    What was your first home computer? The one that made you "fall in love" with programming. There are 300+ entries, many (most?) of which are duplicates. As with all StackOverflow Poll type Q&As, please make certain your answer is NOT listed already before adding a new answer - searching doesn't always find it (model naming variations, I assume). If it already exists, vote that one up so we see what the most popular answer is, rather than duplicating an existing entry. If you see a duplicate, vote it down so the top entries have only one of each model listed. If you have interesting or additional information to add, use a comment or edit the original entry rather than creating a duplicate.

    Read the article

  • How is this problem usually solved without using sever-side scripting?

    - by cyggi
    Simple problem I have so far always solved via PHP: You have a site with header, menu, footer and content field. Header, menu and footer are usually the same for each page. How do you, without PHP or any other server-side language, have the header, menu and footer data exist only in one file? So that for example you don't have ten sites (like home.html, products.html, about.html, ..) all having a copy of the static header and menu in their html files. Now if you want to change the header you have to change ten files. I hope I made my question clear enough, if not please leave a comment :)

    Read the article

  • Mootools event leak

    - by user572263
    The example to demonstrate the issue can be found here: link text The test shows a basic Mootools class that contains an element variable with a click event attached. There’s also a “cleanup” function to remove the event and nullify the element variable. My problem is that when I loop a thousand times to create the “LeakClass” instance and clean it up, it causes a major memory leak like there’s no tomorrow. I tested this on IE8 and Chrome. On the other hand what I’ve noticed is that if I comment out the line that adds the “click” event, the code doesn’t leak. Can somebody please help me structure the class/event in a manner that it doesn’t leak. Thanks in advance.

    Read the article

  • Mongodb, simple IN problem

    - by afvasd
    Hi everyone I am new to mongo, this is my db design: product := { name: str group: ref, comments: [ ref, ref, ref, ref ] } comments := { ... a bunch of comments stuff } tag := { _id: int, #Need this for online requests tag: str, products: [ {product: ref, score: float}, ... ], comments: [ {comment: ref, score: float}, ...], } So my usage pattern is: GIVEN a product, find comments that have certain tag and sort them accordingly. My current approach involves: Look for that tag object that has tag=myTag pull all the comments out, sorted look for that product where product.name=myProduct pull all the comments out (which are dbrefs by the way) loop through the result of 2, and checking if they are in 4, (this I can do a limit 10) etc. It's pretty inefficient. Any better methods?

    Read the article

  • How to I initialize a class with an interface button clicked? [Objective - C]

    - by seaworthy
    I am having a problem with figuring out how to initialize a class with button clicked. The code is listed below the line I have a problem with has "HELP NEEDED HERE" comment above it. // // Controller.m // #import "Controller.h" @implementation Controller - (id)init { self = [super init]; if(self){ numberTotal = 0; //HELP NEEDED HERE [self btnScore_Clicked:(id)sender]; } return self;} - (IBAction) btnScore_Clicked:(id)sender { numberTotal += 1; NSLog(@"Number Total: %d",numberTotal); } - (void)dealloc { [super dealloc]; } @end // // Controller.h // #import <UIKit/UIKit.h> @interface Controller : UIViewController { NSInteger numberTotal; } - (IBAction) btnScore_Clicked:(id)sender; @end Thanks!

    Read the article

  • Is it a good design to return value by parameter?

    - by aztack
    bool is_something_ok(int param,SomeStruct* p) { bool is_ok = false; // check if is_ok if(is_ok) // set p to some valid value else // set p to NULL return is_ok; } this function return true and set p to a valid value if "something is ok" otherwise return false and set p to NULL Is that a good or bad design? personally, i feel uncomfortable when i use it. If there is no document and comment, i really don know how to use it. BTW:Is there some authoritative book/article about API design?

    Read the article

  • Remove specified text from beginning of lines only if present (C#)

    - by Zach
    I have a textbox in which the user can edit text, in a scripting language. I've figured out how to let the user comment out lines in one click, but can't seem to figure out how to uncomment properly. For example, if the box has: Normal Text is here More normal text -- Commented text -- More commented text Normal Text again --Commented Text Again So, when the user selects any amount of text and decides to uncomment, the "--" is removed from the beginning of the lines that have it. The lines without the "--" should be unaffected. In short, I want an uncomment function that performs similar to the one in Visual Studio. Is there any way to accomplish this? Thanks

    Read the article

  • Drupal: does removing these lines from .htaccess cause security issues ?

    - by Patrick
    hi, I had to comment these lines from the htaccess files in my main Drupal folder and in sites folder # Don't show directory listings for URLs which map to a directory. #Options -Indexes # Follow symbolic links in this directory. #Options +FollowSymLinks ...in order to not get a 500 Internal Error on the new server. Can I leave them uncommented or am I going to have security issues ? ps. I've also set all content in files folder 777 permission. Is this ok ? thanks

    Read the article

  • How Can I Determine if HTTP Requests/Responses are compressed in IE7?

    - by DTS
    I'm trying to use Fiddler (v2.2.2.0) to see if HTTP traffic through IE7 is being compressed. I'm not seeing Accept-Encoding or Content-Encoding request/response headers being sent/returned and I do not need to decode the response data once it's arrived, which leads me to believe that the responses are NOT coming back compressed. However, when making the same requests using FireFox 3.5.7, I could see through FireBug that FF was sending Accept-Encoding and YSlow at least thought my data was coming back compressed. A comment in this question: http://stackoverflow.com/questions/897989/using-fiddler-to-check-iis-compression suggested that a proxy server may be to blame for stripping out headers and decompressing the content for security reasons. I am using Verizon FIOS for my broadband at home and am now wondering if Verizon is proxying my HTTP traffic? In short, how can I positively confirm/deny that responses are coming back compressed through IE? Thanks.

    Read the article

  • Jquery file format

    - by sarbe
    HI. I have multiple webpages. So I have a common external js file. And I have added this js file to every page. I have multiple check boxes in every page. And I have written the click event in the external, common js file. But I wonder how the js file should be? Currently I have written like this. $(document).ready(function() { $(".chk").click(function() { alert("hi"); }); }); But whenever I click a checkbox the click event is fired twice. it should be once. I dont know where is the error, is there any error in writing the js file? please comment.

    Read the article

  • Why Timer does not work if we do not generate a window?

    - by Roman
    Here is the code: import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.Timer; public class TimerSample { public static void main(String args[]) { new JFrame().setVisible(true); ActionListener actionListener = new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { System.out.println("Hello World Timer"); } }; Timer timer = new Timer(500, actionListener); timer.start(); } } It generates a window and then periodically prints "Hello World Timer" in the terminal (Command Prompt). If I comment this line new JFrame().setVisible(true); the application do not print anything to the command line. Why?

    Read the article

  • How to do a random-and-unique generator?

    - by javaLearner.java
    I already wrote a random generator which take arguments a and b, where a is minimun and b is maximum value, like this randomGenerator(int a, int b) What I want to do next is: Using a loop, then generate unique number from a to b. Example: I want to have 8 unique numbers, int a = 1; int b = 10; int value; If I do the loop, there is a high % that same number will appear more than once. Any idea how to do it? My own way is: while(int i <= 8){ randomGenerator(a,b); // if value is not in array, then insert into array } I am stuck at the comment part. Is there any way to check if a variable is exists in an array?

    Read the article

  • Are there any alternative to the header(); function ?

    - by Simon
    The thing is, I have a log-in page. And, when user enters Username & Password, they must be re-directed to success/failure page. Now, I have placed a "header('location:welcome.php');" after mysql rows are returned. But, it is giving me Header already sent errors, and I don't know much about PHP to do anything about it, let alone understand why it is happening. So, how to you transfer a user to another page after log-in data is verified? Same problem is happening with register, post, comment and search functions in my site.

    Read the article

  • End marker for command line arguments

    - by rwallace
    I'm writing a program which takes filenames and options on the command line in the usual way, and also can be directed to read arguments from a file. I'm implementing the semi-standard -- to turn off special treatment of subsequent arguments, and # as comment marker. I also want to implement a marker for 'disregard all arguments from here on', i.e. an end marker. Is there a common/semi-standard way to indicate this? Or, what way would people find least surprising?

    Read the article

  • Resetting a while loop

    - by Patrick Beardmore
    I have found a confusing thing in a php script I am writing to generate some javascript. Here it is below, slightly simplified. The second while loop won't run unless I comment out the entire first while loop. Can anyone explain why? Many thanks. <?php $listid = 2; //DEMO ONLY $result1 = mysql_query("SELECT words.wid,words.wordmd5,words.word FROM words,instances WHERE words.wid = instances.wid AND instances.lid = \"$listid\""); $result1copy = $result1; $count1 = 1; while( $row = mysql_fetch_object( $result1 ) ) { print "words_left[$count1] = \"".$row->word."\";\n"; //Increment the array counter (starts at 1) $count1++; } ?> //Some javascript <?php $count2 = 1; while( $row = mysql_fetch_object( $result1copy ) ) { print " $count2 then $row->wordmd5 "; $count2++; } ?>

    Read the article

  • Where to declare variable? C#

    - by user1303781
    I am trying to make an average function... 'Total' adds them, then 'Total' is divided by n, the number of entries... No matter where I put 'double Total;', I get an error message. In this example I get... Use of unassigned local variable 'Total' If I put it before the comment, both references show up as error... I'm sure it's something simple..... namespace frmAssignment3 { class StatisticalFunctions { public static class Statistics { //public static double Average(List<MachineData.MachineRecord> argMachineDataList) public static double Average(List<double> argMachineDataList) { double Total; int n; for (n = 1; n <= argMachineDataList.Count; n++) { Total = argMachineDataList[n]; } return Total / n; } public static double StDevSample(List<MachineData.MachineRecord> argMachineDataList) { return -1; } } } }

    Read the article

< Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >