Jump to content

Err

Members
  • Posts

    1,009
  • Joined

  • Last visited

Posts posted by Err

  1. :-O Jaw-dropping site ... very nicely done. I especially loved the sliding panel on your about page. I did notice two things though. Just like what boen_robot said, when switching between your color schemes, it did take a while to load the images. Your CSS validation link seems to be a bad url. That's it, other than that, it's simply perfect.

  2. Hello.I'm working on a Visual Basic project where I have to use an array of strings that generate random sentences in a list box using the same strings. For example, if I was using the words "the", "cat", and "died" in the strings and it came out to "the cat died" the first time, the program would have to rewrite a different sentence each time using the same words when I click on a button. I have the basic things down, I'm just having trouble figuring out how to generating random sentences each time. Can I please get some help?If anyone wants the full code, I will gladly provide it. :)

    Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click  Dim str(5) As String  str(0) = "cat "  str(1) = "ate"  str(2) = "in "  str(3) = "dog"  str(4) = "hat"  str(5) = "the "  lstOutput.Items.Add(str(5) & str(0) & str(2) & str(5) & str(4))End Sub
  3. Hello.I'm working on a VB.NET project in which I want to change the location of the form every time someone hovers over a button. For example, if I hover over an "Exit" button, I want the form to move to a different spot making it impossible to click it. I believe I've seen an example like this in JavaScript, but I can't recall where. Can someone please tell me how this is done or refer me to a good site at the very least? I could not find such a site, probably for obvious reasons. I would REALLY appreciate it.Thanks. :)

  4. <body onload="Resize()"; onresize="Resize()";>

    Added 2 semi-colons. If it still doesn't validate it might be that you have 2 "Resize()" lines on the same tag. Unless someone else here more experienced in JavaScript can tell you otherwise.

  5. ... then would my AuthUserFile be the full URL of the .htpasswd file?
    I won't be a url, but a path: Indicates the path where a file is physically located on the server for the specific sub-domain. A real example would be like: /home/www/oneuse.awardspace.com/test/.htaccess. Your hosting provider control panel should tell you the path when you are browsing through your folders on your site.
    can multiple users with the same username/password be logged on at the same time with this method?
    I really don't know about that. Just have to try it out yourself. :)
    can I make that additional password for myself by putting a second set of .htaccess and .htpasswd in the directories that I want to have access in, and using a different username/password for myself?
    You can add in as many usernames/passwords as you like for any directory. You can have your own username/password and other people will have a different one. You don't have to make more .htaccess/.htpasswd files in order to add more usernames/passwords, you can just add it with your other ones, as long as it's in the same directory... if not, then yes, you would have to make some new ones. :)
  6. Are you talking about the <tr> tag for Tables? If you are, then trying to declare CSS classes for links or anything other then a border or spacing will be of no use. Nothing is meant to get tagged for <tr> as it's only use is for a table break, and not text. You can still do it, but it's a very horrible markup pratice. :)

  7. Enter the usernames and passwords you want into that password creator site. Leave the other options as they are and submit it. Open up notepad. Copy/paste the contents of .htaccess into a blank notepad and save it as .htaccess (no spaces or any characters before the . [dot]), an ideal location for the moment would be your desktop. Open up another blank notepad and copy/paste the contents of .htpasswd into it. Save the file as .htpasswd, again it's by itself with no spaces or characters in front of it. You should now have 2 files, .htaccess and .htpasswd. Upload both these files into the directory you want to protect (e.g www.example.com/movies/, where /movies/ would be the protected directory). Once you do that, find your server root directory path to the .htpasswd file (e.g. /home/example/movies/.htpasswd). Once you have the directory path, open up the .htaccess file, find where it has line of: AuthUserFile /home/mysite/.htpasswd and change the path it has to the sever root path you found earlier. Save it and test it out with your username and password you used into the input box that appears when you access your password protected directory. If all works out, it should work. :)There are probably more easier ways of doing this, but this is the only way I know at the moment.

  8. It's still not working, please look at my code and tell me where I went wrong.

    Public Class Form1Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click        Me.Close()    End Sub    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click        txtGrade1.Clear()        Me.txtGrade2.Clear()        Me.txtGrade3.Clear()        lblLetter.ResetText()        'lblAvg.Text = ""        lblAvg.ForeColor = Color.Empty        lblAvg.BackColor = Color.Empty        lblAvg.ResetText()        lblMsg.ResetText()        txtName.ResetText()        txtAbs.ResetText()        lblAvg.BackColor = Color.White        txtGrade1.Focus()    End Sub    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click        Dim shoGrade1 As Short = 0        Dim shoGrade2 As Short        Dim shoGrade3 As Short        Dim sngAvg As Single        'Input        shoGrade1 = Val(txtGrade1.Text)        shoGrade2 = Val(txtGrade2.Text)        shoGrade3 = Val(txtGrade3.Text)        'Processing        sngAvg = (shoGrade1 + shoGrade2 + shoGrade3) / 3        'If Not IsNumeric(txtGrade1.Text) Then        'lblMsg.Text = "Please enter numbers only."        'End If        If String.Compare(txtGrade1.Text, String.Empty) = 0 Then            lblMsg.Text = "Numbers must be inputed for box 1"        End If        'If txtGrade1.Text = "" Or txtGrade2.Text = "" Or txtGrade3.Text = "" Then        'lblMsg.Text = "Numbers must be inputed to all 3 boxes."        'End If        If sngAvg < 0 Then            lblLetter.Text = "X"            lblMsg.Text = "Please enter positive numbers only"        ElseIf sngAvg < 60 Then            lblLetter.Text = "F"            lblMsg.Text = "You are teh fail."            lblAvg.BackColor = Color.Red        ElseIf sngAvg < 70 Then            lblLetter.Text = "D"            lblMsg.Text = "Almost, but you're still a failure."            lblAvg.BackColor = Color.Yellow            lblAvg.ForeColor = Color.Black        ElseIf sngAvg < 80 Then            lblLetter.Text = "C"            lblMsg.Text = "Passing."            lblAvg.BackColor = Color.Yellow        ElseIf sngAvg < 90 Then            lblLetter.Text = "B"            lblMsg.Text = "Good."            lblAvg.BackColor = Color.LightGreen            lblAvg.ForeColor = Color.Black        ElseIf sngAvg <= 100 Then            lblLetter.Text = "A"            lblMsg.Text = "Winnar."            lblAvg.BackColor = Color.Green            lblAvg.ForeColor = Color.FloralWhite        ElseIf sngAvg > 100 Then            lblMsg.Text = "Impossable."        Else            lblLetter.Text = "Invalid"            lblMsg.Text = "Invalid Inputs"        End If        'Output        lblAvg.Text = FormatNumber(sngAvg, 1)        'lblAvg.ForeColor = Color.FloralWhite        'lblAvg.BackColor = Color.Firebrick    End Sub    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        'lblDate.Text = FormatDateTime(Today, DateFormat.LongDate)        'lblTime.Text = FormatDateTime(Now, DateFormat.ShortTime)        lblDate.Text = Now.ToShortDateString        lblTime.Text = TimeOfDay.ToLongTimeString        'changes color of lblAvg, when the program starts, to white        Me.lblAvg.BackColor = Color.White    End Sub    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick        lblTime.Text = TimeOfDay.ToLongTimeString    End SubEnd Class

    And the Form code:

    #Region " Windows Form Designer generated code "    Public Sub New()        MyBase.New()        'This call is required by the Windows Form Designer.        InitializeComponent()        'Add any initialization after the InitializeComponent() call    End Sub    'Form overrides dispose to clean up the component list.    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)        If disposing Then            If Not (components Is Nothing) Then                components.Dispose()            End If        End If        MyBase.Dispose(disposing)    End Sub    'Required by the Windows Form Designer    Private components As System.ComponentModel.IContainer    'NOTE: The following procedure is required by the Windows Form Designer    'It can be modified using the Windows Form Designer.      'Do not modify it using the code editor.    Friend WithEvents Label1 As System.Windows.Forms.Label    Friend WithEvents Label2 As System.Windows.Forms.Label    Friend WithEvents Label3 As System.Windows.Forms.Label    Friend WithEvents Label4 As System.Windows.Forms.Label    Friend WithEvents Label5 As System.Windows.Forms.Label    Friend WithEvents txtGrade1 As System.Windows.Forms.TextBox    Friend WithEvents txtGrade2 As System.Windows.Forms.TextBox    Friend WithEvents txtGrade3 As System.Windows.Forms.TextBox    Friend WithEvents lblAvg As System.Windows.Forms.Label    Friend WithEvents btnExit As System.Windows.Forms.Button    Friend WithEvents btnClear As System.Windows.Forms.Button    Friend WithEvents btnCalculate As System.Windows.Forms.Button    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox    Friend WithEvents lblDate As System.Windows.Forms.Label    Friend WithEvents lblTime As System.Windows.Forms.Label    Friend WithEvents Timer1 As System.Windows.Forms.Timer    Friend WithEvents lblMsg As System.Windows.Forms.Label    Friend WithEvents lblLetter As System.Windows.Forms.Label    Friend WithEvents Label7 As System.Windows.Forms.Label    Friend WithEvents txtAbs As System.Windows.Forms.TextBox    Friend WithEvents Label6 As System.Windows.Forms.Label    Friend WithEvents txtName As System.Windows.Forms.TextBox    Friend WithEvents Label8 As System.Windows.Forms.Label    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()        Me.components = New System.ComponentModel.Container        Me.Label1 = New System.Windows.Forms.Label        Me.Label2 = New System.Windows.Forms.Label        Me.Label3 = New System.Windows.Forms.Label        Me.Label4 = New System.Windows.Forms.Label        Me.Label5 = New System.Windows.Forms.Label        Me.txtGrade1 = New System.Windows.Forms.TextBox        Me.txtGrade2 = New System.Windows.Forms.TextBox        Me.txtGrade3 = New System.Windows.Forms.TextBox        Me.lblAvg = New System.Windows.Forms.Label        Me.btnExit = New System.Windows.Forms.Button        Me.btnClear = New System.Windows.Forms.Button        Me.btnCalculate = New System.Windows.Forms.Button        Me.GroupBox1 = New System.Windows.Forms.GroupBox        Me.lblTime = New System.Windows.Forms.Label        Me.lblDate = New System.Windows.Forms.Label        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)        Me.lblMsg = New System.Windows.Forms.Label        Me.lblLetter = New System.Windows.Forms.Label        Me.Label7 = New System.Windows.Forms.Label        Me.txtAbs = New System.Windows.Forms.TextBox        Me.Label6 = New System.Windows.Forms.Label        Me.txtName = New System.Windows.Forms.TextBox        Me.Label8 = New System.Windows.Forms.Label        Me.GroupBox1.SuspendLayout()        Me.SuspendLayout()        '        'Label1        '        Me.Label1.AutoSize = True        Me.Label1.Font = New System.Drawing.Font("Comic Sans MS", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))        Me.Label1.Location = New System.Drawing.Point(56, 16)        Me.Label1.Name = "Label1"        Me.Label1.Size = New System.Drawing.Size(225, 30)        Me.Label1.TabIndex = 0        Me.Label1.Text = "Letter Grade Calculator"        Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter        '        'Label2        '        Me.Label2.Location = New System.Drawing.Point(16, 144)        Me.Label2.Name = "Label2"        Me.Label2.Size = New System.Drawing.Size(72, 32)        Me.Label2.TabIndex = 4        Me.Label2.Text = "Grade &1:"        Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'Label3        '        Me.Label3.Location = New System.Drawing.Point(16, 280)        Me.Label3.Name = "Label3"        Me.Label3.Size = New System.Drawing.Size(72, 32)        Me.Label3.TabIndex = 10        Me.Label3.Text = "Average:"        Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'Label4        '        Me.Label4.Location = New System.Drawing.Point(16, 232)        Me.Label4.Name = "Label4"        Me.Label4.Size = New System.Drawing.Size(72, 32)        Me.Label4.TabIndex = 8        Me.Label4.Text = "Grade &3:"        Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'Label5        '        Me.Label5.Location = New System.Drawing.Point(16, 192)        Me.Label5.Name = "Label5"        Me.Label5.Size = New System.Drawing.Size(72, 32)        Me.Label5.TabIndex = 6        Me.Label5.Text = "Grade &2:"        Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'txtGrade1        '        Me.txtGrade1.Location = New System.Drawing.Point(112, 144)        Me.txtGrade1.Name = "txtGrade1"        Me.txtGrade1.Size = New System.Drawing.Size(72, 28)        Me.txtGrade1.TabIndex = 5        Me.txtGrade1.Text = ""        '        'txtGrade2        '        Me.txtGrade2.Location = New System.Drawing.Point(112, 192)        Me.txtGrade2.Name = "txtGrade2"        Me.txtGrade2.Size = New System.Drawing.Size(72, 28)        Me.txtGrade2.TabIndex = 7        Me.txtGrade2.Text = ""        '        'txtGrade3        '        Me.txtGrade3.Location = New System.Drawing.Point(112, 240)        Me.txtGrade3.Name = "txtGrade3"        Me.txtGrade3.Size = New System.Drawing.Size(72, 28)        Me.txtGrade3.TabIndex = 9        Me.txtGrade3.Text = ""        '        'lblAvg        '        Me.lblAvg.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D        Me.lblAvg.Location = New System.Drawing.Point(112, 280)        Me.lblAvg.Name = "lblAvg"        Me.lblAvg.Size = New System.Drawing.Size(72, 28)        Me.lblAvg.TabIndex = 0        Me.lblAvg.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'btnExit        '        Me.btnExit.Location = New System.Drawing.Point(272, 384)        Me.btnExit.Name = "btnExit"        Me.btnExit.Size = New System.Drawing.Size(88, 32)        Me.btnExit.TabIndex = 13        Me.btnExit.Text = "E&xit"        '        'btnClear        '        Me.btnClear.Location = New System.Drawing.Point(152, 384)        Me.btnClear.Name = "btnClear"        Me.btnClear.Size = New System.Drawing.Size(88, 32)        Me.btnClear.TabIndex = 12        Me.btnClear.Text = "Clea&r"        '        'btnCalculate        '        Me.btnCalculate.Location = New System.Drawing.Point(40, 384)        Me.btnCalculate.Name = "btnCalculate"        Me.btnCalculate.Size = New System.Drawing.Size(88, 32)        Me.btnCalculate.TabIndex = 11        Me.btnCalculate.Text = "&Calculate"        '        'GroupBox1        '        Me.GroupBox1.Controls.Add(Me.lblTime)        Me.GroupBox1.Controls.Add(Me.lblDate)        Me.GroupBox1.Location = New System.Drawing.Point(216, 104)        Me.GroupBox1.Name = "GroupBox1"        Me.GroupBox1.Size = New System.Drawing.Size(208, 136)        Me.GroupBox1.TabIndex = 9        Me.GroupBox1.TabStop = False        Me.GroupBox1.Text = "Date and Time"        '        'lblTime        '        Me.lblTime.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D        Me.lblTime.Location = New System.Drawing.Point(16, 80)        Me.lblTime.Name = "lblTime"        Me.lblTime.Size = New System.Drawing.Size(176, 40)        Me.lblTime.TabIndex = 1        Me.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter        '        'lblDate        '        Me.lblDate.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D        Me.lblDate.Location = New System.Drawing.Point(16, 32)        Me.lblDate.Name = "lblDate"        Me.lblDate.Size = New System.Drawing.Size(176, 40)        Me.lblDate.TabIndex = 0        Me.lblDate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter        '        'Timer1        '        Me.Timer1.Enabled = True        Me.Timer1.Interval = 1000        '        'lblMsg        '        Me.lblMsg.Location = New System.Drawing.Point(216, 248)        Me.lblMsg.Name = "lblMsg"        Me.lblMsg.Size = New System.Drawing.Size(208, 80)        Me.lblMsg.TabIndex = 10        Me.lblMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter        '        'lblLetter        '        Me.lblLetter.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D        Me.lblLetter.Location = New System.Drawing.Point(112, 328)        Me.lblLetter.Name = "lblLetter"        Me.lblLetter.Size = New System.Drawing.Size(72, 28)        Me.lblLetter.TabIndex = 12        Me.lblLetter.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'Label7        '        Me.Label7.Location = New System.Drawing.Point(16, 328)        Me.Label7.Name = "Label7"        Me.Label7.Size = New System.Drawing.Size(72, 32)        Me.Label7.TabIndex = 11        Me.Label7.Text = "Grade:"        Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'txtAbs        '        Me.txtAbs.Location = New System.Drawing.Point(112, 96)        Me.txtAbs.Name = "txtAbs"        Me.txtAbs.Size = New System.Drawing.Size(72, 28)        Me.txtAbs.TabIndex = 3        Me.txtAbs.Text = ""        '        'Label6        '        Me.Label6.Location = New System.Drawing.Point(8, 96)        Me.Label6.Name = "Label6"        Me.Label6.Size = New System.Drawing.Size(80, 32)        Me.Label6.TabIndex = 2        Me.Label6.Text = "&Absences:"        Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'txtName        '        Me.txtName.Location = New System.Drawing.Point(112, 48)        Me.txtName.Name = "txtName"        Me.txtName.Size = New System.Drawing.Size(208, 28)        Me.txtName.TabIndex = 1        Me.txtName.Text = ""        '        'Label8        '        Me.Label8.Location = New System.Drawing.Point(16, 48)        Me.Label8.Name = "Label8"        Me.Label8.Size = New System.Drawing.Size(72, 32)        Me.Label8.TabIndex = 0        Me.Label8.Text = "Name:"        Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight        '        'Form1        '        Me.AutoScaleBaseSize = New System.Drawing.Size(8, 21)        Me.ClientSize = New System.Drawing.Size(440, 430)        Me.Controls.Add(Me.txtName)        Me.Controls.Add(Me.Label8)        Me.Controls.Add(Me.txtAbs)        Me.Controls.Add(Me.Label6)        Me.Controls.Add(Me.lblLetter)        Me.Controls.Add(Me.Label7)        Me.Controls.Add(Me.lblMsg)        Me.Controls.Add(Me.GroupBox1)        Me.Controls.Add(Me.btnCalculate)        Me.Controls.Add(Me.btnClear)        Me.Controls.Add(Me.btnExit)        Me.Controls.Add(Me.lblAvg)        Me.Controls.Add(Me.txtGrade3)        Me.Controls.Add(Me.txtGrade2)        Me.Controls.Add(Me.txtGrade1)        Me.Controls.Add(Me.Label5)        Me.Controls.Add(Me.Label4)        Me.Controls.Add(Me.Label3)        Me.Controls.Add(Me.Label2)        Me.Controls.Add(Me.Label1)        Me.Font = New System.Drawing.Font("Comic Sans MS", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))        Me.Name = "Form1"        Me.Text = "Letter Grade Calculator"        Me.GroupBox1.ResumeLayout(False)        Me.ResumeLayout(False)    End Sub#End Region

    Edit: I got it, I needed to put "Exit Sub" before my "End If" statements. :)

×
×
  • Create New...