0

He's clearly not tried anything Shark_1, it's just a homework question he's pasted.

Giving him the answer will encourage this kind of behaviour in the future and further pollute our industry with qualified idiots. Not giving him the answer pollutes the forum with shitposts.

The only sensible thing to do is just delete these posts, but for some reason that doesn't happen. That's why StackOverflow has taken over.

1

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.

0

Inbetween contracts over the last year or so I have been beavering away building a CMS with a difference. https://www.graphia.co.uk/

It's aimed at companies that have huge libraries of documents that every employee needs (operating procedures, handbooks, guides, etc) locked away in inflexible propriatory formats (aka Sharepoint/Confluence).

  • documents are stored in plain text (Markdown) files
  • the 'database' is a Git repository (but end-users needn't know!)
  • authors can work online using the web editor (but power users can clone the repo and work in whichever editor they like)
  • the documentation is 'published' to a static site, the theme can be customised (using CSS and HTML templates) by the company to match their styleguide

So, why am I posting here? Well, I can no longer see the wood for the trees. To the uninitiated, am I making sense? Is the website nonsense?

Please let me know, any feedback is welcome.

0

So you want a number in the web page to increment when a backend operation takes place? To do this 'on the fly' would require you to implement server-sent events or write something custom with websockets, which might be a little advanced for you at the moment.

I'd suggest creating a new endpoint in your backend that returns the correct number that you can poll for. So your web page, every few seconds, would ask the backend for the new number and display it. The response should look something like this {"operation_count": 34}.

Then you have two independent bits of functionality that you can test in isolation.

With regards to your progress bar, just use the standard element.

1

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?

Votes + Comments
Seriously funny. Toot toot.
1

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.

Votes + Comments
OK, I'm gonna figure this out and post back here when I have it officially solved. Thx a ton!
1

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.

Votes + Comments
Wow, I've never even seen that templating thing before. I'm gonna play with that a ton. Thx!
2

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.

Votes + Comments
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
pretty nifty
1

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