我有一个我想单独处理的IP分隔列表.列表长度提前未知.如何拆分和处理列表中的每个项目?
@echo off
set servers=127.0.0.1,192.168.0.1,10.100.0.1
FOR /f "tokens=* delims=," %%a IN ("%servers%") DO call :sub %%a
:sub
echo In subroutine
echo %1
exit /b
Run Code Online (Sandbox Code Playgroud)
输出:
In subroutine
127.0.0.1
In subroutine
ECHO is off.
Run Code Online (Sandbox Code Playgroud)
更新: 使用Franci的答案作为参考,这是解决方案:
@echo off
set servers=127.0.0.1,192.168.0.1,10.100.0.1
call :parse "%servers%"
goto :end
:parse
setlocal
set list=%1
set list=%list:"=%
FOR /f "tokens=1* delims=," %%a IN ("%list%") DO (
if not "%%a" == "" call :sub %%a
if not "%%b" == "" call :parse "%%b"
)
endlocal
exit /b
:sub …Run Code Online (Sandbox Code Playgroud) 我有一个带有以下CSS的容器div:
#container {
position:relative;
overflow:hidden;
width:200px;
height:200px;
}
Run Code Online (Sandbox Code Playgroud)
为什么这样:
alert('height is ' + $("#container").attr('height'));
Run Code Online (Sandbox Code Playgroud)
返回高度未定义?
谢谢.
我想捕获从Script-A.sh发送到Script-B.sh的信号,所以在Script-A.sh中我使用命令
(将SIGINT发送到Script-B.sh)
kill -2 $ PID_Script-B.sh
在Script-B.sh中,我捕获信号并调用函数Clean
陷阱'清洁'2
它不起作用,而是立即杀死Script-B.sh而不执行Clean !!
我还注意到,如果我想将SIGINT从终端发送到任何捕获它的脚本,ctrl-c将会正确捕获,但如果我通过命令指定信号则不会kill -2 $pid_of_script
有没有想过发送SIGINT(ctrl-cVS kill -2 $pid_of_script)的两种方法之间的区别,以及如何将SIGINT从脚本发送到另一个?
问候,
调试器
有没有人一起加入SQLAlchemy和Memcached,以便SQLAlchemy返回的结果在Memcached中缓存?目前我不知道如何自己实施,我完全失去了寻求帮助.
谢谢,Boda Cydo.
我已经看到了一些类似的问题,但似乎没有什么是我正在寻找的.如果我错过了在另一个问题中回答的解决方案,请原谅我!
对.我有一个观点.160像素既高又宽.我知道这个视图将被用作子视图,我知道在任何使用它的情况下它总是需要以两个轴为中心.
如果以编程方式定义视图,我怎样才能确保它相对于超视图始终完全居中,水平和垂直?
到目前为止,我只有这个简单的代码:
- (void)loadView {
self.view = [[UIView alloc] initWithFrame:CGRectMake(80, 150, 160, 160)];
self.view.backgroundColor = [UIColor greenColor];
self.view.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);
[self.view release];
}
Run Code Online (Sandbox Code Playgroud)
这可以实现集中化,但仅限于最简单的情况.非常感谢任何见解.
添加以下代码行:
self.view.center = self.view.superview.center;
Run Code Online (Sandbox Code Playgroud)
子视图的中心点成为超级视图的(0,0)坐标.也许我还没有正确设置超视图?
我有这个脚本
<select>
<option value="1">one<img src="star.gif" height="15" width="15"></img> </option>
</select>
Run Code Online (Sandbox Code Playgroud)
但它不起作用.如何将图像放入选中?谢谢
所以这是不可能的?:(也许通过javascript?...
有没有OpenSource Java Crossplatform(至少win,mac,lin)Screen(desctop)Capture program/lib?
我在网上看到很多与修复无法按下的按钮有关的内容,以及修复代理的网络问题.这对我来说似乎是一个不同的问题,在maven2的情况下与jem.util.0.0.0或其他插件需要的libs有关.
设置:
Eclipse 3.5.1(Galileo)与apt-get一起安装.Ubuntu 9.10(Karmic Koala)(这是作为虚拟机运行的,不应该这么重要.)
一般问题描述:Maven2 eclipse插件安装失败.
具体来说,我无法使用此目标站点从eclipse安装流程安装maven2插件:http: //m2eclipse.sonatype.org/sites/m2e/
找到maven站点,安装开始,然后返回此错误:
无法完成安装,因为找不到一个或多个必需的项目.正在安装的软件:Maven Integration for Eclipse(必需)0.10.0.20100209-0800 \(org.maven.ide.eclipse.feature.feature.group 0.10.0.20100209-0800)缺少要求:Eclipse的Maven集成(必需)0.10.0.20100209 -0800(org\.maven.ide.eclipse.feature.feature.group 0.10.0.20100209-0800)需要'org.eclipse.jem.\ util 0.0.0'但无法找到
官方Ubuntu文档声称支持eclipse 3.5.1,并建议使用Synaptic Package Manager,而不是任何其他任何问题.
有没有人对此有任何见解?
我正在尝试使用Web应用程序进行前/后注释,但出于某种原因,spring-security没有发生任何事情.
web.xml中:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/rvaContext-business.xml
/WEB-INF/rvaContext-security.xml
</param-value>
</context-param>
<!-- Spring security filter -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>rva</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>rva</servlet-name>
<url-pattern>/rva/*</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)
rvaContext-security.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd">
<global-method-security pre-post-annotations="enabled"/>
<http use-expressions="true">
<form-login login-page="/login" />
<logout />
<remember-me />
</http>
...
Run Code Online (Sandbox Code Playgroud)
LoginController类:
@Controller
@RequestMapping("/login")
public class LoginController {
@RequestMapping(method = RequestMethod.GET)
public String login(ModelMap map){
map.addAttribute("title", "Login: AD Credentials");
return("login");
}
@RequestMapping("/secure") …Run Code Online (Sandbox Code Playgroud) 我有一个问题,Oracle Float双精度数据类型映射到Java双数据类型.使用Java Double数据类型时,hibernate架构验证程序似乎失败.
org.hibernate.HibernateException: Wrong column type in DB.TABLE for column amount. Found: float, expected: double precision
Run Code Online (Sandbox Code Playgroud)
避免这种情况的唯一方法是禁用模式验证,并希望模式与即将运行的应用程序保持同步.它必须在投入生产之前修复.
应用程序的环境:
- Grails 1.2.1
- Hibernate-core 3.3.1.GA
- Oracle 10g
css ×2
jquery ×2
bash ×1
bash-trap ×1
batch-file ×1
command-line ×1
eclipse ×1
grails ×1
hibernate ×1
html ×1
html-select ×1
iphone ×1
java ×1
javascript ×1
kill ×1
maven-2 ×1
memcached ×1
open-source ×1
signals ×1
sqlalchemy ×1
ubuntu-9.10 ×1
validation ×1