nested

Java: reference outer class in nested static class [duplicate]

蹲街弑〆低调 提交于 2020-01-23 19:26:49
问题 This question already has answers here : Java inner class and static nested class (26 answers) Closed 4 years ago . I have a class structure like this: public class OuterClass { private static class InnerClass { public void someMethod() { OtherClass.otherMethod(<???>); } } which refers to a static method of some other class OtherClass : public class OtherClass { public static void otherMethod(OuterClass) { .... } } I am trying to figure out what to put in place of the <???> . How do I refer

Map<String, Map<String, Boolean>> myMap = new HashMap<String,HashMap<String,Boolean>>();

南楼画角 提交于 2020-01-23 08:36:05
问题 Why doesn't that work in java, but this does Map<String, Map<String, Boolean>> myMap = new HashMap<String,Map<String,Boolean>>(); Just to clarify the below alteration of the nested HashMap shows a compiler error, whereas the above does not not; with a Map (not hashmap) Map<String, Map<String, Boolean>> myMap = new HashMap<String,HashMap<String,Boolean>>(); 回答1: This is because generics in Java are invariant , i.e. even if class B is an A, a Collection<B> is not a Collection<A> . And this is

OpenXML nested tables

本秂侑毒 提交于 2020-01-23 06:27:07
问题 I am trying to insert a Table into a TableCell, but when I try to open it in MS Word I get a message like: " a <p> is required before a </tc> ". When I open the file in compatibility mode the table formatting looks perfect but the table lines are missing. Inserting simple text into the cell works fine, the issue only happens when I try to insert a whole table. Inserting the Table in the document outside the other table also works fine. 回答1: If you create a nested table structure in Word, and

Describe a deeply nested array in TypeScript

狂风中的少年 提交于 2020-01-23 06:19:58
问题 How do I define a type or interface describing a deeply nested array in TypeScript? For example, let's say I am writing a function for testing a path against any number of patterns. function match(path: string, matcher: Matcher): boolean { /* ... */ } The Matcher type may be any of the following: string RegExp Matcher[] (note the self-reference) In other words, the compiler should accept the following: match('src/index.js', 'lib/**/*'); match('src/index.js', /\/node_modules\//); match('src

How to extract .class files from nested Jar?

大憨熊 提交于 2020-01-23 02:24:48
问题 I have a Jar file named " OuterJar.jar " that contains another jar named " InnerJar.jar " this InnerJar contains 2 files named " Test1.class " & " Test2.class ".Now i want to extract these two files. I have tried some piece of code but it doesn't work. class NestedJarExtractFactory{ public void nestedJarExtractor(String path){ JarFile jarFile = new JarFile(path); Enumeration entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry _entryName = (JarEntry) entries.nextElement()

SQL Server - Nested transactions in a stored procedure

喜你入骨 提交于 2020-01-22 18:45:10
问题 Lets say this is the situation: [Stored Proc 1] BEGIN BEGIN TRANSACTION ... exec sp 2 COMMIT END Now, if SP 2 - rolls back for whatever reason, does SP 1 - commit or rollback or throw exception? Thanks. 回答1: There are no autonomous transactions in SQL Server. You may see @@TRANCOUNT increase beyond 1, but a rollback affects the whole thing. EDIT asked to point to documentation. Don't know of the topic that documents this explicitly, but I can show it to you in action. USE tempdb; GO Inner

SQL Server - Nested transactions in a stored procedure

一个人想着一个人 提交于 2020-01-22 18:43:46
问题 Lets say this is the situation: [Stored Proc 1] BEGIN BEGIN TRANSACTION ... exec sp 2 COMMIT END Now, if SP 2 - rolls back for whatever reason, does SP 1 - commit or rollback or throw exception? Thanks. 回答1: There are no autonomous transactions in SQL Server. You may see @@TRANCOUNT increase beyond 1, but a rollback affects the whole thing. EDIT asked to point to documentation. Don't know of the topic that documents this explicitly, but I can show it to you in action. USE tempdb; GO Inner

Retain expanded rows after databinding Kendo UI grid

拜拜、爱过 提交于 2020-01-22 16:49:48
问题 This is my first time working with Kendo UI. I have a Kendo UI grid with child nodes. I want to retain the expanded rows after databinding. Right now its getting collapsed after a row is added in the child I have tried suggestion from here dataBound: function() { this.expandRow(this.tbody.find("tr.k-master-row").first()); } But this expands the first row only. How to retain rows? What am I missing? Codepen 回答1: After a lot of playing around with your code example in CodePen, I believe I've

Retain expanded rows after databinding Kendo UI grid

我与影子孤独终老i 提交于 2020-01-22 16:49:25
问题 This is my first time working with Kendo UI. I have a Kendo UI grid with child nodes. I want to retain the expanded rows after databinding. Right now its getting collapsed after a row is added in the child I have tried suggestion from here dataBound: function() { this.expandRow(this.tbody.find("tr.k-master-row").first()); } But this expands the first row only. How to retain rows? What am I missing? Codepen 回答1: After a lot of playing around with your code example in CodePen, I believe I've

Recursively ensuring tibbles instead of data frames when parsing/manipulating nested JSON

試著忘記壹切 提交于 2020-01-21 14:02:26
问题 I have to deal with JSON documents that contain nested documents and at some level have an array which in turn contains individual documents that conceptionally would map back to "data frame rows" when reading/parsing the JSON in R. First order problem/question I'm looking for a way to ensure that either all data frames are always turned into tibbles or that at least the "leaf data frames" become tibbles while the the "parent data frames" are allowed to become lists for arbitrary nested