Posts

How do I install to my Linux laptop a software project hosted on git? -

how install, linux laptop, software project hosted on github? not attempting set project/repository myself. intention download project, in order use/execute it. name of process? how done? if helps, trying install command line interface last pass. instructions seem assist me downloading dependencies. downloading zip file provides folder filed random files. used installers, perhaps missing steps aid understanding. this off-topic stackoverflow, it's not programming. has nothing git, got files github, git has nothing installing it. the first thing should check if software available linux distribution, using system's software management tools. installing there simpler , mean software gets updated automatically in future. if isn't packaged distro, , project don't provide binaries, may need build software yourself. among files cloned github should readme or install file instructions on building , installing it. typically involves running configure script, o...

c++11 - C++: error: exception handling disabled, use -fexceptions to enable -

i trying compile simple code -fno-exceptions flag. giving error. please let me know how suppress this. using gcc version 4.6.3 code #include <iostream> using namespace std; int main () { try { throw 20; } catch (int e) { cout << "an exception occurred. exception nr. " << e << '\n'; } return 0; } log > g++ throw.cc -o out -fno-exceptions throw.cc: in function ‘int main()’: throw.cc:10:11: error: exception handling disabled, use -fexceptions enable throw.cc:14:56: error: ‘e’ not declared in scope edit i have client code have lot throws this. have integrate in project , can't control compilation flags build(which come config has -fno-exceptions enabled). wanted quick work around can suggest. edit i found workaround see below answer. you cannot use -fno-exceptions flag program, use exceptions (try/catch/throw). quote gcc manual before detailing library support -fno-exceptions, firs...

python - Pycharm unresolved reference issue -

Image
i have strange pycharm behavior. have project , folder in named core (see picture details). in have 2 python files: agentmeasurement.py , collectorbase.py . now, want import type agentmeasurement agentmeasurement.py in collectorbase , write following: from agentmeasurement import agentmeasurement . works fine (when run script), pycharm marks unresolved reference. i tried mark core source root, can't reference other folders package (i.e. from core.agentmeasurement import agentmeasurement ) , can write from agentmeasurement import agentmeasurement makes code unreadable. how can make pycharm work correctly in such case?

java - Does DeferredResult have a race condition when returning a potentially already-set instance? -

i'm using deferredresult in spring mvc application handle server-side processing of potentially long-running action. might very fast, or take second or two. but in either case, incoming http request causes action pushed queue, separate thread (via executorservice ) responsible consuming. callback called, notifying pusher operation has completed. i refactored of behavior utility method: public static deferredresult<string> toresponse(gamemanager gamemanager, final player player, action action) { deferredresult<string> deferredresult = new deferredresult<>(); gamemanager.execute(action, new handler<result>() { @override public void handle(result result) { jsonobject obj; try { obj = gamemanager.getgamejson(player); obj.put("success", result.getresult()); obj.put("message", result.getmessage());...

objective c - AUHAL with USB audio device -

i've got usb audio device (presonus audiobox) , want able switch audio output of program between usb device , default output device (the internal speakers). apple documentation tells me have use auhal: if need connect [..] hardware device other default output device, need use auhal. source normally, make device description , if exists. wrote function test this: -(osstatus) showauhaldevices { //show available auhal devices // create description audiocomponentdescription test_desc; test_desc.componenttype = kaudiounittype_output; test_desc.componentsubtype = kaudiounitsubtype_haloutput; test_desc.componentmanufacturer = kaudiounitmanufacturer_apple; test_desc.componentflags = 0; test_desc.componentflagsmask = 0; // determine number of available components uint32 count = audiocomponentcount(&test_desc); // print result osstatus err = noerr; cfstringref compname; audiocomponent test_comp; (uint32 = 0; ...

javascript - angularjs watch for change in scope variable made from another controller -

i have following service function pathfactory() { this.path = null; this.setpath = function(path) { this.path = path; } return this; } my navigation controller: function navcontroller($scope, pathfactory) { list = document.getelementsbytagname("ul"); list = list[0]; var items = list.getelementsbytagname("li"); for(var = 0 ; < items.length ; i++) { items[i].setattribute("navindex", i); items[i].addeventlistener("click", navclick); } function navclick(e) { switch(e.path[1].hash) { case "#home": pathfactory.setpath("home"); break; case "#bots": pathfactory.setpath("bots"); break; case "#servers": pathfactory.setpath("servers"); break; case "#status": ...

regex - Regexp for parsing a string -

hello have troubles in parsing these strings (num of columns fixed) 9/01 down/down 0/ 0 0/ 0 0/ 0 0/ 0 0%/ 0% 9/01 up/ 33172/100014 65/ 111 -106/ 136 33172/100014 100%/100% the final result should matrix like: 9/01 | down/down | 0/ 0 | 0/ 0 | 0/ 0 | 0/ 0 | 0%/ 0% 9/01 | up/ | 33172/100014 | 65/ 111 | -106/ 136 | 33172/100014 | 100%/100% could me in writing regexp single input line? riccardo edit: temp solution: [^/]+/[\s]*[^\s]+ ahh lot better. @ndn proud of, think. :p ([\w\/%\-\s]+?)(?:\b\s|$) regex101 if want captured in line right away separate capture groups can use this: (\d+\/\d+)\s+(\w+\/\s?\w+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-%]+\/\s?[\d%]+) regex101