|
PowerPC is fine
|
# ? Jun 29, 2019 08:30 |
|
|
# ? May 30, 2024 18:48 |
|
Suspicious Dish posted:PowerPC is fine except for r0
|
# ? Jun 29, 2019 11:20 |
|
There are 10,000 accounts each of which are "up" or "down" on any given day, and I have charts of potential uptimes and definite downtimes. For example, maybe account 7 is up between days 3 and 6 and between 12 and 18 except for 13-15 and 17-17 (so it was actually only up on 3,4,5,6,12,16,18). I want to extract info like "how many accounts were up on day 5?" I think I can write some ugly code to get at this, but is there a right way to do this sort of thing? (Ideally in Excel but I'll take whatever) dirby fucked around with this message at 17:20 on Jun 30, 2019 |
# ? Jun 30, 2019 17:17 |
|
How you solve this depends a lot on how you store the data. The easiest way is just to keep a record of the state of each account on each day, in which case it's just a simple SQL query.
|
# ? Jun 30, 2019 17:27 |
|
ultrafilter posted:How you solve this depends a lot on how you store the data. The easiest way is just to keep a record of the state of each account on each day, in which case it's just a simple SQL query. Thanks. Can I easily build an SQL-queryable database from the tables I have? Maybe with Microsoft Access or something? I'm imagining something like filling in the ranges (so "3-6" becomes "3,4,5,6"), deleting the down days up from the up lists, and then magically turning those lists of days into a database (which I haven't really worked with before, but I think the queries I'd want would be simple in SQL)
|
# ? Jun 30, 2019 17:33 |
|
What format is the data in now, exactly?
|
# ? Jun 30, 2019 17:43 |
|
mystes posted:What format is the data in now, exactly? I have two csvs with three columns each: a column of account number, a column of the first date of a range, and a column of the last date of the range. One csv is for the potential up days and the other is for the down days. Account numbers are often repeated if there are multiple ranges for that account. I think I could easily (outside of excel) make a single sheet with uneven rows like "account number, first up date, second up date, third up date,..." for making a database. Edit: Mathematica's Dataset command might be able to get me the database I want. dirby fucked around with this message at 18:18 on Jun 30, 2019 |
# ? Jun 30, 2019 17:57 |
|
I guess some sort of elegent solution would use interval trees or something, but the laziest/easiest way would be to just go through each id and use an array or hashmap of bools to represent up or down for each day, which you update based on both files and then use to obtain the information you need.
|
# ? Jun 30, 2019 18:48 |
|
e: wrong thread
|
# ? Jun 30, 2019 19:59 |
|
I'd just chuck it into an sql database that supports range types - it's a very natural modelling of your existing data, and then your queries are very simple "count the number of users where there's at least one up period containing the day of interest, and no down periods".
|
# ? Jun 30, 2019 20:34 |
|
Games with crafting and harvesting involve picking up or otherwise harvesting raw materials (eg iron ore, leather straps, wood), transforming them into intermediate materials zero or more times (iron ore + wood in furnace = iron ingots), and transforming those into final products (iron ore + leather straps + blacksmiths tools = iron sword). The economy allows the player to sell materials from any of these steps, but each step of refinement adds additional value (eg iron ore = $1, wood = $1, iron ingots = $5, 2 ore + 1 wood = 1 ingot, $2 is "created" in refinement). Ignoring for now (but worth discussing later) the cost in time, equipment, and other sunk costs, I want to determine what the most efficient item to make is, so that I can grind it endlessly and mercilessly, crushing the game economy in charcoal dildos or whatever it ends up being. Does this type of problem have it's own name? Once the costs in time and sunk costs come in, or in the case of materials which don't have direct $$$ values, how does the calculus change?
|
# ? Jul 4, 2019 00:21 |
|
Production Possibility Curve? Like it's a legit problem that folks in meatspace have, you might want to check economics sources instead of CS. It's like that econ problem where Country A is better at making both kinds of widgets but it still makes sense for Country B to make them. I normally solve them by opening up a spreadsheet, starting to build up columns of time/money and boiling things down to see how they're most efficient, then chucking the whole thing because iron's boring to farm anyway.
|
# ? Jul 4, 2019 00:36 |
|
Volmarias posted:Games with crafting and harvesting involve picking up or otherwise harvesting raw materials (eg iron ore, leather straps, wood), transforming them into intermediate materials zero or more times (iron ore + wood in furnace = iron ingots), and transforming those into final products (iron ore + leather straps + blacksmiths tools = iron sword). The economy allows the player to sell materials from any of these steps, but each step of refinement adds additional value (eg iron ore = $1, wood = $1, iron ingots = $5, 2 ore + 1 wood = 1 ingot, $2 is "created" in refinement). If you ignore the constraint that you have to make an integer amount of each item, this is a bog-standard linear program.
|
# ? Jul 4, 2019 01:00 |
|
If you're selling to other players, you have to worry about price/demand curves and there's a bunch of economics work you should look at. If you're just selling to vendors, or if you're certain that the player economy is large enough to absorb your additional supply without affecting prices, then it's much simpler:
rjmccall fucked around with this message at 01:28 on Jul 4, 2019 |
# ? Jul 4, 2019 01:23 |
|
rjmccall posted:If you're selling to other players, you have to worry about price/demand curves and there's a bunch of economics work you should look at. Thanks everyone who responded. This is indeed just for vendors, and I suspect I can adapt the farming cost to the other sunk costs in production equipment I have to make for widgets, so this is likely to be my easiest answer.
|
# ? Jul 4, 2019 03:05 |
|
Also what rjmcall is describing is an ILP optimization problem, which is NP complete. You can also use an LP relaxation, assuming you don't mind slight inefficiencies because it assumes infinite divisibility (or you are making so many widgets it gets lost in the noise).
|
# ? Jul 4, 2019 08:38 |
|
Volmarias posted:Thanks everyone who responded. This is indeed just for vendors, and I suspect I can adapt the farming cost to the other sunk costs in production equipment I have to make for widgets, so this is likely to be my easiest answer. If you use ILP formulation, you can also properly represent the cost of tools for making widgets... e.g. if you have a tool T1 that can be used to make 100 widgets W1, you could say that the cost of making a single W1 is the cost of T1/100, but that leads to inefficiencies. Instead, you should subtract cost of T1*T1 from your optimization function, and add a constraint that says W1 <= 100*T1. This constraint ensures that you have bought at least enough tools to make the widgets, while the optimization function forces you to buy at most enough tools to make the widgets. Similarly you can account for tooling that does not get used up at all, but you still need to buy it. This however gets a bit more hairy, as you usually need to select a "big enough" constant.
|
# ? Jul 4, 2019 09:24 |
|
What I described can be memoized to a simple linear algorithm if you assume that the required components are an unambiguous tree. It might become NP-complete if you allow buying intermediate components, though.
|
# ? Jul 4, 2019 18:48 |
|
Also worth noting that just being np-complete doesn't automatically make it intractable, if your problem is small then you can just try every possible combination in a reasonable amount of time.
|
# ? Jul 4, 2019 19:34 |
|
Or just use a reasonably modern ILP solver that can tear through huge problems in a blink.
|
# ? Jul 4, 2019 20:28 |
|
I’m not sure I believe that this would be NP-complete even if you allow buying intermediate products, though. Seems like it has an obvious subproblem structure where you can find the farm-optimal way to produce any particular component and that remains optimal no matter what the other components are. That’s assuming you (1) are maximizing profit/farm as farm scales to infinity, instead of minimizing the cost of a single item, and (2) ignoring interactions between farming rates (e.g. because darkblood iron and crimsonheart planks are both farmed in the Vampyrsache Fallowfields), but both of those seem reasonable.
|
# ? Jul 4, 2019 21:13 |
|
2) seems like a hell of an assumption if you want to maximize exploitation rate.
|
# ? Jul 4, 2019 22:01 |
|
Maybe, but honestly even “node frequency” is pushing the limits of what’s precisely knowable for something like an MMO; demanding comprehensive cross-tabs seems unrealistic. Remember that the real goal here is just to get a better-informed idea of what things are more efficient to farm for, and maybe to identify outliers; OP can still look at the list on their own and see obvious things like “this requires a million things from an area that’s not actually safe for me to be in” or “this thing that’s supposedly 4% less efficient should actually be faster because I can farm everything in one place”, and it’s a lot easier to make that kind of judgment after the fact than to build it into the model.
|
# ? Jul 5, 2019 03:30 |
|
Patch notes 1.222.33: Randomized darkblood iron drop rates to gently caress that ork in the fallowfields with the fancy excel spreadsheet.
|
# ? Jul 5, 2019 19:52 |
|
Out of wonder, are there any good guides for web stuff or even non-web networking stuff focused towards experienced programmers who know very little/nothing about web? I'm interested in learning more just for personal enrichment, but I'm constantly caught between the world of tutorials either being framework tutorials for career web developers who may want to switch to a new paradigm or language on one hand, and people who have never heard of a for loop on the other. The latter could be okay, but I tend to glaze over with how slow they are, and they usually hide way too many details for me to adequately understand what's going on since they're paced in a way that knows they're introducing a lot of new concepts to newbie programmers by introducing programming and web simultaneously. Normally I like the "jump in and fiddle around" method of learning stuff, but web and networking has a lot of stuff attached to it where it's really hard for me to get started because there's a whole stack involved. I've managed to figure out super basic networking stuff from time to time, but anything more complex than piping structured data in a format I control over a LAN/static IP connection I get lost. And even there sometimes I get lost with like... handling failure/out of order packets/lost packets/ack messages and so on. I really just want something that's like "you understand programming logic and technical specifications, I trust you to read documentation -- here's the basics of how networking, HTTP requests, web APIs, and such work with examples. This is when you should use websockets, this is when you should use raw TCP/UDP and how to handle the finnicky bits of each. Here are some options for storing data. Here are some current best practices no matter what paradigm you're using. Here are some available modern frameworks and the pros/cons of each, I recommend this one because xyz." I'm not a complete beginner, I have some decade out of date background in like... OSI layers and subnet masking and stuff, as well as a little experience with piping stuff over a network (mostly for IPC sort of stuff) like I said above. As well as just some common acquired knowledge. But starting as if I've never heard of anything more complex than an IP address is fine, especially since a lot has almost certainly changed.
|
# ? Jul 5, 2019 22:10 |
|
Linear Zoetrope posted:Out of wonder, are there any good guides for web stuff or even non-web networking stuff focused towards experienced programmers who know very little/nothing about web? I'm interested in learning more just for personal enrichment, but I'm constantly caught between the world of tutorials either being framework tutorials for career web developers who may want to switch to a new paradigm or language on one hand, and people who have never heard of a for loop on the other. The latter could be okay, but I tend to glaze over with how slow they are, and they usually hide way too many details for me to adequately understand what's going on since they're paced in a way that knows they're introducing a lot of new concepts to newbie programmers by introducing programming and web simultaneously. This might sound stupid, but I think it helped me a lot back in the day: Write a toy HTTP server. It's not terribly difficult and it will help you wrap your head around a lot of this poo poo.
|
# ? Jul 6, 2019 00:06 |
|
rjmccall posted:Maybe, but honestly even “node frequency” is pushing the limits of what’s precisely knowable for something like an MMO; demanding comprehensive cross-tabs seems unrealistic. Interesting, back when I was still playing Lineage 2, you could pull up a nice graphic map with spawn locations, rates and drops of all mobs, and even the comparatively casual players (e.g. me) somewhat optimized their farming using those Anyway I think we provided OP enough options with differing levels of exactness that they can pick from.
|
# ? Jul 6, 2019 08:44 |
|
Hi. I'm fairly comfortable with c/c++. I recently bought a couple of msp430 dev boards. what's a good resource to learn how to program for the msp430? for example, here's the blinkey program for one of the boards: msp-exp430g2et blinkey posted:#include <msp430.h>
|
# ? Jul 7, 2019 00:03 |
|
Faith For Two posted:Hi. I'm fairly comfortable with c/c++.
|
# ? Jul 7, 2019 01:49 |
|
Faith For Two posted:what's a good resource to learn why I need to stop the watchdog timer at the beginning of the program, how to set-up the peripheral devices I want to use in my program (in this case, setting up one of the gpio pins), and anything else I might need to know to understand how to do anything? Also unless you have a specific need for very low power draw, or just want to fart around with extremely limited hardware for the challenge of it, I would recommend pretty much any other microcontroller over the MSP430. A few years ago I had some fun getting one to read and play back audio from sdcard with its limited 512bytes of total memory (SD reads 2048 bytes at a time...), and actually managed to make it play two samples at the same time in a really hacky way(quality was poo poo, and there was a little bit of stuttering when both were playing).
|
# ? Jul 7, 2019 04:02 |
|
This book might be worth checking out: https://www.elsevier.com/books/msp430-microcontroller-basics/davies/978-0-7506-8276-3 As for the watchdog timer, some microcontrollers have it on by default and others don't. The MSP430 has it on by default so unless you disable it or reset the timer periodically, your system will reset after the limit has been reached.
|
# ? Jul 8, 2019 06:39 |
|
I'm trying to do a programming puzzle, looking for some tips. There are n buttons spread evenly in a straight line. I need to figure out the best order(s) of pressing the buttons in a way that sequentially pressed buttons are as far away from each other as possible. More specifically, I need to determine all possible orders of pressing the buttons for both of the following criteria: 1) The sum of distances between sequentially pressed buttons is maximized (the distance between button 1 and button 3 is abs(1-3)) 2) The minimum distance between sequentially pressed buttons is maximized The highest minimum distance criterion seems to be very simple with an even amount of buttons - there should only be 2 best sequences and I know how to generate them. I'm not really sure about a way of generating the sequences with an uneven n, though, and I don't have a good idea of how to generate sequences for the first criterion either. It's easy to bruteforce all the sequences with low n values, I can just generate all possible button press orders and check at each one if it's better/as good as the previous best match for either criterion. But of course, this becomes very slow very quickly as n grows, and I basically need to keep calculating the sequences with constantly increasing values for n. Are there any obvious algorithms for doing this sort of thing more efficiently? Edit: Adding my bruteforce solution output for more clarity, this is an example where n==5: code:
sunaurus fucked around with this message at 08:57 on Jul 8, 2019 |
# ? Jul 8, 2019 08:52 |
|
For an odd-length sequence: What's the largest possible minimum value? Which element do you know for sure will have a jump that size? For the maximum sum problem: If you have an optimal solution to, say, the 3-element case, does that help you find an optimal solution to the 4-element case? Can you generalize this further?
|
# ? Jul 8, 2019 09:02 |
|
Thanks for the help! I'm not sure if I understood you completely, but I think I'm making progressJabor posted:For the maximum sum problem: If you have an optimal solution to, say, the 3-element case, does that help you find an optimal solution to the 4-element case? Can you generalize this further? I think I can find the maximum sum for n buttons if I know the maximum sum for n-1 buttons, is that what you meant? My current idea for using this is to find all optimal pair distances (integer arrays of length n-1 that add up to the maximum sum - I'm sure I knew an algorithm for this some years ago when I was still in uni), and then use these pair distances to start generating button press orders (by just starting at every button and adding/subtracting every distance that I found in the first step to get to the next button). I'm guessing this will be much faster than just checking all possible button press orders individually, because with this solution, I can bail out of a branch as soon as an order becomes invalid, but it still feels quite inefficient. Jabor posted:For an odd-length sequence: What's the largest possible minimum value? Which element do you know for sure will have a jump that size? I know how to get the largest possible minimum value, but I'm not sure what you mean by the second question. But I'm thinking I can probably generate potential pair distances by starting with an array of length n-1 where each element is the known largest minimum value, and then adding +1 to each element in this array to get more potential arrays of distances, until I reach arrays that add up to a sum which exceeds the known maximum sum. Then I can use these arrays of pair distances to generate sequences in the same way as I described above for the maximum distance sum case. I feel like I'm still probably not at a good solution, so I'll keep working on improvements, any further tips are still welcome. Also, apologies if my solution descriptions were confusing, English is not my first language. sunaurus fucked around with this message at 14:11 on Jul 8, 2019 |
# ? Jul 8, 2019 13:59 |
|
This is the sort of problem where working it out on paper can be more effective than diving straight into code. So. Draw out the optimal solution(s) for four points. Draw out the optimal solutions for three points. Compare them, visually. See if you can figure out a way to go from the optimal solutions for three points to the optimal solutions for 4 points. Then repeat that with 5 points, 6 points, etc. until you've come up with a way that generalizes to n points. -- The other question might be served by a more explicit example, too. What's the largest possible minimum value for a line of buttons 345820945 items long? Once you know that number, can you think of any points that are particularly constrained in what other points they can connect to?
|
# ? Jul 8, 2019 14:42 |
|
This is a long shot and not exactly general programming, but this seems like my best shot: The company I work for currently uses the edge compute resources now in CDNs to manage a security solution. In CloudFront, that's Lambda@Edge, Cloudflare Workers, etc. We've now got a customer that wants to do a similar integration, but with Alicloud/Aliyun. I've been diving through their offerings, but though they have a serverless Lambda analogue, there doesn't seem to be anything that's a Lambda@Edge equivalent. Does anyone know if there is something that I'm missing?
|
# ? Jul 8, 2019 20:03 |
|
I don't have an answer, but it might be worth cross-posting in the cloud giant thread: https://forums.somethingawful.com/showthread.php?threadid=3791735
|
# ? Jul 8, 2019 20:23 |
|
How should I work around a slow-loading fonts.googleapi on my django app's CSS? I didn't make any changes, and the problem happens when I run on localhost or the server. I don't see anything about outages either. Is there some workaround everyone uses that I don't know about?
|
# ? Jul 8, 2019 22:10 |
|
Host the font files yourself?
|
# ? Jul 8, 2019 22:13 |
|
|
# ? May 30, 2024 18:48 |
|
How do I do speech synthesis on Windows with C++? I just want to use the built-in speech synthesis. This uses Azure which is a paid service, and is overkill: https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/quickstart-text-to-speech-cpp-windows This example works, but the code is so old that it doesn't compile if I try to use it in my project because of deprecated code. It doesn't seem to use whatever the modern convention is: https://code.msdn.microsoft.com/windowsdesktop/C-Text-Speaker-37905ac5/sourcecode?fileId=45137&pathId=2037806931 To elaborate, it uses a header called <sphelper.h> which uses deprecated code. There is a thing called System::Speech::Synthesis but this is only C# as far as I can tell https://docs.microsoft.com/en-us/dotnet/api/system.speech.synthesis?view=netframework-4.8 There is a library called flite https://github.com/festvox/flite but I'm not sure I'll be able to even get it to build on Windows because it has an old crusty visual studio project file that doesn't work. I literally just want a thing so I can do: speaker.speak( "fartz" ); baby puzzle fucked around with this message at 17:34 on Jul 9, 2019 |
# ? Jul 9, 2019 16:52 |