Posts

Showing posts from March, 2011

c++ - Where are the memory leaks? 2d array class -

i submitted program class , error message says there few memory leaks, cannot find them (i asked professor) here error message: ==27796== heap summary: ==27796== in use @ exit: 160 bytes in 2 blocks ==27796== total heap usage: 192 allocs, 190 frees, 21,989 bytes allocated ==27796== ==27796== 160 bytes in 2 blocks lost in loss record 1 of 1 ==27796== @ 0x402adfc: operator new[](unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==27796== 0x804d5c2: sweepergrid::sweepergrid(sweepergrid const&) (in /tmp/grading20151030-8173-zfd6af-0/sweepertest) ==27796== 0x804bf57: main (sweepertest.cpp:357) and following code use new or delete: // explicit-value constructor sweepergrid::sweepergrid(const int initialrows, const int initialcols, const int density){ if ((initialrows<5 || initialcols<5) || (density<25 || density>75)) { throw out_of_range("grid not large enough (number of rows or columns cannot fewer 5) or dens

java - Class path contains multiple SLF4J bindings after exclusion -

i've error "class path contains multiple slf4j bindings." when starting web-app server. solutions i've found here didn't seem work. i've excluded artifacts domain still error. don't understand why have error after exclusions. i'm using glassfish 4.1.1 server. severe: slf4j: class path contains multiple slf4j bindings. severe: slf4j: found binding in [jar:file:/c:/glassfish4.1.1/glassfish/domains/domain1/eclipseapps/csbasement/web-inf/lib/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/staticloggerbinder.class] severe: slf4j: found binding in [jar:file:/c:/glassfish4.1.1/glassfish/domains/domain1/eclipseapps/csbasement/web-inf/lib/slf4j-simple-1.7.12.jar!/org/slf4j/impl/staticloggerbinder.class] severe: slf4j: see http://www.slf4j.org/codes.html#multiple_bindings explanation. i excluded artifact seen in link furnished in error code : <!-- slf4j --> <dependency> <groupid>org.slf4j</groupid> <artifacti

command line - python: how to properly pass arguments to executable via commandline -

i'm trying write small python script, allow me pass parameters command line dialog, in order run setup file. want able pass parameters executable file, example: "setup.exe --uninstall --delete-profile --force-uninstall" i've tried use "os.system" module, "subprocess.call" module, in both cases, script doesn't work. i'm not getting error. instead, script ends, setup and\or application files , folders not deleted. when i'm running same commands manually (via commandline), application , relevant files deleted. here's line of code: subprocess.call('setup.exe --uninstall --delete-profile --force-uninstall', shell=true) i think problem due permissions (though i'm running script via idle admin rights) or "--" symbols, separates arguments (unfortunately, that's format used setup file). any appreciated. use : subprocess.popen(['hostname', '-f'], stdout=subprocess.pipe).comm

visual studio 2015 - After installing .NET Core 1.0 with VS2015 tooling (preview), I am unable to create .NET core class library projects -

i error message when try add .net core class library solution: error: template attempted load component assembly 'microsoft.visualstudio.projectsystem.dotnet.wizard, version=14.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a'. more information on problem , how enable template, please see documentation on customizing project templates. an empty folder created on disk nothing added solution. my initial process consisted of: upgrading visual studio 2015 update 3 uninstalling preview / rc bits of .net core , tooling downloading , installing release version of .net core preview tooling i have tried following after getting error: uninstalling , reinstalling .net core repairing .net core installation uninstalling , reinstalling visual studio 2015 professional w/update 3 and uninstalling , reinstalling , repairing .net core yet again afterwards measure executing devenv /setup administrator i shut down , restart after each step well, no dice.

security - WCF X509 getting "Could not establish trust relationship for the SSL/TLS secure channel with authority" -

Image
i'm developing wcf web service in c#, , test client go it. web service hosted in iis on server , test client running on desktop pc. able make calls web service client using http, trying working https , x509 certificates. when try make calls now, "could not establish trust relationship ssl/tls secure channel authority '192.168.5.5'". here i've done far try setup: created self-signed certificate , key use certificate root: makecert -n "cn=roottest" -r -sv roottest.pvk roottest.cer created certificates/keys signed above root server , client: makecert -iv roottest.pvk -n "cn=servertest" -ic roottest.cer -sky exchange -pe -sv servertest.pvk servertest.cer makecert -iv roottest.pvk -n "cn=clienttest" -ic roottest.cer -sky exchange -pe -sv clienttest.pvk clienttest.cer imported roottest.cer "trusted root" under "local computer" on both server , client pc using mmc. created pfx files server , client cer

arrays - Python 3.4 TypeError: argument of type 'int' is not iterable -

i have array each position in array represents parking spot. value of each position in array (or parking lot) represents in parking spot (car, motorcycle, etc.). showspots function should show of spots vehicle in. example, showspots(car) (where car = 1) should show of spots (or positions in array) hold value 1. however, when run code, 'typeerror: argument of type 'int' not iterable' on line 'if holder in parkinglot[x]:' why getting error, , how fix it? my code: from random import * parkinglot = [0, 1, 0, 2, 0, 0, 1] empty = 0 car = 1 motorcycle = 2 def showspots(holder): x in range(0, 6): if holder in parkinglot[x]: print(x) def main(): print("there cars in lots:") showspots(car) print("there motorcycles in lots:") showspots(motorcycle) main() i think want if holder == parkinglot[x]: . doing in , python trying iterate through parkinglot[x] , check if holder in it. obviously,

XmlSlurper in Groovy and SOAPUI - Add new element to random location in xml -

i'm creating automated tests soapui , need check happens when add new groupingnodes on different positions in xml. i have xml structure similar this: <rootnode> <groupingnode> <id>1</id> <name>node 1</name> <groupingnode> <id>2</id> <name>node 2</name> <groupingnode> <id>3</id> <name>node 3</name> </groupingnode> </groupingnode> </groupingnode> <groupingnode> <id>4</id> <name>node 4</name> </groupingnode> and new elements add: <groupingnode> <id>5</id> <name>node 5</name> </groupingnode> in data source defined several different combinations node , add, new node in 1 test case needs added rootnode, in second test case groupnode id=3, in third test case newly created node added rootnode , on. so q

Xamarin.UITest on Android: Dismiss keyboard with Entry.Completed -

i'm testing xamarin.forms app entry element. i'd enter text , dismiss keyboard raising entry.completed event. on ios working nicely iapp.pressenter . on android, however, inserts whitespace. how can dismiss keyboard such entry.completed raised? i imagine invoking backdoor method or executing methods on native views , couldn't work, yet. know how raise entry.completed programatically within xamarin.forms or xamarin.android? oh, found solution , it's rather trivial. while iapp interface has no method dismissing keyboard , raising entry.completed on android, there androidapp.pressuseraction() desired purpose. can write: (app iosapp)?.pressenter(); (app androidapp)?.pressuseraction();

c++11 - temporary objects with variadic template arguments; another g++/clang++ difference -

the following code struct foo { foo () { } template <typename t0, typename ... ts> foo (const t0 & t0, const ts & ... ts) { foo(ts...); } }; int main() { foo f(1, 2); return 0; } compile without problems g++ (4.9.2) , give following errors tmp_002-11,14,gcc,clang.cpp:9:16: error: expected ')' { foo(ts...); } ^ tmp_002-11,14,gcc,clang.cpp:9:13: note: match '(' { foo(ts...); } ^ tmp_002-11,14,gcc,clang.cpp:9:14: error: redefinition of 'ts' { foo(ts...); } ^ tmp_002-11,14,gcc,clang.cpp:8:42: note: previous definition here foo (const t0 & t0, const ts & ... ts) ^ 2 errors generated. with clang++ (3.5). as usual question is: who's right? --- edit --- clarification: know foo(ts...) can't call delegate constructor (i think can be) construction of temporary foo object (an

API For Additional Storage Details Softlayer -

for given virtual guest, how should attached additional storage details using api. information storage name, storage id etc softlayer only. please provide api if possible. thanks you use objectmask retrieve additional information related object using. next examples might you: method: get https://$username:$apikey@api.softlayer.com/rest/v3/softlayer_virtual_guest/$virtualguestid/getobject?objectmask=mask[datacenter,blockdevices[diskimage[capacity,type[name],units]],networkstorage,allowedhost,allowednetworkstorage[serviceresource[networkdevice[datacenter]],serviceresourcebackendipaddress,storagetype],allowednetworkstoragereplicas,evaultnetworkstorage[serviceresource[networkdevice[datacenter]]]] method: post https://$username:$apikey@api.softlayer.com/rest/v3/softlayer_virtual_guest/$virtualguestid/getattachednetworkstorages?objectmask=mask[id,username,capacitygb,nastype,notes,serviceresource[id,networkdevice[id,datacenter],type],storagetype,storagetierlevel,replica

java - Application has stops at the invocation of the webservice. Please help me to resolve this error -

the application invokes webservice read user data , password stops go through invocation of web service, doing no wrong. public webservice(context context) { contexto= context; } public arraylist login(string user, string password) { string namespace = "http://tempuri.org/"; string url = "http://192.168.30.8/genera/genera.asmx"; string soap_action = "http://tempuri.org/login"; string method_name = "login"; arraylist unidades =new arraylist(); try { **//create request , envelope** soapobject request = new soapobject(namespace, method_name); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); request.addproperty("username", user.tolowercase()); request.addproperty("password", password.tolowercase()); envelope.dotnet = true; envelope.enc = soapserializationenvelope.enc2003; envelope.setoutput

r - Going from a frequency table to a burt table -

i need transform dataset burt table, don't know how because know how indicator matrix. this data looks like geo identity age sex value 3649 atlantic total , aboriginal identity 18 24 years male 950 3653 atlantic total , aboriginal identity 18 24 years male 506 3657 atlantic total , aboriginal identity 18 24 years male 0 3661 atlantic total , aboriginal identity 18 24 years male 0 3665 atlantic total , aboriginal identity 18 24 years male 0 3669 atlantic total , aboriginal identity 18 24 years male 950 3673 atlantic total , aboriginal identity 18 24 years male 0 3677 atlantic total , aboriginal identity 18 24 years male 0 3681 atlantic total , aboriginal identity 18 24 years male 0 3685 atlantic total , aboriginal identity 18 24 years male 0 there thousand combinations frequency in last column , don't know how manipulate data frame indicator matrix or burt table directly. more info on data aft

python - Django Form Wizard persistent initial data between steps -

Image
i'm using django form wizard in project. want allow users provide initial data specific field , want make field initial data provided disabled. problem when user clicks button initial data erased. for example form(initial data set second step) can see fine here, form fields disabled , value selected. click next . click next , second step without problems if click back .. form fields still disabled value gone! the code i'm using goes (relevant part): form choices=[('one','choice 1'), ('two','choice 2'), ('three','choice 3'), ('four','choice 4'), ] class bookingform1(forms.form): """ select reservation type""" sko = forms.choicefield(choices=choices, widget=forms.radioselect()) wizard def get_form(self, step=none, data=none, files=none): form = super(presentview, self).get_form(step, data, files) ste

Nginx 404 issue when serving static files of a sub-directory -

i have 404 error when trying access css , js files of sub static directory. tried use = , or ~ still not work. mydomain/sub/index.html is served. mydomain/sub/css/style.css is not served. here nginx configuration file : server { listen 80; server_name www.example.com example.com; return 301 https://www.example.com$request_uri; } server { # global listen 443 ssl http2; server_name www.example.com example.com; charset utf-8; # logs ... # ssl ... # ocsp stapling ... # hsts .... # robots location /robots.txt { return 200 "user-agent: *\nallow: /"; } # sub location /sub { alias /www/sub; index index.html; try_files $uri $uri/ =404; } # page speed include /etc/nginx/pagespeed.conf; # set expiration policy location ~* \.(?:ico|css|js|gif|jpe?g|png|woff)$ { expires 7d; add_header pragma public; add_header cache-control "public"; proxy_pass http://example; } # lo

mysql - how to delete record from a join table in rails -

i have join table having 2 record list_id , car_id . want delete record list_id = 5 , car_id = 7 example. here code in controller section: def deletejoin @car = car.find(params[:id]) end def destroyjoin # car = car.find(params[:id]) # list = list.find(params[:list_id]) # car = car.find(21.to_i) # list = list.find(8) # puts car # puts list car = car.find(params[:id]) @list = car.lists.find(params[:list_id]) cars_lists.where(car_id: 25).destroy_all # @list.cars.where(:id => params[:id]).destroy_all # @list = @car.cars_lists.find(params[:list_id]) # @list.destroy # car = car.find(params[:id]).destroy flash[:notice] = "car #{car.name} destoryed successfully" redirect_to(:action => 'index', :list_id => @list.id) end try this, def delete_join car = car.find(params[:id]) list = list.find(params[:list_id]) carslists.where(car_id: car.id, list_id: list.id).dest

How to return float value with zero fraction in MongoDB? -

i trying retrieve float values mongodb 0 fraction. doesn't work expect to. i.e. inserted doc: db.collection.insert({ _id: 1, floatval: 10.0 }) while retrieving gives as: { "_id": 1, "floatval": 10 } whereas want result as: { "_id": 1, "floatval" : 10.0 }

python - File cannot be found using open() -

the code not finding notepad document, please help send_report_tuple = ('wet', 'water', 'liquid') #make list input input_list = answer.split(" ") #and use function comprehension list if any(e in send_report_tuple e in input_list): file = open('notepad', 'r') print = file make sure file in same directory python script or put full path it. should put file extension in name i.e. file = open('notepad.txt', 'r')

nuget package - Fail to Add Migration in ASP.NET Core 1.0 -

i trying add migrations existing models in asp.net core 1.0 web app. when type add-migration following result. use vs 2015 community , nuget package manager console execute commands on windows 7. upgraded powershell (from version 2.0 version 4.0). cannot understand error if can explain happens appreciate. pm> enable-migrations enable-migrations obsolete. use add-migration start using migrations. pm> add-migration cmdlet add-migration @ command pipeline position 1 supply values following parameters: name: initmigration expression after '&' in pipeline element produced object not valid. must result in command name, script block, or commandinfo object. for ef core, enable migrations add-migration command (as messages pretty indicate :)). try add-migration -name initmigration see here more: https://docs.efproject.net/en/latest/miscellaneous/cli/powershell.html#add-migration

ios - Scroll View Alignment Issue -

Image
can me out can not seem remove white below navigation bar shown in image below? https://www.dropbox.com/s/o8egd3i7vyqxc9w/img_2015-10-31%2000%3a10%3a14.jpg?dl=0 i have other view controllers using same restraints , not have issue? select controller in storyboard --> go attribute inspector --> uncheck "adjust scroll view insets" in view controller layout property. see attached image.

android - Cannot resolve symbol newRequestQueue - Volley -

i have bit of code in mainactivity file requestqueue queue = new volley.newrequestqueue(this); , reason newrequestqueue part red , when hover on cannot resolve symbol 'newrequestqueue' . how can solve ? see https://developer.android.com/training/volley/requestqueue.html try it: requestqueue queue = volley.newrequestqueue(this);

php - Call to a member function find() on a non-object in -

i try scrape keywords error . can't figure out think problem dom when load curl. try different methods hope can me this. with dom works need use curl . include("simple_html_dom.php"); $lines = file('key.txt', file_skip_empty_lines); foreach ($lines $key) { $bla= ucwords($key); $in = str_replace(' ','+',$bla); $ch = curl_init(); $url = 'http://www.google.com/search?hl=en&tbo=d&site=&source=hp&q='.$in.'&oq='.$in.'&num=20'; $ch = curl_init(); $timeout = 5; curl_setopt($ch, curlopt_ssl_verifyhost, 0); curl_setopt($ch, curlopt_ssl_verifypeer, 0); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_useragent,'mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.1.13) gecko/20080311 firefox/2.0.0.13'); curl_setopt($ch, curlopt_connecttimeout, $timeout); $html = curl_exec($ch);

image - Get first file in directory PHP -

i want first file in directory using php. i trying make function users on website can change profile picture. show profile picture on profile page want first image in profile picture folder. want image have uploaded, regardless of file type. have made when upload new picture old 1 deleted, 1 file in folder. how do this? you can first file in directory this $directory = "path/to/file/"; $files = scandir ($directory); $firstfile = $directory . $files[2];// because [0] = "." [1] = ".." then open fopen() can use w or w+ modes: w open writing only; place file pointer @ beginning of file , truncate file 0 length. if file not exist, attempt create it.

PowerShell pass arguments with quotes -

have useful script named sudo.ps1 : $w=""; foreach($a in $args[1..($args.length-1)] ){ $w += " " + $a }; $w start-process $args[0] -argumentlist $w -verb runas -wait but can't handle complex command ./sudo.ps1 schtasks /create /f /tn "$vpn_name connection update" /tr "powershell.exe -noexit -command d:\vpn-route.ps1" /sc onevent /ec application /mo "*[system[(level=4 or level=0) , (eventid=20225)]] , *[eventdata[data='$vpn_name']]" /rl highest problem in obfuscated quotes. in sudo.ps1 quotes opened: /create /f /tn vpn-kosmos6 connection update /tr powershell.exe -noexit -command d:\vpn-route.ps1 /sc onevent /ec application /mo *[system[(level=4 or level=0) , (eventid=20225)]] , *[eventdata[data='vpn-kosmos6']] /rl highest command executed no error, no work. how can fixed? if arg contains space, add quotes via """ (thanks petseral ) . sudo.ps1 works fine: $w=""

Why does the m= line in sdp contain a port? Isn't this redundant with candidates? -

according rfc 4566 https://tools.ietf.org/html/rfc4566#page-22 , m= line in sdp contains port: m=audio 49170 rtp/avp 0 aren't ports determined ice candidates already? these contain ports well: a=candidate:1 1 udp 2130706431 10.0.1.1 8998 typ host as rfc 5245 https://tools.ietf.org/html/rfc5245#page-9 states, "ice extension offer/answer model, , works including multiplicity of ip addresses , ports in sdp offers , answers, tested connectivity peer-to-peer connectivity checks." would mean port specified in m= line obsolete? when using libjingle create new sdp offer, shows ip address of 0.0.0.0 , port 9 (which "discard" port). not see port in m= line relevant: m=audio 9 udp/tls/rtp/savpf 111 103 9 102 0 8 106 105 13 127 126 c=in ip4 0.0.0.0 a=rtcp:9 in ip4 0.0.0.0 does know? ip , candidates in m= line relict pre-candidate eras, fixed ips , ports used communication. at least webrtc, specified in https://tools.ietf.org/htm

logging - Closing Java FileHandler when quitting a routine that runs as a service -

i have little routine schedules timer that: timer.schedule(new myroutine(), 1000, 60000); in run() method of myroutine logger opened , filehandler attached it: filehandler fh = new filehandler("app.log"),true); logger.addhandler(fh); since there no real exit point application (as runs service), have no chance close , remove logger ´s filehandler , hence file lock ( app.log.lck ) remains, resulting in new logfile ( app.log.1 ) on next start of service. is there way ensure filehandler closed , removed? you add shutdown hook this: in method schedules timer: public void schedulefiletask() { final filehandler fh = new filehandler("app.log"),true); runtime.getruntime().addshutdownhook(new thread() { @override public void run() { fh.close(); } }); timer.schedule(new myroutine(fh), 1000, 60000); } and in myroutine.java public class myroutine extends timertask { private final filehand

r - ddply colSums and count of column together -

i'm new r , have pieced syntax below based on other helpful suggestions here on stackoverflow. i'm trying sum column called "combined hours" , count of column called doc_line_num grouped column doc_num. so each doc_num, calculate sum combined_hours, , show count of doc_line_num. the syntax below works fine column sum of combined_hours how incorporate count logic syntax doc_line_num? thank you. train2 <- ddply(train, c("weeknum", "doc_num", "doc_line_num", "short_date","cust_code", "op_code", "job_tp_code"), function(x) colsums(x[c("combined_hours")])) # sample data weeknum doc_num doc_line_num short_date cust_code op_code job_tp_code combined_hours 40 227555 1 2015-10-02 dotsug ndona pu 0.0269448 40 227555 3 2015-10-02 dotsug ndona pu 0.4183320 using old-school plyr , should able ddply(train, .variable

Makefile rule to create several files, that each depend on different targets -

i trying write makefile file aggregation. following: have data several days ate breakfast lunch , dinner. files named like: monday_breakfast.meal monday_lunch.meal monday_dinner.meal tuesday_breakfast.meal ... or if working numbers makes simpler: 00_00.meal 00_11.meal 00_22.meal 11_00.meal ... the objective aggregate 3 files each day single file each day, days. possible write rule this? tricky part don't know how many days worth of files there when run make, want generic. i thinking like: days= $(sort $(patsubst _*,,*.meal)) day: %.day: $(days): but stuck. using sort of exercise learn more makefiles---it seemed easy @ first can not think through. make's ability manipulate strings not 1 might desire. here goes. suppose have: monday_breakfast.meal monday_lunch.meal monday_dinner.meal tuesday_breakfast.meal tuesday_lunch.meal tuesday_dinner.meal wednesday_breakfast.meal first, names of meal files: meals := $(wildcard *.meal) then somehow want

arrays - String padding and slicing to fixed length -

for random length array of 1's , 0's, need make start , end 001 , 100 respectively. some examples in string form readability "11010" => "00110100" "01010" => "0010100" "10000" => "00100" "01100" => "001100" "11111" => "001111100" "00100" => "00100" "00010" => "00100" "00000" => "" # cases no 1's ignored the code came shift/unshift push/pops using until def norm(arr) (arr.index(1) > 2 ? arr.shift : arr.unshift(0)) until arr.index(1) == 2 (arr.rindex(1) > arr.length-3 ? arr.push(0) : arr.pop) until arr.rindex(1) == arr.length-3 arr end is there better(sort of?) way padding, slicing, etc.? you can ignore 0 before first 1 , after last 1 . so, def norm(arr) if arr.include?('1') ['0', '0'] + arr.slice(arr.index('1')..a

json - AngularJS Dynamic Editable Table Directive -

my goal here create dynamic editable table directive, takes in json object , outputs editable html table. here plunker of have far: http://plnkr.co/edit/enay3g?p=preview //////////////////////////////////// // save //////////////////////////////////// $scope.save = function (ind) { $scope.headers.foreach(function(entry) { $scope.data[ind][entry] = 0; //i know shouldn't 0, dont know how @ value of input text box }); $scope.showing = false; }; everything works, except save. dont know how update json object in controller of directive. , can't put ng-model on text boxes because overrides value being set json. could possible add ng-model directive on "edition mode text boxes" , "edition mode text boxes" should bind copy of row object instead of original 1 , later, on save operation replace original 1 edited copy ///////////////////////////////

javascript - Click to reveal answer -

updated include more code our webdesigner has had stroke , i've been trying finalise of design in absence. seems unlikely ever able me. i've been using typepad , 1 of pages has faqs , uses javascript if click on question answer revealed. if click on answer text disappears again. updated of answer text , seems have broken javascript links somehow. i've been doing tutorials , trying learn how fix it. shows questions , answers , click reveal functionality has been lost. our designer using onclick = toggle i have included code (replacing answer text answer 1 brevity) here see if can point out how has been broken/how can fix it. sadly have 0 experience of doing this. thank :) <p>faq display</p> <script type="text/javascript">// <![cdata[ function toggle(info) { var cstate = document.getelementbyid(info); cstate.style.display = (cstate.style.display != 'block') ? 'block' : 'none';} //

ruby - Nested Context Blocks in RSpec -

does seem bad nesting context blocks inside of other context blocks? for example: describe "update_management" context "with typical update" context "when red flag has been raised" "" end end context "when yellow flag has been raised" "" end end etc... end end i recommend check out better specs know more best practices while using contexts in rspec tests. can take @ rspec-style-guide know more best practices.

java - why javax.annotation of different organization are different -

i'm using guava , jetty in java project, while found odd problem. in guava,it depend javax.annotation has many class while in jetty javax.annotation has less in guava. what's difference between them. what's more,the javax.annotation in jetty signed,while in guava not signed. when jvm load class package javax.annotation in guava.jar , jetty.jar,it throw securityexception cause 1 package signed , others not signed. so,what's real difference of javax.annotation package between guava.jar , jetty.jar. the package in guava: no sign , has lot of class the package in jetty: signed , has little class there different libraries provide types in javax.annotations package. 1 guava using jar (now abandoned) jsr-305 proposal . in maven com.google.code.findbugs:jsr305:1.3.9 . the other jar appears org.eclipse.jetty.orbit:javax.annotation:1.1.0.v201108011116 . it's not clear jar comes from, , appears have been uploaded in 2011 , never updated since. the co

ios - using didDismissCompletionHandler in MZFormSheetController -

i'm using mzformsheetcontroller present modals in app. there situation want present second sheet controller right after dismiss first one. in order that, there completion block , can't figure out how use it. the code looks this: [self mz_presentformsheetcontroller:formsheet animated:yes completionhandler:^(mzformsheetcontroller *formsheetcontroller) { formsheetcontroller.diddismisscompletionhandler; }]; in completion handler, supposed notified of sheet dismissal can call second sheet? this pretty simple, not totally intuitive if haven't spent time in type of environment. [self mz_presentformsheetcontroller:formsheet animated:yes completionhandler:^(mzformsheetcontroller *formsheetcontroller) { formsheetcontroller.diddismisscompletionhandler = ^(uiviewcontroller *presentedview

shell - Passing params to another Bash file, with spaces -

i want pass several parameters 1 bash file another, problem is, seems ignore quote marks, dont want pass $@ . here current setup: agent.sh : #!/bin/bash key='insert_key_here'; resp='command start test "srcds_run -game garrysmod +maxplayers 32 +map gm_construct"' ./cmd.sh ${key} ${resp} actually resp coming curl gives me same result. cmd.sh : #!/bin/bash echo $1; echo $2; echo $3; echo $4; echo $5; and guess, $5 gives me: "srcds_run instead of srcds_run -game garrysmod +maxplayers 32 +map gm_construct what wanted. so when using $* gives me parameters, fine want them splitted, same using $@ , overwrite parameters @ angent.sh script turns parameters $2 , want them splitted... so solution pass parameters spaces without issues? in case have use array (and more quotes): #!/bin/bash key='insert_key_here' resp=( command start test "srcds_run -game garrysmod +maxplayers 32 +map gm_construct" ) .

Javascript (with Sharepoint 2007) alert -

i program java started programming javascript , searched , searched couldn't find works. problem there 4 input fields (parid, groups, customer , projectname) , wanted add values make large string e.g.: 123456_nec_franzi_seestadt every time try alert it keeps me saying "undefined" <p> par id: <input id = "parid"> </p> <p> research group: <select id = "groups"> <option></option> <option>bam</option> <option>pas</option> <option>avt</option> <option>sra</option> <option>nec</option> <option>itp</option> <option>eld</option> <option>rft</option> <option>see</option> </select> </p> <p> customer: <input id = "customer"> </p> <p> projectname: <input id = "projectname"> </p> <p> submit: <inpu

c++ - func(QWidget* const &widget) VS func(QWidget* const widget) -

i've noticed peace of code works throwing away ampersand/reference signal. qwidget* widget; func(widget); do following expressions mean same? func(qwidget* const &widget) func(qwidget* const widget) i understand both pointers cannot modified stuff can modified. an answer focused on practical effects of both more valuable. read definitions right-to-left: the first means: widget reference const pointer qwidget object qwidget* const &widget the second means: widget const pointer qwidget object func(qwidget* const widget) of course not same. both definitions work because references automatically derenferenced compiler.

javascript - How could I access localstorage under Python requests -

i found need send session id x-connection-id stored server side javascript localstorage.setitem("x-connection-id") if , if id, can keep going following request. any idea ? headers = { 'user-agent': 'mozilla/5.0 (macintosh; intel mac os x 10_10_5) applewebkit/537.36 (khtml, gecko) chrome/45.0.2454.85 safari/537.36', 'x-connect-id': 'i need it', } req.get('https://api.sample/api/v1//flightavailability?'+urllib.parse.urlencode(params)) seems it's impossible local storage specific browser. local storage way store persistent data using javascript. should used html5 compatible web browser. to access local storage in python, compatible browser's python api required.

css - Font Awesome and Sass fail on my project -

Image
i working on windows , using bower, app.sass: $fa-font-path: "/lib/font-awesome/fonts" @import 'lib/font-awesome/scss/font-awesome' i have same project on linux , runs well, on windows fails, bug: 1) not use @import css (it limits ability of browser parallel load). recommendations <link href='my css' rel='stylesheet'> 2) edit @import 'lib/font-awesome/scss/font-awesome' to @import '/lib/font-awesome/scss/font-awesome' done

Error when using LogManager (l4j2) with Java 8 (java.lang.reflect.AnnotatedElement cannot be resolved) -

i encountered strange error when switching jdk version of new project of mine 7u45 8u20. harmless logmanager declaration @ beginning of class being refused following error: the type java.lang.reflect.annotatedelement cannot resolved. indirectly referenced required .class files this code: public class class1 { private static logger log = logmanager.getlogger(class1.class); ... eclipse proposes me configure build path, have no idea configure because don't know underlying problem of error. using jdk version 7, works fine. when using jdk 8 , ide own compiler, eclipse, have update ide version java 8 support, if not using newer java 8 features. the reason compiler must able load newer class files of jre in order compile software references these classes. sometimes can away older compiler when ignores newer version number of class files. types confuse older class file parsers use new features, notably annotatedelement , has default methods, , map.en

ajax - Polymer iterate/repeat through multiple ironajax responses -

i want iterate through 2 arrays including data iron-ajax request. the 2 repeats are: <template is="dom-repeat" items="[[risknamesarr]]" as="risk"> <paper-listbox multi> <paper-material>{{risk}}</paper-material> </paper-listbox> </template> <template is="dom-repeat" items="[[riskworkflowstatearr]]" as="state"> <paper-listbox multi> <paper-material>{{state}}</paper-material> </paper-listbox> </template> the result then {{risk1}} {{risk2}} {{risk3}} {{state1}} {{state2}} {{state3}} my issue want iterate through both arrays @ same time that: {{risk1}} + {{state1}} {{risk2}} + {{state2}} {{risk3}} + {{state3}} you use either computed property or computed binding . computed property // template <template is="dom-repeat" items="[[riskcombined]]"> <div>[[item.name]] + [[item.stat

c# - Dapper.net "where ... in" query doesn't work with PostgreSQL -

the following query produces error "42601: syntax error @ or near "$1" ". connection.query<carstatsprojection>( @"select manufacturer, model, year, avg(price) averageprice, avg(miles) averagemiles, count(*) count products manufacturer in @manufacturers , model in @models , year in @years group manufacturer, model, year", new { manufacturers = new[] { "bmw", "audi" }, models = new[] { "m4", "a3" }, years = new[] { 2016, 2015 } }); i have got around creating method below , calling inline build sql query now. know if dapper can handle object param though? public static string toinsql(this ienumerable<object> values) { var flattened = values.select(x => $"'{x}'"

c# - Adding a new grant_type in ASP.NET Identity? -

i'm using asp.net identity in web api 2 project. have , running fine authenticating username , password using following example: grant_type=password&username=alice%40example.com&password=password1! and working fine. now, service can called mobile app , want give user option able log in passcode. i've added 2 fields (passcode , device id) user table , have extended userstore able retrieve user based on information. my question how allow user supply passcode? need them able log in either password or passcode, thinking of sending following passcode: grant_type=passcode&username=alice%40example.com&passcode=1234&deviceid=abcdef and depending on grant_type can either query user store password or passcode. throws error ( unsupported_grant_type ) , having quick search looks these predefined values can't add new one? am able add new grant_type or have stick password , have additional field in post data stating if it's passcode? thanks

data manipulation - How do I remove all participants in R that only occur with one single variable level and never with the second one? -

i analyzing online community dataset r. i'd appreciate since stuck @ 1 problem. here outline: dataset: username of every user available. every row represents activity of 1 user in 1 single online community. example a: row 1 shows user 'blue' 'member' of online community x has contributed 1 post far. example b: row 5 shows user 'blue' 'owner' of online community y has contributed 2 posts far. see below! question: want remove users dataset active either member or user - in online community. want remove them if active members in several online communities. in other words, want remove users 'orange', 'purple', 'black'and 'white'. important: dataset contains > 1mio. rows. looking approach takes account :) thank you. username role # of posts blue member 1 blue member 0 red owner 6 red owner 1 blue owner 2 red member 1 blue owner 3 blue member 2 blue owner 1 blue

git - zsh having right prompt on same level as left using prezto -

Image
i'm new zsh , prezto . in bash shell want have current path on left , current branch @ right can see in picture far good..... ... problem right part of prompt in second line , not in 1 path in! # define prompts. prompt=" [ ${_prompt_steeef_colors[3]}%n%f@${_prompt_steeef_colors[2]}%m%f ] ${_prompt_steeef_colors[5]}%~%f "'$python_info[virtualenv]'"$ " rprompt='${vcs_info_msg_0_}' (complete source code: here ) how can achieve both path , branch @ same line in custom prezto prompt? if don't care rendering artifacts when resizing windows, can use control characters hack functionality in: local _lineup=$'\e[1a' local _linedown=$'\e[1b' rprompt=%{${_lineup}%}"some stuff"%{${_linedown}%} i found here: https://superuser.com/questions/357107/zsh-right-justify-in-ps1/737454#737454

c# - Invalid PUT method from Webforms to Web API 2 (Azure) -

i have web api in azure server , i'm making calls asp.net webforms website. i seem able perform no trouble. put, it's giving me error: the page looking cannot displayed because invalid method (http verb) being used i not able delete either. see other topics people disable webdav , stuff on iis servers , works. on azure? below code put: httpresponsemessage response = client.getasync("api/people/" + id).result; if (response.issuccessstatuscode) { var yourcustomobjects = response.content.readasasync<people>().result; uri peopleurl = response.headers.location; yourcustomobjects.name= "bob"; response = await client.putasjsonasync(peopleurl, yourcustomobjects); tbdebug.text += await response.content.readasstringasync(); } alright grew tired of trying fix issue enabling put. so did, wrote makes needed change in database. cheers

ios - Changing a property of an object from GameViewController.swift in GameScene.swift -

Image
i'm new swift, sorry if seems obvious question. i'm trying write game in swift, , have designed label , play button in storyboard. i've added references these objects in gameviewcontroller.swift file seen here: // mark: objects @iboutlet var gamelabel: uilabel! @iboutlet var playbutton: uiimageview! // mark: actions @ibaction func playbuttontapped(sender: uitapgesturerecognizer) { gamescene().gamestart() } this belongs gameviewcontroller class: class gameviewcontroller: uiviewcontroller . however, main game takes place in gamescene.swift . involves me having hide label , image game starts. i'm unsure how set properties these objects hide, since if did following in gamescene.swift : gameviewcontroller().playbutton.hidden = true ...the game crashes fatal error. error says: fatal error: unexpectedly found nil while unwrapping optional value . does have suggestion problem? appreciated. sorry if information difficult understand. cheers.

jquery - JavaScript - returning [object Object] -

i'm working on dynamic form appends groups of input fields page based on user input. because of additional functionality needs attached of these elements, need create them json objects. when test method 1 input element, element appended page, no problem. however, when try incorporate second element process, [object object] [object object] appended page instead. here's gist... //this problem function, triggered change function below function generateinput(sitenumber, x){ select = $("<select/>", { id: 'select'+sitenumber+''+x+'', name: 'select'+sitenumber+'['+x+']' }).append(list); notes = $("<input/>", { type: 'text', id: 'notes'+sitenumber+''+x+'', name: 'notes'+sitenumber+'['+x+']' }); //if return 1 or oth