JAVA,J2EE

Discussion in 'MCSE' started by SATHEES KUMAR . A, Dec 24, 2004.

  1. SATHEES KUMAR . A

    Nerd32768 Guest

    SELECT * FROM a-s-s-f-u-k-e-r-s WHERE brain_mg > 0
     
    Nerd32768, Dec 29, 2004
    #41
    1. Advertisements

  2. SATHEES KUMAR . A

    Nerd32768 Guest

    even better: this program that i made takes unlimited words and finds the
    definition on merriam webster's website

    Private Sub Command2_Click()
    Dim strWord As String
    Open "Wordlist.txt" For Output As #101
    Print #101, InputWord.Text
    Close #101
    Open "Wordlist.txt" For Input As #101
    While Not EOF(101)
    Line Input #101, strWord

    Open "mw.txt" For Output As #1
    sSource = "http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=" +
    strWord + "&x=0&y=0"
    Set oHTTP = CreateObject("Microsoft.XMLHTTP")
    oHTTP.Open "GET", sSource, False
    oHTTP.send
    html = oHTTP.responseText

    Print #1, html
    Close #1


    Dim str1 As String
    Dim MainEntryFound As Boolean
    Dim ForMoreInfoFound As Boolean
    MainEntryFound = False
    ForMoreInfoFound = False
    Open "mw.txt" For Input As #1
    Open "step1.txt" For Output As #2
    Open "step2.txt" For Output As #3
    Open "step3.txt" For Output As #4
    Open "step4.txt" For Output As #5
    Open "step5.txt" For Output As #6

    While Not EOF(1)
    Line Input #1, str1
    str1 = RemoveHTML(str1)
    Print #2, str1
    Wend
    Close #1
    Close #2

    Open "step1.txt" For Input As #2
    While Not EOF(2)
    Line Input #2, str1
    str1 = RemoveNBSP(str1)
    Print #3, str1
    Wend
    Close #2
    Close #3

    Open "step2.txt" For Input As #3
    While Not EOF(3)
    Line Input #3, str1
    If InStr(str1, "Main Entry") > 0 Then
    MainEntryFound = True
    End If
    If MainEntryFound = True Then
    Print #4, str1
    End If
    Wend
    Close #3
    Close #4

    Open "step3.txt" For Input As #4
    While Not EOF(4)
    Line Input #4, str1
    If InStr(str1, "For More Information") > 0 Then
    ForMoreInfoFound = True
    End If
    If ForMoreInfoFound Then
    GoTo step4
    Else
    Print #5, str1
    End If
    Wend
    step4:
    Close #4
    Close #5

    Open "step4.txt" For Input As #5
    While Not EOF(5)
    Input #5, str1
    If Len(Trim(str1)) > 0 Then
    Print #6, str1
    End If
    Wend
    Close #5
    Close #6
    Open "step5.txt" For Input As #6
    While Not EOF(6)
    Input #6, strOut
    txtOutput.Text = txtOutput.Text & vbCrLf & strOut
    Wend
    Close #6
    txtOutput.Text = txtOutput.Text + vbCrLf & vbCrLf & vbCrLf
    Wend
    Close #101
    End Sub

    Function RemoveHTML(strText)
    Dim RegEx

    Set RegEx = New RegExp

    RegEx.Pattern = "<[^>]*>"
    RegEx.Global = True

    RemoveHTML = RegEx.Replace(strText, "")
    End Function

    Function RemoveNBSP(strText)
    Dim nPos1
    Dim nPos2

    nPos1 = InStr(strText, "&")
    Do While nPos1 > 0
    nPos2 = InStr(nPos1 + 1, strText, ";")
    If nPos2 > 0 Then
    strText = Left(strText, nPos1 - 1) & Mid(strText, nPos2 + 1)
    Else
    Exit Do
    End If
    nPos1 = InStr(strText, "&")
    Loop

    RemoveNBSP = strText
    End Function



    I do plan to get rid of the regular expression, because they are a pain, and
    they make no sense to me
     
    Nerd32768, Dec 29, 2004
    #42
    1. Advertisements

  3. SATHEES KUMAR . A

    Neil Guest

    geez you need a hobby...can't you find a girlfriend or something?
     
    Neil, Dec 29, 2004
    #43
  4. SATHEES KUMAR . A

    Nerd32768 Guest

    this program has saved me hours of finding definitions. we get lists with up
    to 100 words at a time
     
    Nerd32768, Dec 29, 2004
    #44
  5. SATHEES KUMAR . A

    Ken Briscoe Guest

    In
    I think they probably want you to get used to using a dictionary, not the
    inTaRwEb. But nice thinking outside the box.

    --

    KB - MCNGP "silent thug" #26

    Briscobar AT gmail DOT com

    www.mcngp.com *is* the one who answered the phone.
     
    Ken Briscoe, Dec 29, 2004
    #45
  6. SATHEES KUMAR . A

    Ken Briscoe Guest

    In
    Invalid column name 'brain_mg'

    Perhaps you meant 'brain_dmg'? In which case, this is what my database
    returns:

    (94506414 row(s) affected)

    --

    KB - MCNGP "silent thug" #26

    Briscobar AT gmail DOT com

    www.mcngp.com will kill you! No, not! Only kidding!
     
    Ken Briscoe, Dec 29, 2004
    #46
  7. You don't bother renaming controls?
    Nice... at least you name your variables properly
    101? Why aren't you using Freefile and a variable?
    Well, you renamed one control, at least, but maybe it should have been
    called txtInputWord.
    That was quick.
    Won't this always be one iteration?
    Ack! Never use "+" in string concatenations! Always use "&"
    Nice. But why do you define some string variables as "str" and others as
    "s". Consistency!
    Tsk, tsk.
    Again, inconsitent... "bln" perhaps.
    Some strange indentation, but okay.
    This is why it's generally better to define booleans as "bln". The " =
    True" is unnecessary so it would be more readable and faster as:

    If blnMainEntryFound Then

    It would be even more concise to simply

    If InStr(str1, "Main Entry") Then

    and skip the boolean altogether.
    GoTo?

    GoTo?!?!?!?!?!?!?!?!?!?!?!?

    FAIL!

    Forget the While/Wend and re-write this as a Do/Loop if you ever hope to
    become a REAL programmer!

    GoTo = EVIL!
    Again, minor point:

    If Len(Trim$(str1)) Then

    The "$" is just more efficient, since it specifically expects a string
    parameter, as opposed to Trim() which accepts a variant (slower, less
    efficient)
    Maybe use vbNewLine instead. Same thing, but I suspect more portable.
    Notes in other function below apply here as well.
    Function RemoveNBSP(ByVal strText As String) As String?

    Nothing's defined! Is the function and parameter variant?
    I hope you copied this from someone else's code! Variants again? Very
    sloppy.
    Well, since it appears you borrowed some crappy code from someone else for
    the functions, your only major slip-up was the GoTo, so I'll give this a B+.

    If you want an A+, re-do the While/Wends to Do/Loops, preferably as
    procedures and shrink this code down some.

    --
    Fris "Too tired to scrutinize it completely" bee®, MCNGP #13

    The MCNGP Team - We're here to help!
    http://www.mcngp.com

    Certaholics
    http://groups.yahoo.com/group/certaholics
     
    =?Windows-1252?Q?Frisbee=AE?=, Dec 29, 2004
    #47
  8. SATHEES KUMAR . A

    Neil Guest

    he's probably also only seen an Art gallery from the world wide wait...
     
    Neil, Dec 29, 2004
    #48
  9. SATHEES KUMAR . A

    Nerd32768 Guest

    this is beta 0.1 version. i wrote it in half an hour in an emergency, and i
    DID get some of the code off of the internet, which is why some things are
    inconsistent, but i DO plan on rewriting it. I plan on becoming a sysadmin,
    not a programmer, but programming is still an occasional hobby of mine.

    *NOTE TO NON-MCNGP*
    Read Frisbee's post above, and you will see that us MCNGP actually do know
    things. IF FRISBEE HAD [email protected] AND [email protected] INTO HIS JOB, THEN HE
    WOULDN'T BE ABLE TO DO THIS!
     
    Nerd32768, Dec 29, 2004
    #49
  10. SATHEES KUMAR . A

    Nerd32768 Guest

    SELECT * FROM a-s-s-f-u-k-e-r-s WHERE brain_mg > 0
    briain_miligrams
    or brain_mcg is the same as brain_micrograms
     
    Nerd32768, Dec 29, 2004
    #50
  11. SATHEES KUMAR . A

    Ken Briscoe Guest

    In
    I think you may need a new hobby. Programming != fun.

    --

    KB - MCNGP "silent thug" #26

    Briscobar AT gmail DOT com

    nerd32768 needs your business. Visit www.mcngp.com today.
     
    Ken Briscoe, Dec 29, 2004
    #51
  12. That's why you're not a programmer. It has to be fun, or don't get into the
    field. You'll hate it if you don't like constant challenges. On the other
    hand, even if you like programming, if you want to keep a full head of hair,
    don't become a programmer.

    You probably don't like crosswords, either.

    Personally my favorite is cross sums.

    --
    Fris "Puzzler" bee®, MCNGP #13

    The MCNGP Team - We're here to help!
    http://www.mcngp.com

    Certaholics
    http://groups.yahoo.com/group/certaholics
     
    =?Windows-1252?Q?Frisbee=AE?=, Dec 29, 2004
    #52
  13. SATHEES KUMAR . A

    Ken Briscoe Guest

    In
    I don't have the patience to be a programmer. Make one typo, and you have to
    spend eleventy-six years trying to figure out why your $#**$*^ code won't
    compile, run, or whatever you're trying to do with it. But then again, I'm
    getting more and more into SQL, which isn't exactly programming, but as I'm
    writing more and more expansive sprocs, views, functions, is taking up more
    and more of my time finding junk like
    Server: Msg 170, Level 15, State 1, Line 104
    "Incorrect syntax near ItemKey"

    Whatever, I just have to learn to not throw in extraneous parentheses and
    stuff. Query Analyzer needs a spellchoker.
    Actually, I very much do.
    Those the things where all the rows/columns/diagonals have to add up to the
    same number? Yeah, they're fun. I'm mathy, so I get a kick out of those.

    --

    KB - MCNGP "silent thug" #26

    Briscobar AT gmail DOT com

    My psychiatrist recommends 10mg of Valium, a shot of Tequila, and
    twice-daily viewings of the b00bz0rs forum on www.mcngp.com
     
    Ken Briscoe, Dec 29, 2004
    #53
  14. Actually cross sums kinds of looks like a crossword puzzle, except that the
    rows and columns are all numbers (1-9) where the digits can only be used
    once and their sum is given as the clue. The Japanese call it Kakro and
    there was a cool site that had like over one hundred of them, but they shut
    the ^&^&^*(^ site down a few months after I found it. There's a shareware
    program that creates them, but it kinda sucks, and you have to pay for it
    (go figure) to get more cross sums. I'd been intending to write a cross
    sums program for a couple of decades but never got a round tuit.

    Here's a site that has twenty printable versions:

    http://www.pro.or.jp/~fuji/java/puzzle/crosssum/index-eng.html

    --
    Fris "I need MORE" bee®, MCNGP #13

    The MCNGP Team - We're here to help!
    http://www.mcngp.com

    Certaholics
    http://groups.yahoo.com/group/certaholics
     
    =?Windows-1252?Q?Frisbee=AE?=, Dec 29, 2004
    #54
  15. SATHEES KUMAR . A

    JaR Guest

    In microsoft.public.cert.exam.mcse, Nerd32768 climbed on a soapbox &
    opined:
    Um, nerd, I think the idea is for you to look them up so you can *learn*
    the definitions, not cut and paste them.

    Gotta admire the effort though. It takes a lazy man to find the easiest way
    |-D
     
    JaR, Dec 29, 2004
    #55
  16. Private Sub Command2_Click()
    it's a company standard.
    never been one for hungarian notation, guess I just hate communists.

    Kline Sphere (Chalk) MCNGP #3
     
    The Poster Formerly Known as Kline Sphere, Dec 29, 2004
    #56
  17. SATHEES KUMAR . A

    JaR Guest

    In microsoft.public.cert.exam.mcse, The Poster Formerly Known as Kline
    Sphere climbed on a soapbox & opined:
    Speaking of which, wonder what ever happened to ol' unca Vigo?
     
    JaR, Dec 29, 2004
    #57
  18. Speaking of which, wonder what ever happened to ol' unca Vigo?

    he must have eaten up all the bread crumbs and forgot how to get home.

    Kline Sphere (Chalk) MCNGP #3
     
    The Poster Formerly Known as Kline Sphere, Dec 29, 2004
    #58
  19. SATHEES KUMAR . A

    Jtyc Guest

    You knew my ex-wife?

    I don't think so, why?
     
    Jtyc, Jan 3, 2005
    #59
  20. SATHEES KUMAR . A

    Jtyc Guest

    If thread = active THEN
    Print "F U U F'N TARDS"
    End If
     
    Jtyc, Jan 3, 2005
    #60
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.