Search Results

Search found 1489 results on 60 pages for 'peter walser'.

Page 33/60 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • What happens when you click a button using WebRat under cucumber

    - by Peter Tillemans
    I am trying to login to a Java web application. The login page has the following html : <html> <head><title>Login Page</title></head> <body onload='document.f.j_username.focus();'> <h3>Login with Username and Password</h3> <form name='f' action='/ui/j_spring_security_check' method='POST'> <table> <tr><td>User:</td><td><input type='text' name='j_username' value=''></td></tr> <tr><td>Password:</td><td><input type='password' name='j_password'/></td></tr> <tr> <td><input type='checkbox' name='_spring_security_remember_me'/> </td> <td>Remember me on this computer.</td> </tr> <tr><td colspan='2'><input name="submit" type="submit"/></td></tr> <tr><td colspan='2'><input name="reset" type="reset"/></td></tr> </table> </form> </body> </html> I use the following script: Given /^I am logged in as (.*) with password (.*)$/ do | user, password | visit "http://localhost:8080/ui" click_link "Projects" puts "Response Body:" puts response.body assert_contain "User:" fill_in "j_username", :with => user fill_in "j_password", :with => password puts "Response Body:" puts response.body click_button puts "Response Body:" puts response.body end This gives the following in the log file : [INFO] Response Body: [INFO] <html><head><title>Login Page</title></head><body onload='document.f.j_username.focus();'> [INFO] <h3>Login with Username and Password</h3><form name='f' action='/ui/j_spring_security_check' method='POST'> [INFO] <table> [INFO] <tr><td>User:</td><td><input type='text' name='j_username' value=''></td></tr> [INFO] <tr><td>Password:</td><td><input type='password' name='j_password'/></td></tr> [INFO] <tr><td><input type='checkbox' name='_spring_security_remember_me'/></td><td>Remember me on this computer.</td></tr> [INFO] <tr><td colspan='2'><input name="submit" type="submit"/></td></tr> [INFO] <tr><td colspan='2'><input name="reset" type="reset"/></td></tr> [INFO] </table> [INFO] </form></body></html> [INFO] Response Body: [INFO] <html><head><title>Login Page</title></head><body onload='document.f.j_username.focus();'> [INFO] <h3>Login with Username and Password</h3><form name='f' action='/ui/j_spring_security_check' method='POST'> [INFO] <table> [INFO] <tr><td>User:</td><td><input type='text' name='j_username' value=''></td></tr> [INFO] <tr><td>Password:</td><td><input type='password' name='j_password'/></td></tr> [INFO] <tr><td><input type='checkbox' name='_spring_security_remember_me'/></td><td>Remember me on this computer.</td></tr> [INFO] <tr><td colspan='2'><input name="submit" type="submit"/></td></tr> [INFO] <tr><td colspan='2'><input name="reset" type="reset"/></td></tr> [INFO] </table> [INFO] </form></body></html> [INFO] Response Body: [INFO] [INFO] Given I am logged in as pti with password ptipti # features/step_definitions/authentication_tests.rb:2 So apparently the response.body disappeared after clicking the submit button. I can see from the server log files that the script does not arrive on the Project page. I am new to webrat and quite new to ruby and I am now thoroughly confused. I have no idea why the response.body is gone. I have no idea where I am. I speculated that I had to wait for the page request, but all documentation says that webrat nicely waits till all redirects, pageloads, etc are finished. (At least I think I read that). Besides I find no method to wait for the page in the webrat API. Can someone give some tips on how to proceed with debugging this?

    Read the article

  • Query to show images with recent posts in Wordpress sidebar/widget

    - by Peter
    To show recent items from a Wordpress category in a widget I'm using this code... <ul> <?php $recent = new WP_Query("cat=1231&showposts=5"); while($recent->have_posts()) : $recent->the_post();?> <li><a href="<?php the_permalink() ?>" rel="bookmark"> <?php the_title(); ?> </a></li> <?php endwhile; ?> </ul> ...but how can I make this query also display the first image in each post, and is there any way to set a 'default' image in case there is no image? Is there also a way to use thumbnails here, rather than loading the full size image and using HTML to resize?

    Read the article

  • Can I pass an argument to a VBScript (vbs file launched with cscript)?

    - by Peter
    I have this script saved in "test.vbs": Set FSO = CreateObject("Scripting.FileSystemObject") Set File = FSO.OpenTextFile(workFolder &"\test.txt", 2, True) File.Write "testing" File.Close Set File = Nothing Set FSO = Nothing Set workFolder = Nothing When I run the script I want to pass the value of the "workFolder" variable. How can I do this? Can I do it? Something like "cscript test.vbs workFolder:'C:\temp\'" perhaps? Bonus question: Is it neccessary to clean up the passed variable with "Set workFolder = Nothing" or does VBSCript do that automatically when it terminates? Maybe "Set File = Nothing" and "Set FSO = Nothing" is unneccessary also? Please let me know if you know the answer to both these questions.

    Read the article

  • Where do you take mocking - immediate dependencies, or do you grow the boundaries...?

    - by Peter Mounce
    So, I'm reasonably new to both unit testing and mocking in C# and .NET; I'm using xUnit.net and Rhino Mocks respectively. I'm a convert, and I'm focussing on writing behaviour specifications, I guess, instead of being purely TDD. Bah, semantics; I want an automated safety net to work above, essentially. A thought struck me though. I get programming against interfaces, and the benefits as far as breaking apart dependencies goes there. Sold. However, in my behaviour verification suite (aka unit tests ;-) ), I'm asserting behaviour one interface at a time. As in, one implementation of an interface at a time, with all of its dependencies mocked out and expectations set up. The approach seems to be that if we verify that a class behaves as it should against its collaborating dependencies, and in turn relies on each of those collaborating dependencies to have signed that same quality contract, we're golden. Seems reasonable enough. Back to the thought, though. Is there any value in semi-integration tests, where a test-fixture is asserting against a unit of concrete implementations that are wired together, and we're testing its internal behaviour against mocked dependencies? I just re-read that and I think I could probably have worded it better. Obviously, there's going to be a certain amount of "well, if it adds value for you, keep doing it", I suppose - but has anyone else thought about doing that, and reaped benefits from it outweighing the costs?

    Read the article

  • JS Object this.method() breaks via jQuery

    - by Peter Boughton
    I'm sure there's a simple answer to this, but it's Friday afternoon and I'm tired. :( Not sure how to explain it, so I'll just go ahead and post example code... Here is a simple object: var Bob = { Stuff : '' , init : function() { this.Stuff = arguments[0] } , doSomething : function() { console.log( this.Stuff ); } } And here it is being used: $j = jQuery.noConflict(); $j(document).ready( init ); function init() { Bob.init('hello'); Bob.doSomething(); $j('#MyButton').click( Bob.doSomething ); } Everything works, except for the last line. When jQuery calls the doSomething method it is overriding 'this' and stopping it from working. Trying to use just Stuff doesn't work either. So how do I refer to an object's own properties in a way that allows jQuery to call it, and also allows the object to work with the calling jQuery object? i.e. I would like to be able to do things like this: doSomething : function() { console.log( <CurrentObject>.Stuff + $j(<CallerElement>).attr('id') ); } (Where <CurrentObject> and <CallerElement> are replaced with appropriate names.)

    Read the article

  • How to fix this java.lang.LinkageError?

    - by Péter Török
    I am trying to configure a custom layout class to Log4J as described in my previous post. The class uses java.util.regex.Matcher to identify potential credit card numbers in log messages. It works perfectly in unit tests (I can also programmatically configure a logger to use it and produce the expected output). However when I try to deploy it with our app in JBoss, I get the following error: --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- ObjectName: jboss.web.deployment:war=MyWebApp-2010_02-SNAPSHOT.war,id=476602902 State: FAILED Reason: java.lang.LinkageError: java/util/regex/Matcher I couldn't even find any info on this form of the error - typically LinkageError seems to show up with a "loader constrain violation" message, like in here. Technical details: we use JBoss 4.2, Java 5, Log4J 1.2.12. We deploy our app in an .ear, which contains (among others) the above mentioned .war file, and the custom layout class in a separate jar file. We override the default settings in jboss-log4J.xml with our own log4j.properties located in a different folder, which is added to the classpath at startup, and is provided via Carbon. I can only guess: are two different Matcher class versions loaded from somewhere, or is Matcher loaded by two different classloaders when it is used from the jar and the war? What does this error message mean, and how can I fix it?

    Read the article

  • Accessing Sabre Web Services using PHP

    - by Peter
    I have been approached to create a website using Sabre Web Services to power the reservations system. All documentation I have seen refers to .NET or Java solutions, I was in doubt whether PHP can be used as access is performed using SOAP. I have found no further information about this, I assume the answer is yes, but wonder why there is not a single reference to this being possible - all solutions seem to be .NET Any suggestions? Thanks!

    Read the article

  • Simple PHP file

    - by Peter
    Here is my code <html> <body> <?php echo "<b>Hello World</b> <br />"; ?> </body> </html> I have named the file as test.php but I dont get the desired output in my firefox 3.6 browser. Output Hello World "; ?>

    Read the article

  • Make iPad app a Universal app

    - by Peter Hajas
    I have an iPad app that I would like to make Universal, however this seems alarmingly difficult. I've changed things around so that I support both builds, but when building, I get lots of errors about using UIPopOvers. Here're my questions: Why does UI_USER_INTERFACE_IDIOM() not compile or register on 3.1.3? Can I conditionally have variables in a class definition based on UI_USER_INTERFACE_IDIOM()? If not, should I make two different view controllers? Thanks!

    Read the article

  • Rsync: pure Ruby implementation?

    - by peter
    I have a Rsync program Deltacopy with an executable as client and server but would like to replace this if possible with a pure Ruby implementation of Rsync. I found gems like six-rsync and rsync-update but they seem to be no general implementations. I'm looking for a pure Ruby solution, so no executables involved and preferably runnable on multiple OS. If possible a simple sample would be great. I only look for Rsync, no other transfer or backup solutions please.

    Read the article

  • How to load an HTML file into an included PHP file from another PHP?

    - by Peter NGM
    i have 2 PHP file and 1 HTML. i want to include file2.php in file1.php. file1.php is: <html> <head>...</head> <body> ... <?php include("file2.php"); ?> ... </body> </html> i want to load an HTML file in file2.php: file2.php is: <?php $doc = new DOMDocument(); $doc->loadHTMLFile("sample.html"); echo $doc->saveHTML(); ?> and sample.html is: ... <b>Hello World!</b> ... my problem is this error: Warning: DOMDocument::loadHTMLFile() [domdocument.loadhtmlfile]: I/O warning : failed to load external entity "sample.html" in C:\xampp\htdocs\project\file2.php on line 3 please help me to solve this problem.

    Read the article

  • How do I get an overview and a methodology for programming in Python

    - by Peter Nielsen
    I've started to learn Python and programming from scratch. I have not programmed before so it's a new experience. I do seem to grasp most of the concepts, from variables to definitions and modules. I still need to learn a lot more about what the different libraries and modules do and also I lack knowledge on OOP and classes in Python. I see people who just program in Python like that's all they have ever done and I am still just coming to grips with it. Is there a way, some tools, a logical methodology that would give me an overview or a good hold of how to handle programming problems ? For instance, I'm trying to create a parser which we need at the office . I also need to create a spider that would collect links from various websites. Is there a formidable way of studying the various modules to see what is needed ? Or is it just nose to the grind stone and understand what the documentation says ? Sorry for the lengthy question..

    Read the article

  • ASP.NET MVC 2.0 + Implementation of a IRouteHandler does not fire

    - by Peter
    Can anybody please help me with this as I have no idea why public IHttpHandler GetHttpHandler(RequestContext requestContext) is not executing. In my Global.asax.cs I have public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); routes.Add("ImageRoutes", new Route("Images/{filename}", new CustomRouteHandler())); } protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } } //CustomRouteHandler implementation is below public class CustomRouteHandler : IRouteHandler { public IHttpHandler GetHttpHandler(RequestContext requestContext) { // IF I SET A BREAK POINT HERE IT DOES NOT HIT FOR SOME REASON. string filename = requestContext.RouteData.Values["filename"] as string; if (string.IsNullOrEmpty(filename)) { // return a 404 HttpHandler here } else { requestContext.HttpContext.Response.Clear(); requestContext.HttpContext.Response.ContentType = GetContentType(requestContext.HttpContext.Request.Url.ToString()); // find physical path to image here. string filepath = requestContext.HttpContext.Server.MapPath("~/logo.jpg"); requestContext.HttpContext.Response.WriteFile(filepath); requestContext.HttpContext.Response.End(); } return null; } } Can any body tell me what I'm missing here. Simply public IHttpHandler GetHttpHandler(RequestContext requestContext) does not fire. I havn't change anything in the web.config either. What I'm missing here? Please help.

    Read the article

  • Learning to write organized and modular programs

    - by Peter
    I'm a computer science student, and I'm just starting to write relatively larger programs for my coursework (between 750 - 1500 lines). Up until now, it's been possible to get by with any reasonable level of modularization and object oriented design. However, now that I'm writing more complex code for my assignments I'd like to learn to write better code. Can anyone point me in the direction of some resources for learning about what sort of things to look for when designing your program's architecture so that you can make it as modularized as possible?

    Read the article

  • How do I find out what process Id and thread id / name has a file open

    - by peter
    Hi All, I am using C# in an application and am having some problems with a file becoming locked. The piece of code does this, while (true) { Read a packet from a socket (with data in it to add to the file) Open a file Writes data to it Close a file } But in the process the file becomes locked. I don't really understand how, we are are definately catching and reporting exceptions so I don't see how the file doesn't get closed every time. My best guess is that something else is opening the file, but I want to prove it. Can someone please provide a piece of code to check whether the file is open and if so report what processid and threadid has the file open. For example if I had this code, StreamWriter streamWriter1 = new StreamWriter(@"c:\logs\test.txt"); streamWriter1.WriteLine("Test"); // code to check for locks?? StreamWriter streamWriter2 = new StreamWriter(@"c:\logs\test.txt"); streamWriter1.Close(); streamWriter2.Close(); That will throw an exception because the file is locked when we try and open it the second time. So where the comment is what could I put in there to report that the current app (process Id) and the current thread (thread Id) have the file locked? Thanks.

    Read the article

  • Shell script argument parsing

    - by Peter Coulton
    There are a number of questions about this sort of thing but lets imagine we are targeting a generic Linux system with both getopt and getopts installed (not that we'll use either, but they seem popular) How do I parse both long (--example | --example simple-option) and short argruments (-e | -esimple-example | -e simple-example)

    Read the article

  • Deleting an Image that has been used by a WPF control

    - by Peter
    Hi, I would like to bind an Image to some kind of control an delete it later on. path = @"c:\somePath\somePic.jpg" FileInfo fi = new FileInfo(path); Uri uri = new Uri(fi.FullName, UriKind.Absolute); var img = new System.Windows.Controls.Image(); img.Source = new BitmapImage(uri); Now after this code I would like to delete the file : fi.Delete(); But I cannot do that since the image is being used now. Between code fragment 1 en 2 what can I do to release it? Thanks

    Read the article

  • How to make CodeIgniter accept "query string" URLs?

    - by Peter
    According to CI's docs, CodeIgniter uses a segment-based approach, for example: example.com/my/group If I want to find a specific group (id=5), I can visit example.com/my/group/5 And in the controller, define function group($id='') { ... } Now I want to use the traditional approach, which CI calls "query string" URL. Example: example.com/my/group?id=5 If I go to this URL directly, I get a 404 page not found. So how can I enable this?

    Read the article

  • How to @synthesize a C-Style array of pointers?

    - by Peter Hajas
    I have a property defined in a class like so: @interface myClass UIImageView *drawImage[4]; ... @property (nonatomic, retain) UIImageView **drawImage; ... @synthesize drawImage; // This fails to compile I have found similar questions on StackOverflow and elsewhere, but none that really address this issue. What is the most Objective-C kosher way to do this?

    Read the article

  • Delphi Component Serialization

    - by Peter
    Has anyone run into issues serializing components into a file and reading them back, specifically in the area where the component vendor upgrades the VCL components. For example a file serialized with DelphiX and then years later read back with delphiY. Do the serialization formats change and if so what can be done to prevent errors reading in the componets when upgrading.

    Read the article

  • Mysql through PHP gives a "Can't create/write to file" error

    - by Peter
    The full error is: Message: Mysqli statement execute error : Can't create/write to file '/var/www/zendApp/backup/mysql/1268733580_name.sql' (Errcode: 13) I have tried several things already with the /var/www/ZendApp/backup/mysql directory $chmod 777 mysql $chmod 1777 mysql $chown root:root mysql $chown mysql:mysql mysql But nothing helps. What am I doing wrong here? Do I have to tell mysql somewhere that I can write to that directory?

    Read the article

  • Whats wrong with this task queue setup?

    - by Peter Farmer
    I've setup this task queue implementation on a site I host for a customer, it has a cron job which runs each morning at 2am "/admin/tasks/queue", this queues up emails to be sent out, "/admin/tasks/email", and uses cursors so as to do the queuing in small chunks. For some reason last night /admin/tasks/queue kept getting run by this code and so sent out my whole quota of emails :/. Have I done something wrong with this code? class QueueUpEmail(webapp.RequestHandler): def post(self): subscribers = Subscriber.all() subscribers.filter("verified =", True) last_cursor = memcache.get('daily_email_cursor') if last_cursor: subscribers.with_cursor(last_cursor) subs = subscribers.fetch(10) logging.debug("POST - subs count = %i" % len(subs)) if len(subs) < 10: logging.debug("POST - Less than 10 subscribers in subs") # Subscribers left is less than 10, don't reschedule the task for sub in subs: task = taskqueue.Task(url='/admin/tasks/email', params={'email': sub.emailaddress, 'day': sub.day_no}) task.add("email") memcache.delete('daily_email_cursor') else: logging.debug("POST - Greater than 10 subscibers left in subs - reschedule") # Subscribers is 10 or greater, reschedule for sub in subs: task = taskqueue.Task(url='/admin/tasks/email', params={'email': sub.emailaddress, 'day': sub.day_no}) task.add("email") cursor = subscribers.cursor() memcache.set('daily_email_cursor', cursor) task = taskqueue.Task(url="/admin/tasks/queue", params={}) task.add("queueup")

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >