Posts

Showing posts from June, 2011

java - IndexOutOfBoundsException in RecyclerAdapter with Multiple View Types -

i'm getting indexoutofboundsexception when attempting return view type function of position of data in array. have 2 sources of data. 1 advertisement, , other list of names , locations. need combine arrays 1 single array before processing in recycleradapter? i'd rather not, if in principle different types, i.e. images versus text. getitemcount() method returns summed size of 2 arrays. why getting exception? how can achieve desired result of showing data 2 different sources in 2 different view types? my main activity: public class mainactivity extends appcompatactivity { private arraylist<object> getpresidentsarraylist() { arraylist<object> items = new arraylist<>(); items.add(new president("george washington", "mount vernon")); items.add(new president("john adams", "braintree")); items.add(new president("thomas jefferson", "monticello")); items.add

c# - Xamarin Forms PCL with Caliburn, only the original thread that created a view hierarchy can touch its views -

in xamarin forms pcl, i'm using caliburn.micro.xamarin.forms implement mvvm data binding. structure of project has viewmodel , view , data binding done this: in viewmodel private bindablecollection<templistitem> _temperatures; public bindablecollection<templistitem> temperatures { { return _temperatures; } set { if (value != _temperatures) { _temperatures = value; notifyofpropertychange(() => temperatures); } } } in view var t2name = new label { fontsize = 17, textcolor = (color)application.current.resources["foregroundcolor"] }; t2name.setbinding(label.textproperty, new binding("temperatures[1].name")); i have problem only original thread created view hierarchy can touch views arise when navigate page , suppos

javascript - double parentecies doesn't work in jade -

this worked .container each item in items li= item.name but not this .container each item in items li {{item.name}} what's wrong here? because each view engine has own syntaxe, ie: {{item.name}} work ejs , not jade . way can use in jade .container each item in items li= #{item.name}

regex - Unix: Rename file with dynamic extension -

i using rhel 5.10 , trying remove dynamic date extension bunch of files. the file format filename01.gz.20160704 , last part date dynamic. want renamed filename01.gz when try rename below, works rename gz.20160704 gz filename01.gz.20160704 output: filename01.gz but when try rename doesn't work rename gz.* gz filename01.gz.20160704 i tried searching other answer , in of them, used rename below, sadly not working me. rename 's/gz*/gz/' filename01.gz.20160704 rename 's/gz.*/gz/' filename01.gz.20160704 the man page linux says for example, given files foo1, ..., foo9, foo10, ..., foo278, commands rename foo foo0 foo? rename foo foo0 foo?? could please me or there alternative approach can use? update: added solution given @pskocik not working either. $> ls -ltr filename01* -rw-rw----+ 1 foo foo 0 jul 4 08:34 filename01.gz.20160704 $> rename -n 's/\.gz\.[^.]*/.gz/' filename01.gz.* $> ech

elasticsearch - Elastic - with_positions and with_positions_offsets -

Image
what's difference between with_positions , with_positions_offsets regard term_vector in elasticsearch? with_positions instruct elasticsearch (lucene) to, also, index position of terms in original text this helps order of terms inside field, example other question had here . with_positions_offsets instruct elasticsearch (lucene) to, also, index position of terms in original text and character offset information each term (the start position , end position each term, @ character level) this helps in cases when original text indexed "changed" during analysis phase, example, changing terms in synonyms. these synonyms can have multiple words, changing whole "structure" (positions and offsets) of original text. in both cases size of index on disk increase. increase smaller with_positions with_positions_offsets . term_vector options must highlighting ! a great example demonstrating positions , offsets can found on lucene , e

How to add a label to xbl component Orbeon -

i want add input field called name, created xbl component , add in directory ressources/xbl in orbeon. want create label "name" didn't work. <xbl:xbl xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"> <xbl:binding element="fr|tutorial-input" id="fr-tutorial-input" xxbl:mode="lhha binding value"> <xbl:template> <!-- input points external single-node binding --> <xf:input ref="xxf:binding('fr-tutorial-input')"/> </xbl:template> </xbl:binding> <fr:tut

javascript - how to pass and receive a parameter using link-to from ember js? -

i have on page list of clients (only names) , when click on each 1 of them, want open new page called 'clientdetails' in details of client besides name (i have address , age) ; what have far : {{#each model |client|}} <p> {{#link-to "clientdetails"}} {{client.name}} {{/link-to}} </p> {{/each}} how should pass client.address , client.age clientdetails , display them accordingly in clientdetails page? thank you. take at: https://guides.emberjs.com/v2.5.0/templates/links/ i guess create route in route.js route client details: router.map(function() { this.route('clients', function(){ this.route('clientdetails', { path: '/:client_id' }); }); }); in template (to link client details): {{#each model |client|}} <p> {{#link-to "clientdetails" client}} {{client.name}} {{/link-to}} </p> {{/each}} last, create template clientdetails show client details: <p&

javascript - What is the Handled filter in Chrome DevTools used for? -

Image
chrome devtools has several useful filters limit logging: errors , warnings , info etc. the last filter called handled , , have yet find out used for. no console.handle() or similar. googling hasn't provided answer. for , how use handled filter? this filter exceptions handled inside of promise. filter added ui this patch . included test , linked ticket reveal feature about. if create promise , reject so: var p = new promise((resolve, reject) => reject('ooops')) error message printed console: however, rejection can handled later on: p.catch(e => {}) causing previous error message change state: " uncaught (in promise) ooops " becomes " handled promise rejection ". since it's not considered error anymore not show when " errors " filter active. show though, when new " handled " filter active.

android - Recognize when a notification posted / removed is in a group -

i'm trying play notificationlistenerservice check if statusbarnotifications (displayed in statusbar) inherent group (ex. mails or messages). i'm using sdk >= 21. playing applications well-known fb, whatsapp or gmail saw different rules marking grouped messages (group , key properties - of statusbarnotification - not easy manage purpose). how possible recognize when notification posted / removed in group? , group header? there isn't possibility achieve statusbarnotification. possible onnotificationremoved/posted & getactivenotifications.

c# - How to Bind a textBlock's value with another TextBlocks value In the same window? -

Image
please picture below. 1 window have placed multiple textblock s inside grid . marketing team compelled me design ui this. facing other issues like i have code xaml can achieve ui design if place textblocks in way. <textblock x:name="bluetextblock" margin="100,10,0,0" foreground="blue" text="{binding elementname=gridalltextblocks, path=??? mode=twoway}"/> <grid x:name="gridalltextblocks"> <grid.rowdefinitions> <rowdefinition height="40" /> <rowdefinition height="40" /> <rowdefinition height="40" /> <rowdefinition height="40" /> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition width="*" /> <columndefinition width="*" /> <column

python - What's the maximum size of a image to send using MQTT -

i'm trying send images using mqtt in 2 r-pi. wonder what's maximum size of image send. think 1mb maximum size however, 26.5kb image not sended. please give answer of question thank you. mqtt doc mosquito: message_size_limit limit this option sets maximum publish payload size broker allow. received messages exceed size not accepted broker. default value 0, means valid mqtt messages accepted. mqtt imposes maximum payload size of 268435455 bytes. from: https://mosquitto.org/man/mosquitto-conf-5.html

c# - Error: an object reference is required to access non static member -

using unityengine; using system.collections; public class playermovement : monobehaviour { public float movespeed; private vector3 input; void update () { input = new vector3(input.getaxis ("horizontal"), 0, input.getaxis ("vertical")); rigidbody.addforce(input * movespeed); } } as of unity 5 unityengine.component.rigibody has been deprecated , using cause compiler error. instead need use getcomponent<rigidbody>() . in case, code looks like: using unityengine; using system.collections; public class playermovement : monobehaviour { public float movespeed; private vector3 input; void update () { input = new vector3(input.getaxis ("horizontal"), 0, input.getaxis ("vertical")); getcomponent<rigidbody>().addforce(input * movespeed); } }

sql server - Uisng exists in sql to find duplicates, is there a cleaner way? -

see script below find duplicates in sql server db. there cleaner way? select itemnum matusetrans exists (select null matusetrans b a.itemnum = b.itemnum , a.actualdate = b.actualdate , a.matusetransid != b.matusetransid , (a.rotassetnum = b.rotassetnum or (a.rotassetnum null , b.rotassetnum null)) , a.quantity = b.quantity) group itemnum another possibility (but not neccessarily "cleaner") might be with cte as( select columns, row_number() on (partition columns order columns) rowidx matusetrans group columns ) select * cte rowidx > 1

What is the best way to create Update Method using PHP OOP -

i have thinking of past hour, unable understand best way add update , insert feature using class in php. i have employee table has around 5 columns, have created different properties in employees class. now unable understand set these values, in __costructor() , in add_employees() method or other way.. if set them in __constructor() user must remember , follow same pattern in writing arguments followed in writing parameters. i unable understand right way or should use different approach this. i have searched on net, , found complex examples, people taking argument in form of array, separating it, add loop in , put database. class employees(){ public $db; public $conn; public $emp_id; public $first_name; public $last_name; public $gender; public $added_by; public function __construct(){ $this->db= new databaseconnection('localhost', 'root', '', 'employeesmanagement'); $this->co

Authenticate users against Azure Active Directory from PHP web application -

i have website in php , want authentificate users against azure active directory. ldap_connect , bind have no problems local ad-server in our company. function checkadaccount($username, $password) { $adserver = "myadserver"; $ldaprdn = 'mydomain' . "\\" . $username; $ldap = ldap_connect($adserver); ldap_set_option($ldap, ldap_opt_protocol_version, 3); ldap_set_option($ldap, ldap_opt_referrals, 0); $bind = @ldap_bind($ldap, $ldaprdn, $password); if ($bind) { @ldap_close($ldap); // verbindung schließen return true; } else { return false; } } but application hosted @ amazon web services (aws) , not in same domain, can't use way. ldap_connect , bind functions local ad-server in our company. application hosted @ amazon web services (aws) , not in same domain, can't use way. tested graphapi clientid , key company azure. can read users-data, don't see possibility check user/passwo

powershell - Are the properties in Power Shell FTP module(WebAdministration) Case-Sensitive? -

powershell case insensitive language , modules webadministration expected be. this doesn't work: ps iis:\apppools> set-itemproperty .\defaultapppool -name enable32bitapponwin64 -value $true whereas works: ps iis:\apppools> set-itemproperty .\defaultapppool -name enable32bitapponwin64 -value $true difference in capital , small letter 'e' in property name. moreover, first command doesn't throw error. can explain behaviour? this bug since behaviour differs different windows versions (e. g. windows 10, first letter must lowercase whereas windows 7 not). there related question on so .

How to disallow push to docker repository -

i setting local cluster @ work using docker. works fine, thing worry is, other devs use setup may push local builds remote repository. since catastrophe because not allowed upload companies artefacts anywhere else internal servers - there way prevent other users pushign remote docker repo? docker repo == docker registry? not sure full picture desired workflow, here 2 options: use registry authentication , make sure authorised people push configure networking / dns / hosts resolve correct registry - e.g. docker-registry.mycompany.com resolves local registry devs , remote registry others.

c# - Cannot assign to 'click' because it is a 'method group' -

i'm using linux monodevelop c# stuff , wrong ? ? using system; using gtk; namespace aaadd { class mainclass { public static void main (string[] args) { application.init (); mainwindow win = new mainwindow (); button button = new button(); button.click += new eventhandler (button_click); win.add (button); button.show (); win.show (); application.run (); } public static void button_click(object sender, system.eventargs e) { } } } error : cannot assign 'click' because 'method group' to subscribe event need use button.clicked += new eventhandler (button_click);

eclipse - AdMob for Android: AppStreamingHelper(27173): No acceptable module found. Local version is 0 and remote version is 0 -

i'm trying admob running in game ( c++ / ndk / sdlactivity / eclipse / android-api19 / google-play-services ) , following error in logcat: "appstreaminghelper(27173): no acceptable module found. local version 0 , remote version 0." what missing ? here more detailed foregoing excerpt logcat: 07-04 13:35:00.730: v/mw(20836): java_requestnewinterstitial: loading ad. 07-04 13:35:00.760: i/dalvikvm(20836): not find method android.security.networksecuritypolicy.getinstance, referenced method com.google.android.gms.ads.internal.state.h.a 07-04 13:35:00.760: w/dalvikvm(20836): vfy: unable resolve static method 1390: landroid/security/networksecuritypolicy;.getinstance ()landroid/security/networksecuritypolicy; 07-04 13:35:00.760: d/dalvikvm(20836): vfy: replacing opcode 0x71 @ 0x0072 07-04 13:35:00.770: i/dalvikvm(20836): not find method android.content.pm.packagemanager.getpackageinstaller, referenced method gsk.a 07-04 13:35:00.770: w/dalvikvm(

python - How to quit from input() function after call codecs.getreader for stdin? -

i try read windows console utf-8 letters. i have code follows: import codecs sys.stdin = codecs.getreader('utf-8')(sys.stdin) if __name__ == '__main__': print 'query=', query = sys.stdin.readline() print query but there strange thing: after pressing enter button execution of stdin.readline() or raw_input() or input() functions not stop. what do wrong? or how send eof() stop input console in case? on mac, hitting ^d (ctrl-d) twice trick. not sure if work across systems, give shot.

c# - ActiveX Control Not Installing Automatically -

i have written simple activex control in c# , created .msi installer , packaged in .cab file. when runs .msi installer manually, installs activex control , works fine browser. when browser prompts automatic installation, not gets installed. i using windows server 2008 64 bit , ie 11. .inf [version] signature="$chicago$" advancedinf=2.0 [add.code] axcontrolsinstaller.msi=axcontrolsinstaller.msi [axcontrolsinstaller.msi] file-win32-x86=thiscab registerserver=yes clsid={1fc0d50a-4803-4f97-94fb-2f41717f558d} fileversion=1,0,0,0 i have following following tutorial create control. works till step 16 prompts installation after every refresh , not gets installed. http://www.slideshare.net/yudep_apoi/steps-how-to-create-active-x-using-visual-studio-2008 [ie setting change] run activex , plug-ins – enabled download signed activex control – enabled script activex controls marked safe scripting – enabled download unsigned activex control – prompt initialize , s

ios - Autolayout - 2 Labels with dynamic length -

Image
i have question autolayout - dont have problems using autolayout, if cell label has dynamic length - case ill got 2 labels, 1 top label dynamic length, , second 1 under first label. ill tried set top label leading, trailing, fixed width (its ipad landscape app, want have , exact with) - , second 1 bottom, trailing, , set leading first label. here: but unable bring work that: both labels should have dynamic length - update cell height automatically. width of both labels 700px, width margin top, right , bottom 8. ill forgot say, left label should have dynamic height too. any ideas? in advance! errors after using "lukas" tipp: by default, both labels have same hugging , resistance priority, making 1 of them less other fix problem. ps, i'd avoid using magic numbers 8 in auto layout, instead use standard value

javascript - Sails.js stream sql query -

is there way stream data model.query() in sails ? example export: (req, res) => { let sql = "select ..."; let stream = model.query(sql).stream(); // know not work stream.pipe(...); } yes. according sails doc : module.exports = { teststream: function(req, res){ if (req.param('startstream') && req.issocket){ var getsocket = req.socket; // start stream. pipe sockets. user.stream({name:'walter'}).pipe(getsocket.emit); } else { res.view(); } } }

javascript - Highlight 2 rows by class or ID in separate tables -

i creating 2 tables dynamically in php , want able compare rows in 2 tables. want able hover highlight row in either table , corresponding row (by id) in other table highlight well. i've found many references similar situations on here, seem work hover on row 1 highlight row 1 in table 2. want highlight function row id (or class, not sure more appropriate). in example below if hover on row id 123 in table 1, row id 123 in table 2 highlight. , reverse, highlighting row id 123 in table 2 highlight row id 123 in table 1. the trick here these rows may in sort of order, counting or doing nth stuff wont work here. <table id="t1"> <tr id="123"><td>......</td></tr> <tr id="456"><td>......</td></tr> <tr id="789"><td>......</td></tr> <tr id="0ab"><td>......</td></tr> <tr id="cde"><td>.....

javascript - How do I show annotations on my Google Chart that extracts data from a Google Spreadsheet? -

i have google chart displays data. here html - <div id="chart"></div> here css - html, body { width: 100%; height: 100%; } #chart { width: 100%; } here js - google.charts.load('current', { 'packages': ['corechart'] }); google.charts.setonloadcallback(drawchart); function drawchart() { var query = new google.visualization.query("https://docs.google.com/spreadsheets/d/1wlbwmwwu_bxcpxm8tlkntkr4gbeqz_o8curzddqmuam/gviz/tq?gid=799372846&range=a:b"); query.send(handlequeryresponse); } function handlequeryresponse(response) { var data = response.getdatatable(); var chartareaheight = data.getnumberofrows() * 10; var chartheight = chartareaheight + 70; var options = { title: "andaman & nicobar islands", legend: "none", vaxis: { title: "year", format: "0", }, haxi

excel - Average of TextBoxes that are not blank -

i need average of 5 textboxes there chance of them may empty. if so, should consider filled textboxes. have code find sum of couldn't succeed in finding average: tot = tot + cdbl(textbox117.text) tot = tot + cdbl(textbox118.text) tot = tot + cdbl(textbox119.text) tot = tot + cdbl(textbox120.text) tot = tot + cdbl(textbox121.text) textbox70.text = tot i tried counting number of boxes still couldn't result. dim arr, long, n long, t double, v arr = array(textbox117, textbox118, textbox119, textbox120, textbox121) n = 0 t = 0 = lbound(arr) ubound(arr) v = trim(arr(i).text) if len(v) > 0 t = t + cdbl(v) n = n + 1 end if next textbox70.text = t textbox71.text = t/n

c++ - Why is the size of a native long primitive on 64-bit Windows only 4 bytes? -

will please tell me how makes sense, , how make stop? seriously, crazy or 64-bit windows long type 4 bytes? how make sense? thought native long primitive size supposed same native register size. [32-bit linux] me@u32:~$ ./sizes32 sizeof(char): 1 sizeof(short): 2 sizeof(int): 4 sizeof(long): 4 sizeof(long long): 8 [64-bit linux] me@u64:~$ ./sizes64 sizeof(char): 1 sizeof(short): 2 sizeof(int): 4 sizeof(long): 8 sizeof(long long): 8 [32-bit windows] c:\users\me\downloads>sizes32.exe sizeof(char): 1 sizeof(short): 2 sizeof(int): 4 sizeof(long): 4 sizeof(long long): 8 [64-bit windows] c:\users\me\downloads>sizes64.exe sizeof(char): 1 sizeof(short): 2 sizeof(int): 4 sizeof(long): 4 sizeof(long long): 8 backward compatibility! windows came 16-bit platform sizeof(long) == 4 , makes extensive use of types long , dword ... , changing make lot of code crash or not able compile o

ios - Undefined symbols for architecture arm64 in Xcode 7.1 -

hi when try run app in xcode 7.1 on device , getting following error. can pls let me know issue. runs fine on simulator. undefined symbols architecture arm64: "_objc_class_$_adauthenticationcontext", referenced from: objc-class-ref in loadingviewcontroller.o ld: symbol(s) not found architecture arm64 clang: error: linker command failed exit code 1 (use -v see invocation) it library consists of class adauthenticationcontext isn't compiled arm64 architecture, armv7 / armv7s . you can disable arm64 support in project modifying supported architectures , valid architectures in build settings , case compilation , linking should work. note app store won't accept app without arm64 support. try update library or recompile if possible.

I can't override a method of a class imported from cocoapods in swift -

Image
i've installed pod cocoapods named swifthsvcolorpicker. it's working fine. when try subclass 1 class of pod (which public class), it's given error when trying override method hueandsaturationselected(hue:saturation:) saying method doesnt exist in class.below it's print of subclass: below it's print of referred method: if try create class inside same folder of class swifthsvcolorpicker, says swift not supported static libraries. (besides fact dont know if class remain there in case of new pod install ). how override method?

html - how to make bootstrap v4 card group to share same header -

i'm trying use bootstrap v4 card-group project. , want add card-header card-group. however, .card-header class should added each of card, want know if there solution make header shared cards in same row. i attached codepen here. eg, want have 1 shared card-header topic shown. thanks! i think best way create class (it not affect default bootstrap css). .card-header-custom { border-radius: .25rem .25rem 0 0; padding: .75rem 1.25rem; background-color: #f5f5f5; border: 1px solid #e5e5e5; border-bottom: none; } .card-header-custom + .card-group > .card { border-top-left-radius: 0; border-top-right-radius: 0; } codepen

Font color property in PDF using perl PDF::Create -

how set font-color property when creating pdf through perl module pdf::create ? below code snippet using. how can set font color property here? use warnings; use strict; use pdf::create; use pdf::image::jpeg; print "pdf image\n"; #create $pdf = new pdf::create( 'filename' => "./image_embed_test.pdf", 'version' => 1.2, 'pagemode' => 'usenone', 'author' => 'madhan', 'title' => 'my pdf', ); # prepare 2 fonts $f1 = $pdf->font('subtype' => 'type1', 'encoding' => 'winansiencoding', 'basefont' => 'helvetica'); $f2 = $pdf->font('subtype' => 'type1', 'encoding' => 'winansiencoding', 'basefont' => 'helvetica-bold'); $f3 = $pdf->font('subtype' => &#

php - How to make a rest api with Facebook Authentication -

i want make ios app need communicate webservice/restful api data mysql db. instead of implement own user login module in ios app want use facebook sdk/api. i'm using laravel 5 make rest api (i'm new laravel/php). question how authorize logged in facebook user? i thinking when facebook user login via ios app save required facebook users data in table called "users" post request ios app. , let user has many images. if want images user ios app send access-token webservice , webservice i'll find users id using access_token (making post request facebook api user details) , users id can images belongs to. as said i'm new these technologies if i'm wrong please correct me , me further - thank you ps: have read called social authentication in laravel, haven't digged deeper it.

html - css hover div1.img1 affect on another div2.img2 -

Image
css hover div1.img1 affect on div2.img2 .img1:hover + .i1 { display: none } <article> <div class="bigimg"> <img id="hauptimg" class="i4" style="position: absolute" src="imgs/k2.jpg" width="394px" height="309px"> <img id="hauptimg" class="i3" style="position: absolute" src="imgs/k1.jpg" width="394px" height="309px"> <img id="hauptimg" class="i2" style="position: absolute" src="imgs/big.jpg" width="394px" height="309px"> <img id="hauptimg" class="i1" style="position: absolute" src="imgs/big2.jpg" width="394px" height="309px"> <div class="clear"></div> </div> <div class="smallimg"> <img id="secondimg

javascript - Dynamically adding html from external view -

i have function in javascript appending html div like: $("#test").html("<tr><td>" + data[0].foo + "</td></tr>"); i don't want html in code, want place external file , load variable. data variable? how pass external file? how use it? you can store code in file (let's script.js because i'm feeling creative), , using jquery function $.getscript( "script.js") load script page. if have name in variable, that's not problem, can use var scriptsrc="script.js"; $.getscript(scriptsrc); does answer question?

Python BeautifulSoup can't select specific tag -

my problem when parsing website , loading data tree bs. how can content of <em> tag? tried for first in soup.find_all("li", class_="li-in"): print first.select("em.fl.in-date").string #or print first.select("em.fl.in-date").contents but doesnt work. pls help. i searching cars on tutti.ch here entire code: #crawl tutti.ch import urllib thisurl = "http://www.tutti.ch/stgallen/fahrzeuge/autos" handle = urllib.urlopen(thisurl) html_gunk = handle.read() bs4 import beautifulsoup soup = beautifulsoup(html_gunk, 'html.parser') first in soup.find_all("li", class_="li-in"): if first.a.string , "audi" , "bmw" in first.a.string: print "geschafft: %s" % first.a.contents print first.select("em.fl.in-date").string else: print first.a.contents when finds bmw or audi should check when car inserted. ti

android - How to determine which dependency causes Google Play OpenSSL warning? -

i'm working on big legacy project , trying fix openssl vulnerability issue explained @ how address openssl vulnerabilities in apps . the problem is, there lot of dependencies, open source (i updated didn't break compatibility) added gradle import, custom/closed source provided partners , contractors of company work , attached project jars. is there way pinpoint specific library has vulnerability? used bash script provided @ google play , openssl warning message , points 1 native dependency (actually .so file). there option pinpoint actual dependency there? is there option pinpoint actual dependency there? yes, need know offending openssl version , need grep . windows find won't do. first, take note of offending openssl version. sake of argument, due openssl 1.0.1h . next, gather list of dependencies , top level folders. sake of argument, $home/desktop/aosp-app , $home/sdk-a , /usr/local/sdk-b , /opt/local/sdk-c . finally, top level directorie

javascript - DOM updates not shown in 'View Source', only in 'Inspect Element' -

this question has answer here: content of html page changed jquery “view source” don't reflect changes 2 answers i have write simple script 1 change alts in img tag. not working. here script: jquery(document).ready(function($) { var slowakluczowe = ['alt1', 'alt2', 'alt3']; $("img").attr("alt", function() { return slowakluczowe[math.floor(math.random() * slowakluczowe.length)]; }); }); the script takes random alt , pins in image doesn't work well. doesn't change alt when click 'view source' works when click 'inspect element'. see here: http://prntscr.com/boo9jk it's working 'inspect element' how can make work 'view source'? view source displays original data received server. cannot changed javascript. browser inspector shows live represen

python - order of executing shell_exec in php -

i want execute 2 scripts: s1 , s2 . s2 must executed after s1 . time of execution of s1 2800 seconds, , need execute s2 after s1 . should put sleep(3000) in php between them, or second 1 execute automatically after first one? i tried this: exec('python s1 '); //time of execution 2800s sleep(3000); // want sure first 1 finished shell_exec('php /home/parik/s2.php'); from exec manual page: if program started function, in order continue running in background, output of program must redirected file or output stream. failing cause php hang until execution of program ends. in short, php wait python s1 command finish before continuing. note execution time of 3000 seconds time out without changing default maximum execution time in ini file. see how increase maximum execution time in php .

node.js - transfer cookies on a server/server request -

in universal app, loose every users cookies on server/server http request. have build small nodejs app reproduce thing: const fetch = require('isomorphic-fetch'); const bodyparser = require('body-parser'); const cookieparser = require('cookie-parser'); const session = require('express-session'); const server = require('express')(); server.use(bodyparser()); server.use(cookieparser()); server.use(session({ secret: 'foo', httponly: false })); server.get('/set-cookies', (req, res) => { req.session.user = { name: 'john doe' }; res.send('ok'); }); server.get('/a', (req, res) => { console.log('cookie in = ', req.cookies); // cookies here ! const options = { credentials: 'include' }; fetch('http://localhost:3131/b', options) .then( () => { res.send('ok'); }); }); server.get('/b', (req, res) => { console.log('coo

java - Adding new option for command line parser: Unrecognised option error -

so i've forked , zipped code github repository contains java files require command line arguments. here's relevant code problem- options options = new options(); options.addoption("f", false, "force processing of text file"); options.addoption("printhtml", false, "print html file inspection"); options.addoption("w", true, "coreference weight file"); options.addoption("doc", true, "text document process"); options.addoption("tok", true, "processed text document"); options.addoption("docid", true, "text document id process"); options.addoption("p", true, "output directory"); options.addoption("id", true, "book id"); options.addoption("d", false, "dump pronoun , quotes annotation") commandline cmd = null; try { commandlineparser parser = new ba

php - How can I make sure my query inserts a new row? -

this question has answer here: pdo mysql: how know if insert successful 7 answers here query: $db->query("insert mytable(col1, col2) values('val1', 'val2')"); i'm trying understand query inserts new row or not? how can determine it? note: i'm not using execute() in case. taken directly w3schools.com/php/php_mysql_insert ... $sql = "insert myguests (firstname, lastname, email) values ('john', 'doe', 'john@example.com')"; if ($conn->query($sql) === true) { echo "new record created successfully"; } else { echo "error: " . $sql . "<br>" . $conn->error; } you're looking this: if ($conn->query($sql) === true) edit: sorry, took wrong example @drew pointed out! below correct snippet, make use of execute, think should (corr

java - How to wrap text around an image? -

Image
i'm trying wrap text around image. the structure need create in picture bellow: this have tried i have tried using table did not succeed. tough of using text field html , passing image , set alignment left, found out not possible pass image in text field. started solve problem using jaspersoft studio pro , html element . not figure out how pass image field data base html source. expression in html element is: "<img src= '$f{image}' align='left'/> <p>"+$f{kn_zusatzinfo_dv_einleitungstext} +"</p>" this code not show image, box instead of image. , text printed not stretched. page style use 2 column. html out put in picture using static path 1 bellow image works, not option me since need read image data base: "<style>.left { float: left; margin-left: 1em; width :40%;}</style><p><img class = left src= c:/users/iman/jaspersoftworkspace/qreport/sample1.png /> if use imag