所有问题

0 投票
1 回答
978 浏览

javascript - Cookie expiration date equals -1

I'm retrieving some cookies information and some of them have the expires property set to -1, does anyone knows what this means?

0 投票
1 回答
524 浏览

php - 条带将元数据传递给客户条带时出现无效哈希错误

我在创建客户时传递元数据,响应如附件中使用 php 中的条带 api 所示。但它抛出了无效的哈希错误。有人可以帮忙吗?

我现在被困了2天。在此处输入图像描述

0 投票
1 回答
105 浏览

linux - 无法在 Shell 脚本中保存进程的进程 ID

我只是在 Unix 中尝试 shell 脚本。我想捕获在端口号 1337 上运行的进程的进程 ID。所以我编写了以下代码:

并将其保存在一个名为auto.sh

现在,当我运行以下命令时:

./auto.sh

我得到下面给出的输出:

$process_id从来没有回声。所以我的猜测是,它没有被存储。

我查看了以下内容,但没有帮助

链接 1 链接 2

0 投票
1 回答
1005 浏览

angular - Angular 6 库

我正在使用 Angular 6 ( https://medium.com/@tomsu/how-to-build-a-library-for-angular-apps-4f9b38b0ed11 ) 开发一个库,但我正在阻止添加项目依赖项。我想创建一个独立于我的项目的库,它有自己的依赖项。我想修改 package.json 并在里面添加我的依赖项,但它不起作用。

然后我想在 ng-package.json 但同样的事情

angular-in-memory-web-api must be explicitly whitelisted.

帮我 :)

0 投票
1 回答
955 浏览

ios - iOS: Error Domain=NSCocoaErrorDomain Code=132001 '-save: on the context aborted' 在后台使用更新数据库核心数据/推送通知

当我尝试使用该命令在后台使用带有推送通知的 coreData 更新我的数据库时:

有一条错误消息无法更新从未插入的对象。我确切地说,当我在应用程序处于活动状态时执行此操作时,它运行良好,但是当我在后台使用它时,它不起作用(Error Domain=NSCocoaErrorDomain Code=134030)。

消息错误完成:

如何在后台进程中使用 coredata 更新我的数据库?

0 投票
1 回答
524 浏览

kendo-ui - 验证不适用于 Jquery 中 Kendo Grid UI 的 KeyDown 事件

我在 MVC 中为 Jquery 使用 Kendo UI。下面的代码可以很好地使用“Enter”和“Tab”按键事件移动下一个单元格,但不能通过按键事件进行验证,所以如果有任何解决方案,请与我分享。可编辑模式是“incell”。

提前致谢 !

0 投票
1 回答
2064 浏览

html - CSS counter-increment page on print view issue

I'm facing a issue on page counting on browser's Print View.

Creating a report with tables separated by categories I need to reset the counter by category and when we create a long data table with undetermined number of lines we can't count how many times the table header will be shown to determine how many pages will have that category.

Is there a way to count on print view how many times the header will be shown?

JSFiddle

https://jsfiddle.net/7prs03eh/3/

0 投票
1 回答
967 浏览

python - 如何让 Django Admin 缓存内联的选择选项?

使用 Django 1.11、Python 3.6

我对此一点运气都没有。我正在尝试优化一个缓慢的 Django 管理页面,由于大量select下拉列表和多个内联,该页面会进行大量重复的 SQL 查询。

我尝试过使用cacheops库和 Redis 存储,但根本没有缓存任何内容,即使我将所有内容设置为使用'*.*': {'ops': 'all', 'timeout': 60*60},. 我假设这可能是因为管理员似乎绕过了正常的 Django ORM 对象。

说到这,我尝试实现一个定制的对象管理器,它使用cachetools库的 TTLCache 类进行缓存:

然后我的模型类:

这也没有任何作用。起初我认为这是由于管理员没有使用定制的对象管理器,但我在 StackOverflow 上发现了一条评论,认为使用管理器添加 Admin 类应该可以解决这个问题 - 但在这种情况下显然不是,因为加载时一个具有角色的管理页面select我在日志中得到了这个:

2018-06-04 11:49:06,350 [DEBUG] django.db.backends: (0.003) QUERY = 'SELECT [cms_role].[id], [cms_role].[date_added], [cms_role].[date_modified], [cms_role].[name] FROM [cms_role] ORDER BY [cms_role].[name] ASC' - PARAMS = (); 参数=()

** 跳过此重复 20 次 **

2018-06-04 11:49:07,572 [DEBUG] django.db.backends: (0.002) QUERY = 'SELECT [cms_role].[id], [cms_role].[date_added], [cms_role].[date_modified], [cms_role].[name] FROM [cms_role] ORDER BY [cms_role].[name] ASC' - PARAMS = (); 参数=()

那是超过一秒钟的重复 SQL 查询!我该如何阻止它这样做?

0 投票
1 回答
463 浏览

c# - Task.WaitAll,获取所有异常和单个任务持续时间

我正在开发一个实用程序,它将使用 ExecuteNonQueryAsync 并行执行多个 SqlCommand。该实用程序仅应在所有请求完成后返回,因此我使用的是 WaitAll。

碰巧,这个实用程序是一个 SQL CLR 存储过程。这排除了使用 Task.Run()

我想捕获所有发生的个别异常,这似乎工作正常。我现在正在尝试添加获取数组中每个单独任务的已用持续时间的功能。

这是代码的核心,没有任何经过的时间信息:

现在,我正在努力弄清楚如何获取每个单独的 ExecuteNonQueryAsync 请求的经过时间。

我的第一个想法是创建一个秒表数组,并在 executeSQL 调用中添加一个秒表参数,然后将手表数组传递给 GetResults 函数:

我可以在 executeSQL 函数中调用 ExecuteNonQueryAsync 之前启动秒表。但是我什么时候可以阻止它?

这就是我试图解决问题的方式。我想我会添加一个延续来停止秒表,然后等待延续。但是此代码无效(无法将类型 'System.Runtime.CompilerServices.ConfiguredTaskAwaitable>' 隐式转换为 'System.Threading.Tasks.Task'

0 投票
1 回答
81 浏览

php - 使用 php 在选择选项上未显示图像

我有一个表格,应该在用户姓名的右侧显示他们上传的图片。我已经使用以下方式上传了他们的图片:

下面是显示用户图像及其姓名的代码:

图像不会在进入用户页面时显示。只有名字会出现。我愿意学习并对您可能拥有的任何解决方案持开放态度。谢谢

0 投票
1 回答
85 浏览

android - 相对布局中的颜色问题 onFocus/onClick

我的布局风格有一些问题,实际上在 Android 5.1.1 上它工作正常,当我按下 RelativeLayout 时,它上面的文本会改变颜色,所以它看起来像是被选中的,而且看起来更漂亮。

在 Android 7.0 中,当 RelativeLayout 为 onClick 或 onFocus 时,它会呈现出可怕的橙色,所以我希望它看起来像在 Android 5.1.1 中...... 在此处输入图像描述

在此处输入图像描述

这是我在这个视图中的 xml 代码

0 投票
1 回答
84 浏览

javascript - 指定从函数返回的键时,可选对象道具无法读取

这是代码的要点,您可以在此处尝试。为什么会失败?

错误信息是这样的

0 投票
1 回答
63 浏览

mysql - SQL treats similar to English and Swedish characters

Statement 1

Statement 2

I have unique constraint on column name.

Statement 2 throwing following exception.

I tried to configure database with following settings,

  1. Collation = utf8 - Defalut collation
  2. Collation = utf8_swedish_ci

But, SQL is not able to differentiate between o and Ö due to that it is throwing exception.

Can anyone assist me how to resolve this issue.

0 投票
3 回答
569 浏览

ios - Swift index of array of Dictionary

I have two arrays:

I am appending deletes into array based off index:

Else where in my code, I am now trying to get the index of self.array of the item in delete:

However on I am getting this error on let i

Cannot invoke 'index' with an argument list of type '(of: [String : Any])'

What am I doing wrong? How do I get the index of array of dictionary?

0 投票
2 回答
56 浏览

reactjs - how to toggle a class on a div in react project for opening a mobile menu in mobile

This is my current code which shows up a hamburger menu.

I want to add a new class "open" to the existing class "navlines". how can i do this in react. i just started learning react a few days ago.

0 投票
0 回答
2904 浏览

php - 我在哪里存储我的令牌服务器端?

我(自己)为我的 ExtJS 应用程序制作了一个身份验证系统。

当我登录时,我的服务器会生成一个由我的客户端存储的令牌。当我必须向服务器发送请求时,我将令牌放在请求标头中,但是检查令牌服务器端的常用方法是什么?

我是否必须将令牌存储在我的数据库中,进行选择查询等?

以另一种方式吗?为每个请求再查询我的数据库 1 次对我来说似乎不是一个好主意(但也许我错了)

0 投票
1 回答
40 浏览

r - 矩阵的一行及其在R中的同一矩阵中反转

有没有办法找到矩阵的一行是否包含在矩阵中但以相反的方式?

例如,这发生在以下矩阵中W

在第一排和第三排之间。

我已经开发了以下代码,但它仅在矩阵中以相反的方式存在行时才有效:

所以,在前面的矩阵W中,我的代码不起作用,因为NA在代码的第二行的结果中。

我们如何解决这个问题?

0 投票
2 回答
1612 浏览

c# - 带有 api 版本控制的 Autofac 和 swagger 给出异常

从 Visual Studio 运行我的项目时出现以下异常,它是一个 ASP.NET Core 项目。

似乎依赖项注册了两次,因此“System.ArgumentException:已添加具有相同键的项目”。

它似乎也与路线有关,但我找不到调试它的方法。

它似乎也与 Api 中的版本控制有关,因为如果我删除此代码,异常就会消失。

任何人都见过这个或知道如何调试它。

Autofac.Core.DependencyResolutionException:在激活特定注册期间发生错误。有关详细信息,请参阅内部异常。注册:Activator = ISwaggerProvider (DelegateActivator), Services = [Swashbuckle.AspNetCore.Swagger.ISwaggerProvider], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope 在激活特定注册过程中发生错误。有关详细信息,请参阅内部异常。注册:Activator = ApiDescriptionGroupCollectionProvider (ReflectionActivator), Services = [Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionGroupCollectionProvider], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope 在激活特定注册过程中发生错误. 有关详细信息,请参阅内部异常。注册:Activator = IApiDescriptionProvider[] (DelegateActivator), Services = [System.Collections.Generic.IEnumerable1[[Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionProvider, Microsoft.AspNetCore.Mvc.Abstractions, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DefaultApiDescriptionProvider (ReflectionActivator), Services = [Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionProvider], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DefaultInlineConstraintResolver (ReflectionActivator), Services = [Microsoft.AspNetCore.Routing.IInlineConstraintResolver], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions1[Microsoft.AspNetCore.Routing.RouteOptions])' 类型为'DefaultInlineConstraintResolver'。已添加具有相同密钥的项目。(详见内部异常。)(详见内部异常。)(详见内部异常。)(详见内部异常。)(详见内部异常。)(详见内部异常。)

0 投票
1 回答
192 浏览

session - Tensorflow Graph,用于交叉验证的会话管理

在 Tensorflow 中实施交叉验证时,管理(初始化、关闭、重置)会话和图表的正确方法是什么?

我应该为每个折叠重置会话和图表,还是在整个过程中保持一个会话更好/可能?做后者的一个优点是资源在整个过程中都是绑定的,例如,当我在处理/保存折叠之间的结果时,防止在同一台机器上运行的一些不相关的进程占用 GPU。

保持相同的图形/会话并简单地通过以下方式重新初始化参数是否足够:

另外,我想理想情况下,应该为每个折叠单独保存摘要(可能还有检查点?)。

0 投票
1 回答
290 浏览

reactjs - react-router 切换和404页面

我不想使用 Switch,因为我想利用多个组件使用当前 url 来更新自己。但我必须使用 Switch,因为我想要一个 404 页面。

当然,我使用的是 react-router v4。任何人都可以指出我的解决方案吗?

0 投票
0 回答
463 浏览

ios - 节点快速会话未在 iPhone IOS 中持续存在

我有一个使用 Angular 和 Node (Nest JS) 的应用程序,在服务器端我使用的是 express-session。在我的中间件中,我将登录用户添加到会话中:

当用户尝试使用 Iphone 登录时,他无法登录。调试问题后,我发现每个请求都有不同的 sessionId。我可以看到,在会话中初始化用户之后它工作正常,但是下一个请求是空的(没有用户对象)并且有一个新的 id。

此问题仅在 IOS 中出现。

我确实尝试更改 express-sessions 选项:maxAge、httpOnly、resave、saveUninitialized,但没有任何效果。

这些是我的明确定义:

0 投票
1 回答
831 浏览

jpa - EntityManager 在 DAO 中为空,使用 @PersistenceContext 和 transaction-type="JTA"

我面临在 DAO 类中注入实体管理器的问题,我搜索了很多解决方案,但无法解决这个问题。

我有 EJB Bean 类

DAO 类

Persistence.xml 如下

请帮助我解决这个问题。我是 EJB 世界的新手!

0 投票
2 回答
890 浏览

emv - 应用程序交换配置文件 (AIP) 是否包含在 CDA 中?

基本上是标题,但在更广泛的背景下:终端有没有办法验证 AIP 是卡真正发送的,而不是在中间人攻击中被替换的?

0 投票
1 回答
136 浏览

json - 节点无法读取未定义的属性

我正在为 foodtruck 制作 api 用于我添加的练习

食品卡车模型中的几何图形,我添加了

帖子中的几何图形以在用户请求时从用户那里获取坐标数据,但是当我尝试添加诸如(POST)http://localhost:3005/v1/foodtruck/add之类的数据时

它返回

我仍然很困惑为什么它返回未定义的坐标

0 投票
1 回答
1682 浏览

android - Android camera and portrait rotation

I have an issue in my Android App, I followed this article to take picture in my application and it works fine but unfortunately the picture is in landscape mode instead of portrait mode. I have found several posts on SO and also articles on the net concerning this issue, from what I understand this behavior is not Android behavior but device behavior, and it may change from a device to an other.

So the question is : when I get the picture from the intent, how do I know if the taken picture needs to be rotated or not?

Here you can see the capture taken with the emulator (I have same behavior on my Sony Xperia) :

enter image description here

And then when I display it in an ImageView :

enter image description here