Posts

SAS where condition exact matching -

thanks feedback guys, have rewrite question make more clear. say, have table: table what trying table list of numbers have matching fp_ndt dates condition, example, want list of numbers, have fp_ndt not null 2014 , 2015 , missing values 2011, 2012 , 2013 (irrelevant of months). condition should number 4. possible table ? ps: if write simple sql select statement , put condition where year(fp_ndt) in (2014,2015) it give me numbers 2 , 3... why not first summarize data? proc sql; create table xx select number , max(year(fp_ndt)=2011) yr2011 , max(year(fp_ndt)=2012) yr2012 , max(year(fp_ndt)=2013) yr2013 , max(year(fp_ndt)=2014) yr2014 , max(year(fp_ndt)=2015) yr2015 table1 group number ; now easy make tests. select * xx yr2014+yr2015=2 , yr2011+yr2012+yr2013=0 ; you use first query sub-query instead of creating physical table.

javascript - Is it possible to detect repaint/reflow in the browser? -

not sure if there solution problem. want know if there way detect when browser actually updates ui. lets want add class element before run long-running, synchronous block of code, after synchronous function runs, class removed. el.classlist.add('waiting'); longrunningsynchronoustask(); el.classlist.remove('waiting'); if run code, long running task started, , block ui before class added. tried using mutationobserver 's, , checking element getcomputedstyle , doesn't work because don't reflect when realtime updates ui. using worker might best solution (drop long running code in worker , post message when it's complete remove class). isn't option me, due needing support older browsers. the solution works outside of implementing worker using settimeout . i'd love know if has run problem , if there way detect repaint/reflow of ui in browser. see example better illustration of problem. const el = document.queryselector('.targe...

git - Have two different copies of same file in two different branches -

Image
do know how have 2 different copies of same file in 2 different branches in git? let assume have file called config . i'm trying achieve have copy of file in dev branch different in master branch. the important thing file can't ignored in gitignored. you can checkout 2 branches. modify file , commit them each branch. if want merge branches , have 2 separate files (different content) in each branch, commit changed branches , set desired file tin .gitattributed grab ours file - result in file never overwritten read , set here: https://git-scm.com/book/en/v2/customizing-git-git-attributes#merge-strategies you can use git attributes tell git use different merge strategies specific files in project . one useful option tell git not try merge specific files when have conflicts , rather use side of merge on else’s. this helpful if branch in project has diverged or specialized, want able merge changes in it, and want ignore files . config_fi...

regex - Regular Expression user input Java -

this question has answer here: learning regular expressions [closed] 1 answer i new regular expressions , clueless @ moment. i trying create regular expression in java allow alphabetical characters. integers , special characters not allowed. minimum length possible 2 , maximum length 10. (^[a-za-z]{2,10}$) or (\a[a-za-z]{2,10}\z) you downcase first , make smaller regex if doesn't matter these should work.

perl - Use Archive::Zip to determine if a member is a text file or not -

i'm working on script grep contents of members of zip archives when member name matches pattern, using given search string. i have following sub processes single archive (the script can take more 1 archive on command line): sub processarchive($$$$) { ($zip, $searchstr, $match, $zipname) = @_; print "zip[$zip] searchstr[$searchstr] match[$match] zipname[$zipname]\n"; @matchinglist = $zip->membersmatching($match); $len = @matchinglist; if ($len > 0) { print $zipname . ":\n"; $member (@matchinglist) { print "member[$member]\n"; print "textfile[" . $member->istextfile() . "] contents[" . $member->contents() . "]\n"; if ($member->istextfile()) { print "is text file.\n"; } else { print "is not text file.\n"; } @matchinglines = grep /$searchstr/, $member->c...

hadoop - complex Hive Query -

hi have following table: id------ |--- time ====================== 5------- | ----200101 3--------| --- 200102 2--------|---- 200103 12 ------|---- 200101 16-------|---- 200103 18-------|---- 200106 now want know how month in year appears. cant use group because counts number of times appears in table. want 0 when month in year not appear. output should this: time-------|----count ===================== 200101--|-- 2 200102--|-- 1 200103--|-- 1 200104--|-- 0 200105--|-- 0 200106--|-- 1 sorry bad table format, hope still clear mean. apreciate help you can provide year-month table containing year , month information. wrote script generate such csv file: #!/bin/bash # year_month.sh start_year=1970 end_year=2015 year in $( seq ${start_year} ${end_year} ); month in $( seq 1 12 ); echo ${year}$( echo ${month} | awk '{printf("%02d\n", $1)}'); done; done > year_month.csv save in yea...

Can I create a Visual Studio WinGDB project for python running on Linux? -

i need develop python code run remotely on linux machine. installed extension visual studio called wingdb, supposed allow me use visual studio features such breakpoints , smart editing, while code exists , runs on linux machine. in visual studio created new project, , in templates area, chose template: windgb standard projects -> multiplatform executable. created project c++. how tell instead make python project works remotely linux? possible? none of wingdb templates mention particular language. extent of python support unclear wingdb documentation ( http://www.wingdb.com/docs/pages/wg_intro.htm ) , have not answered email. i'm using visual studio 2015 update 2, , wingdb version 4.4. this answer received wingdb support: unfortunately not possible, wingdb meant native c/c++ development, not python. i think these different plugins python development under vs, or if not have use vs necessarily, can try this: http://www.jetbrains.com/pycharm this python ide...