Search Results

Search found 1722 results on 69 pages for 'andrew sullivan'.

Page 43/69 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • should I ever put a major version number into a C#/Java namespace?

    - by Andrew Patterson
    I am designing a set of 'service' layer objects (data objects and interface definitions) for a WCF web service (that will be consumed by third party clients i.e. not in-house, so outside my direct control). I know that I am not going to get the interface definition exactly right - and am wanting to prepare for the time when I know that I will have to introduce a breaking set of new data objects. However, the reality of the world I am in is that I will also need to run my first version simultaneously for quite a while. The first version of my service will have URL of http://host/app/v1service.svc and when the times comes by new version will live at http://host/app/v2service.svc However, when it comes to the data objects and interfaces, I am toying with putting the 'major' version of the interface number into the actual namespace of the classes. namespace Company.Product.V1 { [DataContract(Namespace = "company-product-v1")] public class Widget { [DataMember] string widgetName; } public interface IFunction { Widget GetWidgetData(int code); } } When the time comes for a fundamental change to the service, I will introduce some classes like namespace Company.Product.V2 { [DataContract(Namespace = "company-product-v2")] public class Widget { [DataMember] int widgetCode; [DataMember] int widgetExpiry; } public interface IFunction { Widget GetWidgetData(int code); } } The advantages as I see it are that I will be able to have a single set of code serving both interface versions, sharing functionality where possible. This is because I will be able to reference both interface versions as a distinct set of C# objects. Similarly, clients may use both interface versions simultaneously, perhaps using V1.Widget in some legacy code whilst new bits move on to V2.Widget. Can anyone tell why this is a stupid idea? I have a nagging feeling that this is a bit smelly.. notes: I am obviously not proposing every single new version of the service would be in a new namespace. Presumably I will do as many non-breaking interface changes as possible, but I know that I will hit a point where all the data modelling will probably need a significant rewrite. I understand assembly versioning etc but I think this question is tangential to that type of versioning. But I could be wrong.

    Read the article

  • Selenium: How to enter white space as the value of a text field?

    - by Andrew
    I have a form text field that is being populated with a default value. I would like to clear the value and enter white space to assert that the expected validation occurs. I am using Selenium RC and the PHPUnit Selenium extension. How can I achieve this? Note: I have already tried doing these, but they do not work: $this->type('FirstName', " "); //spaces $this->type('FirstName', "\t"); //tab character They clear the value from the field, but they do not enter the white space into the field.

    Read the article

  • c#: Design advice. Using DataTable or List<MyObject> for a generic rule checker

    - by Andrew White
    Hi, I have about 100,000 lines of generic data. Columns/Properties of this data are user definable and are of the usual data types (string, int, double, date). There will be about 50 columns/properties. I have 2 needs: To be able to calculate new columns/properties using an expression e.g. Column3 = Column1 * Column2. Ultimately I would like to be able to use external data using a callback, e.g. Column3 = Column1 * GetTemperature The expression is relatively simple, maths operations, sum, count & IF are the only necessary functions. To be able to filter/group the data and perform aggregations e.g. Sum(Data.Column1) Where(Data.Column2 == "blah") As far as I can see I have two options: 1. Using a DataTable. = Point 1 above is achieved by using DataColumn.Expression = Point 2 above is acheived by using DataTable.DefaultView.RowFilter & C# code 2. Using a List of generic Objects each with a Dictionary< string, object to store the values. = Point 1 could be achieved by something like NCalc = Point 2 is achieved using LINQ DataTable: Pros: DataColumn.Expression is inbuilt Cons: RowFilter & coding c# is not as "nice" as LINQ, DataColumn.Expression does not support callbacks(?) = workaround could be to get & replace external value when creating the calculated column GenericList: Pros: LINQ syntax, NCalc supports callbacks Cons: Implementing NCalc/generic calc engine Based on the above I would think a GenericList approach would win, but something I have not factored in is the performance which for some reason I think would be better with a datatable. Does anyone have a gut feeling / experience with LINQ vs. DataTable performance? How about NCalc? As I said there are about 100,000 rows of data, with 50 columns, of which maybe 20 are calculated. In total about 50 rules will be run against the data, so in total there will be 5 million row/object scans. Would really appreciate any insights. Thx. ps. Of course using a database + SQL & Views etc. would be the easiest solution, but for various reasons can't be implemented.

    Read the article

  • Is there a way to get different sizes of the Windows system icons in .NET?

    - by Andrew Watt
    In particular I'd like to be able to get the small (16 x 16) icons at runtime. I tried this: new Icon(SystemIcons.Error, SystemInformation.SmallIconSize) Which supposedly "attempts to find a version of the icon that matches the requested size", but it's still giving me a 32 x 32 icon. I also tried: Size iconSize = SystemInformation.SmallIconSize; Bitmap bitmap = new Bitmap(iconSize.Width, iconSize.Height); using (Graphics g = Graphics.FromImage(bitmap)) { g.DrawIcon(SystemIcons.Error, new Rectangle(Point.Empty, iconSize)); } But that just scales the 32 x 32 icon down into an ugly 16 x 16. I've considered just pulling icons out of the VS Image Library, but I really want them to vary dynamically with the OS (XP icons on XP, Vista icons on Vista, etc.). I'm willing to P/Invoke if that's what it takes.

    Read the article

  • How did Perl gain a reputation for being a write-only language?

    - by Andrew Grimm
    How did Perl gain a reputation (deserved, undeserved, or used to be deserved, no longer so) of being a "write only language"? Was it The syntax of the language Specific features that were available in the language Specific features not being available in the language (or at least old versions of it) The kind of tasks Perl was being used for The kind of people who use Perl (people who aren't full-time programmers) Criticism from people committed to another language Something else? Background: I'd like to know if some aspects that gave Perl the reputation of being write-only also apply to other languages (specifically ruby). Disclaimer: I recognise that Perl doesn't force people to do write-only code (can any language?), and that you can write bad code in any language.

    Read the article

  • Use a grepped file as an included source in bash

    - by Andrew
    I'm on a shared webhost where I don't have permission to edit the global bash configuration file at /ect/bashrc. Unfortunately there is one line in the global file, mesg y, which puts the terminal in tty mode and makes scp and similar commands unavailable. My local ~./bashrc includes the global file as a source, like so: # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi My current workaround uses grep to output the global file, sans offending line, into a local file and use that as a source. # Source global definitions if [ -f /etc/bashrc ]; then grep -v mesg /etc/bashrc > ~/.bash_global . ~/.bash_global fi Is there a way to do include a grepped file like this without the intermediate step of creating an actual file? Something like this? . grep -v mesg /etc/bashrc > ~/.bash_global

    Read the article

  • XML structure question

    - by Andrew Jahn
    I have a basic XML object that I'm working with. I can't figure out how to access the parts of it. EX:<br> <pre><code> < FacetsData> < Collection name="CDDLALL" type="Group"> < SubCollection name="CDDLALL" type="Row"> < Column name="DPDP_ID">D0230< /Column> < Column name="Count">9< /Column> < /SubCollection> < SubCollection name="CDDLALL" type="Row"> < Column name="DPDP_ID">D1110< /Column> < Column name="Count">9< /Column> < /SubCollection> < /Collection> < /FacetsData> (PS: I can't get this damn xml to format so people can read it) What I need to do is check each DPDP_ID and if its value is D0230 then I leave the Count alone, all else I change the Count to 1. What I have so far: node = doc.DocumentElement; nodeList = node.SelectNodes("/FacetsData/Collection/SubCollection"); for (int x = 0; x < nodeList.Count; x++) { if (nodeList[x].HasChildNodes) { for (int i = 0; i < nodeList[x].ChildNodes.Count; i++) { //This part I can't figure out how to get the name="" part of the xml //MessageBox.Show(oNodeList[x].ChildNodes[i].InnerText); get the "D0230","1" //part but not the "DPDP_ID","Count" part. } } }

    Read the article

  • How do I make a view that groups nodes by taxonomy term?

    - by Andrew Weir
    Hello, I'm trying to bend views and drupal to my will. So far I've produced a view to display the titles of my nodes. Each node will be assigned exactly one taxonomy term from the set {X, Y and Z}. So for example, Node A has a title "Car drives into field, thousands don't care". Node A has a taxonomy term "Pointless". I'd like to group all the node titles by their taxonomy term. So.. Pointless - Car drives into field, thousands don't care - .... Next Taxonomy Term - ..... - ...... - ... You get the idea. Is it doable and how do I do it? I can't find the group by option in views. cheers SO.

    Read the article

  • How to optimize this SQL query for a rectangular region?

    - by Andrew B.
    I'm trying to optimize the following query, but it's not clear to me what index or indexes would be best. I'm storing tiles in a two-dimensional plane and querying for rectangular regions of that plane. The table has, for the purposes of this question, the following columns: id: a primary key integer world_id: an integer foreign key which acts as a namespace for a subset of tiles tileY: the Y-coordinate integer tileX: the X-coordinate integer value: the contents of this tile, a varchar if it matters. I have the following indexes: "ywot_tile_pkey" PRIMARY KEY, btree (id) "ywot_tile_world_id_key" UNIQUE, btree (world_id, "tileY", "tileX") "ywot_tile_world_id" btree (world_id) And this is the query I'm trying to optimize: ywot=> EXPLAIN ANALYZE SELECT * FROM "ywot_tile" WHERE ("world_id" = 27685 AND "tileY" <= 6 AND "tileX" <= 9 AND "tileX" >= -2 AND "tileY" >= -1 ); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- Bitmap Heap Scan on ywot_tile (cost=11384.13..149421.27 rows=65989 width=168) (actual time=79.646..80.075 rows=96 loops=1) Recheck Cond: ((world_id = 27685) AND ("tileY" <= 6) AND ("tileY" >= (-1)) AND ("tileX" <= 9) AND ("tileX" >= (-2))) -> Bitmap Index Scan on ywot_tile_world_id_key (cost=0.00..11367.63 rows=65989 width=0) (actual time=79.615..79.615 rows=125 loops=1) Index Cond: ((world_id = 27685) AND ("tileY" <= 6) AND ("tileY" >= (-1)) AND ("tileX" <= 9) AND ("tileX" >= (-2))) Total runtime: 80.194 ms So the world is fixed, and we are querying for a rectangular region of tiles. Some more information that might be relevant: All the tiles for a queried region may or may not be present The height and width of a queried rectangle are typically about 10x10-20x20 For any given (world, X) or (world, Y) pair, there may be an unbounded number of matching tiles, but the worst case is currently around 10,000, and typically there are far fewer. New tiles are created far less frequently than existing ones are updated (changing the 'value'), and that itself is far less frequent that just reading as in the query above. The only thing I can think of would be to index on (world, X) and (world, Y). My guess is that the database would be able to take those two sets and intersect them. The problem is that there is a potentially unbounded number of matches for either for either of those. Is there some other kind of index that would be more appropriate?

    Read the article

  • Test iPhone in-app purchases on a different bundle?

    - by Andrew Johnson
    We have a group of beta testers for iPhone app. Recently, we added in-app purchases to the app. Before this, we would send out ad hoc builds to beta testers using a separate bundle ID and name so that they could have the store build and the ad hoc build on their phones. However, it seems like we have to build the ad hoc copy with the same Bundle ID to test in-app purchases, and this means we can't send out a seperate beta copy - our beta file (annoyingly) overwrites the user's store-bought app. Is there any way to test in-app purchases in a different bundle ID? Do I need to set up fake, test in-app purchases for the test build too?

    Read the article

  • Linking to an item in another node (XSLT)

    - by Andrew Parisi
    I have an XML document with companies listed in it. I want to create a link with XSLT that contains the <link> child of the next node. Sorry if this is confusing..here is some sample XML of what i'm trying to obtain: <portfolio> <company> <name>Dano Industries</name> <link>dano.xml</link> </company> <company> <name>Mike and Co.</name> <link>mike.xml</link> </company> <company> <name>Steve Inc.</name> <link>steve.xml</link> </company> </portfolio> I want two links, "BACK" and "NEXT". While currently on mike.xml, I want BACK to link to "dano.xml" and NEXT linked to "steve.xml"...etc..and have it dynamically change when on a different page based on the nodes around it. I want to do this because I may add and change the list as I go along, so I don't want to have to manually re-link everything. How can I obtain this? Sorry I am new to XSLT, so please explain with solution if possible! Thanks in advance!

    Read the article

  • HierarchicalDataTemplate Link By Parent

    - by Andrew Kalashnikov
    Hello colleagues. I want bind my treeview. There are a lot of samples binding treeview by object, which contains children collection. I've got domain having just Parent pointer. public class Service : BaseDomain { public virtual string Name { get; set; } public virtual string Description { get; set; } public virtual Service Parent { get; set; } } Can I bind collection of this objects to my treeView. Thanks

    Read the article

  • PHP protected classes and properties, protected from whom?

    - by Andrew Heath
    I'm just getting started with OOP PHP via PHP Object-Oriented Solutions and am a little curious about the notion of protection in OOP. The author clearly explains how protection works, but the bit about not wanting others to be able to change properties falls a bit flat. I'm having a hard time imagining a situation where it is ever possible to prevent others from altering your classes, since they could just open up your class.php and manually tweak whatever they pleased seeing as how PHP is always in plaintext. Caution: all of the above written by a beginner with a beginner's understanding of programming...

    Read the article

  • Adding items to a combo box's internal list programatically.

    - by Andrew
    So, despite Matt's generous explanation in my last question, I still didn't understand and decided to start a new project and use an internal list. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { codesList = [[NSString alloc] initWithContentsOfFile: @".../.../codelist.txt"]; namesList = [[NSString alloc] initWithContentsOfFile: @".../.../namelist.txt"]; codesListArray = [[NSMutableArray alloc]initWithArray:[codesList componentsSeparatedByString:@"\n"]]; namesListArray = [[NSMutableArray alloc]initWithArray:[namesList componentsSeparatedByString:@"\n"]]; addTheDash = [[NSString alloc]initWithString:@" - "]; flossNames = [[NSMutableArray alloc]init]; [flossNames removeAllObjects]; for (int n=0; n<=[codesListArray count]; n++){ NSMutableString *nameBuilder = [[NSMutableString alloc]initWithFormat:@"%@", [codesListArray objectAtIndex:n]]; [nameBuilder appendString:addTheDash]; [nameBuilder appendString:[namesListArray objectAtIndex:n]]; [comboBoz addItemWithObjectValue:[NSMutableString stringWithString:nameBuilder]]; [nameBuilder release]; } } So this is my latest attempt at this and the list still isn't showing in my combo box. I've tried using the addItemsWithObjectValues outside the for loop along with the suggestions at this question: Is this the right way to add items to NSCombobox in Cocoa ? But still no luck. If you can't tell, I'm trying to combine two strings from the files with a hyphen in between them and then put that new string into the combo box. There are over 400 codes and matching names in the two files, so manually putting them in would be a huge chore, not to mention, I don't see what would be causing this problem. The compiler shows no warnings or errors, and in the IB, I have it set to use the internal list, but when I run it, the list is not populated unless I do it manually. Some things I thought might be causing it: Being in the applicationDidFinishLaunching: method Having the string and array variables declared as instance variables in the header (along with @property and @synth done to them) Messing around with using appendString multiple times with NSMutableArrays Nothing seems to be causing this to me, but maybe someone else will know something I don't. Thanks for the help.

    Read the article

  • How to handle concurrency control in ASP.NET Dynamic Data?

    - by Andrew
    I've been quite impressed with dynamic data and how easy and quick it is to get a simple site up and running. I'm planning on using it for a simple internal HR admin site for registering people's skills/degrees/etc. I've been watching the intro videos at www.asp.net/dynamicdata and one thing they never mention is how to handle concurrency control. It seems that DD does not handle it right out of the box (unless there is some setting I haven't seen) as I manually generated a change conflict exception and the app failed without any user friendly message. Anybody know if DD handles it out of the box? Or do you have to somehow build it into the site?

    Read the article

  • How do you limit a page with multiple flash mp3 players to play one at a time?

    - by Andrew.S
    I am working with the open source flash player at http://flash-mp3-player.net/ and I am trying to figure out how to limit one sound file at a time. I know this has been done on a number of sites but I am unsure how to approach it. Scenario: A page has five different instances of the flash player. The user is litening to one song but clicks on another to listen to it. Goal: The first audio file automatically stops while the second starts playing instead of both playing at the same time. Do I need to have some sort of javascript handler than interacts with the swf or something?

    Read the article

  • How do you organise your MVC controller tests?

    - by Andrew Bullock
    I'm looking for tidy suggestions on how people organise their controller tests. For example, take the "add" functionality of my "Address" controller, [AcceptVerbs(HttpVerbs.Get)] public ActionResult Add() { var editAddress = new DTOEditAddress(); editAddress.Address = new Address(); editAddress.Countries = countryService.GetCountries(); return View("Add", editAddress); } [RequireRole(Role = Role.Write)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Add(FormCollection form) { // save code here } I might have a fixture called "when_adding_an_address", however there are two actions i need to test under this title... I don't want to call both actions in my Act() method in my fixture, so I divide the fixture in half, but then how do I name it? "When_adding_an_address_GET" and "When_adding_an_address_POST"? things just seems to be getting messy, quickly. Also, how do you deal with stateless/setupless assertions for controllers, and how do you arrange these wrt the above? for example: [Test] public void the_requesting_user_must_have_write_permissions_to_POST() { Assert.IsTrue(this.SubjectUnderTest.ActionIsProtectedByRole(c => c.Add(null), Role.Write)); } This is custom code i know, but you should get the idea, it simply checks that a filter attribute is present on the method. The point is it doesnt require any Arrange() or Act(). Any tips welcome! Thanks

    Read the article

  • "Send Email" functionality for public web-site

    - by Andrew Florko
    Hello everybody. Public web-site provides list of employees to Internet visitors. Contact information is hidden but visitor can send email via popup email-form. What do you think about automated-scripts/viruses/bot spam activity? Is Capture a "must" for this functionality and what kind of precautions can you suggest also? Thank you in advance

    Read the article

  • SQL Server schema-owner permissions

    - by Andrew Bullock
    if i do: CREATE SCHEMA [test] AUTHORIZATION [testuser] testuser doesn't seem to have any permissions on the schema, is this correct? I thought as the principal that owns the schema, you had full control over it? What permission do i need to grant testuser so that it has full control over the test schema only? Edit: by "full control" i mean the ability to CRUD tables, views, sprocs etc Thanks

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >