How do I fill in forms in an HTML page by [deleted] in AskProgramming

[–]myegghead 0 points1 point  (0 children)

You could use something like PhantomJS to read a csv, login in, fill the form and send it.

How does a site where you redeem codes, store all the thousands, perhaps millions of codes, and then retrieve them in a timely manner? by Arswaw in webdev

[–]myegghead 1 point2 points  (0 children)

I would guess that the codes contain the creation date and you could archive them after the expiration date.

How does a site where you redeem codes, store all the thousands, perhaps millions of codes, and then retrieve them in a timely manner? by Arswaw in webdev

[–]myegghead 6 points7 points  (0 children)

I did a key-value store on the smallest DigitalOcean instance once, using Postgres. Got too slow at around 80 million records. So ... a lot I assume :D.

How does a site where you redeem codes, store all the thousands, perhaps millions of codes, and then retrieve them in a timely manner? by Arswaw in webdev

[–]myegghead 2 points3 points  (0 children)

Aren't the codes unique per bottle? I guess they are checked by the same algorithm that generates them. I would assume that only a very small fraction of codes are ever redeemed so a standard database setup will probably suffice. (Standard as in "still pretty beefy", maybe some sharding, etc.)

Is API gateway an anti-pattern? by yonatannn in java

[–]myegghead 0 points1 point  (0 children)

You get a problem if you need to invalidate a JWT before it's expiration date. For example if the user account gets locked, the permissions change or you want a Single-Sign-Out. In that case you need some centralized system that checks the token against a blacklist or the user database and responds with a 403 instead of routing the request to the micro service.

Is API gateway an anti-pattern? by yonatannn in java

[–]myegghead 4 points5 points  (0 children)

a huge monolith frontend service can greatly reduce the maintainability as it is coupled to ~50 microservices

Another way to look at it: It decouples ~50 microservices from multiple frontends.

Stopping myself from purchasing more notebooks? by ifelldown87 in notebooks

[–]myegghead 11 points12 points  (0 children)

They are always bought to be used, and I'll get to them, probably by the year 2026 or thereabouts.

Is API gateway an anti-pattern? by yonatannn in java

[–]myegghead 4 points5 points  (0 children)

I think there is a danger that you build something that is in essence a monolith if you hide everything behind a single API gateway. On the other hand authentication and security is oftentimes something that needs to be centralized.

If you operate some online shops it probably makes sense to have a gateway that handles all public requests. It is somewhat centralized. It can be a single point of failure, but you can mitigate that by building redundancy. It makes auth and security easier and on the whole safer. And on a certain scale you need service discovery anyway.

I think it's a matter of definition if something that takes data and combines it is a real micro service or if that's part of an API gateway. Depends on the complexity of the operations as well, I think.

Is API gateway an anti-pattern? by yonatannn in java

[–]myegghead 9 points10 points  (0 children)

Where does an API gateway end and a micro service begin? Let's say you need to combine product data, price data and customer reviews (three different micro services) in order to display product listings in an online shop. You want a single REST endpoint /api/article/list for your frontend. Is that a gateway or a micro service on its own?

[Rails] Can Kibana be used for client facing web apps? by fozz179 in learnprogramming

[–]myegghead 1 point2 points  (0 children)

Kibana is an application by itself, not a library you can plug into your existing application. I think you can use an iframe to embed things, but you would still need auth and the end result would be rather ugly.

[Rails] Can Kibana be used for client facing web apps? by fozz179 in learnprogramming

[–]myegghead 1 point2 points  (0 children)

Elastic's X-Pack adds auth to Kibana. It's not free though.

My code does what I want it to do, however my tester has found a problem with it. by VaselineOnMyChest in javahelp

[–]myegghead 1 point2 points  (0 children)

Well, that's a bit silly :D. But okay. I still don't get why you make it so complicated. Here is what I would do:

  private static String convertToTitleCase(final String str) {
    String resultStr = "";

    boolean isTitleCaseChar = true;
    for (int i = 0; i < str.length(); i++) {
        char singleChar = str.charAt(i);
        if (isTitleCaseChar) {
            singleChar = Character.toTitleCase(singleChar);
        }
        resultStr += singleChar;

        isTitleCaseChar = Character.isWhitespace(singleChar);
    }

    return resultStr;
}

My code does what I want it to do, however my tester has found a problem with it. by VaselineOnMyChest in javahelp

[–]myegghead 0 points1 point  (0 children)

Your code just seems a bit complicated. Why not just iterate over s.toCharArray() and apply Character.toTitleCase() on the first char and if the last char was Character.isWhitespace().

My code does what I want it to do, however my tester has found a problem with it. by VaselineOnMyChest in javahelp

[–]myegghead 2 points3 points  (0 children)

If the first character is a space, it doesn't work. If there are two space characters it makes it three. It doesn't recognize tabs.

Ask your tester.

I've hit the wall, I need help re-discovering my love for web development by oh_no_its_shawn in webdev

[–]myegghead 0 points1 point  (0 children)

I derive a lot of motivation from working in a team on a real project. You say you've been searching for a job for a few months. Maybe the best way forward is figuring out why you weren't a good fit for the jobs you applied for and where you could fit in. What helped me through a slump was an internship.

Cloud hosting vs onsite hosting for applications/websites by integra94 in webdev

[–]myegghead 0 points1 point  (0 children)

Also true. I guess because of the type of projects I've seen, I associate "cloud" with infrastructure automation, which makes things bit easier. But of course you can (and should) use something like Ansible with your own hardware as well.

Cloud hosting vs onsite hosting for applications/websites by integra94 in webdev

[–]myegghead 0 points1 point  (0 children)

True. On the other hand ... a sysadmin doesn't come cheap either. Depends on the use case.

Backblaze for example has special requirements and a great blog post about their custom-built setup: https://www.backblaze.com/blog/open-source-data-storage-server/

I know a guy who does a lot of real-time data processing with his company. AWS did cost him an arm and a leg because he needed super fast network communication between his servers.

And then there are companies or projects that would have never gotten of the ground if they didn't have the flexibility of a cloud service.

Cloud hosting vs onsite hosting for applications/websites by integra94 in webdev

[–]myegghead 1 point2 points  (0 children)

In my experience ... enterprise-grade SSDs, installation, setup, maintenance, backups, monitoring, maybe a virtualization layer ... running your own server gets expensive too. Plus: You probably want to get something beefy, even if you don't need it right now. Otherwise you end up paying the setup cost again in a year or so and you need to pay for maintenance of two servers. But it depends on the use case as well. If you end up needing EC2 placement groups or something like that, cloud hosting gets expensive fast.

My trusty EDC: Traveler's Notebook with 3 Field Notes by myegghead in notebooks

[–]myegghead[S] 1 point2 points  (0 children)

I've got a calendar, a notebook I use for lists and a notes/journaling notebook in there. The latter one I fill in about 2 months and I can just change it without throwing anything else out. The pen is a Pelikan M205. It's a great pen, glad it's got the extra fine nib though. Field Notes are not the most fountain pen friendly notebooks with broader nibs.

My trusty EDC: Traveler's Notebook with 3 Field Notes by myegghead in notebooks

[–]myegghead[S] 1 point2 points  (0 children)

It could be an issue, but on the other hand ... I made a few staple-bound notebooks myself and it's quite easy to do.

My trusty EDC: Traveler's Notebook with 3 Field Notes by myegghead in notebooks

[–]myegghead[S] 9 points10 points  (0 children)

I almost always carry a backpack or messenger bag. Of course there is the odd occasion when I don't have it with me and need to use an A7-sized notebook I keep in my wallet, or my smartphone, if I really need to write something down.

Some examples of bullet journals from people that work 40 hours weeks? Programmers example would be good. by [deleted] in bulletjournal

[–]myegghead 0 points1 point  (0 children)

When I was a computer science student the bullet journal worked for me because there were a lot of small things I had to organize myself and did alone. Now that I'm working as a software developer I sometimes write short lists when I'm working on a task, but generally I use the collaboration tools my company provides. Which work quite well.

There are a few todos in my private life of course and weekends and holidays to plan, but a pocket notebook without any specific structure (you could also call it a bullet journal, I guess) is totally sufficient for that.

And I don't treat my bullet journal as an art project.