DaveAmour 160 Mmmmmm beer Featured Poster

Why would you want to do that? What gives you the right to take over someone's pc!?

DaveAmour 160 Mmmmmm beer Featured Poster

Sure, you need to look at loops https://wiki.python.org/moin/WhileLoop

DaveAmour 160 Mmmmmm beer Featured Poster

I think you need speechmarks aroynd yes

Eg if x == "yes"

DaveAmour 160 Mmmmmm beer Featured Poster

Looks good.

I have some suggestions which are sincerely intended as to be encouraging.

Firstly I would always use the using statement rather than manually calling Dispose eg:

            using (SqlDataReader reader = cmd.ExecuteReader())
            {
                //Somde code here
            }

For a few reasons - firstly you won't forget to call Dispose. Secondly it gives nicely structered indentation making it easier on the eye to see what is happening and thirdly because it is the way most developers do it so its a kind of unwritten standard.

I would also be mindful of the S in SOLID. That is single responsibility principle. This method does a lot. I would split it up a bit more. In Visual Studio a great thing to play with is highlighting a block of code that looks like it could be a seperate method or class and then right click and Refactor - try extracting to method - VS will figure out the parameters and does all the work for you.

Smaller, more cohesive methods are easier to maintain, test and debug.

And finanlly in C# we say methods not functions - sorry if that one is too picky!

DaveAmour 160 Mmmmmm beer Featured Poster

Your tags are malformed - put the close div at the end.

DaveAmour 160 Mmmmmm beer Featured Poster

Can you not just hard code this:

Dim x As Decimal = 0

x += Convert.ToDecimal(Table1DataGridView.Rows(0).Cells(1).Value)
x += Convert.ToDecimal(Table1DataGridView.Rows(1).Cells(1).Value)
x += Convert.ToDecimal(Table1DataGridView.Rows(3).Cells(1).Value)

Where Cells(1) is the appropriate column?

DaveAmour 160 Mmmmmm beer Featured Poster

$("#firsttearesult").val(diffHour + " " + diffMins);

DaveAmour 160 Mmmmmm beer Featured Poster

I love optical illusions and they normally work on me but in the following one you are supposed to be able to see a red pill and a blue pill when in fact they are both grey. I see them both as grey though - does anyone else see red and blue?

http://i.dailymail.co.uk/i/pix/2015/03/30/16/27244D7D00000578-3018215-image-a-2_1427727872594.jpg

This is one of my all time favorites.

http://en.wikipedia.org/wiki/Checker_shadow_illusion

If you want some fun, print this one out twice. Cut out square A and then slide it from A to B on the other printout. You see it amazingly change colour as you slide it!

Print it out from here:

http://en.wikipedia.org/wiki/Checker_shadow_illusion#/media/File:Grey_square_optical_illusion.PNG

DaveAmour 160 Mmmmmm beer Featured Poster

You need:

if ($a == "Employed, Locally" or $a == "Employed, Abroad")

DaveAmour 160 Mmmmmm beer Featured Poster

Yes sure I wouldn't trust me if I saw my picture too!

DaveAmour 160 Mmmmmm beer Featured Poster

I'm happy to take a closer look if you want.

If so do I need more code or the above all I need to make it all work?

DaveAmour 160 Mmmmmm beer Featured Poster

I wrote an article a few years back which might shed some light on this if you can bare to read it as its quite long!

https://www.paxium.co.uk/PublicArticle/Article/497

Just realised you are already cleaning things up so whilst my article may not help its certainly worth reading especially if you have insomnia!

ddanbe commented: Great article +15
DaveAmour 160 Mmmmmm beer Featured Poster

Gribouillis is spot on but I would also move text = text.upper() into your acronym method too - its cleaner that way and more reusable.

DaveAmour 160 Mmmmmm beer Featured Poster

Assuming you are using Windows, you can use Task Manager or process explorer is better

Ctrl + Alt + Del => Start Task Manager

https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

DaveAmour 160 Mmmmmm beer Featured Poster

Oh dear I can see this is going to kick off! Dani keep calm!

DaveAmour 160 Mmmmmm beer Featured Poster

I think My Articles are ones you started where posts are any posts at all.

DaveAmour 160 Mmmmmm beer Featured Poster

ring.jpg

This post has no text-based content.
DaveAmour 160 Mmmmmm beer Featured Poster

http://www.paxium.co.uk/content/daniweb/trim.html

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <form>
        <input type="text" id="test" />

        <br />
        <br />

        <input type="button" value="Show Trimmed Text"  onclick="showTrimmedText();" />
    </form>

    <script>
        function showTrimmedText()
        {
            var value = document.getElementById("test").value.trim();

            alert("[" + value + "]");   
        }
    </script>
</body>
</html>
DaveAmour 160 Mmmmmm beer Featured Poster

ZZTop - Too beardy for me!

DaveAmour 160 Mmmmmm beer Featured Poster

Fiddler is also a great tool for debugging ajax calls.

Szabi Zsoldos commented: fiddler is the best for me also :) +5
DaveAmour 160 Mmmmmm beer Featured Poster

You can even make your CSS more concise - put all your float left in on the line 36 section for example.

DaveAmour 160 Mmmmmm beer Featured Poster

http://www.paxium.co.uk/content/daniweb/divclear.html

<html>
<head>
    <title>untitled</title>
    <style type="text/css">
        body
        {
            font-family: sans-serif;    
        }

        p
        {
            clear: left;    
        }

        #boxA
        {
            float: left;
        }

        #boxB
        {
            float: left;
        }

        #boxC
        {
            clear: left;
            float: left;
        }

        #boxD
        {
            float: left;
        }

        #boxA, #boxB, #boxC, #boxD
        {
            border: 1px solid green;
            text-align: center;
            line-height: 100px;
            margin: 10px;
            width: 100px;
            height: 100px;
        }
    </style>
</head>
<body>
    <p>First Row</p>
    <div id="boxA">Box A</div>
    <div id="boxB">Box B</div>
    <p>Second Row</p>
    <div id="boxC">Box C</div>
    <div id="boxD">Box D</div>
</body>
</html>
DaveAmour 160 Mmmmmm beer Featured Poster

Sorry one last thing to add!

You can use File.ReadAllLines which already returns a string array so no need for lines 2 and 3.

DaveAmour 160 Mmmmmm beer Featured Poster

I don't know anything about those objects but my tip would be to consider the Liskov substitution principle in making your decision.

ddanbe commented: Thanks for the tip. +15
DaveAmour 160 Mmmmmm beer Featured Poster

Is there a bug when editing a post?

To reproduce follow these steps.

a) Reply to post

b) Edit to correct a typo maybe

c) Save

d) Edit again as you spotted another typo - the editable text then does not load the latest correction.

I am using IE 11. Not sure if it happens all the time but I have noticed it a few times. The only way to be sure would be to test more thoroughly but that would mean a thread with lots of test posts which I'm sure you don't want.

DaveAmour 160 Mmmmmm beer Featured Poster

Always code as if the person who will maintain your code is a violent psychopath who knows where you live.

DaveAmour 160 Mmmmmm beer Featured Poster

And finally

There are only 10 types of people. Those who understand binary and those who don't.

DaveAmour 160 Mmmmmm beer Featured Poster

Based on years of experience and many discusions with other experienced developers both face to face and online and through working in many different companies as a contractor and seeing them both in use.

Database first has it's place of course in certain scenarios but for the most part code first is far superior.

DaveAmour 160 Mmmmmm beer Featured Poster

Try this

    function validate(dt1, dt2)
    {
        var jdt1 = Date.parse('20 Aug 2000 ' + dt1);
        var jdt2 = Date.parse('20 Aug 2000 ' + dt2);
        var diffMs;
        var diffMins

        if (isNaN(jdt1))
        {
            alert('invalid start time');
            return false;
        }

        if (isNaN(jdt2))
        {
            alert('invalid end time');
            return false;
        }

        if (jdt1 > jdt2)
        {
            diffMs = (jdt1 - jdt2);

            diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes

            alert('start is greater by ' + diffMins + ' minutes');
        }
        else
        {
            diffMs = (jdt2 - jdt1);

            diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes

            alert('start is less equal by ' + diffMins + ' minutes');
        }

        return true;
    }
DaveAmour 160 Mmmmmm beer Featured Poster

Make sure all the vents are clear - buy some compresssed air to clean it out. You must buy the correct stuff as it has anti static properties.

http://www.ebuyer.com/649796-ebuyer-com-air-duster-400ml-ebairduster

After that install speedfan which will give you an idea of temperatures

http://www.almico.com/speedfan.php

DaveAmour 160 Mmmmmm beer Featured Poster

Do you have any code at all yet?

miazara commented: #include <iostream> #include <iomanip> using namespace std ; void main () { int total_month; float total_salary = 0, total_pay = 0; c +0
DaveAmour 160 Mmmmmm beer Featured Poster

Is this any help?

` <style type="text/css">
html body
{
margin: 0 atuo;
margin-top: 20px;
}

    #main
    {
        margin: 0 auto;
        background-color: lightgreen;
        overflow: auto;
        text-align: center;
        height: 300px;
        width: 300px;
        color: blue;
        display: table;
        padding: 40px;
    }

    #box
    {
        display: table-cell;
        vertical-align: middle;
        height: 200px;
        border: 1px solid #000;
        width: 200px;
        background-color: #FFA500;
        border: 1px solid silver;
        color: blue;
        font-weight: bolder;
        font-size: 24px;
        padding: 30px;
        margin: 0 auto;
    }
</style>`
DaveAmour 160 Mmmmmm beer Featured Poster

Will this work?

$result = str_replace(' ', '', $input);

DaveAmour 160 Mmmmmm beer Featured Poster

Does this kind of thing help?

$start_date = new DateTime('2007-09-01 04:10:58');

$since_start = $start_date->diff(new DateTime('2012-09-11 10:25:00'));

echo $since_start->i.' minutes<br>';
matrixdevuk commented: Yay, you got the answer. :D +0
DaveAmour 160 Mmmmmm beer Featured Poster

You will of course need to make sure jquery is included in your page and your code is within script tags etc.

DaveAmour 160 Mmmmmm beer Featured Poster

You don't want all that code inside a button click event handler.

Break your code up into discrete classes and methods of specific functionality. It will make everything much easier.

Your button click code should be very simple like below - note this is pseudo code (http://en.wikipedia.org/wiki/Pseudocode)

If FormIsValid() Then
    If UserExists() Then
        ShowUserExistsMessage()
    Else
        SavePicture()
        SaveRecord()
        ClearForm()
    End If
Else
    ShowInvalidFormMessage()
End If

So you can write a Function which returns a bool if a user exists. Try and think like this rather than having one massive block of code which does everything. It will be easier, more fun, easier to fix and add to later and easier for other people to understand and easier to reuse code too.

ddanbe commented: Great advice! +15
Reverend Jim commented: Always worth pointing out. +12
DaveAmour 160 Mmmmmm beer Featured Poster

I know it works perfectly but I feel so dirty now!

DaveAmour 160 Mmmmmm beer Featured Poster

You can hit F12 in most browsers and see what CSS is in action to help diagnose.

Source control is so easy to implement, can't recomend it enough.

DaveAmour 160 Mmmmmm beer Featured Poster

Any JavaScript in your page?

DaveAmour 160 Mmmmmm beer Featured Poster

You have prodid in your url. You are getting productID though in your code.

DaveAmour 160 Mmmmmm beer Featured Poster

I still feel there may be more instructions than what was posted. We need the poster to confirm or deny this otherwise we cannot talk of facts.

DaveAmour 160 Mmmmmm beer Featured Poster

Because image_id cannot be both 7 and 9 right?

What is it you want to achieve?

Maybe

sql = "SELECT * FROM image_upload WHERE location='article' AND (image_id='7' Or image_id='9')";

DaveAmour 160 Mmmmmm beer Featured Poster

But that is not instructions, that is just a list.

DaveAmour 160 Mmmmmm beer Featured Poster

It says the instructions are in Quiz.java

"as shown in the instructions in Quiz.java"

DaveAmour 160 Mmmmmm beer Featured Poster

If you want us to do your homework you could at least post the homework instructuions.

DaveAmour 160 Mmmmmm beer Featured Poster

PS - here are some explanations: http://www.w3schools.com/php/func_math_ceil.asp

DaveAmour 160 Mmmmmm beer Featured Poster

Try using Math.round instead

DaveAmour 160 Mmmmmm beer Featured Poster

void is a return type. In programming languages methods or functions may return something. What type of data they return is usually specified in the method signature. If they don't return anything then void can be used to signify this.

C++ types can easily be found on many website such as http://www.tutorialspoint.com/cplusplus/cpp_data_types.htm

DaveAmour 160 Mmmmmm beer Featured Poster

I won't give up my day job just yet then!

I'm not in it for the money anyway, I write articles for myslef as a learning exercise so its just nice to share.

diafol commented: That's the spirit! +0
DaveAmour 160 Mmmmmm beer Featured Poster

Is this what you need?

("Update Medicine_Details SET UnitsInStock = UnitsInStock + " & rs3.Fields.Item(3).Value & " where ProductID='" & rs3.Fields.Item(2).Value & "'")