我的aspx页面中有一个iframe.代码是:
<iframe style="height: 513px; width: 1071px" id="iframe1" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="paymentprocess.aspx"></iframe>
Run Code Online (Sandbox Code Playgroud)
沙箱属性是停止iframe页面占用整个窗口所必需的.付款后,由于自动重定向,响应页面在iframe中加载.我想通过javascript更改iframe的属性,以便整个窗口显示响应页面.我在javascript控制台中收到错误消息.
尝试导航顶层窗口的框架是沙箱,但未设置"允许顶部导航"标志.
我正在使用此代码:
if (top != self) {
top.location = self.location;
}
Run Code Online (Sandbox Code Playgroud)
但这是在控制台中抛出上述错误.
请有人帮助我如何从子页面更改父窗口的iframe属性(在本例中为确认页面)
我正在尝试将SQL查询实现为"如果存在其他INSERT则更新"
我的表(Allowance)如下:
EmployeeID int(8) PK
Year year(4) PK
Month int(2) PK
OverTime decimal(10,2)
Medical decimal(10,2)
Lunch decimal(10,2)
Bonus decimal(10,2)
Allowance decimal(10,2)
Run Code Online (Sandbox Code Playgroud)
下面是我试过的SQL查询:
IF EXISTS (SELECT * FROM Allowance WHERE EmployeeID =10000001 and Year = 2014 and Month = 4)
UPDATE Allowance
SET OverTime = 10.00, Medical = 10.00, Lunch = 10.45, Bonus =10.10, Allowance = 40.55
WHERE EmployeeID =10000001 and Year = 2014 and Month = 4
ELSE
INSERT into Allowance values (10000001,2014,4,10.00,10.00,10.45,10.10,40.55)
Run Code Online (Sandbox Code Playgroud)
我一直收到此错误消息:
"#1064 - 您的SQL语法有错误;请查看与您的MySQL服务器版本对应的手册,以便在'IF EXISTS(SELECT*FROM …
我使用的是 uwsgi 版本 2.0.8,它的配置如下:
/home/user/env/bin/uwsgi
--chdir=/home/user/code
--module=XXXXXXX.wsgi:application
--master
--pidfile=/tmp/XXXX.pid
--socket=/tmp/uwsgi.sock
--chmod-socket
--processes=9
--harakiri=2000
--max-requests=50000
--vacuum
--home=/home/user/env
--stats /tmp/stats.socket
--stats-minified
--harakiri-verbose
--listen=2048
--log-date
--log-zero
--log-slow 2000
--log-5xx
--log-4xx
--gevent 5
-m
-b 25000
-L
--wsgi-file /home/user/code/wsgi.py
--touch-chain-reload /home/user/uwsgi.reload
Run Code Online (Sandbox Code Playgroud)
我收到了很多消息,例如:
{address space usage: 1444040704 bytes/1377MB} {rss usage: 759623680 bytes/724MB} [pid: 4655|app: 0|req: 2897724/26075292] 184.172.192.42 () {44 vars in 563 bytes} [Tue Jul 7 18:45:17 2015] POST /some/url/ => generated 0 bytes in 34 msecs (HTTP/1.1 204) 1 headers in 38 bytes (3 …Run Code Online (Sandbox Code Playgroud) 多次循环子组件但每次使用不同数据的最佳方法是什么?
例如,在我的“站点列表”组件(父组件)中,我想遍历我的“摘要”组件(子组件),尽可能多地遍历数据。“摘要”将只是与我从服务“站点”中提取的对象数组中的每个索引相对应的数据。
考虑到这种父/子关系,显示此数据的最佳方式是什么?
我需要声明数据并从服务中获取它的哪个文件(sitelist.component.ts 或 summary.component.ts)?
对于#1,我可以更改什么以正确循环遍历这些数据?不确定我可以传递这样的数据。
Sitelist.html(父级)
<div *ngFor="let site of sites">
<app-summary></app-summary>
</div>
Run Code Online (Sandbox Code Playgroud)
summary.html(子):
<li>{{site.id}}</li>
<li>{{site.name}}</li>
<li>{{site.location}}</li>
Run Code Online (Sandbox Code Playgroud)
对于#2,根据#1 的答案,我应该将可观察对象放入哪个文件以从服务中获取数据?(sitelist.component.ts 或 summary.component.ts)
ngOnInit() {
let observable = this._dataService.getSites()
observable.subscribe(data => {
console.log("got info")
console.log(data)
this.sites = data
})}
}
Run Code Online (Sandbox Code Playgroud)
在我的服务中,我有:
export class DataService {
sites;
constructor(private _http: HttpClient) { }
getSites(){
return this._http.get(`http://localhost:3000/sites.json`);
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢!!如果我能澄清任何事情,请告诉我
我需要随机获取一行的数字,并将每行放在其他数组中,然后获取一个col的数字.
我有一个超过400M的大文件.在该文件中,有13496*13496个数字,表示13496行和13496个列.我想把它们读成数组.这是我的代码:
_L1 = [[0 for col in range(13496)] for row in range(13496)]
_L1file = open('distanceCMD.function.txt')
while (i<13496):
print "i="+str(i)
_strlf = _L1file.readline()
_strlf = _strlf.split('\t')
_strlf = _strlf[:-1]
_L1[i] = _strlf
i += 1
_L1file.close()
Run Code Online (Sandbox Code Playgroud)
这是我的错误信息:
MemoryError:
File "D:\research\space-function\ART3.py", line 30, in <module>
_strlf = _strlf.split('\t')
Run Code Online (Sandbox Code Playgroud) 我的模拟器显示一条消息,表明应用程序意外停止.我无法在代码中找到错误.
这是我的主要类名Database2Activity:
package data.base;
import com.example.phone_no.DBhelper;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class Database2Activity extends Activity {
EditText editText;
DBhelper DB;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button button = (Button)findViewById(R.id.button);
DB = new DBhelper(Database2Activity.this);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String rr = editText.getText().toString();
DB.open();
DB.adddata("A", rr, "122");
DB.getAlldata();
DB.close();
} …Run Code Online (Sandbox Code Playgroud) 这是我的代码:
select_where_true :: (Double -> Bool) -> [Double] -> [Double]
select_where_true is_neg [a] = case [a] of
[] -> []
x:xs -> is_neg x
|(is_neg x) == False = []
|(is_neg x) == True = x ++ (select_where_true is_neg xs)
is_neg :: Double -> Bool
is_neg x = x < 0
Run Code Online (Sandbox Code Playgroud)
这是错误消息:
[1 of 1] Compiling Main ( test.hs, interpreted )
test.hs:5:18: parse error on input `|'
Failed, modules loaded: none.
Run Code Online (Sandbox Code Playgroud)
有人喜欢告诉我我的代码有什么问题吗?
感谢任何能给我一些建议的人.
我正在尝试将背景更改为"android.support.v7.widget.PopupMenu".
我想我已经完成了我在互联网上发现的改变背景的一切.
RES /值/ styles.xml
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">
<item name="popupMenuStyle">@style/MyPopupMenu</item>
</style>
<style name="MyPopupMenu" parent="@style/Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">#888888</item>
</style>
Run Code Online (Sandbox Code Playgroud)
RES /值-V14/styles.xml
<style name="CustomActionBarTheme" parent="@style/Theme.AppCompat.Light">
<item name="android:popupMenuStyle">@style/MyPopupMenu</item>
</style>
<style name="MyPopupMenu" parent="@style/Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">#888888</item>
</style>
Run Code Online (Sandbox Code Playgroud)
当然我在显示弹出窗口的活动中设置了"CustomActionBarTheme".
我究竟做错了什么?
我希望创建一个使用金星(U + 2640♀)符号代表女性和火星(U + 2642♂)符号代表男性的情节.如果您之前使用过这些,请与我分享如何将它们设置为标记pylab.scatter().
在我的主.c文件中,我定义NUMBER为:
#define NUMBER '0'
Run Code Online (Sandbox Code Playgroud)
在另一个.c文件2中,我已将其声明为"extern int"变量并使用它.但是在编译gcc时会出现以下错误消息:
/tmp/ccsIkxdR.o: In function `file2':
file2.c:(.text+0xfd): undefined reference to `NUMBER'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
请建议我一个出路.提前致谢.
python ×3
android ×2
html ×2
javascript ×2
angular ×1
c ×1
gcc ×1
haskell ×1
iframe ×1
matplotlib ×1
mysql ×1
parse-error ×1
popupmenu ×1
scatter ×1
sql ×1
styles ×1
typescript ×1
uwsgi ×1