Задача
Необходимо определить число строк в некотором DataSet'е, чтобы затем использовать это значение в скрипте.
Решение
Как вариант - создаем JS-переменную, равную 0, и в обработчике onFetch нужно датасэта выполняем ее инкремент.
SELECT * FROM ALL_CONSTRAINTS WHERE TABLE_NAME = 'K' AND CONSTRAINT_NAME = 'N'
CREATE OR REPLACE FUNCTION nop()
RETURNS trigger AS
$BODY$
BEGIN
RETURN NULL;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
CREATE TRIGGER suppress_tr1code_rowsПрофит!
BEFORE INSERT ON mytable
FOR EACH ROW
WHEN (new.code = 'TR1')
EXECUTE PROCEDURE nop();
[auth]
myrepo.prefix = https://myrepo/repo/
myrepo.username = myusername
myrepo.password = MyPa$$W0Rd
pom.xml
|_ module1
|_ pom.xml
|_ submodule1
|_ pom.xml
|_ submodule2
|_ pom.xml
|_ module2
|_ pom.xml
|_ submdule3
|_ pom.xml
<parent>
<groupId>somegroup</groupId>
<artifactId>someparent</artifactId>
<version>[1.0,99.0)</version>
<relativePath>../</relativePath>
</parent>
SELECT query, pid FROM pg_stat_activity WHERE state = 'active'
SELECT pg_terminate_backend(<pid из выдачи предыдущего запроса>)
import org.apache.commons.lang.time.DateUtils;
def sourceFormats = [
"yyyy-MM-dd'T'HH:mm:ss.SSS",
"yyyy-MM-dd'T'HH:mm:ss",
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
"yyyy-MM-dd'T'HH:mm:ssXXX"
];;
sourceFormats = sourceFormats.toArray(new String[1]); // convert ArrayList to String Array
def date = DateUtils.parseDate(stringValue, sourceFormats);
SELECT generate_series(MIN(my_date)::timestamp, CURRENT_TIMESTAMP, '1 day')::date FROM mytable
var i = 0;
map(
heap.objects('byte[]', false, 'sizeof(it)>10000000'),
function(v) {
var file = new java.io.FileOutputStream("T:/binaries/"+i+".bin");
try {
for(var j=0;j<v.length;j++) {
file.write(v[j]);
file.flush();
}
} finally {
file.close();
}
i++;
return v;
}
);
var file = new java.io.FileWriter("T:/namespaces.log");А такой код - локальные имена всех объектов OMElementImpl:
unique(map(
heap.objects('org.apache.axiom.om.impl.llom.OMTextImpl'),
function(v) {
var ns = v.parent == null ? "null_parent" :(v.parent.ns == null ? "null_ns" : (v.parent.ns.uri == null ? "null_uri" : v.parent.ns.uri));
file.write(new java.lang.String(ns.toString() + "\r\n"));
file.flush();
return "1";
}
));
var file = new java.io.FileWriter("T:/omelements.log");
unique(map(
heap.objects('org.apache.axiom.om.impl.llom.OMElementImpl'),
function(v) {
file.write(new java.lang.String(v.localName));
file.write(new java.lang.String("\r\n"));
file.flush();
return "1";
}
));
<parameter name="transport.jms.ConcurrentConsumers">25</parameter>
<parameter name="transport.jms.MaxConcurrentConsumers">25</parameter>
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="MYJMS" locked="false">
<parameter name="java.naming.factory.initial" locked="false">
org.apache.activemq.jndi.ActiveMQInitialContextFactory
</parameter>
<parameter name="java.naming.provider.url" locked="false">
tcp://localhost:61616?jms.prefetchPolicy.queuePrefetch=0
</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">
QueueConnectionFactory
</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">
queue
</parameter>
<parameter name="transport.jms.ConcurrentConsumers" locked="false">
50
</parameter>
<parameter name="transport.jms.MaxConcurrentConsumers" locked="false">
50
</parameter>
</parameter>
</transportReceiver>
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
msxml3.dll: Security certificate required to access this resource is invalid
var xmlhttp = new ActiveXObject("Msxml2.ServerXMLHTTP");
xmlhttp.setOption(2, 13056);
msxml3.dll: The operation timed out
var xmlhttp = new ActiveXObject("Msxml2.ServerXMLHTTP.6.0");
xmlhttp.setTimeouts(60000, 60000, 60000, 60000);
xmlhttp.setOption(2, 13056);
var xmlhttp = new ActiveXObject("Msxml2.ServerXMLHTTP.6.0");
xmlhttp.setTimeouts(60000, 60000, 60000, 60000);
xmlhttp.setOption(2, 13056);
xmlhttp.setProxy(2, '<proxyhost>:<proxyport>','');
xmlhttp.open('GET', 'http://myurl', false);
xmlhttp.setProxyCredentials('<proxy_user>', '<proxy_password>');
CURRENT_TIMESTAMP - INTERVAL (N || ' hour')
CURRENT_TIMESTAMP - (N::varchar || ' hour')::interval
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
2016-08-17 11:20:45.525 ERROR 22440 --- [http-nio-8080-exec-154] ctiveDirectoryLdapAuthenticationProvider : Failed to locate directory entry for authenticated user: user@domain.local
javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-0310020A, problem 2001 (NO_OBJECT), data 0, best match of:
'DC=domain,DC=local'
]
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3160) ~[na:1.8.0_60]
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3081) ~[na:1.8.0_60]
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2888) ~[na:1.8.0_60]
at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1846) ~[na:1.8.0_60]
at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1769) ~[na:1.8.0_60]
at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1786) ~[na:1.8.0_60]
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:418) ~[na:1.8.0_60]
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:396) ~[na:1.8.0_60]
at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:297) ~[na:1.8.0_60]
at org.springframework.security.ldap.SpringSecurityLdapTemplate.searchForSingleEntryInternal(SpringSecurityLdapTemplate.java:333) ~[spring-security-ldap-4.0.3.RELEASE.jar:4.0.3.RELEASE]
at org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider.searchForUser(ActiveDirectoryLdapAuthenticationProvider.java:310) ~[spring-security-ldap-4.0.3.RELEASE.jar:4.0.3.RELEASE]
at org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider.doAuthentication(ActiveDirectoryLdapAuthenticationProvider.java:144) ~[spring-security-ldap-4.0.3.RELEASE.jar:4.0.3.RELEASE]
at org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider.authenticate(AbstractLdapAuthenticationProvider.java:82) [spring-security-ldap-4.0.3.RELEASE.jar:4.0.3.RELEASE]
curl -u <user>@<domain>:<password> "ldap://<AD_IP>:389/"
curl -u <user>@<domain>:<password> "ldap://<AD_IP>:389/DC=company,DC=org?memberOf,sAMAccountName?sub?(sAMAccountName=someusr)"Или посмотреть список всех OU первого уровня:
curl -u <user>@<domain>:<password> "ldap://<AD_IP>:389/DC=company,DC=org?distinguishedName?one?(objectClass=organizationalUnit)"
javax.naming.PartialResultException [Root exception is javax.naming.CommunicationException: xxx.yyy:389 [Root exception is java.net.UnknownHostException: xxx.yyy]]
du -sh /*
lsof +L1
route add -host 10.1.1.2 gw 192.168.1.100
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.048428] java invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
...
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.048618] 88800 total pagecache pages
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.048619] 53685 pages in swap cache
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.048620] Swap cache stats: add 8392477, delete 8338792, find 21248605/22043373
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.048622] Free swap = 0kB
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.048631] Total swap = 1048572kB
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.057372] 1048560 pages RAM
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.057374] 35908 pages reserved
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.057375] 80915 pages shared
Jun 30 10:21:12 ESBint2-60141 kernel: [3866020.057376] 950754 pages non-shared
Jun 30 10:21:13 ESBint2-60141 kernel: [3866020.057588] Out of memory: Kill process 26797 (java) score 432 or sacrifice child
Jun 30 10:21:13 ESBint2-60141 kernel: [3866020.057707] Killed process 26797 (java) total-vm:3475068kB, anon-rss:2180320kB, file-rss:0kB
ps -eLf | grep <app_name> | wc -l
ERROR: unrecognized configuration parameter "row_security"
SQL-состояние: 42704
-- Dumped from database version 9.4.4
-- Dumped by pg_dump version 9.5.0
SET row_security = off;
<%
javax.servlet.http.HttpServletResponseWrapper wrappedResponse = new javax.servlet.http.HttpServletResponseWrapper(response) {
public void setHeader(String name, String value) {
if(name.equals("My-Header")) {
value = "my_value";
}
super.setHeader(name, value);
} public void addHeader(String name, String value) {
if(name.equals("My-Header")) {
value = "my_value";
}
super.addHeader(name, value);
} };
request.getRequestDispatcher("MyServlet").forward(request, wrappedResponse);
%>
reportContext.setGlobalVariable("GROUP_ROW_CNT", 0);Т.е. мы устанавливаем глобальную переменную GROUP_ROW_CNT в 0. Эта переменная будет счетчиком строк в рамках группы.
var curGroupRowCnt = reportContext.getGlobalVariable("GROUP_ROW_CNT");Т.е. мы инкрементируем счетчик строк в группе, и далее, если строка первая - устанавливаем для нее значение rowSpan, заведомо большее, чем возможное число строк в группе, а если строка не первая - то скрываем ее.
curGroupRowCnt++;
reportContext.setGlobalVariable("GROUP_ROW_CNT", curGroupRowCnt);
if(curGroupRowCnt != 1) {
this.getStyle().display = "none";
} else {
this.rowSpan = 1000; // заведомо большое число, т.к. мы на данном этапе не знаем, сколько строк в группе
}
апр 05, 2016 9:34:32 PM org.eclipse.birt.report.engine.api.impl.EngineTask handleFatalExceptions
SEVERE: An error happened while running the report. Cause:
org.eclipse.birt.report.engine.api.EngineException: Failed to initialize emitter.
at org.eclipse.birt.report.engine.emitter.EmitterUtil.getOuputStream(EmitterUtil.java:82)
...
Caused by: java.io.FileNotFoundException: \Myreport.rptdesign.html (Access is denied)
at java.io.FileOutputStream.open0(Native Method)
...
app.page.myGrid.deleteRow(app.page.myGrid.getSelectedIndex())
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (def
ault) on project *****: Command execution failed. Cannot run program
"mvn" (in directory "D:\***"): CreateProcess error=2, Не удается найти указанный файл ->
[Help 1]
[INFO] --- maven-invoker-plugin:1.8:run (default) @ **** ---При этом версией maven 3.0.4 проект собирался без проблем.
[INFO] Building: pom.xml
[INFO] ..FAILED (0.0 s)
[INFO] Maven invocation failed. Error configuring command-line. Reason: Maven
executable not found at: C:\Program Files\apache-maven-3.3.9\bin\mvn.bat
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxxEntityManagerFactory' defined in class xxx.xxx: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilder]: : No qualifying bean of type [org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilder] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilder] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at ...
org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilderнужно использовать
org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder.
/var/opt/cprocsp/keys/<username>
import java.util.Date;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.S");
Date parsedValue = format.parseDateTime("2016-01-01T11:05:42.1").toDate();
DECLARE @myVar MyTableType;
INSERT INTO @myVar(a,b) VALUES(1,2);
EXECUTE someProc @myVar;