Search Results

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

Page 97/140 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • Obtaining the server IP address in WCF?

    - by chris
    How can I obtain the server IP address that was used to connect to a service? The server has multiple IP addresses and I need to know which one the client is connected to. So far I only found that OperationContext.Current.EndpointDispatcher.EndpointAddress and OperationContext.Current.Channel.LocalAddress contain the address from .config (e.g. localhost) OperationContext.Current.IncomingMessageProperties.Via contains the Url that the client used to connect to the server (but this might just be a name from the clients hosts file). EDIT - Sorry, I wasn't being clear enough: The server needs to know which of its IP addresses were used by the client. E.g. the server has the addresses 10.0.0.1 and 10.0.0.2. when processing the request the server service needs to know if 10.0.0.1 or 10.0.0.2 was used by the client to connect to it.

    Read the article

  • Equivalent of Backticks in Python

    - by Chris Bunch
    What is the equivalent of the backticks found in Ruby and Perl in Python? That is, in Ruby I can do this: foo = `cat /tmp/baz` What does the equivalent statement look like in Python? I've tried os.system("cat /tmp/baz") but that puts the result to standard out and returns to me the error code of that operation.

    Read the article

  • Advanced search functionality

    - by Chris
    I have a website with a jQuery based autocomplete search functionality which works great. Currently though I have just one search box for all categories, what I want is for someone to be able to type in, say for example, dorian gray dvd (in any order) which will search for dorian gray within the dvd category. What this will require then is a bit of magic on the server side to figure out if any of the words are category keywords, and then limit the search by that. What is the best (and quickest) way to do this in PHP / MySQL? I currently have a few trains of thought Search the category table for matches and perhaps order the results by that. Or split up the search terms into an array and separately search the categories for that for a match. Another thought I just had is to concat the category title to the dvd title in the database and match against that, or something similar... but this sounds computationally expensive? Any advice?

    Read the article

  • Is it against best practice to throw Exception on most JUnit tests?

    - by Chris Knight
    Almost all of my JUnit tests are written with the following signature: public void testSomething() throws Exception My reasoning is that I can focus on what I'm testing rather than exception handling which JUnit appears to give me for free. But am I missing anything by doing this? Is it against best practice? Would I gain anything by explicitly catching specific exceptions in my test and then fail()'ing on them?

    Read the article

  • Preventing HTML character entities in locale files from getting munged by Rails3 xss protection

    - by Chris S
    We're building an app, our first using Rails 3, and we're having to build I18n in from the outset. Being perfectionists, we want real typography to be used in our views: dashes, curled quotes, ellipses et al. This means in our locales/xx.yml files we have two choices: Use real UTF-8 characters inline. Should work, but hard to type, and scares me due to the amount of software which still does naughty things to unicode. Use HTML character entities (&#8217; &#8212; etc). Easier to type, and probably more compatible with misbehaving software. I'd rather take the second option, however the auto-escaping in Rails 3 makes this problematic, as the ampersands in the YAML get auto-converted into character entities themselves, resulting in 'visible' &8217;s in the browser. Obviously this can be worked around by using raw on strings, i.e.: raw t('views.signup.organisation_details') But we're not happy going down the route of globally raw-ing every time we t something as it leaves us open to making an error and producing an XSS hole. We could selectively raw strings which we know contain character entities, but this would be hard to scale, and just feels wrong - besides, a string which contains an entity in one language may not in another. Any suggestions on a clever rails-y way to fix this? Or are we doomed to crap typography, xss holes, hours of wasted effort or all thre?

    Read the article

  • Putting a dollar value on code quality

    - by Chris Nelson
    As noted in another thread, "In most businesses, code quality is defined in dollars." So my company has an opportunity to acquire a large-ish C code base. Obviously, if the code quality is good, the code base is worth more than if it's poor. That is, if we can readily read, understand, and update the code, it's worth more to us than if it's a spaghetti-coded mess. Without being able to see the code ahead of time, we'd like to set some objective measure as an acceptance criteria like "If the XXX measure is below the price will be discounted YY%." What criteria can we or should we measure and what tool can we use to measure it?

    Read the article

  • How to package Qt Framework on Mac OS X?

    - by Chris Kaminski
    I'm developing an application for the Mac, and I'm wicked new at this - what would be the best way to distribute the Qt Framework so that I'm not impacting an already existing framework, and so that my App.app picks up the libraries. I'm also using boost, so I'm curious how a simple bundle works with libraries.

    Read the article

  • How to get an id from the results in two tables

    - by Chris Lively
    Consider an order. An order will have one or more line items. Each line item is for a particular product. Given a filter table with a couple of products, how would I get the order id's that had at least all of the products listed in the second table? table Orders( OrderId int ) table LineItems ( OrderId int, LineItemId int, ProductId int ) table Filter ( ProductId int ) data Orders OrderId -------- 1 2 3 LineItems OrderId LineItemId ProductId ------- ---------- --------- 1 1 401 1 2 502 2 3 401 3 4 401 3 5 603 3 6 714 Filter ProductId --------- 401 603 Desired result of the query: OrderId: 3

    Read the article

  • Posting Documentation onto a Joomla Site

    - by Chris Spicer
    I would like to create some documentation and post it onto my Joomla website. This documentation would be something along the lines of the MSDN documentation: i.e. each page would follow a basic template. Intuitively I feel I have two ways of achieving this: 1) Creating each page of documentation as a separate article, and then linking them up. 2) Creating some kind of template and filling the information from a database. The second option being preferable in the long run. Unforunately I have no idea how to achieve what I'm looking for. I hoped that there would be a component out there that woud help me, but Googling for 'Joomla Documentation' just brings up the documentation for Joomla itself. Has anyone out there put documentation on their site, and how did they achieve it?

    Read the article

  • Handling Types Defined in Plug-ins That Are No Longer Available

    - by Chris
    I am developing a .NET framework application that allows users to maintain and save "projects". A project can consist of components whose types are defined in the assemblies of the framework itself and/or in third-party assemblies that will be made available to the framework via a yet-to-be-built plug-in architecture. When a project is saved, it is simply binary-serialised to file. Projects are portable, so multiple users can load the same project into their own instances of the framework (just as different users may open the same MSWord document in their own local copies of MSWord). What's more, the plug-ins available to one user's framework might not be available to that of another. I need some way of ensuring that when a user attempts to open (i.e. deserialise) a project that includes a type whose defining assembly cannot be found (either because of a framework version incompatibility or the absence of a plug-in), the project still opens but the offending type is somehow substituted or omitted. Trouble is, the research I've done to date does not even hint at a suitable approach. Any ideas would be much appreciated, thanks.

    Read the article

  • JSON editor/formatter?

    - by Chris
    I've got some JSON data, but it's all on one line. Does anyone know of a web or Windows editor that will format (e.g. indent and insert new lines) this data for me, so I can read it better? Preferably one that uses a GUI to display the JSON—instead of a command-line tool that outputs a reformatted document, for example.

    Read the article

  • Hibernate cascade debug options

    - by Chris
    I have run into various StackOverflowErrors which occur during cascading. These have been extremely time consuming in debugging because I don't know which properties are being cascaded to cause this recursive behavior. Does anyone know of a log setting or some other form of debugging which could tell me specifically what properties are being cascaded?

    Read the article

  • C standard addressing simplification inconsistency

    - by Chris Lutz
    Section §6.5.3.2 "Address and indirection operators" ¶3 says (relevant section only): The unary & operator returns the address of its operand. ... If the operand is the result of a unary * operator, neither that operator nor the & operator is evaluated and the result is as if both were omitted, except that the constraints on the operators still apply and the result is not an lvalue. Similarly, if the operand is the result of a [] operator, neither the & operator nor the unary * that is implied by the [] is evaluated and the result is as if the & operator were removed and the [] operator were changed to a + operator. ... This means that this: int *i = NULL; printf("%p", (void *) (&*i) ); printf("%p", (void *) (&i[10]) ); Should be perfectly legal, printing the null pointer (probably 0) and the null pointer plus 10 (probably 10). The standard seems very clear that both of those cases are required to be optimized. However, it doesn't seem to require the following to be optimized: struct { int a; short b; } *s = 0; printf("%p", (void *) (&s->b) ); This seems awfully inconsistent. I can see no reason that the above code shouldn't print the null pointer plus sizeof(int) (possibly 4). Simplifying a &-> expression is going to be the same conceptually (IMHO) as &[], a simple address-plus-offset. It's even an offset that's going to be determinable at compile time, rather than potentially runtime with the [] operator. Is there anything in the rationale about why this is so seemingly inconsistent?

    Read the article

  • JQuery validation not working for checkbox group

    - by Chris Halcrow
    I'm having trouble getting JQuery validation to work with a set of checkboxes. I'm generating the checkboxes using an ASP.NET checkboxlist, and I've used JQuery to set the 'name' attribute to the same thing for each checkbox in the list. Here's the code that gets written to the browser. I'm setting the 'validate' attribute on the 1st checkbox to set the rule that at least one checkbox must be selected. The JQuery validation works for all other elements on the form, but not for the checkbox list. I'm also using a JQuery form wizard on the page which triggers validation for each 'page' of the form, so I don't have control over how the validation is called. <input id="ContentPlaceHolder1_MainContent_AreaOfInterest_0" class="ui-wizard-content ui-helper-reset ui-state-default" type="checkbox" value="Famine" name="hello[]" validate="required:true, minlength:1"> <label for="ContentPlaceHolder1_MainContent_AreaOfInterest_0">Famine</label> <br> <input id="ContentPlaceHolder1_MainContent_AreaOfInterest_1" class="ui-wizard-content ui-helper-reset ui-state-default" type="checkbox" value="Events Volunteer" name="hello[]"> <label for="ContentPlaceHolder1_MainContent_AreaOfInterest_1">Events Volunteer</label> Any ideas on what's going wrong? There are lots of examples of JQuery scripts that will do the validation, however I'm trying to avoid this as I'm generating the checkboxlist server side by a custom control so that it can be re-used across different pages that may or may not have JQuery enabled. I'm trying to enable the JQuery validation whilst being as unobtrusive as possible, so that pages will still work even if JQuery is disabled. Here are the relevant JQuery inclusions and JQuery initialisation script for the form wizard. I'm not using any initialisation code for JQuery validation: <script type="text/javascript" src="../js/formwizard/js/bbq.js"></script> <script type="text/javascript" src="../js/formwizard/js/jquery.form.js"></script> <script type="text/javascript" src="../js/formwizard/js/jquery.form.wizard.js"></script> <script type="text/javascript" src="../js/formwizard/js/jquery.validate.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#form1").formwizard({ validationEnabled: true, focusFirstInput: true }); }); </script>

    Read the article

  • How to use associated Model as datasource for DataView

    - by Chris Gilbert
    I have a Model structure as shown below and I want to know how to use the Bookings array as the datasource of my DataView. Model Structure: Client ClientId Name Bookings (HasManyAssociation) Contacts (HasManyAssociation) AjaxProxy JsonReader (ImplicitIncludes is set to true so child models are created with one call) Booking BookingNodeId BookingDetails Contact ContactNodeId ContactDetails The above gives me a data structure as follows: Client Bookings[ Booking Booking ] Contacts[ Contact Contact ] What I want to be able to do is either, create a Store from my Bookings array and then use that store as the datasource for my DataView OR directly use the Bookings array as the datasource (I don't really care how I do it to be honest). If I setup the AjaxProxy on my Booking model it works fine but then obviously I cannot automatically create my Client and Contacts when I load my JSON. It seems to me to make sense that the Client model, being the top level model hierarchically, is the one to load the data. EDIT: I figured it out as follows (with special thanks to handet87 below for his dataview.setStore() pointer). The key in this case is to know that creating the relationship actually sets up another store called, in this case BookingsStore and ContactsStore. All I needed to do was dataview.setStore("BookingsStore")

    Read the article

  • Date format broken in .net 4.0 for uk format

    - by Chris Foot
    I'm in the process of converting a couple of sites up to .net 4.0 and I seem to have a problem with regionalisaion of dates. This code: Date.Today.AddDays((Date.Today.DayOfWeek - 1) * -1).ToString() In .net 3.5 produces: '19/04/2010 00:00:00' but as soon as I change the app pool to 4.0 it produces: '4/19/2010 12:00:00 AM' Where can I change the setting that governs this?

    Read the article

  • Can you open an SPSite object while being within a different site collection?

    - by Chris Stewart
    I'm working on creating a common navigation experience across two site collections in MOSS 2007. I've looked around for various solutions and haven't found anything that fits. Our navigation is dynamic and driven by a number of factors, including audience targeting. Most of what I've found relates to having static XML and that just won't work for our requirements. What I'm down to at the moment is just getting a navigation item from site collection A while in the context of site collection B. Are there reasons I shouldn't be able to just open a navigation item from site collection A and gets its audience? Certainly there could be permissions problems on my end, or code related issues, or things that are in my control. What I'm wondering is if there's something inherent to SharePoint that would not allow this. Something I don't have control over which would force me to travel a different path.

    Read the article

  • Browser Not Reading Entire XML File

    - by Chris
    I have an XML file that is written by a PHP script. The data for the XML file is gathered from several different RSS feeds. The PHP script is invoked every 5 minutes by a Cron Job. The PHP Script takes maybe 5-10 seconds to write the XML File. Here's the problem: After the XML file is written, I can open it through DreamWeaver and read everything just fine - but when I enter the XML File's URL into my Web Browser (IE or Firefox), I get a "XML Parsing Error: not well-formed" Error in the Browser. When I do View Source in the Browser, the XML file appears incomplete - but when I open the file directly off the server, it is complete. Anyone know what's going on here?

    Read the article

  • Using UNC path as collections location in Mecurial IIS6 Server2003

    - by Chris M
    I'm running the latest Mercurial and Python 2.6; IIS6 is using the wildcard ISAPI method to attach the site to the Mecurial hgwebdir_wsgi [paths] \ = \\COMP3254\TestRepo\* [web] baseurl = / allow_push = * push_ssl = false style = monoblue The setup works perfectly if I reference the local drive E:\repo* but doesnt work if I specify the network as above; I've given the server (MERCDEV01$) full permissions on the shared folder on COMP3254, I can't think of any other reason it wouldn't work. Any ideas?

    Read the article

  • Iterate over a dict or list in Python

    - by Chris Dutrow
    Just wrote some nasty code that iterates over a dict or a list in Python. I have a feeling this was not the best way to go about it. The problem is that in order to iterate over a dict, this is the convention: for key in dict_object: dict_object[key] = 1 But modifying the object properties by key does not work if the same thing is done on a list: # Throws an error because the value of key is the property value, not # the list index: for key in list_object: list_object[key] = 1 The way I solved this problem was to write this nasty code: if isinstance(obj, dict): for key in obj: do_loop_contents(obj, key) elif isinstance(obj, list): for i in xrange(0, len(obj)): do_loop_contents(obj, i) def do_loop_contents(obj, key): obj[key] = 1 Is there a better way to do this? Thanks!

    Read the article

  • LINQ to Entities and Business / Validation Rules

    - by Chris
    We have a requirement where we need to allow users to dynamically create custom reports that will run against our database and return sets of data. It would be something similar to this: http://www.marcuswhitworth.com/2009/12/dynamic-linq-with-expression-trees/ but would ultimately contain the ability to create more complicated logic. I believe LINQ to Entities might possibly allow us to do something like we're attempting to achieve. I should note that these reports are going to need to run against multiple tables. Can anyone point me in the right direction for something like this? Has anyone done anything similar with LINQ to Entities?

    Read the article

  • Assigning ID to a Row in an Android ListView

    - by Chris
    I have a ListView. When an item on the ListView is tapped, it loads a SubView. I want to assign an ID to each row of the ListView, so I can pass that ID along to the SubView. How do I assign a specific ID to each row in the ListView? Here is how I am currently loading the ListView: setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, mArrayList));

    Read the article

  • SQL: Recursive Path

    - by Chris
    Is it possible to create a "tree resolver" in SQL? I have a table: ID Name Parent 1 a 2 b 1 3 c 1 4 d 3 Now I want a SQL query that returns: ID PATH 1 /a 2 /a/b 3 /a/c 4 /a/c/d Is this possible with SQL? It would make many things easier for me. Any help would really be appreciated!

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >