pty 882 Posting Pro

Funny how this question has been posted to about five forums over the last day. Delete, block and ban?

Hilariously, someone seems to have posted this exact question as a Freelancer project and the guy who took on the project reported him to his supervisors.

this was done for cooper21 on freelancer. Informing his teachers that he is a cheater

pty 882 Posting Pro

Ah! Sorry, I thought you were referring to gwt, Google's old web development toolkit.

I thought you meant that Google Webmaster Tools had been re-written in gwt, which is what the old version was written in, along with most of Google's other tools released from 2006-2015.

pty 882 Posting Pro

Also, using regular expressions to parse HTML on a large scale is a bad idea.

pty 882 Posting Pro

I didn't realise that GWT was still being actively developed. It was good back in the day and I'm sure plenty of companies have apps written with it chugging away on their intranets. It seems that frameworks like Angular, React and Vue have moved in on GWT's patch from one side, and babel/ES6 from the other.

pty 882 Posting Pro

Is there any particular reason you want to use Gambas for this task?

It is of course possible with gb.net.curl but compared to other languages it's a lot of work. In Ruby it's like 3 lines (and two of them are require nokogiri and require open-uri!).

pty 882 Posting Pro

The irony is palpable.

AndrisP commented: Webguru asks this question? +6
pty 882 Posting Pro

HTML, as stated in the standard, is case-insensitive. XHTML, like all XML, is case sensitive.

pty 882 Posting Pro

Maybe, if all developers are struggling to write for your platform, they are not the issue?

As a contractor I've seen companies at all levels of NIH syndrome fail to keep their in-house frameworks (and associated projects like documentation, examples, plugins) on par with the tools that the rest of the industry are using, simply because it takes a lot of time and effort to do well.

Or, maybe you need to pay more!

pty 882 Posting Pro

You probably want to be using a for...of loop here instead of a for...in, which means you don't need to set the variable using the index every time.

const drivers = [
    {
        dateTime: "2018-12-04T10:30:45:222z",
        comments: "",
        drivers: [
            {
                fname: "John",
                lname: "Doe",
                driverCode: "DOEJ"
            },
            {
                fname: "Mary",
                lname: "Smith",
                driverCode: "SMIMA"
            }
        ]
    }
];

for (let d of drivers) {
    console.debug(d);
};

Lastly, don't build stuff in the DOM by appending strings. It's slow, ugly and error prone. Use a templating library instead.

pty 882 Posting Pro

Looks like you're actually going to have to write some code then!

pty 882 Posting Pro

Working out the difference between two files is trivial using (like I said earlier) diff and comm, both of which have existed since at least the 1970s.

The two provided files, diffed by word. Red bits have been removed, green added.

Screen_Shot_2018-02-15_at_16_18_03.png

Now, comm outputs three columns

  1. lines only in file 1
  2. lines only in file 2
  3. lines in both files

So by default, lines that were deleted in file 2 will be in column 1, lines that were added in file 2 will be in column 2, and lines that remain unchanged will be in column 3. You can surpress columns using -1, -2 or -3, so we can run the command multiple times to get a nice summary.

Lines deleted in f2:
deleted.png

Lines added in f2:
added.png

Lines unchanged:
unchanged.png

pty 882 Posting Pro

I'd pay more attention to the slow query log and simple page stats from your logs than hunting down select * queries.

The slow query log will highlight all queries that take more than x time (configurable by you). Your logging system or analytics should tell you which pages take longest to render.

From my experience, it's likely that there will be a couple of pages that hammer the database. Either building up a complex dataset server-side by hammering the database with n+1 queries or doing a few big selects then manually manipulating the data.

So, in short, find the slowest pages/actions. Make them more efficient and faster. Rinse, repeat.

pty 882 Posting Pro

I'd create a profile on a low-traffic niche tech forum, add a few links in my signature and then start asking stupid questions. This method is used by all the biggest, most successful marketing companies and soon you will have to upgrade your web hosting because of the influx of punters.

pty 882 Posting Pro

Do you want to actually learn how to use NodeJS or are you looking for code you can copy and paste from the internet then ask on here why it's not working?

If it's the former, you can make a good start by checking out the free content on [Code Academy](https://www.codecademy.com/learn/introduction-to-javascript and) and NodeSchool.

rproffitt commented: "I'd get it one piece at a time And it wouldn't cost me a dime You'll know it's me when I come through your town." J. Cash +14
pty 882 Posting Pro

The clue is Access denied for user 'homestead'@'localhost'

Do you have a user called homestead? Have you attempted to grant them access to the database?

If you're unsure of the answers to either of those questions, I think you should re-read the documentation.

pty 882 Posting Pro

Use comm or diff.

pty 882 Posting Pro

So you're trying to use media queries in HTML?

Perhaps you should try to read the documentation and gain a basic understanding of things before wasting time by asking inane questions.

pty 882 Posting Pro

This is a shady tactic at best. If someone doesn't submit the form, calling them to offer your services is likely to make them run a mile and choose a less-scummy competitor. I certainly would.

If you're selling on their data it's even worse. But, you know, it's your call.

gentlemedia commented: +1 this is bad, really... really bad! +7
pty 882 Posting Pro

No, that's how you're currently trying to do it. It being something confusing.

What is the outcome? Simple, a couple of sentences max. For example:

I'm trying to implement some kind of custom phone number validation where numbers follow [this pattern]

or

I'm trying to record someone's phone number without them actually submitting the form

By using words out of context and nonsensical phrases like "assign it to a session" confuses matters to the point where I can't tell what you're actually attempting to write.

pty 882 Posting Pro

This is an integration with payment gateway so this data should be passed to them via this way so that why I don't post or get this to another php file.

Really? Which gateway requires this kind of ridiculous gymnastics?

I think that your problem is self-inflicted.

In one or two sentences, what are actually you trying to do?

pty 882 Posting Pro

Check line 34!

Seriously, how do you expect anyone to point you in the right direction without having a ####ing clue about what you're doing? Post the problematic piece of code.

pty 882 Posting Pro

If I can find it with one search you're not trying very hard.

Clue, add CSV to your query.

pty 882 Posting Pro

That kind of ban is called a shadowban. Regular Reddit moderators cannot perform site-wide shadowbans, only administrators can. Usually it happens to spammers.

pty 882 Posting Pro

Yes, it's possible.

pty 882 Posting Pro

Just an idea. Rather than trying to do two things at once, first make one work then (when you're sure the first bit is correct) concentrate on the second.

If you can't answer the question of "which part is broken?" you're going to struggle.

Install httpie and then you can test your API simply from the command line:

http post localhost:4567 < payload.json

where payload.json contains

{
    "profile_info": "Hello world"
};

Once that works, then re-create that POST using jQuery's $.ajax(). The benefit of working this way is that if something doesn't work, you know exactly where the problem is.

rproffitt commented: I fall down if I move both legs at the same time, unless I'm jumping? +14
pty 882 Posting Pro

An example output with a diff tool.

Screen_Shot_2018-01-11_at_13_08_21.png

If you use a merging tool like Meld you can interactively (and graphically) merge the two files together, combining rows that are only differ by whitespace and copying rows that exist on one side but not the other.

pty 882 Posting Pro

I use diff for this kind of thing.

pty 882 Posting Pro

It will be much easier for people to test and contribute if you create a JS fiddle demonstrating exactly what the problem is.

pty 882 Posting Pro
pty 882 Posting Pro

You need to convert the dates users enter to Unix timestamps. You can do that either in PHP or MySQL (see UNIX_TIMESTAMP()).

pty 882 Posting Pro

A few points.

You are looping through dutyStatusLogs multiple times in different ways. You're calling dutyStatusLogs.forEach twice and $.each(dutyStatusLogs, function(i,v){...}) once. These should probably be combined into one loop.

Now, what your original question was about, the nested loop

        $.each(dutyStatusLogs, function(index, value) {

                    var json = dutyStatusLogs;

                        var tr;
               for (var i = 0; i < json.length; i++) {
               }

This section doesn't look right to me. You don't appear to be using the outer loop for anything (there are no references to index or value inside the $.each loop), and you're executing the inner loop once per iteration.

I would rewrite that section in the following manner:

$.each(dutyStatusLogs, function(index, dsl) {
    var dateFieldValue = dsl.dateTime;
    var employeeNo = dsl.driver.employeeNo ;
    var status = dsl.status;

    ...
});

Note I'm using variable dsl (for dutyStatusLog) instead of accessing the original array with the index, this is one of the benefts of using jQuery's $.each function. Newer JavaScript allows for an even simpler syntax. If that's an option you can make your code more readable by using it.

for (variable of iterable) {
  statement
};
pty 882 Posting Pro

Your for loop will be executed once per iteration of your $.each loop.

If that's what you intend to do, then it's not dangerous. Perhaps posting an example of your code (use jsfiddle or similar) would help you explain exacctly what your concerns are.

Additionally, the two types of loop can be used for the same purpose, they are just different syntax (there are other differences but let's not complicate things).

pty 882 Posting Pro

So what's the question?

Have you ever thought about learning web development rather than just copy/pasting random stuff you find on the internet until it looks like it's working?

pty 882 Posting Pro

href="#" makes an anchor tag appear like a link without actually redirecting you. It's intended to take you to anchors on the same page (<a href="#section-1">Section One</a>) but with no following text does nothing.

The intention is that a JavaScript handler takes over the click event.

pty 882 Posting Pro

Not that it matters, but here it is in Ruby.

Simple, elegant and concise. Dare I say, beautiful?

lower, upper = 20, 400

lower.upto(upper)
    .select{|i| i.modulo(3).zero? && i.modulo(4).zero?}
    .each_slice(5){|m| puts m.join("  ")}

.upto loops from the called number to the arg. Normally I'd have written this (lower..upper).select… but this makes it a bit clearer.

.select returns an array containing elements where the block returns true.

.each_slice iterates through the enumerable object in chunks (the first arg, 5 in this case) and executes the block for each chunk (printing the array joined by two spaces).

pty 882 Posting Pro

Beets is exactly this. Don't try to rip it off OP, it'll be painfully obvious.

rproffitt commented: If it's for personal use, a great way to start then customize. If for school, well, a deep one. +14
pty 882 Posting Pro

Your procedure is returning VAR_PRICE OUT AUTOMOBILES.A_PRICE%TYPE. You should be returning a table.

pty 882 Posting Pro

Which filesystem are you using?

pty 882 Posting Pro

More likely you didn't follow their instructions. It looks quite straightforward to me.

pty 882 Posting Pro

Delete and ban. These threads are worthless.

Guard Dog commented: What do you mean under "bad links"? +0
ZoyaHall commented: Why? This question is more relevant than ever. +0
pty 882 Posting Pro

Is there anything in the database that can't be migrated to a newer version?

Using a database that's been unsupported for nearly fourteen years is a bad idea.

pty 882 Posting Pro

Not using any PHP page

var url = serverURL() + "/login.php";
pty 882 Posting Pro

Without knowing what you've done it's difficult to diagnose anything. Did you install this?

pty 882 Posting Pro

Not that anyone will be too bothered, but I created a full guide on how to remove the ads.

Here is the link.

Hopefully anyone who happens across this thread in a search will find it useful. Post here (or on Github) if you run into any problems!

pty 882 Posting Pro

Additionally, in theory your ISP could inspect your data as it passes through them on its way to you. However, sites that contain important personal data (such as your bank, email provider, online shops you buy things from, etc) should be secured via SSL. This will prevent anyone from inspecting data in transit.

Your browser will tell you if a site is secure, just look for a green padlock on the left side of the URL bar.

Screen_Shot_2017-11-10_at_15_57_10.png

It's a good idea not to send anything personal or important unless you can see one of these.

pty 882 Posting Pro

What does your ISP have to do with your data? Why would they ever see it? If they were compromised, how would that affect you?

pty 882 Posting Pro

Here is a working version. Unfortunately in the wrong language, looks like OP will have to do some work after all.

loop do

  puts "Enter a number (-1 to end):"
  num = gets.strip

  exit if num == "-1"

  num
    .chars
    .each
    .with_index(1) {|c,i| puts "Digit#{i} = #{c}"}

end
rproffitt commented: Noice. +12
pty 882 Posting Pro

TinyMCE is open source and the 'community' (read: unsupported) edition is available using NPM, and easy to use with module loaders like webpack and browserify.

I'm guessing Davy hasn't done it that way, but without him saying what he's done it's impossible to point him in the right direction. The right direction is probably RTFM, though.

rproffitt commented: Yes. "What did you do, Dave?" +0
pty 882 Posting Pro

Both Oracle and SQL Server support BACKUP DATABASE, but they have different syntaxes and options.

Providing you can connect a web app to any database you want to back up, you should be able to execute these commands using the SQL driver your language/framework provides.

Docs here and here.

rproffitt commented: Fine example about how details matter. +12
pty 882 Posting Pro

Incidentally, here's the portion of my API that handles CORS. It's in Go (with vestigo), but should be easily translateable to whatever platform you're working with:

    if config.CORSEnabled {

        Warning.Println("CORS is enabled, origin:", config.CORSOrigin)

        r.SetGlobalCors(&vestigo.CorsAccessControl{
            AllowOrigin:      []string{"*", config.CORSOrigin},
            AllowHeaders:     []string{"Authorization"},
            AllowCredentials: true,
            MaxAge:           3600 * time.Second,
        })

    }