Posts

mod rewrite - Apache: doing pattern matching and grouping with a RewriteRule leads to the local path instead of getting the URL component -

i'd use rewriterule's pattern path requested , redirect client elsewhere keeping path in resulting redirect. i thought trick: rewriterule. ^(.*)$ http://testserver/test/$1 if user requests foo , send him test/foo (don't worry looping, put rewritecond logic prevent that). to surprise, apache ends http://testserver/foo/var/www/html . did following: /bar /var/www/html/bar i raised log level of mod_rewrite , found out did match, apache expand matching local path of / , /var/www/html , using redirect browser, won't surely work. i tried using [pt] thought prevent expansion, didn't. any idea on how can prevent happening. appreciated. best wiki

computer vision - Can't understand the PCL sample point clouds(.pcd) without header -

i working point clouds , using pcl. read .pcd file format from: http://pointclouds.org/documentation/tutorials/pcd_file_format.php the above link mentions every .pcd file contains header , yet have come across many .pcd files have no header. yet pcl reader able read file correctly. can't make sense of fields in file without header. example, have @ file: https://i.stack.imgur.com/cqqok.jpg know first 3 fields represent xyz cooridnates other 5 fields. the .pcd format can formatted in ascii or binary. you're looking @ binary version. header human-readable in ascii format not in binary format. pcl::pcdreader , pcl::pcdwriter capable of reading or writing both types. advantage of binary type small file sizes, whereas advantage of ascii type it's human-readable. wiki

javascript - How to filter to multiple paths using functional programming -

i have following pseudo-code: let array = getdata(); array.filter(x => condition1(x)).dosomething1... array.filter(x => condition2(x)).dosomething2... array.filter(x => condition3(x)).dosomething3... obviously not efficient because iterates array 3 times. i wondering if there way like: array.filtermany([ x => condition1(x).dosomething1..., x => condition2(x).dosomething2..., x => condition3(x).dosomething3... ]) so array gets iterated once? you can use array reduce functionality. for example: const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const split = arr.reduce(([odd, even], current) => { if (current % 2 === 0) { even.push(current); } else { odd.push(current); } return [odd, even]; }, [[], []]); console.log('odd / even', split); wiki

java - org.json.JSONException: No value for status Android Parsing -

hello have error in code in json parsing error org.json.jsonexception: no value status jsonobject c = new jsonobject(); try { if(c.has("status")) { this json format, have problem in getting status value. { "id": "7", "nome": "dfsdfsdfsdff", "email": "and@gmail.com", "status": "1" } you need put response in jsonobject constructor jsonobject c = new jsonobject(yourresponsestring); // ^^^^^^^^^^^ currently empty hence no status or else wiki

css - Fixed Div Won't Scroll In Desktop Safari -

it's hard reproduce generic version of behavior, please see codepen in debug mode (in safari): https://s.codepen.io/stephen_marsh/debug/ojzxml/nqkzynzlqxya when click yellow "shop look" trigger in header image, drawer of products should slide out. in chrome , firefox, drawer scroll intended. in safari, drawer not scroll until inside clicked, , scroll behavior laggy. interestingly, magic in codepen wrapper fixes behavior completely, if viewed in alternate mode full page: https://codepen.io/stephen_marsh/full/ojzxml/ now in safari fixed div scrolls intended , smooth. can figure out causing behavior? thanks scss: $product-drawer-header-height: 84px; $navigation-height-mobile: 60px; $navigation-height-desktop: 96px; .product-drawer-header { transform: translatex(100%); z-index: map-get($z-index, product-drawer-header); background-color: map-get($colors, teal); padding-left: 24px; padding-right: 24px; position: fixed; right: 0; top: 60p...

machine learning - Is weights are diffrent for each training Example in perceptrons -

Image
i new neural network. have training dataset of 1k examples. each example contains 5 features. initially, provided value weights. so, there 1k value stored weights associated each example or weight values remain same 1k examples? i.e. example1 => [f1,f2,f3,f4,f5] -> [w1e1,w2e1,w3e1,w4e1,w5e1] example2 => [f1,f2,f3,f4,f5] -> [w1e2,w2e2,w3e2,w4e2,w5e2] here w1 means first weight , e1, e2 means diffrent examples or example1,example2,... -> [gw1,gw2,gw3,gw4,gw5] here g means global , w1 means weight feature 1 on. thanks start single node in neural network. it's output sigmoid function applied linear combination of input shown below. so 5 features have 5 weights + 1 bias each node of neural network. while training, batch of inputs fed, output @ end of neural network calculated, error calculated respect actual outputs , gradients backpropogated based on error. in simple words, weights adjusted based on error. so each node have 6 weights, , depen...

javascript - How to make time counter will continue even refresh or leave the page -

i implemented timer count on examination page. edmodo website . when you're taking exam in edmodo, if refresh it, timer still counting. on site, if refresh page, timer refresh too. want edmodo still counting refresh page. please see code reference. note: i'm using laravel5.1/jquery $(document).ready(function() { // quiz timer (start of quiz) var quiz_timer = $('.quiz-timer').html(); var exact_time = parseint($('.timer-value').html() - 1); var hrs_to_spend = parseint(exact_time / 60); var mins_to_spend = parseint(exact_time % 60); var secs_to_spend = 60; var timeisup = false; var secs = 0, mins = 0, hrs = 0; var secs_zero, mins_zero, hrs_zero, h_spend_zero, m_spend_zero, s_spend_zero; var setters = setinterval(function() { if ($('.quiz-timer').html() != '00:00:01') { if (secs_to_spend > 0) { secs_to_spend--; } if (secs_to_spend <= 0) { ...