run_g

Member
  • Content count

    60
  • Joined

  • Last visited

Community Reputation

212 Neutral

About run_g

  • Rank
    Member
  1.     Its the bad interviewing methods of the industry that is killing my skills,   Originally I was top a class programmer. Then I had a break lasting several months (supposed yo be a temporal quit - due to family issues). Then I couldn't get in any more.   But I still kept up by developing great personal projects (a RT 3D photographic scanner- for example), Except that through the years, as I concentrated more on development, My theoretical rehearsing stop, that affected interviews.  My coding skills remained top class at first until i'm forced to work outside the industry 9 hours a day, 5/6 days a week (in a retail, restaurant - find it boring, not my calling), and now, after some few years of that , even my programming skills (and analysis skills) is now starting to get extremely rusty.   Its a chain effect that I wouldn't wish on my enemy   Yes, now i realise the solution was extremely simple, but i was attending to the forum during breaks in my long shift, was tired, lacked patience...  if I'd known my judgement would be affected that much i would have waited for my day-off 
  2. iterator output not in sync

    I do apologise     Wooh, rip-off, DeafManNoEars, BitMaster, Lasctose  et al   It did work with the correct behaviour with Wooh exact code   I dont know what mistakes i made originally that caused the errors that i observed the first times i tried it, I must overwritten some other code   My apologies and many thanks
  3. iterator output not in sync

      I did exactly that. Perhaps you are so much in a hurry to dismiss me that you didnt read the posts properly or follow the logic properly. (with respect : I don't mean to sound awful)   I know u know the following already but to reiterate I will add this anyway - Eclipse IDE doesn't work like visual studio. U see red error lines. not compile errors. Put the cursor on it and you see the errors. I immediately knew that vector3D v = vecIterator.next(); wouldn't work because the return type doesn't match vector3D data type       so   System.out.println("iterator list output " + v.x + " " + v.y + " " + v.z);   also had red lines. No compile errors (or it the editor automatically compiles without printing to the console)    All i was asking was a fresh eyes to look at it but you all kept refering to Wooh's fix which can never be the correct fix
  4. iterator output not in sync

      The whole code was posted in my 1st  and 5th posts.  Afterwards isolated snippets was because those were the only changes    But I will post all again here in one shot      Consist of the                   class conceptPractice   which contains the main() function                   class  myIterator                   class  vector3D                                                                   output as in first post.                m  thanx public class conceptPractice { static myIterator scanArray; public static void main( String[] args ){ scanArray = new myIterator(); scanArray.createListVector3D(); } } import java.util.ArrayList; //import java.util.Iterator; import java.util.List; import java.util.ListIterator; public class myIterator{ List<vector3D> vec = new ArrayList<vector3D>(); vector3D myTwoDimVec[][] = new vector3D[3][5]; myIterator( ){ for(int i=0; i<myTwoDimVec.length; i++){ for(int j=0; j<myTwoDimVec[i].length; j++){ //but this code makes it 10, 20, 30 11, 21, 31 12, 22, 32 etc // comment as in first post myTwoDimVec[i][j] = new vector3D(10+(i*myTwoDimVec[i].length+j), 20+(i*myTwoDimVec[i].length+j), 30+(i*myTwoDimVec[i].length+j)); vec.add( myTwoDimVec[i][j] ); } } } public void createListVector3D(){ for(int i=0; i<myTwoDimVec.length; i++){ for(int j=0; j<myTwoDimVec[i].length; j++){ System.out.println("2 dimen array output "+myTwoDimVec[i][j].x + " " + myTwoDimVec[i][j].y + " " + myTwoDimVec[i][j].z ); } } ListIterator<vector3D> vecIterator = vec.listIterator(); System.out.println( "============================================================="); while( vecIterator.hasNext()){ System.out.println( "iterator list output " + vecIterator.next().x + " " + vecIterator.next().y + " " + vecIterator.next().z ); } } } //=============================== vector3D class ================================================== import java.io.*; import java.math.*; public class vector3D{ float x; float y; float z; vector3D(){ } vector3D(float a, float b, float c){ x = a; y = b; z = c; } public void sum(){ } }
  5. iterator output not in sync

      *.next() and *.hasNext()  is part of the iterator class  ie     ListIterator<vector3D> vecIterator = vec.listIterator();   if you try to run all i posted originally you will see that the vector3D class doesn't have to have *.next() and *.hasNext()   i added  the code below becus it was suggested by @wooh..      vector3D v = vecIterator.next();     System.out.println("iterator list output " + v.x + " " + v.y + " " + v.z);
  6. iterator output not in sync

    No. this fix didnt compile, just Errors.  But the original code work except arraylist object didn't print out all data I had the crash when i tried the code below.  So i adjusted it further to the posted and had errors vector3D v = vecIterator.next(); System.out.println( "iterator list output " +  vecIterator.next().x + " " +  vecIterator.next().y + " " +vecIterator.next().z );          
  7. iterator output not in sync

      Here is the remaining part of the code (vector3D class), you can check the fix/adjustment also ,  thanks public class vector3D{ float x; float y; float z; vector3D(){ } vector3D(float a, float b, float c){ x = a; y = b; z = c; } public void sum(){ } }
  8. iterator output not in sync

      when I adjusted the code as you suggested i had an exception crash, i guess you are must be right but i not connecting with your suggestion properly. 
  9. iterator output not in sync

    Added some comments, hope that help understanding the code :)
  10. iterator output not in sync

      Just trying to add some vector3d data with x, y, z to an array list, and then output the data back using *.hasNext().  To show if the output is right or not i am also comparing with printing out the 2d vector3D out directly. So on comparing the output i found that *.hasnext() misses out on a whole lot of data   I will edit and add some comments to the code
  11. my iterator output (below) is picking up diagonals of vector3D array, why? how can i fix this code so the output is the same as the 2-d array output (below also)? Or is it a fact that iterators cannot be used with 2d arrays   many thanks        (just edited to add some comments now. Hope that helps)  public class myIterator{ List<vector3D> vec = new ArrayList<vector3D>(); vector3D myTwoDimVec[][] = new vector3D[3][5]; myIterator( ){ for(int i=0; i<myTwoDimVec.length; i++){ //double loop to traverse 2d vector array for(int j=0; j<myTwoDimVec[i].length; j++){ //setting values the x,y,z data feild of the vector3D // in order to make each data unique value and thus debugging is tractable // i am incrementing the data by 1 using i * myTwoDimVec[i].length + j // this is row* MaxColumnLength + current column // in other words if i do not increase by 1 at all then it will be //myTwoDimVec[i][j] = new vector3D(10, 20, 30 ); and all the data will look the same //but this code makes it 10, 20, 30 11, 21, 31 12, 22, 32 etc // so with this difference i can track which data went missing myTwoDimVec[i][j] = new vector3D(10+(i*myTwoDimVec[i].length+j), 20+(i*myTwoDimVec[i].length+j), 30+(i*myTwoDimVec[i].length+j)); vec.add( myTwoDimVec[i][j] ); // adding to the arraylist } } } public void createListVector3D(){ for(int i=0; i<myTwoDimVec.length; i++){ //double loop to print out the for(int j=0; j<myTwoDimVec[i].length; j++){// data directly- not using *.hasNext System.out.println("2 dimen array output "+myTwoDimVec[i][j].x + " " + myTwoDimVec[i][j].y + " " + myTwoDimVec[i][j].z ); } } ListIterator<vector3D> vecIterator = vec.listIterator(); System.out.println( "============================================================="); while( vecIterator.hasNext()){ // outputing using hasNext System.out.println( "iterator list output " + vecIterator.next().x + " " + vecIterator.next().y + " " + vecIterator.next().z ); } } } public class conceptPractice { static myIterator scanArray; public static void main( String[] args ){ scanArray = new myIterator(); scanArray.createListVector3D(); } } 2 dimen array output   10.0   20.0   30.0 2 dimen array output   11.0   21.0   31.0 2 dimen array output   12.0   22.0   32.0 2 dimen array output   13.0   23.0   33.0 2 dimen array output   14.0   24.0   34.0 2 dimen array output   15.0   25.0   35.0 2 dimen array output   16.0   26.0   36.0 2 dimen array output   17.0   27.0   37.0 2 dimen array output   18.0   28.0   38.0 2 dimen array output   19.0   29.0   39.0 2 dimen array output   20.0   30.0   40.0 2 dimen array output   21.0   31.0   41.0 2 dimen array output   22.0   32.0   42.0 2 dimen array output   23.0   33.0   43.0 2 dimen array output   24.0   34.0   44.0 ============================================================= iterator list output   10.0   21.0   32.0 iterator list output   13.0   24.0   35.0 iterator list output   16.0   27.0   38.0 iterator list output   19.0   30.0   41.0 iterator list output   22.0   33.0   44.0
  12.   You are perfectly right! as tough as that sounds you are damn right!!!   Probably 4 hours a day instead bcus  i need to fast-track myself away from the fried chicken job
  13.   fair enough for a multi-stage interview.  communication, aptitude, personalty ... coding . How do you assess the coding stage? Testing real algorithm development on computer would be closer to what the candidate would be doing if they join your company, so why not test them that way in addition.
  14. I've got serious problems with interviews ( I live in the UK ...  not sure if my experience is the same for those in the US or else where)   When i was in university over 13 years ago i practice code and definitions on paper - mainly to pass exams   But since leaving uni i coded straight to my computer....  because i code to develop projects (not to pass exams), and with advanced IDEs such as eclipse i can concentrate on developing algorithm. Of course i do analysis on paper - vector maths, algorithms, data-user interactions, image processing, rough pseudo-code  analysis... on paper. But never proper coding and never definitions because its never been necessary for my code to work. I get the full picture writing the code direct to my computer.   And i don't need to rehearse concepts in English because i know it. My focus can momentarily shift from a concept (depending on what i'm currently working on) and there are so many... but i can easily reference anything when i need it.   I don't even have to memorise definitions to get complicated code to work.   simple example: don't know the definition of anonymous inner class but i have used it b4 because once i see an example of how its used, i have always used it. My description of how i use didn't cut it with them, I have to define it using some key words.  Ok now with hindsight i can describe it better.  But my using it wouldn't necessarily improve and next time it would be something else   In my opinion core algorithm development on computer (not on paper) should be the best way to test the competence and intelligence of a developer    Yet whenever i go for an interview every time again and again and again (despite pre-asking to be tested by writing code to computer) i kept being tested by definitions and crossword-puzzle kind of coding questions on paper (where i can't get- in non-trivial situations- a full picture of the problem)   Then someone calls me dumb... because i scored 6/50 They don't even consider my portfolio-projects - taking the so-called test to over-rule my portfolio    Now i'm forced to work in KFC to pay my bills   Why do employers insist on this way of assessing programmers? Why are they so naive? What's the experience of others (not if you a boss your-self) on this forum?