Posts

Showing posts from April, 2012

function - How to output two different sets of random numbers in C++? -

so far, code: #include <iostream> #include <time.h> #include <stdio.h> #include <stdlib.h> using namespace std; int dealerroll(int dealerroll) { srand (time(null)); (int dealercount = 1; dealercount <= 3; dealercount++) { dealerroll = rand()% 6+1; cout << dealerroll << " "; } return dealerroll; } int playerroll(int playerroll) { srand (time(null)); (int playercount = 1; playercount <= 3; playercount++) { playerroll = rand()% 6+1; cout << playerroll << " "; } return playerroll; } int main() { int dealerroll; int playerroll; cout << "dealer's roll: " << endl; dealerroll(dealerroll); cout << endl << "your roll: " << endl; playerroll(playerroll); system ("pause"); return 0; } my problem dealer , player's random (dice) roll same. output example:

java - How to lock button for 30 seconds if incorrect username/password 3 times? -

this code have. reads text file , compares users input. have been trying add counter++ , once count =3 can't work. feel should easy.... boolean login = false; while (read.nextline() !=null) { string user = read.next(); string pass = read.next(); read.next(); if(usernamet.gettext().equals(user) && passwordt.gettext().equals(pass)) { login = true; break; } } if (login) { new menu(); } else { joptionpane.showmessagedialog(null, "incorrect username or password"); usernamet.settext(""); passwordt.settext(""); } am thinking along write lines? for(count=0;count<4){ if(login) new menu(); else { joptionpane.showmessagedialog(null, "incorrect username or password"); usernamet.settext(""); passwordt.settext(""); count++ } }

Good or bad to provide services per component angular 4? -

actually, have 2 questions angular 4 best practice. i have service named remoteservice , responsible xhr calls. want catch component instance, using service, in remoteservice . guess, better provide service per component level. because don't want every methods of service take component instance parameter. but, or bad provide service per component?. way: remoteservice used in hundreds of components. i'm trying follow style guide of angular. should place remoteservice ?. shared feature module or core feature module?. it's purpose seems exceptionservice , loggerservice . not singleton service explained above. may depends on answer of question 1. so answer both questions - remoteservice idea. call mine apiservice . this idea several reasons - all http calls out of 1 file allows single endpoint external requests. it's more organized having calls come out of individual component-level services you have more control on calls. meaning, if needed put

linux - Facebook-Scribe creating directories which are no longer needed -

i using facebook scribe logging data remote files. scribe seems remember file paths has seen far. e.g., pattern old_directory_pattern/old_file_pattern.log , has been changed to: new_directory_pattern/new_file_pattern.log . i deleted old directories , started logging in new pattern. but, saw strange, scribe creating both old_directory_pattern/old_file_pattern.log , new_directory_pattern/new_file_pattern.log . the difference was, in old pattern, files empty , in new files contained data. scribe continued rotation of files in both old , new directories. may because scribe storing files information. thinking in these lines, thought of restarting scribe, didn't either. please me this. i not want files old pattern created, no 1 writing in files, empty files, scribe creating , rotating them every hour. i don't find problems logging. but, sharing scribe config, in case there parameter needs set/unset: port=1464 max_msg_per_second=2000000 check_interval=3 <store

plsql - When i create a trigger it gives an error saying it is invalid and failed re-validation -

i tried updating client_master table gave error idk why.i did update client_master set name='abc' name='xyz'; create or replace trigger client_audit before update or delete on client_master each row begin case when updating insert audit_client values(:old.c_no,:old.name,:old.address,:old.bal_due,'upd','1',sysdate); when deleting insert audit_client values(:old.c_no,:old.name,:old.address,:old.bal_due,'delet','2',sysdate); end case; end; / try solution. hope helps. create or replace trigger client_audit before update or delete on client_master each row declare begin if updating insert audit_client values ( :old.c_no, :old.name, :old.address, :old.bal_due, 'upd', '1', sysdate ); elsif deleting insert audit_client values ( :old.c_no, :old.name, :old.address, :ol

Firebase and indexing/search -

i considering using firebase application should people use full-text search on collection of few thousand objects. idea of delivering client-only application (not having worry hosting data), not sure how handle search. data static, indexing not big deal. i assume need additional service runs queries , returns firebase object handles. can spin such service @ fixed location, have worry availability ad scalability. although don't expect traffic app, can peak @ couple of thousand concurrent users. architectural thoughts? long-term, firebase have more advanced querying, it'll support sort of thing directly without having special. until then, have few options: write server code handle searching. easiest way run server code responsible indexing/searching, mentioned. firebase has node.js client, easy way interface service firebase. of data transfer still happen through firebase, write node.js service watches client "search requests" @ designated locat

xamarin.ios - Xamarin Forms - IOS , Scripts and styles are not calling -

Image
i working on xamarin forms ios application calling html pages, styles , scripts using hybrid webview. not able render styles , scripts , code hybridwebviewrenderer.cs protected override void onelementchanged (elementchangedeventargs<hybridwebview> e) { base.onelementchanged (e); if (control == null) { usercontroller = new wkusercontentcontroller (); var script = new wkuserscript (new nsstring (javascriptfunction), wkuserscriptinjectiontime.atdocumentend, false); usercontroller.adduserscript (script); usercontroller.addscriptmessagehandler (this, "invokeaction"); var config = new wkwebviewconfiguration { usercontentcontroller = usercontroller }; var webview = new wkwebview (frame, config); setnativecontrol (webview); } if (e.oldelement != null) { usercontroller.removealluserscripts (); usercontroller.removescriptme

javascript - Make user input start with either "BR" or "BT" -

i have input field , check if input entered starts either "br" or "bt". example br1234 valid jh1234 not valid. @ moment can check "br" , not "bt". this code have far: if (id.indexof('br') === 0) || (id.indexof('bt') === 0){ } else { id = "invalid id" document.getelementbyid('id').innerhtml = id return false; check have proper parentheses in right positions. condition if statement contains id.indexof('br') === 0 because closed parenthesis it. if (id.indexof('br') === 0 || id.indexof('bt') === 0) { // ... } you can use string.prototype.startswith check if string starts desired string. if (id.startswith('br') || id.startswith('bt')) { // ... }

javascript - How to show custom label on pie chart using c3js? -

Image
i want show custom label on pie chart shown in image using c3.js . i tried change pie chart label format: {...} function. doesn't work. here tried, var charthree = c3.generate({ bindto: "#chartthree", size: { width: 500, height: 300 }, data: { colors: { a: 'yellow', b: 'red', c: 'green', d: 'orange', e: 'blue' }, columns: [ ['a',20], ['b',40], ['c',20], ['d',10], ['e',9] ], type: 'pie' }, pie: { labels: { show: true, threshold: 0.1, format: { a: function (value, ratio, id) { if(value=20) { return "a<br/>9item<br/>20.2%"; }

javascript - Angularjs dynamic form contents -

here angular view, <label class="control-label">skipcolumns:</label> <br /> <fieldset ng-repeat="skipcolumn in config.skipcolumns track $index"> <input type="text" class="form-control" ng-model="skipcolumn[0]" /><br /> </fieldset> <button class="btn btn-default" ng-click="addnewskipcolumn(skipcolumn)">add skipcolumn</button> <br /> which adds new textfield every time click addskipcolumn button. here js code: $scope.config.skipcolumns = []; $scope.addnewskipcolumn = function (skipcolumn) { if($scope.config.skipcolumns==null){ $scope.config.skipcolumns=[]; } $scope.config.skipcolumns.push([]); } so problem when display or see structure of $scope.config.skipcolumns, gives following output: { skipcolumns:[["content of textfield1"],["content of textfield1"]..] } but need is,`

php - AJAX Variable data -

i have question ajax. my ajax script : { "data": "noinduk", "width": "100px", "sclass": "text-center", "orderable": false, "mrender": function(data) { return '<a href="data.php?noinduk="' + data + '"">edit</a>'; } how can make more 1 variable review data request. return '<a href="data.php?noinduk="'+ data + '"">edit</a>'; be return '<a href="data.php?noinduk="'+ data + '"/"'+ data2 + '"">edit</a>'; one solution whole data concatenating specific delimiter | , on ajax response split data, have 2 responses. { "data": "noinduk", "width": "100px", "sclass": "text-center", "orderable": false, "mrender": function(data) { var ne

javascript - Why is this variable reassigned to 0? -

Image
i have react component takes in array, , renders components using map() . issue index value map() seems revert 0 no matter in anonymous function associated onchange listener. function questions({ questions, answers, toggleanswers }) { const questionbuttons = questions.map((question, index) => { if (answers[index - 1] === undefined || answers[index - 1] === 'true') { const buttonindex = index; console.log('before return etv:', event.target.value, 'index:', index, 'buttonindex:', buttonindex); return ( <customformcomponent key={ index } name={ question.substr(0,5) } label={ question } value={ answers[index] } handlechange={ (event) => { console.log('isthisever not zero?', buttonindex); toggleanswers(event, index); } } /> ); } else { return null; } }); return ( <div

wordpress - 301 redirect .htaccess - https preventing redirect -

the english section of site has moved subdirectory of old domain own domain. such, have set 301 redirects follows in .htaccess... errordocument 404 http://www.some-site.jp/ rewriteengine on rewritecond %{http_host} ^(some-site\.jp)(:80)? [nc] rewriterule ^(.*) http://www.some-site.jp/$1 [r=301,l] rewriterule ^index\.html$ / [r=301,l] rewriterule ^(.*)/index\.html$ /$1/ [r=301,l] redirect 301 /en/index.html https://some-site.com/ redirect 301 /en/contact/index.html https://some-site.com/contact/ etc....... this works fine of site, has no certificate. contact page alone https , not redirect. i tried solutions found here no avail. suggestions?

html - Automate Mail merge in Excel VBA - Not sending multiple emails -

this automated mail merge pieced few different sites. it's been altered many times make sure email sends html , includes default users signature. after button click, window pops select range, email personalised depending on range selection. sub emailattachmentrecipients() 'updateby extendoffice 20160506 dim xoutlook object dim xmailitem object dim xrg range dim xcell range dim xtxt string dim signature string dim xemail string dim xsubj string dim xmsg string dim integer dim k double ' create window select range xtxt = activewindow.rangeselection.address set xrg = application.inputbox("please select arresses list:", "water corporation mail merge", xtxt, , , , , 8) if xrg nothing exit sub = 1 xrg.rows.count set xoutlook = createobject("outlook.application") set xmailitem = xoutlook.createitem(0) xmsg = "<body style=font-size:11pt;font-family:verdana>" & sheet2.cells(4, 2) & " &

select - Multiselect in Angular 2 -

here code: want use onselect type triggering instead of change, welcome. <select multiple (change)="setselected($event.target)"> <option *ngfor="let accesskey of accesskeys" [ngvalue] = "accesskey"> {{accesskey.name}}</option> </select> you can simpply use primeng's multiselect see here more info https://www.primefaces.org/primeng/#/multiselect

How to get current monthly interval from given date till today in PHP? -

for example starting date 5th january 2017 , today 7th april 2017. 5th jan 5th feb interval 1, 5th feb 5th march interval 2, 5th march 5th april interval 3. 5th april till 5th may interval 4. so if today 7th april result should return interval 4. function currrent_monthly_interval($from_date) { $interval = date_diff(date_create($from_date), date_create(date('y-m-d'))); return intval($interval->format('%m')) + 1 ; }

angularjs - Wrapping primeng components? (Angular) -

i have been using primeng while , found have lot selectbuttons same configuration in few forms. best option creating general component? i started create component, passing in formcontrol input, , model. but... doesn't seem best way. (i can't put ngmodel, name...). any suggestions? thank in advance finally, able using fordwardref , ng_value_accessor.

android - Inheriting from AppCompat Toolbar changes Toolbar icon margin -

Image
in project i'm extending android.support.v7.widget.toolbar add functionality class. however, when implement class in layout file changes margin (or padding, not sure...) of icons displayed on toolbar. default android.support.v7.widget.toolbar result: custom toolbar class result: my custom toolbar class has no code yet, implements required constructors, i'm not manipulating margin myself. here's custom toolbar class: import android.content.context; import android.support.annotation.nullable; import android.support.v7.widget.toolbar; import android.util.attributeset; public class themedtoolbar extends toolbar { public themedtoolbar(context context) { this(context, null); } public themedtoolbar(context context, @nullable attributeset attrs) { this(context, attrs, 0); } public themedtoolbar(context context, @nullable attributeset attrs, int defstyleattr) { super(context, attrs, defstyleattr); } } and here

java - How do you convert multiple lines of String input to Upper Case until EOF? -

import java.util.scanner; public class shout { public static void main(string[] args) { string str1; string str2 = ""; scanner keyboard = new scanner(system.in); stringbuilder output = new stringbuilder(); while (keyboard.hasnextline()) { str1 = keyboard.nextline(); stringbuilder sb = new stringbuilder(str1); output.append(sb.touppercase().tostring()).append("\n"); } system.out.print(output.tostring()); } } i looking convert multiple lines of input until eof (ctrl+d) uppercase. can used print out same multiple lines in uppercase? example, input , output like: car bus taxi car bus taxi with repeated lines in uppercase. put each line hashmap, , each time line check if same string found in hashmap. if not, print normal , add hashmap. otherwise print uppercase. code should similar this. map<string> lines = new hashmap(); while (keyboard.ha

delphi - How to determine if a program needs elevated rights? -

this question has answer here: how detect if executable requires uac elevation (c# pref) 3 answers imagine following scenario: i have exe-file "doineedadmin.exe" somewhere , want check if program require admin-rights start it. it okay trying start , determine failure return value. since windows can adding admin-icon exe if needs elevated rights, hope it's possible programmatically too. in short, there no sure way. windows start program elevated if specified in manifest. start elevated if program name contains setup, install, update, patch (maybe more) (unless disabled local policy or manifest file ). other that, application can request elevation code. there's no way can detect in external program.

c# - Entity Framework database first with MySQL not working -

Image
i have been trying use entity framework connect mysql database, database first, can´t connection database. when searching google , mysql.com, guides thats telling me use code first or model first. what want do: add new entity data model, write credentials database , then, works fine , can write linq queries used to. i using windows 8, vs 2013 ultimate, environment.version 4.0.30319.36366. how can connect mysql ef database first? that's common error when first load ef designer. don't know if same in vs 2013 in vs 2015 can create new connection , select mysql, mysql visual studio should installed.

typescript - Angular 2 injected service into another service is undefined -

i'm trying create small framework make easier me implement crud functionality. therefore i've created basehttpservice this: ... <imports> ... @injectable() export class basehttpservice { constructor( private http: http ) { console.log('ctor'); this.apiurl$.subscribe(apiurl => this.rootapiurl = apiurl.removetrailingslash()); } public getpagedresultoftype<t extends ibaseentity>(url: string, vm: isearchvm<t>, options?: requestoptions): observable<pagedresult<t>>{ ... <implementation> ... } ... <other methods> ... } then have baseentityreadonlyservice uses basehttpservice create read fucntionality of crud: @injectable() export class baseappsumentityreadonlyservice<t extends ibaseentity>{ constructor( @inject(forwardref(() => basehttpservice)) public basehttpservice: basehttpservice // public basehttpservice: basehttpservice ) { console.log('ro ctor'); console

javascript - Regex match HTML attributes names -

i have following element stored string: <div class="some-class" id="my-id" data-theme="black"> <strong data-animation="fade" disabled>hello world!</strong> </div> i want extract attributes names this: ["class", "id", "data-theme", "data-animation", "disabled"] this tried do, values , dosent match data-animation , disabled: http://jsbin.com/hibebezibo/edit?js,console edit: manged attributes using: [\w-]+(?=\s*=\s*".*?") but still cant "disabled" prop. can explain me how achieve this? thanks! using below regex benefits positive lookahead able match attributes' names: [ ][\w-]+(?=[^<]*>) note: adding - character class must. javascript code: const htmlelement = `<div class="some-class" id="my-id" data-theme="black"> <strong data-animation="fade" di

java - Using MultipleOutputs without context.write results empty files -

i don't know how use multipleoutputs class. i'm using create multiple output files. following driver class's code snippet configuration conf = new configuration(); job job = job.getinstance(conf); job.setjarbyclass(customkeyvaluetest.class);//class mapper , reducer job.setoutputkeyclass(customkey.class); job.setoutputvalueclass(text.class); job.setmapoutputkeyclass(customkey.class); job.setmapoutputvalueclass(customvalue.class); job.setmapperclass(customkeyvaluetestmapper.class); job.setreducerclass(customkeyvaluetestreducer.class); job.setinputformatclass(textinputformat.class); path in = new path(args[1]); path out = new path(args[2]); out.getfilesystem(conf).delete(out, true); fileinputformat.setinputpaths(job, in); fileoutputformat.setoutputpath(job, out); multipleoutputs.addnamedoutput(job, "islnd" , textoutputformat.class, customkey.class, text.class); lazyoutputformat.setoutputfor

codenameone - How can i add pull to fresh option in swipe tabs in codename one? -

i want add pull fresh option in swipe tabs it's not working have taken container , try add seems same. here code displaycontainer = new container(); getdisplay(displaycontainer); for(i=0;i<totalradiobutton;i++){ tabs.hidetabs(); displaycontainer = new container(new boxlayout(boxlayout.y_axis)); getdisplay(displaycontainer); tabs.addtab("",displaycontainer); //tabs.add(flowcontainer); tabs.setname("t"+i); tabs.settabuiid(tabs.getname()); radiobutton =new radiobutton(); radiobutton.setname("rbt"+i); radiotypecontainer.add(radiobutton); finalradiolist.add(radiobutton.getname()); tabslistname.add(tabs.gettabuiid()); radiolist.add(radiobutton); tabindex0="rbt0"; if(radiolist.get(i).getname().equals(tabindex0)){ radiolist.get(i).setselected(true); } buttongroup.addall(radiobutton);

c# - Double dispatch inside a single inheritance tree -

i have inheritance tree of different line -classes, starting abstract line -class. want able intersect each line each other line, , sometimes, not know neither of runtime types, e.g. i'm calling line.intersect(line) (so need double dispatch). call abstract overload of overriden intersect -methods, e.g. circle.intersect(line) instead of circle.intersect(actualtype) . here's example code: class program { static void main(string[] args) { line straightline = new straightline(); line circle = new circle(); // print: "circle intersecting line." // should print: "circle intersecting straight line." circle.intersect(straightline); console.readline(); } } abstract class line { public abstract void intersect(line line); public abstract void intersect(straightline straightline); public abstract void intersect(circle circle); } class straightline : line { public override void intersect(line line) { console.wri

linux - Interfaces cannot ping each other over ovs vxlan -

Image
i'm setting layer 2 network on 2 virtual machines using openvswitch-2.5.2, above picture shows. after reading ovs official tutorials , other articles, i've tried following cmds on each virtual machine: # on vm1 ip link add dev veth0 type veth peer name veth1 ip link add dev veth3 type veth peer name veth4 ip netns add ns0 ip netns add ns1 ip link set veth0 netns ns0 ip link set veth3 netns ns1 ip link set veth1 ip link set veth4 ip netns exec ns0 ip link set veth0 ip netns exec ns1 ip link set veth3 ip netns exec ns0 ip addr add 10.0.0.1/24 dev veth0 ip netns exec ns1 ip addr add 10.0.0.3/24 dev veth3 ovs-vsctl add-br br0 ovs-vsctl add-port br0 veth1 ovs-vsctl add-port br0 veth4 ovs-vsctl add-port br0 vx1 -- set interface vx1 type=vxlan options:remote_ip=192.168.99.101 # on vm2 ip link add dev veth0 type veth peer name veth1 ip netns add ns0 ip link set veth0 netns ns0 ip link set veth1 ip netns exec ns0 ip link set veth0 ip netns exec ns0 ip addr add 10.0.0.2/24

sql - Update few values on few records at once -

i'm trying update values in 2 columns on 2 records @ once. insert .... on duplicate ... update ... doesn't work. i have read post subject solution doesn't work me, here question. going wrong? code: [7.4.2017 10:21:07] executing query: update sales set (ind,otst) = case id when 7795 (759900,2.2) when 7799 (779900,5) else (ind,otst) end id in(7795, 7799) , recno>1; error: [7.4.2017 10:21:09] value null - native error: 30359 p.s. when change value in single column on multiple rows works fine. [7.4.2017 11:33:17] executing query: update sales set ind = case id when 7795 759900 when 7799 779900 else ind end, otst = case id when 7795 99 when 7799 77 else otst end id in(7795, 7799) , recno>1; [7.4.2017 11:33:17] ok. [7.4.2017 11:33:17] 3 rows affected. thank much, stanislavl

regex - Exclude expressin '?!' cannot be validated -

Image
in xsd schema, there 1 particular regex <xs:pattern value="(?!tr)[a-z]{2}"/> pattern causes error. want ignore 'tr' , match other country codes. although regular expression works fine in several online editors, eclipse says: invalidregex: pattern value '(?!tr)[a-z]{2}' not valid regular expression. reported error was: 'this expression not supported in current option setting.' despite it's simple expression, cannot figure out why cannot validated. error, cannot deploy xsd file service bus. there problem aclipse or sth else? all advises appreciated! xml schema regex flavor not support lookarounds. non-lookaround version of regex is [a-su-z][a-z]|[a-z][a-qs-z] or, using character class subtraction : [a-z-[t]][a-z]|[a-z][a-z-[r]] see regex demo just note used ^ , $ in demo because flavor pcre there. in xsd pattern , regex anchored default, no ^ , $ necessary. pattern details : [a-su-z] (or [a-z-[t]])

javascript - While uploading the HTML file reading the image tag and fetching its dimension in angular js -

here i'm uploading html file. html file contains <img> tag. e.g.: <img src="smiley.gif" alt="smiley face" height="42" width="42"> it should read image tag i.e <img> , tell respective image tag height , width i.e dimension https://www.html5rocks.com/en/tutorials/file/dndfiles/#toc-reading-files this link followed reading content. // html <input type="file" id="files" name="file" /> // javascript function readblob(start, stop) { var reader = new filereader(); // if use onloadend, need check readystate. reader.onloadend = function (evt) { if (evt.target.readystate == filereader.done) { // done == 2 document.getelementbyid('byte_content').textcontent = evt.target.result; document.getelementbyid('byte_range').textcontent = ['read bytes: ', start + 1, ' - ', stop + 1,

android - App killed event in BroadcastReceiver -

in service, need when running app being killed using command killall com.test.test . listening events when app being uninstalled, cannot find such event killed processes. exist? current code looks this: intentfilter packagefilter = new intentfilter(); packagefilter.adddatascheme("package"); packagefilter.addaction(intent.action_package_removed); packagefilter.addaction(intent.action_package_fully_removed); registerreceiver(new broadcastreceiver() { @override public void onreceive(context context, intent intent) { log.d("app", "onreceive"); } }, packagefilter);

Send Email via MailEnvelope (VBA, Excel) -

i want create macro copies specific range outlook (with images). doesn't work want to... sub send_range_or_whole_worksheet_with_mailenvelope() 'working in excel 2002-2016 dim aworksheet worksheet dim sendrng range dim rng range on error goto stopmacro application .screenupdating = false .enableevents = false end 'fill in worksheet/range want mail 'note: if use 1 cell send whole worksheet set sendrng = worksheets("email").range("b2:w41") 'remember activesheet set aworksheet = activesheet sendrng ' select worksheet range want send .parent.select 'remember activecell on worksheet set rng = activecell 'select range want mail .select ' create mail , send activeworkbook.envelopevisible = true .parent.mailenvelope ' set optional introduction field thats adds ' header text email body. .introduction = "this test mail 2." .item

ssl - Run multiple websites with same ip and port on IIS7 Windows server 2008R2 -

i have few websites ip same mapped server ip 1 . want apply https certificate these individual websites , certificate issued org . every time try add https binding " other website has same binding" , when try apply binding using command cscript.exe adsutil.vbs set /w3svc/site identifier/securebindings ":443:host header binding gets accepted certificates messed site1 has cert sha2 site1 site2 has cert sha2 site2 when execute command site1 , site have same cert , result in mapping going haywire. please provide suggestion , thoughts , insights .thanks in advance you should correctly fill out host name when adding binding. way server can distinguish incoming traffic , direct correct iis website.

CVS cvs command exited with exit-status 1 -

i'm trying revive old project cvs server. this, have had pull cvs server data image backup , install cvs scratch. when trying login cvs server, get: pi$ export cvsroot=:pserver:ian@localhost:/data/cvs pi$ cvs login logging in :pserver:ian@localhost:2401/data/cvs cvs password: cvs [login aborted]: reading server: connection reset peer checking syslog: apr 7 05:03:14 raspberrypi cvsd[14833]: connection 127.0.0.1 55155 apr 7 05:03:14 raspberrypi cvsd[14833]: cvs command exited exit-status 1 i changed permissions on directories user , group (cvsd:cvsd) given in /etc/cvsd/cvsd.conf which contains: pi$ cat /etc/cvsd/cvsd.conf | egrep -v "^#.*|^$" rootjail /var/lib/cvsd uid cvsd gid cvsd nice 1 umask 027 pidfile /var/run/cvsd.pid maxconnections 10 log syslog info listen * 2401 repos /data/cvs the data under: /data/cvs the user , password correct given in file /data/cvs/cvsroot/passwd ideas? eventually found answer. @ point after stopped

reporting services - Depending Parameters in a text box (SSRS 2008-R2) -

Image
i working on ssrs report , have 2 parameters in prompt section, employeeid , employeename respectively. employeename prompt depends on employeeid prompt selected, can employeename populated in textbox once employeeid selected. right employeeid being shown in drop-down , user have go drop-down , select it, can done in textbox? any appreciated! create main report dataset (dsmain exmaple) query select * mytable employeeid = @employeeid i'm assuming have first parameter setup , working correctly return list employeeids. example we'll call parameter employeeid/ create dataset (called example, dsemployeename) query select employeename myemployeetable employeeid = @employeeid in second parameter (the 1 want showing in text box), leave 'available values' blank , set 'default values' query. choose dsemployeename dataset , choose employeename value. note work first time round. if choose value drop down, name not updated. i don't know

Kotlin null-safety for class properties -

how can avoid using !! optional properties of class class postdetailsactivity { private var post: post? = null fun test() { if (post != null) { postdetailstitle.text = post.title // error have still force using post!!.title postdetailstitle.author = post.author glide.with(this).load(post.featuredimage).into(postdetailsimage) } else { postdetailstitle.text = "no title" postdetailstitle.author = "unknown author" toast.maketext(this, resources.gettext(r.string.post_error), toast.length_long).show() } } } should create local variable? think using !! not practice you can use apply: fun test() { post.apply { if (this != null) { postdetailstitle.text = title } else { postdetailstitle.text = "no title" } } } or with: fun test() { with(post) { if (this != null

vb.net - System.IO.IOException: The process cannot access the file because it is being used by another process -

in before, have checked fileinfo isn't filestream, there no need close file after being used. however, have encountered error when try run method twice. , found out message caused due file.copyto(_fulldestpath , true). how resolve error message? public function copyfiles(_fullpath string, _dest string) string dim destpath string = _dest if not directory.exists(destpath) directory.createdirectory(destpath) end if scribe.displaymessage("hello") ' dim file = new fileinfo("\\200.1.1.32\export\2016\11\01000001mp201611.pdf") dim file = new fileinfo(_fullpath) scribe.displaymessage("hello 2") dim _fulldestpath = path.combine(destpath, file.name) scribe.displaymessage("hello 3") file.copyto(_fulldestpath, true) scribe.displaymessage("hello 4") return _fulldestpath end function

javascript - Why my bundle file is so big in Webpack -

Image
you can see files , detailed info in webpack, , files large. why happen? i use these plugins in production environment , nothing else. guess is maybe caused scss file or pictures.

android - Getting error on inserting data on table using SQLite -

i'm building android mobile app , use sqlite database. i'm having trouble inserting record on table , returns toast message "insert failed" meaning saving data unsuccessful. public class databasehelper extends sqliteopenhelper { public static final string database_name = "mobilebuddy.db"; public static final string table_name = "bets_table"; public static final string col_1 = "combination"; public static final string col_2 = "draw_date"; public static final string col_3 = "trans_date"; public databasehelper(context context) { super(context, database_name, null, 1); } @override public void oncreate(sqlitedatabase db) { db.execsql("create table " + table_name + "(" + col_1 + " text, " + col_2 + " datetime, " + col_3 + " datetime)"); } @override public void onupgrade(sqlitedatabase db, int oldversio

web crawler - What does the plus sign mean in robots.txt? -

for site, want web crawling @ /telecommandes path. it's robots.txt: user-agent: * disallow: *telecommande++* my questions are: what plus-sign mean in case? and appropriate crawl url /telecommandes-box-decodeur.html ? respect robots.txt file? per original robots.txt specification , + has no special meaning in disallow values, , neither has * . so crawling of /telecommandes-box-decodeur.html allowed. disallowed be, example, crawling of /*telecommande++*.html (literally). if want polite, take "proprietary" robots.txt extensions account, e.g., google , other search engines. many authors might not realize these aren’t part of official specification, , expect them work other crawlers. per google’s robots.txt documentation , + has no special meaning, * has 1 (it means: sequence of characters). so crawling of /telecommandes-box-decodeur.html still allowed. disallowed be, example, crawling of /foo/telecommande++bar.html (and still /*te

excel - vba copy corresponding values from another workbook? -

i have 2 workbooks: planner column k column ag 123 £100 246 £20 555 £80 master column d column r 123 £100 246 £20 555 £80 i trying copy values planner, column ag column r (master) item numbers in column d (master) match column k (planner). my code below produces no error , not producing results - despite being several matches. please can show me going wrong? for avoidance of doubt, workbook opening ok finding file. code : sub planneropen() 'set variables dim wb2 workbook dim long dim j long dim lastrow long dim app new excel.application 'find planner if len(finddepotmemo) 'if found set planner reference. app.visible = false 'visible false default, isn't necessary application.displayalerts = false application.screenupdating = false application.enableevents = false set wb2 = workbooks.open(finddepotmemo, readonly:=true, update

java - Issue with spring error-page and web.xml -

here web.xml: <error-page> <error-code>404</error-code> <location>/error/404</location> </error-page> below controller class : import org.springframework.stereotype.controller; import org.springframework.ui.modelmap; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.servlet.modelandview; import javax.servlet.http.httpservletrequest; @requestmapping(value = "/error") @controller public class errorcontroller { @requestmapping(value = {"/307", "/400", "/401", "/403", "/404", "/405", "500", "503"}) public modelandview error(httpservletrequest request) throws exception { string path = request.getservletpath().replace("/error/", ""); return new modelandview("redirect:/error/view/"+path); } if request error url this http://localhost:8080/erro/ it display 404 err

linux - PKCS#11 driver for Trusted Platform Module (TPM) chip version 1.2 -

i'm building application can interact tpm chip via pkcs#11, generate private key (stored in tpm), import certificate according private key, sign data,... want use tpm chip hsm. so, can me! what's name of pkcs#11 driver can me interact tpm? or what's must make pkcs#11 driver? have build opencryptoki , trousers on centos 6.5 after build successful don't know what's file in opencrptoki or trousers pkcs11 driver! thanks! opencryptoki should support tpm via trousers (see e.g. here , here , here ). there simple-tpm-pk11 project takes straighter approach , might interesting -- see this interesting article on author's blog . disclaimer: have never used tpm doing crypto please validate thoughts. ps: forgot opencryptoki pkcs#11 driver resides in /usr/lib/opencryptoki/libopencryptoki.so .

asp.net mvc - Twitter external login is pending forever on .net web api -

i'm facing weird issue twitter external login of asp.net web api . i endless pending request when trying redirect twitter screen (so blank loading page), of had issue before? everything ok when use mvc site fails twitter when use api while facebook login works fine on both site , api.

excel - Installing openpyxl in python 2.7 -

i using python 2.7 , want work on excel sheets. found package called openpyxl 2.4.0 . tried installing using pycharm , pip command . shows following error could not find version satisfies requirement openpyxl (from version s: ) no matching distribution found openpyxl should go version of python? please me issue. in advance.

android - I want to hide Action Bar while scrolling the webview -

basically have bottomnavigationview activity in there 3 fragments (tab1,tab2,tab3) contain 3 webviews, wanna while scrolling down webview actionbar should hide, like getsupportactionbar().hide(); know there answers in stack overflow same question, don't know in case, because beginner in android development here activity_main.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.hackerinside.jaisonjoseph.polysocial.mainactivity"> <framelayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="0dp" android:layout_w

angular - " warning.indexOf is not a function" rollup.js -

am getting below error message rollup.config.js file � warning.indexof not function rollup.config.js import noderesolve 'rollup-plugin-node-resolve' import commonjs 'rollup-plugin-commonjs'; import uglify 'rollup-plugin-uglify' //paths relative execution path export default { entry: 'src/main-aot.js', dest: 'aot/dist/build.js', // output single application bundle sourcemap: true, sourcemapfile: 'aot/dist/build.js.map', format: 'iife', onwarn: function (warning) { // skip warnings // should intercept ... doesn't in rollup versions if (warning.code === 'this_is_undefined') { return; } // intercepts in rollup versions if (warning.indexof("the 'this' keyword equivalent 'undefined'") > -1) { return; } if (warning.indexof("use of `eval` ") > -1) { return; } // console.warn else console.warn(warning.message); }, plugins: [ noderesolve({ jsnext: t

node.js - get current protocol and host from mongoose virtual method -

i have created simple mongoose schema following const playlistschema = mongoose.schema({ imagefile: buffer }, { tojson: { virtuals: true } }); and have virtual method builds image url depending on current hostname , protocol, like playlistschema.virtual('image').get(function(){ return protocol + hostname + process.env.port + '/playlist/' + this._id + '/image'; }); as far know hostname , protocol available in req object, not accessible mongoose virtual methods. is there way implement or it's bad practice , i'm doing wrong?

python - Unable to run a .py in cgi-bin -

hi guys:) using beagle bone black debian wheezy make project. have small problem:i have index.php in /var/www there call python file called send_email.php using ajax: $.ajax({ url:"/cgi-bin/send_email.py" }); it works (it sends me email , receive it). but when try same thing send_sms.py has following code inside import nexmo client = nexmo.client(key='xxxxx', secret='xxxxxxxxx') client.send_message({'from': 'nexmo number', 'to': 'my own number', 'text': 'hello world'}) when run terminal using: python send_sms.py, works when call using ajax not. confused thought calling .py file in cgi-bin using ajax, execute them (and works send_email.py) send_sms.py not. thank help, appreciated!

ios - Assigning data to the buttons from service Objective C -

i have 4 buttons(date1, date2, time1 , time2) , 3 labels, can assign labels given output _lblname.text = [medicationdicts objectforkey:@"name"]; _lblmedicine.text = [medicationdicts objectforkey:@"medicine"]; _lbldate.text = [medicationdicts objectforkey:@"expdate"]; but, how can assign date , time buttons like(date1 = 2017-04-05, date2 = 2017-04-06, time1 = 07:00:00 , time2 = 07:10:00) following output name = abhi; medicine = colpol; time = ( { date = "2017-04-05"; time = "07:00:00"; }, { date = "2017-04-06"; time = "07:10:00"; } ); expdate = "2017-04-30"; help me solve issues. tia you can this... nsarray *times = [medicationdicts objectforkey:@"time"]; (nsdictionary *timedict

bluetooth - Android btsnoop_hci.log event timestamps -

Image
i have generated btsnoop_hci.log on android phone, monitor bluetooth activity. i have opened in wireshark, , can see packets , forth. my question regarding timestamps in log. snippet of log: at time these packets timestamped? when bytes leaves bluetooth buffer or when enter buffer?

asp.net web api - Web Api, TokenEndPointPath returns Http resource was not found in production -

i have web api. works on local computer when publish on server/hosting. url request oauth token returns "no http resource found matches request". others controllers works fine. any ideas why happens in production? my startup.cs using system; using system.web.http; using microsoft.owin; using microsoft.owin.security.oauth; using owin; [assembly: owinstartup(typeof(api.startup))] namespace api { public class startup { public void configuration(iappbuilder app) { var config = new httpconfiguration(); configureoauth(app); webapiconfig.register(config); app.usewebapi(config); app.usecors(microsoft.owin.cors.corsoptions.allowall); app.usewebapi(config); } public void configureoauth(iappbuilder app) { var oauthserveroptions = new oauthauthorizationserveroptions { allowinsecurehttp = true, tokenendpointpath = new pathstring("/api/v1/oauth/token"), //t

scan input string and store words in array in C -

i writing c program in want scan user given input this: "hello how you" (one single line without quotes) and each of word should in user defined array like a[0]=hello a[1]=how a[2]=are a[3]=you here code link https://github.com/fzx-314/learning/blob/master/text.c function using scanning input is j=0; for(i=0;i<4;i++) { scanf("%s",&a[j][i]); } here function using print contents of array for(i=0;i<2;i++) for(j=0;j<4;j++) printf("%s\t",a[i][j]); getting run time error since want store two-dimensional char array. code should like char a[4][10]; for(i=0;i<4;++i){ gets(a[i]); } it 4 strings , store them in different rows. and can accessed in same way mentioned