Code Definition and 908 Threads
-
M
Python Is This Python Multiplication Table Code Correct?
Hey! 😊 I want to write a function in Python that returns the multiplication table $20\times 20$. We do that using lists in lists, right? I have written the following : def mul_table() : Prod = [] Table = [] for i in range(21) : for j in range(21) ...- mathmari
- Thread
- Code Multiplication Table
- Replies: 3
- Forum: Programming and Computer Science
-
Python What does this code signify in relation to boolean logic?
my_age = 10 if my_age >= 100: print("One hundred years old! Very impressive.") elif my_age <= 3: print("Awwww. Just a baby.") else: print("Ah - a very fine age indeed") https://www.fullstackpython.com/blog/python-basic-data-types-booleans.html Article says-:- shivajikobardan
- Thread
- Code Logic Relation
- Replies: 2
- Forum: Programming and Computer Science
-
Python Python-What does this code signifies in relation to boolean logic?
my_age = 10 if my_age >= 100: print("One hundred years old! Very impressive.") elif my_age <= 3: print("Awwww. Just a baby.") else: print("Ah - a very fine age indeed") https://www.fullstackpython.com/blog/python-basic-data-types-booleans.html Article says-:- shivajikobardan
- Thread
- Code Logic Relation
- Replies: 4
- Forum: Programming and Computer Science
-
Looking for a good source to find FPGA developers for ADC PCB spinouts
Summary:: I am trying to find some good folks with knowledge in FOGA coding for some ADC boards our EEs are spinning out, but am having terrible luck so far... I am trying to find some good folks with knowledge in FPGA coding for some ADC boards our EEs are spinning out for pulse heigh...- mesa
- Thread
- Adc Code Fpga Pcb Source
- Replies: 6
- Forum: STEM Career Guidance
-
O
Simulation Code for Earth's Historical Temperature Record
I am new to the field of climate change. Are there publicly available simulation code for Earth's temperature history, going back, say 2000 years, with a resolution on the order of years? Thank you very much.- optotinker
- Thread
- Code Historical Simulation Temperature
- Replies: 46
- Forum: Earth Sciences
-
A Quantum linear code/ Dual Code (CSS) proof
- steve1763
- Thread
- Code Css Dual Linear Proof Quantum Quantum information
- Replies: 3
- Forum: Quantum Physics
-
C
I have a few questions about Formalization & Pseudo-code
Hello, I have a few questions and I'd appreciate if you can please help me. 1. If I want to say "for every ## i \in \Bbb N ## and ## 0 \leq j \leq i ## define ## A_{i,j} := i ## and ## B_{i,j} := i \cdot j ## ", then is the logical formula used for this is as such?: ## \forall i \in \Bbb N...- CGandC
- Thread
- Code Function Logic Quantification
- Replies: 19
- Forum: Math Proof Training and Practice
-
A Knill-Laflamme condition Shors code
The K-L condition has projection operators onto the codespace for the error correction code, as I understand it. My confusion I think comes primarily from what exactly these projections are? As in, how would one find these projections for say, the Shor 9-qubit code?- steve1763
- Thread
- Code Condition Information theory Quantum information
- Replies: 1
- Forum: Quantum Physics
-
C
I Implementation of Correlated Gaussian Random Fields Model
Hello everyone. I have been recently working in an optimization model in the presence of uncertainty. I have read https://www.researchgate.net/publication/310742108_Efficient_Simulation_of_Stationary_Multivariate_Gaussian_Random_Fields_with_Given_Cross-Covariance in which, a methodology for...- confused_engineer
- Thread
- Articles Code Example Fields Gauss Gaussian Model Random Random process
- Replies: 1
- Forum: Set Theory, Logic, Probability, Statistics
-
MATLAB Graphene band structure Matlab code
I have this code for 3D band structure of graphene but i can't understand why while graphene first brillouin zone is hexagonal but here a rectangle form of first brillouin zone is used?E0 = 0; % coloumb integral V = -2.7; % hopping integral [eV] acc = 1.41; % c-c bond length [Angstrom] lattice =...- Mohammad-gl
- Thread
- Band Band structure Code Graphene Matlab Matlab code Structure
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
How to clone git repo and run a code in repo directory
I have downloaded JupyterLab Neon Theme, and I can run it without a problem, but I want to change some things on the custom.css file. However, when I change that file, I need to do something called development installation. However, I have no idea how to do it properly. I mean, what steps...- Arman777
- Thread
- Code
- Replies: 2
- Forum: Programming and Computer Science
-
S
B Find Numerical Relativity Source Code
Where can I find numerical relativity source code?- sqljunkey
- Thread
- Code Numerical Relativity
- Replies: 1
- Forum: Special and General Relativity
-
[Bash] Use of brackets in this code snippet
Disclaimer: I am an absolute beginner in bash scripting. I spent the whole evening trying to make this code snippet work as intended. The program is supposed to sort an array using bubble sort algorithm. #!/bin/bash arr=(7 -1 9 2 11 -13 5) for (( i=0; i<(( ${#arr[@]} - 1 )); i++ )) ; do...- Wrichik Basu
- Thread
- Code
- Replies: 9
- Forum: Programming and Computer Science
-
LaTeX Feedback on my LaTeX code please
\newcommand\func{\(f\)} \newcommand\myset[1][math]{\ifthenelse{\equal{math}{#1}}{\(K\)}{K}} \newcommand\diff[4]{\(|#1-#2|#4#3\)} \newcommand\ball[3]{\diff{#1}{#2}{#3}{<}} \newcommand\Fllab[2]{\diff{f(#1)}{f(#2)}{\epsilon}{\geq}} \newcommand\term[2][n_k]{\({#2}_{#1}\)}...- Eclair_de_XII
- Thread
- Code Feedback Latex
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
N
Help requested with translating math into code (Not homework)
The paper is https://core.ac.uk/display/10365043 (12MB pdf) My purpose is to construct parametised spiral bevel gears (using OpenSCAD). I know how to produce a correctly formed circular cut (cylindrical) crown gear profile. My problem is mapping that to a conical surface. I am looking for...- noname12345
- Thread
- Code Homework
- Replies: 8
- Forum: Differential Geometry
-
LaTeX How do I fix this generated LaTex code for a matrix?
Hi, I'm using Scientific Workplace to write LaTex and it generates the code shown below for the given matrix. I don't think the generated code is standard LaTex in this particular instance. How can I fix it without making too many modifications? I mean if there is a simple way to fix it. Thank...- PainterGuy
- Thread
- Code Latex Matrix
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
B
Are Moderna/Pfizer/JJ/AZ using the same code for the spike?
Given the variants of the corona virus now appearing, I was wondering, Are Moderna, Pfizer and Johnson and Johnson and Astrazeneca all using the same genetic code to create the spike protein? Or more specifically, the spike protein that's made by our body, is it the identical spike protein in...- brajesh
- Thread
- Code
- Replies: 3
- Forum: Biology and Medical
-
Python Kindly explain this source code for me
Check this link: How to override the copy/deep-copy operations for a Python object? Can anyone explain, in layman's terms, what is going on in this source code? from copy import copy, deepcopy class MyClass(object): def __init__(self): print('init') self.v = 10...- user366312
- Thread
- Code Explain Python Source
- Replies: 2
- Forum: Programming and Computer Science
-
A
Help with Matlab Problem: Commenting Code & Finding Errors
Hi! I really need help with the following Matlab problem. What does this code do? I need to comment what the important lines of this code do. Also the code contains several errors which i need to find. Here is the program: clear all; close all; clc; Maxi=50; tab=[1 :Maxi] ; tab(1)=0; while...- Aydashka
- Thread
- Code Errors Matlab
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
NRC Event Report SCRAM Code help
I am a dedicated nuclear physics and radiology enthusiast who often looks at the NRC’s event notification reports for information about our countries nuclear industry and the status of our reactors. And every time I read the report and an event occurs at a commercial reactor they are required to...- Northmeadow
- Thread
- Code Nuclear reactors Report
- Replies: 3
- Forum: Nuclear Engineering
-
F
Write MATLAB code to find Y bus for any bus system
Here's my work: clc; clear all; % Ybus by step by step method for an any bus system % | From | To | R | X | gsh | B | T|ysh % | Bus | Bus | pu | pu | pu | pu | ph-sh linedata = [1 2 0 -5 0...- Fatima Hasan
- Thread
- Bus Code Matlab Matlab code System
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
Python Help with .dot code for Graphviz
Hi guys! I'm completely new with dot code to make graph by graphviz and I'm calling by any help. I would like to make a network of, approximately, 1500 nodes, with each node with its position (geographic coordinate) and its own group of bounded nodes. Some nodes have the same position. These...- UFSJ
- Thread
- Code
- Replies: 3
- Forum: Programming and Computer Science
-
Question for a pointer code fragment
(I am not sure what does "(MyType **)" means after the '=' sign at the second line) The output is :- Linda8888
- Thread
- Code
- Replies: 4
- Forum: Programming and Computer Science
-
(C language)why does this code fail to compile
// MyStruct.h typedef struct { int a; float b; char c; } MyStruct;// HisStruct.h #include "MyStruct.h" typedef struct { MyStruct a; int b; } HisStruct;// HerStruct.h #include "MyStruct.h" typedef struct { MyStruct a; float b; } HerStruct;// main.c #include "HisStruct.h" #include...- Linda8888
- Thread
- Code
- Replies: 7
- Forum: Programming and Computer Science
-
Python Running a Github File on VS code for windows 10- File system problem (
I am doing a cosmological work and I need to run a code form this github page https://github.com/ja-vazquez/SimpleMC I download the whole repository as .zip file and I inserted into my desktop. Then I opened it through vs code and this is how it looks like The problem is that, when I run...- Arman777
- Thread
- Code File Running System Windows Windows 10
- Replies: 14
- Forum: Programming and Computer Science
-
M
(CFD) Problem with C code for 1D linear convection equation
This is my c program below. Again everything works as expected up until the highlighted lines or the second for loop. When i run my program to output the arrays contents i get bizarre numbers that are not correct. # include <math.h> # include <stdlib.h> # include <stdio.h> # include <time.h>int...- mcgrane5
- Thread
- 1d C code Cfd Code Convection Linear
- Replies: 1
- Forum: Programming and Computer Science
-
Python Finding the stability of a system using Python code
I'm given this code to plot the system for task 1 where my teacher have used some random numbers just to show us how the code can be used: The code makes a plot that is given below: So my professor just gave us this code and plot without saying anything more. All the students in the class...- appletree23
- Thread
- Code Python Stability System
- Replies: 4
- Forum: Programming and Computer Science
-
C
Covering credit card 3 digit code
What would be the best way to cover the 3 digit code at the back of a credit card? Some suggest using correcting liquid (but it is easy to remove it and apply new one). Many restaurants still get our cards to swipe at their counter. Only very few go to table to swipe it. Also sometimes we gave...- Cobul
- Thread
- Code Credit card
- Replies: 9
- Forum: Computing and Technology
-
Fortran Extract values from ASCII file in GIS by Fortran code
I want to read values from the ASCII file of GIS by Fortran code. In GIS, an area has meshed. Each mesh has an individual value (e.g. velocity of water). Here is the website that shows how the ASCII file is working in GIS. https://en.wikipedia.org/wiki/Esri_grid I want to know if anybody has...- Pooyannikeghbali
- Thread
- Code File Fortran
- Replies: 2
- Forum: Programming and Computer Science
-
Python Python code to calculate the age of the Universe using the Hubble constant
honestly just need some help here i understand the physics just not how to code it or the syntax of python- k1120
- Thread
- Age Code Constant Hubble Hubble constant Python Universe
- Replies: 1
- Forum: Programming and Computer Science
-
Y
C/C++ What could be causing my program to hang on cin.getline() in C++ code?
I have no idea why the program got hung on cin.getline() in my program. cin >> works just find. Here is the program. It is the really scaled down version of my long program. I just deleted all the irrelevant things. The structure is defined in the header file. I use debug to step through the...- yungman
- Thread
- C++ Code
- Replies: 30
- Forum: Programming and Computer Science
-
MATLAB How to make a while loop stop when reaching a certain value
m_1 = 1; C_p1 = 2219; T_1in = 100 + 273.15; T_1out = 75 + 273.15; Q_1 = (m_1)*C_p1*(T_1in-T_1out); while Q_1 ~= 30000 T_1outnew = T_1out + 0.1; Q_1 = (m_1)*C_p1*(T_1in-T_1outnew); T_1out = T_1outnew; end T_1outnew keeps increasing, but the code never stops; and naturally, Q...- WhiteWolf98
- Thread
- Code Loop Matlab Value
- Replies: 6
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
Code / Software for Dynamic Balancing (Free / Open Source)
I am thinking of doing a DIY project in which one sub-task would be to dynamically balance a small assembly that will be spun up by, for example, a small motor taken from a DVD drive. As a test case, here is a setup where we would like to adjust screws S1 to S6 such that the cylinder is...- Swamp Thing
- Thread
- Code Dynamic Open source Software Source
- Replies: 15
- Forum: Mechanical Engineering
-
G
SF code cracking vs real mathematics
After i read about RSA encoding, it looks like as if one need an alternate history universe to justify that in the not so far (cyberpunk) future the coded message of an important person involved in shady business can be cracked in reasonable time, let alone during a single night. I read that...- GTOM
- Thread
- Code Mathematics Sf
- Replies: 19
- Forum: Sci-Fi Writing and World Building
-
P
Comp Sci Answer: Fixing Error in TextAnalyzer Java Code
My current attemp is: import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class TextAnalyzer { private int lineCount; private int wordCount; private int[] frequencies = new int[26]; public int...- ParticleGinger6
- Thread
- Code Computer science Java
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
A
Comp Sci How to Structure Java String Code in a Static Main Method?
here the class name is test153 sent is the sentence entered l is the length of the sentence w is the variable storing each word temporarily before printing.- anyonebutangel
- Thread
- Code Java String
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
Comp Sci Optimal code for the array problem
Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each of the array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in your array. For example, the length of your array of zeros ...- Monsterboy
- Thread
- Array Code
- Replies: 21
- Forum: Engineering and Comp Sci Homework Help
-
B
Having trouble setting up mern in Visual Studio code
I am having an error setting up mern https://www.digitalocean.com/community/tutorials/getting-started-with-the-mern-stack#testing-api I have to assume I didn't follow the instruction properly.The error is under Database section from the link above. When I type require('dotenv').config() into...- billllib
- Thread
- Code Visual
- Replies: 16
- Forum: Programming and Computer Science
-
M
MHB How Do You Calculate the Total Weight of a Huffman Code?
Hey! 😊 We are given the following letters with the respective frequencies: \begin{equation*}\begin{matrix}a/2 & b/4 & c/7 & d/6 & e/4 & f/5 & g/8 & h/10 & i/3 & j/11\end{matrix}\end{equation*} For that I have applied the Huffman code and I got the following tree: Now it is asked for the...- mathmari
- Thread
- Code Weight
- Replies: 1
- Forum: Set Theory, Logic, Probability, Statistics
-
Probability of a 4 character code without repetition
The lessons show using Permutations and Combinations for other problems in this section, but we were having difficulty what to choose to put in those formulas. I used this approach: We have 10 numeric and 6 alphabetic = 16 total possible. Let's look at the first digit numeric, and the next 3...- scottdave
- Thread
- Code Probability
- Replies: 16
- Forum: Precalculus Mathematics Homework Help
-
LaTeX How to convert MathML code into LATEX code
Hi again, I'm trying a new program, Scientific Workplace 6, which let's me produce a zip file with four different options as shown below. I just noticed that I could open these zip files in browser and format of the document remains intact. I only tried "Zip file with MathJax". Do you know...- PainterGuy
- Thread
- Code Convert Latex
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
A
Comp Sci Recursive Double code to Calculate the sum of the square roots <= a number
#include<stdio.h> #include<math.h> double foo(int n){ if(n==1){ return(1); } if(n!=0){ return( sqrt((n)+foo(n-1) ) ); } } int main(){ int num; printf("Enter the number: "); scanf("%d",&num); foo(num); printf(" %lf ",foo(num)); return(0); }I...- anonim
- Thread
- Code Roots Square Sum
- Replies: 19
- Forum: Engineering and Comp Sci Homework Help
-
S
Python X error correction code in ProjectQ Python
I have been trying write a code in for error correction. I am new to programming and am unable to understand what is not alright. Can anyone please suggest some explanation? from projectq.ops import All, CNOT, H, Measure, Rz, X, Z from projectq import MainEngine from projectq.meta import...- Spark-X
- Thread
- Code Correction Error Python
- Replies: 1
- Forum: Programming and Computer Science
-
M
C/C++ What is happening to num and den in this C++ code for Stieltjes polynomials?
I'm not at all C++ literate, but I need to understand what a C++ code is doing for a math problem regarding the Stieltjes polynomials. Especially, I want to know what is happening to the "num" and "den" in the code; the code is in this link: Stieltjes- member 657093
- Thread
- C++ Code Polynomials
- Replies: 10
- Forum: Programming and Computer Science
-
Mastering Physics access code -- 1 book versus 3 books?
I want to buy the access code for university physics 14th edition.I know there are 3 volumes for this books.Is there one access code for 3 books or just one for each volume?- Amik
- Thread
- Book Books Code Mastering physics Physics
- Replies: 2
- Forum: Science and Math Textbooks
-
B Odds of Drawing Sequence 4457: Calculating Probability
Suppose we have a code: 4457 If these numbers are randomly drawn what are the odds of drawing those numbers? Here's my approach: The available numbers range from 0123456789 and there are four columns, minus the numbers which were drawn gives: 1/(10^4-4)~0.01% Now what about the odds of...- Glype11
- Thread
- Code Probability
- Replies: 8
- Forum: Set Theory, Logic, Probability, Statistics
-
P
Comp Sci Mars Rover Project code w/ Arduino
Mentor note: I have removed author information and have enclosed the code below in code tags. First library: MarsRover_lineFinder2.ino #include <ZumoShield.h> #include "MRlinelib.h" #include <QTRSensors.h> #include <Pushbutton.h> #include <ZumoReflectanceSensorArray.h> #include <ZumoMotors.h>...- ParticleGinger6
- Thread
- Arduino Code Mars Project Rover
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
E
Quantum Springer discount code CYBERWEEK19 - English IT books only 7 Euro
Use the discount code CYBERWEEK19 to purchase English IT eBooks from Springer online for only 7 Euro. Go to the checkout and enter the code. Afterwards, you can proceed browsing the book list and it automatically shows if the code was applied. Note: At the checkout read again if the discount...- Edgardo
- Thread
- Books Code English springer
- Replies: 1
- Forum: Science and Math Textbooks
-
P
Decoding Miller Code: Understanding the High and Low Signals
Hello, I have some questions about the Miller Code. So I googled something and found some helpful pictures. See, for example, Figure 1: My first question on picture 1 is, why is 0 set to high in the first signal (I marked this with a red question mark)? With the second signal in the first...- Peter_Newman
- Thread
- Code Coding
- Replies: 8
- Forum: Electrical Engineering
-
M
C/C++ Running a C++ code from oomph-lib (a CFD software)
Hi PF! I recently installed the computational fluid dynamics software oomph-lib, which is similar to OpenFOAM. After installing, I'm trying to run a tutorial provided with the program, described here. I think all I need to do it run the .cc file here, so I type into the terminal >> gcc...- member 428835
- Thread
- C++ Cfd Code Running Software
- Replies: 34
- Forum: Programming and Computer Science