|
Thermopyle posted:I don't really know where to ask this... You can use CGI with bash to do this. You’ll have to parse the query string which is available as $QUERY_STRING. I highly recommend not doing this unless you understand the risks involved and are ok with them, but it is basically what you’re asking for.
|
# ? Dec 24, 2019 01:47 |
|
|
# ? May 31, 2024 02:41 |
|
Yeah, I know how to securely-as-possible roll my own it just seems like something someone would've wrote a wrapper for already. In fact, I won't even roll my own as I'll do this another way if there's not a pre-built solution out there. I was really looking for something like...magiccommandserver ls that would start a HTTP server that would run ls with whatever arguments and return the results. Volmarias posted:It's been a while since we've seen a hand rolled arbitrary execution exploit being made It'd be neat to see someone exploit this thing running on a raspberry pi running off of a solar panel and battery in the middle of the woods with no internet connection. Thermopyle fucked around with this message at 03:08 on Dec 24, 2019 |
# ? Dec 24, 2019 03:06 |
|
Thermopyle posted:Yeah, I know how to securely-as-possible roll my own it just seems like something someone would've wrote a wrapper for already. PHP code:
Bash code:
|
# ? Dec 24, 2019 07:19 |
|
Cross posting this - what fields use computational photography? The obvious would be camera companies (Nikon, Canon), phone manufacturers (LG, etc.) , and robotics. Are there other fields to look at?
|
# ? Dec 24, 2019 16:39 |
|
The Fool posted:
So I’ve taken it upon myself to create a program to automate the administration of a betting game my friends and I play. Currently it’s basically a full time job for 1 or 2 administrators for ~20 participants for 3 hours or so, and imo can be easily automated. Here’s the concept: - The whole game lasts some number of rounds (say 25, but variable), and each bettor can choose 2 options for each round (say 0 and 1). An administrator will control when voting is open or closed. Scores are tracked and displayed in real time to the administrator. - The players will use their phone or some other browser capable device to access a website hosted on a local server at my house. They’ll be given unique user names and passwords to login to ensure there are no mixups. The user interface will have the following items: -- A header displaying the current round, and whether voting is open or closed, and what their current vote is -- 2 buttons to vote for one option or the other (buttons labeled 0 and 1, say) -- Some autovote toggle that allows the player to automatically vote for one option until turned off, to allow people to walk away to smoke/bathroom without entirely removing themselves from the game - There will also be an administrator on a device that will control the rounds (I’ll be admin for the foreseeable future, will use a laptop as my interface) -- The admin screen will also have a header displaying the current round, and whether voting is open or closed (for control) -- 2 buttons, a “voting open”, and “voting closed” button -- When the “voting open” button is pressed (IE the round ends, and a winner is determined), the admin is prompted to enter whether 0 or 1 won -- The running scoreboard/table -- Maybe some tools to make manual edits if necessary? Like restart round, go back a round, or maybe just have the running scoreboard/table stored as an excel file that can be edited on the fly or something. This is the bit I’m least certain of what will be necessary and I’ll probably build the admin toolset during testing I guess Conceptually the program is pretty simple, but I lack any knowledge/experience building something that will be interacted with in a multi-user environment/local network so that’s what I’m not really sure about. For background, I’m a mechanical engineering student, I’m on a co-op where I’ve been building automation tools using VB/VBA. In high school (10 years ago) I took CS/CEng every year, did a lot in Java, Perl, C/C++, other languages and could probably pick them up again fairly easily. I remember using HTML and CSS to do some stuff when I had built an HTPC/usenet setup 5-6 years ago for my exwife, but it was mostly copy-paste type poo poo so I didn’t learn too much. I can mostly visualize the program build in my head using VB (probably because it’s all I use these days), but I doubt that’s the best tool for the job. I have googled around a bit but just figured I’d come and try to tap the goon resource for tips/advice/resources before I set out on my own. Thanks.
|
# ? Dec 24, 2019 16:53 |
|
huhu posted:Cross posting this - what fields use computational photography? The obvious would be camera companies (Nikon, Canon), phone manufacturers (LG, etc.) , and robotics. Are there other fields to look at?
|
# ? Dec 24, 2019 16:53 |
|
mystes posted:You really mean computational photography specifically and not computer vision? Isn't computer vision just an application of computational photography?
|
# ? Dec 24, 2019 16:59 |
|
huhu posted:Isn't computer vision just an application of computational photography?
|
# ? Dec 24, 2019 17:06 |
|
hot cocoa on the couch posted:So I’ve taken it upon myself to create a program to automate the administration of a betting game my friends and I play. Currently it’s basically a full time job for 1 or 2 administrators for ~20 participants for 3 hours or so, and imo can be easily automated. This is something that any web framework made in the last 15 years can handle without breaking a sweat. If you're not sure which one to pick, I'd start with Django. I'm confident it has everything you need, including well-written documentation. For serving 20 people on a local network, you can use the built-in development server and stick with SQLite and you'll be more than fine. And Django's admin tool will give you a huge head start in setting up the "manual intervention" bits. I think there's a python thread around here where you could get a hand with Django stuff, or this thread works too.
|
# ? Dec 24, 2019 17:29 |
|
I guess then I'm interested in anything relating to the intersection and surrounding disciplines of photography, image processing, and programming.
|
# ? Dec 24, 2019 17:29 |
|
So uh... What's a monad? Or is this Worth Its Own Thesis?
Dominoes fucked around with this message at 18:25 on Dec 24, 2019 |
# ? Dec 24, 2019 18:22 |
|
Dominoes posted:So uh... What's a monad? A burrito
|
# ? Dec 24, 2019 18:24 |
|
Dominoes posted:So uh... What's a monad? Or is this Worth Its Own Thesis?
|
# ? Dec 24, 2019 19:33 |
|
Dominoes posted:So uh... What's a monad? Or is this Worth Its Own Thesis? Simplified bad answer: Basically, it's a higher level type like "maybe" that can be used to create types like "maybe int" or "maybe butt", and it comes with a set of functions to do things like finagle using a "maybe int" with a function that just wants a normal int, so (fake syntax) map(square, maybe 2) produces "maybe 4" and map(square, none) produces none.
|
# ? Dec 24, 2019 19:43 |
|
None of the metaphors are good. You really have to just mess around with it and understand what bind means in different monads for it to click. Also, trying to understand the significance of the difference between monads and functors is good.
|
# ? Dec 24, 2019 19:47 |
|
monads are just the starting point on a long and nuanced journey though functional programming's 500,000 unique and subtly different mathematical objects. strap in.
|
# ? Dec 25, 2019 01:15 |
|
I use one-line loop sugar and partial evaluation, and don't inherit data structures; isn't that enough?
|
# ? Dec 25, 2019 01:47 |
|
redleader posted:monads are just the starting point on a long and nuanced journey though functional programming's 500,000 unique and subtly different mathematical objects. strap in. Diagrams like https://github.com/JordanMartinez/purescript-jordans-reference/blob/latestRelease/41-Ecosystem/Type-Classes/Type-Class-Relationships.svg have a ton.
|
# ? Dec 25, 2019 03:23 |
dirby posted:Diagrams like https://github.com/JordanMartinez/purescript-jordans-reference/blob/latestRelease/41-Ecosystem/Type-Classes/Type-Class-Relationships.svg have a ton. As far as I can tell from the legend on the right, every single type named on that diagram has usage frequency "Rarely". Good to know.
|
|
# ? Dec 25, 2019 12:53 |
|
If you want a serious answer, read the first three sections ("Functor," "Applicative" and "Monad") of this: https://wiki.haskell.org/Typeclassopedia
|
# ? Dec 25, 2019 16:11 |
|
Monad seems like it's basically just a way for you to use optionals but having functions know how to handle empty optionals themselves instead of you having to wrote a lot of if empty and or else statements everywhere
|
# ? Dec 25, 2019 19:28 |
|
The MUMPSorceress posted:Monad seems like it's basically just a way for you to use optionals but having functions know how to handle empty optionals themselves instead of you having to wrote a lot of if empty and or else statements everywhere Await may actually be the clearest example since it's literally just bind (well ignoring implementation details depending on the language).
|
# ? Dec 25, 2019 19:51 |
|
Is there a good shuffle algorithm I can use in a declarative/functional language? Basically my problem is that lists/vectors are immutable so any single element "swap" (like in Fisher-Yates) requires building a whole new sequence.
|
# ? Dec 25, 2019 21:59 |
|
Haskell Wiki has a Random shuffle article. There's an O(n) algorithm that uses I/O and a purely functional algorithm that's O(n log(n)). The I/O based algorithm might be Haskell specific but the other one should be more portable.
|
# ? Dec 25, 2019 22:02 |
|
The best way to do it from a performance perspective is to have mutable state that's created, used, and discarded inside your shuffle function, and still provide a strongly functional interface to anything interacting with that code. Most mature functional implementations should have a way to use mutable state internal to a function, without violating any functional guarantees.
|
# ? Dec 25, 2019 22:18 |
|
Jabor posted:The best way to do it from a performance perspective is to have mutable state that's created, used, and discarded inside your shuffle function, and still provide a strongly functional interface to anything interacting with that code.
|
# ? Dec 26, 2019 18:15 |
|
Hey dudes. Do you think it would be feasible to make a browser plugin that selectively filters out content that includes, or rewords manipulative phrases, exaggerations etc? Or warn you if a page contains too many? This feels so obvious; I'm surprised I haven't heard of it. The Internet's filled with trash; or, maybe I'm enjoying Neal Stephenson's new book too much. Do you think social media etc companies would be amenable to allowing users to specify what types of ads they prefer? Seems like a win-win. Despite all FB etc should know about you, the ads are (anecdotally) 95+% awful/irrelevant. What if we just made public a profile they could use to show good ads? I'm missing something, or this would already be a popular thing. Dominoes fucked around with this message at 06:58 on Dec 27, 2019 |
# ? Dec 27, 2019 05:57 |
|
"Sorry, nobody wants to see your ads." " Okay, but what if we paid you even more money to show our ads to unwilling users?" "loving sold, my friend." As for your first request, judging tone online is uh not easy.
|
# ? Dec 27, 2019 06:07 |
|
Dominoes posted:Hey dudes. Do you think it would be feasible to make a browser plugin that selectively filters out content that includes, or rewords manipulative phrases, exaggerations etc? Or warn you if a page contains too many? This just feels so obvious I'm surprised I haven't heard of this. The Internet's filled with trash; or, maybe I'm enjoying Neal Stephenson's new book too much. 1) That sounds quite hard, especially in maintaining the semantics behind the content, if you even want to do that. Now, do it quickly, and also for free. 2) The vast majority of people are either going to block all of the ads, or block none of them. Technically you can tell some of the ad companies what kind of ads you actually want, but that's a crap shoot and pretty much only exists as a fig leaf of self regulation.
|
# ? Dec 27, 2019 06:09 |
|
TooMuchAbstraction posted:"Sorry, nobody wants to see your ads." " Okay, but what if we paid you even more money to show our ads to unwilling users?" "loving sold, my friend." quote:As for your first request, judging tone online is uh not easy. Volmarias posted:1) That sounds quite hard, especially in maintaining the semantics behind the content, if you even want to do that. Now, do it quickly, and also for free. Overall, I'm worried (like first pt above) people don't really know what they want. Ie I find myself clicking crappy articles and, on some level enjoying them, ie when I'm bored and subconsciously looking for a distraction.
|
# ? Dec 27, 2019 06:54 |
|
Dominoes posted:Hey dudes. Do you think it would be feasible to make a browser plugin that selectively filters out content that includes, or rewords manipulative phrases, exaggerations etc? Or warn you if a page contains too many? https://chrome.google.com/webstore/detail/cloud-to-butt-plus/apmlngnhgbnjpajelfkmabhkfapgnoai?hl=en Not sure how much more complicated you want to get, but it seems like it's at least a start. That is, it shows you can reword stuff programmatically. The hard part is getting it to recognize what you think is manipulative/exaggerative, and how to reword it so it's not. Kilson fucked around with this message at 08:21 on Dec 27, 2019 |
# ? Dec 27, 2019 08:17 |
|
peepsalot posted:Is there a good shuffle algorithm I can use in a declarative/functional language? Basically my problem is that lists/vectors are immutable so any single element "swap" (like in Fisher-Yates) requires building a whole new sequence. If you have a built in sort function you can simply convert each list element a to a tuple of this list element and a random nr and then sort on this random nr. For example in elixir: shuffled_list = Enum.map(input_list, fn a -> (a, Enum.random(1..n)) end) |> Enum.sort_by(fn (_,r) -> r end) |> Enum.map(fn (a,_) -> a end)
|
# ? Dec 27, 2019 12:02 |
|
Dominoes posted:I'm worried about that. There implication is that people will buy things from ads they think they don't like, or that incentive to push ads anyway wouldn't work. The deal breaker may be that what people think they want doesn't line up with what they actually buy. There are impression ads like car ads, where the goal isn't to click through for immediate conversion but to put things in your mind for when you do. There's also "CLICK HERE TO CUM INSTANTLY" ads where 99.9% of people will be turned off but that 0.1% who click through will spend $100 and make it worthwhile Showing you garbage advertising still makes financial sense. quote:
The number of people who use ad blockers is still a relative minority, and advertisers handle this by paying ad blockers to let a few through and by collecting analytics to sell data on the backend. People indeed don't know what they want but right now the market rewards eyeballs over meaningful interaction, hence outrageous headlines, click bait, and recipe websites that tell you the author's life story before you can get to the recipe.
|
# ? Dec 27, 2019 15:51 |
|
Dominoes posted:A hard problem, but not impossible to get somewhere on. There are still a lot of PhD theses to be written on figuring out the tone of a post. There is progress, but it's really not clear that what we have now is better than nothing at all.
|
# ? Dec 27, 2019 22:04 |
|
Walh Hara posted:If you have a built in sort function you can simply convert each list element a to a tuple of this list element and a random nr and then sort on this random nr.
|
# ? Dec 28, 2019 08:25 |
|
Graphic designer here, hired to do web design, so I have likely broken plenty of rules. I'll apologize for that up front. Currently, my site works great on desktop browsers, but when it comes to mobile chrome, it won't calculate the viewport width correctly. I'm getting 1/5 of the screen on the right side that looks like body padding. No idea what's happening here, and googling at the problem is just getting me warnings to not use 100vh (which I'm currently doing as well, but I'll fix that next) site is here: http://enrightdesignfoundry.com/dcindex.html Any ideas would be a huge help. I'm sure I did something obviously flawed to cause this issue, but I'm not experienced enough to understand what it is, and brute force changing poo poo has gotten me nowhere. Edit - Forgot to mention, the error can be replicated on desktop chrome by going into mobile mode on the inspector. JesusDoesVegas fucked around with this message at 23:34 on Dec 29, 2019 |
# ? Dec 29, 2019 23:31 |
|
JesusDoesVegas posted:Graphic designer here, hired to do web design, so I have likely broken plenty of rules. I'll apologize for that up front. Currently, my site works great on desktop browsers, but when it comes to mobile chrome, it won't calculate the viewport width correctly. I'm getting 1/5 of the screen on the right side that looks like body padding. No idea what's happening here, and googling at the problem is just getting me warnings to not use 100vh (which I'm currently doing as well, but I'll fix that next) https://stackoverflow.com/questions/30358630/html-body-not-filling-complete-width-on-mobile-devices
|
# ? Dec 29, 2019 23:56 |
|
I'm making my own GIF decoder and it works fine except... It adds an extra pixel at the edge of every block. The image data is LZW compressed and stored in variable-length data blocks (usually 255 until the last one). The actual LZW codes are also variable length but here they're always 9 bits. What happens is that I read the blue code without problems. Then the green code gets is interrupted by the block length indicator (or so I think), but I read 0xFF as part of the code: And this would add an extra pixel basically which shouldn't be there. The problem is that if I do anything else, the LZW decoder breaks. If I toss the incomplete code and start over in the next block, it breaks. If I skip over the 0xFF byte and continue as usual, it breaks (I get code values which shouldn't exist). Maybe the bug is elsewhere, but any idea what is the correct behavior? I've read some documentation and descriptions but it's not super clear.
|
# ? Dec 30, 2019 16:05 |
|
The LZW-compressed data is a byte stream which is broken down into a stream of length-prefixed blocks of bytes. Codes can cross block boundaries. The block length byte is not part of the data stream.
|
# ? Dec 30, 2019 18:20 |
|
|
# ? May 31, 2024 02:41 |
|
huhu posted:https://stackoverflow.com/questions/30358630/html-body-not-filling-complete-width-on-mobile-devices This looks like it may be my issue. Thanks for the help! EDIT - Ok, so this worked, and definitely helped. I think my real problem is that I somehow broke my container div, and that was causing the browser to not really know where things go. I doubt anyone reads these threads for info, but if anyone has this problem, maybe that can help. JesusDoesVegas fucked around with this message at 23:02 on Dec 30, 2019 |
# ? Dec 30, 2019 19:20 |