Psyguy's Profile User Rating: -----

Reputation: 69 Whiz
Group:
Authors
Active Posts:
316 (0.25 per day)
Joined:
12-January 11
Profile Views:
8,906
Last Active:
User is offline Jul 23 2014 07:17 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
250

Latest Visitors

Icon   Psyguy I reject your reality and replace it with my own...

Posts I've Made

  1. In Topic: Class function passing custom type structure variable array

    Posted 22 Jul 2014

    I am going to take a leap and guess you are fairly new to this. That being said, I am going to proceed with that thought in mind.

    The first thing I would do is step through the code. Put a break point on the first line of code in your event handler (Button1_Click). From there, step through your code line by line until you get the error. This will allow you to find out for sure which line is causing the issue.

    Now, bearing in mind I have never used a "Structure", but assuming it is similar to a "Class", I would guess that you are running into issues with one of two lines:

    The first is where you declare timeStamp as New tempo. I do not see any declaration of a class called "tempo", however, that doesn't mean that it doesn't exist. The second, which I am positive will cause problems, is where you call your "save" method. The second parameter required is a type of "DateTime", not a type of "tempo". So unless tempo inherits from DateTime (not even sure that is possible), you should fix that issue.

    The next issue I see, is that your "Function" called "load", in the fileIO class, has no return type. That being the case, you will run into issues when you get to that line of code, so you may want to look into fixing that as well. From the way you are using it, it should have a return type of array of the "RTDB" structure.
  2. In Topic: How to tell if a point is inside a triangle or outside?

    Posted 13 May 2014

    This is a really good explanation of how to determine if a point is inside a triangle. Give it a try.

    Quote

    I always try not to use anything other than basic math in programming. Kinda takes away from the fun of solving problems.


    I completely disagree. While it makes the programming harder to understand for the less math centric programmer, complex algorithms discovered by people who are way smarter than me make a sometimes lengthy process into something that takes only a few milliseconds. I would not discount a given algorithm because it is not "basic math". This is especially important when you have to worry about things such as graphics plotting and lag.
  3. In Topic: Redirect Login from multiple applications to a single application

    Posted 25 Apr 2014

    Update on this. I finally did figure out a way to do this. It's isn't what i would call a very "elegant" approach, but it works. The below code is added to the AccountController for each application that I want to use the same login for. Obviously, the machine key in the web.config also has to be the same in order to preserve the login. The "SanitizeURL" function just makes sure that someone doesn't try to send a redirect url that isn't in the approved list of applications. I also wrote a static class to serve up the URL's to common pages (i.e. the login page, the portal main page, the account management page).

    [AllowAnonymous]
            public ActionResult Login(string returnUrl)
            {
                if(System.Diagnostics.Debugger.IsAttached)
                {
                    WebSecurity.Login("myusername", "mypassword", false);//only needed for debug, so i just remove any credentials before any commits.
                    return RedirectToAction("Index", "Home");
                }
                else if(WebSecurity.IsAuthenticated)
                {
                    return RedirectToAction("Index", "Home");
                }
                else
                {
                    var r = SanitizeURL(returnUrl);
    
                    return Redirect(RedirectHelper.LoginPage() + "?returnUrl=" + r);
                }            
            }
    
            [AllowAnonymous]
            public ActionResult Register()
            {
                return Redirect(RedirectHelper.RegisterPage());
            }
    
            [HttpPost]
            [ValidateAntiForgeryToken]
            public ActionResult LogOff()
            {
                WebSecurity.Logout();
    
                return Redirect(RedirectHelper.Portal());
            }
    
            public ActionResult ManageAccount()
            {
                return Redirect(RedirectHelper.ManageAccountPage());
            }
    
    
  4. In Topic: Cannot access file "path" because its being used by another pr

    Posted 27 Dec 2013

    I believe the answer supplied here may provide some help in this situation.
  5. In Topic: Problem with how I pause a stream reader?

    Posted 27 Nov 2013

    This is how i would approach the problem:

    File Name gets entered, presumably, in code
    Load all lines of the file into a collection (list, array, queue, etc.) when the application loads up (on a separate thread if the file is large or you expect some latency issues)
    Set up timer to retrieve a line from the collection and load the line into the box as needed

    Private fileName as String = "MyFile.txt"
    Private lines as List(Of String) = New List(Of String)
    Private lineNum as Integer = 0
    
    'load the data into the private global list(or other collection)
    Using sr as new StreamReader(fileName)
         While Not sr.EndOfStream
              lines.Add(sr.ReadLine)
         End While
    End Using
    
    'in the timer tick go through a line
    'and perform what you were doing to the line
    'then increment the lineNum
    'dont forget to validate the collection size against the lineNum value
    
    

My Information

Member Title:
D.I.C Regular
Age:
36 years old
Birthday:
October 14, 1977
Gender:
Location:
Eugene, OR
Full Name:
Joel M. Priddy
Years Programming:
3
Programming Languages:
VB.NET, C#, ASP/ADO.NET, C++, Java, XML, SQL

Contact Information

E-mail:
Click here to e-mail me
LinkedIn:
http://www.linkedin.com/pub/joel-priddy/12/49/7b5/
Twitter:
joel_priddy

Friends

Comments

Page 1 of 1
  1. Photo

    sarahbanana Icon

    22 Apr 2013 - 15:20
    can you help me wtith the question i have just posted:D!
Page 1 of 1