Posts

r - Select only matching files using multiple patterns in list.files -

i have following csv files , want select ones have matching 'pop' , 'throughput' values in each string: example_pop_high_throughput_high_strategy.csv example_pop_high_throughput_base_strategy.csv example_pop_high_throughput_low_strategy.csv example_pop_base_throughput_high_strategy.csv example_pop_base_throughput_base_strategy.csv example_pop_base_throughput_low_strategy.csv example_pop_low_throughput_high_strategy.csv example_pop_low_throughput_base_strategy.csv example_pop_low_throughput_low_strategy.csv i want these: example_pop_high_throughput_high_strategy.csv example_pop_base_throughput_base_strategy.csv example_pop_low_throughput_low_strategy.csv i can use list.files select files with, example, 'high': file_names <- list.files("made/up/path", pattern = c("high")) although, trying twice match 'high' , 'high', didn't work: file_names <- list.files("made/up/path", patte...

javascript - How to change the attribute of subitem are used by `use` element? -

i learn svg. want change circle fill value of second use . how can it? attempt: * { stroke: brown; stroke-width: 1; fill: none; } .canvas{ border-color: green; border-style: solid; border-width: 1px; } .sun > circle{ fill: yellow; } .hot-sun > circle { fill: red; } <?xml version='1.0'?> <!doctype svg public '-//w3c//dtd svg 1.1//en' 'http://www.w3.org/graphics/svg/dtd/svg11.dtd'> <?xml-stylesheet type='text/css' href='../css/index.css'?> <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='1400' height='1000' viewbox='0 0 1400 1000' class='canvas'> <title>svg learning</title> <desc>this sandbox</desc> <defs> <g id='foo' class='sun'> <rect x='0' y='0' width='50' height='50'/> <circ...

How to store a dictionary as a separate file, and read the file in a python script to use the variables -

i using python open file , use contents of file variables. have script looks this. #!/usr/bin/env python open("seqnames-test1-iso-legal-temp.txt") f: gene_data = {'ham_pb_length':2973, 'ham_pb_bitscore':5664,'cg2225_ph_length':3303, 'cg2225_ph_bitscore':6435,'lrp1_pf_length':14259, 'lrp1_pf_bitscore':28010,} line in f: if not line.isspace(): bitscore = gene_data[line.rstrip()+'_bitscore'] length = gene_data[line.rstrip()+'_length'] if (2*0.95*length <= bitscore/2 <= 2*1.05*length): print line where file "seqnames-test1-iso-legal-temp.txt" list of gene names ham_pb, cg2225, lrp1_pf, etc. included first 6 values of dictionary, has total of 600 keys. each in form 'name'_length, 'name'_bitscore 300 gene names in file "seqnames-test1-iso-legal-temp.txt". for ...

node.js - What are some ways to figure out related products/questions/items anything? -

what ways including machine learning can use in projects generate things related another. related apps, related websites, related products, etc. i've been brainstorming these strategies... one way can think of show items same category. broad. 2nd way improves upon previous step, it's keep track of people click next , promote item. meanwhile keep bottom list randomized let other relevant items show , clicked. 3rd way use machine learning , provide training data somehow , use that. i want simple smart, gets better time. collaborative filtering designed solving problem. problem approach produces results having lot of data only. mean... a lot . , it's not simple thing use. however, machine learning technique not simple. there node.js packages cf available, have no idea how they. wiki

How to put a live YouTube subscriber counter on my website -

i beginner when comes programming , have never used youtube api key. trying create live youtube subscriber counter can put website show how many subscribers have on channel. not sure or start. have easy , simple code can put website show subscriber counter? type of api key need this? data or analytics? appreciated!! in advance -mahdi you have use youtube data api , query channel resource. in statistics.subscribercount section of response, can find number need. remember trigger http calls after page has been loaded client refreshing data , working live fashion. you need data api key kind of use case. wiki

spring-data-elasticsearch: Highlighter not working -

i'm working spring-data-elasticsearch:2.1.6.release library, , can't seem able highlighting working. right now, query looks so: searchrequestbuilder request = client .preparesearch("stuff") .setsearchtype(searchtype.query_then_fetch) .setquery(matchquery) .setfrom(from) .addhighlightedfield("description", 10, 5) .addhighlightedfield(new highlightbuilder.field("title").pretags("<b>").posttags("</b>")) .addhighlightedfield(new highlightbuilder.field("description").pretags("<b>").posttags("</b>")) .sethighlighterpretags("<br>") .sethighlighterposttags("</br>") .setsize(pagesize); as can see, i'm trying under sun. no matter do, nothing seems work. further down in code, decided see fields might highlighted in se...

report - Show SSRS KPI in website or webpage -

i can show paginated report in website/webpage using report viewer. how can show kpi in website/webpage. as have created kpi in report folder , it's showing in web portal, need kpi in own website iframe using report viewer or related that. wiki