A computer program is a collection of instructions that can be executed by a computer to perform a specific task.
A computer program is usually written by a computer programmer in a programming language. From the program in its human-readable form of source code, a compiler or assembler can derive machine code—a form consisting of instructions that the computer can directly execute. Alternatively, a computer program may be executed with the aid of an interpreter.
A collection of computer programs, libraries, and related data are referred to as software. Computer programs may be categorized along functional lines, such as application software and system software. The underlying method used for some calculation or manipulation is known as an algorithm.
I was given an Excel that contains a list of products, my teacher would like us to scrap through the website hktvmall.com to find respective similar products and list out their prices and description.
FYI:
My code is as follow:
import pandas as pd
from bs4 import BeautifulSoup
import requests
import os
url = 'https://www.goodschool.hk/ss'
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html, 'html.parser')
school_items = soup.find_all('div', {'class'...
I'm looking for a free (and simple to use!) program to do differential backups of my files on my Windows laptop. I don't want anything encrypted, just something that can compare files to the backup and add/subtract whatever's been changed.
Years ago, I used "Karen's Replicator". Not sure if...
I am attending University of Waterloo and my school will allow me to graduate as a Mathematical Physics major without taking any labs/experiment courses (in my school lab is not integrated to physics courses, they are separate courses with separate credits).
This could be great because :
-...
Just FYI to anyone who is interested or has a friend or relative who might be interested, Kerbal Space Program is free on the Epic Games store right now through January 12th at 10AM (don't know the time zone).
Kerbal Space Program is THE game if you are interested in rocketry, realistic space...
I know this might be a stupid question, but I am serious. Some of my friends are in graduate programs not much related to their major (a number of my friends majored in math but are in computer science grad programs, and vice versa), so I am curious whether the same holds for physics. In my...
Code for this is here:
https://codesandbox.io/s/floral-frog-7zfon3
I got the general idea of program flow in this case.
First user clicks a button, then function gets called, that function in turn updates the state from initial [] state to [{id:1,value:0.12232}]. Now the array map accesses...
Promises syntax that I learnt:
let p = new Promise(function (resolve, reject) {
let x = 20, y = 20;
if (x == y) {
resolve(); }
else {
reject();
}
})p.then(function () {
console.log("that's correct");
}) .catch(function () {
console.log("that's not correct");
})
I...
Hi everyone
I modified some code that originally displayed a toast when the screen was pressed and held. The original code used onTouchListener with a relative layout, but I changed it to a button instead. I think I've copied it correctly, but my program crashes when the button is clicked.
I...
My little project - 3body simulator started as a programming exercise, which I attempted to make a program that solves the famous 3-body gravity problem using numerical integration.
Later I gained interest in the underlying physics and expanded the program to solve N-body problems involving...
Hello. Would you please explain the factors that determines the opening time of a program or a big file. For example if you have a large excel file, why would you have a difficulty to open it, if it is very large? If it is in your PC's main storage, that is either HDD or SDD, is it reading...
I've been trying to find a way to calculate Gaussian curvature from a 4D metric tensor. I found a program that does this in Mathematica using the Brioschi formula. However, this only seems to work for a 2D metric or formula (I would need to use something with more dimensions). I've found...
Let's say I have an algorithm ## ALG_A ## written in language ##A##, and I wish to call algorithm ## ALG_B ## written in language ##B## through ## ALG_A ##. What are some ways of achieving this in implementation?
For example, say I want to calculate stuff in C language and provide this...
Hi, i am really new to scratch programming so I am having difficulties in interpreting how does this code work ? I understand the first block set a = 5. But i don't know what is that " Repeat 10 " block. What does it do? So really stuck at that "repeat 10" so haven't gone further.
/* Write a c program to convert given number of days to a measure of time * given in years, weeks and days. For example 375 days is equal to 1 year * 1 week and 3 days (ignore leap year) */
#include stdio.h #define DAYSINWEEK 7
void main() { int ndays, year, week, days...
Hi,
Question:
Why is the error 'Error parsing inputs' in CVXPy occurring?
Context:
I am trying to solve a semidefinite program in CVXPy (using Google Colab). I went to the documentation (HERE) and I copied the example code into a cell. It doesn't work for some reason and I don't understand...
crystal frequency is 4MHz
The code i have tried is:
#include <p18cxxx.h>
#include <xc.h>
void main(void)
{
TRISC = 0; // making TRISC pins output
ADCON1 = 0x07; // making them digital pins
while(1)
{
RC0 = 1;
__delay_ms(5000);
RC0 = 0...
I was having a conversation with a coworker and this question came up: is there a program like ORIGEN (or maybe even ORIGEN) to run decay calculations in reverse?
It's a relatively easy process to start with a given quantity of an isotope (e.g. U236), run it through a program such as ORIGEN...
At the very beginning, I accept that I have a faulty mouse. I bought it last year, and it's been only one year (almost), and the left button is malfunctioning. Single clicks are often becoming double clicks, which is causing a host of problems — closing two tabs one after the other in browsers...
Hi,
I was working through the following optimization problem, and am getting stuck on how to get to the dual problem that is being presented.
Question:
Find the dual problem for the semidefinite primal problem below:
min_{X} tr(C^T X)
\text{subject to} AX = B
X \succeq 0
(the answer is...
I am sinking deeply into the cryptocurrencies world. There is a website that shows a "smart contract", a piece of code that is supposed to provide rewards for "staking" a particular token, where the rewards is two different tokens (I am not even sure in which proportion). Usually people who...
Almost all (compiled or interpreted) programming langues store the program source in the form of a series of bytes (using an encoding like ASCII or UTF-8) into a text file, enforcing the grammer of the programming language using a parser (as part of the compilation process or interpretation of...
Hey! 😊
A polynomial can be represented by a dictionary by setting the powers as keys and the coefficients as values. For example $x^12+4x^5-7x^2-1$ can be represented by the dictionary as $\{0 : -1, 2 : -7, 5 : 4, 12 : 1\}$. Write a function in Python that has as arguments two polynomials in...
Hi,
Due to a proxy issue I have to launch chromium with this additional requirement to set the right proxy
chromium-browser --proxy-server=http://proxy.myproxy:XXXX
To get things more easy I defined an alias
alias chrome='chromium-browser --proxy-server=http://proxy.myproxy:XXXX'
so now I...
I wrote a program to determine the critical mass of uranium oxide with an enrichment of 10%. I got a keff approximately equal to 1 with the selected volume and density (attached a file). Is it possible to somehow run the program without writing the initial density and volume into the conditions...
Hello Forum,
I am not completely clear on the idea of saving the state of a Python program. We can write a .py program which has instructions, formulas, variables, user inputs, and uses data from an external file, etc., and run such file. However, running the program is different from saving...
Hello, I hold a BS in mathematics and want to pursue a career in physics. Is there any way where I can directly join a physics grad program from my current background? What are the options available? And would it be better to pursue an MS in applied math and then switch to physics? Would a good...
Bit of a long shot but can anyone remember a TV program where the presenter measured the weight of something at ground level and compared it to the weight at the top of a tall building, possibly the Empire State building? Sorry I can't recall more details. Think it was at least 10 years ago...
Suppose a program computes or reads-in a symbolic mathematical expression like ##2x^2 - xy + y##. What's an effective way to cause the program to implement the expression as a function (e.g. implement ## f(x,y) = 2x^2 - xy + y##) when the programmer doesn't know in advance what the expression...
Hello,
Is it possible to enroll in a graduate program in physics if I have an an undergraduate degree in architecture? Or is an undergraduate degree in physics- or in a related field- required to qualify?
(Assuming that I have studied extensively physics (alone) while obtaining my degree in...
Hello everyone,
I have a friend who serves in the military, he enlisted right out of high school (about 3 years ago) and he is looking to start a program to earn his bachelors degree. Due to his current role in the military, he needs to take courses online in order to fulfill his duties.
He...
Hi
I have a MPG file that I cannot watch on my computer. My computer will play MP4, I know there are online program to convert MPG to MP4, I want to get a safe link from you experts before I dare to do that.
This is what I found, but I want to get your feedback before I do anything...
Hello all,
I'm looking for an online Post-Masters Certificate Program in Engineering. Can anyone please point me towards one? My background is in Electrical and Systems Engineering. So I wouldn't mind a Post-Master's certificate in either Electrical Engineering, Systems Engineering, or possibly...
https://projecteuler.net/problem=101import numpy as np
for j in range (1,11):
M = np.empty([j, j])
for x in range(1,j+1):
for y in range(1,j+1):
M[y,x] = y**(j-x)
Minv = np.linalg.inv(M)The ##j^{\mathrm{th}}## estimate ##\mathrm{OP}(j,n)## which fits ##j## data...
Hi,
I don't want to be too specific here, but specific enough for relevant advice.
I'm finishing a Masters in Physics and am lucky to have been made offers by 2 excellent institutes: a Max Planck Graduate Centre (MP), and at Oxford UK. Both are in experimental condensed matter; Weyl...
I am a junior physics major, and I have applied to many summer programs this year. One of which is the AFRL Scholars program. I applied to Kirtland and Elgin. They said that offers will be extended through mid February to mid March. Did anyone apply to this program? If so, has anyone received...
Here is the function that I have written:
import numpy as np
def ode_euler_forward(odefun, y_initial, x_range, num_steps):
"""
Solves a system of non-stiff ODEs using Euler's forward algorithm.
Parameters
----------
odefun : callable(x, y1, y2, ...)
The function...
Following my book, we are making a program with two classes: Message and Folder. The idea is that messages will be stored in a folder. The same message can be saved in multiple folders. In order to accomplish this, Message has a set of pointers to Folder that point to each of the folders that...
Below is my code. The include directives and the using std::* declarations have been removed for brevity:
class HasPtr {
friend void swap(HasPtr&, HasPtr&);
public:
HasPtr(const std::string &s = string()): ps(new string(s)), i(0) {}
HasPtr(const string &s, const int &j) : ps(new...
I am stepping through the program and I actually wrote down the steps in comment each step the debugger step through. I have a few question I still don't understand. Here is the program:
//Matching catch handler with exception
#include<iostream>
#include<string>
#include<string_view>...
On wikipedia, it says that the Langlands program is a kind of "grand unified theory of mathematics." Does this program have any known connections to physics and in particular, quantum gravity?
I've attempted and I can retrieve a 0 when the first input is greater than the second using BRP. I can't seem to get the output of 1 if the first input is equal to the second input. I also don't get a 2 output with the first input being less than the second. I also have no idea how to loop a...
I am writing a simple program for my wife and would like some critique on some general design decisions I've made. The program will be able to store a recipe she enters (in a .txt file), retrieve a recipe that she had entered in the past, and allow the input and retrieval of ingredient densities...
A computer program that was supposed to handle this was bought and tried, and it made a mess of it, so the idea is that perhaps it would be easier to give a strategy to someone (computer savvy, but an amateur, not a professional ) to program (not requiring too much power of the computer on which...
Wich The Program (Software) Using To Draw Statics And Dynamics Mechanichal Same This 100% When Create This below Which Program Using ?
And set Dimensions
Thanks For All