Search Results

Search found 107 results on 5 pages for 'kurt woods'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Git - tidying up a repo

    - by Simon Woods
    Hi I have got my repo into a bit of a state and want to be able to work my way out of it The repo looks a bit like this (A1, B1, C1 etc are obviously commits) A1 ---- A2 ---- A3 ---- A4 ---- A5 ---- A6 ---- A7 ---- A8 / (from a remote repo) B1 ---- B2 --------------------------------- | \ \ C1 ---------------------------------C2 \ / D1 --- D2 --- D3 --- D4 --- D5 --- D6 Ideally I'd like to be able to remove all the revisions (with rebase?) on the B, C and D lines (I'm loathed to say branches simply because there are now no local branches on these lines except ref branches to the remote repo) and try to merge in the remote repo again, perhaps in a better way. I'd be grateful of any suggestions as to how to get rid of all these commits. Could I ask that any answers use revision SHA1s rather than branch names. I thought that somehow I'd be able to revert the merge into A7 but can't quite work out how to do it I hope that is sufficient information. Many thx Simon

    Read the article

  • Design-time failure: WPF, Usercontrols and Namespaces

    - by Simon Woods
    Hi I have a very simple WPF project comprising a Window and Usercontrol. I'm very much in a learning phase. It works fine when I run it. However, I am unable to see the form in design time. The problem, I believe is something to do with namespaces, but I don't understand where. It may well be a simple error Main Window XML <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:views="clr-namespace:UserLogin" x:Class="UserLogin.MainView" x:Name="MainViewWindow" mc:Ignorable="d" Title="Login" Height="141" Width="347" > <Grid> <views:LoginView /> </Grid> </Window> Main Window CodeBehind Imports Microsoft.VisualBasic Imports System Imports System.Windows Imports UserLogin Namespace UserLogin Partial Public Class MainView Inherits System.Windows.Window Public Sub New() InitializeComponent() End Sub End Class End Namespace Usercontrol XAML <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" x:Class="UserLogin.LoginView" x:Name="LoginViewControl" mc:Ignorable="d" d:DesignHeight="96" d:DesignWidth="298"> <Grid Height="96" Width="298"> <Button Command="{Binding OKCommand}" Height="21" Margin="0,0,90,16" Name="btnOK" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="76">OK</Button> <Button Command="{Binding CancelCommand}" Height="21" HorizontalAlignment="Right" Margin="0,0,9,16" Name="btnCancel" VerticalAlignment="Bottom" Width="75">Cancel</Button> <Label Height="23" HorizontalAlignment="Left" Margin="10,5,0,0" Name="Label1" VerticalAlignment="Top" Width="85">Name:</Label> <Label HorizontalAlignment="Left" Margin="10,32,0,0" Name="Label2" Width="85" Height="29" VerticalAlignment="Top">Password:</Label> <TextBox Margin="0,31,6,0" Name="txtPassword" Height="22" VerticalAlignment="Top" HorizontalAlignment="Right" Width="182" /> <ComboBox Height="22" Margin="110,6,6,0" Name="cboNames" VerticalAlignment="Top" /> </Grid> </UserControl> Usercontrol CodeBehind Imports Microsoft.VisualBasic Imports System Imports UserLogin Namespace UserLogin Partial Public Class LoginView Inherits System.Windows.Controls.UserControl Public Sub New() InitializeComponent() End Sub End Class End Namespace I think I'm missing something this namespace xmlns:views="clr-namespace:UserLogin" since intellisense doesn't give me the usercontrol declared within it in the XAML designer but rather reports the error "Unable to load the metadata for the assembly ... etc etc" Thx for any suggestions Simon

    Read the article

  • Creating a list of most popular posts of the past week - Wordpress

    - by Gary Woods
    I have created a widget for my Wordpress platform that displays the most popular posts of the week. However, there is an issue with it. It counts the most popular posts from Monday, not the past 7 days. For instance, this means that on Tuesday, it will only include posts from Tuesday and Monday. Here is my widget code: <?php class PopularWidget extends WP_Widget { function PopularWidget(){ $widget_ops = array('description' => 'Displays Popular Posts'); $control_ops = array('width' => 400, 'height' => 300); parent::WP_Widget(false,$name='ET Popular Widget',$widget_ops,$control_ops); } /* Displays the Widget in the front-end */ function widget($args, $instance){ extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? 'Popular This Week' : $instance['title']); $postsNum = empty($instance['postsNum']) ? '' : $instance['postsNum']; $show_thisweek = isset($instance['thisweek']) ? (bool) $instance['thisweek'] : false; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; ?> <?php $additional_query = $show_thisweek ? '&year=' . date('Y') . '&w=' . date('W') : ''; query_posts( 'post_type=post&posts_per_page='.$postsNum.'&orderby=comment_count&order=DESC' . $additional_query ); ?> <div class="widget-aligned"> <h3 class="box-title">Popular Articles</h3> <div class="blog-entry"> <ol> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <li><h4 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4></li> <?php endwhile; endif; wp_reset_query(); ?> </ol> </div> </div> <!-- end widget-aligned --> <div style="clear:both;"></div> <?php echo $after_widget; } /*Saves the settings. */ function update($new_instance, $old_instance){ $instance = $old_instance; $instance['title'] = stripslashes($new_instance['title']); $instance['postsNum'] = stripslashes($new_instance['postsNum']); $instance['thisweek'] = 0; if ( isset($new_instance['thisweek']) ) $instance['thisweek'] = 1; return $instance; } /*Creates the form for the widget in the back-end. */ function form($instance){ //Defaults $instance = wp_parse_args( (array) $instance, array('title'=>'Popular Posts', 'postsNum'=>'','thisweek'=>false) ); $title = htmlspecialchars($instance['title']); $postsNum = htmlspecialchars($instance['postsNum']); # Title echo '<p><label for="' . $this->get_field_id('title') . '">' . 'Title:' . '</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . $title . '" /></p>'; # Number of posts echo '<p><label for="' . $this->get_field_id('postsNum') . '">' . 'Number of posts:' . '</label><input class="widefat" id="' . $this->get_field_id('postsNum') . '" name="' . $this->get_field_name('postsNum') . '" type="text" value="' . $postsNum . '" /></p>'; ?> <input class="checkbox" type="checkbox" <?php checked($instance['thisweek'], 1) ?> id="<?php echo $this->get_field_id('thisweek'); ?>" name="<?php echo $this->get_field_name('thisweek'); ?>" /> <label for="<?php echo $this->get_field_id('thisweek'); ?>"><?php esc_html_e('Popular this week','Aggregate'); ?></label> <?php } }// end AboutMeWidget class function PopularWidgetInit() { register_widget('PopularWidget'); } add_action('widgets_init', 'PopularWidgetInit'); ?> How can I change this script so that it will count the past 7 days rather than posts from last Monday?

    Read the article

  • GEdit/Python execution plugin?

    - by Simon Woods
    Hi I'm just starting out learning python with GEdit plus various plugins as my IDE. Visual Studio/F# has a feature which permits the highlighting on a piece of text in the code window which then, on a keypress, gets executed in the F# console. Is there a similar facility/plugin which would enable this sort of behaviour for GEdit/Python? I do have various execution type plugins (Run In Python,Better Python Console) but they don't give me this particular behaviour - or at least I'm not sure how to configure them to give me this. I find it useful because in learning python, I have some test code I want to execute particular individual lines or small segments of code (rather then a complete file) to try and understand what they are doing (and the copy/paste can get a bit tiresome) ... or perhaps there is a better way to do code exploration? Many thx Simon

    Read the article

  • Using IvyDE with different workspaces on different branches

    - by James Woods
    I am having problems using IvyDE when I have different workspaces for different branches. I have "Resolve dependencies in workspace" switched on. But everytime I change to a different workspace I have to remember to manually clean the caches out. This is because IvyDE always uses the default cache for resolving dependencies within a workspace, so when switching between workspaces the cache can be polluted by different versions. It would seem that it is impossible to work with two different workspaces at the same time. I cannot find a way to configure the location that IvyDE uses to cache the project dependencies. It does not appear to use the caches defined in the ivysettings.xml

    Read the article

  • Insert xelements using LINQ Select?

    - by Simon Woods
    I have a source piece of xml into which I want to insert multiple elements which are created dependant upon certain values found in the original xml At present I have a sub which does this for me: <Extension()> Public Sub AddElements(ByVal xml As XElement, ByVal elementList As IEnumerable(Of XElement)) For Each e In elementList xml.Add(e) Next End Sub And this is getting invoked in a routine as follows: Dim myElement = New XElement("NewElements") myElement.AddElements( xml.Descendants("TheElements"). Where(Function(e) e.Attribute("FilterElement") IsNot Nothing). Select(Function(e) New XElement("NewElement", New XAttribute("Text", e.Attribute("FilterElement").Value)))) Is it possible to re-write this using Linq syntax so I don't need to call out to the Sub AddElements but could do it all in-line Many Thx Simon

    Read the article

  • Android Dev: The constructor Intent(new View.OnClickListener(){}, Class<DrinksTwitter>) is undefined

    - by Malcolm Woods Spark
    package com.android.drinksonme; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class Screen2 extends Activity { // Declare our Views, so we can access them later private EditText etUsername; private EditText etPassword; private Button btnLogin; private Button btnSignUp; private TextView lblResult; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get the EditText and Button References etUsername = (EditText)findViewById(R.id.username); etPassword = (EditText)findViewById(R.id.password); btnLogin = (Button)findViewById(R.id.login_button); btnSignUp = (Button)findViewById(R.id.signup_button); lblResult = (TextView)findViewById(R.id.result); // Set Click Listener btnLogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // Check Login String username = etUsername.getText().toString(); String password = etPassword.getText().toString(); if(username.equals("test") && password.equals("test")){ final Intent i = new Intent(this, DrinksTwitter.class); //error on this line startActivity(i); // lblResult.setText("Login successful."); } else { lblResult.setText("Invalid username or password."); } } }); final Intent k = new Intent(Screen2.this, SignUp.class); btnSignUp.setOnClickListener(new OnClickListener() { public void onClick(View v) { startActivity(k); } }); } }

    Read the article

  • InteropServices COMException when executing a .net app from a web CGI script on Windows Server 2003

    - by Kurt W. Leucht
    Disclaimer: I'm completely clueless about .net and COM. I have a vendor's application that appears to be written in .net and I'm trying to wrap it with a web form (a cgi-bin Perl script) so I can eventually launch this vendor's app from a separate computer. I'm on a Windows Server 2003 R2 SE SP1 system and I'm using Apache 2.2 for the web server and ActivePerl 5.10.0.1004 for the cgi script. My cgi script calls the vendor's app that resides on the same machine using the Perl backtick operator. ... $result = "Result: " . `$vendorsPath/$vendorsExecutable $arg1 $arg2`; ... Right now I'm just running IE web browser locally on the server machine and accessing "http://localhost/cgi-bin/myPerlScript.pl". The vendor's app fails and logs a debug message that includes the following stack trace (I changed a couple names so as to not give away the vendor's identity): ... System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80043A1D): 0x80040154 - Class not registered --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at VendorsTool.Engine.Core.VendorsEngine.LoadVendorsServices(String fileName, String& projectCommPath) ... When I run the vendors app from the Windows command line on the server machine with the exact same arguments that the cgi script is passing it runs just fine, so there's something about invoking their app via the web script that is causing a problem. This problem is likely security related because the whole thing runs just fine on a Windows XP Pro machine (both command line and web invocation). I actually developed my web script there and got it completely working there before I tried moving it to the Windows Server 2003 machine. So what's different about the Windows Server 2003 machine that would keep the vendor's .net app from being executed successfully by a web cgi script? Can I fix this problem somehow to make it work on my server or will the vendor have to make a change to their .net app and ship out a new version? I'm probably the only person in the world who is trying to execute this vendor's app from a separate program, so I hate to bother the vendor with the issue if there's a workaround that I can implement myself here on my server machine. Plus, I'm in kind of a hurry and I don't want to wait 4 or 6 months for the vendor to put in a fix and deploy a new version. Thanks for any advise you can give.

    Read the article

  • Perl CGI that sends a temporary loading page to client then later sends the actual results page

    - by Kurt W. Leucht
    I've wasted at least a half day of my company's time searching the Internet for an answer and I'm getting wrapped around the axle here. I can't figure out the difference between all the different technology choices (long polling, ajax streaming, comet, XMPP, etc.) and I can't get a simple hello world example working on my PC. I am running Apache 2.2 and ActivePerl 5.10.0. JavaScript is completely acceptable for this solution. All I want to do is write a simple Perl CGI script that when accessed, it immediately returns some HTML that tells the user to wait or maybe sends an animated GIF. Then without any user intervention (no mouse clicks or anything) I want the CGI script to at some time later replace the wait message or the animated GIF with the actual HTML results from their query. I know this is simple stuff and websites do it all the time, but I can't find a single working example that I can cut and paste onto my machine that will work. Here is my simple Hello World example that I've compiled from various Internet sources, but it doesn't seem to work. When I refresh this CGI URL in my web browser it prints nothing for 5 seconds, then it prints the PLEASE BE PATIENT web page, but not the results web page. What am I doing wrong? #!C:\Perl\bin\perl.exe use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; sub Create_HTML { my $html = <<EOHTML; <html> <head> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="-1" /> <script type="text/javascript" > var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } </script> <title>Ajax Streaming Connection Demo</title> </head> <body> Some header text. <p> <div id="response">PLEASE BE PATIENT</div> <p> Some footer text. </body> </html> EOHTML return $html; } my $cgi = new CGI; print $cgi->header; print Create_HTML(); sleep(5); print "<script type=\"text/javascript\">\n"; print "\$('response').innerHTML = 'Here are your results!';\n"; print "</script>\n";

    Read the article

  • MKMapView memory usage grows out of control with setRegion: calls

    - by Kurt
    Hi, I have a single MKMapView instance that I have programmatically added to a UIView. As part of the UI, the user can cycle through a list of addresses and the map view is updated to show the correct map for each address as the user goes through them. I create the map view once, and simply change what it displays with setRegion:animated:. The problem is that each time the map is changed to show a new address, the memory usage of my program increases by 200K-500K (as reported by Memory Monitor in Instruments). According to Object Allocations, it appears that a lot of 1.0K Mallocs are happening each time, and the Extended Detail pane for these 1.0K allocations shows that the Responsible Caller is convert_image_data and the Extended Detail pane shows that this is the result of [MKMapTileView drawLayer:inContext:]. So, seems likely to me that the memory usage is due to MKMapView not freeing memory it uses to redraw the map each time. In fact, when I don't display the map at all (by not even adding it as a subview of my main UIView) but still cycle through the addresses (which changes various UILabels and other displayed info) the memory usage for the app does NOT increase. If I add the map view but never update it with setRegion:, the memory also does NOT increase when changing to a new address. One more bit of info: if I go to a new address (and therefore ask the map to display the new address) the memory jumps as described above. However, if I go back to an address that was already displayed, the memory does not jump when the map redraws with the old address. Also, this happens on iPad (real device) with 3.2 and on iPhone (again, real device) with 3.1.2. Here's how I initialize the MKMapView (I only do this once): CGRect mapFrame; mapFrame.origin.y = 460; // yes, magic numbers. just for testing. mapFrame.origin.x = 0; mapFrame.size.height = 500; mapFrame.size.width = 768; mapView = [[MKMapView alloc] initWithFrame:mapFrame]; mapView.delegate = self; [self.view insertSubview:mapView atIndex:0]; And in response to the user selecting an address, I set the map like so: MKCoordinateRegion region; MKCoordinateSpan span; span.latitudeDelta=kStreetMapSpan; // 0.003 span.longitudeDelta=kStreetMapSpan; // 0.003 region.center = address.coords; // coords is CLLocationCoordinate2D region.span = span; mapView.region.span = span; [mapView setRegion:region animated:NO]; Any thoughts? I've scoured the net but haven't seen mention of this problem, and I've reached the limits of my Instruments knowledge. Thanks for any ideas.

    Read the article

  • Are there any decent free JAVA data plotting libraries out there?

    - by Kurt W. Leucht
    On a recent JAVA project, we needed a free JAVA based real-time data plotting utility. After much searching, we found this tool called the Scientific Graphics Toolkit or SGT from NOAA. It seemed pretty robust, but we found out that it wasn't terribly configurable. Or at least not configurable enough to meet our needs. We ended up digging very deeply into the JAVA code and reverse engineering the code and changing it all around to make the plot tool look and act the way we wanted it to look and act. Of course, this killed any chance for future upgrades from NOAA. So what free or cheap JAVA based data plotting tools or libraries do you use? Followup: Thanks for the JFreeChart suggestions. I checked out their website and it looks like a very nice data charting and plotting utility. I should have made it clear in my original question that I was looking specifically to plot real-time data. I corrected my question above to make that point clear. It appears that JFreeChart support for live data is marginal at best, though. Any other suggestions out there?

    Read the article

  • c# ListView unable to check a checkbox! Strange problem.

    - by Kurt
    This is a strange problem, I've not added much code as I don't know were to start. I have a listview control in virtual mode, if I filter the listview to show me all people called John, I then see 3 users called John, I then cancel the filter setting all values to null and return all data to the listview, I now have several hundred items in the list but I can only see 30 on screen unless I scroll down the listview. I then use the code below to check a checkbox in each row, all get checked apart from the 3 Johns but if I can see 1 of the 3 Johns in listview without scrolling and then run the code below the visible John is checked. for (int i = 0; i < this._items.Count; i++) { this._items[i].Checked = true; } I have checked the status of the checkbox just before it is checked in the above code and if John is visible then the checkbox believes it is unchecked (false), if it is not visible it belives it is checked (true). So having one visible John on screen the checkbox looks unchecked and running a test proves it is unchecked, for the two Johns I can't see they believe they are checked but if I scroll down so I can see them they aren't. Any ideas? Thanks

    Read the article

  • Which key:value store to use with Python?

    - by Kurt
    So I'm looking at various key:value (where value is either strictly a single value or possibly an object) stores for use with Python, and have found a few promising ones. I have no specific requirement as of yet because I am in the evaluation phase. I'm looking for what's good, what's bad, what are the corner cases these things handle well or don't, etc. I'm sure some of you have already tried them out so I'd love to hear your findings/problems/etc. on the various key:value stores with Python. I'm looking primarily at: memcached - http://www.danga.com/memcached/ python clients: http://pypi.python.org/pypi/python-memcached/1.40 http://www.tummy.com/Community/software/python-memcached/ CouchDB - http://couchdb.apache.org/ python clients: http://code.google.com/p/couchdb-python/ Tokyo Tyrant - http://1978th.net/tokyotyrant/ python clients: http://code.google.com/p/pytyrant/ Lightcloud - http://opensource.plurk.com/LightCloud/ Based on Tokyo Tyrant, written in Python Redis - http://code.google.com/p/redis/ python clients: http://pypi.python.org/pypi/txredis/0.1.1 MemcacheDB - http://memcachedb.org/ So I started benchmarking (simply inserting keys and reading them) using a simple count to generate numeric keys and a value of "A short string of text": memcached: CentOS 5.3/python-2.4.3-24.el5_3.6, libevent 1.4.12-stable, memcached 1.4.2 with default settings, 1 gig memory, 14,000 inserts per second, 16,000 seconds to read. No real optimization, nice. memcachedb claims on the order of 17,000 to 23,000 inserts per second, 44,000 to 64,000 reads per second. I'm also wondering how the others stack up speed wise.

    Read the article

  • Libreoffice Calc run macro with HYPERLINK

    - by Kurt Borno
    I'm trying to use hyperlinks instead of buttons to run Basic macros. It seems to be more natural to me because hyperlinks are directly connected to a cell and buttons are not. I'm using the following Formula: =HYPERLINK("vnd.sun.star.script:Standard.Module1.Test?language=Basic&location=document";"Check") It should call the Subroutine Test placed in the document's macros under Standard.Module1 and display the Text 'Check' in the Cell it is written. This works absolutely fine with libreoffice 3.6.1.2 but it doesn't work at all with version 4.1.4.2. I can't see any errors it just happens nothing at all. I tried to simply click the Hyperlink and also to hold CTRL and click it. Same result - nothing. When I use a button the macro works as expected. Does anyone know how to solve this problem?

    Read the article

  • Using Selenium, how can I test a web UI that returns XML instead of HTML?

    - by Kurt W. Leucht
    I'm using Selenium to unit test my Perl cgi script and all works fine except in one case where my cgi script returns XML content to the web browser instead of returning HTML content. I'm new to Selenium and only pasted in their sample script to get started, but I can't seem to find a Selenium command in any of the documentation that will recognize that my XML response has been returned. The Selenium commands seem to assume that an HTML page is always being returned.

    Read the article

  • Jquery Living Elements

    - by Kurt
    Hi there! Does anybody know how to deal with the effect at http://2crossmedia.com/liv-multicolor/ If you click into the text field, its surrounded by a color-changing line. The code says it's jquery. But how :) ? A lot of thanks!

    Read the article

  • Jquery How to change url for every ajax respond

    - by fatih-kurt
    $(".blok").newWindow({ windowTitle:"Example1", ajaxURL:"Action.php?task=BlokDuzenleFormGetirBlokId="+$(".blok").attr('id') }); when first clicked on blok class a href, newWindow loads from data by $(".blok").attr('id'). Then every action sen same url to ajax, with not change. is there a way change url every single respond to call function by unique id parametre or anything like that.

    Read the article

  • How to send web browser a loading page, then some time later a results page

    - by Kurt W. Leucht
    I've wasted at least a half day of my company's time searching the Internet for an answer and I'm getting wrapped around the axle here. I can't figure out the difference between all the different technology choices (long polling, ajax streaming, comet, XMPP, etc.) and I can't get a simple hello world example working on my PC. I am running Apache 2.2 and ActivePerl 5.10.0. JavaScript is completely acceptable for this solution. All I want to do is write a simple Perl CGI script that when accessed, it immediately returns some HTML that tells the user to wait or maybe sends an animated GIF. Then without any user intervention (no mouse clicks or anything) I want the CGI script to at some time later replace the wait message or the animated GIF with the actual results from their query. I know this is simple stuff and websites do it all the time using JavaScript, but I can't find a single working example that I can cut and paste onto my machine that will work in Perl. Here is my simple Hello World example that I've compiled from various Internet sources, but it doesn't seem to work. When I refresh this Perl CGI script in my web browser it prints nothing for 5 seconds, then it prints the PLEASE BE PATIENT web page, but not the results web page. So the Ajax XMLHttpRequest stuff obviously isn't working right. What am I doing wrong? #!C:\Perl\bin\perl.exe use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; sub Create_HTML { my $html = <<EOHTML; <html> <head> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="-1" /> <script type="text/javascript" > var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } </script> <title>Ajax Streaming Connection Demo</title> </head> <body> Some header text. <p> <div id="response">PLEASE BE PATIENT</div> <p> Some footer text. </body> </html> EOHTML return $html; } my $cgi = new CGI; print $cgi->header; print Create_HTML(); sleep(5); print "<script type=\"text/javascript\">\n"; print "\$('response').innerHTML = 'Here are your results!';\n"; print "</script>\n";

    Read the article

  • How do I get code coverage of Perl cgi script when executed by Selenium?

    - by Kurt W. Leucht
    I'm using Eclipse EPIC IDE to write some Perl cgi scripts which call some Perl modules that I have also written. The EPIC IDE lets me configure a Perl CGI "run configuration" which runs my CGI script. And then I've got Selenium set up and one of my unit test files runs some Selenium commands to run my cgi script through its paces. But the coverage report from Module::Build dispatch 'testcover' doesn't show that any of my module code has been executed. It's been executed by my cgi script, but I guess the CGI script was run manually and was not executed directly by my unit test file, so maybe that's why the coverage isn't being recognized. Is there a way to do this right so I can integrate Selenium and unit test files and code coverage all together somehow?

    Read the article

  • Hard to append a table with many records into another without generating duplicates

    - by Bill Mudry
    I may seem to be a bit wordy at first but for the hope it will be easier for all of you to understand what I am doing in the first place. I have an uncommon but enjoyable activity of collecting as many species of wood from around the world as I can (over 2,900 so far). Ok, that is the real world. Meanwhile I have spent over 8 years compiling over 5.8 meg of text data on all the woods of the world. That got so large that learning some basic PHP and MySQL was most welcome so I could build a new database driven home for all this research. I am still slow at it but getting there. The original premise was to find evidence of as many species of woods in the world I can. The more names identified, the more successful the project. I have named the project TAXA for ease of conversation (short for Taxonomy). You are most welcome to take a look at what I have so far at www.prowebcanada.com/taxa. It is 95% dynamically driven. So far I am reporting about 6,500 botanical wood names and, as said above, the more I can report, the more successful is the project. I have a file of all the woods in the second largest wood collection in the world, the Tervuren wood collection in the Netherlands with over 11,300 wood names even after cleaning out all duplicates. That is almost twice the number I am reporting now so porting all the new wood names from Tervuren to the 'species' table where I keep the reported data would be a major desirable advancement in the project. At one point I was able to add all the Tervuren records to the species table but over 3,000 duplicates also formed. They were not in the Tervuren file in the first place but represent the same wood names common to both files. It is common sense that there would be woods common to both that when merged would create new duplicates. At one point and with the help of others from another forum, I may very well have finally got the proper SQL statement. When I ran it, though, the system said (semi-amusingly at first) ----- that it had gone away! After looking up on the Net what could have have done this, one reason is that the MySQL timeout lapses and probably because of the large size of files I am running. I am running this on a rented account on Godaddy so I cannot go about trying to adjust any config file. For safety, I copied the tervuren.sql file as tervuren_target.sql and the species.sql file as species_master.sql tp use as working files just to make sure I protect the original files from destruction or damage. Later I can name the species_master back to just species.sql once I am happy all worked well. The species file has about 18 columns in it but only 5 columns match the columns in the Tervuren file (name for name and collation also). The rest of the columns are just along for the ride, so to speak. The common key in both is the 'species_name" columns in both. I am not sure it is at all proper to call one a primary key and the other a foreign key since there really is no relational connection to them. One is just more data for the other and can disappear after, never to be referred to the working code in the application. I have been very surprised and flabbergasted on how hard it can be to append records from one large table into another (with same column names plus others) without generating NEW duplicates in the first place. Watch out thinking that a SELECT DISTINCT statement may do the job because absolutely NO records in the species table must get destroyed in the process and there is no way (well, that I know of) to tell the 'DISTINCT" command this. Yes, the original 'species' table has duplicates in it even before all this but, trust me ---- they have to be removed the long hard way manually record by record or I will lose precious information. It is more important to just make sure no NEW duplicates form through bringing in new names in the tervuren_target.species_name into species.species_name. I am hoping and thinking that a straight SQL solution should work --- except for that nasty timeout. How do I get past that? Could it mean that I may have to turn to a PHP plus SQL method?? Or ..... would I have to break up the Tervuren files into a few smaller ones and run them independently (hope not....)" So far, what seems should be easy has proven to be unexpectedly tricky. I appreciate any help you can give but start from the assumption that this may be harder to do right than it may seem on the surface. By the way --- I am running a quad 64 bit system with Windows 7, so at least I have some fairly hefty power on the client end. I have a direct ethernet cable feeding a cable connection to the Internet. Once I get an algorithm and code working for this, I also have many other lists to process that could make the 'species' table grow even more. It could be equivalent to (ahem) lighting a rocket under my project (especially compared to do this record by record manually)! This is my first time in this forum, so I do not know how I can receive any replies. Do I have to to come back here periodically or are replies emailed out also? It would be great if you CC'd copies to me at billmudry at rogers.com :-) Much thanks for your patience and help, Bill Mudry Mississauga, Ontario Canada (next to Toronto).

    Read the article

  • how to disable web page cache throughout the servlets

    - by Kurt
    To no-cache web page, in the java controller servlet, I did somthing like this in a method: public ModelAndView home(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView mav = new ModelAndView(ViewConstants.MV_MAIN_HOME); mav.addObject("testing", "Test this string"); mav.addObject(request); response.setHeader("Cache-Control", "no-cache, no-store"); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", 0); return mav; } But this only works for a particular response object. I have many similar methods in a servlet. And I have many servlets too. If I want to disable cache throughout the application, what should I do? (I do not want to add above code for every single response object) Thanks in advance.

    Read the article

  • Can I force Perl Devel::Cover to generate a coverage report if I killed the build testcover process

    - by Kurt W. Leucht
    If I am able to start up Devel::Cover successfully and it starts to collect data in the cover_db directory, can I then kill the process and then after the fact get Devel::Cover or some other utility to process those binary Devel::Cover run files and structure files into the HTML coverage report? To ask the question another way ... Can I use Devel::Cover to get a coverage report for a process that I am unable to stop, other than by killing the process? This question is related to: How do I get code coverage of Perl CGI script when executed by Selenium?

    Read the article

  • Why does Module::Build's testcover gives me "use of uninitialized value" warnings?

    - by Kurt W. Leucht
    I'm kinda new to Module::Build, so maybe I did something wrong. Am I the only one who gets warnings when I change my dispatch from "test" to "testcover"? Is there a bug in Devel::Cover? Is there a bug in Module::Build? I probably just did something wrong. I'm using ActiveState Perl v5.10.0 with Module::Build version 0.31012 and Devel::Cover 0.64 and Eclipse 3.4.1 with EPIC 0.6.34 for my IDE. UPDATE: I upgraded to Module::Build 0.34 and the warnings are still output. *UPDATE: Looks like a bug in B::Deparse. Hope it gets fixed someday.* Here's my unit test build file: use strict; use warnings; use Module::Build; my $build = Module::Build->resume ( properties => { config_dir => '_build', }, ); $build->dispatch('test'); When I run this unit test build file, I get the following output: t\MyLib1.......ok t\MyLib2.......ok t\MyLib3.......ok All tests successful. Files=3, Tests=24, 0 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) But when I change the dispatch line to 'testcover' I get the following output which always includes a bunch of "use of uninitialized value in bitwise and" warning messages: Deleting database D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db t\MyLib1.......ok Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. t\MyLib2.......ok Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. t\MyLib3.......ok Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. Use of uninitialized value in bitwise and (&) at D:/Perl/lib/B/Deparse.pm line 4252. All tests successful. Files=3, Tests=24, 0 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) Reading database from D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db ---------------------------- ------ ------ ------ ------ ------ ------ ------ File stmt bran cond sub pod time total ---------------------------- ------ ------ ------ ------ ------ ------ ------ .../lib/ActivePerl/Config.pm 0.0 0.0 0.0 0.0 0.0 n/a 0.0 ...l/lib/ActiveState/Path.pm 0.0 0.0 0.0 0.0 100.0 n/a 4.8 <SNIP> blib/lib/<SNIP>/MyLib2.pm 100.0 90.0 n/a 100.0 100.0 0.0 98.5 blib/lib/<SNIP>/MyLib3.pm 100.0 90.9 100.0 100.0 100.0 0.6 98.0 Total 14.4 6.7 3.8 18.3 20.0 100.0 11.6 ---------------------------- ------ ------ ------ ------ ------ ------ ------ Writing HTML output to D:/Documents and Settings/<username>/My Documents/<SNIP>/cover_db/coverage.html ... done.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >