假设我在vim中有一些任意的分割布局。

____________________
| one       | two  |
|           |      |
|           |______|
|           | three|
|           |      |
|___________|______|

有没有办法交换一个和两个,并保持相同的布局?在这个例子中很简单,但我正在寻找一个解决方案,将有助于更复杂的布局。

更新:

我想我应该说清楚点。我前面的例子是对实际用例的简化。有一个实际的例子:

我怎么能交换任何两个分割,保持相同的布局?

更新!3年多后……

我把sgriffin的解决方案放在一个Vim插件中,你可以轻松安装!用你最喜欢的插件管理器安装它,并尝试一下:WindowSwap.vim

Facebook无法掌握我的og:图像文件,我已经尝试了所有常见的解决方案。我开始认为这可能与https://..有关。

I have checked http://developers.facebook.com/tools/debug and have zero warnings or errors. It is finding the images we linked to in the "og:image", but they're showing up blank. When we click the image(s), however, they DO exist and it takes is straight to them. It DOES show one image -- an image hosted on a non-https server. We've tried square images, jpegs, pngs, larger sizes and smaller sizes. We've put the images right in public_html. Zero are showing up. It's not a caching error, because when we add another og:image to the meta, FB's linter does find and read that. It DOES show a preview. The preview is blank. The only exception we're getting is for images that are not on this website. We thought maybe there was some anti-leach on cpanel or the .htaccess that was preventing the images from showing up, so we checked. There was not. We even did a quick < img src="[remote file]" > on an entirely different server and the image shows up fine. We thought maybe it was the og:type or another oddity with another meta tag. We removed all of them, one at a time and checked it. No change. Just warnings. The same code on a different website shows up without any issue. We thought maybe it was not pulling images because we're using the same product page(s) for multiple products (changing it based on the get value, ie, "details.php?id=xxx") but it's still pulling in one image (from a different url). Leaving any og:image or image_src off, FB does not find any images.

我已经山穷水尽了。如果我说我自己和其他人在这方面花了多少时间,你会感到震惊。问题是这是一个在线商店。我们绝对绝对不能没有图像。我们必须这么做。我们还有十多个其他网站……这是唯一一个有og:图像问题的。它也是唯一一个使用https的,所以我们认为这可能是问题所在。但我们在网上找不到任何这样的先例。

这些是元标签:

<meta property="og:title" content="[The product name]" /> 
<meta property="og:description" content="[the product description]" /> 
<meta property="og:image" content="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-details-black.png" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-art-black.png" />
<meta property="og:image" content="http://www.[ADIFFERENTwebsite].com/wp-content/uploads/2011/06/ARS-Header-Shine2.png" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/ARShopHeader.png" />
<meta property="og:image" content="http://www.[ourwebsite].com/overdriven-blues-music-tshirt-art-black.JPG" />
<meta property="og:type" content="product"/>
<meta property="og:url" content="https://www.[ourwebsite].com/apparel-details.php?i=10047" />
<meta property="og:site_name" content="[our site name]" />      
<meta property="fb:admins" content="[FB-USER-ID-NUMBER]"/>
<meta name="title" content="[The product name]" />
<meta name="description" content="[The product description]" />
<link rel="image_src" href="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-details-black.png" />
<meta name="keywords" content="[four typical keywords]">
<meta name="robots" content="noarchive">

如果你想要它,这里有一个链接到我们一直在做的产品页面。[缩短链接,试图阻止这进入我们网站的搜索结果]:http://rockn.ro/114

编辑——

使用“see what facebook sees”刮刀工具,我们可以看到以下内容:

"image": [          
      {
         "url": "https://www.[httpSwebsite].com/images/shirts/soul-man-soul-music-tshirt-details-safari.png"
      },
      {
         "url": "https://www.[httpSwebsite].com/images/shirts/soul-man-soul-music-tshirt-art-safari.png"
      },
      {
         "url": "http://www.[theotherNONSECUREwebsite].com/wp-content/uploads/2011/06/ARS-Header-Shine2.png"
      }
   ],

我们测试了它为单个页面找到的所有链接。所有这些都是完全有效的图像。

编辑2 ----

我们尝试了一个测试,并在NONSECURE网站上添加了一个子域名(从该网站上的图像实际上可以通过facebook看到)。子域名为http://img.[nonsecuresite].com。然后,我们将所有图像放入主子域文件夹并引用它们。它不会把这些图片拉进FB。但是,它仍然会提取在不安全的主域上引用的任何图像。

发布的解决方案----

Thanks to Keegan, we now know that this is a bug in Facebook. To workaround, we placed a subdomain in a different NON-HTTPS website and dumped all images in it. We referenced the coordinating http://img.otherdomain.com/[like-image.jpg] image in og:image on each product page. We then had to go through FB Linter and run EVERY link to refresh the OG data. This worked, but the solution is a band-aid workaround, and if the https issue is fixed and we go back to using the natural https domain, FB will have cached the images from a different website, complicating matters. Hopefully this information helps to save someone else from losing 32 coding hours of their life.

查找Git存储库大小的简单方法是什么?

我指的不是存储库根目录上的du -h。我有很多被忽略的文件,所以这个大小与我的总存储库大小不同。实际上,我想知道克隆存储库时会传输多少数据。

License keys are the defacto-standard as an anti-piracy measure. To be honest, this strikes me as (in)Security Through Obscurity, although I really have no idea how license keys are generated. What is a good (secure) example of license key generation? What cryptographic primitive (if any) are they using? Is it a message digest? If so, what data would they be hashing? What methods do developers employ to make it difficult for crackers to build their own key generators? How are key generators made?

我已经看到了在Vim中使用选项卡(使用:table,:tabnew等)的能力,以取代我目前在隐藏缓冲区的同一个窗口中打开多个文件的做法。

我想每个不同的文件,我已经打开,总是在自己的选项卡。然而,有一些事情阻碍了这一点。我如何解决这些问题:

When commands like gf and ^] jump to a location in another file, the file opens in a new buffer in the current tab. Is there a way to have all of these sorts of commands open the file in a new tab, or switch to the existing tab with the file if it is already open? When switching buffers I can use :b <part of filename><tab> and it will complete the names of files in existing buffers. <part of filename> can even be the middle of a filename instead of the beginning. Is there an equivalent for switching tabs?

是否可以就地升级节点,而不是手动安装最新的稳定版本?

我已经用nvm安装了node.js 5.0版本,但现在我想把它更新到5.4。我试图避免手动重新安装我所有的全局包(例如通过运行npm install -g grunt-cli bower yo yoman-angular-generator blabla blablablabla…)

我正在尝试在mac os 10.6上使用Homebrew by brew安装MySQL 5.1.52。

一切都很顺利,我也成功地使用mysql_install_db。 然而,当我试图连接到服务器使用:

/usr/local/Cellar/mysql/5.1.52/bin/mysqladmin -u root password 'mypass'

我得到:

/usr/local/Cellar/mysql/5.1.52/bin/mysqladmin: connect to server at 'localhost' 
failed error: 'Access denied for user 'root'@'localhost' (using password: NO)'

我尝试访问mysqladmin或mysql使用-u root - root以及, 但是有没有密码都不行。

这是全新机器上的全新安装,据我所知,新安装必须在没有根密码的情况下访问。我还试过:

/usr/local/Cellar/mysql/5.1.52/bin/mysql_secure_installation

但我也得到了

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

我需要一种方法来获得一个文件的大小使用c#,而不是磁盘上的大小。这怎么可能呢?

目前我有这个循环

foreach (FileInfo file in downloadedMessageInfo.GetFiles())
{
    //file.Length (will this work)
}

这将返回大小还是磁盘上的大小?

我希望接受数字和小数点,但没有符号。

我已经看过使用Windows窗体中的NumericUpDown控件的示例,以及来自微软的这个NumericUpDown自定义控件的示例。但到目前为止,似乎NumericUpDown (WPF是否支持)不会提供我想要的功能。我的应用程序是这样设计的,任何头脑正常的人都不会想弄乱箭头。在我的应用程序中,它们没有任何实际意义。

所以我正在寻找一个简单的方法,使一个标准的WPF文本框只接受我想要的字符。这可能吗?实用吗?

当使用Facebook Sharer时,Facebook将为用户提供使用从源中提取的几个图像中的一个作为他们的链接预览的选项。如何选择这些图像,以及如何确保页面上的任何特定图像始终包含在此列表中?