首先让我说我有 Linux 背景并且在 Windows 上开发对我来说是相当新的。
我正在处理我在 Visual Studio 中打开的 ASP.NET 项目。该项目最初设置为通过 IIS 运行。VS 很有帮助地问我是否想尝试 IIS Express,我说是的。该应用程序最初有一些小问题,但那是因为代码既旧又庞大。解决这些问题后,应用程序加载正常,但任何静态文件除外。对于文件系统上实际存在的资源,我收到 404 Not Found 错误。
您在照片中看到的物理路径存在于 Web.config 文件旁边的文件夹中。我可以从作为图形目录的同级目录的 exec 目录加载 aspx 文件。图形目录是我试图在这张图片中加载的 favicon.ico 文件所在的位置。
我今天已经阅读了很多关于 IIS 和 IIS express 的文档,但他们都没有提到必须对静态文件做任何特殊的事情。也许我只是厚。如果需要我的 Web.config,请告诉我,我可以在此处附加它。
编辑:
1) 在这方面取得了一些进展。在成熟的 IIS 下,我也遇到了完全相同的错误。我的静态内容不显示。
2)这是请求的web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5" /> …Run Code Online (Sandbox Code Playgroud) 我有一个必须渲染的项目列表。我有一个函数viewItem可以渲染一个项目。我做的很简单List.map viewItem items,现在我有一个可以显示的项目列表。
我的观点有四列。如何将此列表分为四个列表,其中包含原始列表中的所有元素?
这就是我现在的做法,但是我必须缺少一些东西。我希望能够将其拆分成五列甚至六,而无需编写col4 = ...和col5 = ...每一次。
splitColumns : Int -> Array a -> Array (List a)
splitColumns cnum xs =
let
ixdList =
Array.toIndexedList xs
in
List.filterMap
(\a ->
if modBy 4 (Tuple.first a) == cnum then
Just (Tuple.second a)
else
Nothing
)
ixdList
viewItems : Array Item -> Html msg
viewItems items =
let
itemsHtml =
Array.map viewItem items
col0 =
splitColumns 0 itemsHtml
col1 =
splitColumns 1 …Run Code Online (Sandbox Code Playgroud) 我的 json 看起来像这样:
{"name": "providerWithVal", "value": "example"}
Run Code Online (Sandbox Code Playgroud)
或者像这样:
{"name": "provider2"}
Run Code Online (Sandbox Code Playgroud)
或者
{"name": "provider3"}
Run Code Online (Sandbox Code Playgroud)
我的 Elm 联合类型定义如下:
type Provider
= ProviderWithVal String
| Provider2
| Provider3
Run Code Online (Sandbox Code Playgroud)
我可以为没有附加数据的联合类型编写解码器。但ProviderWithVal需要一个字符串,我不知道如何让它全部工作。
这是我到目前为止:
import Json.Decode as D
providerDecoder : D.Decoder Provider
providerDecoder =
D.field "name" D.string |> D.andThen providerNameDecoder
providerNameDecoder : String -> D.Decoder Provider
providerNameDecoder string =
case string of
"providerWithVal" -> D.succeed ProviderWithVal
"provider2" -> D.succeed Provider2
"provider3" -> D.succeed Provider3
_ -> D.fail <| "Invalid provider: " ++ string
Run Code Online (Sandbox Code Playgroud) 我正在将 Spring Boot 应用程序从 maven 迁移到 bazel。我已经将我的工作区中 pom.xml 的所有依赖项列为 maven_jar()s。我收到一个错误,说 org.springframework.boot.web.support 包不存在。它属于我已经包含的 org.springframework.boot jar。我能做些什么来解决这个问题?
我的 pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.abc</groupId>
<artifactId>abcclient</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>abcclient</name>
<description>ABC Client</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> …Run Code Online (Sandbox Code Playgroud) 我有三个功能
boombangs xs = [if x < 10 then "BOOM" else "BANG" | x <- xs odd x]
length' xs = sum [1 | _ <- xs]
removeNonUppercase st = [x | x <- st, x `elem` ['A'..'Z']]
Run Code Online (Sandbox Code Playgroud)
这是我得到的每个函数的类型(类型签名?)
*Main> :t boombangs
boombangs :: Integral a => [a] -> [[Char]]
*Main> :t length'
length' :: Num a => [t] -> a
*Main> :t removeNonUppercase
removeNonUppercase :: [Char] -> [Char]
Run Code Online (Sandbox Code Playgroud)
当我传递一组int来删除NonUppercase或一个字符串到boombangs时,Haskell应该给我一个错误.它也是,但是当我没有在任何地方指定类型时,它怎么知道它是错的.
另外,为什么boombangs和removeNonUppercase的类型不同,即使它们在相同的输入上工作.
如果问题看起来含糊不清或完全无知,我道歉.我刚开始学习你是一个Haskell而我正在慢慢地围绕这个范例,主要是在C和python中编程.
任何有关haskell和类型系统的更多信息的资源也将受到赞赏.