Posts

Showing posts from August, 2011

json - Proces files fast in loop with function in R -

i have read 88 thousand json files , process them. r-script looks this: webshop_id = numeric() serving = data.frame(value = numeric(), unit = character()) alcohol = data.frame(alcoholpercentage = numeric()) voeding = data.frame(character()) filenames <- list.files("d:/thijs/documents/ah/productfeatures/allproducts", pattern="*.json", full.names=true) tic() (i in 1:length(filenames)) { df = fromjson(filenames[i]) webshop_id = c(webshop_id, df$product$webshopid) if (is.null(df$productlabels$alcoholpercentage)==true){ alcohol = rbind(alcohol, alcoholpercentage = na) } else{ alcohol = suppresswarnings(rbind(alcohol, alcoholpercentage = as.numeric(gsub("%","",df$productlabels$alcoholpercentage)))) }if (length(df$productlabels$nutrition$nutritionvalues[[1]])==0){ temp_row = data.frame(matrix(c(rep.int(na,length(voeding))),nrow=1,ncol=length(voeding))) colnames(temp_row) = colnames(voeding)

elasticsearch - Concurrent file parsing and inserting into Elastic Search -

i playing go , come small script parses log files , inserts them elastic search. each file spawned goroutine this: var wg := sync.waitgroup{} wg.add(len(files)) _, file := range files { go func(f os.fileinfo){ defer wg.done() processfile(f.name(), config.originfilepath, config.workingfilepath, config.archivefilepath,fmt.sprintf("http://%v:%v", config.elasticsearch.host, config.elasticsearch.port),config.providerindex, config.networkdata) }(file) } wg.wait() inside of processfile have function sends elastic search: func bulkinsert(lines []string, es *elastic.client) (*elastic.response, error){ r, err := es.performrequest("post", "/_bulk", url.values{}, strings.join(lines, "\n")+"\n") if err != nil { return nil, err } return r, nil } the problem don't understand how goroutines work. understanding sending elastic search blocking 1 of goroutines executing. tried spawning gorout

pgadmin - Impossible to connect to LocalHost Xampp 127.0.0.1 -

Image
am unable connect xampp pgadmin problem ? do need check port in firewell, think port 5432, locked

Check if array is consecutive then delete values in between vba -

i have array being set selected items listbox. need know how check see if there consecutive values in array delete values between lowest , highest values of consecutive numbers. here example show mean: dim sheets() long dim selected string redim sheets(i) = 1 listbox1.listcount - 1 if listbox1.selected(i) = true selected = listbox1.list(i) redim preserve sheets(i) sheets(i) = selected end if next the array used solidworks api function sets print sheet range. why cant have more 2 consecutive numbers. that being said if there easier way based on deselecting consecutive listbox items ears too. thank you with these values in listbox (all selected), get: listbox result -> array(1, 3, 5, 7, 9, 11) 1 1 3 3 4 5 5 7 7 8 9 9 11 11 option explicit public sub getminmaxofconsecutives() dim sheets() long, long, totalitms long dim prev boolean, nxt boolean, us

c# - How to check an element is displayed or not based on their style attribute in selenium? -

i guidances on how solve little issue below in selenium. basically, want check if menu appears. there 2 menus , if @ html code below, menus each contain 'style="display: none"' attribute. if menu opens up, display changed block , if it's closed displays changes none <div class="confirmation-price-summary__price-dropdown js-dropdown-content" style="display: none;"> <div class="confirmation-price-summary__price-dropdown js-dropdown-content"> <div class="confirmation-price-summary__price-dropdown js-dropdown-content"> <div class="confirmation-price-summary__price-dropdown js-dropdown-content"> <div class="confirmation-price-summary__price-dropdown js-dropdown-content"> </div> <div class="confirmation-price-summary__price-item js-dropdown-container" data-is-dropdown-open="false"> <div class="confirmation-price-summary__price-row co

BootStrap "navbar-toggle" class will open, but not close -

i'm creating navbar displays button when screen size below width; you've seen many other bootstrap sides. when button displayed , clicked, navigation links display in vertical dropdown, works intended. the problem comes when try close dropdown re-clicking link. no matter remains open. after inspecting live site, looks class 'in' added on first click, not removed on subsequent clicks (the toggle function). i'm @ loss how correct this, believe links correct in header. have experience problem? edit: clarification, understand write workaround in javascript document, don't want go down path if there more obvious solution. helping out beginner. <html> <head> <meta charset="utf-8"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" /> <link rel="stylesheet" href="https://maxcd

Using python 3.6 to transform dirty data from and Access database -

when 19 or 20 dad typed records of british army officers in world war 1 access 1.0 database. last 27 years or until remembered had done , decided should "put on internet" him (i had been drinking agreed). the news it's single table, bad news data typed in 1990 has not stood test of time. there lot of abbreviation , different spellings of things should same spoil of document , make search difficult. the csv header looks like: soldier,soldiername,notes,christian name,rank,regiment,appointment,grade,date appointed the data looks like: 2876,"furber","vice capt g w r stacpoole dso res of off lg29113 2984 26/3/1915. replaced lt h gordon ind army res of off lg29555 4121 20/4/1916.","m","capt","re see how word "captain" spelt "capt", spelt "cptn", "cpt" , on. i'd process file , correct these. using python 3.6 read in csv , substitute ranks in dictionary keys corrected rank

Android Studio google play run signed android application -

i have question. im new in android studio (came eclipse) and try implement google play services leaderboards , on. so far good. when upload signed apk (maybe important: use new feature google sign in) , install app on play store on device, app signing google play services correctly. fine. but when come ide , make there signed build , run directly in android studio, have message: installation failed.... install_failed_duplicate_permission package .... how fix ... how run signed apk out of ide ... or maybe ask why signings (uploaded one/google play store 1 , ide one) different , collide? has todo new google feature "google sign in" keys saved on google structure? some ask maybe, why i'm not deinstall app device , run on ide.. , problem gone ..but problem not sign google play services... gaves error sign_in_required and on eclipse remember had not problem. had modify keystore. or have here , use modified key? or there other solution in android studio ma

Do any search engines offer greater precision - when using quotes -

i trying find answer related "hping" utility; when search in google, bing , duckduckgo, hping - in quotes - returning results low precision (ie great recall, useless precision; in case of bing, no "hping" results (was 1 of few terms)). not programming question, perhaps meta one, community perhaps need precision when tackling issues specific terminology; know of search engine, or way accurate precision, current search engines or suggest alternative public search engine not mentioned above?

Compiling netty-tcnative dll for Windows 32-bit not working -

i unable compile netty tcnative dll windows 32-bit. have followed guide on netty site on how build, , of steps succeed except maven install. this log step: [info] scanning projects... [info] ------------------------------------------------------------------------ [info] detecting operating system , cpu architecture [info] ------------------------------------------------------------------------ [info] os.detected.name: windows [info] os.detected.arch: x86_64 [info] os.detected.classifier: windows-x86_64 [info] ------------------------------------------------------------------------ [info] reactor build order: [info] [info] netty/tomcatnative [parent] [info] netty/tomcatnative [openssl - dynamic] [info] netty/tomcatnative [openssl - static] [info] netty/tomcatnative [boringssl - static] [info] netty/tomcatnative [libressl - static] [info] [info] ------------------------------------------------------------------------ [info] building netty/tomcatnative [parent] 2.0.7.final-snaps

javascript - JS/Underscore: _.groupBy or _.uniq to get unique/grouped elements of field is existing -

a mongodb query gives me result array this: var result = [ { _id: 'grrq56zvtgpsajvcr', title: 'element 1' meta: { groupid: '1' } }, { _id: 'nqs7t5qzcjbyxe6yh', title: 'element 2' meta: { groupid: '1' } }, { _id: 'cbdqv6exzoyjqjlnp', title: 'element 3' meta: { groupid: '2' } }, { _id: 'v6exzoycbdqjqjlnp', title: 'element 4' meta: { groupid: '2' } }, { _id: 'qbqiegwsgyprfutzm', title: 'element 5' meta: { } }, { _id: 'rfutzmqbqiegwsgyp', title: 'element 6' meta: { } } ] now need output each element without groupid , single element each identical groupid. (i cannot use distinct or aggregate directly on mongodb query, have work result) so i'm thinking of using _.unique or _.groupby . const resultgroupby =

visual studio 2015 - VS2015 C++ CLR Project GetForegroundWindow() Not Starting up -

i trying code program see current application open , base on application something. create empty clr project using vs 2015 c++. there @ moment have textbox , button start. have below code in myform.h file below code vs generates form, textbox , button: private: void getapps() { hwnd hcurrentwindow = null; char title[256]; string stitle; while (true) { if (hcurrentwindow != getforegroundwindow()) { hcurrentwindow = getforegroundwindow(); getwindowtexta(hcurrentwindow, title, sizeof(title)); stitle = title; if (stitle.find("notepad++") != string::npos) { //npos returned find if substring wasn't found txtbox->text += "\r\n" + "notepad++"; } if (stitle.find("skype") != string::npos) { txtbox->text += "\r\n" + "skype"; }

sql - Delete All Rows apart from highest date -

i have table looks this. id | create date ---+------------------------- 1 | 2007-06-12 15:44:10:000 1 | 2007-07-12 15:44:10:000 2 | 2007-06-12 15:44:10:000 2 | 2007-07-12 15:44:10:000 2 | 2007-08-12 15:44:10:000 3 | 2007-09-12 15:44:10:000 4 | 2012-06-12 15:44:10:000 5 | 2011-07-12 15:44:10:000 i need keep max(createdate) while deleting other rows. need keep rows id 3,4,5. any great. note: little abstract. actual table has millions of ids have many duplicate ids different create dates you can use row_number() identify records have recent date, , delete rest: ;with todelete ( select *, row_number() on (partition id order createdate desc) rn yourtable ) delete todelete rn <> 1

reactjs - react ajax request using axios -

i'm using axios make ajax request. i'm newbie making ajax request , not understanding why code isn't working? have deleted code has nothing question on why not working. error showing "get https://api.github.com/users/ $%7bthis.state.usersname%7d 404 (not found)". maybe i'm writing request wrong in url part... import react 'react'; import reactdom 'react-dom'; import './index.css'; import app './app'; import registerserviceworker './registerserviceworker'; import axios 'axios'; const card = (props) => { return( <div style={{margin: '1em'}}> <img src={props.avatar_url} width="120px"/> <div> <div>{props.name}</div> <div>{props.company}</div> </div> </div> ); }; const cardlist= (props) => { return( <div> {props.

c# - Textbox not displaying value after selecting from ComboBox Dropdown -

so have combo box , have list made using keyvaluepair<int, decimal> . want textbox have selected show value according key when select drop-down textbox. relevant code: // make list of truck weight , mpg. list<keyvaluepair<int, decimal>> weightmpg = new list<keyvaluepair<int, decimal>>(); private void mainform_load(object sender, eventargs e) { decimal k = 7; (int = 20000; < 40000; i+=1000){ weightmpg.add(new keyvaluepair<int, decimal>(i, k)); k -= 0.1m; } (int = 40000; < 45000; i+=1000){ weightmpg.add(new keyvaluepair<int, decimal>(i, 5)); } weightmpg.add(new keyvaluepair<int, decimal>(46000, 4.9m)); weightmpg.add(new keyvaluepair<int, decimal>(47000, 4.8m)); weightmpg.add(new keyvaluepair<int, decimal>(48000, 4.7m)); truckweight2.datasource = weightmpg; truckweight2.valuemember = "value"; truckweight2.displaymember = "key";

osx - How to remove hidden MacOS files from a zip file? -

when creating zip file on macos result in many hidden macos files in zip archive. these files problematic when uploading application amazon via elastic beanstalk. how remove these hidden files zip file created on macos? the command can used delete hidden macos files zip file follows: zip -d filename.zip __macosx/\*

asp.net - Internet Explorer Takes Long Time in Creating and Sending Request ( Chrome works fine ) -

we have performance issue in internet explore functionality same works fine in chrome ( difference in more minute on performance between ie , chrome ) this legacy asp.net web application hosted in iis , web page has user controls, buttons , grids. we did analysis , found ie taking close 60 seconds before sending request server after button clicked in page. please find attached network capture screenshots( ie takes around 70 seconds send request ) network capture screenshot network capture screenshot any in resolving issue appreciated thanks, nanda

uiviewcontroller - Swift - Make segue from SKScene to Viewcontroller (game crash after getting out and then in to game) -

ok.. have problem, , cant figure out doing wrong, hope can med! have made game, , works should, can play, quit , restart. when score enough points, viewcontroller here @ medal. problem comes, when user goes game again after picking medal. game wont show game-scene. i use notificationcenter in gameviewcontroller, make segue gamescene. , try in ways remove scene viewcontroller, because think problem lies there. nothing seems work :( in gameviewcontroller have: notificationcenter.default.addobserver(self, selector: #selector(gameviewcontroller.doasegue), name: nsnotification.name(rawvalue: "doasegue"), object: nil) func doasegue(){ let skview = self.view as! skview skview.presentscene(nil) self.dismiss(animated: false, completion: nil) print(self.view) self.performsegue(withidentifier: "gametooffer", sender: self) } and when player dies use code in skscene, before make segue: if won { self.r

ember.js - ember data findRecord return value is not the expected record -

Image
i starting ember , picking javascript again after few years. have basic question. i have login page - login route , controller. have setup ember cli mirage endpoint return applicantsinfo data, when calling /applicantsinfo/123 import ember 'ember'; export default ember.controller.extend({ applicantsinforecord: '', username: '', password: '', actions: { submitauthform() { const username = this.get('username'); const password = this.get('password'); // call mirage this.get('store') .findrecord('applicantsinfo', username) .then((applicantsinforecord) => { this.set('applicantsinforecord', applicantsinforecord); console.log('inside function',applicantsinforecord); this.transitiontoroute('form-edit'); }) .then((error) => { console.log('then error happened', error); this.set('

bash - Modify first column on my data file -

i trying modify first column on xyz file. tried awk , worked, erased lines in new file created modified data. here head of original data. 1500 atoms. timestep: 0 1 6.3115 6.3115 6.36745 2 6.3115 6.3115 9.47036 2 6.3115 3.15575 6.39316 2 3.15575 6.3115 6.39316 3 3.15575 3.15575 8.83622 4 3.15575 3.15575 3.90335 5 8.53643 8.92983 8.45625 5 4.08657 8.92983 8.45625 i used code modify first column file: awk 'nr==fnr{a[$1]=$2;next} {$1=a[$1]}1' reemp.txt traj300.xyz > tra300.xyz but new file looks timestep: 0 pb 6.3115 6.3115 6.36745 6.3115 6.3115 9.47036 6.3115 3.15575 6.39316 3.15575 6.3115 6.39316 c 3.15575 3.15575 8.83622 n 3.15575 3.15575 3.90335 hc 8.53643 8.92983 8.45625 hc 4.08657 8.92983 8.45625 the modification good, erased first , part of second line. problem list has 75 million lines different timesteps , configurations, , code erased same thing in every configuration. your pro

spring - Junit Mockito:How to Pass parameters: Arraylist,int value to Rest Junit API -

i writing junit rest api , have junit test method below snippet , can 1 tell me how can pass arraylist , int type of data when using mockito. can please tell me. test invocation eg: ` list<myuser> myuserlist = new arraylist<myuser>(); myuser user1 = new usrhelper().create(); myuser user2 = new usrhelper().create(); myuserlist.add(user1); myuserlist.add(user2); mvcresult result =mockmvc.perform(post("/test1/test2/test3").contenttype(mediatype.application_json).content(jsonutils.tojsonstring(myuserlist)).param("myuserid", 1234).param("id", "abcd123")).andexpect(status().isok()).andreturn();` in above myuserlist arraylist , myuserid - int value. please let me know. i got soultion , mapping parameter passed correctly. wrong parameter name (myuserid) passed. got fixed problem.thank you

python - Anybody get django cookiecutter to work with anaconda instead of virtualenv? -

just when think i'm starting handle django start reading 2 scoops of django advise use cookiecutter instead of regular django-admin startproject. authors of 2 scoops big on virtualenv. i've been using anaconda because everywhere says it's better virtualenv. i'm tempted rid of anaconda , use virtualenv try work, figured i'd ask here first. anybody know how cookiecutter work anaconda??? i think you're bit confused anaconda , virtual environment is. @ end of day, both python installations (hopefully) include binaries needed run code. the answer question use virtual environment, not anaconda project, store dependencies in requirements.txt file has project base code can install exact dependencies needed project virtual environment . so, difference? anaconda python bunch of preinstalled libraries geared towards data analysis. means programmer don't have worry installing matplotlib, pandas, or plethora of other libraries. includes binary executes

windows - Putting Python 3.5 and 3.6 into path and switching between them in command prompt -

i seek able type like python36 or python35 in command prompt be able run 3.6 or 3.5 shells, respectively. when type python in command prompt, opens 3.5 shell, , if try specify 3.6 typing python3.6 or python3.5 or python36 or python35 , doesn't recognize commands. both installations, checked "add path" box, , have since tried manually add them path using system settings/advanced/environment variables, etc, it's not clear me how best this. i using windows 7. you can add both folders environment variables , copy each python.exe python35.exe or python36.exe depending on version. then can execute using python35 or python36 execute different versions. for example: navigate python3.5 folder look python.exe file , make copy of named python35.exe you can use python35 in cmd run 3.5 version of python do same 3.6 , you're done.

algorithm - How to generate comprehensive Selenium variable name for complex HTML elements -

i trying develop own selenium page object generator. have encountered problem have generate meaningful names web elements. i know can "normal" elements: grab html element, id or class , use extracted id make normal variable name. example: <input type="text" name="username" size="10"> here can extract "name" attribute , generate variable name username. but let's there more complex html elements (link example). example: open google , type: selenium features , limitations. when inspect first link, looks horrible , complex: <a href="/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0ahukewizi6z3i6pwahwnkjokhvuvbm8qfggkmaa&amp;url=http%3a%2f%2fwww.testinginterviewquestion.com%2f2014%2f04%2fwhat-are-advantages-and-disadvantages_17.html&amp;usg=afqjcnefzcvjn3i-ijijif8wqych86k-_a" onmousedown="return rwt(this,'',&

jquery - Detect when an element is done loading new HTML -

i have load event in js file, uses .on('load') load in new html when clicking on pagination. however, need happen in script once html done loaded. far i've tried this, no luck. js-ajax-content-container element loading in new html. js-ajax-link pagination link click initiate load event. $('body').on('click', '.js-ajax-link', function() { $('body').on('.js-ajax-content-container', 'ajaxcomplete', function() { alert("loaded"); }); }); you can fire custom event in 1 script , listen in another. by way, arguments in wrong order on() . first pass event name , selector. $('body').on('click', '.js-ajax-link', function() { $('body').on('ajaxcomplete','.js-ajax-content-container', function() { $(document).trigger('ajaxlinkloaded'); }); }); and in script can listen event: $(document).on('ajaxlinkloaded', function(e){ //

How to encode PHP string of HTML for use as string by JavaScript function? -

i've got following code: <iframe id="uniqueid" frameborder="0" width="100%" height="100%"></iframe> <script> var iframeobject = document.getelementbyid("uniqueid"); var iframecontent = iframeobject.contentwindow.document; iframecontent.open(); iframecontent.write("<?php echo $htmlstring ?>"); iframecontent.close(); </script>; i'm trying insert user-generated html (metadata, <html> , <head> , <body> , <script> s , all), stored string in php variable $htmlstring , #uniqueid iframe browser/client render. i'm having hard time figuring out proper way safely escape/encode string of html use in javascript i've written. on php side, i've tried htmlspecialchars() , htmlentities() , json_encode() , , simple str_replace() s on $htmlstring , none of them need them to. there i'm missing? i think should save code file , loa

python - Convert XML structure into a Pandas DataFrame without using a complex set of for loops -

i'm trying convert xml pandas dataframe. tried method austin taylor website without success. here's code far: import xml.etree.elementtree et import pandas pd xml_data = open("c:\\users\\john__000\\documents\\analytics\\anlt data wrangling\\assignments viz\/xdemo_stat.xml").read() def xml2df(xml_data): root = et.xml(xml_data) # element tree all_records = [] i, child in enumerate(root): record = {} subchild in child: record[subchild.tag] = subchild.text all_records.append(record) return pd.dataframe(all_records) after running code, nothing happened. i'm expecting dataframe didn't work. might issue?

go - Type interface {} is interface with no methods - Golang -

i using https://github.com/kataras/iris golang web framework. follow mail last question asked here - fetching logged in user info display - golang template i using code mentioned in previous post like:- ctx.values().get("user") and value user set or has "struct" type:- // users struct below var user users // details fetched db , assigned user // mentioned here http://go-database-sql.org/retrieving.html // value set ctx.values().set("user", user); but after getting value, when use in different handler , print:- user := ctx.values().get("user") fmt.println(user.id) i error:- user.id undefined (type interface {} interface no methods) i need in "type assertion" interface. how can "type assert" above value. please let me know, right way it. thanks a type assertion that, asserts value given type . userid := user.(users).id use type name, , should work.

linux - CUDA C v. Thrust, am I missing something? -

i started learning cuda programming. trundling through simple cuda c examples , going swimmingly. then! suddenly! thrust! consider myself versed on c++ functors , taken aback @ difference between cuda c , thrust i find hard believe that __global__ void square(float *a, int n) { int idx = blockidx.x * blockdim.x + threadidx.x; if (idx < n) { a[idx] = a[idx] * a[idx]; } } int main(int argc, char** argv) { float *ahost, *adevice; const int n = 10; size_t size = n * sizeof(float); ahost = (float*)malloc(size); cudamalloc((void**)&adevice, size); (int = 0; < n; i++) { ahost[i] = (float)i; } cudamemcpy(adevice, ahost, size, cudamemcpyhosttodevice); int block = 4; int nblock = n/block + (n % block == 0 ? 0:1); square<<<nblock, block>>>(adevice, n); cudamemcpy(ahost, adevice, size, cudamemcpydevicetohost); (int = 0; < n; i++) { printf("%d, %f\n", i, ahost[i]); } free(ahost); cudafree(adevice); } is equ

algorithm - When to use Big O instead of theta or little o -

a question asymptotic notation. i've seen lot of explanations of asymptotic notation say: θ(...) analogous = o(...) analogous <= o(...) analogous < which seem imply if f(n) = o(g(n)) , either f(n) = θ(g(n)) or f(n) = o(g(n)) . is possible have f(n) = o(g(n)) such neither f(n) = θ(g(n)) nor f(n) = o(g(n)) ? if so, example of this? , if not, why ever use o(...) when θ(...) or o(...) stronger descriptors? let f(n)=k! , when k smallest integer such n<=k! . then f(n) not θ(n) (since f(k!+1)/(k!+1) tends infinity) neither o(n) (since f(k!)=k! ), f(n)=o(n) (as f(n)<=n ).

javascript - Opacity on selected option -

i have toggle button allow user select 1 or 2 rows so when user click on id remove or add class , show diferents rows, need add opacity on toggle button, how?, need show opacity on actual selected toggle button. jquery("#one-row").click(function () { $('.product-list').removeclass('-two-columns'); $('.product-list').addclass('-one-columns'); }); jquery("#two-rows").click(function () { $('.product-list').removeclass('-one-columns'); $('.product-list').addclass('-two-columns'); }); .toggle-one{ background-image: url(images/toggle_1.svg); width: 30px; height: 10px; float: right; display: inline-block; cursor: pointer; } .toggle-two{ background-image: url(images/t

cordova - Ionic Google social authentication to Django Rest Framework backend -

i trying social authentication working mobile app (an ionic app on android). django rest framework backend rest_framework_jwt , social_django , , rest_social_auth . on ionic app using satellizer.js , however, can't use inappbrowser trying following cordova-plugin-googleplus : step#1 (on client/app) if (provider == 'google') { // use google api natively tokens , user info window.plugins.googleplus.login( { // todo webclient app settings 'webclientid': '[*.myclientid]', // optional clientid of web application credentials settings of project - on android, must included idtoken. on ios, not required. 'offline': true, // optional, requires webclientid - if set true plugin return serverauthcode, can used grant offline access non-google server }) ................ result: gets me valid response both idtoken , serverauthcode , , userid . step#2

html - How to adjust element width dynamically using jQuery or SCSS -

this first stackoverflow question, please patient. the problem that, each time browser being resized, image overflowing on text. how can fix dashed element more responsive rather manually adding media queries? thank you! .romanweek-tablewrapper { border: 2px solid #000; padding: 20px 30px; margin: 40px auto; display: table; width: 85%; } .romanweek-tablewrapper .menu-list-wrapper .romanweek-menulist { display: table; width: 85%; margin: 0 auto; } .romanweek-tablewrapper .menu-list-wrapper .romanweek-menulist li h4 { font: 400 16px lato; width: 100%; display: inline-block; } .romanweek-tablewrapper .menu-list-wrapper .romanweek-menulist li h4 .menu-schedule { text-transform: uppercase; position: relative; float: left; } .romanweek-tablewrapper .menu-list-wrapper .romanweek-menulist li h4 .menu-schedule::after { content: ''; position: absolute; border: 1px dashed rgba(0, 0, 0, 0.5); bottom: 5px; width:

mysql - Query posts custom field: check list inside a ACF repeater -

i'm trying query posts have specific check box selected inside repeater field. i found tutorial , want mix of topic 3 , 4, couldn't accomplish self, first attempt query posts , print 1 checked item: <?php // check if repeater field has rows of data if( have_rows('horarios') ): // loop through rows of data while ( have_rows('horarios') ) : the_row(); $dia_da_semana = get_sub_field_object( 'dia_da_semana' ); $horario = get_sub_field_object( 'horario' ); if ( in_array(1, $dia_da_semana['value'])) { echo 'segunda'; print_r( $horario['value']); echo '<br>'; } endwhile; endif; ?> but don't think solution. maybe there better way achieve i'm trying do.

c# - Task Was Canceled -

i trying download pdf database api call.. pdf getting downloaded 1 row getting task canceled exception public async system.threading.tasks.task<actionresult> record(string empno) { using (var client = new httpclient()) { client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/pdf")); var response = client.getasync("url?empno=" + empno).result; if (response.issuccessstatuscode) { var files = directory.getfiles(server.mappath(@"~/emppdf/")); foreach (var file in files) { try { system.io.file.delete(file); } catch { } } var bytes = await response.content.readasbytearrayasync(); using (stream writer = system.io.file.create(system.web.httpcontext.current.server.mappath(@"~emppdf/" + empno + &q

json - I am trying to add a dist-tag to my pkg but I keep get 404 error -

i'm trying add dist-tag pkg, aka package.json. doing wrong? i running $ npm dist-tag add pkg@1.0.2 beta 17 verbose stack error: missing : -/package/pkg/dist-tags 17 verbose stack @ makeerror (/home/ubuntu/.nvm/versions/node/v6.11.2/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:302:12) 17 verbose stack @ cachingregistryclient.<anonymous> (/home/ubuntu/.nvm/versions/node/v6.11.2/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:290:14) 17 verbose stack @ request._callback (/home/ubuntu/.nvm/versions/node/v6.11.2/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:210:14) 17 verbose stack @ request.self.callback (/home/ubuntu/.nvm/versions/node/v6.11.2/lib/node_modules/npm/node_modules/request/request.js:187:22) 17 verbose stack @ emittwo (events.js:106:13) 17 verbose stack @ request.emit (events.js:191:7) 17 verbose stack @ request.<anonymous> (/home/ubuntu/.nvm/versions/node/v