EzDevInfo.com

reply

REPL-y: A fitter, happier, more productive REPL for Clojure.

Inserting > at the start of each line in reply e-mails

In my Rails app I have a mail section in which I want to append a > character at the start of each line when replying to a message. The challenge is, how do I know when to insert a > character given the block of text doesn't contain carriage returns according to the width of the textbox.


Source: (StackOverflow)

WCF OperationContract - What's the point of Action and ReplyAction?

[ServiceContract(Namespace = "http://schemas.mycompany.com/", Name = "MyService")]
public interface IMyService
{
    [OperationContract(Name = "MyOperation")
    OperationResponse MyOperation(OperationRequest request);
}

In this scenario, what is the point of the Action and ReplyAction ?


Edit: I should clarify my question...

How would my wsdl differ if I don't specify these parts? Won't it just use some combination of the namespace, service name and opeartion name anyways?


Source: (StackOverflow)

Advertisements

php remove all but last quoted reply in forum

I'm creating my own forum and stuck with removing multiple quoted text from replies. I'll try to explain this with example.

Let's say we got first message with text Hello A.

Then somebody quotes this and we get: [q]Hello A[/q] Hello you too in database.

And if third person quotes second reply it goes more ugly and will be something like: [q] [q]Hello A[/q] Hello you too[/q] Hello both.

What I want do to is to remove all but the last quoted replies from quoted text. So in this case on third reply I want to strip [q]Hello A[/q] inside 3rd quote.

How to make it work on unlimited [q]'s?

edit: How to replace multiple [q]something[/q] inside the main [q] which is the first one? -> [q] [q]A[/q] B[/q] -> becomes -> [q]B[/q] OR [q][q][q]A[/q]B[/q]C[/q] -> becomes -> [q]C[/q]


Source: (StackOverflow)

Akka zeromq actor seems to be slow for REP/REQ

I'm building a REQ/REP service with zeromq and the REP part is in Scala and using Akka actors.

Here is the actor

class ReplyActor extends Actor {

  println("Listening..")

  def receive = {
    case m: ZMQMessage =>
      sender ! ZMQMessage(Seq(Frame("world")))
    case _ =>
      sender ! ZMQMessage(Seq(Frame("didn't understand?")))
  }

}

And my main function

object Replyer extends App {
  val system = ActorSystem("zmq")
  val serverSocket = ZeroMQExtension(system).newRepSocket(
    Array(
      Bind("tcp://127.0.0.1:1234"),
      Listener(system.actorOf(Props[ReplyActor]))
    )
  )
}

My REQ code is in python

import zmq
import time
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://127.0.0.1:1234")

startTime = time.time() 
for i in range(10):
    msg = "msg %s" % i
    socket.send("hello")
    msg_in = socket.recv()

print 'That took ', time.time()-startTime, 'seconds'

It takes about 1 second for 10 messages, so my question is why is it so slow? If I build the REP in python it is really fast so I'm accusing Akka zeromq binding.

Extra info: I'm using Scala 2.9.2 and the newest Akka 2.0.3 (but also tried with 2.0.2)


Source: (StackOverflow)

Sendgrid Web API -- set multiple users in reply_to field

I'm using the Sendgrid Python library, and I'd like to send emails with multiple people in the 'reply_to' field.

I'd like to send an email to 2 people such that both users can email one another by hitting reply. The simplest solution to this seems to be to put both users in the reply to field.

I haven't seen any way to do this in the Sendgrid docs -- they seem to only want a single email address string in their 'reply_to' field. However, I know that emails with this characteristic are possible (please excuse the budget redaction job):

Multiple entries in the reply-to field

Anyway, as you can see, multiple entries in 'reply-to' are possible. So does anyone know how to do it with Sendgrid?


Source: (StackOverflow)

Does RFC 5322 allow reply-to header without any actual e-mail address? If so, what is its semantic?

Section 3.6.2 of RFC 5322 defines the reply-to header as:

reply-to        =   "Reply-To:" address-list CRLF

Where address-list is defined at section 3.4. When unfolding the ABNF grammar, I find that address-list can consist of nothing but phrase ":" ";" (phrase being defined at section 3.2.5). So it boils down to you being able to add a reply-to header that does not contains any actual e-mail address.

The RFC states:

When the "Reply-To:" field is present, it indicates the address(es) to which the author of the message suggests that replies be sent.

Even if it is only a suggestion, it seems rather strange that I can suggest to someone to reply to an address I name but don't specify.

Am I missing something here? How should I interpret such a construction?


Source: (StackOverflow)

Receve replys from Gmail with smtplib - Python

Ok, i am working on a type of system so that i can start operations on my computer with sms messages. now i can get it to send the initial message:

    import smtplib  

fromAdd = 'GamilFrom'  
toAdd  = 'SMSTo'  
msg = 'Options \nH - Help \nT - Terminal'  

username = 'GMail'  
password = 'Pass'  

server = smtplib.SMTP('smtp.gmail.com:587')  
server.starttls()  
server.login(username , password)  
server.sendmail(fromAdd , toAdd , msg)  
server.quit()

Now i just need to know how to wait for the reply or pull the reply from Gmail itself, then store it in a variable for later functions.


Source: (StackOverflow)

Reply to sender - PHP email

Here is my code for a email form. It works well, it sends to my email. But how can i make it so i can reply to the email that i received from the form? Would you be able to edit my code and put it in because im a BIG php noobie. many thanks!

<?php

$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$to = "adamgoredesign@gmail.com";

mail ($to, $subject, $message, "From: " . $name);

header('Location: contact_thankyou.html');

?>

Source: (StackOverflow)

Print out response of Dbus Method Call in C

The problem I am having is specifically printing out the response of a dbus method call in C using the low level API. I am new to C's libdbus, but have done some work in python-dbus.

  • I know how to write dbus methods and method calls in python as well as the CLI
  • I can find code on the internet to invoke dbus methods, but they don't return or print out the response
  • I have been looking at the libdbus doxygen api, but cannot determine how to pull out the response.

The way I have my code set up, a python dbus daemon runs with methods I want to call. Some of them return a string. I want a C program to connect to the session bus, call the method, print out the reply and exit.

This is what I have currently:

#include <stdio.h>
#include <dbus/dbus.h>

static void send_dbus_message (DBusConnection *connection, const char *msg)
{
DBusMessage *message;
//initialize the message
message = dbus_message_new_signal ("/org/example/foo/bar",
                                    "org.example.foo.bar",
                                    msg);

//send the message
dbus_connection_send (connection, message, NULL);
//deallocate the message
dbus_message_unref (message);
}

int main (int argc, char **argv)
{
DBusConnection *connection;
DBusError error;

//init error message
dbus_error_init (&error);
connection = dbus_bus_get (DBUS_BUS_SESSION, &error);
if (!connection)
{
    printf ("Connection to D-BUS daemon failed: %s", error.message);

    //deallocate error message
    dbus_error_free (&error);
    return 1;
}

send_dbus_message (connection, "HelloWorld");
return 0;
}

Can be synchronous or asynchronous.


Source: (StackOverflow)

iPhone Objective C - wait_fences: failed to receive reply: 10004003

i have this strange error : wait_fences: failed to receive reply: 10004003 in this code :

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {

    if (buttonIndex==0) {
        [self showActivityViewer];
        [NSTimer scheduledTimerWithTimeInterval:6.0 target:self selector:@selector(hideActivityViewer) userInfo:nil repeats:NO];
        [self downloadControlAndUpdatePoi];
        [self downloadControlAndUpdateItinerari];
        [self downloadControlAndUpdateEventi];
        [self downloadControlAndUpdateArtisti];
        NSLog(@"AGGIORNA");
    } else {
        NSLog(@"NON AGGIORNARE");
        return;
    }
}

Why?? Where could be the possibile error or problem??


Source: (StackOverflow)

System.Net.Mail.MailMessage "Reply-To" header is ignored in IIS 6.0 but OK in IIS 5.1

I have a web app project developed and unit-tested on a WinXP machine (IIS 5.1). It has been published to a Win2003Server (IIS 6.0). One feature of the app sends an email with a "Reply-To" header (snippet follows). On the IIS 5.1 machine, the Reply-To appears properly in the header. When sent from the IIS 6.0 PC, the header does not contain the Reply-To address (see below):

    Public Shared Sub SendEmail_withReplyTo(ByVal emailfrom As String, _
                                        ByVal emailto As String, _
                                        ByVal vbody As String, _
                                        ByVal vsubject As String, _
                                        ByVal msgcc As String, _
                                        ByVal msgbcc As String, _
                                        ByVal sReplyTo As String)
    Dim MyMsg As New MailMessage
    ErrorTrap.ErrorMsg = Nothing
    With MyMsg
        .From = New MailAddress(emailfrom)
        .Headers.Add("Reply-To", sReplyTo)
        .To.Add(emailto)
        If msgcc.Length > 0 Then
            .CC.Add(msgcc)
        End If
        If msgbcc.Length > 0 Then
            .Bcc.Add(msgbcc)
        End If
        .Subject = vsubject
        .IsBodyHtml = True
        .Body = vbody
    End With
    Try
        Dim smtp As New SmtpClient
        smtp.Send(MyMsg)
    Catch ex As Exception
        ErrorTrap.ErrorMsg = Nothing
        ErrorTrap.ErrorMsg = ex.ToString
    End Try
End Sub

The following internet headers are pasted from MS Outlook 2003 - View - Options:

Valid Reply-To as sent from JOHNXP machine (the dev PC with IIS 5.1):

Return-path: <Service@zipeee.com>
Received: from JohnXP (unverified [10.10.30.66]) by mail.cbmiweb.com
(Rockliffe SMTPRA 9.2.0) with ESMTP id <B0003406093@mail.cbmiweb.com>;
Mon, 28 Jun 2010 15:16:25 -0400
Message-ID: <B0003406093@mail.cbmiweb.com>
Reply-To: terriadams@cox.net
MIME-Version: 1.0
From: Service@ZIPeee.com
To: johna@cbmiweb.com
Date: 28 Jun 2010 15:17:57 -0400
Subject: Regarding your Ad #153949: Yard sale in vienna va June 12 at 8am
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Missing Reply-To as sent from the MOJITO machine (the 2003 server with IIS 6.0):

Return-path: <Service@zipeee.com>
Received: from MOJITO (unverified [10.10.30.14]) by mail.cbmiweb.com
(Rockliffe SMTPRA 9.2.0) with ESMTP id <B0003405883@mail.cbmiweb.com>;
Mon, 28 Jun 2010 13:37:53 -0400
Message-ID: <B0003405883@mail.cbmiweb.com>
MIME-Version: 1.0
From: Service@ZIPeee.com
To: johna@cbmiweb.com
Date: 28 Jun 2010 13:39:25 -0400
Subject: Regarding your Ad #153949: Yard sale in vienna va June 12 at 8am
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

I even set up VStudio2008 on the Win2003 machine and stopped at a breakpoint inside the code above to make sure that the mailmessage was in fact being correctly built with the "Reply-To" added to the header (it is). Yet when arriving in Outlook, the message originating from the MOJITO server lacks the "Reply-To" in the header.

Are there other configuration issues that would thwart what the actual code is trying to do?


Source: (StackOverflow)

Django blog reply system

i'm trying to build a mini reply system, based on the user's posts on a mini blog. Every post has a link named reply. if one presses reply, the reply form appears, and one edits the reply, and submits the form.The problem is that i don't know how to take the id of the post i want to reply to. In the view, if i use as a parameter one number (as an id of the blog post),it inserts the reply to the database. But how can i do it by not hardcoding?

The view is:

def save_reply(request):

  if request.method == 'POST':
    form = ReplyForm(request.POST)
    if form.is_valid():
       new_obj = form.save(commit=False)
       new_obj.creator = request.user
       new_post = New(1) #it works only hardcoded
       new_obj.reply_to = new_post
       new_obj.save()
       return HttpResponseRedirect('.')    
  else:
       form = ReplyForm()     
  return render_to_response('replies/replies.html', {
       'form': form,
       }, 
      context_instance=RequestContext(request))  

i have in forms.py:

  class ReplyForm(ModelForm):
    class Meta:
      model = Reply
      fields = ['reply']

and in models:

class Reply(models.Model):
reply_to = models.ForeignKey(New)
creator = models.ForeignKey(User)
reply = models.CharField(max_length=140,blank=False)
    objects = NewManager()   

mentioning that New is the micro blog class

    thanks

Source: (StackOverflow)

Sending post request and do not wait for reply and continue php script

I need to send post request from php whithout waiting for response .

CURL has no this abillity and also wget.

I am sending many post requests to apple push servers and reply from this server is very slow and i dont need the response.

thx for help


Source: (StackOverflow)

Is it possible to count only the total replies message via IMAP()

I'm working on the 1st imap() project. I want to count every message type - unread, read, reply and deleted. Only the "reply" status that consumes me a lot of time. I tried to search here and google. But no luck. Some says I need to create my own way to count it coz there's no such a universal function for it.

So may I have you guys a suggestion on how to count it. Or point me the way to do so. (I don't ask for a complete code. Just only suggestions.)

Regards,


Source: (StackOverflow)

ZeroMQ REQ-REP: Checking that replies went through

In the ZeroMQ documentation for a REP socket it says:

If the original requester doesn't exist any more the reply is silently discarded.

In my project, I'd like to have some way of knowing that the entity that made the original request is no longer present and listening for a reply. In other words, I'd like an error to be thrown if the reply is going to be discarded.

Is such a thing possible, or must I use some separate channel to check on the requestor or some kind of ACK upon its receipt of the reply?


Source: (StackOverflow)