Code Definition and 908 Threads

  1. T

    C/C++ Rewriting C/ C++ code in Pascal

    Hello, I have a code in C/ C++and I have just learned I am going to need it in a version compatible with Free Pascal. I would never bother anyone with it but as I need it pretty quickly and my knowledge of Pascal is very poor I would spend ages rewriting this and it probably woudn't even work at...
  2. alliecat

    Options for running code on a smart phone

    Hello everyone! I am an undergrad currently doing research for a nuclear physicist at the University of Notre Dame. My current project is taking a code (written in Fortran-63 in 1967 ?:)) that calculates relativistic kinematics for two-body nuclear reactions and converting into some sort of...
  3. A

    Error in My Code: Undefined Symbols for x86_64

    I have received this error : Undefined symbols for architecture x86_64: "start", referenced from: -u command line option (maybe you meant: __gfortrani_library_start) ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status what is this mean?? the code is...
  4. D

    Comp Sci [JAVA GUI] Counting the trajectory of a projectile not shown

    Hello PFers, I'm trying to make a program in java which process user's position, initial velocity of the projectile and the elevation of the projectile and show the trajectory in GUI. The language is in java. The problem is, the trajectory won't show. It is supposed to show the player's...
  5. T

    What is the Encoding Scheme for this Code?

    Hey, I recently received a message from one of my friends. He's a real joker, thinks it's funny to send my pieces of code. This one had me stumped; from the little, and I mean very little, I know about code, this looks like base64 does it not? H05LekhYaNE3Y7Movd47Y0KYHnuX/srs/V0pEk22bl8= But I...
  6. C

    HTML/CSS HTML, php and css code in ebook, proper formatting?

    Hi, I want to write an ebook on CSS, HTML and php, and I'm using a RTF copy/paste plugin to my code editor so i can copy and paste code directly into MS Word from my code editor. I'm just wondering: Can i write the whole book in MS Word and then directly upload it to amazon, for ebook readers...
  7. I

    Matlab running out of memory on code

    Homework Statement I am trying to run code for the code below but MATLAB runs out of data. The Attempt at a Solution NumberOfVariables = 9; k=NumberOfVariables^2-NumberOfVariables+1; integers = 0:k-1; numbers = 1:k-1; tic s = combnk(integers,NumberOfVariables); AllAnswers = []; for i =...
  8. E

    MATLAB 2D diffusion equation, for matlab code.

    https://scontent.xx.fbcdn.net/hphotos-xtf1/v/t34.0-12/12204847_801668796608594_2127169351_n.jpg?oh=f6ea92a40c93e4d843a4bf26a358677d&oe=56404FC5
  9. parazit

    FLUKA Code : Total Cross Section Calculation

    Hi folks, I'm working on Fluka nowadays which you can found from here if you are not familiar. It's a very useful and widely used Monte Carlo simulation package. My main goal is to be able to perform total cross section calculation with it. So far, please consider I'm a rookie, I've done some...
  10. C

    Python How can I properly use the onkey() event handler for keyboard inputs in Python?

    Hi, I'm trying to take keyboard inputs to make changes to a turtle from the 'Turtle' graphics in Python. I'm not able to register keyboard inputs for the code I've written. I've tested out the examples that had been provided online, and they seem to work fine. I'm not quite sure where I'm...
  11. NicolasPan

    Comp Sci Why Does My Fortran 95 Code for Calculating a Piecewise Function Fail?

    Homework Statement . [/B]Hello all ! I am currently trying to make my fortran95 code run in vain.I would really appreciate it if someone could lend my a hand since I am a starter in programming.So the problem goes like that:Create a program capable of calculating the following function: f(x)=1/x...
  12. S

    What is the color code for a zero Ohm resistance?

    What will be the color code of a zero Ohm resistance?
  13. H

    MATLAB Coding up a simple geometric algebra in MATLAB

    Hi, I have been wanting to do this for a while but not too sure how to go about it. I have the following geometric algebra \lbrace\mathbf{e}_{i}\rbrace_{i=0}^{3} which satisfy the following relations: \mathbf{e}_{i}\mathbf{e}_{j}=-\mathbf{e}_{j}\mathbf{e}_{i} and...
  14. C

    MHB Just a question about recursive functions, no code.

    What are different ways of ensuring efficiency in a recursive function in C++? i.e. Prevent calling your recursive function when not necessary.
  15. A

    Comprehending some C code (simple function calls)

    Homework Statement Hi, I have a piece of code that I'm trying to comprehend but I don't understand some aspects. Here is that code: #include <stdio.h> /* function prototype declaration for FindSum */ void FindSum(int, int, int *); int main(void) { int a=2, b=5, c=1, x=3, y=4, z=7; /*...
  16. Mr Davis 97

    Python How to Convert Python Code to Effective Pseudocode?

    I have the following python code: I need to know how to best convert this to pseudocode. On one hand, I am afraid of making it too python specific, and on the other hand, it can't be too general. For example, for the 2nd and 3rd blocks of code, how would I write them in pseudocode? What...
  17. mariem.makh

    Fortran FORTRAN Code for Control Volume Finite Element Method Fluid Flow Problems

    where i can found an example A FORTRAN control volume finite element method code FOR FLUID FLOW PROBLEMS thanks for help
  18. A

    Simple C code and PIC microcontroller: need it looked at

    Homework Statement I'm using a PIC 16F877A microcontroller. An LDR and moisture sensor connect to the ADC. The main body of the code is ''void main'', and there is also a sub-code called "void light_the_led'' which is read inside the 'void main code'. I cannot get access easily to hardware or...
  19. P

    How to remove goto statement (below code)

    100 VR=D+R LR=R VS = VR - (1-q)*F LS = LR +f*Q loop = loop +1 if (loop.GT.50) stop x(1) = ..... CALL for i=2 to nf x(i) = ..... call x(nf+1) = (vr*y(nf)+b*xb...) if (x(nf+1).LT.x(nf)) go to 30 call for i=nf+2 to nt x(i)=(vr*y(n-1)...) if ( x(i).GT.Xd) goto 40...
  20. G

    Getting an infinite loop in Nelder-Mead code, help please

    I've been making a go at writing out algorithms myself in MATLAB rather than using pre-existing code. I've just attempted to write the Nelder-Mead optimization method and I have hit a stumbling block where the code is now looping infinitely. It seems to have something to do with sorting the...
  21. NaughtyBear

    C# [C#] Code for project involving voice recognition and arduino

    A friend of mine wrote some code in C# that he is wanting to use in order to basically make a house controlled by voice commands he would input via microphone connected to his computer. He wrote some code and asked for my opinion and I have no idea how to read C#. Anybody help me find where he...
  22. S

    How can I write code for an optical touchscreen using infrared technology?

    Hello, I am looking into building a touch screen. I have been considering a capacitive touch screen but I am also interested in optical touchscreen using infrared like the ones one this link...
  23. N

    Python Project euler 1 understanding the python code

    If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. This is the code for python I found (didn't create) which I believe is correct: max = 1000 result = 0 for...
  24. E

    Code of the Angular Spectrum Method

    I constructed my code of the Angular Spectrum Method. However, as the distance between the object and the plane of interest increases, the diffraction pattern never disappears; there is still some sort of a diffraction pattern, and I am expecting that it disappears as distance increases. Here...
  25. Math Amateur

    LaTeX Latex code for the "not equivalent" symbol

    I have just posted on the Linear and Abstract Algebra forum ... and the post needs a "not equivalent" symbol as shown in Rotman's Proposition 1.58 part (ii) see below ... Can someone please help with the latex code for this symbol? PeterProposition 1,58 in Rotman's Abstract Algebra reads as...
  26. S

    Fortran Optimizing Makefile for LHS Code in Fortran

    I've always made my own makefiles and it hasn't been an issue because it's usually a small number of subroutines. However, I am working on modernizing and optimizing a Latin Hypercube sampling code in Fortran which has close to 80 functions/subroutines that I am splitting up into different files...
  27. amtech

    What is Australian Grid Code for solar energy integration?

    Hi, I am working on Solar systems in Australia. I want to know the Australian standards for grid connected PV systems for voltage, power factor, reactive power etc.
  28. angelos_physik

    Fortran Solving Large/Infinite Results w/Yee 1D FDTD Code

    Hello to all! I have written this 1D FDTD code but the results I take are very large and after some timestep they get to infinite/NaN... I really don't know what's wrong. The expressions I have used are the exact given solution for the Maxwell equations. Thank you for your help. program yee...
  29. 22990atinesh

    Counting Problem : A code consists of at-most two....

    Homework Statement A code consists of at-most two identical letters followed by at-most four identical digits. The code must have atleast one letter and one digit. How many distinct codes can be generated using letters A-Z and digits 1-9. Homework EquationsThe Attempt at a Solution //One...
  30. E

    NEC: Outlet Rating on 20A Breaker? Current Per Outlet?

    If you have multiple outlets connected to the same 20A breaker, do the outlets need to be rated for 20 A? Or, is it acceptable to have the outlets rated somewhat lower? Where can I find this information in the NEC? If I do not need each outlet to be rated for 20 A, then is the current rating...
  31. billyp245

    Double Pendulum in C (Trace Motion Real-Time + gif output)?

    I have written a C program to trace out the motion of a double pendulum, but am having difficulties in getting gnuplot (controlled from my c program) to trace out the paths of the masses (example video below). Thus far I have created the program such that it produces a number of png images at...
  32. A

    Can some one explain this Code to me

  33. STEMucator

    Code Readability for "Higher" Level Languages

    There really is no specific guideline for this. Personally, I like to write my code as compact as I can, but is there really a problem with this? Having those small complicated statements can make code hard to read, but is that not up to the developer's/reader's level of skill? For example, the...
  34. S

    Why do big corporations use such large encryption keys?

    Simple question. I understand that the product of two "large" primes is a nearly unbreakable code. How large is "large" and if it's that easy, why aren't big corporations using this?
  35. m4r35n357

    "Simple" 4D Kerr Geodesics simulator, source code and docs

    Looks like my main pet GR project is about to enter something akin to maintenance mode, since it now does all I currently need it to. It's nothing earth-shattering at first glance, but is very concise (e.g. ~100 lines of Python for the simulator script) and should be easier to understand than...
  36. V

    Genetic Code: Val-tRNA Val - Anticodon Selection

    Homework Statement Val-tRNA val is the tRNA that carries valine to the ribosome during translation. Which of the following sequences gives an appropriate anticodon for this tRNA? A. CAU B. AUC C. UAC D. GUG Homework Equations There are four different codons for Valine: GUU, GUC, GUA, and...
  37. ghalimoglu

    Muon detecting with smarthpones -- need open source code....

    hi everyone, nowadays i am working on muon detecting but i need something cheap. i saw on the internet some people are using their smartphone as a detector with sensor or phones cameras. is there anyone can share their code ? there are some samples but they don't share their code.. only can...
  38. B

    What is the semantic error in my code

    Note that the code I am using is Python. Currently, I am attempting to numerically solve the equations of state that give rise to the Chandrasekar limit for a white dwarf star. My code works for a simple harmonic oscillator given the correct equations of motion, but does not compute the correct...
  39. D

    Why are there two different truth tables for BCD to Gray?

    [FONT=Arial]Having a bit of trouble understanding why there are two different truth tables for BCD to Gray. Using ABCD as the BCD and WXYZ as the Gray, The way I learned it is: 1) MSB of BCD (A) = MSB of Gray (W) 2) A ⊕ B = X 3) B ⊕ C = Y 4) C ⊕ D = Z 5) Since BCD only ranges from 0 - 9, 10 -...
  40. O

    Fortran I can't find a small bug in this Fortran code

    So I'm writing a short subroutine to compute a QR factorization of an (mxn) matrix using the Householder method. To test this, I'm computing the factorization of the matrix 12 -51 4...
  41. 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.
  42. 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...
  43. 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...
  44. 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...
  45. 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...
  46. 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 ...
  47. 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
  48. cpscdave

    Python How Do You Include Header Files in Python?

    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...
  49. 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...
  50. 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
Back
Top