Posts

Cannot use msn.marginal {sn} in R -

i have try many ways, still cannot use msn.marginal research. when try install package sn in latest r software (ri386 3.2.0), msn.marginal not in there msn.marginal error: object 'msn.marginal' not found i tried install package of sn version 0.4-18, still cannot use msn.marginal so, tried install sn package of version 0.4-14, got install.packages(" http://cran.r-project.org/src/contrib/archive/sn/sn_0.4-14.tar.gz ", repo=null, type="source") installing package ‘c:/users/owner/documents/r/win-library/3.2’ (as ‘lib’ unspecified) trying url ' http://cran.r-project.org/src/contrib/archive/sn/sn_0.4-14.tar.gz ' content type 'application/x-gzip' length 60084 bytes (58 kb) downloaded 58 kb installing source package 'sn' ... ** r ** data ** inst ** preparing package lazy loading ** help warning: c:/users/owner/appdata/local/temp/rtmpclmzuh/r...

javascript - $.ajax, complete function (no more data to get) -

im new .ajax , far good. i've run issue of, want run function once i've used data. for example have following, run on 'click': $.ajax({ url: "url.modal.tothegoods" + (nextpage), success: function (data) { //keeps appending data on click }, error: function () { alert('balls'); } }) i've tried ajaxcomplete function runs everytime load data onto screen. it runs everytime appened data .ajaxcomplete runs. guess questions is, how run function once have no more data consume. done any tips/tricks appreciated the response depends on behaviour of server part. if have hand on it, simple solution returns nothing when there no more data send. may simple this: $.ajax({ url: "url.modal.tothegoods" + (nextpage), success: function (data) { if (!!data) { //keeps appending data on click } }, ...

python 2.7 - After writing formulae into excel sheet with xlwt, reading cells with formulae by xlrd returns blank -

i have first created pivot table using pandas. saved worksheet. wrote data & formulae in worksheet using xlwt further processing. trying read value cell had written formula. book = xlrd.open_workbook(fname) sheet = book.sheet_by_name('pivot table') print 'spare',sheet.cell(11,10).value this code works fine , returns proper values when pointing cell without formula (that depends on other cells). cells formulae return nothing. i need way read cell value. excel sheet has lot of formulae written , cell trying read final cell. not want back-track process value (compute through script). i using ubuntu , have libreoffice. (fyi, in case there no direct way , need open excel , fetch data) this can't done. after writing excel xlwt package, need open excel , save it. opening excel file populate cells containing formulae calculated values. saving excel save these values cells along formulae. some things observed- the above true cells ...

ruby on rails - undefined method `location' for #<Event::ActiveRecord_Associations_CollectionProxy:0x007f834658ea50> -

i have 2 models: event , location. location has_many events , event belongs_to location. location has attribute called "city". in controller, have following code: @locations = location.all.includes(:events) @events = @locations.collect{|l| l.events} @events.each |event| puts "event #{event.inspect}" puts "event location #{event.location}" end i getting following error: undefined method `location' #<event::activerecord_associations_collectionproxy:0x007f834658ea50> i know events have location, should work. how work? this fail if of locations has no events associated it. can try ensure have no nil elements in array: @locations = location.all.includes(:events) @events = @locations.collect{|l| l.events}. flatten. reject{|e| e.nil?} @events.each |event| puts "event #{event.inspect}" puts "event location #{event.location}" end

javascript - Angular directives not showing in the source HTML -

i have filter turns hashtags links: app.filter('hashtags', function($filter) { return function(text, target) { if (!text) return text; var replacedtext = text.replace(/#(\w*[a-za-z_]+\w*)/gim, '<a ng-href="/posts?q=%23$1">#$1</a>'); return replacedtext; }; }); however, when displayed on page, hashtag clickable , surrounded in anchor tags, ng-href no found. looks this. <a>#hashtag</a> why angular directive not showing up? it may worth noting classes show up. if change line read: var replacedtext = text.replace(/#(\w*[a-za-z_]+\w*)/gim, '<a class="test" ng-href="/posts?q=%23$1">#$1</a>'); the output in html be: <a class="test">#hashtag</a> ng-href need pulled out of filter , put template in used. <div ng-repeat="tag in tags"> <a class="test" ng-href="{{tag | hashtag}}">{{tag}}</a...

c# - Best way to read single byte from array of bytes -

i have array of bytes , want read bytes 1 one , convert int. getting date in byte of array need create datatime object that. using following code. should best approach same performance perspective. byte[] date = {25, 10, 13, 04, 16, 26} //day month year hour minute second capturetime = new datetime( (int)(new arraysegment<byte>(date, 2, 1).toarray()[0]), // year (int)(new arraysegment<byte>(date, 1, 1).toarray()[0]), // month (int)(new arraysegment<byte>(date, 0, 1).toarray()[0]), // day (int)(new arraysegment<byte>(date, 3, 1).toarray()[0]), //hours (int)(new arraysegment<byte>(date, 4, 1).toarray()[0]), //minutes (int)(new arraysegment<byte>(date, 5, 1).toarray()[0])); //seconds above code working fine performance point of view fine or there more approach handle this? byte 8-bit unsigned ...

adal - Can You Grant Admin Access to an Azure Application through PowerShell -

is there way grant administrative consent application using powershell? imagine have done connect-msolservice , provided credentials of account tenant admin; there way provide tenant-wide consent based on application client id? to clarify, mean granting application ability access directory admin? if case, can this: # using windows azure active directory module windows powershell # # connect tenant modify connect-msolservice # => login # service principal add role $serviceprincipal = get-msolserviceprincipal -serviceprincipalname principal.name # role object id # alternatively, can list roles (in order different role name) using `get-msolrole` $roleid = (get-msolrole -rolename "directory readers").objectid # add role service principal add-msolrolemember -roleobjectid $roleid -rolememberobjectid $serviceprincipal.objectid -rolemembertype serviceprincipal # check our work get-msolrolemember -roleobjectid $roleid # => should include principal.name ...