Search Results

Search found 7104 results on 285 pages for 'dynamic usercontrols'.

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

  • Goodbye XML&hellip; Hello YAML (part 2)

    - by Brian Genisio's House Of Bilz
    Part 1 After I explained my motivation for using YAML instead of XML for my data, I got a lot of people asking me what type of tooling is available in the .Net space for consuming YAML.  In this post, I will discuss a nice tooling option as well as describe some small modifications to leverage the extremely powerful dynamic capabilities of C# 4.0.  I will be referring to the following YAML file throughout this post Recipe: Title: Macaroni and Cheese Description: My favorite comfort food. Author: Brian Genisio TimeToPrepare: 30 Minutes Ingredients: - Name: Cheese Quantity: 3 Units: cups - Name: Macaroni Quantity: 16 Units: oz Steps: - Number: 1 Description: Cook the macaroni - Number: 2 Description: Melt the cheese - Number: 3 Description: Mix the cooked macaroni with the melted cheese Tooling It turns out that there are several implementations of YAML tools out there.  The neatest one, in my opinion, is YAML for .NET, Visual Studio and Powershell.  It includes a great editor plug-in for Visual Studio as well as YamlCore, which is a parsing engine for .Net.  It is in active development still, but it is certainly enough to get you going with YAML in .Net.  Start by referenceing YamlCore.dll, load your document, and you are on your way.  Here is an example of using the parser to get the title of the Recipe: var yaml = YamlLanguage.FileTo("Data.yaml") as Hashtable; var recipe = yaml["Recipe"] as Hashtable; var title = recipe["Title"] as string; In a similar way, you can access data in the Ingredients set: var yaml = YamlLanguage.FileTo("Data.yaml") as Hashtable; var recipe = yaml["Recipe"] as Hashtable; var ingredients = recipe["Ingredients"] as ArrayList; foreach (Hashtable ingredient in ingredients) { var name = ingredient["Name"] as string; } You may have noticed that YamlCore uses non-generic Hashtables and ArrayLists.  This is because YamlCore was designed to work in all .Net versions, including 1.0.  Everything in the parsed tree is one of two things: Hashtable, ArrayList or Value type (usually String).  This translates well to the YAML structure where everything is either a Map, a Set or a Value.  Taking it further Personally, I really dislike writing code like this.  Years ago, I promised myself to never write the words Hashtable or ArrayList in my .Net code again.  They are ugly, mostly depreciated collections that existed before we got generics in C# 2.0.  Now, especially that we have dynamic capabilities in C# 4.0, we can do a lot better than this.  With a relatively small amount of code, you can wrap the Hashtables and Array lists with a dynamic wrapper (wrapper code at the bottom of this post).  The same code can be re-written to look like this: dynamic doc = YamlDoc.Load("Data.yaml"); var title = doc.Recipe.Title; And dynamic doc = YamlDoc.Load("Data.yaml"); foreach (dynamic ingredient in doc.Recipe.Ingredients) { var name = ingredient.Name; } I significantly prefer this code over the previous.  That’s not all… the magic really happens when we take this concept into WPF.  With a single line of code, you can bind to the data dynamically in the view: DataContext = YamlDoc.Load("Data.yaml"); Then, your XAML is extremely straight-forward (Nothing else.  No static types, no adapter code.  Nothing): <StackPanel> <TextBlock Text="{Binding Recipe.Title}" /> <TextBlock Text="{Binding Recipe.Description}" /> <TextBlock Text="{Binding Recipe.Author}" /> <TextBlock Text="{Binding Recipe.TimeToPrepare}" /> <TextBlock Text="Ingredients:" FontWeight="Bold" /> <ItemsControl ItemsSource="{Binding Recipe.Ingredients}" Margin="10,0,0,0"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Quantity}" /> <TextBlock Text=" " /> <TextBlock Text="{Binding Units}" /> <TextBlock Text=" of " /> <TextBlock Text="{Binding Name}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <TextBlock Text="Steps:" FontWeight="Bold" /> <ItemsControl ItemsSource="{Binding Recipe.Steps}" Margin="10,0,0,0"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Number}" /> <TextBlock Text=": " /> <TextBlock Text="{Binding Description}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> This nifty XAML binding trick only works in WPF, unfortunately.  Silverlight handles binding differently, so they don’t support binding to dynamic objects as of late (March 2010).  This, in my opinion, is a major lacking feature in Silverlight and I really hope we will see this feature available to us in Silverlight 4 Release.  (I am not very optimistic for Silverlight 4, but I can hope for the feature in Silverlight 5, can’t I?) Conclusion I still have a few things I want to say about using YAML in the .Net space including de-serialization and using IronRuby for your YAML parser, but this post is hopefully enough to see how easy it is to incorporate YAML documents in your code. Codeplex Site for YAML tools Dynamic wrapper for YamlCore

    Read the article

  • SSAS DMVs: useful links

    - by Davide Mauri
    From time to time happens that I need to extract metadata informations from Analysis Services DMVS in order to quickly get an overview of the entire situation and/or drill down to detail level. As a memo I post the link I use most when need to get documentation on SSAS Objects Data DMVs: SSAS: Using DMV Queries to get Cube Metadata http://bennyaustin.wordpress.com/2011/03/01/ssas-dmv-queries-cube-metadata/ SSAS DMV (Dynamic Management View) http://dwbi1.wordpress.com/2010/01/01/ssas-dmv-dynamic-management-view/ Use Dynamic Management Views (DMVs) to Monitor Analysis Services http://msdn.microsoft.com/en-us/library/hh230820.aspx

    Read the article

  • Adventures in MVVM &ndash; My ViewModel Base &ndash; Silverlight Support!

    - by Brian Genisio's House Of Bilz
    More Adventures in MVVM In my last post, I outlined the powerful features that are available in the ViewModelSupport.  It takes advantage of the dynamic features of C# 4.0 (as well as some 3.0 goodies) to help eliminate the plumbing that often comes with writing ViewModels.  If you are interested in learning about the capabilities, please take a look at that post and look at the code on CodePlex.  When I wrote about the ViewModel base class, I complained that the features did not work in Silverlight because as of 4.0, it does not support binding to dynamic properties.  Although I still think this is a bummer, I am happy to say that I have come up with a workaround.  In the Silverlight version of my base class, I include a PropertyCollectionConverter that lets you bind to dynamic properties in the ViewModelBase, especially the convention-based commands that the base class supports. To take advantage of any properties that are not statically defined, you can bind to the Properties property of the ViewModel and pass in a converter parameter for the name of the property you want to bind. For example, a ViewModel that looks like this: public class ExampleViewModel : ViewModelBase { public void Execute_MyCommand() { Set("Text", "Foo"); } } Can bind to the dynamic property and the convention-based command with the following XAML. <TextBlock Text="{Binding Properties, Converter={StaticResource PropertiesConverter}, ConverterParameter=Text}" Margin="5" /> <Button Content="Execute MyCommand" Command="{Binding Properties, Converter={StaticResource PropertiesConverter}, ConverterParameter=MyCommand}" Margin="5" /> Of course, it is not as pretty as binding to Text and MyCommand like you can in WPF.  But, it is better than having a failed feature.  This allows you to share your ViewModels between WPF and Silverlight very easily.  <BeatDeadHorse>Hopefully, in Silverlight 5.0, we will see binding to dynamic properties more directly????</BeatDeadHorse>

    Read the article

  • Implementing Search Engine Optimization Technique to E-Publishing Domain

    Implement the SEO concepts to both applications static and dynamic web application. There is no issue for create SEO contents to static (web contents does not change until that web site is re host) web application and keep up the SEO regulations and state of affairs. A few significant challenges to dynamic content poses. To overcome these challenges to have a fully functional dynamic site that is optimized as much as a static site can be optimized. Whatever user search and they can get information their information quickly.

    Read the article

  • when add dynamic control in update panel then getting failed to load viewsate error ?

    - by Tushar Maru
    when add dynamic control in update panel then getting failed to load viewsate error ? see following example :- UpdatePanel panel = new UpdatePanel(); panel.ContentTemplateContainer.Controls.Clear(); if (strPopupType == "O") { Control ctrl = Page.LoadControl(@"~/Modules/MLM/UnilevelViewer/DesktopModules/OrderDetails.ascx"); OrderDetails orderdetails = (OrderDetails)ctrl; orderdetails.ID = "Orders" + elementID; orderdetails.OrderID = Convert.ToInt32(elementID); //orderdetails.ModuleSkinStyleName = CurrentModuleSkin; panel.ContentTemplateContainer.Controls.Add(ctrl); } else if (strPopupType == "U") { Control ctrl = Page.LoadControl(@"~/Modules/MLM/UnilevelViewer/DesktopModules/UserDetails.ascx"); UserDetails userdetails = (UserDetails)ctrl; userdetails.ID = "Users" + elementID; // userdetails.UserModuleSkinStyleName = CurrentModuleSkin; userdetails.UserID = new Guid(elementID); panel.ContentTemplateContainer.Controls.Add(ctrl); }

    Read the article

  • Dynamic openrowset in T-Sql Function or viable alternative?

    - by IronicMuffin
    I'm not quite sure how to phrase this. Here is the problem: I have 1-n items that I need to join to a different system (AS400) to get some data. The openrowset takes forever if I specify the where criteria outside of the openrowset, e.g.: select * from openrowset('my connection string', 'select code, myfield from myTable') where code = @code My idea was to create a function that takes in the item number and uses dynamic sql to inject it into the openrowset string, a la: declare @cmd varchar(1000) set @cmd = 'select * from openrowset('my connection string', ''select code, myfield from myTable where code = ' + @code + ''')' Apparently I can't use the insert.. exec.. strategy inside of a function. Is there any better way to achieve this? I was going to use this in joins where I needed the external data using cross apply. I'm not married to tvf and cross apply, but I do need a method of getting this data quickly. Thanks for any help.

    Read the article

  • Does Delphi really handle dynamic classes better than static?

    - by John
    Hello, I was told more than once that Delphi handles dynamic classes better than static.Thereby using the following: type Tsomeclass=class(TObject) private procedure proc1; public someint:integer; procedure proc2; end; var someclass:TSomeclass; implementation ... initialization someclass:=TSomeclass.Create; finalization someclass.Free; rather than type Tsomeclass=class private class procedure proc1; public var someint:integer; class procedure proc2; end; 90% of the classes in the project I'm working on have and need only one instance.Do I really have to use the first way for using those classes? Is it better optimized,handled by Delphi? Sorry,I have no arguments to backup this hypothesis,but I want an expert's opinion. Thanks in advance!

    Read the article

  • What web UI framework is most suitable for building dynamic pages / forms?

    - by waxwing
    Hello, We are at a stage where we are considering different Web UI frameworks (most likely component based ones such as GWT, JSF, Wicket, Vaadin, etc). One of the main use cases / constraints is that it must support generating dynamic pages. I.e., the page/form layout and components is stored in a database and is changeable at runtime, and from this pages are generated. We are also going to write static layouts, but that is not the main focus of this question. I thought maybe the user community here can share experiences of different frameworks in this context. Are there differences in ease of implementation and what is suitable?

    Read the article

  • How to get dynamic SQL result from SP in entity framework?

    - by KentZhou
    Suppose I have following SP to run a dynamic sql ALTER PROCEDURE [dbo].[MySP] AS BEGIN declare @sql varchar(4000) select @sql = 'select cnt = count(*) from Mytable ..... '; exec (@sql) END then in edmx, I add the sp and import function for this sp. the return type is scalars int32. then I want to use this function in code like: int? result = context.MySP(); I got error said "cannot implicitly convert type System.Data.Objects.ObjectResults to int?" If use var result = context.MySP(); then Single() cann't be applied to context.MySP(). How to get the result for this case?

    Read the article

  • How do I keep the width of a table constant when it has dynamic content?

    - by Lincoln Bergeson
    How do I keep the width of a table constant, even when the content of that table is interactively changing? Old Post: How do I insert a variable length tab in HTML? I want certain dynamic fields in my table to line up but they're changing width constantly. EDIT: What I mean is this: in any text editor I can press tab to align certain bits of text, and not care about how many spaces there are. In fact, the number of spaces there needs to be for the leftmost part of the text can change, and I still won't care, as long as the text lines up. How do I do this is in HTML?

    Read the article

  • Rails plugin for generating dynamic / ajax crud interfaces compatible with Rails 3 beta?

    - by mikehansen
    Anyone know of some good gems or plugins to create dynamic / ajax crud interfaces for Rails 3 projects? I know active scaffold was popular before and it's been awhile since I have used it / any other gems similar to this (I usually just write it myself). I like the direction that the formtastic gem (http://github.com/justinfrench/formtastic) is headed and wonder what else people are combining with it. Also I like the generators approach that Ryan Bates uses and he appears to be making updates for Rails 3. Anything else I am missing here? (I am also open to gems not compatible with Rails 3 too I guess, I can always make a contribution and try to help them get to the next phase. ;)) PS - Really stackoverflow, only one hyperlink?? lame.

    Read the article

  • Is it ok to hardcode dynamic links in a permanent view?

    - by meder
    Let's say I wanted to showcase 2-3 clickable buttons on my homepage which will be there permanently. These are links to the css, html, and javascript tag listing pages. Is it fine to just hardcode href=/tags/css and href=/tags/html right in my django templates/view? I won't change them for at least a year or so, meaning I don't think I need to add a column to the tags table to distinguish them - is this common or should I try to make it somewhat dynamic? These tags are in a table but so are 1000 other tags.

    Read the article

  • How do I unhide a CFDIV that has dynamic content with AJAX binding itself?

    - by Eric Belair
    I have the following CFSELECT tags that are used to populate a text input: <cfselect id="this" name="this" bind="cfc:Data.getThis()" bindonload="true" /> <cfselect id="that" name="that" bind="cfc:Data.getThat({p1})" /> <cfselect id="theOther" name="theOther" bind="cfc:Data.getTheOther({p1}, {p2})" /> The text input is the only value that needs to be submitted in a form: <cfform name="addItem" method="post" action="somepage.cfm"> <cfinput type="text" id="item" name="item" bind="cfc:Data.getResult({this}, {that}, {theOther})" /><br /> <cfinput type="submit" name="addButton" value="Add Item" /> </cfform> I want the form and it's contents to be visible only when all three selections have been made, and there is a value for the text input. What is the best way to do this? I'm assuming some use of CFDIV is the best way, but I'm not sure how to load the dynamic content (the CFINPUTs) this way.

    Read the article

  • How can I bind dynamic data to DataGridTemplateColumn in code?

    - by TuomoT
    I'm using DataGrid from CodePlex. I have objects (ICustomTypeDescriptor) that have properties 'name' 'description' 'c' 'd' and so on (the names are dynamic, and so is the value) and they have information behind them. I have templates for different types. And if I have to list the properties of a single element I can just bind to the values in xaml and use datatemplateselector (in datagridtemplatecolumn) which will pick the correct template. However, when I'm listing several of the elements, how can I use the selectors and the templates? How do I get the correct property bound to the template (two-way)? When ignoring the need for different templates, using DataGridTextColumn with bindings is very simple (and works, see example below), is there any way to use similar approach with the DataGridTemplateColumn? foreach (String propertyName in listOfPropertyNames) { DataGridTextColumn textColumn = new DataGridTextColumn() { Header = propertyName, Binding = new Binding() { Path = new PropertyPath(propertyName) } }; DataGrid.Columns.Add(textColumn); }

    Read the article

  • Do I have to use Stored Procedures to get query level security or can I still do this with Dynamic S

    - by Peter Smith
    I'm developing an application where I'm concerned about locking down access to the database. I know I can develop stored procedures (and with proper parameter checking) limit a database user to an exact set of queries to execute. It's imperative that no other queries other then the ones I created in the stored procedures be allowed to execute under that user. Ideally even if a hacker gained access to the database connection (which only accepts connections from certain computers) they would only be able to execute the predefined stored procedures. Must I choose stored procedures for this or can I use Dynamic Sql with these fine grain permissions?

    Read the article

  • Generating dynamic C# based on textual data into the runtime?

    - by WeNeedAnswers
    Is there a quick and easy way to load textual C# into a program. I would like to load the LINQ from the database as an Expression and run it against some data (SQL or Array/List don't mind). I know I can do it using the C# CodeDom/ExpressionTree builder with Assembly Loading and Creating AppDomains, but this seems very long winded. Is there an easier way. I thought with the advent of .net 3.5 that the ExpressionTree would come to my aid, but I now realise that I have to write a parser to use this. Maybe there is a new trick in 4.0? Something along the lines of a dynamic languages Parse would be great. Any suggestions greatly appreciated.

    Read the article

  • How can I bind dynamic data to DataGridTemplateColun in code?

    - by TuomoT
    I'm using DataGrid from CodePlex. I have objects (ICustomTypeDescriptor) that have properties 'name' 'description' 'c' 'd' and so on (the names are dynamic, and so is the value) and they have information behind them. I have templates for different types. And if I have to list the properties of a single element I can just bind to the values in xaml and use datatemplateselector (in datagridtemplatecolumn) which will pick the correct template. However, when I'm listing several of the elements, how can I use the selectors and the templates? How do I get the correct property bound to the template (two-way)? When ignoring the need for different templates, using DataGridTextColumn with bindings is very simple (and works, see example below), is there any way to use similar approach with the DataGridTemplateColumn? foreach (String propertyName in listOfPropertyNames) { DataGridTextColumn textColumn = new DataGridTextColumn() { Header = propertyName, Binding = new Binding() { Path = new PropertyPath(propertyName) } }; DataGrid.Columns.Add(textColumn); }

    Read the article

  • Performance Impact of Generating 100's of Dynamic Methods in Ruby?

    - by viatropos
    What are the performance issues associated with generating 100's of dynamic methods in Ruby? I've been interested in using the Ruby Preferences Gem and noticed that it generates a bunch of helper methods for each preference you set. For instance: class User < ActiveRecord::Base preference :hot_salsa end ...generates something like: user.prefers_hot_salsa? # => false user.prefers_hot_salsa # => false If there are 100's of preferences like this, how does this impact the application? I assume it's not really a big deal but I'm just wondering, theoretically.

    Read the article

  • Would it be useful to change java to support both static and dynamic types?

    - by James A. N. Stauffer
    What if a Java allow both static and dynamic types. That might allow the best of both worlds. i.e.: String str = "Hello"; var temp = str; temp = 10; temp = temp * 5; Would that be possible? Would that be beneficial? Do any languages currently support both and how well does it work out? Here is a better example (generics can't be used but the program does know the type): var username = HttpServletRequest.getSession().getAttribute("username");//Returns a String if(username.length() == 0) { //Error }

    Read the article

  • How to create a dynamic number of possibly children objects using partial views?

    - by NullReference
    I have a parent object that contains a property that is a list of children objects. I'd like to have it so that when the form loads to create the parent object a partial view is used to create the list of child objects. The problem is I have to idea how to have the list of children object populated. I can do one object ok, but a dynamic list of possible children is difficult. Any ideas? @Html.RenderPartial("_CreateChild", Model.Children); public class Parent { private List<Child> _list; public Guid Id { get; set; } public List<Child> Children { get { return _list; } set { _list = value; } } public Parent() { _list = new List<Child>(); } }

    Read the article

  • How do I specify a dynamic position for the start of substring?

    - by analyticsPierce
    As in the example, I am trying to substring the Video_full column in a data.frame (video_data_2) I am working on. I want to keep all the characters after the period. The period is always present, there is only one period and it is in a different position in each value for the column. Date Video_full Instances 1 Apr 1, 2010 installs/AA.intro_video_1 546 2 Apr 1, 2010 installs/ABAC.intro_video_2 548 I got substring to work; video_data_2$Video_full <- substring(video_data_2$Video_full,11) And strsplit also; strsplit("installs/AA.intro_video_1 ",'[.]') I'm just not able to figure out how to start the substring in a dynamic position or only keep the second value returned by strsplit. Thanks for any help you can offer for a simple question.

    Read the article

  • How to perform dynamic formatting with perl during write?

    - by Bee
    I have a format which is defined like below: format STDOUT = ------------------------------------ |Field1 | Field2 | Field3 | ------------------------------------ |@<<<<<<<<<<| @<<<<<<<<<<<| @<<<<< |~~ shift(@list1),shift(@list2),shift(@list3) ------------------------------------ . write STDOUT; So the questions are as below: Is it possible to make the list of values printed dynamic? e.g. If list 1 contains 12 elements, and if $flag1 is defined, then print only elements 0..10 instead of all 12. I tried doing this by passing $flag as a parameter to the sub which generates the report. However, the last defined FORMAT seems to always take precedence and the final write when it happens, applies the last format no matter what the condition is. Is it possible to also add/hide fields using the same process. e.g. If $flag2 is defined, then add an additional field Field4 to the list?

    Read the article

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