Posts

Showing posts from August, 2010

java - Use enum like a getter? -

i have util class keeps track of important system variables: public static final string request_address = "http.request.address"; public static final string request_port = "http.request.port"; public static final string get(string property) { return system.getproperty(property); } and can retrieve these values so: string port = systempropertyhelper.get(systempropertyhelper.request_port); is possible, in java, these enum? request_port { return system.getproperty("http.request.port"); } string port = systempropertyhelper.request_port; i'd solve way. public static final string request_port = system.getproperty("http.request.port");

python - Permutations and combinations error in kivy -

i have developed script shows combinations of given word main.py (without imports have done ) class combinations(popup): def present(self): import itertools import sys a=str(self.word.text) count=0 if len(a)>=6: os.startfile("e:\\python27\\my programs\\novos\\beta\\combinations.py") else: h in itertools.permutations(a): count=count+1 x=count, ''.join(h) x=str(x) x="\n"+x self.sh.text+=(str(x)) self.sh.text+=(str("\nthere {0} combinations of {1}".format(count,a))) and corresponding .kv file <combinations>: size_hint: .5, .9 title:"permutations , combinations" word:wo sh:sh boxlayout: orientation:"vertical" textinput: id:wo text:"" font_name:"roboto-light.ttf" font_size:30 button: text:"done" on_press:root.present() ...

sql server - Script SSIS Flat File Connection Manager Editor -

i working in visual studio 2010 , sql server 2012.i have many (hundreds) of connections create between flat file , variables in ssis. defining variables, ssis packet. connecting them manually in editor tedious task. is there way script relationships instead of manually creating them, without using forms in visual studio?

java - Different behaviors for HashMap and Hashtable when Equals overridden to always return False -

this question has answer here: what issues should considered when overriding equals , hashcode in java? 11 answers i little confused thought hashmap , hashtable should behaves same way when comes hashcode , equals method. in example below key class has overridden equals method return false. does 1 have idea can explain in difference in behavior because seem output different both value null value null value value 1 value value 2 import java.util.hashtable; import java.util.hashmap; public class hashtest { public static void main(string[] args) { hashtable ht = new hashtable(); hashmap hm = new hashmap(); keyclass k1 = new keyclass("k1"); keyclass k2 = new keyclass("k2"); ht.put(k1, "value 1"); ht.put(k2, "value 2"); hm.put(k1, "value 1"); ...

linux - *** buffer overflow detected ***: ./lamps terminated -

i running data acquisition program named lamps camac. of sudden, start getting following error every time try peak fitting of pulse. the error message quite long, try embed here. *** buffer overflow detected ***: ./lamps terminated ======= backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x7338f)[0x7f0c2a23638f] /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f0c2a2cdc9c] /lib/x86_64-linux-gnu/libc.so.6(+0x109b60)[0x7f0c2a2ccb60] /lib/x86_64-linux-gnu/libc.so.6(+0x109069)[0x7f0c2a2cc069] /lib/x86_64-linux-gnu/libc.so.6(__printf_fp+0x2456)[0x7f0c2a214736] /lib/x86_64-linux-gnu/libc.so.6(_io_vfprintf+0x315b)[0x7f0c2a20fe4b] /lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x84)[0x7f0c2a2cc0f4] /lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7f0c2a2cc04d] ./lamps[0x449638] /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_closure_invoke+0x138)[0x7f0c2b2e03b8] /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(+0x21d3d)[...

combination product through sql -

Image
i store option values , categories in table. i want 1 column possible combinations of option values. for example: option category id (1,2,5) option values {(31,39,55),(61,62),(98,99)} i want listing this, in 1 column: 31 61 98 31 61 99 31 62 98 31 62 99 39 61 98 39 61 99 39 62 98 39 62 99 55 61 98 55 61 99 55 62 98 55 62 99 please see below screen shot not answer, leave here work it schema, data sample , query show. select * #a from( select 1 prod,1 id union select 1,2 union select 1,5 )a select * #b from( select 1 id,31 cat union select 1,39 union select 1,55 union select 2,61 union select 2,62 union select 5,98 union select 5,99 ) b select * #a inner join #b b on a.id=b.id and retrieves 1 row of tree items for, in order need select b1.cat 'a', b2.cat 'b', b3.cat 'c' #b b1, #b b2, #b b3, #a a1 a1.id=b1.id , b2.id>a1.id , b3.id>a1.id , b3.id>b2.id , b1.cat<b2.cat , b2.cat<b3.cat order b1....

javascript - jquery dropdown and posting to sql database issue -

the issue cant select information dropdown box , post our database. tried numerous things cant see value of selected dropdown display anywhere. sorry first time posting on stack overflow. html , php dropbox <div class="tl"> <center><br><? $sqltl = "select * till account ='$dbname' order tillname asc"; $resulttl = mysql_query($sqltl); echo "<select id='tills' name='tills'>"; while ($rowtl = mysql_fetch_array($resulttl)) { echo "<option value='" . $rowtl['tillname'] . "'>" . $rowtl['tillname'] . "</option>"; } echo "</select>"; ?><br> <div class="pagination btn-group"> <div class="btn btn-medium highlight-color-0" id="floattl" style="width: 150px; height: 150px; margin: 0.5px; white-space: normal"> <div class=...

Which R versions contain which base functions -

i noticed function anyna has been added r base sometime around 3.1 ( commit ). discovered function relatively new running code on machine running old version of r. is there easy way (i.e. not searching through commit history, or trying on number of different r versions) find out when function added r. in case, affects r version package relies on , subsequently how decide write code (as i asked here ). i worked out finished writing question, thought i'd post , answer anyway. you can search through release news files . versions 3.0.0 onwards , 2.0.0 - 3.0.0 , 1.0.0 - 2.0.0 , < 1.0.0 .

php - anchor tag doesn't work through a different page -

i have built site using foundation , php. on index.html using foundation scroll feature scroll different sections of page. on php page wanted set navigation links links respective section on index.html , thought easy using anchor tags. out links first(#second) links through correctly, rest go straight bottom of index.html page. i have been searching , can't find why 1 work , not others, there missing? here code //code //target section in index.html <div class="row"> <div class="large-8 column large-centered" id="third" data-magellan-target="third"> <h2 class="heading">location</h2> <div class="border"> <div id="map"> <!--map location--> </div> </div> </div> </div> //navigation on php page <div class=...

node.js - NodeJS get request. JSON.parse: unexpected token -

i'm writing function in nodejs hits url , retrieves json. i'm getting error in json.parse: unexpected token. in json validators string passing test when copy browser , paste text field, when paste url parser json show me invalid message. i guess encoding of response, can;t figure out is. here if function example url. function getjsonfromurl(url, callback) { url = 'http://steamcommunity.com/id/coveirao/inventory/json/730/2/'; http.get( url , function (res) { // explicitly treat incoming data utf8 (avoids issues multi-byte chars) res.setencoding('utf8'); // incrementally capture incoming response body var body = ''; res.on('data', function (d) { body += d; }); // whatever want response once it's done res.on('end', function () { console.log(body.stringfy()); try { var parsed = json.parse...

swift - Error with realm query using NSDate() -

i have code in swift: lists = sharedappcore.getrealm().objects(event).filter("status = 1 or status = 2").sorted("end_date", ascending: false) now want filter start_date nsdate() not work: lists = sharedappcore.getrealm().objects(event).filter("status = 1 or status = 2 or start_date >= \(nsdate())").sorted("end_date", ascending: false) any ideas? lists = sharedappcore.getrealm() .objects(event) .filter("status = 1 or status = 2 or start_date >= \(nsdate())") .sorted("end_date", ascending: false) strictly speaking, above code not same final code. filter("status = 1 or status = 2").filter(predicate).sorted("end_date", ascending: false) ^ because predicate same following: filter("(status = 1 or status = 2) , end_date >= %@", nsdate()) if create predicate or , can following: filter("status = 1 or status = 2 or end_date >= %@", nsdate())...

java - How to select multiple columns but group by only one column in Hypersql database(HSQLDB)? -

i using hsqldb-2.3.3 version, here i'm showing simple mysql query. example: select name,age,emailid,country players group country; but if same query in hypersql shows error, "expression not in aggregate or group columns public.players.name" and if apply group every column selected select statement, display results aggregation of column. my question is, how display multiple columns 1 column aggregate ( group by ) in hypersql ?? table players : pid name emailid country region age 1 samual samual@gmail.com india delhi 25 2 vino vino@gmail.com india delhi 20 3 john john@gmail.com india delhi 20 4 andy andy@gmail.com india delhi 22 5 brian brian@hotmail.com america delhi 21 6 dew dew@hotmail.com america delhi 24 7 kris kris@hotmail.com america delhi 25 8 william william@hotmai...

javascript - Simulating keyboard press in a way that isn't deprecated? -

i looking way simulate keyboard press (like titled suggests). have looked around , have found these 2 questions: is possible simulate key press events programmatically? simulate keypress without jquery the issue both use keyboardevent.initkeyboardevent() event according mdn deprecated. there different way of accomplishing same thing without deprecated function? i know because creating script youtube using chrome's tampermonkey extension. script will, when [space] pressed, trigger k . k youtube's toggle play/pause button. have [space] listener working code below: document.addeventlistener("keydown", function(e) { if(e.keycode==32) { e.preventdefault(); } }, false); also looking pure javascript approach. if jquery build event. https://stackoverflow.com/a/3368599/3257830 if want create event, initialize object dispatch event. https://developer.mozilla.org/en-us/docs/web/api/event/event document.addeventliste...

java - how to change datasource connection url dynamically in Jboss 6 -

i using jboss as6 container manager tracsaction. using single mysql data source defined in mysql-ds.xml. have user requirement multiple users can have different database contents.so planning create new database each user.in future can change database design. quick solution, need find way crossover between different databases. this default configuration. need change dbname <local-tx-datasource> <jndi-name>defaultds</jndi-name> <connection-url>jdbc:mysql://144.0.0.1:3306/**dbname**</connection-url> <driver-class>com.mysql.jdbc.driver</driver-class> <user-name>root</user-name> <password>password</password> <max-pool-size>100</max-pool-size> <min-pool-size>0</min-pool-size> <connection-property name="readonly">false</connection-property> <autoreconnect>true</autoreconnect> <failoverreadonly>false</failoverreadonly...

ios - Is there a way to know whether here is a 'back-to-app' bar in current app? -

or how know current app opened app? thanks... see picture here as far know, no there's no way check. as @zp_x's comment, can verify openurl:sourceapplication:annotation method not invoked back-to-app. is invoked in cases app's custom url scheme called specifically, tapping back-to-app button go app not appear invoke other applicationdidbecomeactive . source: trying implement squaresdk in ios 9 app. when square app calls custom url scheme, openurl:sourceapplication:annotation indeed invoked. however, if back-to-app button tapped square app, no such invocation occurs. leads annoying bugs in case.

c# - WCF service dns identity on client doesn't work -

trying communicate soap service via https. service has certificate. works ok, if install certificate local storage or write it's encoded content in config as <certificate encodedvalue="ccbf......"/> but don't want have hard reference in client service certificate data, due expire , changed. want accept service certificate cn or someway that. according msdn client.endpoint.identity.dns value can used in such case. if dns.value==cn in service certificate, connection should ok. but doesn't. when open connection, exception: client.endpoint.contract.protectionlevel = system.net.security.protectionlevel.sign; client.open(); additional information: service certificate not provided target ' https://sss.myhost.com '. specify service certificate in clientcredentials. <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5" /> </startup> ...

javascript - Populate an input when checkbox is checked from ngRepeat -

i'm trying populate input 2 ways. first method type amount input, works perfectly. second method (which i'm struggling with) check checkbox generated within ngrepeat directive. the desired behavior checkbox take value of item.amount json data , populate input value. here markup: <table class="table table-striped header-fixed" id="invoicetable"> <thead> <tr> <th class="first-cell">select</th> <th class="inv-res2">invoice #</th> <th class="inv-res3">bill date</th> <th class="inv-res4">amount</th> <th class="inv-res5">amount pay</th> <th class="inv-res6"></th> </tr> </thead> <tbody> <tr ng-if="invoices.length" ng-repeat="item in invoices | filter: {status:'unpaid'}"> ...

registration - Usergrid Portal 2.0.17 unable to login/register -

after countless hours of trial end error figured out how cassandra 1.2 , usergrid 1.x , running , talking each other. "cassandraavailable" : true, keyspace has been created (by calling /system/database/setup , /system/superuser/setup). installed portal end see login screen, neither sysadmin nor test account, configured in usergrid-default.properties accepted. can not register new user. says "error registering:" , nothing else. where can error logging? have set usergrid portal working? thanks help! first, make sure using correct url log portal, need repeat host twice portal knows usergrid instance want interact with. http://[host]:8080/usergrid-portal/?api_url=http://[host]:8080 if running on tomcat (make sure using tomcat 7 usergrid 1.x) can @ tomcat logs usergrid issues.

Are there any penetration test tools available for Google Cloud Platform? -

basically title. looking around couldn't find resources penetration testing on gcp. know of any? google release web-app vulnerability scanner google cloud platform : https://cloud.google.com/security-scanner/

mysql - How to resolve Error Code: 1064. You have an error in your SQL syntax; -

enter code herei'm getting following error when try run query. error:error code: 1064. have error in sql syntax; check manual corresponds mysql server version right syntax use near '( add last_name varchar(20) )' @ line 2 query: alter table durgesh.student1 ( add last_name varchar(20) ); if you're using mysql, right syntax is: alter table durgesh.student1 add column last_name varchar(20); more info here

java - HystrixCommand annotation - how to do fallback with throw -

i using @hystrixcommand create fallbacks in java server. here 1 method have issue im having im wondering allowed throw in fall ? @hystrixcommand(fallbackmethod = "dofallback", commandkey = "dofallbackcommand") public response getgraphpoints(string id, string position) { //do work ... create response return a_response; } public response dofallback(string id, string position) { //can in hystrix command ? or have return response here?no other method catch throw throw new serviceunavailableexception("points not found"); } the reason im asking when run im getting following error: error [hystrixtimer-1] [com.netflix.hystrix.contrib.javanica.command.genericcommand] [myserver] failed processed fallback method: 'dofallback'. i had same problem, understand little how hystrix "think". hystrix not require set 1 fallback method. unless want return default data or add business logic case, not ne...

javascript - Handle `Print` button click on a webpage in `WebView`? -

web page opens fine inside webview doesn't respond print button present in webpage. when click on print button desktop browser opens print interface of browser can save file pdf . want same, have searched lot not find information, how can that? any appreciated, thanks

xamarin - Mono Framework NUnit Version -

i'm running unit tests xamarin application using nunit-console (2.4.8) provided mono framework on os x. i'm trying publish results through sonarqube , believe work need nunit 2.5 or higher currently sonarqube errors because of missing "errors" attribute in xml results file, seems got introduced in nunit 2.5. what options have upgrading nunit on os x? version of mono framework support higher version of nunit? can separate binary? all versions of nunit supported on mono. there no install package can binaries zip.

javascript - Allow global transforms with grunt browserify -

i've added jquery script tag in html file , have added package.json working browserify-shim follows: "browserify": { "transform": [ "browserify-shim" ] }, "browserify-shim": { "jquery": "global:jquery" }, i'm able expose in main script file simple require('jquery') call. the problem i'm using jquery plugins internally require('jquery') , since browserify transforms don't apply dependency of dependencies, it's causing browserify complain bundling since cannot find jquery . now know can solve applying global-transforms cannot find way easily. browserify docs cannot apply global-transforms in package file following don't work, (which thought would): "browserify": { "global-transform": [ "browserify-shim" ] }, "browserify": { "transform": [ "browserify-shim...

garbage collection - not all RAM is released after gc() after using ffdf object in R -

i running script follows: library(ff) library(ffbase) setwd("d:/my_package/personal/r/reading") x<-cbind(rnorm(1:100000000),rnorm(1:100000000),1:100000000) system.time(write.csv2(x,"test.csv",row.names=false)) #make ffdf object minimal ram overheads system.time(x <- read.csv2.ffdf(file="test.csv", header=true, first.rows=1000, next.rows=10000,levels=null)) #make increase 5 of column#1 of ffdf object 'x' chunk approach chunk_size<-100 m<-numeric(chunk_size) #list of chunks chunks <- chunk(x, length.out=chunk_size) #for loop increase column#1 5 system.time( for(i in seq_along(chunks)){ x[chunks[[i]],][[1]]<-x[chunks[[i]],][[1]]+5 } ) # output of x print(x) #clear ram used rm(list = ls(all = true)) gc() #another option run garbage collector explicitly. gc(reset=true) the issue still ram unreleased objects , functions have been swept away current environment. moreover, next run of script increase por...

csv - ValueError in Random forest (Python) -

Image
i trying perform random forest analysis in python. seems ok but, when try run code, following error message: did of valueerror? cheers dataset: https://www.dropbox.com/s/ehyccl8kubazs8x/test.csv?dl=0&preview=test.csv code: from sklearn.ensemble import randomforestregressor rf import numpy np import pylab pl headers = file("test.csv").readline().strip().split('\r')[0].split(',')[1:] data = np.loadtxt("test.csv", delimiter=',', skiprows=1, usecols = range(1,14)) #yellow==par, green==vpd, blue== tsoil , orange==tair par = data[:,headers.index("par")] vpd = data[:,headers.index("vpd")] tsoil= data[:,headers.index("tsoil")] tair = data[:,headers.index("tair")] drivers = np.column_stack([par,vpd,tsoil,tair]) hour = data[:,-1].astype("int") #performs random forest hour-wise explain each nee, gpp , reco fluxes importances = np.zeros([24,2,3,4]) ff,flux in enumerate([...

c++ - SIGSEGV in _dl_fini -

i hoping insights debugging problem have been wrestling 2 days now. situation i working on 2 shared object files, let's call them libmya.so , libmyb.so , part of product. these 2 shared object files each link 2 static library, libmyc.a , libmyd.a libmya.so , libmyb.so have unit tests command line executables invoke of functions exported shared objects, blackboxa , blackboxb . libmyb.so makes used of functions exported libmya.so . few functions of libmya.so invoked in init function of libmyb.so (just generation of few stl containers). what happens this: blackboxa runs smooth , passes tests. blackboxb passes tests, upon termination raises sigsegv . gdb tells me sigsegv happens during execution of finalizer of libmyb.so inside destructor of std::basic_string<char> object: #0 0x00007ffff74a0bc3 in ?? () /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x00007ffff74a0c13 in std::basic_string<char, std::char_traits<char>, std::allocator<ch...

How to communicate with an HTTP/HTTPS proxy server (like Fiddler) from hooked socket calls? -

on windows 7, force custom web browser application talk fiddler proxy (for both http , https) can play web traffic fiddler. the custom browser application not have proxy settings managed write own application intercept ws2_32/wsock32 socket calls, namely getaddrinfo() , connect() , send() , recv() using mhook library. now, in intercepted connect() call, if instead connect fiddler's ip , port, able direct http traffic fiddler, in following code: int wsaapi hookconnect(socket s, const struct sockaddr *name, int namelen) { int sock_type; socklen_t sock_type_length = sizeof(sock_type); getsockopt(s, sol_socket, so_type, (char*)(&sock_type), &sock_type_length); if (sock_type == sock_stream) { wsaprotocol_info proto_info; socklen_t proto_type_length = sizeof(proto_info); getsockopt(s, sol_socket, so_protocol_info, (char*)&proto_info, &proto_type_length); if (proto_info.iprotocol == ipproto_tcp) { ...

ruby on rails - Httparty get information to use inside view -

so have @ moment. api = httparty.get("api url here").parsed_response @api = api["events"] this returning this. [{"id"=>1015765, "date"=>"/date(1468062000000+0100)/", "venuename"=>"milton keynes bowl", "town"=>"milton keynes", "country"=>"uk", "layoutid"=>3932, "eventgroupid"=>32347, "venueid"=>3596}] now how go getting venuename view? i've tried putting <%= @api.id %> didn't work i wondering if it'd better venue name in controller can used elsewhere? thanks sam since @api array of hashes, can in view: <% @api.each |event| %> <%= event['venuename'] %> <% end %> for each of events in array, output venuename element hash. to first event's name in controller: @name = @api.first['venuename']

Python unit test: testcase class with own constructor fails in standard library -

this question has answer here: deriving class testcase throws 2 errors 2 answers i have plain vanilla unit test, works expected, long leave out constructor. import sys import unittest class instance_test(unittest.testcase): def __init__(self): super(instance_test, self).__init__() self.attribute = "new" def test_something(self): pass def test_other(self): self.asserttrue(true) pass def setup(self): pass def teardown(self): pass def suite(): return unittest.makesuite(instance_test, "test") def main(): runner = unittest.texttestrunner(sys.stdout) runner.run(suite()) if __name__ == "__main__": main() with constructor in place in backtrace: traceback (most recent call last): file "f:\gt\check.py", line 31, in main() file "f:\gt\check.py", line ...

Expect: what is the meaning of "force_conservative", "set send_slow" and "--"? -

set force_conservative 1 ;# set 1 force conservative mode if ;# script wasn't run conservatively if {$force_conservative} { set send_slow {1 .1} proc send {ignore arg} { sleep .1 exp_send -s -- $arg } } i dont understand force_conservative , statments set send_slow {1 .1} inside proc send not clear me. also why -- needed send command i don't understand trying accomplish script, here answers. force_conservative parameter makes expect script pause 1 tenth of second before sending each character. done shell not ignore characters came quickly. set send_slow {1 .1} same thing. make 100ms pause (second parameter) every 1 symbol (first parameter). proc send {ignore arg} { sleep .1 exp_send -s -- $arg } this code snippet doing same thing previous two. -- parameters used tell script add no more options, options delimiter.

error parsing xml not well-formed (invalid token) error on android -

i getting above error code. don't see spelling error here. < textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="first name" android:textsize="17sp" android:paddingright="10dp" android:paddingtop="10dp" android:paddingleft="10dp" /> there shouldn't space between < , textview . should follows <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingleft="10dp" android:paddingright="10dp" android:paddingtop="10dp" android:text="first name" android:textsize="17sp"/>

Android equivalent to CocoaPods Pods-Acknowledgements.plist? -

cocoapods automatically generates nice list of acknowledgements projects i've used, can include info in applications ui. is there similar whole android / gradle situation? more generally, how can automate collecting , showing appropriate acknowledgement / licensing info components i've used in android project? i'm afraid there's no in 1 drop-in equivalent of cocoapods acknowledgments android ecosystem far, because there no equivalent of ios settings bundle on android. option may : generation part : use gradle plugin create reports dependencies licence : https://github.com/jk1/gradle-license-report or https://github.com/hierynomus/license-gradle-plugin (downloadlicenses task) show user part : you'll have manually, parts want reports , put example in googleplay description, or store wherever want (local or remote) , show user @ first launch after install ( https://github.com/prashantsolanki3/shoot )

php - phpbrew not connecting to mysql -

i have set phpbrew, including installing requirements , have compiled php-5.6.11 using following command: sudo phpbrew --debug install php-5.6.11 +default+mysql+pdo+debug +apxs2 -- --with-mysql-sock=/var/run/mysqld/mysqld.soc i can switch between php versions using phpbrewswitch script below, found in this comment : #!/usr/bin/env bash version=$1 sofile=/usr/lib/apache2/modules/libphp$version.so conffile=/etc/apache2/mods-available/php5.load source ~/.phpbrew/bashrc if [ -f $sofile ]; phpbrew switch $version phpbrew list filecontents="loadmodule php5_module $sofile" echo $filecontents > $conffile echo "updated $conffile" sudo service apache2 restart else echo $version "is not configured apache" phpbrew list fi this script uses phpbrew switch php versions , tells apache use .so file requested version, reboots apache. (all in 1 commmand makes easy switch & forth yay!) however switching between loca...

How to correctly monitor a Java Batch process? -

i trying find way monitor progress of java batch process. first thought receive start event posts every task done queue , asynchronously subscribe queue process each message processed whet must done, not coupling code. i must have way send notifications if unexpected occurs. so, idea use snmp (send snmp trap systems able receive it) signal if batch process fails. correct thought? ideas?

Upgrading to Grails 3.0.14 leads to CLI error -

i have been using groovy 2.4.5 , grails 3.0.8 installed via sdk, java 1.8.0_45 on mac os 10.11. when install grails 3.0.14 , change grails properties file use it, get: $ grails run-app java.lang.runtimeexception: conversion of null java.util.map not implemented @ org.grails.config.codegenconfig.converttoothertypes(codegenconfig.groovy:201) @ org.grails.config.codegenconfig.converttotype(codegenconfig.groovy:196) @ org.grails.config.codegenconfig.getproperty(codegenconfig.groovy:252) @ org.grails.config.codegenconfig.loadyml(codegenconfig.groovy:133) @ org.grails.cli.grailscli.loadapplicationconfig(grailscli.groovy:455) @ org.grails.cli.grailscli.execute(grailscli.groovy:241) @ org.grails.cli.grailscli.main(grailscli.groovy:153) | error error occurred running grails cli: conversion of null java.util.map not implemented any ideas how fix or underlying issue is?

java - How do I troubleshoot an ANT "exec" command line error message? -

using ant script, trying build bar file deploy in iib server. facing error like: bip0960e incorrect "-a", "-l", "-p", or "-o" argument supplied mqsicreatebar please let me know how solve error. thank you. i using following ant script : <?xml version="1.0" encoding="utf-8"?> <project name="test" default="create_bar" basedir="."> <property file="ucd.properties"></property> <taskdef resource="net/sf/antcontrib/antlib.xml"> <classpath> <pathelement location="c:\apache-ant-1.9.6\lib\antcontrib.jar"/> </classpath> </taskdef> <!-- making windows command environment --> <target name="mqsiprofile.cmd"> <exec executable="${broker.mqsi.path}\mqsiprofile.cmd" /> </target> // <!-- creating ba...

url redirection - Ping Fed :How to re-direct back from Idp login page to Sp asp .net application to receive posted SAMLResponse? -

i going use ping federate authenticating existing asp .net web application. application stands sp. have link idp page. link looks ( https://fed1.sys.xxxxxx.xx/idp/startsso.ping?partnerspid=xx-xxxx-xxxx ). this user enters credentials. after authentication samlresponse posted asp .net application(which sp). i have following challenges; how call idp page asp .net application page? after how can receive samlresponse on page continue execution? note: tried response.redirect("https://fed1.sys.xxxxxx.xx/idp/startsso.ping?partnerspid=xx-xxxx-xxxx") so page redirecting idp login page. after how catch samlresponse on page? on chrome debugger see samlresponse posted response how grab on default.aspx.cs page question. to call idp using saml2 protocol should issue authnrequest. saml2 sp (service provider) module correctly. you should use saml2 sp (service provider) module receive , validate saml2 response , establish user session. so need sp imple...

javascript - Why we cannot have return in ternary operator? -

say i've simple form , want check whether form has changed or not. if changed submit else prevent form submission, used return , instead of using if-else statement tried use ternary operation unfortunately hit error uncaught syntaxerror: unexpected token return did not understand why error? ternary operation used assign? not sure on part. below sample of trying do. var form_original_data = $("#frmprofile").serialize(); $("#frmprofile").on('submit', function(e) { e.preventdefault(); $("#frmprofile").serialize() != form_original_data ? $("body").append('changed') : return; }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form id="frmprofile"> <input type="text" value="name" /> <input type="submit" value="go" /> </form> the ternary operator e...

Error using Cordova Google Maps plugin in android emulator: getMap is not defined in GoogleMaps plugin -

when calling plugin.google.maps.map.getmap don't see map being shown. remote inspection chrome reveals there's error in browser console: getmap not defined in googlemaps plugin i followed steps mentioned in pluing's tutorial linux: https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/tutorial-for-mac i have installed required android packages, made sure api key correct, google maps services enabled , else mentioned in troubleshooting guide. versions: cordova: 5.4.1 googlemaps plugin: 1.3.9 android emulator: nexus 5 5.1.1 (api level 22) i'm noob cordova , android platforms, no idea go here, how past error. ok, got around it. turns out there's recent issue google play services: https://code.google.com/p/gmaps-api-issues/issues/detail?id=9021 (found googling java exception found adb logcat ) the comment helped me one: "we have identified issue , have developed fix. rolling out in next major update of google play services, @ ...

audio - Using bluetooth in java -

i'm attempting write java application open device run on receiving audio on bluetooth , playing audio. i looked javadoc javax.bluetooth, frankly i'm little confused it, while importing javax.bluetooth failed compile, i'm not sure whats going on. this have far if helps: import javax.swing.*; import javax.obex.*; import javax.bluetooth.*; public class bluetoothconnection{ public static void main(string[] args) { discoverylistener alpha; startinquiry(777, alpha); } }

angularjs - Custom class or attribute in E2E testing -

having pretty complex angular application many pages (states) , conditional sections creates lot of test scenarios need perform e2e tests. i'm tired of nested selectors 'div.somecomponent > ul:nth-child(2) > ... ' , on using bem namings (especially when app evolving , it's easy spoil tests little change of html structure). the question is, guys opt creating dummy (empty) classes or data-* attrs simplify protractor (or groovy) selector @ expense of loosing semantics? what's alternative? to avoid changing element definitions every time developers change css , avoid using long css strings select elements, can try referring them other means (id, classname, model, etc.). see https://github.com/angular/protractor/blob/master/docs/locators.md examples. my personal favorite use element(by.css('[ng-click="executesomeaction()"]')) not change application updates. works other directives well. as testing applications high volume of pa...

How to load an array of objects in typescript -

how convert simple javascript proper typescript syntax using class "add" method? var i, rec; var myarray = []; (i = 0; < 10; i++) { rec = { name: "john", age: }; myarray.push(rec); } i figured out how @ least define variable, can't use "add" method load it: var myarray: { name: string; age: number }[] = []; here pathetic attempt add method on class: class myclass { name: string; age: number; add(inarg1: string, inarg2: number) { this.name = inarg1; this.age = inarg2; } } var myarray= new array<myclass>(); (i = 0; < 10; i++) { myarray.add("john", i); } while above answer it's job, not reflecting requirements of having custom array specific classes. learning want share of experience in oop, since think solution providing more meaning. you define class reflects requirements of object in array: class myclass { name: string; age: number; construc...

geospatial - OpenLayers 3 get WKT Polygon string -

i have openlayers 3 map can draw polygon. i have returned wkt string rapresent drawed polygon. how can it? jsfiddle code http://jsfiddle.net/michelejs/3zawt33b/7/ here map: map = new ol.map({ target: 'map', layers: [raster,vector], view: new ol.view({ center: ol.proj.fromlonlat([11.249367, 43.774298]), zoom: 15 }) }); here intaractions me draw polygon: function addinteraction() { var ct = 0; draw = new ol.interaction.draw({ source: source, type: 'polygon', geometryfunction: function (c, g) { if (goog.isdef(g)) { g.setcoordinates(c); } else { g = new ol.geom.polygon(c); } if (c[0].length > ct) { console.log('click coord : ' + c[0][c[0].length - 1]); var coord = c[0][...

office365 - Powershell script to view all OneDrive files and who has access to them -

i'm pretty new powershell , wanted know if there way pull files onedrive , see has access them? i hoping find easier way see whether or not file shared , if is, shared internally , externally. as of right now, know if go through each user account, can see information. i'm curious know if there faster way that. you can call onedrive list shared file rest api finish job. you need register application proper access onedrive according https://dev.onedrive.com/app-registration.htm then can make use code below. $clientid = "<your application client id>" # application clientid $secrectkey = "<your application key>" # secrect key application $redirecturi = "<your web app redirect url>" # re-direct url of application function list-shareditem { [cmdletbinding()] param ( [parameter(mandatory=$true)][string]$clientid, [parameter(mandatory=$true)][string]$secrectkey, [par...

Grouping in Python -

i have list of dictionaries (which uploaded using csv), , run "group by" equivalent based on 1 of "columns". trying group on teamid , sum "r" columns based on groupings. i trying following code: import itertools key, group in itertools.groupby(batting, lambda item: item["teamid"]): print key, sum([item["r"] item in group]) however, not seeing them grouped correctly. there multiple instances of same team id. for example: rc1 30 cl1 28 ws3 28 rc1 29 fw1 9 rc1 0 bs1 66 fw1 1 bs1 13 cl1 18 as padric said in comment, itertools.groupby() needs ordered data want. simplest solution (as in least code edits) be: import itertools key_func = lambda item: item["teamid"] key, group in itertools.groupby(sorted(batting, key=key_func), key_func): print key, sum([item["r"] item in group]) if data relatively big, may want consider more efficient doesn't require duplicate sorted copy in memor...

python - GAE: Can't use imported class with Endpoints API method -

i have class containing method writes datastore. able use write datastore web, can't figure out how use api post well. datastorewrite.py: from endpoints_proto_datastore.ndb import endpointsmodel google.appengine.ext import ndb def person_timestamp_key(person_timestamp): return ndb.key('person timestamp', person_timestamp) class person(endpointsmodel): name = ndb.stringproperty(indexed=false) timestamp = ndb.datetimeproperty(auto_now_add=true) def do_insert(self, name): person_timestamp = 'person_timestamp' # sets entity person = person(parent=person_timestamp_key(person_timestamp)) person.name = name person.put() webapp.py - adds entry datastore when submitted webapp: def post(self): name = self.request.get('name') person = datastorewrite.person() if name , not name.isspace(): person.do_insert(name) self.redirect('/') api.py - i've tried hundred different things here. ...

php - string is not getting printed and showing error of division by zero -

string $unencodeddata; not getting printed , showing error of division zero $date = date_create(); $timestamp= date_timestamp_get($date); $rand = mt_rand(100000,999999); $string = "cp-string"; $unencodeddata = "cp-string"/'.$timestamp.'/'.$rand.'; echo $unencodeddata; file_put_contents('./public/image/share/image.png',file_get_contents('$unencodeddata')); dont know code wrong.. hinking may wrong in declaring $unencodeddata; it simple case of miss-matched quote pairs think wanted : $unencodeddata = 'cp-string/'.$timestamp.'/'.$rand; also please note if don't care little overhead can use following make code little more readable : $unencodeddata = "cp-string/$timestamp/$rand" ;

javafx - Autosize to parent -

i have simple example. want autosize chart fill parent. @override public void start(stage primarystage) { flowpane flowpane = new flowpane(orientation.horizontal); flowpane.getchildren().addall(test()); flowpane.setpadding(new insets(5, 5, 5, 5)); flowpane.setstyle("-fx-background-color: green;"); //flowpane.setprefwidth(1200); flowpane.setvgap(4); flowpane.sethgap(4); flowpane.setalignment(pos.top_left); scrollpane scroll = new scrollpane(); scroll.setstyle("-fx-background-color: transparent;"); scroll.sethbarpolicy(scrollpane.scrollbarpolicy.as_needed); // horizontal scroll bar scroll.setvbarpolicy(scrollpane.scrollbarpolicy.as_needed); // vertical scroll bar scroll.setfittoheight(true); scroll.setfittowidth(true); scroll.setcontent(flowpane); scene scene = new scene(scroll, 1500, 250); primarystage.settit...

ios - XMPPIQ doesn't set vCard tag in the vCard -

This summary is not available. Please click here to view the post.