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

    MHB Hamming Code: Need Help Fixing Mistakes? Get Expert Assistance Here!

    Hey guys I've attampted to do this as best I can but i need some help, becasue i know there are mistakes i have to fix.
  2. F

    Java Solve Confused Java HW: Generate 225 Samples Size 625 Random Nos U(10,22)

    Generate 225 samples of size 625 random numbers from U(10,22). For each of these 225 samples calculate the mean. a) Find the simulated probability that the mean is between 10 and 11. b) Find the mean of the means. c) Find the standard deviation of the means. d) Draw the histogram of the...
  3. T

    Matlab code running loops to meet conditions

    Homework Statement This is not homework but I am trying to solve a problem to see to general a set of numbers for the grassmanian equations to use in something else.[/B] I have five variables a,b,c,d,e. a-b,a-c,a-d,a-e,b-a,b-c,...etc so that none of them are the same so it generates all...
  4. foroughi

    Using the Makxsf code to produce a library

    I'm studying in the field of library production for code MCNP. I use makxsf Code to do this operation. I have a simple example . I've produced library by makxsf for this simple example. I've encountered some problem now. keff has decreased in the higher temperatures suitably, but keff has...
  5. kroni

    Tip for people who optimize their code

    Hello everybody. I am looking question for programming and computer science since 6 months and i see a lot of threat speaking about time consumption and optimization. I just want to say that INTEL COMPILER and INTEL PROFILER are available on intel website for FREE as a student license without...
  6. Matterwave

    Fortran [FORTRAN] How did I screw up my code?

    Hi guys, there's a bug in my code which I've been trying to get rid of for the last 2 weeks. I'm completely out of ideas now on what it is so I have to turn to you guys for help. The code is here: module helectron use params use parallel !* electron density parameters integer ...
  7. N

    Mathematica code for multinomial expansion

    Hello, I m looking for a mathematica code for the multinomial expansion of the general case of (let's say m sum terms given in a power of n), e.g., the code for the 1st equation in http://en.wikipedia.org/wiki/Multinomial_theorem Any help would be useful. Thanks
  8. cpscdave

    [Python] include block of code

    In c I quite often build header files with a bunch of predefined data. Fill it with structures or what not. Then to include that information in my program its a simple #include "myHeader.h" Is there a way I can do this in python? I've created another file "myHeader.py" Have put in some code to...
  9. W

    MATLAB Converting Excel formulae into Matlab code

    Hi everyone, I will start off by saying that I am a complete novice in Matlab and prefer to use Excel however the data that I have requires more computing power than Excel can provide. I have 16 sets of data with over 70,000 rows and 9 columns. The first column is a time series separated into...
  10. A

    Design code for structural steel materials

    Bidders propeses ASTM A36 material istead of S275 J2 or S355ML/NL for structural steel (Piperack, Equipment Structure, etc.) on the basis of international standards for most optimal and economical design. Is it really optimal? pls explain why
  11. J

    Normal distribution starting with a uniformed distribution

    Hi comunity! I need to make a code o a normal distribution of velocities, starting whit a random secuence uniformly distributed between [0,1]. I am using FNT95, with Plato. I want to obtain a ''for'' bucle with I=1,N for the velocities. It is importan for the distribution to have sigma defined...
  12. G

    Morse Code Project: Building Circuit for 7 Segment Display

    Homework Statement Hi everyone. I am currently embarking on a Morse Code project which involves building a circuit to display Morse codes, eventually displaying the Morse code with a 7 segment display. I am currently stuck at the first stage as I am not sure of what to do, i.e. what chips to...
  13. G

    C/C++ VCSEL, spin-flip model, c or c++ code?

    Is there any c or c++ written spin-flip model for simulation of dynamics in VCSELs available? Thanks.
  14. Matterwave

    Fortran [FORTRAN] Code misassigning values

    Hi guys, I can't figure this one out. Here I am working with a piece of code which should read in a grid of 2 arrays, a radius array and an electron fraction array. The code looks like this: subroutine varelec_init(varelecfrac,elecprofile,effilename,elecfracname) integer ...
  15. thankz

    Simple Pivot Table Code Example: Step-by-Step Guide

    where can I find an example of a SIMPLE snippet of code used to create a pivot table?
  16. A

    Write PEP8 Code: Display Full Name & Major

    Homework Statement You are to write a program that will display your full name and your major (First Name, Middle name and Last Name) on the Terminal Input/output (I/O) screen.[/B] Homework EquationsThe Attempt at a Solution I was trying to get the screen to say "What's your first name?"...
  17. A

    Write a Pseudocode for the following instructions:

    Homework Statement - Calculating the factorial of a number N - For simulating the roll of a die 200 times (include the calculation for the relative frequency of the number 4 in the upface of the die within the 200 rolls) Homework Equations None? The Attempt at a Solution I am taking this...
  18. Alexi-dono

    [python] How can I get my OS to pick this up as entropy?

    So I am going to be making some keys; and I want to make them more random... So I made this: #I know that the code is pretty crude, but it works. #P.S. it is an infinite loop, run at your own risk import random from random import randint import string import time x=1 n=randint(5,90)...
  19. beyondlight

    MATLAB Optimize code for a blob-detector (MATLAB)

    The blobdetector consist of the following functions: gaussImage: Filters a image with a gaussian filter gaussPyramid: Uses gaussImage to filter the same image several times with different std. diffOfGaussians: Uses gaussPyramid to compute the difference between consecutive filtered images...
  20. N

    C# This[r, c] saw this in some C# code, how is it possible?

    Hey all, I was looking at some example code where they said "this[r, c] = sourceMatrix[r, c];" where sourcematrix is double[][] but its in a custom local class, the code runs and works. but I am confused as to what "this[r, c]" does, how can a custom class be an array of doubles at the same...
  21. P

    C/C++ How Should I Modify My C++ Code to Start Time Calculation from Zero?

    #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { cout << "Enter the total time: "; double t; cin >> t; cout << "Enter the step-size: "; double step; cin >> step; double steps = ceil(t/step); const double a = 9.806...
  22. J

    A mathematical way to analyze code?

    In the last semester I was taking a microcontroller programming course. For the programming assignments, our professor would hold an extra credit competition where we competed for the smallest, fastest, and most energy-efficient code for the same application. It got me thinking. What I'm...
  23. D

    Can You Decode This List of Numbers into a Message?

    The encryption method is extremely simple and the first letter is already in plaintext (the character number that is). The plaintext is plain english. [79, 32, 79, 39, 45, 39, 112, 21, 50, 64, 37, 5, 107, 4, 36, 87, 35, 81, 48, 94, 57, 92, 46, 93, 125, 9, 102, 70, 42, 69, 51, 86, 92, 5, 106...
  24. I

    C/C++ C++ Code Display: Understanding Output of Exam-Related Question

    I came across this question while studying for a C++ exam. What is the screen output of the code? #include <stdio.h> int main(){ int i, counter=0; for(i=0;i<100;counter++){ i++; ++counter; } cout<<i<<' '<<counter<<'\n'; return 0; } What will this code display...
  25. P

    C/C++ C++ Programming Problem: Adding Streams to a Pre-Existing Code

    I have been given a project to modify my pre-existing code to satisfy these guidelines: - Create a file called "sides.txt" and put it in the same folder as your program. - The file contains multiple lines with each line having the three sides, separated by white spaces, e.g., 3 4 5 6 8 10 5...
  26. ahsanamin

    Code for Simulation of SDEs using Girsanov Theorem

    http://wilmott.com/i/dominant/block.gif I have worked with generation of transition probabilities of mean reverting CEV type stochastic differential equations using Girsanov theorem. A variable grid is generated and Transition probabilities are calculated from the well known analytic...
  27. I

    Inductor Color Code: 68mH Violet Gray Brown Silver

    hi, i just bought an inductor that was labeled 68mH, but the colors are violet gray brown silver. doesn't this make it 680uH (0.68mH)?
  28. L

    Need help understanding part of this assembly code

    CHARI 0xFE,d ; read 1stchar CHARI 0xFF,d ; read 2ndchar LDBYTEA 0xFE,d ; load 1stchar ADDA 0xFE,d ; add 2ndchar to low byte(big endian!) ANDA 0x0F,i ; keep low 4 bits ORA 0x30,i ; convert to ascii STBYTEA 0xFD,d ; store for output CHARO 0xFD,d...
  29. Math Amateur

    LaTeX Latex code for the functor Hom_R( _ , X)

    Can someone please help me with the correct Latex code for the functor Hom_R( _ , X) When I try to get the correct symbol for the functor I get Hom_R( _ , X) , that is I get a symbol without the _ displayed. Can someone please help me with the correct code? Peter
  30. STEMucator

    [C] The usage of ? and : when cleaning up recursive code

    I noticed some interesting utility in using ? and : when writing some recursive code out of boredom. I thought I'd share some of the code for those interested. These were written in C, and I must say they simplify a lot of code. #include <stdio.h> #include <math.h> /* Return x raised to the...
  31. I

    MATLAB Line following Matlab Code. How to Start?

    So we're using NXT 2.0 and MATLAB to program a robot to follow a white line through a maze. I'm using a light sensor, color sensor and an ultrasonic sensor in the process. Any programming/Coding ideas of how i should start? This is the maze...
  32. A

    MATLAB Could you check (if statment block) in my MATLAB code please?

    function RunlogisticOscilnumericalfisherfixedn0omega omega=1; N0=1; k = 10; A = 1; p0 = 0.1; tspan=(0:0.1:4); [t,p] = ode45(@logisticOscilnumerical,tspan,p0,[],omega,k,N0); figure(1) plot(t,p) xlabel('Time') ylabel('p') P = @(T) interp1(t,p,T); f = @(t) ( ( A.*( ( N0.*...
  33. Math Amateur

    LaTeX Latex code for the class SE of short exact sequences in Mod_R

    I just uploaded a post on the class SE of short exact sequences in Mod_R ... and tried to use Latex Code to achieve the same fancy script for S and E as Paul E Bland used in his text "Rings and Their Modules" ... but seemingly did not achieve the right script for S (E seems OK, or at least...
  34. C

    How to use 3D FDTD code for 1D problem?

    Hello, I have a three dimensional FDTD code. The problem I have for simulation is one dimensional. How can I use this 3D FDTD code for the 1D problem. The 1D problem is like this: in one-dimension half of the problem space is filled with a dielectric medium and the other half is free-space. A...
  35. S

    Fortran Error 6404 when running fortran code in visual studio

    I am trying to compile several libraries of FORTRAN code and getting the error message as can be seen in the screen shot. As I do not have any experience with FORTRAN I am not sure what is wrong in the line highlighted line. Any help would be greatly appreciated! Thanks a lot! :-)
  36. A

    MATLAB MATLAB code for Computational Fluid Mechanics

    Hello guys, I'm writing to get some help on an exercise I've been thinking but I can't get to solve. I have to write the code for the Example 8.5 of the book White, Fluid Mechanics. Here is the problem and the solution I have to obtain. It is about one duct that has three sections in which I...
  37. C

    Write a state that will compute f=x/y^2 in maple

    Homework Statement Using maple cw version, trying to write a state that will compute f=x/y^2 over several iterations. y^2 is changing but x is dependent on a value input my user. I don't really know how to write the loop? I need the loop to run on an interval of different y values that I can...
  38. F

    Python code using Process class

    Homework Statement I have the following code (please see below). I want it to return [2,4,6,8,10] which is the function evaluated at the given list [1,2,3,4,5]. I want to do this using the process command. My problem is: print A returns [None, None, None, None, None] But I want it to return...
  39. F

    Unbreakable Code: Moby Dick Method

    I heard this method of creating a code described in a movie a long time ago. Two people want to send encoded messages to each other by mail(or now email). To encode their messages they both buy the same novel , let's say Moby Dick. To write the message they use a system where a triple set of...
  40. STEMucator

    Why Does One Piece of Code Run Slower Than Another?

    Homework Statement Not homework, but I'm wondering why a certain piece of code seems to run faster than another. Homework EquationsThe Attempt at a Solution I'll mention a few relevant structs to be more clear: struct intlist { int *elems; int capacity; /* Maximum number of elements...
  41. B

    Digital design code converter help

    Homework Statement design a code converter that converts a decimal digit from the 8 4 -2 -1 code to BCD. Homework EquationsThe Attempt at a Solution so i listed out the BCD order from 0 to 9 and listed the weighted 8 4 -2 -1 code so that the weights would equal to the BCD equivalent. 8 4 -2...
  42. G

    Asymptotic running time of code segments

    I'm trying to grasp some basic concepts of analyzing code segments. Not sure if I have the right thought process. Can't find many examples online. Homework Statement A.) for (i=1; i<n; i++) for (j=1; j<n; j++) return 1 Guess: Theta(n) because both loops go to (n) and they're...
  43. J

    Do Empty spaces/text slow down code?

    If you are say running a for-loop with 5000 cycles, will 2 empty spaces and say 3-comments slow this operation down?
  44. T

    C/C++ How to write C++ code using SGP4 to propagate satellite position

    Greetings all ! I really hope this is the right sub-forum for my question, I have chosen it because I've seen TLE being mentioned a couple of times around here. I have done some reading on astrodynamics and orbital mechanics, but I am relatively new to coding. I would like to write some C++...
  45. H

    Algebraic coding theory- Golay Code

    Homework Statement does anyone know why C24 (the extended Golay Code) doesn't have any words of weight 20? I know that it only has words of weight 0,8,12,16, & 24, but why is 20 skipped here? Homework Equations I am asked to deduce this from the fact after I have shown that the code does...
  46. J

    Java Why does the output show 1 and not 3?

    Consider the following java code int a=1; if (a != 0) { int a=3; } System.out.print(a); What is the output A. 0 B. 1 C. 3 D. No output. A compilation error occurs The answer is B. I want to ask why the output shown will not be 3. As the 1 is not equal to 0, should the ' int a '...
  47. mesa

    Trouble with understanding MatLab code

    Homework Statement A = [1 3; 2 4]; %Okay, so we are starting with this matrix N = 2; %Here we are setting N equal to '2' for k = 1:N %So here we have a 'for loop' for variable 'k' starting at 1 in increments of '1' up to 'N', which %happens to be '2' so once this function gets to '2' it...
  48. M

    MATLAB Why Does Matlab Say Matrix Must Be Square When Using mpower?

    When running the following code on Matlab: >> y(i) = y(i-1) + (0.5 * y.^3 * exp(t^2 + t))*h I get the error: ? Error using ==> mpower Matrix must be square. It seems fairly simple but I'm not quite sure what I'm overlooking. Any help with regards to what I may be doing wrong would be...
  49. T

    Request for SCDAP source code

    :(as a student, any help would be appreciated.
  50. Greg Bernhardt

    Read this before posting code GeSHi Syntax Highlighter

    Physics Forums now supports GeSHi syntax highlighting for nearly 200 programming languages. Simply hit the + button on the editor. Select the code option, use general code, type in your code. Then in the first bbcode tag put in the language you want to use. For example: C AREA OF A TRIANGLE -...
Back
Top