Posts

c# - Using BrokeredMessage with ServiceBus Queue Trigger in Azure Function -

i've created azure function triggered time new message added azure servicebus queue. code works fine: #r "newtonsoft.json" #load "..\shared\person.csx" using newtonsoft.json; using newtonsoft.json.serialization; public static void run(string message, tracewriter log) { var person = jsonconvert.deserializeobject<person>(message, new jsonserializersettings() {contractresolver = new camelcasepropertynamescontractresolver()}); log.verbose($"from deserializeobject: {person.firstname} {person.lastname}"); } i've seen can bind message poco that: public static void run(person message, tracewriter log) { log.verbose($"from deserializeobject: {message.firstname} {message.lastname}"); } now bind message brokeredmessage because need have access properties of message. edit new sdk supports servicebus sdk using #r directive #r "microsoft.servicebus" using microsoft.servicebus.messagin...

swing - Java order jlist by status -

i have small problem, don't know how sort jlist status retrieved database. want sort "online" , "offline", mean online computers go first , offline computers, have code now, makes icon+text jlist can tell me how can filter/sortby status? public void acx_pc(string query) { try { statement st = con.createstatement(); resultset rs = st.executequery(query); string comb; map<object, icon> icons = new hashmap<>(); arraylist<string> pc_list = new arraylist<>(); int = 0; while (rs.next()) { //getting info db string pc_name = rs.getstring("nombre_pc"); string pc_ip = rs.getstring("ip"); string status = rs.getstring("estado"); //setting text jlist comb = pc_name + " - " + pc_ip; //comparing status switch (status) { case "onl...

Routes error with django models migrations -

i have file named routes.py have router.register('orders', orderviewset, 'order') if comment don't have problems migrations, in production, , boss cannot comment every time want migrate. in te serializer.py have this: class orderserializer(serializers.modelserializer): buyer_obj = serializers.serializermethodfield() #items = productserializer(many=true, read_only=true) class meta: model = order fields = ('id', 'url', 'buyer', 'items', 'store', 'buyer_obj', 'browser_ip', 'currency', 'enabled', 'financial_status', 'gateway', 'total_amount') the error next: django.db.utils.operationalerror: (1054), "unkown column 'orders_order.currency' in 'field list'") please exist form migrate that? thank you.

c# - How to use a ServiceBus Trigger with a topic/subscription in an Azure Function -

Image
i'd create azure function triggered when new message added topic/subscription. for moment i've created azure function using servicebusqueuetrigger c# template , i've set queue name to topicpath + "/subscriptions/" + subscriptionname but i've got exception: microsoft.servicebus: cannot entity 'topic-test/subscriptions/subscription-test' because not of type queuedescription . check using method(s) correct entity type. system.runtime.serialization: error in line 1 position 1762. expecting element 'queuedescription' namespace ' http://schemas.microsoft.com/netservices/2010/10/servicebus/connect '.. encountered 'none' name '', namespace ''. . i thought azure function using messagingfactory.createmessagereceiver initialize message pump not. is there support topic/subscription moment ? yes topics supported, our ui , templates behind on unfortunately - we'll releasing updates addr...

Intellij Idea - how to get rid of thick caret/cursor -

Image
i pressed in intellij , caret shape changed this. how revert normal thickness? using intellij 2016.1. compare this, normal thickness should of bold vertical line: update: on android studio 2.1 beta, same machine, same font settings, cursor visibly thinner. you can .. it's not pixel perfect. mean -- me value not seem control thickness in pixels rather index (which gets applied predefined values) -- at least impression on see computer. in case: help | find action... search registry action once in registry window -- editor.caret.width entry set new value (for me default 2 ) -- make sure field went bold (move entry) ensure new value accepted. restart ide (this option requires it) update (2017/04/06): you may try thincaret plugin : makes editor caret 1 pixel thin (for retina users)

linear regression - How to replace the fitted value in multiple columns in R -

i have dataframe called new.cars . need apply linear regression formula columns in dataframe. there thousands of columns in new.cars , indicating each of them not possible in formula. there 4 columns, pcas remain same in formula other columns (columns other pcas ) in want apply formula. the formula first column (column mercedes ) is fit1 <- lm(mercedes ~ pca1 + pca2+pca3+pca4, data=new.cars) new.cars[,"mercedes"] <-fit1$fitted.values and forth other car columns.. best way replace column values fitted value (and omitting na values in column, means don't want change nas--as empty cells , need not fitted)? new.cars<- structure(list(mercedes = c(1, 1, 1, 1), vw = c(1, 2, 0, na), camry = c(2, 0, 0, na), civic = c(4, 1, 1, 1), ferari = c(2, 2, 2, 0), pca1 = c(0.021122, 0.019087, 0.022184, 0.021464 ), pca2 = c(0.023872, 0.024295, 0.022471, 0.027509), pca3 = c(0.000784, 0.001996, 0.003911, 0.006119), pca4...

r - Using "rvest" scraping html table -

i try using rvest package scrape table: library(rvest) x <- read_html ("http://www.jcb.jp/rate/usd04182016.html") x %>% html_node(".csvtable") %>% html_table url elements likes: <table class="csvtable"> <tbody>...</tbody> <tbody class>...</tbody> </table> why occur error "no matches"? you're in luck (kind of). site uses dynamic xhr requests make table, said request csv file. library(rvest) library(stringr) pg <- read_html("http://www.jcb.jp/rate/usd04182016.html") # <script> tag dynamic loading in position 6 of # list of <script> tags fil <- str_match(html_text(html_nodes(pg, "script")[6]), "(/uploads/[[:digit:]]+\\.csv)")[,2] df <- read.csv(sprintf("http://www.jcb.jp%s", fil), header=false, stringsasfactors=false) df <- setnames(df[,3:6], c("buy", "mid", "sell", "symb...