Posts

Vim key mapping for emmet-vim -

ok here want accomplish: in insert mode emmet autocomplete tab key here have tried let g:user_emmet_expandabbr_key = '<tab>' (only works in normal mode) though above code useful, need work in insert mode i transferring on sublime text vim , miss having emmet functionality accessible. ideas how can achieve this? thanks in advance. solved problem including following lines in .vimrc file. let g:user_emmet_expandabbr_key='<tab>' imap <expr> <tab> emmet#expandabbrintelligent("\<tab>") now can use tab key both indent , activate emmet snippets in insert mode :d

javascript - How do I delete a key-value pair using Cradle in CouchDB/Node.js? -

i've been working lot cradle, couchdb client. however, have document filled key-value pairs, , i'm trying delete specific row in there. in documentation, cannot find way deletion doesn't include deleting entire document or updating null value. can point me in right direction? feel simple issue lots of people run into. in couchdb, there no support partial document updates (support discussed every once in while, since there no accepted way patch json, never gets far), have update entire document copy unwanted key/value pair removed.

mysql - Find all employee who have worked on at least two projects -

table: projectressources idproject idemployee numhours priceperhr 1 1876 500 65 1 4354 2000 31 2 2231 250 55 3 2231 500 65 3 1212 3000 35 3 1876 2000 35 i come following research syntax can't figure how filter indicate 2231 , 1876: select idemployee, count (*) ‘number of projects’ projectressources group idemployee; you're headed in right direction. missing piece having clause allows filter aggregate expression, such count(*) : select idemployee, count (*) ‘number of projects’ projectressources group idemployee having count(*) > 1 -- here!

c++ - Cartesian to quaternion glm -

i have vector pointing in direction need rotate, need convert quaternion first. cannot find converting cartesian coordinates quaternions in glm. such function exist? maybe these out. can found on website in api documents v0.9.6: glm_func_decl tvec4<t, p> glm::rotate( tquat<t,p> const &q, tvec4<t,p> const &v ) rotates 4 components vector quaternion. see glm_gtx_quaternion glm_func_decl tquat<t, p> glm::rotation( tvec3<t,p> const &orig, tvec3<t,p> const &dest ) compute rotation between 2 vectors. param orig vector, needs normalized param dest vector, needs normalized see glm_gtx_quaternion and template<typename t, precision p> glm_func_decl tvec3<t,p> rotate( tquat<t,p> const &q, tvec3<t,p> const &v ) template<typename t, precision p> glm_func_decl tvec4<t,p> rotate( tquat<t,p> const &q, tvec4<t,p> const &v ) template<t...

cmake - How to use clang to generate all ast files for a project with makefile or cmakelist? -

i have developed static analyze tool based on clang reads ast files generated clang -emit-ast option , analysis on them. when testing tool, it's convenient generate ast files multiple c or cpp files. can use command 1 one: clang -emit-ast test.c -o test.ast but when comes large project build make or cmake, don't know how can generate ast files. there convenient way manage that? you can use add_custom_target cmake. something this: add_custom_target(ast) foreach(sourcefile ${sourcefiles}) add_custom_command(target ast pre_build command clang -emit-ast ${sourcefile} -o ${cmake_binary_dir}/${sourcefile}.ast)

How to update URL in redux simple router from action? -

according redux simple router docs, can update route action. don't see how in documentation. have example of this? you can import history singleton passed root component action , operate on directly, or, if you've installed router middleware, can use action creators provided react-router-redux . from docs : what if want issue navigation events via redux actions? react router provides singleton versions of history (browserhistory , hashhistory) can import , use anywhere in application. however, if prefer redux style actions, library provides set of action creators , middleware capture them , redirect them history instance. import { routermiddleware, push } 'react-router-redux' // apply middleware store const middleware = routermiddleware(browserhistory) const store = createstore( reducers, applymiddleware(middleware) ) // dispatch anywhere normal. store.dispatch(push('/foo')) the following actions supported : push(l...

php - Array push to end keeping format -

i'm making automated system send out emails. have array containing info registered users: email , forum name/nickname: $array = [ ['jane.apples@gmail.com', 'jane apples'], ['jdoe@gmail.com', 'john doe'], ]; to send emails uses each loop: foreach ($array list($email, $name)) { echo "$email&nbsp;&nbsp;&nbsp;$name<br>"; } this yield: jane.apples@gmail.com jane apples jdoes@gmail.com john doe in final code this: foreach ($array list($email, $name)) { email($email, $name); } also, please note array in different file like: array.php , include file. please me this, , in advance. update: i've found solution while messing around little bit here code: <?php $result = array(); $file = fopen("mail.txt", "r"); while(!feof($file)){ $line = fgets($file); list($email, $name) = explode(":", $line); echo $email . ':' . $name .'...