3,815 Topics

Member Avatar for
Member Avatar for alegatross

I am using C language to encrypt a text file and decrypt it by the means of an AES Algorithm. This algorithm can only encrypts characters if they are stated in the format of an unsigned character where a letter A is represented by 0x41. what i am trying to …

Member Avatar for alegatross
0
714
Member Avatar for sassy_94

Hello, i am new to storm and stream data. I have implemented a sketch algorithm in java with maven. The algorithm has as an input a continuous stream of integers. The result is an array of integer frequencies and i want to run some queries on that array, but i …

0
146
Member Avatar for Violet_82

HI guys, a while ago I built an application to save strings to file https://www.daniweb.com/programming/software-development/threads/501460/application-to-save-wordsentences-to-file and I was wondering, what if I wanted to have the ability to search those strings, say I can choose a search key, like "bring" and search all the strings (and when I say strings …

Member Avatar for Violet_82
0
734
Member Avatar for Vessy

I have to do this program in C++ but I don't know how exactly to write it so that it displays everything it has to display. I'll be really thankful if you try to help me because I'm not so good at programming. 1. Create a program that has linked …

Member Avatar for rubberman
0
348
Member Avatar for toxicandy

I am trying to declare a function to find the largest mobile element for a program to list permutations using johnson-totter algorithm. Here is my definition of the function in the header file: `int findMobile( string, int[] );` and here is my actual declaration of the function: `int findMobile( string …

Member Avatar for rubberman
0
476
Member Avatar for JamesCherrill

I'm looking for an algorithm, pseudocode or any langauge, to generate random numbers with the following characteristics: integer values in the range 0-n lower values much more likely to happen than higher values, eg prob of 0 is n/(n(n-1)), prob of n is 1/(n(n-1)) - linear relationship between value and …

Member Avatar for invisal
1
669
Member Avatar for negru

Write a program that will print two closest pair integers in an array (if there are more than one pair with the same distance, then print all pairs). //Example: 6 -3 8 0 5 //The closest numbers: 5 6 -> difference is 1 In the following program I am using …

Member Avatar for rubberman
1
881
Member Avatar for ressenjack

Anyone have flowchart or algorithm of Snap Card game which can let me to refer since I need it for my assignment. It will be very helpful if provided me the source. Thank you

Member Avatar for Reverend Jim
0
193
Member Avatar for negru

Write a program that will print adjacency matrix of a directed and weighted graph. Weights are positive real values, and graph is strongly connected. Then, print values of two vertices which indices are read (values of each vertice are functions: **sin(index),cos(index),index^2,sqrt(index)**). How to check if a graph is strongly connected? …

Member Avatar for rubberman
0
354
Member Avatar for dhitinair

can anyone suggest how to convert python code to java. Following is the python implementation """ K-prototypes clustering """ # Author: 'Nico de Vos' <njdevos@gmail.com> # License: MIT from collections import defaultdict import numpy as np from scipy import sparse from sklearn.utils.validation import check_array from . import kmodes def euclidean_dissim(a, …

Member Avatar for stultuske
0
1K
Member Avatar for negru

I am having problems to figure out how to do arithmetic operations on positive integers represented as strings (addition, subtraction, multiplication, incrementing and decrementing). I did the addition as following: #include<stdio.h> #define MAX 100000 typedef struct { int arr[MAX]; }NUMBER; void read(NUMBER *add_num) { int i,digit=0; char ch[101]; scanf("%s",ch); while(ch[digit]) …

Member Avatar for David W
0
2K
Member Avatar for MrQuentin

Hello! my name is Quentin and i am a young french programmer and i have some issue with my program i don't know how to simplify it for the refresh function and the creation of rectangles. i would like to create a fonction that create X rectangles for me then …

Member Avatar for Gribouillis
0
223
Member Avatar for negru

Write a program that reads data from binary file **EMPLOYEE.DAT** (employees are proffesors and teaching assistants, assume that the file exists). Split data about proffesors and teaching assistants in two separate text files and sort data by **ID** using insertion sort algorithm. Search and print data about employee which **ID** …

Member Avatar for David W
0
247
Member Avatar for preslav_milev

Hello ! How can I change my sorting function called bubblesort, so that it uses a dynamic stack. Now I've done and funcion can work properly, but is using list, because I intercede for the next item and in stack i have access only to the top. Data for stacks …

0
143
Member Avatar for COKEDUDE

I am trying to do Shortest Remaining Time scheduling algorithms turnaround time. This is the formula. Turnaround Time = Completion Time - Arrival Time I have already sorted my arrays. This is what it looks like my hand. 5,1 done with magical 0 9,2 2nd iteration 1 2,4 1st iteration …

Member Avatar for Taywin
0
135
Member Avatar for nana_1

I honestly have no clue how to go about this. Need some assistance on the following questions: 1. Modify the program to subtract (num1 – num2). If num2 is greater than num1, swap the values of the variables using a variable named temp, using the partial code below. if (num2 …

Member Avatar for nana_1
0
661
Member Avatar for tgreiner

Is there a way to catch a "program.exe stopped working" Windows error? I am not sure what to look for, or even where to look, in my code. I have the code repeat a rather complicated algorithm using different data several times. It runs fine for 27 iterations and then …

Member Avatar for tgreiner
0
331
Member Avatar for nana_1

Exercise Three: In this exercise, you will create a program that gets two numbers from the user and checks to make sure the first number is less than the second number. It should then display the sum of the even numbers between, and including, the two numbers entered by the …

Member Avatar for nana_1
-1
284
Member Avatar for Bobbyj245

Minimal Submitted Files You are required, but not limited, to turn in the following source files: Assignment8.java(More code need to be added) Food.java (given by the instructor, it needs to be modified for this assignment) IdComparator.java (Need to be completed) CategAndNameComparator.java (Need to be completed) Sorts.java (Need to be completed) …

Member Avatar for stultuske
-2
582
Member Avatar for Luckychap

This is a program for Encryption and Decryption This program uses the Simple Data Encryption Standard (SDES) Algorithm. This Algo takes 8-bits of plaintext at a time and produces 8-bits of ciphertext. It uses 10-bits of key for Encryption and Decryption.

Member Avatar for overwraith
1
13K
Member Avatar for DaveTran

I am moving an object around from one node to another. I need to tell the object to stop moving when it has reached its destination node. I am currently using this algorithm for movement and node checking [CODE] if (!isFinished) { // If the level has arrived at the …

Member Avatar for Chris_33
1
2K
Member Avatar for James_43

Hi all, I'm working with a function that only accepts values between 0 and 1, so I need to scale my data first. The first part involved in this is calculating the high/low values of my inputs. I pass this into a function that churns out X and Y values …

Member Avatar for James_43
0
117
Member Avatar for Agilemind

I'm trying to optimize a Bayesian inference algorithm written in C. I'm looking for fast and accurate open-source libraries for working with probability distributions (both calculating density & drawing deviates - like the rnorm,dnorm,pnorm functions in R). So far I've found a tutorial which suggested the [gsl](http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions.html#Random-Number-Distributions) library but I …

Member Avatar for rubberman
0
157
Member Avatar for joe97

Pig is a simple dice game first described by John Scarne in 19451. It is a form of jeopardy dice game, where a players decisions are between protecting current gains, or risking current gains to make greater gains. In Pig, each player takes a turn rolling a 6-sided dice, playing …

Member Avatar for joe97
0
1K
Member Avatar for loldafuq

Here is what i have to do Create Class CSalary with private member variables string m_strProfession double m_dSalary Constructors:Default,Copy,Explicit Functions: 1/string GetProf(void),double GetSalary(void) 2/SetProf(const string val),SetSalary(const double val) 3/Output(ostream&) and Input(istram&) 4/Operators:<<,>>,=,==,<,double operator*(const CSalary&obj) Create Class CCalcCorr with private member variables: vector<CSalary>m_vCity1//data for city 1 vector<CSalary>m_vCity2//data for city 2 double …

Member Avatar for tinstaafl
0
355
Member Avatar for Shiladittya_1

I am searching for an algorithm which can shows line and arc intersected or not. For line I have start and end point and for arc I have start, end and center point. I also have start and end angle of an ARC. **Bold Text Here** I found one link …

Member Avatar for gusano79
0
121
Member Avatar for booglaoogla

Write a C++ program to determine a student's grade. It reads three test scores (between 0 and 100) and calculates the average score and converts it to a letter grade. Grade Conversion Rules: rule a. If the average score is 90 or more the grade is 'A'. rule b. If …

Member Avatar for triumphost
0
357
Member Avatar for NewOrder

It took me 4 weeks to write this code. The chess game works now . there are no bugs... everything confirms to the chess rules (part from stalemate that i was too lazy to do). i have been learning java for 4 months. what do you think of my code …

Member Avatar for JamesCherrill
0
3K
Member Avatar for dawbin

Has anyone seen/does anyone have a native PHP implementation of the TEA Tiny Encryption Algorithm?

Member Avatar for pritaeas
0
80
Member Avatar for Ahmed_62
Member Avatar for JamesCherrill
-1
106
Member Avatar for Ahmed_62

#include <iostream> using namespace std; //Write a recursive algorithm to solve the towers of Hanoi problem. //move disc 1 A to c ACB //move disc 2 A to b ABC //move disc 1 C to b CBA //move disc 3 A to c ACB //move disc 1 B to a …

Member Avatar for Ahmed_62
0
179
Member Avatar for diafol

## Contents ## Overview 1. Alternatives to Deprecated mysql_* Functions 2. SQL Injection: What to do with $_POST and $_GET variables 3. How to Insert Tablenames and Fieldnames Properly 4. What to do With Dynamic Values? 5. How to Use Aggregate Functions (COUNT, SUM, MIN etc) 6. How to Paginate …

Member Avatar for developer707
6
5K
Member Avatar for boomtifier

I have my instructions in the top of my code. But for some reason when I input a decimal and then return my error message like it is supposed to then I input a valid amount it prints everything twice, once for the valid input then once for the valid …

Member Avatar for boomtifier
0
3K
Member Avatar for devianleong

Hi guys, currently I have 3 groups of user which is A, B and C. A will handle tasks for first week, B will handle tasks for second week, C will handle tasks for third week, C will handle tasks for 4th week, A will handle tasks for 5th week, …

Member Avatar for cereal
0
143
Member Avatar for New Jack

My program is to solve the simple problem in the Link[http://codeforces.com/problemset/problem/143/A] #include <stdio.h> #include <cstring> #include <math.h> #include<set> #include<iostream> #include<algorithm> #define MAXN 25 #define INF 100000000 using namespace std; struct _point { int L;int r; bool operator<(const _point &a)const{ return (this->L<a.L); } }; set<_point> up,down; int r1,r2,c1,c2,d1,d2; void solve(){ _point …

Member Avatar for Moschops
0
201
Member Avatar for Syed Zeeshan Ahmed

I need help in writing a the following programs in C language: We want to determine whether a long string of a’s and b’s has the property that the number of a’s is even and the number of b’s is even. Algorithm 1: Keep two binary flags, the a-flag and …

Member Avatar for David W
0
262
Member Avatar for ladynjb22

I would like to know if any one know what are the steps of setting up code for CPU Scheduling. I must develop a simulation program for CPU scheduling. -First I have to use FCFS(first come first serve) algorithm that will read the first number that me or anybody put …

Member Avatar for Neha_15
0
2K
Member Avatar for Jazerix

[CODE]using System; using System.Security.Cryptography; using System.Text; public static class Encryption { public static string Encrypt(string input, string key) { byte[] inputArray = UTF8Encoding.UTF8.GetBytes(input); TripleDESCryptoServiceProvider tripleDES = new TripleDESCryptoServiceProvider(); tripleDES.Key = UTF8Encoding.UTF8.GetBytes(key); tripleDES.Mode = CipherMode.ECB; tripleDES.Padding = PaddingMode.PKCS7; ICryptoTransform cTransform = tripleDES.CreateEncryptor(); byte[] resultArray = cTransform.TransformFinalBlock(inputArray, 0, inputArray.Length); tripleDES.Clear(); return Convert.ToBase64String(resultArray, …

Member Avatar for hunny1
0
9K
Member Avatar for Xia_1

#include<iostream> #include<string> #include <cstdlib> //rand #include<ctime> #include <algorithm> //shuffling #include <vector> using namespace std; int main() { int option,i=0, num_part; vector<string> names; cout << "Welcome to Number-guessing Game !\n\n"; do { cout << "Menu" << endl; cout << "-----" << endl; cout << "1)To register number of participants and name …

Member Avatar for ddanbe
0
128
Member Avatar for stevexavior

The seo job I found the toughest on the planet. We in seo learn a lot and use good and also bad means to rank better in search results. We do the hard work of learning the act and bring websites up in rankings. Then suddenly Google rolls out an …

Member Avatar for cwvps
0
211
Member Avatar for nathan.pavlovsky

Hi all! I am working on creating an SMS language translator (SMS -> real English), and I am having trouble initializing a map for the SMS -> English codes. My code is below: map<string, string> THE_SMS_CODES{ ".02","Your (or my) two cents worth", "10X", "Thanks", "2MI","Too much information", "2U2" ,"To You …

Member Avatar for nathan.pavlovsky
0
688
Member Avatar for hadisur_rahman

# What's the problem in output where the algorithm was correct ???? # #include<iostream> #include<stdio.h> using namespace std; main() { int LA[100],K=1,N=5,L;//K=POSITION...N=element for(int i=0;i<=4;i++) { cin>>LA[i]; } L=LA[K]; for(int J=K ; J<N-1; J++) { LA[J]=LA[J+1]; } cout<<"DELETE ITEM:"; N=N-1; for(int P=0;P<=4;P++) { cout<<" "<<LA[P]; } }

Member Avatar for StuXYZ
0
162
Member Avatar for Alan_7

**Question-1: Write a program to sort in ascending order random entered numbers by user using Linked Lists. - Size of LL is not limited - Entering numbers should be stopped by entering '0' (zero) - Sort entered numbers using any sorting algorithm (Bubble, Selection or Insertion sort) - Display sorted …

Member Avatar for David W
-2
656
Member Avatar for Xhesika

Will somebody please help me solve this algorithm? it says: 2+2x4+2x4x6+2x4x6x8+...+2x4x6x...x20

Member Avatar for JamesCherrill
0
154
Member Avatar for mgold

I've been learning a lot about machine learning (mostly clustering and regressions), but when I've looked into programming libraries/environments, I've found "production ready" ones to be few and far between. What I mean by "production ready" is that it could be incorperated into a product, not just used a tool …

Member Avatar for thaifoodlover
0
346
Member Avatar for Tcll

I've been here before but I'm looking to find a single-pass method to input the LRS `[[0,0,0],[0,0,0],[1,1,1]]` and get a basic 3x4 (at least) matrix in return: [ [1,0,0,0], [0,1,0,0], [0,0,1,0] ] ^ matrix is NOT transposed (I'll never understand why we use column-major) anyone got anything on this?? > …

Member Avatar for Tcll
0
501
Member Avatar for nathan.pavlovsky

Hello Programmers! I am trying to write a recursive implementation of the quicksort algorithm in C++. I believe you all know what it is so I shall not go into the details. However, I run this, but it never ends. Going through it with a debugger shows that my partitioning …

Member Avatar for nathan.pavlovsky
0
526
Member Avatar for hadisur_rahman
Member Avatar for hadisur_rahman
0
129
Member Avatar for kww228

I am writing a program that will implement an ADT for polynomials of the form: c0+c1x+c2x2+c3x3+… Each Polynomial object will save the appropriate coefficients for a single polynomial. I think that I have the code doing the right things, however I am getting the following undefined reference errors: undefined reference …

Member Avatar for Moschops
0
1K
Member Avatar for preslav_milev

Hi. I need to write a program that finds the shortest route in directed graph. Please look at the picture. [Click Here](https://goo.gl/photos/uRdTfp9pDrAobun87) Here is my code: #include <iostream> using namespace std; const int N = 10; struct elem { char key; elem *next; } *g[N]; void init(elem *g[N]) { for …

Member Avatar for preslav_milev
0
1K

The End.