I am really confused as to how this works? You have a critique but where does the critique come in? Also is their a difference between activation on hidden nodes and output nodes? Does the critique come in during the hidden node? or the input node? Thanks

Member Avatar
+0 forum 0

TITLE SHOULD ACTUALLY BE: how to get mouselistener to work on method in an class in java If I click a circle it should change the color of the circle. But, I am having difficult getting it to work. Help appreciated. Main just calls this class and calls the init function. [CODE] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package hopfieldnet; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseListener; import javax.swing.*; public class hop2d extends JFrame{ static final int MAXPATTERNS = 4; static final int ROWS = 8; …

Member Avatar
Member Avatar
+0 forum 4

I am trying to implement a hopfield net to learn patterns. This is what I current have.... I am current having it create a random number of patterns based on the number of neurons Next I am trying to make a weight matrix Should I have a seperate weight matrix for every or is one good enough to apply the hebbs learning rule to? One should be enough since I know based on nodes how many it can recognize based on following formula: N/4 * log N, where N is numofNodes. it is log base 2? Thanks. [CODE] #include <iostream> …

Member Avatar
Member Avatar
+0 forum 5

Having problems with executing jobs using fork. The code is supposed to create one job and execute one job and repeat this multiple times. We are only supposed to use usleep in the jobgeneration() function. We are having trouble sleeping and executing ctrl-c in the execute job function. [CODE] #include <iostream> #include <fstream> #include <string> #include <sstream> #include <iterator> #include <vector> #include <map> #include <signal.h> #include <unistd.h> using namespace std; void jobScheduler(); void setJobQueues(); void jobGenerator(int maximumQueueSize); int createRandomJob(); int createRandomQuatnumInteger(); int selectJob(); void executeJob(int jobnumber); string convertInt(int number); int main() { int pid; int MAX_JOB_QUEUE_SIZE = 10; srand(time(0)); // …

Member Avatar
Member Avatar
+0 forum 6

[CODE] using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Win32; using System.Deployment; namespace RegisteryCheck { class Program { static void Main(string[] args) { ApplicationDeployment ab = new } } } [/CODE]

Member Avatar
Member Avatar
+0 forum 4

Any suggestions. I am assuming I use a registery but i dont' know which member to use. Thanks.

Member Avatar
+0 forum 0

I have set the textbox to public so that another form can access it but when i run it in debug mode with the following line it gives me exception so it doesn't store correct directory. For example: If I enter D:\newfolder it gives me D:\\newfolder. Why does it add the extra \. Here's the exception: An exception 'Microsoft.VisualStudio.Debugger.Runtime.CrossThreadMessagingException' occurred Here's the line where the exception occurs. Choose is a class in the same namespace as the method which contains this string. The method is in a different class than the choose class. txtbxTargetDir is the name of the textbox. …

Member Avatar
Member Avatar
+0 forum 13

Take line below which is in batch file and convert it in C# so that I don't have to create a seperate file. Thanks! Any suggestions? I have spent way too long on this. Odbcconf /a {CONFIGDSN "Microsoft Access Driver (*.mdb)" "DSN=NexTest_CDMA_2009|Description=NexTest_CDMA_2009|DBQ=C:\prod\database\nextest_CDMA_2009.mdb"}

Member Avatar
+0 forum 0

[CODE] //copy database files to target directory string fileName = "test.txt"; string targetPath = StaticFormInstances.choose.txtbxTargetDir.Text; string sourcePath = @"\\il93fil48\3GSM\release\testapplication_REL_01_00_09\database"; //Use Path Class to manipulate file and directory paths string sourceFile = System.IO.Path.Combine(sourcePath, fileName); string destFile = System.IO.Path.Combine(targetPath, fileName); //Create a new target folder if it doesn't exist if (!System.IO.Directory.Exists(targetPath)) { System.IO.Directory.CreateDirectory(targetPath); } if (System.IO.Directory.Exists(sourcePath)) { string[] files = System.IO.Directory.GetFiles(sourcePath); //calculate total number of files in source int totalNumberOfFiles = files.Length; //current file number int fileNumber = 0; //create object to store database string OdbcConnectionStringBuilder builder = new OdbcConnectionStringBuilder(); foreach (string s in files) { //increase file number by 1 fileNumber++; …

Member Avatar
Member Avatar
+0 forum 1

I was wondering how you do this. Would you have to use delegates and event handlers or can you do it through application.Run(object) and call that in the clickevent but I need to keep a reference to previous form. but that doesn't seem possible.

Member Avatar
Member Avatar
+0 forum 4

In the following code how to fix problem that the batch file won't get created. When I run in debug mode exception I get is "could not find part of path" Thanks [CODE] StreamWriter sw = null; try { if (AgilentNVisaDriver.Checked == false && RequiredDlls.Checked == false) { MessageBox.Show("Please select the application you would like to install"); } else { Assembly objAssembly = Assembly.GetAssembly(this.GetType()); string strAppPath = objAssembly.CodeBase; strAppPath = strAppPath.Replace("SplashScreen.dll", ""); Uri objUri = new Uri(strAppPath); strAppPath = @objUri.AbsolutePath; string strBatchFilePath = strAppPath + @"Setup.bat"; sw = File.CreateText(strBatchFilePath); [/CODE]

Member Avatar
Member Avatar
+0 forum 1

How to use bootstrapper manifest to create a prerequistie which runs another windows application installer before the setup.exe installer from the deployment project. Thanks.

Member Avatar
+0 forum 0

how to have an executable run before deployment project executable? Thanks

Member Avatar
+0 forum 0

how would you do that? Language similar to LISP I don't think you can use cons twice. really stuck. maybe (define a '('()))

Member Avatar
Member Avatar
+0 forum 1

I can write the recursion version correctly need help with writing a do loop in DrScheme. After the do loop the variable x is sent to car L intially and then is updated to first element of everything but first element in list. [CODE] (define (sumiteration L) (do ((x (car L) (car(cdr L)))) ((null? L)) (set! sum (+ sum x))) ) [/CODE]

Member Avatar
Member Avatar
+0 forum 6

I have added a reference to dll file in VS 2008. Yet I still get an error. Not sure why, do I have to do some other changes to get it to work?

Member Avatar
Member Avatar
+0 forum 2

Here's the assignment: You are to create a single server (in either Java or C/C++) which can service both C/C++ and Java clients. The protocol of the server is as follows: 1. The client contacts the server. 2. The client performs a single send of a data packet containing the following items (in the order specified): a. a 32-bit signed integer (int) b. a 64-bit floating point value (double) c. another 64-bit floating point value (double) d. another 32-bit signed integer (int) e. an array of 80 bytes representing a C char array (i.e. a C “string” – NOT a …

Member Avatar
Member Avatar
+0 forum 5

It is impossible in C++ since you have to use iterator to erase. Here's what I have: main.ccp [CODE] #include <iostream> #include <vector> #include "Mastermind.h" int main() { vector<int>* answer=new vector<int>(4); cout<<"enter an code\n"; for(int i=0; i<4; i++) { int k; cin>>k; answer->push_back(k); } //initalize population Mastermind a(5); //set answer a.setanswer(answer); a.showpopulation(); a.evaluateblackandwhite(); return 0; } [/CODE] Mastermind.h [CODE] #include <vector> #include <string> using namespace std; class Mastermind { public: Mastermind(int populationsize); void showpopulation(); void setanswer(vector<int>* answer); void evaluateblackandwhite(); void calculatepopulationfitness(); int evaluatepopulation(); int sum(int index); int randomizenumber(); private: int populationsize_; vector<int>* answer_; vector<vector<int>>* tempanswer_; vector<int>* fitness_; vector<vector<int>>* population_; vector<int>* …

Member Avatar
Member Avatar
+0 forum 2

starting to think that memory isn't big enough. the totalnumberofpegs i only set it to 0 in my code yet it changes it self somehow :(. please help i have tried everything. It shows that it is 0 in all other functions. main.cpp [CODE] #include <iostream> #include <ctime> #include <stdio.h> #include "Mastermind.h" using namespace std; int main() { int* answer=new int[4]; int populationsize=0; srand((unsigned)time(NULL)); cout<<"please select 4 numbers out of the following options"; cout<<"\nred:0\n" "black:1\n" "yellow:2\n" "white:3\n" "blue:4\n" "green:5\n"; for(int i=0; i<4; i++) { cin>>answer[i]; } Mastermind a; a.setanswer(answer); cout<<"please enter a population size"; cin>>populationsize; a.setpopulationsize(populationsize); a.initializepopulation(); a.calculatenumberofblackpegs(); a.calculatenumberofwhitepegs(); a.print(); …

Member Avatar
Member Avatar
+0 forum 2

so i think i know where the problem is... it return garbage for code_pos even though i initalize and change values assigned to it. :( Please help. but don't know how to fix it. main.cpp [CODE] #include <iostream> #include <ctime> #include <stdio.h> #include "Mastermind.h" using namespace std; int main() { int* answer=new int[4]; int populationsize=0; srand((unsigned)time(NULL)); cout<<"please select 4 numbers out of the following options"; cout<<"\nred:0\n" "black:1\n" "yellow:2\n" "white:3\n" "blue:4\n" "green:5\n"; for(int i=0; i<4; i++) { cin>>answer[i]; } Mastermind a; a.setanswer(answer); cout<<"please enter a population size"; cin>>populationsize; a.setpopulationsize(populationsize); a.initializepopulation(); a.calculatenumberofblackpegs(); a.calculatenumberofwhitepegs(); a.print(); return 0; } [/CODE] mastermind.h [CODE] #include <iostream> …

Member Avatar
Member Avatar
+0 forum 1

When i try it goes heywire and gives me 35 errors. all for the erase command. :( [CODE] for(int i=0; i<populationsize_; i++) { //check for black for(int j=answer_->front(); j!=answer_->back(); j++) { if(answer_[j]==population_[i][j]) { feedback_[i][j].push_back("Match"); for(int k=tempanswer_->at(i).front(); k!=tempanswer_->at(i).back(); k++) { //find first instance if(tempanswer_[i][k]==answer_[j]) { tempanswer_[i].erase(k); break; } } } } } [/CODE]

Member Avatar
Member Avatar
+0 forum 8

Need to calculate number of white pegs so I can write fitness function. It works sometimes and it doesn't work other times. I got the calculate number of black pegs to work. A black peg is correct position and color. A white peg is correct color wrong position. Colors are numbers in my program. Here is all my code so far. Any help appreciated. main.cpp [CODE] #include <iostream> #include <ctime> #include "Mastermind.h" using namespace std; int main() { int* answer=new int[4]; int populationsize=0; srand((unsigned)time(NULL)); cout<<"please select 4 numbers out of the following options"; cout<<"\nred:0\n" "black:1\n" "yellow:2\n" "white:3\n" "blue:4\n" "green:5\n"; for(int …

Member Avatar
Member Avatar
+0 forum 23

Here's my code. [CODE] (define L ()) (define (union L1 L2) ;continue until one list is empty (do() ((or (null? L1) (null? L2))) (cond ((<(car L1)(car L2)) (attach(car L1)(cdr L1)L2)) ((eq?(car L1)(car L2)) (attach(car L1)(cdr L1)(cdr L2))) (else(>(car L1)(car L2)) (attach(car L2)L1(cdr L2))) ) ) ;after which you continue to add add while one list isn't empty and ;the second one isn't empty. I know I need a new attach function. ) (define (attach item List1 List2) (cons item L) (union List1 List2) ) [/CODE]

Member Avatar
+0 forum 0

so far I can't figure out a way to write powerset in SML :(. I see a pattern for example powerset([1,2,3]) is [] [1] [2] [1,3] [3] [1,2] [2,3] [1,2,3] Here's what I have come up with: fun add(a,L)= [a]@L fun ps(L)= ps(tl L)@add(hd L, ps(tl L)); Any help appreciated.

Member Avatar
Member Avatar
+0 forum 2

I recently updated to windows 7 and since then I have been having this problem. Any help appreciated.

Member Avatar
Member Avatar
+0 forum 2

I plan on using the Bayesian method to try and solve the mastermind problem. The user will enter 4 numbers which represent the colors on the board from 6 different colors. After which the computer will randomly estimate the posterior probabilities for all events. ?Then continue with this scheme until it has gone through 12 rounds or guesses the score?. An event is defined as a row that the codebreaker uses.

Member Avatar
+0 forum 0

When i run main it prints out gibberish not sure why. main.cpp [CODE] #include <iostream> #include <string> #include "phrase.h" #include "EA.h" #include <cstdlib> #include <time.h> int main() { phrase a; EA b; std::string phrase; int populationsize; std::cout<<"enter a population size\n"; std::cin>>populationsize; std::cin.ignore(); b.setpopulationsize(populationsize); std::cout<<"enter a string\n"; getline(std::cin,phrase); a.setphraselength(phrase); b.setlength(phrase); std::cout<<"the phrase length is"<<a.getphraselength()<<std::endl; srand ((unsigned)time(0)); b.initalizepopulation(); /*while(phrase!=bestofpopulation()) { //mutate and crossover to create new population }*/ return 0; } [/CODE] EA.h [CODE] #ifndef EA_H_INCLUDED #define EA_H_INCLUDED #include <string> #include "phrase.h" #include <iostream> class EA:public phrase { public: EA(); ~EA(); void setgenerationnumber(int generationnumber); int getgenerationnumber(); void setpopulationsize(int populationsize); void setlength(std::string length); …

Member Avatar
Member Avatar
+0 forum 1

I am trying to create a double pointer. never done it before. Problem is currently in intializepopulation(); Error C2106 left of operand must be l-value. EA.h [CODE] #ifndef EA_H_INCLUDED #define EA_H_INCLUDED #include <string> #include "phrase.h" #include <iostream> class EA:public phrase { public: EA(); ~EA(); void setgenerationnumber(int generationnumber); int getgenerationnumber(); void setpopulationsize(int populationsize); void initalizepopulation(); void mutate(); //void crossover(); std::string bestofpopulation(); private: int populationsize_; int generationnumber_; char** population_; }; #endif // INTERFACE_H_INCLUDED [/CODE] EA.cpp [CODE] #include "EA.h" EA::EA() { populationsize_=NULL; generationnumber_=0; population_=NULL; } EA::~EA() { delete population_; } void EA::setgenerationnumber(int generationnumber) { generationnumber_=generationnumber; } int EA::getgenerationnumber() { return generationnumber_; } void …

Member Avatar
Member Avatar
+0 forum 5

its it skipping. This is the part of the code. :( cout<<"enter a string\n"; getline(std::cin,phrase); [CODE]#include <iostream> #include <string> #include "phrase.h" #include "EA.h" #include <cstdlib> #include <time.h> int main() { phrase a; EA b; std::string phrase; int populationsize; //int percentmutation; std::cout<<"enter a population size\n"; std::cin>>populationsize; b.setpopulationsize(populationsize); //std::cout<<"enter the percentage you would like to mutate\n"; //std::cin>>percentmutation; std::cout<<"enter a string\n"; getline(std::cin,phrase); //std::cout<<a.getphraselength(); srand ((unsigned)time(0)); b.initalizepopulation(); /*while(phrase!=bestofpopulation()) { //mutate and crossover to create new population }*/ return 0; } [/CODE]

Member Avatar
Member Avatar
+0 forum 1

Still having trouble install opencv. I used cmake doing what was told and it created files in a folder then i ran the install VC++ project. After which I went back to cmake and generated the examples. ran those. My path environment variable is C:\OpenCV2.0\bin, I was wondering whether it should be where the generated files by cmake are? Thanks.

Member Avatar
+0 forum 0

The End.