Code Definition and 908 Threads
-
Does <Code> feature not work?
I cannot post code with the CODE tags. Here is a screen grab of the code I tried to post, and the error it thorws when I try to save it. I am going to start small and see where it breaks. It chokes on any script line. <!DOCTYPE html> <html lang="en"> <head> <meta...- DaveC426913
- Thread
- Code Error
- Replies: 22
- Forum: Feedback and Announcements
-
M
How can you modify Python code for effective graph plotting?
TL;DR Summary: How to understand the code determining the plot Hi; this is the code I have been given for a H-R diagram of M35; I understand the inversion concept.. The plot is below. I am trying to understand the code that creates its position and size and how to alter it to a more...- Martyn Arthur
- Thread
- Code Python
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
Why Were Resistor Values Indicated by Colored Bands Instead of Printed Numbers?
In the Dark Ages, resistor values were indicated by colored bans, and we all had to memorize the code. (This was back when they were bigger than a speck of dust) My question is - why colored bands? Caps have numbers printed on them (as do some resistors). Why fool with bands if you can just...- Vanadium 50
- Thread
- Code Color Resistor
- Replies: 22
- Forum: Electrical Engineering
-
S
Unable to crack this image enhancement code -- Matlab is throwing errors
img= imread('Image.bmp'); img= rgb2gray(img); imshow(img); pt = ginput(4); % the function ginput is used to get the input from mouse x1 = pt(1,1); y1 = pt(1,2); x2 = pt(2,1); y2 = pt(2,2); x = [x1 x2]; y = [y1 y2]; line(x,y); x3 = pt(3,1); y3 = pt(3,2); x4 = pt(4,1); y4 = pt(4,2); x = [x2 x3]; y...- Saikiran
- Thread
- Code Image
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
C
Is It Time for a Gap Year After College?
Hi, my name's Cass. I finished my bachelors in physics last year. Kind've floating around I guess. I write code, play guitar, make art, and study Japanese. I hope to spend some time away from school and get my priorities straight then maybe go back to gradschool eventually. Nice to meet you!- CassKaid
- Thread
- Code Guitar Physics
- Replies: 1
- Forum: New Member Introductions
-
C# Generic Interfaces and Covariance
Hi. I have the following code: public interface ICovariance<out T> { void Add(T item); T Get(); } How to remove the compile-time error without changing the code of method declaration and by only changing the interface signature? The error is in:void Add(T item); Thanks.- pairofstrings
- Thread
- Code Covariance
- Replies: 7
- Forum: Programming and Computer Science
-
M
Python Can Fortran 77 Code Be Used to Debug Python Code for Solving ODEs Using Radau5?
Hi, I have a piece of Fortran code but I'm not Fortran literate. I'm trying to translate it into Python. I have already made it, but I need someone who can run the Fortran code to compare the values of the variables.- member 657093
- Thread
- Code Debugging Fortran Python Translation
- Replies: 64
- Forum: Programming and Computer Science
-
A
Help debugging MCNP code - particle lost and zero latice element found
I keep getting particle lost error even though there were no hole in the lattice. Can someone identify any mistake in my code?- AlexFi
- Thread
- Code Debugging Element Lost Mcnp Particle Zero
- Replies: 3
- Forum: Nuclear Engineering
-
Python Thermal lattice Boltzmann model ignoring source term -- python code help please
LBM model for phase change- relevant equations found here. Also here. #Thermal LBM #solves 1D 1 phase phase-change #D2Q5 Lattice nx=100 # the number of nodes in x direction lattice direction ny=5 # the number of nodes in y...- Gwen
- Thread
- Boltzmann Code Lattice Lattice models Model Phase change Python Source stefan Term Thermal
- Replies: 1
- Forum: Programming and Computer Science
-
Comp Sci How do "min" and "hour" get their values in this C++ code?
How does "min" and "hour" get their values in this C++ code? Full code here: #include<iostream> using namespace std;class Time { public: int hour; int min; Time() { hour=min=0; } Time(int h,int m) { hour=h; min=m; } Time add (Time t)...- shivajikobardan
- Thread
- C++ Code
- Replies: 15
- Forum: Engineering and Comp Sci Homework Help
-
G
I Angle of Sun by date and zip code?
I don't know the correct works search to find this info online. I have been doing word searches since about Dec 15, 2022 but not finding what I want.??????? Some where there much be a chart by date and zip code for sun angle. I built a sun dial in the yard to learn the angle of the sun on...- gary350
- Thread
- Angle Code Sun
- Replies: 6
- Forum: Astronomy and Astrophysics
-
I get this error when I try to run the code MCNPX
I get this error"bad trouble in imcn in routine pass1 unexpected eof in file depletion.inp" when I try to run the code MCNPX my input file c Depletion pincell input file for MCNPX c Define cells c Cell 1: Fuel 1 0 -1.0 -4 -5 -6 c Cell 2: Cladding 2 0 -2.0 4 -7 c Cell 3: Moderator 3 0 -3.0...- emilmammadzada
- Thread
- Code Error Mcnpx
- Replies: 5
- Forum: Nuclear Engineering
-
FRENDY nuclear code -- Where to download it? (for ubuntu 22.04)
I want to compare njoy2016 and frendy codes.If anyone is using frendy nuclear, I wanted to get information about how to download it for ubuntu 22.04 version?- emilmammadzada
- Thread
- Code Nuclear Ubuntu
- Replies: 6
- Forum: Nuclear Engineering
-
Stopping power and projected range for FLUKA code
How do I calculate the stopping power or projected range for aluminum in Fulka. And in which output file is this data located?How can I edit a change in the input file?- emilmammadzada
- Thread
- Code Power Range Stopping power
- Replies: 1
- Forum: Nuclear Engineering
-
G
Java Please help explain the reason for the errors displayed for my Java code
//program showing an advantage of using arrays public class Arr3 { public static void main(String []args) { System.out.println("There are 31 days in the month of Jan"); System.out.println("There are 27 days in the month of Feb"); System.out.println("There...- grzz
- Thread
- Code Errors Explain Java Reason
- Replies: 8
- Forum: Programming and Computer Science
-
JavaScript What happens when return is executed in this code?
I'm currently watching tutorials to build projects as I'm still not in a phase where I can carve a project that I want all on my own. Currently, working on a snake game. let speed = 2; let lastPaintTime = 0; //Game functions function main(ctime) { window.requestAnimationFrame(main); if...- shivajikobardan
- Thread
- Code
- Replies: 12
- Forum: Programming and Computer Science
-
I How to do algebra on the Kitaev toric code grid?
The toric code is a basic computational model as follows: There are 2 operations that can be performed, A and B, on this grid. To compute the value A at each point on the grid, we transform the raw values at each dot (located in between two vertices) according to some predefined operators...- James1238765
- Thread
- Algebra Code Grid
- Replies: 18
- Forum: General Math
-
MATLAB Help converting MATLAB to Scilab code
Hello, I am having difficulty converting some MATLAB code to Scilab code. Specifically, the problem is with graphing the results of a spiking neuron program. Herer is the program and the article that explains it: https://www.izhikevich.org/publications/spikes.pdf The problem I am having is...- DiracPool
- Thread
- Code Matlab
- Replies: 4
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
Which MSc to do after BSc physics if you love to code?
Hi everyone! Merry christmas first and I hope you're getting great rest with close ones around :) Well, as title may suggest it, I will graduate soon in physics and I'm not sure of the next step in my academic curriculum. I like theoretical physics, I've touched upon most fondamental physics...- yezia
- Thread
- Applied mathematics Bsc Code Computer science Love Msc Physics
- Replies: 10
- Forum: STEM Academic Advising
-
V
Comp Sci An Introduction to Deep Learning and Modifying Code
The code with no modifications is at the very bottom. For part 1: loading a mat file into the code, I just put it above the last function but it's going to have to replace the data part of the original code thus I have to extract it out of the file: (I would add the file but I am unsure of how...- ver_mathstats
- Thread
- Code Introduction
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
M
C/C++ Errors trying to compile a simple code
When trying to compile the following c++ code I get the errors I've screenshot // p12 #include <iostream> #include <vector> #include <string> #include <map> class Solution { private: std::vector<int> num = {1,4,5,9,10,40,50,90,100,400,500,900,1000}; std::vector<std::string> sym =...- member 428835
- Thread
- Code Errors
- Replies: 22
- Forum: Programming and Computer Science
-
D
Online compilers that will run code that features TextIO?
Hi everyone I've been trying to teach myself coding using the free materials from https://math.hws.edu/javanotes/index.html I've been using online compilers because I got a "Error: Could not find or load main class" message immediately upon installing Eclipse. The online compilers work for...- Darkmisc
- Thread
- Code
- Replies: 6
- Forum: Computing and Technology
-
D
C/C++ Learning to Code Game Enemy AI in C++ from Scratch or in Assembly?
Hello, To keep my questions straightforward they are below. How do I learn how to code Game Enemy AI in C++ from scratch and what are the top resources you recommend(Books, Tutorials, CD-Roms, Videos)? How do I learn how to code Game Enemy AI in Assembly Langauge from scratch and what are the...- DeVaughn_B970
- Thread
- Ai Assembly C++ Code Game scratch
- Replies: 16
- Forum: Programming and Computer Science
-
G
I What is the angle of the Sun on June 21 & Dec 21 at US Zip Code 37129?
What is angle of Sun June 21 & Dec 21 at zip code 37129. I need lowest angle & highest angle and probably angle of sun about Feb 20. Google word search shows nothing. I am probably need using correct word search to find what I want. Several years ago I accidently found a calendar that showed... -
K
Genetic code other than DNA (moved)
Summary: Curious to find out genetic code other than DNA <mentor> Moved to Discussion, hypothetical discussion Dear PF Forum, It's been a long time since I log into PF. And I hope everybody is in a good health. Recently I had a discussion debate with my friend about other life in this...- KingGambit
- Thread
- Code Dna Genetic code
- Replies: 7
- Forum: General Discussion
-
A PD code yields two different knot diagrams
The PD code [(2, 3, 1, 4), (4, 1, 3, 2)] seems to map to a non-unique knot diagram. I can describe the following two Hopf links with different orientations with this same PD code. As I understand it, while a link diagram does not have a unique PD code, a given PD code should map to just one knot...- sophiatev
- Thread
- Code Diagrams Knot theory Pd
- Replies: 3
- Forum: Topology and Analysis
-
Other Is There a 40% Discount Code for Springer Books?
Hey there. Here is a springer discount code for %40 off. M3rtp5dd Does PF have a deal with Springer, similar to the agreement with Amazon?- MidgetDwarf
- Thread
- Code springer
- Replies: 3
- Forum: Science and Math Textbooks
-
M
Python One-line Python Code that returns a sequence of integers
Hey! 😊 I want to write a one-line Python generator or iterator expression that returns the sequence of integers generated by repeatedly adding the ascii values of each letter in the word “Close” to itself. The first 10 integers in this sequence are: 67, 175, 286, 401, 502, 569, 677, 788, 903...- mathmari
- Thread
- Code Integers Python Sequence
- Replies: 4
- Forum: Programming and Computer Science
-
Changing the Temperature in an MCNP code
Hello everybody. I would like to ask a question; if I change the dimensions and densities and the material number identifier ZAID to a specific temperature. Does MCNP change automatically the volume of the cells? or I have to change the volume of each cell manually and indicate it in the cell...- Zakariya
- Thread
- Code Mcnp Temperature
- Replies: 2
- Forum: Nuclear Engineering
-
I Propagation of Angular Spectrum Code
I'm making a MATLAB code to propagate a gaussian field in the angular spectrum regime (fresnel number >> 1). After Fourier transforming the field, you propagate it: $$U(k_x,k_y,z) = U(k_x,k_y,0)e^{ik_z z}$$ The thing that I am having trouble with is the propagation factor, I have looked at this...- stephen8686
- Thread
- Angular Code Fourier analysis Propagation Spectrum
- Replies: 1
- Forum: Other Physics Topics
-
C/C++ Polymer simulation source code in C++ and Python
I am absolutely new to Polymer simulation. I am trying to understand the simulation by analyzing source code written by others. Can anyone tell me what are the differences between the following three source code in terms of their objectives? Monte-Carlo-simulation-of-polymers...- user366312
- Thread
- C++ Code Monte carlo simulation Polymer Python Simulation Simulations Source
- Replies: 1
- Forum: Programming and Computer Science
-
A
Need of Tangle calculation using code and Numerically
= tangle equation = Inequality condition = partial trace formula. To find the tangle, we need the square concurrence value of ABC states as mentioned in a tangle equation. I am not able to find the value of square concurrence.- Appu
- Thread
- Calculation Code
- Replies: 1
- Forum: Advanced Physics Homework Help
-
M
Comp Sci How does Instruction 2 affect the updates in a flow chart for coding?
I found this as problem 3/42 from here (copied below for viewing convenience). I'm a little confused about Instruction 2. The way I interpret it, upon the first loop, no evaluation is occurring, but instruction 1 now becomes "increase Box 2 by 2". So now the three instructions are 1) increase...- member 428835
- Thread
- Charts Code Flow
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
Interest in post comparing nVidia CUDA code vs. Intel AVX-512 code?
I've done a bit of CUDA programming lately, to exercise some parallel code on my nVidia graphics card. I also ported implemented the computations in Intel AVX-512 assembly code. The code I wrote takes a bunch (=262,144 = ##2^{18}## to be exact) of points, and calculates the slope and...- Mark44
- Thread
- Code Interest Nvidia
- Replies: 11
- Forum: Programming and Computer Science
-
C
Help with this emu8086 assembly language problem please
Summary:: my code has been successfully showing the right decrement of the letter. however, i tried to put space in between the letter output but its output became repititive letters. this is the original output when i try to put space it become like this i want to put spaces on the output...- chewi
- Thread
- Assembly Assembly language Code Language Programming
- Replies: 20
- Forum: Engineering and Comp Sci Homework Help
-
LaTeX What is the Latex Code for Upper Sum?
- Math Amateur
- Thread
- Code Latex Sum
- Replies: 3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
Python Why Does My Python Code Output None Instead of the Next Permutation?
Hi PF! I'm trying to write a code that, given a list of integers, will output the next lexicographic permutation. But my output gives me None, and I can't see why. Is it because I am incorrectly calling the reverse function? Any help is greatly appreciated! class Solution(object): def...- member 428835
- Thread
- Code Python
- Replies: 34
- Forum: Programming and Computer Science
-
MHB Solving Your Problem: Troubleshooting Mistakes in Code
https://lh6.googleusercontent.com/gIpHfdMTJMBg2-cMkBWqVQYyAUKTwBCzc30JXJ054wfj06IBGeeXFdHd1-VO0J6EFrssOlAe3ntqJaVHSakLZAK8x4BI6pRL5Lb0JWUdDEuaxAm4NPAiUMvtOSLqjrOkH8r0VOv7...- shivajikobardan
- Thread
- Code Troubleshooting
- Replies: 1
- Forum: Programming and Computer Science
-
LaTeX Why Is My LaTeX Code Not Working?
[SOLVED]I keep failing to be able to correct the following Latex Code B' = \{ x \in \mathbb{R^n} \ \ | \ \ a_j \leq x_j \leq t_j \text{ and } a_k \leq x_k \leq b_k \{ for } k \neq j \} Can someone help by indicating what's wrong ... Help will be much appreciated Peter- Math Amateur
- Thread
- Code Failing Latex
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
Python How does this recursive code work?
Hi PF! Here is a code that generates ##n## amount of valid combinations of parenthesis e.g. n = 2 implies (()), ()(). But this wouldn't work )()( or this ))((. def generate(result, s, _open, close, n): # Base condition if close == n: result.append(s) return # If...- member 428835
- Thread
- Code Work
- Replies: 11
- Forum: Programming and Computer Science
-
Understanding the source code for an OpenFOAM solver (CFD)
I am trying to understand the following code (it starts from line 59) and there are pieces I do not understand. argList::addNote ( "Solver for two incompressible, isothermal immiscible fluids with" " phase-change.\n" "Uses VOF (volume of fluid) phase-fraction based...- JD_PM
- Thread
- Cfd Code openfoam Source
- Replies: 14
- Forum: Programming and Computer Science
-
M
Python Executing Specific Python Lines in VS Code on Ubuntu
Hi PF! I am running VS Code for python on Ubuntu. Is there a way to execute a specific python line? As I currently have it set up, on the terminal input at the bottom of the screen, I can only work through the terminal, so a command like print('hello world') won't do anything. THanks so mcuh!- member 428835
- Thread
- Code Python Visual
- Replies: 2
- Forum: Programming and Computer Science
-
I
Prove this inequality about the weights of code words (Coding Theory)
I'm trying to prove the following: ##wt(x+y) \leq wt(x) + wt(y)##, where "wt(x)" is referring to the weight of a specific code word. Proof: For two code words ##x, y \in F^{n}_2##, we have the inequalities ##0 \leq wt(x)## and ##0 \leq wt(y)##. Adding these together, we have ##0 \leq wt(x) +...- imDooiNGMATH
- Thread
- Code Inequality Theory
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
M
Python Why is spaces equal to tree_height-1 in the Christmas tree code in Python?
Hey! :giggle: I found online the following code for a christmas tree in Python : tree_height = input("Enter the tree height : ") tree_height = int(tree_height) spaces = tree_height-1 hashes = 1 stump_spaces = tree_height-1 while tree_height != 0 : for i in range(spaces)...- mathmari
- Thread
- Code Explanation Python
- Replies: 5
- Forum: Programming and Computer Science
-
I want to write my own Monte Carlo code for Neutron transport
Hi, i would like to write my own MC code in order to simulate the transport of Neutrons in Nuclear reactors. I know the basics of MC and i have already written a code for homogeneus reactors, my problem is the generalization to more complex geometries made of different materials, such as fuel...- mark_bose
- Thread
- Code Monte carlo Neutron Transport
- Replies: 11
- Forum: Nuclear Engineering
-
How to understand this "decompiled" program?
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...- fluidistic
- Thread
- Code Program
- Replies: 9
- Forum: Programming and Computer Science
-
I Is There a Hidden Pattern in This Sequence of Numbers?
I have been trying to find a pattern in this sequence of numbers: 72.1, 25.2, 35.1, 58.3, 164.14, 99.8, 23.1, 51.5, 13.2 I have tried every method I can think of like finding the mean, putting them in numerical order, trying to see if the differences between each number has any correlation (It...- jrrunge98
- Thread
- Code Numbers Patterns Puzzle
- Replies: 7
- Forum: General Math
-
R
Resetting PC & Visual Studio Code - Need Help!
I tried resetting the PC and reinstalling visual studio code and that does nothing. Any advice would be helpful.- rgtr
- Thread
- Code pc Visual
- Replies: 3
- Forum: Programming and Computer Science
-
A
Can DRAGON/DONJON Code Handle Complex Boron Compositions in PWR Analysis?
Hello Everyone, Hope you will be with good health in this situation. I am Ali and i need some help regarding DRAGON/DONJON Code for PWR Analysis if anyone help me i will be very glade Regards Ali- Amjad78
- Thread
- Analysis Code
- Replies: 8
- Forum: Nuclear Engineering
-
How can I get the RUN button in Visual Studio Code to turn GREEN again?
I have been using Visual Studio Code for a couple months now and it has been fine. When I want to run some code, there is usually a little green triangle button in the top right corner that I can click on. A few days ago, that triangle turned white only for Python files (it is still green for...- SamRoss
- Thread
- Code Green Latex Python Visual
- Replies: 15
- Forum: Computing and Technology