在Ubuntu 10.04上的bash 4.1.5(1)上的GNU grep 2.5.4
这匹配
$ echo "this is a line" | grep 'a[[:space:]]\+line'
this is a line
Run Code Online (Sandbox Code Playgroud)
但事实并非如此
$ echo "this is a line" | grep 'a\s\+line'
Run Code Online (Sandbox Code Playgroud)
但这也符合
$ echo "this is a line" | grep 'a\s\+\bline'
this is a line
Run Code Online (Sandbox Code Playgroud)
我不明白为什么#2不匹配(而#1确实如此)而#3也显示匹配.这有什么区别?
我们使用Like Gate构建了一个Facebook 页面选项卡应用程序.我们之前已经做过无数次,在这方面这个应用并没有什么不寻常之处.
在我们的ASP.Net 4.0 Web窗体应用程序中,我们使用了Facebook C#SDK,最新版本(6.4.2)直接从NuGet和以下C#代码中提取:
public static bool IsPageLiked(string appId,
string appSecret, string signedRequest)
{
var fb = new FacebookClient { AppId = appId };
dynamic req = fb.ParseSignedRequest(appSecret, signedRequest);
return req.page.liked;
}
Run Code Online (Sandbox Code Playgroud)
我们以前曾多次使用过此代码,我们从来没有遇到任何问题.该应用程序及其Like Gate在未发布的页面上运行良好- 因此只有位于相应应用角色中的页面管理员才能看到该应用.
不过,我们看到了间歇性的错误.这仅影响某些用户,但是这些用户只要他们喜欢或不同于托管Tab应用的页面就可以看到该消息:
此内容不再可用
您请求的内容目前无法显示.它可能暂时不可用,您点击的链接可能已过期,或者您可能无权查看此页面.
如果您尝试访问您没有权限的内容,则会出现该错误消息.但是,用户仍然是Page Admins,因此他们查看App和Page的权限不会改变.
谷歌表示,这是Facebook的一个错误,没有人真正找到一个令人满意的解决方案.奇怪的是,我们的客户对这个答案并不十分印象深刻.
有没有人能提供更具建设性的东西?请?:)
我们有一个View(称之为X),它是由其他2个视图调用的基本视图(称为Y和Z).
今天我们进行了更改以查看X,在该视图之后,Y和Z开始返回不正确的数据.当我们在Management Studio中运行时Select * from Y(这正是代码中调用视图的方式),它将返回不正确的数据.但是,当我们运行视图包含它的实际SQL时很好.我们尝试了很多东西,直到一位同事建议添加一个空格来查看X和Z,然后运行Alter,这是有效的.一切恢复正常,运行良好.
我的问题是:MSSQL是否缓存其视图?如果是这样,你怎么强迫他们不要强迫他们重新编译?
此外,任何有关此的额外阅读将是有帮助的.
我已经下载了一个HttpHandler类,它将JS文件连接成一个文件,并且它会在它连接的每个文件的开头附加字符.
关于是什么导致这个的任何想法?是否可以将处理的文件写入缓存,缓存是如何存储/渲染的?
任何投入将不胜感激.
using System;
using System.Net;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Configuration;
using System.Web;
public class HttpCombiner : IHttpHandler {
private const bool DO_GZIP = false;
private readonly static TimeSpan CACHE_DURATION = TimeSpan.FromDays(30);
public void ProcessRequest (HttpContext context) {
HttpRequest request = context.Request;
// Read setName, contentType and version. All are required. They are
// used as cache key
string setName = request["s"] ?? string.Empty;
string contentType = request["t"] ?? string.Empty;
string version = request["v"] …Run Code Online (Sandbox Code Playgroud) 我试图在数据检索任务需要不同时间的网站上的更新面板中异步显示数据.我想更新每个面板,以在每个任务完成后显示页面上的数据.
但是,无论我尝试什么,所有更新面板在最后一个任务完成后更改其内容.
例如:
我有两个任务:
预期的结果是在5秒后只有UpdatePanel1中的标签发生变化,但是,两个更新面板同时更新,为10秒.
两个更新面板都设置为updatemode ="Conditional",并告诉他们从客户端javascript回发.以下是上述示例的完整列表.
我在这里错过了什么?如何加载一个更新面板,然后另一个,让两个任务异步运行?
谢谢,
TM值
ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body onload="partialPostback();">
<script language="JavaScript" type="text/javascript">
function partialPostback() {
__doPostBack('UpdatePanel1', '');
__doPostBack('UpdatePanel2', '');
}
</script>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
5 sec:
<asp:UpdatePanel ID="UpdatePanel1" runat="server"
UpdateMode="Conditional" OnLoad="UpdatePanel1_Load">
<ContentTemplate>
<asp:Label ID="Label2" runat="server" Text="Label"/><br />
</ContentTemplate>
</asp:UpdatePanel><br />
10 sec:
<asp:UpdatePanel ID="UpdatePanel2" runat="server"
UpdateMode="Conditional" OnLoad="UpdatePanel2_Load"> …Run Code Online (Sandbox Code Playgroud) 我正在编写一个简单的shell脚本来更改网络硬件的mac地址.其中一条线是:
sudo ifconfig eth0 hw ether 00:99:99:00:00:00
Run Code Online (Sandbox Code Playgroud)
我的问题是sudo脚本提示输入密码.有没有办法,我可以这样做而不提示用户输入密码???
我只想要一个IIS 7.5重写规则将http://www.domain.com/url1重定向到http://www.domain.com/url2(同一个域).这可以通过以下方式实现:
<rule name="Redirect url" enabled="true" stopProcessing="true">
<match url="^url1" />
<action type="Redirect" url="http://www.domain.com/url2"
appendQueryString="false" redirectType="Permanent" />
</rule>
Run Code Online (Sandbox Code Playgroud)
但是,该网站会监听多个域,因此上述内容成为所有域的全局规则.如何将此特定于domain.com?尝试更改匹配URL并添加条件但无法使其工作.谢谢.
任何人都可以帮助我了解如何主题视图.
对于创建的每个视图,我想要有不同的模板.
我在我的web.config文件中创建了一个配置部分,其中包含所有重写规则,如下所示
<rewrite>
<outboundRules>
<rule name="OutboundRewriteCatalogURL" preCondition="ResponseIsHtml1">
<match filterByTags="A" pattern="^(.*/)Catalog\.aspx\?Catalog=([^=&]+)&(?:amp;)?Title=([^=&]+)$" />
<action type="Rewrite" value="{R:1}ctlg/{R:2}/{R:3}/" />
</rule>
<rule name="OutboundRewriteCategoryURL" preCondition="ResponseIsHtml1">
<match filterByTags="A" pattern="^(.*/)ProductList\.aspx\?Catalog=([^=&]+)&(?:amp;)?Category=([^=&]+)&(?:amp;)?Title=([^=&]+)$" />
<action type="Rewrite" value="{R:1}categ/{R:2}/{R:3}/{R:4}/" />
</rule>
<rule name="OutboundRewriteFullProductURL" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^(.*/)Product\.aspx\?Catalog=([^=&]+)&(?:amp;)?Category=([^=&]+)&(?:amp;)?Product=([^=&]+)&(?:amp;)?Title=([^=&]+)$" />
<action type="Rewrite" value="{R:1}prd/{R:2}-{R:3}-{R:4}/{R:5}/" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<rule name="RedirectCatalogURL" stopProcessing="true">
<match url="^Catalog\.aspx$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<add input="{QUERY_STRING}" pattern="^Catalog=([^=&]+)&Title=([^=&]+)$" />
</conditions>
<action type="Redirect" url="Catalog/{C:1}/{C:2}" appendQueryString="false" />
</rule>
<rule name="RewriteCatalogURL" stopProcessing="true">
<match url="^ctlg/([^/]+)/([^/]+)/?$" …Run Code Online (Sandbox Code Playgroud) 我正在解决一个问题,其中页面标题和图像没有包含在Facebook喜欢的内容中.点击OG调试器后,看起来og:facebook上没有任何元标记被访问:
这里的调试器的链接 -它说这是推断og:url和og:title其中存在的页面属性.
作为测试的问题,我直接从开发人员文档中的示例复制元标记和HTML模式,我仍然得到相同的警告.
这是生成的head标记的HTML和开头:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>123-ABC Butterfly Fun Carpet 3'10" x 5'5" Rectangle</title>
<meta name="description" content="Transactiv Products" />
<meta name="title" content="Transactiv" />
<meta property="fb:app_id" content="289501899130" />
<meta property="og:site_name" content="Transactiv InRecv" />
<meta property="og:url" content="http://localhost:2609/Pages/ProductSummary.aspx?OrganizationProductID=617c54a0-189a-48af-9b5e-002148210208&StoreID=a1d6bc99-9a6a-4e46-bdb4-790be4e59bd4&ProductID=d6748a89-41f4-48aa-a1c1-5c28f87cc47f&PageName=MHMTest&PageID=236549899706529" />
<meta property="og:title" content="123-ABC Butterfly Fun Carpet 3'10" x 5'5" Rectangle" />
<meta property="og:type" content="website" />
<meta property="og:description" content="" />
<meta property="og:image" content="http://transactivazureprod.blob.core.windows.net/pictureblob/831a4d4a-dbe3-44f5-9ff8-12286cdc33f5" />
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
asp.net ×2
c# ×2
facebook ×2
linux ×2
asp.net-ajax ×1
bash ×1
drupal ×1
drupal-6 ×1
drupal-views ×1
encoding ×1
grep ×1
httphandler ×1
iis-7 ×1
iis-7.5 ×1
opengraph ×1
redirect ×1
regex ×1
shell ×1
sql-server ×1
sudo ×1
updatepanel ×1
view ×1