core

Play Framework 2.1 Remove a core dependency

谁都会走 提交于 2019-12-08 01:57:06
问题 since a few day now i'm trying to use Joda-time 1.6.2 on a play project. I know the play framework already come with the Joda-time 2.1 and it should be compatible with 1.6.2 according to joda-time site. I'm trying to write an application that ask the user for a LocalDateTime and save the class with the attributes on a MongoDB using morphia. I'm facing a problem, i have to use a class that are currently using joda-time 1.6.2 and i cannot change it dependency neither update it to 2.1. Since i

How GetCurrentProcessorNumber() works? CPU core of a thread at runtime?

坚强是说给别人听的谎言 提交于 2019-12-07 22:26:13
问题 Is there any smooth way to find out the CPU core id of a thread running in a multithreading code during runtime? I tried to use GetCurrentProcessorNumber(), but it seems it is not giving the CPU core id where the individual threads are running. The code I have been using is: using System; using System.Threading; using System.Threading.Tasks; using System.Diagnostics; using System.Runtime.InteropServices; class S { [DllImport("kernel32.dll")] static extern int GetCurrentProcessorNumber();

Generate core file with original process name

给你一囗甜甜゛ 提交于 2019-12-07 21:22:49
问题 I have a binary which will create multiple threads. Now when one of those threads crashes, I want the name of the core file generated to contain the original process name instead of the thread name. When I use the %e specifier, it gives the thread name only (I think it is because in Linux, all threads are considered as LWPs). How do I get the original process which created the thread in the core file name? I looked at the man file, but it does not have any other specifier which I can use. 来源:

ASP.NET Core 十种方式扩展你的 Views

时光毁灭记忆、已成空白 提交于 2019-12-07 15:59:40
原文: ASP.NET Core 十种方式扩展你的 Views 原文地址:http://asp.net-hacker.rocks/2016/02/18/extending-razor-views.html 作者: Jürgen Gutsch 翻译: 杨晓东(Savorboard) 现在,已经有很多种方式来扩展Razor视图了,我们循循渐进,先从最简单的开始。 如果你之前熟悉MVC5(以及之前的MVC)中的视图的话,有一部分你应该已经很熟悉了。在新的ASP.NET Core 中,那些你熟悉的方式有一部分仍然能用,只是Core版本针对视图又添加了一些东西。这篇文章,我们就来一起看看吧。 #1:数据视图(Typed Views) 这是一个不具有动态内容的最基本的一个视图,就是你定义一个ViewModel , 然后ViewModel具有一些默认值,在视图上直接呈现而已。定死的ViewModel,好像不是很常见,以至于你使用Visual Studio新建一个默认的Web应用程序的话,都看不到它。它就看起来像一个 *.cshtml 结尾的HTML文件,但是,cshtml文件却是服务端可以解析的一种文件,所以你可以在里面使用一些Razor语法,比如HtmlHelpers,UrlHelpers等。同样,你可以使用 ViewBag 或者 ViewData

How to enable core dump in my Java - Mac OS X

我只是一个虾纸丫 提交于 2019-12-07 12:52:01
问题 Honestly i'm new using Mac OS X El Capitan, i tried to create some Java program and runing it using eclipse Neon. But i got this error : # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007fff9c23616f, pid=810, tid=0x0000000000000a0b # # JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode bsd-amd64 compressed oops) # Problematic frame: # C [libobjc.A

java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)

☆樱花仙子☆ 提交于 2019-12-07 09:02:51
问题 I have a HTTP server in Android. I create a new thread for each of the HTTP requests as in the link mentioned: http://hc.apache.org/httpcomponents-core-ga/httpcore/examples/org/apache/http/examples/ElementalHttpServer.java. When I issue multiple GET requests, sometimes I am getting an exception like the following: 01-22 10:28:22.779: W/System.err(2019): java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer) 01-22 10:28:22.779: W/System.err(2019): at libcore.io

基于Centos7安装Solr7.4服务搭建

梦想的初衷 提交于 2019-12-07 03:17:21
1.准备工作 目前最新版本solr-7.4.0,下载solr-7.4.0 这里写链接内容 下载 Java JDK8 下载并安装jdk1.8 这里写链接内容 2、安装JDK rpm -ivh jdk-8u131-linux-x64.rpm 3、配置JDK环境变量 vim /etc/profile 在最后面加上下面这段 JAVA_HOME=/usr/java/jdk1.8.0_172-amd64 CLASSPATH=%JAVA_HOME%/lib:%JAVA_HOME%/jre/lib PATH= P A T H : P A T H : //--> JAVA_HOME/bin:$JAVA_HOME/jre/bin export PATH CLASSPATH JAVA_HOME 4、检查是否完成安装 java -version javac 二、安装Solr 1、创建目录 [root@localhost opt]# mkdir /solr 把solr-7.4.0.tgz复制到目录 /solr,接着解压。 [root@localhost /]# tar -zxvf solr-7.4.0.tgz 2、启动Solr 进入 /opt/solr/solr-7.4.0/bin 目录 ./solr stop -all 关闭solr服务 ./solr start -force 开启solr服务 .

Remove core from Datastax Solr

纵然是瞬间 提交于 2019-12-07 02:18:46
问题 I have a Cassandra table for which I have enabled Solr indexing, using command dsetool create_core <keyspace>.<table> [<option> ...] Question is how to delete this core? I have tried unload via HTTP Api which returned UNLOAD unsupported! 回答1: Update, unload_core is now avaliable as of DSE 4.8 -- DSP-1533 Verbatim from the DataStax docs Unloading a Solr core To disable full text search on a core, unload the core without removing its backing table. To simplify Solr code unloading, use dsetool

GRADLE遇见“设备未就绪”

谁都会走 提交于 2019-12-06 23:28:49
今天在使用Gradle时,遇到一个很奇怪的问题,我在本机上运行的很好,但在另外一台机器上总是报错 错误内容: java.io.IOException: 设备未就绪。 at java.io.WinNTFileSystem.canonicalize0(Native Method) at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:375) 于是,我就百度,大概告诉我的是,确认路径是否正确。 刚开始很迷茫,不知道要确认是哪里的路径,然后,我发现,那台机器上,没有配置gradle环境。 配好环境后,还是报错。 第一次会提示一个buildship的错误,于是,我就想是不是buildship插件没装好。。 再然后,我干脆启用eclipse的错误报告,查看详细内容,发现,确实是读取文件路径出了问题 这时候我想到了之前修改过一次路径。然后就一个个的配置文件排查。 最终发现,问题出在 org.eclipse.buildship.core.prefs 里面的路径全都是我提交上去的路径,也就是我本机的路径,刚好那台服务器上找不到这个盘符。所以就报了一个设备未就绪的错误。 修改配置后,一切正常。 所以,Gradle项目下下来之后,还要配置好org.eclipse.buildship.core.prefs里面的具体路径

高并发性能调试经验分享

ε祈祈猫儿з 提交于 2019-12-06 22:06:10
引文 4月份的时候看到一道面试题,据说是腾讯校招面试官提的:在多线程和高并发环境下,如果有一个平均运行一百万次才出现一次的bug,你如何调试这个bug?知乎原贴地址如下: 腾讯实习生面试,这两道题目该怎么回答? - 编程 . 遗憾的是知乎很多答案在抨击这道题本身的正确性,虽然我不是这次的面试官,但我认为这是一道非常好的面试题。当然,只是道加分题,答不上,不扣分。答得不错,说明解决问题的思路和能力要超过应届生平均水平。 之所以写上面这段,是因为我觉得大部分后台服务端开发都有可能遇到这样的BUG,即使没有遇到,这样的题目也能够激发大家不断思考和总结。非常凑巧的是,我在4月份也遇到了一个类似的而且要更加严重的BUG,这是我自己挖的一个很深的坑,不填好,整个项目就无法上线。 现在已经过去了一个多月,趁着有时间,自己好好总结一下,希望里面提到的一些经验和工具能够带给大家一点帮助。 项目背景 我们针对nginx事件框架和openssl协议栈进行了一些深度改造,以提升nginx的HTTPS完全握手计算性能。 由于原生nginx使用本地CPU做RSA计算,ECDHE_RSA算法的单核处理能力只有400 qps左右。前期测试时的并发性能很低,就算开了24核,性能也无法超过1万。 核心功能在去年底就完成了开发,线下测试也没有发现问题。经过优化后的性能提升几倍,为了测试最大性能