send

Raw Socket Linux send/receive a packet

人盡茶涼 提交于 2019-11-30 09:21:23
Have some problems in receiving packets. I can receive and read incoming packets, but I think i do not get a handshake with any host. I only want to send a packet to a remote computer with an open port on receiving an answer to see the TTL(time to live) and the window size. Does anyone have an idea where the errors are? (I don't have very deep knowledge in C programming) CODE: #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <errno.h> #include <unistd.h> #include <arpa/inet.h> #include <net/ethernet.h> #include <netinet/in.h> #include <netinet/ip.h

HTML5 increase youtube speed 2x from url?

淺唱寂寞╮ 提交于 2019-11-30 01:31:12
I would like to know how to speed up a youtube video 2x without the user clicking on the HTML5 (of the video), but instead by modifying the URL. For example, I know how to watch video starting at a specific time by appending to the URL the parameter &t=1m1s (for 1 minute and one second). Is it possible to use a similar method to speed up the video 2x? What parameters should I add to the URL to watch video in double speed (I'm using html5)? There's no way to change playback speed by URL arguments. Anyway, if you're working with HTML, you can take advantage of the YouTube Player iFrame API. Here

How to send radio button value in PHP [closed]

南楼画角 提交于 2019-11-30 01:17:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am struggling with sending the value of a radiobutton to an email. I have coded 2 radiobuttons, where I have set the first on to be default checked. The form and values work, however the radio button value is not submitted. Any wise words? 回答1: When you select a radio button and click on a submit button, you

Linux Socket: How to detect disconnected network in a client program?

若如初见. 提交于 2019-11-29 23:18:00
I am debugging a c based linux socket program. As all the examples available in websites, I applied the following structure: sockfd= socket(AF_INET, SOCK_STREAM, 0); connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)); send_bytes = send(sockfd, sock_buff, (size_t)buff_bytes, MSG_DONTWAIT); I can detect the disconnection when the remove server closes its server program. But if I unplug the ethernet cable, the send function still return positive values rather than -1. How can I check the network connection in a client program assuming that I can not change server side? But if I

How to send the mail from c#

左心房为你撑大大i 提交于 2019-11-29 21:26:12
问题 I have code, System.Web.Mail.MailMessage oMailMessage = new MailMessage(); oMailMessage.From = strFromEmaild; oMailMessage.To = strToEmailId; oMailMessage.Subject = strSubject; oMailMessage.Body = strBody; SmtpMail.SmtpServer = "localhost"; SmtpMail.Send(oMailMessage); (all variables have values) I have installed SMTP virtual services. why it is unable to send emails. why it is not working ?? EDIT public bool SendMail(string strToEmailId, string strFromEmaild, string strSubject, string

How to send data from fragment to fragment within same fragment activity?

时光毁灭记忆、已成空白 提交于 2019-11-29 15:37:07
I have a container in which there are two fragments my 1st fragment is working good now I want to send it to 2nd fragment. This is my 1st Fragment private class LoadLink extends AsyncTask<String, Void, String[]> { @Override protected String[] doInBackground(String... params) { Document document = null; try { document = Jsoup.connect(params[0].toString()).timeout(10 * 1000).userAgent("Mozilla").get(); download = document.getElementsByClass("actions").first().select("a").attr("href").toString(); } catch (Exception e) { e.printStackTrace(); } return new String[]{download, params[1]}; } } Now i

Intent.ACTION_SEND Whatsapp

若如初见. 提交于 2019-11-29 14:35:46
Im trying to share a mp3 file through whatsapp. It works perfectly with other apps like gmail, but it dosent works on whatsapp. Can anyone help me? Do I need to add some putExtra()? Here's my code: public void shareWithFriends(int id) { Intent share = new Intent(Intent.ACTION_SEND); share.setType("audio/mp3"); //share.putExtra(Intent.EXTRA_SUBJECT,"subject"); //Uri uri = Uri.parse("android.resource://com.igs.pokemonsoundboard/" + id); Uri uri = Uri.parse("android.resource://com.igs.pokemonsoundboard/raw/" + R.raw.pikachump3); share.putExtra(Intent.EXTRA_STREAM,uri); //share.putExtra("sms_body"

Send email with python

岁酱吖の 提交于 2019-11-29 12:09:33
I am trying to create a simple python script which sends an email. I used this following code: import subprocess params = {'from': 'from@example.com', 'to': 'to@example.com', 'subject': 'Message subject'} message = '''From: %(from)s To: %(to)s Subject: %(subject)s Message body ''' % params sendmail = subprocess.Popen(['/usr/share/sendmail', params['to']]) sendmail.communicate(message) But i recive the following error message when i try to run it: Traceback (most recent call last): File "/home/me/test.py", line 15, in <module> sendmail = subprocess.Popen(['/usr/share/sendmail', params['to']])

Flex: Sending parameters to Alert closeHandler

谁都会走 提交于 2019-11-29 09:59:05
Is it possible to send parameters to a closeHandler Alert function? The fisrt parameter the function gets is the CloseEvent, but how to send another one? <s:Button id="btnLoadLocalData" label="Load data" click="Alert.show('Populate list with local data?', '', Alert.YES | Alert.CANCEL, this, loadLocalData(???parameters???), null, Alert.OK);"/> Thank you! Jason Towne This should be possible using Flex's dynamic function construction. A similar question was asked here . Here's an example: The parameters and handler: var parameters:String = "Some parameter I want to pass"; private function

Android send SMS automatically on button click

两盒软妹~` 提交于 2019-11-29 00:08:56
问题 I am trying to automatically send SMS message to a certain number when the user presses a button on the screen. This is my code: Intent smsIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("sms:xxxxxxxxxxx")); smsIntent.putExtra("sms_body", "Hello"); startActivity(smsIntent); xxxxxxx = phone number I have the following permissions: <uses-permission android:name="android.permission.SEND_SMS"></uses-permission> <uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>