Posts

Showing posts from March, 2013

api - OK.RU embed videos set start time and hide controls -

i want embed video ok.ru , specify time on video should start (eg: video should start second 5), , hide controls, on youtube's embed api. i found api, unable find how above. ok.ru api viewable here: english documentation how this? thank you!

eclipse - How to send commits from developers to test environment, automatically -

i administrator of project. , developers of team, commit somethings svn. normally, sending these commits test environment manually. possible send these commits test environment, automatically. you can use continuous integration tool jenkins that. it can used trigger build @ each change on svn. , can add post-built script in charge of deploying (and testing) newly built application.

angularjs - How to validate ng-tags-input with promise? -

am trying validate tags added calling server-side api. following code. <tags-input ng-model="user.trucks" add-on-space="true" on-tag-adding="checktruck($tag)"> </tags-input> and in controller have written, $scope.checktruck = function(tag){ var x = $q.defer(); someservice.checktruck(tag).then(function(response){ x.resolve(true); }, function(response){ x.reject(false); }); return x.promise; }; though documentation says on-tag-adding can take promise , validate added tag, it's not working way. missing ?? you know need return values resolve , reject handlers !? $scope.checktruck = function(tag){ var deferred = $q.defer(); someservice.checktruck(tag).then(function(response){ return deferred.resolve(true); }, function(response){ return deferred.reject(false); }); return x.promise; }; we can remove the explicit promise construc...

c++ - Can't use QMainWindow after opened a QDialog (Qt) -

in program have following problem: after opened qdialog qmainwindow , can't use qmainwindow , if close qdialog first. there solution this? thank you, mate if don't need event loop of exec can use dialog->show().

python - How to upload a file to Hug REST API -

i'm working on basic hug api , 1 of functions needs file. does hug have way upload file? this example you're looking for: https://github.com/timothycrosley/hug/blob/develop/examples/file_upload_example.py @hug.post('/upload') def upload_file(body): """accepts file uploads""" # simple dictionary of {filename: b'content'} print('body: ', body) return {'filename': list(body.keys()).pop(), 'filesize': len(list(body.values()).pop())}

bash - Make cat command to operate recursively looping through a directory -

i have large directory of data files in process of manipulating them in desired format. each begin , end 15 lines soon, meaning need strip first 15 lines off 1 file , paste them end of previous file in sequence. to begin, have written following code separate relevant data easy chunks: #!/bin/bash destination='media/user/directory/' file1 in `ls $destination*.ascii` echo $file1 file2="${file1}.end" file3="${file1}.snip" sed -e '16,$d' $file1 > $file2 sed -e '1,15d' $file1 > $file3 done this worked perfectly, next step worlds simplest cat command: cat $file3 $file2 > outfile however , need stitch file2 previous file3 . look @ screenshot of directory better understanding. see how these files sequential on time: *_20090412t235945_20090413t235944_* ### april 13 *_20090413t235945_20090414t235944_* ### april 14 so need take 15 lines snipped off april 14 example above , paste end of april 1...

python - imaplib.error: command SEARCH illegal in state AUTH, only allowed in states SELECTED -

def connect_imap(): m = imaplib.imap4_ssl("imap.gmail.com", 993) print("{0} connecting mailbox via imap...".format(datetime.datetime.today().strftime("%y-%m-%d %h:%m:%s"))) details = login_credentials() m.login(details[0], details[1]) return m m = connect_imap() typ, data = m.search(none, 'all') m.close() m.logout() the output of above code is: 2016-08-24 10:55:34 connecting mailbox via imap... traceback (most recent call last): file "/home/zoikmail/desktop/test.py", line 25, in <module> typ, data = m.search(none, 'all') file "/usr/lib/python2.7/imaplib.py", line 640, in search typ, dat = self._simple_command(name, *criteria) file "/usr/lib/python2.7/imaplib.py", line 1088, in _simple_command return self._command_complete(name, self._command(name, *args)) file "/usr/lib/python2.7/imaplib.py", line 838, in _command ...

get the document url in chrome.webRequest.onBeforeRequest -

in chrome.webrequest.onbeforerequest sorts of url's -- javascript, css etc. for every url want know main tab url. what simplest way synchronously? right i'm using way: if details.frameid == 0 details.url contains main tab url tab id chrome.webrequest.onbeforerequest.addlistener( function (details) { if (details.tabid == -1) { return; } if ("type" in details && ['main_frame', 'sub_frame'].indexof(details.type) !== -1) { if (details.frameid == 0) { all_tabs_info.add_tab_info(details.tabid, details.url); } } }, { urls: ['<all_urls>'] }, ["blocking"]); onwards if request comes tab id have tab url. crude logic seems working. a couple of enhancements: use filters as possible , in case type . main_frame t...

python - Find and Edit Text File -

i'm looking find if there way of automating process. have 300,000 rows of data needed download on daily basis. there couple of rows need edited before can uploaded sql. jordan || michael | 23 | bulls | chicago bryant | kobe ||| 8 || la what want accomplish have 4 vertical bars per row. normally, search keyword edit manually save. these 2 anomalies in data. find "jordan", remove excess 1 vertical bar "|" right after it. i need find "kobe", remove 2 excess vertical bars "|" right after it. correct format below - jordan | michael | 23 | bulls | chicago bryant | kobe | 8 || la not sure if can done in vbscript or python. appreciated. thanks! python or vbscript used overkill simple. try sed : $ sed -e 's/(jordan *)\|/\1/g; s/(kobe *)\| *\|/\1/g' file jordan | michael | 23 | bulls | chicago bryant | kobe | 8 || la to save new file: sed -e 's/(jordan *)\|/\1/g; s/(kobe *)\| *\|/\1/g' file >new...

javascript - AngularJS - Best approach for taking data from factory and if not there use http service -

in angularjs application, have set data received 1 controller's ajax , put in factory method reuse in other controllers. problem when user reload page, factory method useless. app.factory('factory', function () { return { set: set, get: } }); app.controller ('testcontroller', function ($scope, factory) { if (factory.get('name')) { $scope.name= factory.get('name'); } else { $http.get(url).then(function(res) { $scope.name= res.name; factory.set('name', res.name); }); } }); what best way retrieve check in factory method value factory, if not there take http service , in controller common code needs handle these 2 cases done factory method? here when data taken http service returns promise otherwise plain value. this code fetch data server if 'cachedresult' variable not set, otherwise return promise stored variable. app.factory('factoryname...

database - Disable radio button based on PHP function -

i want call javascript function based on result coming php script. if ($verify == 'y' , $approve== 'y' , $approve_2=='y') { $state = "disable"; } else { $state = "undisable"; } below javascript function function disable() { document.getelementbyid("approvedd1").disabled = true; document.getelementbyid("approvedd2").disabled = true; } function undisable() { document.getelementbyid("approvedd1").disabled = false; document.getelementbyid("approvedd2").disabled = false; } document.onreadystatechange = <?php echo $state; ?>() this not work. want call function can disable radio button, when page has loaded. the current output of java script be function disable() { document.getelementbyid("approvedd1").disabled = true; document.getelementbyid("approv...

python - Constructing Zipf Distribution with matplotlib, FITTED-LINE -

Image
i have list of paragraphs, want run zipf distribution on combination. my code below: from itertools import * pylab import * collections import counter import matplotlib.pyplot plt paragraphs = " ".join(targeted_paragraphs) paragraph in paragraphs: frequency = counter(paragraph.split()) counts = array(frequency.values()) tokens = frequency.keys() ranks = arange(1, len(counts)+1) indices = argsort(-counts) frequencies = counts[indices] loglog(ranks, frequencies, marker=".") title("zipf plot combined article paragraphs") xlabel("frequency rank of token") ylabel("absolute frequency of token") grid(true) n in list(logspace(-0.5, log10(len(counts)-1), 20).astype(int)): dummy = text(ranks[n], frequencies[n], " " + tokens[indices[n]], verticalalignment="bottom", horizontalalignment="left") purpose attempt draw "a fitted line" in graph, , assign value variable. not know how add...

opencv - Python App built with py2app crashes when run -

i'm developing app python 2.7.12 in virtualenv. after building py2app (no errors when building), when open app crashes immediately. i'm think it's related of libraries i'm using, since test app built without these libraries ran fine. the main libraries i'm using: opencv, pyautogui , numpy. the error in console looks ("gui" name of app): 8/23/16 11:18:04.611 pm gui[25490]: _recipes_pil_prescript(['hdf5stubimageplugin', 'fitsstubimageplugin', 'sunimageplugin', 'gbrimageplugin', 'pngimageplugin', 'jpeg2kimageplugin', 'micimageplugin', 'fpximageplugin', 'pcximageplugin', 'imimageplugin', 'spiderimageplugin', 'psdimageplugin', 'bufrstubimageplugin', 'sgiimageplugin', 'mcidasimageplugin', 'xpmimageplugin', 'ddsimageplugin', 'mpoimageplugin', 'bmpimageplugin', 'tgaimageplugin', 'palmim...

security - Disable Linux vsyscall vdso vvar -

i implementing linux security sandbox custom bytecode interpreter through seccomp mode. minimize as possible attack surface, want run in clean virtual address space. need code , data segments plus stack available, not need vsyscall, vdso nor vvar. is there way disable allocation of pages given process? basically, no, have disable vsyscall/vdso globally if want mapping unavailable. if want program unable call vsyscall/vdso syscalls, seccomp able it. caveats though: see https://www.kernel.org/doc/documentation/prctl/seccomp_filter.txt on x86-64, vsyscall emulation enabled default. (vsyscalls legacy variants on vdso calls.) currently, emulated vsyscalls honor seccomp, few oddities: a return value of seccomp_ret_trap set si_call_addr pointing vsyscall entry given call , not address after 'syscall' instruction. code wants restart call should aware (a) ret instruction has been emulated , (b) trying resume syscall again trigger standard vsys...

android - Updating comment count for a post in recycler view -

activity has recycler view , has each row post, each post has comment button launches comment activity user can see comments , add comments. question is, after adding comment(s), how update comment count in particular row of recycler view in activity when comment activity finishes, without notifydatasetchanged() , since don't wanna reload recycler view again.

portable class library - Xamarin PCL FFImageLoading: How to get the image without using CachedImage View -

can bitmap directly ffimageloading? know can use cachedimage view using ncontrol , ngraphics custom drawing touch events imageservice.instance.loadurl(urltoimage) .into(nativeimageview); or var drawable = await imageservice.instance.loadurl(urltoimage) .asbitmapdrawableasync(); var image = imageservice.instance.loadurl(urltoimage) .asuiimageasync();

php - there is no any change to the rows displayed when doing "search" in yii2 -

Image
i have problem when making modelsearch in yii2. here's relation diagram i want display jurusan table aitambah table ais3 , want display namamahasiswa table ai ais3 . made table s3penghubung table aitambah can related ais3 . able display them. but, when try type "bio" in jurusan field, searching not working properly. refreshing page. there no change rows displayed. so, should fix that? model search code <?php namespace app\models; use yii; use yii\base\model; use yii\data\activedataprovider; use app\models\ais3; use app\models\aitambah; /** * ais3search represents model behind search form `app\models\ais3`. */ class ais3search extends ais3 { /** * @inheritdoc */ public function rules() { return [ [['id', 'kode'], 'integer'], [['nrp', 'nrp1', 'nrp2', 'nrp3', 'nrp4', 'nrp5', 'nrp6', 'nrp7', 'namamahasis...

c - When does malloc return NULL in a bare-metal environment? -

there c memory model following : +--------+ last address of ram | stack | | | | | v | +--------+ ram | | | | +--------+ | ^ | | | | | heap | +--------+ | zi | +--------+ | rw | +========+ first address of ram the stack , heap space increase in opposite directions. overlapped each other in middle. questions are: in bare-metal environment, when malloc return null? in bare-metal environment, how prevent stack overlapping heap? @wikiwang correct if using static, compile-time memory layout ( edit although have tell malloc implementation somehow end of heap is). if not, , assuming mean bare-metal, depends on c library implementation in board-support package. library must provide implementation of brk(2) or function having similar effect. malloc works within area of memory set brk or sbrk . example, see malloc source ca...

How can I get file tile(name) from file full path in VB6? -

i wanna file title(only filename, , extension) how can this? for example : ftp://111.111.111.111:3333/file/file01.bmp i wanna "file01.bmp" in vb6 i believe question vb6, not vb.net or c#. please include reference "microsoft scripting runtime". dim fso new filesystemobject dim filename string filename = fso.getfilename("ftp://111.111.111.111:3333/file/file01.bmp")

regex - Coldfusion doesn't recognize japanese character unicode when searching with regular expression -

when try search japanese characters regular expression in coldfusion, got code. <cfset test1 = refind("[\u3040-\u309f]", "あ")> (1) <cfset test2 = refind("[\u61]", "a")> (2) <cfdump var="#test#"> with (1) got result 0 indicates there no match. actually, above unicode matches all hiragana characters including above char あ . should return 1 . with (2) got 1 indicates matched. i tried anscii chars, works japanese chars doesn't. how should fix this?

mysql - Update the value in table row by id - PHP -

i trying increase number value in column called 'denda' every 24 hours followed different starting date. example if date reach current datetime start count 0.20 ..the next day should 0.40. value should different follow starting date in table. this output contohgambar and code $pulang = mysql_query("select id_peminjam, t_pinjam, t_pulang peminjaman status='lewat'"); $pulang2 = mysql_fetch_array($pulang); $id = $pulang2['id_peminjam']; $id2 = $pulang2['t_pinjam']; $id3 = $pulang2['t_pulang']; "</br>"; date_default_timezone_set("asia/kuala_lumpur"); $now = time(); $your_date = strtotime($id3); $datediff = $now - $your_date; $bil_lewat= floor($datediff/(60*60*24)); $jum_denda = ($bil_lewat * 0.20); $format = number_format($jum_denda, 2, '.', ''); i think can use mysql statement solve problem. add "datediff(curdate(),t_pulang)*0.2" sql statement calculate differenc...

List influxdb series by filtering on series name -

i using influxdb in conjunction grafana. part of grafana query, i'd select influx series' part of set know already. if series named 'a', 'b', , 'c', i'd "show series"-like command return eg. 'a', 'b'. possible influx? i not sure if understand question correct can select multiple series with: select * a, b; if questions how can solve in grafana, can create graph 2 query's. 1 selects a , 1 selects b

java - How to deploy javaagent with 3rd party libs dependencies -

we wrote javaagent developers debugging. but, before releasing tool, still have questions deployment of java-agent. user may use agent tomcat applications. agent uses premain method transform classes. use javassist 3.18.2-ga insert codes. add javassist.jar boot-class-path in manifest.mf. , put both agent , javassist.jar tomcat's lib directory. the questions are: well, least, works. correct way deploy agents , dependencies tomcat applications? because tomcat applications using hibernate using javassist 3.18.2-ga, it's ok right now. understanding, 3.20 not compatible 3.18.2. suggest had update javassist higher version, agent or application crash due conflict between 2 different javassist's. a javaagent added , run on vm's class path. therefore, have following options: add dependencies classpath when starting vm such when deploying normal application. application container tomcat, appropriate directory such dependencies. bundle dependencies agent ...

swift - Alamofire deprecated code -

scenario: networking app based on alamofire. i'm encountering deprecated-code notices in latest project build. traced following statement within alamofire. don't see mention of alternatives. @available(*, deprecated=3.4.0) public static func errorwithcode(code: int, failurereason: string) -> nserror { let userinfo = [nslocalizedfailurereasonerrorkey: failurereason] return nserror(domain: domain, code: code, userinfo: userinfo) } what's replacement? and... how determine other replacements of deprecated codes? you need build own errors own custom domain. unwise of expose convenience methods because led users create own errors using alamofire error domain not correct. all of going easier in swift 3 new aferror type being introduced.

python - removing rows with any column containing NaN, NaTs, and nans -

currently have data below: df_all.head() out[2]: unnamed: 0 symbol date close weight 0 4061 2016-01-13 36.515889 (0.000002) 1 4062 aa 2016-01-14 36.351784 0.000112 2 4063 aac 2016-01-15 36.351784 (0.000004) 3 4064 aal 2016-01-19 36.590483 0.000006 4 4065 aamc 2016-01-20 35.934062 0.000002 df_all.tail() out[3]: unnamed: 0 symbol date close weight 1252498 26950320 nan nat 9.84 nan 1252499 26950321 nan nat 10.26 nan 1252500 26950322 nan nat 9.99 nan 1252501 26950323 nan nat 9.11 nan 1252502 26950324 nan nat 9.18 nan df_all.dtypes out[4]: unnamed: 0 int64 symbol object date datetime64[ns] close float64 weight object dtype: object as can seen, getting values in symbol of nan, nat date , nan weight. my goal: want remove row has column containing nan, n...

lapack - How to implement user-defined function from c in stan -

i trying use hmc mcmc sampling self-defined target function. had hmc code, doesn't work well. knew "stan" has more powerful hmc model. want implement code "stan". i have coded target function derivative function in c. involves for-loop, , functions needed cholesky decomposition , other linear algebras lapack. don't want recode in stan. there way use functions directly? appreciate if can give clues how modify code, or teach me how modify "stan" code. following part of code: void get_v(double phi, double sigmasq, double k, double *neardist, double *neardistm, int *nearind, double *w, int n, int m, double *v){ double 1 = 1.0, var; int i, j, dim ,info, int_one = 1; double *u, *temp_neardistm; char uplo = 'l'; char side = 'l', diag = 'n'; char trans = 'n', trans2 = 't'; var = (double)(1/k) * sigmasq; v[0] = var; (i = 1; < n ; i++){ if(i < m) { dim = i; } else { dim = ...

javascript - Sourcing Global Function from an Anonymous Function that Returns in Adobe DTM -

the below code snippets not actual code, there explain issue. please don't concentrate on actual functionality. i'm working adobe dtm. have no idea how anonymous function returns value (as data element source global function? if have normal anonymous function within data element, works fine. if anonymous function returns, doesn't work? there way work? example: //global function function _myglobalfunct(str){ return (str); } the following code of anonymous function within data element calls global function , works expected: // working anonymous function (function () { window._myglobalfunct("value1"); })() but following return anonymous function, within data element, doesn't call function doesn't throw errors? : // not working doesn't throw errors? return (function() { var rvalue = document.title || "no title"; window._myglobalfunct(rvalue); return rvalue; })(); i know function executing not getting errors in chrome? ...

c++ - error C2059: syntax error : 'generic' -

when want use boost library in code, , found error: error c2059: syntax error : 'generic' and error coming boost/filesystem/path.hpp, path generic() const { ... } and don't know how solve it, google , looks need redefine it. don't know how it.

javascript - Ajax - Render JSon to HTML : View vs Controller -

i want append results of ajax request table have on page. see 2 ways of rendering rows : my controller return json array decode in view , create javascript function add adequate html markup my controller directly return html what best practice on matter? i use ways send ajax php file datatype: 'json' at php : processing data , json_encode data array , die return result html on success function of ajax, process data

haskell - ghc 8.0 cabal build error "ld: -r and -pie may not be used together" known? -

after upgrading ghc 8.0 on recent ubuntu machine, got following build error: /usr/bin/ld: -r , -pie may not used together a different error message same problem is: relocation r_x86_64_32 against `.rodata' can not used when making > shared object; recompile -fpic is known bug? there other solutions? the solution use linker flag "-no-pie": cabal -v --ghc-option="-optl-no-pie" install cabal-install is suspect perhaps implicit ld flag set on ubuntu conflicting somehow.

sql server - How do I call a stored procedure on each of the files in a directory as a parameter? -

i'm green batch scripting, client doesn't allow use of ssis, tool can turn right now... i have folder of flat files, , want call stored procedure on each file. i can loop through files, , can call sqlcmd, can't figure out how pass name of file stored procedure. here's have: pushd d:\test /f "delims=" %%i in ('dir /b') sqlcmd -s servername -u username -p pword -q "exec db.schema.sp $(the_filename)" -v the_filename = %%i popd but i'm getting error: incorrect syntax near '%' what correct syntax? try this: pushd d:\test /f "delims=" %%i in ('dir /b') ( sqlcmd -s servername -u username -p pword -q "exec db.schema.sp '%%i'" ) popd the parentheses not required, use them added clarity.

Adding values to sequentially spaced list in python? -

i new python , confused how represent following code matlab python: p = [2:35,50,100,200] in matlab, spit out: p = [2,3,...,35,50,100,200] ; however, can't seem figure out how add values list sequential numbering done in matlab. suggestions great. thanks! vanilla python doesn't have dedicated syntax ... if you're working lists, need 2 steps: lst = list(range(2, 36)) # python2.x, don't need `list(...)` lst.extend([50, 100, 200]) if have "bleeding edge" (python3.5), you can use unpacking : lst = [*range(2, 36), 50, 100, 200] if you're using numpy , can use r_ index trick (which looks similar matlab version): >>> import numpy np >>> np.r_[2:36, 100, 200, 500] array([ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 100, 200, 500])

php - facing problems uploading image in a form using codegniter -

Image
am trying include image in form, image added correctly 2 rows added in database table. am trying include image in form, image added correctly 2 rows added in database table. structure of table data added below: my controller public function addrecordtotable(){ $this->load->library('form_validation'); $this->form_validation->set_rules('client_id' , 'client_id', 'required'); $this->form_validation->set_rules('l_address' , 'location address', 'required|min_length[3]|max_length[50]'); if ($this->form_validation->run() == false) { $this->load->model('clientaccount_model'); $data['bids']=$this->clientaccount_model->bids(); $data['loads']=$this->truckeraccount_model->loads(); $this->load->view('footer'); } else { $array = array( 'client_id' => $th...

routing - External Load Balancer for Kubernetes cluster -

i want implement simple layer 7 load balancer in kubernetes cluster allow me expose kubernetes services external consumers. i create simple ha-proxy based container observe kubernetes services , respective endpoints , reload backend/frontend configuration (complemented syn eating rule during reload) this allow me access kubernetes services svca, svcb, svcc over http://load-balancer-ip:port/svca -------> pod endpoints..... http://load-balancer-ip:port/svcb -------> pod endpoints..... http://load-balancer-ip:port/svcc -------> pod endpoints..... how above approach work compared (1) ha-proxy forwarding requests clusterip address of kubernetes services. http://load-balancer-ip:port/svca ------->clusterip-svca http://load-balancer-ip:port/svcb ------->clusterip-svca http://load-balancer-ip:port/svcc ------->clusterip-svca (2) ha-proxy load-balancing requests worker-node-ip:port obtained creating nodeport type services http://load-balancer-ip:port/sv...

scene2d - Make content of HorizontalGroup Wrap to the next line in Libgdx -

i use libgdx's scene2d built-in ui library make ui in game . want use component div in html , add textbutton i've try use horizontalgroup when textbuttons long text exceed area . want set bounds actor ( horizontalgroup ) make limited here code myfunction(){ horizontalgroup group=new horizontalgroup(); (...) { button =new textbutton(...); group.addactor(button); group.setdebug(true); group.setbounds(5,200,200f,200f); } stage.addactor(group); } and result my first game any please

html - Tabindex is not working? -

i've been reading documentation of how apply tabindex feature in html elements , i'm trying add "empty-btn" button in html below tabbing feature goes straight social media icons instead. why this? how fix tabs on button before icons? html <p class="designations"> <%= profile.designations %> <button type="button" class="empty-btn" tabindex="0"> <div class="designations-popup"> <div class="popup-content"> <h5><%- theme_data.designation_pop_title %></h5> <p><%- theme_data.designation_pop_msg %></p> ...

keyboard shortcuts - How to make electron application menu accessible on windows? -

i have app built using electron has following application menu: 'my app', 'edit', 'view', 'window', 'help' if have voice on on, these items accessible on mac out of box via shortcut ' ctrl + option + m '. however, in windows, not accessible out of box. impossible me using keyboard. the windows shortcut access application's menu ' alt '. when hit tab, applications give hint of letter have press next menu item. instance, 'file' menu itme can ' alt + f ', view can ' alt + v ' , forth. how go implementing behavior electron app? on windows such access keys commonly referred mnemonics, can add 1 menu item inserting & menu item label right in front of character want use access key. example if create top-level menu label of &about you'll able access pressing alt + a .

html - Flexbox flex-direction: column items in flex-direction:row in IE11 is broken -

i'm trying simple grid flexbox. take @ https://jsfiddle.net/j3w795qo/3/ this example work fine in chrome, ff, edge, no in ie11. markup <div class="column" id="column1"> <p> text wrap ie flex bug. lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </div> <div class="row"> <div class="column" id="column2"> <p> text <strong>wont wrap</strong> reason ie flex bug. lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore ...

How to run same container on all Docker Swarm nodes -

i'm getting feet wet docker swarm because we're looking @ ways configure our compute cluster make more containerized. have small farm of 16 computers , i'd able have each node pull down same image, run same container, , accept jobs openmpi program running on master node. nothing openmpi specific this, containers have able open ssh ports , master must able log them. i've got working single docker container , works. now i'm learning docker machine , docker swarm way manage 16 nodes. can tell, once set swarm, can set docker_host (or use -h) send "docker run", , swarm manager decide node runs requested container. got working using simple node list instead of messing discovery services, , far good. but want run same container on nodes in 1 command. possible? docker 1.12 introduced global services , passing --mode global run command docker schedule service nodes. using docker swarm can use labels , negative affinity filters gain same r...

regex - Java replaceAll cannot replace a character in a string -

i want replace arabic letter heh (u+0647) arabic letter ae (u+06d5) in given string using java replaceall(regex, replacement) method. have code: string arabicheh = "\u0647‌"; // arabic letter heh string arabicae = "\u06d5"; // arabic letter ae string text = txtpane.gettext(); string newtext = text.replaceall(arabicheh, arabicae); when print newtext variable nothing changed, letter arabicheh still exist in string. note: code works when write in way: string newtext = text.replaceall("ه", arabicae); in other words, code works when make arabic letter heh parameter replaceall(regex, replacement) , don't want write character "ه" inside code because not ides can read/show character. i think arabibheh has problem, because text.contains(arabicheh) evaluates false while contains arabicheh , thought may problem in getting text jtextpane ( string text = txtpane.gettext(); ) when print text console same text type...

css - How to keep z-index order on multiple elements transform animation? -

i want keep z-index order before presing alone-box toggle animation button. jsfiddle function toggle_class() {if(document.getelementbyid('alone-boxes-wrapper').classname == 'animated') document.getelementbyid('alone-boxes-wrapper').classlist.remove('animated'); else document.getelementbyid('alone-boxes-wrapper').classlist.add('animated');} div.alone-box { position:absolute; z-index: 1; height: 100px; width:100px; background-color: #f4f1de; opacity:0.9; border:1px dashed #000; } div.absolute-wrapper { position:absolute; top:20px; } div.wrapper { position:relative; height: 100px; width:100px; left: 50px; } div.wrapper .box-1 { position:absolute; z-index:0; } div.wrapper .box-2 { position:absolute; top: 20px; z-index:2; } @keyframes animation { { transform: translatex(1rem); } { transform: translatex(-1rem); } } div.wrapper.animated .bo...

validation - How to add values with backquotes -

i have create grammar grammar com.iamsoft.net.validate org.eclipse.xtext.common.terminals generate validate "http://www.iamsoft.com/net/validate" model: netdescription+=descriptionpair+; descriptionpair:tso; tso: name=tso_name '=' '"' value=boolean '"'; terminal boolean: 'on' | 'off'; terminal tso_name: 'tso_' id; and during validation of string tso_eth1="off" have following error message mismatched input '"off"' expecting '"' but if remove double quotes rule tso, grammar correctly validate string tso_eth1=off so how add double quotes grammar? regards, vladimir the problem inheritance of terminals grammar contains string rule depending on if need string terminal rule anywhere else have following options (1) dont inherit terminals grammar , copy&paste terminal rules , hidden clause terminals grammar grammar (...

jquery - Autocomplete doesn't fire select function if tab out of input quickly -

i have configured autocomplete on input, delay option set 0, , autofocus set true. source: autocomplete set ajax call. typically, if user inputs search string , tabs out of field, first item selected. however, if experienced user inputs search string should have 1 match , very quickly tabs out of input, function specified select option doesn't fire, , input contains search string user entered. causing error when form submitted, because valid selection hasn't been made (normally, selection of match sets hidden form field value of selected match). if put breakpoint in function specified source option retrieve matches, can see invoked, , gets list of matches back. however, breakpoint put in function specified select option never hit when tab out quickly. i can reproduce behavior in both chrome , ie 11, when running against localhost or remote webserver. jquery-ui version v1.11.4. question: possible configure autocomplete -always- select first returned match if u...

excel - VBA code only working for some charts -

my vba code updating secondary axes range on graphs of worksheet works of graphs. after macro run, message "method 'axes' of object '_chart' failed" displayed, of graphs on worksheet being updated. what's problem here? sub macro1() dim objchart chartobject, lower double, upper double lower = application.inputbox(prompt:="enter lower bound", type:=1) upper = application.inputbox(prompt:="enter upper bound", type:=1) each objchart in sheets("summary").chartobjects objchart.chart.axes(xlvalue, xlsecondary) .minimumscale = lower .maximumscale = upper end next objchart end sub if chartobject doesn't have secondary axis, accessing raise error. couldn't figure out way reproduce exact error, said in a comment , extracting procedure , handling runtime errors should @ least diagnosing problem , making loop iterate charts: public sub updatesummarysheetchartaxes() dim lower double...

ios - Back button blinks on UISplitViewController -> detail segue -

Image
i have iphone app , i'm trying make universal. i added split view controller , both master , detail vcs embedded in navigation controllers, navigation bar show on both when they're visible @ same time, , can add displaymodebuttonitem() , all. the problem that, on iphone, when 1 of vcs visible @ time, navigation controller detail vc embedded cause button sort of blink on show detail segue. the difference subtle, it's bugging me. here's how goes without navigation controller: and here's how goes with navigation controller: in gifs doesn't bad in actual iphone, can see difference. it's navigation controller arrow shows itself, , "reading" label catches up. without navigation controller, on other hand, arrow , "reading" label show @ same time (pay attention, you'll see it, haha). to work around tried change segue when tapping on table view row in master vc i'd go straight actual detail vc, bypassing navigation con...

xamarin.ios - Get last update date for iOS application -

i'd display user when app last updated. on android say: packageinfo p = a.packagemanager.getpackageinfo(a.applicationinfo.packagename, packageinfoflags.metadata); textview lastupdated = messageview.findviewbyid<textview>(resource.id.lastupdated); datetime dt = new datetime(1970, 1, 1, 0, 0, 0, 0, system.datetimekind.utc); lastupdated.text = "app updated on " + dt.addmilliseconds(p.lastupdatetime).tolocaltime().tostring("mm-dd-yyyy"); how can similar ios? from below itune app search api can app details. http://itunes.apple.com/lookup?bundleid=yourbundleid&country=appcountry simple download file url @ runtime , read data json string, in obtained result can current version release date key currentversionreleasedate

javascript - Make div button over contenteditable element -

Image
i developping angular app client, , have make clickable button @ bottom right on contenteditable element following image : to add difficulty, content should scrollable, button should stay same place , text should avoid it. of course, can't add marging/padding cause add blank column/line @ bottom or @ right of content editable zone. i can use js/css tips/library. edit #1 : ok not enough accurate question. here code : <p id="editfield" contenteditable="true"></p> http://jsfiddle.net/4yr7jsz1/24/ as can see, "contenteditable" element. user can type come text in it. text should not pass below round button, , should srcollable. edit #2 : actually, button. ":before" element on inserted element inside contenteditale container allow me place zone want text avoid. problem can't change aprameter af ":before" element via javascript... here html : <body ng-app="myapp"> <div id="e...

python - Testing abstract models in Django -

i trying test functionality of abstract base models in django app. have been reading on how these tests , seems need create test model. so have done so, have crated directory called my_app/tests , created models.py in there. have test model uniqueslugtestmodel . now guess need call makemigrations , migrate on test app. add new test app settings in test , call migrate. reason makemigrations , migrate not seeing my_app.tests app not in settings. why looking @ different settings live settings overriding in tests? is best way test abstract models in django? how can make management commands @ overridden settings? from django.conf import settings django.core.management import call_command django.test import testcase django.test import override_settings my_app.tests.models import uniqueslugtestmodel class uniqueslugmodeltestcase(testcase): @override_settings(installed_apps=settings.installed_apps + ['my_app.tests']) def setup(self): print(setting...

java - findViewById cannot resolve method -

i tried use textview here error "cannot resolve method" findbyid . figured out, because class not extends class activity don't know hot fix it. getactivity() in front of setcontenview , getview in oncreate worked first time built app. there simple way display string , integer in textview? my xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.mbientlab.metawear.starter.devicesetupactivityfragment" tools:showin="@layout/activity_device_setup...