Posts

Showing posts from September, 2010

javascript - AJAX on Android Webview: Should I use JSON or HTML? -

i building feed application infinite scroll inside native android application using webview. first tried ionic framework disappointed performance. i thinking of developing in pure jquery , responsive html/css achieve superior performance. 1 thing considering weather emit html or json server side apis. emitting json means client side dom manipulation can again hurt performance. looking maximum performance. whereas, not sure emitting html idea better maintainability of application. what guys recommend? injecting json should better solution. in case manipulation or operation on data required in later phase of development. possible security issue.you mixing control(tags) , data. preventing inline script execution can protect against attacks extend. this said if implemented , right reasons html might not total bad choice. but, performance over-head might not right reason. again haven't tested confirm this. you can have @ this question.

Data validation - Drop down list with no duplicates in excel -

Image
could please assist me removing duplicates in drop down list . list not static. example: before james peter james nick peter after james peter nick i not sure formula use data validation formula box. i had attempted below, no success: =offset($c$13,0,0,countif(c:c,"?*")-1) step 1 - original names in column a, put array formula¹ somewhere off right in second row. i'll use z2. =iferror(index(a$2:index(a:a, match("zzz",a:a )), match(0, countif(z$1:z1, a$2:index(a:a, match("zzz",a:a ))&""), 0)), "") fill down until run out of names , few more rows allow future expansion. step 2 - go formulas ► defined names ► name manager , create new name. name: listnames scope: workbook refers to: =sheet2!$z$2:index(sheet2!$z:$z, match("zzz", if(len(sheet2!x:x), sheet2!$z1:$z98) )) step 3 - go cell want data validation , use data ► data tools ► data validation. allow: list source: listnames     

Python regex to find multiple consecutive punctuations -

i streaming plain text records via mapreduce , need check each plain text record 2 or more consecutive punctuation symbols. 12 symbols need check are: -/\()!"+,'&. . i have tried translating punctuation list array this: punctuation = [r'-', r'/', r'\\', r'\(', r'\)', r'!', r'"', r'\+', r',', r"'", r'&', r'\.'] i can find individual characters nested loops, example: for t in test_cases: print t p in punctuation: print p if re.search(p, t): print 'found match!', p, t else: print 'no match' however, single backslash character not found when test , don't know how results 2 or more consecutive occurrences in row. i've read need use + symbol, don't know correct syntax use this. here test cases: the quick '''brown fox &&quick brown fox quick\brown fox q

Display php result after html -

i have form people can search database user. when search user , click submit, they're re-directed different page , results displayed. my issue results being displayed before required html tags - here's example of page looks through inspect element: "bobby123 " <!doctype html> <html> <body> </body> </html> how display results after required html tags? how set "set place" results displayed? here's code: <?php if(isset($_post['submit'])) { $term = $_post['search']; $searchuser = $stmt = $con->prepare("select * users username :term"); $stmt->bindvalue(':term', '%'.$term.'%'); $stmt->execute(); if($searchuser->rowcount() > 0) { while($row = $searchuser->fetch()){ $name = $row['username']; echo $name; } }else{ echo 'no results'; } } ?> <form metho

string - Longest substring of repeated characters -

i have assignment school in which, given input string of entirely 0's , 1's, must return length of longest substring of repeated 1's. not allowed use having trouble fleshing out idea. far have found length of input string , converted input string uint8. way can use find find indices of ones. next thought sort of loop store indices, or maybe check length of each subset , save longest one? i'm not sure how go part or if right way think it. guidance appreciated. you can use regular expressions this: [s,e] = regexp(inputstring,'(1+)'); maximumsequencelength = max(e-s+1); if want find longest substring of character, use following dynamic regular expression, says: "take character. match many of character possible" [s,e] = regexp(inputstring,'(.)((??$1*))'); inputstring(s) returns first element of each substring.

Java File runs in eclipse but on command line -

i have created jar file in eclipse using maven , able run class jar file eclipse. when run following command command prompt: c:\recomendation_engine\recomendation\target>java -classpath recomendation-0.0.1 -snapshot.jar recomendation.managegeneralcontent test i following error: organization environment test java.lang.classnotfoundexception: com.mysql.jdbc.driver @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ java.lang.class.forname0(native method) @ java.lang.class.forname(unknown source) @ recomendation.managegeneralcontent.main(managegeneralcontent.java:52) i believe issu

datetime - Python not writing to file -

i'm making script reads through .txt file , proceeds use information, , date, create dynamic html files. worked yesterday, today, seems doesn't want write file... here source code. from __future__ import print_function import httplib2 import os import io import shutil import datetime import random import re apiclient.http import mediaiobaseupload, mediaiobasedownload datetime import date apiclient import discovery import oauth2client oauth2client import client oauth2client import tools def filerino(): daginfo = str(datetime.datetime.today().weekday()) ukenr = (datetime.datetime.today().isocalendar()[1]) dato = datetime.date.today() day = datetime.date.today().day month = datetime.date.today().month yesterday = (day - 1) tomorrow = (day +1) todayerino = str(day) + "/" + str(month) yesterdayerino = str(yesterday) + "/" + str(month) tomorrowerino = str(tomorrow) + "/&quo

cron - Symfony ExcelBundle in Command -

i'll try like: <?php namespace exportbundle\command; use symfony\bundle\frameworkbundle\command\containerawarecommand; use symfony\component\console\command\command; use symfony\component\console\input\inputargument; use symfony\component\console\input\inputinterface; use symfony\component\console\input\inputoption; use symfony\component\console\output\outputinterface; use symfony\component\httpfoundation\responseheaderbag; // extending containerawarecommand can have access $container // can see how it's used in method execute class hellocommand extends containerawarecommand { // method used register command name, arguments requires (if needed) protected function configure() { // register optional argument here. more below: $this->setname('hello:world') ->addargument('name', inputargument::optional); } // method called once command being called fron console. // $input - can access arguments passe

javascript - How to properly abstract console.log color variables with messages -

i want abstract console.log() message variable. here code: i utilizing console.log color messages. console.log("%c scenario 1.0:" + "%c [street number] + [direction] + [street name] + [suffix] + else", console.colors.bold.yellow, console.colors.white); which results in scenario 1.0: (in bold , yellow) [street number] + [direction] + [street name] + [suffix] + else (normal , white) console.colors = { "gray": "color: #1b2b34;", "red": "color: #db4c4c;", "orange": "color: #f99157;", "yellow": "color: #bada55;", "green": "color: #99c794;", "teal": "color: #5fb3b3;", "blue": "color: #6699cc;", "purple": "color: #c594c5;", "black": "color: #000000;", "white": "color: #ffffff;", "brown": "color: #ab796

how to create a folder in php and limit the upload in that folder -

i want set limit on folder being created user: according script below: $root = "/users/homedir/"; if (!is_dir($root)) { @mkdir("users/homedir/", 0777); the folder homedir should contain max 20 mb of storage. if reached, user can not upload folder anymore. how can set 20 mb limit folder when created? you can't set limit @ time of creation, can check directory size along size of file being uploaded, , limit based on values.

sql server - Allow user to skip a multi-value and use non-query list parameter in SSRS 2008 -

i want able use or not use "allow multiple values" parameter. far, i've found how add "blank" or "null" parameter default, pulls values blank or null result set, doesn't allow me skip parameter. also, use shared dataset, not stored procedure, , can not use specified query list (there on 2.8m records), need allow users type list manually in text box or skip entirely. i try anything, long data values manually entered or can skipped. thanks can offer. i hope more detail generate idea. working in medical environment, developing series of reports users choose requesting provider information, or physician information, never both @ same time. i tried suggestion, setting providernpi parameter properties default specified to: ="noentry" , edit query add: (fieldprovidernpi in (@providernpi) or @providernpi = 'noentry'). to run report, entered 1 week in date range parameters, entered valid physiciannpi number in @physiciannp

c++ - QtWebEngine - procedure not found -

i have simple c++ (non qt quick) application (that not use .pro mechanism) built against official qt 5.4.2 x64 build (with opengl support). use qwebengineview object in application, fails load message "specified procedure not found". with of gflags, seems fails find following demangled procedure: public: __cdecl qopenglwidget::qopenglwidget(class qwidget * __ptr64,class qflags<enum qt::windowtype>) __ptr64 i not sure understand why cannot found, have put sake of testing dlls in qt_dir\bin next application, , plug-ins. preprocessor list use build app follow: win32;_debug;_windows;_usrdll;win64;qt_webenginewidgets_lib;qt_webengine_lib;qt_quick_lib;qt_printsupport_lib;qt_widgets_lib;qt_gui_lib;qt_qml_lib;qt_network_lib;qt_uitools_lib;qt_core_lib;win32project5_exports;plugin_vendor_name="$(vendorname)";plugin_version="$(pluginversion)";plugin_name="$(pluginname)";%(preprocessordefinitions) and input libraries: qt5cored.lib;qt5gu

mule - Dataweave key value set from database to HashMap -

my flow goes this: i receive payload following: ['bobsfirststatus', 'bobssecondstatus', 'bobseightstatus'] and have lookup table in database so: id_|_bobstatusname___|_internalstatusname_____ 1 | bobsfirststatus | internal_1ststatus 2 | bobssecondstatus| internal_2ndstatus 3 | bobseighstatus | internal_3rdstatus i want read data database, , load hashmap so: { "bobsfirststatus": "internal_1ststatus", "bobssecondstatus": "internal_2ndstatus", "bobseighstatus": "internal_3rdstatus" } this way, can in data weave statement can "flowvars.lookup[payload.bobstatus]" retrieve our internal mapping of status. anyone done before? seems useful... solid plan, although don't doing in flow variable. can make lookup flow, , call dwl like so . you'll want use cache scope avoid doing every time. i have done in spring bean before too, , i'm happy final result.

c++ - Copy text to Clipboard in MFC -

i tried make quick method set clipboard text in mfc, not work. void copytexttoclipboard( cstring strtext) { if (openclipboard(getframe()->getsafehwnd())) { emptyclipboard() ; setclipboarddata (cf_text, strtext.getbuffer() ) ; closeclipboard () ; } } i 'windows breakpoint' error @ 'setclipboarddata'. know might have done wrong? edit: comment. modfied. fails at: memcopy function. void copytexttoclipboard( cstring strtext) { if (openclipboard(getframe()->getsafehwnd())) { hglobal hglbcopy; lptstr lptstrcopy; hglbcopy = globalalloc(gmem_moveable, (strtext.getlength() + 1) * sizeof(tchar)); if (hglbcopy == null) { closeclipboard(); return ; } memcpy(globallock(hglbcopy), &strtext, strtext.getlength() + 1 * sizeof(tchar)); globalunlock(hglbcopy); setclipboarddata(cf_text, hglbcopy); emptyclipboard() ; setclipboarddata (cf_text, strtext

javascript - Selecting nested elements -

i have page hierarchy this: <div class="panel" attribute-id="1"> <button class="delete"> <div class="panel" attribute-id="2" association-id="20"> <button class="delete"> </div> </div> .... so have bunch of these panels nested panels inside, , i'm trying create on on click handler delete buttons of top level panels (so ones inside panels not have association id). different between parent , child panels child ones have attribute "association-id". so can select top level panels so: $('.panel[attribute-id]:not([association-id]') but if try delete buttons from these like: $('.panel[attribute-id]:not([association-id] .delete') obviously i'm still going child buttons. i can't modify html in anyway, how go doing this? $(':not(.panel[attribute-id][association-id]) > .delete') seems trick. jsfiddle

permissions - Run playbook on servers with shared NFS mount -

i have following ansible playbook package updates across cluster: - hosts: cluster become: true become_user: root tasks: - name: updates server apt: update_cache=yes - name: upgrade server apt: upgrade=full when run it, node nfs controller executes fine, 2 nodes have nfs mount on home directory fails following error: $ansible-playbook upgrade-servers.yml -k sudo password: play *************************************************************************** task [setup] ******************************************************************* fatal: [nej-worker2]: failed! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "\r\n/usr/bin/python: can't open file '/home/gms/.ansible/tmp/ansible-tmp-1461269057.4-144211747884693/setup': [errno 13] permission denied\r\n", "msg": "module failure", "parsed": false} ok: [iznej] fatal: [nej-worke

phpunit - Magento 2 dependency injection preferences in unit tests -

i wondering why dependency injection preferences specified in di.xml not being read magento\testframework\helper\bootstrap provided magento. have found workaround providing direct configuration setup it: bootstrap::getobjectmanager()->configure( [ 'preferences' => [ 'example\coreinterface' => 'example\core' ] ] ); unfortunately it's not di.xml rewrite prone, 1 day rewrite di.xml preference , break tests. nice load di.xml upon bootstrap of tests. there better way of loading interface preference rewrites?

angularjs - Morris Chart with angular and dynamic data -

i need area chart using angular directive , data fetched database problem after fetching data ,chart not appear , when use static data chart appears fine.and chart update after 10 seconds requirement. var myapp=angular.module('myapp',['ngroute']); myapp.controller('graphcontroller', function(datafactory,$scope,$http,$timeout){ var getdata=function() { datafactory.httprequest('/graph').then(function (data) { console.log(json.stringify(data)); $scope.mymodel=json.stringify(data); $timeout(getdata, 1000); }); } $scope.xkey = 'id'; $scope.ykeys = ['id', 'value']; $scope.labels = ['id', 'value']; $timeout(getdata, 1000); /* static data , when these static data use in getdata function ,it didnot work. $s

powershell - How to show properly a balloontip? -

Image
i'm writing cleaner known virus key ( "vbs" ,"vbe" ,"wsf", "a3x") registry. i want add balloontip in powershell script but, there wrong ! i don't know how remove icon taskbar show progress scan ? this draft. not yet optimized ! @echo off title hackoo virus cleaner delete virus key registry hackoo 2016 color 1a & mode con cols=80 lines=8 set pattern="\.vbs"^ ^ "\.vbe"^ ^ "\.wsf"^ ^ "\.a3x"^ ^ "vbscript.encode"^ ^ "\winlogon\.bat" set key="hklm\software\microsoft\windows\currentversion\run"^ ^ "hkcu\software\microsoft\windows\currentversion\run"^ ^ "hklm\software\microsoft\windows nt\currentversion\winlogon"^ ^ "hklm\software\microsoft\windows nt\currentversion\image file execution options" %%p in (%pattern%) ( %%k in (%key%) ( cls echo( echo( echo ******

visual studio - Code to search/filter data in a data grid view in VS C# not working as expected -

this tutorial i'm using: https://www.youtube.com/watch?v=v6nnrixn6dy and here relevant code: private void textbox1_textchanged(object sender, eventargs e) { dataview dv = new dataview(senior_playersdatatable); dv.rowfilter = string.format("first_name '%{0}%'", textbox1.text); senior_playersdatagridview.datasource = dv; } my datatable called "senior_playersdatatable" my datagridview called "senior_playersdatagridview" the column called "first_name" the gist of tutorial declare relevant datatable globally, create dataview , filter text entered textbox, set data source new, filtered, gridview. the problem typing text box hides data , rows. them emptying text box not bring them back. ideas i'm going wrong? additionally, if wanted search more 1 column @ time single text box, simple repeating dv.rowfilter line so? { dataview dv = new dataview(senior_playersdatatable); dv.rowfilter = string.fo

wpf - Property element and attribute tag syntax -

i have simple label element , code in 2 ways. approach 1: use attribute syntax converter attribute of binding markup extension. converter attribute in curly braces {}. <label text="flag background" backgroundcolor="{binding source={x:reference switch3}, path=istoggled, converter={staticresource booltocolor}}"></label> approach 2: use property-element tag converter attribute; ok. <label> <label.text> <binding source="{x:reference switch3}" path="istoggled"> <binding.converter> <toolkit:booltostringconverter falsetext="red" truetext="lime"></toolkit:booltostringconverter> </binding.converter> </binding> </label.text> </label> however, cannot make source property-element tag. not understand why cannot use property-element tag source. please explain. <label> <label.text> <

nlp - Predicting next word with text2vec in R -

i building language model in r predict next word in sentence based on previous words. model simple ngram model kneser-ney smoothing. predicts next word finding ngram maximum probability (frequency) in training set, smoothing offers way interpolate lower order ngrams, can advantageous in cases higher order ngrams have low frequency , may not offer reliable prediction. while method works reasonably well, 'fails in cases n-gram cannot not capture context. example, "it warm , sunny outside, let's go the..." , "it cold , raining outside, let's go the..." suggest same prediction, because context of weather not captured in last n-gram (assuming n<5). i looking more advanced methods , found text2vec package, allows map words vector space words similar meaning represented similar (close) vectors. have feeling representation can helpful next word prediction, cannot figure out how define training task. quesiton if text2vec right tool use next word predict

angularjs - Why is scope variable in directive undefined? -

i have following parent , child ( http://jsfiddle.net/j1ee5zss/2/ ): <div parent parent-model="my-model"> <div child>child</div> </div> in child directive trying parent-model, e.g., "my-model": app.directive("parent", parent); function parent() { var parent = { controller: ["$scope", controller], replace: false, restrict: "a", scope: { model: "=" } }; return parent; function controller($scope) { this.getmodel = function () { return $scope.model; } } } app.directive("child", child); function child() { var child = { link: link, replace: false, require: "^parent", restrict: "a" }; return child; function link(scope, element, attributes, controller) { var model = controller.getmodel(); console.log(model); } } why model undefined when write console

typescript - How can I change gesture event options dynamically in Ionic 2? -

i'm starting first project typescript ionic 2 , today events showed in docs (ionic uses hammerjs recognize gestures). example, can use following angular 2 template syntax target swipe event: <ion-card (swipe)="swipeevent($event)">triggers on swipe</ion-card> however, have no idea how access hammerjs instance change event options. thought skipping ionic's implementation of hammer , using hammer outside typescript definitions i'm having problems importing these definitions , don't know how make them work angular. how can change conditions need met event fire? for example, event fire when x amount of pointers used, swipe direction x , velocity exceeds value, seen in hammerjs docs . since repeat pattern other event types (pinch, pan, tap, rotate, ...), suppose easier if code directly in view's class rather in template syntax. also, want able change these options dynamically according json data. say have 2 possible sets of options i

javascript - Two canvases as textures for plane in three.js -

i render 2 canvases textures on plane in three.js. created array 2 meshbasicmaterial , did following texture2 = new three.texture(c1); texture3 = new three.texture(c3); var mat1 = new three.meshbasicmaterial({ map: texture2 }); var mat2 = new three.meshbasicmaterial({ map: texture3 }); materials.push(mat1); materials.push(mat2); mesh2 = new three.mesh(geometry2, new three.meshfacematerial( materials )); scene2.add(mesh2); renderer2 = new three.webglrenderer({canvas:c2}); renderer2.setsize(c2.width, c2.height); document.body.appendchild(renderer2.domelement); i created jsfiddle example show actual problem. second texture isn't rendered on canvas2, want show both textures on it. reason the reason why second texture not rendered because doesn't know faces assign first or second material to, default gives first material of them. solution update three.js latest build (r76). you're running r54 loop through faces , assign them materialindex (

java - How to use dependency injection in JAXB unmarshalled objects? -

i have factory class @applicationscoped /* 'applicationscoped' not must */ class myfactory { @inject private iservice aservice; ... } and jaxb annotated class @xmlrootelement(name = "item") class anitem { @inject myfactory myfactory; ... } anitem instantiated jaxb xml file. problem myfactory null . if replace ... myfactory myfactory = new myfactory(); ... then myfactory.aservice null. how can use dependency injection within classes created jaxb? the following solution inspired block of adam warski , see beanmanager javadoc at first i'll need 2 utility methods: import javax.enterprise.inject.spi.bean; import javax.enterprise.inject.spi.beanmanager; import javax.naming.initialcontext; import javax.naming.namingexception; public class utils { public static beanmanager getbeanmanager() { try { initialcontext initialcontext = new initialcontext(); return (beanmanager) initialcontext.lookup(&quo

ios - Swift - Crashing With Reachability -

i call method testreachability() when uibutton pressed check internet connection before completes action. using ashley mill's reachability class. on line 24 call completed() if app can reach network complete closure , continue on rest of action. app becomes glitchy , error displays in debug console: "this application modifying autolayout engine background thread, can lead engine corruption , weird crashes. cause exception in future release.” and if call completed() on lets say, line 26, app runs flawlessly, quick , smooth until lose internet connection/enter airplane mode. app crashes instantly , xcode loses connection device on tap of button. my question can resolve crashing of application when checking reachability. func testreachability(completed: downloadcomplete) { let reachability: reachability { reachability = try reachability.reachabilityforinternetconnection() } catch { return } reachability.whenreachable = { reachab

Unexpected cartesian product in Foxpro SQL statement -

i executing following visual foxpro sql statement c# program. expecting 1 result not getting results. select iplclaim.lc_lname, ipcname.cn_lname, ipcbusn.cb_bname ; iplclaim ; inner join iplclsub on iplclsub.ls_claimno + iplclsub.ls_sclaimno = iplclaim.lc_claimno + 'a' ; left outer join ipcname on ipcname.cn_inqno = iplclsub.ls_inqno ; left outer join ipcbusn on ipcbusn.cb_inqno = iplclsub.ls_inqno ; iplclaim.lc_claimno = ' 1105' ; , not deleted() i able reproduce problem running vfp using following program... close databases open database ipcust.dbc use c:\testvfp\ips\data\ppdata\iplclaim in 0 use c:\testvfp\ips\data\ppdata\iplclsub in 0 use c:\testvfp\ips\data\ppdata\ipcname in 0 use c:\testvfp\ips\data\ppdata\ipcbusn in 0 sys(3054,12) select iplclaim.lc_lname, ipcname.cn_lname, ipcbusn.cb_bname ; iplclaim ; inner join iplclsub on iplclsub.ls_claimno + iplclsub.ls_sclaimno = ' 1105a' ; left oute

r - Multiple Boxplots in ggplot2 with continuous and categorical data -

Image
i have data frame 4 columns , 200,000 rows of watershed id, forest age (categorical 1-4), evi (continuous), , drought (categorical "drought or "non-drought"). trying use ggplot make 10 boxplots each watershed comparing evi values in drought , non-drought conditions watershed. data frame image: id each watershed repeated because there 10,000 evi samples each watershed in both drought , non-drought periods this code i've been using try , make these plots ggplot: box_watershed<-read.table("all_evi_watersheds_boxplot.txt", header=true) ggplot(data = box_watershed, aes(x=box_watershed$id, y=box_watershed$evi)) + geom_boxplot(aes(fill=box_watershed$drought)) p <- ggplot(data = box_watershed, aes(x=box_watershed$id, y=box_watershed$evi)) + geom_boxplot(aes(fill=box_watershed$drought)) p + facet_wrap( ~ evi, scales="free")

xpages - filtering/searching on a repeat control -

in application, replace viewpanel repeat control. however, part of functionality there ui aspect allows users select fields (that correspond view), , display documents match. view doing filter allows users select aspects of view create search (the code under search of view) allows view panel updated results of search. one of things curious viewpanel has value of "#{javascript:view2}" vice actual view name. the viewpanel defines search view , ... i'd able apply same functionality repeat control. don't see attributes on repeat control... pointers? been while since i've worked xpages... long enough i've forgotten lot already.... tia ! read this blog post did while back, should explain need. the view panel doesn't filter anything, displays rows datasource, same repeat control. indeed can add components viewpanel's column, pulling current row adding var property dominoview datasource. the view bound #{javascrip

aop - Convert Inter-Type declaraton from .aj to .java with Aspect annotations -

i have situation. village.java : public class village{ private integer vid; private string villagename; private string district; public integer getvid() { return vid; } public void setvid(integer vid) { this.vid = vid; } public string getvillagename() { return villagename; } public void setvillagename(string villagename) { this.villagename = villagename; } public string getdistrict() { return district; } public void setdistrict(string district) { this.district = district; } } this dao.java interface: public interface dao<t> { public void insert(); public void update(); public void delete(); } this aspect village_dao.aj (you can ignore static methods logic): import org.apache.ibatis.session.sqlsession; import com.madx.finance.data.utils.persistence.dao; import com.madx.finance.data.utils.factory.connectionfactory; public aspect village_dao {

multithreading - JAVA real time consol-control the threads -

i beginner in programming. still learning threads , more of them. have quite big idea write first program (i mean bigger simple calculator). want sort files, integrate in 1 (many copies of 1 file in different localization - idea of of no importance now). but want create threads, or else (what advice). mean. when start program, console starts up, , e.g have write "my_programm run" or "my_program stop" or "my_program status" or "my_magic_tricks be_done". mean how can create program working in background in threads with real time string control on it . tried find out on google useful me, didn't find out. please give me name of libraries or methods, can use. read out, , move forward it. if dumbass question. sorry disapointing programmer group. nice given of signpost or clue. a simple way using standard library : import java.util.scanner; import java.util.concurrent.linkedblockingdeque; import java.util.concurrent.threadpoole

spark udf with data frame -

i using spark 1.3. have dataset dates in column (ordering_date column) in yyyy/mm/dd format. want calculations dates , therefore want use jodatime conversions/formatting. here udf have : val return_date = udf((str: string, dtf: datetimeformatter) => dtf.formatted(str)) here code udf being called. however, error saying "not applicable". need register udf or missing here? val user_with_dates_formatted = users.withcolumn( "formatted_date", return_date(users("ordering_date"), datetimeformat.forpattern("yyyy/mm/dd") ) i don't believe can pass in datetimeformatter argument udf . can pass in column . 1 solution do: val return_date = udf((str: string, format: string) => { datetimeformat.forpatten(format).formatted(str)) }) and then: val user_with_dates_formatted = users.withcolumn( "formatted_date", return_date(users("ordering_date"), lit("yyyy/mm/dd")) ) honestly, though -- b

css - Do nested Bootstrap 3 rows need to be within a col-sm-*? -

do nested bootstrap 3 rows need within col-sm-* or can nested within col-md- , col-xs- , etc? the documentation says col-sm-* doesn't appear explicit whether nesting within other col sizes forbidden. http://getbootstrap.com/css/#grid-nesting you can use class in same time. on base bootstrap decide 1 best screen. you can nasted class inside of types - it's depend need.

asp.net - AjaxToolkit SliderExtender generates JavaScript exceptions in IE11 -

i'm using ajaxtoolkit:sliderextender in updatepanel so: <asp:updatepanel id="upslideshow" runat="server"> <contenttemplate> <asp:textbox id="txtslidebackgroundopacity" runat="server" readonly="true" tooltip="adjust opacity of background (0 transparent, 100 opaque)" ontextchanged="txtslidebackgroundopacity_textchanged" autopostback="true" /> <br /> <asp:textbox id="txtopacityslider" runat="server" /> <ajaxtoolkit:sliderextender id="seslidebackgroundopacity" runat="server" targetcontrolid="txtopacityslider" boundcontrolid="txtslidebackgroundopacity" /> </contenttemplate> </asp:updatepanel> works fine in edge, firefox, , chrome, generates following exception in ie11: 0x800a13

c# - If abstract base class contains parameterised constructor (and derived does not) why can't it be used? -

this question has answer here: how can call base class's parameterized constructor derived class if derived class has no parameterized constructor? 3 answers i have ddd type solution "domain model" classes constructed using "dto" class (i.e. raw data db). the domain model classes inherit abstract base class, intended provide generic injecting/retrieving of dto data. here sample: public abstract class domainmodelbase<t> t : idto, new() { protected t _data; protected domainmodelbase() { _data = new t(); } protected domainmodelbase(t data) { _data = data; } protected void setdata(t data) { _data = data; } public t getdata() { return _data; } } public class attributeoption : domainmodelbase<attributeoptiondata> { //public attributeoption(at

ms access - Conditional formatting sees a difference between numbers that visually look the same -

in microsoft access 2013, have 2 textboxes on form containing currency format , 2 decimals compare. for example: $25,100.50 if numbers visually identical, expect comparison box turn green. if visually different, expect comparison box turn red. however, box turns red though number visually identical. obviously, comparing rolled decimals. if make sure format currency, , decimal places same, shouldn't take care of it? how can tweak works every time? instead of having conditional formatting expression textbox1 = textbox2 use format(textbox1,"currency") = format(textbox2, "currency")

html - Window.close script doesn't seem to close -

having trouble getting code close window. can help? when "return" clicked goes blank page. <form method="post" action="http://ww8.aitsafe.com/cf/add.cfm" target="newwindow" onsubmit="window.open('', 'newwindow','width=800,height=500,'+'scrollbars=yes,status=no,toolbar=no,menubar=no,top=200,left=200')"> <p> <input type="hidden" name="userid" value="a8403475"> <input type="hidden" name="return" value="window.close"> <input type="hidden" name="thumb" value="logo.png"> <select name="productpr"> <option>- select size -</option> <option value="size one:9.99">size 1 - 9.99</option> <option value="size two:12.99">size 2 - 12.99</option> </select> <input type="submit" value="add cart">

c - Creating a Node for Linked List/Self Referential Structures -

i'm trying create node create linked list, i'm getting error "intellisense: value of type "void *" cannot assigned entity of type "c"" isn't value of c synonym b: null not void? therefore shouldn't initial node created null , manipulation of linked list occur? i haven't continued insert function because creation of node not working #include <stdio.h> #include <stdlib.h> struct { char data; struct *nextptr; }; typedef struct b; typedef b *c; void insert(c *sptr, char value); void print(c cptr); void menu(void); int main (void) { menu(); c startptr = null; char c; int x; (x = 0; x <6; x++) { insert(&startptr, c); print(startptr); } } void menu(void) { puts("enter 1 add: \nenter 2 remove \nenter 3 quit"); } void print (c cptr) { puts("names in list"); printf("%c ->",cptr->data); } void insert(c *sptr, cha

Stripe Payouts to Bank Account in Rails -

i trying automise money transfer website user's bank account. proper way it? i tried create bank account fist js call first: stripe.bankaccount.createtoken({ country: 'us', currency: 'usd', routing_number: routing_number, account_number: account_number, account_holder_name: account_holder_name, account_holder_type: account_holder_type }, function(status, response) { token_input.val(response.id); form.submit(); }); i receive response stipe: {id: "btok_8jtqwnyqqaealf", object: "token", bank_account: …} on server side tried use token () stripe::transfer.create( :amount => 400, :currency => "usd", :destination => params['bank_account_token'], :description => "payout" ) however stripe reponse is: no such destination: btok_8jthh75qpdnb4m what way transfer funds stripe bank account?

python - Impossible to add a background-image in parent QWidget with PyQt5? -

i've been struggling last 2 days... add stretched background image parent qwidget. literally tried dozens of times after searching everywhere i'm still stuck issue. don't use resources (from qt designer). psb : from pyqt5 import qtcore, qtwidgets, qtgui import sys class ui_form(qtwidgets.qwidget): def __init__(self): qtwidgets.qwidget.__init__(self) self.setupui(self) def setupui(self, form): form.setobjectname("form") form.resize(860, 619) form.setstylesheet("qwidget#form {border-image: url(space.png) 0 0 0 0 stretch stretch;}") and not work (default bg displayed). when execute this: form.setstylesheet("border-image: url(space.png) 0 0 0 0 stretch stretch;") all qwidgets children background not want. proves @ least there no problem resource itself. cannot believe basic features setting background image not supported in pyqt5... , appearantly i'm not 1 : stackoverflow i've tried make work