半城柳色半声笛

文章 评论 浏览 26

半城柳色半声笛 2024-11-23 04:15:39

XPT是xpcom接口定义;自 Firefox 3.6 起,xpcom 插件不再在 Firefox 中运行。有关详细信息,请参阅 http:// /colonelpanic.net/2010/01/firefox-3-6-has-removed-support-for-xpcom-plugins/

XPI 文件是一个扩展,但它可能包含 npapi 插件作为扩展的一部分。如果我们假设您实际上没有使用 xpt 并且您的插件在 Firefox 3.6 中工作,那么您遇到的问题很可能是 Firefox 4 不再默认解压 XPI,并且插件无法使用它需要。请参阅https://developer.mozilla.org/En/Updating_extensions_for_Firefox_4.0#XPI_unpacking

但是,我更喜欢像 Dpp 建议的那样使用注册表进行安装。这就是 FireBreath 使用的方法。请参阅 https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-有关此方法的文档,请参见_Development_Overview#Installing_Plug-ins

XPT is the xpcom interface defintion; xpcom plugins no longer work in Firefox as of Firefox 3.6. For more information, see http://colonelpanic.net/2010/01/firefox-3-6-has-removed-support-for-xpcom-plugins/

A XPI file is an extension, but it may contain a npapi plugin as part of the extension. If we go with the assumption that you aren't actually using that xpt and your plugin worked in Firefox 3.6, most likely the issue you're having is that Firefox 4 no longer unpacks the XPI by default, and for a plugin to work it needs to. See https://developer.mozilla.org/En/Updating_extensions_for_Firefox_4.0#XPI_unpacking

However, I much prefer installing using the registry like Dpp suggested. That is the method that FireBreath uses. See https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-in_Development_Overview#Installing_Plug-ins for documentation on this method.

Firefox 4 上的 NPAPI 插件安装问题 .. 被识别为扩展

半城柳色半声笛 2024-11-23 02:20:04

几点建议:

  • 检查受executeUpdate()影响的行数
  • 您的事务策略是什么?定义了任何 TransactionManager 吗?

Few suggestions:

  • Check the number of rows affected by executeUpdate()
  • What is your Transaction policy? Any TransactionManager defined?

表有时不会通过 Hibernate 本机查询进行更新

半城柳色半声笛 2024-11-23 00:23:57

是的,至少从 Android 2.3.3 开始支持。但它非常不精确。 查看第二个示例

Yes, are supported, at least from Android 2.3.3. But it is heavily imprecise. Check the second example.

Android 手势、单笔划和多次冲程产生不一致的结果

半城柳色半声笛 2024-11-22 22:04:54

T 有多重要? 每个服务器每秒应统一生成 200/X 条消息。要生成时间表,请从 [0, 1) 上的均匀分布中抽取 200/X 个样本,并相应地对消息计时(每秒重复一次,或立即从 [0,T) 中抽取 200T/X 个样本)。

How is T important? Each server should generate 200/X messages per second, uniformly. To generate a schedule, draw 200/X samples from a uniform distribution on [0, 1) and time the messages accordingly (and repeat every second, or draw 200T/X samples from [0,T) right away).

PRNG均匀分布

半城柳色半声笛 2024-11-22 19:53:55

感谢您的大力帮助,我终于在上面代码的一些帮助下完成了。

function mailURL(url)
{
  var mailto_link = 'mailto:'+'?subject='+document.title+'&body='+escape(url);

        if(getBrowser()=='mozilla'){
            // Mozilla FireFox Mail To Friend
            // Opens a new tab but also opens up Microsoft Office window with URL
            window.open(mailto_link,'emailWindow'); 
        }
        else if(getBrowser()=='ie'){
            // IE Favourite
            window.open(mailto_link,'emailWindow');
        }
        else if(getBrowser()=='opera'){
            // Opera
            return true;
        }           
        else if (getBrowser()=='safari'){ // safari
            window.location.href=mailto_link;
            //alert('mail to safari');
        }
        else if(getBrowser()=='chrome'){
            window.location.href=mailto_link; 
            //alert('mail to chrome'); 
        }                       
  }

function getBrowser(){
        var userAgent = navigator.userAgent.toLowerCase();
        $.browser.chrome = /chrome/.test(userAgent);
        $.browser.safari= /webkit/.test(userAgent);
        $.browser.opera=/opera/.test(userAgent);
        $.browser.msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );
        $.browser.mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);

        if($.browser.chrome) return "chrome";
        if($.browser.mozilla) return "mozilla";
        if($.browser.opera) return "opera";
        if($.browser.safari) return "safari";
        if($.browser.msie) return "ie";

}

Thanks for great help I have done finally with some help from above code.

function mailURL(url)
{
  var mailto_link = 'mailto:'+'?subject='+document.title+'&body='+escape(url);

        if(getBrowser()=='mozilla'){
            // Mozilla FireFox Mail To Friend
            // Opens a new tab but also opens up Microsoft Office window with URL
            window.open(mailto_link,'emailWindow'); 
        }
        else if(getBrowser()=='ie'){
            // IE Favourite
            window.open(mailto_link,'emailWindow');
        }
        else if(getBrowser()=='opera'){
            // Opera
            return true;
        }           
        else if (getBrowser()=='safari'){ // safari
            window.location.href=mailto_link;
            //alert('mail to safari');
        }
        else if(getBrowser()=='chrome'){
            window.location.href=mailto_link; 
            //alert('mail to chrome'); 
        }                       
  }

function getBrowser(){
        var userAgent = navigator.userAgent.toLowerCase();
        $.browser.chrome = /chrome/.test(userAgent);
        $.browser.safari= /webkit/.test(userAgent);
        $.browser.opera=/opera/.test(userAgent);
        $.browser.msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );
        $.browser.mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);

        if($.browser.chrome) return "chrome";
        if($.browser.mozilla) return "mozilla";
        if($.browser.opera) return "opera";
        if($.browser.safari) return "safari";
        if($.browser.msie) return "ie";

}

Webkit 浏览器(Chrome 和 Safari)不喜欢 mailto?

半城柳色半声笛 2024-11-22 19:15:38

我没有太多 IVR 经验,但以下是它在我工作的一个系统(使用 VXML)上的工作原理。

IVR 应答了呼叫。这导致 IVR 语音浏览器向 Web 服务器发出 HTTP 请求。

Web 服务器收到请求以及端口号,以识别唯一的呼叫者。就我而言,我们使用输出 VMXL(而不是 HTML 或 XHTML)的标准 ASPX 页面,因此所有处理都必须在 Page_Load 方法中完成。如果页面需要有关呼叫的其他信息(例如呼叫者号码),我们将向 IVR 发出 Web 服务呼叫,包括端口号。

所有与 IVR 的用户交互(按下按钮等)均在 IVR 上处理,并且 Web 服务器仅在请求不同的 VXML 文档时才会参与。

I don't have a lot of IVR experience, but here's how it worked on one system I worked on (which used VXML).

The call was answered by the IVR. This caused the IVR Voice Browser to issue an HTTP request to the web server.

The web server received the request, along with a port number, to identify the unique caller. In my case, we were using standard ASPX pages that output VMXL (rather than HTML or XHTML), so all processing had to be done in the Page_Load method. If the page needed additional information about the call, for example the callers number, we would issue a web services call to the IVR, including the port number.

All of the user interaction with the IVR - button presses, etc - were handled on the IVR, and the web server would only get involved when a different VXML document was requested.

在 IVR 系统的 apsx 页面中打开/关闭数据库连接

半城柳色半声笛 2024-11-22 18:09:03

据我所知( http://www.modrails.com/documentation/ Users%20guide%20Standalone.html ) “Passenger Standalone”本身就是一个网络服务器。

与 Apache 的 Phusion Passenger 和 Nginx 的 Phusion Passenger 不同,Phusion Passenger Standalone 不需要外部 Web 服务器,它是自己的,因此非常容易上手。

As far as I can read ( http://www.modrails.com/documentation/Users%20guide%20Standalone.html ) "Passenger Standalone" is itself a webserver.

Unlike Phusion Passenger for Apache and Phusion Passenger for Nginx, Phusion Passenger Standalone does not require an external web server, it is its own and therefore extremely easy to get started.

Passenger Standalone,不需要HTTP Server?

半城柳色半声笛 2024-11-22 15:39:44

有时,尽管您在 AndroidManifest 中添加 并且拥有 WiFi 连接,但仍可能引发此异常。就我而言,我关闭了 WiFi,然后再次打开。这解决了错误。奇怪的解决方案,但有时它有效。

Sometimes, although you add <uses-permission android:name="android.permission.INTERNET" /> in the AndroidManifest and you have a WiFi connection, this exception can be thrown. In my case, I have turned off WiFi and then turned it on again. This resolved the error. Weird solution, but sometimes it works.

无法解析主机“”没有与主机名关联的地址

半城柳色半声笛 2024-11-22 09:20:58
window.onload = function(){
    var text = '<a href="http://stackoverflow.com" target="_blank">StackOverFlow</a>';
    var parser = null;
    if (window.DOMParser){
        parser = new DOMParser();
        xmlDoc = parser.parseFromString(text,"text/xml");
    } else{ // Internet Explorer
        xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async="false";
        xmlDoc.loadXML(text); 
    }
    var a = xmlDoc.childNodes[0];
    alert(a.childNodes[0].nodeValue);
}

http://www.w3schools.com/dom/dom_parser.asp

window.onload = function(){
    var text = '<a href="http://stackoverflow.com" target="_blank">StackOverFlow</a>';
    var parser = null;
    if (window.DOMParser){
        parser = new DOMParser();
        xmlDoc = parser.parseFromString(text,"text/xml");
    } else{ // Internet Explorer
        xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async="false";
        xmlDoc.loadXML(text); 
    }
    var a = xmlDoc.childNodes[0];
    alert(a.childNodes[0].nodeValue);
}

http://www.w3schools.com/dom/dom_parser.asp

如何从 JavaScript 中的链接中提取文本?

半城柳色半声笛 2024-11-22 08:52:57

GM.setValue 将无限期地设置一个值,并且作用范围为脚本,但如果您的脚本跨多个域运行,则该脚本将起作用。

window.localStorage将无限期地设置一个值,并且范围仅限于页面的域,因此不能跨域工作,但如果您需要多个 GreaseMonkey 脚本来访问相同的值,则可以工作。

window.sessionStorage仅当窗口或选项卡打开时才设置一个值,并且范围仅限于该域的该窗口或选项卡。

document.cookie可以无限期地或仅在浏览器打开时设置值,并且范围可以跨子域、单个域、路径或单个页面。

这些是用于跨页面加载存储值的主要客户端机制,旨在实现此目的。然而,还有另一种方法有时是可行的(如果页面本身没有使用它),并且也非常有用; 窗口名称

window.name 的范围仅限于窗口或选项卡,但也可以跨域工作。如果您需要存储多个值,那么可以将它们放入一个对象中,然后您可以存储该对象的 JSON 字符串。例如window.name = JSON.stringify(obj)

GM.setValue will set a value indefinitely and is scoped to the script, but will work if your script runs across multiple domains.

window.localStorage will set a value indefinitely and is scoped to the domain of the page, so will not work across domains, but will work if you need several GreaseMonkey scripts to access the same value.

window.sessionStorage will set a value only while the window or tab is open and is scoped to only that window or tab for that domain.

document.cookie can set a value indefinitely or only while the browser is open, and can be scoped across subdomains, or a single domain, or a path, or a single page.

Those are the main client-side mechanisms for storing values across page loads that are intended for this purpose. However, there is another method which is sometimes possible (if the page itself is not using it), and can also be quite useful; window.name.

window.name is scoped to the window or tab, but will work across domains too. If you need to store several values, then they can be put into an object and you can store the object's JSON string. E.g. window.name = JSON.stringify(obj)

页面重新加载时如何使用 Greasemonkey 脚本记住变量

半城柳色半声笛 2024-11-22 04:40:43

您需要按顺序使用 Graphics 类写在位图上。

具体来说,是 DrawString 方法之一。

Bitmap a = new Bitmap(@"path\picture.bmp");

using(Graphics g = Graphics.FromImage(a))
{
  g.DrawString(....); // requires font, brush etc
}

pictuteBox1.Image = a;

You need to use the Graphics class in order to write on the bitmap.

Specifically, one of the DrawString methods.

Bitmap a = new Bitmap(@"path\picture.bmp");

using(Graphics g = Graphics.FromImage(a))
{
  g.DrawString(....); // requires font, brush etc
}

pictuteBox1.Image = a;

在位图上写入文本

半城柳色半声笛 2024-11-22 00:52:29

不能不回答这个问题...因为Python != Django

Django是一个框架,并且它没有自带Python,所以netbeans默认不支持Django模板语法,这是正常的。

Can't leave this unanswered... Because Python != Django

Django is a framework, and it does not comes with python, so netbeans doesn't supports Django template syntax by default, this is normal.

为什么 NetBeans 不识别 Django 语法?

半城柳色半声笛 2024-11-21 21:13:26

以下函数适用于您的特定示例。有些事情它不会考虑,所以如果您希望它适用于其他情况,请告诉我,我可以更新。

function res = mergeStructs(x,y)
if isstruct(x) && isstruct(y)
    res = x;
    names = fieldnames(y);
    for fnum = 1:numel(names)
        if isfield(x,names{fnum})
            res.(names{fnum}) = mergeStructs(x.(names{fnum}),y.(names{fnum}));
        else
            res.(names{fnum}) = y.(names{fnum});
        end
    end
else
    res = y;
end

然后 res = mergeStructs(x,y); 给出:

>> res.a
ans =
     4

>> res.b
ans = 
    c: 2
    d: 3

根据您的要求。

编辑:我将 isstruct(x) && 添加到第一行。旧版本工作正常,因为如果 ~isstruct(x)isfield(x,n) 返回 0,但新版本如果y 是一个大结构体,~isstruct(x)

The following function works for your particular example. There will be things it doesn't consider, so let me know if there are other cases you want it to work for and I can update.

function res = mergeStructs(x,y)
if isstruct(x) && isstruct(y)
    res = x;
    names = fieldnames(y);
    for fnum = 1:numel(names)
        if isfield(x,names{fnum})
            res.(names{fnum}) = mergeStructs(x.(names{fnum}),y.(names{fnum}));
        else
            res.(names{fnum}) = y.(names{fnum});
        end
    end
else
    res = y;
end

Then res = mergeStructs(x,y); gives:

>> res.a
ans =
     4

>> res.b
ans = 
    c: 2
    d: 3

as you require.

EDIT: I added isstruct(x) && to the first line. The old version worked fine because isfield(x,n) returns 0 if ~isstruct(x), but the new version is slightly faster if y is a big struct and ~isstruct(x).

Matlab 结构体的递归串联

半城柳色半声笛 2024-11-21 20:35:04

好吧,怎么样:(

SELECT url 
  FROM table 
 WHERE INSTR('http://www.longurl.com/some/string', url) > 0

评论中格式不太好,所以我再次添加它作为答案。)

Okay, what about:

SELECT url 
  FROM table 
 WHERE INSTR('http://www.longurl.com/some/string', url) > 0

(Formatting didn't work so well in the comments, so I added it again as an answer.)

比较 MySQL 中的两个字符串

半城柳色半声笛 2024-11-21 20:27:05

如果你有这样的东西:

<input type="checkbox" name="options[]" value="option1">option1
<input type="checkbox" name="options[]" value="option2">option2
<input type="checkbox" name="options[]" value="option3">option3

在 php 中,$_POST["options"] 将是所选选项的数组,

foreach($_POST['options'] as $opt) {
  echo "selected option: $opt <br />";
}

你也可以使用 array_flip(),所以该数组键是选项值...

If you have something like this:

<input type="checkbox" name="options[]" value="option1">option1
<input type="checkbox" name="options[]" value="option2">option2
<input type="checkbox" name="options[]" value="option3">option3

in php, $_POST["options"] will be an array of the selected options

foreach($_POST['options'] as $opt) {
  echo "selected option: $opt <br />";
}

you could also use array_flip(), so the array keys are the option values...

检查已选择的复选框

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文