on-internet

How to control the behaviour of lintr in Visual Studio Code?

Switching from Rstudio to VS Code. Biggest problem right now: the linters are constantly bothering me! Take the snippet as an example: object_name_linter is trying to make me name my variable as group_markers instead of group.markers. However, in the R community, it's rather common to see . within variable names. I couldn't figure out a good way to turn off this linter.

Join the discussion →

Filtering on a condition using the column names and not numbers

I am trying to filter a text file with columns based on two conditions. Due to the size of the file, I cannot use the column numbers (as there are thousands and are unnumbered) but need to use the column names. I have searched and tried to come up with multiple ways to do this but nothing is returned to the command line. Here are a few things I have tried: awk '($colname1==2 && $colname2==1) { count++ } END { print count }' file.txt to filter out the columns based on their conditions and head -1 file.txt | tr '\t' | cat -n | grep "COLNAME to try and return the possible column number related to

Join the discussion →

Sports tournament schedule with changing pairs

Lets imagine there are 8 players attending to beach volley event. Matches are played 2 vs 2. As organiser i want to generate schedule for players with the following rules: each player plays together with everyone (7 matches for each player) each player plays twice against each player So the schedule would start for example: round 1 player1 + player2 vs player3 + player4 player5 + player6 vs player7 + player8 round2 player1 + player3 vs player2 + player5 player4 + player7 vs player6 + player8 round3 player1 + player4 vs player2 + player3 player5 + player8 vs player6 + player7 etc With the examp

Join the discussion →

_batch_encode_plus() got an unexpected keyword argument 'return_attention_masks'

I am studying RoBERTA model to detect emotions in tweets. On Google colab. Following this Noteboook file from Kaggle - https://www.kaggle.com/ishivinal/tweet-emotions-analysis-using-lstm-glove-roberta?scriptVersionId=38608295 Code snippet: def regular_encode(texts, tokenizer, maxlen=512): enc_di = tokenizer.batch_encode_plus( texts, return_attention_masks=True, return_token_type_ids=False, pad_to_max_length=True, #padding=True, max_length=maxlen ) return np.array(enc_di['input_ids']) def build_model(transformer, max_len=160): input_word_ids = Input(shape=(max_len,), dtype=tf.int32, name="input

Join the discussion →

Cannot use import statement outside a module in node.js

I was working on the project on model.js file, then after that I need to import model.js file to Shareplace.js file. But after that the problem occurs into the console browser "Cannot use import statement outside a module". This is my Shareplace.js file code: import {modal} from '../src/UI/modal'; class PlaceFinder { constructor() { const AddressForm = document.querySelector('form'); const locateUserButton = document.getElementById('locate-btn'); locateUserButton.addEventListener('click',this.locateUserHandler); AddressForm.addEventListener('submit',this.findAddressHandler); } locateUserHandle

Join the discussion →

Failed to establish a new connection: [Errno 11001] getaddrinfo failed' in Python 3.9

This script is used to send data to a 3rd party. It seems to run fine when connected to any network other than my work network. When connected to my work network, it will run for a few minutes, PUT/POSTing as it should, and then suddenly the following error will appear: Traceback (most recent call last): File "C:\Users\user\AppData\Local\RPackages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\urllib3\connection.py", line 169, in _new_conn conn = connection.create_connection( File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation

Join the discussion →

How to use session variables in ASP.NET Core 3.1 MVC using C#

I'm having trouble with session objects. To set and get inside the same controller will work fine, my trouble is to use the info saved in the session in another controller, it doesn't work for me, every time I get a null value. I used to code PHP, I just needed to start session and get the values. No idea how to do it in ASP.NET Core 3.1 MVC. using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using partner2.Data; using partner2.Helpers; using partner2.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace partner2.Contro

Join the discussion →

Deprecated APIs should be marked accordingly in the Swagger UI

Feature Request Today it is possible to version APIs and most things around that work perfectly fine with Swagger. What I am really missing here is the possibility to make it transparent for any Swagger UI users that an API version has been marked as deprecated. API deprecation in aspnetcore is described here. My expectation would be to have an icon or a tag which says "OBSOLETE" or "DEPRECATED" next to the API group name. On a side note: The Swashbuckle Swagger ASPNET.Core github project issue tracker advised to open feature requests on SO. Edit: The whole Controller is marked as deprecated u

Join the discussion →

Understanding an issue reported by valgrind

I consistently get this trace shown by valgrind. This is an aarch64 system. I want to know if there is anything I can do within my limits to fix this problem, as explained below - Invalid read of size 8 is at lh_delete by ERR_remove_thread_state (in libcrypto) by soap_free (in gsoap) ? There is no relation as far as I know between these two. Invalid read by a function in libcrypto, attempts to read 8 bytes that has been freed again by libcrypto. Block itself was also allocated by libcrypto. I have been reading about issues with the version of libcrypto I have. https://curl.se/mail/lib-2016-08/

Join the discussion →

How to call function after page fully loaded in Angular?

I am trying to invoke a function on particular route after page loaded fully, like if user logged in and come to main page route first, and it loaded successfully a function will invoke/call by itself. constructor( private router: Router) { this.router.events.subscribe((event: Event) => { if (event instanceof NavigationEnd) { console.log(router.url); //function writes here } }); } I am calling this function on main.ts but when user trying to logged in this function invokes why ?

Join the discussion →

Please enter the correct Email and password for a staff account. Note that both fields may be case-sensitive

I complete makemigrations and migrate then create a superuser. After this http://127.0.0.1:8000/admin i try to log in then show this error Please enter the correct Email and password for a staff account. Note that both fields may be case-sensitive seetings.py AUTH_USER_MODEL = 'user.CustomUser' **models.py** from django.db import models from django.contrib.auth.models import AbstractUser,BaseUserManager class CustomUserManager(BaseUserManager): """ Creates and saves a User with the given email, date of birth and password. """ def create_user(self, email, password=None): if not email: raise Val

Join the discussion →

Bullmq get a job with a specific ID from a queue

I am trying to create a results queue on BullMQ where all workers can send results adding jobs with special crafted jobIDs. The idea is that all results arrive with a specific jobID generated so that I known exactly which process the result is for. I've tried with getNextJob as described in the documentation, with no luck. The solution I found is using the queuEvents: each process registers a listener on the waiting state of the results queue and, when the job with the id It needs arrives, the process gets the job with a getJob, reads the result data and tries to move the job to completed. It

Join the discussion →

Module build failed using css-loader while trying to import main.css file

I am trying to use node and vue js in the wordpress plugin.I am struck in the css file import.I am trying add css file into the package.json file. importing css file using css-loader. But i am getting the following error. Also can anyone explain how to post-css in this case. package.json { "name": "plugin_toolkit", "version": "1.0.0", "description": "Simple WordPress plugin that uses Webpack.", "main": "index.js", "babel": { "presets": [ "@babel/preset-env" ] }, "scripts": { "dev": "webpack --mode=development --watch --config webpack-config.js", "build": "webpack --mode=production --config web

Join the discussion →

OL Office 365 (Win 10) email circle and border issue

<!--[if mso]> <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.EXAMPLE.com/" style="text-align: center;font-size: 14px;height: 143px;width: 143px;" arcsize="50%" strokecolor="#fbe2a6" strokesize="4px" stroke="f" fillcolor="#f7c54d"> <w:anchorlock/> <center style="color:#ffffff;font-family:sans-serif;font-size:13px;"> <div class="yellow-circle"> <div class="number" style="color: #fff;font-weight: 700;font-size: 24px;line-height: 1;padding-bottom: 2px;">#1</div> <div class="round-title" style="font-size: 11px;font-weight: 700;c

Join the discussion →

An uxexpected error has occured. Conda has created the above report. Upload/ Report not sent

When I updated conda to a recent one, it started showing this long list of unsent report after every command I pass. Here is the text it shows: Traceback (most recent call last): File "C:\Users\Amit\anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in call return func(*args, **kwargs) File "C:\Users\Amit\anaconda3\lib\site-packages\conda\cli\main.py", line 8 4, in _main exit_code = do_call(args, p) File "C:\Users\Amit\anaconda3\lib\site-packages\conda\cli\conda_argparse.p y", line 83, in do_call return getattr(module, func_name)(args, parser) File "C:\Users\Amit\anaconda3\lib\site-p

Join the discussion →

Two-level modelling with lme in R

I am interested in estimating a mixed effect model with two random components (I am sorry for the somewhat unprecise notation. I am somewhat new to these kind of models). Finally, I also want also the standard errors of the variances of the random components. That is why I am somewhat boudn to using the package lme. The reason is that I found this description on how to calculate those standard errors and also interesting, the standard error for function of these variances link. I believe I know how to use the package lmer. I am finally interested in model2. For the model1, both command yield t

Join the discussion →

inject instance of ability using casl library

With the latest version of casl that supports only vue 3, an instance can be created like this: import { ABILITY_TOKEN } from '@casl/vue'; export default { inject: { $ability: { from: ABILITY_TOKEN } } } https://www.npmjs.com/package/@casl/vue how can this be achieved with the previous version of casl plugin for vue?

Join the discussion →

Run a series of post-hoc t-tests ANOVAs in R

I have run a series of ANOVAs that examine the link between group membership and a range of dependent variables, with a dataframe generated containing the results of each ANOVA model (one row = one ANOVA model). I would now like to run a series of post-hoc tests based on a list I've generated of dependent variable-independent variable combinations that survived multiple comparison corrections. I've tried to write a a function that submits each of these DV-IV combinations to pairwise.t.test although my code is currently not working as expected. Please see an extract of this code with simulated

Join the discussion →

Why wrap a `Dialog` in a `FragmentDefinition`?

An UI5 dialog can be defined directly as a Dialog: <Dialog xmlns = "sap.m" id = "helloDialog" title = "Hello {/recipient/name}"> <beginButton> <Button text = "{i18n>dialogCloseButtonText}" press = ".onCloseDialog" /> </beginButton> </Dialog> Or can be wrapped by a FragmentDefinition: <core:FragmentDefinition xmlns:core = "sap.ui.core" xmlns = "sap.m"> <Dialog id = "helloDialog" title = "Hello {/recipient/name}"> <beginButton> <Button text = "{i18n>dialogCloseButtonText}" press = ".onCloseDialog" /> </beginButton> </Dialog> </core:FragmentDefinition> As far as I understand, a FragmentDefinition

Join the discussion →

Automating emails on Google sheets

I am trying to automate sending emails on Google sheets using Mailapp. My problem is the following: I need to include the gmail signature in the email. When using Mailapp, the pre-defined signature on gmail does not appear. Is there any solution for that? The other solution, as I found online, is using HTML. I need to develop the email automation for many users on a single google sheet and need to include Linkedin links. My issue here is that I am not able to assign HTML's 'href' as a variable (variable that is in fact a cell containing the linkedin link. JS: var linkedin_link = SpreadsheetApp

Join the discussion →

Node.js: Import .sql file and use it in query

I'm currently using an ORM for Node, this has worked fairly well in most cases but for more complex applicants I still need to occasionally write SQL. Luckily my ORM has a way to execute SQL queries: orm.execute(`SELECT * FROM "Users"`) Ideally I'd rather not write my SQL inline so I was wondering if it's possible to save my SQL query as a .sql file and then import it into a Javascript/Typescript file so it can be used. import sql from '/my_query.sql'; orm.execute(sql) Is this at all possible?

Join the discussion →

Jest encountered an unexpected token This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript

Facing issue while running Jest test cases in combination of D3 with Jest and angular. Test suite failed to run Jest encountered an unexpected token This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript. By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules". Here's what you can do: • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/en/ecmascript-modules for how to enable it. • To have some of your "node_modules" files transformed, you can specify a custom "trans

Join the discussion →

Create On Delete Cascade on existing Foreign Key

Can we create On Delete Cascade on an existing Foreign Key? I know we can create from SQL design of table going to relationships But I want to do this with the script query? I also not want to drop the foreign key first and then create the foreign key with on delete cascade.

Join the discussion →

Can We Create On Delete Cascade on existing foreign Key

Can we create On Delete Cascade on an existing Foreign Key? I know we can create from SQL design of table going to relationships But I want to do this with the script query? I also not want to drop foreign key first and then create the foreign key with on delete cascade, I not want this.

Join the discussion →

AWS Glue job fails with the error "Command failed with exit code 10"

I get this error message every now and then making the Job very unreliable. On deeper evaluation, and continuous logging, I see the following error: 2021-09-02 10:38:19,810 ERROR [main] glue.ProcessLauncher (Logging.scala:logError(70)): Unknown error from Python: Error Traceback is not available. The above error also does not mention where the issue lies. I am running Glue 2.0 with Python 3 with worker type G.1X. The data being pulled is only 100,000 rows, so this should not be a memory issue at all. The AWS page is very unhelpful with the error. The AWS Glue job fails with the error "Command

Join the discussion →

signal: aborted (core dumped), making a two sum pair from a vector

This is the question I'm trying to solve: Write findTwoSumPair, which takes in a vector of integers and a target sum, and returns a pair that represents two distinct indices of elements that sum up to the target value (with indexes sorted). There are no explicit time complexity constraints here (i.e. algorithm just needs to work as intended). Also make sure to handle empty input. This is my main: std::cout << "Q3" << std::endl; std::vector<int> q3Input1{0, 2, 3, 4, 5}; std::pair<int, int> q3Out1 = findTwoSumPair(q3Input1, 6); std::pair<int, int> q3Out2 = findTwoSumPair(q3Input1, 10); std::cout

Join the discussion →

Telegram API send message special character

I need to send a URL that contains the special character # through Telegram API post request. I currently use HTML as parse mode. The message to send is something like: <a href='www.example.com/#/otherparams'>inline link example</a> But when I send the message, the substring of the URL from the # to the end is automatically deleted. I tried to encode the # with the related ASCII code %23 and the message is sent correctly. But the when I click on the link, the URL doesn't work. I think there isn't a resolution of %23. If I manually replace the ASCII code in the URL bar of the browser with #, it

Join the discussion →

How to enable tree shaking for next.js?

Is there something to enable to have next.js perform tree-shaking/removal of dead code from dependencies? I've exported two objects like this: library.js export const foo = {foo:"foo"} export const bar = {bar:"bar"} And in my next.js app I do like this: page.tsx import { foo } from 'library'; console.log(foo); So now I'd expect a production-build will not include bar, and indeed something appears to go right because this line is produced: .next/server/chunks/621.js /* unused harmony exports bar */ But confusingly when I load the app in the browser the network-traffic indicates the unused expor

Join the discussion →
Older stories