首页 \ 问答 \ lambda演算的β减少:评估顺序重要吗?(Beta reduction in lambda calculus: Order of evaluation important?)

lambda演算的β减少:评估顺序重要吗?(Beta reduction in lambda calculus: Order of evaluation important?)

给定以下lambda表达式,其中\类似于lambda

(\kf.f(\c.co)km)(\x.dox)(\le.le)

如果我将(\c.co)k转换为ko是错的吗? 我做到了,显然,这是错的。 正确的方法是首先评估外部函数,意味着(\ff(\c.co)(\x.dox)m)(\le.le)将是所需的解决方案。

这是真的,因为在我们的讲义中找不到任何可以表明这一点的规则吗? 如果是,为什么我不能先评估内部函数? 我这样做了,我的解决方案是正确的。

问候。


Given the following lambda expression, where \ resembles lambda:

(\kf.f(\c.co)km)(\x.dox)(\le.le)

Is it wrong if I convert (\c.co)k into ko? I did that and apparently, it was wrong. The right way to go would have been to evaluate the outer function first, meaning (\f.f(\c.co)(\x.dox)m)(\le.le) would have been the desired solution.

Is that true, because I can't find any rule that could indicate that in our lecture notes? If yes, why can't I evaluate inner functions first? I've done it like this and my solution was correct, nonetheless.

Regards.


原文:https://stackoverflow.com/questions/14567313
更新时间:2024-01-07 21:01

最满意答案

PHPMailer是一个很好用的类,因为它可以检测电子邮件客户端何时不支持HTML。

Check out this code snippet. It should help a little.

require("PHPMailer-master/PHPMailerAutoload.php");

$mail = new PHPMailer();
$mail->IsSMTP();

$mail->Host = "mail.somemailserver.com";  
$mail->SMTPAuth = false;


$mail->From = $someemail;
$mail->FromName = "Who ever";
$mail->AddAddress($email);
$mail->AddCC($anotheremail);

$mail->WordWrap = 50;



$mail->IsHTML(true);

$mail->Subject = "Some subject";

$mail->Body    = "<html>Content goes here</html>";


//if the client doesn't support html email use
$mail->AltBody = "Content";

if(!$mail->Send())
{
   echo "Message could not be sent. <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}

通过使用$ mail-> AltBody,您可以发送纯文本电子邮件。 希望这可以帮助!


PHPMailer is a great class to use because it detects when the email client doesn't support HTML.

Check out this code snippet. It should help a little.

require("PHPMailer-master/PHPMailerAutoload.php");

$mail = new PHPMailer();
$mail->IsSMTP();

$mail->Host = "mail.somemailserver.com";  
$mail->SMTPAuth = false;


$mail->From = $someemail;
$mail->FromName = "Who ever";
$mail->AddAddress($email);
$mail->AddCC($anotheremail);

$mail->WordWrap = 50;



$mail->IsHTML(true);

$mail->Subject = "Some subject";

$mail->Body    = "<html>Content goes here</html>";


//if the client doesn't support html email use
$mail->AltBody = "Content";

if(!$mail->Send())
{
   echo "Message could not be sent. <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}

By using the $mail->AltBody, you can send plain text emails. Hope this helps!

相关问答

更多
  • 尝试切换消息部分的顺序,将HTML部分放在纯文本部分之后。 它可能会工作:)。 注意 :现在我不记得我在哪里阅读(或者如果我确实这么做),但切换可能有所帮助的原因是因为我认为消息的首选部分可能是最后一部分。 更新 :我发现了一个地方,它表示多部分MIME消息中的部分应该按照增加的优先顺序排列 - 这里是第7.2.3节(编辑:最新版本,谢谢@ALEXintlsos !),从第三个开始到最后一段。 更新 :以下是第7.2.3节的引用(请参阅https://stackoverflow.com/help/refer ...
  • 我建议使用HTML到Markdown转换器。 https://github.com/Pixel418/Markdownify https://code.google.com/p/pandoc/source/browse/trunk/html2markdown?r=1651 I'd suggest using a HTML to Markdown converter. https://github.com/Pixel418/Markdownify https://code.google.com/p/pando ...
  • PHPMailer是一个很好用的类,因为它可以检测电子邮件客户端何时不支持HTML。 Check out this code snippet. It should help a little. require("PHPMailer-master/PHPMailerAutoload.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "mail.somemailserver.com"; $mail->SMTPAuth = fa ...
  • 根据您在评论中的反馈,尝试更改第一行以使用Body而不是HTMLBody : string Text = "

    " + mailItem.Body+ "

    "; 编辑:由于纯文本包含换行符,因此可能应该使用
    标记而不是

    标记来防止将所有内容放在一行上。 string Text = "

                                
  • 您可以使用php strip_tags方法http://php.net/manual/en/function.strip-tags.php //HTML VERSION $this->set('techAlertHtmlBody', $this->request->data['NewsArticle']['body']); //PLAIN TEXT VERSION $this->set('techAlertPlainBody', strip_tags($this->request->data['NewsA ...
  • 如果我正确理解你的问题,你只想从tinymce编辑器中获取文本内容。 好吧,如果那就是为什么不使用纯文本区/输入/内容可编辑div? 以这种方式获得编辑器的内容 1. 我们如何在javascript中获取微小的mce textarea的内容 2.现在您可能想要删除与内容关联的html标记,如下所示jQuery从HTML-String中删除标记 希望这可以帮助 if i am understanding your question properly, you want to get only the text ...
  • 如果您可能有任何不接受HTML电子邮件的客户,该决定应以此为开始。 这种情况不像以前那么常见,但是您仍然可能有一些不允许HTML的安全性明确的用户。 但是,您可以在同一封电子邮件中提供纯文本替代。 http://www.wilsonweb.com/wmt5/html-email-multi.htm 你还应该考虑HTML是否在纯文本上方提供了值? 对我而言,我通常收到的信息会在主题行内传输,以获得最佳可读性。 The decision should start with if you will possibl ...
  • 如果你使用普通的php: mail($to, $subject, $message, $headers); 您需要将其添加到标题中: $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; if you're using plain php: mail($to, $subject, $message, $headers); you need to add this to the headers: $headers .= "Conte ...
  • 电子邮件以纯文本形式发送,因为您使用的是email.setText()。 如果邮件内容是HTML,请尝试使用email.setHtml()。 The emails are being sent as plain text because you are using email.setText(). Try using email.setHtml() instead if the content of the message is HTML.
  • 我最近遇到了继续这样做的理由,垃圾邮件过滤器对仅限HTML的电子邮件给予了极大的重视。 I recently ran into a reason to continue doing this, spam filters give some serious weight to emails that are HTML only.

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)