我做了一个只接受字母的正则表达式.我在正则表达式方面不是很好,这就是为什么我不知道如何在我的正则表达式中包含空格.
我的HTML:
<input id="input" />
Run Code Online (Sandbox Code Playgroud)
我的js/jQuery代码:
$('#input').on('keyup', function() {
var RegExpression = /^[a-zA-Z]*$/;
if (RegExpression.test($('#input').val())) {
}
else {
$('#input').val("");
}
});?
Run Code Online (Sandbox Code Playgroud) 我不是程序员,但我使用下面的代码将页面滚动到顶部.
如何调整它以向下滚动?
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<a class="btnMedio" href="javascript:;">
<img src="http://desmond.imageshack.us/Himg41/scaled.php?server=41&filename=deixeseuemail.png&res=landing"/>
</a>
<script>
$('.btnMedio').click(function(){
$('html, body').animate({scrollTop:1000},'50');
});
</script>
Run Code Online (Sandbox Code Playgroud) 是否可以执行以下操作来修改matplotlib中的导航工具栏?
fig = figure()tbar = fig.get_navigation_toolbar()或更好,只需:tbar = fig.navtbartbar,例如删除/添加/编辑按钮,如下所示:tbar.add_button(<a Button object>);tbar.remove_button(a reference to a button);tbar.edit_button(a reference to a button);fig.canvas.draw()非常感谢你.
我有一个多选列表,有超过5个选项,我想计算用户选择的选项的数量.
如何使用java脚本?
我尝试了以下但它对我不起作用:
var x = document.getElementById("preference").count;
Run Code Online (Sandbox Code Playgroud)
提前致谢.
我使用PHPExcel库来生成基于mysql查询创建的表的excel文件.我使用来自不同查询的单个数据创建了多个选项卡
我需要将所有选项卡(工作表)中所有单元格中的数据对齐到中心.
这是我的代码:
$mysql_xls = new MySqlExcelBuilder($mysql_db,$mysql_user,$mysql_pass);
// Add the SQL statements to the spread sheet
$tab_name = "tabname";
$mysql_xls->add_page($tab_name,$sql_statement,NULL,'A',1);
$phpExcel = $mysql_xls->getExcel();
$phpExcel->setActiveSheetIndex(0); // Set the sheet to the first page (default first page).
Run Code Online (Sandbox Code Playgroud)
我尝试了以下内容来对齐单元格中的文本,但没有变化:
$phpExcel->getActiveSheet(0)->getStyle()->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
Run Code Online (Sandbox Code Playgroud) 我在不使用ant的情况下从命令行管理和运行我的Android应用程序,我按照以下步骤操作:
.java文件编译src到.class文件中dex使用以下命令将类文件集合到文件中dx --dex --verbose --output=./bin/classes.dex ./bin.class 文件位于bin目录中.
但是我在这些步骤中遇到以下错误:
java.lang.Runtime exception:.\bin file not found
at com.android.dx.cf.direct.ClassPathOpener.process
at com.android.dx.command.dexer.Main.processOne
at com.android.dx.command.dexer.Main.processAllFiles
at com.android.dx.command.dexer.Main..run
at com.android.dx.command.dexer.Main.main
at com.android.dx.command.Main.main
Run Code Online (Sandbox Code Playgroud)
因此,我无法创建该Classes.dex文件.
有人可以为此提出解决方案吗?
[仅通过命令行不使用eclipse和ant]
我正在用 gatsby 设计一个网页,我想使用 Material UI,但我不知道该使用哪个插件。
我的问题是:
theme.js把ThemeProvider包装纸放在哪里,把包装纸放在哪里? 我刚开始使用C++进行一些原始网络编程,并且已经在我的Raspberry Pi上进行编译(没有交叉编译).这使得一切都变成了小尾数.
在构建我的IP头之后,我计算了IP校验和,但它总是出错(基于这里的例子http://www.thegeekstuff.com/2012/05/ip-header-checksum/).
升级gdb,我把我的问题解决了IP头中前32位的排序.该示例使用0x4500003C,表示版本4(0x4),IHL 5(0x5),TOS 0(0x00)和tot_length 60(0x003C).所以我把我的数据包设置为相同.
struct iphdr* ip; // Also some mallocing
ip->version = 4;
ip->ihl = 5;
ip->tos = 0;
ip->tot_len = 60;
Run Code Online (Sandbox Code Playgroud)
现在在gdb中,我检查了前32位,期待0x3C000045因为字节序,但我得到了这个:
(gdb) print ip
$1 = (iphdr *) 0x11018
(gdb) x/1xw 0x11018
0x11018: 0x003c0045
Run Code Online (Sandbox Code Playgroud)
前16位是小端(0x0045),但第二位,包含十进制60,似乎是大端(0x003C)!
是什么给这个?我疯了吗?我对结构体内的字节顺序完全错了吗?(这是一个明确的可能性)
我试图通过以编程方式登录这样的用户(剥离的异常处理)在不同的身份验证下在JBoss Container中运行代码:
LoginContext ctx = ctx =
new LoginContext("MyLoginSchema",
new UsernamePasswordCallbackHandler("newuser", "")
);
ctx.login();
Subject.doAs(ctx.getSubject(), new PrivilegedAction<T>() {
@Override
public T run() {
Subject.getSubject(AccessController.getContext());
InitialContext ic = new InitialContext();
EJBContext sctxLookup = (EJBContext) ic.lookup("java:comp/EJBContext");
Principal principal = sctxLookup.getCallerPrincipal();
}
});
Run Code Online (Sandbox Code Playgroud)
登录newuser作品(呼叫LoginModule成功),但Subject.doAs()不将新主题与EJBContext.run()-Method中的代码仍然从中获取旧用户的主体EJBContext.
我测试了另一种检索登录用户但方法相同的方法:
Subject caller = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我从 contabo 租了一个 vps 大约半年了,直到现在它都运行良好,因为它开始产生“名称解析暂时失败”的错误。我读到这是一个 DNS 错误,我尝试过nameserver 8.8.8.8,nameserver 1.1.1.1但问题仍然存在。
同样昨天我完全重新安装了vps,但它没有用。
/etc/resolv.conf:# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access …Run Code Online (Sandbox Code Playgroud) javascript ×4
jquery ×2
python ×2
android ×1
c++ ×1
command-line ×1
dex ×1
discord ×1
dx ×1
endianness ×1
gatsby ×1
html ×1
jaas ×1
java ×1
jboss ×1
jboss7.x ×1
linux ×1
material-ui ×1
matplotlib ×1
php ×1
phpexcel ×1
reactjs ×1
ubuntu ×1