小编meh*_*kin的帖子

如何使用 Deno 检查文件或目录是否存在?

Deno TypeScript 运行时具有内置函数,但它们都没有解决检查文件或目录是否存在的问题。如何检查文件或目录是否存在?

typescript deno

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

使用Javascript将CSV数据转换为JSON格式

我有CSV格式数据的数据,并希望使用Javascript转换为JSON格式.

以下是csv格式:

[Test.csv] 
id;name;author
integer;string;authors:n
1;To Kill an Angry Bird;1

[authors.csv] 
id;name
integer;string
1;Harper Lee
2;JRR Tolkien
3;William Shakespeare
Run Code Online (Sandbox Code Playgroud)

我想和他们的作者一起得到所有的书.那么请问我如何使用Javascript实现它.

javascript jquery asp.net-mvc-4

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

无法以编程方式更新社交个人资料中的InfluenceScore

我们有一个新设置的CRM 2015内部部署环境; 我们正在努力摆弄社会关怀框架.

我们只是想InfluenceScore使用Web服务调用在我们的自定义应用程序中更新社交个人资料记录的参数,但它似乎对该字段没有影响.奇怪的是,它没有抛出任何异常,服务电话根本不会抱怨.一切似乎都很正常,除了字段没有更新.

以下是我们代码的相关部分;

// Retrieving the social profile record with all it's columns
Entity socialProfile = GetSocialProfileByName(socialProfileName);

double score = 0;
string scoreField = "influencescore";

// If socialProfile contains our attribute, set it appropriately, otherwise add the attribute
if(socialProfile.Contains(scoreField)) 
{
    score = socialProfile.GetAttributeValue<float?>(scoreField).GetValueOrDefault(0) + 10; // Add 10 to the existing score.
    socialProfile[scoreField] = score;
}
else 
{
    socialProfile.Attributes.Add(scoreField, 10);
}

// Update the record.
service.Update(socialProfile);
Run Code Online (Sandbox Code Playgroud)
  • 社会关怀框架是否允许InfluenceScore …

c# dynamics-crm dynamics-crm-2015

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

nodejs:找不到模块'护照'

在探索Node.js之初,我遗漏了一些相当基本的东西.我正在尝试使用passportjs身份验证构建一个小应用程序.

我的内容如下app.ts:

import passport = require("passport");
Run Code Online (Sandbox Code Playgroud)

以及我的package.json:

{
    "name": "ftct",
    "version": "0.0.0",
    "description": "ftct",
    "main": "app.js",
    "author":
    {
        "name": "Mark.Norgate",
        "email": ""
    },
    "dependencies":
    {
        "express": "3.4.4",
        "jade": "*",
        "passport": "^0.3.2",
        "stylus": "*"
    }
}
Run Code Online (Sandbox Code Playgroud)

但是,Visual Studio 2015抱怨:

Build: Cannot find module 'passport'.
Run Code Online (Sandbox Code Playgroud)

我错过了什么?我已经阅读了一些关于passportjs的文档,但到目前为止没有任何内容表明问题可能是什么.

visual-studio node.js passport.js

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

React.JS新的CSS模块

我一直在关注Udemy上的《 React Complete Guide》上的教程,但是似乎有点过时了,因为弹出文件后,我看不到相同的代码。我认为它是今天更新的,但是作为一个完整的初学者,我不知道如何继续我的课程,因为我不知道如何导入具有唯一ID的类或如何使CSS模块正常工作...谢谢您需要您的帮助。

他看到的是: 从第162行开始到169 这是他的代码

 test: /\.css$/,
 use: [
   require.resolve('style-loader'),
   {
     loader: require.resolve('css-loader'),
     options: {
       importLoaders: 1,
       modules: true,
       localIdentName: '[name]__[local]__[hash:base64:5]'
     },
   },
Run Code Online (Sandbox Code Playgroud)

我所看到的: 从第34行到41行 这是我的代码

// common function to get style loaders const getStyleLoaders =
(cssOptions, preProcessor) => {   const loaders = [
 require.resolve('style-loader'),
 {
   loader: require.resolve('css-loader'),
   options: cssOptions,
 },
Run Code Online (Sandbox Code Playgroud)

我还看到的是/\.css$/;第28到32行有新变量

// style files regexes 
const cssRegex = /\.css$/; 
const cssModuleRegex = /\.module\.css$/; 
const sassRegex = /\.(scss|sass)$/; 
const sassModuleRegex = /\.module\.(scss|sass)$/;
Run Code Online (Sandbox Code Playgroud)

javascript css reactjs webpack

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

占位符在页面加载时打开jQuery UI自动完成组合框(IE10)

我正在使用jQuery UI自动完成组合框小部件.当我在我的组合框中添加占位符时,默认情况下会打开自动完成框.

仅在IE10及更高版本上发生.

这是我的代码:

 _create: function () {
            this.wrapper = $("<span>")
            .addClass("custom-combobox")
            .insertAfter(this.element);
            this.element.hide();
            this._createAutocomplete();
            this._createShowAllButton(); 
            this.input.attr("placeholder", this.element.attr('placeholder'));
        },
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui autocomplete placeholder

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

如何安排PHP的循环值?

这是我的座位清单安排的例子.我必须显示一些座位对齐方式的变化.

$rows=($data['seat_type']==1)?3:4;
$cols=round($numofseats /$rows) ;
$rowCssPrefix= 'row-';
$colCssPrefix= 'col-';
$seatWidth= 35;
$seatHeight= 35;
$seatCss= 'seat';
$selectedSeatCss= 'selectedSeat';
$selectingSeatCss= 'selectingSeat';
$window_rows = ($data['seat_type']==1) ? array(0,2) :array(0,3);

for ($i = 0; $i < $rows; $i++) {
    $seat_w=(in_array($i,$window_rows))?'W':'A';
    for ($j = 0; $j < $cols; $j++) {
        $seatNo = ($i + $j * $rows + 1);
        if($seatNo <= $numofseats)
        {
            $className = $seatCss . ' '.$rowCssPrefix .$i.' '.$colCssPrefix .$j;                                      if($j % $cols==0) echo '<br>';
            if(!in_array($seatNo,$booked_seats)) {
                echo'<li class="' . $className.'" style="top:'. ($i *$seatHeight).'px;left:'. …
Run Code Online (Sandbox Code Playgroud)

php loops

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

如何更改PowerShell默认模块安装文件夹?

有没有办法更改PowerShell模块安装文件夹(模块放置在Install-Module之后的文件夹)?这就是为什么我想这样做:

  • 我使用的是 Windows 10,PowerShell 5.1.17763.503
  • 我的默认安装文件夹是 Documents\WindowsPowerShell\Modules
  • 我的文档文件夹已移至包含,符号(公司政策)的位置
  • PS 有一个错误加载 .ps1,其中包含类并,在文件路径中具有(类似于此问题。)

我试过的:

  • 我认为安装文件夹是 $env:PSModulePath 中的第一个文件夹,我可以更改它。当我打开“编辑系统环境变量”时,我看到安装文件夹不在$env:PSModulePath. 当您启动 PowerShell 时,它会自动添加到变量中。

powershell

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