|
Protocol7 posted:It doesn’t return anything for any of the files I’ve been given or generated. Unfortunately that will probably be much more annoying to mess with than a device running linux or something. mystes fucked around with this message at 17:11 on Feb 29, 2020 |
# ? Feb 29, 2020 17:09 |
|
|
# ? May 30, 2024 10:47 |
|
I didn't see a specific docker thread offhand, but I have a question that google is failing me on. I have a flask app, it runs fine, and I have it in docker with Traefik, and it's protected by a whitelist, since it lives on a stack that technically is open on 443. I'd like to use Traefik/Docker to protect it with authentication. I setup digest auth, and all that, so I have a local list of usernames/passwords that I can use, but I was curious if there's a docker container that is a simple auth provider, so I could use traefik's forwardauth middleware and use API keys instead of usernames/passwords since it's mostly automated services that hit my API.
|
# ? Feb 29, 2020 19:44 |
|
TraderStav posted:Is it when a car will fall through the ice and everyone in town bets on it? This post made me very happy, it was like a decade ago since I read the book but it is on tv now?
|
# ? Feb 29, 2020 22:38 |
|
Keetron posted:This post made me very happy, it was like a decade ago since I read the book but it is on tv now? It was, not great but still worth a watch. If you haven't listened to the audiobook I HIGHLY recommend that as the narrator is top notch. I still get chills thinking about the numerous times he mentions life turning on a dime. I've listened to that book 3 times over the years, such a great slice of Tales from Americana mixed with apocalyptic time travel. Sorry for the derail... The book is 11/22/63 by Stephen King by the way
|
# ? Feb 29, 2020 22:48 |
|
I am looking for a way to code or script (or if an app exists I guess) a way to find out the last time files were modified in folders. The purpose is to try to generate a listing of what folders are no longer actively being used and can probably be archived. I didn't see a powershell thread which I assume can do this relatively simply but I have really just started with it. I am able to get the modified time of the folder but I don't think that is the same thing as the last modified of the contents.
|
# ? Mar 1, 2020 00:46 |
|
Powershell thread is here: https://forums.somethingawful.com/showthread.php?threadid=3286440
|
# ? Mar 1, 2020 19:30 |
|
Quick CSS/HTML question, a div's border appears to be always rendered "inside" its area, is there a way to center the border line on the boundary of the div? I.e. if i have a 10px border, 5px of the line should be inside the div's area and 5px should be outside.
|
# ? Mar 2, 2020 17:37 |
Use the outline property.
|
|
# ? Mar 2, 2020 17:46 |
|
Plank Walker posted:Quick CSS/HTML question, a div's border appears to be always rendered "inside" its area, is there a way to center the border line on the boundary of the div? I.e. if i have a 10px border, 5px of the line should be inside the div's area and 5px should be outside. Use a border and outline? code:
|
# ? Mar 2, 2020 17:47 |
|
Plank Walker posted:Quick CSS/HTML question, a div's border appears to be always rendered "inside" its area, is there a way to center the border line on the boundary of the div? I.e. if i have a 10px border, 5px of the line should be inside the div's area and 5px should be outside. half in border, half in outline efb
|
# ? Mar 2, 2020 17:47 |
|
Thanks for the triple replies haha. Hate to change the question after getting answers but, I sort of lied when I said I wanted a 10px line, and instead need a 1px line and apparently half pixels don't exist. I'll probably end up just using 1px outline since it looks better.
|
# ? Mar 2, 2020 17:54 |
|
You can still use outlines, they have an offset property. https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset Might see if an offset of -1px or -0.5px does what you need. Not sure if values that small are visible without a high-PPI display though.
|
# ? Mar 2, 2020 19:18 |
|
Protocol7 posted:I put the file through r2 and it seemed like it was all good machine code. 2) What is bad machine code, duude Really there ought to be some data sections that look like really weird code. A bunch of ADD instructions doing the same thing repeatedly. Bad opcodes or otherwise nonsensical sequences.
|
# ? Mar 2, 2020 19:29 |
|
JawnV6 posted:1) It.. shouldn't? I mean there are those, but I found functions that look like they do substantial things as well when I ran them through the r2dec decompiler. I found this Medium article and it was helpful since it uses a similar MCU. https://medium.com/techmaker/reverse-engineering-stm32-firmware-578d53e79b3 Using the same tools and steps I get similar looking results, but I do admit I'm a complete noob in this area. Ultimately we're just trying to replace a hardcoded IP/domain name so that this device connects to our own server instead of the manufacturer's very lovely, unreliable server.
|
# ? Mar 2, 2020 19:40 |
|
CampingCarl posted:I am looking for a way to code or script (or if an app exists I guess) a way to find out the last time files were modified in folders. The purpose is to try to generate a listing of what folders are no longer actively being used and can probably be archived. I wanted to speculate that there are already utilities for this, but couldn't get TreeSize to very clearly do it, so I was staying silent for any tricks that might get you around having to code it out.
|
# ? Mar 2, 2020 21:18 |
|
Anyone recommend a particular good intro to learning parsing expression grammars (PEG)? Hoping for some web tutorials etc over a full fledged book.
|
# ? Mar 3, 2020 18:57 |
|
I'm looking for experiences people have had with using Entity-Component-Subsystem and similarly decoupled patterns. I'm particularly curious how they managed sequential and temporal problems with stuff having to be ordered linearly or hierarchically. I'm looking at this for a context outside of gamedev where I don't really have to tick these subsystems every frame, but I get other problems in exchange.peepsalot posted:Anyone recommend a particular good intro to learning parsing expression grammars (PEG)? Hoping for some web tutorials etc over a full fledged book. I feel bad you were left hanging with this. My take from the silence is nobody has a good tutorial for general syntax for this. I went down this road a little under a year ago and just mangled around with ANTLR4. That is, learning by doing. I think any particular tool is going to have its own quirks so you might as well not look for PEGs in general but how to write grammars using this or that. If you have even the faintest handle on recursion then you shouldn't have any problem with writing rules like "a statement is stuff followed by possibly more statements." (Chances are that people will now respond with the parsing tools of their own preference and you'll find more luck from that than a general grammar.) The grammar for a calculator is going to be the "simplest non-trivial" case you'll find, but you probably want to parse multiple lines. There are various toy projects for that. If your goal is to outright parse and existing language, then there's a nice GitHub project that has ANTLR grammars for various languages. For what I'm doing with Python stuff, I wound up using this one. It has a lot of crap for lexing a space-delimited language. On the other hand, the rules match the syntax of the grammatical rules in Python's own spec.
|
# ? Mar 6, 2020 21:59 |
|
Rocko Bonaparte posted:I'm looking for experiences people have had with using Entity-Component-Subsystem and similarly decoupled patterns. I'm particularly curious how they managed sequential and temporal problems with stuff having to be ordered linearly or hierarchically. I'm looking at this for a context outside of gamedev where I don't really have to tick these subsystems every frame, but I get other problems in exchange. Try AOL keyword "struct of arrays"
|
# ? Mar 7, 2020 00:06 |
|
leper khan posted:Try AOL keyword "struct of arrays" I know this is why people push for ECS in game engines, but I'm not looking at game engines or even a situation where performance is a major problem. I particularly wound up in a situation where composition was a good data model for something, but turning that into an object implementing each section as interfaces wasn't necessarily looking good. So I wound up with an entity-component kind of thing, and it just happens that ECS is how I see it come up any more. Some of the stuff in that data model represents data that matters during common pre-check, initialization, setup, or cleanup phases. I was generally wondering how the code working on those components (the subsystems) are separated and ordered by the framework in a variety of situations. At the end of the day, I'm trying to conclude how much of a pain it is to maintain something like this--it's probably too much of a pain--using a really synthetic prototype. Edit: And this is a Rocko doing work thing and not a Rocko's annoying science project thing, if that matters.
|
# ? Mar 7, 2020 00:58 |
|
I have sort of a complex question... I just started a new job a month and a half ago. The software is still pretty young, 2 years old maybe - we're just starting developing an API. At a very high level, the problem is that a lot of tables in the database have a UserID that does not allow nulls. But now we need to start exposing stuff for the API, where they won't have a UserID to pass and we're having a hard time trying to figure out how to 'correctly' modify the tables / the architecture for the software to be able to handle requests "internally" or "externally"? If anyone has advice or knows of some relevant reading materials I'd appreciate it
|
# ? Mar 7, 2020 13:13 |
|
Why won't your API server have a UserID to pass? Surely you're not planning on exposing your database tables directly?
|
# ? Mar 7, 2020 13:21 |
|
They'll provide an API key, but that's stored differently. Like we've got an API Key table, a User Table, and for example say a Bill of Materials which requires UserID as a foreign key, and that's kinda enforced all through the ORM the application uses I suspect I'm not explaining it accurately though =x
|
# ? Mar 7, 2020 14:17 |
|
The obvious solution is just to creature a UserID for everyone who uses your api and has been given an api key, and keep that mapping in the same place you keep known api keys.
|
# ? Mar 7, 2020 14:32 |
|
Thought about that, but my boss doesn't love the idea security implications of creating however many users behind the scenes. I also suggested creating a singular API User that would also be hidden, but that got shot down too Maybe I'll try suggesting it again on Monday lol
|
# ? Mar 7, 2020 15:28 |
|
To be clear are you saying everyone who has an API Key doesn't have a user ID already? Typically, your key belongs to a user and then your views look up the user based on the API key...
|
# ? Mar 7, 2020 16:46 |
|
I think the current "vision" is that there will be a single user who can grant unlimited number of API keys and give them to whoever they please. It's enterprise software, not like a "public" service if that makes a difference. So we log who creates the key, yes, but it's not guaranteed that the person using the key is the person who generated it.
|
# ? Mar 7, 2020 16:50 |
|
peepsalot posted:Anyone recommend a particular good intro to learning parsing expression grammars (PEG)? Hoping for some web tutorials etc over a full fledged book. I learned them by loving around with LPEG, the Lua PEG library. However, this was back in 2007-2008ish when PEGs were still quite new, and also I was already using Lua at the time; if you aren't there may be better choices. Rocko Bonaparte posted:Some of the stuff in that data model represents data that matters during common pre-check, initialization, setup, or cleanup phases. I was generally wondering how the code working on those components (the subsystems) are separated and ordered by the framework in a variety of situations. At the end of the day, I'm trying to conclude how much of a pain it is to maintain something like this--it's probably too much of a pain--using a really synthetic prototype. In my experience -- which is mostly hobbyist and entirely game-oriented, so take that for what it's worth -- there's two main approaches to this: - have a top-level runSystems() that runs every tick and invokes each system in turn; if necessary it can be made smart enough to skip systems that only need to run every second rather than every frame or whatever - have each system declare up front what other systems it needs to wait for, what component data it reads and writes, and under what circumstances it can skipped, and then organize the systems into a graph (at compile or startup time, typically) based on that and invoke them in an order that satisfies the dependency graph; this has the advantage that since systems declare all their data dependencies you can automatically invoke systems in parallel when it's safe to do so, at the cost of being considerable more complicated
|
# ? Mar 7, 2020 17:51 |
|
ToxicFrog posted:- have a top-level runSystems() that runs every tick and invokes each system in turn; if necessary it can be made smart enough to skip systems that only need to run every second rather than every frame or whatever Ahh thanks. I had a notion of using a graph for that kind of thing but it was definitely a "let's stop and think about this" kind of moment. Some of the sequential stuff as very specific phases so I was thinking of either having the subsystems report their phase or have the subsystem API have call-ins for each phase or whatever. I haven't gotten that far yet. The whole thing might be too much for casual use but I think I'll be able to at least demo it with a bunch of stuff printing things to a log.
|
# ? Mar 7, 2020 19:03 |
|
The goal of ECS and data-oriented programming is performance.
|
# ? Mar 7, 2020 19:28 |
|
Suspicious Dish posted:The goal of ECS and data-oriented programming is performance. Do you know of other means of composition that mate well with a pretty flexible input configuration format? Real question here. The only real other thing I can think of is dynamically building objects out of interfaces for each section, and I don't know how that would turn out better.
|
# ? Mar 7, 2020 19:41 |
|
Write some code for it. That's why they hired you, after all.
|
# ? Mar 7, 2020 21:02 |
|
Suspicious Dish posted:Write some code for it. That's why they hired you, after all. Okay I know I'm driving people nuts, but I literally have nobody I can talk to or think out loud with about this stuff, and the rubber duck doesn't answer these kinds of questions, so I just ask it here. If the answer to asking questions like this in this thread is to just go off and write code then so be it, but I think that's setting a bad example even if you're fed up with me. Is there a better thread for the design/abstraction/hippy stuff? The reason I explored an ECS kind of thing in the first place was based more on what I remember seeing in a Game Programming Gems book a long time ago that composition like this helps avoid inheritance diamond-of-death situations where you get something that's X and Y but not Z, and lot of the inputs have situations like that. So the subsystem part getting dragged in is to just stick with how people talk about it these days.
|
# ? Mar 7, 2020 21:14 |
|
quote:composition like this helps avoid inheritance diamond-of-death situations
|
# ? Mar 7, 2020 23:43 |
|
dirby posted:I may be misreading the context, but it might be helpful to just google "Composition over Inheritance" and your language of choice. I'm generally just looking for any shared experiences working with and designing frameworks with a heavy bend towards composition. If I were to then get specific, I'm looking for any experiences with dealing with timing dependencies after distributing an architecture that way. I consider that to be a big tradeoff with it and I figure there would be some war stories or something.
|
# ? Mar 8, 2020 00:54 |
|
Composition over inheritance is cool and good but you don’t have to use ECS to get the benefits. It’s too heavy of a design pattern if you don’t need the performance benefits imho.
|
# ? Mar 8, 2020 00:58 |
|
Rocko Bonaparte posted:The reason I explored an ECS kind of thing in the first place was based more on what I remember seeing in a Game Programming Gems book a long time ago that composition like this helps avoid inheritance diamond-of-death situations where you get something that's X and Y but not Z, and lot of the inputs have situations like that. So the subsystem part getting dragged in is to just stick with how people talk about it these days. That's entity-component modelling, a related-but-adjacent term to data-oriented programming and ECS describing an older architecture. But it's all confused these days and when I tried to search for entity-component modelling I got a bunch of people saying calling it ECS so maybe I'm the wrong one. Unity's GameObject is Entity-Component Modelling Unity's Burst system is Entity-Component-System
|
# ? Mar 8, 2020 01:05 |
|
Google even wants to autocomplete "entity component" as "entity component system." It's very prolific now. Something like a decade ago when I first delved into any notion of the concept, Google was more like "what the gently caress are these moonbeams?!"
|
# ? Mar 8, 2020 01:15 |
|
Bit twiddling question. Is there a trick to expand 4 bits into 4 bytes quickly? For example: binary 1111 -> 00000001 00000001 00000001 00000001 binary 1010 -> 00000001 00000000 00000001 00000000 Since there are only 16 possible inputs a lookup table is the obvious solution and that's what I have. But I'd like to get rid of it to keep the code size low since this is on a microcontroller.
|
# ? Mar 11, 2020 14:43 |
32 bit register size? Best I can think of is something like (x << 21 | x << 14 | x << 7 | x) & 0x01010101 If you don't have 32 bit registers you're probably stuck with a loop shifting one bit left or right at a time and setting one output byte based on current bit.
|
|
# ? Mar 11, 2020 15:03 |
|
|
# ? May 30, 2024 10:47 |
|
It depends on your cpu (eg Intel BMI2 extensions on allow for this as a single instruction). Most likely on embedded this doesn't exist Quickest is probably your lookup table (would need to benchmark though) , smallest would just be calculating it:code:
|
# ? Mar 11, 2020 15:12 |