Posts

Showing posts from May, 2014

C# OnReceived Event is fired twice -

i'm relatively new c# , had stumbled across issue onreceived event triggered twice first time doesn't update subscriber instead update on second times. below of codes used in program. appreciate if can have , tell me cause at. i have this. public tcpmain() { socketservice.tcpclient.onconnected += new socketservice.tcpclient.onconnectedhandler(client_onconnected); socketservice.tcpclient.ondatareceived += new socketservice.tcpclient.ondatareceivedhandler(client_ondatareceived); socketservice.tcpclient.ondisconnected += new socketservice.tcpclient.ondisconnectedhandler(client_ondisconnected); socketservice.tcpclient.onstatus += new socketservice.tcpclient.onstatushandler(client_onstatus); socketservice.tcpclient.onstatus2 += new socketservice.tcpclient.onstatus2handler(client_onstatus2); } public tcpmain(string remoteserverip, int remoteserverport, int remoteserverport2, string localip = "", int localport = 0)

Touch doesn't work in Windows 10 file open picker -

i've downloaded file open picker sample microsoft ( https://code.msdn.microsoft.com/windowsapps/file-picker-app-extension-0cb95155 ) testing file open picker contract. i installed sample app , went through file picker ui (where select installed app pick file from). there can't interact ui using touch screen. mouse works fine. sample works fine touch in windows 8.1. it ignores click events. hover animations still happen. i made simple app gridview , button . gridview.itemclick worked fine touch, button click events work maybe once every 30 clicks. tried setting click , pointerreleased , , command . i tried built-in photo app, , same results. touch doesn't work buttons outside of gridview . here's simple page (minus gridview ) doesn't respond touch click events: public sealed partial class app : application { ... protected override void onfileopenpickeractivated(fileopenpickeractivatedeventargs args) { var root =

react native - Scroll to top of ScrollView -

is there way scroll top of scrollview in response button press? i can force re- render of whole page seems inefficient. you can run "scrollto" method of scrollview. @ sources of scrollview component https://github.com/facebook/react-native/blob/master/libraries/components/scrollview/scrollview.js#l288 you can reference scrollview component setting ref property , using this.refs described here: https://facebook.github.io/react/docs/more-about-refs.html

php - Joomla 3 add article tags to search results -

i appreciate help. i creating site joomla 3.4. articles tagged not showing tags in search results. i'm not sure whether should or not, have read following answer: article tags shown in article list-layout i concluded should able add following default_results.php page, similar: <?php // set tags $tags = ''; if (!empty($result->item->tags->itemtags)) { jloader::register('tagshelperroute', jpath_base . '/components/com_tags/helpers/route.php'); foreach ($result->item->tags->itemtags $i => $tag) { if (in_array($tag->access, jaccess::getauthorisedviewlevels(jfactory::getuser()->get('id')))) { if($i > 0) $tags .= ', '; $tags .= '<a href="'.jroute::_(tagshelperroute::gettagroute($tag->tag_id . ':' . $tag->alias)).'">'.$result->escape($t

java - Artificial Neural Networks input comprehension -

i'm total beginner regarding a.n.n.s. understand concept , there's no straight explanation why input series of 0s , 1s , output series of 0s , 1s. i read here on neural networks - input values can encode input data normalization function it's converted number between 0 , 1. is case or misunderstanding things? also think point me in right direction regarding article/ lecturing material should pick clear things out? i'm relearning nets now, , asked similar question. it's hard know exact scenario is, me, activations in range of 0-1 because activation function sigmoid function, outputs in range of 0-1 (although you'll need ask math oriented person why is). say you're using simple step function instead activation function. logically take 0 or 1 (but nothing in between), , output 0 or 1. so answer seems be: range of activations in net defined activation function used. my similar question.

c - How to tell `getchar()` to go back to the beginning of the buffer? -

i learning c "the c programming language" , have ran getchar() confuses me. apparently, when call getchar() in program, input text stored in buffer , getchar() reads characters in buffer 1 one until sees eof . possible me instruct getchar() perform process second time on same buffer? instance, second loop in following program not run me. possible "reset" getchar() after first loop? #include <stdio.h> int main() { int c,d; c = d = 0; while((c = getchar()) != eof) printf("foo"); while((d = getchar()) != eof) printf("bar"); } it's not getchar() buffered, terminal. once hit enter , terminal sends whole line typed at once program. program's point of view, there's no buffer, sat still ten seconds, typed whole sentence in blink. you can verify crafting loop getchar() 's, , outputs character received : output not interleaved input, appear once you've pressed enter . thus, if want reuse know bu

c - Portable method for getting ACL perms from acl_permset_t -

the posix.1e (draft) standard defines number of functions working acls (defined in sys/acl.h regardless of platform). see manpage overview of standard. 1 critical function, acl_get_perm , queries see whether acl_permset_t has particular permission ( acl_permset_t meant opaque type) defined linux-specific extension. sources (see here example) suggest acl_get_perm , or non-portable variant, acl_get_perm_np , defined on other systems, though standard doesn't require it. is there portable way query acl_permset_t given permission? all of code i've found online far 1 of following: skirts issue using acl_to_text function, defined in libacl , text representation of acl directly, without having inspect permissions directly (see, example, darwin's implementation of getfacl ) skirts issue setting permissions, not getting them (see, example, darwin's implementation of setfacl ) checks @ configuration time see whether 1 of acl_get_perm variants defined, , othe

javascript - Intersection point of two lines in leaflet -

i want intersection point of 2 polylines in leaflet. have 2 lines given below :- var latlng1 = l.latlng(-7.9375, 4.46354); var latlng2 = l.latlng(-7.96875, 16.11979); var latlongs1 = [ latlng1, latlng2 ]; var polyline1 = l.polyline(latlongs1, { color : 'red' }).addto(map); var latlng3 = l.latlng(-3.5625, 9.31719); var latlng4 = l.latlng(-12.125, 9.50469); var latlongs2 = [ latlng3, latlng4 ]; var polyline2 = l.polyline(latlongs2, { color : 'blue' }).addto(map); i can bounds , latlongs of endpoints of these lines. can't contiguous array of latlongs of line. there way ? if don't program logic, there small , easy use library called turf provides several geoprocessing algorithms. can use 1 of algorithms independent of rest of library. the lineintersects module want. var intersection = turf.lineintersect(polyline1.togeojson(), polyline2.togeojson()); var intersectioncoord = intersection.features[0].geometry.coordinates; also can ch

php - Selecting data from table using another table's data -

i'm building app stores data different types of products. here schema of products table:- ------------------------------------------------------------------------------------ | id | product_name | price | details | category_id | phone_ram | bike_mileage | ------------------------------------------------------------------------------------ here, id, product_name, price , details column applicable products. 'phone_ram' column applicable items under 'phone' category , 'bike_mileage' column applicable items under 'bike' category. here 'category' table:- ---------------------- | id | category_name | ---------------------- | 1 | phone | ---------------------- | 2 | bike | ---------------------- and here 'category_data' table stores name of data of category. ----------------------------------- | id | category_id | name_of_data | ----------------------------------- | 1 | 1 | phone_ram | ---

android - How to test my current activity after intent with Robotium -

i have tedious problem robotium. while test robotium, if gone secondactivity clicking button in firstactivity, robotium can checked secondactivity assertcurrentactivity() method. for instance activity opened, button clicked , b activity opened , assertcurrentactivity(b) returns true. hovewer; if applicaiton started in oncreate method in activity, b activity opened robotium can not checked assertcurrentactivity(b). says still current activity activity. mainactivity.class @override public void oncreate( bundle savedinstancestate ) { super.oncreate( savedinstancestate ); setcontentview( r.layout.activity_main ); selector(); sharedprefenceshelper.setapplaunched( true ); periodscount = periodlistordering.getallperiodsize(); if ( periodscount < 0 ) intentcalendaractivity(); replacenewfragment( entryfragment.newinstance( ), entrypage_fragment_tag ); } intentcalendaractivity() method send calendarac

excel - Pull Site Code from Location Name (VBA) -

so have customer need specific code isolated name of each location. have following formula have been manually editing, wondering if there way have possibly count characters in cell , pull codes new cell. example location name: mri-lenox hill radiology 150/14101 =right(a1,find("/",a1)-19) the code format 0123/01234 (3 4 characters in front of slash , 5 after) any in regard appreciated. thanks, justin hames you can use regex find , extract code cell value. example: with createobject("vbscript.regexp") .pattern = "\d{3,4}/\d{5}" if .test(range("a1")) range("b1") = .execute(range("a1"))(0) end if end this extract code a1 , place b1 . edit , respect comments: to run on range of cells: dim re set re = createobject("vbscript.regexp") re.pattern = "\d{3,4}/\d{5}" dim r range each r in range("a1:a100") if re.test(r) r.offset(0, 1) = re.execute(r)

java - Login dialog doesn't display welcome -

when enter username , password, , click on login button, welcome.java doesn't open, shows output message dialog box. doesn't open welcome.java . there no error in coding; neither coding nor connection. after login, welcome.java should open, doesn't open @ all. please help string path = "jdbc:mysql://localhost/"; string place = "hotel"; try { class.forname("com.mysql.jdbc.driver"); connection myconnection = drivermanager.getconnection(path + place, "root", ""); try { string = "select usertype usertable username=? , password=? "; preparedstatement mystatement = myconnection.preparestatement(a); mystatement.setstring(1, username.gettext()); mystatement.setstring(2, password.gettext()); resultset myresult; myresult = mystatement.executequery(); if (myresult.next()) { if (myresult.getstring("usertype").equals("

excel - Looping until blank column -

i putting vba code think needs loop. loops biggest weakness vba , need assistance. i have text file import excel spreadsheet. length of how many columns , rows , down vary day day. example today's file might have data in columns - h, tomorrow might : p. each typical row count around 200 mark, not long. in essence im trying make 1 long list in column data spread on multiple columns. im looking loop checks if column has data in it, if copies data bottom of data in column a. illustration purposes data goes out column g, copy b1, xl down, find first empty row in , paste, same c, stopping after column g. i hope i’ve been clear when writing this. in advance matt you first want loop on columns. loop column b lastcolumn (which there function for.) want loop through rows within column find first empty row, , substract 1 arrive @ last column data. if cells(row,col) = "" lastrowcopy = row -1 then want copy a1, , keep track of last row posted in. want h

How to add Global.asax page to asp.net 4.5 version in C#? -

i have put css , javascript files reference in aspx page bundle(global.asax )file in 2013(4.5 version) visual studio. how can it? try : bundles.add(new stylebundle("~/allstyles").includedirectory("~/images","img.css") .includedirectory("~/content","con.css") .include("~/styles.css")) in view page: <%: styles.render("~/allstyles") %> or bundles.add(new stylebundle("~/bundles/img").include("~/images/img.css")) bundles.add(new stylebundle("~/bundles/content").include("~/content/con.css")) bundles.add(new stylebundle("~/bundles/style").include("~/styles.css")) in view page: <%: styles.render("~/bundles/img","~/bundles/content","~/bundles/style") %> and remind must add in global.asax.cs file bundleconfig.registerbundles(bundletable.bund

logging - How to send host and application information to Loggly through winston-loggly in Node.js -

i'm using winston-loggly module in node app in order send logging information loggly. logger instantiated so: var logger = new(winston.logger)({ transports: [ new (winston.transports.console)({ level: 'debug' }), new (winston.transports.loggly)({ inputtoken: {token}, subdomain: {subdomain}, tags: ['winston-nodejs', 'logtag'], json:true, level: 'debug' }) ] }); on loggly account can see logs have been sent. want create source groups can filter out host , tags, , far i've gotten work when tags specified fro source group. when tried adding ip specified in "clienthost" of log messages the"host" field of source group, group stopped displaying results. i've looked through documentation see how send host , application information, couldn't find how through winston-loggly. source groups support syslog.host right now. http.clienthost isn't supported there yet

html - Contact Form Validation Issues -

i've been trying contact form validate , show required user i've been having issues getting of inputs behave. you can see here: http://denverbarr.com for reason placeholders aren't behaving correctly in have weird padding not set. , reason can't name input validate. here code i've been using: html code <div class="six col text-center" id="contact"> <div id="contactform"> <fieldset> <div class="row"> <div class="twelve col"> <input placeholder="name" id="user_name" name="user_name" required="true" size="30" type="text" value="">

swing - Java - jList sometimes not updating correctly? -

this code: defaultlistmodel modelplayers = (defaultlistmodel)game.window.jlistplayers.getmodel(); defaultlistmodel modelplayersgame = (defaultlistmodel)game.window.jlistplayersingame.getmodel(); modelplayers.clear(); modelplayersgame.clear(); for(string s : getplayersfromarray(p.content[0])) { modelplayers.addelement(s); modelplayersgame.addelement(s); } private string[] getplayersfromarray(string array) { return array.split(","); } sometimes content of list disappears , appears again (after update). i have checked p.content[0] contained player1, player2 should not problem.

javascript - Get Selected Value of Area Chart -

i'm having problems writing simple directive updates d3 area chart using angularjs. here demo this model: app.controller('chartcontroller', ['$scope' , 'chartservice', function ($scope, chartservice) { $scope.data = chartservice; }]); when select range using sub chart, want values of selected date in label or input. following code worked me. brush.extent() may

entity framework - EF union and count query -

i have sql command below,how can translate ef query? select sum(t1) ( select count(*) t1 products.[product] t t.txdate between '2015-06-01' , '2015-06-02' union select count(*) t1 products.[product_archive] t t.txdate between '2015-06-01' , '2015-06-02' union select count(*) t1 products.[product_cancel] t t.txdate between '2015-06-01' , '2015-06-02' ) m you can use concat extension combine results. var starttime = datetime.parse("2015-06-01"); var endtime = datetime.parse("2015-06-02"); var products = context.set<products>() .where(p => p.txdate >= starttime , p.txdate <= endtime); var archivedproducts = co

excel - .End(xlDown) selecting last nonblank cell incorrectly -

writing vba code copy dynamic range new worksheet. code supposed first define range range copied. starting in upper left hand corner of range begin, using range.end(xldown) find last entry. offset finds bottom right hand corner of range, , range set span upper left hand corner lower right hand corner. that's how supposed work, , how work verbatim sub, changes in variable names clarity. here's goes south. range.end(xldown) indicating last non-blank cell in column very, bottom cell on worksheet (like row 40,000 something). not true, last non-blank cell 3 rows down range looking at. thus, rather getting 4x5 size range, 1 spans entire height of sheet. have tried clearing formatting of column in case lingering, no avail. code below. sub copy_starters_tomaster() dim masterio worksheet, iows worksheet set masterio = worksheets("master io worksheet") set iows = worksheets("io worksheet") 'sets range cover vfds entered enclosure.

What orders to save a file by string AND variable? MATLAB -

i have loop goes through 7 elements in array , operation, , gets 'work' (name of variable) variable. want save work variable in form of 'work_#ofexperiment' (experiments 1 through 7) so have experiment 1, 2, 3, 4, 5, 6, 7 and array [stuff1,stuff2,stuff3,stuff4,stuff5,stuff6,stuff7]; for i=1:7 do stuff work = save work based on order of , name work_experiment# save('work_%s',work,experiment(i)) not working you need pass names of variables strings save function. save(sprintf('work_%d',i), 'work', 'experiment') with save function cannot partial saving experiment(i). once saved can partially update mat file using matfile function. ( http://www.mathworks.com/help/matlab/ref/matlab.io.matfile-class.html ). matobj = matfile('work_%s') matobj.properties.writable = true matobj.experiment(i) = newvalue;

excel vba - Vba code to Check file is the readonly -

please advise how check if file ready before opening it... below code used open file... myfilenamedir = "h:\shaikh_gaus\scratch\vba\book16.xlsx" workbooks.open filename:=myfilenamedir, updatelinks:=0 set ws1 = worksheets("students") ways check or change attributes: option explicit sub testfileattributes() const file_name string = "c:\test.txt" if isreadonly(file_name) msgbox "file read-only" if isopenasreadonly msgbox "file open read-only" makereadwrite file_name if not isreadonly(file_name) msgbox "file not read-only" end sub . public function isreadonly(byval fname string) boolean 'vbnormal = 0, vbreadonly = 1, vbhidden = 2, vbdirectory = 16 if len(fname) > 0 isreadonly = getattr(fname) , vbreadonly end function . public function isopenasreadonly(optional byref wb workbook = nothing) boolean if wb nothing set wb = activeworkbook isopenasread

javascript - Column method in protractor -

i can't find column method doing in docs. know it's doing? here code: var phonenamecolumn = element.all(by.repeater('phone in phones').column('phone.name')); var query = element(by.model('query')); function getnames() { return phonenamecolumn.map(function(elm) { return elm.gettext(); }); } query.sendkeys('tablet'); //let's narrow dataset make test assertions shorter expect(getnames()).toequal([ "motorola xoom\u2122 wi-fi", "motorola xoom\u2122" ]); column() convenience method columns repeater binding. if imagine table formed repeater, columns correspond model fields, rows - model instances. for example, if want book name elements repeater: element.all(by.repeater('book in library').column('book.name')); you can single book name element in specific row: element(by.repeater('book in library').row(0).column('book.name'));

Blurry text in chrome on < button> element related to css transform? -

Image
i using menu animated using transformation of < svg> element buttons on top of it. strangely text on buttons extremely blurred in chrome, while nice , crisp in other browsers have tested far. the blurry text not related < svg> element. (which first guess) if remove text still blurred. seems related < button> element. displaying text without being in < button> gives nice , crisp text in chrome. this css assigned button element: .grid figure button { top: 50%; left: 50%; border: medium none; background: #316ba8 none repeat scroll 0% 0%; color: #fff; opacity: 0; transform: translatey(-50%) translatex(-50%) scale(0.25); this transform takes place on hover: (when buttons blurry text come up) .grid div:hover figure button { opacity: 0.9; -webkit-transform: translatey(-50%) translatex(-50%) scale(1); transform: translatey(-50%) translatex(-50%) scale(1); } i have found other posts relating blurry text in browsers (not chrome) css transformation haven

javascript - on click apply class with different css properties -

i trying apply class on click li of div . this js have. $(document).ready(function() { $('#toggleme').click(function() { $(this1).addclass('active_class'); }); }); now when click @ cart, want change cart image. i trying via css applying class background-image:url(""); property. reason not able working. here's fiddle please help. change js code this: $(document).ready(function () { var img=0; $('#toggleme').click(function () { $(this).toggleclass('active_class'); if(img==0){ $(this).find("img").attr("src", 'http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/simple-red-glossy-icons-business/086707-simple-red-glossy-icon-business-cart5.png'); img=1; }else{ $(this).find("img").attr("src", 'http://www.daru-koi.com/images/winkelwagen.png'); img=0;

nightwatch.js - How to get child elements using NightwatchJs -

how can child element of dropdown using nightwatch js. here code <ul id="ddemp" class="ng-scope"> <li class="ng-scope active">emp 1</li> <li class="ng-scope">emp 2</li> <li class="ng-scope">emp 3</li> </ul> i want "emp 3". you can use nth-child() css selector. in case ul#ddemp li:nth-child(3) you can use xpath , text in li: .usexpath().click('//li[text()="emp 3"]')

Visual Studio - custom menu -

i've got powershell scripts need run time time. have custom menu few items each run command. have create menu dynamically (the best - when vs run). possible achieve that? should read achieve that? maybe there external libraries allow me that? edit: dynamically becouse need external programm feed visual studio items need , script should run.

angularjs - Back button should take to parent route -

i making angularjs app using cordova problem when press button traces path have followed. ex. have made homepage session homepage , inside session homepage there session1, sesion2......session5etc. problem if move homepage session homepage , session1 , after session2 on pressing button goto session1 instead of going session homepage. how rid of it, should make directive or there other method you don't want "back" button. button says - go previous page. if wish go specific page, need explicitly specify link page. cannot call going "back" - intend go specific page. <a href="/#/main-session-page">back session page</a>

java - Hibernate eager loading not fetching all child rows -

hibernate version 4.3.10 i have parent/child relationship described in example. there occasions when expect 1 row returned when querying provider. in case, limit criteria calling setmaxresults method 1. dump of sql revealed hibernate makes outer join calls ends returning more 1 row, because of limit set on criteria, first child row read database. @entity @table(name = "f_provider") public class provider { @onetomany(cascade = cascadetype.all, mappedby = "provider", orphanremoval = true, fetch = fetchtype.eager) private final set<credentialfielddefinition> credentialfielddefinitionlist; } @entity @table(name = "f_cred_fields", uniqueconstraints = { @uniqueconstraint(columnnames = { "name", "provider_id" }) }) public class credentialfielddefinition { @manytoone(targetentity = provider.class, optional = false) @joincolumn(name = "provider_id", nullable = false, unique = false)

javascript - Images not loading in chrome -

for small project doing, creating masonry style picture board using css3 column count. works , creates 4 columns want use. my problem is images populate cards render in 1st column. in rest, their, , if click , drag or right click provides image url/the thumbnail . in firefox , internet explorer renders correctly , images show in every column, not on chrome. the html pictures below: <div class="col s12 masonry"> <div class="masonryitem card" ng-repeat="photo in recentphotos"> <div class="card-image"> <img ng-src="assets/images/photos/{{photo.filename}}"> <span class="card-title" ng-hide="photo.editing">{{photo.name}}</span> <input class="card-title" title="title" type="text" ng-model="photo.name" ng-show="photo.editing" ng-blur="updatephoto(photo)" autofocu

mongodb grouping and subgrouping with java driver -

i need query mongodb db in such way kind of data hierarchy grouping field1 , field2 . shell can run following: db.collection.aggregate([{'$group': {'count': {'$sum': 1}, '_id': {'field1': '$field1', 'field2': '$field2'}}}]) does did same java? it better if provide sample document. you can convert query mongo-java driver following: dbcollection collection = db.getcollection("collectionname"); dbobject groupfieldsinid = new basicdbobject(); groupfieldsinid.put( "field1", "$field1"); groupfieldsinid.put( "field2", "$field2"); dbobject groupfields = new basicdbobject( "_id", groupfieldsinid); groupfields.put("count", new basicdbobject( "$sum", 1)); dbobject group = new basicdbobject("$group", groupfields ); aggregationoutput output = collection.aggregate(group);

python - CX_Freeze - Error while loading shared object from library.zip: not a directory -

i bundling graphical application cx_freeze ubuntu 14, , added dependency on cefpython3. installed package deb file, , software runs fine command line ( python (name-of-program).pyw ). i made sure package included adding packages = ["cefpython3"] to setup.py. complained not find (path-to-folder)/library.zip/cefpython3/libcef.so so added zip via zip_includes=[("/usr/lib/pymodules/python2.7/cefpython3/libcef.so","cefpython3/libcef.so") and if open library.zip find libcef.so inside cefpython3 , should. but when run, complains not directory: oserror: (path-to-folder)/library.zip/cefpython3/libcef.so: cannot open shared object file: not directory i tried adding libcef.so otherwise via bin_include , include_files , still tries open in library.zip , , fails when cannot. what doing wrong?

single backslash needed in SQL Server query from Python / SQLAlchemy -

i trying write query using bulk insert function in sql server 2014 via python script insert large csv file table in database. have following example code: import pymssql import sqlalchemy engine = create_engine('connection_string_goes_here', encoding="utf-8") table_name = 'my_table' source_path = 'c:\path\to\csv\test.csv' q = ("bulk insert " + table_name + " " + "from '" + source_path + "' " + "with ( datafiletype = 'char', " + "fieldterminator = ',', " + "rowterminator = '\\n')") connection = engine.connect() connection.execute(q) connection.close() the error is: (pymssql.operationalerror) (4861, cannot bulk load because file "c:\\path\\to\\csv\\test.csv" not opened. operating system error code 3(the system cannot find path specified.).db-lib error message 20018… i believe because of double backslash issue.

c# - Listen for cmd output and log to file -

i'm trying make c# program can listen , output cmd.exe , log file. example, if run exe , runs command in cmd echo "hello" , want echo "hello" written in file. i know need use filesystem , process maybe? if possible, , appreciated. thanks. here's quick little example should work. there lot of examples out there, i'll try looking on stackoverflow , post 1 well... string cmd_to_run = "dir"; // whatever you'd be... // set our initial parameters out process processstartinfo p_info = new processstartinfo(); p_info.filename = "cmd"; p_info.arguments = "/c " + cmd_to_run; p_info.useshellexecute = false; // instantiate new process process p_to_run = new process(); p_to_run.startinfo = p_info; // wait exit (i chose 120 seconds) // waiting output here not asynchronous, depending on task may want p_to_run.start(); p_to_run.waitforexit(120 * 1000); strin

What type of HTML, javascript, or web page source code would cause Adblock to not render a page when using Google Chrome? -

i'm experiencing interesting issue google chrome , adblock (not adblock plus) preventing web pages rendering altogether. when try view page http://inkthemes.com/wptheme/classicraft/ad/black-bmw-z4-red-leather-seats-convertible/ .. in chrome adblock 2.36.2 enabled, page comes blank. but, clicking on view source can see code fine. particular demo site home page , listing page work fine. every single content page comes white. if disable extension works fine. i'm thinking somewhere there type of class or id keyword that's triggering it, cause entire page go blank (and not container class)? could related doctype? causing this? this link extension i'm using. https://chrome.google.com/webstore/detail/adblock/gighmmpiobklfepjocnamgkkbiglidom?hl=en the issue single-ad class name present on body tag. assuming intended author, appears naming collision style declarations used adblock. otherwise there other reason adblock interpreting entire body adve

c++ - QSignalMapper does not update parameter after choosing file -

i'm making application able program board. select file via file dialog , upload board selected file upload button. have 2 class it: myfiledialog , commandprocess. connected upload button clicked signal signal mapper , mapped commandprocess::startprocess slot, executes process path of selected file path incorrect if don't indicate on start of program. how can update mapping parameter after choose file? part of main.cpp code: qobject *uploadbutton = mainform->findchild<qobject*>("uploadbutton"); qsignalmapper mapper; consoleprocess proc; myfiledialog mfd; qobject::connect(filebutton, signal(clicked()), &mfd, slot(openmyfiledialog())); qobject::connect(uploadbutton, signal(clicked()), &mapper, slot(map())); mapper.setmapping(uploadbutton, mfd.getfilename()); qobject::connect(&mapper, signal(mapped(const qstring &)),&proc, slot(startprocess(const qstring &))); myfiledialog class: public: myfiledialog(); qstring getfi

oracle - Having trouble debugging a Java/DB error where data is being put into wrong record -

this happens infrequently , unable reproduce problem because of it. running jave ee web app on weblogic oracle backend. store pdf records in database blobs. happening sometimes--very rarely--when pdf blob being saved, being saved wrong user's row. not has original user's pdf not been saved, user's pdf has been overwritten wrong information! stored procedure called update/insert table. does seem might session-related error? records in pdf table have unique id serves primary key. pk referenced when adding or updating row in pdf table. can make operation more thread-safe? assume happening because multiple users updating @ same time , somehow uids mixed up. said, happens , haven't been able reproduce or find easy solution while looking @ source code. on right track? suggestions?

android - Ionic nav-view and external resource -

i'm trying display video within application. i've created link such: <a href="movie/my_movie.mp4">start movie</a> everything fine , video spins up, when push button nav state resetted , have restart app in order "main" page of app. there trick maintain nav state when starting video? yes there trick can use below code in button listener below example reference can adjust getting status of media player mediaplayer.isplaying() final mediaplayer mp1 = mediaplayer.create(playaudioactivity.this, r.raw.beet); mbackbtn.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if (mp1.isplaying()) { }else{ finish(); } } });

What is Nutch 1.10 crawl command for elasticsearch -

using nutch 1.10 (newbie), trying learn how crawl using nutch 1.10 , using elasticsearch indexer. not sure why, can not crawl command work: bin/crawl -i --elastic -d elastic.server.url=http://localhost:9200/elastic/ urls elastictestcrawl 1 update: used bin/crawl -i -d elastic.server.url=http://localhost:9200/elastic/ urls/ elastictestcrawl/ 2 --almost succesfully, received following error when came indexing part of command: error running: /home/david/apache-nutch-1.10/bin/nutch clean -delastic.server.url=http://localhost:9200/elastic/ elastictestcrawl//crawldb failed exit value 255. what exit value 255 nutch 1.x? , why space deleted between "-d , elastic..." i have these elasticsearch properties here in nutch-site.xml file: if can point error of ways, great! update posted own answer below, second one. had accepted first answer months ago when got working. answer more clear , concise make easier (and quicker) started nutch. unfortunately can

android - Cursor Loaders filtering, old data shown in for a split second -

i have weird behavior in app i'm struggling understand. have 2 lists (a & b), initial view list textbox on top filters results of list b. i use cursor loaders, adapters , listview implement these 2 lists. when user enters keyword search, restart loader b entered keyword , load adapter , set listview display adapter b. everything runs fine but instead of displaying results right away, wrong behavior happens: full list b shown split second, filtered results shows. of course creates bad ux (user experience), want achieve here filtered results shown right away without split second view of full list b. i want understand why behavior occurring... after implementation style of querying 1 used in official example of cursor loaders :) the code big these relevant parts: ontextchange produces bad behaviour: @override public void ontextchanged(charsequence s, int start, int before, int count) { getloadermanager().restartloader(loader_id_2, null, this); } these curs

Retrieving Max value(select query) from MySQL using PHPSECLIB -

i able connect remote server , mysql tables using phpseclib. unable fetch max value of column , try insert table. output getting max(test_id) 1 . not sure might going wrong? $value = $ssh->exec("mysql -h localhost -u root -pxxxx dbname -e \"select max(test_id) cpu_util_all;\""); echo "$value"; - output : max(test_id) 1 echo $ssh->exec("mysql -h localhost -u root -pxxxx dbname -e \"insert test_execution (test_id) values ('$value');\"");

updating a table using the max date and values from another table using sql in ms-access -

i have following scenario: want update tableb using rating tablea . challenge is: ratings change randomly , when updating tableb's records, have take in account date of match , if rating changed let's on tuesday , game on monday before, want rating previous rating not latest one. #table a: contains rating of players, changes randomly @ date depending #on drop of form players pid| rating | datechange | 1 | 2 | 10-may-2014 | 1 | 4 | 20-may-2015 | 1 | 20 | 1-june-2015 | 2 | 4 | 1-april-2014| 3 | 4 | 5-april-2014| 2 | 3 | 3-may-2015 | #table b: contains match sheets. every player has different match sheet #and plays different dates. msid | pid | matchdate | win | rating | 1 | 2 | 10-may-2014 | no | 0 | 2 | 1 | 15-may-2015 | yes | 0 | 3 | 3 | 10-apr-2014 | no | 0 | 4 | 1 | 21-apr-2015 | yes | 0 | 5 | 1 | 3-june-2015 | yes | 0 | 6 | 2 | 5-may-2015 | no | 0

ios - Best place to set cornerRadius based on UIButton size in subclass? -

so having few different rounded buttons within app (all way circular buttons), , can tell, easiest way achieve set cornerradius property of buttons calayer. however, don't want doing manually every button requires in every controller, thought simple subclass sets on init way. i using storyboard , autolayout position , size buttons, , assigning them subclass. class roundedbutton: uibutton { required init(coder adecoder: nscoder) { super.init(coder: adecoder) self.layer.cornerradius = self.bounds.size.height / 2.0 self.clipstobounds = true nslog("button bounds: h-%f w-%f", self.bounds.size.height, self.bounds.size.width) nslog("button frame: h-%f w-%f", self.frame.height, self.frame.width) } } but have come find out @ point (i.e. init), size of neither frame nor bounds final. button in storyboard sized (and constrained) h40 x w40, bounds/frame sizes showing h30 x w38. this means cornerradius doesn

How to get conditional input in java? -

i want enter 2 numbers csv , cr. condition that: if csv positive, cr can positive or negative. if csv negative, cr cannot positive how can this? scanner scanner = new scanner(system.in); system.out.print("csv: "); double csv = scanner.nextdouble(); system.out.print("cr: "); double cr = scanner.nextdouble(); if (csv < 0.0) { while (cr > 0.0) { system.out.println("cr cannot positive since csv negative."); system.out.print("cr: "); cr = scanner.nextdouble(); } }

Proxy websockets connection within webpack-dev-server -

is possible proxy websocket connections within webpack dev server? know how proxy regular http requests backend it's not working websockets, presumably because target in proxy configuration starts http://... version 1.15.0 of webpack-dev-server supports proxying websocket connections. add following configuration: devserver: { proxy: { '/api': { target: 'ws://[address]:[port]', ws: true }, }, }

DropNet returning metadata for root folder not folder requested -

problem: getmetadata folder need returns root folder metadata. background: i'm trying write small app download folder large (many thousand files , multiple gb) download dropbox web interface. tries recurse through subdirectories of directory given, downloading files. what happens endless loop. app (incorrectly) gets root folder metadata, iterates through directories until hits directory need , starts working through root directory metadata set receives. the directory name "/apps" works fine 1 need doesn't. folder name has underscore , mix of upper , lower case letters (no other characters) similar "/xyx_datafolder". my app has "full dropbox" permission , authorized account api key acquired under. changing directory name not option me. i'm using vs2012 , dropnet added through nuget. any input on issue welcome. thanks! edit: runtime version v4.0.30319 version 1.10.23.0 as reported in visual studio properties page reference

python - Rename a file with a pattern -

i have filename looks er-log-0.0.1-20150807.194034-8.jar the format follows artifactid-version-timestamp.jar i want rename artifactid.jar . i tried >>> fname = "er-log-0.0.1-20150807.194034-8.jar" >>> import os >>> os.rename("er-log*", "er-log.jar") traceback (most recent call last): file "<stdin>", line 1, in <module> oserror: [errno 2] no such file or directory the file in current directory though you need glob if want find files using shell wildcard: import os glob import glob path = "/path_to_files" f = glob(os.path.join(path,"er-log*"))[0] os.rename(f, os.path.join(path,"er-log.jar")) using "er-log*" os.rename, python looking file called "er-log*" . if run code same directory, don't need join path, os.rename(f, "er-log.jar")

c - How to check if variable is Scalar or Array before mxIsScalar was introduced? -

in matlab's mex files there function mxisscalar tells if input mex files scalar or not. function has been introduced in r2015a. if using previous version of matlab (2014b in case, if matters), elegant way of checking if input scalar or array? do need combine mxgetnumberofdimensions , mxgetdimensions , mxisnumeric it? or there other clear , simple way of doing it? favor readability on speed. mrows = mxgetm(prhs[0]); ncols = mxgetn(prhs[0]); if (mrows==1 && ncols==1) { // scalar prhs[0] here } note that, if prhs[0] has more 2 dimensions n, mxgetn result of product of dimensions 2 ... n. mxgetm return first dimension. may not check sparse matrices these may not return actual number of elements in matrix. a full example mex file can found @ http://www.mathworks.com/help/matlab/matlab_external/passing-a-scalar_btgcjh1-1.html .

ios - Change 'Return' button function to 'Done' in swift in UITextView -

i rid of "return" function of keyboard while user typing, there no new lines, instead 'return' key function 'done' hide keyboard. i using uitextview, editable, user able type post, , post main timeline, since have fixed cells, don't want user able press 'return' , post out of range of timeline. i found works uitextfield, not uitextview: func textfieldshouldreturn(textfield: uitextfield!) -> bool { textfield.resignfirstresponder() //if desired return true } so wanted know if there way in uitextview, or @ least able hide keyboard if pressed return, instead of creating new line. you can set return key type of text field: textfield.returnkeytype = uireturnkeytype.done update can use same approach set return key "done", mentioned above. however, uitextview doesn't provide callback when user hits return key. workaround, can try handle textview(textview: uitextview, shouldchangetextinrange range: nsrange

c# - Extract property of object from entity framework query -

i'm new ef , i'm having trouble doing simplest thing... public class person : dto { public string id { get; set; } public string fname { get; set; } public string lname{ get; set; } } i use either iqueryable<person> or objectreuslt<person> extract fname object. peopleentities entities = new peopleentities(); string querystr = "select value c peopleentity.person c c.id=" + personid; iqueryable<entityobject> query = entities.createquery<entityobject>(querystr); i see createquery can both return iqueryable , objectresult . i'd know whats lightest way can extract fnames list query result. i'm interpreting question "get first name of provided personid". assuming peopleentities contains dbset<person> person following: public string getfirstnameforperon(string personid) { peopleentities entities = new peopleentities(); // new ef context return entities .person // pe

networking - Plot 2D topographic map of EEG node network on MATLAB -

i plot topographic map eeg network. electrodes (nodes) have associated networks metric , these values want interpolate between them , plot in head shape. here code have reseached , result getting... ========================================= %the position x , y integers (electrodes position) , value of z (network metric) x = [36 51 66 11 22 51 79 91 3 16 51 86 99 1 14 51 88 101 3 16 51 86 99 11 22 51 79 91 36 51 66]; y = [99 101 99 80 85 87 85 80 66 69 70 69 66 51 51 51 51 51 36 33 32 33 36 22 17 15 17 22 3 1 3]; z = [-404 -566 -379 -71 -102 -119 -87 9 -62 -160 -104 -81 -26 12 -120 -176 -85 -13 0 -118 -288 -159 -36 -115 -145 -292 -215 -266 -235 -364 -192]; %making meshgrid dd = 1:31 i(xd(dd),yd(dd))=zd(dd); end zd = [zd; zeros(70,1)]; xd = [xd; zeros(70,1)]; yd = [yd; zeros(70,1)]; [xx,yy] = meshgrid(1:101,1:101); z = griddata(xd,yd,zd,x

java - Selecting innermost child of an element Jsoup -

i attempting scrape following html: <table> <tr> <td class="cellright" style="cursor:pointer;"> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td class="cellright" style="border:0;color:#0066cc;" title="view summary" width="70%">92%</td> <td class="cellright" style="border:0;" width="30%"> </td> </tr> </table> </td> </tr> <tr class="listroweven"> <td class="cellleft" nowrap><span class="categorytab" onclick= "showassignmentsbympandcourse('08/03/2015','58100:6');" title= "display assignments art 5 ms. martinho&

node.js - Initializing jquery from Node -

i creating new project using following: $mkdir x $cd x $npm install jquery then create new app.js file: var http = require('http'); var $ = require('jquery'); console.log("http="+ http); console.log("$="+ $); console.log("$.getjson="+ $.getjson); output is: http=[object object] $=function ( w ) {...} $.getjson=undefined why $.getjson undefined ? using latest io.js v2.4.0. you trying create xhr within node.js. not going work since node.js javascript runtime , not same browser. if want fetch somewhere on http protocol, can use request . example (from official docs): var request = require('request'); request('http://www.google.com', function (error, response, body) { if (!error && response.statuscode == 200) { console.log(body) // show html google homepage. } }) you can take @ this answer (also me) more information on using jquery in combination node.js. update[d again!]: s