AleMonteiro 238 Can I pick my title?

Have you set margin, padding and border to 0? If you set the height/widht to 100% and have padding/margin the scroll will show.

This kind of stuff is very trick and browser compability doesn't help either.

I had the need to do a very sofisticated interface fit in a large number of screens, my solution was the use of a layout plugin: http://layout.jquery-dev.net/

AleMonteiro 238 Can I pick my title?

JavaScript is very dynamic, so you can use OOP in various ways. Take a look at a couple of examples:

// -------------------------
// Using Prototype
var MyPrototype = function () {
    // do something
};

MyPrototype.prototype.MyMethod1 = function() {
    return this.MyMethod2();
};

MyPrototype.prototype.MyMethod2 = function() {
    return "something";
};

// Usage
var myObj = new MyPrototype();
myObj.MyMethod2();

// -------------------------
// Using a object like an "static" class

var MyStaticObject = {

    MyMethod1: function() {

        return MyStaticObject.MyMethod2();

    },

    MyMethod2: function() {
        return "Something";
    }

};

// Usage
MyStaticObject.MyMethod1();

For futher understading, read those pages:
https://developer.mozilla.org/en-US/docs/JavaScript/Introduction_to_Object-Oriented_JavaScript

http://killdream.github.com/blog/2011/10/understanding-javascript-oop/

diafol commented: Nice post +14
AleMonteiro 238 Can I pick my title?

The only way to store that in the client with only JS is cookies. If you have an server-side script you can store in a session object or an database.

AleMonteiro 238 Can I pick my title?

I'd say the best way to handle the address bar text is using Regular Expression.

Or if just want to check if it's a valid URI, use this: Uri.IsWellFormedUriString(YourURLString, UriKind.RelativeOrAbsolute)

AleMonteiro 238 Can I pick my title?

I think the easiest way is writing files to disk or on a database and the most "decent" way is using windows services.

AleMonteiro 238 Can I pick my title?

Nobody is here to do you work for you, we're here to help. And nobody wants to help someone that wants everything done for him.

AleMonteiro 238 Can I pick my title?

I'd start parsing the text file data into a object model and keep it in an list, like List<Product>.

Then I'd use the generic sorting functionalities for performing the sort, this you can see at http://www.codeproject.com/Tips/323985/Sorting-using-Csharp-Lists

AleMonteiro 238 Can I pick my title?

I think there's no problem, it's good. If they already have the data in excel it's the easiest way to update the DB.

Couple months ago I did an web app so the user could upload the excel and import to the SQL DB.

If you are thinking of doing such thing, I recommend using C# and EPPLus lib, it was really peaceful to work with ^^

AleMonteiro 238 Can I pick my title?

You can do it like this:

var input = document.getElementById('myInputID');
var className = input.className;

input.className = className.replace("int[5]", "int[7]");
AleMonteiro 238 Can I pick my title?

Sorry, I didn't understand what you want. Please rephrase it.

AleMonteiro 238 Can I pick my title?

You'll have to use an Neural Network to identify the images, I think it's the only decent way of doing it.

This is a nice and simple tutorial wich may help you:
http://neuroph.sourceforge.net/tutorials/android_image_recognition_using_neuroph.htm

AleMonteiro 238 Can I pick my title?

I think the most important aspect of your app is to have the list of the hospitals with their address. If you have it, building the app is quite simple.

For what plataform are you planning on develop?

AleMonteiro 238 Can I pick my title?

I think your want to make int comparisson, if sou use parseInt(document.getElementById('min').innerText). If it's float, use parseFloat().

Using > and < with string will not do you any good.

AleMonteiro 238 Can I pick my title?

If you're planning to make various date/time calculations and does not have much experience with JS or does not want to code a lot, I suggest you use the DateJS lib. I've used in a couple of projects and it works very well.

http://www.datejs.com/

AleMonteiro 238 Can I pick my title?

Master pages has nothing to do with CSS nor it behave like such.

Please read the folling pages to understand how a master page works:

http://www.codeproject.com/Articles/333650/Beginner-s-Tutorial-on-Master-Pages-in-ASP-NET

http://msdn.microsoft.com/en-us/library/wtxbf3hh(v=vs.100).aspx

AleMonteiro 238 Can I pick my title?

You need to use the same name on all the radios, then the valeu submited will be that of the selected one.

AleMonteiro 238 Can I pick my title?
AleMonteiro 238 Can I pick my title?

A master page have a single a html file (.aspx). But the master page can hold any number of user defined controls or you can have multiple nested master pages.
It really depends on what you are trying to do.

AleMonteiro 238 Can I pick my title?

I think it could be something like this:

if(!empty($secondMenus)) {

    $backgroundColor = $idMenuParent == 2 ? 'blue' : 'gray';

                ?>

                <div id="secondary-menu-main">

                <div id="secondary-menu-items" style="background-color: <?php echo $backgroundColor; ?> ">              
                <?php
                foreach($secondMenus as $secondMenu) {
AleMonteiro 238 Can I pick my title?

Are you talking about an windows aplication or web?

AleMonteiro 238 Can I pick my title?

The best way is to change your webservice so it doesn't return those tags.
Post the code for your method.

AleMonteiro 238 Can I pick my title?

I'd suggest you add an ID to your table and use:

$("#myTable tr:last").after("<your html>");

This will add the new row at the end of the table.

AleMonteiro 238 Can I pick my title?

Good to know. You're welcome.

Just mark the post as solved please.

AleMonteiro 238 Can I pick my title?

Ok, this will be easy and painless ^^

There's a lot of nice jQuery ToolTip plugins. Take a look at those sites:

http://calebjacob.com/tooltipster/
http://www.1stwebdesigner.com/css/stylish-jquery-tooltip-plugins-webdesign/
http://jqueryui.com/tooltip/

Most of them will use the attributes Title for the text, so you can make like this before using the plugins:

$("#addtocart")
    .attr("Title", "My tooltip text")
    .tooltipster();
AleMonteiro 238 Can I pick my title?

Check this demo, I coded like an jQuery plugin:

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$(function(){
    $("#main").children().eq(0).fadeToNext(1000, 1000, 1000);
});

(function($){
    $.fn.extend({
        /*
            @fadeInTime Time of the FadeIn effect in milliseconds
            @shownTime Time between the finish of the FadeIn and the start of the FadeOut effect in milliseconds
            @fadeOutTime Time of the FadeOut effect in milliseconds
        */
        fadeToNext: function(fadeInTime, shownTime, fadeOutTime) {

            var 
                $this = $(this), // Current element 
                $siblingsAndSelf = $this.parent().children(); // All children of it's parent

            $this
                .fadeIn(fadeInTime) // Show Item
                .delay(shownTime) // Stay shown
                .fadeOut(fadeOutTime, function() { // Hide Item
                    // When finish hiding gets the next item to be shown
                    var 
                        $next = ($this.index() == $siblingsAndSelf.length-1) ? // If last children of parent
                                    $siblingsAndSelf.eq(0) : // First children of parent
                                    $this.next(); // Next sibling

                    // Show the next item
                    $next.fadeToNext(fadeInTime, shownTime, fadeOutTime); 
            });
        }

    });
}(jQuery));

</script>
</head>
<style type="text/css">

    #main{
        width: 100%;
        height: 100%;
        border:1px solid #FF0000;
        position:absolute;
    }

    #main > div {
        width: 200px;
        height: 200px;
        border: 2px solid black;
        position: absolute;
        border: 3px solid #FF0000;
        display: none;
        background: #00F;
        top: 50px;
        left: 50px;
        font-size: 70px;
        line-height: 200px;
        text-align: center;
        color: #fff;
    }

</style>
<body>

    <div id="main">
        <div>1</div> 
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>  
    </div>

</body>
</html>

Ps.:All itens to be faded needs to have the same parent, and all children of this parent will be faded

AleMonteiro 238 Can I pick my title?

Oh, if I understood correcly now, there's the Quotes table wich references the Users and the Quotes. Then there's a bunch of other tables with related data from the Quotes.

If so, you can build a single statement if the relationships have Cascade Delete ON:

DELETE FROM Quotes
WHERE
    UserID IN (
        SELECT UserID FROM Users WHERE Something = @Something
    )
    AND QuoteID NOT IN ( Some Other Select )
    AND QuoteText LIKE @Something
    AND ....

If your relationships doesn't have CASCADE DELETE you can create an SELECT statement similar to the delete above, and add thoses quotes in a temporary table.
Like this:

CREATE TABLE #tmpQuotes (QuoteID int)

INSERT INTO #tmpQuotes
SELECT QuoteID FROM Quotes
    WHERE
        UserID IN (
            SELECT UserID FROM Users WHERE Something = @Something
        )
        AND QuoteID NOT IN ( Some Other Select )
        AND QuoteText LIKE @Something
        AND ....


DELETE FROM QuotesTable1 WHERE QuoteID IN (SELECT QuoteID FROM #tmpQuotes)
DELETE FROM QuotesTable2 WHERE QuoteID IN (SELECT QuoteID FROM #tmpQuotes)
DELETE FROM QuotesTable3 WHERE QuoteID IN (SELECT QuoteID FROM #tmpQuotes)
...

I'd say maybe there's even a better way to do it, looking at performance. But this will certanly be faster than what you're currently doing.

Good luck.

AleMonteiro 238 Can I pick my title?

But can you add javascript code to your site? Does the site uses jQuery?

AleMonteiro 238 Can I pick my title?

Oh, that's not very nice... If you use exec with a string the database engine will not be able to precompile your stored procedure and optmize.

Try changing to DELETE FROM TableName WHERE QuoteID = @QuoteID AND UserID = @UserID. The performance will be significantly better.

Another thing, if you are using @QuoteID it seems like you are using another cursor inside the one that you posted, is that right?

Nested cursors are terrible for performance.

AleMonteiro 238 Can I pick my title?

Oh I see... well, only with CSS it's impossible. With JS is possible, and if it can use jQuery it'll be a lot easier.

AleMonteiro 238 Can I pick my title?

Position is a reserved word, you should put it in braces: [Position].
I think this should solve your problem.

It's always good to put names inside [], it can save a lot of time trying to find an error.

Look at this link for more information: http://msdn.microsoft.com/en-us/library/aa238507(v=sql.80).aspx

AleMonteiro 238 Can I pick my title?

Hi, I'd try something like this:

function fadeElements() {
    var yourFade = 1, // the amount of time in seconds that the elements will fade in AND fade out
        yourDelay = 2, // the amount of time in seconds that there will be a delay between the fade ins and fade outs
        fadeTime = yourFade * 1000, //convert fade seconds to milliseconds (1000)
        delayTime = yourDelay * 1000, // convert delay seconds to milliseconds (2000)
        totalTime = fadeTime + delayTime, //3000 milliseconds...needed for all those delays we talked about
        i=0,
        $elements = $('.FadingBanner'),
        elementsLength = $elements.length;

    $('.FadingBanner').each(function(){

        $(this) // Current element
            .delay( totalTime * i )
            .fadeIn(fadeTime)
            .delay(delayTime)
            .fadeOut(fadeTime);

        i = i + 1;
    });

    // Set to call the same function again after (totalTime * elementsLength) milliseconds
    setTimeout(fadeElements, totalTime * elementsLength);
}

$(function(){

    fadeElements();

});

Ps.: I didn't test any of this, but it should work (I Hope! ^^)

AleMonteiro 238 Can I pick my title?

Why do you have to use a cursor? I suppose the quotes table have the user id, right? So you can make just one delete, like this:

DELETE FROM Table_Quotes
WHERE
    user_id NOT IN ( 
        SELECT user_id FROM users
        WHERE user_name LIKE '%SOMESTRING '
    )

You don't even need the temporary table.

If this does not work on your table schema, please post the diagram of the related tables so we can understand it better.

AleMonteiro 238 Can I pick my title?

I used and liked very much this JS chart API: http://www.highcharts.com/

Hope it helps.

AleMonteiro 238 Can I pick my title?

To show the default tooltip just add the attributes title="Buy" and alt="Buy".

If you want a more sofisticated tooltip you'll need javascript to create it.

AleMonteiro 238 Can I pick my title?

Solved

AleMonteiro 238 Can I pick my title?

Solved:

string flag = String.Format( @"<\?'{0}'\?>", pFlag.ToUpper() );
            pCodigo = Regex.Replace( pCodigo, @"(\r?\n)", "$1$$1", RegexOptions.Multiline );
            string pattern = String.Format( @"([ \t]*)({0})", flag );
            _strCodigo = Regex.Replace( codigo, pattern, String.Format( @"$1{0}{1}$1$2", pCodigo, pLineBreak ? Environment.NewLine : "" ) );
AleMonteiro 238 Can I pick my title?

Using MDX Query instead of .NET API really improves performance.

AleMonteiro 238 Can I pick my title?

riahc3, so do as I said. Just create the project as ASP.NET WebService Application.

AleMonteiro 238 Can I pick my title?

What type of WebService are you thinking of? SOAP or REST?

Creating a SOAP WebService in C# with Visual Studio is pretty easy. Just create a project as ASP.NET Web Service Application, that you'll came with a example method, is very straightfoard.

If you are thinking of REST, then you need to stablish your pattern to implement it latter.

AleMonteiro 238 Can I pick my title?

What do you mean by "same level"? Can you post a print of what you are trying to accomplish?

AleMonteiro 238 Can I pick my title?
Using System.IO;


Directory.GetFiles(@"c:\InitialPath", "*.cs", SearchOption.AllDirectories);
AleMonteiro 238 Can I pick my title?

Check this link: http://www.tutorialspoint.com/ruby/ruby_operators.htm

And please search a little bit before posting very basic questions like this.

I have never programmed in Ruby and it didn't take me more than 1 minute to find your answer.

AleMonteiro 238 Can I pick my title?

It should be like this:

document.getElementById("etxt").value = "BelowAverage";
AleMonteiro 238 Can I pick my title?

You are not setting the string to the return of the method. It should be:

textContent = getLimitedWords(textContent, NumberOfWords);

Or you could use a reference parameter, like this:

getLimitedWords(ref textContent, 20);

public string getLimitedWords(ref string textContent, int NumberOfWords){}
AleMonteiro 238 Can I pick my title?

But what if the database is not on the same machine?

That's why it's always better to have the connection string in the app.config.

In my opnion, the best way to use connection string is:
On app.config:

<connectionStrings>
    <add name="machine-name" connectionString="your connection string" />
</connectionStrings>

And in the code:

string hostName = Environment.MachineName.ToLower();

string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[ hostName ].ConnectionString;

This way multiple developers can use the same config file(in case you use SVN) and also the deploy connection string, without having to change it every time.

This works if the DB is on the same machine, on the network or even on the internet. With no need to re-compile.

This can be used on windows forms and also asp.net web applications.

AleMonteiro 238 Can I pick my title?

dancks,

sorry, I forgot to mention that the .inline class only work with divs that have the width explicit set.

AleMonteiro 238 Can I pick my title?

Reverend Jim, what I understood is that his connection string is hard-coded, so he has to change and re-compile each time he needs to change the connection string.

AleMonteiro 238 Can I pick my title?

dancks, great idea for learning!

About floating divs... I hate it! I just think it's too much pain to use it, if you forget to use clean after the headache will be huge.

Because of that I ended up using a custom css class to make elements inline:

.inline
{
    position: relative;
    display: -moz-inline-stack;
    display: inline-block;
    zoom: 1;
    vertical-align: top;

    *display: inline;
}

And the use is like this:

<div class="inline">
    <img src="..."/>
</div>
<div class="inline">
    bla bla bla bla bla bla bla
</div>

Hope it helps

AleMonteiro 238 Can I pick my title?

I think the best solution is to put the connection string in the app.config file under the <connectionString> section.

Then, use the name of the connection string as the name of the machine.

Then, in the code, get the connection string by the name of the machine.

AleMonteiro 238 Can I pick my title?

Probably not. I tested and the results are:

IE 9: OK
IE 8: Elements are off positions but effects works
IE 7: Elements are off positions but effects works