on-internet

Is there a way to convert Future> to List?

Edit: Home Page - I'm fetching a list of strings from my firebase collection. I then want to make a call to firestore storage and get the downloadable image link and store it in a list that I will pass to Page 2. The code below is how i'm getting the downloadable links. Future<List<String>> test(List images) async{ List<String> listOfImages = List<String>(); for(int i = 0; i < images.length; i++){ final ref = FirebaseStorage.instance.ref().child(images[i]); var url = await ref.getDownloadURL(); listOfImages.add(url); } return listOfImages; } I'm then passing the list of Images in the following

Join the discussion →

Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway

I already went Why does springfox-swagger2 UI tell me "Unable to infer base url." and Getting an unexpected result while configuring Swagger with Spring Boot and not using Spring Security at all and for each service, I am using @EnableSwagger2 annotations. I'm following tutorial from link: https://dzone.com/articles/quick-guide-to-microservices-with-spring-boot-20-e and using gateway-service for the project to run instead of proxy-service. gateway-service.yml server: port: 8060 eureka: client: serviceUrl: defaultZone: http://localhost:8061/eureka/ logging: pattern: console: "%d{yyyy-MM-dd HH:m

Join the discussion →

Trazer última data do Produto SQL

Estou realizando a seguinte consulta para trazer os produtos com a última data de venda deles: SELECT P.ID AS 'Código', p.Nome, CONVERT(decimal(18,2),pe.Valor_Custo) as 'Custo', CONVERT(decimal(18,2),pe.Porcentagem) as 'Mark-up', CONVERT(decimal(18,2),pe.Valor_Venda) as 'Venda', e.Quantidade as 'Estoque', (SELECT DISTINCT TOP 1 DATA FROM Venda left join Venda_Item_Produto vip on vip.ID_Produto = p.ID WHERE VENDA.Data BETWEEN '2018/01/16' AND '2019/01/16' AND vip.ID_Produto = p.ID ORDER BY Data DESC) AS 'Data Última Venda' FROM Produto P left join Produto_Empresa pe on pe.ID_Produto = p.ID left

Join the discussion →

Looping instances in hierarchical path

I am trying to load a text file (256 lines with 32 binary values) in register. But, my registers are designed hierarchically, so I am trying to to do the following loop: reg [31:0] data [0:255]; initial $readmemb("vectors.txt", data); generate for (j=0; j<32; j=j+1) begin: BLOCK assign ITR_MAC_AF.IAF.IREG3_31_.IREG2_7_.IREG[j]=data[0]; end endgenerate But, it doesn't like it is looping through instances. Is there any fix for this? I have 32 IREG_3 instances, each IREG3 has 8 IREG2 and each IREG has 32 latches inside them.

Join the discussion →

Can I change the datatype of the Spark dataframe columns that is being loaded to SQL Server as a table?

I am trying to read a Parquet file from Azure Data Lake using the following Pyspark code. df= sqlContext.read.format("parquet") .option("header", "true") .option("inferSchema", "true") .load("adl://xyz/abc.parquet") df = df['Id','IsDeleted'] Now I would like to load this dataframe df as a table in sql dataware house using the following code: df.write \ .format("com.databricks.spark.sqldw") \ .mode('overwrite') \ .option("url", sqlDwUrlSmall) \ .option("forward_spark_azure_storage_credentials", "true") \ .option("dbtable", "test111") \ .option("tempdir", tempDir) \ .save() This creates a table

Join the discussion →

Unity C# Mobile Control Swipe Left Right

I made a 3d game with Unity and C#. I don't know how to make a object (player) control to left and right with swipe on mobile screen. That's my C# code: using UnityEngine; public class PlayerMovement : MonoBehaviour { public Rigidbody rb; public float forwardForce = 300f; public float sidewaysForce = 200f; // Update is called once per frame void FixedUpdate() { rb.AddForce(0, 0, forwardForce * Time.deltaTime); if (Input.GetAxis("Horizontal") > 0.1) { rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0); } if (Input.GetAxis("Horizontal") < -0.1) { rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0)

Join the discussion →

Can't use @Async in spring boot

I want to use spring boot's Asynchronous mechanism, here is my code. @Slf4j @Configuration @EnableAsync public class AsyncConfig implements AsyncConfigurer { private static final int MAX_POOL_SIZE = 50; private static final int CORE_POOL_SIZE = 20; @Override public Executor getAsyncExecutor() { ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); taskExecutor.setBeanName("taskExecutor"); taskExecutor.setMaxPoolSize(MAX_POOL_SIZE); taskExecutor.setCorePoolSize(CORE_POOL_SIZE); taskExecutor.setThreadNamePrefix("async-task-thread-pool"); taskExecutor.setWaitForTasksToCompleteOnShut

Join the discussion →

Chrome Extension message passing: Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist

My chrome extension has the following two javascripts: background.js, running as background script: chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { if (message.data == "takeScreenshot") { var resp = sendResponse; chrome.tabs.captureVisibleTab(function(screenshotUrl) { resp({ screenshot: screenshotUrl }); }); return true; // Return true to tell that the response is sent asynchronously } else { return "TestReply"; } }); api.js, running as web accessible resource: window.takeScreenshot = (function() { var isTakingScreenshot = false; // Semaphore return function() {

Join the discussion →

MariaDb does not support ANY_VALUE() function

I have a laravel project which is connected to mysql db, when I change my server, my codes got failed because my new server has a Mariadb, when I checked my logs, I have realised that, there is some unsupported function from MariaDb which is ANY_VALUE(), how can I edit my sql according to MariaDb ? select(DB::raw('SUM(price) as price, SUM(price_now) as price_now, ANY_VALUE(price_available) as price_available'),'adult_count') error log

Join the discussion →

how to support inline comments when using eslint-prettier/prettier?

i want to turn off the rule in prettier where it newlines an inline comment. my ESLint rule no-inline-comments is set to off or warn, so that is taken care of and works. turns out Prettier still wants to newline and inline comment: i have a setup in my VSCode where ESLint is handling prettier for JS and the Prettier extension is handling all the other languages. im also using the airbnb-base. here are my relevant configs: .eslintrc.json: { "extends": ["airbnb-base", "plugin:prettier/recommended"], "rules": { "no-console": 0, "no-plusplus": 0, "no-inline-comments": "off", "no-undef": "warn", "n

Join the discussion →

How do I implement and use a low-level keyboard hook in Unity to disable Windows shortcuts?

How do I implement and use a low-level keyboard hook in Unity to disable Windows shortcuts? I would like to prevent the user being able to lose focus of my game through accidental use of the Windows key. This is because my application is designed for toddlers who can press the keyboard quite randomly. From searching stack overflow it seems that I need to implement a low-level keyboard hook. What I have tried The below has been implemented in Unity. When pressing the print screen button it should turn the background color of my application black proving that I have implemented it correctly. How

Join the discussion →

Is there any suggestions to monitor results for store and load instructions implemented using Data Memory?

I am having difficulty in getting the Load and store instructions implemented in my processor. I have successfully implemented ALU RegisterFile; now I want to add A Data Memory and Upgrade the Control unit. I don't have yet implemented the instruction Memory. So instructions are hard coded in InstructionReg as 32 bits. I want check whether load and store instructions work properly. So i monitored data_write, data_read and toReg with the changes in the clock. But i don't get results. Can you please help me with any error in the code, or can you suggest any method to do this? My results: executi

Join the discussion →

Why is .Net Framework 4.7.2 "not supported on this operating system"? (Windows 10)

I was trying to install the .NET 472 developer pack on a Windows 10 machine, and got this error. I have been able to install this on other Win10 PCs, and also on Win7. So it doesn't make any obvious sense why it claims to be "not supported". In the log there are some version checks: Bundle condition evaluated to false: ((VersionNT = v6.1 AND ServicePackLevel >= 1) OR (VersionNT = v6.2 AND NOT (OSInstallationType = "Client")) OR (VersionNT = v6.3) OR (VersionNT = v10.0 AND OSBuildNumber >= 14393) OR (VersionNT > v10.0)) but that doesn't clearly indicate (to me) what I need to do to resolve the

Join the discussion →

How to understand sample_weight in sklearn.metrics?

Do we need to set sample_weight when we evaluate our model? Now I have trained a model about classification, but the dataset is unbalanced. When I set the sample_weight with compute_sample_weight('balanced'), the scores are very nice. Precision:0.88, Recall:0.86 for '1' class. But the scores will be bad if I don't set the sample_weight. Precision:0.85, Recall:0.21. Will the sample_weight destroy the original data distribution?

Join the discussion →

How to Enable SSL Certificate for my website?

I am new here. My website is LifelineFoundations and I haven't enabled SSL for this website. Would someone please help me out and tell me the information regarding how to enable SSL certificate for my website, and in case if I won't enable it what would be the penalties I have to face?

Join the discussion →

What do `include and `define mean?

I'm new to SystemVerilog, and I'm going through a .svh file. In he file, there are lines that state the use of `include , `define and sometimes even `ifndef, for example: `include "file.v" and also `define CHECK_B What does the tick mean, and what does each of them do?

Join the discussion →

Assembly x86 check if 3 values can form a triangle

I have to do this problem where I have the sides and I have to check if they can form a triangle. Now I have this code but I don't know why I get both of the messages.I am new to the assembly language. .model small .stack 128 .data a dw 1 b dw 20 c dw 3 msg1 db 'The sides can form a triangle$' msg2 db 'The sides cannot form a triangle$' .code mov AX, @data mov DS, AX MOV AX,a add AX,b mov bX,b add bX,c mov cX,a add cX,c CMP AX,c JAE L1 mov dx, offset msg2 mov ah,9 int 21h L1: CMP bX,a JAE L2 mov dx, offset msg2 mov ah,9 int 21h L2: CMP cX,b JAE L3 mov dx, offset msg2 mov ah,9 int 21h L3: mov d

Join the discussion →

Filter HDF dataset from H5 file using attribute

I have an h5 file containing multiple groups and datasets. Each dataset has associated attributes. I want to find/filter the datasets in this h5 file based upon the respective attribute associated with it. Example: dataset1 =cloudy(attribute) dataset2 =rainy(attribute) dataset3 =cloudy(attribute) I want to find the datasets having weather attribute/metadata as cloudy What will be the simplest approach to get this done in pythonic way.

Join the discussion →

Photo requirements for Vietnam e-visa application

Can you take your own photo if it meets the requirements rather than getting passport photos? The application asks for a scan of your passport and an additional image where you are not smiling, no glasses, white background. Does this have to be done by a passport photo company or can you take your own photo?

Join the discussion →

Getting error An expression of type 'void' cannot be tested for truthiness angular 7

ERROR in node_modules\@ng-bootstrap\ng-bootstrap\datepicker\datepicker-navigation.d.ts.NgbDatepickerNavigation.html(3,67): : An expression of type 'void' cannot be tested for truthiness node_modules\@ng-bootstrap\ng-bootstrap\datepicker\datepicker-navigation.d.ts.NgbDatepickerNavigation.html(25,67): : An expression of type 'void' cannot be tested for truthiness when i am using ng build --prod i am getting this error

Join the discussion →

Use @Pattern to validate UUID or UUID.toString()

As we know, @Pattern annotation can only be used for implementation of CharSequence, such as String. Thus the following validation on UUID won't work. @Pattern(regexp="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$") private UUID id; Is there a way to use @Pattern annotation directly on UUID or based on UUID.toString()? THE ACTUAL SCENARIO: public class IndexController { ... public ResponseEntity<Void> postIndexes(@ApiParam(value = INDEXES_DESC, required = true) @Valid @RequestBody @Size(min = 1, max = 2000) List<Index> indexes) { ... } ... } @JsonInclude(JsonInclude

Join the discussion →

The term 'Get-MessageTrackingLog' is not recognized as the name of a cmdlet

I'm using powershell, I just use Get-MessageTrackingLog after login/Authentication $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “https://outlook.office365.com/powershell-liveid/” -Credential $UserCredential -Authentication Basic -AllowRedirection/ . But I'm getting the following error: Get-MessageTrackingLog not recognized as the name of a cmdlet I want to search all emails in a mail box.

Join the discussion →

react-share image not showing when shared

in my all my share-buttons my images are not showing just the url in my my public folder html header <meta content="`%PUBLIC_URL%/${picture.jpg}`"> <meta property="og:description" content='' /> and in my details component i am using react-helmet t dynamically put the title where the share buttons. render() { const { project, auth } = this.props; const shareUrl = window.location.href; const articleId = this.props.match.params.id; const {pathname} = this.props.location; const imageURL = ''; if (project) { return ( <div className="container"> The helmet component <Helmet> <meta charSet="utf-8" />

Join the discussion →

Can I make array2string output without brackets and indentation?

I need to print/write using a fixed format (6 fields at 13.7e). The array I need to print might have 4, 8, 12, or more values. I found np.array2string, which is almost what I need. Is there a way to eliminate the leading and trailing [ and ]? Likewise, is there a way to avoid the indentation on 2nd and following lines? A solution does not have to use array2string, it was just the simplest thing I found to control print/write formatting for ndarray. I am open to any solution. :-) Here is a simple example to demonstrate the behavior I want, and what I get: >>> import numpy as np >>> foo = np.ara

Join the discussion →

Local cloud stack for Azure similar to LocalStack for AWS?

Is there a mocking framework for Azure similar to LocalStack for AWS? Please understand that I am not looking for a SDK mock but a resource stack mock. So much so, that I could replace the configurations of my local Azure stack with actual Azure resources in my project and the functionality would remain just the same. Quite like how it works with Localstack. I have found Azure Cloud Fabric to come closest to this, but it is tightly coupled with Visual Studio IDE.

Join the discussion →

Is there any way to save the trained data in Verilog?

I wish to train a robot about the indoor environment with multiple obstacles. To save the trained data by this, is there anyway in Verilog? This training data should be used by robot while deploying with dynamic data to move from one point to another in the trained indoor environment. What will be the best way of implementation in Verilog?

Join the discussion →

AADSTS70002: Error validating credentials. AADSTS50126: Invalid username or password

Unable to Get the Access token , Grant Type: password URL : https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token?resources=https%3A%2F%2Fgraph.microsoft.com%2F Request: {'grant_type': 'password', 'client_id': <client_id>, 'scope': 'openid User.Read Mail.Read', 'username': '<email_id>', 'client_secret': '<client_secret>, 'password':<password>} Response: {'correlation_id': 'bbe33e96-aeb8-4e8f-8a2f-1330510c298f', 'error_codes': [70002, 50126], 'timestamp': '2018-12-19 06:58:03Z', 'error': 'invalid_grant', 'trace_id': 'c69686fb-a84e-4299-a72c-0cf079381300', 'error_description': 'AADSTS7

Join the discussion →

Get the city and country name with latitude and longitude (iOS)

I use this function: func getDataCity(tmpLat:Double,tmpLong:Double) { let tmpCLGeocoder = CLGeocoder.init() let tmpDataLoc = CLLocation.init(latitude: tmpLat, longitude: tmpLong) tmpCLGeocoder.reverseGeocodeLocation(tmpDataLoc, completionHandler: {(placemarks,error) in guard let tmpPlacemarks = placemarks else{ return } let placeMark = tmpPlacemarks[0] as CLPlacemark // Country guard let countryLocality = placeMark.country else{ return } // City guard let cityLocality = placeMark.locality else{ return } print(countryLocality) print(cityLocality) }) } When I use coordinates, for example, from B

Join the discussion →
Older stories