Search Results

Search found 3489 results on 140 pages for 'chris welsh'.

Page 94/140 | < Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >

  • Validate an Xml file against a DTD with a proxy. C# 2.0

    - by Chris Dunaway
    I have looked at many examples for validating an XML file against a DTD, but have not found one that allows me to use a proxy. I have a cXml file as follows (abbreviated for display) which I wish to validate: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.018/InvoiceDetail.dtd"> <cXML payloadID="123456" timestamp="2009-12-10T10:05:30-06:00"> <!-- content snipped --> </cXML> I am trying to create a simple C# program to validate the xml against the DTD. I have tried code such as the following but cannot figure out how to get it to use a proxy: private static bool isValid = false; static void Main(string[] args) { try { XmlTextReader r = new XmlTextReader(args[0]); XmlReaderSettings settings = new XmlReaderSettings(); XmlDocument doc = new XmlDocument(); settings.ProhibitDtd = false; settings.ValidationType = ValidationType.DTD; settings.ValidationEventHandler += new ValidationEventHandler(v_ValidationEventHandler); XmlReader validator = XmlReader.Create(r, settings); while (validator.Read()) ; validator.Close(); // Check whether the document is valid or invalid. if (isValid) Console.WriteLine("Document is valid"); else Console.WriteLine("Document is invalid"); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } static void v_ValidationEventHandler(object sender, ValidationEventArgs e) { isValid = false; Console.WriteLine("Validation event\n" + e.Message); } The exception I receive is System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required. which occurs on the line while (validator.Read()) ; I know I can validate against a DTD locally, but I don't want to change the xml DOCTYPE since that is what the final form needs to be (this app is solely for diagnostic purposes). For more information about the cXML spec, you can go to cxml.org. I appreciate any assistance. Thanks

    Read the article

  • acts_as_solr returns all rows in the database when using the model as search query

    - by chris Chan
    In our application we're using acts_as_solr for search. Everything seems to be running smoothly except for the fact that using the model name as the search query returns every single row in the table. For example, let's say we have a users table. We specify acts_as_solr in our model to search the fields first name, last name and handle acts_as_solr :fields = [:handle, :lname, :fname]. When you use "user" as the search term it returns every single user in the system, or every row in the database as a result. Has anyone else run into this?

    Read the article

  • Do controls need to be defined in a web app or will .NET do it for you

    - by Chris
    I always thought that when you dropped a control onto an .aspx page that a declaration of that control ended up being generated for you (either in a designer file, or within your code behind). All of the apps I have worked on have worked this way. A coworker of mine was installing resharper and it was showing that all her code behind pages would not build. Turned out that resharper could not find a definition for any control that she has dropped onto her markup. She has no designer files, and no declarations in markup. Do they get automatically built when putting together the partial classes? Is there an option at that page/project level to instruct .NET to do this for you? Is this a difference between web app and web site? This is a a .NET 3.5 site, C#, and it is running in a production environment. Thanks in advance

    Read the article

  • User upload file above web root with php

    - by Chris
    I have a website where local bands can have a profile page, I'm implementing an upload system so that they can add songs to their profile. I want to make sure that clever visitors to my website cannot download their songs. I was thinking about uploading them to above the folder for my domain so that they cannot be accessed directly. Is this a good idea and/or possible? If not, what do you suggest I do to try and avoid users downloading songs. I'm already using a flash player to try and prevent downloads.

    Read the article

  • SSRS 2008 Need to lookup customer name with largest order

    - by Chris
    Hi, I'm creating an SSRS report which contains a table of orders, grouped by day. Now I can easily get the max order value for the day and put it in the group header by using the SSRS MAX() function. However, I also want to get the corresponding customer name who placed this order, and place this in the group header too. We can assume my result set simply contains date, name and order value. Is there any way to do this in SSRS 2008? Thanks

    Read the article

  • JavaScript Encapsulation / JQuery

    - by Chris
    I am trying to figure out how to keep my page variables in my application from being defined globally. I've come up with a few methods but am wondering if there is a general standard approach people use. I've got my plugin design pattern down using this approach: http://www.virgentech.com/blog/2009/10/building-object-oriented-jquery-plugin.html. But I'm just not sure how to handle my page level encapsulation.

    Read the article

  • What does xp_qv do in SQL Server?

    - by Chris
    Last night one of our SQL servers developed some major problems and after a colleague stopped, started, and all the usual things it started checking and rebuilding databases and is now running an extended stored procedure called "xp_qv". The internet seems to be very short of information on what this procedure does or anythign like that so I was hoping somebody here might be able to help. I should add that I assume it is meant to be running so the question isn't "Can I stop it" or anything like that, its just curiosity in what it is doing in the hope that it will help determine how long before things are usable again...

    Read the article

  • e4x filter on more then on childeren?

    - by Chris
    My XML Looks like this: <?xml version="1.0" encoding="utf-8" ?> <projects> <project id="1" thumb="media/images/thumb.jpg" > <categories> <id>1</id> <id>2</id> </categories> <director>Director name</director> <name><![CDATA[IPhone commercial]]></name> <url><![CDATA[http://www.iphone.com]]></url> <description><![CDATA[Description about the project]]></description> <thumb><![CDATA[/upload/images/thumb.jpg]]></thumb> </project> </projects> But I cannot figure out how to filter projects based on a category id? Does anybody know how to do ? :)

    Read the article

  • Choosing a type for search results in C#

    - by Chris M
    I have a result set that will never exceed 500; the results that come back from the web-service are assigned to a search results object. The data from the webservice is about 2mb; the bit I want to use is about a third of each record, so this allows me to cache and quickly manipulate it. I want to be able to sort and filter the results with the least amount of overhead and as fast as possible so I used the VCSKICKS timing class to measure their performance Average Total (10,000) Type Create Sort Create Sort HashSet 0.1579 0.0003 1579 3 IList 0.0633 0.0002 633 2 IQueryable 0.0072 0.0432 72 432 Measured in Seconds using http://www.vcskicks.com/algorithm-performance.php I created the hashset through a for loop over the web-service response (adding to the hashset). The List & IQueryable were created using LINQ. Question I can understand why HashSet takes longer to create (the foreach loop vs linq); but why would IQueryable take longer to sort than the other two; and finally is there a better way to assign the HashSet. Thanks Actual Program public class Program { private static AuthenticationHeader _authHeader; private static OPSoapClient _opSession; private static AccommodationSearchResponse _searchResults; private static HashSet<SearchResults> _myHash; private static IList<SearchResults> _myList; private static IQueryable<SearchResults> _myIQuery; static void Main(string[] args) { #region Setup WebService _authHeader = new AuthenticationHeader { UserName = "xx", Password = "xx" }; _opSession = new OPSoapClient(); #region Setup Search Results _searchResults = _opgSession.SearchCR(_authHeader, "ENG", "GBP", "GBR"); #endregion Setup Search Results #endregion Setup WebService // HASHSET SpeedTester hashTest = new SpeedTester(TestHashSet); hashTest.RunTest(); Console.WriteLine("- Hash Test \nAverage Running Time: {0}; Total Time: {1}", hashTest.AverageRunningTime, hashTest.TotalRunningTime); SpeedTester hashSortTest = new SpeedTester(TestSortingHashSet); hashSortTest.RunTest(); Console.WriteLine("- Hash Sort Test \nAverage Running Time: {0}; Total Time: {1}", hashSortTest.AverageRunningTime, hashSortTest.TotalRunningTime); // ILIST SpeedTester listTest = new SpeedTester(TestList); listTest.RunTest(); Console.WriteLine("- List Test \nAverage Running Time: {0}; Total Time: {1}", listTest.AverageRunningTime, listTest.TotalRunningTime); SpeedTester listSortTest = new SpeedTester(TestSortingList); listSortTest.RunTest(); Console.WriteLine("- List Sort Test \nAverage Running Time: {0}; Total Time: {1}", listSortTest.AverageRunningTime, listSortTest.TotalRunningTime); // IQUERIABLE SpeedTester iqueryTest = new SpeedTester(TestIQueriable); iqueryTest.RunTest(); Console.WriteLine("- iquery Test \nAverage Running Time: {0}; Total Time: {1}", iqueryTest.AverageRunningTime, iqueryTest.TotalRunningTime); SpeedTester iquerySortTest = new SpeedTester(TestSortableIQueriable); iquerySortTest.RunTest(); Console.WriteLine("- iquery Sort Test \nAverage Running Time: {0}; Total Time: {1}", iquerySortTest.AverageRunningTime, iquerySortTest.TotalRunningTime); } static void TestHashSet() { var test = _searchResults.Items; _myHash = new HashSet<SearchResults>(); foreach(var x in test) { _myHash.Add(new SearchResults { Ref = x.Ref, Price = x.StandardPrice }); } } static void TestSortingHashSet() { var sorted = _myHash.OrderBy(s => s.Price); } static void TestList() { var test = _searchResults.Items; _myList = (from x in test select new SearchResults { Ref = x.Ref, Price = x.StandardPrice }).ToList(); } static void TestSortingList() { var sorted = _myList.OrderBy(s => s.Price); } static void TestIQueriable() { var test = _searchResults.Items; _myIQuery = (from x in test select new SearchResults { Ref = x.Ref, Price = x.StandardPrice }).AsQueryable(); } static void TestSortableIQueriable() { var sorted = _myIQuery.OrderBy(s => s.Price); } }

    Read the article

  • How do you use Canadian currency?

    - by chris
    When I pass an option of :currency = "CAD" to the setup_purchase and purchase methods the transaction still goes through in US funds. My paypal account does have CAD as the default currency. What am I missing?

    Read the article

  • Code to show UIPickerview under clicked UITextField

    - by Chris F
    I thought I'd share a code snippet where I show a UIPickerView when you click a UITextField. The code uses a UIPickerView, but there's no reason to use a different view controller, like a UITableViewController that uses a table instead of a picker. Just create a single-view project with a nib, and add a UITextField to the view and make you connections in IB. // .h file #import @interface MyPickerViewViewController : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource, UITextFieldDelegate> - (IBAction)dismissPickerView:(id)sender; @end // .m file #import "MyPickerViewViewController.h" @interface MyPickerViewViewController () { UIPickerView *_pv; NSArray *_array; IBOutlet __weak UITextField *_tf; BOOL _pickerViewShown; } @end @implementation MyPickerViewViewController - (void)viewDidLoad { [super viewDidLoad]; _pickerViewShown = NO; _array = [NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", nil]; _pv = [[UIPickerView alloc] initWithFrame:CGRectZero]; _pv.showsSelectionIndicator = YES; _pv.dataSource = self; _pv.delegate = self; _tf.delegate = self; _tf.inputView = _pv; } - (IBAction)dismissPickerView:(id)sender { [_pv removeFromSuperview]; [_tf.inputView removeFromSuperview]; [_tf resignFirstResponder]; _pickerViewShown = NO; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { if (!_pickerViewShown) { [self setRectForPickerViewRelativeToTextField:textField]; [self.view addSubview:_tf.inputView]; _pickerViewShown = YES; } else { [self dismissPickerView:self]; } return NO; } - (void)setRectForPickerViewRelativeToTextField:(UITextField*)textField { CGFloat xPos = textField.frame.origin.x; CGFloat yPos = textField.frame.origin.y; CGFloat width = textField.frame.size.width; CGFloat height = textField.frame.size.height; CGFloat pvHeight = _pv.frame.size.height; CGRect pvRect = CGRectMake(xPos, yPos+height, width, pvHeight); _pv.frame = pvRect; } - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { return [_array objectAtIndex:row]; } - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { return _array.count; } - (void) pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { _tf.text = [_array objectAtIndex:row]; [self dismissPickerView:self]; } @end

    Read the article

  • testing .mobile mime format with capybara / rspec

    - by Chris Beck
    For detecting and responding to mobile user agents, I'm using Mime::Type.register_alias "text/html", :mobile and the approach I'm wondering what is the best approach to test with capybara. This article suggests setting up an iphone driver with Capybara.register_driver :iphone do |app| http://blog.plataformatec.com.br/2011/03/configuring-user-agents-with-capybara-selenium-webdriver/ but I'd like a more flexible approach where the mime type is set via the url extension localhost/index.mobile and where I can do this visit user_path( format: :mobile) Rails understands the extension and sets the format in the params hash, but how do I get the url helper methods to add that to all urls as a file extension?

    Read the article

  • Copy NSAttributedString to pasteboard

    - by Chris
    Brand new to Cocoa and I'm trying to figure out how to copy an NSAttributedString to the pasteboard. I've looked in the docs and not sure if I'm supposed to use a NSPasteboardItem or not. Here's what I have to copy a regular NSString: NSPasteboard *pb = [NSPasteboard generalPasteboard]; NSArray *types = [NSArray arrayWithObjects:NSStringPboardType, nil]; [pb declareTypes:types owner:self]; [pb setString:@"asdfasdf" forType:NSStringPboardType]; How do I set a NSAttributedString? Thanks

    Read the article

  • Trigger ad-hoc activity within a workflow

    - by Chris Taylor
    I am looking to use WF 4 to replace an existing workflow solution we have. One feature that is currently used in the existing workflow engine is the ability to cancel a current activity and loopback to a FlowSwitch type activity. So given the following crude workflow where we start at 'O' and base in the input data the workflow follows the path to 'A2' which is currently blocking on s bookmark waiting for input. ---------A1--\ | \ /\ \ O------- ---->--(A2)-------| ^ \/ / | | | / | | ---------A3--/ | | | |----------------------| However in the meantime some out of band data comes in that means we should cancel 'A2' and return to the FlowSwitch to re-evaluate based on the new data. The question is what is the best way to handle the out of band data that arrived? My initial guess is to have a Parallel activity with one branch waiting for out of band data and the other branch containing the workflow sequence described above. If data came in on the brach waiting for the out of band data, how would I cancel the current activity in the workflow and force it to return to the FlowSwitch. Or of course is there a better way to handle this. I have not actually done any work with the WF4 stuff for WF3 for that matter so I might be missing something obvious here.

    Read the article

  • Can Perforce and SourceSafe co-exist in Visual Studio?

    - by Chris
    Visual Studio 2008, to be more specific. We're testing out moving to Perforce for source control, so I'd like to install the P4SCC plugin to monkey around with. However, I'd also like to continue using SourceSafe's IDE capabilities for projects that haven't been moved over yet. Can the two co-exist peacefully, or is it one or the other for a specific install of VS?

    Read the article

  • Valgrind 'noise', what does it mean?

    - by Chris Huang-Leaver
    When I used valgrind to help debug an app I was working on I notice a huge about of noise which seems to be complaining about standard libraries. As a test I did this; echo 'int main() {return 0;}' | gcc -x c -o test - Then I did this; valgrind ./test ==1096== Use of uninitialised value of size 8 ==1096== at 0x400A202: _dl_new_object (in /lib64/ld-2.10.1.so) ==1096== by 0x400607F: _dl_map_object_from_fd (in /lib64/ld-2.10.1.so) ==1096== by 0x4007A2C: _dl_map_object (in /lib64/ld-2.10.1.so) ==1096== by 0x400199A: map_doit (in /lib64/ld-2.10.1.so) ==1096== by 0x400D495: _dl_catch_error (in /lib64/ld-2.10.1.so) ==1096== by 0x400189E: do_preload (in /lib64/ld-2.10.1.so) ==1096== by 0x4003CCD: dl_main (in /lib64/ld-2.10.1.so) ==1096== by 0x401404B: _dl_sysdep_start (in /lib64/ld-2.10.1.so) ==1096== by 0x4001471: _dl_start (in /lib64/ld-2.10.1.so) ==1096== by 0x4000BA7: (within /lib64/ld-2.10.1.so) * large block of similar snipped * ==1096== Use of uninitialised value of size 8 ==1096== at 0x4F35FDD: (within /lib64/libc-2.10.1.so) ==1096== by 0x4F35B11: (within /lib64/libc-2.10.1.so) ==1096== by 0x4A1E61C: _vgnU_freeres (vg_preloaded.c:60) ==1096== by 0x4E5F2E4: __run_exit_handlers (in /lib64/libc-2.10.1.so) ==1096== by 0x4E5F354: exit (in /lib64/libc-2.10.1.so) ==1096== by 0x4E48A2C: (below main) (in /lib64/libc-2.10.1.so) ==1096== ==1096== ERROR SUMMARY: 3819 errors from 298 contexts (suppressed: 876 from 4) ==1096== malloc/free: in use at exit: 0 bytes in 0 blocks. ==1096== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==1096== For counts of detected errors, rerun with: -v ==1096== Use --track-origins=yes to see where uninitialised values come from ==1096== All heap blocks were freed -- no leaks are possible. You can see the full result here: http://pastebin.com/gcTN8xGp I have two questions; firstly is there a way to suppress all the noise? --show-below-main is set to no by default, but there doesn't appear to be a --show-after-main equivalent.

    Read the article

  • For SQL select returning more than 1 value, how are they sorted when Id is GUID?

    - by Chris F
    I'm wondering how MSSQL orders data that is returned from a query and the Id columns of the respective tables are all of type uniqueidentifier. I'm using NHibernate GuidComb when creating all of the GUIDs and do things like: Sheet sheet = sheetRepository.Get(_SheetGuid_); // has many lines items IList<SheetLineItem> lineItems = sheet.LineItems; I'm just trying to figure out how they'll be ordered when I do something like: foreach (SheetLineItem lineItem in lineItems) I can't see to find a good article on the way GUIDs are compared by SQL when being ordered, if that's what's happening.

    Read the article

  • Using Python, what's the best way to create a set of files on disk for testing?

    - by Chris R
    I'm looking for a way to create a tree of test files to unit test a packaging tool. Basically, I want to create some common file system structures -- directories, nested directories, symlinks within the selected tree, symlinks outside the tree, &c. Ideally I want to do this with as little boilerplate as possible. Of course, I could hand-write the set of files I want to see, but I'm thinking that somebody has to have automated this for a test suite somewhere. Any suggestions?

    Read the article

  • How could I apply a genetic algorithm to a simple game that follows rollercoaster tracks?

    - by Chris
    I have free-rein over what I do on a final assignment for school, with respect to modifying a simple direct-x game that currently just has the camera follow some rollercoaster rails. I've developed an interest in genetic algorithms and would like to take this opportunity to apply one and learn something about them. However, I can't think of any way I could possibly apply one in this case. What are some options available to me?

    Read the article

  • Defining - and dealing with - Evil

    - by Chris Becke
    As a software developer one sometimes gets feature requests that seem to be in some kind of morally grey area. Sometimes one can deflect them, or implement them in a way that feels less 'evil' - sometimes - on reflection - while the feature request 'feels' wrong theres no identifiable part of it that actually causes harm. Sometimes one feels a feature is totally innocent but various anti virus products start tagging one as malware. For example - I personally consider EULAs to (a) hopefully be unenforceable and (b) a means by which rights are REMOVED from consumers. However Anti Virus scanners frequently mark as malware any kind of download agent that does not display a EULA. Which to me is the result of a curious kind of double think. What I want to know is - are there any online (or offline) resources that cover evil software development practices? How can I know if a software practice that I consider dodgy is in fact evil enough to consider fighting?

    Read the article

  • Combine hash values in C#

    - by Chris
    I'm creating a generic object collection class and need to implement a Hash function. I can obviously (and easily!) get the hash values for each object but was looking for the 'correct' way to combine them to avoid any issues. Does just adding, xoring or any basic operation harm the quality of the hash or am I going to have to do something like getting the objects as bytes, combining them and then hashing that? Cheers in advance

    Read the article

  • Automated Legal Processing

    - by Chris S
    Will it ever be possible to make legal systems quantifiable enough to process with computer algorithms? What technologies would have to be in place before this is possible? Are there any existing technologies that are already trying to accomplish this? Out of curiosity, I downloaded the text for laws in my local municipality, and tried applying some simple NLP tricks to extract rules from sentences. I had mixed results. Some sentences were very explicit (e.g. "Cars may not be left in the park overnight"), but other sentences seemed hopelessly vague (e.g. "The council's purpose is to ensure the well-being of the community"). I apologize if this is too open-ended a topic, but I've often wondered what society would look like if legal systems were based on less ambiguous language. Lawyers, and the legal process in general, are so expensive because they have to manually process a complex set of rules codified in ambiguous legal texts. If this system could be represented in software, this huge expense could potentially be eliminated, making the legal system more accessible for everyone.

    Read the article

  • how to get entire document in scrapy using hxs.select

    - by Chris Smith
    I've been at this for 12hrs and I'm hoping someone can give me a leg up. Here is my code all I want is to get the anchor and url of every link on a page as it crawls along. from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector import HtmlXPathSelector from scrapy.utils.url import urljoin_rfc from scrapy.utils.response import get_base_url from urlparse import urljoin #from scrapy.item import Item from tutorial.items import DmozItem class HopitaloneSpider(CrawlSpider): name = 'dmoz' allowed_domains = ['domain.co.uk'] start_urls = [ 'http://www.domain.co.uk' ] rules = ( #Rule(SgmlLinkExtractor(allow='>example\.org', )), Rule(SgmlLinkExtractor(allow=('\w+$', )), callback='parse_item', follow=True), ) user_agent = 'Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))' def parse_item(self, response): #self.log('Hi, this is an item page! %s' % response.url) hxs = HtmlXPathSelector(response) #print response.url sites = hxs.select('//html') #item = DmozItem() items = [] for site in sites: item = DmozItem() item['title'] = site.select('a/text()').extract() item['link'] = site.select('a/@href').extract() items.append(item) return items What I'm doing wrong... my eyes hurt now.

    Read the article

< Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >