pty 882 Posting Pro

If you have a problem like this you're probably better just starting again. This is a bad idea that will generate useless data. Burn it with fire.

rproffitt commented: Good advice for spider filled homes. +15
pty 882 Posting Pro

Do you want to get sued? Because this is how you get sued.

What value is there in an app that redirects me to a website? What value to me, them (the brands), and you?

As far as I can see, there's none.

rproffitt commented: "Do you want ants? Because that's how you get ants" - Malory Archer +15
pty 882 Posting Pro

Like doesn't support multiple conditions, you need to use or.

pty 882 Posting Pro

The short answer is that it depends who I'm talking to. With other people who are interested in technology I use hacker in the traditional sense (white hat).

With muggles (many of my clients), it's easier to use the word to describe the black hat variety. It just means I don't have to explain the term to people who don't really care.

rproffitt commented: Ha ha, muggles. +15
pty 882 Posting Pro

I think that spatial functionality probably isn't really required for this, you only need to store coordinates for points (of interest) and a city key in that table, unless you want really fancy functionality like clicking a city will automatically query for any POI within 20km. To start with, an X and Y numeric field is enough.

For displaying maps on the page you're probably best looking into LeafletJS.

I wouldn't worry too much about backend databases to start with, I'd begin by hardcoding a JSON file with the data you need in it, and when you're ready and happy with the structure, content and sections of the app, you can replace it with an API.

pty 882 Posting Pro

WebRTC video chat with integrated payments for adult performers and smut peddlers, perhaps?

rproffitt commented: Brill. May as well get in on what the internet is all about. +15
pty 882 Posting Pro

I think you're approaching this from the wrong direction. You should be storing the start date and calculating the increment using datediff in a computed column.

If you need more complicated logic (like zero days being displayed as one day), take care of that in the application and just store the start date in the database.

pty 882 Posting Pro

If you really care about image quality (say if you're printing fine art photos), Inkjet is better. For almost all office environments where most printing is black text with the odd image that's not going to be hung on a gallery wall, Laser is more convenient and faster.

rproffitt commented: Fire lasers, spread ink. +15
pty 882 Posting Pro

What's the advantage of this over drop schema myschema?

pty 882 Posting Pro

Perhaps there is another solution.

When new members make posts, hide them by default until admins have marked them as being a non-spammer. Once they've been greenlit, show them.

Pros:
  • Most spammers will fall into the trap and their spammers and their posts will vanish without the average user (me included!) being aware
  • The new user/spammer will think everything's normal
  • It's probably not hugely complicated to write and there are plenty of prior examples of this kind of functionality
  • If their post looks kind of ok but has some slightly-worrying signs, this would provide an opportunity for an admin to tidy the post/remove spammy links before it is made

    Cons:
  • New code would have to be written and tested
  • Another field (probably boolean) would be required on the user table
  • Extra work is required from admins in greenlighting new users
rproffitt commented: All good ideas. The ideas of gaining points to post is out there but pain point? Will this bring you back? Mods feel the spam pain for now. +0
ernie.cordell commented: I like the idea, but fear what I hope would be insignificant: Normal users falling into the trap somehow. Also it's a ton of moderator work. +0
pty 882 Posting Pro

There most definitely is a one-query solution. You'd effectively have to do both stages of the route I suggested in one go, using subqueries and a union.

Using views to simplify the process is not really a compromise, that's what they are there for. If you don't want them to be mixed in with your everyday database objects, use a separate schema (again, that's what they are there for!)

The good thing about doing it in stages is that it makes debugging much easier. If your results look a bit iffy or don't perform well and you need to start deconstructing a huge query with subqueries in order to begin working out what's wrong, the additional complexity becomes a burden. If your final query is simple and the views that it relies on are simple it's easier to find the problem. Better still, when you fix or optimise it, all the things that rely on it will automatically improve.

rproffitt commented: "I wrote in just one line, then I went mad." +15
pty 882 Posting Pro

my project is about the cleaning service app

"Cleaner than your mom"

pty 882 Posting Pro

And here lies the problem. Not to mention the 11 year old green underlining thread that was just resurrected. The reason people like and keep going back to SO is because you just don't see spam and shitposting like this.

pty 882 Posting Pro

I'd do this in stages. Create a view where for each table you summarise totals by the month, you'll need to use extract or date_part to split the date into yearand month integer fields, which you'll group by, and sum to get the monthly totals. Then your joining of the two views becomes trivially easy.

Two simple steps are better than one complicated one.

pty 882 Posting Pro

Posts like this. They should be deleted instantly. To be honest, for new members, the post shouldn't even become visible until an admin has verified it. It's pollution and it damages the site.

pty 882 Posting Pro

If you're a developer and list your skills and past places of work there you simply become a magnet for recruiters and are inundated with requests. Some recruiters are ok, most aren't, and a large proportion of the offers I get are extremely low quality or not even remotely suitable.

Additionally, LinkedIn employs plenty of dark UI patterns which I really don't enjoy. "27 people have viewed your profile, click here to find out who! Not really"

pty 882 Posting Pro

Microsoft has a mixed record. LinkedIn was barely touched (and remains a cesspit of the highest order), Skype was mangled and is a shadow of its former self, as was Nokia. Others, like Yammer and aQuantive were just absorbed.

If Microsoft change too much too soon, GitHub users may leave for new pastures. However, if they stay hands off, it's not necessarily an awful move. Microsoft aren't the toxic open source hating company that Balmer ran, even if that memory is still fresh in our minds.

pty 882 Posting Pro

to provide matchmaking between users

Is there value in that?

I know there is value in informed matchmaking but you need a high quality pool of users and companies. Can DW's userbase (which if I'm not mistaken is Dazah's too) support this kind of use in the real world?

I know DW has a lot of members but seemingly only a tiny handful of them are active, many are novices and I don't see any companies being represented.

In this arena you'll be up against LinkedIn, Xing, Salesforce; plus the countless companies that build on their APIs. They all have massive databases full of high quality customer and client record and sell b2b services on top.

Tldr; you might have the expertise but you need the data to back it up.

pty 882 Posting Pro

SSH with keys is the way to go. Written and vetted by cryptography experts, battle tested, hugely widespread and supported by all modern deployment mechanisms.

Rolling your own encryption routine can be fun, but it probably won't be that secure.

pty 882 Posting Pro

Ah, one of my posts is editable and one isn't.

Screen_Shot_2018-04-26_at_09_43_11.png

The difference is that the first was made on my phone and the second on a computer.

If there was a bug tracker I'd raise one.

pty 882 Posting Pro

The fact this post hasn't just been deleted is a bad sign. Burn it with fire.

Reverend Jim commented: Kind of leaves a bad taste in your eyes, doesn't it? +15
pty 882 Posting Pro

It is none of those things. Amazon have lots of servers, in some cases it's easier/cheaper/more-reliable to use theirs than have your own.

If you don't know the difference between Hadoop and Apache HTTPD, you don't need Hadoop.

pty 882 Posting Pro

Change the id of one of the inputs, perhaps?

pty 882 Posting Pro

How are your networks connected together? Are you using a site-to-site VPN?

rproffitt commented: VPN and such has you change LAN IPs when this happens. Done all the time. Except for very new networkers. +15
pty 882 Posting Pro

And the reason your code wasn't working is that you were calling include?on a string and passing an array. Both string and array have an include? method, string's only accepts strings but array's accepts any object.

I'd add an example but I'm typing on my phone

rproffitt commented: +1 for effort. On a phone too. +15
pty 882 Posting Pro

As John suggests, array intersection will work. If you don't need to know what clashes, this might be faster due to any? stopping as soon as it's fulfilled.

colours = %w{red green blue orange}
targets = %w{yellow black pink red blue}
colours.any? {|colour| targets.include? colour}
pty 882 Posting Pro

Yes. Run the website on your local machine and then take a screenshot, and upload that to your host. Then, people can see your AMAZING CONTENT but won't be able to get at your precious, hand-crafted, artisanal, rolled-on-a-virgin's thigh HTML.

An alternative would be to write your website using Adobe Flash. It's capable of making not only beautiful, easily-navigable sites that are accesisible to people with all kinds of disabilities, but you can embed games and funny noises RIGHT IN THE PAGE. I mean, who doesn't want a trumpet sound when they're clicking links?

rproffitt commented: Seriously funny. Toot toot. +15
pty 882 Posting Pro

The week selector is based on ISO8601, and Monday was decided as the first day of the week.

You would need to use a custom widget to customise that. Alternatively, use two inputs, one with the year and one with numbers 1-52. But where possible, I try to stick to standards.

Templating is definitely the way to go for dynamic sections, don't try to build HTML manually with jury or similar. Simplicity is key.

Jon_7 commented: OK, I'm gonna figure this out and post back here when I have it officially solved. Thx a ton! +0
pty 882 Posting Pro

but how can I add HTML instead of the 1-word you used for each day?

Yes, you can add whatever you like. If you structure your data something like this, you can easily use a simple templating library to insert any HTML you like

    let data = {
        "2018-W12": {
            "Monday": {
                exercise: "Squats",
                reps: 50,
                intensity: "medium",
            },
            "Tuesday": {
                exercise: "Pressups",
                reps: 30,
                intensity: "hard",
            }

        }      
    };

Also noticed the 2018 references in the javascript

I did this for speed. You could write it by hand, or easily programatically generate a schedule for the next several years, or you could write some code that generates them on the fly. Without knowing your plans for creating the exercise schedule it's difficult to say, but providing your data is well-structured it's not that difficult.

Jon_7 commented: Wow, I've never even seen that templating thing before. I'm gonna play with that a ton. Thx! +0
pty 882 Posting Pro

Perhaps I didn't fully understand what you're after, but I'd steer clear of using plugins when you can use standard inputs.

Here's a five minute stab at what I think you're asking for. If it's not it should be easy to customise. Where I've defined let data = {...} you should be reading that from your data (or API) and not hardcoding it in the function!

Oh, and I've only added data for W12 2018 and W13 2018 so it'll throw errors for other weeks. You'd have to revert to a default schedule or handle the error sensibly.

ryantroop commented: pretty nifty +9
Jon_7 commented: That's very close, but how can I add HTML instead of the 1-word you used for each day? Also wondering how I can get the week to start on Sunday . Thx +1
pty 882 Posting Pro

https://www.ampproject.org/

Based on your prior record Davy, I think it will take you 98 forum questions and 14 pastings of random code you find on the internet to solve it.

rproffitt commented: (☞゚∀゚)☞ +15
pty 882 Posting Pro

Writing code like this is nuts.

Why is everything (logic, presentation) jumbled up in one file? Why is your //insert the user into the database. comment immediately followed by an update statement?

I'm not going to solve your problem (or maybe homework question) for you. But the actual actions should be in a controller and your template should be in a, well, template.

class Blah::Create

  before_filter :check_officer

  def new
    # insert a Blah, I have no idea what a permohonan is
  end

  private

  def check_officer
    # is the current user an officer?
  end

end

class Blah::Modify

  before_filter :check_admin

  def update(id)
    # update Blah with value id
  end

  private

  def check_admin
    # is the current user an admin?
  end

end
pty 882 Posting Pro

Nice try @dida_1 but this thread nine years old. Maybe you should just do your own homework?

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

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

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

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

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

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

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

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