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.
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...
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...
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...
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...
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...
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}...
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...
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...
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...
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...
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))...
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...
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)...
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!}...
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...
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...
\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...
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...
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...
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...
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...
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...
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.
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...
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...
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
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))...
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...
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.')...
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...
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...
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)...
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...
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...
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...
"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"...
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...
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...
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...
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...
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...
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...
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...
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 =...
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...
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...
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...
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...