Posts

Showing posts from June, 2011

Rails create action Ajax returns Template Missing or Unknown Fomat -

i'm trying implement private_pub on one-to-one chat app, without private_pub works fine not ideal chat app since no websocket used autoupdates. tried implementing on railscasts of private_pub getting either template missing or unknown format. here code: routes resources :conversations resources :messages end i have button in user show page start chat(which creates/uses conversation , shows conversation show page 1 one chat box on facebook/gchat , conversation has many messages): <% unless current_user == @user %> <%= link_to "send message", conversations_path(:sender_id => current_user.id , :recipient_id => @user.id ), :method => :post, class: "btn btn-success btn-xs start-conversation" %> <% end %> conversation controller class conversationscontroller < applicationcontroller before_filter :authenticate_user! layout false def create if conversation.between(params[:sender_id],params[:recipient

performance - Varying benchmarks for same function in javascript -

i've started using performance api in javascript analyze execution time of functions. code given below: var init,fint; init = performance.now(); functioncall(); fint = performance.now(); console.log(fint-init); when run code multiple times, each time different outputs though code , values involved same. difference as +80%. (i talking milliseconds, still...). sample o/p: 6.053819752878553 9.16106501362151 5.987994283801299 is there anyway make these outputs have lesser variance each other? not asking code above, there better alternative profiler? there development environment (i using latest chrome, not many extensions)? (for instance, iterating in loop , taking average better way go?)

php - Multiple-filters real-time implementation with MySQL -

i'm developing php application real-estate portal, , have mysql database properties table. table has 500,000 rows , 20 columns property features. assume each feature integer. examples of features: number of rooms in apartment (1-10) type of building (1-20) condition of building (1-10) i need implement web page multi-filter real-time navigation panel. idea users can select several features equal particular values. example: 1-2 rooms ("1","2"), building of 196x ("6"), state average, or excellent ("3","4","5"), in particular city. the key requirement ability users see number of matching properties near each feature filter, taking account selected filters. this example how should like: rooms: 1[x], 2[x], 3[ ] (15000 more), 4[ ] (10000 more) state: bad[ ] (1000 more), average[x], excellent[x] year: 1950[ ] (19000), 1960[ ] (20000), 1970[ ] (18000) city: a[ ] (25000), b[ ] (18000), c[ ] (30000) price: <100

How to create a database on IBM Bluemix? -

i have created application on bluemix. need copy database on bluemix can accessed adapter. can give me detailed steps on how proceed? first thing: if database reachable through internet , need connect application, please note cf application on bluemix can access public network , able connect db in scenario. assuming have requirement migrating db on bluemix, didn't specify kind of database want migrate, here main (not all) possibilities have: rdbms: postgresql compose (you need account on compose.io) sql database (db2, premium plan available) cleardb (mysql) elephantsql (this postgresql service - have work on db via api) you use rdbs capability of dashdb no-sql: cloudant (documental) redis compose (ultra fast key-value db. need account on compose.io) mongodb compose (you need account on compose.io) ibm graph (graph no-sql db) i suggest take @ bluemix catalog (subcategory data , analytics) , refer docs well.

javascript - How to achieve a sticky table header and few columns (with checkbox or inputs on each columns) -

having problem using jquery library on getting done. 1 problem occur cant check checkbox on sticky columns, cant click , type on text fields, etc. im using jquery stick table headers , checked demo . made changes, added checkbox on 1st row 1st column. checkbox unclickable. sampel code > this . this might you! write in css file table.sticky-col{ opacity: 1 !important; }

python - Force multiprocessing.Array to be created in memory instead of on disk -

i using python 3.4 on linux. want create array in ram shared processes spawned multiprocessing module (i.e. shared memory). according documentation, should possible using multiprocessing.array . when use array = multiprocessing.array('i', n) python creates file in /tmp , zeroes it, , uses through mmap.mmap() shared memory (i have verified looking /usr/lib/python3.4/multiprocessing/heap.py ). however, array created in memory, not on disk. reason in use case, n large (more 100 gb), have lot of ram low disk capacity. creation of multiprocessing.array() ends ioerror: no space left on device because uses file on disk shared memory rather ram. i able around mounting directory via tmpfs , setting tempfile.tempdir point directory. however, there easier way? why python creating shared memory in way? the short answer no. long answer, read this: enter link description here you can use os.fork() pass copy of parent's memory child can't share address sp

entity framework - EF - Changing table name not working -

Image
changing table names doesn't seem working different. decided test on separate project clarify i've tried far. i have database 4 tables "restaurants" , "restaurants2" has same structure i started new mvc 4 project "internet application" being selected created 3 class database error message code public class mydb : dbcontext { public mydb() : base("name=defaultconnection") { } //(1) protected override void onmodelcreating(dbmodelbuilder modelbuilder) //{ // //changing database table name metadata // modelbuilder.entity<restaurant>() // .totable("restaurants2"); //} //(2) protected override void onmodelcreating(dbmodelbuilder modelbuilder) //{ // modelbuilder.entity<restaurant>().totable("restaurants2"); // // otherwise ef assumes table called "products" //} //(3) protected override void onmodelcreatin

PHP app not communicating with certain MYSQL databases -

i have php web app has been working fine until today (it sitting on windows/iis server). when attempt access page connects mysql database, blank page in firefox. in ie 500 internal server error. normal php works fine, when try connect database. mysqli connection not giving error messages. the weird thing - have phpmyadmin on same server , working fine, can see database , interact it. i have database on server working fine, user attached database has read access (as archive database), php web app connecting works. what have tried? initially thought user issue, created new user in phpmyadmin full privileges , had php app log on using instead, same result. i thought issue database, copied data , structure new database, same result. the mysql.err log file has no errors , indicates server accepting connections (which is, phpmyadmin working). i have tried writing test script: <?php //debugging ini_set('display_errors',1); ini_set('display_startup_errors'

java - Jax RS path param not working for accented characters -

hi have jar rs method below @get @path("/versioning/{subjectid}") @produces("application/json") where subjectid path param when invoke service using below request /v6.0/xyz/versioning/001033918in73804cáritastg it gets changed automatically apache cxf /v6.0/xyz/versioning/001033918in73804c%c3%a1ritastg i assume cxf default encoding path param however below error 2016-02-22 16:29:49,177 warning [org.apache.cxf.jaxrs.interceptor.jaxrsininterceptor] (http-127.0.0.1-8092-1) no root resource matching request path is there way resolve this? this change not made cxf http client. encodes á %c3%a1 . cxf warning about no root resource matching request path this not problem of encoding of proper use of @path annotations. check there method matches url request.

How to run CKEditor package in Laravel? -

hi use package laravel 5.2 doesn't work me. can me ? <script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script> <script src="/vendor/unisharp/laravel-ckeditor/adapters/jquery.js"></script> <script> $('textarea').ckeditor(); // if class prefered. // $('.textarea').ckeditor(); </script> my console screenshot please try use jquery version 1.12.0, had same issue got resolved using j v1.12.0

how to apply a softer sharpness in java.awt.image.BufferedImage -

i know how improve sharpness of image javascript code. result steep me. know how apply softer sharpness, sharpness factor instance? in fact understand how sharpness operates through kernel screencapture = new robot().createscreencapture(new rectangle(x1, y1, x2, y2)); float[] data = [-1, -1, -1, -1, 9, -1, -1, -1, -1]; kernel kernel = new kernel(3, 3, data); bufferedimageop convolve = new convolveop(kernel, convolveop.edge_no_op, null); bufferedimage = convolve.filter(screencapture, null); file file = new file(imagetemp); imageio.write(bufferedimage, "jpg", file); this kernel seems softer, still : float[] data= [0.0f, -1.0f, 0.0f, -1.0f, 5.0f, -1.0f, 0.0f, -1.0f, 0.0f ]; thank attention original in pdf print screen capture sharpen result a convolution kernel operates on pixel , surrounding pixels. given weight matrix (whose center pixel), calculates weighted sum of pixel , surrounding pixels. with 3x3 matrix, 9 kernel values weights upper-left

How to create a Range from Table in schematiq -

i have schematiq table containig data have read csv , parsed columns. want create myself data link range object representing each column can pass multiple stats functions. i've tried =rng.subset(b5,1,1) on table had hoped create range first column, in views see results in 1x1 range containing whole table. what's correct syntax? when return array schematiq function, there 2 possible forms array take. 1 "range", i.e. data-linked object exist in single cell regardless of size, other array function result, fill whatever range array formula has been entered in. the easiest way values out of table array use tbl.getvalues() , if use without column argument returns rectangular array containing data in table. however, returned array function result, in order put range need use rng.create() on result. following should work in case: =rng.create(tbl.getvalues(b5)) or, specific column: =rng.create(tbl.getvalues(b5, "columnname"))

java - Reading output of a C++ DLL using JNA -

i have following "system": c++ dll -> c dll -> java jna the c++ dll third party dll, wanted use java using jna. jna works better c c++, made c wrapper load c++ dll (using loadlibrary), in java, jna, load c dll , access functions exported c wrapper. i guess there may better design work c++ dll in java, not point here, , seems work. my problem c++ dll writes on stdout , stderr, messages written c++ dll not displayed in java console, though messages written c wrapper displayed. solution read output of c++ dll java ? so far tried make "test wrapper" in c++, directly loads c++ dll using loadlibrary , use functions, output of c++ dll displayed correctly. then tried call freopen() redirect stdout file c wrapper. when using "test wrapper", output of c++ dll redirect file, when calling c wrapper jna, output of c wrapper , of java redirected file (output of c++ dll ignored). the c++ dll compiled msvc 2013, , c dll wrapper too. working windows

asp.net mvc - ViewModel Contents are Null after Posting Form to Controller -

so viewmodel has 2 sets of data. currentdetails , updateddetails. both instances of same class carries strings , whatnot inside etc. this method has worked other views , models i've attempted with, 1 instance, when form posted controller, contents (currentdetails , updateddetails) both found null. i've tried changing parameter name model test , other arbitrary things, no avail. the 1 thing worked (but not solution me) not having instances of class inside viewmodel, , having data there (but don't see why should forced things way. here's controller: [httppost] public actionresult floristprofile(merchantfloristprofileviewmodel test) { if (!modelstate.isvalid) return view(test); using (var db = new applicationdbcontext()) { florist florist = db.florists.find(merchantbase.floristid); if (request.form["editsubmit"] != null) { florist.name = test.updateddetails.name; florist.website

html - How to use index of loop in Post method PHP -

i need help! trying save variable in sql table using php have problem. there 2 questions in php, first concern continent , second depended continent. want use loop check of continents has been selected in first question , save value of second question. hide option of unchecked continent using javascript code (i don't have problem). the html code: <form method="post" action=""> <fieldset><legend>continents</legend> <select id="q1" name="q1"> <option value="1">africa</option> <option value="2">asia</option> <option value="3">australia</option> <option value="4">america</option> <option value="5">europe</option> </select> <select id="q2" name="africa"&g

java - How to add a new static parameter without affecting the olders one? -

i have read user name of fabricant , type of key. have defined class "article" string fabricant , list of types of keys. if have add new type it's okay if have add new fabricant, new name of fabricant changes 1 before. code( class allarticle it's set of articles): cle.mtype = textntype.gettext(); set <string> ntype = new hashset<>(); boolean found = false; string antes = article.mfabricant; allarticle allarticle = new allarticle(); allarticle.importfrom("article.txt"); for(string fabric : allarticle.getfabricants()){ if(fabric.equals(antes)){ found = true; allarticle.gettypeforfabricant(antes).add(textntype.gettext()); allarticle.exportto("article.txt"); } } if(found == false){ ntype.add(textntype.gettext()); allarticle.addarticle(new article(antes,ntype)); allarticle.exportto("article.txt"); } with debug have founded problem inside second if in add function. think has

Relative path reference to XML file in XSLT does not find elements -

Image
i have 2 xml files containing elements in different languages. position in forders following: i want load value of elements dynamically, according language selected , passed xsl document. let's call it: <xsl:variable name="messagebundle_lang">lang1.xml</xsl:variable> i like: <xsl:variable name="mainroot">../xmlfiles/</xsl:variable> <xsl:variable name="root" select="string(concat($mainroot, $messagebundle_lang))"></xsl:variable> <xsl:value-of select="document($root)/data/xml_element_1" /> this work locally, after deployment elements loaded dynamically not appear in pdf generated based on test.xsl . presume because of this: ../xmlfiles/ how include path of xml files? can problem of os dependent path separator?

iteration - Iterating over resultset with comparison of column name - in python with Mysqldb -

i want use python populate database. have values out of table, calculate score , fill score anoter table. cant figure out how can compare column names of row resultset. because dont need of columns calculate, need few others id , type_name none calculation. want this: cur = connection.cursor() query ="select * table" cur.execute(query) rs = cur.fetchall() row in rs: col in row: // if(col = "x" or col = "y" or col = "z"): calc ... // else: use id, type_name whatever ... how can achieve this? else code blow bomb. maybe searching answer too. of previous comment, solve that field_names = cur.description row in rs: index, col in enumerate(row): name = field_names[index][0] if(name == "..."): ... elif(name == "..."): ...

responsive design - Call jquery method on desktop -

i have following jquery call on website , actioned if visitor using desktop device (screen size on 767px). how can achieved? script <script>$("#sidebar").stick_in_parent();</script> you can check window width, keep in mind, there handhelds on 767px width. not "desktop check". if( $(window).width() >= 767 ) $("#sidebar").stick_in_parent();

android - How to make recording button like WhatsApp? -

i'm trying create button such whatsapp (for android) record audio, , same animation. how should do? floating action button of material design can't. did saw telegram code ? maybe can find "lights" https://github.com/drklo/telegram

html - Kendo Grid Row Grouping Not Working -

i using kendo first time , attempting convert html table kendo grid. upon initialization, want table grouped specific column , not groupable other column. below contrived example of table of cars grouped car's make demonstrates how attempting group specific column upon initialization. this attempt not cause table grouped. know kendogrid call working, because if set groupable true able group column via drag , drop, initial grouping still not occur. suspect somehow group field "make" not being tied make column, examples i've seen seem indicate can accomplished using data-field have done. <table id="carsgrid"> <thead> <tr> <th>year</th> <th>color</th> <th data-field="make">make</th> </tr> </thead> <tbody> <tr> <td>2010</td> <td>red</td>

c# - database validation in WPF MVVM -

in mvvm implement simple validations in model class implementing idataerrorinfo question how can validate business rules in mvvm user exist, etc.. thinking implement business rules on save command, problem how can show error user in validation error template way idateerrorinfo show error if use wpf 4.5 should take advantage of inotifydataerrorinfo you want async validation here because need reach out database. here nice articles background information: wpf 4.5 – asynchronous validation https://anthymecaillard.wordpress.com/2012/03/26/wpf-4-5-validation-asynchrone/ wpf 4.5 – part 1 : asynchronous data validation http://www.jonathanantoine.com/2011/09/18/wpf-4-5-asynchronous-data-validation/ hth

javascript - Highcharts: some x-axis labels are disappearing after using setExtremes() -

Image
i developing solution question here on stack overflow (see highcharts : selection ) has simple slider elements (using input type="range" ) change categories shown in column chart. whenever user changes range in either slider element, chart redrawn using setextremes() . i noticed that, in instances, of x-axis labels disappeared, when moved sliders original positions. i've tinkered number of x-axis settings, including minpadding , startontick , , tickinterval , , none of them seem solve "the case of missing labels." the first screenshot below shows chart when it's first loaded. of x-axis labels present. the second screenshot below shows chart when change 1 of sliders. of x-axis labels missing. looks they're being staggered. here's plot thickens: if adjust sliders other values, of labels come back: here's fiddle developed can see live example of behavior: https://jsfiddle.net/brightmatrix/uvat8u05/ i'm curious know why happ

java - How to populate a ChoiceBox with objects from a List -

i wan't populate choicebox list<object> . object has name field wan't use choice text. of course need know object user has selected in order pass correct data. fxml controller: public void initialize(url fxmlfilelocation, resourcebundle resources) { universitiesservice uniservice = new universitiesserviceimpl(); list<university> unilist = uniservice.getuniversitieslist(); //unichoicebox.setitems(); need guidance here } university entity: private string universityname; private string universityurl; private string[] universitydatanames; //getters setters just do unichoicebox.getitems().setall(unilist); if need configure display (i.e. if tostring() method in university doesn't give text need), add converter: unichoicebox.setconverter(new stringconverter<university>() { @override public string tostring(university uni) { return uni.getuniversityname(); } @override // not used... public u

osx - how does php composer know the php version? -

having upgraded test site (debian linux) zend framework 3, want repeat exercise on os x el capitan running server 5.1.5. had php 5.5.x installed i've upgraded php 5.6.x , verified phpinfo() display. however, when try run composer install zend framework 3 modules, responds can't done php 5.5.x installed. restarting etc. makes no difference. how composer tell php version in use , how can convince php 5.6.x installed? when understand correctly, server php 5.6 , should able run zf3, cli php 5.5 , composer stops fetching zf3 modules, because php low, right? you have 1 php cli , php server. when run composer check php version of running php used cli. two solutions come mind: update php used on cli or append --ignore-platform-reqs composer command. ignore env checks , pretend ok. keep in mind disable checks extensions, might needed of modules.

nlp - CRF model making is taking too much time -

i following link making crf model . using following command making model. java -cp stanford-ner.jar edu.stanford.nlp.ie.crf.crfclassifier -prop austen.prop model made training data , taking time. when closely observe happening in system. it using 1 core of computer. can run command in way should use many cores of computer? implemented single thread. there support of multi-threading? if yes kindly share. make sure download latest version of code (version 3.6.0). should run multi-threaded default.

Parse Server Cloud Code Setting ACL -

i try set acls code below, in mongolab database not see acl settings. doing wrong in code? not find tutorial cloud code examples. parse.cloud.aftersave('_user', function(req) { var user = req.user; var acl = new parse.acl(); acl.setreadaccess(req.user, true); acl.setwriteaccess(req.user, true); user.setacl(acl); user.save(); }); parse.cloud.aftersave('usersetting', function(req) { var userset = req.object; var acl = new parse.acl(); acl.setreadaccess(parse.user.current().id, true); acl.setwriteaccess(parse.user.current().id, true); userset.setacl(acl); userset.save(); }); i figured out code below. problem was trying use "aftersave" method while trying adding acl requested object, however, acl should added before saving, or if should done after saving, object should retrieved again , acl should added. parse.cloud.beforesave('usersetting', function(req, res) { var acl

php - Calendar app take value date(January 1st, 1970) as default in frontend if device language is english[Hongkong SAR china] -

calendar app take value date(january 1st, 1970) default in frontend if device language english[hongkong sar china] in website based on magento framework.is there solution current time? , problem in internet explorer. here screenshot finally problem solved. , code here, ( works in browser because of constant english[us] time format , doesn't care browser's language.) before, $currentdate = new zend_date(mage::getmodel('core/date')->timestamp()); after, $currentdate = new zend_date(mage::getmodel('core/date')->timestamp(),null, "en_us");

parse.com - Parse Querying Limit -

if have pfquery search through every user limit results 3 users, query search through every user , give me 3 users? or query pause/stop once 3 people have been found? thanks! the query stop searching once finds set pfquery's .limit . and if want have pages of 3 users, can use .skip property , e.g. .skip = pagenumber * 3 .

Windows 10 Phone Build To Support Android APK -

i'm trying run apk windows phone running latest version of os - 10. followed link installation. i've failed, maybe due os build . from list inscribed there models of windows phone, not build no. mine model - lumia 535 dual sim what windows build minimum no. run android apk?

jquery - Table Tree in angular2 -

i trying make tree table in angular 2 using jquery-treegrid. 1. added jquery-treegrid dependency on package.json. 2. install typescript jquery library: tsd install jquery 3. add html code: <table class="tree"> <tr class="treegrid-1"> <td>root node</td><td>additional info</td> </tr> <tr class="treegrid-2 treegrid-parent-1"> <td>node 1-1</td><td>additional info</td> </tr> <tr class="treegrid-3 treegrid-parent-1"> <td>node 1-2</td><td>additional info</td> </tr> <tr class="treegrid-4 treegrid-parent-3"> <td>node 1-2-1</td><td>additional info</td> </tr> </table> my component class: declare var jquery:any; @component({ selector: '[configuration]', template: require('./configuration.html'), encap

What is the smartest way to copy a Map in Kotlin? -

i'd new instance of map same content map doesn't have built-in copy method. can this: val newinst = somemap.map { it.topair() }.tomap() but looks rather ugly. there more smarter way this? just use hashmap constructor: val original = hashmapof(1 "x") val copy = hashmap(original) update kotlin 1.1: since kotlin 1.1 , extension functions map.tomap , map.tomutablemap create copies.

Javascript slideUp / slideDown / one button -

i having trouble of solving problem. have 2 buttons, 1 slideup , other slidedown. have 1 button toggle instead of having 2. thanks. i have code in html: <div id = "box">show / hide</div> <button onclick="slideup('box');">slide up</button> <button onclick="slidedown('box');">slide down</button> and have code in css: body{ background:grey; } #box{ width:400px; height:400px; background:orange; margin:0 auto; margin-top:3%; overflow:hidden; } and javascript code this: function slideup(el) { var elem = document.getelementbyid(el); elem.style.transition = "all 2s ease-in-out"; elem.style.height = "0px"; } function slidedown(el) { var elem = document.getelementbyid(el); elem.style.transition = "all 2s ease-in-out"; elem.style.height = "400px"; } you can create css class height:0 rule, , toggle class js : v

javascript - Is it a good practice to invalidate cookie/localStorage data when signing out? -

i have spa written in react , store access token in localstorage , when make api requests, local storage , send header. my questions: 1) practice remove data localstorage when user signs out? or should ask backend developer add /signout endpoint? 2) there security concerns should take account if store access token in local storage? as answer question one. 1) should invalidate token / session in backend depending on api design. 2) it's recommended store tokens in bestcase in cookies because of security concerns, webstorage few possible security concerns. https://stormpath.com/blog/where-to-store-your-jwts-cookies-vs-html5-web-storage

Bcrypt and Rails finding an admin user just by entering password -

i'm building app has 3 models (customer, points, admin). customer has points, points belong customer. admin has user_name , password_hash attributes, storing passwords via bcrypt. once customer searches via phone number, points show up. add points, admin has log in password (code of 4 digits) access adding points. i'm having trouble how find admin via password, not user_name , password. class adminscontroller < applicationcontroller def new @admin = admin.new end def create @admin = admin.new(admin_params) if @admin.save redirect_to root_path else flash[:error] = "incorrect data, please check form" render new_admin_path end end def login @customer = customer.find(params[:id]) # need input password params[:password] # change inputed password password hash # inputed_password_hash (need here) # compare password hash password hashes in admin model/database # see if exists. # if true, send add points page # i

python readline from big text file -

when run this: import os.path import pyproj srcproj = pyproj.proj(proj='longlat', ellps='grs80', datum='nad83') dstproj = pyproj.proj(proj='longlat', ellps='wgs84', datum='wgs84') f = file(os.path.join("distal-data", "countries.txt"), "r") heading = f.readline() # ignore field names. open('c:\python27\distal-data\geonames_20160222\countries.txt', 'r') f: line in f.readlines(): parts = line.rstrip().split("|") featurename = parts[1] featureclass = parts[2] lat = float(parts[9]) long = float(parts[10]) if featureclass == "populated place": long,lat = pyproj.transform(srcproj, dstproj, long, lat) f.close() i error: file "c:\python27\importing world datacountriesfromnad83 towgs84.py", line 13, in line in f.readlines() : memoryerror. i have downloaded countries file http://geonames.nga.mil/gns/html/namefiles

python for x in y loop does not complete -

trying make script extracts song information playlist. this beginning of playlist: #extm3u #extinf:402,junior's eyes - black sabbath /users/omitted/black sabbath/[1978] never die!/03. junior's eyes.mp3 #extinf:327,after forever - black sabbath /users/omitted/black sabbath/[1971] master of reality/02. after forever.mp3 #extinf:341,killing live - black sabbath /users/omitted/black sabbath/[1973] sabbath bloody sabbath/05. killing live.mp3 #extinf:210,rock 'n' roll doctor - black sabbath /users/omitted/black sabbath/[1976] technical ecstasy/06. rock 'n' roll doctor.mp3 and script wrote: import re f = open('sabbath.m3u', 'r') ptitle = re.compile('(?<=,)[a-za-z0-9][a-za-z0-9 \']+[a-za-z0-9]') partist = re.compile('(?<=- )[a-za-z0-9][a-za-z0-9 ]+[a-za-z0-9]') str in f: title = ptitle.search(str) artist = partist.search(str) print artist.group() + ' - ' + title.group() f.close() the result of runn

workflow - Is there a way to add html attributes to an existing html element with Emmet? -

i've been looking around , can not find answer this. suppose put cursor right between number 2 , greater sign in following h2's opening tag. <h2>hello world!</h2> and type .text-uppercase gives me: <h2.text-uppercase>hello world!</h2> after expand abbriviation , get <h2 class="text-uppercase">hello world!</h2> is there way achieve method?

android - HTML + JQUERY - Input type file added dynamically not work attribute capture = 'camera' on mobile -

i have next div: <div id="divllenarimgs"> <input type="file" class="img" name="img[]" accept="image/*" capture="camera"/> </div> when run web site in mobile (android or iphone) , click on input, camera shown attribute capture . but when add more inputs type file dynamically attribute capture stops work . first input always, next added inputs don't. is there reason happen? i add next inputs first one. , have tried many different browsers: safari, chrome, firefox , android default browser. edit : only work inputs using chrome android.

R returns strange order permutation -

i asking helps. struggling way r stores , treats data value. here example: i have matrix 4x3. on each row, calculate absolute different among each pairs (step 2 in code): xi_xj[i,1] = abs(x[i, 1]-x[i, 2]) # different btw 1st , 2nd elements xi_xj[i,2] = abs(x[i, 1]-x[i, 3]) # different btw 1st , 3rd elements xi_xj[i,3] = abs(x[i, 2]-x[i, 3]) # different btw 2nd , 3rd elements once xi_xj computed, order 3 elements on each row in increasing order , return index or permutation (step 3 in code). use function order() this. however, got strange return permutation 4th row of xi_xj containing (0.3, 0.6,0.3) . expect return permutation should {1, 3, 2} mean "the first element (0.3) comes first, followed third element (0.3 well), , second comes last (0.6)". when code running, returns me strange order {3,1,2}. confused here. have add #test1 , #test 2 in code, , see xi_xj[4,1] , xi_xj[4,3] "slightly different" amount of 1.110223e-16 weird. suspect due d

Sending signal/text from Linux Machine to Labview in Window -

currently i'm developing data acquisition program experiment in c++ linux based machine (ubuntu), have many vis in labview programmed in windows control instruments of experiment (motors, signal generator..). purpose have 2-way communication between 2 pc, linux ask vis executed, , when it's finished, send signal linux machine. questions are: can send signal or command labview in windows linux (terminal, , can implemented c code) , vice versa? how? tcp labview solution? or should try set inter-pc "talking" through serial communication (which easy setup physically)? the best (also easiest) way implement tcp-based client-server communication (tcp ensure data lossless. when using other mechanisms udp or serial should make sure commands received correctly). at labview site, have tcp listener (server) listen commands linux machine @ specified port. upon command reception, labview code can work , reply same tcp connection. this article question: htt

How to build android app with Gradle with not the latest version of maven artifact? -

i'm having app built gradle , requires maven module fs . android app requires version 1.1 (exists in local maven repo) it's not latest version of module in local maven repository (version 1.2 in local maven repo too): compile 'name.antonsmirnov.fs:fs:1.1' when trying build android app i'm getting error: executing tasks: [clean, :app:compiledebugsources, :app:compiledebugandroidtestsources] configuration on demand incubating feature. failure: build failed exception. * went wrong: problem occurred configuring project ':app'. > not resolve dependencies configuration ':app:_debugcompile'. > not resolve name.antonsmirnov.fs:fs:1.1. required by: ad_gradle:app:unspecified > inconsistent module metadata found. descriptor: name.antonsmirnov.fs:fs:1.2 errors: bad version: expected='1.1' found='1.2' > not resolve name.antonsmirnov.fs:dropbox:1.1. how can force gradle use not latest version o

typescript - Angular2 output double parameter signature -

hello there way pass 2 parameters in output function child component. i want call markquestion child component(answer-sheet) (q_number, value) parameters gives me errors. it works 1 parameter. http://plnkr.co/edit/4whot3 <answer-sheet *ngif="current_question" [questions]="questions" [question] = "current_question" [answer_list]="answers" (markquestion)="markquestion($event)"> </answer-sheet> markquestion(q_number:number, val:number){ console.log(q_number , "numaralı soru cevap anahtarından ", val, " olarak isaretlendi" ); //this.answers[q_number[0]] = {q_number[1]}; } export class answers { // @input() question: object; @output() markquestion = new eventemitter(); @input() answer_list; public question: object; nextquestionansweredbutton(q_number,val){ //there error @ calling next function -> supplied parameters not match ..

scala - How is List a monad? -

i think have basic grasp of monads , monadic operations still bit stuck on understanding how magic features of monadic type added underlying type (hope makes sense). for example, was reading how list[t] monad. if flatmap , map on lists sequentially in for comprehension isn't flatmap , map providing monadic magic? if create list<string> how monadic magic added? or list<t> monad in scala because happens 1 of containers language provides in-built monadic support for? you're right flatmap , map providing "monadic magic." there fortunately or unfortunately (depending on how bad code you've seen) no magic in programming. no amount of abstraction save (or else) writing code thing want. abstraction "just" lets re-use written code , clarify thoughts around problem. monad concept, idea, abstraction, etc. in case of scala literally compiler for comprehension, becomes series of flatmap , map , withfilter , , filter stateme

How can I check how many containers are running a certain docker image? -

i want check how many containers running image, using docker ps --filter ancestor ="imagename" , count number of containers.but machine not support command there way it? how about docker ps | grep imagename | wc -l

c# - What could stop default proxy being used -

as question manually setting proxy google youtube v3 api has not yielded results. thought ask seperate question causes of proxy not being used are. as stated in other question, have set following in web.config: <defaultproxy usedefaultcredentials="false" enabled="true"> <proxy usesystemdefault="false" proxyaddress="http://192.111.111.102:8081" /> </defaultproxy> which accounts should mean google api use proxy , port stated yet still getting connection refused error. having looked systems team, looks if request google api doesn't hit proxy @ all. so new question cause setting ignored , there other way of setting default proxy? not sure stopping default proxy being used work randomly not on other occasions, in end went coding in redundancy when default proxy failed work: private videolistresponse getvideolistreponse(string videoids) { // original call videolistresponse response = getvideo

javascript - Google Script EPOCH date creation -

i have google script needs 2 specific dates. 1) second day of previous month @ 8 gmt 2) first day of current month @ 8 gmt both dates need converted epoch times. i built on js fiddle : var = new date(); var year = a.getfullyear(); var month = a.getmonth(); if(month === 0){ var startdate = new date((year-1)+'-12-02 08:00 gmt'); var enddate = new date(year+'-'+(month+1)+'-01 08:00 gmt'); }else{ var startdate = new date(year+'-'+month+'-02 08:00 gmt'); var enddate = new date(year+'-'+(month+1)+'-01 08:00 gmt'); } this works fine, when use in google script, new date() fails , returns nan. i've read has js version google script uses, couldn't find on how format string above go through cleanly. what correct format? 1) replace - in date string / . 2) epoc date.gettime() /1000

css - How Bootstrap makes just Modal to scroll & not others? -

i'm creating modal bootstrap & ok. thing noticed bootstrap prevent overflowing of body tag when modal opens modal has property overflow if content in modal more height of screen ..., how did ? added overflow: hidden; body when modal opens & overflow: auto; modal, doesn't work ... basically, once take html element out of normal flow of elements, it's father element shouldn't effect element itself. so, body has overflow: hidden; , since overlay positioned outside of flow, overflow doesn't effect it. since .overlay have overflow-y: auto , scroll should appear content of element. so, once element positioned position: absolute or position: fixed , shouldn't effected it's predecessor's overflow body { overflow: hidden; } .overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow-y: auto; padding: 30px; background: rgba(0, 0, 0, 0.5); } .modal { marg