Search Results

Search found 21430 results on 858 pages for 'message digest'.

Page 97/858 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • Apple Push Notifications With Foreign Accent Characters Not Receiving

    - by confeng
    I'm sending push notifications and when the message contains foreign characters (Turkish in my case) like I, s, ç, g... The message does not arrive to devices. Here's my code: $message = 'THIS is push'; $passphrase = 'mypass'; $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'MyPemFile.pem'); stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); // Open a connection to the APNS server $fp = stream_socket_client( 'ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); if (!$fp) exit("Failed to connect: $err $errstr" . PHP_EOL); echo 'Connected to Apple service. ' . PHP_EOL; // Encode the payload as JSON $body['aps'] = array( 'alert' => $message, 'sound' => 'default' ); $payload = json_encode($body); $result = 'Start'.PHP_EOL; $tokenArray = array('mytoken'); foreach ($tokenArray as $item) { // Build the binary notification $msg = chr(0) . pack('n', 32) . pack('H*', $item) . pack('n', strlen($payload)) . $payload; // Send it to the server $result = fwrite($fp, $msg, strlen($msg)); if (!$result) echo 'Failed message'.PHP_EOL; else echo 'Successful message'.PHP_EOL; } // Close the connection to the server fclose($fp); I have tried encoding $message variable with utf8_encode() but the message received as "THÝS is push". And other ways like iconv() didn't work for me, some of them cropped Turkish characters, some didn't receive at all. I also have header('content-type: text/html; charset: utf-8'); and <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> in my page. I don't think the problem appears while I set the value but maybe with pack() function. Any ideas to solve this without replacing characters with English?

    Read the article

  • is the sender of google-app-engine allow my own gmail..

    - by zjm1126
    my gmail is [email protected] i can only use [email protected] in the sender=".." ,yes ?? from google.appengine.api import mail message = mail.EmailMessage(sender="[email protected]", subject="Your account has been approved") message.to = "[email protected]" message.body = """ Dear Albert: Your example.com account has been approved. You can now visit http://www.example.com/ and sign in using your Google Account to access new features. Please let us know if you have any questions. The example.com Team """ message.send() thanks

    Read the article

  • In Rails Can we pass a parameters to a new Action

    - by fenec
    i would like to write a message using an instince variable in the new invition action like this. redirect_to new_invitation_path("invite your friend") Controller invitations: def new(message) @message = message @from_user_id = facebook_session.user.to_s end Apparently it is not possible how can i find a way around this?

    Read the article

  • symfony 1.4 adding a BCC recipient to mailer

    - by Matt
    I know with swift directly you can create a Recipient_List and do -addBcc() . How would i do this same thing in the context of symfony 1.4 $message = $this->getMailer()->compose(); $message->setSubject(sfConfig::get('app_email_welcome_subject')); $message->setTo($user->getUsername()); $message->setFrom(sfConfig::get('app_email_from'));

    Read the article

  • How to pass a link to Facebook iPhone app status update?

    - by Jonatan
    It's possible to create href-attibutes that makes the iPhone quit Safari and launch another app. For the official Twitter-app this would look like: <a href="twitter:///post?message=my+important+message">Click to deliver message to Twitter-apps status updater</a> For the Facebook-app the protocoll is: fb:/// But i can't figure out, or find any information about, how to get my message (a url to share) directly into the the status updater. Is there a url-scheme, or am I going about this the wrong way?

    Read the article

  • I could use some help with my SQL command

    - by SuperSpy
    I've got a database table called 'mesg' with the following structure: receiver_id | sender_id | message | timestamp | read Example: 2 *(«me)* | 6 *(«nice girl)* | 'I like you, more than ghoti' | yearsago | 1 *(«seen it)* 2 *(«me)* | 6 *(«nice girl)* | 'I like you, more than fish' | now | 1 *(«seen it)* 6 *(«nice girl)* | 2 *(«me)* | 'Hey, wanna go fish?' | yearsago+1sec | 0 *(«she hasn't seen it)* It's quite a tricky thing that I want to achieve. I want to get: the most recent message(=ORDER BY time DESC) + 'contact name' + time for each 'conversation'. Contact name = uname WHERE uid = 'contact ID' (the username is in another table) Contact ID = if(sessionID*(«me)*=sender_id){receiver_id}else{sender_id} Conversation is me = receiver OR me = sender For example: From: **Bas Kreuntjes** *(« The message from bas is the most recent)* Hey $py, How are you doing... From: **Sophie Naarden** *(« Second recent)* Well hello, would you like to buy my spam? ... *(«I'll work on that later >p)* To: **Melanie van Deijk** *(« My message to Melanie is 3th)* And? Did you kiss him? ... That is a rough output. QUESTION: Could someone please help me setup a good SQL command. This will be the while loup <?php $sql = "????"; $result = mysql_query($sql); while($fetch = mysql_fetch_assoc($result)){ ?> <div class="message-block"> <h1><?php echo($fetch['uname']); ?></h1> <p><?php echo($fetch['message']); ?></p> <p><?php echo($fetch['time']); ?></p> </div> <?php } ?> I hope my explanation is good enough, if not, please tell me. Please don't mind my English, and the Dutch names (I am Dutch myself) Feel free to correct my English UPDATE1: Best I've got until now: But I do not want more than one conversation to show up... u=user table m=message table SELECT u.uname, m.message, m.receiver_uid, m.sender_uid, m.time FROM m, u WHERE (m.receiver_uid = '$myID' AND u.uid = m.sender_uid) OR (m.sender_uid = '$myID' AND u.uid = m.receiver_uid) ORDER BY time DESC;

    Read the article

  • Interaction between C++ and Rails applications

    - by FancyDancy
    I have two applications: c++ service and a RoR web server (they are both running at same VPS) I need to "send" some variables (and then do something with them) from each other. For exaple, i'm looking for something like this: // my C++ sample void SendMessage(string message) { SendTo("127.0.0.1", message); } void GetMessage(string message) { if (message == "stop") SendMessage("success"); } # Ruby sample # application_controller.rb def stop @m = Messager.new @m.send("stop") end I have never used it before, and i even don't know which technology should i search and learn.

    Read the article

  • celeryd dead but subsys locked

    - by Jeames Bone
    I get the message 'celeryd dead but subsys locked' when I check if celery is running. I get a [failed] message when trying to stop the service, and as soon as I start it I get this message again. I have deleted the var/lock/subsys/celeryd file which doesn't help at all. I noticed that the PID and log files are not being created in the specified place either, but the service is starting with an [ok] message. I am running CentOS.

    Read the article

  • WCF Endpoint rounting

    - by Dmitriy Sosunov
    Hi, Guys, how to route inbound message between different endpoints. I need to expose the single endpoint that could accept different credentials. I guess, solve this by intercept the incoming message and based on message header then do forward message to appropriate endpoint. Thanks.

    Read the article

  • SSL Authentication with Certificates: Should the Certificates have a hostname?

    - by sixtyfootersdude
    Summary JBoss allows clients and servers to authenticate using certificates and ssl. One thing that seems strange is that you are not required to give your hostname on the certificate. I think that this means if Server B is in your truststore, Sever B can pretend to be any server that they want. (And likewise: if Client B is in your truststore...) Am I missing something here? Authentication Steps (Summary of Wikipeida Page) Client Server ================================================================================================= 1) Client sends Client Hello ENCRIPTION: None - highest TLS protocol supported - random number - list of cipher suites - compression methods 2) Sever Hello ENCRIPTION: None - highest TLS protocol supported - random number - choosen cipher suite - choosen compression method 3) Certificate Message ENCRIPTION: None - 4) ServerHelloDone ENCRIPTION: None 5) Certificate Message ENCRIPTION: None 6) ClientKeyExchange Message ENCRIPTION: server's public key => only server can read => if sever can read this he must own the certificate - may contain a PreMasterSecerate, public key or nothing (depends on cipher) 7) CertificateVerify Message ENCRIPTION: clients private key - purpose is to prove to the server that client owns the cert 8) BOTH CLIENT AND SERVER: - use random numbers and PreMasterSecret to compute a common secerate 9) Finished message - contains a has and MAC over previous handshakes (to ensure that those unincripted messages did not get broken) 10) Finished message - samething Sever Knows The client has the public key for the sent certificate (step 7) The client's certificate is valid because either: it has been signed by a CA (verisign) it has been self-signed BUT it is in the server's truststore It is not a replay attack because presumably the random number (step 1 or 2) is sent with each message Client Knows The server has the public key for the sent certificate (step 6 with step 8) The server's certificate is valid because either: it has been signed by a CA (verisign) it has been self-signed BUT it is in the client's truststore It is not a replay attack because presumably the random number (step 1 or 2) is sent with each message Potential Problem Suppose the client's truststore has certs in it: Server A Server B (malicous) Server A has hostname www.A.com Server B has hostname www.B.com Suppose: The client tries to connect to Server A but Server B launches a man in the middle attack. Since server B: has a public key for the certificate that will be sent to the client has a "valid certificate" (a cert in the truststore) And since: certificates do not have a hostname feild in them It seems like Server B can pretend to be Server A easily. Is there something that I am missing?

    Read the article

  • My form submit button is not showing correctly

    - by JackR
    I have created an form that submits the contents to email. I have used the exact same coding in many other websites, but for my new website http://www.peterevansfuneraldirectors.co.uk/contact-us.html the submit button is just a grey square with text, rather than the usual button. Also the hand doesn't come up on hover. My form code is... <form action="php/FormToEmail.php" method="post" name="ContactForm" id="ContactForm" onsubmit="MM_validateForm('name','','R','email','','RisEmail','message subject','','R','message','','R');return document.MM_returnValue" > <div class="form-text"> <b>Name<span class="purple">*</span></b><br /> <input name="name" type="text" id="name" size="35" style="height:23px; background-color:#FFF; color:#000; border: 1px solid #CCC;" /> </div><br /> <div class="form-text"> <b>Email<span class="purple">*</span></b><br /> <input name="email" type="text" id="email" size="35" style="height:23px; background-color:#FFF; color:#000; border: 1px solid #CCC;" /> </div><br /> <div class="form-text"> <b>Message Subject<span class="purple">*</span></b><br /> <input name="message subject" type="text" id="message subject" size="35" style="height:23px; background-color:#FFF; color:#000; border: 1px solid #CCC;" /> </div><br /> <div class="form-text"> <b>Message<span class="purple">*</span></b><br /> <textarea name="message" type="text" id="message" rows="8" cols="55" style="background-color:#FFF; color:#000; border: 1px solid #CCC;" ></textarea> </div><br /> <div class="submit-button"> <input type="submit" name="submit" value="Submit" /> </div> </form> Thanks in advance! Jack.

    Read the article

  • Sessions not persisting between requests

    - by klonq
    My session objects are only stored within the request scope on google app engine and I can't figure out how to persist objects between requests. The docs are next to useless on this matter and I can't find anyone who's experienced a similar problem. Please help. When I store session objects in the servlet and forward the request to a JSP using: getServletContext().getRequestDispatcher("/example.jsp").forward(request,response); Everything works like it should. But when I store objects to the session and redirect the request using: response.sendRedirect("/example/url"); The session objects are lost to the ether. In fact when I dump session key/value pairs on new requests there is absolutely nothing, session objects only appear within the request scope of servlets which create session objects. It appears to me that the objects are not being written to Memcache or Datastore. In terms of configuring sessions for my application I have set <sessions-enabled>true</sessions-enabled> In appengine-web.xml. Is there anything else I am missing? The single paragraph of documentation on sessions also notes that only objects which implement Serializable can be stored in the session between requests. I have included an example of the code which is not working below. The obvious solution is to not use redirects, and this might be ok for the example given below but some application data does need to be stored in the session between requests so I need to find a solution to this problem. EXAMPLE: The class FlashMessage gives feedback to the user from server-side operations. if (email.send()) { FlashMessage flash = new FlashMessage(FlashMessage.SUCCESS, "Your message has been sent."); session.setAttribute(FlashMessage.SESSION_KEY, flash); // The flash message will not be available in the session object in the next request response.sendRedirect(URL.HOME); } else { FlashMessage flash = new FlashMessage(FlashMessage.ERROR, FlashMessage.INVALID_FORM_DATA); session.setAttribute(FlashMessage.SESSION_KEY, flash); // The flash message is displayed without problem getServletContext().getRequestDispatcher(Templates.CONTACT_FORM).forward(request,response); } FlashMessage.java import java.io.Serializable; public class FlashMessage implements Serializable { private static final long serialVersionUID = 8109520737272565760L; // I have tried using different, default and no serialVersionUID public static final String SESSION_KEY = "flashMessage"; public static final String ERROR = "error"; public static final String SUCCESS = "success"; public static final String INVALID_FORM_DATA = "Your request failed to validate."; private String message; private String type; public FlashMessage (String type, String message) { this.type = type; this.message = message; } public String display(){ return "<div id='flash' class='" + type + "'>" + message + "</div>"; } }

    Read the article

  • I want to trace logs using a Macro multi parameter always null. problem c++ windows

    - by sxingfeng
    I am using the following way to cout a function's time: #define TIME_COST(message, ...)\ char szMessageBuffer[2048] = {0};\ va_list ArgList;\ va_start(ArgList, message);\ vsprintf_s(szMessageBuffer, 2048, message, ArgList);\ va_end(ArgList); \ string strMessage(szMessageBuffer);\ CQLogTimer t(strMessage); // CQLogTimer is a self destructor,which will cout life time of its own and print szMessageBuffer. However when I use the macro this : void fun { TIME_COST("hello->%s", filePath); XXXXXX } The message generated always is hello-(null) Can Any one help? Many thanks!

    Read the article

  • How to use input type="tel" in a contact form

    - by user1678664
    PHP newbie here trying to use a simple contact form. The fields I have are: "Name", "Email", "Phone", and "Message". I am trying to figure out what to do with the "Phone" field – I want it to output to the same place that "Message" does, so that when the email is received it will output both the message and the phone number to the body of the email. How do I do this? if( isset( $_POST['submit'] ) ) : wp_mail( get_option( 'admin_email' ), 'Website Contact Form', ( isset($_POST['message'] ) ? $_POST['message'] : '(blank)' ), 'From: ' . ( isset( $_POST['from_name'] ) ? $_POST['from_name'] : 'Website Contact Form' ) . ' <' . ( isset( $_POST['from_email'] ) ? $_POST['from_email'] : get_option( 'admin_email' ) ). '>' . "\r\n" ); $output = '<p>Thank you! Your message has been sent.</p>'; else : $output = ' <form action="" method="post"><ul> <li> <label for="from_name">Name</label> <input type="text" name="from_name" id="from_name" /> </li> <li> <label for="from_email">Email</label> <input type="email" name="from_email" id="from_email" /> </li> <li> <label for="from_tel">Phone</label> <input type="tel" name="from_tel" id="from_tel" /> </li> <li> <textarea name="message" id="message"></textarea> </li> <li class="submit"> <input name="submit" type="submit" value="Say Hello!" /> </li> </ul></form>'; endif; return $output;

    Read the article

  • NUnit: Assert.Throws

    - by epitka
    How do I use Assert.Throws to assert type of the exception and the actual message workding. Something like this: Assert.Throws<Exception>( ()=>user.MakeUserActive()).WithMessage("Actual exception message") Method I am testing throws multiple messages of the same type, with different message and I need a way to test that correct message is thrown depending on the context.

    Read the article

  • Display a variable when a select box option is selected

    - by user782104
    For example, the select box <select><option selected="" value="">Please Select</option><option value='txt'>Text</option><option value='int'>Numbers</option><option value='bool' >Boolean</option></select> has a string $messageList=array ( 'txt'=>'text message', 'int'=>'int message','bool'=>'bool message'); What i would like to achieve is to display correspond message when the optition is select?

    Read the article

  • CodeIgniter Form Validation

    - by mmcglynn
    I am trying to set up validation on a simple contact form that is created using the form helper. No validation at all occurs. What is wrong? In the code below, the “good” keyword always shows, regardless of what is entered into the form, and the saved values set via set_value are never shown. Controller // Contact function contact() { $data['pageTitle'] = "Contact"; $data['bodyId'] = "contact"; $this->load->library('form_validation'); $config_rules = array ('email' => 'required','message' => 'required'); $this->form_validation->set_rules($config_rules); if ($this->form_validation->run() == FALSE) { echo "bad"; $data['include'] = "v_contact"; $this->load->view('v_template',$data); } else { echo "good"; $data['include'] = "v_contact"; $this->load->view('v_template',$data); } } View echo validation_errors(); echo form_open('events/contact'); // name echo form_label('Name', 'name'); $data = array ( 'name' => 'name', 'id' => 'name', 'maxlength' => '64', 'size' => '40', 'value' => set_value('name') ); echo form_input($data) . "\n<br />"; // email address echo form_label('Email Address', 'email'); $data = array ( 'name' => 'email', 'id' => 'email', 'maxlength' => '64', 'size' => '40', 'value' => set_value('email') ); echo form_input($data) . "\n<br />"; // message echo form_label('Message', 'message'); $data = array ( 'name' => 'message', 'id' => 'message', 'rows' => '8', 'cols' => '35', 'value' => set_value('message') ); echo form_textarea($data) . "\n<br />"; echo form_submit('mysubmit', 'Send Message'); echo form_close();

    Read the article

  • WCF Endpoint routing

    - by Dmitriy Sosunov
    Hi, Guys, how to route inbound message between different endpoints. I need to expose the single endpoint that could accept different credentials. I guess, solve this by intercept the incoming message and based on message header then do forward message to appropriate endpoint. Thanks.

    Read the article

  • Android Progress Dialog not showing

    - by ilomambo
    This is the handler, in the main Thread, which shows and dismisses a progress dialog. public static final int SHOW = 0; public static final int DISMISS = 1; public Handler pdHandler = new Handler() { @Override public void handleMessage(Message msg) { Log.i(TAG, "+ handleMessage(msg:" + msg + ")"); switch(msg.what) { case SHOW: pd = ProgressDialog.show(LogViewer.this, "", getText(R.string.loading_msg), true); break; case DISMISS: if(pd != null) { pd.dismiss(); pd = null; } break; } } }; The message to show the progress is: pdHandler.sendMessage(pdHandler.obtainMessage(SHOW)); The message to dismiss it is: pdHandler.sendMessage(pdHandler.obtainMessage(DISMISS)); It works well when I call it before I start an AsyncTask, the AsyncTask onPostExecute() dismisses it. But when it runs within a runnable (runOnUiThread), the dialog does not show. Examining the pd variable on the debugger, it shows that is is created, it is running and it is visible, but in practice it is not visible. Any suggestion? UPDATE: I did the obvious test I should have done in the first place. I commented the DISMISS message. And the progress dialog did show up. It appeared too late, after the runnable was finished. I undestand now that the DISMISS message did dismiss the not-yet-visible ProgressDialog, that's why I did not see it. The question becomes now: I need the ProgressDialog to show BEFORE the runnable code is executed. And it is not so straight forward. My call hierarchy is like this: onScrollEventChanged --> runOnUiThread ( --> checkScrollLimits --> if need to scroll show ProgressDialog "Loading" get new data into table dismiss ProgressDIalog ) I tried something like this: onScrollEventChanged --> checkScrollLimits --> if need to scroll show ProgressDialog "Loading" --> runOnUiThread ( get new data into table dismiss ProgressDIalog ) But still the dismiss message got there before the ProgressDialog could show. According to Logcat there is a five second interval between the arrival of the SHOW message and the arrival of the DISMISS message. UPDATE II: I though I will use the isShowing() method of ProgressDIalog pd = ProgressDialog.show(...) while(!pd.isShowing()); But it does not help at all, it returns true even if the dialog is not showing yet.

    Read the article

  • how do I iterate through multiple properties in jsp

    - by David
    I'm trying to iterate through a properties file which contains a list of keys like: message.p1 message.p2 message.p3 I don't know how many properties will be in the file, so I want to display any that are present. Is there a standard tag like <fmt:message> that can handle this, or do I need to write some jsp script to handle the loop?

    Read the article

  • Need help with 2 MySql Queries. Join vs Subqueries.

    - by BugBusterX
    I have 2 tables: user: id, name message: sender_id, receiver_id, message, read_at, created_at There are 2 results I need to retrieve and I'm trying to find the best solution. I have included queries that I'm using in the very end. I need to retrieve a list of users, and also with each user have information available whether there are any unread messages from each user (them as sender, me as receiver) and whether or not there are any read messages between us ( they send I'm receiver or I send they are receivers) I need Same as above, but only those members where there has been any messaging between us, sorted by unread first, then by last message received. Can you advise please? Should this be done with joins or subqueries? In first case I do not need the count, I just need to know whether or not there is at least one unread message. I'm posting code and my current queries, please have a look when you get a chance: BTW, everything is the way I want in fist query. My concern is: In second query I would like to order by messages.created_at, but I dont think I can do that with grouping? And also I dont know if this approach is the most optimized and fast. CREATE TABLE `user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) INSERT INTO `user` VALUES (1,'User 1'),(2,'User 2'),(3,'User 3'),(4,'User 4'),(5,'User 5'); CREATE TABLE `message` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `sender_id` bigint(20) DEFAULT NULL, `receiver_id` bigint(20) DEFAULT NULL, `message` text, `read_at` datetime DEFAULT NULL, `created_at` datetime NOT NULL, PRIMARY KEY (`id`) ) INSERT INTO `message` VALUES (1,3,1,'Messge',NULL,'2010-10-10 10:10:10'),(2,1,4,'Hey','2010-10-10 10:10:12','2010-10-10 10:10:11'),(3,4,1,'Hello','2010-10-10 10:10:19','2010-10-10 10:10:15'),(4,1,4,'Again','2010-10-10 10:10:25','2010-10-10 10:10:21'),(5,3,1,'Hiii',NULL,'2010-10-10 10:10:21'); SELECT u.*, m_new.id as have_new, m.id as have_any FROM user u LEFT JOIN message m_new ON (u.id = m_new.sender_id AND m_new.receiver_id = 1 AND m_new.read_at IS NULL) LEFT JOIN message m ON ((u.id = m.sender_id AND m.receiver_id = 1) OR (u.id = m.receiver_id AND m.sender_id = 1)) GROUP BY u.id SELECT u.*, m_new.id as have_new, m.id as have_any FROM user u LEFT JOIN message m_new ON (u.id = m_new.sender_id AND m_new.receiver_id = 1 AND m_new.read_at IS NULL) LEFT JOIN message m ON ((u.id = m.sender_id AND m.receiver_id = 1) OR (u.id = m.receiver_id AND m.sender_id = 1)) where m.id IS NOT NULL GROUP BY u.id

    Read the article

  • Extended MAPI: How to get the entry ID of messages moved by CopyMessages

    - by marijne
    I have found that if I move a message using IMAPIFolder::CopyMessages (using the MESSAGE_MOVE flag) the message gets a new entry ID. However I do not see any reliable way of getting the entry ID of the message in its new location, or otherwise getting a reference to it. The best suggestion I have had so far involves tagging the message with the old custom property before moving, and then doing a search afterwards, but I was wondering if there is a less convoluted solution.

    Read the article

  • Disable automatic index on related object id from yml

    - by BugBusterX
    Doctrine Automatically creates indexes on columns that are used to define object relations, For example user: id, name message: id, sender_id, receiver_id, message if I define relationship between message and user in a way that message has one Sender and has one Receiver, doctrine will automatically index sender_id and receiver_id fields when I generate sql from model. I would like to disable index on sender, because I manually create index with sender_id and receiver id together. How can I disable auto generated index?

    Read the article

  • shell scripting error logging

    - by Eddy
    Hi all, I'm trying to setup a simple logging framework in my shell scripts. For this I'd like to define a "log" function callable as log "LEVEL" $message Where the message is a variable to which I have previously redirected the outputs of executed commands. My trouble is that I get errors with the following {message=command 2&3 1&3 3&-} &3 log "INFO" $message There's something wrong isn't there? TIA

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >