AleMonteiro 238 Can I pick my title?

Sorry for the late response... but to keep the data on page reload you'd have to use cookies to store it.

AleMonteiro 238 Can I pick my title?

Just to update my previous answer... I don't use Windows as my main OS anymore and I feel much safer. I just run lynis and chkrootkit once a while and follow up the suggestions.

AleMonteiro 238 Can I pick my title?

Change $_POST['s'] to $_GET['s'] or to $_REQUEST['s']

AleMonteiro 238 Can I pick my title?

Hello Tko,

when you call countdown('08/26/2016 09:07:13 PM', callback);, 'callback' is not defined.

I made an fiddle if an example based on your code, except the css.

I think it's what you want: https://jsfiddle.net/alemonteiro/s0wwkLfp/1/

AleMonteiro 238 Can I pick my title?

@hericles, thanks for the input, but I disagree in some points...

Humans are incapable of functioning in sufficiently large groups with leadership/authority in place.

You meant "without leardership", right? Because government is leadership/authority.
But even then, if people are not capable of deciding how to live, how are those same people capable of appointing someone to take the decisions for them?

I believe in leadership, but not in defined rules. Not in the military state. I believe in leadership of morals, of knowlodge and of passion. You follow those you believe in, not those that the majority tought was the least worse available option.

It takes organised effort to a variety of good things like food distribution, infratructure, health care, etc. Sure, governments can be (and are) corrupt, or more exactly, are full of corrupt people.

Organized effort doesn't need to be centralized in a instituition. The food available on the market wasn't grown, processed, transported and arranged by plans of the government. People and companies make stuff.

I agree that a government with smart and good hearted people could be great also, but I think this is more than an utopia than anything else. Bad people know that the best position for they to act as they wish is in positions of power, so they'll always fight hard to get there, they'll lie, kill, extort and etc to reach they goal.
So, the existence of a institucionalized power is in it self passive …

dchrismoore commented: If anarchy (as a system of government) worked, we would have more of them and I don’t see any utopia because people are bad. +0
AleMonteiro 238 Can I pick my title?

Hey fellas,

Do you think it's possible to live in a organized society that doesn't have a government? And why?

I can't remeber when I lost faith in our current system, it's been a while for sure. Year after year is getting more clearer to me that we need radical changes in the way we live. We need to evolve in manners to evolve in consciousness.

The government that should, theoretically, protect and provide for the population are often caught protecting and providing for large coorporations while restricting the power and liberties of the people.
I don't believe that any politician could bring real change to our lifes(for the better), most of them say they would but what they really do is get richer and richer. The really rare and spare people that try to change it are marginalized by the mainstream media, and because of the poor education(made poorly by choice of those who wants to perpetuate power) most of the people sits by and watches.

Don't get me wrong, I didn't lost faith in humanity, only in the system. I think government it's the biggest weapon of all times, and only a few have the right to use it, and most of the time they use it against the population.

Until now, with knowlodge I found on my humble research, I'm inclined to believe that only a anarchist society could break our chains and set us free for real. But anarchism is a strong word, many will …

dchrismoore commented: People are not inherrently good. People are bad. That is why parents have to train you how to behave and police have to be ready to arrest you. +0
AleMonteiro 238 Can I pick my title?

My country is the world and my religion is to do good.
- Thomas Plaine

AleMonteiro 238 Can I pick my title?

A simple replace should do it:

// removes duple spaces
$result = str_replace("  ", " ", $tags);
// removes space after comma
$result = str_replace(", ", ",", $result);

but yes, regular expression would be better I guess... something like (,[ \s]+) and replace with ","

sorry but not time to test the regex for u know, i'm in a hurry

AleMonteiro 238 Can I pick my title?

But you're not checking for any text, you're just checking the checkbox value that will always be the same.

I'd go with something like this:

var checkedCount = 0,
    errMessage = undefined;

for (var i = 0; i < chks.length; i++) 
{         
    var chk = chks[i],
        // gets the checkbox value
        chkValue = chk.value, 
        // gets the text input related to that checkbox
        txt = document.getElementsByName('quantity_' + chkValue)[0],
        // gets the text input value
        txtValue = txt.value;

    if ( chk.checked === true || chk.checked === "checked" ) {
        checkedCount = checkedCount + 1;
        // Check if there's value on the text and if the text is not only blank spaces
        if (typeof txtValue !== 'string' || txtValue.toString().replace(/ /gi, "").length === 0 ) 
        { 
            errMessage = "You must fill all selected inputs";
            break;
        } 
    }
}

if ( checkedCount === 0 ) errMessage = "You must select at least one input";

if ( errMessage === undefined ) {
    return true;
}
alert(errMessage);
return false;

Obs.: Not tested.

And I think you shouldn't have re-open this thread. Since is another problem, in another language, you should have started a new thread.

AleMonteiro 238 Can I pick my title?

What do you mean? Are you going to change the navigation menu after the page is loaded?

Or do you just want to know what page was loaded to do something on the contents?

Or do you want to have an tree-like structure that dinamically changes the navigation upon user interaction?

To hide a link to a page is simple, let's hide every link to test.php with jQuery:

$(function() {
    $('a[href="teste.php"]').hide();
});
AleMonteiro 238 Can I pick my title?

Checkboxes values are only submited if they're checked, and text values are always submited even if blank.
So if you check only 5 boxes, the length of $_POST['checkbox1'] will be 5 but the length of $_POST['quantity'] will still be 10.

I suggest you to name each input text with the correspoding prodcode used on the checkbox, like name='quantity_".$row['prodcode']."' and then for each checked input you get it's text using $_POST["quantity_".$check[$i]].

AleMonteiro 238 Can I pick my title?

You could just make an replace for any special char into an space and then split it with explode, but if you want something a little more elegant, you probably want regular expressions.

Take a look at this: http://stackoverflow.com/questions/9088391/splitting-large-strings-into-words-in-php

AleMonteiro 238 Can I pick my title?

There's hundreds of jquery gallery plugins out there, just google "jquery image gallery".

I don't remeber any one that does exactly what you want, but there's probably a few.

Here's somewhere to start: http://www.webdesignerdepot.com/2011/08/25-jquery-image-galleries-and-slideshow-plugins/

AleMonteiro 238 Can I pick my title?

The only way I'd say it's by doing it!

What do you mean only basic stuff? All methods, params and possible results are listed there.

And what else do you want? You asked only about the login. There's a page for each method available. There's a section for each SDK.

Even if you search google how to do something, many answers will lead you to some page on developers.facebook.com

Basically anything you want to do you can find starting here: https://developers.facebook.com/docs/

AleMonteiro 238 Can I pick my title?

It's a silly thing... you're reaching for the form with document.getElementById('myForm'), but your form doesn't have id="myForm".

Just add the id to your form or use document.forms['myForm'] to get it by it's name.

Example:

    function onSelectedOption(sel) {
    var frm = document.forms["myForm"];
        if ((sel.selectedIndex) == 3) {
            frm.action = "a.php";
        }
        else
        {
            frm.action = "b.php"; 
        }
        // I don't think you want to submit the form eah time the combobox is changed, or do you?
        // If you do, just remove the comments.
        //frm.submit();
    }
slowlearner2010 commented: thanks for your answer. its solved now.. +2
AleMonteiro 238 Can I pick my title?

Your button is of 'submit' type, so it means that it'll submit the form (an reload).

I didn't check all of your code, but i'd replace your input button for this one:

<button type="button" class="btn-login" onclick="toggle_visibility('foo'); toggle_visibility('sidebar'); toggle_visibility('tiles'); toggle_visibility('wsf');">Login</button>
AleMonteiro 238 Can I pick my title?

How about the facebook developer homepage? It's has the best, and most up to date, documentation you could ever find.

https://developers.facebook.com/docs/facebook-login

AleMonteiro 238 Can I pick my title?

No where in your code exists an INSERT...

But let's say you want to insert $tolak..

$no1=$_POST[asal6];
$no2=$_POST[tuntutan6];
$tolak6=$_POST[baki6];
$tolak6=($no1-$no2);

$sql = "INSERT INTO table_name(col1, col2, col3) VALUES($no1, $no2, $tolak6);";

// Assuming that you're using MySQL:
$result = mysql_query($sql) OR die("Error: " . mysql_error());
AleMonteiro 238 Can I pick my title?

Oh boy, it would be much easier with you could post the SQL to create the tables already.
It's much easier to analyse an entity relationship on a diagram viewer than on a doc.

I won't take a look at this now, but I suggest you to create the tables on SQL Server and post back an image of the Relationshipg Diagram and the SQL to reproduce it. I think this would get you more answers.

AleMonteiro 238 Can I pick my title?

Is your column name a reserved word?

If it is, you should enclose it with ": http://www.techonthenet.com/oracle/errors/ora01747.php

AleMonteiro 238 Can I pick my title?

On a similar approach of @rpoffitt, you could built it with NodeJS and just make an wrapper for each plataform. This way you can code almost all of it in JavaScript/HTML/CSS and with little effort you can have an app for each plataform.

Basically your app would be an site inside an closed browser.

Brackets and Atom editors are made this way.

It's a great way to make open source projects because JavaScript is only getting more famous and basically any Web Developer can tweak/improve the app.

AleMonteiro 238 Can I pick my title?

Are you asking us to do your homework?

Please have some self-respect and do your own homework!

We're here to help, not to do your ****** ****.

http://www.learnalgorithms.in/

AleMonteiro 238 Can I pick my title?

@DavidB, unfortunally that's not true for every country. You can't buy a new pc under R$ 1.000,00 in Brazil, and if you want anything with 4gb or more of ram then it's going up to at least R$ 1.500,00. And so you can compare, that's 2 times the minimum wage here.

An 1TB HDD costs about R$ 400,00 here, so buying new pcs for testing software is not an option for the majority.

But again, the thread is not about how to test distros, I was asking option about distro and packages =)

Thanks for the reply ntl ^^

AleMonteiro 238 Can I pick my title?

I started up using connection pool to see if it resolve the problem, otherwise i think i'll have to connect and close it after each query.
Another way would be to use events instead of callbacks, so it could reconnect when disconnected.

On similar note, i was thinking about creating one node domain for each server engine (mysql, pg, mssql..).
I don't know if I just split into multiple domains or if already split the extension in parts, because only with those 3 engines the extension is about 2.2mb, and i want to add at least Oracle as well. So as I user, i'd like to setup only what i need.

What do you guys think?

AleMonteiro 238 Can I pick my title?

Thanks a lot for the beautiful words bob!

But let me ask, are you getting much 'Max connection attempts reachead'?

I can't figure this out, normally happens when I let it connected for too long without doing nothing or on the next command after an error occours, but not always.
And it seens it's from node, not the databases.
But no error is logged on the domain side... i need to learn more about node i guess.

AleMonteiro 238 Can I pick my title?

Choose your IDE (Eclipse, Android Studio or even Visual Studio now a days), install the stuff, install the sample apps and start playing!

Almost every release of an API version has an attached API Samples with dozens of apps each one demonstrating one or more features.

If you got and Android device you can just plugin and start debugging, or if you don't, set up and virtual device to do it =)

I think hands on are the best way to go! And the link @stultuske recommend is the best one, android documentaion is neat!

Ps.: I used Eclipse for somewhile but a couple a months ago I migrated to Android Studio, and i'm liking it.

AleMonteiro 238 Can I pick my title?

The connection string depends on the driver you're using. Which probably is NET Connector, so it should probably be:

Server=192.168.8.101;Port=3306;Database=moneycs;Uid=root;
Pwd=mysql;

If you are using any other driver to connect to mysql check out the connection strings here: https://www.connectionstrings.com/mysql/

To connect from the server it self use localhost. If you're using mysql workbench the port should already be filled with the defautl 3306, just change it if you're setup is diferently.

And a free tip: you shouldn't be using root to connect from the application. You should create an user account for the moneycs database with the required permissions.

AleMonteiro 238 Can I pick my title?

Now a days it's rare to find those posts that fulfill the urge of learning and helping at the same time.
Because I'll tell you, the posts I most enjoy contributing to are those that I need to search at least a bit to make sure I do help instead of confusing more.

But for me to go out of my way and learn/check something new to help somebody i need to feel that they're putting at least the same amount of effort that i'm, and that's sooo rare these days.

Most of my posts recently are indeed mine, asking for linux tips or showing up some stuff i made.

But please tell me, what's that MIA you guys talk about? I've tried seaching it but only come up with some pretty singer =x

AleMonteiro 238 Can I pick my title?

@Freshly, thanks, i'll definaltly try Arch someday, but for now Debian is being great for me to get the hang of the linux world =)

I did the move! It's been two weeks and I'm loving it! Nothing to complain comparing to windows and loooots to congratulate!

Easy dual monitor with multiple desktops, dual audio, full smoth dark screen(had to tweak a little but i'd never would have gotten this kind of beuty with windows - even skype respect QT Settings!!).

I'm using Debian 8 with Gnome 3 (installed xfce also, but didn't use much yet) and till now there was nothing that i wanted and didn't found!

And Oh boy, how I love the terminal! I had such a hard time on windows creating custom commands and named shortcuts(for running with <Super>+R), and now i can just nano /usr/bin/mylove and write something up!

Oh, and grep, i need to learn it so badly! It's awesome!

Just to get more confortable, binded super+E to nautilus and super+R to the run dialog and I feel at home!

I just can't say about the .NET development and gaming yet, because did neither of those yet. I left my work notebook intact to continue the clients projects until it's all smooth on here.

And now I realised that i need to learn c and c++ if i wanna help or tweak some sources.
I know veeeeery little about both, basically cause i've skipped college, so, any suggetions on how I should get …

AleMonteiro 238 Can I pick my title?

Yeap, there's something already: https://www.pureftpd.org/project/libpuzzle

One of it's sampled application it's called "finding duplicate images in photo libraries".

ribrahim commented: Many Thanks for the Link. I wil check. +0
AleMonteiro 238 Can I pick my title?

Don't know if it's only this, but the uploaded image is at $target_path.$userpic and your are creating the thumb only from $userpic;

I think it should be this: $source = imagecreatefromjpeg($target_path.$userpic);

And the same to get the size: list($width,$height) = getimagesize($target_path.$userpic);

AleMonteiro 238 Can I pick my title?

Use this function to add days

function addDays(date, days) {
    var result = new Date(date);
    result.setDate(date.getDate() + days);
    return result;
}

var date3 = addDays(date2, cap_days);

More details here: http://stackoverflow.com/questions/563406/add-days-to-datetime

AleMonteiro 238 Can I pick my title?

lol, could at least say what you downvoted my answer

AleMonteiro 238 Can I pick my title?

Hey fellas, I know it's been a while but only now I had the money and time to buy this box,
the best price/performance I could get (in Brazil) for my needs was this:

  • Motherboard Asus B85 Vanguard
  • Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz
  • 16GB (2x 8 Kingston HyperX)
  • Font 600W Akasa 80 Bronze Plus
  • 1TB HD Seagate

I really didn't have money to buy all I wanted, but I realised I don't need it also. The 80GB SSD wouln't help much, so I decided to wait to buy a larger one latter.

This build for development is being great! Can't complain on anything.

And soon I expect to afford an Radeon R9 380 and an SSD to make it fly with games =)

Obs.: I changed my mind about nvidia because this motherboard only has support for Cross Fire.

Besides your inputs I also took a look at the builds on PC Master Race: https://www.reddit.com/r/PCMasterRace/wiki/builds

They have great info, I just couldn't build more likely because some vendors are really hard to find on Brazil, but with a little search replacements appear.

Thanks for the inputs and sorry for the late closeup ^^

AleMonteiro 238 Can I pick my title?

Uhm, what you're asking seems strange to me... if you need to inputs of dates why do you want to use only one input?

Anyway, once the first date is selected you can store it in a var and clear the input to get the second date:

        var firstDate = false,
            secondDate;
        $( "#from" ).datepicker({
         minDate: -2,
          maxDate: "+1d",
          changeMonth: true,
          numberOfMonths: 2,
          onClose: function( selectedDate ) {
              if ( firstDate === false ) { // if first selection
                  firstDate = selectedDate; // store the first date
                  $("#from").val('').datepicker( "option", "minDate", selectedDate);  // set the min date of it self
              }
              // if second date...
              else {
                  secondDate = selectedDate; //
              }
          }
        });

I don't recommend, but it should work.

AleMonteiro 238 Can I pick my title?

Lol, you seem surprised that it does work =P

But if you need to find a bug to feel better, it's easy, I know lots of them! lol.
Just browse some tables on the browser panel, execute an alter table (add/drop column) on the editor and then open that table again on the browser, it'll not have updated... yet! =)

I did this way to avoid many queries to the db, but now i'm thinking it was a mistake.

AleMonteiro 238 Can I pick my title?

Basically you need to get the events and use them.
To allow drop you need to evt.preventDefault() on dragOver and also to stop browser redirection on dropped.

Checkout an working demo that i made based on your code: https://jsfiddle.net/alemonteiro/vsd3cdwj/6/

AleMonteiro 238 Can I pick my title?

Man, you could get lucky and someone that already used this class could come in an give it all on a platter to you, but's that unlikely.

You should attempt to use it on your own and if you fail, then you come explain what happend and post your code so even people that never used the class can maybe find bugs in your code.

You need to show effort if you want other people to help you.

I mean, look at me, i'm here taking time giving you a lesson on basic learning instead of reading about the class you asked =)

Give it a go!

AleMonteiro 238 Can I pick my title?

Thanks for testing! =)

But tell me, is it usefull for you? Any suggestions are welcome.

The next thing on my mind to implement is storing db changes(alter/create tables, columns and etc) to help rember all the changes for the next production update.

AleMonteiro 238 Can I pick my title?

Just a remark about your code, it would be much more elegant and performatic like this:

 var $overlay = $('#overlay_image_text'),
    engraving = this.engravingFontCaseSenstiveOptions(cText);

 if( engraving == "Lower")
    {
        $overlay.css({
            'margin-top':'-162px',
            'font-size':60+'px'
        });
    }else if(engraving == "Upper")
    {
        $overlay.css({
            'margin-top':'-154px',
            'font-size':48+'px',
            'margin-left':'0px'
        });
    }
    .
    .
    .

In general notes, evit calling the same function over and over again. And every time you all $("#") or .css({}) you're executing a function. This take serious effect if inside a large loop. Obs.: you should cache the var outside the loop but not in the global namespace, store somewhere it will not have attachaments as soon as possible.

AleMonteiro 238 Can I pick my title?

You can use word-wrap: break-word; to break the long words.
http://www.w3schools.com/cssref/css3_pr_word-break.asp

You can also use overflow: auto; to enable scrolling when the content is too big.

AleMonteiro 238 Can I pick my title?

Glad to know =)

Just mark as solved please, you can open another thread if you need futher assistence.

AleMonteiro 238 Can I pick my title?

Man! It was going well, had web env for php/mysql runing with my projects already, had already installed vbox with an Win10 image for testing, until...I tried to install team viewer.

Don't know what happen, but it started removing all packages, including gnome, and ctrl+c didn't stop it, and I was wataching all go away helpless!!

Any ideas why this happened? I used gdebi to install the packaged downloaded from the team viewer site.
Could it be that TV uses another UI than gnome and tried to force it up my system?

No worries tho, from command line I could check that the personal files were still intact, so i'm justing reinstalling the gnome interface and hopping for the best.

This adventure has lots of learning.

AleMonteiro 238 Can I pick my title?

It can be in either way... server-name or server-port should both end up on the same server. The server can be configured to only accept one or another, but usually it's accepted both.

Just to be clear, even if the request is made by a domain (or server name), then the DNS servers come in to find out the IP of that domain, but in the end what matters is the IP of the server.

AleMonteiro 238 Can I pick my title?

"help me solve my homework?"

AleMonteiro 238 Can I pick my title?

If the column it's an image you can't add text to it, you need to parse to a byte array.

If you have an base64 image string for example, you can call byte[] toDecodeByte = Convert.FromBase64String(data);

Anyway, you shouldn't be using Image column, use varbinary(MAX) instead.
From Microsoft:

ntext , text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.

And besides that, you shouln't be storing images on the database anyway.
The best approch is to store the image on the hard disk and only store it's path on the database.

AleMonteiro 238 Can I pick my title?

I'm confused... you developing in Windows Forms with C#? Is that it?
If it is, then there's no cookies or sessions. You can just hold the login date on the main form of you app.

Why is this tagged with c,c++, java, pascal, python and vb.net? Please give correct information so people can help better.

Nutster commented: Good note about the tags. +6
AleMonteiro 238 Can I pick my title?

Thanks Bob!
But since it's an open source, it's not advertising, it's sharing. And it's not a product, it's a project =)
This is how I see at least ^^

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

Since you are using bootstrap you could use BootstrapDialog, quite easy...

Just call BootstrapDialog.show({
    title: 'You title here',
    message: $(images)
});

And to upload it you could use xhr itself

var xhr = new XMLHttpRequest(),
    url = 'upload_page.php';
if (xhr.upload) {

    // file received/failed
    xhr.onreadystatechange = function (e) {
        if (xhr.readyState == 4) {
            if ( xhr.status == 200 ) {
                // File uploadded
                var response = xhr.responseText;
            }
            else {
                // Upload error
            }
        }
    };

    xhr.open("POST", url, true);
    xhr.setRequestHeader("X-File-Name", file.name);
    xhr.setRequestHeader("X-File-Size", file.size);
    xhr.setRequestHeader("X-File-Type", file.type);

    xhr.setRequestHeader("Content-Type", "multipart/form-data");
    xhr.send(file);
}