Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 110/613 | < Previous Page | 106 107 108 109 110 111 112 113 114 115 116 117  | Next Page >

  • WPF> Using RadioButtonList style. I want to display user friendly enum strings. how?

    - by Saghar
    Hi WPF lovers, I want to display all the possible enum values as Radio buttons. I am using popular RadioButtonList style to display the radiobutton from my enum using DataProvider in a Listcontrol. I can get all the radio buttons but the text appear with the radio button is not user friendly. I am using the following method. http://social.msdn.microsoft.com/forums/en-US/wpf/thread/5137aabc-bb3a-478a-9438-bc93dd9cc0ac/ I want to show "A ball" instead of "a" and "B ball" instead of "b" I thought about using converter. But where to use convert. Or any other way to display user friendly values? As this style is very common, thats why I am not writing whole code. If anything not clear, please ask. I have already invested about 5 hours on this problem.

    Read the article

  • How to open textfile and write to it append-style with php?

    - by Chris_45
    How do you open a textfile and write to it with php appendstyle textFile.txt //caught these variables $var1 = $_POST['string1']; $var2 = $_POST['string2']; $var3 = $_POST['string3']; $handle = fopen("textFile.txt", "w"); fwrite = ("%s %s %s\n", $var1, $var2, $var3, handle);//not the way to append to textfile fclose($handle);

    Read the article

  • Any suggestions for improvement on this style for BDD/TDD?

    - by Sean B
    I was tinkering with doing the setups with our unit test specifciations which go like Specification for SUT when behaviour X happens in scenario Y Given that this thing And also this other thing When I do X... Then It should do ... And It should also do ... I wrapped each of the steps of the GivenThat in Actions... any feed back whether separating with Actions is good / bad / or better way to make the GivenThat clear? /// <summary> /// Given a product is setup for injection /// And Product Image Factory Is Stubbed(); /// And Product Size Is Stubbed(); /// And Drawing Scale Is Stubbed(); /// And Product Type Is Stubbed(); /// </summary> protected override void GivenThat() { base.GivenThat(); Action givenThatAProductIsSetupforInjection = () => { var randomGenerator = new RandomGenerator(); this.Position = randomGenerator.Generate<Point>(); this.Product = new Diffuser { Size = new RectangularProductSize( 2.Inches()), Position = this.Position, ProductType = Dep<IProductType>() }; }; Action andProductImageFactoryIsStubbed = () => Dep<IProductBitmapImageFactory>().Stub(f => f.GetInstance(Dep<IProductType>())).Return(ExpectedBitmapImage); Action andProductSizeIsStubbed = () => { Stub<IDisplacementProduct, IProductSize>(p => p.Size); var productBounds = new ProductBounds(Width.Feet(), Height.Feet()); Dep<IProductSize>().Stub(s => s.Bounds).Return(productBounds); }; Action andDrawingScaleIsStubbed = () => Dep<IDrawingScale>().Stub(s => s.PixelsPerFoot).Return(PixelsPerFoot); Action andProductTypeIsStubbed = () => Stub<IDisplacementProduct, IProductType>(p => p.ProductType); givenThatAProductIsSetupforInjection(); andProductImageFactoryIsStubbed(); andProductSizeIsStubbed(); andDrawingScaleIsStubbed(); andProductTypeIsStubbed(); }

    Read the article

  • Changing color of a row in dropdown list

    - by Judy
    is it possible to change "selector" color in drop-down list? <select name="select" style="background-color: #ff0000"> <option style="background-color: #ff0000" value="1">Red</option> <option style="background-color: #ffffff" value="2">Green</option> <option style="background-color: #0000ff" value="3">Blue</option> </select> I tried in above style but it didn't worked. I know with javascript getting document.getElementById('text').style.color='red' can set the color. But is it possible in html to set the colors?

    Read the article

  • find() or children() to search top-level children only for a style?

    - by user291701
    Hi, I'd like to find if a child element exists which has either of two class styles applied. My code looks like this: var listOfMatchedResults = $("#parentList").find(".myStyle1, .myStyle2"); My styles are defined like this: .parent li, .myStyle0 { } .parent li.myStyle1 { } .parent li.myStyle2 { } I don't need to traverse more than one level deeper than the children level, like: <ul id='parentList'> <li><p>foo</p><p>grok</p></li> <li class='myStyle2'><p>Here</p><p>I am!</p></li> <li><p>foo</p><p>grok</p></li> </ul> I'm not clear as to what find() is doing, is it going into each of the paragraph elements too? I just need it to traverse the top-level children - is there a way to specify that? Thank you

    Read the article

  • Are there any shortcuts/easier(VB) style way for raising events in C#?

    - by Eric
    Example in VB I have a worker class Public Class worker Public Event EventNumber1(ByVal messages As Dictionary(Of Integer, String)) Public Event EventNumber2(ByVal message As String) Public Sub CallEventNumber1() Dim dict As New Dictionary(Of Integer, String) dict.Add(1, "EventNumber1 First message") dict.Add(2, "EventNumber1 Second message") RaiseEvent EventNumber1(dict) End Sub Public Sub CallEventNumber2() RaiseEvent EventNumber2("I am an EventNumber2 Message") End Sub End Class and wire them up in another class with AddHandler _worker.EventNumber1, AddressOf EventNumber1Handler AddHandler _worker.EventNumber2, AddressOf EventNumber2Handler and in C# the worker class class Worker { public delegate void EventNumber1Handler(Dictionary<int, string> messages); public delegate void EventNumber2Handler(string message); public event EventNumber1Handler EventNumber1; public event EventNumber2Handler EventNumber2; public void CallEventNumber1() { Dictionary<int, string> dict = new Dictionary<int, string>(); dict.Add(1, "EventNumber1 First message"); dict.Add(2, "EventNumber1 Second message"); if (EventNumber1 != null) EventNumber1(dict); } public void CallEventNumber2() { if (EventNumber2 != null) EventNumber2("I am an EventNumber2 Message"); } } and wire that up with worker.EventNumber1 += new Worker.EventNumber1Handler(worker_EventNumber1); worker.EventNumber2 += new Worker.EventNumber2Handler(worker_EventNumber2); So I guess my question is do I always need to add the delegate along with the event in c#? Is there any new syntax for c# 3.0/4.0? Regards _Eric

    Read the article

  • How to make CMake to generate KDE-style makefiles with progress tracking?

    - by mhambra
    Generating moc_krvfshandler.cpp [ 2%] [ 2%] Building CXX object krusader/GUI/CMakeFiles/GUI.dir/GUI_automoc.o Building CXX object krusader/DiskUsage/CMakeFiles/DiskUsage.dir/DiskUsage_automoc.o [ 2%] Building CXX object krusader/Dialogs/CMakeFiles/Dialogs.dir/Dialogs_automoc.o Generating moc_krmousehandler.cpp [ 3%] Building CXX object krusader/ActionMan/CMakeFiles/ActionMan.dir/actionman.o Generating moc_packjob.cpp [ 4%] Building CXX object krusader/Dialogs/CMakeFiles/Dialogs.dir/krsqueezedtextlabel.o Generating moc_krpreviews.cpp [ 4%] Built target VFS_automoc [ 4%] Generating moc_krvfsmodel.cpp Wanted the same thing.

    Read the article

  • How can I get a Dialog style activity window to fill the screen?

    - by Matthias
    I am using an activity with the dialog theme set, and I want it to be full screen. I tried all sorts of things, even going through the WindowManager to expand the window to full width and height manually, but nothing works. Apparently, a dialog window (or an activity with the dialog theme) will only expand according to its contents, but even that doesn't always work. For instance, I show a progress bar circle which has width and height set to FILL_PARENT (so does its layout container), but still, the dialog wraps around the much smaller progress bar instead of filling the screen. There must be a way of displaying something small inside a dialog window but have it expand to full screen size without its content resizing as well?

    Read the article

  • Objective-C style question: do "release" or "nil" properties in dealloc?

    - by Piotr Czapla
    Hi, Apple usually release ivars in dealloc but is there anything wrong with nilling the properties in dealloc? I mean instead of this: - (void) dealoc(){ [myRetainedProperty release]; [super dealloc]; } write code like this: - (void) dealoc(){ self.myRetainedProperty = nil; [super dealloc]; } I know that it is one additional method call but on the other hand it is safer as it doesn't crashes when you change your property form retain to assign and forget to amend dealloc. What do you think? Can you think about any other reason to use release instead of setting nil besides performance?

    Read the article

  • Changing floating point behavior in Python to Numpy style.

    - by Tristan
    Is there a way to make Python floating point numbers follow numpy's rules regarding +/- Inf and NaN? For instance, making 1.0/0.0 = Inf. >>> from numpy import * >>> ones(1)/0 array([ Inf]) >>> 1.0/0.0 Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: float division Numpy's divide function divide(1.0,0.0)=Inf however it is not clear if it can be used similar to from __future__ import division.

    Read the article

  • How to add style to parent <li> item if child <ul> exists?

    - by user1292760
    I'm trying to make a menu in advance to be seen whether there is a double nesting. <ul class="parent"> <li class="child"></li> <li class="child"> <ul slass="nesting"> <li></li> <li></li> </ul> </li> <li class="child"></li> </ul> So ul class="nesting" hidden by default but appears during the hover of li class="child". I want to make another design on the li class="child" which have a nested ul. Another words how can i show nesting before hover by the means of Javascript/JQuery? Thnaks in advance!

    Read the article

  • Calculate difference in days ActiveSupport:TimeWithZone in the most "rubyish" style?

    - by Nick
    I have a feeling someone is going to point me to another question that answers this but I've been searching with no luck over this simple issue. I have a Activerecord with a datetime property. It returns as an ActiveSupport:TimeWithZone. I know I can't compare that to DateTime.now because that doesn't include a zone so I need to use Time.zone. Makes sense. What I'm wondering is stylewise is there a "cleaner" way to do this than subtracting and dividing the result by 86400? Here's what I do: ((Time.zone.now - myActiveRecord.visit_date)/86400).to_i Works but seems un-rubyish and I feel like I'm missing something. Should I be casting, comparing or converting some other route or is this really the typical way to do this in rails? Appreciate any tips or a link to a question that already covers this. Thank you

    Read the article

  • How to properly enque css in to wordpress

    - by wordpressm
    I am trying to en-queue css in worpress. Here is my code function amba_adding_styles() { wp_register_script( 'jquery-ui-css', 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css'); // Register the style like this for a plugin: wp_register_style( 'custom-style', plugins_url( '/css/custom-style.css', __FILE__ ), array(), '20120208', 'all' ); // For either a plugin or a theme, you can then enqueue the style: wp_enqueue_style( 'jquery-ui-css' ); // For either a plugin or a theme, you can then enqueue the style: wp_enqueue_style( 'custom-style' ); } add_action( 'wp_enqueue_scripts', 'amba_adding_styles' ); However, jquer-ui.css doesnt load. Can anybody guess the error here??

    Read the article

  • CSS Question - Any way to set (eg. a font-size) to a group of styles, by linking the style to anothe

    - by Joe
    .small_fonts{ font-size:10px; } .fonts_blue{ color:blue; } .fonts_red{ color:red; } .fonts_green{ color:green; } Any way to apply "small_fonts" to each of the "fonts_blue, _red, _green" w/o doing this: .fonts_blue, fonts_red, fonts_green { font-size:10px; } I am just trying to update my css to be more organized. I realised I don't need to define the font-size for each of the "small" fonts. When adding the class btw... I know you can do this: class="small_fonts fonts_blue" ~ however I'm talking about combining within the css stylesheet

    Read the article

< Previous Page | 106 107 108 109 110 111 112 113 114 115 116 117  | Next Page >