Posts

Showing posts from July, 2013

windows - Set proper paths for VS Command Line Compiler -

i installed vs15 - preview (stripped down version of visual studio 2015). able compile c/c++ sources inside ide, not able compile command line interface cl.exe. can't find c stdlib headers. tried use vcvars32.bat set proper reg values seemingly cant find "common tools folder". "error: cannot determine location of vs common tools folder." the script uses env. variable "%vs150comntools%". if try run "cd %vs150comntools%" cmd line, can't find path, seems main problem. how can manually set %vs150comntools% right path? how can set cmd linker settings manually (without telling cl.exe every time call it)? okay, solved adding path include directories , lib directories env. variables "include", "lib". works now, whyever script not able set values properly. not fluent in reading .bat let away writing in, assume directory structure, different vs15 preview when compared full version, had not been adapted yet.

javascript - How to click and have x/y position written at that position? -

this question has answer here: how x&y corrdinates image input? 3 answers i have image on page. want able click on image , @ point of click output x/y position (coordinates), each click. how can that? note: know how x/y coordinate. question centers around how write x/y coordinates screen @ exact coordinates? i suppose on click of image dynamically write inline div text coordinates in it. have no idea how implement that. thanks! here working snippet. idea bind click event img element , on click create dynamic span tag , set top , left css property event.offsety , event.offsetx respectively. make sure span places click happened. $('img').on('click',function(e){ var span = "<span style='position:absolute;top:"+e.pagey+"px;left:"+e.pagex+"px'>"+e.offsetx +","+ e.offsety+

sorting - python sort objects by difference in attributes/weights -

is there way sort function in python? the array holds objects each 1 has weight value. i'd appreciate javascript sort . i tried doing cmp run error: typeerror: comparison function must return int, not float use python's built in sorted function lambda , , cast result integer. sorted_list = sorted(unsorted_iterable, lambda x, y: int(x.weight - y.weight))

javascript - Data of type undefined has no value? -

in javascript, type "undefined" supposed have 1 value "undefined". however, in example below, undeclared xxx has type "undefined" apparently has no value of kind. not make difference js throws exception because of no value in xxx. consistent js should throw exception on typeof xxx. otherwise, have big hole in logic here. <!doctype html> <html> <body> <script> document.write("type=" + typeof xxx); document.write(", value="); document.write(xxx); </script> </body> </html> you need first at: data types typeof in example never declare xxx variable, therefore when document.write(xxx) variable xxx doesn't exist. var xxx; document.write("type=" + typeof xxx); document.write(", value="); document.write(xxx); declaring var xxx; no value instantiate , since has no value assigned, default assignment undefined stated in data types .

How do I use string manipulation on a .txt file with multiple lines -

what i'm aiming assign strings,each different line(from txt file),to each own variable. example of txt: 1 2 3 i tried doing assigning type output of txt file on variable command for /f "delims=" %%i in ('type "textfile.txt"') set testingvariable=%%i %testingvariable% being variable,i tried string manipulation this set newvariable=%testingvariable:~3,1% hoping come out 2 , results had either 0 on 3 numbers or nothing. is there simple simple solution this? (and if possible try explain as can still of beginner) you want every line seperate variable? need counter: setlocal enabledelayedexpansion set c=0 /f "delims=" %%i in ('type "textfile.txt"') ( set /a c+=1 set testingvariable[!c!]=%%i ) set testingvariable[ ... , need delayed expansion note: emty lines skipped

php - Categorized gallery -

i'm trying make categorized gallery blog. far i've created datebase tables: photos (photos_id, photos_gal_id, photos_link), galeries (galeries_id, galeries_title, galeries_description), , there other tables, not related problem (such users, posts etc). i've established connection db through init file: <?php class init { protected $db, $result; private $rows; public function __construct(){ $this->db = new mysqli('localhost','root','hhpass','europa'); } public function query ($sql){ $this->result = $this->db->query($sql); } public function rows(){ for($x =1; $x<= $this->db->affected_rows; $x++){ $this->rows[] = $this->result->fetch_assoc(); } return $this->rows; } }?> then data db through: class galeries extends init { public function fetchgaleries(){ //query db $this->query("select photos_id, photos.photos_ga

php - Laravel 5 Session not available for the second page -

i new in laravel, , using laravel 5 storing values in session this this in controller function abc session::put('check_in', $check_in); session::put('check_out', $check_out); session::put('no_of_rooms', $no_of_rooms); session::put('adult', $adult); session::put('child', $child); return view('room'); i getting values of these sessions in rooms view, problem when going other link or on other page room view , using session as echo session::get('check_in')."<br>"; echo session::get('check_out')."<br>"; echo session::get('no_of_rooms')."<br><br>"; echo session::get('adult')."<br>"; echo session::get('child')."<br>"; i not able of these sessions value. i using sessions has on pages till session flashed or browser gets closed, not retrieving of session values..

javascript - How to prevent textarea from dancing while typing and running into page bottom? : JQuery/CSS -

i continuously typing auto sizing textarea; when text goes runs bottom of page , continue typing; what find page dancing hell on each keypress or keyup , text runs bottom of page (for need scroll down check happening). how prevent page dancing , text running bottom? js fiddle: https://jsfiddle.net/osbnnbxa/ browser: ie10 (also find little dancing in firefox; client use ie10 need work on only) html: <div> <div> <br><br> &nbsp;&nbsp; <textarea class="normal" name="myarea" id="myarea" style="height: 100px; overflow-y: hidden;"></textarea> </div> </div> <input type="button" class="butt" value="ehehehhe" /> jquery: var myquery = { autoheight: function(e) { $(e).css({ 'height': 'auto', 'overflow-y': 'hidden' }).height(e.scrollheight); }, init: function() { settimeout(function() { $('tex

richtext - Drop caps in Qt rich text -

Image
i want render png image , text, starts drop cap. afaik, can render rich text qtextdocument::drawcontents , how can add drop cap surrounded regular size text? the upper part of image below qtextbrowser , lower 1 rendered transparent qpixmap placed on qlabel : i haven't tried render additional pictures yet question stated, shouldn't hard. textdocument = qtgui.qtextdocument(self) #self.t.setdocument(textdocument) textdocument.setdefaultfont(qtgui.qfont("times new roman", 12)) textdocument.setdefaultstylesheet(".firstcharacter {" "float: left;" "color: #903;" "font-size: 72px;" "font-family: monotype corsiva;" "margin-top: -16px;" "margin-bottom: -16px;"

java - How to run testng.xml from terminal on OS X El Capitan (10.11)? -

i have tried many things run testng.xlm file terminal can't run it. have downloaded latest versions of testng.jar , jcommander.jar , provided path of them in following command java -cp "path/to/testng.jar:path/to/jcommander-1.7.jar" org.testng.testng testng.xml but getting error as error: not find or load main class testng.xml

arduino - C# SerialPort communication protocol -

i did write small c# app reads com port series of numbers sent arduino board. question: if arduino sends single value every 500ms c# program reads single value every 1s doesn't c# left behind arduino? if true, data sent arduino stored in buffer or discarded? [edit] bellow code use read com system.windows.forms.timer tcom; ... tcom.interval = 1000; tcom.tick += new system.eventhandler(this.timer1_tick); ... serialport port = new serialport(); port.portname = defaultportname; port.baudrate = 9600; port.open(); ..... private void timer1_tick(object sender, eventargs e) { log("time read com"); //read string serial port string l; if ((l = port.readline()) != null) { ...... } } serial port communications require flow control . way transmitter know receiver ready receive data. overlooked, in arduino projects. tends work out okay, serial ports slow , modern machines fast compared kind of machines first started using s

how to do clustering of markers on google map -

well trying clustering of markers on google map. have found example http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/examples/simple_example.html not able understand use of following code in it- <script type="text/javascript"> var script = '<script type="text/javascript" src="../src/markerclusterer'; if (document.location.search.indexof('packed') !== -1) { script += '_packed'; } if (document.location.search.indexof('compiled') !== -1) { script += '_compiled'; } script += '.js"><' + '/script>'; document.write(script); </script> what full src used there. when copy code , use on laptop not working. please explain why? , best ways clustering of markers on google map. <script type="text/javascript"> var script = '<script type="text/javascript" src="../src/markerclusterer&

Powershell; Click on a specific link out of a number of similar links -

every month have dl lot of bills lot of different accounts @ same provider. script log in these accounts , navigate correct site. problem is, there lot of bills dl @ site , want dl recent. first link on site, formatted this: <div class="datatable-cell datatable-cell--w20"> <div class="btn btn--secondary"> <a href="/myaccount/bills/bill_download/stringofcharacters" onclick="track('bill_download',{'prop3':'button:bills','events92':1});">download</a> </div> </div> i can't script click link. ideas? i've tried multiple ways link, nothing worked (-eq, -match, -contains etc.) have far: $username = "username" $password = "password" $ie = new-object -com internetexplorer.application $ie.visible=$true $ie.navigate("https://provider.domain/login") while($ie.readystate -ne 4) {

ios - Wrong values for double in swift -

Image
i have string value , converting double value adding it. shows different values when debugging. while using print statement shows correct values, when using "po" command in console shows different, getting different results expected one. let stringvalue = "83.84" let doublevalue = double(stringvalue) let floatvalue = float(stringvalue) let decimalarray: array<double> = [doublevalue!, doublevalue!, doublevalue!] let test1 = decimalarray.reduce(0, combine: +) let floatarray: array<float> = [floatvalue!, floatvalue!, floatvalue!] let test2 = floatarray.reduce(0, combine: +) print(test1) print(test2) i have attached image of console. please let me know how can resolved. i think using po before it's converting. put 1 breakpoint @ last line i.e. @ print(test2) , check.

html - Slide text search box is overwritten -

i'm doing search box slide. need when click on magnifying glass, move slide "castilian", text , not fixed text , sarch see box below. it's possible? best ... my code try css. worked. #wrap { margin: 39px 60px; display: inline-block; position: relative; /*float: right;*/ padding: 0; position: relative; } input[type="text"] { height: 60px; font-size: 55px; display: inline-block; font-family: "lato"; font-weight: 100; border: none; outline: none; color: #555; padding: 3px; padding-right: 60px; width: 0px; position: relative; top: 0; right: 0; background: none; z-index: 3; transition: width .4s cubic-bezier(0.000, 0.795, 0.000, 1.000); cursor: pointer; } input[type="text"]:focus:hover { border-bottom: 1px solid #bbb; } input[type="text"]:focus form { width: 700px; } input[type="text"]:focus { width: 700px; z-index: 1; border-bottom: 1px solid #b

java - Hibernate ORM in cluster environment -

we have new java project planning deploy in cluster environment. i want clarify if hibernate suitable new in technology. far know, hibernate set of java apis working in jvm, caching of objects, first/second level whatever is, bind particular jvm. right? if yes, in cluster environment there many cluster nodes, each own jvm. lead logical mistake, right? if second-level cache not enabled, there no problems, because first level cache bound session (persistence context). if second-level cache enabled, nodes in cluster must aware of each other, cache entries invalidated across cluster when changed. example, see documentation how infinispan cache provider.

spring - Scope 'session' is not active for the current thread; IllegalStateException: No thread-bound request found -

i have controller i'd unique per session. according spring documentation there 2 details implementation: 1. initial web configuration to support scoping of beans @ request, session, , global session levels (web-scoped beans), minor initial configuration required before define beans. i've added following web.xml shown in documentation: <listener> <listener-class> org.springframework.web.context.request.requestcontextlistener </listener-class> </listener> 2. scoped beans dependencies if want inject (for example) http request scoped bean bean, must inject aop proxy in place of scoped bean. i've annotated bean @scope providing proxymode shown below: @controller @scope(value="session", proxymode=scopedproxymode.target_class) public class reportbuilder implements serializable { ... ... } problem in spite of above configuration, following exception: org.springframework.beans.factory.beancreat

r - linking with RcppArmadillo (lapack) fails: undefined symbol: dgesdd_ -

i writing r package packagefoo rcpparmadillo. however, have problems compiling package in linux. glad if me. not know wrong. i have single cpp file following header: #include <stdio.h> #include <string> #include <bitset> #include <fstream> #include <algorithm> #include <iostream> #include <cmath> #include <rcpparmadillo.h> // [[rcpp::depends(rcpparmadillo)]] using namespace rcpp; when devtools::load_all() following: * installing *source* package ‘packagefoo’ ... ** libs g++ -i/usr/share/r/include -dndebug -i"/home/user/r/x86_64-pc-linux-gnu-library/3.2/rcpp/include" -i"/home/user/r/x86_64-pc-linux-gnu-library/3.2/rcpparmadillo/include" -fpic -g -o2 -fstack-protector --param=ssp-buffer-size=4 -wformat -werror=format-security -d_fortify_source=2 -g -c rcppexports.cpp -o rcppexports.o g++ -i/usr/share/r/include -dndebug -i"/home/user/r/x86_64-pc-linux-gnu-library/3.2/rcpp/include" -i"

matlab - Plot a legend for both a barplot and a line -

if have barplot , line on same graph, how write legend both? have hold on h1 = bar([x;y], 0.5); h2 = plot(a, b); l = cell(2,1); l{1,1}='label x'; l{2,1}='label y'; hl=legend(h1, l); set(hl,'fontsize',10,'location','northeast', 'orientation', 'horizontal'); this generates legend barplot how add legend entry line plot? you've passed bar plot handle legend function that's it's going create. can do, however, pass array of handles (and labels) legend , legend entries elements of handles array shown. h1 = bar([x;y], 0.5); h2 = plot(a, b); labels = {'label x', 'label y'}; l = legend([h1, h2], labels, ... 'fontsize', 10, ... 'location', 'northeast', ... 'orientation', 'horizontal');

javascript - Creating a popup like state using AngularJS ui-router -

i'm trying create state acts popup, i.e doesn't clear current state, pops on without destroying current state (so user can gain access dismissing popup). heavily simplified, applications routes following: angular.module('test', ['ui.router']) .config(['$stateprovider', '$urlrouterprovider', function($stateprovider, $urlrouterprovider) { $stateprovider .state('login', { url: '/login', template: '<button><a ui-sref="authenticated.home">login</a></button>' }) .state('authenticated', { url: '/authenticated', template: '<p>we authenticated</p>' + '<a ui-sref="authenticated.home">home</a>' + '<a ui-sref="authenticated.statistics">statistics</a>' + '<a ui-sref=

java - Query enum in hibernate throws DataException: Bad value for type int : t -

i have table enum type attribute mapped this: @enumerated(enumtype.ordinal) @column(name = "status") private enums.status status; where enums.status is public enum status { checked(1), disabled(2), inactive(3); int id; // constructor + getter } and column status database stored type int4 i querying table following hql: query q = session.createquery(" users status=:account"); query.setparameter("account", enums.status.checked); list<users> users = query.list(); the above code works fine on testing server, when on production server throws following exception: org.hibernate.exception.dataexception: bad value type int : t @ org.hibernate.exception.internal.sqlstateconversiondelegate.convert(sqlstateconversiondelegate.java:134) @ org.hibernate.exception.internal.standardsqlexceptionconverter.convert(standardsqlexceptionconverter.java:49) @ org.hibernate.engine.jdbc.spi.sqlexceptionhelper.convert(sqlexcep

javascript - Pass $index to the submit form in jade -

i'm doing upload image application. during uploading, show loading gif. have few image in page , user press picture upload image. now, i'm using ng-repeat show image out when page loaded. below html in jade: .panel-body form.form-horizontal .form-group(ng-repeat="runningtext in runningtexts") .col-md-3 label.control-label image {{$index+1}} .image-upload-area.label-centerleft p(onclick="$('#imagefile').click()" ng-click="setnum($index)") click me change img.loading(ng-show="isuploading[$index]" src="/img/loading.gif") img.img-responsive.clickable(ng-src="{{runningtext.image != '' ? '/img/' + runningtext.image : '/img/logo_d.png'}}") f

awk - Introduce a new line before every row containing a specific word in linux -

i new linux. have tab delim text file following a1 title body.1 gene a1 head head.1 head a1 trunk trunk.1 trunk a1 tail tail.1 tail a2 title body.2 gene a2 head head.2 head a2 trunk trunk.2 trunk a2 tail tail.2 tail a3 title body.3 gene a3 head head.3 head a3 trunk trunk.3 trunk a4 title title.4 gene a4 trunk trunk.4 trunk a4 tail tail.4 tail i introduce new line before every row containing word "gene" in last column following: a1 title body.1 gene a1 head head.1 head a1 trunk trunk.1 trunk a1 tail tail.1 tail a2 title body.2 gene a2 head head.2 head a2 trunk trunk.2 trunk a2 tail tail.2 tail a3 title body.3 gene a3 head head.3 head a3 trunk trunk.3 trunk a4 title title.4 gene a4 trunk trunk.4 trunk a4 tail tail.4 tail i tried following command sed 's/gene/\ \n&\g' file.txt but introduces new line after row containing word "gene". it great if 1 guide me how introduce new line before row containing word " gene " in last c

angularjs - Render directive after javascript-adding on page -

i have web-page angular application, angular-directive, controller, , other javascript-functions. 1 functions adding html-code on page. html contains 1 angular directives. angular doesn't render directive's template if added dynamically. how render derictive in case? here nice example of dynamically adding html code included directive (alert). jsfiddle example the general idea $compile html code. check in example.

Use an Image as Button in Html and Css -

i have been using game assets collection build game upon. main problem arises how include user interface buttons. currently button collection of different gradients , font. i’ve tried convert images gradient background property have failed plus font being used collection of characters represented images. what best practice solve problem? use images button? correct semantic markup? example of button semantic of button thnx! response on question, isn't how it; correct semantic markup. currently i've solved following setup seems reasonable. <label> <img src="/abutton.png" alt="send message"> </label> try follows html <input type="submit" id="search" name="submit" alt="search" value=""> css input#search { background:url(../search-icon.png); background-repeat: no-repeat; width:40px; height:40px; border: 0; } input#search:hover { background:ur

ACR122 NFC-Reader/-Writer Java Application (Interface implementation) -

currently struggling interface between acr122 nfc reader , java. trying achieve read nfc-tag , read value java variable. sounds simpler (for me). what know know bytes have send in order read , write properly. need know how communicate device can send commands (initialize, read/write, close connection)? the manufacturer adds interface written in c (or c++?). unfortunately know java need library use , examples (and maybe explanations). if happen know how achieve goal , going explain me how process works, happy. some additional informations: operating system programm should work on (windows 7 64x) the recent jdk the transfer , stored data on nfc-tag doesn't have secure if information needed, please don't hesitate ask it. glad every bit helps.

javascript - Display step by step Google map Direction -

sorry bad english. looking solution trace route on google map, display progressively street names when user move , read tts google map instructions.. (like gps) wish display following instruction when user approaches previous instruction watchposition function call geolocationsuccess function each movement, not solution in example trace route geolocation omaha beach museum normandy france <!doctype html> <html> <head> <meta charset="utf-8" /> <title>geolocation , google maps api</title> <script src="http://maps.google.com/maps/api/js?sensor=true"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script> function geolocationsuccess(position) { var destination="49.366973,-0.882042"; var userlatlng = new google.maps.latlng(position.coords.latitude, position.coor

python: how to close orphaned domain socket from new process -

i planing use domain sockets lock ensure 1 active instance (linux kernel >=2.6). so, binding domain socket active process , create lock file pid more human-friendly check option in fs. import socket class processlock(object): def __init__(self, processname): self.processname = processname self.pidfile = os.path.join(self.gettmpdir(),"uid-%s_process-%s.pid" % (os.getuid(), processname) ) ... self.socket.bind('\0' + self.processname) ... atexit.register(self.cleanup) ... def cleanup(self): self.socket.shutdown(socket.shut_rdwr) self.socket.close() self.socketok = false os.remove(self.pidfile) it working, managed kill process hard did not close socket @ exit , socket kept open beyond process' lifetime: > lsof condorjob 124485 root 4u unix 0xffff88186c3341c0 0t0 175181414 @testfooname condorjob 124485 root 5w reg

python pandas/numpy True/False to 1/0 mapping -

i have column in python pandas dataframe has boolean true/false values, further calculations need 1/0 representation. there quick pandas/numpy way that? edit: answers below not seem hold in case of numpy that, given array both integers , true/false values, returns dtype=object on such array. in order proceed further calculations in numpy, had set explicitly np_values = np.array(df.values, dtype = np.float64) . true 1 in python, , likewise false 0 * : >>> true == 1 true >>> false == 0 true you should able perform operations want on them treating them though numbers, are numbers: >>> issubclass(bool, int) true >>> true * 5 5 so answer question, no work necessary - have looking for. * note use is english word, not python keyword is - true not same object random 1 .

python - Saving program state when user invokes Ctrl-C -

in python, when user invokes ctrl-c, happens? have possibility save program state? what context-managers? __exit__() section executed? basically, keyboardinterrupt exception raised inside main thread. yes, can handle catching in try/except block , __exit__() sections executed https://docs.python.org/2/library/exceptions.html#exceptions.keyboardinterrupt

javascript - What is the role of ng-app directive? -

i new angularjs. trying write simple angular application. wondering role of ng-app directive. <html ng-app> and possible add ng-app in div tag instead of html tag? if possible, there differences between <html ng-app> , <div ng-app> , example, operating efficiency ? the ng-app directive designates root element of application , typically placed near root element of page - e.g. on <body> or <html> tags.you can have 1 ng-app directive in html document.it used load various angularjs modules in angularjs application. angularjs framework process dom elements , child elements ng-app directive applied usage <div ng-app="" ng-controller="myctrl"> </div> or <div ng-app="myapp" ng-controller="myctrl"> </div> var app = angular.module('myapp', []);

php - How to pass category from custom post type in listbox tinyMCE 4 -

bellow code pass category wordpress default post in tinymce 4. have done properly. function list_categories( $cat_id, &$output = array() ) { $categories = get_categories( 'hide_empty=0&orderby=name&order=asc& parent=' . $cat_id ); foreach( $categories $cat ) { $output[] = array( 'text' => $cat->name, 'value' => $cat->term_id ); list_categories( $cat->term_id, $output ); } return $output; } $list = list_categories(0); // array of categories p_localize_script( 'some_handle', 'mce_options', array( 'categories' => json_encode( list_categories(0) ) ) ); add_action( 'admin_enqueue_scripts', 'mce_admin_scripts' ); function mce_admin_scripts( $hook ) { if ( $hook == 'post.php' || $hook == 'post-new.php' ) { add_action( "admin_head-$hook", 'mce_admin_head' ); } } function mce_admin_head() { echo '<script type="text/javascript&

notifications - Android how to send data to a broadcast receiver using intents -

i'm writing app in launch proximity alert every time i'm near specific point of interest(i read poi mysql db). when broadcastreceiver gets intent, creates notification , works fine. when click on notification activity start, need send parameters (basically strings) broadcast receiver, pass parameters activity want start. problem when try pass these parameters through intent broadcast receiver error: error receiving broadcast intent flg=0x10 has extras. i sent parameters in way: private void addproximityalert(annuncio a){ double latitudine = a.lat; double longitudine = a.lon; intent intent = new intent(prox_alert_intent); intent.putextra("nome", nome); pendingintent pi = pendingintent.getbroadcast(this, 0, intent,0); locationmanager.addproximityalert(latitudine, longitudine, raggio, alert_expiration, pi); intentfilter filter = new intentfilter(prox_alert_intent); registerreceiver(new proximityintentreceiver(),filter); } this re

C++ add_pointer template with array type -

i use std::add_pointer<type> template c++ <type_traits> header construct pointer array type. however, following generates error double *y[2]; std::add_pointer<double[2]>::type x; y = x; // generates error my msvc c++ compiler shipped sdk 7.1 says error c2440: '=' : cannot convert 'double (*)[2]' 'double *[2]' there no conversions array types, although there conversions references or pointers arrays what miss here? edit: want y 2d array 1 dimension 2 , other variable. intended usage is y[i][0] , y[i][1] y , x don't have same type here. as error message said, y array elements of type double* . x pointer pointing array type double[2] . you might change type of y to: double (*y)[2]; std::add_pointer<double[2]>::type x = new double[2][2]; y = x; // use y[0][0], y[0][1], y[1][0] ... delete[] y; live

IIS Certificate. Digicert tells me one thing, probing SSL / TLS another -

i'm trying jira service desk pull mail our server im having certificate issues, think. when try , pull mail our server jira pops suncertpathbuilderexception: unable find valid certification path requested target which seems indicate problem certificate not being trusted. went off , grabbed new trusted cert old 1 self certified "es2010" name of server. afaik new certificate has been installed but. it seems *.domainname.co.uk trusted cert has been issued taking precident on owa.domainname.co.uk . if goto https://www.digicert.com , check out cert seems ok if use portecle app jira examine ssl / tls connection on port 993 (secure imap) shows being issued cn=es2010 can kindly help?

c# - nhibernate saves objects it shoudn't -

i have listeners nhibernate preupdate , other stuff. fire correctly. i do: var model = populatedetailsviewmodel(user, id); _viewhistoryworkerservice.addobjecttohistory(id, user.tenantid, user.userid, "individual", user.isemulated); i populate view model individual's data there lot of entities loaded there fill in detailsviewmodel. in method addobjecttohistory add history object. newhistory = new history(); newhistory.objectaccessedon = datetime.now; newhistory.objectid = objectid; newhistory.tenantid = tenantid; newhistory.userid = userid; newhistory.objectname = type; _historyrepository.saveorupdate(userid, newhistory); the problem when saveorupdate done update history entity in preupdate hibernate event kind of attempts save kind of entities loaded populate detailsviewmodel , not modified. the problem why nhibernate updates entities not modified?

conv neural network - Does the dropout layer need to be defined in deploy.prototxt in caffe? -

in alexnet implementation in caffe, saw following layer in deploy.prototxt file: layer { name: "drop7" type: "dropout" bottom: "fc7" top: "fc7" dropout_param { dropout_ratio: 0.5 } } now key idea of dropout randomly drop units (along connections) neural network during training. does mean can delete layer deploy.prototxt, file meant used during testing only? yes. dropout not required during testing. even if include dropout layer, nothing special happens during testing. see source code of dropout forward pass: if (this->phase_ == train) { // code } else { caffe_copy(bottom[0]->count(), bottom_data, top_data); //code copy bottom blob top blob } as seen in source code, bottom blob data copied top blob data memory if not on training phase.

c# - Add 1 scrollbar for 2 richtextboxes in winforms -

Image
i want add scrollbar can used both these richtextboxes in winforms when scroll down, text in these boxes goes down. right now, both have different scrollbars. have tried following methods didn't work : set autoscroll property true in tablelayoutpanel in these richtextboxes present. set autoscroll property true in normal panel in these richtextboxes present. you can disable scrollbars on richtextbox controls , add vscrollbar control on right or left. please reference msdn description of control: vscrollbar on msdn

java - Problems with rendering JSP in spring boot -

Image
i have spring boot application want use jsp here dependencies in pom.xml <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.4.0.m2</version> <relativepath/> <!-- lookup parent repository --> </parent> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-data-jpa</artifactid> </dependency> <dependency> <groupid>org.jsoup</groupid> <artifactid>jsoup</artifactid> <version>1.8.3</version> </dependency> <dependency> <groupid>javax.mail</groupid>

webdriver - Is it possible to run selenium tests concurrently/parallel using same browser/platform combination -

i trying run tests in parallel using same browser/platform combination, chrome/win7 exact. have managed reduce our test execution times far running different features on separate executors (node) via jenkins. trying achieve being able run separate scenarios in parallel reduce test execution time further. possible using selenium grid node having same browser/platform combo? yes, possible using testng use parallel="methods" below:- <suite name="test-method suite" parallel="methods" thread-count="2" > refer:- http://howtodoinjava.com/testng/testng-executing-parallel-tests/ you can use more execution type according need :- <suite name="my suite" parallel="methods" thread-count="5"> <suite name="my suite" parallel="tests" thread-count="5"> <suite name="my suite" parallel="classes" thread-count="5"> <suite name=

deepstream.io - Can ds.record.getRecord('...') be read only? -

i can see getrecord call has createorread action. possible make read only? need limit client permissions. thank in advance! do mean avoid creating if user not have permissions? if user not have permissions update or patch stop him being able update anything, don't yet have individual read action avoid record being created initially. we'll raise issue , try implement soon. edit: issue created on github

mysql - SSRS mutiple database source to be joined -

just stuck on getting information 2 sources, have mysql database repairs information have in ssrs, brings 7000 rows. have repairs database in oracle brings on 3 million rows. i can't seem bring 1 oracle exceeds maximum limit, there way left join using can bring 2 columns need oracle 1 mysql 1 mean have 7000 rows plus 2 columns oracle have common primary key. can't seem join on 2 dataset being on 2 database. can help. thank in advance you can use lookup function in ssrs find value 1 dataset based on common key. =lookup(fields!saleprodid.value, fields!productid.value, fields!name.value, "product") use lookup retrieve value specified dataset name-value pair there 1-to-1 relationship. example, id field in table, can use lookup retrieve corresponding name field dataset not bound data region. (bids description) in above example, salesprodid 1 dataset being used relate productid in product table name field. this return 1 value,

c++ - What's happening with the snippet below in a release build? -

the code below generates dangling reference can seen in warning emitted compiler , fact destructor a object in function g() invoked before function returns. 1 can verify in main() after "using stack", returned reference has garbage, @ least in debug build. couldn't reproduce same behavior in release build. why that? kind of optimization compiler doing here give impression reference r ok? #include <iostream> struct a{ a(int i) : i(i) { std::cout << "ctor\n"; } a(const a& a) { = a.i; std::cout << "copy ctor\n"; } ~a() { std::cout << "dtor\n"; } int i; }; a& g(int i) { x(i); return x; } int main() { const a& r = g(1); std::cout << "using stack\n"; std::cout << r.i << '\n'; // r.i has garbage in debug, not in release build. } ps. argue against nrvo, function doesn't return a object. edit: in response mark tolonen. if in

ios - How to get cell selection on touchdown? -

i have custom tablecell , trying show different icon when it's selected. problem icon changes after touchup , not right after touchdown (unlike selection background image). there way change behaviour? override func setselected(selected: bool, animated: bool) { super.setselected(selected, animated: animated) let cell = self if (selected) { cell.imageview?.image = uiimage(named: (selectediconname!)) } else { cell.imageview?.image = uiimage(named: (iconname!)) } you can use sethighlighted instead of setselected that: override func sethighlighted(highlighted: bool, animated: bool) { super. sethighlighted(highlighted, animated: animated) let cell = self if (highlighted) { cell.imageview?.image = uiimage(named: (selectediconname!)) } else { cell.imageview?.image = uiimage(named: (iconname!)) } }

r - Changing the colour of a dodged barplot in ggplot2 -

Image
i'm struggling change default colours of barplot made. since used value aes(fill="") argument addition of scale_colour_x or scale_fill_x not work. i'll provide code have , hope you'll find easy way solve problem me. set.seed(123) platelay <- data.frame(rown = rep(letters[1:8], 4), coln = rep(1:4,each = 8), colorvar = rnorm(32, 0.3, 0.2)) the example data (supposed part of 96 microwellplate different fluorescence readouts per well) ggplot(platelay,aes(x=rown,y=colorvar,fill=coln)) + geom_bar(position="dodge",stat="identity") the plot should give 5 bars (one each coln ) per rown , want them have colours make easy distinguish each bar. this looks right now: as can see colours blend , scale shows not distinct values 1 4 halves. appreciate slightest bit of help, since i'm not familiar r or coding @ (just started learning last week). you getting color because fill vari

c# - Xamarin IOS Collection View With Custom Cell -

Image
i working on xamarin ios, want display items in grid style using collection views concept. tried sample collection view example. sample collection view example but items displaying given example. want display items in grid style, please saw below image. this crude example quick test doing on same example code: [export ("initwithframe:")] public productcell (cgrect frame) : base (frame) { backgroundview = new uiview{ backgroundcolor = uicolor.darkgray }; selectedbackgroundview = new uiview{ backgroundcolor = uicolor.green }; contentview.layer.bordercolor = uicolor.lightgray.cgcolor; contentview.layer.borderwidth = 2.0f; contentview.backgroundcolor = uicolor.gray; cellviewcontainer = new uiview (); cellviewcontainer.autoresizingmask = uiviewautoresizing.flexiblewidth | uiviewautoresizing.flexibleheight; imageview = new uiimageview (uiimage.frombundle ("placeholder.png"

numpy - Python - overflow encountered in exp -

i using formula in model i'm developing, which, when runs produces runttimewarning: overflow encountered in exp. understanding i've read due excessively large numbers being used in calculation data type. my formula stores numpy array, there method changing datatype these values can computed? thanks this sounds xy problem . while higher precision datatypes possibly solve issue, comes @ performance , usability cost. not possible numpy directly, can done mpmath. more details can found in question . before resorting such measures: verify these large numbers correct behavior , not result bug further up. see if possible log-transform formulas large numbers avoided.

sockets - Connecting to TCP Protocol from Android Client -

i'am looking answer, , hope can me , guide me solution. what want connect android device tcp protocol server exchange messages. what have using example have found on github i have modified connection ip 1 have. have succesfully managed connect server. got response server such as: <?xml version="1.0" encoding="utf-8"?> <messages> <connection>accepted</connection> </messages> and logcat shows: net.stackueberflow.netcat i/netcat tcp client activity: host: 192.168.170.90, port: 3000 net.stackueberflow.netcat i/netcat tcp client activity: onpreexecute net.stackueberflow.netcat i/netcat tcp client activity: doinbackground: creating socket net.stackueberflow.netcat i/asynctask: doinbackground: socket created, streams assigned net.stackueberflow.netcat i/asynctask: doinbackground: waiting inital data... net.stackueberflow.netcat i/netcat tcp client activity: doinbackground: got data net.stackueberflow.netcat i/netcat