小编Azi*_*ziz的帖子

测试proejct测试将不会执行:无法识别的配置部分entityFramework

当我尝试运行测试时,我的app.config中的测试项目出现以下错误:

Result Message: 
Test method MYTESTPROJ.Repositories.MYREPO.MY_TEST threw exception: 
System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception. ---> 
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> 
System.Configuration.ConfigurationErrorsException: Unrecognized configuration section entityFramework. 
(C:\Dev\trunk\MYTESTPROJ\bin\Debug\MYTESTPROJ.dll.config line 20)
Result StackTrace:  
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
   at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
   at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
 --- End of inner exception stack trace ---
    at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.GetSection(String sectionName)
   at System.Configuration.ConfigurationManager.get_ConnectionStrings()
   at System.Data.Entity.Internal.AppConfig..ctor()
   at System.Data.Entity.Internal.AppConfig..cctor()
 --- End of inner exception stack trace ---
    at System.Data.Entity.Internal.AppConfig.get_DefaultInstance()
   at System.Data.Entity.Internal.LazyInternalConnection..ctor(DbContext context, String nameOrConnectionString) …
Run Code Online (Sandbox Code Playgroud)

c# asp.net entity-framework

25
推荐指数
1
解决办法
2万
查看次数

如何确定颜色是接近白色还是黑色?

我正在处理肤色,并想确定一个人的肤色是否接近白色或黑色.

所以给定一种颜色,如何确定它是否更接近白色肤色或黑色肤色?

我尝试了一些noobish算法,有谁知道我怎么做到这一点?

java colors image-processing

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

Xna将重力添加到2d精灵

我试图在我的第一个xna 2d游戏中模拟引力.我有以下内容

        //Used for Jumping
    double elapsedAirTime = 0.0;
    double maxAirTime = 8.35;
    //End Jumping
Run Code Online (Sandbox Code Playgroud)

所以我试图在elapsedAirTime <maxAirTime时将精灵向上移动一定量但是,有一些问题我的代码似乎只在这段时间内将精灵向上移动一次而不是多次.这是我的"player.cs"类中的代码,或者类的更新方法.

if (newState.IsKeyDown(Keys.Space))
        {
            if(oldState.IsKeyUp(Keys.Space))
            {
                //if we are standing or jumping then change the velocity
                if (playerState == PlayerStates.Standing)
                {
                    playerState = PlayerStates.Jumping;
                    this.position.Y -= (float)(30.0 + ((1.2)*elapsedAirTime)*elapsedAirTime);
                }
            }
        }
        //if we are jumping give it some time
        if (playerState == PlayerStates.Jumping)
        {
            if ((elapsedAirTime < maxAirTime) && position.Y < 3)
            {
                this.position.Y -= (float)(30.0 + ((1.2) * elapsedAirTime)*elapsedAirTime);
                elapsedAirTime += gameTime.ElapsedGameTime.TotalSeconds; …
Run Code Online (Sandbox Code Playgroud)

c# xna game-physics

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

ASP.Net MVC3 SQL连接字符串

我正在APPHARBOR上创建一个应用程序,我有一个用于查询SQL服务器的实体模型.以下字符串给我一个错误:

<add name="TraxzDBEntities" 
           connectionString="metadata=res://*/Models.DBModel.csdl|res://*/Models.DBModel.ssdl|res://*/Models.DBModel.msl;
           provider=System.Data.SqlClient;
           provider connection string='Data Source=d5d3955e-1183-4e10-8892-9f9d005af0a8.sqlserver.sequelizer.com;
           User ID=**; 
           Password=**;
           Initial Catalog=dbd5d3955e11834e1088929f9d005af0a8;Integrated Security=true;
           MultipleActiveResultSets=True'"
      providerName="System.Data.EntityClient" />
Run Code Online (Sandbox Code Playgroud)

以下是堆栈跟踪:说明:在执行当前Web请求期间发生了未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.

异常详细信息:System.ArgumentException:不支持关键字:'server'.

来源错误:

在执行当前Web请求期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息.

堆栈跟踪:

[ArgumentException: Keyword not supported: 'server'.]
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5110868
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
   System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +112
   System.Data.EntityClient.EntityConnection..ctor(String connectionString) +77
   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, ConnectionStringSettingsCollection connectionStrings) +309
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +52
   System.Data.Entity.Internal.LazyInternalConnection.get_ConnectionHasModel() +10
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +265
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +62
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15
   System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +37
   System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +63
   Traxz.Models.TraxzRepository.getListOfUserExerciseSessions(Guid userID) in …
Run Code Online (Sandbox Code Playgroud)

sql connection-string visual-studio-2010 asp.net-mvc-3 appharbor

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

将Java复杂对象转换为Json

我需要转换以下类:

package comS309.traxz.data;

import java.util.Collection;

import org.json.JSONException;
import org.json.JSONObject;

public class ExerciseSession {

    public String DateCreated;
    public String TotalTime;
    public String CaloriesBurned;
    public String AvgSpeed;
    public String SessionName;
    public String Distance;
    public String SessionType;
    public String UserId;
    public Collection<LatLon> LatLons;
}
Run Code Online (Sandbox Code Playgroud)

LatLon如下:

public class LatLon {

    public String LatLonId;
    public String Latitude;
    public String Longitude;
    public String ExerciseSessionId;
    public String LLAveSpeed;
    public String Distance;
}
Run Code Online (Sandbox Code Playgroud)

所以Class ExerciseSession有一组LatLon对象.现在我需要将ExerciseSession类从java转换为Json格式并将其发送到我的服务器.

我在Android操作系统上这样做,如果这很重要.

我目前的解决方案是:

JSONObject ExerciseSessionJSOBJ = new JSONObject();
ExerciseSessionJSOBJ.put("DateCreated", this.DateCreated);
            ExerciseSessionJSOBJ.put("TotalTime", this.TotalTime);
            ExerciseSessionJSOBJ.put("CaloriesBurned", this.CaloriesBurned); …
Run Code Online (Sandbox Code Playgroud)

java android json

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

目标C运行测试时:定义类而不指定基类

我不知道发生了什么,因为我对目标c和IOS开发相当新.

当我尝试运行我的测试时,使用默认测试框架我收到以下错误:

        ..../Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.m:4:1: 
Class 'EXPFixCategoriesBugEXPMatcher_beCloseToWithinMatcher' 
    defined without specifying a base class
Run Code Online (Sandbox Code Playgroud)

以下代码会产生问题(但它不是我的,我相信它是我通过pod使用的其中一个库的一个peice):

#import "EXPMatchers+beCloseTo.h"
#import "EXPMatcherHelpers.h"

EXPMatcherImplementationBegin(_beCloseToWithin, (id expected, id within)) {
  prerequisite(^BOOL{
    return [actual isKindOfClass:[NSNumber class]] &&
        [expected isKindOfClass:[NSNumber class]] &&
        ([within isKindOfClass:[NSNumber class]] || (within == nil));
  });

  match(^BOOL{
        double actualValue = [actual doubleValue];
        double expectedValue = [expected doubleValue];

        if (within != nil) {
            double withinValue = [within doubleValue];
            double lowerBound = expectedValue - withinValue;
            double upperBound = expectedValue + withinValue;
            return (actualValue >= lowerBound) && (actualValue <= …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios cocoapods

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

编译单元测试时找不到-lPods-test clang的库

我试图运行我的单元测试,我得到以下错误:

    ld: library not found for -lPods-test clang: error: 
linker command failed with exit code 1 (use -v to see invocation)  

Ld /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator/MYIOSPROJProjectTests.xctest/MYIOSPROJProjectTests normal i386
    cd /Users/AUSER/Documents/Dev/MYIOSPROJProject/MYIOSPROJProject
    setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator -F/Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Intermediates/MYIOSPROJProject.build/Debug-iphonesimulator/MYIOSPROJProjectTests.build/Objects-normal/i386/MYIOSPROJProjectTests.LinkFileList -bundle_loader /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator/MYIOSPROJProject.app/MYIOSPROJProject -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework CFNetwork -framework CoreData -framework CoreGraphics -framework Foundation -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework XCTest -framework UIKit -framework Foundation -lPods-test -lPods-MYIOSPROJProjectTests …
Run Code Online (Sandbox Code Playgroud)

iphone unit-testing objective-c ios cocoapods

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

从浏览器中检测 USB 设备是否已插入 Javascript

是否有基于 Javascript 的机制,我可以通过浏览器检测用户是否插入了特定的 USB 设备?

javascript browser google-chrome

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

Andengine粒子碰撞效果(Android游戏开发)

我有兴趣开发一个我可以称之为的粒子引擎 .createCollisionEffect(pos x, pos y, float duration);

并且引擎将在指定的持续时间内创建随机方向的粒子杂散.我发现以下代码,但我想使用3种不同的纹理,所以它随机选择一个,但我不知道如何管理时间和3种不同的纹理:我发现以下代码:

    public ParticleSystem createParticleSystem(final TextureRegion textureRegion) {
    //X & Y for the particles to spawn at.
    final float particlesXSpawn = 400;
    final float particlesYSpawn = 300;

    //Max & min rate are the maximum particles per second and the minimum particles per second.
    final float maxRate = 10;
    final float minRate = 5;

    //This variable determines the maximum particles in the particle system.
    final int maxParticles = 100;

    //Particle emitter which will set all …
Run Code Online (Sandbox Code Playgroud)

android particle-system andengine

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