What is Code: Definition and 958 Discussions

In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication channel or storage in a storage medium. An early example is an invention of language, which enabled a person, through speech, to communicate what they thought, saw, heard, or felt to others. But speech limits the range of communication to the distance a voice can carry and limits the audience to those present when the speech is uttered. The invention of writing, which converted spoken language into visual symbols, extended the range of communication across space and time.
The process of encoding converts information from a source into symbols for communication or storage. Decoding is the reverse process, converting code symbols back into a form that the recipient understands, such as English or/and Spanish.
One reason for coding is to enable communication in places where ordinary plain language, spoken or written, is difficult or impossible. For example, semaphore, where the configuration of flags held by a signaler or the arms of a semaphore tower encodes parts of the message, typically individual letters, and numbers. Another person standing a great distance away can interpret the flags and reproduce the words sent.

View More On Wikipedia.org
  1. 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...
  2. 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...
  3. Adrian Tudini

    Computer code that handles the periodic table of elements

    Hi guys When I ran the Chemical Equilibrium Code from NASA (grc.nasa.gov) to predict the products of a chemical reaction and their concentrations, it says it does not handle certain elements in the database from the periodic table. Is there a computer code that predicts the products of a...
  4. R

    What's the point of having a dress code stricter than business casual?

    Nowadays a lot of people like to fashion themselves in a way that is less traditional. You might see men wear make up or men and women coloring their hair some color that isn't naturally possible. Since society is so free, even among serious scholars (as I see in my department), what is the...
  5. GustavoGG

    Why my code sometimes prints trash and other times not?

    #include<stdio.h> #include<math.h> #include<complex.h> int main(){ float complex a,b,x=2,y,z; printf("Write the real part followed by the imaginary part of your complex number: \n"); scanf("%f %f",&a,&b); z=a+I*b; printf("z= %f + i%f\n",creal(z),cimag(z)); y=cpow(z,x)...
  6. D

    Structure of code for ODE solution in Octave

    The problem of interest at the moment is the solution of a simple damped oscillator problem, xddot+2*zeta*wn*xdot+wn^2*x = 0 Everything seems to work fine provided I include the values of zeta and wn inside the function that defines the derivative values. But zeta and wn are actually calculated...
  7. H

    MATLAB My Crank-Nicolson code for my diffusion equation isn't working

    I'm trying to solve the diffusion equation in spherical co-ordinates with spherical symmetry. I have included the PDE in question and the scheme I'm using and although it works, it diverges which I don't understand as Crank-Nicholson should be unconditionally stable for the diffusion. The code...
  8. S

    Mathematica Wolfram Cloud Notebook : Indenting Code

    I tried adding spaces manually to indent a multiline code block in a notebook on Wolfram Cloud (www.wolframcloud.com). It throws the "Set: Tag Times" error. How can I indent code lines (preferably manually, but auto will also be fine).
  9. person123

    MATLAB MATLAB Code For Analyzing Experimental Data

    Hi! I'm working on MATLAB code to analyze dat for a specific project, but I'm curious if it could made useful for more general purposes. Here's a bit of background on the project: I'm an REU student and I was assigned to analyze data for a recently conducted experiment. The experiment took...
  10. Arman777

    Best VS Code Themes: Light & Dark Modes, Python IDLE Colors

    I am searching for VS code themes that is in light or in the dark mode the codes will have different colors such as colors in python idle. Any suggestions ? Thanks
  11. R

    I Generating Irrational Ratios in Wave Simulations

    I am trying to write an algorithm that generates two random numbers in a given interval such that their ratio is an irrational number. I understand that all numbers stored on a computer are rational, so it is not possible to have a truly irrational number in a simulation. So, instead I am...
  12. F

    Coding theory: Find the right code word

    Error correction can be performed on 1010101 after reception, i need to find the right code <br> i know that the polynomial for the received code is $$x^6+x^4+x2+1$$ when i try to find the error pattern,by long division, $$r(x)/g(x)$$ the remainder is $$z^2+z^2+1$$ xor $$z^2+z+1$$ so the...
  13. platosuniverse

    B Is spacetime a quantum error correcting code?

    This is a fascinating discussion. I know some people don't want to debate this or they can't debate it but the truth doesn't care about your feelings. This isn't speculative, it's backed by Scientific research. First paper. Is Spacetime an Error Correcting Code. Published in the Journal of High...
  14. user366312

    Explaining the Source Code for Calculating Stationary Distribution in R

    Summary: Kindly explain the source code in R which meant for calculating stationary distribution of a transition matrix. I am trying to understand the following source code meant for finding stationary distribution of a matrix: ### Stationary distribution of discrete-time Markov chain ###...
  15. user366312

    What is the purpose of using the mod operator in this line of code?

    #================================================================== # Build the transition matrix for random walk on n-cycle #------------------------------------------------------------------ n <- 25 # we are creating (nXn) transition matrix r1 <- c(0, 1/2, rep(0,n-3), 1/2) # create same...
  16. Danny Boy

    Animation using matplotlib query

    I am trying to animate a plot of two distinct points (blue and green points) moving about the complex unit circle using Python's Matplotlib library. The problem I am having is that the animation does not remove and update the previous data points but rather sequentially smears it on the unit...
  17. davidfur

    MPI parallel code speed-up sucks

    Hey guys, I parallelized my code, written in C++, with the MPI library. Unfortunately, the speed-up I get saturates at x6, with increasing number of cores. Whereas, in theory, the speed-up should really be nearly linear. To understand where the bottlenecks come from, I drilled down the code to...
  18. hagopbul

    Java Why is this Java code not working?

    Hello all: I am reading a comutacomputa physics book and trying a code from it in MATLAB it is not working and due to my lack of knowledge in this field I can't see where is the mistake hope you can take a look import java.lang .*; public class Motion { static final int n = 100000, j =...
  19. S

    Large datasets - how to handle / alternatives

    Hello, I am trying to do the following: I have two inputs that are very large files - I extract the first column of each so I have two vectors of ~2-5mil by 1. This is timing information. The goal is to extract the indices of each vector where the time in one vector is within a certain...
  20. jedishrfu

    Microsoft Release the Calc.exe Source Code

    in this article on Ars Technica, Microsoft has released the source code to the Calc.exe app calc.exe is now open source; there’s surprising depth in its ancient code https://arstechnica.com/gadgets/2019/03/calc-exe-is-now-open-source-theres-surprising-depth-in-its-ancient-code/
  21. Dimitris Catzis

    Proper simulation code for a Nuclear Reactor core

    Hi, I want to make a simple nuclear reactor core simulation to calculate the thermal power production. Is there any open source code with interface (or not) that you recommend to use? The core have cylindrical shape with Uranium( up to 90% enriched) molybdenum fuel,Beryllium reflector and one...
  22. W

    What condition is this code testing for (Python 3.7)

    Hi, I am taching myself Python 3.7.2. I think I get how 'While True' statements work, but I am having trouble making sense of this. The program runs, but I would like to understand well what is the condition being tested. (From 'Automate the Boring Stuff with Python) We have a dictionary of...
  23. opus

    Electronics How does this Adruino Code Work?

    Following up on my previous thread, I found a project that I can do for this Arduino. Its really just a little synthesize keyboard thing, but I'm wondering how the code works. Kind of just the logic behind it. I know that some of the stuff at the bottom deals with tones and frequencies and...
  24. D

    I am trying to build a radio to transmit Morse code

    I am trying to build a radio to transmit morse code. I have built A wien bridge oscillator on a breadboard. I think the wien bridge Oscillator works. How long should The antenna be?
  25. J

    MHB Guessing a three digit pin code from an 8 key keypad

    Hello, the problem is as follows. I'm not sure if it is a permutation or combination problem. It says if a thief steals and ATM card and must randomly guess the correct three digit pin code from an 8 key keypad. Repetition of digits is allowed. What is the probability of a correct guess on the...
  26. A

    LaTeX What is the LaTeX code for large brackets and parentheses?

    What is the latex code used in this forum of large bracket (and parenthesis) and subscript and superscript? For example, the below parenthesis is too small: ##(x1 + \frac{1}{\frac{1}{x1}})##
  27. hnnhcmmngs

    Executing code, which statements are true?

    Homework Statement Question 1: def convert(degrees): degrees += 273.15 return degrees degrees = 10 print(convert(degrees)) Which of these statements are true after the code executes? (There may be more than 1 correct answer) a) The value of degrees in the main namespace is 283.15...
  28. R

    Unexpected error while running hello world code on vs studio

    Homework Statement : [/B]Write a C program to print hello world 2. The attempt at a solution: I am completely new to programming. I am learning C at present. In my college, we use linux. Since my pc has windows installed so I am using cygwin terminal to use linux commands from windows. I am...
  29. Suppaman

    Our understanding of the laws of the genetic code?

    I just did my morning exercise while listening to a short youtube talk on genetics. I do not understand it but what struck me was it seemed to be on the level of an EE discussing OHM's law, Transistor theory, and digital logic terms. Now I know all the rules that make my PC on which I am...
  30. C

    How can I optimise my N-body Simulation code further?

    Homework Statement I wrote a brute force O(N^2) N-body code in python and I am not happy with its performance despite the fact that I have cythonised the calculation heavy parts as well as implemented MPI. I am currently out of ideas for how to optimise it further, can I get some advice...
  31. J

    Comp Sci Help with solving first order ODE using a simple Fortran code, please

    I am trying to solve the following first order ODE using a simple Fortran code : $$ ds/dt=k_i * \sqrt{v}$$ where both (ki) and (v) are variables depending on (h) as follows $$ k_i=\sqrt{χ/h^2}$$ $$v= \mu h$$ where (μ) and (χ) are constants. (the arbitrary values of each of them can be seen...
  32. Baynie

    MATLAB Code: Stationary Schrodinger EQ, E Spec, Eigenvalues

    Hello everyone, For weeks I have been struggling with this quantum mechanics homework involving writing a code to determine the energy spectrum and eigenvalues for the stationary Schrodinger equation for the harmonic oscillator. I can't find any resources anywhere. If anyone could help me get...
  33. jim hardy

    Auto/Motor Toyota paint code -- Here is where to find it on the vehicle

    Today i learned where to find the Toyota paint code. It's on the VIN sticker which is on driver's side doorjamb. Bottom left corner of the sticker has a "T/C" followed by a 3 character code. If anybody needs some touchup paint for a gray Toyota with code 1H5 i have a fresh 1 oz vial that i will...
  34. P

    Newbie questions about the NEC code and flexible "dry use" metal conduit

    This is only my second post and I pray it is deemed on topic. This forum has given me a lot of insight however a forum search left me without answer here. Most likely because you are all WELL above my knowledge level. I'll try to make this short and again pray I'm on topic.. I live in florida...
  35. prashantakerkar

    Calculators Morse code embeded in Software applications

    Do you feel it is useful to embed Morse code in specific software applications? Thanks & Regards, Prashant S Akerkar
  36. Z

    How to Manually Test Solidity Code Converted into F-star?

    Hi, I read a research paper for verification and validation of solidity code. It uses F* (F-star). However, it has to convert the solidity code into F-star. I can't find the converter. Can some body please guide me how to manually test the code? Code is given below: contract MyBank {...
  37. grandpa2390

    How exactly do computers execute code?

    one thing that has always miffed me is how is it that the hardware carries out the coded instruction. the code is 1's and 0's, and if I have understood anything. 1's and 0's are on and off. but how is the computer flipping the circuits on and off? something must tell it to do that. but then what...
  38. R

    MATLAB Finite element skeleton code for matlab

    Hello, Does anyone know if a finite element skeleton source code exists. Finite element can be used for structural memebers, gas dynamics, etc. But the over all stepping software is the same and then just input the core equations. My application is for pseudo one dimensional compressible...
  39. adamaero

    What is the ASCII code an ultrasonic sensor will output?

    Problem statement For an ultrasonic sensor (MB7380) sending 8 data BITS, no parity and one stop bit, what is the ASCII code it will give for a certain distance like 0.15 meters (0.5')? maxbotix.com/documents/HRXL-MaxSonar-WR_Datasheet.pdf#page=2 Attempt at a solution I do not know how to...
  40. S

    Finding errors in a section of microprocessor assembly code

    Hi guys, apparently I've got both a linear and a subroutine programming error in the code below from lines 20-35? Could someone point me in the right direction. I think one might be the 'CALL wait' instruction, which should be 'CALL delay'? Not really sure as new to this, any help would be much...
  41. T

    MATLAB Convert R Code to MATLAB for Detrended Cross Correlation Analysis

    Homework Statement I would like to convert this R code into matlab. This code perform a calculation of beta coefficient based on Detrended cross correlation analysis. Homework Equations require(tseries) require(fracdiff) require(matrixStats)DCCA_beta_avg<-function(y,x,smin,smax,step){...
  42. B

    Non-negative matrix factorization code

    Hello, I'm looking for the non-negative matrix factorization (NNMF) source code. I checked several linear algebra libraries (e.g., LaPack, mkl), but it seems that this subroutine is not available. Does anyone know where I can find this source code...
  43. P

    Frenkel/Smit: Exercise 10 - MD NVE Code, PBC

    Homework Statement I am working on a MD code (http://www.acmm.nl/molsim/frenkel_smit/Exercise_10/index.html) which uses the position Verlet algorithm to integrate the equations of motion and a velocity rescaling algorithm for initialization in periodic boundary conditions. I wondered why...
  44. S

    Constructing K-Maps & Gray Codes w/ 2, 3 & 4 Bits

    I know how to construct a Gray code for k-maps with 2 bits, 3 bits, and 4 bits. I also looked at the Wikipedia page for Gray code that explained how to construct an n-bit Gray code from the Gray code for n - 1 bits. What I’m still confused about is where to place the bits. Should the bits be...
  45. ChrisVer

    Question about running "executables" without source code

    I have a simple question I guess, basically by how classes etc are formed. In general a class in C++ has some categories such as private, public and protected, which okay everyone knows/can find what they are meant for. E.g. a private member will not be accessible outside the class member...
  46. phyzguy

    Open source adaptive mesh code

    I want to start a project that requires parallel code for adaptive mesh refinement. I don't want to re-invent the wheel, and was hoping to leverage an open source library as a starting point. Does anyone have experience with any of these codes and could make a recommendation? At this point I...
  47. pairofstrings

    What should be the rules to write excellent code?

    Hi. I know few rules that let's me write great code: 1. "don't pollute the global namespace" when I sit down to write JavaScript code. 2. SOLID 3. KISS 4. Liskov's Open-Closed principle Can someone help me complete the list of such rules? Thanks! Have a great day!
  48. kolleamm

    Converting a DFA to efficient code?

    I've created a DFA for a game character's dialogue. I could probably code this using "if, if else, for, while" statements, but I feel like this would be impractical since there are about 20 states with 4 different inputs each. Any ideas on how I could make this work? I would really like to...
  49. grandpa2390

    MatLab Code for Baseball Not Working

    Homework Statement I am trying to create this plot in MatLab I'm starting out doing the simplest one, no drag, no wind. simple kinematics, right? but I can not get my code to run. Homework Equations Kinematic Equations The Attempt at a Solution close all clear all clc %%defining variables...
Back
Top