Posts

Showing posts from September, 2014

crash - Xcode 8 crashes on storyboard view and displays only blue outlines around views -

Image
i have updated xcode yesterday version 7 version 8.1 overnight , deleted xcode 8.0 beta had! today tried open projects, , when go storyboard, following error.. an internal error occured. editing functionality may limited. report bug (which did). the project opened, not use size classes or autolayout. i have searched many questions on net, pointed problem caused projects without autolayout. or suggested clean xcode, simulator, deleted derived data folder.. without success.. tried saving storyboard xcode7x file no success.. finally tried creating new singleview application , added uibutton it.. (while using size classes, autolayout..) still same.. it's xcode bug issue.. not autolayout incompatibility problem. any hints? p.s. compiling project run great, , ui elements show intended. don't have xcode7 installed anymore.. suggestions? i can not reproduce crashe, fix messed ui setting following under editor menu -> canvas :

laravel - How to display Protected Images in Email Messages -

i creating web app using laravel 5.3 authorised users can view images in app. example, lets says facebook friends can view user's avatar if permission set that. when image viewed app, api check auth credentials, check permission , displays user image accordingly. however, question is, if sending notification emails users, how can display protected images in email messages? example, if add img url in html email: <img src="http://example.com/api/image/useravatarname.jpg" /> the above fail since doesnt have token in it. in these cases, how protected emails displayed in emails? how website facebook it? these methods have thought of not happy with: 1) embed image binary data: don't know if adding image binary data work in html emails. if does, doesn't seem method when sending emails. 2) image url parameter: thinking maybe add parameters user's email address ?xyz@gmail.com img source url , api locate user email id , verify if have permissio...

java - Method with @Transactional called on target not on proxy instance -

i'm migrating 1 of projects form "self configured spring" spring boot. while of stuff working have problem @transactional method when called context not present set before due call "target" instance instead of "proxy" instance (i'll try elaborate below). first stripped down view of class hierarchy: @entity public class config { // fields , stuff } public interface exporter { int startexport() throws exporterexception; void setconfig(config config); } public abstract class exporterimpl implements exporter { protected config config; @override public final void setconfig(config config) { this.config = config; // this.config valid config instance here } @override @transactional(readonly = true) public int startexport() throws exporterexception { // this.config null here } // other methods including abstract 1 subclass } @scope("prototype") @service(...

Giving too many arguments to a function in Haskell -

in haskell, can give few arguments function curried function: -- addition function prelude> :t (+) (+) :: num => -> -> -- curried first argument => increment function prelude> :t (+) 1 (+) 1 :: num => -> -- supplied both arguments => result prelude> :t (+) 1 2 (+) 1 2 :: num => but when supply many arguments? prelude> :t (+) 1 2 3 (+) 1 2 3 :: (num a, num (a -> t)) => t what this, have name, , useful anything? it's useful think way. always give 1 argument function. f b equivalent (f a) b . so (+) 1 2 3 same as (((+) 1) 2) 3 now know ((+) 1) 2 is, it's same (+) 1 2 or 1 + 2 3. expression boils down 3 3 . how come it's not error? integer literals in haskell overloaded. 3 of any type, provided type has num instance. there nothing illegal give num instance function type either. type inferencer tells that: (num a, num (a -> t)) => t this can read as for type a has num instance...

sql - Add single character to string without using update -

problem i have around 5 hundred names in database end abbreviated name, e.g. : ┌────────────┬───────────┐ │ fname │ lname │ ├────────────┼───────────┤ │ berthe m │ bjaaland │ │ markus m │ nilsen │ │ ole t │ rasmussen │ └────────────┴───────────┘ i use find , replace add full stop after single-character names (no norwegian names consist of single characters, know abbreviations). easy if run update query, not have access that. there way find , replace or other workaround? desired result ┌────────────┬───────────┐ │ fname │ lname │ ├────────────┼───────────┤ │ berthe m. │ bjaaland │ │ markus m. │ nilsen │ │ ole t. │ rasmussen │ └────────────┴───────────┘ further usage once working, same method applied changing names single letter in middle, syntax ‘* ? *’. ─── notes i running access 2007 towards oracle. sql find names: select kommnr, kretsnr, bostnr, persnr, fornvn, ettnvn folketellinger_kperson_1875 fornvn ...

Installing LocalDB only, from SQL Server 2016 Express -

sorry if has been asked elsewhere. want use localdb, in installer sql server 2016 express it's bundled in (not separate install file). when installing it, feasible tick 'localdb' , none of other options? or there other items in installer need functional? (apologies - new this) thanks

c - Stacks are executable even with `noexecstack` -

i'm trying protect application against buffer overflow exploits. among other things, i'm using non-executable stacks , link binaries noexecstack flag (by passing -wl,-z,noexecstack gcc). everything seems fine - readelf confirms pt_gnu_stack specifies correct permissions: $ readelf -l target | grep -a1 gnu_stack gnu_stack 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 rw 10 so execstack : $ execstack -q target - target there's 1 problem. stacks executable: root@170ubuntu16p04-64smp-1:~# cat /proc/12878/task/*/maps | grep stack 7ffcac654000-7ffcac675000 rwxp 00000000 00:00 0 [stack] 7fe540e66000-7fe541666000 rwxp 00000000 00:00 0 [stack] 7fe540665000-7fe540e65000 rwxp 00000000 00:00 0 [stack] 7fe53b800000-7fe53c000000 rwxp 00000000 00:00 0 [stack] i've trapped allocate_stack ...

php - Obtaining checkbox values for n number of rows -

i'm trying implement bulk action functionality data displayed sql database on webpage. i've echoed out data html format, , i'm trying add checkbox feature user can select number of rows , perform bulk action them choosing value dropdown, e.g. delete- , selected values deleted database. i'm stumbling bit though obtaining selected checkbox values once perform action button submitted. i've put attempt @ code below- i'm getting invalid foreach argument provided error message. i'm has input loop. any appreciated! //establish connection database: require 'db.php'; $query = mysql_query("select * names", $conn); echo "<tr>"; //echo results while rows of data remain... while ($row = mysql_fetch_array($query)) { echo '<tr><td>' . $row['name'] . '</td>'; echo '<td><input type="checkbox" name="...

Attempting to SELECT, reduce by 1 then UPDATE with php/mysql -

just trying find value of table field , reduce 1 using mysql via php? is there simple way this? below code not process... cheers, j <?php $conn = connecttodb(); /* declare remaining integer */ settype($screenings, "integer"); /* select current screenings value , assign remaining variable */ $findquery("select screenings screener_users user_id = '" . $userid . "';"); $screenings = $conn->query($findquery); /* reduce value 1 */ $screenings--; /* update screener_users new value */ $updatequery = "update screener_users set screenings = '" . $screenings . "' user_id = '" . $userid . "';"; $result = $conn->query($updatequery); ?> you making mistake on query call. can see @ documentation , returns pdostatement, should call resultset value want. should work: <?php $conn = connecttodb(); settype($screenings, "integer"); $findquery("select screenings...

floating point - C program not adding float correctly -

i have method looks this: float * mutate(float* organism){ int i; float sign = 1; static float neworg[inputs] = {0}; (i = 0;i<inputs;i++){ if (rand() % 2 == 0) { sign = 1; } else { sign = -1; } float temp = (organism[i] + sign); printf("bf: %f af: %f diff: %f sign: %f sign2: %f temp: %f\n\n", organism[i], (organism[i] + sign), (organism[i] + sign)-organism[i], sign, sign+sign, temp); neworg[i] = organism[i] + sign; } return neworg; } when sign not 0 first 2 "%f" s same , 3rd 0, putting sum in variable didn't help. baffling me! can post full code if needed. output: bf: 117810016.000000 af: 117810016.000000 diff: 0.000000 sign: 1.000000 sign2: 2.000000 temp: 117810016.000000 finite precision of float . a typical float can represent 2 32 different numbers. 117,810,016.0 , 1.0 2 of them. 117,810,017.0 not. c sum...

c# 4.0 - Regex pattern to match groups starting with pattern -

Image
i extract data text stream data structured such /1-<id>/<rectype>-<data>..repeat n times../1-<id>/#-<data>..repeat n times.. in above, "/1" field precedes record data can have number of following fields, each choice of rectype 2 9 (also, each field starts "/") for example: /1-xxxx/2-yyyy/9-zzzz/1-aaaa/3-bbbb/5-cccc/8=nnnn/9=dddd/1-qqqq/2-wwww/3=pppp/7-eeee so, there 3 groups of data above 1=xxxx 2=yyyy 9=zzzz 1=aaaa 3=bbbb 5=cccc 8=nnnn 9=dddd 1=qqqq 2=wwww 3=pppp 7=eeee data simplicity, know contains [a-z0-9. ] can variable length (not 4 chars per example) now, following expression sort of works, capturing first 2 fields of each group , none of remaining fields... /1-(?'fld1'[a-z]+)/((?'fldno'[2-9])-(?'flddata'[a-z0-9\. ]+)) i know need sort of quantifier in there somewhere, not know or place it. you can use regex match these blocks using 2 .net regex features: 1) ca...

c# - AutoMapper - What's difference between Condition and PreCondition -

suppose mapping using automapper bellow: mapitem.formember(to => to.someproperty, => { from.condition(x => ((fromtype)x.sourcevalue).otherproperty == "something"); from.mapfrom(x => x.myproperty); }); what's difference of substitute condition precondition: from.precondition(x => ((fromtype)x.sourcevalue).otherproperty == "something"); what's practical difference between 2 methods? the diference precondition executed before acessing source value , condition predicate, in case, before value myproperty precondition predicate run, , value property evaluated , condition executed. in following code can see this class program { static void main(string[] args) { mapper.initialize(cfg => { cfg.createmap<person, personviewmodel>() .formember(p => p.name, c => { c.condition(new func<person, bool>(person => ...

java - Eclipse 4.6 and GWT Designer -

is there version of gwt designer, can use in eclipse 4.6 ? have 4.6 in gwt plugin, cant use designer edit webpages wysiwyg. gwt designer not has support google, newest gwt version not compatible designer. so, answer no.

how to solve proxy using maven (IN Eclipse) -

Image
when want create new maven webapp project using eclipse error : not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:release of configured repositories. here part of setting.xml : <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>myusername</username> <password>mypasseword</password> <host>proxy.host.net</host> <port>80</port> <nonproxyhosts>local.net|some.host.com</nonproxyhosts> </proxy> </proxies> thank here configuration : @madjlzz , using goals in commande line works but, in eclipse still problem

android - Social media app: inApp purchase that "helps" other users -

we have social media app 2 user groups. group heavy users , group b less frequent users follow group users. want offer full version purchase can bought both user groups. additionally want offer discounted purchase can made group a, purchase gives followers group b full version. not directly present indirectly. , of course plattform independent. if group user buys , has group b user uses apple phone , android tablet, should have full version on both. is allowed apple/android guidelines? not 100% sure , heard different things. mean can buy other subscriptions of popular apps outside of store influences own app couldn't imagine why shouldn't allowed? i have clarify: purchase yearly subscription

JavaScript variable not working in HTML Audio control? -

audio player not serving purpose, audio source url received in json , saved in audio path, variable passed src attribute, still doesn't seem work var audio_path = json_defects.audio_path; $('#audio_edit').html('<audio controls><source src="audio_path" type="audio/mpeg"></audio>'); you're setting src literal string "audio_path" . variables don't automatically expand in strings. instead, concatenate variable resulting string: '<audio controls><source src="' + audio_path + '" type="audio/mpeg"></audio>'

javascript - JS - swipe end (scroll end) event on eg. Touchpad / Magic Mouse -

on touchpad (eg. macbook) can scroll using 2 fingers, or on magic mouse can scroll swipeing 1 finger. is there way detect when i've finished such 'swipeing' - released fingers after scrolling? it's not mouseup there no click.

c# - How to remove a dll from the GAC when Gacutil.exe refuses service -

i have old version of enterprise library in gac. resists attempt on life made gacutil.exe claiming following: microsoft (r) .net global assembly cache utility. version 3.5.30729.1 copyright (c) microsoft corporation. rights reserved. assembly: microsoft.practices.enterpriselibrary.common, version=4.1.0.0, culture=neutral, publickeytoken=e44a2bc38ed2c13c, processorarchitecture=msil unable uninstall: assembly required 1 or more applications pending references: scheme: <windows_installer> id: <msi> description : <windows installer> number of assemblies uninstalled = 0 number of failures = 0 i found explanation on subject here , can’t find relevant registry keys. so want nuclear option. got one? have tried this? may work since don't think it's using gacutil: using windows interface navigate gac, located @ %systemdrive%\windows\assembly. right-click each assembly file included in application, clic...

eclipse - Jmeter failed to run JUnit Test jar -

i trying execute jar in jmeter load-test orientdb application . some details application : my application print(sysout) logs on console on startup `system starting, loading data... data loaded file..! connecting server save data..` then connect orientdb server save data there i run junit test case using eclipse , running successfully like printing logs on console (sysouts) connecting orientdb server , writing data there successfully problem : when trying run junit test case building jar using jmeter : jmeter print startup logs console (which means jar executing) : system starting, loading data... data loaded file..! connecting server save data.. but after jmeter exit , give error an unexpected error occured error -- executegraph(org.apache.jmeter.protocol.java.sampler.junitsampler$annotatedtestcase): com/orientechnologies/orient/client/remote/oserveradmin at point when giving error, ideally should connect orientdb , write data thei...

javascript - Validation between 3 steps in form -

i have form divided in 3 different steps. i want 2 different things: focus in input in steps 2 , 3 validation non-empty fields in steps 1 , 2 this code: window.onload = function() { document.getelementbyid("i_am").focus(); }; var form = document.getelementbyid('register'); form.novalidate = true; form.addeventlistener('submit', function(event) { if (!event.target.checkvalidity()) { event.preventdefault(); document.getelementbyid('youremailidmsg').innerhtml = document.getelementbyid('email_id').value == '' ? 'please enter email' : ''; } }, false); var questionnumber=0; var questions=document.queryselectorall('.notshown'); function next(){ questionnumber++; if(questions.length>questionnumber) { document.queryselector('.shown').classlist.remov...

c# - External Terminal / Debug outside the IDE -

Image
i'm starting use xamarin studio, , migrating vs it, when try run console application (the unique 1 loaded @ moment), fails , throws exception in console.clear() (supposing can't in integrated debugger), thought 1 way solve compiling , running it, visual studio does, , debug application outside ide, can't figure out how. tell me how solve problem? thanks. edit: reason, runs in embedded window when selecting release, can't read input, gets stuck. you need set project option have run console app in external console: xamarin studio: project options / run / general / run on external console visual studio mac: project options / run / configurations / default / run on external console

.htaccess - Wordpress Consolidating domains to one WP site -

i have existing site www.xyz.com hosts asp.net web site. have blog.xyz.com wp blog site. we have create new wp site www.xyz.com running. blog content exists in www.xyz.com under www.xyz.com/blog/... page names have changed url. have changed dns of blogs.xyz.com point ip of wp site. have added redirects in new wp site (page names url changing blog). right now, redirects failing 404 , browser showing original old email. the redirects setup using csv format of old url, new url site name removed. should work? thoughts welcomed.

database - Updating a link table using Access form/SubForm -

i have database has following structure: pet( pet id , name, type, dob, allergies, etc) owner( owner id , forename, surname, dob, address, etc) registered( reg_id , pet_id, owner_id ) the reason structure being remove many many relation whereby pet may have several owners, aim several people responsible animal in question. my aim have 1 form allows me set 1 owner , pets @ same time (owner pet sub-form), pet should automatically added registration table @ point owner. other owners added through registration table itself. any suggestions on how in access? i'm trying avoid stating pets can have single owner. thanks

junit - Spring Boot unit testing a Service, manual tests pass but mocked service fails -

in order test service logic have set initial test data in 3 repositories. bit of test working, updates service supposed make never happen in repositories , test fails. if show test followed service logic more clear i'm trying do. i think i'm missing annotations mocking service properly. think mocked service not connected mocked repository. don't know specific configurations add. here code: test: package portal.services; import static org.junit.assert.assertequals; @runwith(springjunit4classrunner.class) @datajpatest public class testrunservicetest { @mockbean private testrunservice testrunservice; @autowired private testrunrepository testrunrepository; @autowired private testcaserepository testcaserepository; @autowired private testtoolrepository testtoolrepository; @autowired private testsuiterepository testsuiterepository; testcase testcase = new testcase(); testtool testtool = new testtool(); testsuite te...

html - Google App Scripts Scroll -

i'm using google app scripts run document multiple dropdown menus have scripts make easier me insert paragraphs of typical information write often. my problem under 1 of "submenus," have many "items" require scroll bottom of "submenu" list. right now, solution either delete items fit page or create new submenu. there way have 1 "submenu" many "items" , have scroll down last item when accessing in googledoc?

plot - Plotting a continuous of time data in R -

Image
i trying plot distribution of turtle nesting activity on night using ggplot, want exclude times 8am - 6pm. also, need x-axis start @ 7pm , end @ 7am. my code is ggplot(sub.1) + geom_bar(aes(x = sub.1$time)) + scale_x_continuous(expand = c(0, 0), limits = c(0, 23), breaks = seq(0, 23, 1)) + xlab("hour") + ylab ("frequency") any assistance appreciated. try this. i'll post comments in there when chance. hope helps! # example data samplehours <- sample(1:23, 3000, replace = true) # keep wanted hours includedhours <- c(19:23, 1:7) index <- samplehours %in% includedhours # create dataframe sub.1 <- data.frame(hour = samplehours[index]) # change factor levels sub.1$hour <- as.factor(sub.1$hour) factorlevels <- c(19:23, 1:7) levels(sub.1$hour) <- factorlevels # plot library(ggplot2) ggplot(sub.1) + geom_bar(aes(x = sub.1$hour)) + xlab("hour") + ylab ("frequency") edit changed part id...

jquery - Check if an image is loaded (no errors) in JavaScript -

i'm using javascript jquery library manipulate image thumbnails contained in unordered list. when image loaded 1 thing, when error occurs else. i'm using jquery load() , error() methods events. after these events check image dom element .complete make sure image wasn't loaded before jquery register events. it works correctly except when error occurs before jquery can register events. solution can think of use img onerror attribute store "flag" somewhere globally (or on node it's self) says failed jquery can check "store/node" when checking .complete. anyone have better solution? edit: bolded main points , added detail below: i'm checking if image complete (aka loaded) after add load , error event on image. way, if image loaded before events registered, still know. if image isn't loaded after events events take care of when does. problem is, can check if image loaded already, i can't tell if error occurred instead. an...

oracle - UTL_HTTP - needs to stop escaping reserved chars -

i've got rest webservice , plsql package, want call webservice. parameters call located within uri of webservice. htttp://myservice:8080/some/path/action?value1=123456&value2=some chars&value3=agermansonderzeichencalledÄ as can see, there 2 problems uri. first whitespace value2 , second special character value3. that said, clear me uri has encoded more friendly format. webservice desires utf-8, uri encoded with: utl_url.escape(url,false,'utf-8') . this results in following uri: htttp://myservice:8080/some/path/action?value1=123456&value2=some%20chars&value3=agermansonderzeichencalled%c3%84 so far, good. encoded uri passed utl_http.begin_request(url,'get') . when execute request, , intercept wireshark, can see actual uri got called is: htttp://myservice:8080/some/path/action?value1=123456&value2=some%2520chars&value3=agermansonderzeichencalled%25c3%2584 what can see is, utl_http escapes reserved character '%' %...

guava - Java: possible transformation of List of objects to List of strings -

i have bunch of manager classes manage different objects state, country , on. getobjects() method returns list of such objects, values of these lists appended in different methods following ones: //states - statemanager.java public string getstatemsg() { stringbuilder msg = new stringbuilder(); if (states != null) { (state state : states.getobjects()) { msg.append(state.getstatecd())).append(" "); } } return msg.tostring().trim(); } //codes - codemanager.java public string getcodemsg() { stringbuilder msg = new stringbuilder(); if (codes != null) { (code code : codes.getobjects()) { msg.append(code.getcd()).append(" "); } } return msg.tostring().trim(); } //countries - countrymanager.java public string getcountriesmsg() { stringbuilder msg = new stringbuilder(); if (countries != null) { (country country : countries.getobjects()) { msg.append(...

python - Pandas to_csv() slow saving large dataframe -

i'm guessing easy fix, i'm running issue it's taking hour save pandas dataframe csv file using to_csv() function. i'm using anaconda python 2.7.12 pandas (0.19.1). import os import glob import pandas pd src_files = glob.glob(os.path.join('/my/path', "*.csv.gz")) # 1 - takes 2 min read 20m records 30 files file_ in sorted(src_files): stage = pd.dataframe() iter_csv = pd.read_csv(file_ , sep=',' , index_col=false , header=0 , low_memory=false , iterator=true , chunksize=100000 , compression='gzip' , memory_map=true , encoding='utf-8') df = pd.concat([chunk chunk in iter_csv]) stage = stage.append(df, ignore_index=true) # 2 - takes 55 min write 20m records 1 dataframe stage.to_csv('output.csv' , sep...

matlab - How to merge elements in a matrix -

x = [1 2 3 4 5 1 2 3 0 0]; i want off zeros , merge 2 rows newx = x(:,1) + x(:,2)(nonzeros) = [1 2 3 4 5 1 2 3]; nonzeros give nonzeros in column vector, have orient original matrix , transpose row vector (if that's want): >> newx = nonzeros(x.').' newx = 1 2 3 4 5 1 2 3

How to change the version of perl in Eclipse -

Image
i using eclipse neon 4.6.1 epic plugin 0.7.2 perl. trying change version of perl used eclipse can't quite figure out how change , how check it's changed. i using os x , perl 5.24.0 installed. [~]$: perl /usr/local/bin/perl [~]$: perl -v perl 5, version 24, subversion 0 (v5.24.0) built darwin-thread-multi-2level but when run perl script following, says running 5.18 system ('perl','-v'); perl 5, version 18, subversion 2 (v5.18.2) built darwin-thread-multi-2level (with 2 registered patches, see perl -v more detail) so seems path variable used eclipse incorrect, don't know how check version of perl called eclipse. in preference of eclipse, there settings called "perl executable" is how change perl version , how can check if indeed changed? @simbabque's way of checking confirmed perl version changed.

Why are these two identical sets of Firebase rules are working very differently? -

this set of rules working fine , giving output expected { "rules": { "intents" : { ".read" : "auth.uid === data.child('to').val()", ".write" : true }, "messages" : { ".read": "auth.uid !== null", "$message": { ".write": true } } } } but, set of rules not allowing user read data, though write operation working fine in set too. { "rules": { "intents" : { ".read" : "auth.uid === data.child('to').val()", ".write" : true }, "messages" : { "$message": { ".read": "auth.uid !== null", ".write": true } } } } to me, both these sets identical. there "firebase security rules" rule i'm missing? note both these rules tested without making change database or code. rules shown...

clojure - ANDing a boolean and a list -

i've noticed in scheme, racket, , clojure expression (using clojure here) (and true '()) evaluates () , , (and '() true) evaluates true . true not empty list, list. but in gnu clisp , emacs lisp, (and t '()) evaluates nil , (and '() t) evaluates nil also, (and t '(1 2 3)) evaluates (1 2 3) , (and '(1 2 3) t) evaluates t . what going on here? in first group of languages, empty list not treated 'falsey' , instead treated 'truthy' value. in scheme , racket, #false false value though '() null, null not false; in clojure empty list not same nil, 'truthy' there well. in second group, empty list synonym nil , treated false, leading condition return nil . list elements not same nil, , treated truthy value again. the final piece of puzzle and returns last truthy value if values passed truthy.

What is the real purpose of the $VERSION variable in Perl? -

i've read it's considered practice include $version number in of perl scripts, never understood purpose. what gain including version number in script? only modules, , pushed cpan benefit specifying $version . there's not use in script except use familiar name rather inventing new 1 if want script's version accessible. primary uses: cpan uses version of distribution, allowing index different versions of same distribution. cpan , cpanm uses check if installed module of sufficiently high level meet required minimum version of dependency. as brian d foy mentioned, can checked use foo 1.23; , people avoid in favour of specifying required versions of dependencies in distribution's meta file. allows cpan , cpanm update dependency if needed (where use using use foo 1.23; cause installation fail during testing). due lack of use of feature, it's hardly primary use.

python - What happened to the self variable when it's passed into a new function? -

this question has answer here: what purpose of self? 17 answers i trying decipher code posted few years on here: how implement binary search tree in python? the part confused section: class node: def __init__(self, val): self.l_child = none self.r_child = none self.data = val def binary_insert(root, node): if root none: root = node else: if root.data > node.data: if root.l_child none: root.l_child = node else: binary_insert(root.l_child, node) else: if root.r_child none: root.r_child = node else: binary_insert(root.r_child, node) the class , functions called doing this: r = node(3) binary_insert(r, node(7)) binary_insert(r, node(1)) binary_insert(r, node(5)) my question is: happened s...

javascript - html-jquery,selected option make visible next option -

i have form connected 2 select option. now this: <form> <select onchange="this.form.submit()"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <select> <option>please select first option</option> </select> </form> after submit coming this: <form> <select onchange="this.form.submit()"> <option>1</option> <option>2</option> <option>3</option> <option selected>4</option> </select> <select> <option>41</option> <option>42</option> <option>43</option> <option>44</option> </select> </form> how can make without form submit call...

docusignapi - Docusign Rest api : signer authentication methods and how they would fit into request body JSON -

i want add phone verification sms verification client authentication. able use access code verification having issues while using phone verification. using below request body string not working. can guide me issue? { status: "sent", emailsubject: "secure: request signature via email example", documents: { { documentid: "1", name:"docname", documentbase64: "docnumber" } }, recipients: { signers: { { name: "signername", email: "signeremail", recipientid: "1", accesscode: "1231231230", phoneauthentication: { recipmayprovidenumber: "704xxxxxxx", validaterecipprovidednumber: "704xxxxxxx...

Fail to push a standard Symfony PHP on Bluemix Cloud Foundry -

i'm unable push standard php symfony application on buemix cloud foundry, buildpack compilation step failed due error: [runtimeexception] not scan classes inside "app/appkernel.php" not appear file nor folder here 4 steps reproduce: i created new project composer create-project symfony/framework-standard-edition:^3.0 symfony_bluemix i tested locally php bin/console server:run i added manifest.yml file root of project applications: - path: . memory: 256m instances: 1 name: myphp-app host: myphp-app disk_quota: 1024m buildpack: php_buildpack i push project bluemix running cf push anyone knows needs configured make successful? although not manage make working know these issue comes bluemix deployment when symfony code moved htdocs folder. in case appkernel has referenced htdocs/app/appkernel.php in composer.json

Copy Odata source to Azure Blob using ADF error -

i trying copy odata source(microsoft dynamics marketing) azure blob storage using adf , below error. seen below before? copy activity met internal service error. more information, provide message customer support. errorcode: 8005 errorcode=systemerrorrefreshtokeninternalerror,'type=microsoft.datatransfer.common.shared.hybriddeliveryexception,message=there internal error refresh token.,source=microsoft.datatransfer.clientlibrary,''type=microsoft.datatransfer.credentialservice.datacontracts.exceptionhandling.servicefaultexception,message=exception of type 'microsoft.datatransfer.credentialservice.datacontracts.exceptionhandling.servicefaultexception' thrown.,source=microsoft.datatransfer.credentialservice.clientlibrary,' usually caused aad token expired or revoked. fix this, try redo authorization impacted linked service , re deploy in adf portal. see more details on https://azure.microsoft.com/en-us/documentation/articles/data-factory-azure-datalak...

How to Splice array in Javascript without returning reversed data -

i'm new javascript. have array: var test = [ {data1}, {data2}, {data3}, {data4}, {data5} ]; so did is var test1 = []; while(test.lenght){ test1.push(test.splice(0-2)); } but result is test1[0] = [{data4},{data5}]; test1[1] = [{data2},{data3}]; test1[2] = [{data1}]; i want splice this test1[0] = [{data1},{data2}]; test1[1] = [{data3},{data4}]; test1[2] = [{data5}]; how can achieve this? update array#splice method arguments 0 , 2 removing first 2 elements. var test = [ 'data1', 'data2', 'data3', 'data4', 'data5' ]; var test1 = []; while (test.length) { test1.push(test.splice(0, 2)); } console.log(test1) update : if don't want update original array use array#slice method. var test = [ 'data1', 'data2', 'data3', 'data4', 'data5' ]; var test1 = []; (var = 0, count = math.ceil(tes...

typescript - Cannot reference declared file in module when class is inside the same module -

i have declaration file: decl.d.ts . declare module mymodule { export class myclass {} } and source file: file.ts . /// <reference path="./decl.d.ts"/> export module mymodule { export class myotherclass { myfunction(): void { var myvar: mymodule.myclass; } } } problem mymodule.myclass not recognized. if remove module in file.ts , can reference class. what going wrong?

java - Parse a JSON response as an object -

good evening, newbie in web services , want write simple client gets responses rest calls. downloaded , added jersey-bundle-1.17.1.jar build path , found working piece of code makes rest call url , returns response string . import javax.ws.rs.core.mediatype; import com.sun.jersey.api.client.client; import com.sun.jersey.api.client.clientresponse; import com.sun.jersey.api.client.webresource; public class testjerseyclient { public static void main(string[] args) { try { client client = client.create(); webresource webresource = client .resource("http://path/to/service"); clientresponse response = webresource .accept(mediatype.application_json) .get(clientresponse.class); if (response.getstatus() != 200) throw new runtimeexception("failed : http error code : " + response.getstatus()); string output = respons...

android - How to show specific properties in the settings -

in android application have setting layout 4 properties. can call settings mainactivity , noticeactivity . have overwritten method: @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case r.id.action_settings: intent intent = new intent(this, settingsactivity.class); startactivity(intent); return true; } } to show settings have these 2 classes: public class settingsactivity extends preferenceactivity implements sharedpreferences.onsharedpreferencechangelistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); getfragmentmanager().begintransaction() .replace(android.r.id.content, new settingsfragment()) .commit(); } } public class settingsfragment extends preferencefragment { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate)...

botframework - Activity dropped because this channel is not enabled for this bot -

i tried chat bot via teams. worked @ beginning. after couple of tries, playing around code , getting know it. bot didn't respond in teams anymore. tested bot framework emulator, localhost , ngrok remote on webapi. worked fine. tested webclient bot channel, there worked well. @ first got error message "activity dropped because channel not enabled bot", don't errors anymore bot still not responding. did experienced kind of issue? there known bug when skype channel disabled, teams stops responding. if you've disabled skype try re-enabling temporary work around until fix published.

linux - Run SFTP commands in a bash script -

hi community dwellers, i have requirement - need place csv files local linux server remote linux/windows box. actions - we have passwordless connectivity establish between local , remote boxes. able sftp remote server below command - sftp -o port=11001 user@xx.xx.xx.xx able copy using put command - put /dir/local/*.csv user@remote:/usr/dir/ tried execute above commands in bash script , can reach till sftp login. tried running batchfile (in try 1) in statement in step 1, can see uploading data, when pwd, folder empty, no idea files getting written, same try 2 statement - try 1 - sftp -b test.sh -o port=11001 user@xxx.xx.xx.xx or try 2 - sftp -o port=11001 {user}@{host}:{remote_dir} <<< $'put {local_file_path}'

javascript - Scroll event triggers, but no scrollTop or offset.top value -

following js code works, values offset().top , scrolltop(), respectively, remain @ 0. $("body, html").scroll(function() { // event triggers on scrolling var foo = $("body, html").offset().top; var bar = $("body, html").scrolltop(); console.log(foo); // ==> 0 time console.log(bar); // ==> 0 time }); i have bad feeling somehow associated css overflow, can't figure out. here runnable snippet: $("body, html").scroll(function() { var bar = $(this).scrolltop(); console.log(bar); }); html { overflow: auto; height: 100%; } body { overflow: auto; height: 100%; overflow-x: hidden; } div { background: #ff9900; } <html> <head> </head> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"> </script> <div style="height: 1000px;">hi there.</div> </bod...

c# - ListBox not posting to MVC controller -

i have form have text area's , listbox. other fields in form being posted controller not listbox? here razor code: <form method="post" action="/admin/addpost"> @html.validationsummary(true) <div class="form-group"> <label>title</label> <input type="text" class="form-control" name="blogtitle" placeholder="title" value="@model.blogtitle" required> </div> <div class="form-group"> <label>image</label> <input type="text" class="form-control" name="blogimage" value="@model.blogimage" placeholder="image"> </div> <div class="form-group"> <label>description</label> <textarea name="blogdescription">@model.blogdescription</textarea> </div> <div ...

angular - angular2/Typescript looping over strings, first 1 not formatting as equation (mathJax) -

i pretty new angular2 , typescript , mathjax. i have application when calculate button clicked, retrieves results rest services endpoint. loop through results populate tables. 1 of properties equation string. i'm trying use mathjax show equation string equation. the first equation in loop not getting formatted, after formatting fine. missing? here's plunk simplified illustration of what's happening. http://plnkr.co/edit/epnc0r3rqvjhat0lxmcg?p=preview (why need add code here when i'm adding plunk unclear...but ok) mathjax.hub.queue(["typeset", mathjax.hub, "mathjax"]); is code i've found digging around adding library. think might missing here or in index.html script configuration of mathjax. thanks!

android - Unit Test - Mockito gives NullPointerException when mocking an interface -

i have presenter, has method getview() returns view. view, implements myview (an interface), has method isactive indicates whether active. i testing presenter. in @before setup of testclass, initialize presenter. testclass.java: @runwith(androidjunit4.class) public class testclass { private presenter presenter; @mock private myview mockview; @before public void setup() { mockitoannotations.initmocks(this); presenter = new presenter(mockview); when(mockview.isactive()).thenreturn(true); } @test public void testisactive() { presenter.isviewactive(); verify(mockview).isactive(); } presenter.java: public class presenter { private myview view; // following view instance of myview, not view (typo before). public presenter(myview view) { this.view = view; } public boolean isviewactive() { return getview().isactive(); } public myview getview() { return view; } } myview.class: publi...

javascript - jQuery Add Code To Existing Objects Function Call Back -

in page i'm using jquery countdown plugin. page has function in finish.countdown event . current code is: $this.countdown(finaldate).on('update.countdown', function(event) { //set actual time var format = '<span>%h<strong>'+t_hour+'%!h:'+t_plural+';</strong></span><span>%m<strong>'+t_min+'</strong></span><span>%s<strong>'+t_sec+'</strong></span>'; //send time countdown $(this).html(event.strftime(format)); }).on('finish.countdown', function(event) { //countdown done - add ended class container $(this).addclass('ended'); }); i not have access code generating code - can add own separate javascript page. is there way attach additional function / line of code finish.countdown event? i.e. if wanted console.log("done"); when timer complete can / how attach object - without modifying origina...