AleMonteiro 238 Can I pick my title?

Hi Draw, your project seems really nice. The idea is great and the desktop interface looks good.

I just like to point it out, that, even if the interface it's 100% JS/HTML/CSS it doesn't mean it'll work wonders in all devices.
In a desktop interface you can have all those dialog boxes arround the corner of the drawing board, in tablets and specially phones, you can't. I mean, you can, but it'll be a horror show for people to be able to click the pencil icon that they want.
I hope you already have that in mind.

Another problem that I've had recently with mobiles was about drag and drop. For desktop I usually use jquery ui that work great. But the drag doesn't work for mobiles.

Anyway... I don't think here is the place to look for people to join the team.
Maybe you could try the Business Exchange section of the forum.

Good luck.

AleMonteiro 238 Can I pick my title?

Maybe a simple logic like this could resolve your problem:

    // $currentVisible will hold the current visible element 
    var $currentVisible = undefined;

    $(document).ready(function() {
       /* Every time the window is scrolled ... */
       $(window).scroll( function(){
         /* Check the location of each desired element */
         $('.showme').each( function(i){
             var $this = $(this),
                 middle_of_object = $this.position().top + $this.outerHeight() / 2,
                 middle_of_window = $(window).scrollTop() + $(window).height() /2;

           /* If the object is completely visible in the window, fade it in */
          if( middle_of_window >= middle_of_object ){

              /* If there is a visible element, fade it out */
              if ( $currentVisible !== undefined ) {
                  $currentVisible.animate({'opacity':'0'},2000);
              }

              $this.animate({'opacity':'1'},2000);
              /* Set the current visible as the  one being fade in*/
              $currentVisible = $this;
          }
         }); 
       });

       /* for the first scroll to work properly, you need to set the $currentVisible as the first div */
       $currentVisible = $("#myFirstDiv");

     });

Not tested ^^

AleMonteiro 238 Can I pick my title?

What do you mean by not work? What error do you get? what alerts do you get before the error?
Are you sure the ajax loaded options have a value property?

Another thing.. your validation is not good. If you're so uncertain of what you're getting, try something like this:

function _hasValue(val)
{
    return val !== undefined && val !== null && val != 0 && val != '';
}

if ( ! _hasValue(district) ) {
    // show error
}
AleMonteiro 238 Can I pick my title?

I've never seem embebed windows applications in web pages. And it's probably because it doesn't make much sense.

Maybe you could convert the windows form to an silver light app. Then browsers with the plugin would be abble to run it.

But anyway, why would you want to run a windows form app inside a browser?

AleMonteiro 238 Can I pick my title?

Oh, sorry, my bad. You have to set html to empty;

var html = '', i;
AleMonteiro 238 Can I pick my title?

I'm assuming you have an desktop application with an embebed browser in it.

The problem it's probably caused because of the default setting for Document Mode for embebed IE's. So, if the registry 'tweak' works, you can just make your app change the registry.

There's lot's of resources on setting registry values. One of them:
http://www.codeproject.com/Articles/3389/Read-write-and-delete-from-registry-with-C

AleMonteiro 238 Can I pick my title?

What you need to learn depends on what you want to do with knowledge.
Do you want knowledge for knowledge or you want to build something? What do want to build?

For me, there's no better way of learning than doing. And I don't think studying only HTML it's much helpfull. You'll need at least CSS to make anything worth to be seen, and probably a little JS later.

So, I suggest that you think of something to build, and build it.

Developmet it's much more than just languagues and coding. There's lot's of stuff to learn, from code editors to browser compability issues.
You can't learn all at once, and learn all before doing something we'll consume lot's of time.

If you learn a little from each subject from each project you work on, with time, you'll have a good knowledge of a broad range of subjects.

AleMonteiro 238 Can I pick my title?

It's quite simple:

// $el = jquery element to add the itens
// num = number of elements to add
// method = method used to add elements
var _add = function($el, num, method) {
    var 
        html // hold the html string
        , i // counter;

    // Adds the elements in the html string
    for(i=0;i<num;i++) {
        html += '<li></li>';
    }
    // Adds the html string to the jquery element
    $el[method].call($el, html);

    // it could be writen simpler as
    if ( method == 'append' ) {
        $el.append(html);
    }
    else if ( method == 'prepend' ) {
        $el.prepend(html);
    }

};  
AleMonteiro 238 Can I pick my title?

Try like this:

var counter = 0;
$(document).ready(function () {
    $("#clickbtn").click(addRow);

    // If you want to add a row at the start:
    addRow();
});

var addRow = function() {
    var newRow = $('#form-sample').clone(true);
    newRow.attr('id', counter);
    $('#forms').append(newRow).html();
    counter++;
};
AleMonteiro 238 Can I pick my title?

By elegant do you mean simpler? Less code? More didact? More Efficient?
Elegant code it's a very personal concept i think.
For me, elegant code it's a set of well structured and dynamic functionalities.
That's said, here's a more dynamic function.

var _add = function($el, num, method) {
    var html, i;
    for(i=0;i<num;i++) {
        html += '<li></li>';
    }

    $el[method].call($el, html);
};  

_add($('ul'), 5, 'prepend');
_add($('ul'), 5, 'append');
AleMonteiro 238 Can I pick my title?

toplisek, you have only to change '$' for jQuery, not anything that starts with '$'.
Let me exemplify.

// jQuery object
var jQuery = { ... };

// Sets $ as a reference of jQuery object
var $ = jQuery;

// Variables that start with '$' are usually to identify that it hold a jQuery object;
var $el = $("#myDiv");
var $div = jQuery("#myDiv");
var $str = 'this is not commum, because it's confuses the programmer, but works normally';
AleMonteiro 238 Can I pick my title?

I'm not sure I understood exatcly... do you wan't to save multiple identical forms at once?

If so, I suggest you use json formatting to transfer the data.

You should create an object within JS to hold all the data, something like this

var arr = [];

$("#add-child div").each(function(){
    arr.push({
        id = $(this).find("#parentid").val(),
        salut = $(this).find("#chsalute").val(),
        fname = $(this).find("#chfname").val(),
    .
    .
    .
    });
});

$.post("AddChildDetails.php", { children: arr },
    function(data) {
        alert("Child added!");
        $("#addchildD").hide();
    });

In PHP, you'd have to parse the JSON data to an array and then loop it to make the inserts.

$children = json_decode($_POST["children"], true);

foreach($item in $children)
{
    //do inserts with $item->id...
}

Obs.: In JS you shouldn't use ID to get the inputs, because they wouln't be unique. Use name instead, you can have multiples.

AleMonteiro 238 Can I pick my title?

The URL you posted is not working.

What error do you get when trying to use jQuery?

AleMonteiro 238 Can I pick my title?

Nice job man =)

Cheers!

Just mark as solved to finish it ^^

AleMonteiro 238 Can I pick my title?

You think or does it work? lol.

AleMonteiro 238 Can I pick my title?

So... unless you know a cleaver way, I thin you'll have to loop day by day to calculate the interest.

There's probably a easier math solution, but I don't know it.

AleMonteiro 238 Can I pick my title?

I don't know what this means: calculate interest on principle compounded daily

AleMonteiro 238 Can I pick my title?

Could you post your table schema and the desired result?

AleMonteiro 238 Can I pick my title?

Thanks CimmerianX!

I think I got your idea. I'm gonna prepar to and try it (I don't have a home router capable of VPN yet).

If I get stuck in the setup, I'll create another topic.

This one is solved.

Thanks once more!

AleMonteiro 238 Can I pick my title?

I'm not a LINQ expert, but analysing your code, the first thing I'd try would be:

var query = from Table1 in datatable.AsEnumerable()
            join Table2 in Datatable2.AsEnumerable()
            on Table1.Field<int>("ID") equals Table2.Field<int>("ID")
            where Table1.Field<DateTime>("Date").Date < enddate.Date
            group Table2 by new {
                    Name = Table2.Field<string>("Name"), 
                    Amount = Table2.Field<double>("Amount"),
                } into c
            select new
            {
                  Amount = c.Sum(p => p.Field<double>("Amount"))
            };
AleMonteiro 238 Can I pick my title?

What do you got so far?

If you are trying to convert and is stuck at something, I'm sure lots of people here would help.

If you just want somebody to do it for you, you should probably be posting at the "Jobs and Resume" section, at "Bussines Exchange".

AleMonteiro 238 Can I pick my title?

So the label should be "Deposit Per Month", or something like that.

My point is, your problem, at the moment, seems more about the logic and mathematics about investments than with coding itself.

AleMonteiro 238 Can I pick my title?

CimmerianX, I should probably ask permission first, but even if they allow it, it would be, with luck, for next year. Too many policies and rules. To allow the VPN to our Office, for a 6 month project, it took almost 3 months. The setup took 2 hours, but it took 3 months for the "approval".

About the jump host, I understand it would work, but it isn't a great solution for my use either.
The point of this VPN it's to access multiple projects(source code and spec) on SVN.
If I used a jump host, I would have to merge the versions on the host. I'd lost some of the SVN usefullness, or I'd have to install an SVN on the host to be able to use it well.
So, as far as I see, for now, using a jump host would be problematic.

Thanks for the suggestion anyway.

If it isn't asking too much, could you explain why my last ideas wouldn't work? Would it be because my home ip would be in the same subnet as the office? If this is the case, changing the mask or something could help?

Any other ideas in how to access a customer SVN from your home, through your office VPN with the customer?

Thanks again!

AleMonteiro 238 Can I pick my title?

This table is also wrong... if you make 1200 deposit every 30 days, how come in one year you only deposited 1200? This make no sense.

AleMonteiro 238 Can I pick my title?

It can be done only with SQL but can also be done using VB.
I suggest an stored procedure to delete and execute in VB.

AleMonteiro 238 Can I pick my title?

What do you have so far?

AleMonteiro 238 Can I pick my title?

There's no build-in function that does that.
I think the best approach is to search for the tables you want in the information schema and then delete them by name.

Here's a way: http://stackoverflow.com/questions/4393/drop-all-tables-whose-names-begin-with-a-certain-string

AleMonteiro 238 Can I pick my title?

JorgemM, CimmerianX, thanks for the knowlodge guys!

Now let's go into specifics...

My Customer subnet is 192.168.20.0
My Office subnet is 192.168.10.0
My Home subnet is 192.168.5.0

This way, for what I understood, my Customer VPN should allow 192.168.0.0 (or have two subnets .10 and .0). Right?

But this isn't my best scenario, because I don't want the customer to know (because he woulnd't allow it, it's a big company with lots of rules).

In my home, I don't need subnet, Is just one pc that needs access.

So, If I change my home subnet to 192.168.10 (same as office), and use an static IP on my pc, keeping it different from any IP in the Office (IE. Office DCHP goes from 10.1 to 10.120, Home IP would be 10.130).

Would this work? If not, is there any way that I can put my home pc in the same subnet of the office, so my customer doesn't have to change it's settings?

Thanks again =)

AleMonteiro 238 Can I pick my title?

I don't think this is correct at all, but it makes much more sense than yours do... maybe it can help:

    <html>
    <head>
    <title>Future Value Calculation</title>
    <style type = "text/css">
    table { width: 100% }
    th    { text-align : left } 
    th span { color: #008; margin-left: 15px; }
    </style>
    <script type = "text/javascript">
    window.onload = function()
    {

        var EndBal;
        var principal = 2000.00;
        var rate = 0.12;
        var deposit = 1200;
        var interest;
        var BegBal = principal;
        var initialAge = 16;
        for ( var age = initialAge, i=1; age <= 65; age++, i++ )
        {   
            EndBal = ((principal + (deposit*12* i)) * Math.pow(1 + rate, i ));
            interest = EndBal-(principal+(deposit*12*i));
            // Insert row
            var row = getById("tBody").insertRow(getById("tBody").rows.length); //Insert row at index 0
            // Create cells for the created row
            // Empty cells are set to   to be displayed in the table
            row.insertCell(0).innerHTML = age; 
            row.insertCell(1).innerHTML = formatNum(BegBal);
            row.insertCell(2).innerHTML = formatNum(interest);
            row.insertCell(3).innerHTML = formatNum((deposit*12*i));
            row.insertCell(4).innerHTML = formatNum(EndBal);
            BegBal = EndBal;
        }
        // Set the header values
        getById("spnInitial").innerHTML = formatNum(principal);
        getById("spnRate").innerHTML = rate.toFixed(2);
        getById("spnDeposit").innerHTML = formatNum(deposit);
        getById("spnInvestment").innerHTML = formatNum(EndBal);
    }

    // Format number
    function formatNum(val)
    {
        return val.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
    }
    // Helper function to get element by id
    function getById(id)
    {
        return document.getElementById(id);
    }
    </script>
    </head>
    <body>
    <table border="1">
    <thead>
    <tr><th colspan="5">Future Value Calculation</th></tr>
    <tr><th colspan="5">Initial Investment:<span id="spnInitial"></span></th></tr>
    <tr><th colspan="5">Interest Rate:<span id="spnRate"></span></th></tr>
    <tr><th colspan="5">Deposit every 30 days:<span id="spnDeposit"></span></th></tr>
    <tr><th colspan="5">Investment started:<span id="spnInvestment"></span></th></tr>
    <tr>
    <th>Age</th>
    <th>Beg Bal</th>
    <th>Interest</th>
    <th>Deposits</th>
    <th>Ending Bal</th>
    </tr>
    </thead>
    <tbody id="tBody">
    </tbody>
    </table>
    </body>
    </html>
AleMonteiro 238 Can I pick my title?

Sorry, I was on the phone and couldn't take much time, so, to make it clear....

I'm using the Cisco DPC3925 to build an VPN Tunnel Site to Site (Lan in the Office to Lan in the Customer).

Now I want to make an VPN Tunnel Client to Site (My PC at home to the Lan in the Office).
I'm hopping that this way I'll be able to access the Customer Lan from my home.

Is it clear now? And more important, is it possible?

Thanks.

AleMonteiro 238 Can I pick my title?

JorgeM, the VPN with the customer is site to site.

AleMonteiro 238 Can I pick my title?

Hi guys.

I have an Cisco DPC3925 router at the Office which I use to close an VPN Tunnel with an customer.

Now, I want to close an VPN from my Home to the Office, so I'll be able to connect to the customer VPN from home.

Would this work? If so, is this model(Cisco DPC3925) up for the job? And in my Home, which router should I get?

Thanks!

AleMonteiro 238 Can I pick my title?

Just a guess, but aren't you missing .DataBind()?

   propertyBindingSource.DataSource = _property;
   propertyBindingSource.DataBind();

   propertyUnitsBindingSource.DataSource = _propertyUnit;
   propertyUnitsBindingSource.DataBind();
AleMonteiro 238 Can I pick my title?

Streams are used to manage sequence of bytes.
Manage: read, write, seek, count.

Sequence of bytes are usually files or images, but can be any data in form of byte array.

AleMonteiro 238 Can I pick my title?

Try something like this:

<input type="hidden" name="buttonaction" value="D" />
 <input type="submit" onclick="javascript: document.form.buttonaction.value=this.value;" value="previous">
 <input type="submit" onclick="javascript: document.form.buttonaction.value=this.value;" value="next">

 <?php
    $action = $_POST["buttonaction"];
 ?>
AleMonteiro 238 Can I pick my title?

I suggest using http://htmlagilitypack.codeplex.com to properly parse the HTML and then navigate through it.

AleMonteiro 238 Can I pick my title?

I didn't understand what you saying about server and client machine, jQUery is always client.

Anyway, try like this:

    $("#i_b_prob")
        .children()
            .removeProp("selected")
            .first()
            .prop("selected", true);
AleMonteiro 238 Can I pick my title?

First you need to know why is not starting. Does it show any errors? What message do you get when you try to start the service?

Also look in the Windows Event Viewer for logged errors.

AleMonteiro 238 Can I pick my title?

What you described is jqueryui Dialog widget.

For rotation, I don't know any plugins, but you can try something like this:
http://jsfiddle.net/d039q06t/

AleMonteiro 238 Can I pick my title?

Hello!

For resizing use http://jqueryui.com/resizable/

For rotation, I never used, but there's a couple here: http://plugins.jquery.com/tag/rotate/

Like this one: http://jquery.jcubic.pl/rotate.php

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

Mike, rubberman, thanks for the input!

I'm gonna make some quotations and and I'll post the specs here later, for validation.

Thanks!

AleMonteiro 238 Can I pick my title?

Thanks rubberman!

What processor would you suggest?

About A/V scanning, i don't have any thing like that on my pc. I disable anything that isn't usefull and keep a eye on what's running.

AleMonteiro 238 Can I pick my title?

Hello reader!

I've been working in a laptop with 6GB RAM, i5, 500GB HD and I can't take it anymore!

What I mostly use :

  1. Office Package (word, excel, powerpoint)
  2. Visual Studio
  3. Eclipse
  4. SQL Server / Analisys Services / Management Studio
  5. Adobe Package: PhotoShop and Illustrator (some flash)
  6. VMWare/VirtualBox (customers projects in messy enviorement)

The bad thing is that I usually use most of them at the same time. IE: Working on a android app with c# webservice using sql server database, and the spec would be in an doc or excel file.

About the gaming, I'm not playing much at the moment, but I like it a lot ^^

  • Counter Strike GO
  • Call of Duty MW3
  • Skyrim

The SO I'll propably keep Win7 for a while.

So, my max is about R$ 5k, wich is about U$2.5k.

And what I'm thinking...

  • 16gb RAM
  • 1TB HD
  • 80GB SSD
  • I7
  • 2GB GForce
  • 500W Cooler

What would you guys suggest?

Thanks!

AleMonteiro 238 Can I pick my title?

Try this:

foreach($busName as $code=>$bname)
 {
    $edit = (isset($_REQUEST['do'])=='edit' ? $seldata['bus_name'] : "";

     echo "<option value=\"$code\" $edit>$bname</option>";
 }
AleMonteiro 238 Can I pick my title?

There's no cache in JavaScript, just cookies in the browser.

You have to set and get the cookies that you want. Simple as that.

AleMonteiro 238 Can I pick my title?
//You can do it normally...
$("#X3").click(function() {
    // Do Something
});

//Or you can append listener at the creation...
var x=3,y=3
for (var i=0; i<x; i++){
    var line=$('<div>', {id:"X"+i } ).css({clear:'both',width:'100%'}).appendTo('body');
    for(var j=0;j<y;j++){
        $('<div>',{id:"X"+i+"_"+j}).css({float:'left',width:10,height:10,border:'2px solid red'})
            .click(function() {
                // Do Something
            })
            .appendTo(line);
    }
}
AleMonteiro 238 Can I pick my title?

The first time the button is clicked you're going to clone it once?
The second time the button is clicked you're going to show it twice? And so on?

Then, it sould be something like:

$(function()
    {   
        var element = $("#textbox").hide();
        var count = 0;
        $("#clickme").on("click", function()
        {
            count++;
            for(var i=0;i<count;i++) {
               element.clone().insertAfter("#clickme");
            }
        });
    });

This way, at the third click, there'll be 6 elements (1 for the first click, 2 for the second, 3 for the third).

AleMonteiro 238 Can I pick my title?

That's probably because "http://www.contoso.com/library/homepage/images/ms-banner.gif" is not a image anymore, it's redirecting to microsoft webpage. So you don't get a file to download.

Try using an valid file URL.

AleMonteiro 238 Can I pick my title?

In the example you gave, they use this validation:

if($(window).scrollTop() + window.innerHeight >= $(document).height() - 50 && !busy){

}

View Source is very usefull =)