Posts

c# - I use the following code to capture image from camera. But I cant record the video by this -

cameracaptureui capture = new cameracaptureui(); capture.photosettings.format = cameracaptureuiphotoformat.jpeg; capture.photosettings.croppedaspectratio = new size(1, 2); capture.photosettings.maxresolution=cameracaptureuimaxphotoresolution.highestavailable storagefile storefile=await capture.capturefileasync(cameracaptureuimode.photo); if (storefile != null) { var stream = await storefile.openasync(fileaccessmode.read); bitmapimage bimage = new bitmapimage(); bimage.setsource(stream); image imageitem = new image(); imageitem.source = bimage; my_canvas.children.add(imageitem); just use standard sample recording video capture photos , video cameracaptureui cameracaptureui captureui = new cameracaptureui(); captureui.videosettings.format = cameracaptureuivideoformat.mp4; storagefile videofile = await captureui.capturefileasync(cameracaptureuimode.video); if (videofile == null) { // user cancelled photo capture return; }

awk - Bash directories going in the wrong place -

i'm bash noob great! in advance! what i'm trying take first column students.txt file in input folder , create directories them in output folder. my problem when execute script 1 (the first $stuid ) directory gets made inside output folder. rest goes main folder. #!/bin/bash filecontent=`awk '{print $1}' input/students.txt` stuid in "${filecontent[*]}"; mkdir -p ./output/$stuid done use while read loop extract first field each line , create directory: while read -r stu_id junk; mkdir -p ./output/"$stu_id" done < input/students.txt

c# - Microsoft.Office.Interop.Word reference in Visual Studio 2015 and MS Office 2016 -

i have visual studio 2012 update 1 , office 2010, git cv system, , autobuild system based on teamcity enterprise. there project contain references "microsoft.office.interop.word". on new workplace have installed vs 2015 (update 1) , ms office 2016. gave issue type or namespace 'office' not found in microsoft . deleted old references , add new references "microsoft office 16.0 object library" , "microsoft word 16.0 object library". now, in new visual studio 2015 project compiles ok. .csproj-file has been changed not compiling on other programmers computers, have vs 2012 or vs 2013. is there way combine both references different office versions? alternatively, how can configure moment work fine on workplaces? can copy old .dll (from office 2010) computer , add project outer .dll? or bad idea? always program against oldest version of word (any office program) solution needs support. compiled against version 2016 isn't going ru...

javascript - PHP MySQl Chained Select -

i have 2 drop downs populated mysql tables. in mysql tables have foreign key restraints table "assets" has column "department" linked department table. each asset has associated department. my first dropdown "department" , want second dropdown show results selected department. here's code. <select id="location" name="location"> <option value="">select asset location</option> <?php $pdo = new pdo('mysql:host=localhost;dbname=maintlog', 'root', '*******'); #set error mode errmode_exception. $pdo->setattribute( pdo::attr_errmode, pdo::errmode_exception); $stmt = $pdo->prepare('select id,name location'); $stmt->execute(); while ($row = $stmt->fetch(pdo::fetch_assoc)) { echo "<option value='$row[id]'>$row[name]</option>"; } ?> </sele...

angularjs - Chrome complaining about html tags in app.js -

i trying make simple spa angular , node. when try test if spa working in chrome, chrome gives me peculiar error. complaining html tags in demoapp.js, though not contain html code. how can be? error: demoapp.js:1 uncaught syntaxerror: unexpected token < test.html <html ng-app="demoapp"> <head> <title>my angular app</title> </head> <body> <h2>demoapp demo</h2> <div> <a href="#/partial1.html">partial 1</a> <a href="#/partial2.html">partial 2</a> <div ng-view></div> </div> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.js"></script> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular-route.js"></script> <script src = "demoapp.js"></scri...

typescript - Subscribe Observable value -

when i'm logging value of variable inside subscribe have value when doing outside undefined ???: this._postservice.getconf("app/conf/conf.json") .subscribe(res =>{ this.home = json.stringify(res); console.log("value :" + this.home); i want initialise home varibale value i'm doing on ngoninit value undefined when i'm trying outside: this fonction : getconf(url){ return this._http.get(url). map(res => {return res.json()}); } //ngoninit : ngoninit(){ this._postservice.getconf("app/conf/conf.json") .subscribe(res =>{ this.home = json.stringify(res); console.log("hahowaaaaaaaa" + this.home); } ); //// acount this._postservice.getposts(this.home) .subscribe(result =>{ this.loading = false; this.actionsg = result; var count = json.stringify(result); this.acount = count.substring(count.indexof(','),23); },err...

multithreading - MFC/CLI mixed mode 'System.AccessViolationException' -

i running mfc dialog based application. have serial-comms thread running in reference class (outside code snippet) sends string^ dialog (so can put comms in window). problem (as see commented code) every time try string (except assign local variable) "an unhandled exception of type 'system.accessviolationexception' occurred in dlp_printer_control.exe additional information: attempted read or write protected memory. indication other memory corrupt." in snippet, atoi crashes. using atoi because had idea of trying copy each string element ascii , copying value member cstring. didn't work. every commented line produces exception. sue trying access originated in managed memory. workarounds suggested? bool cdlp_printer_controldlg::updatecommswindow_right(string^ strcommsline) { cstring strtemp = strcommsline; lpwstr chartemp; int = 0; int i_len = strtemp.getlength(); if (i_len == 0) return false; chartemp= strtemp.getbuffer(i_...