communication

How can I receive data from URL on iPhone?

隐身守侯 提交于 2019-12-05 02:53:16
问题 I'm using the code from Apple's Document to do some HTTP communication. I can connect to the URL successfully, but I failed to receive the data from my server. // create the request NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://..."] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; // create the connection with the request // and start loading the data NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest

accessing textview within a fragment in activity

元气小坏坏 提交于 2019-12-05 01:45:20
问题 I wanted to use Fragments with in the ActionBar. Unfortunately it looks like its really complicated. My Fragments have Textviews and I want to be able to communicate with them out of my activity. Before I started to use Fragments I could access them with private EditText editText = (EditText) findViewById(R.id.editTextName); So I was able to receive the editText value when a user clicked on save. How should I do this the Fragment-way? Activity: @Override public void onCreate(Bundle

How to set the baud rate for Macs in a terminal

隐身守侯 提交于 2019-12-05 01:24:37
Is it possible to set the baud rate for Macs in a terminal? If yes, how to set the baud rate in terminal through the terminal? I am trying to talk to the Mac using an Arduino (open source microcontroller), an XBee (wireless communicator) to type in the terminal through the serial monitor. The only problem I am having is the baud rate of the serial monitor and terminal are different. I can easily change the baud rate for the serial monitor in the Arduino, but I do not know what the baud rate is for the terminal in Mac. jon911 On Mac OS, stty seemingly can only change terminal settings for an

cURL requesting URL with whitespaces in URL.. What to do

回眸只為那壹抹淺笑 提交于 2019-12-04 22:22:41
So I'm trying to curl this URL: http://images.fastcompany.com/upload/Screen shot 2011-04-28 at 8.13.21 PM.png URL Encoded it reads as: http%3A%2F%2Fimages.fastcompany.com%2Fupload%2FScreen+shot+2011-04-28+at+8.13.21+PM.png However, curl needs it to be decoded into a proper URL obviously. How do i get around this problem? cURL drops off the rest of the string as soon as it reaches any whitespace... :( I should mention I can't wrap the URL with double quotes as it is a variable being posted. Edit: hahahahaha wowwwwww brainfart.. thanks guys :P Just use str_replace. echo str_replace ( ' ', '%20',

communication between c++ and java

﹥>﹥吖頭↗ 提交于 2019-12-04 21:55:58
I have to write a JAVA program which communicates with some other program in C++. Messages to send are simple String/Char[] like "REQ", "PAUSE", "02,14" with '\0' on the end, so: "REQ\0". I have this: socket = new Socket(); socket.connect(new InetSocketAddress(komputer, port), czekaj); in = new DataInputStream(socket.getInputStream()); out = new DataOutputStream(socket.getOutputStream()); Sending: public void sendTekst(String tekst){ try{ char []a = tekst.toCharArray(); for(int i = 0; i < a.length; i++) out.writeChar(a[i]); out.writeChar((byte)'\0'); out.flush(); } catch(IOException e) {

C++ How to make two programs communicate?

≡放荡痞女 提交于 2019-12-04 21:36:53
问题 Question: What is the best way to make two programs (both running on the same computer) communicate and interact? (Windows, C++) Theoretical situation: On a Windows PC, I have a 3rd party software that you use to do stuff (like open/edit/save files...it's not really important). This 3rd party software has an available C++ SDK so you can develop plugins for it. I develop a separate standalone Windows C++ program (most likely using Qt) with a GUI. This program is made to run on the same Windows

Android and Arduino both receiving strange values via Bluetooth

牧云@^-^@ 提交于 2019-12-04 17:31:41
I am using BluetoothChat code on the Android side to send an ON/OFF signal (I am sending 110, 119 or other cases as defined below) to the Arduino UNO using the chat box, but when I display the received value, it shows strange values in the Arduino Serial monitor, that is, 255, 254, 250 or 245 and replies with strange values on the Android side too. but suprisingly only single condition among 110, 119, etc gets true when i send these commands from android and no other instruction/LED gets properly executed/turned ON/off. Can any one help me figure out the problem? Below is my arduino code. int

Choosing buffer size for FTP and HTTP transfers

混江龙づ霸主 提交于 2019-12-04 16:39:36
问题 How does one choose the size of a buffer (bytes I read from or write to socket) for the maximum throughput when implementing a low-level HTTP and FTP transfer? My application should transfer data with HTTP or FTP on connections varying from 130 Kbps to 3 Mbps (I know the expected speed beforehand). Sometimes it's a one way transfer, sometimes it goes in both directions. Should I stick with some average buffer size or I must vary it depending on the connection speed? Thanks. 回答1: First, get

How to communicate within this system?

雨燕双飞 提交于 2019-12-04 15:32:09
问题 We intend to design a system with three "tiers". HQ, with a single server lots of "nodes" on a regional basis users, with iPads. HQ communicates 2-way with the nodes which communciate 2-way with the users. Users never communicate with HQ nor vice-versa. The powers that be decree a Windows app from HQ (using Delphi) and a native desktop app for the users' iPads. They have no opinion on the nodes. If there are compelling technical arguments, I might be able to beat them down from "decree" to

Google Chrome Extension - Architecture Question

余生颓废 提交于 2019-12-04 14:43:03
问题 I have been going in circles (probably because I am somewhat new) to how communication takes place in Chrome Extensions. I am trying to build an extension that: 1) has a popup that interacts with the user 2) based on what the user chooses in the popup, the DOM of the current tab is modified 3) the popup also needs to be able to send and receive information from a remote database server (i.e. an external website w/ database) For me, it is very unclear as to how to architect the communication