Posts

sql - What is wrong with JPQL (count and select) -

below query rows parent table , count of each id child table. @query("select cnt idcount, person person person,(select count(child.id) cnt child child child.id :input_id) idcount person.id :input_id") list<person> searchpersonwithcount(@param("input_id") long input_id); i below error: caused by: org.hibernate.hql.internal.ast.querysyntaxexception: unexpected token: idcount near line 1, column 12 [select cnt idcount, person com.myc.cc.domain.person person,(select count(child.id) cnt com.myc.cc.domain.child child child.id :input_id) idcount person.id :input_id] @ org.hibernate.hql.internal.ast.querysyntaxexception.convert(querysyntaxexception.java:54) when execute in oracle sqldeveloper able results. native query executed in qracle sql developer: select cnt idcount, person.* person person,(select count(*) cnt child child id = '1235') idcount id = '1235' result: idcount id name 2 1235 p...

gradle - How to create sitemap.xml from docbook source -

i need generate sitemap.xml in standard google acceptable format docbook source. i'm using gradle power build process. is there existing tool out there generate sitemap.xml automatically part of build? by using ant gradle seams possible there apache ant task generating xml sitemap . read manual @ github , usage details. <target name="generate_sitemap" description="generates sitemap"> <taskdef classname="uk.co.arjones.ant.task.sitemap" name="sitemap"></taskdef> <sitemap url="http://organisation.org" gzip="yes" lastmod="now" destdir="${build_dir}"> <fileset dir="${build_dir}"> <include name="**.docbook"></include> <include name="**.dbx"></include> <exclude name="google*"></exclude> </fileset> </sitemap> ...

How do I start an SSH session locally using Python? -

what mean ask is, if on system "a" (linux) , want ssh system "b" (windows): on system "a", can ssh admin@xx.xx.xx.xx prompt me password , when gets authenticated, "$" of system "b" (on system "a"). how send username , password single line (since want use script) how achieve scenario have above. i paramiko, easier import paramiko # ssh print 'enter ssh' ssh = paramiko.sshclient() ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) # automatically add keys ssh.connect(machinehostname, username=user, password=password) # run commands # example 1 : ls command print 'do ls command' stdin, stdout, stderr = ssh.exec_command('ls') print stdout.readlines() time.sleep(2) # example 2 : change ip address print 'changing ip address' stdin, stdout, stderr = ssh.exec_command('sed -i -- s/'+oldip+'/'+newip+'/g /etc/sysconfig/network-scripts/ifcfg-eth0') print...

c# - PInvoke SLAPI Functions -

i'm trying use functions in slapi i'm new pinvoke , i'm struggling this. take slgetpkeyinformation example: hresult winapi slgetpkeyinformation( _in_ hslc hslc, _in_ const slid *ppkeyid, _in_ pcwstr pwszvaluename, _out_opt_ sldatatype *pedatatype, _out_ uint *pcbvalue, _out_ pbyte *ppbvalue ); https://msdn.microsoft.com/en-us/library/windows/desktop/hh971173(v=vs.85).aspx i don't understand hslc type is, able provide sample code using function in c#? hslc defined in slpublic.h as: typedef pvoid hslc; so can treated anonymous handle type in winapi , passed around c# code intptr.

c# - Extract the byte array of Zip files sent from C # in Objective-c side -

it passes c # byte array of zip files via plugin in objective-c, want thaw in objective-c side, suffering not go well. byte data has been converted nsdata type using zlib following url reference tried thaw but, inflate (& stream, z_no_flush); of after review of our return value, have been returned z_data_error data can not decompressed zlib determined have been input not know cause, please tell me if there people knowledge ■ url https://gist.github.com/hacha/9207616 http://www.zlib.net/zlib_how.html sourcecode(c#) using unityengine; using system.collections; using system.runtime.interopservices; public class callplugin : monobehaviour { [dllimport("__internal")] private static extern void uncompressbygzip(byte[] zipbytearray,int ziplen); public void callmain(byte[] unzipstream,int unziplength){ uncompressbygzip (unzipstream,unziplength); debug.log ("test csharp"); } } sourcecode(objective-c) #import <fo...

php - LDAP login page doesn't work -

i installed php on iis , tested script, there no response after either enter correct or incorrect login details. try telnet ldap server , connect properly. <?php $ldapserver = "ldap.server.com"; // ldap server $ldapsuffix = "o=companyname, o=companynet"; // ldap tree if (!empty($_post['login'])) { //print_r($_post); echo "<br><br>"; $userid = $_post['username']; // user key userid or email $userpassword = $_post['userpassword']; // user key password $ds=ldap_connect($ldapserver); ldap_set_option($ds, ldap_opt_protocol_version, 3); $bind=@ldap_search($ds, $ldapsuffix, "uid=".$userid); if ($bind) { echo "ldap bind success <br>"; $result = @ldap_get_entries($ds, $bind); if ($result[0]) { if (@ldap_bind( $ds, $result[0]['dn'], $userpassword)) { echo "user bind suc...

Tomcat8 Gzip Compression for CSS, JS -

i using tomcat8 , trying simulate gzip compression of css , js. have added entry in server.xml , follows <connector port="8088" protocol="http/1.1" connectiontimeout="20000" redirectport="8443" compression="on" compressionminsize="2048" nocompressionuseragents="gozilla, traviata" compressablemimetype="text/html,text/xml,text/plain,text/css,text/javascript,text/json,application/x-javascript,application/javascript,application/json" /> and in html page have included script follows <script type="text/javascript" src="extjs/ext-all-debug.js"></script> but while accessing page, compression not happening , resposne header received follows. remote address:[::1]:8088 request url:http://localhost:8088/test/extjs/ext-all-debug.js request method:get status code:200 ok response headers view source accept-ranges:bytes conte...