小编Ant*_*yrd的帖子

git撤消所有未提交或未保存的更改

我试图撤消自上次提交以来的所有更改.我试着git reset --hardgit reset --hard HEAD观察后,这个职位.我用头响应现在是18c3773 ...但是当我查看我的本地源时,所有文件仍然存在.我错过了什么?

git command-line undo git-reset

759
推荐指数
13
解决办法
59万
查看次数

将列添加到SQL Server

我需要在SQL Server表格中添加一列.我可以这样做而不会丢失数据吗?

sql-server-2008

90
推荐指数
2
解决办法
19万
查看次数

jQueryUI模式对话框不显示关闭按钮(x)

我在ASP .NET MVC 3应用程序中使用了jQuery模式对话框.它工作正常,除了右上角没有关闭按钮.我该如何添加?

$("#dialog-modal").dialog({
            modal: true,
            autoOpen: false,
            buttons: {
                Ok: function () {
                    $(this).dialog("close");
                }
            }
        });
Run Code Online (Sandbox Code Playgroud)

jquery dialog jquery-ui asp.net-mvc-3

67
推荐指数
8
解决办法
10万
查看次数

停止表单提交,使用Jquery

我试图阻止我的表单提交验证失败.我试过按照上一篇文章,但我不适合我.我错过了什么?

<input id="saveButton" type="submit" value="Save" />
<input id="cancelButton" type="button" value="Cancel" />
<script src="../../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script type="text/javascript">

    $(document).ready(function () {
        $("form").submit(function (e) {
            $.ajax({
                url: '@Url.Action("HasJobInProgress", "ClientChoices")/',
                data: { id: '@Model.ClientId' },
                success: function (data) {
                    showMsg(data, e);
                },
                cache: false
            });
        });
    });
    $("#cancelButton").click(function () {
        window.location = '@Url.Action("list", "default", new { clientId = Model.ClientId })';
    });
    $("[type=text]").focus(function () {
        $(this).select();
    });
    function showMsg(hasCurrentJob, sender) {
        if (hasCurrentJob == "True") {
            alert("The current clients has a job in …
Run Code Online (Sandbox Code Playgroud)

validation jquery preventdefault asp.net-mvc-3

54
推荐指数
2
解决办法
19万
查看次数

捆绑不与rbenv一起使用

我正在尝试使用捆绑器与rbenv.我一直工作到今天.我唯一能做的就是打破它gem pristine --all或者gem cleanup?尝试安装bundler时出现以下错误.

Antarrs-MacBook-Pro:some-app antarrbyrd$ sudo gem install bundler
Password:
Bundler gave the error "Could not find mail-2.5.4 in any of the sources" while processing "/Users/antarrbyrd/dev/some-app/Gemfile". Perhaps you forgot to run "bundle install"?
Successfully installed bundler-1.7.12
Parsing documentation for bundler-1.7.12
Done installing documentation for bundler after 3 seconds
1 gem installed
Antarrs-MacBook-Pro:some-app antarrbyrd$ bundle install
/Users/antarrbyrd/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 8 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/antarrbyrd/.gem', execute `gem env` for …
Run Code Online (Sandbox Code Playgroud)

ruby bundler rbenv

34
推荐指数
6
解决办法
5万
查看次数

无效的单表继承类型:Rails

尝试在我的Rails应用程序中创建新产品时出现此错误.

无效的单表继承类型:Movie不是Product的子类

我该如何解决这个问题?

在此输入图像描述

调节器

class ProductsController < ApplicationController
  before_action :set_product, only: [:show, :edit, :update, :destroy]

  # GET /products
  # GET /products.json
  def index
    @products = Product.all
  end

  # GET /products/1
  # GET /products/1.json
  def show
  end

  # GET /products/new
  def new
    @product = Product.new
  end

  # GET /products/1/edit
  def edit
  end

  # POST /products
  # POST /products.json
  def create
    @product = Product.new(product_params)

    respond_to do |format|
      if @product.save
        format.html { redirect_to @product, notice: 'Product was successfully created.' }
        format.json { render …
Run Code Online (Sandbox Code Playgroud)

inheritance ruby-on-rails ruby-on-rails-4

31
推荐指数
3
解决办法
2万
查看次数

在长生不老药中,"|>"是什么意思?

我正在阅读github上的一些代码elixir代码,我看到|>经常使用.它不会出现在文档站点的操作列表中.这是什么意思?

expires_at:    std["expires_in"] |> expires_at,
Run Code Online (Sandbox Code Playgroud)

elixir

21
推荐指数
2
解决办法
5917
查看次数

向node express添加新路由

我正在尝试在我的快递应用程序中添加新路由,但在尝试启动服务器时我一直收到错误.错误是

C:\development\node\express_app\node_modules\express\lib\router\index.js:252
    throw new Error(msg);
          ^
Error: .get() requires callback functions but got a [object Undefined]
Run Code Online (Sandbox Code Playgroud)

这是我的文件,我是节点的新手,所以如果我遗漏了一个重要文件,请告诉我

路线/ furniture.js

exports.furniture = function(req, res){
   res.render('furniture', { title: '4\267pli' });
};
Run Code Online (Sandbox Code Playgroud)

路线/ index.js

/*
 * GET home page.
 */

exports.index = function(req, res){
  res.render('index', { title: '4\267pli' });
};
Run Code Online (Sandbox Code Playgroud)

意见/ furniture.ejs

<!DOCTYPE html>
<html>
<head>
    <title>4&middot;pli -- architecture</title>
    <link rel='stylesheet' href='/stylesheets/style.css'/>
    <link href='http://fonts.googleapis.com/css?family=Didact+Gothic' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="wrapper">
    <h1 class="logo"><%= title %></h1>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

app.js

/**
 * Module dependencies.
 */ …
Run Code Online (Sandbox Code Playgroud)

routing node.js express

16
推荐指数
2
解决办法
3万
查看次数

如果左操作数到?? operator不为null,是否对右操作数进行求值?

我正在考虑??在C#中使用运算符(null-coalescing operator).但是MSDN上的文档是有限的.

我的问题:如果左侧操作数不为null,右手操作数是否会被评估?

.net c# operators

16
推荐指数
2
解决办法
1929
查看次数

在ASP.NET中使用Windows身份验证

我正在尝试在我的ASP.NET应用程序中使用Windows身份验证.每当我尝试查看应用程序时,它都会将我发送到登录页面.如何在不通过浏览器手动登录的情况下使其工作?

web.config中

  <system.web>
    <authentication mode="Windows"></authentication>
    <anonymousIdentification enabled="false"/>
    <authorization>
      <deny users="?" />
      <allow users="*" />
    </authorization>
    <customErrors mode="Off"></customErrors>
    <identity impersonate="true"></identity>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime />
  </system.web>
Run Code Online (Sandbox Code Playgroud)

更新IIS Express后出错

Most likely causes:
No authentication protocol (including anonymous) is selected in IIS.
Only integrated authentication is enabled, and a client browser was used that does not support integrated authentication.
Integrated authentication is enabled and the request was sent through a proxy that changed the authentication headers before they reach the Web server. …
Run Code Online (Sandbox Code Playgroud)

c# asp.net iis windows-authentication iis-express

15
推荐指数
4
解决办法
3万
查看次数