Bidirectional connection [closed] - communication

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I want to know how can we have a bidirectional connection physically and electrically for example how can we send and receive signals at the same time in telephone wire without interference?
thanks for your answers!

Although your question is off-topic the answer is pretty simple.
You have multiple wires. For a signal you need at least two. One for the signal and one to have a common reference the signal refers to.
So either you have at least 2 signal lines so you can send and receive at the same time or you have 1 signal line and both sides send/receive alternatingly.

The term you are looking for is 'Full Duplex'. Communications is a huge topic and it would take a book on the subject to give a complete answer for all cases, but we can generalise a simple answer.
I would not consider this completely off topic here as the same is true for example by two computer processes sending data between each other over some media, perhaps shared memory.
With very few exceptions, full duplex communications requires that there is some form of separation of the data on the channel between multiple parties.
Separation could be by frequency band, separate media (multiple carrier frequences, multiple wires or fibres), by time, coding scheme or other methods. Search FM (frequency modulation - and variants thereof), TDMA (time division multiple access), CDMA (code division multiple access), etc.
In the care of analog telephones it's time; i.e. more than one person talking at the same time will have trouble understanding one another.
Analogue telepones are one of the few mediums where the data is not modulated on a carrier and the media is shared without any controls other than the individuals at each end cooporating.
Full duplex communication can introduce another problem; the send mechanism (e.g. microphone) can coupled to the receive mechanism (e.g. loudspeaker).
E.g. in the case of a phone this is by the media and the room each person is in. This means that because the two are coupled and it takes time to send the message to the other end, echo can be introduced which must be eliminated (echo cancellation) or the message will get corrupted by the returning delayed copy (the echo).

Related

How do i get messages even if the app is closed

It is more or less asking how Whattsapp, Instagram, Facebook etc works.
How does my Phone know i got a new message even if the app is closed
(Please dont focus that much on the examples above, it is more a general question.)
I can think of a couple of solutions:
1.My Phone asks (in the background) an api every couple of seconds and fetches the data.
2.My Phone has an on going connection over the Web(i heard of technologies like: WebSocket, WebRTC, WebTransport, (standard) sockets, TCP)
My Phone is running a Webserver 24/7 and gets the signal like that
So in general the question is how can my PC/Phone etc. wait for a signal/data (Im talking 1, 2 or 3 bytes) in the background efficiently
it Highly Depends on the Operating System that the Program is Running on and also each OS has its own specific Security & Privacy Policy. However, all of them have a Common Agreement that this Types of Operation should be Handled in Background Processes as Secure Lightweight as Possible. so for your listed solution the closest one is 1th case.
2th Case almost Impossible because it is in Contradiction to being Lightweight
3th Case totally wrong way

Track and trace geolocation & temperature with blockchains

For my internship, I need to implement a blockchain based solution to manage a drug supply chain. The management of this supply chain implies to track-and-trace (geolocate) a drug on the chain, but also to monitor the storage temperature to see if the cold chain is respected. For that I also intend to use IOT, where a device will feed information on the blockchain solution. However, I have a few questions that I can't find easier.
The first one is that I don't know if I should use ethereum or not, since each time that a new block is added (the block representing the update on the information about the product on "real-time") I will to use money. Is there any solution for that? Or do I need to create a blockchain with javascript?
The second question is that I absolutely don't know from where to begin in order to implement IOT on the block chain. I searched on research site, but they only talk about it, without presenting any example...
The third one is more a confirmation than a question since I want to know if my idea to use an IOT to track and manage products on a supply chain can be done on a wide scale, since the bigger a blockchain the slower is the time to add a block because of the consensus mechanism. So it means that my "real time" tracking on truly be "on time" since there would be a waiting time before the block is added to the blockchain. If the time is just a few seconds to minutes, then there is no problem, but because the number of block will rapidly increase because of the real time tracking (1 block each minute for each storage or transport vehicles I was planning for) that this problem of scalability makes it impractible.
I'm thanking anybody in advance who will help me solve these questions.
#1) Whether you use Ethereum or another blockchain that may be better suited for this purpose is completely up to you. I expect you will get a lot of opinionated answers on this. Ethereum is certainly the most popular blockchain for a use like this, but that does not mean it is the best for your app. Over the last several years we have seen many new blockchains with lower/no fees, faster block times, and increased scalability. I would suggest doing some research into various "Supply Chain", "Enterprise", and "Business" blockchains, as these are likely the type you are looking for and will cost very little in blockchain fees due to them not being as widely used as Ethereum is.
#2) You will have to settle on a blockchain before you can start prototyping or looking for examples, as each one will be different. For storing "log" data for your application there are generally 2 options: Storing data in a smart contract on Ethereum (or an Ethereum-like blockchain), or storing data in the OP_RETURN field of a transaction on Bitcoin or a bitcoin-based blockchain. The latter is likely easier to get started with and is simpler to understand, you just put the data in a transaction and send it (to yourself, even).
#3) Yes, there a special purpose blockchains created exactly for this purpose that are meant to ingest large amounts of data and that can scale to meet the needs of an application like you describe. Some blockchains have block times of 1 minute or less meaning that on average, you could update the data every minute if you were willing and able to pay the blockchain fee to include the data in each new block (personally I would suggest a longer interval, such as every 5-10 minutes).
You can use Emercoin NVS technology and Emercoin (testnet) blockchain to upload you data into it. By creating some "name label" with name_new command, you can thereafter upload chain of modifications for values of your name. Blockchain has command name_show (shows recent uploaded value) and name_history (shows all chain of uploaded values). You can view/debug your uploaded values within Emercoin Testnet Explorer, tab NVS.
Regarding "use money".
I can give you (or anyone else) 100 test EMCs, for free. Just write your tEMC address in comments here. 100tEMCs will be enough for ~100,000 records within Testnet. Thus, I think, it is more than enough for your test tasks.
If you need to use your service for production, you need to use the "real blockchain" (with high trust), no testnet. Anyway, EMCs are very cheap right now, and you can buy 100EMSs for ~$5 only. I think, this is not big deal for your organization.
Ask more questions, and I will be happy to assist you here with this technology.
Because you have a permissioned / private environment that does not transfer value or store value, a blockchain specialised in value transfer, like Ethereum, is not a good choice.
Choosing a blockchain that is specialised in untrusted value writes simplies creating your product a lot. Some good choices include:
BigchainDB
HyperLedger SawTooth - comes with a stock supply chain example

Why do I need to asynchronously return data when dealing a web API? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm learning how to parse JSON from web APIs. I have read that I need to asynchronously return my parsed data from the API for my application, as opposed to synchronously. I'm not sure why it has to be asynchronously. I know it has something to do with threading, but that doesn't clarify it for me.
Why do network requests have to be performed asynchronously?
The fact that you should to do this asynchonously has nothing to do with the nature of the response (JSON or otherwise). It’s just that you’re requesting data from an API on a remote server and you don’t know how long it will take (subject to the nature of the network the device is on, how busy the web server is, etc.).
Bottom line, any task that takes more than a few milliseconds should generally be performed asynchronously to ensure a responsive UI, and this API call will take much more time than that.
Analogy time
Imagine that you're employed in the information booth of a train station to manually update a board with trains' statuses. You read off an old-fashioned ticker tape and move models of the trains around so that passengers can see what's going on. You also answer questions about schedules and such directly, when passengers ask you.
You realize that for one particular portion of the board, some information is missing from your tape. Your colleague has the info, but she isn't in the station. So you leave the board, go over to the phone, and call her. You dial, and wait for her to pick up, and then explain what you need. She doesn't have what you need immediately to hand, so she asks you to wait a moment while she gets it.
Meanwhile, the tape doesn't stop. Information about trains continues to come in. but because you're sitting there on the phone waiting, you're not doing anything with it. The people who are watching the board get frustrated, and the people who have questions for you can't ask them either.
Finally, your colleage comes back and gives you what you asked for. You thank her and return to the board. You realize the board is in very bad shape, not reflecting the current state of the world at all. And the passengers with questions have stormed out and left you a one-star review on the App, I mean Train, Store.
Next day, the same situation comes up. You need information you don't have. Instead of stepping away from the board for several minutes, you quickly fire off a text message, and get right back to talking to passengers and moving things around on the board.
In about the same amount of time that you spent waiting on the phone yesterday, you get a text back from your colleague with the information. You incorporate it into your workflow, and nobody even notices that you spend a couple of seconds reading from your phone instead of the ticker tape. Victory!
The first day, you made a synchronous network request. You initiated a conversation with a remote service and waited until you got the response. When that happened, your UI was locked up, neither taking input from the user nor refreshing its own state.
The second day, you made an asynchronous request. You kept working normally until the response came back, allowing you to continue with all your other tasks.

QuickBlox 10 Gb traffic/storage in free tier [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am developing a iOS video chat app using QuickBlox api but I didn't getting meaning of 10 Gb traffic/storage. I read about it from here http://quickblox.com/plans/free/
I have three questions:
Q.1) How much storage/traffic will be used, If we started a video call to a person using iPhone for 1 hour ?
Q.2) 10GB traffic/storage per month for each application or per account ?
Q.3) Can we make video confrencening app using Quickblox api ?
Any help will be greatly appreciated. Thanks.
A.1) When you are doing a p2p video call to a person, the only traffic that will be used server-side is for logging start and end time on the server (and the like). The video traffic won't affect the 10Gig.
A.2) You should be creating one account for your app - so: both.
A.3) Video Conference with more than 2 participants is not supported natively in QuickBlox, but you can bind your video signal to more than one instance, allowing you to stream your video to multiple participants at the same time.
Of course, with higher user count, the necessary bandwidth of every user increases. If you have p2p between six users, you have to push five incoming and five outgoing video signals through each participant's internet connection. (You should think of a clever way to downsize the signal on the sender side.)
#Deepak,
1) Not Sure its depends upon your quality & Connection for ex. 5 minute youtube should be around 10mb.... for 360-420p videos.
2) Storage 10GB is for per month based.
3) Yes they do support Check this - http://quickblox.com/developers/Chat/Video_chat
Q.1) How much storage/traffic will be used, If we started a video call to a person using iPhone for 1 hour ?
The data passed between users is Peer to Peer so not that much.
Q.2) 10GB traffic/storage per month for each application or per account ?
The Free tier is just that - Free so it is subject to fair use. We don't cut off at 10GB but if clients want support and SLA and better services we request that clients use the Pro or upgrade to an enterprise tier to support Quickblox to provide them with better services.
Q.3) Can we make video confrencening app using Quickblox api ?
Yes of course

How to connect 2 callers together with Twilio [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have a situation where I want to anonymously connect 2 callers together. The idea being, you call a phone number enter a digit (each digit corresponds to another phone number) Once you enter in your digits the phone calls the other phone number and then once that other phone number picks up, the two callers are connected.
How would I do this as cheap as possible? Is there a way to do it on Twilio to connect the 2 calls, but then once the calls are connected to not have to go through Twilio anymore?
This is possible using Twilio. The first party calls a Twilio number which then uses the <Dial> TwiML verb to call the second party, using the callerId attribute to anonymize who the call is from. For that attribute value you can use any number you have purchased from Twilio or is a validated outgoing caller ID on your account.
Generally what people do in this case is give everyone who needs to make anonymized calls their own phone number. Then you show use that for the caller ID so if the second party calls the number back, they'd also be anonymously forwarded as well.
In this case you'd be charged 1 cent per minute for the duration of the incoming call initiated by the first party, and 2 cents per minute for the duration of the leg connecting the second party.
I am fairly certain, that if you connect thru twilio, you stay connected (and incur per-minute charges) during the entire conversation.
Openvbx, which is built on twilio, does a similar thing, where you can initiate a call from the web, it calls you at your 'real' phone, you press a key and then it connects the second caller. Charges apply during the connection.
(I realize this doesn't answer the first part of the question, just answering the charge-related part)
This is a pretty basic Twilio function:
First call, respond with twiml using to get the digits, and providing a url where to send the digits to
Respond to the request with digits using a verb with to call and, like John said, set the caller ID to something else (like another twilio inbound number).
When the other party picks up, the call is connected.
Pricing-wise, you's be looking at approximately 3 cents per minute or 5 cents if a toll-free number is used.
With Twilio, you will not be able to connect the two calls and then "not use" Twilio. This is an all or nothing proposition, unless you get one of the users to re-dial the call directly.
Only alternative I can thing of, that would not require paying Twilio requires you setting up your own routing setup, such as Asterisk box. However, the cost associated with doing this is arguably greater - you have to learn telco stuff and get a decent rate on minutes from a voip carrier, not to mention supporting it. On the upside, you control your own routing here and you can get better rates, such as $0.0127 per minute here: http://www.minutehub.com/ (I have never used them and am not affiliated with them)
I've worked now in several companies using Twilio in production and have nothing but good experience with them. If you are just starting out, these guys let you focus on the problem you are solving first. Once your solution is baked, you can focus on optimizing the costs. Good luck!

Resources