Posts

Exclude a few words from a simple regex in PHP -

i'm categorizing few folders on drives , want weed out low quality files using regex (this works): xvid|divx|480p|320p|divx|xvid|divx|xvid|xvid|divx|dvdscr|pdtv|pdtv|dvdrip|dvdrip|dvdrip now filenames in high definition still have dvd or xvid in filenames 1080p, 720p, 1080i or 720i. need single regex match 1 above exclude these words 1080p, 720p, 1080i or 720i. you can use negative lookahead this ^(?!.*(?:1080p|720p|1080i|720i)).*(?:xvid|divx|480p|320p|divx|xvid|divx|xvid|xvid|divx|dvdscr|pdtv|pdtv|dvdrip|dvdrip|dvdrip) this match on search strings, fail if there 1080p|720p|1080i|720i in string.

android ndk - WebRTC support on BlackBerry 10 -

are there webrtc libraries ported blackberry? if not, possible port android ndk code bb10 project? thanks in advance! webrtc free both paid , unpaid apps. currently, blackberry interested in delivering support webrtc , researching/investigating on technology. however, no dates or release schedules have been announced @ moment. depending on apis being used in android app. may or may not possible port android ndk code blackberry10. though android runtime not support webrtc projects, blackberry10 os built on qnx, compliant posix system. qnx compiler, qcc, has gcc-compliant mode port on existing code.

sql - PostgreSQL Mathematical Function -

i have table aps_sections many integer fields (such bare_width , worn_width ). have multiple tables (such aps_bare_width , aps_worn_width ) contain id column , weighting column. id recorded in above columns of aps_sections table. need sum weightings of columns in aps_sections table (whereby weighting value comes tables). have managed using below select statement. select aps_sections.ogc_fid, ( aps_bare_width.weighting + aps_worn_width.weighting + aps_gradient.weighting + aps_braiding.weighting + aps_pigeon.weighting + aps_depth.weighting + aps_standing_water.weighting + aps_running_water.weighting + aps_roughness.weighting + aps_surface.weighting + aps_dynamic.weighting + aps_ex_cond.weighting + aps_promotion.weighting + aps_level_of_use.weighting) calc row_access.aps_sections, row_access.aps_bare_width, row_access.aps_worn_width, row_access.aps_gradient, ro...

regex - Qt 4.8.4 MAC Address QRegExp -

i'm trying qt match mac address ( 1a:2b:3c:4d:5e:6f ) using qregexp. can't seem match - doing wrong? i forcing try , match string: "48:c1:ac:55:86:f3" here attempts: // define regex match mac address //qregexp regexmacaddress("[0-9a-f]{1,2}[\.:-]){5}([0-9a-f]{1,2}"); //qregexp regexmacaddress("[0-9a-f]{0,2}:[0-9a-f]{0,2}:[0-9a-f]{0,2}:[0-9a-f]{0,2}:[0-9a-f]{0,2}:[0-9a-f]{0,2}"); //regexmacaddress.setpatternsyntax(qregexp::regexp); // ensure hexadecimal characters upper case hwaddress = hwaddress.toupper(); qdebug() << "string match: " << hwaddress << "matched it: " << regexmacaddress.indexin(hwaddress) << " exact match: " << regexmacaddress.exactmatch(hwaddress); // check mac address format if ( regexmacaddress.indexin(hwaddress) == -1 ) { in first example opening bracket missing , \. incorrect (read help explanations), in both a-f matches nothing, due ...

c++ - Simple insert-erase-insert on std::deque<char> gives strange result -

here simple program #include <iostream> #include <deque> #include <string.h> std :: deque <char> d; int main () { const char * x = "abcdefg"; d .insert (d .end (), x, x + strlen (x)); d .erase (d .begin (), d .begin () + 4); d .insert (d .end (), x, x + strlen (x)); std :: cout .write (& d [0], d .size ()); } i expected output "efgabcdefg", actual output, in hex, is 65 66 67 00 00 00 00 c9 0b 02 which "efg???????" what has gone wrong? the problem output deque has no guarantee elements stored contiguously, , in fact not be. means when take address of first element , size may not accessing elements of deque . you have multiple approachs solve problem. the simplest seems to use string instead of deque . printing becomes trivial, , cut-then-append trivial. you use example ostream_iterator print out contents of deque . finally use vector instead is guranteed store eleme...

javascript - How to communicate Catalyst and Node.js -

how communicate between node.js , perl catalyst applications? i have 2 applications: node.js , catalyst. now these 2 applications communicate each other http. it's not fast , secure way. what way communicate its, local unix socket or other? what perl modules , node.js packages can use? a couple of options: zeromq - node binding ; perl binding dnode - perl dnode protocol support lots of possibilities message transport (e.g. rabbitmq) , network communication... sure nice stick http (on top of ssl/tls) of support come it.

push - Is there an effective working method for having two git repositories separated by network file transfer, but not ssh/http? -

i have git repository a on machine a (which in turn clone of "central" repository hosted development team). various reasons, don't develop on machine a (poor development tools), instead i'd develop on machine b . 2 are/can connected transferring files across network (i.e. virtual sneakernet), various complicated firewall-related questions outside scope of question, cannot connect them directly using ssh, http, or suchlike. connecting removable drive/usb stick etc. machine a not possible either. is there easy way me clone repository onto machine b , develop on local branch there several commits, , once i'm done, move/push changes branch onto corresponding branch on machine a transferring single file, rather connecting remote machine using git push / git pull etc.? in other words, can keep them in sync kind of delta file/package file/etc.? i have thought of flattening changes on machine b , using git rebase -i , 1 change, passing on diff, i'd pref...