I need to run some basic statistics on about ~150 tables that are currently in dBase format. Rather than use excel to do them all individually, i was told to use s+ and write a code to loop through them, but I have never written any code and my experience with spotfire s+ is limited (the stat software i have available) ....
Write a program that will ask the user to enter some words followed by the word END.
Input the words into an array and then output the following statics:
the list of and the count of how many words were typed (not counting END) -- Test 2 the list of and the count of how many unique words were typed -- Test 3 the list of sorted unique words (in alphabetical order) -- Test 4 the list of sorted unique words along with frequency counts for each word -- Test 5 See the sample run below:
Please type in some words. Type END and return when you are finished. red green blue RED red blue green blue orange red reg apple banana banana END
You typed the following 14 words: red, green, blue, RED, red, blue, green, blue, orange, red, reg, apple, banana, banana
You typed the following 7 unique words: red, green, blue, orange, reg, apple, banana
Here are those same unique words sorted: apple, banana, blue, green, orange, red, reg
Here are those same unique words sorted with a count of how many times each was used: apple: 1 banana: 2 blue: 3 green: 2 orange: 1 red: 4 reg: 1
I have a problem with my code while trying to simulate a snakes and ladders program. The objective of the program is to simulate many games (100000+) to gain statistics:
1. The most likely number of rolls. 2. The mean value of the number of rolls. 3. The most common square, C, on which a token may come to rest. i.e. move on to. 4. The probability of coming to rest on square C. 5. The least likely square on which a token may come to rest and what is the probability of this occurring. 6. The distribution in the number of rolls needed per game presented as a normalised graph. 7. The minimum number of rolls of the die - called Nmin. 8. How many different paths (unique sequences of die rolls) take Nmin rolls to complete the game?
However my program (on Tenacious C) doesn't seem to run at all...
I have run it on internet compilers and other compilers but it must work on Tenacious C.
Below is the code I have at the moment, it works fine when stepped through or ran on a different compiler.
How to create code to answer the 8 points above. For instance, to get point number 2. I must find the total rolls divided by the total number of games, but am not sure how to do this.
Code: #include <stdio.h> #include <math.h> #include <stdlib.h> #include <time.h> #define NUMBEROFGAMES 10 int GetThePositionOfMovement(int CurrentPosition, int dieValue);
In my code I have lots of structures. I try to make tables of structures and then get access to elements of the structures to use them all along my code: here is an example to clarify things
typedef struct { Fabric **closfabric; }Network;
Net is part of another structure called Switch and Fabric itself is a composed structure. I have done the following
The compilation returns a segmentation fault because aSwitch->net.closfabric is NULL (0) .
Surprisingly, in other codes the same analogy of using tables made of double pointers works perfectly with no problems and I have no problem of core dumped and NULL pointers.
Why am I getting this problem. It is the case whenever I try to use large dimension tables (tab *** struct for example)...
I am creating 5 different tables each one has 20000 more elements more than the previous when i try to sort them with the sort algorithm quick sort for the first table tha has 20000 elements runs grate then it throws this exception how is this fixable ?
Exception : terminate called after throwing an instanceof 'std::bad_alloc' this application has Requested the Runtime to terminate it in an unusual way. Please contact the applications's support team for more information. Process returned 255(0xFF) . here is the code that gives this return :
Code: #include<time.h> #include<stdlib.h> #include <string.h> #include <ctime> using namespace std; int * Create_Table(int table[],int N);
Currently I have to manually look up values on several different tables in different locations. I have 8 or 10 tables with 100 to 500 parts.
I would like to write a program so if I enter a value it will return the corresponding correct answers from the tables.
If I entered 2.5 for a value it would return the following three items from the tables since they all meet the requirement.
Table 2 Part min max 235 2.4 2.9
Table 6 Part min max 589 2.3 2.5
Table 7 Part min max 12 2.3 2.7
What would the best method be for setting up and accessing tables like this? Is C++ good at representing something like this or should I be looking at a different language?
What I would like to happen, when I run my code is that I'll get the following
Item_ID, Name, parent_Name 1 , jeff , jackson
DataSet DS = new DataSet(); if (this.OpenConnection() == true) { mySqlDataAdapter = new MySqlDataAdapter("select Item_ID, NAME, Parent_ID from table1, table2", connection); mySqlDataAdapter.Fill(DS); dataGridView1.DataSource = DS.Tables[0]; //close connection this.CloseConnection(); }
So this spit out parent ID = 5.
I've not worked with Dataset before and I was just wondering what is the best approach? Can this be done via a SQL command or will I have to replace the value(5) with the string(jackson) using a large IF loop to search and replace.
I'm trying ultimately to do a radix sort. I'm going with the implementation using two tables. One will initially hold the unsorted values then hold the partially sorted values thereafter. The other will be an array of linked lists which will be where the radix sort is done. Here is my code thus far:
Main
#include <iostream> #include <fstream> #include "radix.h" #include "radix.cpp" using namespace std ; int main ( int argc , char * argv [ ] ) { ifstream input ( argv [ 1 ] ) ;
[Code] ....
It appears to be crashing during void insert_into_sorted ( int to_insert , int place ) ; and I'm not sure why.
I'm having a bit of trouble with something. What I'm trying to do is create a new Access table by combining other already existing Tables.
For instance, let's consider Table1 (with columns A, B and C), Table2 (with columns A, D and E) and Table3 (with columns A, F and G), where Table1.A = Table2.A = Table3.A.
From these, I want to create a new table TableResult, with columns A, B, C, D, E, F and G, with all the data contained in them. There's one catch: I want the code to get the names of the other columns, apart from column A.
I've thought about using Union, but I need to actually create a new table by combining the previous tables.
SELECT DISTINCT P.PNo, P.PDate, P.PM, P.DisAmt, P.LT, P.NT, P.EID, P.PTime, C.EName FROM PurchaseDetails AS P INNER JOIN CustomerDetails AS C ON P.EID = C.EID
I have downloaded this project from here -->> [URL] ....
This one works fine and it's a great commented code to understand even for beginners like myself, but it only works with one table per sheet. Once I add second table in sheet, it throws an error that something is wrong in one of the columns in my spreadsheet: It says: " Error occurs! The error message is: Cannot find column 4. "
Basically, I have this type of tables in my spreadsheet:
So I want that my program would export those two tables in a single .XML file (just read them both). And those two tables should be separated in two XML childs: the upper one should be Order-Header and the lower one - Line-Items, like this:
I copied all the code because I think it is the easier way to spot where to change it, to read those two tables in one spreadsheet and export them both in one XML file. How could I achieve this kind of functionality.
I need to show in a comboBox thats shows infor from Entity framework but i need to select a specific colum in the tables..
All in C# visual studio xaml form
So I created a var but i get and output: name of programe.NLHEntities
using (var context = new NLHEntities()) { var blog = context.EtagesChambres .Where(b => b.TypeChanbre == "Prive") .FirstOrDefault(); textBox2Type.Text = Convert.ToString(blog);// i put a text box to see what the output would be.. }
I am having trouble with an assignment. The assignment consists of a basic encryption and decryption program already written for me, I just have to write the encryption function. What we have to get the program to do is enter an integer and a text, and get the program to increment each letter in the text by the integer given. I did this by using a for loop and incrementing each value in the string by the integer.
However, I still can't get it to decrypt and I need the program to work with only a-z letters (if I increment each letter by 3 and I have the letter Z, it should go to Z+3 = C).
I attached the description of the attachment and below are the codes: The first file does not need to be edited.
Code: /*******************Programming Assignment 1***************/ /****************Caesar's substitution cipher**************/ /*****************YOU MUST NOT EDIT THIS FILE**************/ /****Substitute alphabets in a string using rotation key***/ /****Leave all other characters unchanged******************/ /****Confirm correct encryption by decrypting**************/
I had to learn how to use variadic templates recently, and had trouble finding simple examples that just showed the basic syntax.
So I decided to write one myself. Admittedly, it's a bit on the long side, but that is mostly because it includes five specializations.
insert Code: // Variadic.C // Compile command: g++ Variadic.C -std=c++0x // I used GCC version 4.6.3 on Ubuntu.
// This file contains a basic variadic template with five specializations. // It is intended for non-software engineers who are looking for a simple // example of variadic template syntax.
#include <stdio.h> void Swap(int *x, int *y); int *Largest(int *array, int size); int main() { int a, b, i; int c[10]; int maxaddress; }
[code]...
My swap function works fine, but I am trying to find the ADDRESS of the largest element in my array and I am getting an error using gcc on my "return &largest;" and my printf line in my main function.How can I fix this and return the address of the largest?
So I am currently in the middle of learning c++ and I decided to jump ahead of the book and tried to do add procedures. My goal is to have main calling other procedures such as welcome message().
I want to configure netbeans 7.4 settings for c++.I'm posting here because netbeans forums are close to dead. How to do the following things :-
1) When you create a new project of a 'new application' type, main.cpp is already there with some code. I want that main.cpp to be completely empty when I create a new project.
2) When you compile/build your program and run it, the output is shown in a small log window at the bottom. I want it to be shown like in a black output terminal (console ?) just like in Visual Studio or CodeBlocks. (I have some reasons for not using them instead, so don't bother about me not using them)
3) When you click the green 'Run' icon in the upper toolbar, the project is compiled/build again and then runs afterwards. I want it to just run without compiling. (Compiling/Building should be done by 'Build' icon, just like in CodeBlocks or Visual Studio)
I have learned the basics you need to know about c++ so I was wondering, how do you make a GUI from scratch without using any programs like qt, daniweb, ect. Is there like a ongui() or something?
Let assume i have a gtk window with a drawing area and a button in it....
When the application is run it will show ball... when the button is pressed it will start bouncing from one side to other... When the button is pressed again it stop bouncing...
Also the window shows the current XY co-ordinates of the ball in the bottom left corner(inside the drawing area)...
I want to use C , GTK3 and CAIRO only...
I have googled and found animation example not with GTk3 but GTK's previous versions instead...those doesnt work with GTK3..i have also read cairo's official,zetecode's tutorails and some other sites..but nowhere found any solution to my problem...
I know how to do so with OpenGL and it's very easy...but i cannot apply the same logic with cairo and gtk3...please dont suggest to use GtkGlExt...i don't want to use it...