Hello everybody,
I am a master student in Theoretical Chemistry and I am working in the DFT realm. Both TDDFT and DFT applied to extended systems (eg. using QUANTUM ESPRESSO). Of course I work with these softwares from a end-user point of view, not as a developer.
But anyway, even if some of...
Hi,
I'm currently trying to learn the C++ programming language to build my apps in my off time. I already have Code Blocks with WXWidgets installed also. I recently heard of firecode.io. I'm looking for more resources like that ideally to learn software development (C++).
Hello All,
I took it upon myself to create a tool for my job that xref 2 excel worksheets on 2 different workbooks. Customers send us parts and they're wanting the leadtimes for them. We have a weekly report that has all part numbers with their leadtimes. My goal is to create a GUI in C# that...
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...
Hi,
I recently installed GhostBSD on to one of my desktops. I want to use this GhostBSD machine for software development/coding. Obviously I want to program in C++ and I'm currently trying to download the clang compiler for BSD but it's being weird. I looked it up on YouTube but there weren't...
Let's say you have a 4 digit "odometer" using just the digits 0 through 7. So it starts at 0000 and works its way up to 7777. So, for example, the next reading after 0007 is 0010 etc. There are ##8^4 = 4096## readings before it rolls over. I want to create and initialize an array with ##4096##...
I don't have a debugger yet, but my company is getting one...
In the mean time, I've been un/commenting out parts of Mbed's code. Their Hello World program is available from this website, and it can be used directly in their online IDE by clicking "Import Program"...
I’ve been looking for a certain type of software that can host programming (preferably C or Python) and other process that I’m going to need such as DSP, DSP filters, diagrams (3D graphs, charts,…), and text editing within the same file. It’s mainly so that I can incorporate and use each one...
I have a C++ program that starts two threads from the parent thread, I need to kill both children from a child thread.
____> b
|
a -
|_____> c
I need to kill b & c from b. Issue is, I can't use simple flags, as c waits for input using cin.
Any help appreciated.
Hi, I am an undergraduate Physics student and i have an exam on c++ programming next monday, what are the basic things I have to know in order to perform well in the exam? And how is c++ applied in physics?
I attempted going with c++ and this is what i got:
#include <iostream>
Using namespace std;
int i, j, keeper, n;
int Ingredients[100], Blender[100],
cout<<”How many ingredients does the shake need?”<<endl;
cin>>n;
cout<<”Type down the ingredients:”<<endl;
for(i=1; i<=n; i++)
{...
I have following C++ statements:
ifstream inFile;
inFile >> num_rows;
file_buffer.resize(num_rows);
I have converted them into C:
FILE* inFile;
inFile = fopen(argv[1], "r");
fgets(strNum_rows, 20, inFile);
num_rows = atoi(strNum_rows);
But I can't...
Consider an integral of the form $$\int_{-1}^1 dx f(x)g(x).$$
I'd like to use https://www.gnu.org/software/gsl/doc/html/min.html to find the maximum of the convolution ##f(x)g(x)## in the domain ##x \in [-1,1]##. The method initiates via a double function with parameters x and a void params...
My matrix text files can vary from 1x1 to 10x10 (Another file will be given when the code gets tested but it's all square matrices)
I'm stuck here.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
const int MAXI = 10;
int x, y, z...
I have computed the total length of a 3D triangle and its area. The code is shown below.
I want to use file output instead of cout. The file name, cw2task1output, was just given as part of the task, in this case should I make an empty text file named cw2task1output then attach it to the resource...
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...
All the white space among words in a text file was lost. Write a C++ program which using dynamic programming to get all of the possible original text files (i.e. with white spaces between words) and rank them in order of likelihood with the best possible runtime.
You have a text file of...
Homework Statement
I have a complete code that calculates distances between point 1(x1,y1,z1) and other points(from 2nd up to more than 100) and the nth point that results in minimum distance and the minimum distance between point 1 and nth point. The code is below.
The code is 100% correct...
Homework Statement
I have successfully opened and discarded the headers. Then I calculated the distances between point 1 and others and the minimum distance as well. However, I am not sure how to make the code work for more than 4 points. The attached text file is what I am trying to read and...
Homework Statement
Write a program that can read an input file with a simple header.
The Attempt at a Solution
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream inFile;
inFile.open("Data"); //Check for error
if (inFile.fail()) {
cout...
Here is the description of what I am working on. I wasn't able to figure it out during the semester but now that I have some time off during the break, I'd like to figure it out.
implement a bounded buffer queue (BBQ) , where lock variable is used to synchronize the access of queues. 20...
if I want to read to integer a and b and they are in a formation of a@b, I CAN SIMPLY USE
scanf(%d@%d,&a,&b)
to read the input. But how should I do that in c++(with cin)?
Greetings,
for a Monte Carlo simulation of N hard spheres, I want to set up the initial configuration as a fcc lattice. I am thinking about how to do it most efficiently.
Here is the lattice structure:
The 3 lattice vectors, each one pointing to a different type of the 12 nearest neighbors...
Homework Statement
A house has n x m rooms (n and m natural numbers, n>=2 and m>=2) and is represented as a 2 dimensional Array with n rows(0 to n-1)and m columns(0 to m-1).The room at line i( 0 <= i <= n-1) and column j ( 0 <= j <= m-1 ) is identified by the pair of numbers (i,j).All rooms...
Hi,
I'm working on a C++ library for second-quantized models called TBTK (https://github.com/dafer45/TBTK). To make it easy for people to get started using the library, I have recently begun implementing solutions to the exercises in the book "Quantum transport: Atom to Transistor, S. Datta...
Hello All!
Anybody uses C++ Builder / RAD Studio Embarcadero? For me I used Embarcadero products on work for all project. For me interesting information of used Embarcadero in other countries. Thanks.
I would like to discuss code for hit and miss monte carlo methods, and also monte carlo with veto algorithm in C++. Since I am coding in C++ after a long time, I am messed up with syntax too. I have a specific set of problems to work with. If interested we can start working on it here.
Homework Statement
Write a BinaryTree Class using these specifications:
A Class Node represents a standard node of the tree with fields and a constructor like given below:
int start, end;
const Complex* value; //I will provide more information about Complex later because that was the...
Hey all,
This coming Spring semester (starts in 6 weeks), I will be taking C++ Data Structures and Algorithms at my University. I started programming at University, so my experience is very limited (I've taken 3 programming courses, 1 in Python, 2 in C++).
Topics we've covered in C++ were...
Homework Statement
Hello, I am attempting to use the velocity Verlet algorithm of integration applied to the solar system in c++. My goal is be able to use the outputted position components in a plot to see if the trajectory of my object is elliptical/parabolic/hyperbolic resulting from the...
Hi everybody,
I'm writing some algebra classes in C++ , Now I'm implementing the modified sparse row matrix , I wrote all most all of the class, but I didn't find the way saving computing time to perform the product of two Modified sparse row matrix .. if you don't know it you can read in the...
Create a class DecimalN which holds decimal numbers using dynamic arrays.
Implement a constructor DecimalN::DecimalN(char* decimal) so that it can be created like for example DecimalN number("23.5698").
Create two class functions (methods) that given the number n it shift the number n places...
Homework Statement
I am quite new to C++. I have completed my C course and am now taking a C++ course at my college. The first problem i encountered is with classes and custom made constructors. In the first part of the problem I am supposed to create a class with a field which is a dynamic...
Homework Statement
[/B]
Write a function fForceOfGravity, with return type double and with two double parameters for mass (m) and gravity (g). Parameter gravity must be initialized to 9.81. The force of gravity is given by the formula F=mg. Call these functions in the main () as follows:
cout...
This is what I did but I'm getting an infinite loop of the reversed string whenever I run the program. I don't know why
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> /* for fork() and getpid() */
#include <sys/types.h>
#include <iostream>
using namespace std...
I've got experience with win32API but its' a pain in the ass.
What else is good for cross platform low level programming of apps, want it to work for PC, linux, be able to handle serial data streams, convert data and do C++ tier things.
So far been using processing but that's not powerful...
ok i wrote my code but the whole file gets deleted instead of the required values.
else if(option==5)
{
int rno;
fstream w1;fstream e1;
e1.open("temp.dat",ios::in|ios::out|ios::binary)...
Hi everybody,
I seem to be having trouble coding a function that returns the integer value at which degrees celsius is equivalent to degrees fahrenheit. Here is the question:
Write a function that will find a temperature that is the same in both Fahrenheit and Celsius. First define two...
I began by creating 2 classes. A book class and a course class that contains any necessary info about the book and course respectively
class bookClass{
private:
string theISBN;
string thebookName;
string thebookAuthor;
double thebookCost;
int...
Aloha, I am wanting to teach myself C and C++ programming languages and before I purchase any books or materials on the subject. I would like to see if anyone has any recommendations?, and the pros and cons if any, ect.
I have been working on implementing a solar system system simulator in C++ - but am getting incorrect results on the order of 10^10 km, and it seems that the planets are moving directly away from the sun. I suspect that there is a mistake in the integrator (Velocity Verlet) that I have posted...
I'm trying to integrate a simple function (x*y) using the Romberg method.
Question 1:
I want to integrate only x and maintain the argument y present in the rest of calculation, like a global variable. In fortran 77 I would use common.
Question 2:
How to integrate using arguments in the...
Homework Statement
Here is the prompt:
Write a program that does the following:
Welcome the user to the game and ask them if they want to play. They should type y or n for yes or no. Store this value in a char variable. If they type y, continue on with the game. If they type n, print the...
Homework Statement
Find the are of the cylinder, by creating a program in C++.
2. The attempt at a solution
So far I have:
#include <iostream>
using namespace std;
const double PI = 3.14159;
class point
{
protected:
int x;
int y;
public:
point()
{
}
point (int xvalue...
So I'm trying to teach myself C++ programming and I'm having trouble writing a password program.
Essentially I want to program to ask the user to input a password, and then compare that input with the correct password. If the user input matches the password I want the program to output a message...
I have Ettus B210 and trying to add 1 line configuration file "/etc/security/limits.conf" which will allow UHD drive to set priority.
So , I typed this command to edit file: gksudo gedit /etc/security/limits.conf and add:
#@student hard nproc 20
#@faculty soft...
Hey everyone,
I've been looking to get another C++ book. I'm currently using Gaddis Control Structures through Objects (required at my university). However, I find sometimes their explanations are poor or their examples are too long to really illustrate the point they're trying to make (e.g. a...