Categories
Ask Chemistry

Is there any easy trick to know if a substance is a Brønsted–Lowry acid or base?

I know that Brønsted–Lowry acids can donate a proton and a Brønsted–Lowry base can receive a proton. I have also memorized the strong acids and bases, which makes it easier to figure out. However, if I was given a substance that I didn’t memorize, I would struggle to tell if it is an acid or […]

Categories
Mastering Development

how to make a function parameter in a function without IOSTREAM/CSTDLIB C/C++

i’m creating a basic OS and i have to make code to print a function because i can’t use iostream. here’s the code from the main kernel which is having the problem: printf(t.__GETTIME__()); the printf part is coming up with an error in Visual Studio Code which says no instance of overloaded function “printf” matches […]

Categories
Mastering Development

String.casefold not functioning properly

When attempting to use specific_string.casefold I get an error. Whenever I try to concatenate it onto a string for printing (for testing purposes) I get: test = “test” print(“Lowercase: ” + test.casefold) “TypeError: can only concatenate str (not “builtin_function_or_method”) to str” Whenever I try to use it as a condition for an if statement it […]

Categories
Mastering Development

Issues manipulating data from within a function

I have several data frames structured like this: set.seed(123) dat1 <- data.frame(Region = rep(c(“r1″,”r2”), each = 100), State = rep(c(“NY”,”MA”,”FL”,”GA”), each = 10), Loc = rep(c(“a”,”b”,”c”,”d”,”e”,”f”,”g”,”h”),each = 5), ID = rep(c(1:10), each = 2), var1 = rnorm(200), var2 = rnorm(200), var3 = rnorm(200), var4 = rnorm(200), var5 = rnorm(200)) dat1$ID <- factor(dat1$ID) I am using […]

Categories
Mastering Development

Distribute dates as per equipment’s maintenance frequency with criteria – VBA

Guys I need your assistance on how to develop a code to distribute dates as per maintenance frequency of equipment. Each equipment has a proper plan with a defined frequency. Day(s) Week(s) Month(s) To have a good overview I would like to see the behaviour of the plans along a period (5 years) considering the […]

Categories
Mastering Development

Common Lisp – Consing Optimization question – loops and &rest parameters

I’ve finished an implementation of a language using Common Lisp, and I was seeking to optimize it as it takes ~1400s with Lisp instead of ~72 in Java. (Code here cl-lox). I launched the profiler and got this top culprits: seconds | gc | consed | calls | sec/call | name —————————————————————— 32.879 | 0.000 […]

Categories
Mastering Development

Why won’t the find_all() function from beautifulsoup4 not grab all tags

import requests import pprint as pp from bs4 import BeautifulSoup as soup headers = { ‘User-Agent’: ‘some_name’, ‘From’: ‘some_email’ } URL = ‘https://www.reddit.com/r/wallstreetbets/’ page = requests.get(URL, headers = headers) page_html = page.content page_soup = soup(page_html, “html.parser”) print(page_soup.find_all(‘h3′)) print(page.status_code) page.close() This is my first time using beautifulsoup and I’m trying to learn how to use it. […]

Categories
Mastering Development

Connecting Verizon Connect to Google Maps API

I am trying to figure out how to connect a google map api I am planning to put on my site to display live tracking data from a verizon connect fleet tracking service. Verizonconnect.com uses google maps but only allows live tracking data to show within their dashboard and the dashboard map is not exportable […]

Categories
Mastering Development

How can I split a dataframe into multiple columns when my column header has \ in the name?

I have a dataframe called ratings. It is a single column, named “tconst\taverageRating\tnumVotes”, although it needs to be split into 3, separated by “\”. I understand that this statement can be used: ratings[[‘tconst’,’taverageRating’,’tnumVotes’]] = ratings.???.str.split(“\”,expand=True,) However, when I replace ??? with the actual column name, I get an error. I believe this is because of […]

Categories
Mastering Development

DRF Django File Upload ModelViewSet: why do we have to override perform_create?

I can’t really figure this out. Given this model: class AppRelease(models.Model): name = models.CharField(null=False, max_length=250) file = models.FileField(upload_to=app_release_directory_path, storage=OverwriteStorage(), null=True) In order to achieve a working POST with a file upload, if we want it to work, we have to override perform create and pass the variables in the save method. class AppReleaseViewSet(viewsets.ModelViewSet): queryset = […]