Flutter Firebase Pagination with Gridview builder

I am making e-commerce app and i have number of documents in my firebase storage, i want to get in bunch of 10-10 data on scroll, if user reach at last documents then again i want to get 10 more data for user. Following are my code for fetching data from firebase: static allProduct(){ return … Read more

uploading file to server in flutter

I want to upload file to server for removing background using api.But the app freeze when I upload image using multipart request and using simple http request gives “Error in removeBg: type ‘MultipartFile’ is not a subtype of type ‘String’ in type cast”.I have also tried using dio but the app again freeze. When debugging,it … Read more

ReferenceError: Cannot access ‘setTimeout’ before initialization

In my code I am trying to do a javascript exercise. On the second line, I’m trying to get the ogTimeout to store a reference to setTimeout function since I will reassign a new definition to setTimeout. However I get the error “ReferenceError: Cannot access ‘setTimeout’ before initialization”. I understand that it’s saying that setTimeout … Read more

Find closest integer with the same weight

I am trying to solve this problem: Write a program which takes as input a nonnegative integer x and returns a number y which is not equal to x, but has the same weight (same number of bits set to 1) as x and their difference is as small as possible. This is my solution: … Read more

Safari: list item number overlaps a floated span

I maintain a website that has interactive inline footnotes that are inserted as a floated <span> element (with float:left) into the paragraphs just after the footnote number. The idea is that they’d naturally be inserted just after the line in which the footnote’s number is placed, but without breaking the line into two lines (hence … Read more

Suggestions to eliminate vanishing gradients in UNET

I defined a (nested) UNET to predict mask images basing on the article: https://arxiv.org/abs/1807.10165 I have 4 outputs at 4 different layers, so that i can compare result for 4 layers. I monitor the gradient using tensor board, found that the gradients is very small (i average the gradients generated from 4 losses). Is there … Read more

Is there a way to shuffle pairs within a list?

I have a pairs of names in a list that I want to shuffle for xgboost. Input: [[‘A1’, ‘B1’], [‘A2’, ‘B2’], [‘A3’, ‘B3’], [‘A4’, ‘B4’], [‘A5’, ‘B5’], [‘A6’, ‘B6’], [‘A7’, ‘B7’], [‘A8’, ‘B8’]] Expecting: [[‘A1’, ‘B1’], [‘B2’, ‘A2’], [‘A3’, ‘B3’], [‘A4’, ‘B4’], [‘B5’, ‘A5’], [‘A6’, ‘B6’], [‘A7’, ‘B7’], [‘B8’, ‘A8’]] I have tried this and … Read more

Laravel trigger event after return response

all. I’m new to stackoverflow and laravel. Currently I’m working on laravel application which is simple ecommerce. all functionalities completed. currently I’m facing small issue, which is when placing an order it takes some much time to return success. I figured out that issue from Email notifications. I’ve 3 email to send when order created … Read more

ClientToken getting UNDEFINED?

I want to generate clientToken by braintree but I’m getting UNDEFINED….. var braintree = require(“braintree”); // generate client token code export const braintreeToken = (req, res) => { gateway.clientToken.generate({}, function (err, response) { if (err) { res.status(501).send(err); console.log(“hello”); } else { res.send(response.clinetToken); } }); }; Braintree API KEY var gateway = new braintree.BraintreeGateway({ environment: braintree.Environment.Sandbox, … Read more