Posts

Showing posts from April, 2011

javascript - Using a post request to grab filtered data from python flask and update current webpage -

so have web page displays list of open jobs on market. there's advanced search feature on webpage filters results, use post request in java script these inputs python route. i'm confused how connect these arguments , grab filtered data. send inputs front end python route. i'm not sure how filtered data backend frontend. make ajax call same app.route ? can't call .render_template due project structure. this i'm using front-end $(document).ready(function () { $('#view_csr_search').click(function (event) { event.preventdefault(); var data = { role: $('#dropdown_option_1').val(), location: $('#location_drop_down').val(), mandatory_skills: $('#mandatory_field').val(), desired_skills: $('#desired_field').val() }; $.post('/jobs/search', json.stringify(data), ...

C# Entity Framework 6 two way binding with listbox -

how can bind entity listbox allows 2 way operation? i know can provide datasource, doesn't work (two ways mean). i able achieve wanted text box using listbox.databindings.add("text", entity, "textfield") . i've tried binding selectedvalue, selecteditem, selecteditems , items. none of work. in cases exception targetinvocationexception with inner exception text of object not match target type. the object date/time object, doesn't seem problem when bind using datasource . any appreciated. datasource source of items of listbox. when choose element listbox, selected element selecteditem. set datasource (usually target of foreign key) , bind selecteditem (the foreign key).

neoscms - Cropping does not work in Neos back-end, beta5 -

cropping in neos back-end throws exception (for neos beta5): uncaught exception #1297759968 in line 271 of /usr/local/www/apache24/data/_sprint2/data/temporary/development/cache/code/flow_object_classes/typo3_flow_mvc_controller_argument.php: exception while property mapping target type "typo3\typo3cr\domain\model\node", @ property path "": exception while property mapping target type "typo3\media\domain\model\imageinterface", @ property path "": not open stream resource af0c55f536c860b1d44ce0769f4a1ab52d15b6bd ("company_foldout_short.png") collection "persistent" while trying create temporary local copy. - see also: 20150708145304930495.txt previousexception => uncaught exception #1297759968 in line 260 of /usr/local/www/apache24/data/_sprint2/data/temporary/development/cache/code/flow_object_classes/typo3_typo3cr_typeconverter_nodeconverter.php: exception while property mapping target type "typo3\media\doma...

python - How open and read pdf (originally .html) file using Python3 -

i need open file in python3: http://www.arch.gob.ec/index.php/descargas/doc_download/478-historial-de-produccion-nacional-de-crudo-2011.html here have read it, , extract data tables. have searched several hours nothing seem work. new scraping/parsing , first time have looked in file handling of pdf. thanks kind of help! obtaining pdf internet called scraping. trying read pdf obtain data quite problem! there many utilities available try convert pdf text - not entirely successful. this article explains, pdf files nice use (look at), internals aren't elegant. reason visible text, not present directly inside document, , has reconstructed tables. in cases pdf doesn't contain text, image of text. the article contains several tools (try to) convert pdf text. have 'wrappers' in python access them. there few modules sound interesting, such pypdf (which not convert text), aren't. atxt looks interesting data mining - haven't tested yet. as me...

docker - Build multiple images from multiple dockerfile -

is there way build multiple images managing 2 different dockerfiles? in case want keep 2 dockerfile suppose dockerfile_app1 dockerfile_app2 within build context. docker build -t <image_name> . the above pick dockerfile named dockerfile docker build -t <image_name> dockerfile_app1 this not working case it's expecting file name dockerfile. i have tried docker-compose build also. din't work. app1: build: dockerfile_app1 ports: - "80:80" app2: build: dockerfile_app2 ports: - "80:80" just use -f argument docker build specify name of dockerfile use: $ docker build -t <image_name> -f dockerfile_app1 . ... or in compose can use dockerfile key version 1.3 onwards: app1: build: . dockerfile: dockerfile_app1 ports: - "80:80" app2: build: . dockerfile: dockerfile_app2 ports: - "80:80" note build key build context, not name of dockerfile (so looked directory called ...

ssl - Which keystore is used when null is passed to KeyManagerFactory.init() in Java? -

when execute following code: keymanagerfactory keymanagerfactory = keymanagerfactory .getinstance(keymanagerfactory.getdefaultalgorithm()); keymanagerfactory.init(null, null); and subsequent establishment of ssl connection, exception in thread "main" javax.net.ssl.sslhandshakeexception: received fatal alert: handshake_failure , not nullpointerexception or something. keystore used then? or npe hidden? when null used keystore argument of keymanagerfactory.init(..., ...) , no keystore used (it's in fact using an empty list internally). there's no "hidden" nullpointerexception such, , there's no reason why there should one. of course, using null value here , empty collection has consequences when trying use keymanager, not ssl/tls connections require keystore (e.g. client-side without client certificate or anonymous cipher suites). (note that, although there no default value keystore, there 1 truststore ...

PayPal IPN Simulator: Something went wrong while trying to connect to the URL. Please check the URL and try again -

i applying paypal payment on web application i'm building. trying test ipn messages ipn simulator on paypal sandbox account. the issue ipn simulator returning error ipn listener url "something went wrong while trying connect url. please check url , try again." . url in format http://123.123.123.123:1234/myapp.webapi/api/transactions/ppipnlistener . when run url in browser hitting method. address 123.123.123.123:1234 computer's address, visible "outside world" , myapp.webapi project hosted in computer's local iis. code is(c#): [routeprefix("api/transactions")] public class transactioncontroller : apicontroller { [allowanonymous] [route("ppipnlistener")] [httppost] public void ppipnlistener() { //some code } how make ipn simulator work? according this post domain name should used instead of ip address(e.g. http://www.example.com/myapp.webapi/api/transactions/ppipnlistener ) , should ...

android - Using RxJava inside RecyclerView Adapter -

so few weeks ago asked question: recyclerview periodic ui child updates . and today want refactor funcionality using rxjava. it's pretty simple, accomplish following way: @override public void onbindviewholder(recyclerview.viewholder holder, int position) { if (friend.getgamestatus().equals(gamestatus.ingame)) { holderonline.startrepeatingtask(); } else { holderonline.stoprepeatingtask(); } } class myviewholderonline extends recyclerview.viewholder { private subscription subscribe; public myviewholderonline(view itemview) { super(itemview); butterknife.bind(this, itemview); } public void startrepeatingtask() { subscribe = observable.interval(updateinterval, timeunit.milliseconds) .map(along -> current.getgamestatustoprint()) .subscribeon(schedulers.io()) ...

How to modify the date format of date('now') in sqlite? -

when execute following query : select date('now') returns 2015-07-08 . but, want receive date in format mm/dd/yyyy 08/07/2015 . how can that? i know sounds stupid question, i'm not able figure out long. have tried: select strftime('%d-%m-%y', 'now') the output be: 08-07-2015

ruby on rails - Singleton can't be dumped - cached_resource gem -

using cached_resource gem caching active resources. user model class user < activeresource::base cached_resource class teachers < simpledelegator attr_accessor :teacher_id def initialize(attributes = {}, _persisted = true) @teacher_id = attributes['teacher_id'] super(user.find(@teacher_id)) end end end i trying cache user resources. /users/:user_id whenever calling /users/:user_id endpoint gives me error singleton can't dumped @ line super(user.find(@teacher_id)) please suggest if other gem can me in caching activeresource calls. gem activeresource-response causing problem. making class singleton. because of throughing singleton dump error.

geohashing - Geohash: How much hash length is enough -

for application needs store geographical location of person in form of geohash, how hash length (in characters) enough? the code located here (referred in wikipedia article on geohash ) says: #define max_hash_length 22 but haven't mentioned reason that. some justification can found on other topics: geohash-and-max-distance geohash-string-length-and-accuracy to localize person, need one-meter accuracy. 10 characters should enough.

mysql - PHP Queries in Play Framework 1.3.x -

i'd know if can use php in order data mysql database. fraction of code can seen here: <?php $servername = "localhost"; $username = "root"; $password = "pass"; $dbname = "name"; // create connection $conn = new mysqli($servername, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = "select aa, bb, cc data"; $result = $conn->query($sql); ... ?> this placed inside html file in play framework folder "views", , loaded controller, when loads, shows me code if text, , not code or action supposed do, not recognise it. how can solve it? no, cannot use php inside templates, play doesn't parse php @ all, doesn't know there php. p.s. trying reuse php code in java app more difficult learning valid approach java only, see answer similar post (it's mysql raw access, not php integration) ca...

html - HtmlAgilityPack reading table after specified table -

i have similiar structure this: <table class="superclass"> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> ...

c++, Identifier is undefined when part of the code is put in another cpp file -

i'm sorry if question layout weird or first time asking question. have started learning c++ week ago , know how create window glfw clean code , make nicer. tried put "create window" stuff inside .cpp file named "window.cpp" , import main file. when take out glfwcreatewindow function doesn't recognize window name "w_gill" in swapbuffer, windowshouldclose , destroywindow functions. can please me? here main.cpp file: #include <iostream> #include <windows.h> #include "window.cpp" int main(){ do{ createwindow(); glfwswapbuffers(w_gill); glfwpollevents(); } while (!glfwwindowshouldclose(w_gill)); glfwdestroywindow(w_gill); glfwterminate(); return 0; } and window.cpp file: #include <gl\glew.h> #include <glfw\glfw3.h> int windowwidth = 1920 / 2; int windowheight = 1080 / 2; int createwindow(){ if (!glfwinit()) { glfwterminate(); return -1; ...

regex - .htaccess rewrite URL - change domain -

i'm using wordpress multisite wpmu domain mapping - allows me have different language versions on different domain. i'd need add .htaccess rule, that iouj.domain1.com/wp-activate.php?key=2b1447e2fe48f3af points iouj.domain2.com/wp-activate.php?key=2b1447e2fe48f3af i guess need regex this, can't right...

php - how to pass value of varibles in json -

foreach ($orderslist $object) { $entityid = $object->entity_id; //how give $entityid in json $json='{ "orderno":$entityid, //here want assign value of $entityid "customercode": $customerid, "dateordered": "08-07-2015", "warehouseid" : , "orderlinelist": [ "productid": 1000002, "qty": 6, "price": 10 ] }'; } $data = json_decode($json); $data_string= json_encode($data); don't write json strings hand. $data = [ "orderno" => $entityid, //here want assign value of $entityid "customercode" => $customerid, "dateordered" => "08-07-2015", "warehouseid" => null , "orderlinelist" => [ "productid": 1000002, "qty": 6, "price": 10, ], ]; $json = json_encode($data); ...

javascript - How to add context menu for elements in JavaFX webview? -

i want give context menu on html elements in web view. have written piece of code add context menu, displays wherever right click on webview. webview.setcontextmenuenabled(false); contextmenu menu = new contextmenu(new menuitem("verify")); webview.setonmouseclicked(new eventhandler<mouseevent>() { @override public void handle(mouseevent mouse) { if (mouse.getbutton() == mousebutton.secondary) { menu.show(webview, mouse.getscreenx(), mouse.getscreeny()); } else { if (menu != null) { menu.hide(); } } } }); is there way display menu on clicking html element? requirement such should display set of menus if right click on text field, other set of menus if right click on button, other set of menus if right click on radio button , on.

php - Show images from temp directory to end users -

i doing image rotate functionality. rotating image , saving tmp directory using $rotate = imagerotate($source, 90, 0); $rotatedtmpfile = tempnam('/tmp', 'rotatedthumbnailimage'); imagejpeg($rotate, $rotatedtmpfile ,100); files created in tmp folder. want read content of tmp directory generate url of tmp image file send src response ajax call javascript: $.ajax({ url: padmin.roateimageurl, data: { mediaid: id[1], src: src }, type: 'post', success: function(response) { img.attr('src', response); } }); show rotated image end user before uploading on s3 server. please help. i'm pretty sure /tmp not accessible via webserver directly. should either move /tmp directory in docroot, or alternatively encode image in html directly; using $mime = mime_content_type($rotatedtmpfile); $data = file_get_contents($rotatedtmpfile); exit('data:' . $mime . ';base64,' . base...

Text from php variable into javascript function -

i using jquery calendar looks this: $(document).ready(function () { $('#calendar').ecalendar({ weekdays: ['dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam'], months: ['janvier', 'fevrier', 'mars', 'avril', 'mai', 'juin', 'juillet', 'aout', 'septembre', 'octobre', 'novembre', 'decembre'], textarrows: {previous: '<', next: '>'}, eventtitle: 'evenements', url: '', events: [ { title: 'title', description: 'description', datetime: new date (2015,07,01)} ]}); }); </script> to events, connect mysql database , store result in php variable such as: $event={ title: 'title', description: 'description', datetime: new date: (2015,07,01)}; i can't figure out how put $event jquery script reads it. i tried exemple...

javascript - Disabled button color is not rendered correctly in IE9 -

in chrome, disabled button displayed blue color , border color, background color expected. in ie9 text color shown grey. css : fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { background-color: #fff; border-color: #ccc; } .st-btn-default { border: 2px solid #227ab9; padding: .49rem .75rem; color: #227ab9; } html : <input id="buttonprev" type="button" class="localize btn btn-default st-btn-default" lang="previous" value="previous" disabled> disabled attribute ...

javascript - How to insert and update data in Bootstrap table? -

i haven't found exact answer how insert , update data in bootstrap table. the data coming url in json format. i have use multiple urls in same table. <html> <head> <!-- latest compiled , minified css --> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/bootstrap-table.css"> <!-- latest compiled , minified javascript --> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/bootstrap-table.js"></script> </head> <body> <div style="margin : 100px;"> <button class="btn-primary btn" onclick="load();...

html - img and text (with ellipsis) in the same line - CENTERED -

here code of example: problem code example have code below conditions must fulfilled: 1) img , text in same line 2) text ellipsis (so text length not cause moving next line) 3) both img , text centered in parent first condition easy: img{float:left;} same second one: longname{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display:block;} but third 1 real pain me. if leave text center, while img stays on left (not visible long names) - third element in example. change try: moves text next line or destroy ellipsis effect or goes off parent borders. please help. you sort out flex model. .img-circle { display:flex; justify-content:center; } fork of pen

how to execute redis command in shell -

all: want operate redis in shell,my locate redis ip:127.0.0.1 port:6379,i want insert data redis in shell,but don't know how operate redis in own shell,is there redis command mysql -e execute in shell directly. just use echo redis-cli this: # delete list of cores echo del cores | redis-cli # add new core list of cores echo lpush cores 1 | redis-cli # wait forever core become available echo blpop cores 0 | redis-cli

google chrome - karma with karma-coverage takes to long to start -

i have problem karma (0.12.31), when running karma-coverage plugin. executing karma, without coverage, tests running after few seconds. if execute karma karma-coverage plugin take more time. know coverage can take more time, think amount of time ridiculous. with karma-coverage message "karma chrome have not captured in 60000 ms, killing", karma kills chrome (i'm using 43.0.2357.132). after 5 minutes, new chrome window open , after few seconds tests executed. is configuration correct , it's "normal" having wait long? we're talking 4000 tests, though i'm running 12 of 4000. this karma.conf.js file: module.exports = function(config){ config.set({ browsernoactivitytimeout: 60000, basepath : '../', preprocessors: { 'templates/*.tmpl.html': ['ng-html2js'], 'scripts/**/**/*.js': ['coverage'] }, files: [ {pattern: 'styles/...

Is varnish casting boolean to string? -

we have varnish 4.0.3 in live environment. extract code our vcl filein varnish vcl_recv : set req.http.x-is-static-resource = true; #boolean assignment # code if (req.http.x-is-static-resource == true) { # boolean == boolean ? # code } but hits error: message vcc-compiler: comparison of different types: string '==' bool ('/etc/varnish/utils.vcl' line 429 pos 37) if (req.http.x-is-static-resource == true) { ------------------------------------##-------- we found kind of assignments in several codes: https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl https://www.varnish-cache.org/trac/wiki/vclexamplehashalwaysmiss i think varnish shouldn't hits error. assign boolean type , expect boolean type, right? what missing? thanks the assignments found not req.http - req.http.[name] way access request header [name]. headers strings, not booleans. can still make work small changes, though: set req....

c# - Expression - Unable to create a constant value of type 'System.Collections.Generic.List`1'. Only primitive types ('such as Int32, String, and Gu -

i have written following lambda expression expression<func<contractobject, bool>> objexpression = => i.contractprojects.any(a => projectlist.any(p => p.id == a.projectid)); contractprojects , projectlist list of 2 different types sharing common values ie. projectid , id respectively. but throwing following exception. there changes have or can expression written in way? unable create constant value of type 'system.collections.generic.list`1'. primitive types ('such int32, string, , guid') supported in context. i think problem contractlist might not have been created yet try : var objexpression = => i.contractprojects.tolist() .any(a => projectlist.any(p => p.id == a.projectid));

.net - Polling IBM Websphere Message Queue -

requirement : build .net based application can reads messages @ regular interval ibm websphere message queue , save messages in database my solution : created windows service application polls message queue @ interval , process data. problem polling application process delayed polling interval. cannot set interval short not sure how data there in message queue , how long take process. question : better way process data websphere message queue using .net? how able process data arrive in message queue? what need asynchronous messaging. works registering callback, mq client invoke when message available. take @ knowledge center page: http://www-01.ibm.com/support/knowledgecenter/ssfksj_8.0.0/com.ibm.mq.dev.doc/q023050_.htm

php - Warnings are not showing in Laravel 5.1 -

i new laravel, , want show warnings, notices , errors. i searched lot , tried many things nothing seems work. in .env have app_env=local app_debug=true in controller echo non-defined variable echo $undefined; but still not showing warning or error, runs , there no entry in laravel.log file. check app.php in config/app.php 'debug' => env('app_debug', true) is true or false ?

php - Laravel 5: Artisan throw PDOException could not find driver -

i've found other question none seems solve problem. in case occurs on artisan command, if type "php artisan" output [pdoexception] not find driver . i'm running laravel 5 on ubuntu 14.04 lts, lemp stack (php 5.6 fpm, mysql, nginx). in config/database.php default driver set mysql. i've checked output of php --ini , seems load configuration files: configuration file (php.ini) path: /etc/php5/cli loaded configuration file: /etc/php5/cli/php.ini scan additional .ini files in: /etc/php5/cli/conf.d additional .ini files parsed: /etc/php5/cli/conf.d/05-opcache.ini, /etc/php5/cli/conf.d/10-pdo.ini, /etc/php5/cli/conf.d/20-gd.ini, /etc/php5/cli/conf.d/20-json.ini, /etc/php5/cli/conf.d/20-mcrypt.ini, /etc/php5/cli/conf.d/20-mysql.ini, /etc/php5/cli/conf.d/20-mysqli.ini, /etc/php5/cli/conf.d/20-pdo_mysql.ini, /etc/php5/cli/conf.d/20-readline.ini if open /etc/php5/cli/conf.d/20-pdo_mysql.ini see: ; configuration php mysql module ; priority=20 exte...

c++ - Difference between block and in-line if statement -

in c++ there difference in assembly code generated statement such as: if (*expr*) { } vs. if (*expr*) return; basically want know whether or not delimiting if statement brackets makes difference underlying code generated simple return statement, above. if there's going 1 statement within block both identical. if (e) { stmt; } if (e) stmt; are same. however, when you've more 1 statement executed, it's mandatory wrap them in {} .

java - Check if additional hour due to DST -

in application must check if given hour zoneddatetime additional hour due dst. consider transition summer time winter time 1) *date* 01:00:00+02:00 2) *date* 02:00:00+02:00 3) *date* 02:00:00+01:00 4) *date* 03:00:00+01:00 i want write simplest possible function isextrahour(zoneddate time) 1,2,4 return false , 3 case return true of course using java8 time api. this use: public boolean isextrahour(final zoneddatetime time) { return time.getzone().getrules().getvalidoffsets(time.tolocaldatetime()).size() > 1; } note returns true whole hour of overlap, assume answer need.

R : Problems in creating a seq(0,9) in a loop -

i trying write function in r i'm struggling sequence problem: vincent <- function(v,n, val_min){ # v = vector vincentize n = number of bin +1 mean_vct <- array(0, n) # n = nb de bins; crée un vecteur de 5 zéros si n = 5 vsort <- sort(v) vsort <- sort(subset(vsort, vsort>= val_min)) (j in seq(1,n) ){ mean_vct[j] <- (val_inf(j,vsort,n) + val_inter(j,vsort,n) + val_sup(j,vsort,n)) mean_vct[j] <- mean_vct[j]/(length(vsort)/(n)) } return (mean_vct) } when applying code print of sequence, : 1 2 3 4 5 6 7 8 9 0 instead of 0 1 2 3 4 5 6 7 8 9 , need sequence begin 0 because i'm converting code python r. thanks edit : example applying function : rt <- 1:100 vincent(rt, 10, 0) there several issues code. vincent <- function(v,n){ # v = vector vincentize n = number of bin mean_vct <- array(0, n) vsort <- sort(v) #tri dans l'ordre les tr (j in seq(0,9)){ #pour chaque bin mean_vct[j] <-...

javascript - IE 8 width issue with decimal values -

i have used 2 div element. below structure have used. <div id="firstelement" style="width:681px; height:401px"> <div id="secondelement" style="width:50%;height:50%;"></div> </div> i need exact width("340.5px") of second div in ie8. how can using javascript? tried below $("#getwidth").click(function(){ var ele = document.getelementbyid("secondelement"); var box = ele.getboundingclientrect(); alert("width = "+ box.right - box.left); // integer value returned. }); can please give suggestion resolve issue? try this: var rect = $("#secondelement")[0].getboundingclientrect(); var width; if (rect.width) { // `width` available ie9+ width = rect.width; alert(width) } else { // calculate width ie8 , below width = rect.right - rect.left; alert(width) } demo: http://jsfiddle.net/ishandemon/7s6lta50/

android - UI components not getting updated in onReceiveResult after finishing service -

hi using service load data url in tutorial( background service tutorial ) . i have 2 activities. 1st 1 going activity start service , 2nd 1 start service. when start service 2nd activity , waits there until service finishes, ui components gets updated properly. but when start service 2nd activity, finishes , start 2nd activity again ui components not getting updated when service finishes. fetched data correctly coming onreceiveresult ui views not getting updated. why happening? how can fix this? my code: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); /* allow activity show indeterminate progressbar */ requestwindowfeature(window.feature_indeterminate_progress); setcontentview(r.layout.activity_my); btnstartserv=(button)findviewbyid(r.id.buttonserv); /* initialize listview */ //listview = (listview) findviewbyid(r.id.listview); /* starting download service */ mreceiver = ...

.net - At a user control, when setting of DoubleBuffered = false makes sense? -

i have created user control i'm using single graphics.drawimage() paint entire content of control. " painting couldn't simpler " thought " so flickering should elliminated. " flickering on repaint still there until set doublebuffered property true . why setting of doublebuffered = false offered default value if leads flicker in case of trivial painting? why didn't lock painting mechanism @ double buffering permanently? there use case doublebuffered = false makes sense? all standard .net framework controls double buffered default. when create own controls custom paint logic, can specify if want use double buffering provided .net framework ( doublebuffered = true or setstyle(controlstyles.optimizeddoublebuffer, true) ) or not. for own controls, should set false if want use own double buffering logic (specially animation or advanced memory management) involves class bufferedgraphicscontext . heres link msdn describing double buf...

wso2esb - WSO2 ESB Proxy service call Backend service endpoint(WCF)(Big IP) have error 403/404 -

i create wso2 esb proxy service end service. can success call dev wcf service endpoint hosted in dev server , endpoint dev server name. use same way call test environment endpoint, test endpoint big ip endpoints. it's seem wso2 can't access big ip endpoints. from debug info.(my big ip endpoint https://hostname/201507/servicename.svc ) [2015-07-08 11:48:21,786] debug - headers http-outgoing-3 >> post /201507/servicename.svc http/1.1 [2015-07-08 11:48:21,786] debug - headers http-outgoing-3 >> content-type: application/soap+xml [2015-07-08 11:48:21,787] debug - headers http-outgoing-3 >> transfer-encoding: chunked [2015-07-08 11:48:21,787] debug - headers http-outgoing-3 >> host: hostname:80 [2015-07-08 11:48:21,787] debug - headers http-outgoing-3 >> connection: keep-alive [2015-07-08 11:48:21,787] debug - headers http-outgoing-3 >> user-agent: synapse-pt-httpcomponents-nio it's seems wso2 can't success post soap right endpo...

javascript - find() removes the immediate tag from my HTML stored in a variable -

i have html <div id='add_more_edu'> <div class='one_exp'> --- many input , select elements disabled attribute </div> </div> and have button on page, when clicked, function called, function's code looks this. var edu_contect = $("#add_more_edu").clone().html(); // line # 2 edu_contect = $(edu_contect).find("input,select").removeattr('disabled'); $('.edu_history_div').append(edu_contect); the fields disabled content appended in .edu_history_div <div id='add_more_edu'> --- many input , select elements disabled attribute </div> the <div class='one_exp'> gets disappear. if comment line # 2 <div class='one_exp'> not disappear. what solution? or any alternative line edu_contect = $(edu_contect).find("input,select").removeattr('disabled'); ??? i have tried $(edu_contect).find("input,select...

c# - Design a class, what's wrong if using IList as type of property? -

i have simple class below, has property pages of type ilist. there options implement property, can array or collection / list / readonlycollection public class book { private string[] _pages; public book(string[] pages) { _pages = pages; } public ilist<string> pages { { return _pages; //return new collection<string>(_pages); //return new list<string>(_pages); //return new readonlycollection<string>(_pages); } } } at design time , not know actions clients use property choosing option above affect clients. if client uses book class below var book = new book(new[] {"a", "b"}); var pages = book.pages; pages[0] = "a2"; not implementation options of property pages work client. option 1: returning array pages // ok, works public ilist<s...

How to implement navigation drawer in all activities in android -

i have piece of code supposed show navigation drawer in activities. code not show errors while running unfortunately stopped error after checking logcat shows java null pointer exception. these has been declared private drawerlayout mdrawerlayout; private listview mdrawerlist; private actionbardrawertoggle mdrawertoggle; protected relativelayout _completelayout, _activitylayout; private charsequence mdrawertitle; private charsequence mtitle; private arraylist<navdraweritem> navdraweritems; private navidrawerlistadapter adapter; after oncreate public void set(string[] navmenutitles, typedarray navmenuicons) { mtitle = mdrawertitle = gettitle(); mdrawerlayout = (drawerlayout) findviewbyid(r.id.drawer_layout); mdrawerlist = (listview) findviewbyid(r.id.left_drawer); navdraweritems = new arraylist<navdraweritem>(); // adding nav drawer items if (navmenuicons == null) { ...

matlab - Simulink save final state leads to compile error -

Image
i have simpe simulink model it compiles fine unless try save output states: then face error when try compile it: saving complete set of simstate supported model running in normal or accelerator mode, , model blocks running in normal mode. why happen , how around that? update: my model set fixed step , set normal mode: as mentioned in comments, "building" model purpose of generating code/executables, , saving final states not supported code generation. if want run model, press "run" button, not "build" button , should work. see simulink documentation more details on how run model.

java - Check Network and Internet Connection - Android -

i wondering if method below check both connected network, , can connected internet well. not connected network won't let me access internet ? public boolean isnetworkavailable() { connectivitymanager manager = (connectivitymanager) getsystemservice(context.connectivity_service); networkinfo networkinfo = manager.getactivenetworkinfo(); boolean isavailable = false; if (networkinfo != null && networkinfo.isconnected()) { isavailable = true; } return isavailable; } i think, not 100% sure. thanks from comparing accepted answer on post code, doing should work. feel free compare code. safest thing run few tests airplain mode, wifi turned off, , location away wifi sure. luck. android - programmatically check internet connection , display dialog if notconnected

javascript - How can I measure how long an embedded Vimeo video has been watched for? -

i have vimeo video embedded on webpage , want record google analytics event when user has watched video 10 seconds. there way measure how long video has been watched for? reference player uses: player.js - /* vimeoplayer - v2.7.1 - 2015-06-26 */ the playprogess event of vimeo api contain seconds property. so can ask listen event, , check property being more 10. function postmsg(id){ var msg = {method:"addeventlistener", value: 'playprogress'}; var iframe = document.getelementbyid(id), cw; if(iframe) cw = iframe.contentwindow; if(!cw){settimeout(function(){postmsg(id)}, 200); return;} cw.postmessage(json.stringify(msg), '*'); } var messagelistener = function(e){ if (!(/^https?:\/\/player.vimeo.com/).test(e.origin)) return false; var evt = json.parse(e.data); if(evt.event==='ready') postmsg(evt.player_id); if(evt.event==='playprogress') onplayprogress(evt.data); } function onplayprogres...

c++ - I'm getting symbol _cilk_spawn could not be resolved when compiling with icpc -

im using ubuntu 14.04 & eclipse & intel compiler v 15 i have 2 same programs (which use cilk commands) (one c program , other cpp program). i can compile icc (without problem) but when i'm using icpc (cpp program) i'm getting errors: symbol _cilk_spawn not resolved in same 2 programs im not using flags. what different cpp program, cant compile it the keyword "_cilk_spawn", capital "c". c/c++ convention non-standard extensions have leading underscore , start capital letter. you can include cilk.h defines macros allow use "cilk_spawn", "cilk_sync" , "cilk_for".

MongoDB not able to save data through node.js from url http://www.reddit.com/r/technology/.json -

i trying save data reddit collection following error keep coming mongoerror: error parsing element 0 of field documents :: caused :: wrong type '0' field, expected object, found 0: "stories" now stuck in please help here code please let me know missing. var mongoclient = require('mongodb').mongoclient, request = require('request'); mongoclient.connect('mongodb://localhost:27017/course', function (err, db) { if (err) throw err; request('http://reddit.com/r/technology/.json', function (err, response, body) { if (!err && response.statuscode == 200) { var obj = json.parse(body); var stories = obj.data.children.map(function (story) { return story.data; }); console.dir(stories); db.collection('reddit').insert('stories', function (err, data) { if (err...

ios - iAd Interstitial: Determining if ad was shown? -

i'm showing interstitials using destinationvc.interstitialpresentationpolicy = adinterstitialpresentationpolicy.automatic before show destintion view controller. how supposed detect if interstitial loaded? need know can know if should reset timer let's me show interstitials every few minutes. it's weird - 100% fill rate enabled in developer settings, interstitial doesn't show... i tried implementing adinterstitialdelegate seems interstitialdidload doesn't execute? for fillrate, talking test ads or live ads? iad has low live ads fill rate , not supported @ in many countries... for delegate, did assign delegate e.g. self.interstitial.delegate = self; assign , nslog example in delegate methods in interstitialdidload test if s called... p.s. timer fire ads isn t idea... ads should fired after action user, @ specific time regarding app lifecycle / usage , should not interrupt, happen if use timer...

Hive property not getting set -

i setting following property in hive-site.xml: <property> <name>hive.exec.dynamic.partition.mode</name> <value>nonstrict</value> </property> however in hive console if run, show conf "hive.exec.dynamic.partition.mode"; , strict does have clues why configuration properties in hive-site.xml not overriding default properties? further, tried set property console using set command, no luck there either. i think happening why show conf doesn't show current property's values command show default value. check documentation https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl#languagemanualddl-showconf regards

javascript - Hiding button in bootstrap -

i'm trying hide 1 or more radio buttons in bootstrap. see jsfiddle . settimeout(function () { $("input[value='other']").parent().hide(); }, 1000); it works expected except removing either of side buttons leaves new side button incorrectly styled (no rounded corners). in example removing 'female' works fine, removing 'male' or 'other' results in incorrectly styled button row. what easiest way fix this? note might have unhide buttons under circumstances removing dom not desirable. bootstrap applies style last element. solution i (if don't want remove button , hide it): create class in css give rounded corners , add class prev() element. , when show() element remove class. fiddle js: settimeout(function () { $("input[value='other']").parent().prev().addclass('pseudolast') $("input[value='other']").parent().hide(); }, 1000); css: .pseudolast{ bord...

java - Regular Expressions example -

i’m bit confused example... don’t understand written in string pattern. also, find ? learning tutorialspoint. please, can me understand it? code: import java.util.regex.matcher; import java.util.regex.pattern; public class regexmatches { public static void main(string args[]) { // string scanned find pattern. string line = "this order placed qt3000! ok?"; string pattern = "(.*)(\\d+)(.*)"; // create pattern object pattern r = pattern.compile(pattern); // create matcher object. matcher m = r.matcher(line); if (m.find()) { system.out.println("found value: " + m.group(0)); system.out.println("found value: " + m.group(1)); system.out.println("found value: " + m.group(2)); } else { system.out.println("no match"); } } } output: found value: order placed qt3000! ok? found valu...

c++ - Does C++11 or C++14 support "&& const" in declaration -

is following definition (from piece of c++ source code) valid? struct test_ { int i; test_(int j) : i(j) { } int try() && { return i; } int try() && const { return -i; } }; i mean if it's valid put const after &&. code overload resolution ref-qualifier. i know const && valid. wonder if "&& const" supported in c++11 or c++14.

php - java.lang.NullPointerException: Attempt to invoke virtual method on a null object reference -

i reading data database android. copied code , used again in other app gave me error. logcat: 07-08 08:52:24.422: e/buffer error(2636): error converting result java.lang.nullpointerexception: lock == null 07-08 08:52:24.422: e/json parser(2636): error parsing data org.json.jsonexception: end of input @ character 0 of 07-08 08:52:24.423: d/androidruntime(2636): shutting down vm 07-08 08:52:24.424: e/androidruntime(2636): fatal exception: main 07-08 08:52:24.424: e/androidruntime(2636): process: com.example.purplerose, pid: 2636 07-08 08:52:24.424: e/androidruntime(2636): java.lang.runtimeexception: unable start activity componentinfo{com.example.purplerose/com.example.purplerose._appetizer}: java.lang.nullpointerexception: attempt invoke virtual method 'org.json.jsonarray org.json.jsonobject.getjsonarray(java.lang.string)' on null object reference php code data showing up <?php include_once("connection.php"); $sql = "select menuid, name, descripti...

r - Dealing with missing information while converting a list into data frame or data table -

related previous question there way convert list of named elements names duplicated data table na values show in data table in order appear in list? for example: list testlist <- list("blue", "405", "truck", "400", "car", "white", "500", "truck") testnames <- c("color", "hp", "type", "hp", "type", "color", "hp", "type") names(testlist) <- testnames $color [1] "blue" $hp [1] "405" $type [1] "truck" $hp [1] "400" $type [1] "car" $color [1] "white" $hp [1] "500" $type [1] "truck" can changed data table using: dcast(setdt(melt(testlist))[, n:=1:.n, l1], n~l1, value.var='value') but output this: n color hp type 1 1 blue 405 truck 2 2 white 400 car 3 3 <na> 500 truck when want: n color hp type...