dynamic

How to store information about many people in Java

微笑、不失礼 提交于 2020-01-25 12:22:51
问题 My problem is to store details of people in Java. I looked up at the Oracle website topic How to Use Tables and found out that one can use object arrays(2 dimensional) to store details. But my interest is to make a dynamic object array so I can store any amount of data and also take input to store those details from the user. For instance, at the beginning of the program I can specify an object array to hold 5 records, but I actually want an array that could add another available location if

How to store information about many people in Java

倾然丶 夕夏残阳落幕 提交于 2020-01-25 12:22:21
问题 My problem is to store details of people in Java. I looked up at the Oracle website topic How to Use Tables and found out that one can use object arrays(2 dimensional) to store details. But my interest is to make a dynamic object array so I can store any amount of data and also take input to store those details from the user. For instance, at the beginning of the program I can specify an object array to hold 5 records, but I actually want an array that could add another available location if

Dynamically update a pie chart in an Observer?

情到浓时终转凉″ 提交于 2020-01-25 07:22:06
问题 I am using pie chart to display some statistics in a JFrame using JFreeChart package. I am using the PieDataset to be passed to the createChart method. Also, the datatset is set to update dynamically, as I am using the observer pattern in my application, which I thoroughly debugged. My issue is that in spite of being able to update the datatset dynamically, the piechart on the frame does not update as it is, maybe not able to take the new (updated) values and display the result. I would like

Javascript 2D array

老子叫甜甜 提交于 2020-01-25 04:29:07
问题 I am trying to use 2 dimensional array in javascript for storing strings. But I am not able to get the values correctly. Below is my code. var commentstore=new Array(); function creating(id,day) { if(commentstore[day,id] != null) { alert("It already exists: commentstore["+day+"]["+id+"]"+commentstore[day,id] ); var textinput="<div id='closeit'>Comments:<input type='text' name='comm["+day+"] ["+id+"]' value='"+commentstore[day,id]+"'/></div> <div id='closing' onclick='closecomment("+id+","+day

How to insert text into an R function?

ε祈祈猫儿з 提交于 2020-01-25 03:09:07
问题 Consider a function f() of a list of lists as follows: out <- f(list_of_lists = list(list(a,1),list(a,2))) I would like to call this function dynamically: arg = "list(a,1),list(a,2)" out <- f(list_of_lists = list(arg)) But that gives the error "arg number 1 is not a list object" . How can I make f() read the object arg as the raw text it contains? In Stata I would use macros to insert the text into the function; in R this is proving hard. The question is inspired by an application of the

SAS: sort error (by variable not sorted properly)

亡梦爱人 提交于 2020-01-25 00:06:25
问题 This question is a follow up from another I had here SAS: Data step view -> error: by variable not sorted properly; I am opening a new question as the desired solution is slightly different: As I am looping through several input files, one of the raw-files is not properly sorted, I wonder what I could do to make my program to skip that particular input file and just continue? Quote: I am using a macro to loop through files based on names and extract data which works fine for the majority of

How to get ID of multiple EditText dynamically added?

别等时光非礼了梦想. 提交于 2020-01-24 19:56:06
问题 I've added multiple EditText and TextViews dynamically like: final String[] meses = new String[]{"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"}; for(int i=0; i<meses.length; i++){ LinearLayout layout = new LinearLayout(getContext()); layout.setOrientation(LinearLayout.HORIZONTAL); layout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); TextView

@NgModule static forRoot when implementing dynamic modules

萝らか妹 提交于 2020-01-24 13:17:39
问题 I have this code in @NgModule: @NgModule({ declarations: [ AppComponent, DashboardComponent ], imports: [ BrowserModule, BrowserAnimationsModule, ClarityModule, RouterModule.forRoot([ { path: '', redirectTo: 'dashboard', pathMatch: 'full' }, { path: 'dashboard', component: DashboardComponent }, ], {useHash: true}), LibraryTestModule.forRoot(ServicetestService), HttpModule ], If you can see i am injecting the ServicetestService to the LibraryTestModule. But in my case i am loading this module

Create Object and its Properties at Run-time from List

℡╲_俬逩灬. 提交于 2020-01-24 09:04:51
问题 I need to create dynamic object and its properties at run-time then create instance of this object to store values. why I want above logic! I am reading excel file in C# and first line of code is header which is actually properties and followed by each rows are record which is instance of dynamic object. List<string> ExcelDataHeader = new List<string>(); for (int y = 2; y <= colCount; y++) { ExcelDataHeader.Add(xlRange.Cells[headerRow, y].Value2.ToString()); } dynamic MyDynamic = new System

Deserialize JSON text to a specific object type using the Type name [duplicate]

泄露秘密 提交于 2020-01-24 08:52:51
问题 This question already has answers here : Referencing a type from string name in a type parameter (2 answers) Closed 2 years ago . I used to deserialize JSON text to a strongly type object using the code below Trainer myTrainer = JsonConvert.DeserializeObject<Trainer>(sJsonText); Now I need to convert deserialize JSON text to a specific type knowing only the name of the type. I tried to use Reflection to get the Type from its name then use this type with JsonConvert as shown below: Type myType