/tech/ - Technology and Computing

Technology, computing, and related topics (like anime)

Build Back Better

More updates on the way. -r

Max message length: 6144

Drag files to upload or
click here to select them

Maximum 5 files / Maximum size: 20.00 MB

More

(used to delete files and postings)


Daily(or whatever) Programming Thread Anonymous 08/21/2019 (Wed) 14:47:20 No.8 [Reply] [Last]
What are you working on? Wether you just want to show off your shiny new program, or you need help with a programming issues, this is the thread for you!
211 posts and 53 images omitted.
>>2985 if you want a simple formula for diminishing returns with a given maximum, it's: power = max_power*turbine_count/(turbine_count-1+max_power/power_per_turbine) (you can check for yourself that with 0 turbines you get power=0, with 1 turbine it's power=power_per_turbine and with infinite turbines it's power=max_power) if you get multiple types of turbines hooked up to the same system, you can calculate an average power_per_turbine. that way it doesn't matter in which order you have your turbines or whether you have 2 normal turbines vs 1 good one and 1 awful one, but having 2 turbines with a power_per_turbine of 30 is slightly better than 3 turbines of 20.
>>2988 >you can check for yourself that with 0 turbines you get power=0 Nope, when self.power_per_turbine is 0 and/or self.turbine_count is 0 I get "ZeroDivisionError: division by zero". >with 1 turbine it's power=power_per_turbine Yes as excepted >and with infinite turbines it's power=max_power How are infinite turbines represented programmatically wise? I'm not sure if Python is capable of calling "Inf" amount of objects. Current script: https://0bin.net/paste/iTHqnMlJE3rUoZ5S#HgHcQ9Uknt7FmBGlzsS2BuUgBS9m6EMyYhlHV2ROPgg With self.max_power = 100000000 Results (Without a turbine_count condition): Power: 4,850,000.0 --- Turbine: 1 Power: 9,251,311.397234144 --- Turbine: 2 Power: 13,263,445.761166818 --- Turbine: 3 Power: 16,935,835.87952859 --- Turbine: 4

Message too long. Click here to view full text.

>>2989 >Nope, when self.power_per_turbine is 0 Sure, but you've got a really shitty turbine if its designed power rating is 0. :^) Indeed, in practice you need to first check if the power per turbine is valid or by proxy whether there's any turbines, otherwise the formula doesn't make sense. >it causes power output fluctuation when I increase/decrease self.max_power despite the power output is not reaching that limit yet, is that intentional? Yes, because the formula is a simple smooth line. Last time I made an interactive graph to shed some light on the formula, but geogebra requires registration to share it so I left it at that. So here's the setup in desmos: https://www.desmos.com/calculator/v4l49zrkst If you make the power per turbine very small, like p=100 000, you'll see that the effective power grows nearly linearly with more reactors and barely changes when you slide the max power around. But the larger the power per turbine is, the more you'll see the total output fluctuate with a change in the max power, even with only 2 turbines. And the more you'll see that extra turbines have diminishing returns.
I'm just beginning a book called C++ Crash Course by Josh Lospinoso, from No Starch Press. In the preface of the book, he addresses benefits from C++ that C-only developers can take advantage of if they compile their C code with a C++ compiler. Here's an approach that allows C code to use C++'s RAII idiom, and it won't leak the file handle in case something external to the code breaks (like the disk space is exhausted for example). // demo of a SuperC file class, pp55-56 #include <cstdio> #include <cstring> #include <system_error> struct File { File(const char* path, bool write) { auto file_mode = write ? "w" : "r"; file_ptr = fopen(path, file_mode); if (! file_ptr) throw std::system_error{errno, std::system_category()}; } ~File() { fclose(file_ptr); }

Message too long. Click here to view full text.

Open file (644.04 KB 656x749 scientist.png)
>>2990 >Sure, but you've got a really shitty turbine if its designed power rating is 0. :^) It will happen when the steam temperature is less than 100°C caused by lack of fuel or lack of water input (to produce steam off from). >nearly being done with refactoring my turbine and reaktor object >hook them up to my main program which contains the structure object >I have to deal with 2 major bugs now >one is that the reaktor for some reason doesn't produce any steam due to lack of water input despite I make a function call to do so >the other bug is that turbine receives only on certain condition steam and has odd behavior depending how much steam is inputted Oh man this is going to take ages debugging this shit.

Open file (22.32 KB 640x480 StackMachine0.01.2.png)
Homebrew and Hardware Faggotry Anonymous 08/26/2019 (Mon) 18:30:24 No.40 [Reply]
I figured we can have a thread for hrdware shit. I'm planning out a homebrew CPU. This is my proposed microarchitechture. I've posted it on every other fucking imageboard. I might as well post it here. It's a pretty simple stack machine. I'll be making it from 74LS series TTL logic. I plan to use two 74LS181 for the ALU. The data bus will be 8 bit's, but the adressing will all be 16 bit so I can get a whopping 64k of ram for program memory and the stacks.

Also general thread for hardware and electronics projects.
>>40 Very nice, I'm also looking into CPU design. Even for a One Instruction Set Computer (OISC) based on SUBLEQ, you still need things like cache, peripherals etc. for the design to work sufficiently well. Of course you need a compiler/assembler too XD
>>40 >I'm planning out a homebrew CPU Then I'd recommend you check out Ben Eater's videos first OP. >>>/robowaifu/1554

The Python Pill Anonymous 04/27/2020 (Mon) 17:46:30 No.2720 [Reply]
I'm having mixed feelings about this language. I've been recently tasked to write a project using it and part of me is really happy about how relaxing it is to code with it, that is to say, how braindead most of its functionalities are and how easy it is to just grab a module from someone else, try it, find out they forgot some very important functionality, just add it in post and use it as you please. On the other hand, it's staggeringly heavy duty unless you're going for GPU processing and some design choices are just counter intuitive (why is there no Switch case? who thought that having different parts of code be separated by indenting them would have been a good idea?) - so I'm left asking you guys: 1) Is it worth it learning expansively over other languages? 2) What are your thoughts on its features? 3) Some neat modules you've found?
7 posts omitted.
>>2726 >I think you can create working executables with it. With external and unofficial tools, not natively afaik. No official support is a big deal when money is involved, you can't simply go "teehee we can't deploy the new code because some guy on github no longer maintains his py2exe tool, whoopsie".
>>2720 I hate Python packages. Disgusting virtual envs.
1. Learn it for computer vision or machine learning. Other than that it's a lazy alternative for writing native applications, but performance is going to suffer. 2. The reference and scoping semantics are both about as backwards as you'd expect for a scripting language, deploying python programs is a pain in the ass, and its async/await system is poorly implemented compared to its contemporaries. It also has most of your typical dynamic typing pitfalls in terms of maintainability, although it doesn't suffer from php and javascript's type coercion problems. It does typically manage to be fairly concise, although this is due in large part to library design, but it's nice to have regardless. 3. pyopencl is pleasant to work with, although I would generally recommend writing a native library containing your opencl code instead.
>>2720 >2) What are your thoughts on its features? It tries to make everything easy by having a simple syntax that is leaving out many things you'd see in other languages. Like curlybraces. But that makes python actually much harder to read because everything looks the same.
I am not sure if I should like Python. Some of the pro's I can think of is the pretty strong standard library. Also the data structures are very simple to use. Also there are very easy libraries for every task I can imagine (flask, tensorflow, pandas, opencv, mongodb, ...) But to be honest, most of the times being "pythonic" feels like messy code. The thought of having multiple classes in one file is not my favorite choice. Also the missing type safety, missing interfaces, structs,... makes it difficult for me. I head learnt most of my clean code and clean architecture skills from Uncle Bob. And Python seems to work against the code style I learnt.

API's and Bindings thread Anonymous 07/16/2020 (Thu) 01:22:40 No.3001 [Reply]
Holy shit, I just started using Lua 5.3's C api and it's so much cleaner than the 5.1 api I was using before. It makes it so easy to build out metatables for all the types that you're trying to bind. the luaL_checkX functions are a godsend too, it's a real breath of fresh air coming from certain other scripting languages. I think the SLOC I needed for binding easily went down at least 20% using this new interface. It's still got some warts like the lua_tolstring caveats, and the weird proxies and function metamethods for getters and setters, but I think it's a big improvement. ITT Talk about binding things to other languages. Do any api's stand out to you as particularly clean, effective or clever?
>>3001 I know very little about this topic, but I have a C++ program I'm working on that I'd like to provide a reduced & simplistic Python API for so users can script the most basic parts. ATM I'm assuming the Boost library for this would be a reasonable choice, though I haven't yet reached the stage where I'll need to do serious investigation and prototyping for it.
Guile's bindings are nice. Even withing C you can do very lispy things with it. It has a problem in which the "context" is implicit and pretty much invisible, so you can't use it as-is but you have to pass a function pointer to a function which initialized the context; when your function is called, you can use Guile's API however you want, until your function terminates. Under normal cirumstances it wouldn't be too much of a hassle, but I'm using it in a program with a lot of asynchronous operations, so I ended up writing a function which is called when the asynchronous task is executed, which calls the function to temporarily intialize the Guile context (for various reasons I can't keep the whole program in Guile mode all the time) so that the Guile API can be used. In the worst case the callback chain can reach more than three functions just to iterate over a list.

Jewtube WOn't support Palememe no moe Anonymous 02/04/2020 (Tue) 23:20:18 No.1483 [Reply] [Last]
FUCK JEWTUBE FUCK THEM Discuss
109 posts and 13 images omitted.
>>2954 Yeah, I have the same issues. >>2956 >straw-viewer First time I've heard of it. Seems like they use the invidious API, so wouldn't it have the same breakage problem?
>>2972 Try it out. It is light
>>2973 Yeah I'm testing it out now. Seems slick, like a better, terminal-based version of freetube. Very nice.
>>2975 Good to know. There is a catch, video are streamed from jewgle servers directly, not proxied via invidious.
Open file (303.53 KB 1000x978 sdafsfa.png)
>>2976 Invidous doesn't proxy video streams by default. I think it's an option instance owners can enable, but it will be disabled for all public instances because of the bandwidth requirements.

Open file (62.87 KB 560x377 cell_phone_functions.png)
New Jersey Style Anonymous 10/07/2019 (Mon) 14:33:51 No.434 [Reply]
What would it take for New Jersey/"Worse is better" style to make a comeback?

I feel like everything has gone downhill since phones made the MIT approach win out.
>>434
I think once the power grid goes down, your answer will be clear anon.
>>434
Worse is better is why everything sucks.
>>434
For someone to hax themselves into the glownigger mainframe and send rm -rf / via ssh to all Intel management engine/AMD PSP/other botnet-equipped devices connected to the Internet with execution set at a fixed future date to ensure maximum coverage.
>>434
>phones are used as toothbrushes even moreso than as electric drills in the future.
heh
Open file (28.45 KB 480x360 zhqdefault.jpg)
>What would it take for New Jersey/"Worse is better" style to make a comeback? It has never went away. Woke retards appeal to this bullshit every day and have since the beginning of computing. And now they turbo appeal to it with the absolute garbage that is "golang". The entire existence of webshit and electron is just an episode of worse is better. Smartphones literally run linux what the fuck are you even talking about. DAY OF THE SEAL SOON

Open file (14.76 KB 474x474 tux.jpg)
Anonymous 06/08/2020 (Mon) 05:31:45 No.2944 [Reply]
>can't tell anyone that bill gates is a cunt any more because they'll think i'm a niggerlicious gullible Qoomer who doesn't understand primary sources
>>2944 This post is bad, and you should feel bad.

Anonymous 05/30/2020 (Sat) 15:27:45 No.2886 [Reply]
How long does it take for a noob like me who can barely code a christmas tree in java to become an 3l1+3 1337 hax0r?
14 posts and 6 images omitted.
>>2936 You renounced my highlight of “talent”. What kind of “talent” did you possess that the Java college taker does not have, that got you hired in the first places. For a “white man”, I don't see you making hiring opportunities to drive the market into the Donald E. Knuth way. The way you phrased this response compared to >>2928 alludes you're still a slave monkey, and not playing in the real open market of computer sciences. Where's your venture capital (((white man)))?
>>2937 but he is right, you know..
Open file (167.07 KB 800x800 4.jpg)
I wanted to make a proper post instead of ADHD shit liek >>2938 >>2916 Java is still worth learning because there is a lot of code written in it (so there also jobs) Java is also better choice than C# simply because Java still has better ecosystem of free and open-sores tools and libraries when compared to C# and the JVM is actually good platform (there are other languages that use the JVM such as Kotlin and Clojure) Knowing Java and the JVM also opens up the opportunity to learn Android app development as well (well, C# has Xamarin but idk if it's any good) >>2935 >>2937 are you implying that knowing about algorithms is not worth it? or are you implying you shouldn't do something that you enjoy? I actually started hating programming because of college classes. I has been two years and now I am finally starting to get into programming again. >>2928 has the right idea. you should also remember to work on projects that you actually enjoy. otherwise you are likely going to burnout and drop out (which happened to me)
>>2939 Good points Anon. And yes, there are still plenty of Java-centric jobs out there.
>>2939 So that's what Chobitsu has, ADHD, and can't concentrate to liberate the proper way to teach programming for ten years while feeding young lads to join the proper market? >hating programming because of college classes We're not in complete disagreement, if your reading comprehension is limited. We are both saying colleges don't teach, however, I'm telling him "What are you remotely even doing about it than cite some good books?" He's not changing the landscape, making programming fun to learn, or going to libraries to tutor youth. He's telling you "diy, you should deal with this alone" like every sucker that enrolled to college because reasons. He's not telling you how much ass kissing he had to do to get his current 5 figure job.

Darkweb Exposed Anonymous 06/01/2020 (Mon) 16:44:21 No.2899 [Reply]
"Leaked data contains email addresses, site admin passwords, and .onion domain private keys." Lulz https://www.zdnet.com/article/hacker-leaks-database-of-dark-web-hosting-provider/
Based and Navy pilled.

Open file (17.25 KB 260x178 johnlargent.jpg)
https://usesthis.com/ Anonymous 05/23/2020 (Sat) 23:31:12 No.2859 [Reply]
I found an interesting looking site which interviews people asking them what hardware/software they use for their life/work/projects. The actual website has no JS and is ~300KB Which I know isn't the smallest it could be but it is a breath of fresh air in bloated JS-framework monstrosities. There are some interesting people there that, if your interests overlap with mine, you may want to have a look at. Consider the date of the interview because some are 10 years old. Bram Moolenaar https://usesthis.com/interviews/bram.moolenaar/ This lady who has some godtier taste https://usesthis.com/interviews/alice.maz/ The Prophet himself https://usesthis.com/interviews/terry.davis/ Rob Pike https://usesthis.com/interviews/rob.pike/ Brian Kernighan https://usesthis.com/interviews/brian.kernighan/ Daniel Stenberg https://usesthis.com/interviews/daniel.stenberg/ John Romero https://usesthis.com/interviews/john.romero/ Tarn Adams https://usesthis.com/interviews/tarn.adams/ Eric S Raymond https://usesthis.com/interviews/eric.s.raymond/ Drew DeVault https://usesthis.com/interviews/drew.devault/ Tom Scott https://usesthis.com/interviews/tom.scott/ Russ Cox https://usesthis.com/interviews/russ.cox/ William Gibson https://usesthis.com/interviews/william.gibson/ Daniel Robbins https://usesthis.com/interviews/daniel.robbins/ Aaron Swartz https://usesthis.com/interviews/aaron.swartz/

Message too long. Click here to view full text.

5 posts omitted.
It turns out archive.is is really behind Cloudflare. Should have checked with TBB before posting those archives, sorry. And for a moment I felt happy that there is an archival site without 3rd party elements or javascript required to use and view it. Alas, The Wayback Machine needs them to function.
>>2882 >It turns out archive.is is really behind Cloudflare. Should have checked with TBB before posting those archives, sorry. And for a moment I felt happy that there is an archival site without 3rd party elements or javascript required to use and view it. Alas, The Wayback Machine needs them to function. You don't need js for the wayback machine. view with https://web.archive.org/web/<URL> archive with https://web.archive.org/save/<URL>
>This lady who has some godtier taste You fucking lied to me faggot.
I wish they'd update some of their older interviews.
>>2895-kun, please, refrain from overquoting; it is a bad practice in general, on forums especially. And sage your post if it isn't remotely related to the topic of the thread.

Report/Delete/Moderation Forms
Delete
Report