3,815 Topics
![]() | |
The present code snippet just does an especific task. This is, given an ordered sequence of natural numbers, starting at zero, generate all the different permutations there can be. When we talk about permutations, the order of the sequence does matter. So, the sequence 0, 1, 2 differs from 2, … | |
Plz tell me how I would calculate time complexity of the program: int i = N; while (i > 0) { int Sum = 0; int j; for (j = 0; j < i; j++) Sum++; cout << Sum << endl; i--; } thnx in advance | |
I am trying to make a windows form application using Visual Basic 2017. I want to display messaged using a label and a Next Button and a Back Button. Every time the Next Button is click I want the message to update and change to whatever you put in your … | |
python code implementation of firefly algorithm for feature selecting the hepatitis dataset | |
So I have a project with a tester that is not displaying what I thought it would display. The project description and everything is as follows: Given an array of integers, how can we make some basic statistical calculations on the data? Specifically, we want to be able to determine … | |
how to work algorithm of question and answer in c++ | |
How can implement a perfect hashed data structure using the four basic operations? Could I do something like this or do I need to break up my code into two different classes and then test the methods from another class's main method? public class PerfectHashed{ int ticketNumber; // keyfield String … | |
hello friends... i want to print a persian file by thermal printer.. i can print an english file esily..but i face the proble while printing persian text.. i think i don't do some principles...i have studied about unicode encodeand decode in python..but it seems it isn't enough please guide me … | |
I've been trying to create the diamond square algorithm in ruby and whilst it works (that is to say it doesn't error) it doesn't output as expected, so far here's the output at various states: # So far# ## First attempt ## [First Attempt][1] This is the output of when … | |
Hello Guys I am new to C programming and as a part of an assignment I have made an ATM algorithm in C. Though the compiler shows no errors, the code goes into an infinite loop after the first input. Please Help. Here's the code: #include<stdio.h> #include<conio.h> void main(){ float … | |
**Am was already created form like this and working perfect but on last two forms not working, it displays warning-Undefined variable: reg_no and cost. Am trying to follow algorithm as previous forms but nothing happen. My goal is to update inserted data and here is my form** <?php @session_start(); if(!isset($_SESSION['b_lname'])){ … | |
I am trying to write some code for project euler problem 10, in which you are required to find the sum of all the prime numbers less than 2 million. Now the code is taking too long to execute. I would like to know how can I improve my code … | |
In below code while compiling i am getting error , Error : main.cpp:8:57: error: expected type-specifier before ‘Staircase’ std::unique_ptr algodiagnostic (new Staircase()); compilation command g++ HardwareDiagnostic.cpp HardwareDiagnostic.h main.cpp -std=c++0x -o res it works fine if compile entire code in single file without creating header file and main.cpp separately. Can anybody … | |
Hello. I'm having trouble with creating a program based on Prim's algorithm. This is the program and got the following error: #include<iostream> #include<stdio.h> #include<conio.h> using namespace std; int weight[20][20],visited[20],d[20],p[20]; int v,e; void creategraph() { int i,j,a,b,w; cout<<"\nEnter number of vertices"; cin>>v; cout<<"\nEnter number of edges"; cin>>e; for(i=1;i<=v;i++) for(j=1;j<=v;j++) weight[i][j]=0; for(i=1;i<=v;i++) … | |
I am learning to code and found interesting task, but i do not know where to start in solving it. So i have a file with some titles and comments which need to be placed under the right title. So the first line of the input contains a number N … | |
I am having a trouble not knowing how to do a java code that will take user string then encrypt it using Elgamal algorithm as following Elgamal algorithm Pseudo code: - Select Q where Q is a prime number - Select α where α is a primitive root of Q … | |
Is there a standard algorithm that can take the output of difftime (which is in seconds) and use it to print out the number of minutes, hours, days, weeks, etc.? I was going to try and calculate this myself by using the modulo, etc. but thought that something might pre-exist.. | |
#include<stdio.h> #include<math.h> #include<conio.h> #include<graphics.h> void main() { float x1,x2,y1,y2,x,y,dx,dy,pixel; int i,gd=DETECT,gm; initgraph(&gd,&gm,""); printf("Enter x-coordinate for initial point: "); scanf("%f",&x1); printf("Enter y-coordinate for initial point: "); scanf("%f",&y1); printf("Enter x-coordinate for final point: "); scanf("%f",&x2); printf("Enter y-coordinate for final point: "); scanf("%f",&y2); dx=abs(x2-x1); dy=abs(y2-y1); if(dx>=dy) pixel=dx; else pixel=dy; x=x1; y=y1; i=1; while(i<pixel) … | |
[OH noo, please not that again!](https://www.youtube.com/watch?v=DvShTJKuy2w) Yeah, primes sigh. But they play a minor role here as a perfect victim to explain some other things. Would not advise to use the algorithm here to calculate them in real life. There are languages like Python, F#, Haskell etc. who have list … | |
Hello there, I am working on a school project, this project is a program that separates the entered words into syllables, but now I have made my algorithm according to our country but I can not decide in one place I will do it by using the program sequence but … | |
Design a pascal that will capture the names and coursework and exam grades for math, science and computer science from a set of students. It should calculate the final grade for each course and GPA. The algorithm should output as a list at the end the name, math final, computer … | |
Hello. I have this tutorial and I'm at a lost. The program is suppose to calculate the call charges according to the rates. conditions: a) all calls start at 600pm and before 700am will be given 50% discount from the normal rate b) any calls that starts at 700am and … | |
Hello All, I'm currently working on a project which requires me to encrypt multiple text files at one go. I am able to retrieve the name of the files through listfiles() but how am i supposed to pass those files to File variable so that the encrypt method can encrypt … | |
I'm trying to implement Callable for Strassen's algorithm to multiply two matrices. I'm new to this, and i'm having a few issues and I can't figure it out for the life of me :( . The first problem is that the program prints out 0 for all the elements of … | |
This is the result after applying trained svm..i don't know why i got support vectors as 0's and why i got uncompressed support vectors. Can someone help me? <?xml version="1.0"?> -<opencv_storage> -<opencv_ml_svm> <format>3</format> <svmType>C_SVC</svmType> -<kernel> <type>LINEAR</type> </kernel> <C>1.</C> -<term_criteria> <epsilon>9.9999999999999995e-07</epsilon> <iterations>1000</iterations> </term_criteria> <var_count>8</var_count> <class_count>2</class_count> -<class_labels type_id="opencv-matrix"> <rows>2</rows> <cols>1</cols> <dt>i</dt> <data> … | |
I have been writing plain old vanilla JavaScript pages for a while, for numerical math problems. Usually, I create one page for a specific problem. For example, one page to solve a system of 3 Equations in 3 Unknowns, one page to solve a system of 4 Equations in 4 … ![]() | |
Hello. I have an exercisse to convert from 24-hour to 12-hour clock. code: /*ALGORITHM READ INPUT VALUE IN 24-HOUR FORMAT DISPLAY THE EQUIVALENT 12-HOUR CLOCK WITH THE PERIODS AM OR PM */ #include<stdio.h> #include<conio.h> int InputValid24Hour(void); void Output12HourClock(int); void main() { int data; data = InputValid24Hour(); Output12HourClock(data); _getch(); } int … | |
Good afternoon, I have to create a program to only be used as a tool (no main function). Below is the background information related to task: Your goal for this assignment is to create a tool that manages an equivalence relation that can be changed by the program. The equivalence … | |
now I know your first thought is going to be rotation matrices, but take a moment to think about how they're applied... I'm wondering if there isn't something more efficient, or if there really needs to be that many operations per bone and vertex. I'm looking for the smallest data … | |
So... I've slept since college - meaning I've forgotten a few things. I need to do an inner-join on two large-ish sorted vectors. Thought about converting them to unsorted sets and walking through "find-ing", but I'm pretty sure this is the fastest way to do it - and still accurately. … | |
Hi all, I’ve been told to convert a procedural [C++ program](http://pasted.co/cb410afe) into an object-oriented one, using the principals of polymorphism, encapsulation and inheritance. The standard C++ program accepts data values and filter values from the user. It then multiplies these values together using a simple algorithm and prints the output … | |
Hi I am unable to call a function in one class from another class:In this line of the code it is showing error std::nth_element(edge_points.begin(), edge_points.end() - edge_points.size() * c.edge_points_percent, edge_points.end(),Camera::compare_edge_points); Camera:: compare_edge_points - showing error. Can anyone help me here please? Header file: #ifndef main_h #define main_h #include <iostream> #include … | |
Hi team, Please show me how I can encrypt password and padd it with RSA algorithm. Show in java. Assume key is given. | |
This is my Line2D.h #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <cstdlib> #include <cmath> #include <algorithm> #include "Point2D.h" using namespace std; class Line2D { private: Point2D pt1; Point2D pt2; protected: double length; // Set function void setLength(); public: // Constructor Line2D(); Line2D(Point2D pt1, Point2D pt2); // … | |
# BlowFish? # BlowFish was the brain child of Bruce Schneier back in 93. Since BlowFish was released to the public domain, Bruce Schneier has released new encryption algorythems, TwoFish and ThreeFish. BlowFish is an increddibly popular and very strong algorythem. Because it conforms to Kerckhoffs's Principal [Explained Here](http://en.wikipedia.org/wiki/Kerckhoffs's_principle), even … | |
The algorithm for formatting code has has never treated vb.net comments properly. I've discovered a nifty work around that will format the code properly. Close the comment with another comment character(') and the algorithm will treat the rest as code. I've never tried it, but this should also work for … | |
Hello ,I'm writing a GUI with C Win32 API and facing following issue. When I start the program and click the button for Opening the file dialog everything works fine. I can choose a file and all informations seem to fit properly into the ofn structure. If I choose to … | |
Hello, this question is related to an older post of mine ([Click Here](https://www.daniweb.com/programming/software-development/threads/505499/getopenfilename-freezes-at-second-execution)). In this question i stated that my program freezes at the execution of GetOpenFileName. After struggeling a while with that problem and doing other more important stuff first, i came back to the original problem and found … | |
What are some concepts of data structure and algorithm? | |
Making sites is nice and fun but what if you don't want everybody too see something like an admin panel or maybe a special button. Well this tutorial helps you understand how to add a password to a php site in a simple manner. There are two techniques you can … ![]() | |
Recently I was speaking with one of my friends from school for Self learning softwares. He kept telling me that it is possible to do a program like that in C# and/or Java. I was refusing because did not have much information about this. If it is true, how can … | |
In this code if we enter the prime numbers like 3,5 or 7 the output is wrong.and if we input 3,11or 17.. output is correct why???? | |
What is the impact of google using more artificial intelligence in ranking websites for organic rankings. What is the impact of artificial intelligence on SEO strategies . I have just finished this article on techcrunch that got me worried https://techcrunch.com/2016/06/04/artificial-intelligence-is-changing-seo-faster-than-you-think/ They say there is a new algorithm called Google Ranbrain … | |
Hello all, Inverting an upper (or lower) triangular matrix is a trivial algorithm, due to the nature of the matrix. I am having an issue getting a part of my upper-triangular matrix inversion function to work, and I would like to get it working soon for a personal project. From … | |
![]() | Hi everyone. I am makng a RISK game and I am working on a territory class here, and I got a strange message that my google searches have not shed any light on. My code is below. First, my header file: // Class represents each individual territory on the map … |
Write a program to generate a pair of private and public keys. You program should also be able to encrypt and decrypt messages using the public and private keys. here is my program: import java.io.*; import java.math.*; import java.security.*; import java.security.interfaces.*; class generateKeyPair { public static void main(String[] array){ if … | |
a) Perform a DRY RUN on the algorithm below using the data provided. Lay out the results of the dry run in TABLE FORMAT with a column for each variable. Input A C = 0 D = A Repeat Input B If B > D D = B endif C … | |
I saw someone getting an assignment to implement the Vigenere Cipher, so I decided, just for the frig of it, to implement the Caesar Cipher. The algorithm below, however, doesn't account for spaces and punctuation. How can I account for those without redoing the whole thing? from random import choice … | |
Hello everyone. First of all i'm new here, and i registered particulary for this problem of mine i can't figure. In the code shown below, in the function `void printExpensiveThanT(..)` i'm supposed to print out the destination, distance and the price for the offers which are more expensive than the … |
The End.