Posts

Showing posts from April, 2011

x509 - Kerberos test using kinit with no password (cert auth) -

i did extensive search before posting q. we have kerb setup working fine users our internal portal. few users getting following error: "failed create delegated gssapi token on behalf of http/ssologon.xxx.xxx.xx.com@xxx.xxx.xx.com service@hostname.xxx.xxx.xx.com: minor status=-1765328230, major status=851968, message=cannot find kdc requested realm]" i can test kerb setup fine server side using kinit using keytab file etc. issue/q how test same workstations/client pc exhibiting above error. i use kinit or kinit principal-name prompts password. have disabled passwords authentication , use x509 certs/access card login our pcs/domain. so, how use kinit or equiv. test kerberos domain workstation using cli , cert authentication. i have seen kinit -x option not available on jdk1.7/1.8 in win 7 seems. pkinit (mit kerberos) option seems more used web server kdc authentication. thank in advance , appreciate community's time , effort. ---- add

javascript - Multiple <script> tags each with its own scope -

i need programmatically generate multiple <script> tags, , each 1 same except parameter different. example: <script> function foo() { console.log('1'); } /* lots of complicated code calls foo() */ </script> <script> function foo() { console.log('2'); } /* lots of complicated code calls foo() */ </script> in example first script has parameter value of '1' generated code prints '1' console, while second script has parameter value of '2'. i know question far offend many programmers' sensibilities. it's of course simplified , need way reasons beyond scope of question. as understand it, these <script> tags share global scope, foo implementations conflict. 1 fix name them separately, e.g. foo1 , foo2 . in reality have many such functions , i'm wondering if there's better way. is there way enclose each <script> tag in own scope foo implementations don't co

c# - Error in Unity: Lightning.SetColors(Color, Color)' must have a body because it is not marked abstract, extern, or partial -

the errors exactly: error (1) assets/_dinostudios123/match-tree engine/scripts/effects/lightning.cs(7,14): error cs0501: `lightning.setcolors(color, color)' must have body because not marked abstract, extern, or partial this error caused changing [line.setcolors(color, color);] having add public void setcolors (color start, color end); error (2) assets/_dinostudios123/match-tree engine/scripts/effects/lightning.cs(30,14): warning cs0618: unityengine.linerenderer.setvertexcount(int)' obsolete: use numpositions instead.' could determine why error codes coming when adding in line of code correct color start , color end , correct int count per line? using unityengine; using system.collections; // lightning effect public class lightning: monobehaviour { public void setcolors ( //the error applied line of code color start, color end ); public void setvertexcount ( int count ); public transf

mysql - Sequal Pro: able to enter DB, but unable to read table -

there multiple databases on server, after enter 1st db show tables. weird thing required data 3rd db, after choose filter, still shows tables in 1st db. i figure out few possible reasons: setting sequel pro configurations incorrectly db type not able show table in sequel pro miss setting configurations in mysql

Leaflet Ajax JSON file Add to Map as Overlay -

i have json file not formatted in way meet geojson standards. trying load data parse on map. able create markers data , add them: $.getjson( tsdata, function ( data ) { //loop through data $.each( data.response.docs, function ( key, val ) { //console.log(val); if ( typeof val.mc_geo !== 'undefined' ) { //lat lng isn't consitently 1, getting first only. var geo = val.mc_geo; var glat = geo.tostring().split( ',' )[ 0 ]; var glng = geo.tostring().split( ',' )[ 1 ]; //add markers map var marker = l.marker( [ glat, glng ],{icon: tsmarker,} ).bindpopup( "<p><strong><a href='" + val.filename + "'>" + val.title + "</a></strong><hr/><br/><strong>abstract:</strong>

unity3d - Getting an error code in Unity for UnityEditor.HostView:OnGUI() -

i getting error code , don't know how resolve it. can build game in unity3d , create apk file android, file finishing build following error code. could not extract guid in text file projectsettings/projectsettings.asset @ line 44. unityeditor.hostview:ongui() does have solution code , why guid not extracted? the issue facing there no warnings , no error other codes. game plays fine in editor , can execute on command .exe file, however, .apk file transferred android device crashes on load. don't know if error code guid extraction causing .apk file not execute on android device. also, using texture compression of etc of png files make file considerably lower on size original file size game not overload android device. the game's apk file 69.94 mb after build.

tfs - How to unit test the database code for Sql Server 2014 -

i working on developing unit test framework db code in sql server 2014. requirement following: the tool should provide enough assertions check db schema, positive values, negative values, exceptions , constraints. the tool should provide mocking , stubbing db stored procs the tool should able generate .trx reports passed/failed test cases want pulbish these reports using vsts/tfs build code coverage if possible the tool should able integrate tfs build template ci purpose. after doing research, think have 3 options of tools ssdt mstest , tsqlt as: using ssdt test database initialization/cleanup , using mstest sql unit testing has no mocking feature , options assertion limited. cleanup manual using tsqlt unit test cases. nice , powerful tool not provide gui ssdt. redgate gui paid not possible in case. seems tougher integrate tfs builds. , not produce reports in .trx format in .xml format. using combination of ssdt , tsqlt ssdt db initialization, tfs integration , runni

android - why it gives screen inch size wrong all the time? -

i want calculate device size inch. using code every search appears. problem when put device 4.5 inch answer in android studio 4. tried 5.2 inch device , got 4.3 inch 10.1 inch -> answer 9.0. so how can accurate answer? displaymetrics dm = new displaymetrics(); getwindowmanager().getdefaultdisplay().getmetrics(dm); double wi=(double)dm.widthpixels/dm.xdpi; double hi=(double)dm.heightpixels/dm.ydpi; double x = math.pow(wi,2); double y = math.pow(hi,2); double screeninches = math.sqrt(x+y); log.e("hello"," "+screeninches); the problem code not take account actionbar softkeys orientation of screen use following answer windowmanager windowmanager = getwindowmanager(); display display = windowmanager.getdefaultdisplay(); displaymetrics displaymetrics = new displaymetrics(); display.getmetrics(displaymetrics); // since sdk_int = 1; mwidthpixels = displaymetrics.widthpixels; mheightpixels = displaymetrics.heightpi

javascript - How to avoid callback hell in this scenario? -

i have following code can see, each of functions inside functions rely on return value of enclosing function. problem when keep using method code, callback hell occurs. how avoid hell? user.getuserdetail(req.user.id, function(userdetail) { if(req.user.entity_id != '-1') { entity.getentityprimary(req.user.entity_id, function(entityprimary) { entity.getentitypayment(req.user.entity_id, function(entitypayment) { if(entitypayment.length > 0) { entity.subscriptioninfo(entitypayment[0]['date'], entitypayment[0]['exp_date'], function(issubscribed) { res.render('capitol', { user: req.user, title: 'mcic', user_detail: userdetail, entity_primary: entityprimary, entity_payment: entitypayment,

python - "pandas.io.common.EmptyDataError: No columns to parse from file" after moving to mac -

in windows 8, script works fine. after moved script , data.csv work in mac, keep getting error: "pandas.io.common.emptydataerror: no columns parse file." the script , data in same folder "/users/myname/downloads/test/testimport.py" "/users/myname/downloads/test/test2.csv" i've tried many file locations read csv nothing works. file_loc = "../test/test2.csv" # "../test2.csv", "/test2.csv", "/users/myname/downloads/test/test2.csv" import pandas pd df = pd.read_csv(file_loc) exp_mat = df.as_matrix() print exp_mat how can read csv here? wrong location problem or csv filetype in mac not compatible? here os x ei capitan. full error is h143% python testimport.py traceback (most recent call last): file "test_importexcel.py", line 24, in <module> df = pd.read_csv(file_loc) file "/users/myname/anaconda/lib/python2.7/site-packages/pandas/io/parsers.py", line 646, in pars

Incorrect username password 3 times java login form -

this code have. reads text file , compares users input. how add if username , password entered 3 times something. have tried putting counter in many places doesn't work. counter go? 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(""); } int counter = 3; boolean login = false; while(counter > 0 && 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; } --counter; }

ruby - Jekyll access data files from inside a plugin -

how access information inside "_data" folder inside "_plugin"? for example have _data/items.yml item data1: info data2: moreinfo inside plugin in render method want able def render(context) <<--markup.strip <p>#{site.data.items.data1}</p> markup end ideas? have been able site.data.items have not been able access children elements (data1, data2) your data file _data/items.yml has item key well. item data1: info data2: moreinfo so data1 accessed site.data.items.item.data1 and data2 site.data.items.item.data2

c# - How does use of ThreadStatic affect the performance of IIS -

i want use threadstatic atrribute in code. want know if there performance issue in iis if use threadstatic attribute in application multiple threads going access fields . want idea if resources of iis overused or thing should keep in mind before implementing this. there no direct performance issue using threadstatic through iis, have take in consideration iis use thread pool. it means thread static not free after single call. in other hand, web request can composed multiple threads executions (page example not web service) , may not share same thread same "client request". if don't free threadstatic thing, may cost memory usage. if valuate threadstatic in synchronous method call synchronous process , free in block @ end of same method, can use without side effect.

html - How to add full width background in two column (col-md-6) on bootstrap 3 -

Image
i ask how add full width background on 2 column (col-md-6) in bootstrap 3. please refer image. as can see in image there 2 column green background , image . how set full width background on each column? thanks :) <div class="container"> <div class="row"> <div class="col-md-6 the-green-bg"> <h1>lorem ipsum</h1> <p>orem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip </p> <a href="#">learn more</a> </div> <div class="col-md-6"> <!-- full-width image --> </div> </div> </div> see jsfiddle or snippet below ( better see fiddle because use col-md , need see result in lar

.bin file generated by word2vec is not readable -

i new word2vec.i have run word2vec code in python given corpus train.model saved in .bin file extension.but not readable,like below :�z�;5>|:#�Õºsk������a���<�?;x�;���;�]��Ê‹y��#ع�#g;�##���)���#;c�:��}�:�2�;����2#�;>�i�##n;p+�;�#�:p�ّ:�u,���#�?�#���w��#�93�����t�i##;d�q;�� ;��f;#�n;:9�;��к[q0;c�ƹv�";�Üš��#u�#�i���7���Õº+�#��t�;kc�7y#��#�#�{��a4����:ÜŸ��b�#;'�#�##�;w-��$p� �v�"��;�3u;k�;ꌒ�?�f��� � that is, in fact, way 'binary=true`-saved file , should look: lots of raw binary numerical (floating-point) data looks garbage if interpreted text. other code reads format work fine. however, if want that's easier on your eyes, save using binary=false optional parameter. may want use different file-extension (such .txt ) hint others (and future-self) file isn't raw binary data.

Alignement of keys with subscripts in matplotlib -

i trying better control on text in table. in following minimal example keys of table a_c, a_c , abc. in first column , a_c in second column not aligned correctly in key of first column. instead, subscript c in first key aligned in second key, creating bad visual effect , lifting keys respect 1 another: import matplotlib.pyplot plt import numpy np matplotlib import rc rc('text', usetex=true) col_labels=[r'a \textbf{a}\boldmath$_c$',r'\textbf{a}',r'\textbf{abc}'] row_labels=[r'\textbf{a}',r'\textbf{b}',r'\textbf{abc}'] table_vals=[['-','-','-'],['-','-','-'],['-','-','-']] the_table = plt.table(celltext=table_vals, rowlabels=row_labels, collabels=col_labels, loc='center', colwidths = [0.1, 0.1, 0.1] , cellloc='bottom') the_table.scale(1,3.5) the_table.set_fontsize(44) plt.show() how can text

node.js - I'd like to connect to mysql and ionic2 -

i use node.js server , mysql database. i tried connect mysql , ionic2, difficult connect mysql , ionic2. how have do? or there site see? please, let me know this. the easiest way is, need develop restful api interacts mysql database , use api fetch , put data (crud) ionic2 app.

hive - Spark partitions - using DISTRIBUTE BY option -

we have spark environment should process 50mm rows. these rows contains key column. unique number of keys close 2000. process of 2000 keys in parallel. using spark sql following hivecontext.sql("select * bigtbl distribute key") subsequently have mappartitions works nicely on partitions in parallel. trouble is, creates 200 partitions default. using command following able increase partitions hivecontext.sql("set spark.sql.shuffle.partitions=500"); however during real production run not know number of unique keys. want auto managed. there way please. thanks bala i suggest use "repartition" function , register repartitioned new temp table , further cache faster processing. val distinctvalues = hivecontext.sql("select key bigtbl").distinct().count() // find count distinct values hivecontext.sql("select * bigtbl distribute key") .repartition(distinctvalues.toint) // repartition number of distinct values

html - Google map iframe set height? -

Image
i want embed google map location. when use iframe, goes 100% height. when set height .google-maps iframe { position: absolute; top: 0; left: 0; width: 100% !important; height: 30% !important; } it looks way. map size looks ok it's using unwanted white space between footer. ifrmae <div class="google-maps"> <iframe src="https://www.google.com/maps/embed/v1/place?q=place_id:chij-69hn5jz4jorzaymm3zi2o8&key=aizasydtljbjbpix73t57vhnihmkyk0u5p6mngi" width="600" height="200" frameborder="0" style="border:0"> </iframe> </div> .google-maps { position: relative; padding-bottom: 77.4%; height: 0; overflow: hidden; } i want show 30% size of map. how can archive that? you getting white space because use "padding-bottom: 77.4%;". use height: 30%;.

c# - Share user session data between domains (not subdomain) -

we have web application hosted on iis. application can reached on multiple domains (different domains - same application). have implemented shared session between domains use of shared id stored inside database. works fine - once user requests url passing request auth domain (session server) - in response whether user authorized or not. thats basic information user login state. now we're facing problem how share session data? each domain session object maintained separately. means when session object initialized in request domain a, domain b not able access data. we considering implementing "application wide" static collection of user session objects accessible in each domain context. smells trouble when comes maintain object live cycle , overall performance application. do have opinion on above solution? can point other solution problem? best regads man

json - Apache nifi Evalutejson path -

{"data":["12345","ind","899","tammy","clininc","44444","ind","444","tammm2","clinic1","95","exact"]} i have above json data , want 12345 1 value ind value 899 value , on can use $.data[0] 12345 , $.data[1] ind in evalutejson path processor? ahmed, you can have array of values in json using evaluatejsonpathprocessor. in processor have change "destination" attribute in "flowfile-attribute". after add newer attribute in evaluatejsonpathprocessor access values want below. data.0:$.data[0] data.1:$.data[1] data.2:$.data[2] then can use extracted values below., ${data.0} ${data.1} ${data.2} it work me. feel free upvote/accept answer if work you.

c# - Invalid object name 'dbo.ApplicationUsers'.? -

i create small crud operation on user using entity framework code first.now need delete user using store procedure find many links getting solution how use store procedure in ef.so write code that.but m write code , method onmodelcreating() in class , go login time getting error 'invalid object name 'dbo.applicationusers'. comment method login work uncomment code getting error. this class : using system.security.claims; using system.threading.tasks; using microsoft.aspnet.identity; using microsoft.aspnet.identity.entityframework; using microsoft.aspnet.identity.owin; using system.data.entity; using system.data.entity.core.objects; using system.data.entity.infrastructure; using system.collections.generic; using system.componentmodel.dataannotations.schema; namespace abc.models { // can add profile data user adding more properties applicationuser class, please visit http://go.microsoft.com/fwlink/?linkid=317594 learn more. public class

performance - C++ emplace_back parameters -

here piece of code in daily work. want ask if there difference between 2 cases, in terms of performance. std::vector< std::pair<std::string, std::string> > avec; // case 1 avec.emplace_back("hello", "bonjour"); // case 2 avec.emplace_back(std::pair("hello", "bonjour")); following question: what std::list these 2 cases? emplace_back construct element in-place, argument passed in perfect-forwarded constructor element. for 1st case, conceptually 1 step needed, i.e. appropriate constructor of std::pair invoked construct element directly in vector . for 2nd case, 3 steps needed; (1) appropriate constructor invoked construct temporary std::pair , (2) element move constructed in vector in-place temporary std::pair , (3) temporary std::pair destroyed.

How to find selection items lists in SAP -

in sap there dropdown fields list of items countries, nationalities, titles, etc. i need copy such lists excel can select 1 value, can not copy available values directly(?). in current case field's dynpro-name p0002-titel, has many entries want copy excel. don't have developer key, can few tas se16. what's easiest way me values i'm looking without having search through tables or copy single values 1 one? as far know cannot copy values directly dropdown lists in sapgui. solution 1 programs build these lists in various ways (db table, direct values), go se16 after guessing db table fieldname, if lucky values there. check domain's attributes behind dynpro field, if contains value table, should find values there se16. solution 2 sapgui stores dropdown values in cache in xml format. can find these cache files in [users directory]\[user]\appdata\local\sap\sap gui\cache\ . filenames start datap_sapvalueset , 1 file contains 1 field's value s

regex - Javascript: negative lookbehind equivalent? -

is there way achieve equivalent of negative lookbehind in javascript regular expressions? need match string not start specific set of characters. it seems unable find regex without failing if matched part found @ beginning of string. negative lookbehinds seem answer, javascript doesn't have one. edit: regex work, doesn't: (?<!([abcdefg]))m so match 'm' in 'jim' or 'm', not 'jam' use newstring = string.replace(/([abcdefg])?m/, function($0,$1){ return $1?$0:'m';});

c# - how to set the timeout while exporting data using webservices api in acumatica -

this first scenario: - create new "bill" document in acumatica system using webservices api bill , adjustments screen (ap301000). - after that, need load document records in application tab menu of current screen (ap301000) using webservices set off process. problem there lot of documents loaded. it's 9500 documents , of course need more times proceed (it's 10 minutes). i error in exporting process records in aplication tab menu. , error message "operation timeout". is there reference set timeout in exporting process of huge documents through webservices api. scon.getloginsettlementvoucher(context); ap301000content billschema2 = context.ap301000getschema(); list<command> cmds = new list<command>(); billschema2.documentsummary.type.commit = false; billschema2.documentsummary.type.linkedcommand = null; var command2 = new command[] { new value { value = "bill", linkedcommand = billschema2.documentsummary.type}, n

r - Accessing list element using grep -

how can directly access list item using grep output? far, found indirect way works involving unlisting both list , grep output: list1 <- list(c("group1", "group2", "group3")) list2 <- list(c("groupa", "groupb", "groupc")) list.all <- c(list1,list2) the following code works, i'm looking alternative unlist() idx <- unlist(lapply(list.all, function(x) grepl("group1", x))) unlist(list.all)[idx] returns "group1" expected. what looking syntax-wise - doesn't work - access list element directly like: list.all[[id.index]] but returns > invalid subscript type 'list' any ideas appreciated!

javascript - Google Maps API: forcing zoom in to a specific location -

i'm quite new google maps api , wondering if there way force zoom in specific location, example: us. what i'm looking way simulate kind of zooming in effect of mouse scrolling wheel, if cursor in us, when zoom in scrolling wheel, center start moving towards cursor. i tried using 'zoom_changed' event , changing center dynamically, since not running in desktop (device mode), event triggered @ end ( source ). here code: var map; var centerus; var currentcenter; var currentzoom; function initmap() { //define map map = new google.maps.map(document.getelementbyid('map'), { center: {lat: 0, lng: 0}, zoom: 3, disabledefaultui: true }); //limit zoom map.setoptions({ minzoom: 3, maxzoom: 10 }); //initialization of variables currentzoom = map.getzoom(); currentcenter = map.getcenter(); centerus = new google.maps.latlng(40, -100); //add listener zooming in map.addlistener('zoom_changed&#

.net core - How to IsSummary=true using fhir-net-api? -

i using fhir-net-api. have implemented read operation on capabilitystatement. read operation, want implement issummary=true search operation. not figuring out how have resource elements issummary=true using fhir-net-api? taken discussion on chat.fhir.org, recommendation let fhir serializer that's in api take care of that. make sure add "subsetted" tag meta data of resource , serialize summary option set true.

graph - How to find probability from a fitted copula in R? -

Image
i need find probability using fitted copula. example, student t copula used. random bivariate variable tsim01 generated rcopula() function on range [0,1]. as understand should compute value of bivariate copula function tcopula @ corresponded points 0< p1, p2<1 . i have tried use function prob() package copula . setup values of p1=0.4 , p2=0.7 , small delta=1e-3 . have definded small hypercube. probability 0.1036955. example below. library(copula) rm(list=ls(all=true)) n <- 100 set.seed(1) df = cbind(as.data.frame(rnorm(n)), as.data.frame(rnorm(n))); mymargins = c("norm", "norm") myparammargins = list(list(mean=mean(df[,1]), sd=sd(df[,1])), list(mean=mean(df[,2]), sd=sd(df[,2]))) # student t copula tcopula <- tcopula(dim=2, dispstr="un", df=2, df.fixed=true) tfit <- fitcopula(tcopula, pobs(as.matrix(df)), method='ml') trho <- coef(tfit); tcopula <- mvdc(cop

Rename tag in XML using XSLT -

i have xml below: <?xml version="1.0" encoding="utf-8" standalone="no"?> <properties> <entry key="user">1234</entry> <entry key="name">sam</entry> </properties> i want modify key value(key="user" key="id") using xslt, output xml should this <?xml version="1.0" encoding="utf-8" standalone="no"?> <properties> <entry key="id">1234</entry> <entry key="call">sam</entry> </properties> could please me this? new xslt area. for have first transform identity transform handle key: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="1.0"> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="

lucene - Solr wildcard issue with '-' character -

Image
i using solr , tokenizing field follows: <field name="title" type="text_general" multivalued="false" indexed="true" stored="true"> <analyzer> <tokenizer class="solr.whitespacetokenizerfactory"/> <filter class="solr.lowercasefilterfactory"/> </analyzer> </field> i append * @ each search field matching result: title:app* example app* give me app,application , similar result but if search term '-' in query fails return anything. example: title:child-play* not return result title:child-play !! can point me might issue. after debug got : title:child-play "debug":{ "rawquerystring":"title:child-play", "querystring":"title::child-play", "parsedquery":"title::child title::play", "parsedquery_tostring":"title::child title::play", for ti

c - crosss compile for ARM7 : error: '__int128' is not supported for this target -

typedef unsigned __int128 uint128_t; static uint64_t mul64hi(uint64_t x, uint64_t y) { return (uint64_t) ((((__int128) x) * ((__int128) y)) >> 64); } it is. c compiler not required support 128 bit integral type, , platform seems such instance, or if does, it's not __int128 . (try __int128_t or int128_t ?) consult compiler documentation absolute certainty, or consider using 3rd party large integer library, e.g. https://gmplib.org/

spring - External Java Library issue with Autowiring and injecting bean -

i have created spring boot application managed maven. i'm retrieving company's library our maven repository. in library, have service interface, not being annotated '@service': public interface myservice { //... } this service has 1 implementation : public class defaultmyservice implements myservice { //... } this library context managed old spring way (in applicationcontext.xml file). read normally, spring boot able find implementation if there's 1 in scope. when try run "spring-boot:run" on project, fail following error : no qualifying bean of type 'com.pharmagest.saml.samlservice' available: expected @ least 1 bean qualifies autowire candidate. dependency annotations: {@org.springframework.beans.factory.annotation.autowired(required=true)} i tried: to add @componentscan on configuration class, including packages in error : @componentscan(basepackages={"com.mycompany.web", "com.mycompany.theli

ios - How can i get this switch's status?(Setting->Privacy->Your App->Sports and fitness) -

Image
now, can error code function... typedef void (^cmpedometerhandler)(cmpedometerdata * __nullable pedometerdata, nserror * __nullable error) - (void)querypedometerdatafromdate:(nsdate *)start todate:(nsdate *)end withhandler:(cmpedometerhandler)handler; error.code == 105 equal "not allow" i don't know how switch's status directly. if there api can directly switch's status? or did have other function solve problem. thanks!

protocol buffers - How to mark rpc as deprecated -

if have service this: service myservice { rpc getthings(getthingsrequest) returns (getthingsresponse); } how mark getthings deprecated? i know how mark fields or messages deprecated can't find information rpcs. this proto3. tl;dr: it's possible, not generate compiler warning. consider use field-level deprecation. it looks it's possible add deprecated option service, on message , enum like: service myservice { rpc getthings(getthingsrequest) returns (getthingsresponse) { option deprecated = true; }; } found in: https://github.com/google/protobuf/issues/1734 even though compile, not seem generate compiler warning when used. tried in java, helloworld service java quick start guide . inspecting generated java file further, helloworldproto.java, shows class has not added @deprecated java annotation, there differences in file, proto annotation in proto description: $ diff helloworldproto-{control,method}.java 38c38 < "ssag

Locked SQL Server UDF -

when try rename/delete specific udf following error: "lock request time out period exceeded (microsoft sql server, error: 1222)" note if try alter it, query runs indefinitely.. here's did try solving problem without success: 1) dbcc opentran() returns "no active open transactions." 2) select @@trancount returns 0. 3) blkby field returned sp_who2 empty. 4) both restarted windows server , manually stopped/restarted mssqlserver service 5) chkdsk c: returns: 976657407 kb total disk space. 114105840 kb in 702392 files. 424472 kb in 122799 indexes. 0 kb in bad sectors. 1885591 kb in use system. 65536 kb occupied log file. 860241504 kb available on disk. no problem other database objects

C#: Generating a table from a .CSV that counts name (string) occurences in another table -

i importing data table .csv file headers, , no problem. let call file dt.csv . one column header named companyname . but need create new table i, first of all, list companies first data table , count how many times each companyname appear in first table. the first table can have 500 5000 lines, number of different companies appearing 15-50. challenge not know company names expect in advance, cannot make positive list count against. need list count against generated based on content of column companyname (so not duplicates of same name). this code c# largely pseudocode i'm not of approach reading / writing csv file: var seencompanies = new list<string>(); foreach(var line in csvfile) { seencompanies.add(line.getcolumn("companyname")); } var companiesandcounts = seencompanies .groupby(s => s) .select(group => new { name = group.key, count = group.count()}) .tolist(); foreach(var group in companiesandcounts) { o

Trigger PayPal checkout button click -

Image
how can trigger paypal checkout button click? have website beside credit cards going accept paypal payments , have decided put radio buttons customers choose way customer going pay , paypal checkout button: paypal checkout button click opens paypal secure window , rest works fine. when customer click 1st radio button want again open paypal secure window i.e. trigger click on paypal checkout button. how can if button appearing in iframe , not able trigger click event of button cross domain? there way trigger checkout button click? here html code: <html> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script src="https://www.paypalobjects.com/api/checkout.js"></script> <script type="text/javascript" src="paypal.js"> </script> <body> <div> <span style="vertical-align: 50%"><input id="r

Kotlin Unwrapping Function Compiler Error -

anyone know why following code doesn't work? private fun wraplogifneeded(buildmessageoncurrentthread: boolean, log: () -> string): () -> string return if(buildmessageoncurrentthread) { val message = log() // type mismatch: required () -> string found: unit { message } } else { log } } but does: private fun wraplogifneeded(buildmessageoncurrentthread: boolean, log: () -> string): () -> string return if(buildmessageoncurrentthread) { val message = lazy { log() }.value { message } } else { log } } that's because of syntax ambiguity: val message = log() { message } this code gets parsed if val message = log() { message } , is, log called lambda { message } argument. , statement val message = ... has type unit , hence error message. to resolve it, can add semicolon: val message = log(); { message }

python - limit bandwidth of queryset results according to an order django orm -

i have model colleges field rank. input college object rank 10.(lets object xyz) colleges ranked , same rank can assigned different colleges. want return colleges objects (max = 10) 5 colleges having score less xyz's rank , 5 colleges greater college's rank in sorted manner. not want bring colleges first , select 10 colleges out of because huge data. there way make direct query via django orm?? django 1.6 platform. for example have 100 objects rank 1-20. , college xyz lie in 35th position in sorted order. colleges woth 30-34 , 36-40 should show up the problem discussing here dont need custom sql query, if still need check here help # custom query inside `raw` function c in college.objects.raw('select * appname_college')[:5]: print(c) but can use filter above situation & if conditions more use condition expressions

android - Using adjustResize with fragments and requestFocus -

i'm trying create activity single relativelayout used fragment container, each fragment has separate background color bleeds under translucent status bar, , activity whole accounts keyboard size. the layout activity is: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/fragment_container" android:layout_width="match_parent" android:layout_height="match_parent" /> the fragments wrapped with: <android.support.constraint.constraintlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:animatelayoutchanges="true" /> and activity defined as: <activity android:screenorientation="portrait" android:name=".lo

How to create a c++ class (.h and .cpp) in android studio? -

i learning use android ndk , try create native c++ class (.h , .cpp). followed official tutorial ( https://developer.android.com/studio/projects/add-native-code.html ) achieve this. managed create simple c++ class , call java, no problem. now want create own c++ class (let's hellowworld class) constructor nothing. this, right click on cpp folder contain working jni wrapper. i create class , create default constructor , call jni function crashed during compilation: error:failure: build failed exception. what went wrong: execution failed task ':app:externalnativebuilddebug'. build command failed. error while executing 'c:\users\lucien.moor\appdata\local\android\sdk\cmake\3.6.3155560\bin\cmake.exe' arguments {--build c:\users\lucien.moor\desktop\tmp\myapplication2\app.externalnativebuild\cmake\debug\mips64 --target native-lib} [1/2] building cxx object cmakefiles/native-lib.dir/src/main/cpp/native-lib.cpp.o [2/2] linking cxx shared library .

mysql - Is there anyway to get parent on self table in sql? -

i need like this in mysql database. in case need from: id | first_reference | description 1 | -1 | root 2 | 1 | other_child 3 | -1 | root 4 | 2 | child 5 | 1 | other_child 6 | 3 | child i need return root childid, or child if childid refer root: i tried this: select parent.id mytable child join mytable parent on child.first_reference = parent.id parent.first_reference = '-1' , child.id = '6' but doesn't work and tried solution select case: select case first_reference when '-1' id else select rec.id mytable rec rec.id = main.first_reference end 'root' mytable main childid = '6' but syntax error. where wrong? if else have problem solved simle left join: select case when parent.id null child.id else parent.id end id table child left join table parent on ((parent

c# - combine 2 SearchResultCollection -

we in process of moving employees new active directory ou. have applicatin users can search employee displayname (or of know) in ad , returns them list of employees found. filter looks this: (&(displayname={0}*)) , {0} replaced search criteria user enters. application searches active directory , returns searchresultcollection results. needs able search old path in ad new 1 , combine results 1 searchresultcollection sorted lastname, firstname can iterate over. problem is, doesn't there methods join 2 searchresultcollections. missing something?

Is there a way to access method arguments in Ruby? -

new ruby , ror , loving each day, here question since have not idea how google (and have tried :) ) we have method def foo(first_name, last_name, age, sex, is_plumber) # code # error happens here logger.error "method has failed, here method arguments #{something}" end so looking way arguments passed method, without listing each one. since ruby assume there way :) if java list them :) output be: method has failed, here method arguments {"mario", "super", 40, true, true} in ruby 1.9.2 , later can use parameters method on method list of parameters method. return list of pairs indicating name of parameter , whether required. e.g. if do def foo(x, y) end then method(:foo).parameters # => [[:req, :x], [:req, :y]] you can use special variable __method__ name of current method. within method names of parameters can obtained via args = method(__method__).parameters.map { |arg| arg[1].to_s } you display nam

javascript - Ng-Repeat showing irregular behavior with one time binding -

i having ng-repeat directive running on array on object. facing specific scenario in which, when bind object properties 1 time binding getting refreshed when purge , add data in array of object on running ng-repeat. the point focus here is, these functionalities working previosuly. code <div class="search_result" data-ng-repeat="prod in searchresult track $index" ng-show="showwhenresultpositive"> <div class="media search-result-container"> <div class="media-left"> <div class="left ">&nbsp;</div> <div class="leftbottom">&nbsp;</div> <div class="righttop">&nbsp;</div> <div class="rightbottom">&nbsp;</div> <div class="searchimg_container" ng-click="redirectiontopage(prod.url)"> <!--<img src=&

python - Django admin: SORTING list_display field from reverse FK aggregation -

the model station has fk system . want display station count column in system admin change list. have achieved code below having difficulty making 'num_stations' column sortable. model.py: class system(models.model): pass class station(models.model): system_info = models.foreignkey(system) admin.py: class systemadmin(admin.modeladmin): def num_stations(self, obj): return obj.station_set.count() # num_stations.admin_order_field = ???? num_stations.short_description = 'stations' list_display = (num_stations',) the ordinary 'station_set' syntax reverse relationship doesn't seem work in admin_order_field, though other stack overflow question commonly show traversing relation in forward direction supported e.g. django admin: how sort 1 of custom list_display fields has no database field can “list_display” in django modeladmin display attributes of foreignkey fields? . thanks alasdair comment,

javascript - Openlayers tiles not loading on a tabed web page -

if have 3 tabs on page , openlayer map on second page not current default. map tiles not load when click on second tab. map tiles load when resize web document window. happening on browsers. below code reference. jsfiddle link <!doctype html> <html> <head> <link rel="stylesheet" href="https://openlayers.org/en/v4.0.1/css/ol.css" type="text/css"> <style> .map { height: 400px; width: 100%; } body {font-family: "lato", sans-serif;} /* style tab */ div.tab { overflow: hidden; border: 1px solid #ccc; background-color: #f1f1f1; } /* style buttons inside tab */ div.tab button { background-color: inherit; float: left; border: none; outline: none; cursor: pointer; padding: 14px 16px; transition: 0.3s; font-size: 17px; } /* change background color of buttons on hover */ div.tab button:hover { background-color: #dd

csv - How to write and then read a file in Google Storage in local development using Java? -

i developing application java on google app engine , want know if there way load file csv in storage read it. trying care entities csv , seemed me best way since later read every line , save every entity. in fact succeed in doing using commons-lib of apache if files great, errors because there maximum of 10kb. have example of jsp form , of servlet read , write in local?

angular - Why ContentChild is undefined? -

i have 2 components formcomponent , test1component . test1component uses ng-content display formcomponent formcomponent.ts import { component, input, output, eventemitter } '@angular/core'; @component({ selector: 'app-form', template:` <div class="panel panel-default fcs-form"> <div class="panel-header form-header"> {{headertitle}} </div> <div class="panel-body form-body"> <ng-content select="[form-body]"></ng-content> </div> <div class="panel-footer text-center form-footer"> <button class="btn btn-primary">{{resetbtntext}}</button> <button class="btn btn-primary" (click)="saveform()"> {{savebtntext}} </button> <button class="btn btn-primary">{{addbtntext}}</button>