小编ghi*_*ing的帖子

如何在Laravel中使用SQL Server连接?

我得到了一个在Laravel 3中制作的工作项目,我必须切换到MsSQL Server(不是我的电话,但是嗅......)而且我不理解这个数据库类型的Laravel配置......

我将默认内部database.php更改为此'default' => 'sqlsrv'然后我在sqlsrv数组中配置了主机,数据库,用户名和密码,但后来我收到此错误消息:

此扩展需要Microsoft SQL Server 2012 Native Client ODBC驱动程序与SQL Server进行通信

经过一些研究后我发现我们需要SQLSRV的PDO,我已经将其作为5.4版本而且phpinfo我得到了这个,pdo_sqlsrv support : enabled所以它看起来都是正确的但同时它似乎要求ODBC SQLSRV连接,我真的需要用那个?

我宁愿直接从Laravel数据库连接连接......但即使我需要它并且我创建了一些与服务器的ODBC连接,我如何将它们放在我的配置中?这是我在配置中的内容(当然my...是由我的真实细节替换):

'sqlsrv' => array(
    'driver'   => 'sqlsrv',
    'host'     => 'myServerIP', 
    'database' => 'myDatabase',
    'username' => 'myUsername',
    'password' => 'myPassword',
    'prefix'   => '',
 ),
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激,我发现接近我的问题的唯一的事情是来自Laravel论坛的这个链接:Laravel在SQL Server上查询但是它只是在没有给出任何配置的情况下停止.

php laravel laravel-4 laravel-3

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

Bootstrap 4 Beta使用Webpack 3.x导入Popper.js抛出Popper不是构造函数

所以Bootstrap 4 Beta出来......是的!然而,Tether已被替换Popper.js为工具提示(和其他功能).我在控制台中看到一个错误,足以告诉我更改为Popper.js:

Bootstrap dropdown require Popper.js
Run Code Online (Sandbox Code Playgroud)

看起来很简单,我去更新了我的webpack.config.js(整个配置可以在这里看到)然后Bootstrap开始工作(我做的唯一改变是用Popper替换Tether):

plugins: [
new ProvidePlugin({
  'Promise': 'bluebird',
  '$': 'jquery',
  'jQuery': 'jquery',
  'window.jQuery': 'jquery',
  'window.$': 'jquery',
  Popper: 'popper.js' 
}),
Run Code Online (Sandbox Code Playgroud)

我也在import 'bootstrap'我的main.ts文件中做了.

但是我现在有另一个问题(我没有使用Tether),在控制台中抛出一个新错误:

Uncaught TypeError: Popper is not a constructor
Run Code Online (Sandbox Code Playgroud)

如果我尝试在Chrome中进行调试,我确实已经Popper将其作为对象加载(这就是Bootstrap停止抱怨的原因),您可以在下面的打印屏幕中看到.在此输入图像描述

最后包括我的所有代码.我使用Bootstrap工具提示与一个简单的自定义元素构建AureliaTypeScript(以前用于以前的Bootstrap alpha 6和Tether)

import {inject, customAttribute} from 'aurelia-framework';
import * as $ from 'jquery';

@customAttribute('bootstrap-tooltip')
@inject(Element)
export class BootstrapTooltip {
  element: HTMLElement;

  constructor(element: HTMLElement) …
Run Code Online (Sandbox Code Playgroud)

javascript twitter-bootstrap webpack aurelia bootstrap-4

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

带有模板的Twitter Typeahead始终只返回1行数据

我试图做一个类似于Twitter在示例页面上显示的示例,更具体地说是一个带有名为Open Source Projects的模板的Twitter,我得到了一些部分工作,但它只是并且总是只显示1行结果,即使我将它设置为10,我正在提取Yahoo Finance数据,结果是JSON并且在Firebug中有效,例如键入字母"a"将生成类似的JSON对象:[Object { symbol="A", name="Agilent Technologies Inc.", exch="NYQ", more...}, Object { symbol="^DJI", name="Dow Jones Industrial Average", exch="DJI", more...}, more objects...]

我的JS文件有这种预先设置

$('.symbols .typeahead').typeahead({
    //name: 'symbols',
    //remote: 'yahoo_autocomplete_ajax.php?action=autocjson&symbol=%QUERY',
    limit: 3,
    remote: {
        url: 'yahoo_autocomplete_ajax.php?action=autocjson&symbol=%QUERY',
        filter: function(parsedResponse) {
            var dataset = [];

            dataset = parsedResponse.data;
            console.log(parsedResponse.data);
            console.log(dataset); // debug the response here

            return dataset;
        }
    },
    //prefetch: 'symbols.json',
    template: [
        '<p class="symbols-exchange">{{exchDisp}}</p>',
        '<p class="symbols-symbol">{{symbol}}</p>',
        '<p class="symbols-name">{{name}}</p>'
    ].join(''),
    engine: Hogan
});
Run Code Online (Sandbox Code Playgroud)

使用两者的console.log parsedReponse.data并且dataset都显示有效的数组.但最后它仍然总是显示第一个结果,无论是什么,模板似乎正常运作,现在在我的HTML代码中,我有来自Twitter运行的示例,它总是显示所有结果,但我的只是1 …

typeahead.js

12
推荐指数
1
解决办法
7792
查看次数

如何强制在Aurelia中重新评估或重新渲染绑定

我开始使用Aurelia,RethinkDB和Socket.IO的简单TODO应用程序.我似乎在重新渲染或重新评估通过Socket.IO更改的对象时遇到问题.所以基本上,一切都在第一个浏览器上运行良好但在第二个浏览器中没有重新渲染,而在控制台中显示对象确实显示了我的对象的差异.问题仅在于更新对象时,它完全适用于从待办事项数组创建/删除对象.

HTML

<ul>
    <li repeat.for="item of items">
      <div show.bind="!item.isEditing">
        <input type="checkbox" checked.two-way="item.completed" click.delegate="toggleComplete(item)" />
        <label class="${item.completed ? 'done': ''} ${item.archived ? 'archived' : ''}" click.delegate="$parent.editBegin(item)">
          ${item.title}
        </label>
        <a href="#" click.delegate="$parent.deleteItem(item, $event)"><i class="glyphicon glyphicon-trash"></i></a>
      </div>
      <div show.bind="item.isEditing">
        <form submit.delegate="$parent.editEnd(item)">
          <input type="text" value.bind="item.title" blur.delegate="$parent.editEnd(item)" />
        </form>
      </div>
    </li>
  </ul>
Run Code Online (Sandbox Code Playgroud)

带有RethinkDB更改源的NodeJS

// attach a RethinkDB changefeeds to watch any changes
r.table(config.table)
    .changes()
    .run()
    .then(function(cursor) {
        //cursor.each(console.log);
      cursor.each(function(err, item) {
        if (!!item && !!item.new_val && item.old_val == null) {
          io.sockets.emit("todo_create", item.new_val);
        }else if (!!item …
Run Code Online (Sandbox Code Playgroud)

javascript sockets rethinkdb aurelia aurelia-binding

12
推荐指数
1
解决办法
4059
查看次数

如何更改VSCode的.Net Core 2调试器端口

我正在使用Visual Studio Code(VSCode)来编写.Net Core 2.0App,并希望使用VSCode调试器.我创建了一个launch.json,它与我的前端代码一起工作,但我也想调试.Net代码.但是我的主要问题是我没有使用默认端口(5000我相信它是默认的).那么我怎样才能更改端口?

json { "version": "0.2.0", "configurations": [ { "name": ".NET Core Launch (Management.Core)", "type": "coreclr", "request": "launch", "preLaunchTask": ".Net Build (all)", "program": "${workspaceRoot}/Management.Core/bin/Debug/netcoreapp2.0/Management.Core.dll", "args": [], "cwd": "${workspaceRoot}/CpaManagement.Core", "stopAtEntry": false, "console": "internalConsole" }, 我试图添加一个,port: 12345但这不是一个可接受的属性.我也尝试添加,args: ['-- port=12345']但也没有用.

我的.Net Core App launchSettings.json如下配置: json { "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:8888/", "sslPort": 45678 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, …

visual-studio-code asp.net-core-2.0 vscode-tasks

9
推荐指数
1
解决办法
2508
查看次数

AngularJS的CSS3动画在Firefox中无法正确滑动

我做了一个CSS3动画连接到一个ng-repeat随后显示inline-list与Bootstrap3,我限制显示的列表中的最大3的数量和我有一些小问题主要出现在Firefox(相信它或不IE11没有问题,哇我是惊讶).
我有2个按钮(上一个/下一个),当我点击下一个按钮时,从左到右滑动的动画开始完成他的工作,但在Firefox中多次点击时,似乎动画只适用于2/3列表(基本上右边的最后一项始终首先显示,而不是滑动而其他项从左向右滑动).除此之外,有点难以解释,但如果你在plunker中尝试这个例子,你会看到效果.

正如我所说,这个问题只发生,到目前为止,仅在Firefox中,在Chrome和IE11中似乎没问题.

这里是我的pluularer

My AngularJS控制器代码

<ul class="list-inline quotes">
  <li ng-repeat="quote in vm.marketDisplayedQuotes | limitTo:3" class="{{vm.animationClass}} quotes quote-{{$index}}">
        <span class="quote-name">{{quote.name}}</span> 
        <span class="quote-last">{{quote.last}}</span> 
        <span class="quote-change-percent {{quote.direction}}">{{quote.changePercent}}</span>
    </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

然后是CSS动画的从左到右的代码

/* Left to Right */
.animation-lr.ng-enter {
  -webkit-transition: 1s ease-out all;
  -o-transition: 1s ease-out all;
  transition: 1s ease-out all;

  -webkit-transform: translate(-100%,0);
  -o-transform: translate(-100%,0);
  transform: translate(-100%,0);
}

.animation-lr.ng-leave {
  -webkit-transition: 0s ease-out all;
  -o-transition: 0s ease-out all;
  transition: 0s ease-out all;

  -webkit-transform: translate(0,0);
  -o-transform: …
Run Code Online (Sandbox Code Playgroud)

firefox css3 css-animations angularjs angularjs-ng-repeat

7
推荐指数
1
解决办法
1176
查看次数

未捕获的TypeError创建Aurelia插件:plugin.load不是一个函数

我创建了一个新的Aurelia插件,它被命名Aurelia-Slickgrid并在本地工作.feature('resources').然后我准备好进行下一步,将它作为一个插件提供给每个人,并创建一个Github项目,并在这个GitHub链接下提供它- Aurelia-Slickgrid.我使用Aurelia Skeleton Plugin来创建我的插件,也运行gulp build以创建转换后的输出.然后我发布它NPM并成功安装它npm i --save aurelia-slickgrid.我目前正在使用Aurelia-CLI捆绑,一切顺利,直到我打开浏览器并看到控制台中出现错误(现在我在浏览器中留下了白页):

Uncaught TypeError: plugin.load is not a function
    at Module.<anonymous> (vendor-bundle.js:5308)
    ...
Run Code Online (Sandbox Code Playgroud)

目前,我正在尝试将其作为插件加载Aurelia-CLI.请参阅下面的完整配置:

index.js 插件

import {AureliaSlickgrid} from './aurelia-slickgrid';
import {SlickPager} from './slick-pager';
import {SlickWindowResizer} from './slick-window-resizer';

export function configure(config) {
  config.globalResources('./aurelia-slickgrid');
  config.globalResources('./slick-pager');
  config.globalResources('./slick-window-resizer');
}

export {
  AureliaSlickgrid,
  SlickPager,
  SlickWindowResizer
}
Run Code Online (Sandbox Code Playgroud)

main.js (我当地的项目)

aurelia.use
    .standardConfiguration()
    .feature('resources')
    .plugin('aurelia-slickgrid');
Run Code Online (Sandbox Code Playgroud)

aurelia.json (我当地的项目)

{
     "name": …
Run Code Online (Sandbox Code Playgroud)

javascript aurelia aurelia-cli

7
推荐指数
1
解决办法
1056
查看次数

如何过滤可能是几个树级别深度的父子数组的多个属性

TL; 博士; 为简单起见,我如何过滤父子数组的多个属性,这些属性可能是几个树级别的深度。这是针对数百个用户使用的开源数据网格库。

所以我有一系列父/子引用,孩子们也可以有孩子自己等等,树级深度没有限制。此外,我不仅需要能够过滤具有树结构的属性,还需要能够过滤该数组的任何属性,即网格中的列。

例如,我有这个数组,它代表一个文件浏览器列表

const myFiles = [
    {id: 11, file: "Music", parentId: null },
    {id: 12, file: "mp3", parentId: 11 },
    {id: 14, file: "pop", parentId: 12 },
    {id: 15, file: "theme.mp3", dateModified: "2015-03-01", size: 85, parentId: 14, },
    {id: 16, file: "rock", parentId: 12 },
    {id: 17, file: "soft.mp3", dateModified: "2015-05-13", size: 98, parentId: 16, },
    {id: 18, file: "else.txt", dateModified: "2015-03-03", size: 90, parentId: null, },
    {id: 21, file: "Documents", parentId: null, },
    {id: 2, file: …
Run Code Online (Sandbox Code Playgroud)

javascript arrays datagrid slickgrid typescript

7
推荐指数
1
解决办法
512
查看次数

如何在Aurelia-CLI中添加Tether以与Bootstrap 4一起使用

我想补充引导4Aurelia.我只能得到CSS工作,但bootstrap.js需求Tether,我不能把它包括在内,因为我在控制台中不断收到此错误:

Bootstrap tooltips require Tether
Run Code Online (Sandbox Code Playgroud)

我尝试过这个

"jquery",
"Tether",
{
  "name": "tether",
  "path": "../node_modules/tether/dist",
  "main": "js/tether.min",
  "exports": "Tether",
  "resources": [
    "css/tether.css"
  ]
},
{
  "name": "bootstrap",
  "path": "../node_modules/bootstrap/dist",
  "main": "js/bootstrap.min",
  "deps": ["tether", "jquery"],
  "exports": "$",
  "resources": [
    "css/bootstrap.css"
  ]
},
Run Code Online (Sandbox Code Playgroud)

它确实捆绑了,但它仍在抱怨失踪Tether.我读了另一个堆栈的答案 ,我必须available globally which could be done via用这个makeTether requirejs.config.js`

define(['lib/tether.min'], function(tether) {
    window.Tether = tether;    
});
Run Code Online (Sandbox Code Playgroud)

但是没有这样的配置Aurelia.

requirejs tether aurelia aurelia-cli

6
推荐指数
1
解决办法
1045
查看次数

Aurelia如何在自定义元素和其自己的命名空间中添加绑定行为?

我正在构建一个Aurelia自定义元素,我想使用一个特殊的绑定行为,但我似乎无法在我的自定义元素类之外使用它(声明它).另外,我想知道Aurelia中是否存在绑定行为和其他自定义内容的命名空间?

这是我想要使用的绑定行为

optional-binding.js - 由另一个堆栈问题提供的代码

export class OptionalBindingBehavior {
  bind(binding, scope, interceptor) {
    binding.originalupdateTarget = binding.updateTarget;
    binding.originalTargetProperty = binding.targetProperty;
    binding.updateTarget = val => {
      if (val === undefined || val === null || val === '') {
        binding.targetProperty = null;
      } else {
        binding.targetProperty = binding.originalTargetProperty;
      }
      binding.originalupdateTarget(val);
    };
  }

  unbind(binding, scope) {
    binding.updateTarget = binding.originalupdateTarget;
    binding.originalupdateTarget = null;
    binding.targetProperty = binding.originalTargetProperty;
    binding.originalTargetProperty = null;
  }
}
Run Code Online (Sandbox Code Playgroud)

我试着用这种方式导入

index.js

  import {MyCustomElement} from './my-element';
  import './optional-binding.js';

  export function configure(aurelia) {
    aurelia.globalResources('./my-element'); …
Run Code Online (Sandbox Code Playgroud)

javascript ecmascript-6 aurelia aurelia-binding

6
推荐指数
1
解决办法
619
查看次数