Posts

html - Flexbox does not vertically align -

i need vertically aligning following table. can not understand reason why doesn't vertically align. html: <table> <tr> <td>lorem ipsum</td> <td>lorem ipsum</td> </tr> <tr> <td>lorem ipsum</td> <td>lorem ipsum</td> </tr> </table> css: body { display: flex; justify-content: center; align-items: center; } fiddle you can fix style: body, html { height: 100%; } without this, body's height takes enough space hold content. fiddle

java - Track visitors in play framework 2 application,caching and saving to DB -

what want accomplish sane way of storing list of pages visited during each anonymous user session on website. important sequence correct , 1 users navigation not mixed ones. it similar c# question: " track visitor info on every request ", proposed use logfile short-term storage. site host ~2k users/day think fine having cache in memory (atleast seems easier). i cant seem figure out solution work stateless play framework since solution requires saving data(to db) when user has timed out , not active anymore. idea rely on storing each request in memory , call database if new request hasnt arrived in time (user timeout). how possible that? is there other way think might better, perhaps storing requests users , making big write db instead of 1 each session? edit: i have taken easy way out, have been great salem mentioned cant figure out how save list memory. first plan use akka scheduler altered (timer reset , new post added) each time user gets new page dont know h...

gnu - Building Emacs from git master complains errors in configure.ac -

when try build emacs https://github.com/emacs-mirror/emacs @ 4f54f7b using ./autogen.sh errors as checking whether have necessary tools... (read install.repo more details on building emacs) checking autoconf (need @ least version 2.65)... ok checking automake (need @ least version 1.11)... ok system has required tools. running 'autoreconf -fi -i m4' ... configure.ac:54: error: possibly undefined macro: as_echo if token , others legitimate, please use m4_pattern_allow. see autoconf documentation. configure.ac:95: error: possibly undefined macro: am_init_automake configure.ac:245: error: possibly undefined macro: ac_define configure.ac:752: error: possibly undefined macro: am_prog_cc_c_o configure.ac:763: error: possibly undefined macro: am_conditional configure.ac:1020: error: possibly undefined macro: am_subst_notmake configure.ac:1471: error: possibly undefined macro: m4_default autoreconf: /usr/bin/autoconf failed exit status: 1 i've tried common t...

c# - Why some directories i can't drag and drop on listBox1? -

this path of folder images inside i'm trying drag , drop listbox1: c:\users\chocolade1972\appdata\local\mws\my weather station\images but if drag folder in c:\ example c:\images drag fine listbox1. when drag user...directory see black symbol can't drop in. private void listbox1_dragdrop(object sender, drageventargs e) { if (e.data.getdatapresent(dataformats.filedrop)) { string[] files = (string[])e.data.getdata(dataformats.filedrop); label6.text = files.length.tostring(); filescount = files.length-1; beginconvertiontoolstripmenuitem.enabled = true; (int = 0; < files.length; i++) { fileinfo fi = new fileinfo(files[i]); if (listbox1.items.contains(fi.fullname)) { } else { string directoryname = fi.directoryna...

javascript - Check if user exists and store his data with Firebase+Angular+Facebook -

i have facebook signup method , want check if user persists in firebase. if is, i'd set data $rootscope.loggedinuser share across controllers. here's implementation of idea. problem — no data written firebase no redirection performed. seems miss obvious. ideas? firebase v2.0.4 angularfire 0.9.0 angular 1.2.20 $scope.loginfacebook = function() { $scope.auth.$authwithoauthpopup("facebook") .then(function(authdata) { var userid = authdata.uid function checkifuserexists(userid) { (new firebase(users)).child(authdata.uid).once('value', function(snapshot) { var exists = (snapshot.val() !== null); userexistscallback(userid, exists); }); } function userexistscallback(exists) { if (exists) { var loggedinuser = $firebase(new firebase(users).child(authdata.uid)).$asobject(); loggedinuser.$l...

c++ - Finding and replacing lines from a cpp file -

i trying create program finds multiple lines in file continuously have // , replace them /* * * */ . single lines // left is. following example code gives idea of trying perform. example-original.cpp #include <iostream> using namespace std; //to replaced //to replaced //to replaced //to replaced blah blah blah ... ... int main() { ... ... //to replaced //to replaced } //to left return 0; } wantedoutput.cpp #include <iostream> using namespace std; /* replaced *replaced *replaced *replaced */ blah blah blah ... ... int main() { ... ... /*replaced *replaced */ } //to left return 0; } i have created program changes first time multiple line comments occur not work other multiple line comments follow them. output stored in "xyz.tmp". file modified provided command line argument. first, have obtained line numbers contains // , stored in array. from example, array `startcom[]={4,7,16,17}'. line number o...

c++ - Metafunction for expressing "dominance" of one sequence over another -

i'm seeking single meta-function (such std::less_equal ) can used or combined in order express dominance relationship, defined follows. sequence dominates sequence b (both of having equal length) if: each element of not less corresponding element b at least 1 element of greater corresponding element of b so far best have been able come consists of 2 separate tests 1 after other follows. template<typename t> bool dominates( t& sequence1 , t& sequence2 ) { if( std::equal( sequence1.begin() , sequence1.end() , sequence2.begin() ) ) return false; return std::equal( sequence1.begin() , sequence1.end() , sequence2.begin() , std::less_equal<double>() ); } is possible same using single metafunction? the problem one-pass code have keep state - have remember whether encountered dominating element or not. writing simple for loop give advantage of short-circuiting when know result false . if want one-liner, here go: template<typenam...