Posts

c# - WebCamTexture not working on windows phone 10 -

i try open webcam of phone unity3d. mywebcameratexture = new webcamtexture(); mycameratexture.getcomponent<renderer>().material.maintexture =mywebcameratexture; mywebcameratexture.play(); when publish application on phone, camera not start. why? solution? try put plane, have render material still not working.

java - Regex doesn't work in String.matches() -

i have small piece of code string[] words = {"{apf","hum_","dkoe","12f"}; for(string s:words) { if(s.matches("[a-z]")) { system.out.println(s); } } supposed print dkoe but prints nothing!! welcome java's misnamed .matches() method... tries , matches input. unfortunately, other languages have followed suit :( if want see if regex matches input text, use pattern , matcher , .find() method of matcher: pattern p = pattern.compile("[a-z]"); matcher m = p.matcher(inputstring); if (m.find()) // match if want indeed see if input has lowercase letters, can use .matches() , need match 1 or more characters: append + character class, in [a-z]+ . or use ^[a-z]+$ , .find() .

itext - Showing an error while using XMLWorkerHelper -

i trying convert html data pdf. have used xmlworker-5.5.6.jar. while executing code showing error of missing resources. can please help. in advance. here code document document = new document(pagesize.letter); pdfwriter pdfwriter = pdfwriter.getinstance(document, new fileoutputstream(new file(filepathpdf))); document.open(); document.addauthor("me"); document.addcreator("me"); document.addsubject("thanks support"); document.addcreationdate(); document.addtitle("please read this"); xmlworkerhelper worker = xmlworkerhelper.getinstance(); string str = sb.tostring().substring(sb.indexof("<html"),sb.length()); system.out.println(str); worker.parsexhtml(pdfwriter, document, new stringreader(str)); document.close(); system.out.println("done."); and here error : 08-24 12:28:42.079 14077-15044/com.abc.abc e/androidruntime: fatal exception: asynctask #5 ...

javascript - How to ignore case (upper/lower) while triggering change for select in jquery? -

please see code below: <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> </head> <body> <select> <option>one</option> <option>two</option> <option>three</option> <option>four</option> <option>five</option> </select> <script> $("select").val("two").trigger("change"); </script> </body> </html> in case option not set value "two" . if change : $("select").val("two").trigger("change"); then works. how can ignore case while triggering change select? $("select").val("two".tolowercase()).trigger("change"); make value in lowercase , able check not matter upper or lower case in string

android - App Crashes. Error Inflating XML. Cant find image because xxxhdpi folder is not there -

switched eclipse project android studio. maintaining resources under drawable-mdpi folder only. in studio preview of xml loads images correctly. when run app in device resolution higher mdpi app crashes, shows error inflating binary xml. after long analysis found issue device trying load images corresponding density folder not available. created folder drawable-xhdpi , put images in folder. app works fine. why android studio can't pick image other density drawable folder , resize possible eclipse. can't maintain 5 different drawable folders because there lots of images. you have add "drawable-hdpi" resource directory , paste hdpi resources there because 70% android devices supports hdpi resolution images. if maintain hdpi, ok. android manages remaining resouces hdpi resouce directory.

excel - How to open file using Open File Dialog -

i've been searching on web solution on how open file using open file dialog in vbscript. can point me on right track? my code below opens excel file wanted more dynamic in terms input file name can change , not hard coded. set objexcel = createobject("excel.application") objexcel.displayalerts = 0 set objshell = wscript.createobject("wscript.shell") path = objshell.currentdirectory infilename = "inputfile.xlsx" infilepath = path + "\" + infilename 'open target workbook set objworkbook1 = objexcel.workbooks.open(infilepath, false, true) msgbox "reading data " & infilename & vbnewline, vbokonly + vbinformation, _ "reading data" when in doubt, read documentation . set dialog = objexcel.filedialog(3) dialog.allowmultiselect = true dialog.show each f in dialog.selecteditems set objworkbook = objexcel.workbooks.open(f) '... stuff ... objworkbook.close next

git - Use merge operation in gradle (using grgit) -

i want merge branch branch in git using gradle git (grgit) plugin. branch merged first branch , branch first branch merged second branch. so, merge operation this: def grgit = org.ajoberstar.grgit.grgit.open(dir: project.parent.projectdir) grgit.checkout(branch: 'origin/first') grgit.merge(head:'origin/second',mode: org.ajoberstar.grgit.operation.mergeop.mode.only_ff) it builds fine doesnot merge operation. idea?

mysql - How to get json array and insert in the database. php -

i have table on invitation. passing data in json format postman. i want send many invitations @ time. want insert multiple invitations. how can this? i have created single invitation. invitaion : class invitation { private $sender_id,$date,$invitee_no,$status; function invitation($sender_id,$date,$invitee_no,$status) { $this->sender_id = $sender_id; $this->date= $date; $this->invitee_no = $invitee_no; $this->status = $status; } function sendinvite() { $database = new database(contactsconstants::dbhost,contactsconstants::dbuser,contactsconstants::dbpass,contactsconstants::dbname); $dbconnection = $database->getdb(); $stmt = $dbconnection->prepare("select * invitation invitee_no =?"); $stmt->execute(array($this->invitee_no)); $rows = $stmt->rowcount(); if($rows > 0) { $response = array("status...

osx - I install gcc5.3.0 on my mac, and I broke it. What should I do to reuse apple-gcc42? -

i used rm -rf delete gcc5.3.0, mac continues use gcc5.3.0. wrong message: g++: error trying exec 'cc1plus': execvp: no such file or directory what should reuse apple-gcc42? editing comments , responses answer. where gcc 5.3.0 installed? did come from? did create or apple, or 1 of auxilliary packagers? did recursive remove remove anything? running xcode-select help? (use man xcode-select see does; maybe xcode-select --install useful, i'm not sure since i've never destroyed compilation system that.) version of xcode have installed? version of mac os x running? gcc5.3.0 installed @ /usr/local/libexec/gcc/x86_64-apple-darwin15.0.0/5.3.0 . removed folder gcc . mac os x 10.11.6 , xcode 7.3.1. removing /usr/local/lib/libexec/gcc didn't remove executables /usr/local/bin , when run g++ , shell still finding executable /usr/local/bin/g++ , not finding auxilliary programs because did manage remove them. haven't cleaned headers installed und...

ruby - Retrieving only the sixth and seventh matching results in a Rails table -

i working on rails app, , hitting roadblock: need return several items in table are, say, 6th-8th matching items. ironically, rails has helper method shown here .first through .fifth. my question is: how can find these results when n searching 6,7,8 , on without calling of 1st through 8th items? here's why doing this. making home page blog. @ top, want show 5 recent posts (which shown image). underneath them, want show additional 3 links posts text. currently, doing first part fine. in blog.controller.rb : @posts = post.order('created_at desc').first(5) i iterate through posts in view, , shows first 5 recent results. want show 6th-8th, , try , store them in new method. change controller to: @posts = post.order('created_at desc').first(5) @texts = post.order('created_at desc').limit(8) this returns 8 recent posts instead of, say, 8th. is possible me limit @texts show matching 6th, 7th, , 8th results? yes. you'...

java - Jenkins: JDK configuration -

i have both java 1.7 , 1.8 installed in virtual cent os. installed jenkins , running fine dont know version of java using. how can detect that? what configuration file of jenkins setup jdk version manually? edit: ** dont want configure jdk global tool configuration of manage jenkins first, determine process id of jenkins (e.g., ps aux | grep jenkins ) then check corresponding exe entry in /proc file system : $ ls -l /proc/2884/exe lrwxrwxrwx 1 user users 0 aug 24 08:08 /proc/2884/exe -> /usr/lib/jvm/java-8-jdk/jre/bin/java for selecting java version, depends on how start jenkins. if start command line, proper setting of path , java_home sufficient. if use service file ( /etc/init.d/jenkins , or systemd approach), depends on implementation of service.

javascript - How to upload more than 2 files by Dropzone.js with button -

i make simple form uploading files. form can add multiple files queue. special button can remove file queue. reason doesn't work in way want. clicking "unload files" 2 files uploading server. if click second time second 2 files uploading. code below. how upload files click button ones? in advance. html: <div class="panel panel-default"> <div class="panel-heading"> <strong>Прикрепить файлы</strong> </div> <div class="panel-body"> <button type="button" class="btn btn-primary" id="add-file"> <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span> Обзор... </button> <button type="button" class="btn btn-primary" id="upload-file"> <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></spa...

html - Load different background image without loading default -

my rails project has default pattern background pages. i'm trying set root page whole-screen background image. upon loading, works expected. however, when opening page 1 can see two-step delay page first opens default colorful background, , lays image on page. there way can not load default background on 1 view in order avoid two-step view during loading? i have given root view (static_pages#index) #landing-page id. css: #landing-page { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: url(ripples.jpeg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } body { background: url('congruent_pentagon.png'); } if first background comes body, solution add different classes main , other pages body in layout <body class="<%= current_page?('/') ? 'main-page' : 'page' %>"> and in c...

objective c - Calling/Executing applescript commands from a ios xcode project -

so in ios xcode project, trying call applescript code xcode. know possible os x possible ios? instance in os x can execute applescript code using nsapplescript . there equivalent function in ios project? i appreciate can get. thanks. applescript not supported in ios. if want open application app can consider using url scheme of app (if registers one). more info can found @ : https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/inter-appcommunication/inter-appcommunication.html#//apple_ref/doc/uid/tp40007072-ch6-sw2

angular - How to use PayPal SDK Cordova Plugin in ionic2 -

can 1 tell how import , implement paypal cordova plugin in ionic2. i had install plugin using cordova plugin add com.paypal.cordova.mobilesdk paypal cordova plugin on github paypal official developer cordova plugin

javascript - force form submit button click with jquery -

trying trigger submit functionality jquery. doing wrong? in theory, should work. i've tried 4 different ways though. i have tried $('input#submit').trigger("click"); $( form:first ).submit(); $( form:first ).trigger("submit"); $('form#databaseactionform').submit(); nothng has worked (yet)?! code: <html lang="en"> <head> <title>database management</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <script src="http://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-ccuebr6csya4/9szppfrx3s49m9vuu5bgtijj06wt/s=" crossorigin="anonymous"></script> <style> table td { border: 1px solid black; } table td:first-child { text-align: left; } </style> <script> <!-- $(document).ready(function() { $('#...

reporting services - How to make report on 2016 SSRS Report Server and upload it to 2014 SSRS Report Server? -

Image
it seems there not backward compatibility option upload new version report older version server. this 2 step process. on project properties page, set targetserverversion sqlserver 2008 r2, 2012 or 2014 deploy bin folder of project. (if manually deploying/uploading). when building report, vs2015 create rdl file in \bin directory targets correct version of ssrs you can right click | deploy project if settings above have relevant values

active directory - Using group policy migration table does not catch all occurrences -

Image
i'm trying use group policy migration table editor make conversion table import job... and can see below, results positive can't seem account occurrences in policy. what doing wrong?

c# - Project a Query onto an anonymous Dictionary<string,int> -

i trying check if entity in database has foreign key relations, can inform user entity can or cannot deleted. i understand can done in rolled transaction, inform user how many references , assist in decision delete entity. i trying avoid loading entire navigation collection memory data may large. so, in light of this, can formulate simple query firstly determine if there references: private bool candeletecomponent(int compid) { var query = _context.components.where(c => c.componentid == compid) .select(comp => new { references = comp.incidents.any() && comp.drawings.any() && comp.documents.any() && comp.tasks.any() && comp.images.any() && comp.instructions.any() }); var result = query.firstordefault(); if (result != null) { return !result.references; } return true; } this performs series of select count...

node.js - Using named streams with clis without support for stdin -

i'm using following code read pdf web , pass pdftotext without saving in local file system: const source = 'http://static.googleusercontent.com/media/research.google.com/en//archive/gfs-sosp2003.pdf' const http = require('http') const spawn = require('child_process').spawn download(source).then(pdftotext) .then(result => console.log(result.slice(0, 77))) function download(url) { return new promise(resolve => http.get(url, resolve)) } function pdftotext(binarystream) { //read input stdin , write stdout const command = spawn('pdftotext', ['-', '-']) binarystream.pipe(command.stdin) return new promise(resolve => { const result = [] command.stdout.on('data', chunk => result.push(chunk.tostring())) command.stdout.on('end', () => resolve(result.join(''))) }) } in example, work because pdftotext supports stdin, if wasn't case, do? write named streams, didn't f...