Posts

Showing posts from May, 2015

mysql - How to Only select the Columns which can be casted to Numeric Else ignore the column in Spark Sql? -

i have tried lot of things not find proper solution of how select columns can casted double or numeric when have columns of type string . , ignore rest of columns. suppose have 100 columns of type string , want check columns can casted numeric , select them , ignore other columns. for example - structtype( structfield(snapshotdate,stringtype,true), structfield(country,stringtype,true), structfield(region,stri‌​ngtype,true), structfield(probabil‌​ity,stringtype,true)‌​, structfield(bookingamount,stringtype,true), structfield(revenueamount,stringtype,true) ) here want select revenueamount , probability , bookingamount . other columns either string type or date, ignore them. is there way that? thank in advance. you can use schema method in dataframe @ structtype describe schema of dataframe. a structtype set of structfield s composing dataframe schema, can return seq[structfield] schema (returned schema on dataframe) using seq

css - Print HTML with header and footer every page on all browser -

header @ top of each several pages... footer @ bottom of each page page no i want print #header , #footer page no on every page in html print mode. i'd try css @media print @page @bottom-center @top-center. doesn't work. in theory can use: <link rel="import" href="http://example.com/elements.html"> but in real life html tag work on modern browser , not idea use option. better use php language , <?php require '...'; ?>

rest - Incorrect properties displayed from Json -

i having issue when trying collect data json using soap ui , groovy scripting. below example json: { "regions": [{ "regionid": 10, "hotels": [{ "roominformation": [{ "hotelroomid": 1, "availablerooms": 1, "roomprice": 100, "occupancysequenceorder": 1, "providerroomid": 1, "isextranet": true }], "regionid": 1, "hotelid": 1, "boardtypeid": 1, "startdate": "2017-10-23t00:00:00", "enddate": "2017-10-30t00:00:00", "totalprice": 1000, "providerinformation": { "hotelspecialofferdetails": [],

ruby on rails - How does the params method work? -

i have been trying figure out how params method works , i'm bit stuck on process. for example, if user clicks on blog post in index page, guess link_to method calls post controller , show action along block @post = post.find(params[:id]) , goes database find post , view displays it. so missing link seems when post id passed params method? because others explained params , i'm going answer directly question of yours: when post id passed params method i think it's best explained example; see below: say clicked link: /posts/1/?param1=somevalue1&param2=somevalue2 the rails server receives request client wants view get /posts/1/?param1=somevalue1&param2=somevalue2 address. to determine how rails server respond, server first go routes.rb , find matching controller-action handle request: # let's routes.rb contain line # resources :posts # resources :posts above contains many routes. 1 of them below # sake of example, commented above

jquery - Duplicate an HTML file (and its content) with a different name in Javascript -

i have html file javascript , css applied on. duplicate file, make file1.html, file2.html, file3.html,... all of using javascript, jquery or ! idea create different page (from kind of template) printed afterwards different data in (from xml file). hope possible ! feel free ask more precision if want ! thank advance note: not want copy content entire file. edit: know should use server-side language, don't have option ): there couple ways go implementing similar describing. implementation should use depend on goals are. first of all, recommend sort of template system such vuejs, angularjs or react. however, given don't have option of using server side language, suspect won't have option implement 1 of these systems. my next suggestion, build own 'templating system'. simple implementation may suit needs mirroring following: in primary file (root file) want route or copy other files through to, use js include correct html files. example, have j

windows - CopyFile succeed, MoveFile fails with the same parameters - C++ -

i dealing frustrating problem in c++. need use movefile function fails. right using copyfile this: partialresult = l"d:\\cppwork\\test2\\dectobin.exe"; finala = l"d:\\cppwork\\test2\\pefiles_\\dectobin.exe"; if (0 == copyfile(partialresult, finala,b)) {///// dword err = getlasterror(); std::cout << " -> copy fail" << std::endl; } copy works ok if replace copyfile movefile (without changing paths) fails code 0x20 ( msdn doc -> error_file_not_found ). if try replace movefile copyfile , deletefile file previews path, copy works delete fails again error_file_not_found . bool b = false; if (0 == copyfile(partialresult, finala,b)) {//copy works when try delete file give error dword err = getlasterror(); std::cout << " -> copy fail" << std::endl; outfile << " -> copy fail" << std::endl; } else { std::cout << " -> copy done" << std::e

Curl PHP PUT request changes file content -

i use put request curl php in 1 of scripts upload file external file repository using rest api. however, uploaded files contain information content-disposition, content-type , alpha-numeric code @ both beginning , end of file, rendering useless unless manually enditing again. the unnecessary overhead looks this: --------------------------e876c4b8eee91562 content-disposition: form-data; name="test_file"; filename="test_3.xlsx" content-type: application/octet-stream the code use request is: $ch = curl_init($upload_url); $cfile = new curlfile($file_realpath, 'application/octet-stream', $base_file_name); $data = array ('test_file' => $cfile); curl_setopt($ch, curlopt_customrequest, "put"); curl_setopt($ch, curlopt_postfields, $data); curl_setopt($ch, curlopt_httpheader, array( 'accept:application/json', 'content-type:application/octet-stream', )); b2share_ignore_certificates($ch); c

jquery - Datatables remove this !!~ it doesnt return -

regarding in sample i dont understand whats use of !!~ this script in fiddle $.fn.datatable.ext.search.push( function(settings, data, dataindex) { var tdvalues=[]; var $tds=table.row(dataindex).nodes().to$().find('td'); $tds.each(function(){ var $this=$(this); var hasselect=$this.find('select').length >0; // check if current cell has select box var curtdvalue= hasselect ? $this.find('option:selected').text() : $this.text(); tdvalues.push(curtdvalue); }); var rowvalues=tdvalues.join(' '); return !!~rowvalues.tolowercase().indexof(table.search().tolowercase()); //<---this area } ); if remove !!~ doesnt return. cant see in manual of datatables $.fn.datatable.ext.search.push cant see in manual. edited this answered tilde or ~ how this? $.fn.datatable.ext.search.push

c# - How to debug a CLR Stored procedure in VS 2013 -

i have tried different ways done nothing works. vs seems ignore breakpoints in .cs files when run test script. have included breakpoint in test script still not debugging. this guide microsoft https://msdn.microsoft.com/en-us/library/ms165051(v=vs.100).aspx tried, don't have "a set default debug script" option when right click on script file. you might need also: run visual studio admin open additional ports are, default, blocked windows firewall set project startup project. in visual studio: go "sql server object explorer", right-click on instance deploying in "debug" tab of "project properties", , select "allow sql/clr debugging", , click "yes" button in pop-up dialog. if want breakpoints work, cannot have "optimize code" option checked in "sqlclr build" tab of "project properties". default unchecked "debug" configuration , checked "release" configu

c# - Service security using lidgren -

i'm doing simple service install in server send , recieve messages between clients of app (not game). service done, lidgren easy , service simple since beginning, i've been searching here , in google how handle security library , i'm totally confused. take in mind i'm amateur , before trying didn't know authentication , certificates. so main objective of course server deny connections others app clients, clients deny connections others server. app have (i suppose) standard login hash , salt bcrypt , check hashed password database (mysql) stored hash. send hash server , check againthe db, don't want since right don't use more after login gc remove asap, therefore don't have anymore after login... , when can solve it, don't want have hash in memory if there're other options. i began search , read. read certificates secure way authenticate , found several posts here , in google make certificates programmatically. ok, can try that, how wo

networking - Flow control in data link layer vs flow control in transport layer -

Image
i'm trying understand osi layer model. read flow control in handelt in data link layer (l2) , transport layer (l4). cant find methods thay use. transport layer uses flow control tcp useing window mechanism? what/how data link layer flow control? before knowing how layers controlling flow via various algorithms, must know reason why necessary. flow control in transport layer ensures delivery of message globally, 2 points of connection on protocol logically connected. whereas in data-link layer, concern deliver message locally, 2 points of connection on protocol physically connected. now, coming upon algorithms control flow of network: stop , wait - flow control mechanism forces sender after transmitting data frame stop , wait until acknowledgement of data-frame sent received. sliding window - in flow control mechanism, both sender , receiver agree on number of data-frames after acknowledgement should sent. learnt, stop , wait flow control mechanism wastes r

python - tf.WholeFileReader() not reading -

my code seems find jpeg image perfectly, because if mess path not proceed, printed out return match_filenames_once , there correct list of image files. following code not seem load images queue. wrong filename_queue? here code: filename_queue = tf.train.string_input_producer( tf.train.match_filenames_once("./resized2/*.jpg"),shuffle=false) image_reader = tf.wholefilereader() myfilename, image_file = image_reader.read(filename_queue) image = tf.image.decode_jpeg(image_file) # start new session show example output. tf.session() sess: init_op = tf.global_variables_initializer(), tf.local_variables_initializer() sess.run(init_op) # start populating filename queue. coord = tf.train.coordinator() threads = tf.train.start_queue_runners(coord=coord) in range(1): #length of filename list image_tensor = image.eval() #here image tensor :) print(myfilename) print(image.shape) #image.fromarray(np.asarray(image_tensor)).show()

command line interface - Filtering SaltStack output -

when running commands on lots of salt minions, can difficult make sense of output. salt '*somefilter*' state.apply some.thing now, if there 50 guests , few have problem, can lost in commandline output. is there way filter output feedback failed states? or in general better way 'parse' output (as human) scrollback huge buffer? we use following alias salt less output: alias salt='salt --state-output=mixed --state-verbose=false' - on 50 minions still not breeze read output - bit better full response. read more options in the cli docs , highstate docs .

powershell - For loop with DISM to remove unwanted applications in Windows 10 -

i having trouble below script. although says successful during run-time, applications still present within os. dism log files not helpful either. # remove non-corporate apps $appslist = "microsoft.3dbuilder",` "microsoft.advertising.xaml",` "microsoft.messaging",` "microsoft.microsoft3dviewer",` "microsoft.messaging",` "microsoft.microsoftofficehub",` "microsoft.microsoftsolitairecollection",` "microsoft.office.onenote",` "microsoft.oneconnect",` "microsoft.people",` "microsoft.skypeapp",` #"microsoft.storepurchaseapp",` "microsoft.wallet",` "microsoft.xboxapp",` "microsoft.xboxgameoverlay",` "microsoft.xboxidentityprovider",` "m

Display two different array return value in single table in codeigniter -

i want show return 2 array value in single table in view,i run first array value in table. controller public function communication(){ $session_data = $this->session->userdata('admin_logged_in'); $id = $session_data['id']; if ($this->session->userdata('admin_logged_in')) { $data['get_all_mail'] = $this->admin_model->get_all_mails($id); $data['get_out_mail'] = $this->admin_model->get_out_mails($id); $this->load->view('communication',$data); } } model function get_all_mails($id){ $query = $this->db->query("select * t_communication_posting find_in_set($id, replace(`to`, ', ', ',')) or find_in_set($id, replace(`cc`, ', ', ',')) or find_in_set($id, replace(`bcc`, ', ', ',')) <> 0"); return $query->result_array(); } view &

.net - Crystal report not rendering on Mozilla FireFox browser but working on Chrome? -

my crystal report either time not appears or time not rendered in crystal report viewer using latest version of firefox , crystal report v10 .net 4.5 have attached image problem . tried many solution adding meta tag <meta http-equiv="x-ua-compatible" content="ie=8"/> my viewer code <form id="form1" runat="server"> <div> <cr:crystalreportviewer id="crystalreportviewer1" runat="server" autodatabind="true" displaygrouptree="false" reuseparametervaluesonrefresh="true" printmode="activex" /> </div> </form> what should make crystal report 10 visible , render css on chrome here image image of problem

c# - Input with default value set to 0 is being rendered without the 0 -

i have html number input on page accepts integer value. code follows: @html.textbox("answer[" + + "].score", null, new { @class = "form-control", type = "number", value="0", id = "answer[" + + "]_score" }) in model have defaulted score properties 0 still didn't render 0 in view. used value="0" directly on input still doesn't render 0. it renders like: <input class="form-control" id="answer[0]_score" name="answer[0].score" type="number" value=""> this problem when go save form, null value sent controller when score isn't nullable form doesn't submit. is there way 0 default instead of blank value? use value capital v : value = "0" not value="0" value keyword used in setters. for example . private int num; public virtual int number { { return num; } set { num = value; } }

PHP Google Translation API multiple text strings in one POST request -

according google , sitepoint , there possibilities translate multiple text strings in 1 request. when tried translate multiple strings, resulted in replacing first string last one. $handle = curl_init(); if (false === $handle) throw new exception('failed initialize'); curl_setopt($handle, curlopt_url,'https://www.googleapis.com/language/translate/v2'); curl_setopt($handle, curlopt_returntransfer, 1); curl_setopt($handle, curlopt_ssl_verifypeer, false); curl_setopt($handle, curlopt_postfields, array('key'=> $apikey, 'q' => $heading, 'q' => $content, 'source' => $sl, 'target' => $hl)); curl_setopt($handle,curlopt_httpheader,array('x-http-method-override: get')); $response = curl_exec($handle); $responsedecoded = json_decode($response, true); $responsecode = curl_getinfo($handle, curlinfo_http_code); curl_close($handle); if($responsecode != 200) { header("http/1.0 404 not found&

docker - How to use stun.l.google.com behind a corporate proxy? -

i want configure local copy of https://github.com/mattermost/mattermost-webrtc/blob/master/vagrant/janus/config/janus.cfg to enable video calls test purposes in mattermost . 1 part is: [nat] stun_server = stun.l.google.com stun_port = 19302 how use stun.l.google.com behind corporate proxy? i tried proxytunnel -p corporate-proxy:7123 -d stun.l.google.com:19302 -a 3098 and replaced first part with [nat] stun_server = localhost stun_port = 3098 which results in $ docker run -it webrtc_blah_2 janus commit: ad2c131617ac989df1a1bbd601272a5e448cbb3e compiled on: mon jul 24 13:04:22 utc 2017 --------------------------------------------------- starting meetecho janus (webrtc gateway) v0.2.4 --------------------------------------------------- checking command line arguments... debug/log level 4 debug/log timestamps disabled debug/log colors enabled adding 'vmnet' ice ignore list... using x.17.0.2 local ip... token based authentication enabled initializing r

forms - AngularJS select with ng-options -

i'm developing app should have form select boxes populated dinamically json arrays. my problem controller correctly executed select options not populated controller, there empty. this id code: <script> angular.module('ionicapp', [ ]) .controller('timescontroller', function () { console.log("javascript function"); var data = <?php echo $json; ?>; console.log(data); var result = { events: [], events2: [], events3: [], schedules: [], schedules2: [], schedules3: [] }; var events = data; //console.log("events"); //console.log(events); var events2 = data; var events3 = data; var dates = []; var sedi = []; var professionisti = []; console.log("qua3");

database - Check if Oracle Resource Management is enabled -

what's sql statement have run sys find out whether db uses resource management or not? resource management enabled default. must know if user using resource manager or not. find out list of users/roles consumer of resources manager groups executing: sys: select * dba_rsrc_consumer_group_privs ; for logged in user, find out resource groups assigned : select * user_rsrc_consumer_group_privs ; abhi

javafx - How to control Caret position in trimmed TextField? -

Image
i have textfield , in check after changes made. trim away double spaces typed. problem after replace text trimmed one, caret position refreshes. added calculating, caret go position user last input, it's not working spaces. code: eventhandler<inputevent> fieldchangelistener = new eventhandler<inputevent>() { public void handle(inputevent event) { textfield field = (textfield) event.getsource(); int caretpos = field.getcaretposition(); string text = field.gettext(); text = text.replaceall("\\s+", " ").trim(); field.settext(text); field.positioncaret(caretpos); event.consume();}}; name.addeventhandler(keyevent.key_released, fieldchangelistener); in picture user puts cursor before word 'friend' , presses space bar , space trimmed, placing caret right after 'f' . if space bar hold longer, caret placed

c - Trying to read an int into a struct, but it returns a segfault? -

so have code reading in strings , applying them respective struct members fine, reading int, program crashes , returns segfault. if assign variable value, pass value struct, works fine. if assign variable value, overwrite value scanf, pass struct, segfaults again. void createcompetitor() { struct competitor *newcompetitor = malloc(sizeof (struct competitor)); if (newcompetitor == null) return; printf("please enter competitor's first name\n"); fgets(newcompetitor->firstname, 25, stdin); printf(newcompetitor->firstname); printf("please enter competitor's last name\n"); fgets(newcompetitor->lastname, 35, stdin); printf(newcompetitor->lastname); printf("please enter competitor's address\n"); fgets(newcompetitor->address, 105, stdin); printf(newcompetitor->address); printf("please enter competitor's age\n"); scanf("%d", &newcompetitor->

java - Caching objects for later reuse to avoid persistence to recreate them -

i have idea of caching objects have been created slight performance gain. types of objects i'm thinking of stuff player objects in game. think beneficial have cached copy of player ready avoid io/persistence. the idea sounds great have issues(?) guess idea. player data stored on sql database. if make change database, cached copy on server different. run task check objects up-to-date there no point in initial idea. could have advice on should do?

java - How do i set data to every single recyclerView? -

Image
about app: i've made app @ start receiving tcp server tcp client number of cash registers conected network, after open activity called " help " tcp server receiving other data server device id , amount of receipts got in it. question? for when open activity app load number of recyclerview equals number of cash registers sent server , apply all recyclerviews same amount of receipts , id, have it's assign data single recyclerview . example app starting, server sending number of 5 devices, i'm opening activity , asking again data server, server sending 0#17#190 (0 staying cash register active 17 receipts , 190 money in ) , have apply 1st recyclerview in list , ask server again data of 2nd..3rd... cash registers. here mainactivity code connect server , data: public static class connecttask extends asynctask<string, string, client> { @override protected client doinbackground(string... message) { client = new cli

javascript - Why do numpad keycodes differ on windows v mac? -

using chrome, given following code (which paste console): function key(e) { console.log(e.keycode); }; window.addeventlistener("keydown", key, false); the keycodes on numpad seem vary. results below show keydown code numpad 0: mac (num lock on/off) keydown=48 win (num lock on) keydown=96 win (num lock off) keydown=45 can explain these differences please (since breaking our code)? is expected or experiencing unusual behaviour? thanks i believe mac numeric keypad maps normal number strip, not special key. if type normal 0 , keycode 48 on windows.

r - Using both in_header and header_includes in Rmarkdown and knitr -

i have long .txt file contains packages , settings want used in rmarkdown file. want add statements header, based on output of r calculations. in particular case want add titlegraphic located in directory, this: working directory |--- reports |----| my_report.rmd |--- www |----| image.png so header of rmarkdown file like: output: beamer_presentation: keep_tex: true includes: in_header: header.txt header-includes: - \titlegraphic{\includegraphics[width=0.3\paperwidth]{`r paste0("dirname(getwd()),"image.png")`}} if 1 of statements included (in_header or header-includes), work fine. when use them both, the content of header-includes seems overwritten . example given in files below, upon inspecting resulting .tex file, find \usepackage{fancyhdr} in header, there no mention of `\titlegraphic' expression. header.txt \usepackage{fancyhdr} example.rmd title: example 1 output: beamer_presentation: keep_tex: true includes:

sql - Cumulative Sum of last 12 months -

i trying make cumulative sum of last 12 months so, example on 201702 should show sum of 201603 201702. right have following query: select date, product, sum(sales) on (partition product order date) cumulative sales the data this: date product sales sales acum 201601 1 7648 7648 201602 1 5538 13186 201603 1 7659 20845 201604 1 6943 27788 201605 1 7604 35392 201606 1 4398 39790 201607 1 3261 43051 201608 1 3040 46091 201609 1 5637 51728 201610 1 5520 57248 201611 1 8554 65802 201612 1 4794 70596 201701 1 6704 69652 201702 1 2234 66348 201703 1 4093 62782 201704 1 4171 60010 201705 1 6741 59147 201706 1 2902 57651 201601 2 582 582 201602 2 2393 100416 201603 2 4614 105030 201604 2 2611 107641 201605 2 6891 114532 201606 2 4409 118941 201607 2 5454 124395 201608 2 7927 132322 201609 2 6797 139119 201610 2 6740 145859 201611 2 8077 153936 201612 2 5143 159079 201701 2 6383 67439 201702 2 1593 66639 201703 2 5352 67377 20170

sql - Updating large number of records without an index on a nvarchar column -

is there way relatively update large number of records in sql server 2014, filtering on nvarchar(x) column, when there no index on column? eg. i'd run: update products set active = 1 productbrand = 'brand name' on product table millions of rows, , there no index on productbrand . creation of index takes around 45 minutes , update table bit faster. we want perform operation fastest way possible, creating index takes lots of time. wandering if there other ways using index. (creating index on name column , leaving there of course practice, rebuilding time time) check product table, maybe have index on productbrandid, if not, can create new tmpproduct table same structure , default 1 in "active" field. insert registers new table drop original table , rename tmpproduct product you must ensure triggers , references recreated

ionic3 - Uploading app to apps.ionic.io fails silently -

i have started develoing ionic following tutorial. everythings seems quite logical - trying upload simple hello world code without luck. on command line able login on apps.ionic.io account , able link local code app have created in browser on apps.ionic.io. app_id written ionic.config.json. i able build app , run in android simulator. but when execute following command build doesn't seem upload generated code: ps d:\ionictest\ionic-tabs-app> ionic upload --verbose [debug] loading global plugin @ionic/cli-plugin-proxy [debug] loading local plugin @ionic/cli-plugin-cordova [debug] loading local plugin @ionic/cli-plugin-ionic-angular running app-scripts build: --log-level debug [14:37:02] build dev started ... [14:37:02] clean started ... [14:37:02] clean finished in 3 ms [14:37:02] copy started ... [14:37:02] transpile started ... [14:37:04] transpile finished in 2.02 s [14:37:04] preprocess started ... [14:37:04] deeplinks started ... [14:37:04] deeplinks fi

amazon web services - WAFStaleDataException from Java SDK but the same token works with CLI -

my code first gets change token used final awswafregional waf = awswafregionalclientbuilder.defaultclient(); final string changetoken = waf.getchangetoken(new getchangetokenrequest()).tostring(); it uses token update ipset updateipsetrequest updateipsetrequest = new updateipsetrequest(); updateipsetrequest.setchangetoken(changetoken); waf.updateipset(updateipsetrequest); the problem is, when run function returns com.amazonaws.services.waf.model.wafstaledataexception: input token no longer current. (service: awswafregional; status code: 400; error code: wafstaledataexception; after when use same token aws cli works code unable use threw wafstaledataexception. resolution this? the problem in statement final string changetoken = waf.getchangetoken(new getchangetokenrequest()).tostring(); use of tostring() results changetoken of form {changetoken: "xxxxxx"} "xxxxxx" required change token, should have used final string changetoken = waf.ge

url rewriting - Rewrite Nginx with $1 argument -

i'm trying rewrite url one, can't use $1 correctly: location ~ ^/announce { rewrite ^(.*)$1 http://exemple.com/$1/announce.php?ip=$remote_addr&$args; } in fact http://jack.exemple.com:2052/anything/announce should become https://exemple.com/anything/announce.php?ip=$remote_addr& that's work without $1 , not args beetwin http://jack.exemple.com:2052/ , /announce i think it's pretty simple, not common, , can't find syntax. i believe simple removing "1" $ in reg-ex "^(.*)$1" per below ... location ~ ^/announce { rewrite ^(.*)$ http://exemple.com/$1/announce.php?ip=$remote_addr&$args; }

visual studio - intellisense of vs2017 is slow with boost library and resharper c++ plugin -

i use visual studio 2017 c++ projects. fan resharper plugin has similar style jetbrains clion. however, when huge library included, boost c++ library projects. intellisense pops out slowly, no matter resharper intellisense or vs native intellisense. furthermore, vs2017 may misjudge incomplete input errors time. i have known seemly useless method mentioned in official tutorial , computer enough of i7 , high volume memory/ssd no lack of machine performance. so, can increment performance reshaper c++ in vs2017. switch options tool or project properties.

algorithm - How to use Kalman Filter Theorm to calculate next event date -

i having problem statement requires if particular error/event happens on 1-jan-2017 , on 22-feb-2017, 3-april-2017, 9-july-2017 so have predict when next event gonna occur , planning try kalman filter theorm has statistical terms , on internet didn't found easy explanation or easy programming example kalman filter algorithm estimates next event dates . can explain in simple terms or parellel algorithm can used same purpose ? let e i i th event, , let iet i = e i+1 - e i i th inter-event time, i.e., time between 1 event , next. e i+1 = e i + iet i — next event can forecast recent event based on iet. since past determined thing random when you're projecting next event iet, e[e i+1 ] = e i + e[iet i ] (where e[] denotes common notation expected value). don't need know distribution of iet estimate expected value, need assume iets identically distributed. (they don't need independent.) in other words, if iets identically distributed average

jquery - Capture multiple Iframes screenshot in html2canvas -

i using html2canvas capture screenshot of content inside div. working fine not sure how capture screenshot of multiple iframes inside div having id. this did far. <div id="target"> <iframe src="home.html" height="3000" width="1000" id='iframe1'></iframe> <iframe src="about-us.html" height="3000" width="1000" id='iframe2'>/iframe> </div> here js code: var body = $('#iframe1').contents().find('body'); html2canvas(body,{ onrendered: function (canvas) { $('#img_val').val(canvas.todataurl("image/png")); document.getelementbyid("myform").submit(); }, }); above code working fine if have 1 iframe inside div having id='target' .so how capture screenshot if have multiple iframes inside div in above html.

java - pdfBox 2.0.7 Arabic issue -

hi using pdfbox create pdf file writing characters in english , others in arabic when arabic disconnected , reversed . ‫ف ر ح‬ , error message jul 25, 2017 1:51:20 pm org.apache.pdfbox.pdmodel.font.pdcidfonttype2 warning: using fallback font liberationsans cid-keyed truetype font nazaninltlight jul 25, 2017 1:51:20 pm org.apache.pdfbox.pdmodel.font.pdtype0font tounicode warning: no unicode mapping cid+3 (3) in font nazaninltlight public class pdfcreator { public static void main(string[] args) throws ioexception { pddocument document = new pddocument(); pdpage page = new pdpage(); document.addpage(page); file myfile = new file("/home/charefdz19/desktop/nazaninltlight.ttf"); pdfont font = pdtype0font.load(document, myfile); pdpagecontentstream contentstream = new pdpagecontentstream(document, page); contentstream.begintext(); contentstream.setfont(font, 12); contentstream.newlineatoffset(30, 40); string arabictext = " حرف&

Python printing twice when importing facebook-sdk -

Image
can me out why happening? have python 3, virtualenv based environment, , writing scripts facebook sdk. when write print statement before importing facebook, print happening once. when write print statement after importing facebook, print happening twice, though print written once. rename file facebook.py else. is, importing itself rather module.

How to access members of class from a page Load class in c# -

i have 2 classes in project below: //class public class carhelper { public class car { public string colour {get;set;} public string manufacturer {get;set;} } public car getdetails() { car c = new car(); var query = //querying db here c.colour = query.colour; c.manufacturer= query.manufaturer; return c; } } //class b //here have page load method this: protected void page_load(object sender, eventargs e) { carhelper car = new carhelper(); var getcarmanufacturer = car.manufacturer; //<< stuck here //how car manufacturer here above? } as can see above, whats best way access members class a? since you've created getdetails() method public can use retrieve car object : carhelper carhelper = new carhelper(); car car = carhelper.getdetails(); var carmanufacturer = car.manufacturer;

javascript - Angular2 Arrays/Observables/Firebase_x_Observable -

i having issues new angular2 function (trying rewrite v1) writing , going round in circles , cannot find advice. essentially firebase configs hold following events random fb key (eventid) event title event location useridowner useridattendee usersvsevents userid random key | eventid random key | eventid the users home page loads of events user has subscribed (eventlist), why created eventsvsuser index tree, rather looping through every event , userid. i have working (kind of). load eventvsusers tree user, each entry, use eventid load event object events , push eventlist. had reinitialize eventlist every time home page loads using push duplicates events. isn't desireable worked @ stage. the main problem if make change event in firebase directly, eventlist doesn't make changes, loads duplicate events on top of current ones. suspect because dont have subscribe firebase source directly, instead push elevments seperate array , cant keep in sync.

reactjs - "Only a ReactOwner can have refs" despite running a single react copy and no broken refs -

i'm getting old invariant.js:44 uncaught error: addcomponentasrefto(...): reactowner can have refs. might adding ref component not created inside component's render method, or have multiple copies of react loaded the refs not problem (they in render method, , issue persists after they're removed). don't have multiple copies of react - there not single additional copy in node_modules, npm ls react returns single instance, have no react plugins installed. i'm using webpack. adding aliases in webpack config didn't help, reinstalling dependencies didn't help, removing react , linking outside npm/webpack didn't help. here's webpack config: module.exports = { watch: true, entry: "./components/freshinvestigationform/freshinvestigationform.tsx", output: { filename: "bundle.js", path: __dirname + "/dist" }, devtool: "source-map", resolve: { extensio

javascript - Openlayers source tileWMS? TypeError: a.addEventListener is not a function -

i want add features tile map, problem ocurred when try use ol.source.tilewms the error message is: typeerror: a.addeventlistener not function however works with ol.source.osm my code: var projection = new ol.proj.projection({ code: 'epsg:32719', extent: [441867.78, 1116915.04, 833978.56, 10000000.00] }); var extent = [576631.5686027373,8119272.722829757,655823.9357532839,8286730.359291008]; var wmssource = new ol.source.tilewms({ url: 'http://192.168.5.94:8080/geoserver/wms', params: {'layers': 'layer'}, ratio: 1, servertype: 'geoserver' }); var wmslayers = [ new ol.layer.tile({ extent: extent, source: wmssource }) ]; var raster = new ol.layer.tile({ source: new ol.source.osm() }); var source = new ol.source.vector({wrapx: false}); var vector = new ol.layer.vector({ source: source }); var view = new ol.view({ projection: projection, center: [593169.72792

Desktop App Converter -

i have been using desktop bridge time , have started experiencing problem. stopped building packages. have tried install on different virtual machines have been getting same error. powershell error record: desktopappconverter : error 'e_starting_isolated_env_failed': failed start isolated environment. see inner exception more details. powershell stack trace: @ raiseuserexception, c:\program files\windowsapps\microsoft.desktopappconverter_2.0.2.0_x64__8wekyb3d8bbwe\converter_util\daclogger.ps1: line 154 @ invoke-isolatedinstall, c:\program files\windowsapps\microsoft.desktopappconverter_2.0.2.0_x64__8wekyb3d8bbwe\converter_util\isolatedenvironmentops.ps1: line 162 @ <scriptblock><process>, c:\program files\windowsapps\microsoft.desktopappconverter_2.0.2.0_x64__8wekyb3d8bbwe\desktopappconverter.ps1: line 684 @ <scriptblock>, <no file>: line 1 inner exception[0]: system.management.automation.runtimeexception: desktopappconverter : error 'e_starti

Set a word in a text file and replace or delete its value using Batchfile (User Input) -

i got error when run code. got textfile in c:\users\administrator\desktop\comorg , in, has sentence in there , need change value of word like: run: the word inside textfile here enter input [r]-replace [d]-delete : if click r enter word want replace : lets type "word" , if type word enter word: the word replace output = change value of word in sentence here's code: @echo off setlocal enabledelayedexpansion set /p _inputname= please enter "1" view text : if "%_inputname%"=="1" type "c:\users\administrator\desktop\comorg\sentence.txt " echo off echo off set /p _name= please enter input [a]-erase [b]-delete : if "%_inputname%"=="a" set /p _inputname= pick word want replace : if "%_name%"=="love" set /p _inputname= type word : echo %_name% batch script @echo %_name% batch script > c:\users\administrator\desktop\comorg

Android ndk cmakelist -

enter image description here cmakelist :---> cmake_minimum_required(version 3.4.1) set(distribution_dir ${cmake_source_dir}/../../../../distribution) 增加cpp动态共享库 add_library( image_compress shared src/main/cpp/compress_image.cpp ) 增加so文件动态共享库,${android_abi}表示so文件的abi类型的路径 add_library(libjpeg shared imported) set_target_properties(libjpeg properties imported_location ${distribution_dir}/plus/lib/${android_abi}/libjpeg.so) set(cmake_cxx_flags "${cmake_cxx_flags} -std=gnu++11") 增加include包含的路径 target_include_directories(image_compress private ${distribution_dir}/plus/include) 生成链接动态库 target_link_libraries( image_compress android ${log-lib} )

json - Spring Data Rest. PUT for Projection -

i have problems put method. have entity: @data @entity public class idea { @id @generatedvalue private long id; private string title; @onetoone private style style; private double posx; private double posy; private long parentid; @onetomany(mappedby="parentid") private collection<idea> children; private idea() { } } projection: @projection(name="ideasummary", types = {idea.class}) public interface ideasummary { string gettitle(); style getstyle(); double getposx(); double getposy(); long getparentid(); collection<ideasummary> getchildren(); } repository: @repositoryrestresource(excerptprojection = ideasummary.class) public interface idearepository extends crudrepository<idea, long> { } the command json: curl -i -x put -h "content-type:application/json" -d '{"title":"chsild note","style":{"bold":fals