我下载了JDK8 build b121,在尝试安装时遇到以下错误:
the procedure entry point RegDeleteKeyExA could not be located in the dynamic link library ADVAPI32.dll
操作系统是Windows XP,版本2002 Service Pack 3,32位.
按照本教程,我一直在尝试这个简单的谷歌登录:
代码非常简单,我正在按照这些教程中给出的相同步骤进行操作,但最终出现了以下错误.
400. That’s an error.
Error: invalid_request
Storagerelay URI is not allowed for 'NATIVE' client type
Run Code Online (Sandbox Code Playgroud)
在我的凭据中,我有如下配置:
我的代码如下:
<meta name="google-signin-client_id" content="377345478968-2opk94iompa38gja0stu1vi821lr3rt0.apps.googleusercontent.com">
<script src="https://apis.google.com/js/client:platform.js?onload=renderButton" async defer></script>
<div id="gSignIn"></div>
function onSuccess(googleUser) {
var profile = googleUser.getBasicProfile();
gapi.client.load('plus', 'v2', function () {
var request = gapi.client.plus.people.get({
'userId': 'me'
});
//Display the user details
request.execute(function (resp) {
console.log(resp);
});
});
}
function onFailure(error) {
alert(error);
}
function renderButton() {
gapi.signin2.render('gSignIn', {
'scope': 'profile email',
'width': 240,
'height': 50,
'longtitle': true,
'theme': …Run Code Online (Sandbox Code Playgroud) 我正在附加每个片段的片段(许多片段FrameLayout)Activity有自己的视图膨胀onCreateView().
现在,
如果我旋转屏幕Landscape/Protrait,onCreateView()则调用片段而不是调用其附加的Activity的onCreate()方法.因此,视图呈现两次.
我希望onCreate()每次有配置更改时都调用Activity .可能吗?
活动: MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
getSupportFragmentManager().beginTransaction()
.add(R.id.layout_replace, new MyFragment()).commit();
}
Run Code Online (Sandbox Code Playgroud)
片段: MyFragment.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return (ScrollView)inflater.inflate(R.layout.some_layout, container, false);
}
Run Code Online (Sandbox Code Playgroud) main.xml中
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/spin"
android:entries="@array/num"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn"
android:text="Click ME"
android:gravity="center"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/txtv"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
Spin.java
package com.and.spin;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
public class spin extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final TextView tv=(TextView)findViewById(R.id.txtv);
Button b=(Button)findViewById(R.id.btn);
final Spinner s=(Spinner)findViewById(R.id.spin);
b.setOnClickListener(new OnClickListener() …Run Code Online (Sandbox Code Playgroud) 我在MVC(ASP.NET)项目中使用Kendo ui Grid,我想根据来自数据库的数据更改网格列标题(标题),并更改javascript中的字段值.我有以下代码绑定kendo ui网格.
detailRow.find("#childGrid").kendoGrid({
dataSource: partDataSource,
scrollable: false,
sortable: true,
pageable:
{
input: true,
numeric: false
},
columns: [{
field: "UnitNumber",
title: "Unit Number",
},
{
field: "SampleNumber",
title: "Sample Number",
},
{
field: "TotalMiles",
title: "TestFrequency",
},
{
field: "IsTestCompletedByDriver",
title: "Part Complete",
template: "#if( IsPartCompleteApprove==true){#<a href='javascript:return(void)' style='float: left; font-size: 17px;' class='app-btn'>Approved</a>#} else if( IsTestCompletedByDriver==false || MarkTesterComplete==true) {#<input type=\"checkbox\" name='IsTestCompletedByDriver' #= IsTestCompletedByDriver? 'checked' : '' # disabled /># } else {#<span><input class='k-button k-button-icontext k-grid-AddFeedback' type='button' onclick=ApprovePartcomplete('#:TRPartUnitId#','approve'); value='Approve'/> <input …Run Code Online (Sandbox Code Playgroud) Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
并使用此方法
moveTaskToBack(true);
Run Code Online (Sandbox Code Playgroud)
我正在开发一个应用程序,在我需要退出它的最后一个活动中,我使用了退出应用程序的上述方法,问题是它是否存在,只有活动和应用程序在后台运行(在任务管理器中看到).每当我再次加载应用程序时,它都从我退出它的位置开始(最后一个活动).
是否有任何代码完全退出它并删除表单背景(任务管理器).
提前致谢.
这是我试过的代码:
import java.io.*;
public class file03 {
public static void main(String[] args) {
File f1 = new File("C:/tempo1/tempo");
f1.mkdirs();
File f2 = new File("C:/test");
if(!f2.exists()) {
f2.mkdir();
}
f1 = new File("C:/tempo1/kempo");
f1.mkdirs();
f1 = new File("C:/tempo1");
String[] t = {};
if(f1.exists()) {
t = f1.list();
System.out.println(t.length + " files found");
}
for(int i = 0; i < t.length; i++) {
System.out.println(t[i]);
}
try {
Thread.sleep(3000);
}
catch(Exception e) {}
f2.delete();
f2 = new File("C:/tempo1/test.txt");
try {
f2.createNewFile();
}
catch(Exception …Run Code Online (Sandbox Code Playgroud) 在我的代码中有两个弹出窗口.首先是登录,第二次是重置密码.第二个弹出窗口的链接位于登录弹出窗口内.当我点击链接忘记密码时,我想自动关闭登录弹出窗口.
<a href="#" data-toggle="modal" data-target=".loginform">Login</a>
<!- Login Popup start-->
<div id="login" class="modal fade loginform" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
....
<label>
<input type="checkbox"><span style="font-size:12px;display:block;">Remember me</span>
</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<a data-toggle="modal" data-target=".forgotpassword" href="#" style="float:left;font-size:14px;">Forgot Password</a>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Login</button>
</div>
</div>
<!-- /.modal-content -->
</div>
</div>
<!- popuplogin end-->
<!- Popup forgot password start-->
<div id="forgot" class="modal fade forgotpassword" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
.......
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" …Run Code Online (Sandbox Code Playgroud) 我需要复制一些输入字段以处理来自客户端的数据.我用jQuery http://jsfiddle.net/m7R3f/1/完成了它
HTML:
<fieldset id="fields-list">
<div class="pure-g entry">
<div class="pure-u-1-5">
<input type="text" class="pure-input-1" id="input-1" name="input-1">
</div>
<div class="pure-u-1-5">
<input type="text" class="pure-input-1" id="date" name="date">
</div>
<div class="pure-u-1-5">
<input type="text" class="pure-input-1" id="input-2" name="input-2">
</div>
</fieldset>
<button id="add">Add</button>
Run Code Online (Sandbox Code Playgroud)
JS
$(document).ready(function ()
{
$("#add").click(function ()
{
$(".entry:first").clone(false).appendTo("#fields-list");
});
});
Run Code Online (Sandbox Code Playgroud)
但是我刚开始学习Angular,并希望将这些代码转换为Angular.我已经在stackoverflow中阅读了问题,并在这里找到了带有angularjs的代码:http://jsfiddle.net/roychoo/ADukg/1042/.但是,它似乎仅适用于一个输入字段?我可以使用AngularJS克隆/复制几个输入字段吗?(换句话说:将上面的代码转换为AngularJS版本?)非常感谢.
我的要求就像我需要替换文本框中的非字母字符我只有当用户在文本框中输入时才能实现它,但是如果用户复制粘贴一些像这样的值
"asd5653tYgh45Ghgs34gthth65TGhd"
值不会按预期替换.这里65没有被替换,要替换它我需要再次进行keyup或keypress,之后只更换值.我附上了jsfiddle链接供您参考.
码:
HTML:
Name :<input type='text' id='txtName' />
Run Code Online (Sandbox Code Playgroud)
jQuery的:
$("#txtName").on('keyup keypress',function(){
var pattern = /^[a-zA-Z]+$/;
var txtval = $("#txtName").val();
if(!pattern.test(txtval)){
$(this).val($(this).val().replace(/[^a-zA-Z]+/,''))
}
});
Run Code Online (Sandbox Code Playgroud)
链接:
我有一个JQuery脚本验证了头像图像的上传,但我需要它来防止上传PNG,JPG和GIF图像以外的任何内容.有没有在我的代码中实现这个的方法?这是代码:
$('#addButton').click(function () {
var avatar = $("#avatarupload").val();
if(avatar.length < 1) {
avatarok = 0;
}
//ELSE IF FILE TYPE
else {
avatarok = 1;
}
if(avatarok == 1) {
$('.formValidation').addClass("sending");
$("#form").submit();
}
else {
$('.formValidation').addClass("validationError");
}
return false;
});
Run Code Online (Sandbox Code Playgroud) 嗨,我正在尝试通过xml 更改切换按钮的文本颜色.
我已经引用了链接,但它只更改了切换按钮的背景颜色,而不是其文本.
我试过这种方法:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="#ffffff" />
<item android:state_checked="false" android:color="#000000" />
</selector>
Run Code Online (Sandbox Code Playgroud)
但只有背景在变化.
注意:我不想在代码中执行此操作,因为有21个切换按钮,并且每个按钮的设置监听器都不好.
android toggle togglebutton android-button android-togglebutton
我已创建2 Div,当我点击Parent Div时,1 Div隐藏并可见.这些Div是在一个php foreach循环中,所以可以有很多Div .
我编写了以下代码,它仅适用于第一个结果,并且不影响其余结果.
请检查并指导我.
谢谢
<script>
$(document).ready(function (e) {
$('#course_details').hide();
if ($('#course_details').hide()) {
$('#expand').click(function () {
$('#course_details').show();
});
} else {
$('#expand').click(function () {
$('#course_details').hide();
});
}
});
</script>
Run Code Online (Sandbox Code Playgroud)
PHP
foreach ($past_course as $course_records)
{
$course_name= $course_records->CourseName;
$AssignmentMarks= $course_records->AssignmentMarks;
$QuizMarks= $course_records->QuizMarks;
<div id="expand">
<h3><?php echo $course_name ?> </h3>
</div>
<div id="course_details" >
<table border="1">
<tr>
<th>
Assignment Marks
</th>
<td>
<?php echo $AssignmentMarks; ?>
</td>
</tr>
<tr>
<th>
Quiz Marks
</th>
<td>
<?php …Run Code Online (Sandbox Code Playgroud) javascript ×6
jquery ×6
android ×4
html ×3
java ×2
angularjs ×1
asp.net-mvc ×1
bluej ×1
directory ×1
dll ×1
file ×1
file-io ×1
file-upload ×1
java-8 ×1
php ×1
toggle ×1
togglebutton ×1
upload ×1
windows-xp ×1