Hi everybody I want to develop a fuzzy expert system but I don't know what to use Do you recommend jFuzzylogic (Eclipse plug-in) or Matlab or an expert system shell like (FuzzyCLIPS or JESS)? I prefer the easiest and highly supported one. Thank you in advance and sorry if this is not the suitable section
mesho
Posts
-
jFuzzy logic or Matlab -
call by value for objectsLuc Pattyn Cédric Moonen thank u all for your reply its clear now that's my problem was i don't create a new insantce of my objects but i referenced to existing object schedule s = POP.get(i); where POP is arraylist of schedules again thank u for ur help:rose::rose::rose:
-
call by value for objectsmy code is very long, that's why i don't write it before i'm writing a program for multiprocessor using genetic algorithm
ArrayList POP=new ArrayList (); for(int i=0;i<10;i++) POP.add(generate_schedule()); ArrayList TMP=new ArrayList (); for(int j=0;j < NPOP.size()/2;j++) { schedule s1=NPOP.get(j); schedule s2=NPOP.get(j+(POP.size()/2)); Random rand=new Random(); double r=rand.nextDouble(); if(r<=CrossOver_prob) { ArrayList result=new ArrayList (); result=crossover(s1,s2); TMP.add(result.get(0)); TMP.add(result.get(1)); } else { TMP.add(s1); TMP.add(s2); } } for(int j=0;j < TMP.size();j++) { System.out.println("schedule"+j); Random rand=new Random(); double r=rand.nextDouble(); if(r<=Mutation_prob) **POP.add(Mutation(TMP.get(j)););** else POP.add(TMP.get(j)); }
my problem is on the bold line when calling mutation all schedules in TMP is changed hope its clear now :) -
call by value for objectsi have arraylist of objects and i wrote a method that take one object from the arraylist and return a modified object the problem is after calling the method all objects in the arraylist changed to the new value!!! when i debuge my program i realized that all objects (in the array list and the returning object) have the same id (i'm using eclipse), which is suppose to be unique and because of that any changes to object are applied to all version i don't know way can you help please??:rose:
-
call by value for objectshi all as u know java is using call by reference with objects how can i instead call by value for objects?? thanks in advance
-
decryption with AESyes i don't think that the problem is with encrypted data how about reading encrypted data, and key? is there any mistake?
-
decryption with AESsorry, it was a typing error what about my exception?any idea? :((
-
decryption with AEShi everybody :) i'm trying to write a program that uses "brute force" to decrypt an encrypted message (using AES), where I only have the first 96-bits of the 128-bit secret key when i complie i got this exception: Exception in thread "main" javax.crypto.BadPaddingException: Given final block not properly padded:confused: my code:
public static byte[] encrypt (byte[] plainText , SecretKeySpec spc) throws NoSuchAlgorithmException,GeneralSecurityException { Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE,spc); byte[] cipherText = cipher.doFinal( plainText); return cipherText ; } public static byte[] decrypt (byte[] cipherText , SecretKeySpec spec) throws NoSuchAlgorithmException,GeneralSecurityException { Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, spec); byte[] plainText = cipher.doFinal(cipherText); return plainText ; } public static void readfile(RandomAccessFile file, byte[] bytes) throws Exception { file.seek(0); int offset = 0; int numRead = 0; while (offset < bytes.length && (numRead=file.read(bytes, offset, bytes.length-offset)) >= 0) { offset += numRead; } } public static void main(String[] args) throws Exception { try { // 1: open cipher file RandomAccessFile cipherfile = new RandomAccessFile( "ciphertext2.dat", "r" ); // read cipher text byte[] bytes = new byte[(int)cipherfile.length()]; readfile(cipherfile,bytes); // 3: RandomAccessFile file = new RandomAccessFile( "partial-key.dat", "r" ); byte[] keybytes = new byte[(int)file.length()+4]; readfile(file,keybytes); for(int i=0;i<256;i++) { keybytes[12]=(byte)i; for(int j=0;j<256;j++) { keybytes[13]=(byte)j; for(int k=0;k<265;k++) { keybytes[14]=(byte)k; for(int l=0;l<265;l++) { keybytes[15]=(byte)l; SecretKeySpec key = new SecretKeySpec(keybytes, "AES"); byte[] plain=new byte[(int)cipherfile.length()];
-
help in building a color lookup tableThanks Tim very much for ur help i solve the problem, the problem was that my project was in release mode so i changed it now to debuge mode and it works well i really appreciate your help:rose:
-
help in building a color lookup tableMicrosoft Visual Studio 2005
-
help in building a color lookup tableNo i'm sure there is no syntax errors, the error in the loop header only appear when i copy from my program anyone have solutions for my problem????
inline void CMesh::RenderFaceNormals() { float t=0.5; CVector v0,v1; for(int i=0 ; i< get_numOfFaces() ;i++) { v0 = (verts[faces[i]->get_v0()]->get_gp()+ verts[faces[i]->get_v1()]->get_gp()+ verts[faces[i]->get_v2()]->get_gp() )/3; v1 = t * faces[i]->get_normal(); glBegin(GL_LINES); glVertex3f(v0.X(), v0.Y(), v0.Z()); // origin of the line glVertex3f(v1.X(), v1.Y(), v1.Z()); // ending point of the line glEnd(); } }
-
help in building a color lookup tablethanks, i solved the problem of th table but i have another question pls i implement this function to render the face normal of the mesh but when i debug i found that the program doesn't enter the loop at all and i get this in the watch of the debug when i type i: i CXX0017: Error: symbol "i" not found inline void CMesh::RenderFaceNormals() { float t=0.5; CVector v0,v1; for(int i=0 ; iget_v0()]->get_gp()+ verts[faces[i]->get_v1()]->get_gp()+ verts[faces[i]->get_v2()]->get_gp() )/3; v1 = t * faces[i]->get_normal(); glBegin(GL_LINES); glVertex3f(v0.X(), v0.Y(), v0.Z()); // origin of the line glVertex3f(v1.X(), v1.Y(), v1.Z()); // ending point of the line glEnd(); } } it seems that my program doesn't see i?? can anyone help me?? :((
-
help in building a color lookup tablei used i/255 to compute the red value,i didn't test my program yet but my question was is this enough to build the lookup table or I should use some gl commands to enable the index color mode?? can i use now glindex()?? thanks
-
help in building a color lookup tablehello, i'm new to openGL, and i'm trying to build a color lookup table of size 265 is there any thing wrong in my code??:confused::confused: // i define the array in header GLfloat color_table[256][4]; void BuildColorLookUpTable() { for(INT i = 0; i < 256; i++) { GLfloat red=i/255; GLfloat green=0; GLfloat blue=1-i/255; color_table[i][0] = 0; color_table[i][0] = red; color_table[i][0] = green; color_table[i][0] = blue; glutSetColor(i, red, green, blue); } } also, can anyone pls give me some guides :doh: thanks:rose:
-
create MS access DB from VBhi I'm trying to write a code that create DB & tables in MS access using VB, when I excute my code the DB is created but I don't see any table in the DB when I open the access file. Can any one tell me what's the problem? This is my code: Public Function CreateAccessDatabase(ByVal DatabaseFullPath As String) As Boolean Dim bAns As Boolean Dim cat As New ADOX.Catalog() Dim table1 As New ADOX.Table() Dim cn As ADODB.Connection cn = New ADODB.Connection Try Dim sCreateString As String sCreateString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DatabaseFullPath cat.Create(sCreateString) bAns = True Catch Excep As System.Runtime.InteropServices.COMException bAns = False 'Open the connection cn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\testdb.mdb") 'Open the Catalog cat.ActiveConnection = cn 'Create the table table1.Name = "Test_Table" 'Create and Append a new field to the "Test_Table" 'Columns Collection table1.Columns.Append("PrimaryKey_Field", ADOX.DataTypeEnum.adInteger) 'Create and Append a new key. Note that we are merely passing 'the "PimaryKey_Field" column as the source of the primary key. 'Thi snew Key will be Appended to the Keys Collection of '"Test_Table" table1.Keys.Append("PrimaryKey", ADOX.KeyTypeEnum.adKeyPrimary, "PrimaryKey_Field") 'Append the newly created table to the Tables Collection cat.Tables.Append(table1) ' clean up objects table1 = Nothing cat = Nothing cn.Close() cn = Nothing Finally End Try Return bAns End Function
-
calling C++ from Visual Basic codeHi I have a project written in VB & I want to call a C++ code inside my project How can I do that? Or it is easier to change the second code to VB Can anyone help me pls?
-
.pst filethank you killerp very much :)
-
.pst fileHi forum members :) , I want to write a VB code that read .pst(outlook) file can any help me in that :( ? should I convert the file in other extension first, or I can read it directly? Regards, mesho