外文分享

How I Retrieve Data from SQL Server Database hosted on a Web Server in my desktop application?

给你一囗甜甜゛ 提交于 2021-02-20 02:55:06
问题 I have SQL Server Database which is present on some web server.I made a WPF or Windows form Desktop application using C# .Net.I want to retrieve data from sql server database in my desktop application as per end user requirements on its own local PC.Give me best way and best solution regarding security and accessing data. 回答1: You have 2 options. 1. Write the business logic layer which resides on the web-server and communicates with DB to serve the required data based on requests coming from

pyinstaller executable doesn't run in Ubuntu 18.04.1

落花浮王杯 提交于 2021-02-20 02:54:46
问题 I looked through other posts and they didn't seem to address the specific issue where nothing happens when I try to execute a compiled program. Not sure if this is an Ubuntu issue or a python issue... Either way I'm very new to both so I'm sure there's some simple answer to this. I wrote a simple program print("hello") input("now") and used pyinstaller to compile it into a single file. pyninstaller --onefile test.py When I try to run the file by double clicking it in the GUInothing at all

Why does `&value.into_something()` still result in a moved value?

人盡茶涼 提交于 2021-02-20 02:54:27
问题 I'm struggling to see how this transfers ownership. Here is my code: let res = screenshot::take_screenshot(0); let file = File::open("test.png").expect("Failed to open file"); let encoder = PNGEncoder::new(file); encoder.encode(&res.into_raw(), res.width(), res.height(), ColorType::RGBA(0) ); screenshot::take_screenshot is a function that returns an ImageBuffer<Rgba<u8>, Vec<u8>> . Here is the compiler error I'm getting: error[E0382]: use of moved value: `res` --> src/main.rs:21:37 | 21 |

R Error: First argument, `data`, must be a data frame or shared data

社会主义新天地 提交于 2021-02-20 02:53:52
问题 I am using the R programming language. I am following this tutorial over here: https://plotly.com/r/dropdowns/ I tried to create my own data and run the same procedure: library(plotly) library(MASS) library(dplyr) # create data x <- sample( LETTERS[1:4], 731, replace=TRUE, prob=c(0.25, 0.25, 0.25, 0.25) ) y <- rnorm(731,10,10) z <- rnorm(731,5,5) date= seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") df <- data.frame(x,y, z, date) df$x = as.factor(df$x) #create plot fig <- plot_ly(df, x

Node.js API with express & mysql - Getting record count, page number, … & provide pagination

醉酒当歌 提交于 2021-02-20 02:53:29
问题 I would like to get and provide the total total_record_count, page_number, page_size, total_pages, has_more information in the response and being able to paginate through the result since I LIMIT the query to 100. What's the best way to do this? That's my current setup: router.get('/?', function(req, res, next) { const sql = "SELECT * from users "; const existingParams = ["title", "active"].filter(field => req.query[field]); if (existingParams.length) { sql += " WHERE "; sql += existingParams

Big Sur Update Leads to Multiple Load Error Rails Ruby

你离开我真会死。 提交于 2021-02-20 02:53:29
问题 After updating to Big Sur, my ruby (2.6.3) on rails (5.2.1) application repeatedly has LoadError when running rails s or rails db:migrate . I have tried uninstall and reinstall rails multiple time but it will only work 1 or 2 times before encountering LoadError again. Here are some samples of the errors (Note that they are different) /Library/Ruby/Gems/2.6.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require': cannot load such file -- new_relic/agent/instrumentation

Node.js API with express & mysql - Getting record count, page number, … & provide pagination

白昼怎懂夜的黑 提交于 2021-02-20 02:53:08
问题 I would like to get and provide the total total_record_count, page_number, page_size, total_pages, has_more information in the response and being able to paginate through the result since I LIMIT the query to 100. What's the best way to do this? That's my current setup: router.get('/?', function(req, res, next) { const sql = "SELECT * from users "; const existingParams = ["title", "active"].filter(field => req.query[field]); if (existingParams.length) { sql += " WHERE "; sql += existingParams

How can I link IBM Watson Assistant with Watson Discovery

梦想的初衷 提交于 2021-02-20 02:53:07
问题 I wish to make a chatbot using the two services listed in the title. Watson assistant is used to make the dialog for the chatbot while watson discovery allows for finding information in a large variety of documents such as .html, .pdf files. I want to make a chatbot that uses these two services. The way the chatbot would work is that when a user says something into the chatbot, it will go through watson discovery and run that query which will then return results back to the user. I currently

Big Sur Update Leads to Multiple Load Error Rails Ruby

◇◆丶佛笑我妖孽 提交于 2021-02-20 02:52:49
问题 After updating to Big Sur, my ruby (2.6.3) on rails (5.2.1) application repeatedly has LoadError when running rails s or rails db:migrate . I have tried uninstall and reinstall rails multiple time but it will only work 1 or 2 times before encountering LoadError again. Here are some samples of the errors (Note that they are different) /Library/Ruby/Gems/2.6.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require': cannot load such file -- new_relic/agent/instrumentation

PHP/MYSQL: Database Table For Email Notifications

这一生的挚爱 提交于 2021-02-20 02:52:49
问题 I want to notify users of changes on a site. Users are subscribed to different kinds of changes so I don't send all changes to all users. Here's what I am thinking: at t=0 (i.e. an if statement that checks that some table is empty) I basically have an SQL query that fetches the appropriate changes and mails to the appropriate users. I then populate a user_changes table which essentially stores what changes have been mailed to what users. Mailing is done with the php mail function Then at t>0