小编Mar*_*tin的帖子

angularJS:如何在父作用域中调用子作用域函数

如何从父作用域调用子作用域中定义的方法?

function ParentCntl() {
    // I want to call the $scope.get here
}

function ChildCntl($scope) {
    $scope.get = function() {
        return "LOL";    
    }
}
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/wUPdW/

angularjs angularjs-scope

93
推荐指数
3
解决办法
8万
查看次数

订阅和计算在淘汰赛中的差异

什么是在knockout.js中使用computed函数和subscribe函数之间的主要区别?

knockout.js

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

通过解码"*.itemdata-ms"二进制数据文件(Windows 8.1,StartScreen,C#)自定义Windows 8.1 StartScreen

我将尝试以更舒适且不依赖于用户的方式编辑Windows 8.1 StartScreen .

我知道这不是Microsoft使用其操作系统的方式,但在企业环境中必须有一种方法来自定义StartScreen.如果我部署一个新的软件包,那么StartScreen上应该有一个图标(在右侧组中,在预定义的位置).

于是,我找到的文件appsFolder.itemdata-msappsFolder.itemdata-ms.bak两个都是二进制编码.如果我在十六进制编辑器中打开它们,有几个组名和链接可见但不是转储格式.也无法按照需要的方式在hexeditor中编辑此切片.

appsFolder.itemdata-ms的一部分

?%???????         ?   ?   S t o r e           Y+????BGJ   F   1SPS?w?
Run Code Online (Sandbox Code Playgroud)

我试着写一个解码器(使用C#),没有成功,一切都可以查看,但只是像在十六进制编辑器中一样.

尝试使用PowerShell命令,Export-StartLayout -as xml所有内容都以正确的方式导出,组,磁贴,位置为:

export.xml

<launcher version="2">
   <view name="Start">
     <group name="Desktop">
       <tile FencePost="0" size="wide310x150" AppID="Microsoft.Windows.Desktop"/>
       <tile FencePost="0" size="square150x150" AppID="Microsoft.InternetExplorer.Default"/>
       <tile FencePost="0" size="square150x150" AppID="Chrome"/>
     </group>
     <group name="Entwicklung">
       <tile FencePost="0" size="square150x150" AppID="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}\Fiddler2\Fiddler.exe"/>
       <tile FencePost="0" size="square150x150" AppID="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}\Notepad++\notepad++.exe"/>
      </group>
    </view>
</launcher>
Run Code Online (Sandbox Code Playgroud)

但是Import-StartLayout没有按预期工作,使用此命令,先前导出的布局无法应用于当前用户(仅使用gpo,但随后启动屏幕被锁定).

我还使用了ILSpy来检查PowerShell Cmt-Lets,但最终却是非托管代码部分.

简而言之,有没有办法解码二进制文件来编辑它们(可能是第三方工具?)并将它们写回以将更改应用于当前用户?

c# windows powershell binaryfiles windows-8.1

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

将.txt文件加载到textarea Javascript中?

我试图将文本文件放入textarea.结果是" http://mywebsite.com/textfile/(txtinput).txt,文本文件未加载到textarea中.

<html>
   <head>
      <title>textbox</title>
      <script type="text/javascript">
         function readBOX() {
            var txtinput = document.getElementById('txtinput').value;
            document.forms[0].text.value = ("http://mywebsite.com/textfile/") + txtinput +(".txt");
         }
      </script>
   </head>
   <body>
      <p> Type</p>
      <input type="text" id="txtinput" />
      <input id="open" type="button" value="READ" onClick="readBOX()" />
      <form>
         <textarea name="text" rows="20" cols="70">loaded text here</textarea>
      </form>
   </body>
</html>
Run Code Online (Sandbox Code Playgroud)

html javascript

7
推荐指数
2
解决办法
4万
查看次数

如何将一个供应商块文件 (webpack) 用于多个 React 项目

我有不同的反应应用程序的不同 gits。每个应用程序都应该使用相同的供应商块文件和外部包(React、ReactDOM ...)

项目设置:

Project 1 (git)
   /dist/...
   /src/...
   webpack.config.js
Project 2 (git)
   /dist/...
   /src/...
   webpack.config.js
Project N (git)
   ...
Run Code Online (Sandbox Code Playgroud)

每个都webpack.config.js包含此配置但具有不同的库名称:

module.exports = {
  entry: {
      app: './src/App.ts',
      vendor: ['react', 'react-dom', 'react-redux', 'redux', 'redux-thunk']
  },
  output: {
      path: path.resolve(__dirname, "dist"),
      filename: '<Name>.bundle.js',
      library: "<Name>",
      libraryTarget: "umd"
  },
  module: { /* ... */ },
  plugins: [
      new webpack.optimize.CommonsChunkPlugin({
          name: 'vendor',
          filename: 'vendor.bundle.js'
      })
  ]
}
Run Code Online (Sandbox Code Playgroud)

问题:

Webpackvendor.bundle.js专门为当前的库/项目构建了一个,而不是全局使用,是否有一个选项可以让 webpack 创建一个vendor.bundle.js可以包含在单个页面上的选项,其中两个应用程序都可以基于此文件加载:

例子:

<html>
   <head>
      <script src="/vendor.bundle.js"></script>
   </head> …
Run Code Online (Sandbox Code Playgroud)

git bundle reactjs webpack commonschunkplugin

4
推荐指数
1
解决办法
1907
查看次数

.NET ShellExtension(Framework 4.5,Windows 8.1,SharpShell)无效

我试图在Windows 8.1中实现自定义ShellExtension.发现真的很好的SharpShell教程.

[ComVisible(true)]
[COMServerAssociation(AssociationType.AllFiles)]
public class CountExtProvider : SharpContextMenu
{
    protected override bool CanShowMenu()
    {
        //  We will always show the menu.
        return true;
    }

    protected override ContextMenuStrip CreateMenu()
    {
        //  Create the menu strip.
        var menu = new ContextMenuStrip();

        //  Create a 'count lines' item.
        var itemCountLines = new ToolStripMenuItem
        {
            Text = "Count Lines"
        };

        //  When we click, we'll call the 'CountLines' function.
        itemCountLines.Click += (sender, args) => CountLines();

        //  Add the item to …
Run Code Online (Sandbox Code Playgroud)

.net c# shell-extensions visual-studio windows-8.1

3
推荐指数
1
解决办法
2901
查看次数

在PHP中用单个按钮从计算机上传图片

<html>
   <head>
      <title>File Upload Form</title>
   </head>
   <body>
      This form allows you to upload a file to the server.<br />
      <form action="getfile.php" method="post"><br />
         Type (or select) Filename: 
         <input type="file" name="uploadFile" />
         <input type="submit" value="Upload File" />
      </form>
   </body>
</html>
Run Code Online (Sandbox Code Playgroud)

我正在研究一种php语言.我正在从我的电脑上传一张照片.但是有两个按钮,即选择文件和上传文件.CHOOSE FILE用于从PC中选择图片,上传文件按钮用作SUBMIT按钮,但我需要一个按钮,点击它会打开我的电脑窗口浏览照片并选择它,它也可以作为提交按钮.用单个按钮有没有办法做到这一点

javascript php jquery image-uploading

3
推荐指数
1
解决办法
4809
查看次数

SharePoint要求

我是SharePoint新手.我需要一个工作流门户Web应用程序.请有人指导安装sharepoint以及在SharePoint中工作的硬件和软件要求是什么.

请告诉我哪个更好的Windows SharePoint Services或MOSS2007用于创建Web应用程序门户

sharepoint

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

jQuery/JavaScript:在jQuery中使用JavaScript数组

我是jQuery的新手,我有以下问题:

我制作了一个JS脚本,将用户输入与一组<h3>代表电影片头的元素进行比较.

userinput = userinput.toLowerCase(); 
var list = document.getElementsByTagName("h3"); //dit wordt de lijst met titels
var i = list.length,
    html, flag = false,
    matches = []; 

while (i--)//here, we loop through the list of <h3>'s
{
    var html = list[i].innerHTML.toLowerCase();
    if (-1 < html.indexOf(userinput))
    {
        flag = true;
        matches.push(list[i]); 
        list[i].className = "matched";
    }
}

if (!flag)//no match 
{if (-1 !== html.indexOf(userinput))
    alert('No match found !');
}
else//match!
{
    for (var i = 0; i < matches.length; i++)
    { …
Run Code Online (Sandbox Code Playgroud)

html javascript arrays jquery

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