Search Results

Search found 5637 results on 226 pages for 'triple slash comments'.

Page 69/226 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • Benchmarking a UDP server

    - by Nicolas
    I am refactoring a UDP listener from Java to C. It needs to handle between 1000 and 10000 UDP messages per second, with an average data length of around 60 bytes. There is no reply necessary. Data cannot be lost (Don't ask why UDP was decided). I fork off a process to deal with the incoming data so that I can recvfrom as quickly as possible - without filling up my kernel buffers. The child then handles the data received. In short, my algo is: Listen for data. When data is received, check for errors. Fork off a child. If I'm a child, do what I with the data and exit. If I'm a parent, reap any zombie children waitpid(-1, NULL, WNOHANG). Repeat. Firstly, any comments about the above? I'm creating the socket with socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP), binding with AF_INET and INADDR_ANY and recvfrom with no flags. Secondly, can anyone suggest something that I can use to test that this application (or at least the listener) can handle more messages than what I am expecting? Or, would I need to hack something together to do this. I'd guess the latter would be better, so that I can compare data that is generated versus data that is received. But, comments would be appreciated.

    Read the article

  • htaccess mod rewrite changes http://www to http:/www

    - by Nir
    I want to replace calls like this: www.mysite.com/sub/file.php?param1=x&param2=http://www.someurl.com with: www.mysite.com/sub/param1/param2 Param 1 is an integer number Param 2 is a url I wrote this rewrite rule in htaccess: RewriteCond %{REQUEST_URI} \/sub\/ RewriteRule sub\/([0-9]+)\/(.*)$ sub\/file.php?param1=$2&param2=$1 [L] Unfortunately param2 (the URL) starts with http:/www.someurl.com instead of http://www.someurl.com (note the single slash). Any idea what causes it? When I call the same file with same parameters in the format www.mysite.com/sub/file.php?param1=x&param2=http://www.someurl.com , param2 does appear OK so it must be something with the rewrite rule.

    Read the article

  • Conditional required field validation in an ASP.net ListView

    - by Jim Dagg
    I'm having a heck of a time trying to figure out how to implement validation in a ListView. The goal is to require the user to enter text in the comments TextBox, but only if the CheckBox is checked. Downside is that these controls are in the EditTemplate of a ListView. Below is a snippet of the relevant code portion of the EditTemplate: <tr style="background-color: #00CCCC; color: #000000"> <td> Assume Risk? <asp:CheckBox ID="chkWaive" runat="server" Checked='<%# Bind("Waive") %>' /> </td> <td colspan="5"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Comments required" ControlToValidate="txtComments" /> <asp:TextBox Width="95%" ID="txtComments" runat="server" Text='<%# Eval("Comment") %>'></asp:TextBox> </td> <td> <asp:Button ID="btnSave" runat="server" Text="Save" CommandName="Update" Width="100px" /> </td> </tr> Is there a way to do conditional validation using this method? If not, is there a way I could validate manually in the ItemUpdating event of the Listview, or somewhere else, and on a failure, alert the user of the error via a label or popup alert?

    Read the article

  • Ruby on Rails / Yellow Maps For Ruby Plugin woes...

    - by Zach
    Okay I've read through the plugin comments and the docs as well and I have yet to come up with an answer as to how to do this. Here's my problem I want to use the :info_window_tabs and the :icon option, but I don't know what format to pass my information in. According to the documentation the following code should be correct. Here's my code: @mapper.overlay_init(GMarker.new([map.lat, map.lng], :title => map.name, :info_window_tabs => [ {:tab => "HTML", :content => @marker_html}, {:tab => "Attachments", :content => "stuff"}], :icon => { :image => "../images/icon.png" })) The readme and documentation can be viewed here. And the relevant ruby file that I am trying to interact with, including the author's comments, can be viewed here. I have tried the #rubyonrails channel in IRC as well as emailing the author directly and reporting an issue at GitHub. It really is just a question of syntax. Thanks!

    Read the article

  • How can I stop SharePoint from appending <mso:CustomDocumentProperties> to my output

    - by tath.am
    I'm trying to hack together an extra feature on top of a POC (smoke and mirrors demo). The POC is on SPS 2007 and I need to integrate with another system. To facilitate part of this, I need to provide a JSONP endpoint. I want this URL: http://sharepoint:2024/Pages/SomeExternalSystem/Payload.aspx?callback=abc To return this: abc({ sampleField1: "sampleData1", sampleField2: 234.56 }); It's all smoke and mirrors anyway, so I uploaded this file to SharePoint: <%@ Page ContentType="text/javascript" Language="C#" %> <%= Request.QueryString["callback"] %>({ sampleField1: "sampleData1", sampleField2: 234.56 }); (And added a page parser rule to allow it to compile the code blocks.) No matter what I seem to do, SharePoint emits this instead: abc({ sampleField1: "sampleData1", sampleField2: 234.56 }); <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head> <!--[if gte mso 9]><xml> <mso:CustomDocumentProperties> <mso:PublishingContactPicture msdt:dt="string"></mso:PublishingContactPicture> <mso:PublishingRollupImage msdt:dt="string"></mso:PublishingRollupImage> <mso:Audience msdt:dt="string"></mso:Audience> <mso:PublishingContactName msdt:dt="string"></mso:PublishingContactName> <mso:ContentType msdt:dt="string">Page</mso:ContentType> <mso:Comments msdt:dt="string"></mso:Comments> <mso:PublishingContactEmail msdt:dt="string"></mso:PublishingContactEmail> </mso:CustomDocumentProperties> </xml><![endif]--> </head> It's proving hard to Google for.

    Read the article

  • Proper way to use a config file?

    - by user156814
    I just started using a PHP framework, Kohana (V2.3.4) and I am trying to set up a config file for each of my controllers. I never used a framework before, so obviously Kohana is new to me. I was wondering how I should set up my controllers to read my config file. For example, I have an article controller and a config file for that controller. I have 3 ways of loading config settings // config/article.php $config = array( 'display_limit' => 25, // limit of articles to list 'comment_display_limit' => 20, // limit of comments to list for each article // other things ); Should I A) Load everything into an array of settings // set a config array class article_controller extends controller{ public $config = array(); function __construct(){ $this->config = Kohana::config('article'); } } B) Load and set each setting as its own property // set each config as a property class article_controller extends controller{ public $display_limit; public $comment_display_limit; function __construct(){ $config = Kohana::config('article'); foreach ($config as $key => $value){ $this->$key = $value; } } } C) Load each setting only when needed // load config settings only when needed class article_controller extends controller{ function __construct(){} // list all articles function show_all(){ $display_limit = Kohana:;config('article.display_limit'); } // list article, with all comments function show($id = 0){ $comment_display)limit = Kohana:;config('article.comment_display_limit'); } } Note: Kohana::config() returns an array of items. Thanks

    Read the article

  • How to log in to a website using installed twill?

    - by brilliant
    Hello, everybody!!!! I have just successfully installed TWILL on my computer with the help of one very supportive member of "StackOverflow" (you can check it out HERE) and have tried to run one of the simple examples on the twill documentation page (you can see that page HERE). Here is that example: Let's say my username on www.slash.org is lynxye and my password is mammal. When I try to enter that example code into my Python prompt, I can only type and enter the first line of the code because when I click on "Enter" to start a new line, I get some error messages right away: The same happens when I try to enter this code into my terminal: I think I miss out on some basics here. Perhaps, I need to create a file that would contain that code and then run that file somehow, but I really don't know where I need to create that file and with what extensdion. Can anyone, please, help me with this?

    Read the article

  • What is best strategy to handle exceptions & errors in Rails?

    - by Nick Gorbikoff
    Hello. I was wondering if people would share their best practices / strategies on handling exceptions & errors. Now I'm not asking when to throw an exception ( it has been throroughly answered here: SO: When to throw and Exception) . And I'm not using this for my application flow - but there are legitimate exceptions that happen all the time. For example the most popular one would be ActiveRecordNotFound. What would be the best way to handle it? The DRY way? Right now I'm doing a lot of checking within my controller so if Post.find(5) returns Nil - I check for that and throw a flash message. However while this is very granular - it's a bit cumbersome in a sense that I need to check for exceptions like that in every controller, while most of them are essentially the same and have to do with record not found or related records not found - such as either Post.find(5) not found or if you are trying to display comments related to post that doesn't exist, that would throw an exception (something like Post.find(5).comments[0].created_at) I know you can do something like this in ApplicationController and overwrite it later in a particular controller/method to get more granular support, however would that be a proper way to do it? class ApplicationController < ActionController::Base rescue_from ActiveRecord::RecordInvalid do |exception| render :action => (exception.record.new_record? ? :new : :edit) end end

    Read the article

  • has_many, belongs_to and comment forms

    - by Koning Baard XIV
    I'm having two models: Snippet and SnippetComment. These also have their own controllers, as well as views. In /app/views/snippets/show.html.erb I have a form that starts like this: <% form_for(@new_snippet_comment) do |form| %> SnippetComment belongs to one Snippet, and a Snippet belongs to one User. This means that I have this routing: map.resources :users do |user| user.resources :snippets do |snippet| snippet.resources :snippet_comments, :as => "comments" end end So when I submit the SnippetComment form in the SnippetController#show view, this request should be made: POST /users/x/snippets/x/comments HTTP/1.1 (where x is the User's or Snippet's id). The problem is that I don't even get the comment submission form, but rahter this: NoMethodError in Snippets#show Showing app/views/snippets/show.html.erb where line #29 raised: undefined method `snippet_comments_path' for Extracted source (around line #29): 26: <% if current_user %> 27: <h2>Schrijf een nieuwe reactie</h2> 28: 29: <% form_for(@new_snippet_comment) do |form| %> 30: 31: <p> 32: <%= form.text_area :body %> RAILS_ROOT: /Users/jeffatwood/Dev/youjustdontneedmyrealname Application Trace | Framework Trace | Full Trace /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/polymorphic_routes.rb:107:in `__send__' /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/polymorphic_routes.rb:107:in `polymorphic_url' /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/polymorphic_routes.rb:114:in `polymorphic_path' /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/helpers/form_helper.rb:298:in `apply_form_for_options!' /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/helpers/form_helper.rb:277:in `form_for' /Users/jeffatwood/Dev/youjustdontneedmyrealname/app/views/snippets/show.html.erb:29:in `_run_erb_app47views47snippets47show46html46erb' /Users/jeffatwood/Dev/youjustdontneedmyrealname/app/controllers/snippets_controller.rb:19:in `show' Request Parameters: {"id"=>"1", "user_id"=>"2"} Show session dump Response Headers: {"Content-Type"=>"text/html", "Cache-Control"=>"no-cache"} Can anyone help me with this problem? Thanks

    Read the article

  • CodeIgniter's Scaffolding and Helper Functions Not Working

    - by 01010011
    Hi, I'm following CodeIgniter's tutorial "Create a blog in 20 minutes" and I am having trouble getting the helper, anchor and Scaffolding functions to work. I can't seem to create links on my HTML page using the helper and anchor functions. I put $this->load->helper('url'); $this->load->helper('form'); in the constructor under parent::Controller(); and <p>&lt;?php anchor('blog/comments','Comments'); ?&gt;</p> within the foreach loop as specified in the tutorial. But Im not getting the links to appear. Secondly, I keep getting a 404 Page Not Found error whenever I try to access CodeIgniter's Scaffolding page in my browser, like so: localhost/codeignitor/index.php/blog/scaffolding/mysecretword I can access localhost/codeignitor/index.php/blog just fine. I followed CodeIgnitor's instructions in their "Create a blog in 20 minutes" by storing my database settings in the database.php file; and automatically connecting to the database by inserting "database" in the core array of the autoload.php; and I've added both parent::Controller(); and $this->load->scaffolding('myTableName') to blog's constructor. It still gives me this 404. Any assistance will be appreciated. Thanks in advance?

    Read the article

  • regex to get current page or directory name?

    - by John Isaacks
    I am trying to get the page or last directory name from a url for example if the url is: http://www.example.com/dir/ i want it to return dir or if the passed url is http://www.example.com/page.php I want it to return page Notice I do not want the trailing slash or file extension. I tried this: $regex = "/.*\.(com|gov|org|net|mil|edu)/([a-z_\-]+).*/i"; $name = strtolower(preg_replace($regex,"$2",$url)); I ran this regex in PHP and it returned nothing. (however I tested the same regex in ActionScript and it worked!) So what am I doing wrong here, how do I get what I want? Thanks!!!

    Read the article

  • When does invoking a member function on a null instance result in undefined behavior?

    - by GMan
    This question arose in the comments of a now-deleted answer to this other question. Our question was asked in the comments by STingRaySC as: Where exactly do we invoke UB? Is it calling a member function through an invalid pointer? Or is it calling a member function that accesses member data through an invalid pointer? With the answer deleted I figured we might as well make it it's own question. Consider the following code: #include <iostream> struct foo { void bar(void) { std::cout << "gman was here" << std::endl; } void baz(void) { x = 5; } int x; }; int main(void) { foo* f = 0; f->bar(); // (a) f->baz(); // (b) } We expect (b) to crash, because there is no corresponding member x for the null pointer. In practice, (a) doesn't crash because the this pointer is never used. Because (b) dereferences the this pointer (this->x = 5;), and this is null, the program enters undefined behavior. Does (a) result in undefined behavior? What about if both functions are static?

    Read the article

  • NetBeans Tips and Tricks

    - by cdmckay
    I just saw an Eclipse tips & tricks post and was wondering if anyone had any tips & tricks for my IDE of choice: NetBeans. Here's a few I know and find to be useful: Removing a package: After you remove a package in NetBeans, it sticks around as a grayed-out package in your Project view. To get rid of that, switch to Files view and delete the directory. Alt-Insert (in Windows) opens up a Generate submenu at your cursor. A nice shortcut for quickly generating getters/setters (among other things). Selecting a chunk of code, right-clicking and then clicking "Refactor Introduce Method" will have NetBeans introduce a method, complete with arguments and return value. Of course you have to make sure the chunk of code only has one return value. Sometimes when you run a build and it crashes, the Java window sticks around at the bottom. I used to just click X until Windows let me End Task, but there's a nicer way to get rid of them. Click "Run Stop Build/Run" and NetBeans will close the window for you. It'll even let you close multiple applications at once. These may seem obvious to grizzled NetBeans developers, but I thought they might be useful for NetBeans newbs like me. Anyone else have any tips/tricks to share? Here are some from the comments: NetBeans allows for code templates. You can even add yours on the Code Templates tab under the Editor settings on the Options window. Some examples: Type sout and hit the tab key as a shorcut for System.out.println("") Type psvm and hit the tab key as a shorcut for public static void main(String args[]) {} Ctrl Shift C: Comments out the selected block of code. Alt Shift F: Formats the selected block of code. Ctrl E: Deletes current line. Ctrl Shift I: Fixes your imports, handy if you've just written a piece of code that needs a lot of packages imported.

    Read the article

  • Tricky file parsing. Inconsistent Delimeters

    - by Ben Truby
    I need to parse a file with the following format. 0000000 ...ISBN.. ..Author.. ..Title.. ..Edit.. ..Year.. ..Pub.. ..Comments.. NrtlExt Nrtl Next Navg NQoH UrtlExt Urtl Uext Uavg UQoH ABS NEB MBS FOL ABE0001 0-679-73378-7 ABE WOMAN IN THE DUNES (INT'L ED) 1st 64 RANDOM 0.00 13.90 0.00 10.43 0 21.00 10.50 6.44 3.22 2 2.00 0.50 2.00 2.00 ABS The ID and ISBN are not a problem, the title is. There is no set length for these fields, and there are no solid delimiters- the space can be used for most of the file. Another issue is that there is not always an entry in the comments field. When there is, there are spaced within the content. So I can get the first two, and the last fourteen. I need some help figuring out how to parse the middle six fields. This file was generated by an older program that I cannot change. I am using php to parse this file.

    Read the article

  • Ldap query returns null result when deployed.

    - by Trey Carroll
    I'm using a very simple Ldap query in my asp.net mvc 2.0 site: String ldapPath = ConfigReader.LdapPath; String emailAddress = null; try { DirectorySearcher search = new DirectorySearcher(ConfigReader.LdapPath); search.Filter = String.Format("(&(objectClass=user)(objectCategory=person)(objectSid={0})) ", securityIdentifierValue); // add the mail property to the list of props to retrieve search.PropertiesToLoad.Add("mail"); var result = search.FindOne(); if (result == null) { throw new Exception("Ldap Query with filter:" + search.Filter.ToString() + " returned a null value (no match found)"); } else { emailAddress = result.Properties["mail"][0].ToString(); } } catch (ArgumentOutOfRangeException aoorEx) { throw new Exception( "The query could not find an email for this user."); } catch (Exception ex) { //_log.Error(string.Format("======!!!!!! ERROR ERROR ERROR !!!!! in LdapLookupUtil.cs getEmailFromLdap Exception: {0}", ex)); throw ex; } return emailAddress; It works fine on my localhost machine. It works fine when I run it in VS2010 on the server. It always returns a null result when deployed. Here is my web.config: Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config -- section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. -- <!-- -- section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. -- I'm running it under the default app pool. Does anybody see the problem? This is driving me crazy!

    Read the article

  • routing problem in codeigniter

    - by Obay
    I'm new to CodeIgniter and routing. I have a Login controller whose index() loads up a view to enter a username/password. In the view, the form has action="login/authenticate". Login-authenticate() determines if the login is valid or not. If it's valid, redirect('lobby'), if not redirect('login') routes.php: $route['default_controller'] = "login" config.php: $config['base_url'] = "http://localhost/dts/"; $config['index_page'] = "index.php"; The problem is that when i go to http://localhost/dts/ , click login, I am correctly (?) redirected to http://localhost/dts/login/authenticate but the browser says Object not found!. But when I go to http://localhost/dts/index.php/ (with trailing slash), it works correctly (I get redirected to http://localhost/dts/index.php/login/authenticate, and am logged in) I tried removing "index.php" by using a .htaccess: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] and it would no longer open even the http://localhost/dts/ I'm confused.. what's going on?

    Read the article

  • Python Vector Class

    - by sfjedi
    I'm coming from a C# background where this stuff is super easy—trying to translate into Python for Maya. There's gotta' be a better way to do this. Basically, I'm looking to create a Vector class that will simply have x, y and z coordinates, but it would be ideal if this class returned a tuple with all 3 coordinates and if you could edit the values of this tuple through x, y and z properties, somehow. This is what I have so far, but there must be a better way to do this than using an exec statement, right? I hate using exec statements. class Vector(object): '''Creates a Maya vector/triple, having x, y and z coordinates as float values''' def __init__(self, x=0, y=0, z=0): self.x, self.y, self.z = x, y, z def attrsetter(attr): def set_float(self, value): setattr(self, attr, float(value)) return set_float for xyz in 'xyz': exec("%s = property(fget=attrgetter('_%s'), fset=attrsetter('_%s'))" % (xyz, xyz, xyz))

    Read the article

  • Mapping Cassandra Super Columns

    - by Laubstein
    Hello dudes, I guess everybody that played with Cassandra already read this article. I trying to create my schema on CassandraCli, but I am having a lot of problems, can someone guide me to the right way? I am trying to create a similar structure like the Comments column family from the article. In CassandraCli terminal I type: create column family posts with column_type = ‘Super’ and comparator = ‘AsciiType’ and subcomparator = TimeUUIDType; It works fine, there is no doc telling me that if I add a column_metadata attribute those will be for the super columns cause my column family is of type super, i can’t find if it is true so: create column family posts with column_type = ‘Super’ and comparator = ‘AsciiType’ and subcomparator = ‘TimeUUIDType’ and column_metadata = [{column_name:'body'}]; I am trying to create the same as the comment column family of the article, but when i try to populate set posts['post1'][timeuuid()][body] = ‘Hello I am Goku!’; i got: Invalid UUID string: body I guess because i chose the subcomparator be of type timeuuid and the body is a string, it should be a timeuuid, so HOW my columns inside the super column which is the type timeuuid could holds columns with string type names as the comments of the article are created? Thanks

    Read the article

  • PHP Prepared Statement Returns -1

    - by pws5068
    I've been using prepared statements for a little while now and I've never had any problems. Now I'm trying to: $sql="SELECT PhotoID,Caption FROM Photos WHERE EntityID=? AND TypeID=? LIMIT ?,?"; $iDB = new mysqliDB(); // Extends mysqli $stmt = $iDB->prepare($sql); $stmt->bind_param('iiii',$entityID,$typeID,$minRange,$maxRange); $stmt->execute(); $stmt->bind_result($photoID,$caption); echo("Affected={$stmt->affected_rows}"); This prints -1. I have triple tested that all 4 values in bindParam are set, and that the sql query works when pasted into myAdmin with the respective values. Any idea what may be causing this?

    Read the article

  • c# HTTPListener encoding issue

    - by Rob Griffin
    I have a Java application sending HTTP requests to a C# application. The C# app uses HTTPListener to listen for requests and respond. On the Java side I'm encoding the URL using UTF-8. When I send a \ character it gets encoded as %5C as expected but on the C# side it becomes a / character. The encoding for the request object is Windows-1252 which I think may be causing the problem. How do I set the default encoding to UTF-8? Currently I'm doing this to convert the encoding: foreach (string key in request.QueryString.Keys) { if (key != null) { byte[] sourceBytes =request.ContentEncoding.GetBytes(request.QueryString[key]); string value = Encoding.UTF8.GetString(sourceBytes)); } } This handles the non ASCII characters I'm also sending but doesn't fix the slash problem. Examining request.QueryString[key] in the debugger shows that the / is already there.

    Read the article

  • Scripts to parse and download iTunes Connect and AppStore data

    - by bradhouse
    I'm looking for recommendations of a script or series of scripts that download and parse iTunes Connect sales data and AppStore comments, ratings and rankings data for a defined app. I'm also aware of solutions like: AppViz appsales-mobile iphone-stats Heartbeat.app I'm sure I'll find a few more with more searching. I can't help but feel there must be a really decent set of open source scripts out there to do this, given how many developers are now writing apps for the AppStore. Would be interested to hear any commercial offerings as well (although my personal preference is for open source, so I can at least see what it is doing with my iTunes Connect login credentials). To be clear, I'm really looking for something that hits all of the areas mentioned: App Store (per store) Comments Ratings Category/store rankings iTunes Connect The contents of the sales reports Analysis/graphs of the data is not necessary (but would be a nice to have I guess). I'm not really looking for something like AppSales Mobile above, I would like the raw data so I can do my own analysis and formatting. So far it looks like AppViz (listed above) is the best out there. Any suggestions on what is good/available or should I just go roll my own?

    Read the article

  • Turing Machine & Modern Computer

    - by smwikipedia
    I heard a lot that modern computers are based on Turing machine. I'd like to share my understanding and hear your comments. I think the computer is a big general-purpose Turing machine. Each program we write is a small specific-purpose Turing machine. The classical Turing machine do its job based on the input and its current state inside and so do our programs. Let's take a running program (a process) as an example. We know that in the process's address space, there's areas for stack, heap, and code. A classical Turing machine doesn't have the ability to remember many things, so we borrow the concept of stack from the push-down automaton. The heap and stack areas contains the state of our specific-purpose Turing machine (our program). The code area represents the logic of this small Turing machine. And various I/O devices supply input to this Turing machine. The above is my naive understanding about the working paradigm of modern computer. I couln't wait to hear your comments. Thanks very much.

    Read the article

  • Getting an empty response when calling CouchDB over ajax

    - by swilliams
    I'm new to CouchDB, so please bear with me. I have an instance of CouchDB running on a VM. I can access it just fine through the browser via futon or directly at: http://192.168.62.128:5984/articles/hot_dog Calling that URL in a browser returns the proper JSON. But, when I try to call that exact same URL via ajax, I get nothing: var ajaxUrl = 'http://192.168.62.128:5984/articles/hot_dog'; $.getJSON(ajaxUrl, null, function(data) { alert(data); }); Looking at the response header with Firebug shows me that the HTTP response was 200 and the content-length is the right size. Even the Etag matches with what is in CouchDB. But the response itself is empty! The URL is absolutely right; I've triple checked, and copy/pasted it directly (and besides it wouldn't give a 200 response if it weren't). I'm using jQuery 1.4.2, and CouchDB 0.8 What's going on?

    Read the article

  • What's your most controversial programming opinion?

    - by Jon Skeet
    This is definitely subjective, but I'd like to try to avoid it becoming argumentative. I think it could be an interesting question if people treat it appropriately. The idea for this question came from the comment thread from my answer to the "What are five things you hate about your favorite language?" question. I contended that classes in C# should be sealed by default - I won't put my reasoning in the question, but I might write a fuller explanation as an answer to this question. I was surprised at the heat of the discussion in the comments (25 comments currently). So, what contentious opinions do you hold? I'd rather avoid the kind of thing which ends up being pretty religious with relatively little basis (e.g. brace placing) but examples might include things like "unit testing isn't actually terribly helpful" or "public fields are okay really". The important thing (to me, anyway) is that you've got reasons behind your opinions. Please present your opinion and reasoning - I would encourage people to vote for opinions which are well-argued and interesting, whether or not you happen to agree with them.

    Read the article

  • AJAX jQuery click results in function event being fired twice

    - by pmagunia
    I have an AJAX chat room module in Drupal and I am trying to insert BBCode stlye tex tags to the submit box when the user clicks Insert Tex. I managed to get the following code to work the first time but afterwards when I click Insert Tex it inserts the tex tags triple times. $('#edit-chatroom-message-entry-submit').click(function (e) { e.preventDefault(); e.stopPropagation(); if ($('#edit-chatroom-message-entry-box').val()){ Drupal.chatroom.postMessage($('#edit-chatroom-message-entry-box').val()); $('#edit-chatroom-message-entry-box').val('').focus(); } }); $('#edit-chatroom-tex-submit').click(function (e) { e.preventDefault(); e.stopPropagation(); $('#edit-chatroom-message-entry-box').val($('#edit-chatroom-message-entry-box').val() + '[tex][/tex]'); }); I would appreciate it if a suggestion could be make to make the code work properly.

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >