Daily Archives

Articles indexed Friday May 21 2010

Page 1/114 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Why is the unit test useful when the view is not unit testable in MVVM?

    - by BigTiger
    Why is the unit test useful when the view is not unit testable in MVVM? In MVVM, we have the models, view-models, and views. The claimed advantage is that MVVM can make the models and view=models unit testable. But all the three parties belong to the same application. If the views are not unit testable, why test the other two? Will unit testing the other two and leave one not tested improve the quality? Removing all the code-behind from the views sounds weird to me. How about the code-behind only handles the pure UI operations?

    Read the article

  • iPhone NavigationControl Toolbar items

    - by BahaiResearch.com
    MonoTouch preferred, but Obj-C ok too My MainWindow.xib has a NavigationView and a View. The View appears nicely and works, but I need to add buttons to the toolbar that is part of the NavigationView. I can see the toolbar in IB. In this View I try to add buttons to the toolbar, but they do not appear. UIBarButtonItem btnBrowse = new UIBarButtonItem ("Browse", UIBarButtonItemStyle.Bordered, null); UIBarButtonItem btnOptions = new UIBarButtonItem ("Options", UIBarButtonItemStyle.Bordered, null); UIBarButtonItem btnBibles = new UIBarButtonItem ("Bibles", UIBarButtonItemStyle.Bordered, null); UIBarButtonItem btnSpacer = new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace); void WireUpCommands () { this.NavigationController.Toolbar.SetItems (new[] { btnOptions, btnSpacer, btnBrowse, btnSpacer, btnBibles }, false); }

    Read the article

  • Member "TextTrimming" is not recognized in Expression Blend?

    - by emalamisura
    So I am using Silverlight 4.0 I have the following code but its giving me the following error: "The member "TextTrimming" is not recognized or is not accessible", but it works fine when I run in Visual Studio 2010. <TextBlock Margin="0,30,28.789,50.455" TextWrapping="Wrap" TextTrimming="WordEllipsis" HorizontalAlignment="Right" Width="117" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Text="This is some text in a sticky note for the sake of making sure that the text will fit and that the user can see all the necessary details that are going to be available and stuff" LineHeight="-1" FontWeight="Normal"> <TextBlock.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform AngleX="8"/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </TextBlock.RenderTransform>

    Read the article

  • Interface implementation Diferences

    - by carlos
    What is the diference of using interfaces like ... I have an interface Public Interface IProDataSource Function read() As Integer End Interface Then a class Public Class DataSource : Implements IProDataSource Function read() As Integer Implements IProDataSource.read some code... End Function End Class Then I use this the next way ... but what is the difference? ... boths approaches are working ... Dim obj As IProDataSource = New DataSource obj.read() vs Dim datas as new Datasource datas.read() The only difference I have notice is that if the method is declare private it will be visible using the first approach only. Thanks for any comments !!!

    Read the article

  • How can I scale the height of a UITextView to fit a changing amount of text?

    - by Tony
    I created a nib for a specific view I have. The view has a text field that may change height depending on the amount of text in the view's "represented object". For example, a blog post screen would have to handle different amounts of text as blog posts are not the same length and you obviously only want one nib to represent all blog posts. Here is a screen shot of my nib settings. Do you know what is wrong? I am pretty sure it is just staying at the height I give it. Thanks!

    Read the article

  • Python- Convert a mixed number to a float

    - by user345660
    I want to make a function that converts mixed numbers and fractions (as strings) to floats. Here's some examples: '1 1/2' -> 1.5 '11/2' -> 5.5 '7/8' -> 0.875 '3' -> 3 '7.7' -> 7.7 I'm currently using this function, but I think it could be improved. It also doesn't handle numbers that are already in decimal representation def mixedtofloat(txt): mixednum = re.compile("(\\d+) (\\d+)\\/(\\d+)",re.IGNORECASE|re.DOTALL) fraction = re.compile("(\\d+)\\/(\\d+)",re.IGNORECASE|re.DOTALL) integer = re.compile("(\\d+)",re.IGNORECASE|re.DOTALL) m = mixednum.search(txt) n = fraction.search(txt) o = integer.search(txt) if m: return float(m.group(1))+(float(m.group(2))/float(m.group(3))) elif n: return float(n.group(1))/float(n.group(2)) elif o: return float(o.group(1)) else: return txt Thanks!

    Read the article

  • How to make a Custom Data Generator for SQL XML DataType.

    - by Keith Sirmons
    Howdy, I am using Visual Studio 2010 and am playing around with the Database Projects. I am creating a DataGenerationPlan to insert data into a simple table, in which one of the column datatypes is XML. Out of the box, the generation plan uses the Regular Expression generator and generates something like this : HGcSv9wa7yM44T9x5oFT4pmBkEmv62lJ7OyAmCnL6yqXC2X.......... I am looking at creating a custom data Generator for this data type and have followed this site for the basics: http://msdn.microsoft.com/en-us/library/aa833244.aspx This example works if I am creating a string datatype and using it for a nvarchar datatype. What do I need to change to hook this Generator to the XML Datatype? Below are my code files. The string property works for nvarchar. The XElement property does not work for the xml datatype, and the RecordXMLDataGenerator is not listed as an option in the Generator column for the generation plan. CustomDataGenerators: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Data.Schema.Tools.DataGenerator; using Microsoft.Data.Schema.Extensibility; using Microsoft.Data.Schema; using Microsoft.Data.Schema.Sql; using System.Xml.Linq; namespace CustomDataGenerators { [DatabaseSchemaProviderCompatibility(typeof(SqlDatabaseSchemaProvider))] public class RecordXMLDataGenerator : Generator { private XElement _RecordData; [Output(Description = "Generates string of XML Data for the Record.", Name = "RecordDataString")] public string RecordDataString { get { return _RecordData.ToString(SaveOptions.None); } } [Output(Description = "Generates XML Data for the Record.", Name = "RecordData")] public XElement RecordData { get { return _RecordData; } } protected override void OnGenerateNextValues() { base.OnGenerateNextValues(); XElement element = new XElement("Root", new XElement("Children1", 1), new XElement("Children6", 6) ); _RecordData = element; } } } XML Extensions File: <?xml version="1.0" encoding="utf-8" ?> <extensions assembly="" version="1" xmlns="urn:Microsoft.Data.Schema.Extensions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:Microsoft.Data.Schema.Extensions Microsoft.Data.Schema.Extensions.xsd"> <extension type="CustomDataGenerators.RecordXMLDataGenerator" assembly="CustomDataGenerators, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxx" enabled="true"/> </extensions> Table.sql: CREATE TABLE [dbo].[Record] ( id int IDENTITY (1,1) NOT NULL, recordData xml NULL, userId int NULL, test nvarchar(max) NULL, rowver rowversion NULL, CONSTRAINT pk_RecordID PRIMARY KEY (id) )

    Read the article

  • Pseudorandom crashes in Flash Debugger - My bad, or Abode's?

    - by rinogo
    I'm working on a large-size dual AS3/Flex project (some parts are pure AS3, other parts are Flex), and I'm experiencing a lot of Flash Debugger crashes. These crashes aren't completely random - it seems like I can get them to occur with greater consistency when I perform certain actions in my app. However, at the same time, they aren't consistently repeatable - sometimes a set of actions causes my app to crash, and other times, the same steps execute fine without a crash. I have two questions (carefully worded to remove my personal bias :) ) Are these crashes due to my coding practices, or Adobe's Flash Debugger? When I deploy my app on a web site and access it via Flash Player, should I expect the same crashes to occur, or is Flash Player considerably more resilient than Flash Debugger? Thanks so much, all! :) -Rich

    Read the article

  • Flex ProgressBar component problem

    - by Abhinav
    I am trying to use the ProgressBar Flex component inside a custom Actionscript 3.0 component derived from the UIComponent class. I have set the minimum and maximum values etc. _progressBar = new ProgressBar(); _progressBar.label = "Loading"; _progressBar.minimum = 0; _progressBar.maximum = 100; _progressBar.direction = ProgressBarDirection.RIGHT; _progressBar.mode = ProgressBarMode.MANUAL; The component shows the "Loading" text but not the loading bar. Anything like _progressBar.setProgress(20, 100) does not have any effect on the code. Any ideas why this is not working?

    Read the article

  • Can one instance of a WCF service pass work on to another instance where this 2nd instance would rep

    - by Matt
    Let's say I have 2 instances of the same web services. Is there a way that I can have the second instance of the web service perform a task at the behest of the first instance of the WCF service and reply directly to the original requester? I could code this and include logic in WCF-A to contact WCF-B under the right conditions and then passback the result, but returning to the requester directly from WCF-B would be easier. Also, I made a handy dandy chart.

    Read the article

  • Is it possible to intercept an HTML form post and do some processing before sending it to it's final

    - by Brent
    I'm trying to extend the functionality of an ASP.net application that I'm working with. For its logon page, it uses an html form to post to a dll to handle it's login logic. I'm wondering if there is any way to redirect that html POST to my C# code so that I can do some processing and then (and this is the part that I haven't figured out yet) POST it to the dll so that the regular logon logic can continue. I can make changes to the logon page, but the final step must be to do an HTML POST to the dll. I can't change that.

    Read the article

  • ModelMultipleChoiceField and reverse()

    - by celopes
    I have a form containing a ModelMultipleChoiceField. Is it possible to come up with a url mapping that will capture a varying number of parameters from said ModelMultipleChoiceField? I find myself doing a reverse() call in the view passing the arguments of the form submission and realized that I don't know how to represent, in the urlconf, the multiple values from the SELECT tag rendered for the ModelMultipleChoiceField...

    Read the article

  • What tools provide burndown charts to Bugzilla or Mylyn?

    - by Daniel Jomphe
    My team and I need to work on a project whose bugs are filed in Bugzilla, using Mylyn. Do you know of any tool or plug-in that provides scrum-inspired burndown charts to Bugzilla or Mylyn? Hopefully, this tool would be free for commercial usage, but we're not closed to commercial tools. Update: 4 hours of research allowed me to find very few free tools. Looks like bugzilla isn't popular in agile teams! And obviously, it's not the best fit.

    Read the article

  • Computer starts, POSTs normal, no video

    - by Annath
    So, I recently tried to start up an old computer of mine. It would not power on, so I replaced the PSU. When I powered it on, all the fans spun up and the POST beeps indicated a normal startup. The problem was there was no video output. Every couple of minutes, I hear the post code again. I think it is restarting after POST, but without video I have no idea why. Does anyone have an idea as to why this is happening, and how to fix it? EDIT: The video card is a PCI-e card. There is no integrated graphics on the motherboard. If I remove the video card, the POST indicates a missing card. When I put it back, it goes back to normal, so I know that it recognizes that the card exists.

    Read the article

  • How to convert an object into a double?

    - by george t.
    I am working on VS C# on the following code, which converts an user input math expression and computes it. MSScriptControl.ScriptControl sc = new MSScriptControl.ScriptControl(); sc.Language = "VBScript"; sc.ExecuteStatement( "function pi\n" + "pi = 3.14159265\n" + "end function"); sc.ExecuteStatement( "function e\n" + "e = exp(1)\n" + "end function"); expression = textBox1.Text.ToString(); expression = expression.Replace("x", i.ToString()); object y = sc.Eval(expression); string k = y.ToString(); double result = double.Parse(k); While this outputs onto the console with the correct result, I want to use the values to make a graph of the function user inputs and it's not doing it correctly. Thank you for your help.

    Read the article

  • iPhone: Compressing .app files in command line (Mac OS X) removes CodeSigning

    - by Santthosh
    I am trying to do a simple build automation of my iPhone apps with TeamCity, but having this nagging issue.. When I manually pickup and install .app file from the build folder it works great (syncs smoothly with iTunes and I can see the app on my phone) But when I try to zip this with /bin/zip or ditto...then the zipped contents loose the CodeSigning (iTunes says that it cannot install this app because its not signed) I have tried different combinations of these.. ditto -ck --rsrc --keepParent HelloWorld.app HelloWorld.zip Any more ideas?

    Read the article

  • Ruby: Passing optional objects to method

    - by Sam
    Class TShirt def size(suggested_size) if suggested_size == nil size = "please choose a size" else size = suggested end end end tshirt = TShirt.new tshirt.size("M") == "M" tshirt = TShirt.new size = tshirt.size(nil) == "please choose a size" What is a better way to have optional objects in a method? Procs?

    Read the article

  • Drupal: How can one use Context to trigger a reaction for a Taxonomy Term condition caused by a Vie

    - by jschrab
    What I would like to do is use the Context module to insert $body_classes of my choosing based on a Taxonomy Term condition. Fine, that's what the Context module is for. Seems simple enough IF your content/page source is a node that is involved with the appropriate Terms. However, I have a page generated by Views that has the appropriate Taxonomy Term id that SHOULD trigger the condition but it doesn't. Now I could set my $body_classes in a "preprocess" in template.php but I'd rather avoid that. Is this even possible in Context? Or am I just doing something wrong?

    Read the article

  • Better Flex memory profiling tools

    - by verveguy
    Does anyone know of any better tools that the Flex Builder Profiler? I've googled and googled to no avail. While the FB tools are OK for small apps / small leak situations, they're nowhere near adequate for wading through the thicket of object references that can arise in a large scale Flex app (that is leaking memory heavily). In particular, any reasonably complex view structure ends up with huge numbers of parent/child object references to the top level view - none of which are at all relevant to finding the one or two refs from outside the parent child subgraph that are causing the whole bolus to be non-GC'able. If no one has any better suggestions, I'm seriously considering writing a tool to parse the saved profile dumps that Flex Builder can generate so that I can do my own "graph pruning" to find the important refs. If I go this route, collaboration would be welcome!

    Read the article

  • jQuery: How to check if a value exists in an array?

    - by Jannis
    Hello, I am trying to write a simple input field validation plugin at the moment (more of a learning exercise really) and thought this would not be too hard, seeing as all I should have to do is: Get input fields Store them in array with each one's value On submit of form check if array contains any empty strings But I seem to fail at writing something that checks for an empty string (read: input with no text inside) inside my array. Here is the code I have so far: var form = $(this), // passed in form element inputs = form.find('input'), // all of this forms input fields isValid = false; // initially set the form to not be valid function validate() { var fields = inputs.serializeArray(); // make an array out of input fields // start -- this does not work for (var n in fields) { if (fields[n].value == "") { isValid = false; console.log('failed'); } else { isValid = true; console.log('passed'); }; } // end -- this does not work }; // close validate() // TRIGGERS inputs.live('keyup blur', function(event) { validate(); }); Any help with how I can check if one of the fields is blank and if so return a isValid = false would be much appreciated. I also played around with the $.inArray("", fields) but this would never return 0 or 1 even when the console.log showed that the fields had no value. Thanks for reading.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >