Posts

Showing posts from April, 2011

php - Programmatically submit file to website using Java -

i have simple website html file upload form, uses php file user submits. create java app able upload file specific page using form on page. in more detailed explanation, wan't create java app have specific file in it's directory. whenever app run, submit 1 file "file" input on website , app call submit button on site. there sort of 2 parts, first there actual website, form , php backend done , works supposed. there external app, can have on desktop. run 1 time , have specific file uploaded, without me having enter website , manually. far haven't been able find much, other apache commons library, said have uploading part. to make time line go, java app connects url, java app inputs/uploads desired file , java app submits actual form. note: file supposed uploaded regular .txt file here current script html , php part. html: <form enctype="multipart/form-data" action="upload2.php" method="post"> <input type=&q

swing - Java: Moving JButtons vertically in a JPanel with BoxLayout -

in program, need have 3 buttons. using boxlayout in jpanel , , have managed move them dead center of screen. correct size , in correct horizontal position, want move them top of frame. should use this? import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jtextfield; import java.awt.dimension; import java.awt.toolkit; import javax.swing.box; import javax.swing.boxlayout; import javax.swing.jbutton; public class library extends jframe { private jframe jf1; private jpanel jp1; private jbutton jb1; private jbutton jb2; private jbutton jb3; public library() { jf1 = new jframe("library"); jf1.setvisible(true); jf1.setdefaultcloseoperation(jframe.exit_on_close); jf1.setsize(1080, 900); dimension dim = toolkit.getdefaulttoolkit().getscreensize(); jf1.setlocation(dim.width/2-jf1.getsize().width/2, dim.height/2-jf1.getsize().height/2); jp1 = (jpanel) jf1.getcontentpane();

translate - XLIFF source with HTML content -

is common give translator xliff contains html? do cat tools support html tags properly? <trans-unit id="1" xml:space="preserve"> <source>this &lt;b&gt;bold&lt;/b&gt;</source> </trans-unit> update: i'm working on html5 wysiwyg editor widgets, , need have export translation feature. have @ xliff 1.2 presentation guide html . ideally need encapsulate html elements in xliff elements this: <g id='d' ctype='bold'>bold</g> . most cat tools support native xliff elements treat escaped html plain text, cause issues.

Google analytics regex goal not working correctly -

i have regex track signups site. there multiple adresses goal. here regex: (\/membership\/signed-up\/|\/membership\/campagin\/(?!.*(not-this-campaign)).[-\w]+\/signed-up\/) i want match adresses: /membership/signed-up/ /membership/campagin/random-campaign/signed-up/ /membership/campagin/other-random-campaign/signed-up/ but want exclude address: /membership/campagin/not-this-campaign/signed-up/ it works, google matches address: /membership/signed-up/step-2/ when test in http://regexr.com matches on strings want, why google analytics matching more? try : (\/membership\/signed\-up\/(?!.*(step\-2))|\/membership\/campagin\/(?!.*(not\-this\-campaign)).[-\w]+\/signed\-up\/) you regex correct, but, need ensure dont match step 2

python 2.7 - How can i find the pixel color range in an image that excludes outliers? -

i have code randomly generates 10 pixel locations in image dimensions. want take each pixel location , find gbr value , find largest g value, b value, r value , smallest g value b value , r value. found code can take color boundaries , create mask image. might want incorporate mean g, b , r value , compute standard deviation each , use eliminate outliers. or instead of using code wrote generate 10 random pixels if there way color range inside of +- 1 standard deviation of mean color of image? see code below: import cv2 import numpy np import random name = "highway" img = cv2.imread(name + ".jpg") inc = 10 n = 10 rpixel=[] # grabs bottom center of image, keeps image ratio. larger inc smaller imaged grabed def bottomcenter(inc,img): y,x,z = img.shape h = x/2 x1 = h - (x/inc) x2 = h + (x/inc) y1 = y - (y/inc) y2 = y bcsample = img[y1:y2, x1:x2] return(bcsample) # generates random selection of pixels def randompi

Elasticsearch groovy script loading error -

i have installed elasticsearch 2.4.3 on our new ubuntu servers. while starting server got error. 2016-12-22 20:22:56,199][info ][script ] [frrole-esprod-data-2-vm4] compiling script file [/etc/elasticsearch/scripts/userintel_updates.groovy] [2016-12-22 20:22:56,201][warn ][script ] [frrole-esprod-data-2-vm4] failed load/compile script [userintel_updates] scriptexception[error compiling script 5fe76475eb1c3c852696768a11f91509af4f6564]; nested: multiplecompilationerrorsexception[startup failed: not instantiate global transform class groovy.grape.grabannotationtransformation specified @ jar:file:/usr/share/elasticsearch/modules/lang-groovy/groovy-2.4.6-indy.jar!/meta-inf/services/org.codehaus.groovy.transform.asttransformation because of exception java.lang.classnotfoundexception: groovy.grape.grabannotationtransformation not instantiate global transform class org.codehaus.groovy.ast.builder.astbuildertransformation specified @ jar:file:/usr/sha

Error when installing cocoapods - Host is down -

i had problems installing gem, tried updating cocoapods. uninstalled first, tried installing again command sudo gem install cocoapods , gem install cocoapods. won't work because had following error: error: error: while executing gem ... (errno::ehostdown) host down - sendto(2) "8.8.8.8" port 53 this happens when gem install cocoapods , sudo gem install cocoapods. idea why happens ? connection internet ok. tried searching on internet possible solutions couldn't find similar one. never mind, using little snitch blocked incoming connection :)

javascript - Strange behavior when getting element height inline - it takes time to get the right heigh -

i have slider 100 images , want extract height of each of parents (the wrapper) use inline onload event: <div class="wrap" style="height: 100%"> <img src="<%=i.src%>" style="width: 100%; max-height: 100%" onload=" var maxheight = $(this).parent().height(); console.log(maxheight)"> </div> i can correct readings on image height . problem parent .wrap element. strange thing half of images log right height (almost first half of them log 0 height , other half log correct height ) , if wrap javascript inside settimeout function can see more time use more logs correct height until time logs correct. know has timing of load event, time fires shouldn't rendered because i'm trying father's height ? so: 1) why happening? 2) how make work?

http - Is OkHttp faster or better that HttpUrlsConnection for android? -

i have develop sdk web service android, should consider using okhttp creating instead of httpurlsconnection? if benefits of using it? you should try both if in learning phase. libraries make work alot easier. list down libraries used in making network call. retrofit library - easy intergrate , fasten network call official link . use peer library picasso if downloading images. use okhttp if need http operations lie outside of retrofit/picasso. volley library - officially supported google check this i recommned use retrofit simple use , documentation nice. pros of retrofit: compared volley in rest api code brief , provides excellent api documentation , have support in communities! easy add projects. can use serialization library, error handling.

java - Generic type in a map codec for MongoDB -

given map<class1, class2> , want store in format: [{ key: ** key encoded using class1 codec **, value: ** value encoded using class2 codec** }, { ... }, { ... }, ... ] since it's supposed work class1 , class2 , not know how implement mongodb codec , getencoderclass function ( encode , decode not problem) far know, not handle generic types. how can define , register such codec? or there easier way that?

performance - Is it faster to do bitwise inside an OpenGL shader or beforehand in C++? -

i unsure whether should , perform bitwise operations , division inside opengl fragment shader, or before running shader (calculate in c++ , pass uniform). i'm doing converting hex int representing rgb value color can used drawing in opengl. faster [on systems]? if single value calculated per draw call, in c++. gpus insanely fast, there's little point in getting them calculate same value millions of vertices or fragments. however, there's question of how data passed around. if suspect there's difference, try both approaches , profile them.

How can I write a SQL Server stored procedure to get the following output? -

i have sourcetable 2 column names: col 1 | col 2 ------------------ | 2 b | 3 c | 4 d | 2 e | 1 f | 0 the first column has letter, , second column carries frequency. we need write stored procedure , output in targettable this. we can not use loop, or iteration this. col 1 ----- b b b c c c c d d e how recursive cte? with x ( select col1, 1 i, col2 lim t col2 > 0 union select col1, + 1, lim x + 1 <= lim ) select col1 x order col1;

How to calculate time based on location in react native -

how can calculate time based on different location's time in react native app? example, user in new york , want app convert time user inserts , convert based on location's time (which given in lat/long) , send server store in db. time in advance. since default date.now() give time based on phone's timezone, suggest using momentjs has feature utc time (more on docs ). the default use be: const = moment(); and in order avoid timezones , utc time: const = moment.utc();

javascript - Arranging row text based on the header using boostrap or Jquery -

i have kind of table using boostrap. wanted sort them asc or desc after clicking header. search ordering , sorting in boostrap not thing want achieve. ordering moving things , sorting selecting , removing based on selection. $('#header > div').on('click', function() { var $label = $(this).find('label'); // column number var $filter = $label.attr('data-name') == 'name' ? 1 : 2; // set toggle asc/desc flag var $sort = $label.attr('data-sort') || -1; $label.attr('data-sort', -$sort); $sort = -$sort; $('#header').nextall('.row').sort(function(a, b) { var c = $(a).find('div:nth-child(' + $filter + ') label').text(); var d = $(b).find('div:nth-child(' + $filter + ') label').text(); if ($filter === 1) { // filter strings if (c == d) return 0; else if (c > d) return 1 * $sort; else if (c < d)

documentdb emulator gatewayservice crashing on startup -

i looking learn documentdb , installed emulator seemingly without error. however, upon startup have service crashing: gatewayservicestartup judging title guessing important service emulator. interestingly enough seems emulator continues load , attempts open : https://localhost:8081/_explorer/index.html without success. using command prompt attempted start gateway services manually , here results: c:\program files\documentdb emulator\packages\gatewayservice\gatewayservice.code>documentdb.gatewayservice.exe /? unhandled exception: system.runtime.interopservices.comexception: invalid value registry (exception hresult: 0x80040153 (regdb_e_invalidvalue)) @ system.runtime.interopservices.runtimeenvironment.getdeveloperpath() @ system.appdomain.setupfusionstore(appdomainsetup info, appdomainsetup oldinfo) @ system.appdomain.setupdomain(boolean allowredirects, string path, string configfile, string[] propertynames, string[] propertyvalues) c:\program files\documen

mysql - fetch data from table -

i have following table in database create table `sms_pool` ( `id` int(11) not null auto_increment, `ag_id` varchar(20) not null, `sms_to` varchar(15) not null, `template_name` varchar(100) not null, `contents` varchar(500) not null, `bulk_flag` varchar(1) not null, `file_name` varchar(100) null default null, `send_flag` varchar(1) not null, `creation_date` datetime not null default current_timestamp, `created_by` varchar(20) not null, `modification_date` datetime null default null, `modified_by` varchar(20) null default null, `processing_msg` varchar(2000) null default null, primary key (`id`), ); i wish write procedure/function takes 'id' input. if 'id' present in table should return corresponding row, if 'id' = null should return of rows database. note : if 'id' not present in table should return of rows. how should this? appreciated. thank in advance. :d you mean sele

c# - Trying to catch DbEntityValidationException but skips straight to general exception -

note: ef6 i adding several dozen each of 3 or 4 different types of entities before calling savechanges. when do, im catching exception inner exception message indicates "string or binary data truncated". pretty obvious 1 of fields trying put string field of 1 of tables isnt large enough hold it. question - field. 1 of tables has 30-40 fields. sometimes while debugging, if there fk constraint error, see entityvalidationerrors in locals window. in case not. so trying catch ef errors identify culprit, in code below, skips straight catch on general exception. //were done try { ctx.savechanges(); } catch(dbentityvalidationexception ef) { retval = -1; throw ef; } catch(exception ex) { retval = -1; throw ex; } how can identify field/entity causing issue?

php - can I $_POST multiple assoc. arrays -

i am.working on user input availability database. order standardize information, want use more 1 mulitiple select inputs. <form method="post" action=''example.php"> gamerid:<input ="text" name ="gamerid"/></br> monday:<select name="monday[]" multiple="multiple"> <option>select availability</option> <option value="4">4pm</option> <option value="5">5pm</option> <option value="6">6pm</option> <option value="7">7pm</option> <option value="8">8pm</option> <option value="9">9pm</option> <option value="10">10pm</option> <option value="11">11pm</option> <option value="12">12pm</option> <option value="1a">1am</option> </select> </br> tuesday:<select name

hadoop - How to create a variable with EL expression to use in all the actions oozie workflow? -

i want create variable should available actions in oozie workflow. have tried create shown below. el expression not getting evaluated resulting in variable current_ts value el expression itself. can please throw light on this? <workflow-app xmlns="uri:oozie:workflow:0.4" name="no-op-wf"> <parameters> <property> <name>current_ts</name> <value>${replaceall((replaceall((replaceall((timestamp()),"-","")),"t","_")),":","")}</value> </property> </parameters> <start to="test"/> <kill name="test"> <!--message show expression works if used here>timestamp - [${replaceall((replaceall((replaceall((timestamp()),"-","")),"t","_")),":","")}</message--> <message>timestamp - ${current_ts}</message> <!-- print exp

php - Putting data from two different loops in a google pie chart -

so have code google pie chart (pie chart code not included, works fine , displays data) <?php $query = "select * category type = 'expense' "; $select_category_list = mysqli_query($connection, $query); while($row = mysqli_fetch_assoc($select_category_list)) { $cat_id = $row['id']; $cat_title = $row['title']; echo "['$cat_title'" . ","; echo "$cat_id],"; } ?> i put echo in different lines, not matter if in 1 line or in 2 lines, matters working :) instead of $cat_id want put sum ($cat_amount) calculated code: $query = "select category_id, sum(amount) totalamount spendee type = 'expense' group category_id "; $expense_query = mysqli_query($connection, $query); while ($row = mysqli_fetch_assoc($expense_query)) { $cat_amount = $row['totalamount']; } i have tried putting while loop in while loop, foreach loop in while loop, putting

c++ - Storing 200kb of data in an array? -

i'm pretty new programming embedded applications (besides arduino stuff) , i'm working cc3220sf microcontroller texas instruments. currently have program polling device , storing result. store 100,000 of these samples (each 2 bytes) giving me 200kb of data store. i'm not sure how should go doing this, trying make array of size [100][1000] crashes device. how should go storing data later use? #define max_arr_length 1000 #define max_arr_depth 100 // later in collection function: uint16_t measurmentsarr[max_arr_depth][max_arr_length] = {0}; unsigned int arr_length = 0; unsigned int arr_depth = 0; // , later, after data point has // been verified useful: if (arr_length < max_arr_length){ measurmentsarr[arr_depth][arr_length++] = angle; } else { arr_length = 0; measurmentsarr[arr_depth++][arr_length] = angle; } this ^^^ way works small arrays, said need store 200kb... know cc3220sf has 512kb use, how best write

Racket Terminal: Command for exiting a current program? -

when running racket terminal, can start running racket program using (enter! "yourfile.rkt") how exit program while still keeping terminal open? using (exit) closes racket instead of current program. maybe try , current namespace restore original. (enter! #f)

api - Search/Filter/Select/Manipulate data from a website using Python -

i'm working on project requires me go website, pick search mode (name, year, number, etc), search name, select amongst results specific type (filtering in other words), pick option save results opposed emailing them, pick format save them download them clicking save button. my question is, there way steps using python program? aware of extracting data , downloading pages/images, wondering if there way write script manipulate data, , person manually do, large number of iterations. i've thought of looking url structures, , finding way generate each iteration accurate url, if works, i'm still stuck because of "save" button, can't find link automatically download data want, , using function of urllib2 library download page not actual file want. any idea on how approach this? reference/tutorial extremely helpful, thanks! edit: when inspect save button here get: search button this depend lot on website targeting , how search implemented. for

angularjs - in angular, using both ngRoute and ui.grid as dependencies makes the page go blank -

i'm using ngroute , ui.grid dependencies, whenever add ui.grid localhost page becomes blank, feels ngroute stops working whenever add ui.grid second dependency, using npm , lite-server localhost, , made sure install both angular route , angular ui grid. console log giving me error: uncaught error: [$injector:modulerr] [this error page angular's original site] 1 have angularjs application i'm beginner can't work around problem, appreciated, in advance. ps:this first question go easy on me if it's vague. well apparently missing couple of tags in code, once linked them code worked, sorry bother

asp.net - How gcTrimCommitOnLowMemory actually works? -

documentation gctrimcommitonlowmemory says: because garbage collector retains memory future allocations, committed space can more strictly needed. can reduce space accommodate times when there heavy load on system memory. reducing committed space improves performance , expands capacity host more sites. when gctrimcommitonlowmemory setting enabled, garbage collector evaluates system memory load , enters trimming mode when load reaches 90%. maintains trimming mode until load drops under 85%. when disable both gcserver , gcconcurrent . each web site (worker process) eats between 100 , 500 mb. when concurrent server gc enabled, web sites eats between 1500 , 2500 mb. since there more 100 such web sites memory load gets on 200 gb (physical memory full). i thought enabling gctrimcommitonlowmemory (while both gcserver , gcconcurrent enabled) causes web sites return unused memory gen 0 heap size when server reaches 90 % memory load. however, seems not return (the ser

xml - XSD schema different name in different place -

i have file xml , xsd , wish know if there way declare key in differente way. in other words: xsd file: <father name="f1"> <family name="fa1"> </family > </father > i wish f1 different fa1 have not idea it. thank help.

opengl - Can I use three-dimensional compute shader to write to a three-dimensional image -

define three-dimensional texture , dispatch compute gltexstorage3d(gl_texture_3d, 1, gl_rgba32f, screen_width, screen_height, texture_depth); glbindimagetexture(0, m_texture, 0, gl_false, 0, gl_read_write, gl_rgba32f); gldispatchcompute(16, 16, 2); compute shader #version 450 layout(local_size_x = 32,local_size_y = 32, local_size_z = 2) in; layout(binding = 0, rgba32f) uniform image3d image; void main() { ivec3 position = ivec3(gl_globalinvocationid.xyz); vec4 color = vec4(gl_workgroupid / vec3(gl_numworkgroups), 1.0); imagestore(image, position, color); } but code doesn't work, want konw value of gl_globalinvocationid.z depth of space i had solved probelm, parameters of gldispatchcompute() x,y,z, ifx y z local_size_x local_size_y local_size_z > screensize.x screensize.y, cannot work, downsample texture resolution.

c# - How to save Image in collection and load in picturebox -

i declare list store image's url , call "loadbitmap" method image's stream. //this list store url list list<string> imagefilelist=new list<string>(); //this list store return image stream list<stream> imagefiles = new list<stream>(); imagefilelist.add("some picture url"); imagefilelist.add("some picture url"); imagefilelist.foreach(delegate(string imgurl) { stream tempfile = loadbitmap(imgurl); imagefiles.add(tempfile); tempfile.dispose(); }); private stream loadbitmap(string imageurl) { stream image; httpwebrequest request =(httpwebrequest)webrequest.create(imageurl); using (var response = request.getresponse()) using (var stream = response.getresponsestream()) { image=stream; } r

How does the Bayes algorithm be implemented in sk-learn? -

today, try write bayesian algorithm compare same algorithm in sk-learn. i found result of own bayesian algorithm better bayesian algorithm named sklearn-gaussiannb , 1 named sklearn-multinomialnb. note idea of method writed similar multinomialnb in sk-learn. result different. is there need pay more attention on when use bayes algorithm in sk-learn? the accuracy: my own: 0.97 gaussiannb: 0.909 multinomialnb:0.876 does have similar problem? the bayes algorithm writed: http://paste.ubuntu.com/23382722/ the bayes algorithm sk-learn: http://paste.ubuntu.com/23382725/ the dataset: http://archive.ics.uci.edu/ml/datasets/occupancy+detection+

linux - See stdout of python script running through rc.local -

inorder run python script @ ubuntu startup, wrote command in rc.local file as /usr/bin/python path/to/my/script.py exit 0 my script.py has print statements. wanted know can see them while script being executed @ background. tried putting exec 2> /tmp/rc.local.log exec 1>&2 set -x at top, din't show in rc.local.log except sequence in bash commands got executed. i tried writing in rc.local /usr/bin/python path/to/my/script.py > /some/log.txt & din't work out either. so how see print statements of python script running in background via rc.local?

angularjs - How to change data into Angular 1.5 Component via an external Service? -

i make app angular 1.5 components. provide data component via resolve parameter, in way can display data different sources in same component. don't understand, how change data in component. for example, have user service, works users through api. in state load component , use method users.get(). use ui router. //... $stateprovider .state('users', { url: '/users', component: 'formpage', resolve: { values: function(users) { return users.get(); }); //... //... component('formpage', { bindings: { values: '<' }, //... i have form in component , want change data. want call users.update() method, when form submitted. component don't know users service , that's right. how may specify component must use users.update() update data in state? , how call method in component when form submitted? resolve: { values: function(users) { return users.get

ios - Map core data row from one table (entity) to an array of [CLLocation]? -

in ios app using core data , need save in table array of "regions" json. the model "region" object quite simple: class region : nsobject, nscoding { ... //mark: - //mark: - properties fileprivate var id: string fileprivate var name: string fileprivate var boundarypoints: [cllocation] fileprivate var midcoordinate: cllocationcoordinate2d { return getpolygonfromboundarypoints().coordinate } init(id: string, name: string, boundarypoints: [cllocation]) { self.id = id self.name = name self.boundarypoints = boundarypoints super.init() } //mark: - //mark: - nscoding ... //mark: - //mark: - getters , setters ... } the problem need persist in table record this: regions table: id | title | [cllocation] what best solution mapping row array of (lat,lng) points ( in case [cllocation]) when storing information "region" object ? "region" object model contains array of boundary points. in words how should go savi

java - Execution failed for task app:transformClassesAndResourcesWithProguardForDebug -

when try run app these errors: error:execution failed task ':app:transformclassesandresourceswithproguardfordebug'. java.io.ioexception: please correct above warnings first. this gradle file apply plugin: 'com.android.application' android { compilesdkversion 24 buildtoolsversion "24.0.2" defaultconfig { applicationid "xxxxxxxxxxxxx" minsdkversion 14 targetsdkversion 24 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled true shrinkresources true proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } debug { minifyenabled true shrinkresources true } } } repositories { mavencentral() } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.2.1' compile 'com.android.sup

php - Database error. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax -

i getting error: an error occured: database error. have error in sql syntax; check manual corresponds mariadb server version right syntax use near '@gmail.com, salt = , iteration = 12, method = blowfish, person_id ' @ line 1 here code: $data_con = new data_abstraction; $data_con->execute_query("insert `user` set `username` = $user, `password` = $phsh, `email` = $email, `salt` = $salt, `iteration` = $new_iteration, `method` = $new_method, `person_id` = $result2, `role_id` = $result4, `skin_id` = $result5"); edit: i used prepared query, used parameterized statements , bind parameters. error has gone details want inserted table not added. here code: if(!($sql = $link->prepare("insert `user` set `username` = ?, `password` = ?, `email` = ?, `salt` = ?,

android - Null pointer on a imageview, don't know how to pass it to a view -

this question has answer here: what nullpointerexception, , how fix it? 12 answers i have app takes picture , want see picture when taken. , works fine, picture , save storage. made view called "activity_image.xml. nullpointer: java.lang.nullpointerexception: attempt invoke virtual method 'void android.widget.imageview.setimagebitmap(android.graphics.bitmap)' on null object reference here try pass imageview main activity, , cant figure out how properly: static final int request_take_photo = 1; static final int request_image_capture = 1; intent takepictureintent = new intent(mediastore.action_image_capture); private bitmap mimagebitmap; private string mcurrentphotopath; private imageview mimageview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_fullscreen)

sql - Data type changing after multiplying two columns in MS Access -

i want multiply 2 columns each other , use following code cdbl(amount) * cdbl(weighting) [amount_weighted], "amount" regular number while "weighting" value between 0 , 1. resulting column formatted "short text" in access, although should number. column "weighting" or "amount" can empty, may reason malfunctioning? wrong formatting gives causes "number stores text" error when want export resulting column excel. the fact single lines empty caused problem. nz(amount,0) * nz(weighting,0) [amount_weighted] using instead of cdbl , therefore inserting "0" empty lines solved problem.

angular - Grails 3.2.1 - built in CORS - still get CORS error in browser -

i have grails rest app access via angular app running under nginx. running grails in development mode using run-app. had cors problems upgraded grails 3.2.1 , added following grails section in application.yml cors: enabled: true this allows accessible anywhere (i want work @ moment, worry restrictions later). but still cors error in browser console when tries access rest app data. on get. does know may have missed? regards.

Solving double (n-tuple) multivariate integrals in R -

Image
i write code solve kind of equations: for wrote code below, not solve problem. have ideas possibility solve kind of integrals in r? t_0 = 15 mu = 0.1 lambda = 0.8 f = function(x1,x2) exp(mu*(x1+x2))*dexp(log(lambda)*(x1+x2)) f_comp = function(x2) f(x1,x2) f_1 = function(x1) {integrate(f_comp,upper = t_0, lower = x1)} result = integrate(f = f_1, lower = 0, upper = t_0)$value --------- edit: given answer below, adapt code example, still think not correct one, @ least value 0 integral not make sense. integrate(function(x1) { sapply(x1, function(x1){ integrate(function(x2) exp(mu*(x1+x2))*dexp(log(lambda)*(x1+x2)), lower = x1, upper = t_0)$value }) }, 0, t_0) by way, buid general procedure (that why not calculate integral hand). not double integrals, n-tuples integrals, need general procedure kind of calculations.

routes - Laravel 5.3 web.php not working -

i'm web developer. in routes/web.php route::group(['middleware' => ['web']], function () { route::get('/', 'homecontroller@index'); route::get('news/index', 'newscontroller@getindex'); }); if running http://localhost/project/public/news/index has no action. me! can clarify? controllers exist? code works good: route::group(['middleware' => ['web']], function () { route::get('/', function () { echo 'one'; }); route::get('news/index', function () { echo 'two'; }); }); so problem controllers, or maybe apache configuration.

wpf - How to open/close view from the XAML code of another view when specific event is risen? -

how open/close view xaml code of view (using mvvm) when specific event risen? instead of using event, why not use variable datatriggers? have mainview has contentcontrol content equal initial view. when change variable (for example, true false) mainview sets content equal other view.

telerik - Is it possible to find out server response time and client rendering time using Fiddler? -

hope fine, use fiddler web calls. have tuned queries in application. test server response time , client rendering time using fiddler. option available in fiddler? if yes, can that? have gone through link , couldn't help. in advance. update: if fiddler doesn't this, can of ie browser console or extensions? nb: application works in ie no, fiddler not able capture rendering time or done purely on client side. able eavesdrop on data sent , forth between client , server. if want testing performance client-side standpoint. ahould take loom @ chrome dev tools timeline feature

java - How to properly set up a media player javafx -

i have created media player method javafx called upon startup (below media player). problem pauses whenever interact scroll pane dragging or zooming player pauses , not start again. why case , how may fix this(included full application if try it). method(live code) private static void musicplayer() { if(musiclist.peek() == null) { return; } mediaplayer mediaplayer = new mediaplayer(new media(new file(musiclist.poll()).touri().tostring())); mediaplayer.setonready(() -> { mediaplayer.play(); mediaplayer.setonendofmedia(() -> { mediaplayer.dispose(); musicplayer(); }); }); } minimal package minimalist; import java.io.file; import java.io.ioexception; import java.nio.file.files; import java.nio.file.paths; import java.util.linkedlist; import java.util.list; import java.util.queue; import java.util.stream.collectors; import javafx.application.application; import javafx.scene.scene; import

java - Encoding record samples for expectation maximization algorithm -

first, i'm programmer without data science background, working knowledge of statistics quite limited. i'm creating entity matching tool match records across internal datasets. want use probabilistic matching technique described in these documents*. have understanding of how technique works , how apply it, except derivation of agreement/disagreement weights using expectation maximization (em). specifically, i'm unclear on how encode record pairs double[][] format required the em implementation have available apache common math multivariatenormalmixtureexpectationmaximization . here concrete example: matching company records. a company has 2 fields: name (string) , country (enum) , , want generate m , u probabilistic weights using em. how create double[][] dataset each field feed em? in case of name , string there approximate agreement / disagreement, using string similarity method (edit distance, phonetic index, etc., details aren't relevant here) in

javascript - Replace multiple occurrences of words in html of page -

how can replace words in html without losing event bindings ? i want replace occurrences of word 'delivery' 'pickup' on html page suggested approaches : get html of page , store in variable 'content' replace word in 'content' variable through regex (updated_content = content.replace(/delivery/ig,'pickup')); update page html updated_content but approach wipes out event binding on page if use jquery: $("*:not(html, table, tbody, tr):contains('" + yoursearchphrase + "')").each(function(index, item) { item.innertext = item.innertext.replace(yoursearchphrase, replacementtext); });

html - Spacing issue. Replace tables with divs -

Image
there huge gap above table, , cannot understand why. here html: .table-size-guide td { border: 1.5px solid #ced9e0; padding-left: 10px; color: #ced9e0; font-family: helvetica; font-size: 12px; } .sizing-table { color: #fd8014; } <table class="table-size-guide" style="width: 100%;" cellspacing="2" cellpadding="5"> <tbody> <tr> <td style="padding-top: 8px; padding-right: 40px; padding-bottom: 5px; padding-left: 12px; background-color: #ededed;"> <span style="color: #ff8f07;"><strong>waist size</strong></span> </td> <td style="padding-top: 8px; padding-right: 0px; padding-bottom: 5px; padding-left: 12px; background-color: #ededed;"> <span style="color: #ff8f07;"><strong>to fit height</strong></span> </td> </tr> <