java

Jasper compiler error when using SUM method

穿精又带淫゛_ 提交于 2021-02-18 17:14:47
问题 I'm using the Jasper built-in SUM function in a cell of a table. It should sum the content of other cells (in the example I'm using a single cell, but the output is pretty much the same adding multiple cells). The jrxml is: <jr:column width="49" uuid="e6595bc8-b46e-4bbe-85a2-7ea9526fce83"> <property name="local_mesure_unitwidth" value="pixel"/> <jr:columnHeader style="Table 2_CH" height="20"> <staticText> <reportElement x="2" y="0" width="47" height="20" uuid="af5e8305-5cdf-41ad-b827

Convert Latitude and Longitude values to a custom sized grid

橙三吉。 提交于 2021-02-18 17:13:13
问题 I am making a java program that classifies a set of lat/lng coordinates to a specific rectangle of a custom size, so in effect, map the surface of the earth into a custom grid and be able to identify what rectangle/ polygon a point lies in. The way to do this I am looking into is by using a map projection (possibly Mercator). For example, assuming I want to classify a long/lat into 'squares' of 100m x 100m, 44.727549, 10.419704 and 44.727572, 10.420460 would classify to area X and 44.732496,

How to use date_format when using JPQL/JPA

孤街醉人 提交于 2021-02-18 17:11:05
问题 I am doing Java EE with MySQL as database and implementing JPA on my codes. I have no problem retrieving the data from MySQL Workbench but when I change my syntax to JPQL's it does not work. For e.g. in MySQL - it works SELECT date_format(s.date,'%Y, %m, %d') from Transactions s; in JPQL - it does not SELECT date_format(s.date,'%Y, %m, %d') from TransactionEntity s; How do i modify to suit the JPA query? Note: in JPQL the following works SELECT s.date from TransactionEntity s; 回答1: SQL

How to implement Voice Activity Detection in Java?

亡梦爱人 提交于 2021-02-18 17:05:22
问题 I need to implement a voice activity detection algorithm in Java so that I can know when to start and/or stop recording audio. I am looking for an algorithm that can take either a byte[], a target-data-line, or an audio file as input. Also, a solution would preferably not use external dependencies. 回答1: Give a look at TarsosDSP as source of inspiration: It is so far the best open source Java library to deal with Audio Detection. It is purely written in Java and briefly provides:

How to override a gradle build with dev/prod configuration

我怕爱的太早我们不能终老 提交于 2021-02-18 17:00:21
问题 I'm evaluating gradle for replacing an ant build script and I can't manage to find a solution for creating a standard build script that correctly manages dev / prod environment. Than ant script (it's for a java project, not android) is structured in this way: a common script with the standard tasks (compile, build-jar, build-war) a specific project script that includes the first one and through some properties it defines where the war task should pick the correct files Our project structure

Eclipse does not show EclipseLink platform in JPA configuration [closed]

左心房为你撑大大i 提交于 2021-02-18 17:00:20
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Improve this question I'm trying to set up JPA facet. All tutorials online state that I should select EclipseLink platform and not Generic. The thing is in my eclipse only Generic appears. I've installed Eclipse Web tools hoping that it would appear but looks like I need to add

Spark Dataframe: Select distinct rows

狂风中的少年 提交于 2021-02-18 17:00:20
问题 I tried two ways to find distinct rows from parquet but it doesn't seem to work. Attemp 1: Dataset<Row> df = sqlContext.read().parquet("location.parquet").distinct(); But throws Cannot have map type columns in DataFrame which calls set operations (intersect, except, etc.), but the type of column canvasHashes is map<string,string>;; Attemp 2: Tried running sql queries: Dataset<Row> df = sqlContext.read().parquet("location.parquet"); rawLandingDS.createOrReplaceTempView("df"); Dataset<Row>

Spark Dataframe: Select distinct rows

拜拜、爱过 提交于 2021-02-18 17:00:14
问题 I tried two ways to find distinct rows from parquet but it doesn't seem to work. Attemp 1: Dataset<Row> df = sqlContext.read().parquet("location.parquet").distinct(); But throws Cannot have map type columns in DataFrame which calls set operations (intersect, except, etc.), but the type of column canvasHashes is map<string,string>;; Attemp 2: Tried running sql queries: Dataset<Row> df = sqlContext.read().parquet("location.parquet"); rawLandingDS.createOrReplaceTempView("df"); Dataset<Row>

After kafka crashed, the offsets are lost

拥有回忆 提交于 2021-02-18 16:56:17
问题 Our kafka system crashed because no disk space was available. The consumers are Spring boot application which are using the Kafka Streams API. Now every consumer application shows the following error: java.io.FileNotFoundException: /tmp/kafka-streams/908a79bc-92e7-4f9c-a63a-5030cf4d3555/streams.device-identification-parser/0_48/.checkpoint.tmp (No such file or directory) This exception occurred exactly after the kafka server was restarted. If we restart the application, the service starts at

Python装饰器(decorator)不过如此,是我想多了

半腔热情 提交于 2021-02-18 16:45:13
摘要: Python装饰器是Python中一个非常有趣的特性,可以利用Python装饰器对一个函数包装再包装,其实从效果上看有一点像AOP中的切面,也就是对函数调用进行拦截,那么通过Python装饰器可以做哪些有趣的事情,以及Python装饰器的原理是什么呢?继续看本文吧! 1. 叠加使用Python装饰器 最近有学员问,Python中也有与Java类似的@xxxx语法,这到底是什么意思呢?现在我就来回答这个问题。 Java中的@xxxx语法是注解(Annotation),而Python中的@xxxx语法是装饰器(decorator),尽管在语法上类似,但作用完全不同。Java的注解相当于语法元素(方法、类、接口等)的元数据。而Python的装饰器是对Python函数(方法)的包装,现在我们来举个例子。 @makebold @makeitalic def say () : return "Hello" print(say())) 这段代码,对函数say使用了2个装饰器:@makebold和@makeitalic,而且是叠加状态。@makeitalic会首先作用于say函数,然后@makebold会作用于@makeitalic装饰器的结果,这两个装饰器分别用<b>...</b>和<i>...</i>包装say函数返回的字符串,所以这段代码的执行结果如下: < b > < i >