Posts

chef - Library doesn't process "DSL" for 'execute' -

can me please? nomethoderror ------------- undefined method `execute' chat::mattermost:class relevant file content: (file name libraries/chat.rb ) 4: 5: module chat 6: class mattermost 7: 8: def self.log_to_chat(message) 9>> execute "echo" 10: command "echo #{message}" 11: end 12: end 13: 14: end 15: end 16: i read dsl syntax isn't available in definition, guessing need resembling r = chef::resource::execute.new("echo #{message}") , r.run_command :run i'm not quite sure how it. other relevant code, method "called" this: log "this message" level :info notifies :run, chat::mattermost.log_to_chat("#{name}"), :immediately end edit: second attempt nomethoderror ------------- undefined method `events' nil:nilclass for code: 5: require 'chef/resource/execute' 6: 7: module chat 8: class mattermost 9: 10: def self.log_to_chat(m...

r - ggplot2: Independent Continuous Fill for Summary Row & Column -

Image
i using strategy plot summary (totals) rows in heatmap using geom_tile , involves creating rows in data_frame row , column totals: library(dplyr) library(ggplot2) entitites = letters[1:10] # create sample data df_foo = bind_cols( data_frame(group1 = rep(c("a", "b"), each = 100)), bind_rows( expand.grid( left = entitites, right = entitites, stringsasfactors = false ), expand.grid( left = entitites, right = entitites, stringsasfactors = false ) ), data_frame(value = rpois(200, 15)) ) # create summary row & column df_foo_aug = bind_rows( df_foo, df_foo %>% group_by(left, group1) %>% summarize( value = sum(value), right = "total" ), df_foo %>% group_by(right, group1) %>% summarize( value = sum(value), left = "total" ) ) # create plot df_foo_aug %>% ggplot(aes(x = right, y = left, fill = value)) + geom_tile()...

c# - How can i split excel sheet values and store it in new excel sheet? -

i have excel sheet having values in 1 column splitted delimiter (|). coumn1|column2|column3|column4 (this column names in 1st row of excelsheet) value1|value2|value33|value4 val1||val3|val4 i want split values separate , create new excelsheet store splitted value. in new excel sheet want values like. column1 column2 column3 column4 value1 value2 value3 value4 val val3 val4 how can values this.anyone give me solution this. i data excel , store values in data table. using following code. public void loadexceldata() { using (spsite site = this.webapplication.sites[0]) { using (spweb currweb = site.openweb()) { string fullpath = ""; spquery query = new spquery(); splist currlist = currweb.lists.trygetlist("jdfieldmapping"); splistitemcollection itemcoll = currlist.getitems(query); query.viewfields ...

Oracle SQL Update using group by/case -

i have record table1 structure key1 key2 key3 emplid enrcd addl_seq ... (key1 key2 key3 emplid enrcd addl_seq) being keys i have rows emplid & erncd same different values of key1/2/3 increment addl_seq value 1 when multiple rows exist same emplid & erncd example - key1 key2 key3 emplid erncd addl_seq 001 a1 b1 12345 reg 1 001 a1 b2 12345 reg 2 updated sql update ps_xx_py40_apay_1 a1 set a1.addl_seq = ( select rank() over(partition xx_employee_id,erncd order xx_conversion_id,xx_ucpath_loc,xx_wrkr_instance,xx_appt_num,xx_dist_num,empl_rcd,emplid,effdt) ps_xx_py40_apay_1 b1 b1.xx_employee_id=a1.xx_employee_id , b1.erncd=a1.erncd , xx_conversion_id=xx_conversion_id , xx_ucpath_loc=xx_ucpath_loc , a1.xx_wrkr_instance=b1.xx_wrkr_instance , b1.xx_appt_num=a1.xx_appt_num , b1.xx_dist_num=a1.xx_dist_num , a1.emplid=b1.emplid , a1.empl_rcd=b1.empl_rcd , a1.effdt=b1.effdt ); ...

In Kafka, can I create a single kafka topic and have multiple producers write to it -

i have following use case : log files comes single data source pushed kafka topic (say topic 1). there consumer read , converts json format , writes topic (topic 2). consumer expecting data in json read topic 2 other modification , writes topic (topic 3). my question instead of creating 3 different topics, can create single topic , have these multiple producers write same topic? how consumer know partition read since group id cannot set producer? 1 solution learnt create partitions , make each producer write particular partition alone. problem approach number of producers , consumers might change , modifying topic not desired. please advice. as 1 commented should not push different type of schema's single topic. number of topics in kafka not issue. can use nomenclature manage them. "topic1", "topic1_json", "topic1_modification". if use case have unmanageable list of topics, same consumer can read json topics & don't want batc...

asp.net mvc - How can I use the Vue.js code from a webpack bundle in a Razor page? -

here razor page code: @using system.web.optimization; @{ bundletable.bundles.add( new scriptbundle("~/scripts/vuejs") .include("~/static/scripts/vuejs/vue.min.js")); } @section scripts { @scripts.render("~/static/vue/assets/bundle.js") @scripts.render("~/scripts/vuejs") } <div id="app_container"> {{text}} </div> and here entry of webpack javascript: import vue 'vue'; const v = new vue({ el: '#app_container', data: { text: 'abcdefg' } }); webpack config: export default { entry: [ 'babel-polyfill', './src/index.js' ], output: { filename: 'bundle.js', path: 'c:/websandbox/static/vue/assets', publicpath: '/vue/assets/' }, devtool: 'source-map', module: { loaders: [ { test: /\.vue$/, loader: 'vue' }, ...

r - How to get latest news posted on twitter by a website -

i using r , need retrieve few recent posts twitter user (@expressnewspk) using twitter api. have created account , have access token, etc. have used following command extract tweets: setup_twitter_oauth(consumerkey,consumersecret,accesstoken,accesssecret) express_news_tweets <- searchtwitter("@expressnewspk", n = 10, lang = "en" ) however, posts returned aren't recent ones user. have made mistake? i think searchtwitter search search string provided (here @expressnewspk). instead of giving tweets @expressnewspk give tweets directed @expressnewspk. to tweets @expressnewspk, have function named usertimeline give tweets particular user. so after done setup_twitter_oauth , can try usertimeline("expressnewspk") read more @ ?usertimeline