Posts

Showing posts from March, 2014

removing enemy and bullet in collision java -

this question has answer here: iterating through collection, avoiding concurrentmodificationexception when removing in loop 17 answers i making simple 2d game in java. have created controller class , created linked lists zombies(enemies) , bullets. in gamestate class trying use each loops loop through linked lists , detect if there collision bullet , zombie. way laid out below in code example, enemy can removed game, if try remove bullet well, game crashes. wondering if ideas on how can remove both entities after collision occurs. this error when bullet collides enemy exception in thread "thread-1" java.util.concurrentmodificationexception @ java.util.linkedlist$listitr.checkforcomodification(unknown source) @ java.util.linkedlist$listitr.next(unknown source) @ android.game.gamestate.update(gamestate.java:71) @ android.game.game.update(game.java:121) @

android - Error "java.lang.String cannot be cast to java.lang.Integer" In Custom Adapter -

i have problem custom adapter put hint in spinner. i've made class adapterspinnerhint extends arrayadapter: public class adapterspinnerhint extends arrayadapter { int labelhint; int textviewid; int layout; arraylist<string> mitems; context context; public adapterspinnerhint(context context, int spinner_layout, int field, arraylist<string> list, int label) { super(context, spinner_layout, list); textviewid = field; labelhint = label; layout = spinner_layout; mitems=list; } @override public view getview(int position, view convertview, viewgroup parent) { view v; layoutinflater inflater = (layoutinflater)context.getsystemservice(context.layout_inflater_service); v = inflater.inflate(layout, null); if (position == getcount()) { ((textview)v.findviewbyid(textviewid)).settext(labelhint); ((textview)v.findviewbyid(textviewid)).sethint((integer) getitem(getcount())); //"hint displayed" } return v;

Objective-c:How can the object p know the changes of Person class after Person class is changed? -

how can object p know content of person class changed ?like this: before person class changed: #import <foundation/foundation.h> @interface person:nsobject @end int main(){ person *p = [[person alloc] init]; return 0; } after person class changed: #import <foundation/foundation.h> @interface person:nsobject @property int age;/* add new member */ - (void)test; /* add new method */ @end @implememtation person - (void)test { nslog(@"hello"); } @end int main(){ person *p = [[person alloc] init]; return 0; } how can object p know person added new member , new method? use instruments , allocations template , enter "person" in search box. if person object presently in memory in list.

sql - Parent Child over id query -

example data: id parent child total isparent isparentchildthing 1 j na 5 1 1 1 b na -5 0 1 1 j na -10 1 1 1 b na 10 0 1 2 x na -1 1 1 2 y na 1 0 1 3 z na 6 0 1 3 w na 7 0 1 3 p na -6 1 1 3 r na -7 1 1 3 tt yy 500 0 0 desired output: id parent child total 1 j b 5 1 j b -10 2 x y -1 3 p z -6 3 r w -7 in psuedo/english, each "pair" in given id, want parent , parent's total value , "child" goes parent determined isparent = 0 , total = total*-1 isparent = 1 any suggestions welcome according requirement, nee

javascript - *ngFor | async doesn't work -

there input text each change, service search results. serivce returns : observable contain results. return multiple persons . tamplate.html: <input type="text" id="inputsearch"> ... <tr *ngfor="let person of items$ | async" ... ... code: import { component ,oninit} '@angular/core'; import {control} '@angular/common'; import {personservice} "./person.service"; import {person} "./person.class"; import {observable} "rxjs/rx" @component({ selector: 'contact-table', moduleid: module.id, templateurl: 'contact-table.component.html', styleurls: ['contact-table.component.css'] }) export class contacttable implements oninit { private items$: observable<person[]>; private inputchanged$:observable<{}>; constructor(private _personservice:personservice) {} public ngoninit() { this.inputchanged$=observable.fromevent(document.getelementbyid("i

Jumbled words in ruby -

i implementing jumbled words game without gui, need in console. i need small console themes moving text , blinking text timeout, etc. need without graphics. i don't have limited questions jumbled words game, if user press ctrl + c or ctrl + d should print score in alert box. also if press ctrl + c or ctrl + d , errors printing in console. don't want print. how do this? here code: class string def black; "\e[30m#{self}\e[0m" end def red; "\e[31m#{self}\e[0m" end def green; "\e[32m#{self}\e[0m" end def brown; "\e[33m#{self}\e[0m" end def blue; "\e[34m#{self}\e[0m" end def magenta; "\e[35m#{self}\e[0m" end def cyan; "\e[36m#{self}\e[0m" end def gray; "\e[37m#{self}\e[0m" end def bg_black; "\e[40m#{self}\e[0m" end def bg_red; "\e[41m#{self}\e[0m" end def bg_green; "\e

javascript - Rails4 + Bootstrap3 - Modals render but won't show -

i'm using rails 4, bootstrap 3. particular page in question made of 3 haml views. first contains of page content. second contains row of buttons - 1 of needs trigger modal. third contains modal. code first view is: <...bulk of page content...> = render partial: 'shared/buttons', locals: {diagram: @diagram} #showdetail.modal.fade{"aria-labelledby" => "showdetail", :role => dialog, :tabindex => "-1"} code second view ('shared/buttons'): <...links several buttons don't call modals...> = link_to "show detail", show_detail_path(item), class: "btn", data: {"toggle" => "modal", "target" => "#showdetail", "remote" => :true} code third view (items/_show_detail.html.haml, routed 'show_detail_path'): .modal-dialog{:role => "document} .my_popup_contain .container-fluid

Asana - Get list of Projects that a user has access to? -

i coding "asana post" program need give user option choose project post task to. but obviously, can't offer user post projects may not member of of them. the option see in api pull projects team ids , pull users team , check if member. that seems tedious. any other ideas?

javascript - Where can I find Angular Materials' CSS directives? -

i'm working https://material.angularjs.org/latest/ components in searcher. i have md-datepicker field , want apply custom rules on (background-color: white, custom size, etc). https://material.angularjs.org/latest/demo/datepicker and need, instance, remove arrow selector , image (just applying 'display:none'). i've tried research on official documentation in repository, seems looking not there. did try this? .md-datepicker-triangle-button { display: none; }

python - Digits and caffe on windows error 5 -

i trying create classification model using digits gui 3.0. , getting error: error: [error 5] access denied traceback (most recent call last): file "c:\digits\digits\scheduler.py", line 494, in run_task task.run(resources) file "c:\digits\digits\task.py", line 208, in run env=env, file "c:\users\username\appdata\local\continuum\anaconda2\lib\site-packages\gevent\subprocess.py", line 534, in init reraise(*exc_info) file "c:\users\username\appdata\local\continuum\anaconda2\lib\site-packages\gevent\subprocess.py", line 503, in init restore_signals, start_new_session) file "c:\users\username\appdata\local\continuum\anaconda2\lib\site-packages\gevent\subprocess.py", line 847, in _execute_child startupinfo) windowserror: [error 5] access denied i create data set correctly. however, creating model triggering error.

android - RecognitionListener doesn't call onEndOfSpeech immediately after user stops talking? -

so using speechrecognizer along recognitionlistener recognize user speech. works fine problem when tested noticed doesn't call onendofspeech after finishes talking. waits around 7 10 seconds , onendofspeech , onresult called. don' know reason delay. here code: public class mainactivity extends appcompatactivity { protected static final int request_ok = 1; speechrecognizer sr; textview mtext; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mtext = (textview) findviewbyid(r.id.text1); recognitionlistener recognitionlistener=new recognitionlistener() { @override public void onreadyforspeech(bundle bundle) { toast.maketext(mainactivity.this,"start takling",toast.length_short).show(); } @override public void onbeginningofspeech() {

database - Need data storage recommendation -

i new aws, , have use case need store huge amounts of data - approx 60 gb. need records in data id parameter. data storage or database service recommended fast lookup? there several data storage services on aws: relational databases amazon rds (relational database service) provides fully-managed, traditional sql database using either mysql, mariadb, postgresql, oracle or microsoft sql server. you can try using them -- 60gb within scope to make them fast, put primary key on field wish use identify records retrieve , retrieve via field in statement amazon redshift data warehouse -- can handle tb , pb of data , quick on large volumes of data. however, overkill relatively simple requirements. non-relational databases amazon dynamodb fully-managed nosql database can configured provide exact number of reads , writes per second it not support sql, if goal merely store , retrieve data via unique id, 1 of fastest choices (and can change speed necessary) amazon s3

Searching -food, on google gives no result -

i fooling around, , going search food on google. mistake entered -food , , google gave no results: your search - -food - did not match documents. suggestions: make sure words spelled correctly. try different keywords. try more general keywords. i tried searching other keywords on google - before them. of them gave no results. knew because of part of algorithm, not understand part. can tell me bug, or if isn't, how happening? part of algorithm causing this? note: not off-topic asking algorithm. giving space after - gives proper results. like: - food . even though off-topic. answer this, because transferred other site. anyways.. you should read google search guide understand why happening. this feature provided google search engine. when not want word appear in results of search, use hyphen before word. -animals . consider this, want search sports cars without ferrari result. type sports cars -ferrari so when -ferrari

Discatenate a column vector to get back to its original square matrix in MATLAB -

i had convert n x n matrix n^2 x 1 column vector ease of operations. now, operations done, how return n x n form n^2 x 1 vector. it supposed opposite of this: concatenation thanks! you can use reshape() function: //m n^2 x 1 column vector, nxn matrix want recover = reshape(m, [n n]) if n x n matrix 3x3, then: a = reshape(m, [3 3]) for more info: http://www.mathworks.com/help/matlab/ref/reshape.html

Ignore the first two lines with ## in perl -

all. im newbie in programming in perl. skip first 2 lines in dataset. these codes. while (<peptidelist>) { next if $_ !=~ "##"; chomp $_; @data = split /\t/; chomp $_; next if /sequence/; chomp $_; $npeptides++; # print "debug: 0: $data[0] 1: $data[1] 2: $data[2] 3: $data[3] \n" if ( $debug ); $pepseq = $data[1]; #print $pepseq."\n"; foreach $header (keys %sequence) { #print "looking $pepseq in $header \n"; if ($sequence{$header} =~ /$pepseq/ ) { print "matched $pepseq in protein $header" if ( $debug ); # $in =<stdin>; if ( $header =~ /(ensgalp\s+)\s.+(ensgalg\s+)/ ) { print "debug: $1 $2 have pep = $pepseq \n\n" if ( $debug); $lprot = $1; $lgene = $2; $gccount{$lgene}++; $pccount{$lprot}++; # print "$1"

Docker - How to disable PHP ext / modules -

i working on php api , disable unused php modules inside php-fpm image, such "sqlite3, pdo ..". i docker beginner , know if there similar docker-php-ext-enable if not best practice disabling unused php modules. yes that's possible. taken https://hub.docker.com/_/php/ for example, if want have php-fpm image iconv , mcrypt , gd extensions, can inherit base image like, , write own dockerfile this: from php:7.0-fpm run apt-get update && apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ libpng12-dev \ && docker-php-ext-install -j$(nproc) iconv mcrypt \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install -j$(nproc) gd remember, must install dependencies extensions manually. if extension needs custom configure arguments, can use docker-php-ext-configure script example.

java - ADF Partial Validation -

i have panel splitter , 2 forms, 1 search (executewithparam form) , other 1 details, when click on create , click search, have fill require fields. tried immediate="true" skipped validation on search input texts. skipping validation in page definition didn't work either. how can skip validation on search button on details form , not search form, can please?

Python - del element in list based on another list -

list1 = [1,2,3,4,5,6,7,8,9] list2 = [10,11,12,13,5,7] and want list2 should cutted same elements in list1 , list2 --> list2 = [10, 11, 12, 13] 5 , 7 deleted because in list1. this tried: for in range(len(list1)): test = list1[i] if test in list2: del list2[list1[i]] print(list2) but list2 same before :-( hope can me edit: sorry forgot lists have got dates in datetime type. still work ? try this, first cast both list set , can find differnce between 2 set cast result list , assign list2 : list2 = list(set(list2)-set(list1)) list2 # [10, 11, 12, 13] however works when dont have duplicates in lists.

asp.net mvc - Prevent multiple form submission MVC Jquery -

i using actionlink , jquery submit form. submitting form every time when clicking link. want submit form first time(once). code - @html.actionlink(model.link, "defaultrate", "defaultrate", null, new { @class = "btnclick", onclick = "return false;" }) <script type="text/javascript"> $(document).ready(function () { $('.btnclick').click(function () { $(this).closest('form')[0].submit(); }); }); </script> thanks in advance this must work: @html.actionlink(model.link, "defaultrate", "defaultrate", null, new { @class = "btnclick"}) <script type="text/javascript"> $(document).ready(function () { var allow = true; $('.btnclick').click(function () { if (allow){ $(this).closest('form

osx - Error running '__rvm_make -j 1' during rvm Ruby installation | openssl error -

you searching error running '__rvm_make -j 1' says, went wrong while compiling ruby. question relevant if openssl and/or ossl_ssl part of error message. maybe problem similar 1 , can solve problem customizations. background today wanted delete gems of project forgot specify path bundler beforehand gems installed in ~/.rvm/gems/ruby-2.2.4/gems/ . as it's ruby 2.2.4 project though rm -rf ~/.rvm/gems/ruby-2.2.4/gems/* fine. wasn't. bundler gone , gem install bundler didn't worked anymore well. i removed hole ruby installation rvm remove ruby-2.2.4 ant tried reinstall it. console output error got: console output > rvm install ruby-2.2.4 searching binary rubies, might take time. no binary rubies available for: osx/10.11/x86_64/ruby-2.2.4. continuing compilation. please read 'rvm mount' more information on binary rubies. checking requirements osx. certificates in '/usr/local/etc/openssl/cert.pem' date. requirements installation

c++ - Vector<Vec3b> difference with Vector<int> in OpenCV -

my project moving puck detection , location finding on hockey table. need use houghcircles detect circular form of puck. hough alghoritm need make vector . familiar vector concept , how working ( basic), there problem of differentiating example vector<int> vec , vector<vec3b> vec . is possible let me know difference in meaning , application? pay attention vector , vector different. vector std::vector , while vector cv::vector . if in practice difference minimal, different things. i'll assume meant std::vector , in context valid cv::vector . a vector<int> vector of integers. nothing fancy this. a vector<vec3b> vector of cv::vec3b , opencv structure holds 3 uchar ( unsigned char ), i.e. type 8 bit can contain data 0 255. in fact defined cv::vec_<uchar, 3> . cv::vec template class represents short numerical vectors, 4 elements, not important here. a vec3b used in opencv store color pixel, b,g,r triplet.

java - No such algorithm - bcrypt -

i'm using spring security bcrypt password security. it's in grails application. when application starts get: "no such algorithm [bcrypt]" i traced error code in spring security: try { return messagedigest.getinstance(algorithm); } catch (nosuchalgorithmexception e) { throw new illegalargumentexception("no such algorithm [" + algorithm + "]"); } how install bcrypt java security? i'm running oracle jdk 1.8.0_73-b02 on centos 7. the problem code: messagedigestpasswordencoder(messagedigestpasswordencoder, conf.password.algorithm) { encodehashasbase64 = conf.password.encodehashasbase64 iterations = conf.password.hash.iterations } by default grails 3 spring-core plugin configures conf.password.algorithm="bcrypt" i thought had overridden in config in config.groovy. in grails 3 config needs moved application.groovy

jquery - How to get values of JSON object to string using javascript -

i have json object. example: { "id": 1, "name": "name", "surname": "surname", "number": "111111111" } how make string json object using javascript, looks this. name surname 111111111 you can use for...in statement iterating values of object. in loop add every value string. var json = { "id": 1, "name": "name", "surname": "surname", "number": "111111111" }; var str = ""; (var key in json) { str += (key != "id") ? (json[key] + " ") : ""; } console.log(str);

c# - How do I programmatically find whether the intermediate certificate was served by the web server? -

my c# code uses httpwebrequest send requests web service via http on ssl ( https:// prefixed urls). service has it's coolservice.example.com certificate signed certificate authority intermediate certificate in turn signed trusted root certificate authority certificate. latter must in caller certificate store , marked "trusted root", otherwise ssl trust chain thing makes no sense. intermediate certificate may come either of different sources: the web server may serve own certificate (as in "here's certificate , btw signed certificate signed trust, please check signatures along trust chain") the caller may automagically retrieve intermediate certificate authority (aia protocol or something) - know because i've been interfacing web service didn't have intermediate certificate installed , "it worked" the caller may have intermediate certificate installed in store i need check web server serves (not has in trust store serves certif

c# - Why SmartScreen Filter blocks all my executables? -

i have several winform tools now. publish them on internal website. issue in case smartscreen filter turned on in ie users can't download them. "blocked" error message. if it's turned off fine, smartscreen sure. all files signed verisign certificates , file details filled. so question: ho can make smartscreen trust files, or how can bypass without making users turning off? since internal company tool, should ask company's systems administrators deploy you. it can deployed using group policy, systems management server or whatever management system use. systems administrators have ability enable clickonce, can deploy using clickonce. no doubt have other methods use other internal tools. but short answer is: you should not trying circumvent protections company has put in place. instead, talk them , find way done.

sql - Insert NULL if value matches the value of another column -

lets have table : "mytable" , have 2 columns in : "val" , "val_new". now want insert new value "val_new" if values equal('val' , 'val_new') want insert null instead. ---------------------- | id | val | val_new | ---------------------- | 1 | 5 | null | ---------------------- | 2 | 6 | null | ---------------------- lets have table example. now : update mytable mt set mt.val_new = '5' mt.id = '1'; i want value of val_new remain null or updated null instead of '5'. edit: want update existing values not inserting new rows. you need not have insert record rather have update existing one. if run insert command new record created. table have ---------------- |val | val_new | ---------------- | 5 | null | ---------------- | 6 | null | ---------------- | | | <-- if val = val_new ---------------- | | 6 | <==if val<> val_new. i guess do

android - I want to place background image where "image url" is not present -

Image
i want place background image "image url" not present . i not getting background image image url not present . why not appearing ? please see in image 1 image url not present in json should replace "bc.jpeg" have placed in drawable folder. but not coming why not showing ? main activity public class mainactivity extends activity { // log tag private static final string tag = mainactivity.class.getsimplename(); private static final string url = "http://qzrbzpztcd.localtunnel.me/api/v1/restaurants?per_page=10&page=1&sort_col=average_ratings"; // movies json url //private static final string url = "http://api.androidhive.info/json/movies.json"; private progressdialog pdialog; private list<movie> movielist = new arraylist<movie>(); private listview listview; private customlistadapter adapter; @override protected void oncreate(bundle savedinstancestate) { super.oncr

Accessing data in an object array with Java -

i'm working cucumber , java. retrieve path of file itestresult . i'm retrieving parameters with: object[] test = testresult.getparameters(); however thing can access seem first objects name , nothing else. test = {object[1]@1492} 0 = {cucumberfeaturewrapper@1493} "links @ edm documents view," cucumberfeature = {cucumberfeature@1516} path = "test/01-automation.feature" feature = {feature@1518} cucumberbackground = null currentstepcontainer = {cucumberscenario@1519} cucumbertagstatements = {arraylist@1520} size = 1 i18n = {i18n@1521} currentscenariooutline = null i cannot see anyway of retrieving path = "test/01-automation.feature" under cucumber feature. have tried ((cucumberfeaturewrapper)test[0]).getcucumberfeature().getpath() ?

java - Thymeleaf and Spring Boot not reading properties from localization files - Question marks appear instead of the localized string -

when attempting localize static string message displayed surrounded questionmarks "??" e.g. ??ticket.type_en_us?? <p th:text="#{ticket.type}">blah</p> i using springboot 1.3.6.release thymeleaf: 3.0.0.release thymeleaf-spring4 artifact i have configured basename of messages in application.properties and contents of messages.properties , messages_en_us.properties is: ticket.type=bugs!!!! config: spring.messages.basename=messages output on startup: 2016-07-19 08:38:28.673 debug 5175 --- [ main] ationconfigembeddedwebapplicationcontext : using messagesource [org.springframework.context.support.resourcebundlemessagesource: basenames=[messages]] i tried programatically using messageresource in code below. placed messages.properties file in same folder application.properties file. src/main/resources/ @configuration @componentscan("controller") public class webconfig extends webmvcconfigureradapter

java - What is the difference in saving? -

i know can save objects in 2 different ways. diference between these lines? ebean.save(network); network.save(); there no difference. the play framework provides save() method, , others, default on model types mapped persisted entities. the method same thing ebean.save() gives benefit of abstracting away details of vendor specific orm being used. if using play framework, best practice call save() method directly on model/entity call methods on ebean directly.

android - Toolbar turns darker than normal while opening drawer -

while open drawer toolbar's colors turns way more darker color of rest of screen. initially toolbar's background color white. ideas why happening ? the code i'm using below : <android.support.v4.widget.drawerlayout android:id="@+id/dl_poll_container" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:background="@color/white" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="false"> <linearlayout android:id="@+id/ll_toolbar_container" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.toolbar android:id="@+id/tb_poll_toolbar" android:gravity="center"

java - tomcat as a service in windows do not load dll files of devices -

i trying run tomcat service, not load device driver dll files, , on starting startup.bat works perfectly. anyone please suggest options try out. when windows starts tomcat service not use startup.bat file manual startup. presume dll files in place not on java/tomcat path , made manual additions/changes startup.bat or catalina.bat make them available tomcat? if so, need modify service startup options define them there too. at command prompt navigate tomcat bin folder. run command tomcat6w.exe //ms//servicename (replacing servicename name of service) open service dialog. click through java tab , there can see can define additional options pass service @ startup. need define value java.library.path refer folder dlls are. tip: rename tomcat6w.exe file servicename.exe (replacing servicename name of service) , can double-click bring service dialog.

scheme - Getters for struct fields in a list -

i define struct this (struct anobject name1 name2 name3) i create lists containing these structs (define list1 (list (anobject name1a name2a name3a) (anobject name1b name2b name3b))) i value of name2 or name3 given name1. one way write 2 functions (define (get-name2 name1) ...) (define (get-name3 name1) ...) that loops through list looking struct name1 matches name1 arg , return property want. but these 2 functions same other 1 accesses name2, other accesses name3. if add more fields have add more functions. is there better way of retrieving name2/name3 single function (or other way)? i think better way first find item matching name1 field using library function, extract field want. can pass accessor function parameter need 1 function this. example in racket, shouldn't hard adapt "your" scheme: (require srfi/1) ; 'find' (struct anobject (name1 name2 name3)) (define (lookup n1 field ls) (let ((r

How to use dynamic golang html template id with javascript? -

hi have html image button dynamic id inside range in golang template. need add javascript function it. problem how use dynamic id in javascript? my html {{range $i, $e := .process}} <input id="id{{.}}" type="image" src="/images/icons/pencil.png" alt="edit" width="15" height="15"> {{end}} javascript <script type="text/javascript"> $().ready(function() { $('#id{{.}}').click(function() { $('#hidebody').toggle(); }); }); </script> how solve this? there better way this? give buttons class. {{range $i, $e := .process}} <input id="{{.}}" class="img-buttons" type="image" src="/images/icons/pencil.png" alt="edit" width="15" height="15"> {{end}} in javascript can do, $(".img-buttons").click ( function() { $(t

join - SQL Query For These Two Tables -

i have these 2 tables: person name gender regionid bob male 1 mary female 2 jane female 3 chris male 1 paul male 2 matt male 2 jenny female 1 region id region 1 north 2 south 3 central i end table this: region male female north 2 1 south 2 1 central 0 1 i first tried resulting table region's id in there no join required: select regionid, gender, count(name) person group regionid but gender field coming undefined. , didn't know go there. as tagged, i'm using alasql javascript library. try @ this: select a.region , sum(case when gender = 'male' 1 else 0 end) male , sum(case when gender = 'female' 1 else 0 end) female region inner join person b on a.id = b.regionid group a.region

asp.net mvc - Azure website suddenly responds slowly -

i have azure website consisting of wcf endpoint , mvc website running on azure. runs on basic medium/large tier - no cap in cpu free or basic has. has been running 6 months probably, regular deployments , updates. , performance has expected kept consistent. takes forever load mvc website. the flow follows; receive call via wcf endpoint , direct people url mvc web site. resides on same "web site" inside azure. the strange thing can see no difference in log files. wcf endpoint responds , can see heavy lifting inside mvc responds expected, still user left waiting forever on specified url? as said can't see in performance logs mvc controllers, somehow seems https request takes ages, how debug or measure this? i in process of getting visual studio 2015 see remote profiling can generated through kudo - somehow don't think problems resides here. kind of blanking thoughts on wrong , how debug appreciated. if knows azure has released within last couple of weeks mig

ios - Does using a path from system, while calling a file, cause crashes? -

Image
i've text file stores app's data me. if use system path (/users/username/desktop/projectfile/data.txt) , can cause errors when application compiled .ipa file? open file in project, , check target membership, shown in following image. if target membership icon checked corresponding target, not make problem during compilation(creating ipa). if target membership unchecked target build, make problem.

javascript - Why can't CasperJS show part of a web site 'outlook.com'? -

Image
i have problem of capturing of web page. after log in outlook.com using regular browser, should show inbox message in right side: however, when use casperjs, blank. have idea? i have include temporary login id in script, can test if can, thanks. here script: var casper = require('casper').create({ verbose: true, loglevel: "info", viewportsize: {width: 1280,height: 720}, pagesettings: {useragent: "mozilla/5.0 (macintosh; intel mac os x 10_8_2) applewebkit/537.11 (khtml, gecko) chrome/23.0.1271.97 safari/537.11"} }); casper.start('http://www.hotmail.com').then(function () { console.log('got here'); }); casper.wait(500, function () { console.log('wait'); }); casper.then(function(){ this.sendkeys("[name='loginfmt']", 'peterwhite12345678@outlook.com'); this.sendkeys("[name='passwd']", '12345678peterwhite'); this.click("[type='submit']")

java - Netflix Archaius Dynamic Configuration -

i integrating hystrix in existing project , want read configuration values xml file instead of feeding configuration properties using configuration manager. when values updated in xml file want hystrix configuration updated @ runtime. this guide following: https://github.com/netflix/archaius/wiki/users-guide i understand far can use polledconfigurationsource , following code: polledconfigurationsource source = ... abstractpollingscheduler scheduler = ... dynamicconfiguration configuration = new dynamicconfiguration(source, scheduler); configurationmanager.install(configuration); how point polledconfigurationsource xml file read properties after fixed time interval? following code did trick me private void initializeconfiguration() { // fixeddelaypollingscheduler initialized default system // settings // fixed delay in milliseconds between 2 reads of configuration // urls // archaius.fixeddelaypollingscheduler.delaymills = 60000 // initia

javascript - Retrieve the entire file tree from OneDrive JS API -

i'm trying pull down entire file tree onedrive api, without having manually crawl through (for offline browsing), can't seem find right params , documentation doesn't seem much. right now, after authorizing od api, send request [...]/drive/root?select=id,name,size,file,folder,photo,@microsoft.graph.downloadurl&expand=children&access_token=" + token the response brings root directory , children, doesn't expand there. how can request entire file tree without having recurse based on whether dir has children? the changes tracking api returns full set of items get .../drive/root/view.delta this call return changes within root folder's hierarchy, giving information need store offline set. using token returned in request, can issue future request , see changes need synchronize client.

Is possible create new firebase project by API? -

i's possible create new hosting projects api, or non-interactive method on google firebase? i tried firebase tools token, says possible create new project on firebase console. my project allow users create static websites online, , searching solutions host sites. firebase greate solution, if intregate user's new project sistem, firebase projects. there no public api create firebase projects. tools/cli says, you'll have create them in firebase console .

php - Converting SVG to PNG with ImageMagic ignores fill pattern url -

i using php's imagick class convert svg png. the conversion succeeds seems ignore fill patterns. here code: <?php $svg = <<<svg <?xml version="1.0"?> <svg> <defs> <pattern id="mypattern" x="0" y="0" width="20" height="20" patternunits="userspaceonuse"> <rect width="20" height="20" fill="#ffffff" /> <circle cx="10" cy="10" r="5" stroke="#0000bb" fill="#dd8d8d" /> </pattern> </defs> <text y="100%" stroke="#ff0000" fill="url('#mypattern')" font-size="40pt"> hello <tspan style="font-style: italic">svg</tspan> world! </text> </svg> svg; try{ $image = new imagick(); $image->setbackgrou

sql - Remove a key:value from json string stored in a MySQL database -

i have column in table stored in format: {"field1":"val1","field2":"val4"} {"field1":"val2","field2":"val5"} {"field1":"val3","field2":"val6"} i need remove field1 values(e.g "field1":"val1","field1":"val2","field1":"val3" ) , result should be {"field2":"val4"} {"field2":"val5"} {"field2":"val6"} i trying acheive via replace stuck in '"field1":"val1"' string val1 value null, integer. update emp set col = replace(col, '"field1":"val1"', '') i stuck due dynamic value of val1. you can this: select substring(field, 1, instr(field, '"field1"')) + substring(field, instr(field, '"field2"'), length(field)) @temp i don't know if

regex - Wrap a single field with single quotes using awk -

there number of examples using awk wrap fields double quotes. have unsuccessfully been trying enclose field single quotes data loading csv files in postgresql. below few of attempts: #!/usr/bin/awk -f begin { fs=ofs=","} { (i = 1; <= nf; ++i) if($i == 9) { $i = "\'' $i \''" } print $0 >> "output.csv" } or awk 'begin { ofs=fs="," } { $9= ""'" $9 ""'"} 1' container.csv > output.csv also... awk -v q="'" 'begin { fs="," } { sub($9, ""\'"&"\'"" );print}' container.csv > output.csv $ awk 'begin { fs = ofs = "," } { $9= "'"'"'" $9 "'"'"'"; print }' \ > <<<one,two,three,four,five,six,seven,eight,nine,ten one,two,three,four,five,six,seven,eight,'nine',t

css - Internet Explorer 'input:checked + label:before' styling is not rendered -

Image
i'm having trouble getting :checked styling custom checkboxes display in internet explorer. they work fine in chrome. ... in ie here's relevant styling input[type="radio"], input[type="checkbox"] { opacity: 1; position: absolute; top: -9999; & + label { vertical-align: middle; } } input[type="radio"] + label:before, input[type="checkbox"] + label:before { content: '\f3fd'; font-family: 'ionicons'; width: 26px; height: 20px; border: 2px solid #45555f; font-size: 24px; color: transparent; display: table-cell; text-align: center; transition: 0.3s linear; -webkit-transition: 0.3s linear; -moz-transition: 0.3s linear; -ms-transition: 0.3s linear; -o-transition: 0.3s linear; padding: 0 2px; } input[type="radio"]:checked + label:before, input[type="checkbox"]:checked + label:before { content: 

android - DownloadManager addCompletedDownload() method not working, gives SecurityException -

i using url download , read bytes of data using inputstream, data fetched writing using fileoutputstream in form of pdf. using environment.getexternalstoragepublicdirectory(environment.directory_downloads).tostring(); to write file in downloads folder. the file gets downloaded in download folder, , can access using filemanager, no issues in that. file not appear in downloads app. so, tried using downloadmanager object mmanager = (downloadmanager) getsystemservice(context.download_service); and once download has happened, using mmanager.addcompleteddownload(filename, "hello", true, "application/pdf", "nn",bufferlength,false); from sources addcompleteddownload method now, first query, i not quite being able understand must mention string path using line of code, getting securityexception says securityexception invalid value visibility 2 android any highly appreciated. securityexceptions usualy rised when dont provide need

How to set specific css value for javaFX ProgressBar during Runtime? -

Image
i have usual css progressbar : .progress-bar > .track { -fx-background-color: transparent; } .progress-bar > .bar { -fx-background-color: transparent; -fx-background-image: url('/images/progress_bar.png'); -fx-background-size: 1600px 50px; -fx-background-repeat: no-repeat; } image progress_bar.png 3-colored bar changes green red reaches it's end. works nicely when application run. my problem hard coded values background size. work on full hd displays on 1366x768 of yellow/red parts cut out. set property during run-time match screen size. possible? i tried use setstyle() method in progressbar without success. maybe doing wrong if has working example... i tried set width 100% (instead of px) not work either. shows compressed bar , stretches 100% width. here image: i don't think possible using css alone. customized skin used replaces bar node imageview , uses bar clip instead: progress.barbackgroundprogressbarskin publ