Questions tagged [interface]

33345 questions
-1

votes
1

answer
21

Views

JavaFX update progress bar and wait for threads to complete

I'm trying to update a progress bar in Java FX. My first problem was that the window said 'not responding' instead of actually updating. It just froze and then after the tasks were done, the progress bar became full. So I found out that I had to use multithreading and implemented it like this. overa...
Karan Bijani
1

votes
1

answer
203

Views

UIGestureRecognizer created in UIView code not working

I've got a custom subclass of UIStackView that's got some UIImageViews inside it. I want the view to accept a pan gesture to track a slow swipe across its surface. When I configure a UIPanGestureRecognizer in Interface Builder it works, but not in code. Here's an abbreviated version of the class: @I...
Dov
1

votes
2

answer
634

Views

Convert Jboss (WildFly) cli output to json in Ansible

I'm struggling to automate my deployment processes to WildFly over its cli. The cli itself don't work idempotent, so if I want to add using ansible for example some server properties it just threw an error in case it already exist (official cli documentation gives only 3 methods add, read, remove ht...
1

votes
1

answer
72

Views

Typescript: Define initial state for object using interface with dictionary of keys

I've defined my interface as follows: export interface FullCache { // keys names are dynamic [cacheId: string]?: SingleCache; } export interface SingleCache { data: string; } so an example FullCache object could look like this: { ca001:{data:'foo'}, ca002:{data:'bar'} } However, I can't figure out...
Our_Benefactors
0

votes
1

answer
18

Views

Shouldn't every class that inherits an interface implement all interface members?

What is the difference between ClassTemp1 and ClassTemp2? I thought every class that implements an interface should implement all the interface members but ClassTemp2 has no error. Why? public interface ITemp : IComparable { void Temp(); } public class ClassTemp1 : ITemp // Error { } public class Cl...
Hree
1

votes
1

answer
489

Views

What TCP port number does the aws cli s3 use?

When you upload or download files via aws cli, what TCP port number does it use over the internet?
Abel Callejo
0

votes
0

answer
5

Views

Better Kivy Click Drag and Draw line

This is a a small component of a bigger app that draws a line when clicked, dragged and released : from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.core.window import Window from kivy.graphics import Color, Line, Rectangle Window.set_system_cursor('crosshair') DRAG_START =...
Keno
1

votes
2

answer
201

Views

Setting background color of a tkinter ttk frame

I want to simply set a background color to the frame within the tkinter window. The background color for the window was successful set, but the not for the frame inside. Simply entering bg='color_name or color_code' is not working. How can one set the background color of a ttk frame? In addition t...
Pratyush Karna
1

votes
2

answer
111

Views

Fibonacci using Stream And BinaryOperator in Java

I'm student and I learning functional Java 8. I got project to do and I don't understand how this function interface work. My teacher told me 'you should know that' and I'm looking for help to understand this problem. It should count Fibonacci series I got this code StreamUtils.generateRest(Stream.o...
anik
0

votes
0

answer
10

Views

separate functions from gui into process. lagging

first i created the functional parts of my code and later decided to add a interface to it, so i have linked the interface and and the main function of the previous code as bellow. class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def __init__(self, parent=None): super(MainWindow, self).__ini...
Eshaka
0

votes
2

answer
12

Views

Do not understand behavior of wpf updating dynamically created image control visibility changing every seconds

I have a Grid with 8 rows and 8 columns in wpf: the code behind is: public partial class MainWindow : Window { private const int MaxRow = 8; private const int MaxCol = 8; public MainWindow() { InitializeComponent(); DataContext = this; } private void Start() { for (int i = 0; i < MaxRow ; i++) { for...
Edgar
0

votes
0

answer
9

Views

App/Homepage displaying as blank window while using class structures with tkinter in Python 3.7

I'm brand new to python/programming (2-3 weeks experience) and I'm trying to make a GUI app with tkinter for a Battleship game that I wrote originally as a cmd line game for my first project. I would like this GUI to have a few different screens/frames that walk the user through setting up and playi...
BurtMacklinFBI
1

votes
1

answer
252

Views

Resources for learning tk/tile

Besides Ruby-Doc, what sources are best to take some examples and tutorials from, especially about Tk/Tile in Ruby? I found myself more normal with http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm http://www.perfectxml.com/syngress/ruby/Page1.asp but the information is pretty vague, and there is...
Denees
0

votes
0

answer
2

Views

Combine Consumers with different arguments or different arguments number

Let's say, our method receives input String and returns some List output. This output is the result of some number of generators, some of which depend on input and some of them not - they just add predefined values. I want to implement these generators like a list of some function interfaces (Consu...
Aleksey Balenko
0

votes
0

answer
6

Views

Update Gtk+2 text view widget from another thread

I am writing a chat client in GTK. The client has the main GTK loop, plus a spawned thread that sits and blocks at the read() function waiting for input from a file descriptor connected to a socket. Once the read function gets past the blocking, it has a char buffer of text that I would like to appe...
Matthew
1

votes
1

answer
5.4k

Views

How can wrap input value text [duplicate]

This question already has an answer here: How to wrap text of html button with fixed width 8 answers I have this piece of code but I am unable to wrap word.
Shube
1

votes
2

answer
2.4k

Views

How to uninstall sample data from Magento 2 using CLI?

I have installed sample data in magento 2, due to power failures of system its stop in between. Later I saw, there were showing all categories and Products almost installed. But at home page not seem any banner or product sliders. I tried to install it again but it shown message associated email is...
Praful Rajput
0

votes
0

answer
6

Views

Why do pointers implement interface with pointer receivers, but not vice versa?

Not a duplicate of X does not implement Y (... method has a pointer receiver) There are many questions regarding errors that arise from mixing regular and pointer receivers when implementing an interface on a type. I understand the fixes and proper design concepts for this, but don't understand why...
robbieperry22
1

votes
1

answer
719

Views

How to find all (child) sub-interfaces of a particular interface in Java?

Given an interface: public interface A {}; with inheriting interfaces: public interface B extends A {} public interface C extends A {} How can I programmatically scan to find B and C? I.e. how to do this: Type[] types = findAllSubInterfacesOfA(); // Returns [B.class, C.class] Note: Am trying to find...
Steve Chambers
1

votes
2

answer
1.2k

Views

How to use an interface in a callback with Golang?

I am trying to use a Faye client for Go but when I try to make an interface for the client it seems to fail due to to the type in the callback: package main import ( 'fmt' 'github.com/autogrowsystems/wray' ) type Message interface { Data() map[string]interface{} } type Promise interface { Successful...
komatsu
1

votes
1

answer
2.5k

Views

What does the difference of the JNI method CallObjectMethod,CallObjectMethodV and CallObjectMethodA?

There are 3 kinds of methods in JNI CallObjectMethod CallObjectMethodV CallObjectMethodA So what does the difference of the methods? jobject (*CallObjectMethod)(JNIEnv*, jobject, jmethodID, ...); jobject (*CallObjectMethodV)(JNIEnv*, jobject, jmethodID, va_list); jobject (*CallObjectMeth...
anql
1

votes
1

answer
895

Views

Using markup with Gtk.TextView

I have been trying to find a way to use Pango markup with Gtk.TextView and Gtk.TextBuffer in Python GObject, but it seems like this functionality is only available for tooltips and labels. Gtk.TextBuffer has the insert_markup method, but requires Gtk.TextIter as input, and must be of specified lengt...
Holsterbau
1

votes
2

answer
1.9k

Views

Android, add view with height in percentage

i wanna add a view with a 100% width and X%(e.g: lets make it 40%) to the parent view i have this: private RelativeLayout getParentView(){ return (RelativeLayout) MyActivity.this.getWindow().getDecorView().getRootView(); } i should cast parent view to LinearLayout or RelativeLayout can achieve this...
Mars
1

votes
1

answer
624

Views

How to create an JNI Android Studio Project with multiple static libs

I'm converting our game from using ndk-build to using Android Studio and CMake. The app is a JNI app taking the following form: A Java main activity (single, very basic .java file) c++ app code (game code) c++ physics code (to be compiled and linked as a static lib) c++ graphics code (to be compile...
Steven Haggerty
1

votes
2

answer
197

Views

Implement an internal interface in an internal class in C#

Why can't I implement an internal interface in an internal class? internal interface IDefinition { string GetValueAsString(string property); } internal sealed class DefinitionArray : IDefinition { internal string GetValueAsString(string property) { return m_definitionRows .Select(o => o.GetValueAsSt...
Vahid
1

votes
2

answer
1.6k

Views

Centering images horizontally in a shiny fluidRow

Is it possible to centre three images in one row within the shiny ui fluidPage AND have the width of each image fixed at 300px? To get: One idea I had was to use splitLayout and somehow insert an image as a function of window width but I am not sure how to acheive this. I understand you can use spli...
KGee
1

votes
1

answer
356

Views

Distribute remaining space in GridPane or how to do it

We need a solution for a 3 column layout with the following requirements: The middle column has a fixed size The middle column is centered in the parent The other two columns both share the remaining space The other two columns both have the same size Let's say we have an amount of horizontal space...
Guardian667
2

votes
1

answer
25

Views

Payment calculator does not reset properly

So after you hit the reset button or have an error message all the values turn blank but keep getting added onto when you continue to use the program but they are supposed to start over. public GroceryCalc() { initComponents(); purchase = 0; numitems = 0; } public void recordPurchase(double item_pri...
J. Sack
1

votes
0

answer
6

Views

How to run a service for multiple VLAN's?

I have a running server hosted on 192.168.254.1 with some VLAN's which can be accessed by each one from 192.168.(TAG).1. I'm trying to run a service on a second computer physically connected to the first one and make it available for all VLAN's by running it on 192.168.(TAG).1 for each VLAN. This se...
Diego Fidalgo
1

votes
1

answer
88

Views

Swift Threading: When to use DispatchQueue.main.async?

I believe I understand what the dispatch queue is doing when I call it, but I'm not sure when exactly I should use it and what it's advantages are when I do use it. If my understanding is correct, DispatchQueue.main.async { // code } will schedule the code contained within the closure to run on the...
YungGun
1

votes
1

answer
67

Views

How to create a JavaFX TableView without warnings?

I'm following a tutorial by Oracle to create a TableView in JavaFX. In this screenshot, I've copied and pasted the code and I get several errors, which aren't mentioned in the tutorial anywhere. The warning on the TableView says: TableView is a raw type. References to generic type TableView should...
JolonB
1

votes
2

answer
89

Views

How are native methods for JDK loaded?

While reading JDK source code, I found that some methods are native, but there's no System.loadLibrary or System.load in their static block, so how are those methods actually loaded? So I guess those methods are built-in in the JVM. Just wonder how are them loaded for specific class. Say, StrictMat...
Rui Yang
1

votes
1

answer
56

Views

Golang *bytes.Buffer nil causes fatal error [closed]

I had the same issue as https://github.com/golang/go/issues/26666 because I have a wrap function for my http requests. Sometimes I need to request: body := new(bytes.Buffer) json.NewEncoder(body).Encode(h) req('POST', 'http://example.com', body) And sometimes it's simply: req('GET', 'http://example...
Raimonds Linde
1

votes
2

answer
38

Views

Why can I assign a `Function` to an `Interface` in Typescript?

I am reading the Typescript Handbook - Generics, and there is a snippet of code as the following: interface GenericIdentityFn { (arg: T): T; } function identity(arg: T): T { return arg; } let myIdentity: GenericIdentityFn = identity; I would like to know why can I assign identity (which is a Functio...
fluency03
1

votes
2

answer
57

Views

Custom visitor pattern implementation

I'm trying to implement a sort of visitor pattern. Most of examples on web show a visitor class with a 'visit' method and multiple overloads of that method. In this case i've called my 'visit' method CalculateFee (it's a semantic matter) with its overloads. Everything it's ok so far, but now i need...
FredE
1

votes
5

answer
136

Views

How to set elevation color below the view in Android?

I am creating below design in Android Studio. But I stuck in how I can add color in elevation as seen in the picture below. A greenish color is shown below each button. I don't know how I can achieve this. I have even set the android:outlineSpotShadowColor and also this android:outlineAmbientShado...
1

votes
2

answer
33

Views

Returned interface{} type assertion

I need function that make query to databse. I use github.com/gocraft/dbr, so i create helper function: //SelectData - selects data from database func SelectData(table, fields, where string, data interface{}) interface{} { var ptr reflect.Value ptr = reflect.New(reflect.TypeOf(data)) // create new po...
Vasilij Altunin
1

votes
1

answer
31

Views

What is /w 1 and /C in PowerShell command?

I've seen PowerShell commands that start powershell /w 1 /C ...some command here.... What are the /w and /C arguments? Is there some documentation for this? Googling it didn't return anything that seemed relevant.
Nicole
1

votes
2

answer
1.2k

Views

Java Native Interface and Security

Is there any chance for the the violation of java security policy through java native interface. Which are the main areas we have to use JNI
Biju CD
1

votes
2

answer
2.2k

Views

Qt - How to open a website in a particular browser

I am coding one project, which needs to launch some webbrowsers with the given url. I saw some QT examples, but they explained how to launch the default browser, not a particular browser. Any helping suggestions will be appreciated. Edit1: Below is the code I use currently QString temp='C:/Program F...
prabhakaran

View additional questions