2018-10-22         Matthew

Show Office 365 Authentication Dialog from bot in Microsoft Teams with context.Activity.CreateOAuthReplyAsync

I am creating a bot with Microsoft Bot Framework. The bot is using enterprise resources in Office 365, therefore I need authentication. If the user of the bot is not authenticated and an access token is not present, the bot prompts the user to logon, using context.Activity.CreateOAuthReplyAsync.In the bot emulator, all of this works fine. The Office 365 authentication dialog is shown and the access token is available.Not in Microsoft Teams. In Microsoft Teams, the Card shows, but when I hit the "Sign in" Button, nothing happens. I have done a quick edit, to distinguish the ...

 authentication                     1 answers                     63 view
 2018-10-22         Matthew

How to print stack trace when an error occurs during annotation processing in Java

I'm working on a Java library that has an annotation processor. To trap exceptions I wrote code similar to the following code:public class KriptonProcessor extends AbstractProcessor { @Override public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv) { try { ... return true; } catch (Throwable e) { String msg = StringUtils.nvl(e.getMessage()); error(null, e.getClass().getCanonicalName() + ": " + msg); e.printStackTrace(); } return true; }}When an exception occurs, actually i...

 java                     1 answers                     39 view
 2018-10-22         Matthew

How to make JavaScript and Python work together?

I want to make a two way communication model for JavaScript and Python.I want JavaScript to process a data and send it to Python and then Python processes it and sends it back to JavaScript. I don't have a clue how this can be achieved and how the communication between the two languages will be made.Consider the example:Read the comments for clarity of the model!var files = [];const div_files = document.getElementById("files");const div_results = document.getElementById("results");function fetchNames() { div_files.innerHTML = ""; // clears the file div div_results.innerHT...

 javascript                     2 answers                     4 view
 2018-10-22         Matthew

Creating buttons inside loop command failing

Using Tkinter in python, trying to make numbered buttons, which use self.do(x) to add the number x to a string variable. The problem with this particular piece of code being in a loop (to save space), is that it will add the LAST number to the string (ie, 9 in this example). This is because it calls the function after this, and uses the latest value of num[i]. Is there any way to correct this?self.numButton = []num = []for i in range(9): num.append(i + 1) self.numButton.append(Button(root,text=num[i],command=lambda: self.do(num[i]))) Use a default value in your lam...

 python                     1 answers                     68 view
 2018-10-22         Matthew

C# date formatting

This is a problem I have come across a number of times and I'm sure there's an elegant solution I'm missing.I have some DateTime variables in c# that I get sent from various SQL tables/websites/web services, often sent as strings. The problem is that some of these sources are set up as English (United States) and some are set up as English (British). I don't have control over some of these, as I would dearly like to set them all to one culture or the other.Until now I have been converting these using a CultureInfo object to format it correctly like:CultureInfo ci = new Cult...

 c#                     3 answers                     60 view
 2018-10-22         Matthew

cycle the LEDS IN ATMEGA8515

I want to read the switches next to the LEDS and cycle the LEDS from 0 to whichever switch is pressedif none are pressed cycle through all of them with the delay.For this i have used timer0. Since I work onatmega8515. I used INT0. Here is my implementation:#include <avr/io.h>#include <avr/interrupt.h>#include <util/delay.h>#define BIT(n) (1 << n) volatile uint8_t led, k, switches, i , j = 1; /* uint8_t is the same as unsigned char */int main(void){ DDRB = 0xff; /* use all pins on PortB for output */ led = 1; ...

 atmega                     1 answers                     86 view
 2018-10-22         Matthew

Convert .class files to binary files?

When compiling a '.java' file it will create a new '.class' file, which is not a pure binary file. To run this file you need an interpreter called 'java'. Is there a way to convert this '.class' file to a binary file? In which you don't need another program to run?F.ex './filename' in Linux.Sorry for my bad english.-Henrik What you need is GCJ,http://gcc.gnu.org/java/ [XXX]

 java                     1 answers                     15 view
 2018-10-22         Matthew

(MySQL 5.7.19 AWS RDS) how to change table column character set without locking

i want to change table character set from 'utf8' to 'utf8mb4'but each column has own character set setting(utf8)so i need to change column character set to 'Table Default', but locking is the problemhelp me to change column character set without table lockingthere is over 100,000,000 rows in table "Character set" is the encoding of the characters in bytes."Collation" is how to sort characters.An INDEX on a VARCHAR is sorted by its collation, so changing the collation of a column requires rebuilding an index -- a non-trivial operation.The difference between utf8 and utf8m...

 mysql                     1 answers                     40 view
 2018-10-22         Matthew

Retrieve closest road when given (lat, long) using OSM in Postgres with Postgis using SQL query

Given a set (lat, long) I am trying to find the maximum speed using "max_speed" and street type using "highway". I have loaded my database (Postgres and Postgis) as follows:$ osm2pgsql -c -d gis --slim -C 50000 /var/lib/postgresql/data/germany-latest.osm.pbfThe closest related question I could find was How to query all shops around a certain longitude/latitude using osm-postgis?. I have taken the query, and plugged in a (lat, long) that I found in google maps for the city center of Munich (as the post was also related to city center Munich and I have the map for Germany). ...

 sql                     1 answers                     38 view
 2018-10-22         Matthew

Concatenate value into SELECT on a condition

I need to insert into a table a list of concatinated values but the first one needs to be added if p_is_broker variable is true. For simplicity let's say it's true.insert into exports (session_id, row_sequence, row_data)select token, 1, 'Manager' ||','||'Company' ||','||'Driver Name' ||','||'Registration' ||','||'Vehicle'from dualunionselect token, rownum + 1, '"'||replace(manager,'"','""') ||'","'||replace(company,'"','""') ||'","'||replace(driver_name,'"','""') ||'","'||replace(registration,'...

 sql                     1 answers                     1 view
 2018-10-22         Matthew

SSRS: Upload multiple reports to reporting server 2008 R2

Is it possible to upload multiple RDL files in Report Manager? For example: I have 40 rdl files in a folder and I want to upload all these 40 RDLs in a single upload (i.e as a zip or just the whole folder).Normally I have to upload these RDLs one by one and that takes too long and increases the chance of an error. If all the RDLs exist in one project, you can deploy it to the server via Visal Studio.Here is a guide [XXX]

 sql-server                     1 answers                     14 view
 2018-10-22         Matthew

Kafka Connect JDBC sink connector not working

I am trying to use Kafka Connect JDBC sink connector to insert data into Oracle but it is throwing an error . I have tried with all the possible configurations of the schema. Below is the examples .Please suggest if I am missing anything below are my configurations files and errors.Case 1- First Configurationinternal.value.converter.schemas.enable=false .so I am getting the[2017-08-28 16:16:26,119] INFO Sink task WorkerSinkTask{id=oracle_sink-0} finished initialization and start (org.apache.kafka.connect.runtime.WorkerSinkTask:233)[2017-08-28 16:16:26,606] INFO Discovered c...

 apache-kafka                     1 answers                     97 view
 2018-10-22         Matthew

Are 32-bit libraries installable on Ubuntu 16.04 for Android development?

I have installed Ubuntu 16.04 but I am stuck because the distribution can not install the 32-bit libraries sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6. My output isReading package lists... DoneBuilding dependency tree Reading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation: The fol...

 ubuntu                     1 answers                     93 view
 2018-10-22         Matthew

Frequent database backup workflow

We've got a database (mysql) driven application which contains business critical information, were looking at building a system that will allow us to backup the db frequently (say every 15 mins) essentially so that we minigate the danger of any data loss. Where torn between two setups :Adding a backup jobs too a queue every 15 mins on a cron and storing these backups on another server. (To save space we would then delete most of these backups after 3 days, but keep the 06:00, 12:00, 18;00 hour versions.)or Is there a RAID like setup were all our data will be automatically c...

 mysql                     2 answers                     5 view
 2018-10-22         Matthew

@NotNull is not validating and not Producing correct Result in Spring Framework

I have created a simple Application that checks whether the given first name and lastname is null or not . i have used @NotNull annotation to check The code for the Student.java is @NotNull(message = "Name must not be null") private String firstName; @NotNull(message = "Name must not be null") private String lastName;i have also created StudentController.java public String processForm(@Valid @ModelAttribute("student") Student student,BindingResult bindingResult){ //bindingResult is not an annotation if(bindingResult.hasErrors()) { return "error"...

 spring                     2 answers                     76 view
 2018-10-22         Matthew

Push notifications and token device in Swift

I am working on an App that need to know the device token to send notification to the users when they give their authorization.The first time the system ask the authorization for notification. If user say "allow" the system calls for me the method didRegisterForRemoteNotificationsWithDeviceToken and in the body of this method I write in UserDefaults the device token.This is the flow:1) System ask for permission2) in didFinishLaunchingWithOptions (inside AppDelegate) I call this method in my class that manage the Notification Framework: func registerForPushNotifications() ...

 ios                     1 answers                     16 view

Page 1 of 145  |  Show More Pages:  Top Prev Next Last