Daily Archives

Articles indexed Saturday April 17 2010

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

  • JQuery Ajax returns status 0 in Google Chrome, works fine with other browsers.

    - by Jason Zhou
    Hello, I am using jQuery ajax, and it worked very well until I tried the site in Google Chrome. I am directed to the success handler. However, when I printed the status of the XMLHttpRequest, I got a 0. The responseText is empty as well. This only happens in Google Chrome. I tried the same code on Safari, Firefox, and Opera, they are worked correctly. Any help will be greatly appreciated. Thanks.

    Read the article

  • Debugging embedded Lua

    - by Caspin
    How do you debug lua code embedded in a c++ application? From what I gather, either I need to buy a special IDE and link in their special lua runtime (ugh). Or I need to build a debug console in to the game engine, using the lua debug API calls. I am leaning toward writing my own debug console, but it seems like a lot of work. Time that I could better spend polishing the other portions of the game.

    Read the article

  • SQL Azure Security: DoS

    - by Herve Roggero
    Since I decided to understand in more depth how SQL Azure works I started to dig into its performance characteristics. So I decided to write an application that allows me to put SQL Azure to the test and compare results with a local SQL Server database. One of the options I added is the ability to issue the same command on multiple threads to get certain performance metrics. That's when I stumbled on an interesting security feature of SQL Azure: its Denial of Service (DoS) detection engine. What this security feature does is that it performs a check on the number of connections being established, and if the rate of connection is too high, SQL Azure blocks all communication from that machine. I am still trying to learn more about this specific feature, but it appears that going to the SQL Azure portal and testing the connection from the portal "resets" the feature and you are allowed to connect again... until you reach the login threashold. In the specific test I was performing, all the logins were successful. I haven't tried to login with an invalid account or password... that will be for next time. On my Linked In group (SQL Server and SQL Azure Security: http://www.linkedin.com/groups?gid=2569994&trk=hb_side_g) Chip Andrews (www.sqlsecurity.com) pointed out that this feature in itself could present an internal threat. In theory, a rogue application could be issuing many login requests from a NATed network, which could potentially prevent any production system from connecting to SQL Azure within the same network. My initial response was that this could indeed be the case. However, while the TCP protocol contains the latest NATed IP address of a machine (which masks the origin of the machine making the SQL request), the TDS protocol itself contains the IP Address of the machine making the initial request; so technically there would be a way for SQL Azure to block only the internal IP address making the rogue requests.  So this warrants further investigation... stay tuned...

    Read the article

  • Linux memory fragmentation

    - by Raghu
    Hi all, Is there a way to detect memory fragmentation on linux ? This is because on some long running servers I have noticed performance degradation and only after I restart process I see better performance. I noticed it more when using linux huge page support -- are huge pages in linux more prone to fragmentation ? I have looked at /proc/buddyinfo in particular. I want to know whether there are any better ways(not just CLI commands per se, any program or theoretical background would do) to look at it.

    Read the article

  • validating creation by post_id and ip_address - Ruby on Rails

    - by bgadoci
    I have created a blog application using Ruby on Rails which includes the ability to vote on posts. A user can click vote and a record is created in the vote table. I am now trying to limit that same person from voting for a post multiple times. class Post has_many :votes end class Vote belongs_to :post end When a vote record is created I am using the VotesController to pass the :post_id and using a hidden field in the view to pass the ip_address (both to the vote table). I am wondering if there is a way to add a validation to the Vote Model that searches to see if a post_id has an ip_address that matches the person requesting to vote. I have tried simply using the validates_uniqueness_of :ip_address but that restricts the user from voting on any post. I just want to restrict the user from voting on a particular post that they have already voted on. Is there a way to do this through validation?

    Read the article

  • Button outside view... how to make it work

    - by Mike
    I have a UIImageView based class that creates objects with the following characteristics: a small image square and a UITextView below. If the user drags the object by the image it can drag it around. If the user taps on the UITextView the keyboard has to appear and the user can change the text on it. The objects created by the class are like this: 1) the object creates a 60x60 pixels frame 2) puts an image inside that frame 3) creates a UITextView and puts it below that 60x60 frame. So, as the class is a UIImageView based and it creates an image with 60x60 pixels and the UITextView is located outside that area, in theory the text view is outside the area the tapping are for that object. Obviously I could make the class create a big square to encompass the image and the text view, but that frame would be too big and I have the objects created by this class to be as close as possible when I add them to another view. I could also create the text views from the same view I created the objects, but I would have to manage each object and each correspondent text view and I need them to move together... so, I have a problem. Any ideas on a simplest way to do that?

    Read the article

  • Type casting needed for byte = byte - byte?

    - by Vaccano
    I have the following code: foreach (byte b in bytes) { byte inv = byte.MaxValue - b; // Add the new value to a list.... } When I do this I get the following error: Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?) Each part of this statement is a byte. Why does C# want to convert the byte.MaxValue - b to an int? Shouldn't you be able to do this some how without casting? (i.e. I don't want to have to do this: byte inv = (byte) (byte.MaxValue - b);)

    Read the article

  • Problem when subClassing NSDate

    - by iFloh
    Hi, I first time tried to subClassed an NSDate to give it 2 methods that I need. Compiles fine, but in runtime I try to access it I get an error. Lets say I just want the current date which is unmodified in the subClass: [myNSDate date]; I get the error -[NSDate initWithTimeIntervalSinceReferenceDate:]: method only defined for abstract class. Define -[myNSDate initWithTimeIntervalSinceReferenceDate:]! what is different?

    Read the article

  • Virtual Keyboard doesn't appear when rotate the screen?

    - by user164589
    Hi guys. I am facing to a problem related virtual keyboard. I've created a layout that contains Button, TextView and EditText. When its screen orientation is Portrait, it can show the Virtual Keyboard by one touching on the EditText. Then I've changed screen orientation to Landscape. At this moment Virtual Keyboard hasn't been appeared. What is wrong here ? How to fix it ? I think this is big problem for my application. Please help. guys. Thanks.

    Read the article

  • Is there a way that I can hard code a const XmlNameTable to be reused by all of my XmlTextReader(s)?

    - by highone
    Before I continue I would just like to say I know that "Premature optimization is the root of all evil." However this program is only a hobby project and I enjoy trying to find ways to optimize it. That being said, I was reading an article on improving xml performance and it recommended sharing "the XmlNameTable class that is used to store element and attribute names across multiple XML documents of the same type to improve performance." I wasn't able to find any information about doing this in my googling, so it is likely that this is either not possible, a no-no, or a stupid question, but what's the harm in asking?

    Read the article

  • xml file reading

    - by Dilse Naaz
    How to read an xml file in silverlight using webclient. I have one task, in this the xml file that i stored in my machine will read and the content od the xml file will display on a data grid. how it will be done?

    Read the article

  • Hibernate: OutOfMemoryError persisting Blob when printing log message

    - by paul
    I have a Hibernate Entity: @Entity class Foo { //... @Lob public byte[] getBytes() { return bytes; } //.... } My VM is configured with a maximum heap size of 512 MB. When I try to persist an object which has a 75 MB large object, I get an OutOfMemoryError. The names of the methods in the stack trace (StringBuilder, ByteArrayBlobType.toLoggableString, pretty.Printer.toString) suggest that hibernate is trying to write a very large log message that contains my object. Am I correct about why hibernate is using so much memory? What is the simplest way to work around this problem? java.lang.OutOfMemoryError: Java heap space at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:44) at java.lang.StringBuilder.<init>(StringBuilder.java:81) at org.hibernate.type.ByteArrayBlobType.toString(ByteArrayBlobType.java:117) at org.hibernate.type.ByteArrayBlobType.toLoggableString(ByteArrayBlobType.java:127) at org.hibernate.pretty.Printer.toString(Printer.java:53) at org.hibernate.pretty.Printer.toString(Printer.java:90) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:97) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.jboss.seam.persistence.HibernateSessionProxy.flush(HibernateSessionProxy.java:181)

    Read the article

  • Implementing a Suspension or Penalty System for Users in ASP.NET MVC

    - by Maxim Z.
    I'm writing a site in ASP.NET MVC that will have user accounts. As the site will be oriented towards discussion, I think I need a system for admins to be able to moderate users, just like we have here, on Stack Overflow. I'd like to be able to put a user into a "suspension", so that they are able to log in to the site (at which point they are greeted with a message, such as, "Your account has been suspended until [DATE]"), but are unable to do the functions that users they would normally be able to do. What's the best way of implementing this? I was thinking of creating a "Suspended" role, but the thing is, I have a few different roles for normal users themselves, with different privileges. Have you ever designed a feature like this before? How should I do it? Thanks in advance.

    Read the article

  • Perl, deleting an .xml file created and open with IO::File and XML::Writer?

    - by Sho Minamimoto
    So I'm running through a list of things and have code that creates an .xml file with IO::File called $doc, then I make a new writer with XML::Writer(OUTPUT = $doc). More code runs and I build a big xml file with XML::Writer. Then, near the end of the file, I find out if I need this file at all. If I do need it, I just $writer-end(); $doc-close(); but if I don't need it, what should I enter to just delete all data I've stored/saved and move onto the next file? I tried unlink($docpath) (before and after $doc-close()), the file was not deleted.

    Read the article

  • learning C++ from java, trying to make a linked list.

    - by kyeana
    I just started learning c++ (coming from java) and am having some serious problems with doing anything :P Currently, i am attempting to make a linked list, but must be doing something stupid cause i keep getting "void value not ignored as it ought to be" compile errors (i have it marked where it is throwing it bellow). If anyone could help me with what im doing wrong, i would be very grateful :) Also, I am not used to having the choice of passing by reference, address, or value, and memory management in general (currently i have all my nodes and the data declared on the heap). If anyone has any general advice for me, i also wouldn't complain :P Key code from LinkedListNode.cpp LinkedListNode::LinkedListNode() { //set next and prev to null pData=0; //data needs to be a pointer so we can set it to null for //for the tail and head. pNext=0; pPrev=0; } /* * Sets the 'next' pointer to the memory address of the inputed reference. */ void LinkedListNode::SetNext(LinkedListNode& _next) { pNext=&_next; } /* * Sets the 'prev' pointer to the memory address of the inputed reference. */ void LinkedListNode::SetPrev(LinkedListNode& _prev) { pPrev=&_prev; } //rest of class Key code from LinkedList.cpp #include "LinkedList.h" LinkedList::LinkedList() { // Set head and tail of linked list. pHead = new LinkedListNode(); pTail = new LinkedListNode(); /* * THIS IS WHERE THE ERRORS ARE. */ *pHead->SetNext(*pTail); *pTail->SetPrev(*pHead); } //rest of class

    Read the article

  • How does the VS XAML designer know what to auto-populate certain values with?

    - by Pwninstein
    <Button Name="MyButton" Content="Test" FontStyle="Italic" /> In the above XAML definition of a button, the FontStyle property is set to Italic. The designer is somehow able to populate a list for me to choose from when I hit the = sign. How is this achieved? Before you answer, consider that the FontStyle property is, appropriately enough, of type FontStyle (which is a struct). It's not an enumeration, which would be trivial for VS to list out at design time, so how are the valid list of options chosen to be displayed? There is also a completely separate FontStyles class which contains three static fields, Italic, Normal, and Oblique which just so happen to be the three items VS provides in the drop down list. Is there some mapping going on behind the scenes between the FontStyle struct and FontStyles class, because I've looked in many places in both the object browser and in .NET Reflector and couldn't determine anything from either. Thanks!! I NEED to know!* *Not really, but it would be nice to :)

    Read the article

  • How to auto-mount encfs volume on login in ubuntu 9.10

    - by xzenox
    Hi, Previously, in 9.04, I was using pam mount in conjunction with encfs to mount an encrypted volume at login. This worked perfectly and since the password was the same as my user password, none was entered besides the initial login one. Now in 9.10, using the same setup and the same volume line in pam's config file, the volume will not mount. The folder does not even get created for the mount point. I am thinking this might be caused by the fact that I now switched to using an encrypted /home directory (previously left unencrypted on 9.04). To encrypt it, i used the standard /home encrypt setup from the 9.10 fresh install. I am thinking that perhaps, pam tries to mount the volume before /home is mounted and fails. Is there a log file I could look into/post here? Note that mounting manually works fine using the same paths, writing full paths does not help, nor is removing the options attribute. Here's my volume entry: <volume user="nicholas" fstype="fuse" path="encfs#~/.dropbox_dir/Dropbox/encrypted" mountpoint="~/Dropbox" options="nonempty" />

    Read the article

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