假设我将.txt文件加载到Vim中.然后我想改变filetype=html但我也想要一个相关的ftplugin加载.我怎样才能做到这一点?
我已经尝试了类似的东西::set filetype plugin on和:set filtype plugin_nameon :filetype plugin_name等等,但我似乎无法手动加载ftplugin.有什么建议?
我试过:filetype=html,然后:filetype plugin on和其他组合无济于事.
编辑:我无法用任何答案"完全"解决这个问题(但它可能与我的配置有关).然而,皮埃尔的答案非常好,所以我给了他绿色的复选标记.
这非常令人困惑.每当我尝试在SQL Server Management Studio Express(SQL Server 2008)中的数据库节点下添加(或甚至查看)Database Diagrams节点时,我都会收到此错误:
无法安装数据库关系图支持对象,因为此数据库没有有效的所有者.要继续,首先使用"数据库属性"对话框的"文件"页面或ALTER AUTHORIZATION语句将数据库所有者设置为有效登录,然后添加数据库关系图支持对象.
好的.问题是,根据Management Studio,我的登录名是数据库的所有者.当我登录Management Studio时,我正在使用Windows身份验证,如果我转到"数据库属性"对话框的"文件"页面,我的登录名是所有者.
接下来我想,好吧,也许我不是正确服务器角色的成员实际上是所有者,但是,我的登录是sysadmin服务器角色的成员,根据此MDSN页面是拥有的必备条件一个数据库.
所以最后我做了一些谷歌搜索,我看到人们告诉我尝试执行这样的声明:
EXEC sp_dbcmptlevel 'yourDB', '90';
go
ALTER AUTHORIZATION ON DATABASE::yourDB TO "yourLogin"
go
use [yourDB]
go
EXECUTE AS USER = N'dbo' REVERT
go
Run Code Online (Sandbox Code Playgroud)
我的问题在于我并不真正理解这段代码在做什么,并且使用上述语句(看起来成功执行)尝试不同的用户名或数据库名称似乎无法解决我的问题.
谁能想到我可能会遗失的任何事情?
我想将.flv文件存储在数据库中,而不是存储在文件系统中.
这就是我现在能做的:
用ffmpeg成功地将.wmv和.mpeg转换为.flv.
将图像存储在SQL Server中,并使用httphandler在我的页面上显示它们.
与.avi和.mpeg视频相同.(这取决于用户的软件,如果他可以查看它)
如果文件位于文件系统而不是数据库中,则在浏览器中播放.flv文件.
我不能做的是:
直接从数据库中将.flv视频流传输到JW Player.(存储为二进制数据)
我已经在互联网上搜索了两天,但我无法让它工作.感觉好像我几乎在那里.JW Player打开并开始"缓冲",但没有任何反应.
我知道没有简单的答案,但如果有人之前做过这个,或类似的事情,我想知道你是怎么做的.我觉得我有太多的代码要在这里发布.
提前致谢!
如果使用像素填充,我的表单输入将正确显示,但使用左右百分比填充会将其中断.我无法弄清楚为什么.
它适用于Safari,在Firefox 3.5.3 OSX中已经破解.
问题是,当我使用百分比填充时,填充都会中断(因此输入值不能很好地对齐的原因.)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>% padding</title>
<style>
html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
border:none;
}
div.content {
width:50%;
margin:0 auto;
background:#eee;
}
div.content form {
width:100%;
}
div.content form ul {
list-style:none;
margin:0;
width:100%;
}
div.content form li {
position:relative;
margin-bottom:20px;
height:64px;
width:100%; /* width is declared */
}
div.content form li label {
position:absolute;
width:auto;
left:0;
top:0;
line-height:20px;
}
div.content form li .text {
position:absolute;
bottom:0;
left:0;
padding:10px 2%; /* …Run Code Online (Sandbox Code Playgroud) 我想做这样的事情(例子是简化的,但包含所有关键部分):
class Master
{
type DataType = Int
var counter : DataType = 0
}
class Slave(private val master : Master)
{
val counter = master.counter // (*)
}
Run Code Online (Sandbox Code Playgroud)
在这里(*)我收到错误:
private value master将其定义范围作为Slave.this.master.DataType类型的一部分进行转义
val counter = master.counter
我理解错误,但我不明白原因 - 类型是类的一部分Master,而不是对象master,所以如果类是私有的,而不是对象,这很重要.好吧,至少在理论上.
很容易快速解决方法:
val counter : Master#DataType = master.counter
Run Code Online (Sandbox Code Playgroud)
但我相信这是与以前完全相同的代码的显式版本,它"只"需要更多的输入.这是一个功能吗?
题:
类型(此处为DataType)是否可以依赖于对象,而不是Scala中的类(即每个类实例的类型定义)?
有人可以提供代码将上传的文件保存到二进制文件中的azure blob吗?我目前使用文本保存,这对于大文件来说非常慢,读取/保存到blob,逐行.
Private Function ReadFile(ByVal file As HttpPostedFile) As String
Dim result As String = ""
Dim objReader As New System.IO.StreamReader(file.InputStream)
Do While objReader.Peek() <> -1
result = result & objReader.ReadLine() & vbNewLine
Loop
Return result
End Function
Run Code Online (Sandbox Code Playgroud)
谢谢
不太确定最好的头衔,但我会尽我所能解释我的要求.假设我有以下文件:
MyCustomClass.php
<?php
namespace MyNamespace;
use FooNamespace\FooClass;
use BarNamespace\BarClass as Bar;
use BazNamespace\BazClass as BazSpecial;
class MyCustomClass {
protected $someDependencies = [];
public function __construct(FooClass $foo, Bar $bar) {
$someDependencies[] = $foo;
$someDependencies[] = $bar;
}
}
Run Code Online (Sandbox Code Playgroud)
现在,如果我要使用反射,我可以从构造中的类型提示中获取完全限定的类名.
但是,我会接受FooNamespace\FooClass和BarNamespace\BarClass.不,FooNamespace\FooClass和BarNamespace\Bar.我也没有参考BazNamespace\BazClass.
基本上,我的问题是:我怎样才能得到完全合格的名称MyCustomClass.php,而只知道FooClass,Bar和,BazSpecial?
我不想使用文件解析器,因为这会吃掉性能.我希望能够做到这样的事情:
$class = new ReflectionClass('MyCustomClass');
...
$class->getUsedClass('FooClass'); // FooNamespace\FooClass
$class->getUsedClass('Bar'); // BarNamespace\BarClass
$class->getUsedClass('BazSpecial'); // BazNamespace\BazClass
Run Code Online (Sandbox Code Playgroud)
我该怎么做呢?
我有一个使用jQuery和大量动态生成内容的项目.click左上角元素上有一个处理程序 - "主动"得分 - 它在桌面Safari上工作正常但在Mobile Safari上根本没有调用; 灰色覆盖层永远不会出现,也不会采取任何措施.与点击区域(右侧172)的点击处理程序和状态(底部的"添加状态效果";确认;它出现在肖像上)的情况相同:所有工作都在桌面上但不是移动Safari.
我已将代码缩减为以下内容:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
$(function() {
$('#dynamic').click(function() {alert("works")});
$('#dynamic-with-onclick').click(function() {alert("works")});
$('#dynamic-with-dynamic-onclick').click(function() {alert("works")}).attr('onclick', '');
})
</script>
</head>
<body>
<ul>
<li id='static' onclick='alert("works")'>If there's an onclick it's called</li>
<li id='dynamic'>And if there's no onclick the iPad won't see other click events</li>
<li id='dynamic-with-onclick' onclick=''>But if there is one all events are called</li>
<li id='dynamic-with-dynamic-onclick'>And if we add one everything works</li>
</ul>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
现在看起来比我10个月前最初提出这个问题要简单得多; 使用现代Mobile Safari,所有点击处理程序都会正常注册.所以,出去,只是使用$(...).click(function() {})!
我正在尝试通过multipart/form-data帖子上传图片,我正在使用下面的代码.我只会上传.jpg图片.
问题是保存的图像不是有效图像,无法查看.它也比我上传的文件大200个字节,所以我想我在这里遗漏了什么?
public class FileUploadController : ApiController
{
public Task<HttpResponseMessage> PostUploadFile()
{
return UploadFileAsync().ContinueWith<HttpResponseMessage>((tsk) =>
{
HttpResponseMessage response = null;
if (tsk.IsCompleted)
{
response = new HttpResponseMessage(HttpStatusCode.Created);
}
else if (tsk.IsFaulted || tsk.IsCanceled)
{
response =
new HttpResponseMessage(HttpStatusCode.InternalServerError);
}
return response;
});
}
public Task UploadFileAsync()
{
return this.Request.Content.ReadAsStreamAsync().ContinueWith((tsk) =>
{ SaveToFile(tsk.Result); },
TaskContinuationOptions.OnlyOnRanToCompletion);
}
private void SaveToFile(Stream requestStream)
{
string path =
System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory);
using (FileStream targetStream =
File.Create(path + "/Uploads/" + DateTime.Now.ToFileTime() + ".jpg"))
{ …Run Code Online (Sandbox Code Playgroud) 我最近注意到gapi_processed很多脚本标签的属性,但我找不到任何好的文档.
它是什么意思,我在哪里可以阅读更多相关信息?
<script gapi_processed="true" src="..."></script>
Run Code Online (Sandbox Code Playgroud)
编辑
这里有几个例子(检查<head>前两个中的脚本标签)
看起来它可能与谷歌有关?
asp.net ×1
attributes ×1
azure ×1
binary ×1
blob ×1
c# ×1
css ×1
database ×1
file-upload ×1
ftplugin ×1
html ×1
ipad ×1
javascript ×1
jquery ×1
jwplayer ×1
namespaces ×1
php ×1
plugins ×1
post ×1
reflection ×1
scala ×1
scope ×1
sql ×1
vim ×1