Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mesho

@mesho
About
Posts
18
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • jFuzzy logic or Matlab
    M mesho

    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

    Java linux question

  • call by value for objects
    M mesho

    Luc 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:

    Java question java

  • call by value for objects
    M mesho

    my 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 :)

    Java question java

  • call by value for objects
    M mesho

    i 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:

    Java question java

  • call by value for objects
    M mesho

    hi all as u know java is using call by reference with objects how can i instead call by value for objects?? thanks in advance

    Java question java

  • decryption with AES
    M mesho

    yes i don't think that the problem is with encrypted data how about reading encrypted data, and key? is there any mistake?

    Java cryptography

  • decryption with AES
    M mesho

    sorry, it was a typing error what about my exception?any idea? :((

    Java cryptography

  • decryption with AES
    M mesho

    hi 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()];

    Java cryptography

  • help in building a color lookup table
    M mesho

    Thanks 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:

    Graphics graphics game-dev data-structures help question

  • help in building a color lookup table
    M mesho

    Microsoft Visual Studio 2005

    Graphics graphics game-dev data-structures help question

  • help in building a color lookup table
    M mesho

    No 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(); } }

    Graphics graphics game-dev data-structures help question

  • help in building a color lookup table
    M mesho

    thanks, 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?? :((

    Graphics graphics game-dev data-structures help question

  • help in building a color lookup table
    M mesho

    i 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

    Graphics graphics game-dev data-structures help question

  • help in building a color lookup table
    M mesho

    hello, 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:

    Graphics graphics game-dev data-structures help question

  • create MS access DB from VB
    M mesho

    hi 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

    Visual Basic database help question

  • calling C++ from Visual Basic code
    M mesho

    Hi 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?

    Visual Basic question c++ help

  • .pst file
    M mesho

    thank you killerp very much :)

    Visual Basic help question

  • .pst file
    M mesho

    Hi 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

    Visual Basic help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups