Posts

Showing posts from April, 2013

libreoffice calc - Using Java to get OfficeLibre Cell value -

i can not seem find documentation on accessing value in .ods table, officelibre java. using officelibre background program javafx program dump , data to, , can not figure out how access cell a1, example, holds "entrees". any appreciated. i use apache odf toolkit-simple api, here easier use version of apache's odfdom api.

android - How to add tabs to listview? -

i need add 2 tabs in listing , not know how it, wanted add 1 in first row , after fourth item separates: trend , genre, saw adding new xml layout need because can not, text between items.. my main activity: public class inicio extends appcompatactivity { private listview listaitens; private string[] itens = { "home", "playlist", "trend", "conta", "live", "rock", "hip hop", "pop", "house", "gospel music", "metal", "alt rock", "sport", "game" }; integer[] imgid={ r.drawable.home, r.drawable.playlist, r.drawable.trend, r.drawable.conta, r.drawable.live, r.drawable.rock, r.drawable.hiphop, r.drawable.pop, r.drawable.house, r.drawable.gospel, r.drawable.metal, r.d

mongodb - Should I stringify part of document, that are not used in the query -

i have collection document similar this: { name: 'foo', age: 25, extrainfo: { // big, complex many level nesting, , different between document. }, } i query document based name, age properties. don't care extrainfo property. it's complex. not know whether reduces performance of query process. do extrainfo. should stringify , compress before insert collection.? i avoid stringifying embedded documents makes them impossible use later down line. understand there no current requirement data used knows requirements tomorrow bring. it's better plan future block in corner. it'll same amount of performance if you're creating strings of embedded objects compared serializing them in bson.

java - Getting responsecode of 400 from POST in Android Studio -

Image
i've been following wintech's youtube tutorials this. set , added few post methods. methods work fine, when try posting bits, 400 response code. know means improper/malformed syntax, cannot find is. it's been few hours of trying , searching. , yes, aware can in 1 class , method, did see bit causing problem. it's of them. can tell me bit might wrong? mainactivity.java: import android.app.activity; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.content.intent; import android.net.uri; import android.widget.adapterview; import android.widget.checkbox; import android.widget.datepicker; import android.widget.edittext; import android.widget.listadapter; import android.widget.listview; import android.widget.simpleadapter; import java.io.bufferedinputstream; import java.io.bufferedoutputstream; import java.io.bufferedreader; import java.io.inputstream; import java.io.inputstreamreader; import java.io

authentication - Create SQL Server grant user -

i created database in sql server 2014 , entered sa , administrator. how make sa have permission see procedures? and how create admin user, using code? i tried this create login ztestecom password = 'sqlserver'; you cannot remove 'sa' being system administrator. recommended disable sa account since known account have system administrator rights , therefore user attempted hacked. the being said, below create user sysadmin , make yet user , grant them ability execute stored procedures in user databases. can run 'sa' account. -- create new account secure password create login sqlmanager password = 'now master.'; go -- grant new account sysadmin rights alter server role [sysadmin] add member [sqlmanager] go -- create new role executing procedures in user db's declare @command varchar(1000) select @command = ' if ''?'' not in(''master'', ''model'', ''msdb'&#

Java - Inheritance - Can you return a child self into parent instance method that returns self? -

this question has answer here: is there way refer current type type variable? 6 answers i have own custom list has bunch of functionality since manipulating same kinds of lists wanted extend custom list defined type , want able use parent functions , return child type. example: //object within list public class childobject { private string name; // getters, setters, methods, etc. } // parent custom list public class parentlist<t> extends arraylist<t> { public parentlist<t> filter(predicate<t> predicate) { collector<t, ?, list<t>> collector = collectors.tolist(); list<t> temp = this.stream().filter(predicate).collect(collector); this.clear(); this.addall(temp); return this; } } // extended custom list predefined type public class childlist extends parentlist&

php - Entering three elements at different points in retrieval/list -

i listing batsmen , have page showing top 50. want have 3 separate points in list can enter 3 different elements. i after 10th, 24th, 42nd batsmen. how go doing php? my current code retrieves batsmen , in controller has take of 50 @foreach($batsmen $bat) <h2> $bat->name</h2> <h3> $bat->nationality</h3> <h3> $bat->highscore</h3> @endforeach in normal php use index, , increment index in loop. i'm not clear 3 different elements are, should help: <?php // here $i index $i = 1; foreach($batsmen $bat){ // when index reaches 10, 24, , 42 add 3 different elements // output here done every iteration of loop // , before ads if( $i == 10 ){ echo '<div id="ad1"></div>'; } if( $i == 24 ){ echo '<div id="ad2"></div>'; } if( $i == 42 ){ echo '<div id="ad3"></div>'; } // he

amazon web services - Access RDS from Lambda function -

Image
i have aurora cluster in rds , lambda function. both assigned same vpc. both have same subnets (us-east-1 a-f) both have same security group assigned lambda assigned role amazonrdsfullaccess, amazonvpcfullaccess, awslambdavpcaccessexecutionrole when run lambda instance, connection timeout when trying connect aurora. i'm able access aurora locally (with access key added aws configure). any ideas else can check why lambda wouldn't have access instance? thank you update: subnets each have following configuration: both have same security group assigned it's common misconception members of same security group can communicate each other virtue of being members of same group. not case. being members of same group means follow same set of rules. members of security group can access other members of group if group allows access itself. instances associated security group can't talk each other unless add rules allowing (exception: defau

rest - Higher concurrency vs lower concurrency -

in doing load test (by using siege example) servers, lower concurrency number better? what number signify? the siege docs go detail on concurrency here: https://www.joedog.org/2012/02/17/concurrency-single-siege/ from page: the calculation simple: total transactions divided elapsed time. if did 100 transactions in 10 seconds, our concurrency 10.00. higher concurrency measure can mean server handling more connections faster can mean server falling behind on calculations , causing connections queued. concurrency measure valuable when taken in context of time elapsed.

amazon web services - Extract date time from Apache Combined log format using AWS Logs and Cloudwatch -

we're using awslogs collect apache combined formatted logs cloudwatch . it's capturing fine, we're getting timestamp not parsed message error. an example log entry: ::ffff:10.0.0.1 - blahblah [17/aug/2017:20:31:07 +0000] "get /favicon-16x16.png http/1.1" 304 - "http://blahblah:3000/" "mozilla/5.0 (macintosh; intel mac os x 10_12_6) applewebkit/537.36 (khtml, gecko) chrome/60.0.3112.90 safari/537.36" our config set of log files looks this, including our datetime_format entry: [access_logs] log_group_name = cromwell log_stream_name = react-172.31.43.245-access file = /home/admin/aperian-react/log/*access.log datetime_format = "%d/%b/%y:%h%m:%s %z" multi_line_start_pattern = ::ffff: time_zone = utc encoding = ascii as can see, datetime mid-line. different examples syslogs, etc. change our log format, we'd prefer not since flow other systems well. our dateformat_string missing colon.😒 😢 datetime_format =

java - How to connect oracle database through tcps on tomcat -

i using tomcat 7, jdk 7. my db oracle 11g. i trying connect db tcps on tomcat. some people have adding these lines. url="jdbc:oracle:thin:@(description=(address=(protocol=tcps)(host=db ip)(port=port number))(connect_data=(service_name=db sid))) " connectionproperties="oracle.net.ssl_cipher_suites=ssl_dh_anon_with_3des_ede_cbc_sha,ssl_dh_anon_with_rc4_128_md5,ssl_dh_anon_with_des_cbc_sha" so config file looks : <resource name="jdbc/jedidatasource" auth="container" driverclassname="oracle.jdbc.driver.oracledriver" type="javax.sql.datasource" maxactive="40" maxidle="20" maxwait="-1" initialsize="1" username="cdw_admin" password="travel" removeabandoned="true" logabandoned="true" removeabandonedtimeout="60" validationquery="select 1 dual" url="jdbc:oracle:thin:@(description=(address=(protocol=tcps)(host=db

YouTube volume is very low when played during a WebRTC session -

i working on ios app webrtc. during chat, volume fine. if play embedded youtube video through wkytplayerview, volume of video low. if disconnect chat, video volume becomes normal again. i have tried several things , have been looking @ issue few days. here how setting category audio session; nserror *error = nil; [[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayandrecord withoptions: avaudiosessioncategoryoptionmixwithothers | avaudiosessioncategoryoptiondefaulttospeaker error: &error]; if (error != nil) { nslog(@"problem setting avaudiosession mix others"); } any appreciated. afaik, there raised webrtc issues. here's 2 of them: low sound volume during calls agc sets volume zero you may want check given fix putting cl fix problem in platforms. see if works you. otherwise, can try using mediastream-gain useful controlling rhe volume of micr

firebase - database is unavailable use object construction FIRDatabase swift -

need help! newbie in swift developing , try connect app firebase. when try configure , locate database got error! "database unavailable use object construction firdatabase" here code: let db = firdatabase.database().reference() my podfile pod 'firebase' pod 'firebase/core' pod 'firebase/storage' pod 'firebase/auth' pod 'firebase/database' what missing here? need help. thanks did add in appdelegate application:didfinishlaunchingwithoptions: method? firebaseapp.configure() did add googleservice-info.plist project? are using xcworkspace project file instead of xcodeproj file open xcode project? i see references api naming changes (i.e. firdatabase database). make sure that's not causing problem too.

php - Multiple PayPal accounts linked to ONE installation of Woocommerce -

my issue: client has 12 locations, each location different corporation hence different paypal account per business. default woocommerce supports 1 email entered process payment. goal use 1 installation of wordpress / woocommerce direct user paypal account associated location have selected upon checkout. my theory / attempt: thought of implementing feature setting variation user can select location pass parameter url. parameter later used within php overwrite default email. my problem: having trouble overwriting default email entered within admin settings, cant seem locate email in database. assuming file pertaining modification located at: wp-content/plugins/woocommerce/includes/gateways/paypal prefer doing wordpress way vs editing core files, obvious reasons. after doing research have found following action shown below, proceed checkout button, looking interact proceed paypal button. fluent in php not best wordpress development. think popular issue since majority of franch

java - How to add list from cursor to intent in share button -

i have app use content provider work db. have list, inflated , shown user. need save list intent , send share button i found here here questions- 1) need convert cursor list or need create second list , inflate cursor or there other variant? 2) how can customize of recieved message? here code- public class catalogactivity extends appcompatactivity implements loadermanager.loadercallbacks<cursor> { private static final string tag = "mylogs"; /** identifier pet data loader */ private static final int list_loader = 0; /** adapter listview */ listcursoradapter mcursoradapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_catalog); log.v(tag, "Зашли в catalog activity oncreate"); // setup fab open editoractivity floatingactionbutton fab = (floatingactionbutton) findviewbyid(r.id.fab); fab

How to create multi dimension array in php for followingg input -

i have input array format , convert multi dimensional array array ( [0] => array ( [third_party_id] => 2 [third_party_name] => aardvarkg [parameter_id] => 221 [parameter_name] => new2 [param_value] => 1 [sub_param_name] => new2_new2 [sub_param_value] => 1_1 [sub_bidder_id] => 72 ) [1] => array ( [third_party_id] => 2 [third_party_name] => aardvarkg [parameter_id] => 222 [parameter_name] => new [param_value] => 1 [sub_param_name] => new [sub_param_value] => 1 [sub_bidder_id] => 74 ) [2] => array ( [third_party_id] => 3 [third_party_name] => aard [parameter_id] => 221 [parameter_name] => new2 [param_value] =&g

how to tell apart 2 exact same usb devices (audio pcm) from the port they are connected in linux? -

in case, making program uses 2 exact same usb sound cards, when check pcm name arecord -l set , set_1 cards. trying make program runs inside raspberry pi automatically cannot check unplugging , replugging each boot, know if there way tell apart device which?

asp.net - Accepting requests from authorized application -

my asp.net api accepts requests authenticated , registered users. want add new api methods should respond requests coming applications -- website created. how handle "application authentication" scenario in asp.net api app? simple way go pass secret key [ key ] in requests header server verify. make more secure , ensure no man-in-the-middle can sniff secret key better approach pass token sha(key:timestamp) along timestamp use in sha function. once receive such request on api server should verify received timestamp not old/expired , construct servertoken= sha(key:timestamp) . if token header same servertoken request authenticated.

rest - Is there any tool or site to suggest resource paths as per RESTful standards based on our input path? -

i having tough time coming noun resource path endpoints per naming conventions. eg: lets have "sim" service handles changing sim details. post /sim/changereasons - give reasons change. post /sim/changevalidator - validate if given sim can changed. post /sim/changeprocessing - process change sim request. whats best way tell "change of sim" operation complying restful api naming standards

java - How to choose class-coding way when using GSON -

there 2 class-coding way use gson,the 1 is class { b b; c c; public static class b { c c; public static class c { //the same a.c } } public static class c { } } the other is class { b b; c c; public class b{ c c; } public class c { } } all of 2 way can work. can see ,the first way can provide re-code , easy code,but target json become more , more complex, become hard use static class in class a , second way can more easy use in case, second way use repeated class, , whether same static class in different class occupy more resource.

How to Read Value from XML document and store it in a variable using Selenium Java -

Image
i'm new automation using selenium java. i have problem need go through xml file find node , read value in node. , need compare value input string. can please me how read xml file , fetch value xml , store in variable. this have in xml : in image 01 need read value in chassismoduleoptionrequest partner_item= , store value in array. below code tried. documentbuilderfactory factory = documentbuilderfactory.newinstance(); documentbuilder builder = factory.newdocumentbuilder(); //parsing of xml done here document doc = builder.parse(new file("c:\\users\\satish_d1\\documents\\my received files\\pdsl_abm.xml")); //here root element of xml , print out doc.getdocumentelement().normalize(); system.out.println ("root element of doc " + doc.getdocumentelement().getnodename()); nodelist list = doc.getelementsbytagname("chassismoduleoptionrequest"); int totalpartneritem =list.getlength(); system.out.println("total no of

fortran - Where should I allocate a pointer? -

ok..i edited whole question again. in test_module , there's type "body" consists of array of pointers. in test_subroutine , want input real number , output pointer instance of type "body". i compiled , ran following code, got runtime error - "segmentation fault - invalid memory reference". questions are: i'm not sure what's wrong code. where should allocate "low" component? in test_main or test_subroutine? word say, every component in pointer derived type need allocated before being passed? how debug these memory bugs? tried gdb didn't enough useful info it. test_module.f90 module test_module implicit none type body real,pointer :: low(:) => null() end type end module test_module test_subroutine.f90 subroutine test_subroutine(input,output) use test_module implicit none real,intent(in) :: input type(body),pointer,intent(out) :: output

java - Proxy password containing `@` in JVM -

i have scala code has managed negotiate (ntlm) proxy , access internet, specifying username , password so: // based upon http://rolandtapken.de/blog/2012-04/java-process-httpproxyuser-and-httpproxypassword authenticator.setdefault(new authenticator() { override protected def getpasswordauthentication: passwordauthentication = { if (getrequestortype eq requestortype.proxy) { val prot = getrequestingprotocol.tolowercase // allows return passwordauthentication when have // 4 of host, port, user , password _and_ host , // port match actual proxy wanting authentication. { host <- option(system.getproperty(prot + ".proxyhost")) if getrequestinghost.equalsignorecase(host) port <- try(augmentstring(system.getproperty(prot + ".proxyport")).toint).tooption if port == getrequestingport user <- option(system.getproperty(prot + ".proxyuser")) pass <- option(system.g

c# - Gaussian Filter implemetation -

i preparing implement gaussian filter in c#, , in preparation reading literature on this. have disagreeing sources. one book (japanese text: practical image processing introduction uchimura) specifies equation calculate template w(u,v)= (1/2*pi*sigma^2) exp(-(x^2+v^2)/(2*sigma^2)). i think correct, although author links size , sigma size = 3*sigma . finally excellent book (feature extraction & image processing computer vision nixon , aguado, p.106) gives correct equation, when implementing in code gives different implementation. w(u,v)= (1/sum)* exp(-(x^2+v^2)/(2*sigma^2)) where sum sum of values of exponentials. below pseudo code provide - think close matlab. function template=gaussian_template(winsize,sigma) %template gaussian averaging %usage:[template]=gaussian_template(number, number) %parameters: winsize-size of template (odd, integer) % sigma-variance of gaussian function %author: mark s. nixon %centre half of window size centre=floor(winsize/2)+1; %we&#

python - Comparing values in columns and returning boolean values -

hi have 4 columns column names(ma5,ma10,ma20,ma60). see if in each row, satisfies: ma60>ma20>ma10>ma5(numbers in these columns in specific row), return 1 if true , 0 if false. tried following: (eachstockdf['ma5']>eachstockdf['ma10'] , eachstockdf['ma10']>eachstockdf['ma20'] , eachstockdf['ma20']>eachstockdf['ma60']) *1 i want return series 0 , 1 indication of whether condition met. gives following error: valueerror: truth value of series ambiguous. use a.empty, a.bool(), a.item(), a.any() or a.all(). i know works when compare 2 rows. example: ((eachstockdf['ma5']>eachstockdf['ma10'])) *1 but how can compare 4 columns? in advance!! you need use bitwise & operators, pandas overloads those. also, each condition must wrapped in set of enclosing parens, because of precedence of bitwise operators. ( (eachstockdf['ma5'] > eachstockdf['ma10']) & (

html5 - how to achive the fallowing using angular2 and typescript html css -

hi friends new angular2 , need achive fallowing issue. when click on search icon (marked in red color) window should open shown in image fields. , don't no concept use achive please me guys this. enter image description here enter image description here and code used schive this <!--filter , search bar --> <div class="row" > <div class="col-md-6 col-lg-6 col-xs-12 searchfilter pull-right"> <img src="/images/filter.svg" alt="searchfilter" width="100%" style="margin-top:13px;"> </div> <div class="col-md-6 col-lg-6 col-xs-12 filter pull-right"> <img src="/images/filter.svg" alt="filter" width="100%" style="margin-top:13px;"> </div> </div>

android - No cache version available for offline mode -

i updating android stud via sdk manager com.google.protobuf:protobuf-java:3.0.0 think needs there in order me work offline 'cause not have internet @ home use universities internet updates. i've downloaded file think com.google.protobuf:protobuf-java:3.0.0 site https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java/3.0.0-alpha-2 , wondering if there way me to... don't know "plug in" or that?

Oracle database multiple row -> c# -

how retrieve multiple data rows oracle database using c#.net? , disply data rows list-box. let's brush code: // extract methods, don't cram in onclick private void feedfriendslistbox() { string oracledb = @"connection string"; //done: wrap idisposable using using (oracleconnection conn = new oracleconnection(oracledb)) { conn.open(); //done: make sql readable - format out , use names parameter(s) string sql = @"select name, address friends age = :prm _age"; //done: wrap idisposable using using (oraclecommand cmd = new oraclecommand(sql, conn)) { cmd.parameters.add(new oracleparameter(txtlist.text, oracledbtype.decimal)); //done: wrap idisposable using using (var reader = cmd.executereader()) { if (!reader.hasrows) { listbox1.text = "not found"; messagebox.show("data not found", "not found",

twitter bootstrap - How to get particular row data on click of edit icon ReactJS? -

Image
hi i'm using bootstrap table , used display data. example : how can particular row data when click edit icon? code : <table classname="table table-striped table-custom"> <thead> <tr> <td style={tablestyle}>date</td> <td style={tablestyle}>bill no</td> <td style={tablestyle}>amount</td> <td style={tablestyle}>edit</td> <td style={tablestyle}>delete</td> </tr> </thead> <tbody> {this.state.customerindividual.map(para => { return <tr key={para.id}> <td>{para.date}</td> <td>{para.billno}</td> <td>{para.amount}</td> <td> <button classname="btn btn-primary btn-xs" onclick={this.editmode} data-title="edit" data-toggle="modal" data-target="#edit"

Java scanner and Method set in Array Exception in thread "main" java.lang.NullPointerException at Main.main(Main.java:16) -

this question has answer here: what nullpointerexception, , how fix it? 12 answers nullpointerexception when creating array of objects 7 answers import java.util.scanner; public class main { public static void main(string[] args) { tech[] std=new tech[5]; int i; for(i=0;i<5;i++) { system.out.println("enter name of student"); string name; scanner scanin = new scanner(system.in); name = scanin.nextline(); scanin.close(); std[i].setname(name); system.out.println(std[i].name); } } } exception in thread "main" java.lang.nullpointerexception @ main.main(main.java:16)

google maps - Standard Android Geocoder Usage Limits -

do geocoding apis usage limits (2,5000 per day) relate standard geocoder may use in app? no. there no usage limit associated calling functions in android.location.geocoder . however, there no sla or performance guarantee associated api, there's price/quality tradeoff made.

vue.js - How can I get data inside of Vue from database like config or smth> -

var app = new vue({ el: '#app', data: { positions: [] }, created() { axios.get('/config').then(function(response) { this.$set(this.positions, "positions", response.data[0].dragedpositions); }); console.log(this.positions.positions); } }); i have configs app in database , want use them inside of vue instance (here positions of elements). when im getting "this.positions.positions" im getting empty string.. how can that? sounds want load config first , bootstrap application after that. use propsdata this: axios.get('/config').then(function(response) { new vue({ el: '#app', props: ['positions'], propsdata: { positions: response.data[0].dragedpositions }, created() { console.log(this.positions); } }); }); i created little demo :) const axios = {get () { return promise.resolve({data: [{dragedposit

mysql how to create new row for selected group -

i have tables partners, publications, baskets, etc. i'd add publication every partner in selected basket. every table connect keys, not sure, have join them ( partner.partner_id , publications.pb_partner_id , baskets.bsk_partner_id ). i tried isn't enough: insert publications(pb_id, timestamp, comment) values (1, 2017, 'whatever') (select partner_id partner join basket on partner_id = b_partner_id b_partner_id in basket_id = 13; yes, i'm full beginner in, may simple, dont speak english enough. use insert ...select in following way: insert publications(pb_id, timestamp, comment) (select 1, 2017,partner_id partner join basket on partner_id = b_partner_id basket_id = 13);

laravel - Failed to connect to graph.facebook.com port 443: Network is unreachable -

working on facebook application uses fb-sdk in laravel getting "failed connect graph.facebook.com port 443: network" error 2hr. i authenticating user using js , redirecting long live access token in fb-sdk giving error. here code,: try { $accesstoken = $helper->getaccesstoken(); } catch (facebookresponseexception $e) { // when graph returns error echo 'graph returned error: ' . $e->getmessage(); exit; } catch (facebooksdkexception $e) { // when validation fails or other local issues echo 'facebook sdk returned error: ' . $e->getmessage(); exit; } i want know possible reasons fb-sdk giving error suddenly. there can me out ?

javascript - How to put PHP content into an iframe? -

i have iframe , want put php content in in text-area. <textarea><?php echo $content; ?></textarea> but not work iframe . how can solve it? code: <form action="php_parsers/article_parser.php" id="writearticle" name="writearticle" method="post"> <p style="text-align: center; font-size: 22px;">create article</p> <textarea name="title" id="title" type="text" maxlength="100" placeholder="article title"></textarea> <div class="toolbar"> <a onclick="ibold()"><i class='fa fa-bold'></i></a> <a onclick="iunderline()"><i class='fa fa-underline'></i></a> <a onclick="iitalic()"><i class='fa fa-italic'></i></a> <a onclick="ifontsize()"><i c

shell - Bash group by on the basis of n number of columns -

this related previous question [asked] ( bash command group count ) what if want generalize this? instance input file abc|1|2 abc|3|4 bcd|7|2 abc|5|6 bcd|3|5 the output should be abc|9|12 bcd|10|7 the result calculated group first column , adding values of 2nd column, , 3rd column, similar group command in sql. i tried modifying command provided in link failed. don't know whether i'm making conceptual error or silly mistake know none of mentioned commands aren't working. command used awk -f "|" '{arr[$1]+=$2} end arr2[$1]+=$5 end {for (i in arr) {print i"|"arr[i]"|"arr2[i]}}' sample awk -f "|" '{arr[$1]+=$2} end {arr2[$1]+=$5} end {for (i in arr) {print i"|"arr[i]"|"arr2[i]}}' sample awk -f "|" '{arr[$1]+=$2 arr2[$1]+=$5} end {for (i in arr2) {print i"|"arr[i]"|"arr2[i]}}' sample additionally, if i'm trying here limit use sum

Count string length in byte using mb_strlen in php -

i got trouble while using mb_strlen function. mb_strlen('12', 'shift-jis') got 4 (full width char) mb_strlen('12 ', 'shift-jis')` got 2 meanwhile mb_strlen('1212', 'shift-jis') got 5???? anyone know how count there strings in byte? please help!!! if want number of bytes in string, use strlen function. it number of characters in string more difficult get.

c++ - Qt: Updates can only be scheduled from GUI thread or from QQuickItem::updatePaintNode -

how can call update() on qquickitem worker thread without causing following warning? updates can scheduled gui thread or qquickitem::updatepaintnode() i want enforce qquickitem::updatepaintnode() execute. i tried solution of hooking qobject::connect worker thread slot calls myqquickitem->update() . everything works fine though . qquickitem::updatepaintnode() called after signal emit & qquickitem updated the way want . warning on every update call schedule i understand cannot update ui worker thread . way without warning in qt? but, how can rid warning on every update call? note: had make qobject::connect qt::directconnection since qt::queuedconnection did not work calling update through signal. checked through this discussion here . discussion in link ends complain same warning getting here. question should correct avoid warning?

javascript - Cannot read property 'runResult' of undefined in stryker testing framework -

i trying use javascript testing framework stryker. when stryker run gives error. cannot read property 'runresult' of undefined at: g:\stryker test\node_modules\stryker-mocha-runner.js:30:40 below stryker.conf.js- module.exports = function(config){ config.set( { "files": [ { "pattern": "src/**/*.js", "mutated": true, "included": false }, "test/**/*.js" ], "testrunner": "mocha", "reporter": [ "clear-text", "progress" ], "testframework": "mocha", "coverageanalysis": "pertest" } ); } my file structure follows .stryker-tmp node-modules src index.js test index.js package.json stryker.conf.js

service - MDS JOIN between entity -

i'm stuck on problem mds (master data service) , don't know do, maybe can give me little tip. in mds possible show join between 2 entity (table)? with subscription view entity in domain based entity show name , code of both entity. while mds api didn't find nothing, method extract data 1 entity. do have advice? thank much

How to receive input and print it using Python? -

i have written following code: name = input("what name: ") print(name) it giving below error when input name /usr/bin/python2.7 /home/sreedhar/pycharmprojects/sample1/sample.py name: sree traceback (most recent call last): file "/home/sreedhar/pycharmprojects/sample1/sample.py", line 1, in name = input("what name: ") file "", line 1, in nameerror: name 'sree' not defined process finished exit code 1 can body me debug code, have started python today. , i'm using python community 17.2 on linux mint this. use raw_input instead: name = raw_input("what name: ") print(name) see python 2.7 getting user input , manipulating string without quotations input works on python 3.x, not in 2.x

php - how to send hidden details when click on image in while loop -

this code while ($row = $result->fetch_assoc()) { $imgpath=$row['image_name']; $id=$row['id']; <input type="hidden" name="id" value="' . $row['id'] . '" > here when click send id next page <img src="'.$imgpath.'" height="170" width="600" title="album-name" class="img-responsive" alt=" " /> } can use form it? jquery ajax job. need attach event handler function click event image. don'it need hidden element , attach $row['id'] id attribute of <img> element, on click, post via ajax. try : //first, make id attribute of <img> equal $id($row['id']) <img src="'.$imgpath.'" id="$id" height="170" width="600" title="album-name" class="img-responsive" alt=" " /> then, add event handler : $('body').on(

php - Product Attributes in Short Description in WooCommerce 3.0+ -

this question has answer here: add attributes short description in woocommerce 3.0+ 2 answers i’ve been trying use code found here this: // woocommerce version 3.0+ (only) add_action( 'woocommerce_shop_loop_item_title', 'custom_attributes_display', 20 ); function custom_attributes_display(){ // product category archives pages if(is_product_category()){ global $product; // array of attributes names $attribute_names = array('pa_guaranteed-ram', 'pa_cpu', 'pa_disk', 'pa_traffic'); foreach( $attribute_names $key => $attribute_name ) { // woocommerce version 3.0+ $product_id = $product->get_id(); // wc 3.0+ // getting value of attribute (ok wc 3.0+) $attribute_value = array_shift(wc_get_product_terms( $product_id, $attribute_