/t/ - Technology

Discussion of Technology

Index Catalog Archive Bottom Refresh
Options
Subject
Message

Max message length: 12000

files

Max file size: 32.00 MB

Total max file size: 50.00 MB

Max files: 5

Supported file types: GIF, JPG, PNG, WebM, OGG, and more

E-mail
Password

(used to delete files and posts)

Misc

Remember to follow the Rules

The backup domains are located at 8chan.se and 8chan.cc. TOR access can be found here, or you can access the TOR portal from the clearnet at Redchannit 3.0.

US Election Thread

8chan.moe is a hobby project with no affiliation whatsoever to the administration of any other "8chan" site, past or present.

You may also be interested in: AI

Programming Thread: Up and Running Edition Anonymous 04/27/2020 (Mon) 19:03:16 No. 9
Hey Anon, Learn to Code! There's a bunch of free resources for learning to program. Come here to ask for advice or to discuss current projects. Download the complete Gentooman's Library: https://g.sicp.me/books/ Visit MIT OpenCourseware on (((YouTube))) https://www.youtube.com/user/MIT Or take one of these free online courses being offered by universities right now: https://www.freecodecamp.org/news/free-courses-top-cs-universities/
Edited last time by codexx on 05/04/2020 (Mon) 00:54:19.
discrete math a fuckin nightmare from what people have told me
>>7836 ive seen that fucking garbage when I was writing a regex engine and holy shit, its fucking oop but x999999 more retarded, what fucking imbecile comes up with this shit its complete bullshit and the worst way to understand code execution, like yeah wow look a fucking conditional jump look how complicated it is, fucking grow up, its literally just a fucking jump in the code this is what happens when no one understands assembly anymore, computers are super fucking simple, stop creating bullshit complexities that DO NOT EXIST
(31.08 KB 1300x642 state_machine_diagram.png)

>>7854 Are you complaining about the state machines for checking whether a string matches a regex? Like these or pic related? https://en.wikipedia.org/wiki/Nondeterministic_finite_automaton https://en.wikipedia.org/wiki/Deterministic_finite_automaton I thought the whole point of this is that this can be done by something simpler than a computer (Literally a finite state machine). And then other problems like matching parentheses requires a stack
>>7861 yes this is absolute fucking autism lingo for regex directed and text directed matching ie. while ( regex[i++] != '\0' ) { match( regex[i], text ... } while ( text[i++] != '\0' ) { match( text[i], regex[j] ... }
(153.87 KB 446x457 1343800725619893.png)

>>7854 Discrete Math/Theoretical CS is less about computers and computation so much as it is about teaching sophomores how logic works, because otherwise they will spend all of their lives cuntpasting from stackoverflow instead of ever thinking about the machine state. Most kids don't have an understanding of algorithmic problem solving which is agnostic of a specific coding language, and maybe 30% of those I've seen actually shouldn't be there because they will never develop an internally consistent model of how a anything works despite lecturing. "Johnny can't code" stands especially today because many zoomers have spent most of their lives in (web)app-world instead of anywhere close to the machine. >no one understands assembly anymore The same people who went out of their way to learn asm in the 80s and 90s still eventually learn asm now: a small vanguard of auto-diadacts who do so because they wish to program at a low level. You're not wrong, but you are not the intended audience.
>>7863 But isn't that what the regex / text directed matching is doing underneath? It compiles the regex to some representation of the graph, and then tries to match the text to it. The abstraction isn't supposed to help you understand the "code execution." The code execution is derived from the abstraction.
>>7884 no youre a fucking idiot the graph doesnt fucking exist, all engines are fundamentally only doing one fucking thing and thats comparing the current match count with the total required to get a full match its just setting flags for each individual condition in the regex and when all flags are 1 it returns the position and size of the match, heres a simple fucking regex directed sequence for matching literals matchN=strlen(regex); while ( text[t] != '\0' ) { match=0; r=0; while ( regex[r] != '\0' ) { if ( text[t+r] == regex[r++] ) { match++; } else { break; } } printf(";%d;%d\n", t, t+r ); if ( match == matchN ) { return t; } t++; } every other feature is just a different evaluation of the match condition, like lazy quantifiers it would change if ( text[t+r] regex[r++] ) to while( text[t+r] regex[r++] ), or a fucking dot which would change it to if ( text[t+r] != '\0' ) its the same with text-directed but with no backtracking on failure, isntead it just slowly builds a map of the entire text piece by piece getting all permutations of regex[i] at once instead of sequentially and then when you actually compile it and disassembly it you wont even see any loops or fucking state bullshit, just a shit load of xor, not and 'and' because most of theses comparisons can be be done completely branchless using bit operations like xoring the bits of every character to an accumulator and shifting left which would literally tell you every single position of the character in the string without making a single comparison or loop ie. [000010000111000] which are indexes (3,4,5,9) none of youre abstract bullshit is real not on a code level or the physical level inside the actual cpu it has NOTHING in common with reality
<it can be compiled to jumpless bit-fuckery <for my super special regex engine (special like me) <so state machines are not real
(57.13 KB 633x729 011734520943.png)

>>7887 >magic box
>>7887 believe me bro I wrote a lisp compiler in haskell that uses a data flow model to compile with fully automatic paralellization to verilog and runs on FPGA and does everything in O(1). I haven't released it because the CIA might kill me. Quantum is a jew hoax.
>>7901 how hard it is to write a compiler? :0
>>8185 Depends. Is it your own language? How fully-featured do you want it to be? If you just want to write a simple compiler for an easily parsed language then it's not so bad. You could also start with an interpreter first. Here's an example you can follow if you'd like: https://www.youtube.com/watch?v=eF9qWbuQLuw
based
the SICP book is not 10$ :/ ....
Is PajeetScript really that much on demand? I don't wanna use it, but it feels like everyone is telling you to do so.
>>8511 If by PajeetScript you mean Javascript then yes, yes it is if you work in webdev (which is most of programming jobs).
Honestly, I recommend starting with Python or something. >https://automatetheboringstuff.com/#toc
Has anyone ever made a webscrapper for collecting images under a tag/hashtag on twatter/oixiv/some booru? How would you go about doing such?
Bump this awesome thread. I'm learning prog from scratch, whish me luck.
>ctrl + f >"the art of programming" not found contempt.png
Should I try learning Angular, React or Haskell? Been searching for jobs on the internet and I've seen many complement the first two complement a lot with what I work with already (C++, ASP.NET, C#, T-SQL), but Haskell is something that, even though it was only one place that asked for it, calls my attention because apparently it has a different programming structure compared to most programming languages. It could probably turn out to be fairly useful
(42.10 KB 359x480 byte_lisp-2880772885.jpeg)

>>8844 ( (there can be ((only [((one,true)])language)) )
What would be the most appropriate neural network to train with a dataset like this?: id,timestamp B6Q_6XYb5p65QG3,1304474548 iSjl6kmliNfBFoI,1295997524 Uy9oyE2nzJxNWJZ,1256104029 QM5-eotmsdkPhf5,1134644428 4mcrT4f_wtSy_ru,1261067627 Sb4Eg5z12ESarN3,1647054017 WvwKiPE2AvcQFjI,1534320056 ekufrTSThZ3sJNW,1389277113 uJApLEvULs03tf4,1493811764 b4hcxn3qXVA4wd_,1239339894 y1OjJhKRkTSkven,1130146654 JeaF_DMH-fFGS4T,1425254914 KUgf-3FKes1IKQX,1447501927 6CMVPYsPXV7MOET,1298337269 AC3xm_8KCpTWE1i,1396932104 fvDNW4YLRYTzaDK,1537370404 Ni7Bg1tBG17UOLC,1401677745 O-6vRfrO7g6Zqz5,1277357594 37fk5yq9XQrOPFf,1635309809 G7UwXLgnp_PlYZ7,1257546306 The idea is to make a program that, when passing an id that it doesn't know, returns the corresponding timestamp (or an approximate one). Another question I have is, how should I normalize the dataset for training (from what I understand, numerical datasets are normally used)?
Is it really better to study everything from the ground up with these textbooks, or just jump into a tutorial and learn as you go? I feel that the latter is more fun, and fun is the most critical element in learning a skill.
What are some good alternative technology imageboards? This place is slow and I'm tired of 4chan /g/.
>>9456 The ID is randomly generated without a mathematical relationship to the timestamp, or is a hash of the timestamp? If so that's not something suited for AI, as far as I underatand. It'd be like trying to predict the outcome of a die roll based on when the roller woke up that day. You could try though maybe something would happen.
>>9525 soyjak.party/g/
About more than half of the stuff in the /g/ torrent looks to be pretty old man I was just wondering if an anon out there could update it with new stuff
Resources for those that wish to code: https://www.codecademy.com/ https://www.khanacademy.org/ And a good game engine to help you learn programming fundamentals. https://stencyl.com/
>>9560 >soyjak.party/g/ it's no longer a tech board
>>9560 And here I was thinking you couldn't get worse than cuckchan.
I have been adapting the code of https://gitgud.io/LynxChan/LynxChan/-/blob/master/src/be/native/captcha.cpp so that it does not depend on the Node.js API and in fact it compiles without problems, but at the moment of trying to generate an image it returns the following error: terminate called after throwing an instance of 'Magick::ErrorImage' what(): Magick: width or height exceeds limit `#FFFFFFFFFFFF[0]' @ error/cache.c/SetPixelCacheNexusPixels/5053 Aborted From what I could find out, it fails in this line: textImage.distort(Magick::ShepardsDistortion, distortArrayLength, distorts); What could cause this and how do I solve it? It doesn't seem to be a problem with the fonts and I also tested it in two different machines to rule out system problems (although on the other it does not return an error but a black image is generated). The modified code is the following: #include <ctime> #include <Magick++.h> #include <cstring> #include <iostream> #include <fstream> const int width = 300; const int height = 100; const int distortLimiter = 30; const int minDistorts = 3; const int maxDistorts = 5; const int minCircles = 5; const int maxCircles = 10; const int minCircleSize = 15; const int maxCircleSize = 30; const int lineCount = 5; const int minLineWidth = 10; const int maxLineWidth = 20; const double baseDistorts[] = { 0, 0, 0, 0, 0, 100, 0, 100, 300, 0, 300, 0, 300, 100, 300, 100 }; const int baseDistortsLength = 4; int rng(int min, int max) { return min + (rand() % (max - min + 1)); } extern "C" { void buildCaptcha(const std::string& text, const std::string& font, const std::string& filepath, int level) { srand((unsigned) time(0)); Magick::Geometry dimensions(width, height);
[Expand Post] Magick::Image textImage(dimensions, "white"); textImage.fillColor("black"); textImage.font(font); textImage.fontPointsize(70); textImage.annotate(text, MagickCore::CenterGravity); Magick::Image maskImage(dimensions, "white"); if (!level) { const int circleCount = rng(minCircles, maxCircles); for (int i = 0; i < circleCount; i++) { const int startX = rng(width * 0.1, width * 0.9); const int startY = rng(height * 0.1, height * 0.9); const int size = rng(minCircleSize, maxCircleSize); maskImage.draw( Magick::DrawableCircle(startX, startY, rng(startX, startX + size), rng(startY, startY + size))); } } else { int lineOffSet = rng(-maxLineWidth, maxLineWidth) / level; for (int i = 0; i < lineCount * level; i++) { const int lineWidth = rng(minLineWidth, maxLineWidth) / level; maskImage.draw( Magick::DrawableRectangle(0, lineOffSet, width, lineWidth + lineOffSet)); lineOffSet += rng(minLineWidth, maxLineWidth) / level + lineWidth; } } textImage.composite(maskImage, 0, 0, Magick::DifferenceCompositeOp); textImage.negate(); const int distortCount = rng(minDistorts, maxDistorts); const int distortArrayLength = (distortCount + baseDistortsLength) * 4; double distorts[distortArrayLength]; memcpy(distorts, baseDistorts, baseDistortsLength * 4 * sizeof(double)); const double portionSize = width / distortCount; for (int i = 0; i < distortCount; i++) { const int distortOriginX = rng(portionSize * i, portionSize * (1 + i)); const int distortOriginY = rng(0, height); const int offset = (baseDistortsLength + i) * 4; distorts[offset] = distortOriginX; distorts[offset + 1] = distortOriginY; distorts[offset + 2] = rng(distortOriginX - distortLimiter, distortOriginX + distortLimiter); distorts[offset + 3] = rng(distortOriginY - distortLimiter, distortOriginY + distortLimiter); } textImage.distort(Magick::ShepardsDistortion, distortArrayLength, distorts); textImage.blur(0, 1); textImage.magick("JPEG"); textImage.write(filepath); } } int main() { // Example parameters, font and captcha_path must be valid file paths std::string text = "o9sd8f"; std::string font = "/usr/share/fonts/dejavu/DejaVuSans.ttf"; std::string captcha_path = "captcha.jpg"; int level = 2; buildCaptcha(text, font, captcha_path, level); std::cout << "Captcha generated and saved in " << captcha_path << std::endl; return 0; } And this is the command I used to compile it: g++ -o captcha-standalone -fPIC captcha-standalone.cpp -I/usr/include/ImageMagick-7 `Magick++-config --cxxflags --cppflags --ldflags --libs`
>>9456 Why would you use a neural network for this? Is there even any relation in your dataset between ID and timestamp? Garbage in - garbage out.
>>12088 >What could cause this and how do I solve it? Some of the math is probably blowing up. Debug it to see where the problem is and inspect the values, or if you don't know how that then add logs to the same extent.
>try to learn Qt for a project >still shaky on C++, but I can make do >try to figure out how to properly exit the main loop >qt example just does QCoreApplication::quit() in some unrelated class >wut >read through documentation again >public slot: void QCoreAppliction::quit() blah blah blah and a few tips to make sure it works >no mention of why you can access it from somewhere else without even referring to the object >wonder if this is some Qt specific bullshittery >fruitlessly try to research the issue >check the implementation of quit >nope, it's just a three line call to exit() >keep researching, still nothing >decide to check the header file >public slots: static void quit() <DSP_woooow.webm >later realize the documentation does include the static part, as a small, hard to notice comment on the side


Forms
Delete
Report
Quick Reply