Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. invalid6363

    Connection Ruby program to databse

    Ok. Thanks for your help.
  2. invalid6363

    Connection Ruby program to databse

    I have made a GUI application using Ruby\FXRuby and i would like to be able to connect it to a database to save the data that is entered in the application. It's a simple application that saves a person's contacts (name, address, email, etc.). I'm trying to use SQLite3 but i have not been able...
  3. invalid6363

    Need help creating edges between all vertices

    Ok. Thanks. new code to add edges between vertices: private static void setVertices(int n) { int vertexLength = n; /* Create vertices */ for(int i = 0; i < vertexLength; i++) { undirGraph.addVertex("City" + String.valueOf(i+1) + " - "); } } private static void setEdges()...
  4. invalid6363

    Need help creating edges between all vertices

    I'm trying to create a graph with 'n' vertices and create edges between all the vertices. Here is the code for adding vertices and edges: private static void setVertices(int n) { int vertexLength = n; /* Add vertices */ for(int i = 0; i < vertexLength; i++) {...
  5. invalid6363

    Trouble with accepting user input

    Oh, ok. Thanks for your help. I made the change in the code and it works perfectly now. :-)
  6. invalid6363

    Trouble with accepting user input

    hello, i'm new to ruby and i'm trying a to write a simple greeting program that accepts input from the user (user's name) but its not completely working the way i would like it to. It doesn't print out the goodbye messages and doesn't work when nothing is typed in (Hello World should print out)...
  7. invalid6363

    Need help creating multithreaded program

    i'm trying to do one of the exercises from my OS book. the exercise is about creating a multithreaded solution that performs matrix multiplication.(A[i,j] x B[i,j]= C[i,j]) it says that for this exercise you need to calculate each element C[i,j] in a separate worker thread. This will involve...
  8. invalid6363

    help with arranging flags program

    i'm trying to learn prolog and one of the problems that i am trying to do is the following: Write a Prolog program that takes the total number of flags of each color and some initial arrangement of flags. The initial arrangement may be empty, or it may specify that certain positions in the line...
  9. invalid6363

    formating character lenght of a line in a txt file

    ok, i made the change from [i+2..-1] to [i+2..$#line] and it is now working correctly but isn't -1 and $#line stating the same thing, to go from i+2 to the end of the list?
  10. invalid6363

    formating character lenght of a line in a txt file

    Oh, ok. i get it. thanks franco but one minor problem. when i ran the code for format 3 the address field did not print to the outfile but the other fields did and in the correct order. instead of printing to outfile: 23573456 Mary Beth Davis 000 (541) 555-4321 234 Bridge St. Abc, OR. 24356 it...
  11. invalid6363

    formating character lenght of a line in a txt file

    franco, could you explain your code for format 3, i don't fully understand how it works: for(my$i=1;$i<@line;$i++){ if($line[$i]=~/^\(\d{3}\)$/){ $phone=join' ',@line[$i..$i+1]; $name=join' ',@line[0..$i-1]; $address=join' ',@line[$i+2..-1]; last; } } how did you determine...
  12. invalid6363

    formating character lenght of a line in a txt file

    thanks franco for your help. i got the second format to work. elsif(length($line) == 150){ $name = substr($line,0,50); $account = substr($line,50,10); $phone = substr($line,60,14); $status = substr($line,74,3); $address = substr($line,77,73)...
  13. invalid6363

    formating character lenght of a line in a txt file

    any suggestions on how to improve code?
  14. invalid6363

    formating character lenght of a line in a txt file

    Here is what the code looks like so far: #!/usr/bin/perl open(INFILE, "input.txt"); open(OUTFILE, ">output.txt"); open(ERRORFILE, ">errorfile.txt"); #performs data cleanup and formatting functions on a semi-structured input #file. #name = [A-Za-z\s-']+ #phone number =...
  15. invalid6363

    formating character lenght of a line in a txt file

    These are the fields that make up a data record: Name: Customer names may contain any alphabet letter, spaces, hyphens, and apostrophes. Address: May contain any letter or number, spaces, and the following symbols: # , ' :. - / Phone Number: Will always be in format (###) ###-#### Status: 3...
  16. invalid6363

    formating character lenght of a line in a txt file

    here is an example of how the input data could look in the text file: Joe Smith, 1 Uni Dr. Camarillo, CA. 93012., (805) 555-1234, AW87124356, 001 Joe Smith AW87124356(805) 555-12340011 Uni Dr. Camarillo, CA. 93012...
  17. invalid6363

    formating character lenght of a line in a txt file

    Here is the majority of the code and it does work but not as it should: #Format 2 #Each line is fixed at 150 characters in length. #Each field has an assigned number of characters. If the #data for that field contains less than the maximum number of characters, that field will be right-padded...
  18. invalid6363

    formating character lenght of a line in a txt file

    i need help on writing some code that will take each line of a file and determine if it contains the right length of characters for each line (150 max). Each line in the file contains 5 fields and has an assigned number of characters: name (0-49) address (50-59) phone number (60-73) status...
  19. invalid6363

    Searching for a pattern in a list

    what about for a pattern of three? i tried just simply adding another variable : occurs([X,Y,Z|_],X,Y,Z). occurs([_|L],X,Y,Z) :- occurs(L,X,Y,Z). but this does not work at all. any suggestions?
  20. invalid6363

    Searching for a pattern in a list

    this seems to work for a pattern of two: occurs([X,Y|_],X,Y). occurs([X|Y],X,Y). occurs([_|L],X,Y) :- occurs(L,X,Y).

Part and Inventory Search

Back
Top