Questions tagged [protocols]
A common means for (un)related objects to communicate with each other.
5,382
questions
0
votes
0
answers
24
views
How to allow a generic function for types that are able to be converted to String
I'm trying to use a generic function uses types (in my particular case Floats and Ints ) which are able to be created from a string.
I've noticed that both types (Int and Float) have similar init ...
0
votes
1
answer
14
views
Reuse Extension for multiple types
I am attempting to reuse a piece of functionality in an extension across multiple types but I'm currently having a difficult time with the types. My code is as follows:
struct TitleStyle: ViewModifier ...
0
votes
0
answers
17
views
Determine size of array Protocol.Type in memory
I am trying to find out what the size of a protocol type array in memory is. But I lack the tools to figure out how to retrieve the size. It doesn't make sense that the object size of an object with 3 ...
0
votes
0
answers
51
views
from one language to another : I currently have a program in R, but I need to convert it in Python
I am already familiar with the possibility to "call" some R functions from python, but what I'm looking for is a way to convert R code to Python code.
I doubt that there's an automatic way ...
-1
votes
0
answers
5
views
POP email clients search functionality failing
I am using mail on my iPhone. I have configured it to use the POP protocol so I can look at old emails without worrying about connections to a server etc..
Recently searching my email has been ...
0
votes
0
answers
21
views
How to block all network protocols except TCP? [closed]
What is the absolutely quickest and most elegant way to block all network protocols except TCP for both inbound and outbound connections?
Problem/example: In Windows 7, you need to click all the way ...
0
votes
0
answers
13
views
How to trigger a custom slide up menu in a custom class, from button defined in that class, in any viewController?
I am trying to create a slide up menu, completely defined in a custom class named OldMenu.
It would show every time a user tap a UIBarButtonItem, that is also defined in that class.
So the button, the ...
0
votes
0
answers
6
views
General features or behaviours common to all or most application protocols defined in RFCs
Is there an RFC that recommends or defines some basic features an application protocol should or must contain? I'm thinking of (but not limited to):
The application protocol specification (APS) must ...
0
votes
2
answers
35
views
Why the class does not have to implement all the functions in a protocl?
I'm a newer to Swift. UITableViewDataSource and UITableViewDelegate have so many functions. If I have a UIViewController to adopt them, why don't I have to implement all the functions? In other ...
0
votes
2
answers
43
views
Protocol method not getting called in UIView
I have 2 UIViews
1st: ToolbarView:
This is the code for protocol in 1st view:
public enum ToolBarActionType: String {
case style = "style"
case undo = "undo"
case redo = &...
1
vote
1
answer
63
views
Static function encapsulation in Swift by passing Protocols.Type better than OO encapsulation and just as testable?
Given that I have a function that does not need to share and store state; should I use a static class/struct/enum to hold the function? I have read in many places that it is a bad design to use static ...
0
votes
0
answers
24
views
All links contained in the page removed http or https in Laravel website
Below is the file of /routes/web.php and declared 3 routes as following: web.php code image
xx.com/contact
xx.com/ooo/contact
xx.com/vendor/contact
The problem is in the route xx.com/contact and xx....
-3
votes
1
answer
33
views
Blynk protocols That used for Arduino [closed]
Is the blynk platform takes the MQTT protocol ?
for communication from the Arduino what is the protocols it used for blynk platform ?
0
votes
2
answers
32
views
Conforming to a protocol and also having a property with the type of the protocol in the same struct
I have the following struct:
struct ImageSlider: CodableComponent {
let slides: [CodableComponent]?
}
which conforms to CodableComponent
protocol Component {
}
typealias CodableComponent = ...
3
votes
0
answers
23
views
Difference between Arena::CreateMessage and Arena::CreateMaybeMessage
When I using Protocol Buffer with Arena, what is the difference between those 2 functions
google::protobuf::Arena::CreateMaybeMessage<LPD::MyObj>();
And
google::protobuf::Arena::CreateMessage&...
-1
votes
0
answers
31
views
In Swift, trying to use an initializer where all parameters have defaults to satisfy an Initable protocol
I'm creating a hierarchy of objects (ViewModels, specifically, but that doesn't matter). I am striving to be able to create my ViewModels with default values, so that you can always use a default ...
0
votes
0
answers
30
views
Can't add constraint to method
I'm trying to create a publisher for CoreData changes.
I've implemented Publisher protocol and I was required to implement NSFetchedResultsControllerDelegate in same type (not in extension).
Next, I ...
0
votes
0
answers
10
views
Does IIB/ACE support oAuth2.0 on email input node
IIB(v10)/ACE(v11) email input node: The doc suggests that only iMap and POP3 protocols are supported and these require a configured uid/pwd combination via mqsisetdbparms.
I'd like to know if access ...
0
votes
0
answers
19
views
Gardena Battery Rain Water Tank Pump 2000/2 - UART Interface [migrated]
I have a Garden and would like to water it automatically with rain. For this i buy a «Gardena Battery Rain Water Tank Pump 2000/2» and would like to control via an ESP8266.
After opening the control ...
0
votes
1
answer
24
views
Best way to create user profile with multiple attributes in python?
I am writing a user profile for a python script to run, which includes the user name, date of birth and their ip address. There will be multiple users, am I on the right track? Or do I use a list/...
-1
votes
1
answer
34
views
Best HID device communication libary C++
I want to send bytes to a HID device.
I've allready tried libhid but I can't get it to work.
Does anyone know a libary or a easy way to send bytes via. HID in C++.
Any help is appreciated.
0
votes
0
answers
32
views
MS-CHAPv2 - How to arrive at the auth response in the Success Packet
My team is currently working on an authentication module which uses MS-CHAPv2 protocol to authenticate users.
The API we have designed in C#, takes in username, challenge Hash and challenge Response ...
0
votes
0
answers
5
views
GLX glXQueryVersion returns error of "wrong opcode". Unix socket connection
The connection to the X server is done with Unix sockets. I can confirm that the server has GLX extension with the following code:
const char *str_extension = "GLX";
/* X protocol requires ...
-1
votes
1
answer
92
views
Make protocol conform to Hashable in Swift
I am trying to loop through an array which holds different types of exercises. In order to do so, I declared a protocol AnyExercise which can be hold by an array. I would like to add the Hashable ...
-1
votes
1
answer
70
views
Swift, use generic property with different specific types - Reference to generic type requires arguments in
How would one go about assigning an instance of a class which can have a generic type, but you don't know what type that is until run time?
For example.
We have a protocol and enums that conform to it ...
-2
votes
1
answer
50
views
Is there a way to use the 'is' type check operator with RandomAccessCollection?
I'm getting the following error on the 'if' condition:
"Protocol 'RandomAccessCollection' can only be used as a generic constraint because it has Self or associated type requirements"
let ...
1
vote
1
answer
28
views
Discover and connect to the devices running the same app around globally without a server
I want to create a mobile app which can connect to devices having the same app installed without having a server in between. The devices should act as server and client and discover nodes similar to ...
0
votes
0
answers
46
views
SwiftUI - Ability to call different methods with different parameters and returned results while going through another struct
I am currently writing a multi-platform app where multiple views execute code in another class. Each method called takes different parameters and returns different results (either string? for error or ...
0
votes
0
answers
16
views
How to hand over delegate to controller in different places of project
I have a UINavigationController which includes 4 screens. Each has a back button respectively. Task: by pressing the back button on Controller4 get to Controller2, which will immediately switch to ...
0
votes
0
answers
45
views
HART Protocol -- Universal Commands serial communication through modem
I have a few questions which I thought you might be able to help with:
I have been trying to carry out further communication with a Slave Device (FUJI A2 V5) on Windows 10 PC connected with HART modem ...
0
votes
0
answers
20
views
Big-endian byte to Int in java
I have this server-client protocol in my project and in the first byte of the message there is the message code (<MsgCode><MsgLength><Msg>).
response += data_length.to_bytes(...
0
votes
1
answer
14
views
Is there any consensus protocol that does not guarantee linearizability?
While studying consensus protocols, I notice for the typical ones, such Paxos, MultiPaxos, Fast Paxos, EPaxos etc, they all guarantee linearizability.
But it seems there is no literature explicitly ...
0
votes
0
answers
29
views
How to type-erase a Swift PAT that exposes an `init`?
Questions are:
how to type-erase a PAT (a Protocol with Associated-Type) that exposes an init method? The PAT being SpecializedContribution and my tentative being AnySpecializedContribution in the ...
1
vote
1
answer
76
views
Swift Enum associated values conforming to single protocol
How can I get associated value of current enum's case as Refreshable not using exhaustive switch?
In condition I only need it retrieved as protocol, which is used for each case associated type.
class ...
0
votes
0
answers
27
views
How can i enable TLS 1.2 for Tomcat 0.6.32?
How can i enable TLS1.1 and TLS 1.2 for Tomcat 0.6.32?
i did until now,
Java Version from 1.6.0_22 to 1.7.0_79
Openssl Version from 0.9.81 to 1.0.2
from Windows 2008 to Windows 2008 R2
but in that ...
0
votes
1
answer
44
views
Opening a local or network path in Explorer from browser
I am trying to open a path in Explorer.exe from the browser. I added a custom protocol:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\filebrowser]
@="File browser"
"URL ...
0
votes
1
answer
52
views
Type specific method is unavailable for a var returned with `some` directive
Consider a factory method pattern implementation:
import UIKit
protocol TransportProtocol: CustomStringConvertible {
func techReview()
}
// Make default implemetation opposed to @objc optional ...
1
vote
1
answer
52
views
UI is not updating after Protocol call Xcode
I was trying to implement viper architecture on my Xcode. I am following an article https://medium.com/cr8resume/viper-architecture-for-ios-project-with-simple-demo-example-7a07321dbd29.
also, I ...
1
vote
1
answer
67
views
SignalR json_aot protocol
I am currently working on a server which uses SignalR next to plain HTTP for communication.
I created a Asp.Net Core 5.0 backend with SignalR and implemented some methods to invoke the client calls.
I ...
-2
votes
1
answer
51
views
How to solve discarded git protocol over https or ssh issue
Github Discarded git protocol over https or ssh .
To read more about here - Improving Git protocol security on GitHub
Package won't work using git:// protocol
0
votes
1
answer
22
views
What protocols does gateway convert?
I've read that:
Gateways are basically protocol converters, facilitating compatibility
between two protocols and operating on any layer of the open systems
interconnection (OSI) model.
I don't ...
0
votes
1
answer
22
views
HTTP2 expects streams to be opened following the sequence
I haven't seen this claim in the official HTTP2 spec but it seems that if you open streams with IDs that do not represent sequential numbers, the server responds with a GoAway frame having ...
1
vote
0
answers
32
views
How to type hint a function returning a generic type and conformance to a Protocol in Python
If I have a function taking in an instance of type T, and outputting that same instance but modified so it additionally conforms to a Protocol, how should I type hint that? My main goal is to allow my ...
0
votes
1
answer
53
views
Capturing Profisafe packets using Lua Wireshark dissector
I am writing a Lua script to capture profisafe packets on wireshark.It is above the profinet layer in the stack.The wireshark dissect the profinet packets but does not dissect the profisafe.
For other ...
0
votes
2
answers
121
views
Forcing an Encoder's UnkeyedEncodingContainer to only contain one type of value
As part of a custom Encoder, I am coding an UnkeyedEncodingContainer. However, the specific format I am making it for asks that all elements of an array be of the same type. Specifically, arrays can ...
2
votes
1
answer
42
views
conforming to a protocol require delegate variable be available in ios13
having this protocol
public protocol URLSessionWebSocketTaskProtocol {
func send(_ message: URLSessionWebSocketTask.Message, completionHandler: @escaping (Error?) -> Void)
func receive(...
0
votes
0
answers
79
views
Print HTTP protocol version of given url
I'm building a webapp using Vue CLI to analyze http responses. I'm using axios to make get requests and a chrome extension which allows to send cross-domain requests.
My goal is to print HTTP protocol ...
1
vote
1
answer
37
views
Requiring, for a protocol, that an instance variable conform to a protocol ; rather than have a specific type
As part of a custom Coder, I convert both Float and Double in the exact same way :
static func encode(_ value : Double) -> Data {
withUnsafeBytes(of: value.bitPattern.bigEndian) { Data($0) }
}
...
-1
votes
1
answer
63
views
Swift protocol default values are not changable
I have such a protocol properties with default values. But with the current implementation if I create an instance of AssetViewAttributes with some other values for avgPrice, precision they still have ...
0
votes
0
answers
8
views
Protocol to find local server out of network
I was thinking about a project the other day and an idea stumbled across my mind:
How would you set up a server, for instance at a restaurant, and have an app of the restaurant chain which finds and ...