parameters

Java: Implementation of Interface with Methods passing Interface parameter

社会主义新天地 提交于 2019-12-14 02:38:59
问题 I have a given interface called IAbc, which consists of a method with a parameter of interface IXyz. I am not sure whether I should create an attribute IXyz or an attribute XyzImpl in my implementation of IAbc. public interface IXyz { } public class XyzImpl implements IXyz { public void doSomething() { ... } } public interface IAbc { public void setXyz(IXyz val); public IXyz getXyz(); } Implementation 1: public class AbcImpl1 implements IAbc { private XyzImpl attr; public void setXyz(IXyz val

Reportviewer - Prompt for parameters in local mode?

梦想与她 提交于 2019-12-14 02:31:34
问题 Is it possible for the Microsoft ReportViewer control to prompt for parameters in local mode? I have added a parameter to filter the report by, which can be mulitple values for the one parameter. I have set the available Values property of the paramter to read a list of Values from a query. I was hoping if I did not set parameter values in code the report would prompt for them like crystal reports does ( Im setting the datasource for the parameter available values ) I have done some research

How can I force Python to create a new variable / new scope inside a loop? [duplicate]

心不动则不痛 提交于 2019-12-14 01:15:56
问题 This question already has answers here : Closed 7 years ago . Today I explored a weird behavior of Python. An example: closures = [] for x in [1, 2, 3]: # store `x' in a "new" local variable var = x # store a closure which returns the value of `var' closures.append(lambda: var) for c in closures: print(c()) The above code prints 3 3 3 But I want it to print 1 2 3 I explain this behavior for myself that var is always the same local variable (and python does not create a new one like in other

In Angular, what is the correct way to implement a route with an optional parameter without having to define a second route?

谁说我不能喝 提交于 2019-12-13 22:00:24
问题 As to the suggestion that this question has already been answered, that answer suggests a workaround solution that does not solve my use case. The answer referenced suggests using 2 routes, hence the title of my question which stipulates without having to to define a second route Using 2 routes creates a problematic browser history. If avoidable, I do not want to use a query string parameter or hash. I do not want to use a child route because that would require the use of a secondary router

updating using sql parameters in vb.net

一世执手 提交于 2019-12-13 21:37:04
问题 my code returns error saying violation of PRIMARY KEY constraint 'PK_tblOfficeEquipmentProfile'. Cannot insert duplicate key in object 'tblOfficeEquipmentProfile'. This is my code: Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Dim sqlconn As New SqlClient.SqlConnection sqlconn.ConnectionString = "server = SKPI-APPS1;" & _ "Database = EOEMS;integrated security=true" Dim myCommand As SqlCommand 'parametrized update sql command

Passing and using Class in a method in Java

走远了吗. 提交于 2019-12-13 21:18:15
问题 void methodA() { methodB(ClassA.class) } void methodB(Class classname) { classname a; //not correct HashMap<String, classname> hash = new HashMap<>(); //not correct } IDE is complaining it to be not correct. I want to do something like what is being commented as //not correct. Why is it not correct and how can I do it? 回答1: You cannot use a variable name as a type name, so methodB won't compile. You can however use a type parameter for the method. Try <T> void methodB(Class<T> clazz) { T a;

passing a parameter to remote modal in bootstrap 3

馋奶兔 提交于 2019-12-13 19:38:13
问题 I have a function to load remote content into a bootstrap 3 modal, which uses the id from a php generated recordset. I seem to be retrieving the id correctly, but the remote page content always shows the first id i clicked on <script type="text/javascript"> $(document).ready(function(){ $('.pull-right').click(function(){ var id = this.id; alert(id); $('#myModal').modal({ remote: '/member_profile.php?MemberID='+id, show: true }); }); }); </script> As the id is being generated correctly, is the

getting charconversion exception for “ %” value in query parameter?

空扰寡人 提交于 2019-12-13 19:16:03
问题 i am getting adding some of parameter in query string.value of these param can be "a%%","%" etc.on java code side .while parsing query parameter i m getting char conversionexception as shown below in exception log. 13:14:39,555 ERROR [STDERR] java.io.CharConversionException: EOF 13:14:39,555 ERROR [STDERR] at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:119) 13:14:39,555 ERROR [STDERR] at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:87) 13:14:39,555 ERROR [STDERR] at

How to filter Recyclerview with SearchView on multiple parameters

岁酱吖の 提交于 2019-12-13 19:07:55
问题 I have implemented the SearchView example given here. How to filter a RecyclerView with a SearchView ....to filter and list company names based on the parameter "Product name". In my project, I want to extend this to further filter on the parameter on "city name" The below is the code for the onQueryTextSubmit which filters on the parameter "productname". @Override public boolean onQueryTextSubmit(String query) { return false; } private List<ExampleModel> filter(List<ExampleModel> models,

SSRS Parameters - Toggle a parameter's NULL checkbox depending on value other parameter(s) NULL checkboxes

試著忘記壹切 提交于 2019-12-13 18:18:04
问题 In MS SQL Server Report Builder 3.0, I have an SSRS report with 3 parameters: start date (date) end date (date) last number of days (integer) My Stored Procedure needs either a Date Range OR the last number of days, not all 3 (they are set to NULL by default). I want to be able to toggle a parameters NULL checkbox (tick/untick) based on the value of another parameter, eg: last # days has NULL ticked, then untick NULL checkboxes for the date range (start & end date) & vice versa. Any ideas on