我多次想到在Vim中重复一个命令直到满足某个条件而不是多次.例如,假设我想让这段代码更整洁:
Ogre::String GetConfigPath() const { return m_configPath; }
Ogre::String GetConfigName() const { return m_configName; }
Ogre::String GetConfigFileName() const { return m_configPath + m_configName + ".txt"; }
Ogre::String GetConfigStateFileName() const { return m_configPath + m_configName + "-state.txt"; }
Ogre::String GetConfigStatisticsFileName() const { return m_configPath + m_configName + "-statistics.txt"; }
Ogre::String GetConfigDetailedStatisticsFileName() const { return m_configPath + m_configName + "-detailed_statistics.txt"; }
Run Code Online (Sandbox Code Playgroud)
我通常做的是转到名字最长的函数,按'Tab'然后对齐其他函数的其他大括号以匹配这个.显然,任务现在是在其他函数的大括号之前添加空格,直到光标位于位置,例如80(最长函数的大括号的位置).
无论如何重复命令直到光标位于x位置?
这只是一个例子,我经常需要重复一个命令,直到满足某个条件.
任何的想法?
是否有任何方法可以在控件之间共享列宽,而不仅仅是在同一控件上的多个网格之间?
我想要得到的原始图表:

我目前正忙着在每个UserControl的第一列中获取标签的宽度,但它似乎是一个混乱的解决方案,相当CPU重(找到标签并计算文本的宽度,在它呈现之前是讨厌的!) .
我一直在阅读尽可能多的关于SharedSizeGroups的内容,但没有任何迹象表明它们可以在不同的控件上工作.有一个简单的解决方案,甚至是一个不那么简单的简单解决方案吗?!
我在VS2010中有一个测试项目,我需要从命令行运行单元测试.在一台机器上,以下方案可以正常工作:
1)通过"MSBuild test_project.csproj"构建测试
2)通过"MSTest /testcontainer:test_project.dll"运行测试
但是在另一台机器上,第二步产生了一个奇怪的错误信息,即:"指定文件扩展名'.dll'不是有效的测试扩展名"
知道怎么解决这个问题吗?
谢谢!
编辑:这有效,但不知道为什么?
$('button').each(function() {
$(this).bind(
"click",
function() {
alert($(this).val());
});
});
Run Code Online (Sandbox Code Playgroud)
我不确定为什么这不起作用...现在,我只是尝试使用按钮值输出警报,但它不能在我的页面上工作.我没有在Firebug中得到任何控制台错误,也看不到任何阻止它工作的东西.
我的HTML看起来像这样:
<table id="addressbooktable">
<thead>
<tr>
<th>Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>7892870</td>
<td><button id="button-20" class="custom-action" value="XY89" name="info">Click</button></td>
</tr>
<tr>
<td>9382098</td>
<td><button id="button-21" class="custom-action" value="XY544" name="info">Click</button></td>
</tr>
<tr>
<td>3493900</td>
<td><button id="button-22" class="custom-action" value="XY231" name="info">Click</button></td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
代码看起来像这样:
$('button').each(function() {
$(this).click(function() {
alert($(this).val());
}
});
Run Code Online (Sandbox Code Playgroud)
但是,点击它什么都不做?我使用不正确吗?
我正在玩tapestry 5.2.4和AJAX.
在我的Test.tml中,我有一个表单:
<form t:id="form">
<t:label for="userName"/>:
<input t:type="TextField" t:id="userName" size="30"/>
</form>
Run Code Online (Sandbox Code Playgroud)
以及显示变量"test"的区域:
<t:zone t:id="myZone" id="myZone">
<p>show test ${test}</p>
</t:zone>
Run Code Online (Sandbox Code Playgroud)
现在我尝试将表单字段"userName"的值放入带有actionlink的区域中:
<t:actionlink t:id="SomeLink" zone="myZone" context="${userName}">update</t:actionlink>
Run Code Online (Sandbox Code Playgroud)
这是java类Test.java:
public class Test {
@Persist
@Property
private String userName;
@Property
private String test;
@InjectComponent
private Zone myZone;
@Component
private Form form;
Object onActionFromSomeLink(String input) {
test = input;
return myZone.getBody();
}
}
Run Code Online (Sandbox Code Playgroud)
我认为这将"获取"表单字段userName的值,并通过actionlink将其传递给onActionFromSomeLink方法.该方法将变量"test"设置为输入,并显示区域.
这不起作用,并抛出一个我不明白的错误:
Ajax失败:状态500 /example/test.somelink:未处理请求事件'action'(在组件Test:somelink上); 您必须在组件或其中一个容器中提供匹配的事件处理程序方法.
Communication with the server failed: Request event 'action' (on component Test:somelink) was not handled; you must …Run Code Online (Sandbox Code Playgroud) 有一个红宝石词干https://github.com/aurelian/ruby-stemmer,但它1)不会阻止英语不规则动词2)无法在Windows上构建原生扩展.是否有其他方法可以解决至少一个问题?
我遇到以下代码的问题(编译但崩溃):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace ConsoleApplication1
{
public struct MyBoolean
{
public bool Value { get; set; }
//cast string -> MyBoolean
public static implicit operator MyBoolean(System.String value)
{
return new MyBoolean() { Value = (value[0] == 'J') };
}
//cast bool -> MyBoolean
public static implicit operator MyBoolean(bool value)
{
return new MyBoolean() { Value = value };
}
//cast MyBoolean -> bool
public static implicit operator bool(MyBoolean value)
{
return value.Value; …Run Code Online (Sandbox Code Playgroud) org.apache.jasper.JasperException:绝对uri:http://java.sun.com/jsp/jstl/core无法在web.xml或使用此应用程序部署的jar文件中解析
当我运行我的应用程序时,我收到此错误.
这是我的userForm.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
.even {
background-color: silver;
}
</style>
<title>Registration Page</title>
</head>
<body>
<form:form action="add.htm" commandName="user">
<table>
<tr>
<td>User Name :</td>
<td><form:input path="name" /></td>
</tr>
<tr>
<td>Password :</td>
<td><form:password path="password" /></td>
</tr>
<tr>
<td>Gender :</td>
<td><form:radiobutton path="gender" value="M" label="M" /> <form:radiobutton
path="gender" value="F" label="F" /></td>
</tr>
<tr>
<td>Country :</td>
<td><form:select …Run Code Online (Sandbox Code Playgroud) 在循环中声明一个变量是不好的做法?在我看来,这样做,如下面的第一个代码块所示,将使用十倍的内存作为第二个...由于在循环的每次迭代中创建一个新的字符串.它是否正确?
for (int i = 0; i < 10; i++) {
String str = "Some string";
}
Run Code Online (Sandbox Code Playgroud)
与
String str;
for (int i = 0; i < 10; i++) {
str = "Some String";
}
Run Code Online (Sandbox Code Playgroud) 我已经使用Dreamweaver很长一段时间了,但它有许多我不需要的功能.我想要一个简洁的简单编辑器,如textmate,但我使用Windows ..
我尝试过Zend Studio但是作为DW它有许多我不需要的功能.
您会为HTML,PHP,CSS和JS推荐其他编辑器吗?