我在Vim和Python之间浪费了很多时间.我发现从Python手动复制粘贴到Vim太慢了,反之亦然.一个好的破坏的例子是:
%!python for i in xrange(25); 打印6*i \n
你怎么能在Vim做这样的调整? [解决了]
[澄清] 我需要Vim的东西,比如打印序列,算术...... - 我在Vim做不到的事情.
[?]有人可以详细说明这一点:"你的脚本可以从stdin中读取,直接在给定的行(.,%,...)上运行. "
[进一步澄清]
如果我想在第4,5,6和7行打印'Hello',那有什么不对:
:4-7!python -c"print'hello'"
点.修改当前行.我可以在多行7,32和99上打印:
:7,32,99!python -c"print'hello'"
显然不行.怎么样?
我正在尝试创建一个以相反顺序返回字符串的方法.
IE /"西班牙的降雨主要落在"将会回归:"大部分时间落在西班牙雨中"
为此,我不应该使用任何内置的Java类只是基本的Java.
到目前为止,我有:
lastSpace = stringIn.length();
for (int i = stringIn.length() - 1; i >= 0; i--){
chIn = stringIn.charAt(i);
if (chIn == ' '){
word = stringIn.substring(i + 1, lastSpace);
stringOut.concat(word);
lastS = i;
}
}
word = stringIn.substring(0,lastSpace);
stringOut.concat(word);
return stringOut;
Run Code Online (Sandbox Code Playgroud)
我的问题是当stringOut它返回给它的调用者时,它总是一个空字符串.
难道我做错了什么?也许我的用途string.concat()?
目前我正在使用自动工具来构建/安装和打包我的项目,但我真的想转向感觉更"pythonic"的东西.
我的项目包括两个脚本,一个模块,两个glade GUI描述和两个.desktop文件.它目前是一个纯粹的python项目,虽然很快就会改变.
看看setuptools,我可以很容易地看到如何处理除.desktop文件之外的所有内容; 他们必须最终进入特定目录,以便Gnome可以找到它们.
使用distuils/setuptools是一个好主意吗?
我有以下按钮
<asp:ImageButton ID="button1" runat="server"
ImageUrl="~/image.jpg"
CommandName = "id"
CommandArgument = "1"
onclick="button1_Click"
/>
Run Code Online (Sandbox Code Playgroud)
并在代码背后
protected void button1_Click(object sender, ImageClickEventArgs e)
{
Response.Write(e.commandName);
}
Run Code Online (Sandbox Code Playgroud)
这不起作用!!,所以我的问题是如何从按钮控制获得价值?
我一直在使用Emacs编写Python 2代码.现在我在我的系统上安装了Python 2.6和3.0,我也需要编写Python 3代码.
以下是在/ usr/bin中设置不同版本的方法:
python -> python2.6*
python2 -> python2.6*
python2.6*
python3 -> python3.0*
python3.0*
Run Code Online (Sandbox Code Playgroud)
有没有办法设置它,以便Emacs使用正确版本的Python,具体取决于我使用的语言?例如,Cc Cc当前运行缓冲区,但它总是调用python2.6,即使我正在编写Python 3代码.
我正在尝试从提要中获取未回答问题的列表,但在阅读时遇到问题。
const string RECENT_QUESTIONS = "https://stackoverflow.com/feeds";
XmlTextReader reader;
XmlDocument doc;
// Load the feed in
reader = new XmlTextReader(RECENT_QUESTIONS);
//reader.MoveToContent();
// Add the feed to the document
doc = new XmlDocument();
doc.Load(reader);
// Get the <feed> element
XmlNodeList feed = doc.GetElementsByTagName("feed");
// Loop through each item under feed and add to entries
IEnumerator ienum = feed.GetEnumerator();
List<XmlNode> entries = new List<XmlNode>();
while (ienum.MoveNext())
{
XmlNode node = (XmlNode)ienum.Current;
if (node.Name == "entry")
{
entries.Add(node);
}
}
// Send …Run Code Online (Sandbox Code Playgroud) 每当我在Eclipse中创建一个新的Java文件并检查添加选项时public static void main(String args[]),都会生成以下代码:
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
Run Code Online (Sandbox Code Playgroud)
我如何能:
@param args评论我在第379页的Expert F#副本中注意到以下注释:
传递和处理消息
通常在共享内存并发和消息传递并发之间进行区分 .前者在本地计算机上通常更有效,本章后面的"使用共享内存并发"一节中对此进行了介绍.后者扩展到没有共享内存的系统,例如分布式系统,也可用于避免与共享内存相关的性能问题.
我感兴趣的是消息在没有共享内存的进程之间传递并发.Expert F#和互联网上演示如何使用MailboxProcessor的所有示例都包含此代码的一些变体:
let counter =
MailboxProcessor.Start(fun inbox ->
let rec loop n =
async {
do printfn "n = %d, waiting... " n
let! msg = inbox.Receive()
match msg with
| -1 ->
do printfn "'Til the bitter end..."
return ()
| n -> return! loop(n + msg)
}
loop 0)
counter.Post(20)
counter.Post(50)
counter.Post(-1) // kill mailbox
Run Code Online (Sandbox Code Playgroud)
换句话说,在将消息发布到其通道之前,必须在共享内存中拥有邮箱处理器的句柄.据我所知,这不是Erlang风格的并发,因为您只能在同一进程中将消息发布到MailboxProcessors(注意:进程,而不是线程).
一个进程中的一个MailboxProcessor是否可以将消息发送到另一个MailboxProcessor进程?如果是这样,你能提供样品吗?
我怎样才能在CSS中完成上标?
我有一个样式表,我用上标字符标记外部链接,但我很难正确对齐字符.
我目前的情况如下:
a.external:after {
font-size: 50%;
vertical-align: top;
content: "+";
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
当然,我<sup>只会在content允许HTML的情况下使用-tag ...
java ×3
python ×3
c# ×2
.net ×1
asp.net ×1
autoboxing ×1
casting ×1
concurrency ×1
css ×1
distutils2 ×1
eclipse ×1
emacs ×1
erlang ×1
events ×1
f# ×1
feed ×1
gnome ×1
imagebutton ×1
packaging ×1
python-3.x ×1
setuptools ×1
string ×1
vim ×1
xml ×1
xmldocument ×1
xmlreader ×1