on-internet

A lot of white space between items of a flat list in react native

I am trying to create a flat list in react native that displays an image as many times as the length of an array called "bools" (later, I will also display contents of bools in the flatlist). While I am able to create and display the flatlist, there is a lot of space between each item and above & below the first and last items, respectively. I can’t remove top and bottom margins completely because I want to add other elements above and below the flatlist. Other than this, I have tried every possible thing I could find online, but nothing is working. Flat List: <View style={{ marginTop: "10%",

Join the discussion →

Getting java.lang.SecurityException: Unsupported path. But I am asking for permissions

I am downloading files using DownloadManager to a directory, that isn't apart of my "local packages" directory, i.e. outside /storage/emulated/0/Android/data/myPackageName/, but part of another directory's package, more specifically, obb directory, /storage/emulated/0/Android/obb/otherPackageName/ If I install on "my package's directory", no problem, if I got outside of it, I get a "java.lang.SecurityException: Unsupported path /storage/emulated/0/Android/obb/otherPackageName/fileName.obb" I have my permissions in the android manifest, WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, and I check

Join the discussion →

Trying to mod MC Forge 1.12.2, but SetupDecompWorkspace not working

I am trying to make a mod for Minecraft Forge 1.12.2, mdk file forge-1.12.2-14.23.5.2854-mdk. Problem is, when i right-click inside this folder, open Powershell and run the ./gradlew setupDecompWorkspace eclipse command, it comes up with an error log: forge-1.12.2-14.23.5.2854-mdk> ./gradlew setupDecompWorkspace eclipse To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradlDaemon will be stopped at the end of the build stopping after processing FAILURE: Build failed with an exception. What went wrong: A problem occurred configur

Join the discussion →

Apache Cloudstack Console Proxy access via API

I make use of the cloudstack API, to integrate into a 3de party portal. I would like to access the console proxy via the API, cant find the API methods to do so. Ie get the session token for the specific virtual machine and open up the ajax window from our 3de party portal. The management server should expose the Console Proxy to use via the API, then I assume you should acquire a token based on login credentials, or via the API for the specific Virtual Machine you have access to. If someone done this before, would be appreciated to share some detail related to this request.

Join the discussion →

Ansible playbook to copy files from git repo to remote server

I am trying to copy a few files from a git repository to a remote server. since the changes will be made often to these files, the files are placed in git, and from git, I am trying to copy it to the remote servers. I am trying something like this, but the git repo I am accessing is a protected one and I have the creds. I would like to know how do I pass on the username and password here. How do I achieve it? - name: Clone git to a local server git: repo: https://github.com/blah/blah.git dest: /my/laptop/var/tmp/ Once I have those files in the controller server, from there I can copy files to

Join the discussion →

How to run docker in docker in Gitlab ci?

I have /etc/gitlab-runner/config.toml [[runners]] name = "My Docker Runner" url = "###" token = "###" executor = "docker" pre_clone_script = "git config --global http.sslVerify false" [runners.custom_build_dir] [runners.docker] tls_verify = false image = "tiangolo/docker-with-compose" privileged = true disable_entrypoint_overwrite = false oom_kill_disable = false disable_cache = false volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"] shm_size = 0 [runners.cache] Insecure = false [runners.cache.s3] [runners.cache.gcs] .gitlab-ci.yml stages: - test before_script: - apk update - a

Join the discussion →

Cannot replace a normal View with a Late Binding View in Redshift

I am trying to create a VIEW in Redshift but getting error messages. Can someone please help me to resolve this? Example: CREATE OR REPLACE VIEW medaff_smrtsrc.DMN_STATUS as SELECT DISTINCT dense_rank()over(order by cs.status,cs.sub_status asc) as STATUS_SID, CASE WHEN CS.STATUS IS NULL THEN 'Unspecified' ELSE TRIM(cs.STATUS) END as STATUS, CASE WHEN CS.SUB_STATUS IS NULL THEN 'Unspecified' ELSE TRIM(cs.SUB_STATUS) END as SUB_STATUS, 'sysdate' as T_INSERT_DT,'ETL' as T_INSERT_USER FROM medaff_ref_spectrum.CASE CS WHERE CS.STATUS IS NOT NULL; Failing with: Error - 0A000: External tables are not

Join the discussion →

Residual standard error of a regression in python

Does anyone know a command or a way to obtain the residual standard error of a regression or standard error of a regression? I use the following commands to get the coefficients and the R-squared, I would like to learn one command like these for the standard error of the regression: #For the coefficients: model = smf.OLS(y, X).fit() print(model.params) #For the R-squared: model = smf.OLS(y, X).fit() print(model.rsquared) I will be really grateful to the person that can help me with this issue.

Join the discussion →

Unexpected end of JSON input while parsing

I tried to reinstall one of my old vue projects on my new computer (on Windows 10) with npm but I came across this error : npm ERR! Unexpected end of JSON input while parsing near '...n":"0.8.1","devDepend' npm ERR! A complete log of this run can be found in: npm ERR! C:\tmp\empty-npm-cache\_logs\2020-08-09T15_45_53_395Z-debug.log Here's the log file : 0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'install' 1 verbose cli ] 2 info using [email protected]

Join the discussion →

Extract public interface of a class

Is there a mapped type that lets you extract the public properties and methods of a TypeScript class into an interface? It would look like this: class Foo { private x: number; public y: number; bar(a: number) {} private baz() {} } type FooPublic = PublicInterface<Foo>; In this example, FooPublic would have the property y and the method bar(), but would not have private x or private baz(). The closest I have come is: type PublicInterface<T> = {[K in keyof T]: T[K]}; However, this doesn't appear to correctly type the methods. I get no error if I say: const example: PublicInterface<Foo> = { y: 5,

Join the discussion →

Using Javascript with HTML drop-down select

I am having problems using data from a dropdown list with my JavaScript. I want it to print out on the page based off what is selected, but so far when they select a value, nothing happens. I am new to JavaScript, please help: <form> <select name="abc" id="abc" onChange="check(this.form)"> <option value="a">A</option> <option value="b">B</option> <option value="c">C</option> </select> </form> <script> function check (form){ var letter = document.getElementById("abc"); var userLtr = letter.options[letter.selectedIndex].value; if (userLtr == "a"){ document.write ("You selected A"); } else if(use

Join the discussion →

How do I use getopts with long strings?

I'm using Getopt::Std to process my command line args. My command line args are strings. I have an issue with getopts(), as it works only for single character based opts. As seen below "srcdir" "targetdir" options are mandatory and script should error out if any one of them is missing. "block" is NOT a mandatory option. I don't see %options is being set with the code below, and all my options{key} are NULL. Had I replaced "srcdir" with "s" and "targetdir" with "t", then the below piece of code works. It doesn't work with "-srcdir" "-targetdir" options. What's the best way to address the issue

Join the discussion →

Issues with getopts in perl

I'm using Getopt::Std to process my command line args. My command line args are strings. I have an issue with getopts(), as it works only for single character based opts. As seen below "srcdir" "targetdir" options are mandatory and script should error out if any one of them is missing. "block" is NOT a mandatory option. I don't see %options has is being set with the code below, and all my options{key} are NULL. Had I replaced "srcdir=>s" and "targetdir=>t" then the below piece of code works. It doesn't work with "-srcdir" "-targetdir" options. What's the best way to address the issue I have? U

Join the discussion →

Datepicker Input in Lightning Web Component

I want to any pass date value from Datepicker input of lightning web component to PostingDate variable in LWCcontroller.cls import { LightningElement,api ,track} from 'lwc'; import getInvoiceData from '@salesforce/apex/CustomerRefundLwcController.getInvoiceData'; import getBankAccounts from '@salesforce/apex/CustomerRefundLwcController.getBankAccounts'; import processCustomerRefund from '@salesforce/apex/CustomerRefundLwcController.processCustomerRefund'; export default class CustomerRefund extends LightningElement { @api recordId; /*Sales Credit Id*/ @track invoiceData; @track invoiceLinesDat

Join the discussion →

Questions about byte order during mips traditional 5-stage cpu design

I'm working on developing a traditional MIPS 5-stage pipeline cpu using verilog on a FPGA platform. My reference material shows an example with big-endian byte order, while I decide to develop a little-endian cpu. My question is whether there will be difference when decoding instructions or loading/storing data and what is it specifically? I used two X-compilers which are little endian and big endian respectively to compile a piece of sample assembly code as follows: At the center is the big endian translation with little endian on the right and original assembly code on the left. Obviously ,

Join the discussion →

What kind of simple typo would change the course of the history the most?

Obviously the cases where the importance of a message or data is acknowledged, the relevant people would probably triple-check it several times, so something like "wrong latitude/longitude coordinate in a nuclear warhead during a training exercise" is not allowed. I was originally thinking of a case where the person making the typo was one of very few people who know what is supposed to read. Or at some point of history a translator or a copier made a typo. But since I'm struggling to think of an example, I'm not restricting it into such a scenario.

Join the discussion →

Python type hint for undefined values to distinguish from None

I want to create a function signature where an undefined value and None are distinct from each other. So e.g.: undefined = object() def update(id: str, title: str = undefined, description: str): data = { "title": title, "description": description, } # remove undefined key-value pairs from data for key in data.keys(): if data[key] is undefined: del data[key] # send data to the server for further processing Obviously this way I get conflicting types and the following error: Incompatible default for argument "description" (default has type "object", argument has type "str") From the above example

Join the discussion →

Client side routing not working in Next.js

I have the following pages; pages/_app.js pages/_document.js pages/index.js pages/order.js pages/discover/[categoryId].js Here is the order page. The client side routing only changes the url but not the content of the page. If I refresh the page I get the last content. So the server side routing works but the client side routing only changes the url and not the content. import React from "react"; import Head from "next/head"; import Link from "next/link"; export default function Order() { return ( <> <Head> <title>Orders</title> </Head> <div> <p>Put orders here</p> <Link href={"/"}> <a>Home</a

Join the discussion →

value turned const in lambda capture?

I have this simple code: std::shared_ptr<std::string> s; auto bla = [s]() { s.reset(); }; What I meant this to do is that the shared_ptr be captured by the lambda and then reset once the lambda is called. Compiling this with VS yields the following error: error C2662: 'void std::shared_ptr<std::string>::reset(void) noexcept': cannot convert 'this' pointer from 'const std::shared_ptr<std::string>' to 'std::shared_ptr<std::string> &' 1>...: message : Conversion loses qualifiers What gives? How come the shared_ptr turns to const shared_ptr?

Join the discussion →

Unable to open step output file for one job only

I have several SQL Server Jobs which successfully write the output of the job to a local drive on the server. I created a new job today using the exact same path, the job is succeeding but I get the message [SQLSTATE 01000] (Message 0) Unable to open Step output file. The step succeeded and there is no file created or written to. I changed the output to a different directory and it works fine. I am really confused how one job works fine writing to the same directory, yet another doesn't, especially when I created both jobs myself. Both jobs are executed by the same Service Account and have the

Join the discussion →

How to use new Instagram Graph or Basic Display API to fetch profile image of a normal user (as of 29 June 2020)

The former Instagram API (completely removed on 29 June 2020) allowed requesting the avatar URL of a normal user, but the 2 new APIs (Graph and Basic Display) no longer provide this. The Instagram Graph API does provide the profile_picture_url field but ONLY for Business or Creator accounts. On a production server, if you try to scrape an Instagram page or use the https://www.instagram.com/USERNAME/?__a=1 URL, your requests will eventually start getting redirected to the login page. How do you grab the profile photo now? Extra: I've noticed these four sites managed to grab not only the profile

Join the discussion →

How to convert HTML to JSX (React.js)

<!DOCTYPE html> <html> <body> <script crossorigin src="https://unpkg.com/@daily-co/daily-js"></script> <script> callFrame = window.DailyIframe.createFrame(); callFrame.join({ url: 'https://your-team.daily.co/hello' }) </script> </body> This code is trying to display a video function by embedding. I need to convert this to jsx to add it to my webpage or find another way to create a video call using react.

Join the discussion →

Laravel assertDatabaseHas in phpunit test is not working

I have the following code: /** @test */ public function it_updates_customer_status_to_deactivated_for_admin_users() { $this->hubAdminUser = factory(User::class)->state('admin')->create(); $this->customer = Customer::first(); $this->customer->status_id = 2; //active $this->customer->save(); // this will update status_id to 3 $this->actingAs($this->hubAdminUser) ->patch(route('hub.customer.updateStatus', $this->customer)) ->assertRedirect(); $this->assertDatabaseHas('tenants', [ 'id' => $this->customer->id, 'status_id' => 3, //deactivated ]); } The ->patch(route('hub.customer.updateStatus', $thi

Join the discussion →

Fetching Lighthouse metrics Data for large count of urls without using API key on Python

I am trying to capture the lighthouse metrics data for 7k urls using Google Page speed insights API without using API key. I have created a python script to execute this process. I am able to capture first 1000 urls data using this method. Python script runs for all 7k urls without any error but stops writing the data after 1000 urls. Do I require API key or some permissions to execute this process for large set of URLs?. is there any pre requirements to fetch 7k urls data. I have even included multithreading in the python script to speed up the process. Following is the python script: start =

Join the discussion →

Image not loading in react native having bearer token authentication

I am having my images on a secure server. For authentication, I should provide a bearer token. If I pass it using the below format I am getting a blank image. <Image source={ { uri: 'https://yourdomain.com/get-image', headers: { Authorization: 'Bearer xyz' } } }/> When I have checked error code onError prop in Image source it has "nativeEvent": {"error": "Unexpected HTTP code 403"} I have tested the request in postman it is working without any issues.(I am able to see the image) The token is valid. Edit1: Sending an XMLHttpRequest and taking the byte array and converting it into Base64 works j

Join the discussion →

Chrome 84 Inspect element, find results not highlighted in yellow like before

As per usual when making automated tests I use "Inspect"(CTRL+SHIFT+I) in Chrome to find element by xpath, id, CSS selector etc. For example: //li/a[contains(text(), "Products")] Above is an xpath from this page. In previous versions of Chrome in "DevTools"/"Elements" after pressing CTRL+F to open the "Find" option and pasting this xpath element is highlighted in DevTools window. In new version of chrome it is not highlighted, the usual "1/1" results is displayed in far right of the "Find" tab. I've search the internet and Chrome Settings but to no avail.The yellow highlight is time saver and

Join the discussion →

Rearranging Expression to a Standard Form for Transfer Function

I'm a newcomer to Python/Sympy and I'm hoping it can make life easier understanding control system topics. A common requirement for me is to cross-check equations developed in the literature against my own derivations. When it comes to transfer functions, the denominator is typically ordered with the higher orders of s on the left, with order decreasing moving to the right. The highest order s term has a unity coefficient. Here's an example (taken from here): I've developed my own transfer function using sympy and I'd like to rearrange it in the fashion just described. import sympy as sp from

Join the discussion →

How do I get the Value of Tkcalendar/Date Entry

I am building a GUI where it should be possible to insert your name and your brthday that get´s stored in a sqllite3 database. I use the Tkcalendar module to let the person choose it´s birthday. My problem is I don´t know how to read out the Date. import sqlite3 verbindung = sqlite3.connect("Datenbanken/geb3.db") zeiger = verbindung.cursor() zeiger.execute("""CREATE TABLE IF NOT EXISTS people3(vorname VARCHAR(20), nachname VARCHAR(30), geburtstag DATE );""") from tkinter import * from tkcalendar import Calendar, DateEntry root = Tk() def speichern(): zeiger.execute("""INSERT INTO people3 VALUE

Join the discussion →
Older stories