问题列表 - 第22326页

页面重定向

我正在编写一个脚本,我想要它(现在)根据他们按下的按钮重定向用户.最终它将采取表单输入并将其合并到重定向中,但是现在我只是试图让按钮将用户发送到适当的站点.但是,我的重定向不起作用.

<html>
<head>
<title>
Home
</title>
</head>

<body>

<script type="text/javascript">
<!--

var textstring;
var btnWhichButton;

//Gets the text from the form
function getQ() {
    textstring = document.forms['Search'].elements[0].value;
}

//Does a Google Search
function googleSearch() {
    window.location ="http://www.google.com";
}

//Does a YouTube Search
function youtubeSearch() {
    window.location = "http://youtube.com"; 
}

//Figure out which button was pressed
function whichButton() {
    if (btnWhichButton.value == 'Google Search' ) {
        googleSearch();
    } else if (btnWhichButton.value == 'YouTube Search' ){
        youtubeSearch();
    } 
}

//main function to …
Run Code Online (Sandbox Code Playgroud)

html javascript webforms

5
推荐指数
1
解决办法
374
查看次数

从与条件匹配的iterable中获取第一个项目

我想从符合条件的列表中获取第一项.重要的是,生成的方法不会处理整个列表,这可能非常大.例如,以下功能就足够了:

def first(the_iterable, condition = lambda x: True):
    for i in the_iterable:
        if condition(i):
            return i
Run Code Online (Sandbox Code Playgroud)

这个函数可以用这样的东西:

>>> first(range(10))
0
>>> first(range(10), lambda i: i > 3)
4
Run Code Online (Sandbox Code Playgroud)

但是,我想不出一个好的内置/单线来让我这样做.如果我不需要,我不特别想复制这个功能.是否有内置方法可以使第一个项目符合条件?

python iterator

264
推荐指数
11
解决办法
15万
查看次数

7
推荐指数
1
解决办法
198
查看次数

以编程方式将用户角色添加到COM +组件(C#)

我希望知道使用C#以编程方式将COM("Machine_Name"\ IIS_IUSRS)添加到COM +组件中的用户角色的方法.因此,无论何时安装我的COM +组件,都会在Role下创建ASP.NET用户.

c# asp.net security dll com+

2
推荐指数
1
解决办法
2285
查看次数

55
推荐指数
8
解决办法
8万
查看次数

如何使用mod_rewrite始终从URL中删除WWW?

我正在使用以下内容尝试从网址中删除WWW:

RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) http://example.com$1 [R=301]
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,它不起作用.有什么建议?

apache mod-rewrite

15
推荐指数
4
解决办法
2万
查看次数

android textview settext显示nullpointer异常

<TextView
android:id="@+id/first_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/black"
android:textColor="@color/light_grey"
android:text="FirstName"
></TextView>

TextView first_text_view;

first_text_view = (TextView)this.findViewById(R.id.first_name);
try {
first_text_view.setText("Android");
}catch(Exception e) {
}
Run Code Online (Sandbox Code Playgroud)

我得到了nullpointer异常.

什么是解决方案.请回复我

android textview

5
推荐指数
1
解决办法
7594
查看次数

退出前如何保存应用程序选项?

我已经创建了一个应用程序,我需要在退出之前保存一些选项.(类似于窗口维度,......,将写入文件中.)

主框架设置如下:

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Run Code Online (Sandbox Code Playgroud)

如何保存我感兴趣的选项?(在退出之前)

谢谢!

java processing swing desktop-application

20
推荐指数
2
解决办法
3万
查看次数

Visual C++程序问题 - 无法找到Debug CRT

我有一个朋友正在接管我的Visual C++项目并且无法运行它.它是一个图形应用程序,它使用Qt GUI库.我提到这个的原因是因为下面的错误.

他可以使用Visual Studio 2010构建和链接程序,但是当他运行它时,此消息会出现在事件查看器中:

"D:\ Test\Qt\4.2.2\bin\QtGuid4.dll"的激活上下文生成失败.相关大会Microsoft.VC80.DebugCRT,ProcessorArchitecture用于= "86",公钥= "1fc8b3b9a1e18e3b",键入= "win32的" 版本= "8.0.50608.0" 无法被发现.请使用sxstrace.exe进行详细诊断.

当我们按照消息要求并运行sxstrace.exe时,我们看到的是:

开始激活上下文生成.输入参数:标志= 0 ProcessorArchitecture用于= WOW32 CultureFallBacks = EN-US; EN ManifestPath = d:\测试\的Qt\4.2.2\BIN\QtGuid4.dll AssemblyDirectory = d:\测试\的Qt\4.2.2\BIN \

---------------信息:解析清单文件D:\ Test\Qt\4.2.2\bin\QtGuid4.dll.信息:清单定义标识是(null).INFO:参考:Microsoft.VC80.DebugCRT,ProcessorArchitecture用于= "86" 类型= "Win32的",版本= "8.0.50608.0" INFO:解决参考Microsoft.VC80.DebugCRT,ProcessorArchitecture用于= "86" "的win32",版本=" 8.0.50608.0" .信息:解决ProcessorArchitecture WOW64的参考.信息:解决文化中立的参考.信息:应用绑定策略.信息:未找到发布者政策.信息:找不到绑定策略重定向.信息:开始装配探测.信息:没有在WinSxS中找到程序集.INFO:尝试在C到探测清单:\ WINDOWS \装配\ GAC_32\Microsoft.VC80.DebugCRT\8.0.50608.0__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL.信息:没有找到文化中立的清单.信息:结束装配探测.信息:解析ProcessorArchitecture x86的参考.信息:解决文化中立的参考.信息:应用绑定策略.信息:未找到发布者政策.信息:找不到绑定策略重定向.信息:开始装配探测.信息:没有在WinSxS中找到程序集.信息:尝试在C:\ Windows\assembly\GAC_32\Microsoft.VC80.DebugCRT\8.0.50608.0__1fc8b3b9a1e18e3b\Microsoft.VC80.DebugCRT.DLL中探测清单.信息:尝试在D:\ Test\Qt\4.2.2\bin\Microsoft.VC80.DebugCRT.DLL中探测清单.信息:尝试在D:\ Test\Qt\4.2.2\bin\Microsoft.VC80.DebugCRT.MANIFEST中探测清单.信息:尝试在D:\ Test\Qt\4.2.2\bin\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.DLL中探测清单.信息:尝试在D:\ Test\Qt\4.2.2\bin\Microsoft.VC80.DebugCRT\Microsoft.VC80.DebugCRT.MANIFEST中探测清单.信息:没有找到文化中立的清单.信息:结束装配探测.错误:无法解析引用Microsoft.VC80.DebugCRT,processorArchitecture ="x86",publicKeyToken ="1fc8b3b9a1e18e3b",type ="win32",version ="8.0.50608.0".

对不起该消息的长度,但我认为它可能会慢慢记忆.这是他没有Visual C++ 2005(我相信VC80来自哪里)C运行时库的情况吗?如果是这样,他可以下载VC++再分发包并安装它,那么一切顺利吗?或者这是一个完全不同的问题?

c++ msvcrt visual-c++

5
推荐指数
1
解决办法
1万
查看次数

编译C++代码时出错?

这是我的test.cpp:

#include <iostream.h>
class C {
public:
C();
~C();
};

int main()
{
C obj;
return 0;
}
Run Code Online (Sandbox Code Playgroud)

当我使用该命令编译它时g++ test.cpp,我收到此错误消息:

    In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iostream.h:31,
                     from test.cpp:1:
    /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the  header for the  header for C++ includes, or  instead of the deprecated header . To disable …

c++ gcc compiler-errors g++

0
推荐指数
3
解决办法
2043
查看次数