Search Results

Search found 10597 results on 424 pages for 'dynamic attributes'.

Page 9/424 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • EC2 hosted service multi-tenant dynamic DNS solution

    - by accidental admin
    I want to change the model of my EC2 hosted service to have a separate sub domain for each tenant (ie. .example.com). My primary DNS is now with dnsmadeeasy.com, but their dynamic DNS offering seem pretty weak: it requires the API to use my full dnsmadeeasy.com account credentials, I rather have the API use a limited privilege credential that can only add/remove/modify subdomain records from what I gather it only allows to modify existing records, does not allow me to dynamically add/remove records for new tenant subdomains My question what are my alternatives? Is there something in the dnsmadeeasy API offering I misunderstood and I should just use them? Is there some other similar DNS service that has a DDNS offering that satisfies my requirements? Or should I just bite the bullet and host my own DNS (my fear is not configuration/learning/know how, my fear is reliability). If you recommend the latter, can you detail the necessary steps or a link to a good tutorial how to?

    Read the article

  • dynamic routing between openvpn tunnels

    - by pQd
    i'm thinking about using dynamic routing [ OSPF or RIP ] via OpenVPN tunnels. right now i have few offices connected in full mesh, but this is not scalable solution as we add more locations. i would like to avoid situation when plenty of internal traffic is affected if one of two vpn termination points that i plan to use is down. do you have similar configuration working in production? if so - what routing daemon did you use - quagga? something else? did you encounter any problems? thanks!

    Read the article

  • Godaddy hosting with dynamic ip?

    - by Razor Storm
    I bought a domain name on godaddy.com let's call it www.website.com, but my server has a dynamic ip, how do I resolve this issue? What I've tried: get a dns account at dyndns.com let's call it dns.dyndns.com, so I set up godaddy to forward the domain to dns.dyndns.com. problem: When the user goes to www.website.com, they see dns.dyndns.com in the url bar. Bad So then I set up the forwarding on godaddy to forward with domain masking, but then the problem is now that users can't even see url paths/get queries/ or hash marks anymore! `www.website.com/folder/search?id=4#ajax=4` becomes just www.website.com in the url bar. bad! What do I do?

    Read the article

  • Dual boot Windows 7 with Windows 8- Dynamic Disk

    - by MeetM
    Its a long explanation. I have a HP Pavilion dm4 notebook. It has pre installed Windows 7 Home Pre. Recently, I tried to install Windows 8 developer preview on my notebook, but while installing, it only allowed me to insatll it on my primary Windows 7 drive I.e. drive C. I had kept 1 empty partition for Windows 8 but when I selectced that option, the next button at the bottom of the window just grey with some error saying Windows cannot boot from this drive....blah blah blah So I googled and found another way of doing it by VHD(virtual hard disk). This seemed to work but on restarting gave me "VHD_BOOT_INITIALIZATION_FAILED" error. After trying all possible ways for around 10 times, I gave up. I noticed that d only thing difference in d tutorials and my notebook is the Disk type. They all had Basic and I have Dynamic. Is that the reason m not able to boot Windows 8? Any suggestions?

    Read the article

  • Change location of RSS Dynamic Desktops

    - by Andy
    I'm currently using CCleaner to take care of my computer, but I also have a dynamic desktop background provided by Bing (I'm running Windows 7 HP) - and unfortunately the two conflict. Whenever I 'clean' my computer using CCleaner it messes up my destop backgrounds as they are stored in the temporary internet files directory, and for some reason I don't appear to be able to get as far as the 'Enclosures' sub directory in order to tell CCleaner to exclude the directory (I can see it in Windows Explorer but not in CCleaner's directory browser). Therefore, I am looking for an alternative solution to this problem and wondered if I could change the directory to which the images were downloaded on the RSS feed. If anybody knows how to do this, I would be grateful if you could share or indeed, I would be equally as greatful if anyone knows any other ways of getting around CCleaner. Please note that I don't want to stop cleaning the whole of my temporary internet files though - I just don't want the wallpapers that have been downloaded to be deleted... Thanks in advance!

    Read the article

  • Running a home mail server using dynamic dns [closed]

    - by Anand
    Hi, Is it possible to run an email server on my home box using dynamic dns? The scenario is, I want to auto cc all incoming and outgoing emails from my one account to another, from some server side config instead of configuring email clients for rules. I have tried Google Apps Mail but it doesn't allow auto cc of outgoing emails. After having read tons of blogs, forum messages etc (hope I have been reading the correct info :) ) the only option to achieve what I am needing is to setup my own mail server, but the cost of getting a static IP doesn't fit my budget. Please can someone point me in the correct direction. Platform doesn't matter, I can setup a Windows or Linux server. Many Thanks

    Read the article

  • Dynamic Subdomains

    - by crash
    On my new site I want to have dynamic subdomains. I'm trying to make it so that the subdomains use the same web root as the main domain, all under a single CodeIgniter installation. For example, subdomain.example.com would lead to example.com/subdomain, which is actually example.com/index.php/subdomain. I've already the DNS, virtual hosts set up but I"m getting caught up on the .htaccess. The effect of the linked htaccess is that when navigating to any subdomain, it gets caught up in an infinite loop. (Error log after one request.) It's the same effect for www., which should just resolve to the main domain.

    Read the article

  • Running a home mail server using dynamic dns

    - by user4009
    Hi, Is it possible to run an email server on my home box using dynamic dns? The scenario is, I want to auto cc all incoming and outgoing emails from my one account to another, from some server side config instead of configuring email clients for rules. I have tried Google Apps Mail but it doesn't allow auto cc of outgoing emails. After having read tons of blogs, forum messages etc (hope I have been reading the correct info :) ) the only option to achieve what I am needing is to setup my own mail server, but the cost of getting a static IP doesn't fit my budget. Please can someone point me in the correct direction. Platform doesn't matter, I can setup a Windows or Linux server. Many Thanks

    Read the article

  • .NET custom property attribute?

    - by ropstah
    EDIT: I'd better rephrase: How can I shift the GET-implementation of a Class property to a / using a custom attribute? (I've added instantation vars (classname, propertyname) to the attribute, however I'd rather have these automatically fetched ofcourse.) Public Class CustomClass <CustomAttributeClass(ClassName:="CustomClass", PropertyName = "SomeProperty")> _ Public Property SomeProperty() as String Get() as String //This implementation should be handled by the attribute class End Get Set(Byval value as String) Me._someProperty = value End Set End Property End Class Old question: I want to create a custom property attribute for classes. I can create a class derived from Attribute, and 'mark' the property with the attribute, but where to go from here? I have a repository where I can quickly get data based on the attributes values. I would like to generalize the behaviour of the property in the attribute but I don't know how to go from here... Any help would be greatly accepted! Public Class CustomDataAttribute : Inherits Attribute Private _name As String Public Sub New(ByVal name As String) Me.Name = name End Sub Property Name() As String Get Return _name End Get Set(ByVal value As String) Me._name = value End Set End Property End Class Public Class CustomClass <CustomDataAttribute(Name:="CustomField")> _ Public Property CustomField() End Property End Class

    Read the article

  • zend tool is not working

    - by user362155
    Hi, I've installed ZendStudio 7.2 it creates project normally with no error but when i try to add action(s) in it, it says project profile does not exist. and the error log is as follow: executing zf create action showLatest index-action-included An Error Has Occurred A project profile was not found. Zend Framework Command Line Console Tool v1.10.2 Details for action "Create" and provider "Action" Action zf create action name controller-name[=Index] view-included[=1] module Failed loading ./ZendDebugger.so: (null) PHP Warning: PHP Startup: Unable to load dynamic library './ext/bcmath.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/bz2.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/calendar.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ctype.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/curl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/exif.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/fileinfo.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ftp.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/gd.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/imagick.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/json.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ldap.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mbstring.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mcrypt.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/memcache.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mhash.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mime_magic.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mssql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mysql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mysqli.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/pcntl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/pgsql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/posix.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/shmop.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/soap.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sockets.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sqlite.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvmsg.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvsem.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvshm.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/tidy.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/tokenizer.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/wddx.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xmlreader.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xmlrpc.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xsl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/zip.so' - (null) in Unknown on line 0 please help me to configure latest ZendTool with ZendStudio 7.2 or how can i get rid of this. i am runin ZS 7.2 on my mac os x 10.5.8 thanks.

    Read the article

  • Dynamic fowarding with SOCKS5 proxy [on hold]

    - by bh3244
    I'm building my own SOCKS5 client and HTTP library and am having trouble figuring out how things work with dynamic port forwarding. So far I can connect successfully with my SOCKS5 client, but from there on I am stuck. I am using the ssh -D command. Considering I have my local machine "home" and my server "server" and I wanted to use "server" as proxy for all connections I understand I would type ssh -D "localport" "serverhostname" on my local machine "home". This command I understand has ssh accept connections with the SOCKS5 protocol. So now if I want to connect to google.com(74.125.224.72:80) and issue a GET for the front page, I assume I would send the SOCKS5 client request and the server would respond back with a 0x00 "succeeded" and from then on I am connected and I would send the HTTP GET request and the server would respond back accordingly with the data. Now if I want to navigate to a different website, must I issue another SOCKS5 connection request for that sites IP/hostname? I'm confused if this is the way it is done, or if there is a program listening on the local port of the "server" and handling outgoing and incoming data. To reiterate: Do SOCKS5 proxies work by sending repeated SOCKS5 connection requests for different addresses or is there just one connection to a local port on "server" and another program on "server" handles the outgoing connection to the internet by using that local port to send and receive data to/from "home"?

    Read the article

  • Why can't I renew my dynamic IP address?

    - by qwerty
    So, I'm going to explain this from the start. I've started a project with a friend of mine which includes a webspider, that crawls through all pages on a site and stores them in a DB. Since I've never done this before, I didn't think about the amount of requests I was actually sending to the site, and after a day or two I finally got my IP blocked. I need to be able to visit that site as it's very important to me. Not only for my project, but for other reasons too. (and if I'm able to renew my IP I'm going to set a delay on the crawler so I don't get blocked & DDOS the site) I have a dynamic IP address, at least that's what my router settings say. I've tried ipconfig /flushdns, ipconfig /release, restart computer. No result. I end up with the same IP address. I've also tried renewing it from the router, however, I think it uses the same method which isn't working. Is it possible that site has blocked my mac address? Can a site even access my mac address?

    Read the article

  • Adding Attributes to Generated Classes

    ASP.NET MVC 2 adds support for data annotations, implemented via attributes on your model classes.  Depending on your design, you may be using an OR/M tool like Entity Framework or LINQ-to-SQL to generate your entity classes, and you may further be using these entities directly as your Model.  This is fairly common, and alleviates the need to do mapping between POCO domain objects and such entities (though there are certainly pros and cons to using such entities directly). As an example, the current version of the NerdDinner application (available on CodePlex at nerddinner.codeplex.com) uses Entity Framework for its model.  Thus, there is a NerdDinner.edmx file in the project, and a generated NerdDinner.Models.Dinner class.  Fortunately, these generated classes are marked as partial, so you can extend their behavior via your own partial class in a separate file.  However, if for instance the generated Dinner class has a property Title of type string, you cant then add your own Title of type string for the purpose of adding data annotations to it, like this: public partial class Dinner { [Required] public string Title { get;set; } } This will result in a compilation error, because the generated Dinner class already contains a definition of Title.  How then can we add attributes to this generated code?  Do we need to go into the T4 template and add a special case that says if were generated a Dinner class and it has a Title property, add this attribute?  Ick. MetadataType to the Rescue The MetadataType attribute can be used to define a type which contains attributes (metadata) for a given class.  It is applied to the class you want to add metadata to (Dinner), and it refers to a totally separate class to which youre free to add whatever methods and properties you like.  Using this attribute, our partial Dinner class might look like this: [MetadataType(typeof(Dinner_Validation))] public partial class Dinner {}   public class Dinner_Validation { [Required] public string Title { get; set; } } In this case the Dinner_Validation class is public, but if you were concerned about muddying your API with such classes, it could instead have been created as a private class within Dinner.  Having the validation attributes specified in their own class (with no other responsibilities) complies with the Single Responsibility Principle and makes it easy for you to test that the validation rules you expect are in place via these annotations/attributes. Thanks to Julie Lerman for her help with this.  Right after she showed me how to do this, I realized it was also already being done in the project I was working on. Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Dynamic Objects for ASPxGridview

    - by André Snede Hansen
    I have a dictionary that is populated with data from a table, we are doing this so we can hold multiple SQL tables inside this object. This approached cannot be discussed. The Dictionary is mapped as a , and contains SQL column name and the value, and each dictionary resembles one row entry in the Table. Now I need to display this on a editable gridview, preferably the ASPxGridView. I already figured out that I should use Dynamic Objects(C#), and everything worked perfectly, up to the part where I find out that the ASPxGridview is built in .NET 2.0 and not 4.0 where Dynamic objects where implemented, therefor I cannot use it... As you cannot, to my knowledge, add rows to the gridview programmatically, I am out of ideas, and seek your help guys! protected void Page_Load(object sender, EventArgs e) { UserValidationTableDataProvider uvtDataprovider = _DALFactory.getProvider<UserValidationTableDataProvider>(typeof(UserValidationTableEntry)); string[] tableNames = uvtDataprovider.TableNames; UserValidationTableEntry[] entries = uvtDataprovider.getAllrecordsFromTable(tableNames[0]); userValidtionTableGridView.Columns.Clear(); Dictionary<string, string> firstEntry = entries[0].Values; foreach (KeyValuePair<string, string> kvp in firstEntry) { userValidtionTableGridView.Columns.Add(new GridViewDataColumn(kvp.Key)); } var dynamicObjectList = new List<dynamic>(); foreach (UserValidationTableEntry uvt in entries) { //dynamic dynObject = new MyDynamicObject(uvt.Values); dynamicObjectList.Add(new MyDynamicObject(uvt.Values)); } } public class MyDynamicObject : DynamicObject { Dictionary<string, string> properties = new Dictionary<string, string>(); public MyDynamicObject(Dictionary<string, string> dictio) { properties = dictio; } // If you try to get a value of a property // not defined in the class, this method is called. public override bool TryGetMember(GetMemberBinder binder, out object result) { // Converting the property name to lowercase // so that property names become case-insensitive. string name = binder.Name.ToLower(); string RResult; // If the property name is found in a dictionary, // set the result parameter to the property value and return true. // Otherwise, return false. bool wasSuccesfull = properties.TryGetValue(name, out RResult); result = RResult; return wasSuccesfull; } // If you try to set a value of a property that is // not defined in the class, this method is called. public override bool TrySetMember(SetMemberBinder binder, object value) { // Converting the property name to lowercase // so that property names become case-insensitive. properties[binder.Name.ToLower()] = value.ToString(); // You can always add a value to a dictionary, // so this method always returns true. return true; } } Now, I am almost certain that his "Dynamic object" approach, is not the one I can go with from here on. I hope you guys can help me :)!

    Read the article

  • How to modify the attributes by putting dynamic node paths

    - by sam
    I have a code that selects all elements and their child nodes DECLARE @x XML DECLARE @node_no int DECLARE @count int DECLARE @max INT, @i INT EXECUTE return_xml '1', NULL, @x output Declare @temp Table ( id int not null identity(1,1), ParentNodeName varchar(max), NodeName varchar(max), NodeText varchar(max) ) INSERT INTO @temp SELECT t.c.value('local-name(..)', 'varchar(max)') AS ParentNodeName, t.c.value('local-name(.)', 'varchar(max)') AS NodeName, t.c.value('text()[1]', 'varchar(max)') AS NodeText FROM @x.nodes('/booking//*') AS t(c) select * from @temp Now I want to modify the attributs by putting dynamic node paths SET @x.modify (' insert attribute MyId {sql:variable("@i")} as first into (ParentNodeName/NodeName::*[position() = sql:variable("@i")])[1] ') where id = id of temp table any Idea how can I modify my whole xml this way as I am having a untyped xml and have to add an attribute in every node

    Read the article

  • Serialize C# dynamic object to JSON object to be consumed by javascript

    - by Jeff Jin
    Based on the example c# dynamic with XML, I modified DynamicXml.cs and parsed my xml string. the modified part is as follows public override bool TryGetMember(GetMemberBinder binder, out object result) { result = null; if (binder.Name == "Controls") result = new DynamicXml(_elements.Elements()); else if (binder.Name == "Count") result = _elements.Count; else { var attr = _elements[0].Attribute( XName.Get(binder.Name)); if (attr != null) result = attr.Value; else { var items = _elements.Descendants( XName.Get(binder.Name)); if (items == null || items.Count() == 0) return false; result = new DynamicXml(items); } } return true; } The xml string to parse: "< View runat='server' Name='Doc111'>" + "< Caption Name='Document.ConvertToPdf' Value='Allow Conversion to PDF'></ Caption>" + "< Field For='Document.ConvertToPdf' ReadOnly='False' DisplayAs='checkbox' EditAs='checkbox'></ Field>" + "< Field For='Document.Abstract' ReadOnly='False' DisplayAs='label' EditAs='textinput'></ Field>" + "< Field For='Document.FileName' ReadOnly='False' DisplayAs='label' EditAs='textinput'></ Field>" + "< Field For='Document.KeyWords' ReadOnly='False' DisplayAs='label' EditAs='textinput'></ Field>" + "< FormButtons SaveCaption='Save' CancelCaption='Cancel'></ FormButtons>" + "</ View>"; dynamic form = new DynamicXml(markup_fieldsOnly); is there a way to serialize the content of this dynamic object(name value pairs inside dynamic) form as JSON object and sent to client side(browser)?

    Read the article

  • NHibernate: Mapping different dynamic components based on a discriminator

    - by George Mauer
    My domain entities each have a set of "fixed" properties and a set of "dynamic" properties which can be added at runtime. I handle this by using NHibernate's dynamic-component functionality. public class Product { public virtual Guid Id { get; } public virtual string Name { get; set;} public virtual IDictionary DynamicComponents { get; } } Now I have the following situation public class Customer { public virtual Guid Id { get; } public virtual string Type { get; set;} public virtual IDictionary DynamicProperties { get; } } Where a CustomerType is something like "Online" or "InPerson". Furthermore an Online customer has dynamic properties "Name" and "IPAddress" and an InPerson Customer has dynamic properties "Name" and "Salesman". Which customer types are available and the extra properties on them are configured in meta-data which is used to generate hbm files on application start. I could figure out some way to knock this together using an intermediate DTO layer, but is there any support in NHibernate for this scenario? The only difficulty seems to be that all the different "types" of customer map to the same Customer class.

    Read the article

  • Dynamic programming - Coin change decision problem?

    - by Tony
    I'm reviewing some old notes from my algorithms course and the dynamic programming problems are seeming a bit tricky to me. I have a problem where we have an unlimited supply of coins, with some denominations x1, x2, ... xn and we want to make change for some value X. We are trying to design a dynamic program to decide whether change for X can be made or not (not minimizing the number of coins, or returning which coins, just true or false). I've done some thinking about this problem, and I can see a recursive method of doing this where it's something like... MakeChange(X, x[1..n this is the coins]) for (int i = 1; i < n; i++) { if ( (X - x[i] ==0) || MakeChange(X - x[i]) ) return true; } return false; Converting this a dynamic program is not coming so easily to me. How might I approach this?

    Read the article

  • asp.NET Dynamic Data Site and asp.NET MVC-2 site together

    - by loviji
    Hi, I have created firstly ASP.NET MVC 2. and write more functionality. After I create asp.NET Dynamic Data Site. now, when I click on run button in Visual Studio, mvc app. opened in browser as http://localhost:50062. and asp.NET Dynamic Data Site as http://localhost:58395/cms/. but i want to merge this app. in one. can I use asp.NET Dynamic Data Site and asp.NET MVC-2 at the same time?

    Read the article

  • how to make dynamic xaml in silverlight

    - by lina
    Good day! I want to make a form - a set of questions with different answer types: some questions have a number of answers and you can check one of the answers using radiobutton, other questions you should answer using a textbox, some answers have a datetime type and you choose answer for them using a DatePicker and so on. I get all information about the questions and answer types from a WCF service. I want to make this form using making a dynamic xaml but i've naver made dynamic xaml and I don't know exactly how to make it. Please, can you give me a council about dynamic xaml or maybe you have any other ideas about how to make this form? Thank you.

    Read the article

  • how to create local dynamic varables

    - by xielingyun
    this is my code, i want to use eval() to get the rule status and eval() nead local varables, there is many classes inherit class base, so i should to rewrite get_stat() in every class.i just want to avoid this, an idea is to create dynamic varables in get_stat(),eg. in class b it dynamic create var a and b how to create dynamic varables in function? or any other way to avoid this stupid idea i use python 3.2.3, locals() does not work class base(object): def check(self): stat = get_stat() def get_stat(self): pass class b(base): rule = 'a > 5 and b < 3' a = 0 b = 0 def update_data(self, a, b): self.a = a self.b = b def get_stat(self): a = self.a b = self.b return eval(rule) class b(base): rule = 'd > 5 and e < 3' d = 0 e = 0 def update_data(self, d, e): self.d = d self.e = e def get_stat(self): d = self.d e = self.e return eval(rule)

    Read the article

  • Pass dynamic data to mvc controller with AJAX

    - by Yustme
    How can I pass dynamic data with an AJAX call to an MVC Controller? Controller: public JsonResult ApplyFilters(dynamic filters){ return null; } The AJAX call: $(':checkbox').click(function (event) { var serviceIds = $('input[type="checkbox"]:checked').map(function () { return $(this).val(); }).toArray(); //alert(serviceIds); $.ajax({ type: 'GET', url: '/home/ApplyFilters', data: JSON.stringify({ name: serviceIds }), contentType: 'application/json', success: function (data) { alert("succeeded"); }, error: function (err, data) { alert("Error " + err.responseText); } }); //return false; }); Ideally would be that the filters would contain the serviceIds as a property For example like this: filters.ServiceIds. I got another filter for a date range and that one would be added like so: filters.DateRange. And server side get the filter as a dynamic object in the ApplyFilters()

    Read the article

  • Error in Using Dynamic Data Entities WebSite in VS2012

    - by amin behzadi
    I decided to use Dynamic Data Entities website in vs2012. So, I created this website,then added App_Code directory and added a new edmx to it and named it myDB.edmx. After that I uncommented the code line in global.asax which registers the entity context : DefaultModel.RegisterContext(typeof(myDBEntities), new ContextConfiguration() { ScaffoldAllTables = true }); But when I run the website this error occurs : The context type 'myDBEntities' is not supported. how can I fix it? p.s: You now there are some differences between using L2S by Dynamic Data L2S website AND using entity framework by Dynamic Data Entities website.

    Read the article

  • Validating Data Using Data Annotation Attributes in ASP.NET MVC

    - by bipinjoshi
    The data entered by the end user in various form fields must be validated before it is saved in the database. Developers often use validation HTML helpers provided by ASP.NET MVC to perform the input validations. Additionally, you can also use data annotation attributes from the System.ComponentModel.DataAnnotations namespace to perform validations at the model level. Data annotation attributes are attached to the properties of the model class and enforce some validation criteria. They are capable of performing validation on the server side as well as on the client side. This article discusses the basics of using these attributes in an ASP.NET MVC application.http://www.bipinjoshi.net/articles/0a53f05f-b58c-47b1-a544-f032f5cfca58.aspx       

    Read the article

  • dynamic? I'll never use that ... or then again, maybe it could ...

    - by adweigert
    So, I don't know about you, but I was highly skeptical of the dynamic keywork when it was announced. I thought to myself, oh great, just another move towards VB compliance. Well after seeing it being used in things like DynamicXml (which I use for this example) I then was working with a MVC controller and wanted to move some things like operation timeout of an action to a configuration file. Thinking big picture, it'd be really nice to have configuration for all my controllers like that. Ugh, I don't want to have to create all those ConfigurationElement objects... So, I started thinking self, use what you know and do something cool ... Well after a bit of zoning out, self came up with use a dynamic object duh! I was thinking of a config like this ...<controllers> <add type="MyApp.Web.Areas.ComputerManagement.Controllers.MyController, MyApp.Web"> <detail timeout="00:00:30" /> </add> </controllers> So, I ended up with a couple configuration classes like this ...blic abstract class DynamicConfigurationElement : ConfigurationElement { protected DynamicConfigurationElement() { this.DynamicObject = new DynamicConfiguration(); } public DynamicConfiguration DynamicObject { get; private set; } protected override bool OnDeserializeUnrecognizedAttribute(string name, string value) { this.DynamicObject.Add(name, value); return true; } protected override bool OnDeserializeUnrecognizedElement(string elementName, XmlReader reader) { this.DynamicObject.Add(elementName, new DynamicXml((XElement)XElement.ReadFrom(reader))); return true; } } public class ControllerConfigurationElement : DynamicConfigurationElement { [ConfigurationProperty("type", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)] public string TypeName { get { return (string)this["type"]; } } public Type Type { get { return Type.GetType(this.TypeName, true); } } } public class ControllerConfigurationElementCollection : ConfigurationElementCollection { protected override ConfigurationElement CreateNewElement() { return new ControllerConfigurationElement(); } protected override object GetElementKey(ConfigurationElement element) { return ((ControllerConfigurationElement)element).Type; } } And then had to create the meat of the DynamicConfiguration class which looks like this ...public class DynamicConfiguration : DynamicObject { private Dictionary<string, object> properties = new Dictionary<string, object>(StringComparer.CurrentCultureIgnoreCase); internal void Add<T>(string name, T value) { this.properties.Add(name, value); } public override bool TryGetMember(GetMemberBinder binder, out object result) { var propertyName = binder.Name; result = null; if (this.properties.ContainsKey(propertyName)) { result = this.properties[propertyName]; } return true; } } So all being said, I made a base controller class like a good little MVC-itizen ...public abstract class BaseController : Controller { protected BaseController() : base() { var configuration = ManagementConfigurationSection.GetInstance(); var controllerConfiguration = configuration.Controllers.ForType(this.GetType()); if (controllerConfiguration != null) { this.Configuration = controllerConfiguration.DynamicObject; } } public dynamic Configuration { get; private set; } } And used it like this ...public class MyController : BaseController { static readonly string DefaultDetailTimeout = TimeSpan.MaxValue.ToString(); public MyController() { this.DetailTimeout = TimeSpan.Parse(this.Configuration.Detail.Timeout ?? DefaultDetailTimeout); } public TimeSpan DetailTimeout { get; private set; } } And there I have an actual use for the dynamic keyword ... never thoguht I'd see the day when I first heard of it as I don't do much COM work ... oh dont' forget this little helper extension methods to find the controller configuration by the controller type.public static ControllerConfigurationElement ForType<T>(this ControllerConfigurationElementCollection collection) { Contract.Requires(collection != null); return ForType(collection, typeof(T)); } public static ControllerConfigurationElement ForType(this ControllerConfigurationElementCollection collection, Type type) { Contract.Requires(collection != null); Contract.Requires(type != null); return collection.Cast<ControllerConfigurationElement>().Where(element => element.Type == type).SingleOrDefault(); } Sure, it isn't perfect and I'm sure I can tweak it over time, but I thought it was a pretty cool way to take advantage of the dynamic keyword functionality. Just remember, it only validates you did it right at runtime, which isn't that bad ... is it? And yes, I did make it case-insensitive so my code didn't have to look like my XML objects, tweak it to your liking if you dare to use this creation.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >