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. grandpa2390

    Why won't my Matlab code work?

    Homework Statement I need to write a program in Matlab that accomplishes this graph: I keep getting an error on Line31 Column 161 about unexpected parenthesis. They look balanced to me. If I take one away from either side, I get an error that I am short a parenthesis. I also need to change...
  2. C

    Weights and interpolation -- Replicating Python code with hand calculations

    Hello everyone. I have a Python code which calculates, given a continuos uniform random variable U(-1,1), the order of a interpolation polynomial and a set of points the evolution of a function of this random variable. i.e. v0 = cp.Uniform(-1,1) t = np.linspace(0, 10, 10) order=1 . . . plt.plot...
  3. J

    Magnetostatics experiment flowchart - How can I improve this

    Homework Statement I'm attempting to write a FORTRAN program that calcuates the magnetic field, B, at any point outside of a bar magnet. I will be using a simple first order euler scheme for numerical surface integration. Homework Equations Here is the exact method I will be using...
  4. Math Amateur

    LaTeX Latex Code for One Set Minus Another .... .... A\B .... ....

    Recently I posted the following text on the Analysis forum ..." ... ... In order to demonstrate that K is closed, we prove that \mathbb{R}^n\K is open. Indeed, choose y \notin K and define O_j = \{ x \in \mathbb{R}^n \ \mid \ \mid \mid x - y \mid \mid \gt \frac{1}{j} \} for j \in \mathbb{N}...
  5. P

    MATLAB Help with MATLAB music code | Signals & Systems

    For my signals and system class were creating music. I am given a structure with three variables, frequency/notes, duration, and pulse. ex: frequency(in note numbers which i then convert to frequencies)[44 45 47 50...]. duration[2 1 1 3 4...] with pulse duration being .25s and pulse[1 3 4 5 8...
  6. Math Amateur

    LaTeX Latex Code for a Parenthesis ....

    In a recent post on the Cauchy-Schwarz Inequality I wished to "size" the parentheses adequately in the expression x = \frac{ \langle x, y \rangle }{ \mid \mid y \mid \mid^2} y + ( x - \frac{ \langle x, y \rangle }{ \mid \mid y \mid \mid^2} y ) ... ... but in order to use \left and \right I...
  7. S

    Fortran Porting Python Code to Fortran for Parallel Computing

    I have a simulation that involves a lot of dense linear algebra with a lot of complex arrays, that was written in python's numpy and then sped up with cython. Unfortunately I'm stuck with python's GIL (global interpreter lock), which prevents the use of numpy with multi-threaded code. I'm...
  8. Telemachus

    Fortran Transport Equation code, Fortran77

    Hi. I have written a code to solve the one dimensional one group (a fixed velocity is considered for the particles) time independent transport equation. The code uses the ##S_N## discrete ordinates method, a Gauss-Legendre quadrature in the angular directions, and a Diamond Difference formula...
  9. Hi Im Paul

    Python What's wrong with my bisection method code?

    Hello, I am assigned to write a code using bisection method (aka binary search method) The equation is 10sin(x) - x^3 - N where N = 1,2,3,4,5,6,7 My code is from math import sin def neg(a, b): return a*b> 0 def bisectx(funcx, lowx, highx,n): assert not neg(funcx(lowx,n), funcx(highx,n))...
  10. C

    MATLAB Help: Convert Matlab to Python code

    I'm working on a convolutional neural network project that classifies histopathological images of breast tumors. All my code is in python. Part of the image preprocessing involves appearance normalisation to account for the variation in histological staining. The only code for the preprocessing...
  11. Ygggdrasil

    Semi-synthetic organism with an expanded genetic code

    All life on Earth stores its genetic information in DNA using just four nucleotide letters: A, T, C, and G. Research published this week in the journal Nature describes how scientists engineered a bacterium to incorporate two new letters into their DNA (which they call X and Y, pictured below)...
  12. D

    LaTeX Sample problems; Simple Limit (Epsilon - Delta proofs) Latex code included

    Remember to use the appropriate packages; these are in similar post if a mod wants to add the link if you choose to use Latex. Here is the PDF \begin{document} \begin{center} {\LARGE Epsilon-Delta Proofs \\[0.25em] Practice} \\[1em] {\large Just for practice, don't use Google to cheat!}...
  13. D

    MATLAB Matlab Sim Code for ODE & Gillespie for Reversible Reaction

    Here is the code you input into matlab. Aini etc, are the initial values of the population densities. A for predator, B for Prey. % example for ODE and Gillespie % one reversible reaction b1 = .033; bo = .00047; a1 = .0022; ao = .00055; Aini = 5168; Bini = 34; %% Basic ODE simulation...
  14. pairofstrings

    Operating system concepts in an app by Linux System calls

    Before I begin learning what System Calls, Kernel, and Operating System is, I want to confirm that Operating System concepts like Multi-threading, Concurrency, Parallelism, Scheduling, Memory Management, Process Management, Network Management, Device Drivers can be implemented by using Linux...
  15. D

    LaTeX Modeling 3 species using omnivory models. Latex code is included for the proof of continuity, etc

    \chapter{Sensitivity Analysis} The first step in our method to obtain the sensitivity of each parameter value is to differentiate the right hand side of each model with respect to each model parameter. The partial derivatives for the right hand side of our linear response model...
  16. D

    MATLAB Matlab code for a Gillespie type reaction (model) with wolves and elk.

    Copy and paste if you want to use any of this code. Its a simple iteration of converting biomass of elk into new wolves. % example for ODE and Gillespie % one reversible reaction b1 = .033; bo = .00047; a1 = .0022; ao = .00055; Aini = 5168; Bini = 34; %% Basic ODE simulation dt = 0.01...
  17. PainterGuy

    MATLAB Fixing a Matlab Code: Help Needed for Fourier Transform Calculation"

    Hi Could you please help me to fix the code below? I know that the code is completely wrong but I have tried to write it down so that you can get an idea what I'm trying to do. Thank you. %%file name fourier.m clear all; close all; clc; f = 0; %% 0 Hz to 100 Hz, with 0.1 step...
  18. D

    MHB Building thesis or dissertation using package\style code.

    The code below is the the main thesis style, know as muthesis.sty; It is a style to allow Title, Signatures, Dedication, Table of Contents, Main Matter (Chapter and Sections), Biblio., and approval letter. Edit it to your liking; just make sure all the files are containted within the same...
  19. F

    Converting Simulink model to C code, integration

    Dear Forumers,Given a simulink model: http://www.femm.info/Archives/contrib/images/TransientLoudspeaker/SimulinkOverview.png I would like to implement fast code for it.I have no access to matlib or simulink at all, so I tried to implement the simulation in C code. Code for the block...
  20. J

    How can I integrate sinusoids in python code using FFT?

    Hello, Thank you for taking time to read my post. I have a discrete set of data points that represent an acceleration signal. I want to take the integral of this set of points twice so as to get a function which represents the position over time. To accomplish this, I have taken the FFT of the...
  21. M

    Fortran Fortran Code problems linking to LAPACK library

    Hi, I have a main Fortran code (*.f90) which can calculate eigenvalues and eigenvectors using LAPACK library. Unfortunately, i can't excute this program because i can't link it to the library. I'm using Code Blocks as IDE environment. Any help please.
  22. PainterGuy

    LaTeX Share Latex Code Easily: Tips and Tricks

    Hi I use Scientific Workplace to write down math equations and also to create documents involving mathematics and to do calculations. Although most people use it for writing science articles, I've found it extremely helpful for whatever little bit of mathematics I do. I face a problem when I...
  23. I

    MATLAB Small matlab code not working. Why ?

    Code is the following : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% xiter=[0.7 20 10]; mubeton=[0.100 0.80 0.70 0.60 0.50 0.25]; muair=[0.05 0.042 0.04 0.032 0.021 0.011]; zl=[5 30 70 100]; fnorm1 = @(d,a0,dmax) (a0*(1-exp(-(0.5*log(d./dmax)).^2))+exp(-(0.5*log(d./dmax)).^2)); fnorm2 = @(d,dmax,DRL)...
  24. M

    LaTeX Printing Code from Python in Latex via "minted"

    Hi PF! I am trying to import code written in Python into Latex via the "minted" package. However, I am getting the error: Package minted error: you must invoke latex with the -shell-escape flag. I tried googling help but I can't figure it out. I'm using Python 2.7 on mac OSX sierra. Any help...
  25. C

    A Ikonal equation integration -- source code request

    Hi. I would like a source code to integrate the ikonal equation. I would like to compute the ray path. Of course I am able to compute the phase refractive index n(x,y). Cartesian system is preferred. Can anybody give me a suggestion? Bye, Carlos
  26. ShaddollDa9u

    Why am I getting 'nope' instead of 'works' when using sockets in Python?

    Hi everyone, I have just started learning sockets in python and I have made the following code: import socket HOST = '' PORT = 8888 def main(): while 1: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT))...
  27. Mzzed

    Understanding 'C Code' & 'No.' in Buck Converter Regulator Datasheet

    I have recently come across a datasheet for a buck converter regulator that uses the terms "c code" and "No." for certain capacitors but when going to the manufacturer datasheets for these capacitors they make no reference to any "c code" or one single number for a capacitor. If anyone could...
  28. FallenApple

    MATLAB Sample Code for Monte Carlo estimation of pi

    Below is the partial code to plot the rejection/accept regions using monte carlo sampling. The context is to estimate pi and plotting is just one part of it. I'm not sure how the ~ symbol can work. scatter(samples(1,~reject),samples(2,~reject),'b.')...
  29. A

    A How to validate a code written for solution of 1D diffusion?

    Consider the conceptual model presented in the attached image, of heat conduction in a bar. There is a heat source at left side and heat is observed at point Ho after a distance L from the source. If we consider only heat transfer through conduction then this problem can be modeled by...
  30. Pushoam

    LaTeX Plain latex code not working in Physics forum

    I have written a solution of problem in LYX. I exported the lyx code as latex plain code. I opened the latex plain code in Tex studio and copied it and pasted it in Physics forum and it didn't work. Can anyone please tell me what should I do? Should I again type the latex code here i.e.Physics...
  31. D

    Which code segment completes this C code?

    Homework Statement This is a question from the test i had today in which we had to look at certain C code segments and deduce which code part is missing in order for the program to do what we desire. Part b) was a short questionnaire to test our knowledge about c types and declarations. Part a)...
  32. jamalkoiyess

    MATLAB How to create distinct circles in Matlab?

    I want to create a plate of distinct circles on Matlab where their radii are generated by randn(1,p) and centers are random. I am currently doing the circles using viscircles, but some of them are overlapping, and since I want approximately 100 ones, this problem only gets worse. How can I make...
  33. R

    A DFT Code for Finite-Temperature Calculations

    I'm interested in calculating density of states (DOS) and band structures for metals in which the electrons have a finite temperature (up to ~ 3 eV). I've read several papers indicating that the DOS shifts with electron temperature, and that DFT can be used to calculate finite-temperature...
  34. M

    LaTeX Efficient Fractional Latex Code for Simplifying Equations

    How can this code be coded by another way? ## \frac {300-270.1}{T-130}## = ## \frac {313.-270.1}{135-130}## And it is also very strange that the right side O.K but left side is not but everything is the same for left and right. #,# \frac {300-270.1}{T-130}## = ## \frac...
  35. M

    LaTeX How does rendering work in web development?

    "You must put special delimiters at the beginning and end of your LaTeX code, in order for MathJax to recognize it and process it. If you want the equation to appear inline with the surrounding text, put # # before and after it. If you want the equation to stand alone in a separate "paragraph"...
  36. V

    Why does not this Erdos-Renyi C code work?

    Homework Statement I need to write an Erdos-Renyi random graph, by using the adjacency matrix (or alternatively list) and calculate the fitness of the graph. Definition: G(n, p) is a random graph with n vertices where each possible edge has probability p of existing.Homework Equations The...
  37. doktorwho

    Review C Code: Find & Resolve Issues in Visual Studio & repl.it

    Hi, i wrote a code and annotated it but i have few problems with it. First it won't run on Visual Studio but it runs fine on repl.it online site which uses a C ide. Second, it seems wrong when i input 5 45 6 -4 8 3 It should print out 8 3 but for some reason it misses out on 3. Could you see...
  38. doktorwho

    Help w/ C Programming Homework - Create Array & Print All Inputs

    Homework Statement I am fairly new to C programming. I need to write a code that creates an array of max 300 numbers, ask the user to input the numbers and then print that array. Homework Equations 3. The Attempt at a Solution [/B] Here is my code #include <stdio.h> void main() { int...
  39. sefiroths

    Java Solar system simulator JAVA source code

    Hi, I'm developing a very simple solar system simulator for educational purpose. I had taken from wikipedia mass, velocity of planet and applied universal gravitation formula and applied to all celestial corps. It works well, but when I add the moon... the moon is like a planet, rotating around...
  40. D

    I don't get a reasonable output for my code?

    I'm trying to plot the probability of error for the following equation using Matlab software, i want to use the command "trapz" for the numerical integration, the problem is that i get a fine shape for the plot, but the values in the y-axis are wrong, the whole curve should be between 0 and 1.2...
  41. JayFlynn

    MATLAB Plotting the tragectory of an asteroid in MATLAB

    I am trying to plot the trajectory of an asteroid in MATLAB using ode23. The only bodies in the system are The Sun, Earth, Mars and Jupiter and their orbital data has been loaded from data files. I have picked arbitrary initial conditions for the asteroid and believe my forces are correct. My...
  42. S

    How to Identify Prime Numbers Using Eratosthenes in C#?

    Mod note: added code tags using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { List<int> number = new List<int>(1000); // int list for 1000 numbers...
  43. S

    Is my code suffering from an arithmetic error?

    What it does is described well in my comments. I'm using decimal, which is more precise than double but has a smaller range of values. https://msdn.microsoft.com/en-us/library/ms228360(v=vs.90).aspx const decimal pi =...
  44. A

    MATLAB Python and MATLAB giving different results for same code?

    I am trying to learn Python by translating my MATLAB codes into Python. My translated Python code is giving slightly different result as compared to that of MATLAB. Although difference is very small but it affects largely the results at later stage. My Python code is import numpy as np import...
  45. T

    What does "Genetic Code" mean?

    According to https://www.ncbi.nlm.nih.gov/books/NBK21950/ and some other sources: 'Genetic code is the set of correspondences between nucleotide pair triplets in DNA and amino acids in protein.' What dose correspondences mean in this regard? I don't understand why nucleotide pair triplets and...
  46. BiGyElLoWhAt

    Java Problem with code, possibly multiple extensions of JFrame

    I am making a simple text editor program. You can load, save and exit, and other things. I have the loading and saving working, but the exiting is giving me a peculiar problem. In my project, I have a gui class that extends JFrame, and I also have an ExitOption class that extnds JFrame. I am...
  47. MathematicalPhysicist

    Trying to compile a source code in C

    The source code is as follows: #include <stdio.h> #include <math.h> #define pi 3.14159265 #define nbin 10000 #define small 1.e-12 int addj(int data[nbin],double *tw,double x,double y,double vx,double vy, int xn,int j,double tc); void billiard(int data[nbin],int nx,int nt,double x); void...
  48. S

    Can someone code review my "Distance between nodes in a BT"?

    Here's the solution I used for an online coding test with a major employer and I got rejected. Let me know about improvements I could make. Thanks. using System; using System.Collections.Generic; using System.Linq; class Node { public int Val { get; set; } public Node Right { get...
  49. T

    Running code using XCode vs Terminal

    I have a C++ code, test.cpp, and am using OpenMPI when running it. I followed the instructions here and it appears to have called OpenMPI correctly. I can compile and run the code perfectly fine from the command line but I just have to specify "TMPDIR=/tmp" before running it, i.e.: $ mpic++...
  50. doktorwho

    Help Writing a Program: Solving Encryption with Matrix and Key Sequence Method

    Homework Statement For our final test preparation we were given a few problems to write and this is one of them: I would be very grateful if you could help me find the easiest way to solve it. Homework Equations 3. The Attempt at a Solution [/B] First let me tell you my plan for writing this...
Back
Top