dynamic

adding variables in a regular expression to make it dynamic in java

你离开我真会死。 提交于 2019-12-13 14:13:52
问题 I need to form a regular expression in order to check the outputs of a response log. The log file will always be different based on the input. Thus, I want to create a dynamic regular expression based on the input to the function. I may need to pass variable number of variables at a time for comparison, so how can that 'or' factor be inserted in the regex? Is it possible to create such a regular expression in Java, and how should I go about it? 回答1: Yes, the regex is only a string, you can

Calling a method using dynamic with an out parameter

为君一笑 提交于 2019-12-13 13:42:32
问题 I have a Dictionary<string,K> where K is a type that is loaded through reflection, I can't name K. Unfortunately, I can't figure out how I'm supposed to use the TryGetValue method. I tried a couple of different things and they all lead to exceptions. What am I suppose to do? dynamic dict = GetDictThroughMagic(); dynamic d; bool hasValue = dict.TryGetValue("name",out d); bool hasValue = dict.TryGetValue("name",d); I can write the more verbose if(dict.Contains("name")) d=dict["name"] But I'd

How can i change the values to BarChart dynamically in Core-Plot iphone?

社会主义新天地 提交于 2019-12-13 12:42:02
问题 I am using Core-Plot library to draw bar chart in iPhone. I am using CPTTestApp-iPhone to my training. In my project the bar appear very good thats looks like from the sample project. But, i dont where i need to give the values to draw the bars. Then, in my actual project i need to change the bar values dynamically. How can i do this? Please help me to find out the solution. Thanks in advance. Below the sample datasource code, #pragma mark - #pragma mark Plot Data Source Methods -(NSUInteger

matlab java class path issue

痴心易碎 提交于 2019-12-13 12:31:54
问题 When I put classpaths into the static class path (ie put them in the classpath.txt file) program works. When I add it dynamically, I get an error that it can't find a properties file in the class path. Here is what I have javaaddpath('C:\exchsys\jars\exsystools.jar') javaaddpath('C:\exchsys\externaljars\log4j.jar') javaaddpath('C:\exchsys\externaljars\') javaaddpath('C:\apache-activemq-5.1.0\lib\commons-logging-1.1.jar') javaaddpath('C:\apache-activemq-5.1.0\activemq-all-5.1.0.jar') plus my

cache headers for dynamic css (generated via PHP)

独自空忆成欢 提交于 2019-12-13 12:08:02
问题 My CSS file is acutally a PHP file which is served with content-type text/css so that I can use PHP variables in that file. style.php looks like this: <?php header('Content-Type: text/css'); $bgColor = '#000'; ?> body { background:<?php print $bgColor; ?>; } It works as expected, but I am a bit worried if the browser caches the dynamically created css file. When looking at the requests in firebug, it seems to me that the browser is loading style.php anew everytime I reload the page. I already

Is it possible to create a Generic Method on an dynamic / ExpandoObject

浪子不回头ぞ 提交于 2019-12-13 12:05:11
问题 I suspect this isn't possible, but I haven't seen a definitive no. My current (working) implementation is as followed.. public static Main(param args[]) { dynamic Repository = GetRepository(); var query = (Repository.QueryUser() as IQueryable<User>) .Where(user => user.Name.ToLower().Contains("jack")); } public static dynamic GetRepository() { dynamic repo = new System.Dynamic.ExpandoObject(); repo.QueryUser = new [] { new User() { Name = "Jack Sparrow"}}.AsQueryable<User>(); return repo; }

Get property value in List<> instead of [0],[1]

断了今生、忘了曾经 提交于 2019-12-13 11:16:37
问题 I am using a dynamic class to generate a list, however in the property ;ist I dont get the names as you get in a static class but [0],1,[2], ect. I need these names into the properties. Anybody knows the (probably) simple answer? here my code UPDATE 1: List<string> Properties = new List<string>(); Properties.Add("name"); Properties.Add("instituteTypeId"); Properties.Add("city"); Properties.Add("id"); List<DynamicClass> DynamicClassList = new List<DynamicClass>(); int i = 0; foreach (DataRow r

Set value for Spinner with custom Adapter in Android

ぃ、小莉子 提交于 2019-12-13 09:59:46
问题 I am developing a android application with spinner in a form. The spinner items and spinner values are different. I want to collect all the value from the from including spinner and set a rest api service to web back end. here is the response array. {"Status":true,"errorType":null,"countryList":[{"Code":"US","Name":"United States"},{"Code":"CA","Name":"Canada"},{"Code":"AU","Name":"Australia"},{"Code":"GB","Name":"United Kingdom"}]} I am successfully binded the Name jsonObject to spinner but

how do i create a auto adaptive form [closed]

牧云@^-^@ 提交于 2019-12-13 09:55:15
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I want to create a dynamic form on my website. On my site a have several forms that are subject specific but i also have a contact us form with a subject dropdown from which they can choose any of the subjects that the subject specific forms cover. now if they select website

How to create more form fields by using javascript and then passing values to PHP

两盒软妹~` 提交于 2019-12-13 09:47:33
问题 Hi I'd like to make it so that the user can click a "upload more files" button to create an additional file upload form field and they can also click another button called "add more names" to create an additional "input type='text'" form field. There should be a limit on how many file upload or text fields that can be created using their respective buttons. For example, there should be a max number of 5 file upload fields and a max number of 5 text fields. After the user clicks the "submit"