Search Results

Search found 2767 results on 111 pages for 'alex king'.

Page 79/111 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • mysql_affected_rows() returns 0 for UPDATE statement even when an update actually happens

    - by Alex Moore
    I am trying to get the number of rows affected in a simple mysql update query. However, when I run this code below, PHP's mysql_affected_rows() always equals 0. No matter if foo=1 already (in which case the function should correctly return 0, since no rows were changed), or if foo currently equals some other integer (in which case the function should return 1). $updateQuery = "UPDATE myTable SET foo=1 WHERE bar=2"; mysql_query($updateQuery); if (mysql_affected_rows() > 0) { echo "affected!"; } else { echo "not affected"; // always prints not affected } The UPDATE statement itself works. The INT gets changed in my database. I have also double-checked that the database connection isn't being closed beforehand or anything funky. Keep in mind, mysql_affected_rows doesn't necessarily require you to pass a connection link identifier, though I've tried that too. Details on the function: mysql_affected_rows Any ideas? SOLUTION The part I didn't mention turned out to be the cause of my woes here. This PHP file was being called ten times consecutively in an AJAX call, though I was only looking at the value returned on the last call, ie. a big fat 0. My apologies!

    Read the article

  • Is there a true all-in-one solution for PHP Development?

    - by Alex R
    I'm looking for a "SINGLE INSTALLER" solution for PHP Development. Is there anything out there which will give me a nice IDE, Web Server, Debugger, Database, etc, on a single install image (*.msi or *.exe)? This of course would be completely opposite of Eclipse PDT, which requires you to search and locate a bunch of additional components which never quite work together.

    Read the article

  • Advanced XPath query

    - by alex
    Hello, I have an XML file that looks like this: <?xml version="1.0" encoding="utf-8" ?> <PrivateSchool> <Teacher id="teacher1"> <Name> teacher1Name </Name> </Teacher> <Teacher id="teacher2"> <Name> teacher2Name </Name> </Teacher> <Student id="student1"> <Name> student1Name </Name> </Student> <Student id="student2"> <Name> student2Name </Name> </Student> <Lesson student="student1" teacher="teacher1" /> <Lesson student="student2" teacher="teacher2" /> <Lesson student="student3" teacher="teacher3" /> <Lesson student="student1" teacher="teacher2" /> <Lesson student="student3" teacher="teacher3" /> <Lesson student="student1" teacher="teacher1" /> <Lesson student="student2" teacher="teacher4" /> <Lesson student="student1" teacher="teacher1" /> </PrivateSchool> There's also a DTD associated with this XML, but I assume it's not much relevant to my question. Let's assume all needed teachers and students are well defined. What is the XPath query that returns the teachers' NAMES, that have at least one student that took more than 10 lessons with them? I was looking at many XPath sites/examples. Nothing seemed advanced enough for this kind of question... Thank you

    Read the article

  • NHibernate does not update entity when repository is passed by constructor

    - by Alex
    Hi everybody, I am developing with NHibernate for the first time in conjunction with ASP.NET MVC and StructureMap. The CodeCampServer serves as a great example for me. I really like the different concepts which were implemented there and I can learn a lot from it. In my controllers I use Constructur Dependency Injection to get an instance of the specific repository needed. My problem is: If I change an attribute of the customer the customer's data is not updated in the database, although Commit() is called on the transaction object (by a HttpModule). public class AccountsController : Controller { private readonly ICustomerRepository repository; public AccountsController(ICustomerRepository repository) { this.repository = repository; } public ActionResult Save(Customer customer) { Customer customerToUpdate = repository .GetById(customer.Id); customerToUpdate.GivenName = "test"; //<-- customer does not get updated in database return View(); } } On the other hand this is working: public class AccountsController : Controller { [LoadCurrentCustomer] public ActionResult Save(Customer customer) { customer.GivenName = "test"; //<-- Customer gets updated return View(); } } public class LoadCurrentCustomer : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { const string parameterName = "Customer"; if (filterContext.ActionParameters.ContainsKey(parameterName)) { if (filterContext.HttpContext.User.Identity.IsAuthenticated) { Customer CurrentCustomer = DependencyResolverFactory .GetDefault() .Resolve<IUserSession>() .GetCurrentUser(); filterContext.ActionParameters[parameterName] = CurrentCustomer; } } base.OnActionExecuting(filterContext); } } public class UserSession : IUserSession { private readonly ICustomerRepository repository; public UserSession(ICustomerRepository customerRepository) { repository = customerRepository; } public Customer GetCurrentUser() { var identity = HttpContext.Current.User.Identity; if (!identity.IsAuthenticated) { return null; } Customer customer = repository.GetByEmailAddress(identity.Name); return customer; } } I also tried to call update on the repository like the following code shows. But this leads to an NHibernateException which says "Illegal attempt to associate a collection with two open sessions". Actually there is only one. public ActionResult Save(Customer customer) { Customer customerToUpdate = repository .GetById(customer.Id); customer.GivenName = "test"; repository.Update(customerToUpdate); return View(); } Does somebody have an idea why the customer is not updated in the first example but is updated in the second example? Why does NHibernate say that there are two open sessions?

    Read the article

  • What's quicker and better to determine if an array key exists in PHP?

    - by alex
    Consider these 2 examples $key = 'jim'; // example 1 if (isset($array[$key])) { doWhatIWant(); } // example 2 if (array_key_exists($key, $array)) { doWhatIWant(); } I'm interested in knowing if either of these are better. I've always used the first, but have seen a lot of people use the second example on this site. So, which is better? Faster? Clearer intent? Update Thanks for the quality answers. I now understand the difference between the 2. A benchmark states that isset() alone is quicker than array_key_exists(). However, if you want the isset() to behave like array_key_exists() it is slower.

    Read the article

  • Jquery Resizable Image size issue

    - by alex
    Image size is not automatically detected when using jquery resizable. Both Firefox and IE displays the image much smaller, and chrome show nothing at all. I can't seem to find a direct answer to this issue. How can this be fixed. <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/base/jquery-ui.css" type="text/css" media="all"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"> </script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js" type="text/javascript"> </script> <img src="http://www.carsyouwilldrive.com/wp-content/uploads/2009/06/futurecar1.jpg"> <script type="text/javascript"> $("img").resizable(); </script>

    Read the article

  • Why specifcially in my example does this "too much recursion" error occur in my JavaScript?

    - by alex
    I have been looking into this for a little while now. I have a gallery on my page, that uses Ariel Flesler's scrollTo plugin. It works fine on the home page, but not on the Contact page. In Firefox, I get the error... Too much recursion I have sorted through as much code as possible and set breakpoints in a few places. I am pretty sure it is something to do with the plugin (specifically, when it is called in the click handler). For your convenience, I am using the unpacked versions of jQuery and scrollTo plugin. What on earth am I doing wrong? Thanks for your time.

    Read the article

  • Why does Perl lose foreign characters on Windows input - can this be fixed (if so, how) or is Perl an outdated dinosaur that just can't handle this?

    - by Alex R
    Note below how ã changes to a This is causing me a huge problem as foreign characters show up in URLs, e.g. http://pt.wikipedia.org/wiki/Cão The OS is Windows 7, 64-bit. The Perl is: This is perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x64-multi-thread (with 8 registered patches, see perl -V for more detail) Copyright 1987-2010, Larry Wall Binary build 1202 [293621] provided by ActiveState http://www.ActiveState.com Built Sep 6 2010 22:53:42 Additional update: To get around my particular problem, I tried using File::Find instead of piped input. The issue actually gets worse:

    Read the article

  • [C#] Running elevated applications on user login with UAC?

    - by Alex
    I need to start a program every time the user logs in, but I cannot do this without being met by a UAC dialog asking for permissions for that application. Is there any way to have an application start up on user login without the user having to answer the UAC prompt? I was thinking about running a service, but this would be a last resort. I saw something about an Application Compatibility Toolkit to disable UAC for certain applications, but I feel this is too big of a hassle - even services would be easier to program. I was just wondering if there is an even easier solution I am missing. Thanks in advance.

    Read the article

  • Javascript document.open asynchronous?

    - by Alex Schneider
    So on my site there is a Javascript function that will load a new site from the server via XMLHttpRequest. After that it replaces the current page with the new one: var post = new XMLHttpRequest(); post.open('POST', data); post.onload = function() { var do = document.open("text/html", "replace"); do.write(post.responseText); do.close(); goOn(); } function goOn() { console.log($('img:visible')); } Some could assume that after do.close() the document has changed and is ready. But it is not, e.g. if i load very much/big data/responseText the function goOn() only logs an empty result. Obviously goOn() gets in that case called before the DOM is ready to be read! Unfortunately the is no "ready" event fired after write() finished.... How can i be sure it is finished? /EDIT: goOn() logs this to Chrome Console: [prevObject: p.fn.p.init[1], context: #document, selector: "img:visible"] context: #document length: 0 prevObject: p.fn.p.init[1] selector: "img:visible" __proto__: Object[0] But if i right after that type $('img:visible') into console manually it shows me all images....

    Read the article

  • Form creating sites with output

    - by Alex
    Sites lite faary.com wufoo.com/and theformsite.com help you building forms But the output tables that being created are password protected as far as i know. Are there sites/scripts like the above which can make the output visible to all ? Something like a "guest book" script/form that you can edit the fields and the output will show immediately ? Thank you.

    Read the article

  • Why does Eclipse crash with Xmx, XX:MaxPermSize above certain values?

    - by alex
    Running Eclipse 3.5.1, JDK 1.6.0_17 on WinXP SP3 32Bit with 3.5 gigs of RAM. I'm aware of the known Eclipse best practices, still trying to figure out eclipse.ini. This will launch: -Xmx588m and this won't: -Xmx589m. Same with -XX:MaxPermSize. Anything above -XX:MaxPermSize=140m won't launch. The screen of death is simlar to this (taken from here). Any ideas on why might this be happening?

    Read the article

  • Can Django be used for web services?

    - by alex
    My friend said, "Pylons is so much better for web services." My other friend said, "You can modify Django in a way to do exactly whatever you like." In Django, what is necessary to be modified (urls.py? models classes? settings?) in order to do "web services" with APIs and REST and versioning, etc etc.?

    Read the article

  • How to create a step by step wizard in C++ (with unmanaged code) in Visual Studio 2010

    - by Alex. S.
    I would like to build a small wizard in C++ with no dependencies on any framework. Apparently, is really simple, but I don't know where to start. Can you point me to good information (tutorials, etc) on it. Should I use MFC Application or a Win32 project? Is there any step by step guide ? I'm using VS 2010. The majority of info I'd found on MFC is really old. It seems like the vast majority of development is going .net.

    Read the article

  • Python - how to check if weak reference is still available

    - by Alex
    Hi all, I am passing some weakrefs from Python into C++ class, but C++ destructors are actively trying to access the ref when the real object is already dead, obviously it crashes... Is there any Python C/API approach to find out if Python reference is still alive or any other known workaround for this ? Thanks

    Read the article

  • C#: Perform Operations on GPU, not CPU (Calculate Pi)

    - by Alex
    Hello, I've recently read a lot about software (mostly scientific/math and encryption related) that moves part of their calculation onto the GPU which causes a 100-1000 (!) fold increase in speed for supported operations. Is there a library, API or other way to run something on the GPU via C#? I'm thinking of simple Pi calculation. I have a GeForce 8800 GTX if that's relevant at all (would prefer card independent solution though). Any hints are appreciated!

    Read the article

  • Condor job using DAG with some jobs needing to run the same host

    - by gurney alex
    I have a computation task which is split in several individual program executions, with dependencies. I'm using Condor 7 as task scheduler (with the Vanilla Universe, due do constraints on the programs beyond my reach, so no checkpointing is involved), so DAG looks like a natural solution. However some of the programs need to run on the same host. I could not find a reference on how to do this in the Condor manuals. Example DAG file: JOB A A.condor JOB B B.condor JOB C C.condor JOB D D.condor PARENT A CHILD B C PARENT B C CHILD D I need to express that B and D need to be run on the same computer node, without breaking the parallel execution of B and C. Thanks for your help.

    Read the article

  • Is JSON array parsable?

    - by Alex
    I have a YQL query that extracts data from a page and returns it to my script as JSON. The JSON is huge, and as such, here's my question: Is JSON array parsable? So that I can iterate over the entire JSON structure?

    Read the article

  • jQuery select image in div if image parent does't have a certain class.

    - by Alex
    Wordpress wraps images with captions in a div with a class of .wp-caption. I'm looking for a way to select images that don't have this div so I can wrap them in different div. (to keep a consistent border around all the images) <div class="blog-post-content"> <div id="attachment_220" class="wp-caption alignleft" style="width: 310px"> <a href="/somewhere/"><img class="size-medium wp-image-220" src="/path/to/image" alt="" width="300" height="280" /></a> <p class="wp-caption-text">Caption Text</p> </div> <p>This is the body of the post</p> </div> To test my selector, I'm just trying to add a green border. I can handle the .wrap() once the selector is working. The most promising of my attempts is: $('.blog-post-content img').parent('div:not(".wp-caption")').css('border', '2px solid green'); ... but no luck.

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >