我有脚本打开对话框polyfill:
window.modalDialog = function (url, arg, opt) {
url = url || ''; //URL of a dialog
arg = arg || null; //arguments to a dialog
opt = opt || 'dialogWidth:300px;dialogHeight:200px'; //options: dialogTop;dialogLeft;dialogWidth;dialogHeight or CSS styles
var caller = modalDialog.caller.toString();
var dialog = document.body.appendChild(document.createElement('dialog'));
var splitter = opt.split(",");
dialog.setAttribute('style', splitter[0].replace(/dialog/gi, ''));
dialog.innerHTML = '<a href="#" id="dialog-close">×</a><iframe id="dialog-body" src="' + url + '" style="border: 0; width: 100%; height: 100%;"></iframe>';
document.getElementById('dialog-body').contentWindow.dialogArguments = arg;
document.getElementById('dialog-close').addEventListener('click', function (e) {
e.preventDefault();
dialog.close();
});
dialog = …Run Code Online (Sandbox Code Playgroud) 我有一个泛型类和一个派生类如下.
public class GenericClass<T> { ... }
public class DerivedClass : GenericClass<SomeType> { ... }
Run Code Online (Sandbox Code Playgroud)
如何通过反射找到派生类?我在下面尝试了两种方法,但似乎没有用.
System.Reflection.Assembly.GetExecutingAssembly().GetTypes().Where(t => typeof(GenericClass<>).IsAssignableFrom(t));
System.Reflection.Assembly.GetExecutingAssembly().GetTypes().Where(t => t.IsSubclassOf(typeof(GenericClass<>));
Run Code Online (Sandbox Code Playgroud) 我需要将自定义对话框设置为透明.
示例代码:
Dialog dialog;
@Override
protected Dialog onCreateDialog(int id)
{
switch(id)
{
case 1:
AlertDialog.Builder builder = null;
Context mContext = this;
LayoutInflater inflater = ( LayoutInflater ) mContext.getSystemService( LAYOUT_INFLATER_SERVICE );
View layout = inflater.inflate( R.layout.about_page, ( ViewGroup ) findViewById( R.id.about_Root ) );
builder = new AlertDialog.Builder( mContext );
builder.setView( layout );
dialog = builder.create();
break;
}
return dialog;
}
Run Code Online (Sandbox Code Playgroud)
如何设置透明对话框.
我的XML代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/about_Root"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/alert_page_border"
android:orientation="vertical" >
<TextView
android:id="@+id/about_Title"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:gravity="center"
android:layout_weight="1"
android:textSize="25dip" …Run Code Online (Sandbox Code Playgroud) 所以我有一个小的标题图像在x轴上重复,但由于某种原因它不会出现在IE8中.有人知道一个工作吗?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content='' name='description' />
<meta content='' name='keywords' />
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<title>Book Site</title>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="title">
<span class="maintitle">Site Title Goes Here</span>
<br />
<span class="subtitle">Transitional Justice, Post-Conflict Reconstruction & Reconciliation in Rwanda and Beyond
Phil Clark and Zachary D. Kaufman, editors</span>
</div>
<img class="thebook" src="images/thebook.png" />
<span class="bookblurb">
<span class="bookbuy">Buy the book</span>
get it online …Run Code Online (Sandbox Code Playgroud) 我有使用<p:steps>以下标签的primefaces步骤:
<p:steps activeIndex="3" styleClass="custom" readonly="false" style="padding: 20px;">
<p:menuitem value="step 1." actionListener="#{masterController.menuSales(preferencesController)}" update="mainPanel"/>
<p:menuitem value="step 2." actionListener="#{masterController.menuCustomer(preferencesController)}" update="mainPanel"/>
<p:menuitem value="step 3." actionListener="#{masterController.menuItem(preferencesController)}" update="mainPanel"/>
<p:menuitem value="step 4"/>
</p:steps>
Run Code Online (Sandbox Code Playgroud)
结果是这样的:
我可以单击步骤1而不是步骤3和4.如何为所有步骤启用单击?
我在使用cbind将列添加到数据框的脚本时遇到了一些麻烦.我通过正则表达式选择这些列,我喜欢cbind自动提供前缀,如果你添加多个列.如果您只追加一列,这就不起作用......即使我将此列作为数据框投射......
有办法绕过这种行为吗?
在我的示例中,它适用于以a开头而不是b1列的列.
df <- data.frame(a1=c(1,2,3),a2=c(3,4,5),b1=c(6,7,8))
cbind(df, log=log(df[grep('^a', names(df))]))
cbind(df, log=log(df[grep('^b', names(df))]))
cbind(df, log=as.data.frame(log(df[grep('^b', names(df))])))
Run Code Online (Sandbox Code Playgroud) 在syncdb为模型创建表之后,有没有办法运行一些自定义SQL语句?具体来说,我想创建一些数据库视图.
我有两个javascript数组,我需要比较它们.例如,假设我有这两个数组:
var array1 = ["1", "2", "3", "4"];
var array2 = ["4", "1", "3", "2"];
Run Code Online (Sandbox Code Playgroud)
这些数组实际上是相同的,我希望得到true比较的结果.这样做的最好和最快的方法是什么?
当应用程序在模拟器上运行时,我有以下执行问题:
dyld: Library not loaded: /System/Library/Frameworks/Social.framework/Social
Referenced from: /Users/Development1/Library/Application Support/iPhoneSimulator/4.3.2/Applications/730C5B6A-130C-471D-B8C8-CE119B06ACF5/Emisora Atlantico.app/Emisora Atlantico
Reason: image not found
Run Code Online (Sandbox Code Playgroud)
有谁知道如何修理它?
I am confusing that if the following method are same? Are there any subtle differences?
Your advice are very appreciated.
method 1
public static double sumOfList(List<?> list) {}
Run Code Online (Sandbox Code Playgroud)
method 2
public static <T> double sumOfList(List<T> list) {}
Run Code Online (Sandbox Code Playgroud) dialog ×2
javascript ×2
android ×1
arrays ×1
c# ×1
comparison ×1
css ×1
django ×1
dyld ×1
execution ×1
generics ×1
html ×1
java ×1
jsf ×1
modal-dialog ×1
primefaces ×1
r ×1
reflection ×1
xcode ×1