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

Reputation: 80 Whiz
Group:
Authors
Active Posts:
335 (0.22 per day)
Joined:
12-January 11
Profile Views:
10,978
Last Active:
User is offline Apr 15 2015 01:15 PM
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: issue with using results of previous LINQ to filter by range

    Posted 9 Apr 2015

    One piece of advise...separate your code into methods for specific functionality. For example, you could do the following:

    public static void Main(string[] args)
    {
         var invoices = GetInvoices();
    }
    
    public static Invoice[] GetInvoices()
    {
         Invoice[] Invoices = {
                                new Invoice ("83", "Electric sandar", 7, 57.98m),
                                new Invoice ("24", "Power Saw", 18, 99.99m),
                                new Invoice ("7", "Sledge Hammer", 11, 21.5m),
                                new Invoice ("77", "Hammer", 76, 11.99m),
                                new Invoice ("39", "Lawn mower", 3, 79.5m),
                                new Invoice("68", "Screwdriver", 106, 6.99m),
                                new Invoice("56", "Jig saw", 21, 11.00m),
                                new Invoice("3", "Wrench", 34, 7.5m)
                              };
         return Invoices;
    }
    
    


    This way, your code is cleaner and reusable if you happen to need the same functionality later.
  2. In Topic: Help with this code please

    Posted 7 Apr 2015

    The method you have which calculates the total for your formula should be totalling a sum from 1 to n without having to explicitly state the formula. I would use recursion.

            public static double GetMySum(double maxValue)
            {
                  return m(maxValue);
            }
    
            public static double m(double i)
            {
                    double total;
    
                    if(i > 1)
                    {
                         total = (double) (i / (2*i + 1));//do the calculation for i
    		     return total + m(i-1);
                    }
                    else
                    {
                         total = (1.0/2);//do the calculation for i == 1 since it is the only one that doesn't conform to i/(2i+1)
                         return total;
                    }		
            }
    
    


    This isn't the only way, but I like it.
  3. In Topic: Remove Char parenthesis in Richtextbox

    Posted 20 Mar 2015

    If all you want is to replace the parenthesis with a space, use the following:

    RichTextBox2.Text = RichTextBox2.Text.Replace("(", " ")
    
    
  4. In Topic: Pass user input from form to another view

    Posted 20 Mar 2015

    Bear in mind that I haven't written MVC using VB.NET, I use C#, so some of the syntax might be a little off. Particularly, I would pay attention to the method decorations.

    When you begin the request, the GET method of the controller will execute:

    [HttpGet]
    Function Contact() As ActionResult
            ViewData("Message") = "Send me a message!"
    
            Return View()
    End Function
    
    


    When the form is submitted, the model will be returned to the POST method:

    [HttpPost]
    Function Contact(model As ContactModels) As ActionResult
            /*do some stuff here*/
            /*You will have to specify the success view here unless you want to go back to the Contact view*/
            Return View("ViewName", model)
    End Function
    
    


    In the post method, you receive the model and return it to the "success" view so it can display the information necessary.
  5. In Topic: Span with image on left and right side and text in the middle

    Posted 20 Mar 2015

    You can use something like this (obviously you need to adjust the css to fit what you need):

    <table>
         <tr>
              <td>star</td>
              <td>text</td>
              <td>star</td>
         </tr>
    </table>
    
    

My Information

Member Title:
D.I.C Regular
Age:
37 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

Psyguy has no profile comments yet. Why not say hello?