Posts

Showing posts from April, 2015

lambda - Does Haskell provide an idiom for pattern matching against many possible data constructors? -

working on haskell project, i'm dealing event data type fsnotify package. constructors event all: added filepath utctime modified filepath utctime removed filepath utctime in code, i'm interested in extracting filepath event , doing same action regardless of type constructor; because of this, i'm tempted make lambda. unfortunately, code suffers reduced readability when drop case expression lambda pattern match against 3 cases; there built-in idiom extract filepath in 1 expression without having manually pattern match, given relative homogeneity of type constructors? i've tried passing expression anonymous function in call watchdir action: wm <- startmanager sw <- watchdir wm "." (\_ -> true) (\(_ f t) -> putstrln f) but, predictably, don't-care value in lambda's pattern match causes parse error. the simplest way reflect homogenity of alternatives in type declaration, instead of observing it: data action

azure - Query Active Directory Organization Units with Microsoft Graph APi -

how can query tenants active directory organization units(ou) have been synced azure using adds(active directory domain services) sync? according to: https://azure.microsoft.com/en-us/documentation/articles/active-directory-ds-admin-guide-create-ou/ warning: user accounts, groups, service accounts , computer objects create under custom ous not available in azure ad tenant. in other words, these objects not show using azure ad graph api or in azure ad ui. these objects available in azure ad domain services managed domain. so, flat "not possible"? or there way? possible using different microsoft api other graph?

sql - Selecting specific COLUMNS after a previous select that returned one ROW -

i stumped here , in need of help. i have table called "2016blocks" table has rows each individual. each row has columns every day of year (365 columns each row). i have select statement return single row looks this: select * [2016blocks] ([officialid] = @officialid) the above select statement return 1 row 365 columns. each column either blank or have date in it. name of columns (blocks1, blocks2, blocks3......blocks365) i want select statement on row return columns have date in them. how do this? you'll have use unpivot function that. have 365 columns might not want mention 365 hardcoded column names. purpose can use dynamic query. can use below query in subquery or insert records in temp table , add filter blockvalue. hope helps. declare @colsunpivot nvarchar(max), @query nvarchar(max) select @colsunpivot = stuff((select ','+quotename(c.column_name) information_schema.columns c c.table_name = '2016block

java - Picasso: Unrecognized type of request for HTTP scheme -

i loading images synchronously display notification once image loaded. bitmap = picasso.load(imageurl).get(); it working fine today got exception: fatal exception: java.lang.illegalstateexception: unrecognized type of request: request{ http://www.fulbori.com/mp/resources/image/19/17/e.jpg} @ com.squareup.picasso.bitmaphunter$2.load(bitmaphunter.java:66) @ com.squareup.picasso.bitmaphunter.hunt(bitmaphunter.java:206) @ com.squareup.picasso.requestcreator.get(requestcreator.java:396) @ com.jumbotail.app.utils.jtimageloader.loadimagesync(jtimageloader.java:397) @ com.jumbotail.app.notifs.jumbogcmintentservice.readinboundintent(jumbogcmintentservice.java:213) @ com.jumbotail.app.notifs.jumbogcmintentservice.buildnotification(jumbogcmintentservice.java:273) @ com.jumbotail.app.notifs.jumbogcmintentservice.onhandleintent(jumbogcmintentservice.java:49) @ android.app.intentservice$servicehandler.handlemessage(intentservice.java:

ios - How to find provisioning profile's name by target name or bundle identifier it's associated with? -

we have (figuratively speaking) ton of provisioning profiles (pps) because of large number of non- production environments in addition widget, watch app , tv app. given not have pp naming convention, there way find correct pp's name knowing target name or bundle identifier ? when there's trouble pp during xcode build, want copy clipboard , able command-f developer portal pp page find culprit provisioning profile. ps. changing our pp naming convention going forward meanwhile still have manage pps exist. there's tab in developer portal, under identifiers , called app id's . it's list of bundle id's , respective names.

java - How to configure Maven profiles with different resources folders? -

i'm trying configure application have 2 build profiles: development , production. in order that, created 2 subdirectories under src/main/resources folder: src/main/resources/development , src/main/resources/production . each subdirectory has own .properties files. <profiles> <profile> <id>development</id> <build> <resources> <resource> <directory>src/main/resources/development</directory> </resource> </resources> </build> </profile> <profile> <id>production</id> <build> <resources> <resource> <directory>src/main/resource/production</directory> </resource> </resources> </build> </profile> </profiles> i build

html - References an external font css file with eBay Ad -

i've have read many other answers can't see i'm doing wrong, have set of custom fonts created using iconmoon, i've downloaded css , font files , uploaded directory on website, i'm trying reference font.css file via ad i've put in ebay, can never work, if reference iconmoons development font.css file can see icons, ideas great //this works <link rel="stylesheet" href="https://i.icomoon.io/public/53e1b82fac/dmqdartsfonts/style.css"> //this not work <link rel="stylesheet" href="http://www.my-site.com/fonts.css"> try in style sheet. if that's not gonna work, means url cannot read or put wrong path in link.. @import url("http://www.my-site.com/fonts.css");

Wordpress template for custom post type subpage -

i have custom post types called "realestate". first level pages create subpages contain information different appartments. i created single-realestate.php template file non used page , subpage when create them. possible subpages automatically uses specific template file?

Add struct to struct array using void pointer to said array in C -

let's have following struct , array of struct: struct fileinfo { int ascii[128]; //space store counts each ascii character. int lnlen; //the longest line’s length int lnno; //the longest line’s line number. char* filename; //the file corresponding struct. }; struct analysis fileinfo_space[8]; //space info 8 files i want have function add new struct array. must take void pointer position store struct argument int addentry(void* storagespace){ *(struct fileinfo *)res = ??? //cast pointer struct pointer , put empty struct there (struct fileinfo *)res->lnlen = 1; //change lnlen value of struct 1 } my questions are: what goes in place of ??? tried (fileinfo){null,0,0,null} per this stackoverflow response. `error: ‘fileinfo’ undeclared (first use in function) how create void pointer array? (void *)fileinfo_space correct? i required use void * argument function assignment. it's not me. let's have memory block passed

git rebase - Reapply Git commits from copied fork repository to original repository -

a university colleague of mine thought idea fork repository cloning , copy contents new, freshly initialized repository without .git folder original repository. afterwards, committed copy using single commit , whole team began working on project based on commit: a <- b <- c <- d <- e (original repository) \ clone / |_____| \ / | \ / ofc. work on original repository continued after cloning... \ / m <- n <- o <-p (our "fork", commits team) now, first goal following repository structure: a <- b <- c <- n <- o <- p what have been trying during past few hours following: clone original repository. git diff > /path/to/patch within fork. git apply within original repository. works, not preserve commits. various other things not work. clone original repository. create , switch new branch. reset commit a using git reset --hard commit_hash_a . create patch n <

c++ - ICU ResourceBundle arguments -

i'm using resourcebundle @ icu library c/c++. i test simple messages , works fine. now i'm trying use messages arguments, example: error{"error: {0}"} is there way resource , check if has arguments use formatstring class ? for example in resource: error{"error: {0}"} is method number of arguments ? in case one. thanks

r - Break region into smaller regions based on cutoff -

this assume simple programming issue, i've been struggling it. because don't know right words use, perhaps? given set of "ranges" (in form of 1-a set of numbers below, 2-iranges, or 3-genomicranges), i'd split set of smaller ranges. example beginning: chr start end 1 1 10000 2 1 5000 example size of breaks: 2000 new dataset: chr start end 1 1 2000 1 2001 4000 1 4001 6000 1 6001 8000 1 8001 10000 2 1 2000 2 2001 4000 2 4001 5000 i'm doing in r. know generate these seq , i'd able based on list/df of regions instead of having manually every time have new list of regions. here's example i've made using seq: given 22 chromosomes, loop through them , break each pieces # initialize df regions <- data.frame(chromosome = c(), start = c(), end = c()) # each row, following for(i in 1:nrow(chromosomes)){

python - When printing outputs an empty line appears before my outputs -

i have attempted write program asks user string , number (on same line) , prints possible combinations of string size of number. output format should be: capitals, each combination on each line, length of combination(shortest first) , in alphabetical. my code outputs right combinations in right order places empty before outputs , i'm not sure why. from itertools import combinations allcombo = [] s = input().strip() inputlist = s.split() k = int(inputlist[1]) s = inputlist[0] # l in range(0, k+1): allcombo = [] pos in combinations(s, l): pos = sorted(pos) pos = str(pos).translate({ord(c): none c in "[]()', "}) allcombo.append(pos) allcombo = sorted(allcombo) print(*allcombo, sep = '\n') input: hack 2 output: (empty line) c h k ac ah ak ch ck hk also i've been coding week if show me how write properly, i'd pleased. observe line: for l in range(0, k+1) # notice l starting @ 0.

unreadable layout of Google Custom Search results in wordpress -

the google custom search result incorrectly formatted in wordpress custom search page created. each post found, post's text snippet overlays thumbnail image, making results unreadable. turn off thumbnails via gcse settings, i'd prefer find way keep them. here's screenshot: https://soccermoviemom.com/wp-content/uploads/2016/09/gcse-layout-problem.png a live gcse page @ https://soccermoviemom.com/search i using gcse full-width layout, others don't work me @ all. i've tried setting different options on "div" statement within search page, doesn't help. thank can provide! -mj lee all css <div> element okay. it's <td class="gsc-table-cell-thumbnail gsc-thumbnail"> element that's automatically folding length of second <td> , has width:100% . in css file default+en.css , at: .gsc-table-cell-snippet-close, .gs-promotion-text-cell { vertical-align: top; width: 100%; } you can solve addi

php - DISTINCT fields NOT to show up in cakephp 1.3 -

i'm running feeds table don't want distinct fields "null" retrieve. $this->feed->recursive = 0; $this->paginate = array('feed' => array( 'limit' => 6, 'fields' => 'distinct feed.* not null', 'conditions' => array('feed.member_id' => $friends_ids), 'order' => array('feed.created' => 'desc'), )); $notes = $this->paginate('feed'); $this->set('notes', $notes); // debug($notes); unset($notes); this gives me error. warning (512): sql error: 1054: unknown column 'feed.* not null'. running on cakephp 1.3 thanks. try moving null check conditions array. 'fields' => 'distinct feed.*', 'conditions' => array( 'feed.member_id' => $friends_ids, 'feed.the_field_to_check not null' ),

Quickbooks Online REST API Minor Version 7 -

i'm trying use qbo rest api insert invoices our system , want use billemailcc attribute of invoices. i've read on site these available minor version 7. i've try setting minor version in queries still errors saying attribute not valid. how can access minor version 7? url: https:https://sandbox-quickbooks.api.intuit.com/v3/company/193514338926917/query?query=select%20billemail%20from%20invoice%20where%20customerref%20%3d%20%2760%27&minorversion=7 after doing digging in console, deduced fields set follows "allowonlinepayment":true, "allowonlinecreditcardpayment":true, "allowonlineachpayment":true, quickbooks support has said these attributes aren't supported, however.

Writing matlab vector to a file that is matlab readable -

for matlab: there way write value of vector file can later opened , read matlab program? specifically: have matlab program computes binary-valued vector $zvector$ 10^7 entries. want write $zvector$ data output file can emailed , read input matlab program. ideally, output file called “output.m” , like: zvector=[ 0 1 1 … 0 1 ]; i .m format because easy use matlab input. have experimented matlab’s write() , fwrite() commands, no success. observe these generate files cannot read matlab-recognizable inputs (at least, not know how read them). there way accomplish goals? thanks. ps: interested in easiest way. if involves different type of file format (not .m format) fine. however, in case, can provide both writing , reading commands? again. thanks @edwinksl pointing me in right direction mat files. not know accepted practice here, in stackexchange math encouraged answer own question if hint comments got way there. answer own question. the mat format well.

linux - Can you use a PortAudio callback to write back to a stream's input buffer? -

at highlevel, goal take microphone input 1 stream, processing on it, , copy microphone input stream. latter being default device, other applications (which reasons out of hands, can't specify other device) can record default device , still processed input. here's snippet of code: int stream1_callback(const void *card_capture, void *card_playback, unsigned long framecount, const pastreamcallbacktimeinfo *timeinfo, pastreamcallbackflags statusflags, void *userdata) { main_t *data = (main_t *) userdata; // unused(card_capture); unused(card_playback); unused(framecount); unused(timeinfo); unused(statusflags); // unused(userdata); deinterleave_i16_i16(card_capture, data->mic_unprocessed, num_mics, blocksize_48khz); printf("de-interleaved!\n"); process_microphones(data->mic_unprocessed, data->mic_processed); printf("processed!\n"); return 0; } int stream2_callback(const void *inputbuffer, void *

matlab - Get matrix statistics ignoring internal matrix -

i have image. have sliding window going across image , sliding window has "frame". both window , frame defined rectangles [x y w h]. know window contained within frame (may share edge), can't assume location. need get, example, standard deviation of in frame only. for sake of visualization, assume have window (alpha characters) , frame (numeric characters). have [x y w h] defining each of them. know window in frame. how stdev of numeric characters? 1 8 3 8 2 0 a b c 5 2 8 c b 3 9 9 a c b 0 5 2 9 6 8 3 4 1 note: in reality piece of image numeric. used alpha characters distinguish window frame. if know row , column range of window within frame, logical indexing 1 approach. self-contained example: framesize = [5, 6]; % outer [width, height] of frame windowsize = [3, 3]; % [width, height] of window windowlocation = [2, 1];% [row, column] of top left element of window windowrowrange = windowlocation(1):(windowlocation(1)+windowsize(1

r - Get out of infinite while loop -

what best way have while loop recognize when stuck in infinite loop in r? here's situation: diff_val = inf last_val = 0 while(diff_val > 0.1){ ### calculate val data subset greater previous iteration's val val = foo(subset(data, col1 > last_val)) diff_val = abs(val - last_val) ### how did change val? last_val = val ### set last_val next iteration } the goal have val progressively closer , closer stable value, , when val within 0.1 of val last iteration, deemed sufficiently stable , released while loop. problem data sets, val gets stuck alternating , forth between 2 values. example, iterating , forth between 27.0 , 27.7. thus, never stabilizes. how can break while loop if occurs? i know of break not know how tell loop when use it. imagine holding onto value 2 iterations before work, not know of way keep values 2 iterations ago... while(diff_val > 0.1){ val = foo(subset(data, col1 > last_val)) diff_val = abs(val - las

what does "=>" means in javascript? -

this question has answer here: what's meaning of “=>” (an arrow formed equals & greater than) in javascript? 9 answers what => mean in javascript? (equals greater than) [duplicate] 1 answer in javascript od, code this: [0, 1, 2, 3, 4].reduce( (prev, curr) => prev + curr ); var maxcallback = ( pre, cur ) => math.max( pre.x, cur.x ); i have searched in google "=> in javascript", patched nothing, mean?

Vim: how to use Ex commands across files (global marks?) -

i wanted know if can move/copy lines 1 file in vim using ex commands , global marks. i can on current file setting destination mark @ cursor position (ma), going source, selecting lines , issue command: :'<,'>m 'a and selected lines moved destination. how across files? tried using global marks move file: :'<,'>m 'a but error "e20: mark not set" shown. unfortunately not possible. on mark : uppercase marks 'a 'z include file name. {vi: no uppercase marks} can use them jump file file. you can use uppercase mark operator if mark in current file. they supposed let jump. important, on {address} : ' t = position of mark t (uppercase); when mark in file cannot used in range

ios - Swift - UITableViewCell with custom class and prototype repeating after 4th cell -

in application, have uitableview dynamically creates new cells user clicks on "add" button. cells have several fields intended take user input. however, after creating fourth cell, cell contains duplicates of input added in first cell. example, each cell had textfield firstcell.textfield.text = 0 <--- manually assigned secondcell.textfield.text = 1 <--- .. thirdcell.textfield.text = 2 <---- .. fourthcell.textfield.text = 0 <--- automatically assigned fifthcell.textfield.text = 1 <--- automatically assigned after digging, believe due cells being dequeued using reuse identifier , cells being reused. how can create multiple cells same prototype, not automatically hold manually assigned values previous cell? update: func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("mycustomcell", forindexpath: indexpath

json - How to manage QNetworkReply order from QNetworkAccessManager requests -

i have demo server replying json objects client request. i planning use qnetworkaccessmanager client, did. i defined lambda function handling server reply std::function<void(qnetworkreply*)> processreplylb = [&](qnetworkreply *reply){ static int cnt = 0; std::cout<<"--------------------"<<(++cnt)<<"---------------------"<<std::endl; qlist<qbytearray> headerlist = reply->rawheaderlist(); foreach (qbytearray header, headerlist) { std::cout<<header.constdata()<<" - "<<reply->rawheader(header).constdata()<<std::endl; } processresult = false; if(reply->error()){ std::cout<<"reply error"<<std::endl; std::cout<<reply->errorstring().toutf8().constdata()<<std::endl; } else { qstring value = reply->readall(); std::

security - Apache: how to protect mod_info output -

i use apache's mod_info display detailed information server setup. httpd-vhosts.conf # set path below handled mod_info. show server info. # work, module must loaded (uncommented in httpd.conf) <location /special/path> sethandler server-info order allow,deny allow 127.0.0.1 </location> allow from set local machine because on dev machine. this module allows me see tremendous amount of information navigating /special/path . i'd same benefit on production server, can see output remotely. means need make path publicly accessible of course keep info away prying eyes. what's practical way protect output? i'm ok static password challenge long password not stored in clear (hashed ok) , not stored in publicly accessible location. apache 2.4.16 to solve problem, used configuration: # paths beginning /admin password protected # credentials /path/admin.htpasswd <location /admin> authtype basic authname "administrat

How to plot Integrals Mathematica -

Image
this integral is suppose give result of energy. i'm trying graph energy function of time. i'm trying use mathemathica, i'm not getting right graph. graph suppose can me? the problem showing should not produce graph: 3 integrals added definite integrals , produce number. in other words: t -dependence integrated out, there nothing plot, strictly speaking. however, can generate plot in following way. clear domain has been cut 3 sections, define piecewise function as integrant: f[t_] = piecewise[{{50 t, t < 1}, {0, 1 <= t < 3}, {50 t - 200, 3 <= t}}] next, calculate integral of function starting @ t = 0 : fintegral[t_] = assuming[element[t, reals], integrate[f[t1], {t1, 0, t}]] note how integral uses dummy integration variable t1 integration 0 t . dummy variable drops out when integral , final result not depend on t1 ; on t . (btw: assuming necessary tell mathematica t real number , not strange complex number. if don't that, m

xml - c# windowphone 8.1 code with async task -

i try read xml form url. code: static xdocument getxml(string url) { using (httpclient client = new httpclient()) { var response = client.getstreamasync(url); return xdocument.load(response.result); } } and read xml this: public object deteailsemp(string emp_xml, string emp_error) { xdocument xml; try { xml = xdocument.parse(getxml(emp_xml).tostring()); } catch { xml = xdocument.load(emp_error); } var detail = query in xml.descendants("emp") select new data.emp { name = (string)query.element("name").value, age = (string)query.element("age").value, return detail ; } with code, ok. but, when change code async task this: async static task<xdocument> getxml(string url) {

Is "Dollar-sign" optional in powershell "$()"? -

i've seen example setting timestamps (creationtime, lastaccesstime, lastwritetime) of file powershell: ps>$(get-item test.txt).lastwritetime=$(get-date "01/01/2020") which seems work. this page: http://ss64.com/ps/syntax-operators.html powershell operators says "$( )" "subexpression operator". but seems work without "$" like: ps>(get-item test.txt).lastwritetime=(get-date "01/01/2020") and powershell examples i've seen omit "$" when using parenthesis. so, "dollar-sign" optional in powershell "$()" ? or there difference with/without "$" i'm not seeing. is "$()" , "()" 2 different operators happen both valid uses in examples have shown? you need $ sign denote sub expression if use multiple statements or statement embedded in string. parenthesis without $ grouping operator. $($x = 1; $y =2; $x + $y).tostring() //3 ($x = 1;

ios10 - dlopen() from sandbox in iOS 10 is blocked -

i'm using dlopen() load dynamic framework documents directory, it's working below ios10, in ios10 not work anymore,and console's log is: file system sandbox blocked mmap() of '/var/mobile/containers/data/application/71eb4588-a83f-4af0-9409-dd09afb2ca77/documents/mydylib.framework/mydylib' how can solve problem? in ios10 framework cannot save documents dir or subdir. must put framework under youappname.app/

c++ - Why does omitting the push_back make the loop run slower? -

consider program, compiling on cygwin gcc 5.4.0 , command line g++ -std=c++14 -wall -pedantic -o2 timing.cpp -o timing . #include <chrono> #include <iostream> #include <string> #include <vector> std::string generateitem() { return "a"; } int main() { std::vector<std::string> items; std::chrono::steady_clock clk; auto start(clk.now()); std::string item; (int = 0; < 3000000; ++i) { item = generateitem(); items.push_back(item); // ********* } auto stop(clk.now()); std::cout << std::chrono::duration_cast<std::chrono::milliseconds> (stop-start).count() << " ms\n"; } i consistently reported time of around 500 ms. however, if comment out starred line, omitting push_back vector , time reported around 700 ms. why not pushing vector make loop run slower? i've run test now, , problem in push_back version, item st

javascript - Select element not working in CSS -

Image
i write web page; have problem active element . you can see know issues. i don't know seems fail when tried click on second tab or third tab (it working first tab), , can't click child element tab. can see pen . $(document).ready(function() { (function ($) { $('.tab ul.tabs').addclass('active').find('> li:eq(0)').addclass('current'); $('.tab ul.tabs li a').click(function (g) { var tab = $(this).closest('.tab'), index = $(this).closest('li').index(); console.log(tab + ' ' + index); tab.find('ul.tabs > li').removeclass('current'); $(this).closest('li').addclass('current'); tab.find('.tab_content').find('div.tabs_item').not('div.tabs_item:eq(' + index + ')').slideup(); tab.find('.tab_content').find('div.tabs_item:eq(' + index + ')').slidedown();

ios - How to click a button lying below UITableView -

Image
say, have button lying under uitableview , how can click button through uitableviewcell not trigger cell click event: the reason put button behind tableview want see , click button under cell color set clear, , when scroll table, button can covered cell not clear color i created sample project , got working: override func viewdidload() { super.viewdidload() // additional setup after loading view. let tap = uitapgesturerecognizer(target: self, action: #selector(tableviewvc.handletap)) tap.numberoftapsrequired = 1 self.view.addgesturerecognizer(tap) } func handletap(touch: uitapgesturerecognizer) { let touchpoint = touch.locationinview(self.view) let ispointinframe = cgrectcontainspoint(button.frame, touchpoint) print(ispointinframe) if ispointinframe == true { print("button pressed") } } to check of button being pressed need use long tap gesture: override func viewdidload() { super.viewdidload()

greatest n per group - mysql select top n max values -

how can select top n max values table? for table this: column1 column2 1 foo 2 foo 3 foo 4 foo 5 bar 6 bar 7 bar 8 bar for n=2, result needs be: 3 4 7 8 the approach below selects max value each group. select max(column1) table group column2 returns: 4 8 for n=2 could select max(column1) m table t group column2 union select max(column1) m table t column1 not in (select max(column1) column2 = t.column2) for n use approaches described here simulate rank on partition. edit: this article give need. basically this select t.* (select grouper, (select val table li li.grouper = dlo.grouper order li.grouper, li.val desc limit 2,1) mid ( select distinct grouper table ) dlo ) lo, table t t.grouper = lo.grouper , t.val > lo.mid re

Database migrations in docker swarm mode -

i have application consists of simple node app , mongo db. wonder, how run database migrations in docker swarm mode? without swarm mode run migrations stopping first old version of application, running one-off migration command new version of application , starting new version of app: # setup following $ docker network create appnet $ docker run -d --name db --net appnet db:1 $ docker run -d --name app --net appnet -p 80:80 app:1 # update process $ docker stop app && docker rm app $ docker run --rm --net appnet app:2 npm run migrate $ docker run -d --name app --net appnet -p 80:80 app:2 now i'm testing setup in docker swarm mode scale app . problem in swarm mode 1 can't start containers in swarm network , can't reach db run migrations: $ docker network ls network id name driver scope 6jtmtihmrcjl appnet overlay swarm # trying replicate manual migration process in swarm mode $ docker s

css - Liquid default expanded menu -

i have liquid dropdown menu list of products expand when click. figured out how open default when loading site. found <ul> tag dropdown list , changed this: <ul id="collapsible{{ forloop.index }}" class="site-nav__submenu site-nav__submenu--expanded" aria-hidden="false"> to this: <ul id="collapsible{{ forloop.index }}" class="site-nav__submenu site-nav__submenu--expand" aria-hidden="false"> however, closed default on small screens. so far haven't been able find solution allows me that. i'm open both liquid , css solutions. got ideas? here code looks default expand: <div class="grid"> <nav class="grid__item small--text-center medium-up--one-fifth" id="makeshort" role="navigation"> <hr class="hr--small medium-up--hide"> <button data-target="site-nav" id="togglemobilemenu" class=&q

how to concat a counter for an object declaration in PHP -

i trying create multiple instances of object how wrapper designed work. problem wanted add counter in object declaration have loop through data , create necessary object , loop again wrapper read them all. currently, have this: if(sizeof($product_name) > 0){ for($counter=0;$counter<sizeof($product_name);$counter++){ $lineitem.$counter = new lineitem($this->_xi); $lineitem.$counter->setaccountcode('200') ->setquantity($product_qty[$counter]) ->setdescription($product_name[$counter]) ->setunitamount($product_price[$counter]); print_r($lineitem.$counter); } } print_r($lineitem0); my print_r returns nothing both inside , outside loop. your problem not oop, more php. want create dynamic variable name store instances of class creating, should do: if(sizeof($product_nam

user interface - Transaction check error while installing GUI in CentOS 7 -

Image
i'm getting following error after running install gnome command i.e. yum groupinstall "gnome desktop" "graphical administration tools" how can resolve error? i have resolved error, in case else go through same error, following steps need followed, yum upgrade lvm2 yum groupinstall "gnome desktop"

javascript - Find string in array using prototype functions -

i have array: var str = "rrr"; var arr = ["ddd","rrr","ttt"]; i try check if arr contains str. try this: var res = arr .find(str); but on row above not works idea wrong? find (added in es2015, aka "es6") expects function predicate. you're looking indexof : var res = arr.indexof(str); ...which finds things comparing them === . you'll -1 if it's not found, or index if is. in comment you've said: no string exists expect null if exists expect true ...which seems bit odd (i'd think you'd want true or false ), give that: var res = arr.indexof(str) != -1 || null; ...because of javascript's curiously-powerful || operator (that's post on blog) . just completeness find : but can use find ; es5 version (in case you're polyfilling not transpiling): var res = arr.find(function(entry) { return entry === str; }); or in es2015: let res = arr.find(entry => e

windows - java open file with default program -

i need download file java server using socket, , open default windows program. i've explored several solution, none fits need. aim temporarily open file external default program , delete file when external program exits. i've found these solution: desktop.getdesktop.open(myfile) , seems can't handle returned value check external program exit processbuilder , handles external program exit, not open "default windows program", , need check every file extension run associated command. solution quite "close", can't know in advance types of file open apache commons exec, seems same 2, more reliable same problem what do? think solution found, report others same needs: instead of use file=new file() , have used file=file.createtempfile(basename,extension) [you can use apache common io manage file name] create temporarily file set file deleted on software exit (not on current frame exit) file.deleteonexit() try open file default pro