interface

Correct implementation of an explicit interface in Fortran

与世无争的帅哥 提交于 2021-02-05 09:30:10
问题 I am struggling with explicit interfaces in Fortran. In one instance, the compiler has requested that I write an explicit interface when I attempt to use an assumed-shape array as a dummy argument for a function or subroutine (i.e., procedure): Explicit interface required for ... assumed-shape argument . For example, this would appear like REAL, INTENT(IN OUT) :: dummy_array(:) in a subroutine. The (:) in the declaration of the array means that the compiler takes care of passing information

Allowing multiple differently shaped interfaces as TypeScript return types

守給你的承諾、 提交于 2021-02-05 06:43:25
问题 I have a function that takes a few parameters and generates objects that will be passed into an external process. Sine I have no control over the shapes that need to be ultimately created, I have to be able to take some varying parameters to my function and assemble them into the appropriate objects. Here's a really basic example that exhibits the issue I'm having: interface T1A { type: 'type1'; index: number; } interface T1B { type: 'type1'; name: string; } interface T2A { type: 'type2';

Since a class in Java cannot extend multiple classes. How would I be able to get by this? [closed]

◇◆丶佛笑我妖孽 提交于 2021-02-05 06:10:23
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I have two classes that need to extend one class. I am getting a compiler error since this cannot happen in Java. I know that you can implement as many interfaces you want to in Java but can only extend one other

Call Delphi CLASS exported in DLL from C++ code

可紊 提交于 2021-02-04 21:40:16
问题 i have a problem to use delphi class from C++ code. delphi dll demo that export a function that return an object. my delphi Dll code is as follow: library DelphiTest; // uses part.... type IMyObject = interface procedure DoThis( n: Integer ); function DoThat : PWideChar; end; TMyObject = class(TInterfacedObject,IMyObject) procedure DoThis( n: Integer ); function DoThat: PChar; end; // TMyObject implementation go here ... procedure TMyObject.DoThis( n: Integer ); begin showmessage('you are

Call Delphi CLASS exported in DLL from C++ code

。_饼干妹妹 提交于 2021-02-04 21:39:14
问题 i have a problem to use delphi class from C++ code. delphi dll demo that export a function that return an object. my delphi Dll code is as follow: library DelphiTest; // uses part.... type IMyObject = interface procedure DoThis( n: Integer ); function DoThat : PWideChar; end; TMyObject = class(TInterfacedObject,IMyObject) procedure DoThis( n: Integer ); function DoThat: PChar; end; // TMyObject implementation go here ... procedure TMyObject.DoThis( n: Integer ); begin showmessage('you are

Removing an element from a type asserted Slice of interfaces

六眼飞鱼酱① 提交于 2021-02-04 19:57:50
问题 In Golang, after asserting to a slice, how is one able to remove an element from said slice? For example, the following returns the error cannot assign to value.([]interface {}) value.([]interface{}) = append(value.([]interface{})[:i],value.([]interface{})[i+1:]...) 回答1: If you have a slice value wrapped in an interface, you can't change it. You can't change any value wrapped in interfaces. When an interface value is created to wrap a value, a copy is made and stored in the interface. When

Removing an element from a type asserted Slice of interfaces

主宰稳场 提交于 2021-02-04 19:52:11
问题 In Golang, after asserting to a slice, how is one able to remove an element from said slice? For example, the following returns the error cannot assign to value.([]interface {}) value.([]interface{}) = append(value.([]interface{})[:i],value.([]interface{})[i+1:]...) 回答1: If you have a slice value wrapped in an interface, you can't change it. You can't change any value wrapped in interfaces. When an interface value is created to wrap a value, a copy is made and stored in the interface. When

How I embed a python script in php?

我怕爱的太早我们不能终老 提交于 2021-02-04 14:17:27
问题 I know that there are similar questions on StackOverflow but I've tried all of them and none of them worked. On my laptop, I have an Apache server, a website built with PHP and a Python script. Attempts: 1) system $mystring = system('python myscript.py myargs', $retval); 2) and 3) JSON and $temp = exec($command, $output); php: #first case command= 'C:\wamp\www\com\non.py file'; $temp = exec($command, $output); echo(" output "); echo $output; echo " hello "; echo $temp; #second case // Execute

How can I define an interface for a object/array containing key/value pairs as well as nested objects?

半腔热情 提交于 2021-01-29 22:23:32
问题 I'm typing up a localization-library, and I'm aiming to have it strongly typed (as it will be re-used in multiple angular-applications) and - at the same time - backwards compatible so that we won't have to re-write all existing localization-files. However, the structure of said localization-files is causing me a bit of a headache. Per example: { 'any-random-key': 'This is a string', 'another-random-key': { 'random-key': 'This is a string' }, 'yet-another-random-key': { 'random-key-2': 'This

Pass data from adapter to activity using interface callback method with Kotlin

折月煮酒 提交于 2021-01-29 21:49:31
问题 I have read through this Kotiln: pass data from adapter to activity and am attempting option 1 from the answer given. I have a game with various levels. I send all levels to a recycler view using the the below itemview in gridlayout <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout